@indico-data/design-system 2.60.11 → 2.60.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/tanstackTable/docs/internalSorting/InternalClientSideSorting.stories.d.ts +7 -0
- package/lib/index.css +3 -0
- package/lib/index.esm.css +3 -0
- package/lib/index.esm.js +4 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +4 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/tanstackTable/TanstackTable.tsx +12 -2
- package/src/components/tanstackTable/docs/internalSorting/InternalClientSideSorting.mdx +31 -0
- package/src/components/tanstackTable/docs/internalSorting/InternalClientSideSorting.stories.tsx +71 -0
- package/src/components/tanstackTable/styles/table.scss +8 -0
package/lib/index.js
CHANGED
|
@@ -41492,6 +41492,8 @@ function TanstackTable(_a) {
|
|
|
41492
41492
|
setRowSelection, formattedColumns, setFormattedColumns, } = useTanstackTable({
|
|
41493
41493
|
defaultColumns,
|
|
41494
41494
|
});
|
|
41495
|
+
// handles internal sorting state.
|
|
41496
|
+
const [sorting, setSorting] = React.useState([]);
|
|
41495
41497
|
const thRefs = React.useRef({});
|
|
41496
41498
|
// Auto-compute column widths based on current table header cell widths for columns without a defined size.
|
|
41497
41499
|
React.useEffect(() => {
|
|
@@ -41506,7 +41508,8 @@ function TanstackTable(_a) {
|
|
|
41506
41508
|
}, [data, columns, windowWidth]);
|
|
41507
41509
|
const table = useReactTable(Object.assign(Object.assign({}, rest), { data: data !== null && data !== void 0 ? data : defaultData, columns: formattedColumns, state: {
|
|
41508
41510
|
rowSelection,
|
|
41509
|
-
|
|
41511
|
+
sorting,
|
|
41512
|
+
}, enableRowSelection, onRowSelectionChange: setRowSelection, getCoreRowModel: getCoreRowModel(), getSortedRowModel: getSortedRowModel(), onSortingChange: setSorting, manualPagination: true, getRowId: (row) => row === null || row === void 0 ? void 0 : row.id, initialState: {
|
|
41510
41513
|
columnPinning: {
|
|
41511
41514
|
left: defaultPinnedColumns,
|
|
41512
41515
|
},
|