| 32 | changeDetection: ChangeDetectionStrategy.OnPush, |
| 33 | }) |
| 34 | export class AppComponent { |
| 35 | private readonly rowSelection = signal<RowSelectionState>({}) |
| 36 | readonly globalFilter = signal<string>('') |
| 37 | readonly data = signal(makeData(10_000)) |
| 38 | |
| 39 | readonly ageHeaderCell = |
| 40 | viewChild.required<TemplateRef<unknown>>('ageHeaderCell') |
| 41 | |
| 42 | readonly columns: ColumnDef<Person>[] = [ |
| 43 | { |
| 44 | id: 'select', |
| 45 | header: () => { |
| 46 | return flexRenderComponent(TableHeadSelectionComponent) |
| 47 | }, |
| 48 | cell: () => { |
| 49 | return flexRenderComponent(TableRowSelectionComponent) |
| 50 | }, |
| 51 | }, |
| 52 | { |
| 53 | header: 'Name', |
| 54 | footer: props => props.column.id, |
| 55 | columns: [ |
| 56 | { |
| 57 | accessorKey: 'firstName', |
| 58 | cell: info => info.getValue(), |
| 59 | footer: props => props.column.id, |
| 60 | header: 'First name', |
| 61 | }, |
| 62 | { |
| 63 | accessorFn: row => row.lastName, |
| 64 | id: 'lastName', |
| 65 | cell: info => info.getValue(), |
| 66 | header: () => 'Last Name', |
| 67 | footer: props => props.column.id, |
| 68 | }, |
| 69 | ], |
| 70 | }, |
| 71 | { |
| 72 | header: 'Info', |
| 73 | footer: props => props.column.id, |
| 74 | columns: [ |
| 75 | { |
| 76 | accessorKey: 'age', |
| 77 | header: () => this.ageHeaderCell(), |
| 78 | footer: props => props.column.id, |
| 79 | }, |
| 80 | { |
| 81 | header: 'More Info', |
| 82 | columns: [ |
| 83 | { |
| 84 | accessorKey: 'visits', |
| 85 | header: () => 'Visits', |
| 86 | footer: props => props.column.id, |
| 87 | }, |
| 88 | { |
| 89 | accessorKey: 'status', |
| 90 | header: 'Status', |
| 91 | footer: props => props.column.id, |
nothing calls this directly
no test coverage detected
searching dependent graphs…