@trackunit/react-table 2.1.3 → 2.1.4
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/index.cjs.js +55 -81
- package/index.esm.js +55 -81
- package/package.json +9 -9
package/index.cjs.js
CHANGED
|
@@ -1389,7 +1389,6 @@ const useColumnHelper = () => {
|
|
|
1389
1389
|
}, []);
|
|
1390
1390
|
};
|
|
1391
1391
|
|
|
1392
|
-
const VISIBLE_ONLY_COLUMN_VISIBILITY_KEY = "__trackunitVisibleOnlyColumnVisibility";
|
|
1393
1392
|
const computeMergedPinning = (initialPinning, columnConfigPinning) => {
|
|
1394
1393
|
const leftPinning = initialPinning?.left;
|
|
1395
1394
|
const mergedLeft = leftPinning !== undefined && leftPinning.length > 0 ? [...leftPinning] : [...(columnConfigPinning.left ?? [])];
|
|
@@ -1448,7 +1447,7 @@ const useTable = ({ onTableStateChange, initialState, columns, ...reactTableProp
|
|
|
1448
1447
|
const updatedInitialColumnVisibility = react.useMemo(() => {
|
|
1449
1448
|
const columnsList = JSON.parse(stableColumns);
|
|
1450
1449
|
const initialStateColumnVisibility = initialState?.columnVisibility;
|
|
1451
|
-
const shouldHideColumnsMissingFromInitialVisibility = initialStateColumnVisibility?.[VISIBLE_ONLY_COLUMN_VISIBILITY_KEY] === true;
|
|
1450
|
+
const shouldHideColumnsMissingFromInitialVisibility = initialStateColumnVisibility?.[sharedUtils.VISIBLE_ONLY_COLUMN_VISIBILITY_KEY] === true;
|
|
1452
1451
|
const resultFromInitialState = initialStateColumnVisibility
|
|
1453
1452
|
? Object.fromEntries(columnsList
|
|
1454
1453
|
.map((column) => {
|
|
@@ -1507,63 +1506,43 @@ const useTable = ({ onTableStateChange, initialState, columns, ...reactTableProp
|
|
|
1507
1506
|
})
|
|
1508
1507
|
.filter(sharedUtils.nonNullable));
|
|
1509
1508
|
}, [stableColumns, reactTableProps.defaultColumn?.size]);
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
columnOrder: updatedInitialColumnOrder,
|
|
1523
|
-
sorting: initialState.sorting || [],
|
|
1524
|
-
columnSizing: initialState.columnSizing || {},
|
|
1525
|
-
}));
|
|
1509
|
+
// In-session, user-driven edits. Populated ONLY from the table change callbacks below (real
|
|
1510
|
+
// user events), never from props or effects. Every other value is derived from props on each
|
|
1511
|
+
// render, so async data arrival — saved preferences resolving, custom-field columns appearing
|
|
1512
|
+
// — flows through automatically without any prop-syncing effects.
|
|
1513
|
+
const [userEdits, setUserEdits] = react.useState({});
|
|
1514
|
+
const columnVisibility = react.useMemo(() => userEdits.columnVisibility
|
|
1515
|
+
? { ...updatedInitialColumnVisibility, ...userEdits.columnVisibility }
|
|
1516
|
+
: updatedInitialColumnVisibility, [updatedInitialColumnVisibility, userEdits.columnVisibility]);
|
|
1517
|
+
const columnOrder = react.useMemo(() => {
|
|
1518
|
+
const userOrder = userEdits.columnOrder;
|
|
1519
|
+
if (!userOrder) {
|
|
1520
|
+
return updatedInitialColumnOrder;
|
|
1526
1521
|
}
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1522
|
+
// Keep the user's chosen order, then append any columns that arrived afterwards (e.g. async
|
|
1523
|
+
// custom fields) so newly-loaded columns are never dropped from the table.
|
|
1524
|
+
const appended = updatedInitialColumnOrder.filter(columnId => !userOrder.includes(columnId));
|
|
1525
|
+
return appended.length > 0 ? [...userOrder, ...appended] : userOrder;
|
|
1526
|
+
}, [updatedInitialColumnOrder, userEdits.columnOrder]);
|
|
1527
|
+
const columnPinning = react.useMemo(() => userEdits.columnPinning ?? computeMergedPinning(initialState?.columnPinning, stableUpdatedInitialColumnPinning), [userEdits.columnPinning, initialState?.columnPinning, stableUpdatedInitialColumnPinning]);
|
|
1528
|
+
const sorting = react.useMemo(() => userEdits.sorting ?? initialState?.sorting ?? [], [userEdits.sorting, initialState?.sorting]);
|
|
1529
|
+
const columnSizing = react.useMemo(() => userEdits.columnSizing ?? initialState?.columnSizing ?? {}, [userEdits.columnSizing, initialState?.columnSizing]);
|
|
1530
|
+
const baseState = react.useMemo(() => ({ columnVisibility, columnOrder, sorting, columnSizing, columnPinning }), [columnVisibility, columnOrder, sorting, columnSizing, columnPinning]);
|
|
1531
|
+
const state = react.useMemo(() => ({ ...baseState, ...reactTableProps.state }), [baseState, reactTableProps.state]);
|
|
1532
|
+
// A ref exposes the latest derived state to the change callbacks without making them depend on
|
|
1533
|
+
// it (callbacks run on user events, outside render). Every column-state key on `state` is always
|
|
1534
|
+
// defined — it originates from `baseState` — so the callbacks read it directly.
|
|
1535
|
+
const stateRef = react.useRef(state);
|
|
1536
|
+
stateRef.current = state;
|
|
1537
|
+
// Persist on user actions only (not on mount or prop-driven recomputation): drop column sizes
|
|
1538
|
+
// that match their default so only meaningful overrides are stored.
|
|
1539
|
+
const persistTableState = react.useCallback((nextState) => {
|
|
1540
|
+
if (!onTableStateChange) {
|
|
1530
1541
|
return;
|
|
1531
1542
|
}
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
if (missingColumnOrder.length === 0 && sharedUtils.objectKeys(missingColumnVisibility).length === 0) {
|
|
1536
|
-
return prev;
|
|
1537
|
-
}
|
|
1538
|
-
return {
|
|
1539
|
-
...prev,
|
|
1540
|
-
columnOrder: [...prev.columnOrder, ...missingColumnOrder],
|
|
1541
|
-
columnVisibility: {
|
|
1542
|
-
...prev.columnVisibility,
|
|
1543
|
-
...missingColumnVisibility,
|
|
1544
|
-
},
|
|
1545
|
-
};
|
|
1546
|
-
});
|
|
1547
|
-
}, [initialState, updatedInitialColumnOrder, updatedInitialColumnVisibility]);
|
|
1548
|
-
react.useEffect(() => {
|
|
1549
|
-
setColumnState(prev => ({
|
|
1550
|
-
...prev,
|
|
1551
|
-
columnPinning: computeMergedPinning(initialState?.columnPinning, stableUpdatedInitialColumnPinning),
|
|
1552
|
-
}));
|
|
1553
|
-
}, [initialState?.columnPinning, stableUpdatedInitialColumnPinning]);
|
|
1554
|
-
const state = react.useMemo(() => {
|
|
1555
|
-
return {
|
|
1556
|
-
...columnState,
|
|
1557
|
-
...reactTableProps.state,
|
|
1558
|
-
};
|
|
1559
|
-
}, [columnState, reactTableProps.state]);
|
|
1560
|
-
const stateForTableStateChange = react.useMemo(() => {
|
|
1561
|
-
const columnSizing = Object.fromEntries(Object.entries(state.columnSizing).filter(([columnId, size]) => defaultColumnSizingById[columnId] !== size));
|
|
1562
|
-
return {
|
|
1563
|
-
...state,
|
|
1564
|
-
columnSizing,
|
|
1565
|
-
};
|
|
1566
|
-
}, [defaultColumnSizingById, state]);
|
|
1543
|
+
const columnSizingToPersist = Object.fromEntries(Object.entries(nextState.columnSizing ?? {}).filter(([columnId, size]) => defaultColumnSizingById[columnId] !== size));
|
|
1544
|
+
onTableStateChange({ ...nextState, columnSizing: columnSizingToPersist });
|
|
1545
|
+
}, [onTableStateChange, defaultColumnSizingById]);
|
|
1567
1546
|
const table = reactTable.useReactTable({
|
|
1568
1547
|
manualSorting: true,
|
|
1569
1548
|
enableSortingRemoval: true,
|
|
@@ -1572,48 +1551,43 @@ const useTable = ({ onTableStateChange, initialState, columns, ...reactTableProp
|
|
|
1572
1551
|
getCoreRowModel: reactTable.getCoreRowModel(),
|
|
1573
1552
|
...reactTableProps,
|
|
1574
1553
|
onColumnVisibilityChange: value => {
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
})
|
|
1554
|
+
const current = stateRef.current.columnVisibility;
|
|
1555
|
+
const next = typeof value === "function" ? value(current) : value;
|
|
1556
|
+
setUserEdits(prev => ({ ...prev, columnVisibility: next }));
|
|
1557
|
+
persistTableState({ ...stateRef.current, columnVisibility: next });
|
|
1579
1558
|
reactTableProps.onColumnVisibilityChange?.(value);
|
|
1580
1559
|
},
|
|
1581
1560
|
onColumnSizingChange: value => {
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
})
|
|
1561
|
+
const current = stateRef.current.columnSizing;
|
|
1562
|
+
const next = typeof value === "function" ? value(current) : value;
|
|
1563
|
+
setUserEdits(prev => ({ ...prev, columnSizing: next }));
|
|
1564
|
+
persistTableState({ ...stateRef.current, columnSizing: next });
|
|
1586
1565
|
reactTableProps.onColumnSizingChange?.(value);
|
|
1587
1566
|
},
|
|
1588
1567
|
onColumnOrderChange: value => {
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
})
|
|
1568
|
+
const current = stateRef.current.columnOrder;
|
|
1569
|
+
const next = typeof value === "function" ? value(current) : value;
|
|
1570
|
+
setUserEdits(prev => ({ ...prev, columnOrder: next }));
|
|
1571
|
+
persistTableState({ ...stateRef.current, columnOrder: next });
|
|
1593
1572
|
reactTableProps.onColumnOrderChange?.(value);
|
|
1594
1573
|
},
|
|
1595
1574
|
onSortingChange: value => {
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
})
|
|
1575
|
+
const current = stateRef.current.sorting;
|
|
1576
|
+
const next = typeof value === "function" ? value(current) : value;
|
|
1577
|
+
setUserEdits(prev => ({ ...prev, sorting: next }));
|
|
1578
|
+
persistTableState({ ...stateRef.current, sorting: next });
|
|
1600
1579
|
reactTableProps.onSortingChange?.(value);
|
|
1601
1580
|
},
|
|
1602
1581
|
onColumnPinningChange: value => {
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
})
|
|
1582
|
+
const current = stateRef.current.columnPinning;
|
|
1583
|
+
const next = typeof value === "function" ? value(current) : value;
|
|
1584
|
+
setUserEdits(prev => ({ ...prev, columnPinning: next }));
|
|
1585
|
+
persistTableState({ ...stateRef.current, columnPinning: next });
|
|
1607
1586
|
reactTableProps.onColumnPinningChange?.(value);
|
|
1608
1587
|
},
|
|
1609
1588
|
columns,
|
|
1610
1589
|
state,
|
|
1611
1590
|
});
|
|
1612
|
-
react.useEffect(() => {
|
|
1613
|
-
if (onTableStateChange) {
|
|
1614
|
-
onTableStateChange(stateForTableStateChange);
|
|
1615
|
-
}
|
|
1616
|
-
}, [onTableStateChange, stateForTableStateChange]);
|
|
1617
1591
|
return react.useMemo(() => {
|
|
1618
1592
|
return { table };
|
|
1619
1593
|
}, [table]);
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { registerTranslations, useNamespaceTranslation, NamespaceTrans } from '@trackunit/i18n-library-translation';
|
|
3
3
|
import { MenuItem, Icon, Button, Tooltip, useOverflowItems, MoreMenu, MenuList, Spacer, cvaInteractableItem, Text, Popover, PopoverTrigger, IconButton, PopoverContent, useBidirectionalScroll, noPagination, Card, Spinner, EmptyState } from '@trackunit/react-components';
|
|
4
|
-
import { objectValues, nonNullable, objectKeys, objectEntries } from '@trackunit/shared-utils';
|
|
4
|
+
import { objectValues, VISIBLE_ONLY_COLUMN_VISIBILITY_KEY, nonNullable, objectKeys, objectEntries } from '@trackunit/shared-utils';
|
|
5
5
|
import { useMemo, Children, cloneElement, useRef, useState, useCallback, useEffect, createElement } from 'react';
|
|
6
6
|
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
7
7
|
import { Link } from '@tanstack/react-router';
|
|
@@ -1388,7 +1388,6 @@ const useColumnHelper = () => {
|
|
|
1388
1388
|
}, []);
|
|
1389
1389
|
};
|
|
1390
1390
|
|
|
1391
|
-
const VISIBLE_ONLY_COLUMN_VISIBILITY_KEY = "__trackunitVisibleOnlyColumnVisibility";
|
|
1392
1391
|
const computeMergedPinning = (initialPinning, columnConfigPinning) => {
|
|
1393
1392
|
const leftPinning = initialPinning?.left;
|
|
1394
1393
|
const mergedLeft = leftPinning !== undefined && leftPinning.length > 0 ? [...leftPinning] : [...(columnConfigPinning.left ?? [])];
|
|
@@ -1506,63 +1505,43 @@ const useTable = ({ onTableStateChange, initialState, columns, ...reactTableProp
|
|
|
1506
1505
|
})
|
|
1507
1506
|
.filter(nonNullable));
|
|
1508
1507
|
}, [stableColumns, reactTableProps.defaultColumn?.size]);
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
columnOrder: updatedInitialColumnOrder,
|
|
1522
|
-
sorting: initialState.sorting || [],
|
|
1523
|
-
columnSizing: initialState.columnSizing || {},
|
|
1524
|
-
}));
|
|
1508
|
+
// In-session, user-driven edits. Populated ONLY from the table change callbacks below (real
|
|
1509
|
+
// user events), never from props or effects. Every other value is derived from props on each
|
|
1510
|
+
// render, so async data arrival — saved preferences resolving, custom-field columns appearing
|
|
1511
|
+
// — flows through automatically without any prop-syncing effects.
|
|
1512
|
+
const [userEdits, setUserEdits] = useState({});
|
|
1513
|
+
const columnVisibility = useMemo(() => userEdits.columnVisibility
|
|
1514
|
+
? { ...updatedInitialColumnVisibility, ...userEdits.columnVisibility }
|
|
1515
|
+
: updatedInitialColumnVisibility, [updatedInitialColumnVisibility, userEdits.columnVisibility]);
|
|
1516
|
+
const columnOrder = useMemo(() => {
|
|
1517
|
+
const userOrder = userEdits.columnOrder;
|
|
1518
|
+
if (!userOrder) {
|
|
1519
|
+
return updatedInitialColumnOrder;
|
|
1525
1520
|
}
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1521
|
+
// Keep the user's chosen order, then append any columns that arrived afterwards (e.g. async
|
|
1522
|
+
// custom fields) so newly-loaded columns are never dropped from the table.
|
|
1523
|
+
const appended = updatedInitialColumnOrder.filter(columnId => !userOrder.includes(columnId));
|
|
1524
|
+
return appended.length > 0 ? [...userOrder, ...appended] : userOrder;
|
|
1525
|
+
}, [updatedInitialColumnOrder, userEdits.columnOrder]);
|
|
1526
|
+
const columnPinning = useMemo(() => userEdits.columnPinning ?? computeMergedPinning(initialState?.columnPinning, stableUpdatedInitialColumnPinning), [userEdits.columnPinning, initialState?.columnPinning, stableUpdatedInitialColumnPinning]);
|
|
1527
|
+
const sorting = useMemo(() => userEdits.sorting ?? initialState?.sorting ?? [], [userEdits.sorting, initialState?.sorting]);
|
|
1528
|
+
const columnSizing = useMemo(() => userEdits.columnSizing ?? initialState?.columnSizing ?? {}, [userEdits.columnSizing, initialState?.columnSizing]);
|
|
1529
|
+
const baseState = useMemo(() => ({ columnVisibility, columnOrder, sorting, columnSizing, columnPinning }), [columnVisibility, columnOrder, sorting, columnSizing, columnPinning]);
|
|
1530
|
+
const state = useMemo(() => ({ ...baseState, ...reactTableProps.state }), [baseState, reactTableProps.state]);
|
|
1531
|
+
// A ref exposes the latest derived state to the change callbacks without making them depend on
|
|
1532
|
+
// it (callbacks run on user events, outside render). Every column-state key on `state` is always
|
|
1533
|
+
// defined — it originates from `baseState` — so the callbacks read it directly.
|
|
1534
|
+
const stateRef = useRef(state);
|
|
1535
|
+
stateRef.current = state;
|
|
1536
|
+
// Persist on user actions only (not on mount or prop-driven recomputation): drop column sizes
|
|
1537
|
+
// that match their default so only meaningful overrides are stored.
|
|
1538
|
+
const persistTableState = useCallback((nextState) => {
|
|
1539
|
+
if (!onTableStateChange) {
|
|
1529
1540
|
return;
|
|
1530
1541
|
}
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
if (missingColumnOrder.length === 0 && objectKeys(missingColumnVisibility).length === 0) {
|
|
1535
|
-
return prev;
|
|
1536
|
-
}
|
|
1537
|
-
return {
|
|
1538
|
-
...prev,
|
|
1539
|
-
columnOrder: [...prev.columnOrder, ...missingColumnOrder],
|
|
1540
|
-
columnVisibility: {
|
|
1541
|
-
...prev.columnVisibility,
|
|
1542
|
-
...missingColumnVisibility,
|
|
1543
|
-
},
|
|
1544
|
-
};
|
|
1545
|
-
});
|
|
1546
|
-
}, [initialState, updatedInitialColumnOrder, updatedInitialColumnVisibility]);
|
|
1547
|
-
useEffect(() => {
|
|
1548
|
-
setColumnState(prev => ({
|
|
1549
|
-
...prev,
|
|
1550
|
-
columnPinning: computeMergedPinning(initialState?.columnPinning, stableUpdatedInitialColumnPinning),
|
|
1551
|
-
}));
|
|
1552
|
-
}, [initialState?.columnPinning, stableUpdatedInitialColumnPinning]);
|
|
1553
|
-
const state = useMemo(() => {
|
|
1554
|
-
return {
|
|
1555
|
-
...columnState,
|
|
1556
|
-
...reactTableProps.state,
|
|
1557
|
-
};
|
|
1558
|
-
}, [columnState, reactTableProps.state]);
|
|
1559
|
-
const stateForTableStateChange = useMemo(() => {
|
|
1560
|
-
const columnSizing = Object.fromEntries(Object.entries(state.columnSizing).filter(([columnId, size]) => defaultColumnSizingById[columnId] !== size));
|
|
1561
|
-
return {
|
|
1562
|
-
...state,
|
|
1563
|
-
columnSizing,
|
|
1564
|
-
};
|
|
1565
|
-
}, [defaultColumnSizingById, state]);
|
|
1542
|
+
const columnSizingToPersist = Object.fromEntries(Object.entries(nextState.columnSizing ?? {}).filter(([columnId, size]) => defaultColumnSizingById[columnId] !== size));
|
|
1543
|
+
onTableStateChange({ ...nextState, columnSizing: columnSizingToPersist });
|
|
1544
|
+
}, [onTableStateChange, defaultColumnSizingById]);
|
|
1566
1545
|
const table = useReactTable({
|
|
1567
1546
|
manualSorting: true,
|
|
1568
1547
|
enableSortingRemoval: true,
|
|
@@ -1571,48 +1550,43 @@ const useTable = ({ onTableStateChange, initialState, columns, ...reactTableProp
|
|
|
1571
1550
|
getCoreRowModel: getCoreRowModel(),
|
|
1572
1551
|
...reactTableProps,
|
|
1573
1552
|
onColumnVisibilityChange: value => {
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
})
|
|
1553
|
+
const current = stateRef.current.columnVisibility;
|
|
1554
|
+
const next = typeof value === "function" ? value(current) : value;
|
|
1555
|
+
setUserEdits(prev => ({ ...prev, columnVisibility: next }));
|
|
1556
|
+
persistTableState({ ...stateRef.current, columnVisibility: next });
|
|
1578
1557
|
reactTableProps.onColumnVisibilityChange?.(value);
|
|
1579
1558
|
},
|
|
1580
1559
|
onColumnSizingChange: value => {
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
})
|
|
1560
|
+
const current = stateRef.current.columnSizing;
|
|
1561
|
+
const next = typeof value === "function" ? value(current) : value;
|
|
1562
|
+
setUserEdits(prev => ({ ...prev, columnSizing: next }));
|
|
1563
|
+
persistTableState({ ...stateRef.current, columnSizing: next });
|
|
1585
1564
|
reactTableProps.onColumnSizingChange?.(value);
|
|
1586
1565
|
},
|
|
1587
1566
|
onColumnOrderChange: value => {
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
})
|
|
1567
|
+
const current = stateRef.current.columnOrder;
|
|
1568
|
+
const next = typeof value === "function" ? value(current) : value;
|
|
1569
|
+
setUserEdits(prev => ({ ...prev, columnOrder: next }));
|
|
1570
|
+
persistTableState({ ...stateRef.current, columnOrder: next });
|
|
1592
1571
|
reactTableProps.onColumnOrderChange?.(value);
|
|
1593
1572
|
},
|
|
1594
1573
|
onSortingChange: value => {
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
})
|
|
1574
|
+
const current = stateRef.current.sorting;
|
|
1575
|
+
const next = typeof value === "function" ? value(current) : value;
|
|
1576
|
+
setUserEdits(prev => ({ ...prev, sorting: next }));
|
|
1577
|
+
persistTableState({ ...stateRef.current, sorting: next });
|
|
1599
1578
|
reactTableProps.onSortingChange?.(value);
|
|
1600
1579
|
},
|
|
1601
1580
|
onColumnPinningChange: value => {
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
})
|
|
1581
|
+
const current = stateRef.current.columnPinning;
|
|
1582
|
+
const next = typeof value === "function" ? value(current) : value;
|
|
1583
|
+
setUserEdits(prev => ({ ...prev, columnPinning: next }));
|
|
1584
|
+
persistTableState({ ...stateRef.current, columnPinning: next });
|
|
1606
1585
|
reactTableProps.onColumnPinningChange?.(value);
|
|
1607
1586
|
},
|
|
1608
1587
|
columns,
|
|
1609
1588
|
state,
|
|
1610
1589
|
});
|
|
1611
|
-
useEffect(() => {
|
|
1612
|
-
if (onTableStateChange) {
|
|
1613
|
-
onTableStateChange(stateForTableStateChange);
|
|
1614
|
-
}
|
|
1615
|
-
}, [onTableStateChange, stateForTableStateChange]);
|
|
1616
1590
|
return useMemo(() => {
|
|
1617
1591
|
return { table };
|
|
1618
1592
|
}, [table]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"react-dnd": "16.0.1",
|
|
12
12
|
"react-dnd-html5-backend": "16.0.1",
|
|
13
13
|
"tailwind-merge": "^2.0.0",
|
|
14
|
-
"@trackunit/react-components": "2.1.
|
|
15
|
-
"@trackunit/shared-utils": "1.15.
|
|
16
|
-
"@trackunit/css-class-variance-utilities": "1.13.
|
|
17
|
-
"@trackunit/ui-icons": "1.13.
|
|
18
|
-
"@trackunit/react-table-base-components": "2.1.
|
|
19
|
-
"@trackunit/react-form-components": "2.1.
|
|
20
|
-
"@trackunit/i18n-library-translation": "2.0.
|
|
21
|
-
"@trackunit/iris-app-runtime-core-api": "1.16.
|
|
14
|
+
"@trackunit/react-components": "2.1.3",
|
|
15
|
+
"@trackunit/shared-utils": "1.15.13",
|
|
16
|
+
"@trackunit/css-class-variance-utilities": "1.13.13",
|
|
17
|
+
"@trackunit/ui-icons": "1.13.14",
|
|
18
|
+
"@trackunit/react-table-base-components": "2.1.4",
|
|
19
|
+
"@trackunit/react-form-components": "2.1.4",
|
|
20
|
+
"@trackunit/i18n-library-translation": "2.0.5",
|
|
21
|
+
"@trackunit/iris-app-runtime-core-api": "1.16.13"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@tanstack/react-router": "^1.114.29",
|