({
options = {},
})
| 101 | ] |
| 102 | |
| 103 | const TableComponent: FC<{ options?: Partial<TableOptions<Person>> }> = ({ |
| 104 | options = {}, |
| 105 | }) => { |
| 106 | const table = useReactTable({ |
| 107 | data: defaultData, |
| 108 | columns: defaultColumns, |
| 109 | getCoreRowModel: getCoreRowModel(), |
| 110 | ...options, |
| 111 | }) |
| 112 | |
| 113 | return ( |
| 114 | <table> |
| 115 | <thead> |
| 116 | {table.getHeaderGroups().map(headerGroup => ( |
| 117 | <tr key={headerGroup.id}> |
| 118 | {headerGroup.headers.map(header => ( |
| 119 | <th key={header.id} colSpan={header.colSpan}> |
| 120 | {header.isPlaceholder |
| 121 | ? null |
| 122 | : flexRender( |
| 123 | header.column.columnDef.header, |
| 124 | header.getContext() |
| 125 | )} |
| 126 | </th> |
| 127 | ))} |
| 128 | </tr> |
| 129 | ))} |
| 130 | </thead> |
| 131 | <tbody> |
| 132 | {table.getRowModel().rows.map(row => ( |
| 133 | <tr key={row.id}> |
| 134 | {row.getVisibleCells().map(cell => ( |
| 135 | <td key={cell.id}> |
| 136 | {flexRender(cell.column.columnDef.cell, cell.getContext())} |
| 137 | </td> |
| 138 | ))} |
| 139 | </tr> |
| 140 | ))} |
| 141 | </tbody> |
| 142 | </table> |
| 143 | ) |
| 144 | } |
| 145 | |
| 146 | test(`Select all do not select rows which are not available for selection`, () => { |
| 147 | render( |
nothing calls this directly
no test coverage detected
searching dependent graphs…