@trackunit/react-table 2.7.76-alpha-55a192f4ee4.0 → 2.7.77-alpha-15da733192f.0
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 +11 -65
- package/index.esm.js +12 -66
- package/package.json +10 -10
- package/src/ActionSheet/ActionButton.d.ts +2 -2
- package/src/ActionSheet/ActionSheet.d.ts +1 -1
- package/src/components/TextWithTooltip.d.ts +1 -1
- package/src/hooks/useTablePersistence/useTablePersistence.d.ts +1 -8
- package/src/menus/ColumnActions.d.ts +1 -1
- package/src/menus/ColumnFilter.d.ts +1 -1
- package/src/menus/ColumnFilterItem.d.ts +1 -1
- package/src/translation.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -529,15 +529,6 @@ const validateTableState = (raw) => {
|
|
|
529
529
|
const result = tableStateSchema.safeParse(raw);
|
|
530
530
|
return result.success ? result.data : undefined;
|
|
531
531
|
};
|
|
532
|
-
/**
|
|
533
|
-
* Changes reported before `clientSideUserId` resolves carry no owner — the user
|
|
534
|
-
* was already editing while their id was in flight — so the identity that
|
|
535
|
-
* resolves adopts them. Once a defined identity owns the reported state it must
|
|
536
|
-
* not be adopted by a later identity, including a brief window where the
|
|
537
|
-
* current id is unset: treating that gap as unowned would copy one person's
|
|
538
|
-
* layout into the next user's scoped storage.
|
|
539
|
-
*/
|
|
540
|
-
const isOwnedByCurrentUser = (ownerId, clientSideUserId) => ownerId === undefined || ownerId === clientSideUserId;
|
|
541
532
|
/**
|
|
542
533
|
* Persists and restores table column state (order, sizing, visibility, sorting, pinning, expanded) using
|
|
543
534
|
* the URL **hash fragment** and localStorage.
|
|
@@ -560,8 +551,7 @@ const isOwnedByCurrentUser = (ownerId, clientSideUserId) => ownerId === undefine
|
|
|
560
551
|
*
|
|
561
552
|
* On mount, state is loaded from the hash (or legacy search param as a
|
|
562
553
|
* one-shot fallback) and merged with localStorage so fields omitted from
|
|
563
|
-
* the URL, such as `expanded`, still survive reloads.
|
|
564
|
-
* trigger this hook's persistence effect. Only user-reported changes are
|
|
554
|
+
* the URL, such as `expanded`, still survive reloads. Changes are
|
|
565
555
|
* debounced (300 ms) and synced to both the hash and localStorage.
|
|
566
556
|
*
|
|
567
557
|
* `onTableStateChange` takes a *partial* state and merges it into whatever
|
|
@@ -570,12 +560,6 @@ const isOwnedByCurrentUser = (ownerId, clientSideUserId) => ownerId === undefine
|
|
|
570
560
|
* their mount-time values. A field reported empty is dropped from the stored
|
|
571
561
|
* state, and once every field is empty the entry is removed altogether.
|
|
572
562
|
*
|
|
573
|
-
* Reported state is scoped to the identity that reported it: when the current
|
|
574
|
-
* user changes, state reported by the previous user is discarded instead of
|
|
575
|
-
* being written to the new user's storage. Hydrating a layout shared through
|
|
576
|
-
* the URL is unaffected — it renders for anyone and only becomes the reader's
|
|
577
|
-
* persisted layout once they change the table themselves.
|
|
578
|
-
*
|
|
579
563
|
* @param persistenceKey - Unique key used to store and retrieve the table state.
|
|
580
564
|
* Must be camelCase and at most 15 characters (e.g. "userTable", "assetList").
|
|
581
565
|
* @returns {UseTablePersistenceResult} An object containing:
|
|
@@ -608,8 +592,6 @@ const useTablePersistence = (persistenceKey) => {
|
|
|
608
592
|
// `?<key>=...` search param into the hash on first load.
|
|
609
593
|
urlLocation: "hash",
|
|
610
594
|
});
|
|
611
|
-
// Identity that reported the state currently held in `pendingState`.
|
|
612
|
-
const pendingOwnerIdRef = react.useRef(undefined);
|
|
613
595
|
const [pendingState, setPendingState] = react.useState(null);
|
|
614
596
|
const debouncedPending = reactComponents.useDebounce(pendingState, { delay: 300 });
|
|
615
597
|
const hasReportedChange = debouncedPending !== null;
|
|
@@ -617,12 +599,12 @@ const useTablePersistence = (persistenceKey) => {
|
|
|
617
599
|
if (!debouncedPending && !initialState) {
|
|
618
600
|
return undefined;
|
|
619
601
|
}
|
|
620
|
-
const columnOrder = debouncedPending?.
|
|
621
|
-
const columnSizing = debouncedPending?.
|
|
622
|
-
const columnVisibility = debouncedPending?.
|
|
623
|
-
const sorting = debouncedPending?.
|
|
624
|
-
const columnPinning = debouncedPending?.
|
|
625
|
-
const expanded = debouncedPending?.
|
|
602
|
+
const columnOrder = debouncedPending?.columnOrder ?? initialState?.columnOrder;
|
|
603
|
+
const columnSizing = debouncedPending?.columnSizing ?? initialState?.columnSizing;
|
|
604
|
+
const columnVisibility = debouncedPending?.columnVisibility ?? initialState?.columnVisibility;
|
|
605
|
+
const sorting = debouncedPending?.sorting ?? initialState?.sorting;
|
|
606
|
+
const columnPinning = debouncedPending?.columnPinning ?? initialState?.columnPinning;
|
|
607
|
+
const expanded = debouncedPending?.expanded ?? initialState?.expanded;
|
|
626
608
|
const state = {};
|
|
627
609
|
if (columnOrder && columnOrder.length > 0) {
|
|
628
610
|
state.columnOrder = columnOrder;
|
|
@@ -648,54 +630,18 @@ const useTablePersistence = (persistenceKey) => {
|
|
|
648
630
|
if (!newTableState) {
|
|
649
631
|
return;
|
|
650
632
|
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
if (!isOwnedByCurrentUser(previousOwnerId, reporterId)) {
|
|
654
|
-
if (reporterId === undefined) {
|
|
655
|
-
return;
|
|
656
|
-
}
|
|
657
|
-
pendingOwnerIdRef.current = reporterId;
|
|
658
|
-
// State left behind by another identity is dropped rather than merged, so
|
|
659
|
-
// this user's change builds on their own persisted state.
|
|
660
|
-
setPendingState({ ownerId: reporterId, state: { ...newTableState } });
|
|
661
|
-
return;
|
|
662
|
-
}
|
|
663
|
-
if (reporterId !== undefined) {
|
|
664
|
-
pendingOwnerIdRef.current = reporterId;
|
|
665
|
-
}
|
|
666
|
-
setPendingState(previousState => ({
|
|
667
|
-
ownerId: reporterId,
|
|
668
|
-
state: { ...previousState?.state, ...newTableState },
|
|
669
|
-
}));
|
|
670
|
-
}, [clientSideUserId]);
|
|
633
|
+
setPendingState(previousState => ({ ...previousState, ...newTableState }));
|
|
634
|
+
}, []);
|
|
671
635
|
react.useEffect(() => {
|
|
672
|
-
|
|
673
|
-
// `usePersistedState` deduplicating an attempted write.
|
|
674
|
-
if (!hasReportedChange || !currentState) {
|
|
636
|
+
if (!currentState) {
|
|
675
637
|
return;
|
|
676
638
|
}
|
|
677
|
-
// Writing here after the current user changed would copy the previous
|
|
678
|
-
// user's reported state into this user's scoped storage — the debounced
|
|
679
|
-
// state outlives the identity that produced it.
|
|
680
|
-
const debouncedOwnerId = debouncedPending.ownerId;
|
|
681
|
-
const pendingOwnerId = pendingOwnerIdRef.current;
|
|
682
|
-
const hasCrossUserOwner = !isOwnedByCurrentUser(debouncedOwnerId, clientSideUserId) ||
|
|
683
|
-
!isOwnedByCurrentUser(pendingOwnerId, clientSideUserId);
|
|
684
|
-
const ownerChangedDuringDebounce = pendingOwnerId !== undefined && debouncedOwnerId !== pendingOwnerId;
|
|
685
|
-
if (hasCrossUserOwner || ownerChangedDuringDebounce) {
|
|
686
|
-
return;
|
|
687
|
-
}
|
|
688
|
-
// State reported before identity resolution is adopted by the first
|
|
689
|
-
// identity that resolves. Hydration-only runs cannot reach this branch.
|
|
690
|
-
if (debouncedOwnerId === undefined && clientSideUserId !== undefined) {
|
|
691
|
-
pendingOwnerIdRef.current = clientSideUserId;
|
|
692
|
-
}
|
|
693
639
|
if (sharedUtils.objectKeys(currentState).length === 0) {
|
|
694
640
|
clearState();
|
|
695
641
|
return;
|
|
696
642
|
}
|
|
697
643
|
persistState(currentState);
|
|
698
|
-
}, [clearState,
|
|
644
|
+
}, [clearState, currentState, persistState]);
|
|
699
645
|
return react.useMemo(() => ({
|
|
700
646
|
onTableStateChange,
|
|
701
647
|
initialState,
|
package/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import { registerTranslations, useNamespaceTranslation, NamespaceTrans } from '@
|
|
|
3
3
|
import { Icon, MenuItem, Button, Tooltip, useOverflowItems, MoreMenu, MenuContent, Spacer, usePersistedState, useDebounce, Text, cvaInteractableItem, Popover, PopoverTrigger, IconButton, PopoverContent, cvaMenuList, cvaMenu, useBidirectionalScroll, noPagination, Card, Spinner, EmptyState } from '@trackunit/react-components';
|
|
4
4
|
import { Link } from '@tanstack/react-router';
|
|
5
5
|
import { objectValues, VISIBLE_ONLY_COLUMN_VISIBILITY_KEY, objectKeys, nonNullable, objectEntries } from '@trackunit/shared-utils';
|
|
6
|
-
import { useMemo, Children, cloneElement, useCallback,
|
|
6
|
+
import { useMemo, Children, cloneElement, useCallback, useState, useEffect, useRef, createElement } from 'react';
|
|
7
7
|
import { cva } from '@trackunit/css-class-variance-utilities';
|
|
8
8
|
import { useCurrentUser } from '@trackunit/react-core-hooks';
|
|
9
9
|
import { z } from 'zod';
|
|
@@ -528,15 +528,6 @@ const validateTableState = (raw) => {
|
|
|
528
528
|
const result = tableStateSchema.safeParse(raw);
|
|
529
529
|
return result.success ? result.data : undefined;
|
|
530
530
|
};
|
|
531
|
-
/**
|
|
532
|
-
* Changes reported before `clientSideUserId` resolves carry no owner — the user
|
|
533
|
-
* was already editing while their id was in flight — so the identity that
|
|
534
|
-
* resolves adopts them. Once a defined identity owns the reported state it must
|
|
535
|
-
* not be adopted by a later identity, including a brief window where the
|
|
536
|
-
* current id is unset: treating that gap as unowned would copy one person's
|
|
537
|
-
* layout into the next user's scoped storage.
|
|
538
|
-
*/
|
|
539
|
-
const isOwnedByCurrentUser = (ownerId, clientSideUserId) => ownerId === undefined || ownerId === clientSideUserId;
|
|
540
531
|
/**
|
|
541
532
|
* Persists and restores table column state (order, sizing, visibility, sorting, pinning, expanded) using
|
|
542
533
|
* the URL **hash fragment** and localStorage.
|
|
@@ -559,8 +550,7 @@ const isOwnedByCurrentUser = (ownerId, clientSideUserId) => ownerId === undefine
|
|
|
559
550
|
*
|
|
560
551
|
* On mount, state is loaded from the hash (or legacy search param as a
|
|
561
552
|
* one-shot fallback) and merged with localStorage so fields omitted from
|
|
562
|
-
* the URL, such as `expanded`, still survive reloads.
|
|
563
|
-
* trigger this hook's persistence effect. Only user-reported changes are
|
|
553
|
+
* the URL, such as `expanded`, still survive reloads. Changes are
|
|
564
554
|
* debounced (300 ms) and synced to both the hash and localStorage.
|
|
565
555
|
*
|
|
566
556
|
* `onTableStateChange` takes a *partial* state and merges it into whatever
|
|
@@ -569,12 +559,6 @@ const isOwnedByCurrentUser = (ownerId, clientSideUserId) => ownerId === undefine
|
|
|
569
559
|
* their mount-time values. A field reported empty is dropped from the stored
|
|
570
560
|
* state, and once every field is empty the entry is removed altogether.
|
|
571
561
|
*
|
|
572
|
-
* Reported state is scoped to the identity that reported it: when the current
|
|
573
|
-
* user changes, state reported by the previous user is discarded instead of
|
|
574
|
-
* being written to the new user's storage. Hydrating a layout shared through
|
|
575
|
-
* the URL is unaffected — it renders for anyone and only becomes the reader's
|
|
576
|
-
* persisted layout once they change the table themselves.
|
|
577
|
-
*
|
|
578
562
|
* @param persistenceKey - Unique key used to store and retrieve the table state.
|
|
579
563
|
* Must be camelCase and at most 15 characters (e.g. "userTable", "assetList").
|
|
580
564
|
* @returns {UseTablePersistenceResult} An object containing:
|
|
@@ -607,8 +591,6 @@ const useTablePersistence = (persistenceKey) => {
|
|
|
607
591
|
// `?<key>=...` search param into the hash on first load.
|
|
608
592
|
urlLocation: "hash",
|
|
609
593
|
});
|
|
610
|
-
// Identity that reported the state currently held in `pendingState`.
|
|
611
|
-
const pendingOwnerIdRef = useRef(undefined);
|
|
612
594
|
const [pendingState, setPendingState] = useState(null);
|
|
613
595
|
const debouncedPending = useDebounce(pendingState, { delay: 300 });
|
|
614
596
|
const hasReportedChange = debouncedPending !== null;
|
|
@@ -616,12 +598,12 @@ const useTablePersistence = (persistenceKey) => {
|
|
|
616
598
|
if (!debouncedPending && !initialState) {
|
|
617
599
|
return undefined;
|
|
618
600
|
}
|
|
619
|
-
const columnOrder = debouncedPending?.
|
|
620
|
-
const columnSizing = debouncedPending?.
|
|
621
|
-
const columnVisibility = debouncedPending?.
|
|
622
|
-
const sorting = debouncedPending?.
|
|
623
|
-
const columnPinning = debouncedPending?.
|
|
624
|
-
const expanded = debouncedPending?.
|
|
601
|
+
const columnOrder = debouncedPending?.columnOrder ?? initialState?.columnOrder;
|
|
602
|
+
const columnSizing = debouncedPending?.columnSizing ?? initialState?.columnSizing;
|
|
603
|
+
const columnVisibility = debouncedPending?.columnVisibility ?? initialState?.columnVisibility;
|
|
604
|
+
const sorting = debouncedPending?.sorting ?? initialState?.sorting;
|
|
605
|
+
const columnPinning = debouncedPending?.columnPinning ?? initialState?.columnPinning;
|
|
606
|
+
const expanded = debouncedPending?.expanded ?? initialState?.expanded;
|
|
625
607
|
const state = {};
|
|
626
608
|
if (columnOrder && columnOrder.length > 0) {
|
|
627
609
|
state.columnOrder = columnOrder;
|
|
@@ -647,54 +629,18 @@ const useTablePersistence = (persistenceKey) => {
|
|
|
647
629
|
if (!newTableState) {
|
|
648
630
|
return;
|
|
649
631
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
if (!isOwnedByCurrentUser(previousOwnerId, reporterId)) {
|
|
653
|
-
if (reporterId === undefined) {
|
|
654
|
-
return;
|
|
655
|
-
}
|
|
656
|
-
pendingOwnerIdRef.current = reporterId;
|
|
657
|
-
// State left behind by another identity is dropped rather than merged, so
|
|
658
|
-
// this user's change builds on their own persisted state.
|
|
659
|
-
setPendingState({ ownerId: reporterId, state: { ...newTableState } });
|
|
660
|
-
return;
|
|
661
|
-
}
|
|
662
|
-
if (reporterId !== undefined) {
|
|
663
|
-
pendingOwnerIdRef.current = reporterId;
|
|
664
|
-
}
|
|
665
|
-
setPendingState(previousState => ({
|
|
666
|
-
ownerId: reporterId,
|
|
667
|
-
state: { ...previousState?.state, ...newTableState },
|
|
668
|
-
}));
|
|
669
|
-
}, [clientSideUserId]);
|
|
632
|
+
setPendingState(previousState => ({ ...previousState, ...newTableState }));
|
|
633
|
+
}, []);
|
|
670
634
|
useEffect(() => {
|
|
671
|
-
|
|
672
|
-
// `usePersistedState` deduplicating an attempted write.
|
|
673
|
-
if (!hasReportedChange || !currentState) {
|
|
635
|
+
if (!currentState) {
|
|
674
636
|
return;
|
|
675
637
|
}
|
|
676
|
-
// Writing here after the current user changed would copy the previous
|
|
677
|
-
// user's reported state into this user's scoped storage — the debounced
|
|
678
|
-
// state outlives the identity that produced it.
|
|
679
|
-
const debouncedOwnerId = debouncedPending.ownerId;
|
|
680
|
-
const pendingOwnerId = pendingOwnerIdRef.current;
|
|
681
|
-
const hasCrossUserOwner = !isOwnedByCurrentUser(debouncedOwnerId, clientSideUserId) ||
|
|
682
|
-
!isOwnedByCurrentUser(pendingOwnerId, clientSideUserId);
|
|
683
|
-
const ownerChangedDuringDebounce = pendingOwnerId !== undefined && debouncedOwnerId !== pendingOwnerId;
|
|
684
|
-
if (hasCrossUserOwner || ownerChangedDuringDebounce) {
|
|
685
|
-
return;
|
|
686
|
-
}
|
|
687
|
-
// State reported before identity resolution is adopted by the first
|
|
688
|
-
// identity that resolves. Hydration-only runs cannot reach this branch.
|
|
689
|
-
if (debouncedOwnerId === undefined && clientSideUserId !== undefined) {
|
|
690
|
-
pendingOwnerIdRef.current = clientSideUserId;
|
|
691
|
-
}
|
|
692
638
|
if (objectKeys(currentState).length === 0) {
|
|
693
639
|
clearState();
|
|
694
640
|
return;
|
|
695
641
|
}
|
|
696
642
|
persistState(currentState);
|
|
697
|
-
}, [clearState,
|
|
643
|
+
}, [clearState, currentState, persistState]);
|
|
698
644
|
return useMemo(() => ({
|
|
699
645
|
onTableStateChange,
|
|
700
646
|
initialState,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.77-alpha-15da733192f.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -11,15 +11,15 @@
|
|
|
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.13.
|
|
15
|
-
"@trackunit/react-core-hooks": "1.21.
|
|
16
|
-
"@trackunit/shared-utils": "1.16.
|
|
17
|
-
"@trackunit/css-class-variance-utilities": "2.0.
|
|
18
|
-
"@trackunit/ui-icons": "1.14.
|
|
19
|
-
"@trackunit/react-table-base-components": "2.7.
|
|
20
|
-
"@trackunit/react-form-components": "2.6.
|
|
21
|
-
"@trackunit/i18n-library-translation": "2.4.
|
|
22
|
-
"@trackunit/iris-app-runtime-core-api": "1.17.
|
|
14
|
+
"@trackunit/react-components": "2.13.28-alpha-15da733192f.0",
|
|
15
|
+
"@trackunit/react-core-hooks": "1.21.66-alpha-15da733192f.0",
|
|
16
|
+
"@trackunit/shared-utils": "1.16.51-alpha-15da733192f.0",
|
|
17
|
+
"@trackunit/css-class-variance-utilities": "2.0.16-alpha-15da733192f.0",
|
|
18
|
+
"@trackunit/ui-icons": "1.14.45-alpha-15da733192f.0",
|
|
19
|
+
"@trackunit/react-table-base-components": "2.7.22-alpha-15da733192f.0",
|
|
20
|
+
"@trackunit/react-form-components": "2.6.76-alpha-15da733192f.0",
|
|
21
|
+
"@trackunit/i18n-library-translation": "2.4.66-alpha-15da733192f.0",
|
|
22
|
+
"@trackunit/iris-app-runtime-core-api": "1.17.63-alpha-15da733192f.0",
|
|
23
23
|
"zod": "^3.25.76"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
@@ -27,7 +27,7 @@ export declare const ActionButton: ({ action, id, ...rest }: ActionButtonProps)
|
|
|
27
27
|
* @param {string} [dataTestId] - Optional data test ID.
|
|
28
28
|
* @returns {ReactElement} - The MenuItem component for the given action.
|
|
29
29
|
*/
|
|
30
|
-
export declare const actionDataToMenuItem: (action: ActionModel, dataTestId?: string) => import("react
|
|
30
|
+
export declare const actionDataToMenuItem: (action: ActionModel, dataTestId?: string) => import("react").JSX.Element;
|
|
31
31
|
/**
|
|
32
32
|
* Converts an action model to an ActionButton component.
|
|
33
33
|
* These should be shown in the ActionSheet.
|
|
@@ -36,5 +36,5 @@ export declare const actionDataToMenuItem: (action: ActionModel, dataTestId?: st
|
|
|
36
36
|
* @param action - The action model to convert.
|
|
37
37
|
* @returns {*} The ActionButton component for the given action.
|
|
38
38
|
*/
|
|
39
|
-
export declare const actionDataToActionButton: (action: ActionModel) => import("react
|
|
39
|
+
export declare const actionDataToActionButton: (action: ActionModel) => import("react").JSX.Element;
|
|
40
40
|
export {};
|
|
@@ -127,4 +127,4 @@ export interface ActionSheetProps extends CommonProps, Styleable {
|
|
|
127
127
|
* @param {ActionSheetProps} props - The props for the ActionSheet component
|
|
128
128
|
* @returns {ReactElement} ActionSheet component
|
|
129
129
|
*/
|
|
130
|
-
export declare const ActionSheet: ({ actions, dropdownActions, moreActions, selections, resetSelection, className, style, "data-testid": dataTestId, }: ActionSheetProps) => import("react
|
|
130
|
+
export declare const ActionSheet: ({ actions, dropdownActions, moreActions, selections, resetSelection, className, style, "data-testid": dataTestId, }: ActionSheetProps) => import("react").JSX.Element;
|
|
@@ -81,8 +81,7 @@ type UseTablePersistenceResult = {
|
|
|
81
81
|
*
|
|
82
82
|
* On mount, state is loaded from the hash (or legacy search param as a
|
|
83
83
|
* one-shot fallback) and merged with localStorage so fields omitted from
|
|
84
|
-
* the URL, such as `expanded`, still survive reloads.
|
|
85
|
-
* trigger this hook's persistence effect. Only user-reported changes are
|
|
84
|
+
* the URL, such as `expanded`, still survive reloads. Changes are
|
|
86
85
|
* debounced (300 ms) and synced to both the hash and localStorage.
|
|
87
86
|
*
|
|
88
87
|
* `onTableStateChange` takes a *partial* state and merges it into whatever
|
|
@@ -91,12 +90,6 @@ type UseTablePersistenceResult = {
|
|
|
91
90
|
* their mount-time values. A field reported empty is dropped from the stored
|
|
92
91
|
* state, and once every field is empty the entry is removed altogether.
|
|
93
92
|
*
|
|
94
|
-
* Reported state is scoped to the identity that reported it: when the current
|
|
95
|
-
* user changes, state reported by the previous user is discarded instead of
|
|
96
|
-
* being written to the new user's storage. Hydrating a layout shared through
|
|
97
|
-
* the URL is unaffected — it renders for anyone and only becomes the reader's
|
|
98
|
-
* persisted layout once they change the table themselves.
|
|
99
|
-
*
|
|
100
93
|
* @param persistenceKey - Unique key used to store and retrieve the table state.
|
|
101
94
|
* Must be camelCase and at most 15 characters (e.g. "userTable", "assetList").
|
|
102
95
|
* @returns {UseTablePersistenceResult} An object containing:
|
|
@@ -13,5 +13,5 @@ interface ColumnActionsProps<TData> {
|
|
|
13
13
|
* @param {Header<TData, unknown>} props.header The header of the current column provided by React Table.
|
|
14
14
|
* @param {number} props.visibleColumnsCount The number of visible columns in the table.
|
|
15
15
|
*/
|
|
16
|
-
declare const ColumnActions: <TData>({ header, visibleColumnsCount, setSorting, getColumn }: ColumnActionsProps<TData>) => import("react
|
|
16
|
+
declare const ColumnActions: <TData>({ header, visibleColumnsCount, setSorting, getColumn }: ColumnActionsProps<TData>) => import("react").JSX.Element | null;
|
|
17
17
|
export default ColumnActions;
|
|
@@ -15,7 +15,7 @@ export interface ColumnFilterProps<TColumnFilter extends object, TColumnFilterVa
|
|
|
15
15
|
* @param {ColumnFilterProps<TColumnFilter, TColumnFilterValue>} props - The props object containing necessary properties.
|
|
16
16
|
* @returns {ReactElement | null} A React JSX element representing the ColumnFilter component or null if columns are not provided.
|
|
17
17
|
*/
|
|
18
|
-
export declare const ColumnFilter: <TColumnFilter extends object, TColumnFilterValue>({ columns, setColumnOrder, defaultColumnOrder, columnOrder, onUserEvent, setColumnSize, }: ColumnFilterProps<TColumnFilter, TColumnFilterValue>) => import("react
|
|
18
|
+
export declare const ColumnFilter: <TColumnFilter extends object, TColumnFilterValue>({ columns, setColumnOrder, defaultColumnOrder, columnOrder, onUserEvent, setColumnSize, }: ColumnFilterProps<TColumnFilter, TColumnFilterValue>) => import("react").JSX.Element;
|
|
19
19
|
export interface ColumnFiltersDragAndDropProps<TColumnFiltersDragAndDrop extends object, TColumnFiltersDragAndDropValue> {
|
|
20
20
|
columns: Array<Column<TColumnFiltersDragAndDrop, TColumnFiltersDragAndDropValue>>;
|
|
21
21
|
setColumnOrder: (updater: Updater<ColumnOrderState>) => void;
|
|
@@ -28,5 +28,5 @@ interface ColumnFilterItemProps {
|
|
|
28
28
|
* @param {boolean} [props.isSortDisabled] - Optional flag to disable sorting.
|
|
29
29
|
* @returns {Element} A React component rendering the column filter item.
|
|
30
30
|
*/
|
|
31
|
-
export declare const ColumnFilterItem: ({ name, onToggle, toggled, disabled, index, moveColumn, onDrop, onCancelDrop, id, isSortDisabled, }: ColumnFilterItemProps) => import("react
|
|
31
|
+
export declare const ColumnFilterItem: ({ name, onToggle, toggled, disabled, index, moveColumn, onDrop, onCancelDrop, id, isSortDisabled, }: ColumnFilterItemProps) => import("react").JSX.Element;
|
|
32
32
|
export {};
|
package/src/translation.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export type TranslationFunction = TransForLibs<TranslationKeys>;
|
|
|
26
26
|
/**
|
|
27
27
|
* Trans for this specific library.
|
|
28
28
|
*/
|
|
29
|
-
export declare const Trans: (props: NamespaceTransProps<TranslationKeys>) => import("react
|
|
29
|
+
export declare const Trans: (props: NamespaceTransProps<TranslationKeys>) => import("react").JSX.Element;
|
|
30
30
|
/**
|
|
31
31
|
* Registers the translations for this library
|
|
32
32
|
*/
|