@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/components/tanstackTable/docs/internalSorting/InternalClientSideSorting.stories.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { TanstackTable } from '../../TanstackTable';
|
|
3
|
+
import { Person } from '../../mock-data/mock-data';
|
|
4
|
+
declare const meta: Meta;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof TanstackTable<Person>>;
|
|
7
|
+
export declare const InternalClientSideSorting: Story;
|
package/lib/index.css
CHANGED
|
@@ -2326,6 +2326,9 @@ body div[class*=select__single-value] {
|
|
|
2326
2326
|
border-radius: var(--pf-rounded-lg);
|
|
2327
2327
|
width: 100%;
|
|
2328
2328
|
}
|
|
2329
|
+
.tanstack-table__tbody tr td {
|
|
2330
|
+
padding: var(--pf-padding-2) var(--pf-padding-3);
|
|
2331
|
+
}
|
|
2329
2332
|
.tanstack-table.is-striped .tanstack-table__tbody tr:nth-child(odd) td {
|
|
2330
2333
|
background-color: var(--pf-tanstack-table-stripe-color);
|
|
2331
2334
|
}
|
package/lib/index.esm.css
CHANGED
|
@@ -2326,6 +2326,9 @@ body div[class*=select__single-value] {
|
|
|
2326
2326
|
border-radius: var(--pf-rounded-lg);
|
|
2327
2327
|
width: 100%;
|
|
2328
2328
|
}
|
|
2329
|
+
.tanstack-table__tbody tr td {
|
|
2330
|
+
padding: var(--pf-padding-2) var(--pf-padding-3);
|
|
2331
|
+
}
|
|
2329
2332
|
.tanstack-table.is-striped .tanstack-table__tbody tr:nth-child(odd) td {
|
|
2330
2333
|
background-color: var(--pf-tanstack-table-stripe-color);
|
|
2331
2334
|
}
|
package/lib/index.esm.js
CHANGED
|
@@ -41467,6 +41467,8 @@ function TanstackTable(_a) {
|
|
|
41467
41467
|
setRowSelection, formattedColumns, setFormattedColumns, } = useTanstackTable({
|
|
41468
41468
|
defaultColumns,
|
|
41469
41469
|
});
|
|
41470
|
+
// handles internal sorting state.
|
|
41471
|
+
const [sorting, setSorting] = useState([]);
|
|
41470
41472
|
const thRefs = useRef({});
|
|
41471
41473
|
// Auto-compute column widths based on current table header cell widths for columns without a defined size.
|
|
41472
41474
|
useEffect(() => {
|
|
@@ -41481,7 +41483,8 @@ function TanstackTable(_a) {
|
|
|
41481
41483
|
}, [data, columns, windowWidth]);
|
|
41482
41484
|
const table = useReactTable(Object.assign(Object.assign({}, rest), { data: data !== null && data !== void 0 ? data : defaultData, columns: formattedColumns, state: {
|
|
41483
41485
|
rowSelection,
|
|
41484
|
-
|
|
41486
|
+
sorting,
|
|
41487
|
+
}, enableRowSelection, onRowSelectionChange: setRowSelection, getCoreRowModel: getCoreRowModel(), getSortedRowModel: getSortedRowModel(), onSortingChange: setSorting, manualPagination: true, getRowId: (row) => row === null || row === void 0 ? void 0 : row.id, initialState: {
|
|
41485
41488
|
columnPinning: {
|
|
41486
41489
|
left: defaultPinnedColumns,
|
|
41487
41490
|
},
|