()
| 17 | } from '@tanstack/react-table' |
| 18 | |
| 19 | function App() { |
| 20 | const rerender = React.useReducer(() => ({}), {})[1] |
| 21 | |
| 22 | const [rowSelection, setRowSelection] = React.useState({}) |
| 23 | const [globalFilter, setGlobalFilter] = React.useState('') |
| 24 | |
| 25 | const columns = React.useMemo<ColumnDef<Person>[]>( |
| 26 | () => [ |
| 27 | { |
| 28 | id: 'select', |
| 29 | header: ({ table }) => ( |
| 30 | <IndeterminateCheckbox |
| 31 | {...{ |
| 32 | checked: table.getIsAllRowsSelected(), |
| 33 | indeterminate: table.getIsSomeRowsSelected(), |
| 34 | onChange: table.getToggleAllRowsSelectedHandler(), |
| 35 | }} |
| 36 | /> |
| 37 | ), |
| 38 | cell: ({ row }) => ( |
| 39 | <div className="px-1"> |
| 40 | <IndeterminateCheckbox |
| 41 | {...{ |
| 42 | checked: row.getIsSelected(), |
| 43 | disabled: !row.getCanSelect(), |
| 44 | indeterminate: row.getIsSomeSelected(), |
| 45 | onChange: row.getToggleSelectedHandler(), |
| 46 | }} |
| 47 | /> |
| 48 | </div> |
| 49 | ), |
| 50 | }, |
| 51 | { |
| 52 | header: 'Name', |
| 53 | footer: (props) => props.column.id, |
| 54 | columns: [ |
| 55 | { |
| 56 | accessorKey: 'firstName', |
| 57 | cell: (info) => info.getValue(), |
| 58 | footer: (props) => props.column.id, |
| 59 | }, |
| 60 | { |
| 61 | accessorFn: (row) => row.lastName, |
| 62 | id: 'lastName', |
| 63 | cell: (info) => info.getValue(), |
| 64 | header: () => <span>Last Name</span>, |
| 65 | footer: (props) => props.column.id, |
| 66 | }, |
| 67 | ], |
| 68 | }, |
| 69 | { |
| 70 | header: 'Info', |
| 71 | footer: (props) => props.column.id, |
| 72 | columns: [ |
| 73 | { |
| 74 | accessorKey: 'age', |
| 75 | header: () => 'Age', |
| 76 | footer: (props) => props.column.id, |
nothing calls this directly
no test coverage detected