Files
familytree/UI/src/app/pickperson/pickperson.ts
T
2026-09-20 23:07:32 +10:00

54 lines
1.6 KiB
TypeScript

import { CommonModule } from '@angular/common';
import { Component, OnDestroy, OnInit, signal, ViewChild } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { Table, TableModule } from '@openng/optimus-ui/table';
import { Person } from '../models';
import { IconFieldModule } from '@openng/optimus-ui/iconfield';
import { InputIconModule } from '@openng/optimus-ui/inputicon';
import { DynamicDialogConfig, DynamicDialogRef } from '@openng/optimus-ui/dynamicdialog';
import { ButtonModule } from '@openng/optimus-ui/button';
import { InputTextModule } from '@openng/optimus-ui/inputtext';
@Component({
selector: 'app-pickperson',
imports: [TableModule, ButtonModule,CommonModule, InputTextModule, FormsModule,IconFieldModule,InputIconModule],
templateUrl: './pickperson.html',
styleUrl: './pickperson.css'
})
export class Pickperson implements OnInit, OnDestroy{
@ViewChild(Table) dt2!: Table;
constructor(public ref: DynamicDialogRef, public config: DynamicDialogConfig)
{
}
loading = false;
familyList = signal<Person[]>([]);
selectedPerson!: Person;
handleInput(event: Event) {
const value = (event.target as HTMLInputElement).value;
this.dt2.filterGlobal(value, 'contains');
}
edit(id: number): void {
}
cancel(e:Event):void {
e.preventDefault();
this.ref.close(null);
}
select(e:Event):void {
e.preventDefault();
this.ref.close(this.selectedPerson);
}
ngOnDestroy(): void {
}
ngOnInit(): void {
console.log("pick person the familyList", this.config);
this.familyList.set(this.config.data.familyList);
}
}