asma-ui-core 3.138.0 → 3.138.2
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/dist/components/navigation/tabs/StyledTabs.js +46 -46
- package/dist/src/table/custom-features/order-columns/types.d.ts +1 -1
- package/dist/src/table/custom-features/order-columns/usePersistColumnOrder.d.ts +1 -2
- package/dist/src/table/hooks/usePersistedSorting.d.ts +3 -25
- package/dist/src/table/hooks/usePersistedStateWriter.d.ts +0 -4
- package/dist/src/table/types.d.ts +4 -15
- package/dist/table/custom-features/order-columns/usePersistColumnOrder.js +10 -10
- package/dist/table/hooks/useColumnLayoutPersistence.js +37 -37
- package/dist/table/hooks/usePersistedSorting.js +20 -21
- package/dist/table/hooks/usePersistedStateWriter.js +18 -18
- package/dist/table/hooks/useStyledTable.js +108 -113
- package/package.json +1 -1
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as n } from "../../../helpers/cn.js";
|
|
2
2
|
import { resolveSx as K } from "../../../helpers/sx.js";
|
|
3
|
-
import { ChevronRightIcon as
|
|
4
|
-
import { ChevronLeftIcon as
|
|
5
|
-
import { consumerOverrides as
|
|
6
|
-
import { TabsContext as
|
|
7
|
-
import { Children as
|
|
8
|
-
import { jsx as l, jsxs as
|
|
9
|
-
var
|
|
10
|
-
const
|
|
3
|
+
import { ChevronRightIcon as V } from "../../icons/chevron-right-icon/ChevronRightIcon.js";
|
|
4
|
+
import { ChevronLeftIcon as q } from "../../icons/chevron-left-icon/ChevronLeftIcon.js";
|
|
5
|
+
import { consumerOverrides as z } from "../../../helpers/classOverride.js";
|
|
6
|
+
import { TabsContext as F } from "./TabsContext.js";
|
|
7
|
+
import { Children as G, cloneElement as J, isValidElement as Q, useCallback as m, useLayoutEffect as U, useMemo as X, useRef as A, useState as B } from "react";
|
|
8
|
+
import { jsx as l, jsxs as I } from "react/jsx-runtime";
|
|
9
|
+
var j = 120, se = ({ value: i, onChange: b, variant: g = "standard", scrollButtons: w = "auto", centered: N, size: f = "default", className: x, sx: O, children: p }) => {
|
|
10
|
+
const a = A(null), s = A(/* @__PURE__ */ new Map()), [h, W] = B({
|
|
11
11
|
left: 0,
|
|
12
12
|
width: 0,
|
|
13
13
|
disabled: !1
|
|
14
|
-
}), [c,
|
|
14
|
+
}), [c, _] = B({
|
|
15
15
|
left: !1,
|
|
16
16
|
right: !1
|
|
17
|
-
}), y = g === "scrollable", v =
|
|
18
|
-
t ?
|
|
19
|
-
}, []), S =
|
|
20
|
-
const e =
|
|
21
|
-
if (e &&
|
|
17
|
+
}), y = g === "scrollable", v = m((e, t) => {
|
|
18
|
+
t ? s.current.set(e, t) : s.current.delete(e);
|
|
19
|
+
}, []), S = m((e, t) => b?.(e, t), [b]), d = m(() => {
|
|
20
|
+
const e = s.current.get(i), t = a.current;
|
|
21
|
+
if (e && W({
|
|
22
22
|
left: e.offsetLeft,
|
|
23
23
|
width: e.offsetWidth,
|
|
24
24
|
disabled: e.disabled || e.getAttribute("aria-disabled") === "true"
|
|
25
25
|
}), t) {
|
|
26
|
-
const { scrollLeft: o,
|
|
27
|
-
|
|
26
|
+
const { scrollLeft: o, clientWidth: r } = t, u = Math.max(0, ...Array.from(s.current.values(), (E) => E.offsetLeft + E.offsetWidth));
|
|
27
|
+
_({
|
|
28
28
|
left: o > 1,
|
|
29
|
-
right: o +
|
|
29
|
+
right: o + r < u - 1
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
}, [
|
|
33
|
-
|
|
32
|
+
}, [i]);
|
|
33
|
+
U(() => {
|
|
34
34
|
d();
|
|
35
|
-
const e =
|
|
35
|
+
const e = a.current;
|
|
36
36
|
if (!e) return;
|
|
37
37
|
const t = new ResizeObserver(d);
|
|
38
38
|
return t.observe(e), () => t.disconnect();
|
|
39
|
-
}, [d,
|
|
39
|
+
}, [d, p]);
|
|
40
40
|
const k = (e) => {
|
|
41
|
-
|
|
41
|
+
a.current?.scrollBy({
|
|
42
42
|
left: e,
|
|
43
43
|
behavior: "smooth"
|
|
44
44
|
});
|
|
45
|
-
},
|
|
45
|
+
}, D = (e) => {
|
|
46
46
|
if (![
|
|
47
47
|
"ArrowRight",
|
|
48
48
|
"ArrowLeft",
|
|
@@ -50,49 +50,49 @@ var I = 120, le = ({ value: n, onChange: m, variant: g = "standard", scrollButto
|
|
|
50
50
|
"End"
|
|
51
51
|
].includes(e.key)) return;
|
|
52
52
|
e.preventDefault();
|
|
53
|
-
const t = Array.from(
|
|
53
|
+
const t = Array.from(s.current.values());
|
|
54
54
|
if (t.length === 0) return;
|
|
55
55
|
const o = t.findIndex((u) => u === document.activeElement);
|
|
56
56
|
let r = o;
|
|
57
57
|
e.key === "ArrowRight" ? r = (o + 1) % t.length : e.key === "ArrowLeft" ? r = (o - 1 + t.length) % t.length : e.key === "Home" ? r = 0 : e.key === "End" && (r = t.length - 1), t[r]?.focus();
|
|
58
|
-
}, L = y && w !== !1, R = w === !0,
|
|
59
|
-
value:
|
|
58
|
+
}, L = y && w !== !1, R = w === !0, M = L && (R || c.left), P = L && (R || c.right), T = z(x, "padding-x"), H = X(() => ({
|
|
59
|
+
value: i,
|
|
60
60
|
size: f,
|
|
61
61
|
onSelect: S,
|
|
62
62
|
register: v
|
|
63
63
|
}), [
|
|
64
|
-
|
|
64
|
+
i,
|
|
65
65
|
f,
|
|
66
66
|
S,
|
|
67
67
|
v
|
|
68
68
|
]), C = "flex h-10 w-10 shrink-0 items-center justify-center self-center rounded-[10%] border border-solid border-delta-500 text-delta-700 transition-colors hover:bg-gama-50 disabled:invisible";
|
|
69
|
-
return /* @__PURE__ */ l(
|
|
69
|
+
return /* @__PURE__ */ l(F.Provider, {
|
|
70
70
|
value: H,
|
|
71
|
-
children: /* @__PURE__ */
|
|
72
|
-
className:
|
|
73
|
-
style: K(
|
|
71
|
+
children: /* @__PURE__ */ I("div", {
|
|
72
|
+
className: n("relative flex items-center rounded-t-lg bg-white", !T && "px-4", x),
|
|
73
|
+
style: K(O),
|
|
74
74
|
children: [
|
|
75
|
-
|
|
75
|
+
M && /* @__PURE__ */ l("button", {
|
|
76
76
|
type: "button",
|
|
77
77
|
"aria-label": "scroll tabs left",
|
|
78
|
-
className:
|
|
78
|
+
className: n(C, "mr-2"),
|
|
79
79
|
disabled: !c.left,
|
|
80
|
-
onClick: () => k(-
|
|
81
|
-
children: /* @__PURE__ */ l(
|
|
80
|
+
onClick: () => k(-j),
|
|
81
|
+
children: /* @__PURE__ */ l(q, {
|
|
82
82
|
width: 24,
|
|
83
83
|
height: 24
|
|
84
84
|
})
|
|
85
85
|
}),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
ref:
|
|
86
|
+
/* @__PURE__ */ I("div", {
|
|
87
|
+
ref: a,
|
|
88
88
|
role: "tablist",
|
|
89
89
|
"aria-orientation": "horizontal",
|
|
90
|
-
onKeyDown:
|
|
90
|
+
onKeyDown: D,
|
|
91
91
|
onScroll: d,
|
|
92
|
-
className:
|
|
93
|
-
children: [
|
|
92
|
+
className: n("relative flex bg-[linear-gradient(to_top,var(--colors-delta-200)_1px,transparent_1px)] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", y ? "flex-1 overflow-x-auto" : "w-full", g === "fullWidth" && "[&>*]:flex-1", N && "justify-center", f === "small" && "min-h-9"),
|
|
93
|
+
children: [G.map(p, (e, t) => Q(e) ? J(e, { index: t }) : e), /* @__PURE__ */ l("span", {
|
|
94
94
|
"aria-hidden": !0,
|
|
95
|
-
className:
|
|
95
|
+
className: n("absolute bottom-0 h-[3px] transition-all duration-300", h.disabled ? "bg-delta-300" : "bg-gama-500"),
|
|
96
96
|
style: {
|
|
97
97
|
left: h.left,
|
|
98
98
|
width: h.width
|
|
@@ -102,10 +102,10 @@ var I = 120, le = ({ value: n, onChange: m, variant: g = "standard", scrollButto
|
|
|
102
102
|
P && /* @__PURE__ */ l("button", {
|
|
103
103
|
type: "button",
|
|
104
104
|
"aria-label": "scroll tabs right",
|
|
105
|
-
className:
|
|
105
|
+
className: n(C, "ml-2"),
|
|
106
106
|
disabled: !c.right,
|
|
107
|
-
onClick: () => k(
|
|
108
|
-
children: /* @__PURE__ */ l(
|
|
107
|
+
onClick: () => k(j),
|
|
108
|
+
children: /* @__PURE__ */ l(V, {
|
|
109
109
|
width: 24,
|
|
110
110
|
height: 24
|
|
111
111
|
})
|
|
@@ -115,5 +115,5 @@ var I = 120, le = ({ value: n, onChange: m, variant: g = "standard", scrollButto
|
|
|
115
115
|
});
|
|
116
116
|
};
|
|
117
117
|
export {
|
|
118
|
-
|
|
118
|
+
se as StyledTabs
|
|
119
119
|
};
|
|
@@ -21,7 +21,7 @@ export interface ColumnLayoutDefaults {
|
|
|
21
21
|
export interface ColumnSettingsInstance {
|
|
22
22
|
/**
|
|
23
23
|
* Reset columns (ASMA-8597): puts the column order and the widths back to the table's defaults, and the
|
|
24
|
-
* sorting too when the table
|
|
24
|
+
* sorting too when the table has `persistSorting`. It removes the saved entries of what it resets. On a table
|
|
25
25
|
* with `persistColumnLayout` (ASMA-8695, OQ-02) it also puts the visibility back to the default, unhiding what
|
|
26
26
|
* the user hid and hiding what is hidden by default; any other table never touches visibility. Set by
|
|
27
27
|
* `StyledTable`, which knows the defaults.
|
|
@@ -2,7 +2,6 @@ import { Table } from '@tanstack/react-table';
|
|
|
2
2
|
/**
|
|
3
3
|
* Saves the column order under `key` when it changes. An order that is `[]` or that matches the live
|
|
4
4
|
* definition order removes the entry instead (ASMA-8597, REQ-004), so a table the user has put back to its
|
|
5
|
-
* defaults stores nothing. Mounting never writes.
|
|
6
|
-
* order is the default is worked out only when it is about to be saved.
|
|
5
|
+
* defaults stores nothing. Mounting never writes.
|
|
7
6
|
*/
|
|
8
7
|
export declare function usePersistColumnOrder<TData = unknown>(table: Table<TData>, key?: string | null): void;
|
|
@@ -1,27 +1,5 @@
|
|
|
1
1
|
import { OnChangeFn, SortingState } from '@tanstack/react-table';
|
|
2
2
|
export declare const getSortingStorageKey: (uniqueKey?: string) => string | undefined;
|
|
3
|
-
/** What decides whether `StyledTable` saves a table's sorting: the props that matter, read from the table's own. */
|
|
4
|
-
export interface SortingPersistenceInput {
|
|
5
|
-
uniqueKey?: string;
|
|
6
|
-
/** The `persistSorting` prop as the app wrote it; `undefined` when it did not. */
|
|
7
|
-
persistSorting?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* The app owns the sorting state: it passes `state.sorting`, or `onSortingChange`. TanStack hands every change to that
|
|
10
|
-
* handler instead of updating the table's own state, so a handler alone is as much the app's state as `state.sorting`.
|
|
11
|
-
*/
|
|
12
|
-
controlled: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Whether `StyledTable` reads and writes the sorting under `${uniqueKey}:sorting` (ASMA-8698, DEC-8698-OPTOUT).
|
|
16
|
-
*
|
|
17
|
-
* - No `uniqueKey`: never.
|
|
18
|
-
* - `persistSorting={false}`: never, the opt-out for tables whose order is the user's own (drag and drop).
|
|
19
|
-
* - `persistSorting={true}`: yes, even when the app owns the sorting state. That is how such an app lets `StyledTable` be the
|
|
20
|
-
* only writer of the sort it reads back with `usePersistedSorting`.
|
|
21
|
-
* - Not written: yes, unless the app owns the sorting state. A saved sort could not be applied to a state the table does not
|
|
22
|
-
* own, and an app that persists its own sort would have two writers fighting over it.
|
|
23
|
-
*/
|
|
24
|
-
export declare const savesSorting: ({ uniqueKey, persistSorting, controlled }: SortingPersistenceInput) => boolean;
|
|
25
3
|
/** What a saved sort is checked against: the columns that can sort, and the multi-sort rules. */
|
|
26
4
|
export interface SortingRules {
|
|
27
5
|
sortableColumns: readonly {
|
|
@@ -49,7 +27,7 @@ export interface PersistedSortingOptions {
|
|
|
49
27
|
maxMultiSortColCount?: number;
|
|
50
28
|
}
|
|
51
29
|
/**
|
|
52
|
-
* Reads the sorting `StyledTable` saved for `uniqueKey
|
|
30
|
+
* Reads the sorting `StyledTable` saved for `uniqueKey` (with `persistSorting`), checked against the columns
|
|
53
31
|
* the caller can sort by. Synchronous and pure, so a table that owns its sorting state (for example because
|
|
54
32
|
* the server sorts) can use the saved sort for its first request. Returns `undefined` when nothing valid is
|
|
55
33
|
* saved, and `[]` when the user turned sorting off.
|
|
@@ -58,8 +36,8 @@ export declare const readPersistedSorting: (uniqueKey: string | undefined, optio
|
|
|
58
36
|
/**
|
|
59
37
|
* Sorting state for a table that owns `state.sorting`: the saved sort on the first render (before the first
|
|
60
38
|
* request), `defaultSorting` when nothing valid is saved, and the new key's sort after `uniqueKey` changes.
|
|
61
|
-
* It never writes: `StyledTable` is the only writer, and it
|
|
62
|
-
*
|
|
39
|
+
* It never writes: `StyledTable` with `persistSorting` is the only writer, and it takes the same default
|
|
40
|
+
* from `initialState.sorting`, which Reset columns restores.
|
|
63
41
|
*
|
|
64
42
|
* ```tsx
|
|
65
43
|
* const { sorting, onSortingChange } = usePersistedSorting({ uniqueKey, defaultSorting, sortableColumnIds })
|
|
@@ -25,10 +25,6 @@ interface PersistedStateWriterOptions<T> {
|
|
|
25
25
|
* entry is never touched, so the old value can't be copied over the new key.
|
|
26
26
|
* - When the key goes away (`undefined`), the table goes back to the app's defaults and writes nothing, so
|
|
27
27
|
* one user's values are not left on screen for whoever is shown next.
|
|
28
|
-
*
|
|
29
|
-
* It costs a table that does not save the setting nothing per render (ASMA-8698): the value's signature is computed only
|
|
30
|
-
* while there is a key (the render that loses the key reads it in the layout effect), and the default's only when a write
|
|
31
|
-
* or a reset needs it.
|
|
32
28
|
*/
|
|
33
29
|
export declare const usePersistedStateWriter: <T>(options: PersistedStateWriterOptions<T>) => void;
|
|
34
30
|
export {};
|
|
@@ -158,21 +158,10 @@ export type StyledTableProps<TData, TCustomData> = {
|
|
|
158
158
|
*/
|
|
159
159
|
uniqueKey?: string;
|
|
160
160
|
/**
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
* - `false` is the opt-out, for a table whose order is the user's own (drag and drop rows) or that must always open as the
|
|
166
|
-
* app declares it. Nothing is read or written for sorting then.
|
|
167
|
-
* - Leaving it out, or `true`, saves a sort that `StyledTable` owns. `true` is the default spelled out: nothing changes
|
|
168
|
-
* for a table that has it (it will not be removed before the next major version).
|
|
169
|
-
* - A table whose app owns the sorting state (`state.sorting`, or `onSortingChange`, which TanStack calls instead of
|
|
170
|
-
* updating the table's own state) is **not** saved by default: the saved sort could not be applied to a state the table
|
|
171
|
-
* does not own, and an app with its own persistence would have two writers. Such a table that wants it saved writes
|
|
172
|
-
* `persistSorting` (`true`), makes `StyledTable` the only writer, and reads the sort back with `usePersistedSorting`.
|
|
173
|
-
*
|
|
174
|
-
* A saved sort of a column that is gone or cannot sort is ignored, and so is storage that is corrupt, full or blocked: the
|
|
175
|
-
* table opens with its `initialState.sorting`, which Reset columns also returns to.
|
|
161
|
+
* Temporary opt-in (ASMA-8597, owner decision D1, 2026-10-27): save and restore this table's
|
|
162
|
+
* sorting under `${uniqueKey}:sorting`, and let Reset columns reset it. Needs `uniqueKey`;
|
|
163
|
+
* ignored without it. Off by default until UX and privacy approve the fleet rollout, which
|
|
164
|
+
* makes `uniqueKey` alone enough and retires this prop (follow-up ASMA-8698).
|
|
176
165
|
*/
|
|
177
166
|
persistSorting?: boolean;
|
|
178
167
|
/**
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { tableStorage as
|
|
2
|
-
import { isDefaultColumnOrder as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
function
|
|
5
|
-
const o = n.getState().columnOrder, t =
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
|
|
1
|
+
import { tableStorage as u } from "../../helpers/tableStorage.js";
|
|
2
|
+
import { isDefaultColumnOrder as i } from "./columnLayout.js";
|
|
3
|
+
import { useEffect as m, useRef as f } from "react";
|
|
4
|
+
function d(n, r) {
|
|
5
|
+
const o = n.getState().columnOrder, t = JSON.stringify(o ?? []), c = !o?.length || i(n), s = f(r), e = f(t);
|
|
6
|
+
m(() => {
|
|
7
|
+
if (s.current !== r) {
|
|
8
|
+
s.current = r, e.current = t;
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
-
!r || t === e.current || (e.current = t,
|
|
11
|
+
!r || t === e.current || (e.current = t, c ? u.remove(r) : u.set(r, t));
|
|
12
12
|
}, [t, r]);
|
|
13
13
|
}
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
d as usePersistColumnOrder
|
|
16
16
|
};
|
|
@@ -16,30 +16,30 @@ var F = ":column-order", M = ":column-visibility", f = 1, k = (e) => e ? `${e}${
|
|
|
16
16
|
const i = C(e);
|
|
17
17
|
return i.length > 0 ? i : void 0;
|
|
18
18
|
}, T = (e, i, t) => {
|
|
19
|
-
if (!S(e) || !Object.values(e).every((
|
|
20
|
-
const r = K(Object.fromEntries(Object.entries(e).filter(([
|
|
19
|
+
if (!S(e) || !Object.values(e).every((o) => typeof o == "boolean")) return;
|
|
20
|
+
const r = K(Object.fromEntries(Object.entries(e).filter(([o]) => p(o, i))), t);
|
|
21
21
|
return Object.keys(r).length > 0 ? r : void 0;
|
|
22
22
|
}, U = (e) => {
|
|
23
|
-
const { enabled: i, uniqueKey: t, legacyOrderKey: r, legacyVisibilityKey:
|
|
23
|
+
const { enabled: i, uniqueKey: t, legacyOrderKey: r, legacyVisibilityKey: o, columns: s, defaultOrder: g, defaultVisibility: d } = e, n = i ? k(t) : void 0, a = i ? E(t) : void 0, y = s.map((l) => l.id), c = [];
|
|
24
24
|
let b, u;
|
|
25
|
-
if (
|
|
26
|
-
if (v.get(
|
|
25
|
+
if (n) {
|
|
26
|
+
if (v.get(n) !== null) b = D(O(n));
|
|
27
27
|
else if (r && v.get(r) !== null) {
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
const l = x(O(r)), I = l === void 0 || m(j(l, y), y).join() === m(g, y).join();
|
|
29
|
+
l && !I && (b = l), c.push({
|
|
30
30
|
legacyKey: r,
|
|
31
|
-
...
|
|
32
|
-
key:
|
|
31
|
+
...l && !I && { write: {
|
|
32
|
+
key: n,
|
|
33
33
|
value: JSON.stringify({
|
|
34
34
|
v: f,
|
|
35
|
-
order:
|
|
35
|
+
order: l
|
|
36
36
|
})
|
|
37
37
|
} }
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
return a && (v.get(a) !== null ? u = $(O(a),
|
|
42
|
-
legacyKey:
|
|
41
|
+
return a && (v.get(a) !== null ? u = $(O(a), s) : o && v.get(o) !== null && (u = T(O(o), s, d), c.push({
|
|
42
|
+
legacyKey: o,
|
|
43
43
|
...u && { write: {
|
|
44
44
|
key: a,
|
|
45
45
|
value: JSON.stringify({
|
|
@@ -48,18 +48,18 @@ var F = ":column-order", M = ":column-visibility", f = 1, k = (e) => e ? `${e}${
|
|
|
48
48
|
})
|
|
49
49
|
} }
|
|
50
50
|
}))), {
|
|
51
|
-
orderKey:
|
|
51
|
+
orderKey: n,
|
|
52
52
|
visibilityKey: a,
|
|
53
53
|
order: b,
|
|
54
54
|
visibility: u,
|
|
55
55
|
migration: c
|
|
56
56
|
};
|
|
57
57
|
}, W = (e, i, t) => {
|
|
58
|
-
const r = e.visibility && Object.fromEntries(Object.entries(e.visibility).filter(([
|
|
58
|
+
const r = e.visibility && Object.fromEntries(Object.entries(e.visibility).filter(([o]) => p(o, i)));
|
|
59
59
|
return {
|
|
60
60
|
orderKey: e.orderKey,
|
|
61
61
|
visibilityKey: e.visibilityKey,
|
|
62
|
-
order: e.order && j(e.order, i.map((
|
|
62
|
+
order: e.order && j(e.order, i.map((o) => o.id)),
|
|
63
63
|
visibility: r && Object.keys(r).length > 0 ? {
|
|
64
64
|
...t,
|
|
65
65
|
...r
|
|
@@ -77,41 +77,41 @@ var F = ":column-order", M = ":column-visibility", f = 1, k = (e) => e ? `${e}${
|
|
|
77
77
|
r && !v.set(r.key, r.value) || v.remove(t);
|
|
78
78
|
}, [i]), W(i, e.columns, e.defaultVisibility);
|
|
79
79
|
}, V = /* @__PURE__ */ new WeakMap(), Y = (e, i) => [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(i)])].every((t) => (e[t] ?? !0) === (i[t] ?? !0)), G = (e, i) => {
|
|
80
|
-
const { enabled: t, definitionIds: r, defaultOrder:
|
|
81
|
-
signature:
|
|
80
|
+
const { enabled: t, definitionIds: r, defaultOrder: o, defaultVisibility: s, controlledVisibility: g } = i, d = {
|
|
81
|
+
signature: JSON.stringify([
|
|
82
82
|
r,
|
|
83
|
-
|
|
84
|
-
Object.entries(
|
|
85
|
-
])
|
|
83
|
+
o,
|
|
84
|
+
Object.entries(s).sort()
|
|
85
|
+
]),
|
|
86
86
|
definitionIds: r,
|
|
87
|
-
defaultOrder:
|
|
88
|
-
defaultVisibility:
|
|
89
|
-
},
|
|
87
|
+
defaultOrder: o,
|
|
88
|
+
defaultVisibility: s
|
|
89
|
+
}, n = V.get(e) ?? d, a = t && n.signature !== d.signature;
|
|
90
90
|
return R(() => {
|
|
91
|
-
const
|
|
92
|
-
if (V.set(e,
|
|
93
|
-
const c = e.getState().columnOrder, b = m(c,
|
|
91
|
+
const y = V.get(e);
|
|
92
|
+
if (V.set(e, d), !t || !y || y.signature === d.signature) return;
|
|
93
|
+
const c = e.getState().columnOrder, b = m(c, y.definitionIds).join() === m(y.defaultOrder, y.definitionIds).join() ? o : j(c, r);
|
|
94
94
|
if (e.setColumnOrder(b), !g) {
|
|
95
|
-
const u = e.getState().columnVisibility,
|
|
96
|
-
...
|
|
97
|
-
...K(u,
|
|
95
|
+
const u = e.getState().columnVisibility, l = {
|
|
96
|
+
...s,
|
|
97
|
+
...K(u, y.defaultVisibility)
|
|
98
98
|
};
|
|
99
|
-
Y(
|
|
99
|
+
Y(l, u) || e.setColumnVisibility(l);
|
|
100
100
|
}
|
|
101
101
|
}, [
|
|
102
102
|
e,
|
|
103
103
|
t,
|
|
104
|
-
|
|
104
|
+
d.signature
|
|
105
105
|
]), a;
|
|
106
106
|
}, Q = (e, i) => {
|
|
107
|
-
const { saved: t, reconciling: r, defaultOrder:
|
|
107
|
+
const { saved: t, reconciling: r, defaultOrder: o, defaultVisibility: s, controlledVisibility: g } = i, d = A(e);
|
|
108
108
|
L({
|
|
109
109
|
storageKey: t.orderKey,
|
|
110
110
|
state: e.getState().columnOrder,
|
|
111
|
-
defaultValue:
|
|
111
|
+
defaultValue: o,
|
|
112
112
|
saved: t.order,
|
|
113
113
|
settled: !r,
|
|
114
|
-
toSignature: (n) => JSON.stringify(m(n,
|
|
114
|
+
toSignature: (n) => JSON.stringify(m(n, d)),
|
|
115
115
|
toStorage: (n) => JSON.stringify({
|
|
116
116
|
v: f,
|
|
117
117
|
order: C(n)
|
|
@@ -120,14 +120,14 @@ var F = ":column-order", M = ":column-visibility", f = 1, k = (e) => e ? `${e}${
|
|
|
120
120
|
}), L({
|
|
121
121
|
storageKey: t.visibilityKey,
|
|
122
122
|
state: e.getState().columnVisibility,
|
|
123
|
-
defaultValue:
|
|
123
|
+
defaultValue: s,
|
|
124
124
|
saved: t.visibility,
|
|
125
125
|
settled: !r,
|
|
126
126
|
controlled: g,
|
|
127
|
-
toSignature: (n) => h(n,
|
|
127
|
+
toSignature: (n) => h(n, s),
|
|
128
128
|
toStorage: (n) => JSON.stringify({
|
|
129
129
|
v: f,
|
|
130
|
-
visibility: K(n,
|
|
130
|
+
visibility: K(n, s)
|
|
131
131
|
}),
|
|
132
132
|
applyState: (n) => e.setColumnVisibility(n)
|
|
133
133
|
});
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { readJson as
|
|
2
|
-
import { useCallback as f, useState as
|
|
1
|
+
import { readJson as l } from "../helpers/tableStorage.js";
|
|
2
|
+
import { useCallback as f, useState as m } from "react";
|
|
3
3
|
import { functionalUpdate as v } from "@tanstack/react-table";
|
|
4
|
-
var
|
|
5
|
-
if (!d(t) || t.v !==
|
|
4
|
+
var p = ":sorting", S = 1, u = [], y = (t) => t ? `${t}${p}` : void 0, d = (t) => typeof t == "object" && t !== null && !Array.isArray(t), O = (t, r) => {
|
|
5
|
+
if (!d(t) || t.v !== S || !Array.isArray(t.sorting)) return;
|
|
6
6
|
const o = t.sorting;
|
|
7
7
|
if (o.length === 0) return [];
|
|
8
|
-
const s = new Map(r.sortableColumns.map((n) => [n.id, n])), a = /* @__PURE__ */ new Set(),
|
|
8
|
+
const s = new Map(r.sortableColumns.map((n) => [n.id, n])), a = /* @__PURE__ */ new Set(), e = [];
|
|
9
9
|
for (const n of o) {
|
|
10
10
|
if (!d(n) || typeof n.id != "string" || typeof n.desc != "boolean") continue;
|
|
11
11
|
const g = s.get(n.id);
|
|
12
|
-
!g || a.has(n.id) ||
|
|
12
|
+
!g || a.has(n.id) || e.length > 0 && (r.enableMultiSort === !1 || !g.canMultiSort) || (a.add(n.id), e.push({
|
|
13
13
|
id: n.id,
|
|
14
14
|
desc: n.desc
|
|
15
15
|
}));
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const i = r.maxMultiSortColCount, c = i !== void 0 && Number.isFinite(i) && i >= 1 ? e.slice(0, Math.floor(i)) : e;
|
|
18
18
|
return c.length > 0 ? c : void 0;
|
|
19
|
-
},
|
|
20
|
-
v:
|
|
19
|
+
}, R = (t) => JSON.stringify({
|
|
20
|
+
v: S,
|
|
21
21
|
sorting: t.map(({ id: r, desc: o }) => ({
|
|
22
22
|
id: r,
|
|
23
23
|
desc: o
|
|
24
24
|
}))
|
|
25
|
-
}),
|
|
25
|
+
}), A = (t) => JSON.stringify(t.map(({ id: r, desc: o }) => [r, o])), N = (t, r) => {
|
|
26
26
|
const o = y(t);
|
|
27
|
-
return o ? O(
|
|
27
|
+
return o ? O(l(o), r) : void 0;
|
|
28
28
|
}, b = ({ sortableColumnIds: t, enableMultiSort: r, maxMultiSortColCount: o }) => ({
|
|
29
29
|
sortableColumns: t.map((s) => ({
|
|
30
30
|
id: s,
|
|
@@ -32,19 +32,19 @@ var m = ":sorting", l = 1, p = [], y = (t) => t ? `${t}${m}` : void 0, R = ({ un
|
|
|
32
32
|
})),
|
|
33
33
|
enableMultiSort: r,
|
|
34
34
|
maxMultiSortColCount: o
|
|
35
|
-
}), h = (t, r) => N(t, b(r)),
|
|
35
|
+
}), h = (t, r) => N(t, b(r)), I = ({ uniqueKey: t, defaultSorting: r = u, ...o }) => {
|
|
36
36
|
const s = () => ({
|
|
37
37
|
key: t,
|
|
38
38
|
sorting: h(t, o) ?? r
|
|
39
|
-
}), [a,
|
|
40
|
-
let
|
|
41
|
-
a.key !== t && (
|
|
42
|
-
const c = f((n) =>
|
|
39
|
+
}), [a, e] = m(s);
|
|
40
|
+
let i = a;
|
|
41
|
+
a.key !== t && (i = s(), e(i));
|
|
42
|
+
const c = f((n) => e((g) => ({
|
|
43
43
|
...g,
|
|
44
44
|
sorting: v(n, g.sorting)
|
|
45
45
|
})), []);
|
|
46
46
|
return {
|
|
47
|
-
sorting:
|
|
47
|
+
sorting: i.sorting,
|
|
48
48
|
onSortingChange: c
|
|
49
49
|
};
|
|
50
50
|
};
|
|
@@ -52,8 +52,7 @@ export {
|
|
|
52
52
|
y as getSortingStorageKey,
|
|
53
53
|
h as readPersistedSorting,
|
|
54
54
|
N as readSortingFromStorage,
|
|
55
|
-
R as
|
|
56
|
-
A as
|
|
57
|
-
I as
|
|
58
|
-
_ as usePersistedSorting
|
|
55
|
+
R as serializeSorting,
|
|
56
|
+
A as sortingSignature,
|
|
57
|
+
I as usePersistedSorting
|
|
59
58
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { tableStorage as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
var
|
|
4
|
-
const { storageKey: t, state:
|
|
5
|
-
|
|
6
|
-
if (
|
|
7
|
-
if (
|
|
8
|
-
!i &&
|
|
1
|
+
import { tableStorage as y } from "../helpers/tableStorage.js";
|
|
2
|
+
import { useEffect as b, useLayoutEffect as v, useRef as s } from "react";
|
|
3
|
+
var K = (a) => {
|
|
4
|
+
const { storageKey: t, state: l, defaultValue: c, saved: p, settled: f = !0, controlled: i = !1 } = a, { toSignature: o, toStorage: R, applyState: d } = a, e = o(l), g = o(c), S = s(t), u = s(e), n = s(null);
|
|
5
|
+
v(() => {
|
|
6
|
+
if (S.current === t) return;
|
|
7
|
+
if (S.current = t, n.current = null, u.current = e, !t) {
|
|
8
|
+
!i && e !== g && d(c);
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
-
const r =
|
|
12
|
-
|
|
11
|
+
const r = p ?? c, m = o(r);
|
|
12
|
+
n.current = {
|
|
13
13
|
stale: e,
|
|
14
|
-
loaded:
|
|
15
|
-
}, !i &&
|
|
16
|
-
}, [t]),
|
|
14
|
+
loaded: m
|
|
15
|
+
}, !i && m !== e && d(r);
|
|
16
|
+
}, [t]), b(() => {
|
|
17
17
|
if (!t || !f) return;
|
|
18
|
-
const r =
|
|
18
|
+
const r = n.current;
|
|
19
19
|
if (r) {
|
|
20
20
|
if (e === r.loaded) {
|
|
21
|
-
|
|
21
|
+
n.current = null, u.current = e;
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
if (e === r.stale) return;
|
|
25
|
-
|
|
25
|
+
n.current = null;
|
|
26
26
|
}
|
|
27
|
-
e !==
|
|
27
|
+
e !== u.current && (u.current = e, e === g ? y.remove(t) : y.set(t, R(l)));
|
|
28
28
|
}, [
|
|
29
29
|
e,
|
|
30
30
|
t,
|
|
@@ -32,5 +32,5 @@ var E = (a) => {
|
|
|
32
32
|
]);
|
|
33
33
|
};
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
K as usePersistedStateWriter
|
|
36
36
|
};
|
|
@@ -1,175 +1,170 @@
|
|
|
1
|
-
import { SELECT_COLUMN_ID as
|
|
2
|
-
import { ExpandedRowsFeature as
|
|
3
|
-
import { FocusedRowsFeature as
|
|
4
|
-
import { OrderColumnsFeature as
|
|
5
|
-
import { tableStorage as
|
|
6
|
-
import { normalizeDefaultColumnOrder as
|
|
7
|
-
import { usePersistColumnOrder as
|
|
8
|
-
import { usePersistedColumnOrder as
|
|
9
|
-
import { getPersistedPageSizeKey as
|
|
10
|
-
import { columnSizingSignature as
|
|
11
|
-
import { getSortingStorageKey as
|
|
12
|
-
import { usePersistedStateWriter as
|
|
13
|
-
import { useColumnLayoutReconcile as
|
|
14
|
-
import { RowSelectionTooltipFeature as
|
|
15
|
-
import { getLeafColumnInfos as
|
|
16
|
-
import { resolveColumnSizingDefaults as
|
|
17
|
-
import { STYLED_DEFAULT_SORTING_FN as
|
|
18
|
-
import { useEffect as C, useMemo as b, useRef as
|
|
19
|
-
import { getCoreRowModel as
|
|
20
|
-
var
|
|
21
|
-
const { columns:
|
|
22
|
-
defaultColumn:
|
|
1
|
+
import { SELECT_COLUMN_ID as H } from "../types.js";
|
|
2
|
+
import { ExpandedRowsFeature as Q } from "../custom-features/expand-rows/ExpandRowsFeature.js";
|
|
3
|
+
import { FocusedRowsFeature as X } from "../custom-features/focus-rows/FocusRowsFeature.js";
|
|
4
|
+
import { OrderColumnsFeature as $ } from "../custom-features/order-columns/OrderColumnsFeature.js";
|
|
5
|
+
import { tableStorage as h } from "../helpers/tableStorage.js";
|
|
6
|
+
import { normalizeDefaultColumnOrder as ee } from "../custom-features/order-columns/columnLayout.js";
|
|
7
|
+
import { usePersistColumnOrder as te } from "../custom-features/order-columns/usePersistColumnOrder.js";
|
|
8
|
+
import { usePersistedColumnOrder as oe } from "../custom-features/order-columns/usePersistedColumnOrder.js";
|
|
9
|
+
import { getPersistedPageSizeKey as ie, usePersistedPageSize as ne } from "./usePersistedPageSize.js";
|
|
10
|
+
import { columnSizingSignature as re, getColumnSizingStorageKey as le, serializeColumnSizing as se, usePersistedColumnSizing as ae } from "./useColumnSizingPersistence.js";
|
|
11
|
+
import { getSortingStorageKey as ue, readSortingFromStorage as de, serializeSorting as ge, sortingSignature as me } from "./usePersistedSorting.js";
|
|
12
|
+
import { usePersistedStateWriter as U } from "./usePersistedStateWriter.js";
|
|
13
|
+
import { useColumnLayoutReconcile as Se, useColumnLayoutWriter as ce, useSavedColumnLayout as fe } from "./useColumnLayoutPersistence.js";
|
|
14
|
+
import { RowSelectionTooltipFeature as ye } from "../custom-features/row-selection-tooltip/RowSelectionTooltipFeature.js";
|
|
15
|
+
import { getLeafColumnInfos as Ce } from "../helpers/columnIds.js";
|
|
16
|
+
import { resolveColumnSizingDefaults as be } from "../helpers/columnSizingDefaults.js";
|
|
17
|
+
import { STYLED_DEFAULT_SORTING_FN as pe, createStyledDefaultSortingFn as ve, resolveSortUndefinedDefaults as ze } from "../helpers/defaultSortingFn.js";
|
|
18
|
+
import { useEffect as C, useMemo as b, useRef as I } from "react";
|
|
19
|
+
import { getCoreRowModel as Re, getExpandedRowModel as Oe, getFilteredRowModel as Ke, getPaginationRowModel as Ve, getSortedRowModel as Me, useReactTable as Ie } from "@tanstack/react-table";
|
|
20
|
+
var Le = [], Fe = {}, we = [], _e = { [H]: !1 }, Qe = (p) => {
|
|
21
|
+
const { columns: v, data: G, initialState: s, pageSize: W, enableRowSelection: A, tableInstanceRef: L, locale: B, persistColumnOrderKey: g, uniqueKey: a, persistSorting: Y, persistColumnLayout: j, legacyColumnVisibilityKey: F, defaultColumn: r, ...t } = p, w = s?.sorting ?? Le, z = s?.columnSizing ?? Fe, R = p.enableColumnResizing ?? !0, q = p.enableColumnResizing === !0, J = b(() => ze(be(v, {
|
|
22
|
+
defaultColumn: r,
|
|
23
23
|
enableSorting: t.enableSorting,
|
|
24
|
-
canResize:
|
|
25
|
-
}),
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
canResize: R
|
|
25
|
+
}), r), [
|
|
26
|
+
v,
|
|
27
|
+
r,
|
|
28
28
|
t.enableSorting,
|
|
29
|
-
|
|
30
|
-
]),
|
|
31
|
-
defaultColumn:
|
|
29
|
+
R
|
|
30
|
+
]), O = Ce(v, {
|
|
31
|
+
defaultColumn: r,
|
|
32
32
|
enableSorting: t.enableSorting,
|
|
33
33
|
enableMultiSort: t.enableMultiSort,
|
|
34
34
|
enableHiding: t.enableHiding
|
|
35
|
-
}), i =
|
|
35
|
+
}), i = j === !0, _ = O.map((o) => o.id), l = ee(s?.columnOrder ?? we, _), m = s?.columnVisibility ?? _e, n = fe({
|
|
36
36
|
enabled: i,
|
|
37
|
-
uniqueKey:
|
|
38
|
-
legacyOrderKey:
|
|
39
|
-
legacyVisibilityKey:
|
|
40
|
-
columns:
|
|
41
|
-
defaultOrder:
|
|
42
|
-
defaultVisibility:
|
|
43
|
-
}), D =
|
|
44
|
-
|
|
45
|
-
persistSorting: q,
|
|
46
|
-
controlled: E
|
|
47
|
-
}) ? ge(r) : void 0, M = b(() => S ? me(r, {
|
|
48
|
-
sortableColumns: K.filter((o) => o.canSort),
|
|
37
|
+
uniqueKey: a,
|
|
38
|
+
legacyOrderKey: g,
|
|
39
|
+
legacyVisibilityKey: F,
|
|
40
|
+
columns: O,
|
|
41
|
+
defaultOrder: l,
|
|
42
|
+
defaultVisibility: m
|
|
43
|
+
}), D = oe(i ? void 0 : g), P = q ? a : void 0, N = le(P), K = ae(P, z), S = Y ? ue(a) : void 0, V = b(() => S ? de(a, {
|
|
44
|
+
sortableColumns: O.filter((o) => o.canSort),
|
|
49
45
|
maxMultiSortColCount: t.maxMultiSortColCount
|
|
50
|
-
}) : void 0, [S]),
|
|
51
|
-
...
|
|
52
|
-
sortingFn:
|
|
53
|
-
}), [
|
|
46
|
+
}) : void 0, [S]), u = ne(a) ?? W ?? 50, T = I(void 0), Z = b(() => ve(() => T.current), []), k = b(() => ({
|
|
47
|
+
...r,
|
|
48
|
+
sortingFn: r?.sortingFn ?? "styledDefault"
|
|
49
|
+
}), [r]), e = Ie({
|
|
54
50
|
_features: [
|
|
51
|
+
Q,
|
|
52
|
+
X,
|
|
55
53
|
$,
|
|
56
|
-
|
|
57
|
-
te,
|
|
58
|
-
pe
|
|
54
|
+
ye
|
|
59
55
|
],
|
|
60
|
-
columns:
|
|
61
|
-
data:
|
|
56
|
+
columns: J,
|
|
57
|
+
data: G,
|
|
62
58
|
meta: {
|
|
63
|
-
locale:
|
|
59
|
+
locale: B ?? "en",
|
|
64
60
|
hideHeader: !!t.hideHeader
|
|
65
61
|
},
|
|
66
62
|
initialState: {
|
|
67
63
|
pagination: {
|
|
68
64
|
pageIndex: 0,
|
|
69
|
-
pageSize:
|
|
65
|
+
pageSize: u
|
|
70
66
|
},
|
|
71
67
|
columnVisibility: {
|
|
72
|
-
...
|
|
73
|
-
[
|
|
68
|
+
...s?.columnVisibility,
|
|
69
|
+
[H]: !1
|
|
74
70
|
},
|
|
75
71
|
...D && { columnOrder: D },
|
|
76
|
-
...
|
|
77
|
-
...i &&
|
|
72
|
+
...s,
|
|
73
|
+
...i && l.length > 0 && { columnOrder: l },
|
|
78
74
|
...n.order && { columnOrder: n.order },
|
|
79
75
|
...n.visibility && { columnVisibility: n.visibility },
|
|
80
|
-
...
|
|
81
|
-
...
|
|
76
|
+
...K && { columnSizing: K },
|
|
77
|
+
...V !== void 0 && { sorting: V }
|
|
82
78
|
},
|
|
83
|
-
enableRowSelection:
|
|
84
|
-
getCoreRowModel:
|
|
85
|
-
getExpandedRowModel:
|
|
86
|
-
getFilteredRowModel:
|
|
87
|
-
getSortedRowModel:
|
|
88
|
-
getPaginationRowModel:
|
|
89
|
-
getRowId: t.getRowId ?? ((o,
|
|
90
|
-
defaultColumn:
|
|
79
|
+
enableRowSelection: A,
|
|
80
|
+
getCoreRowModel: Re(),
|
|
81
|
+
getExpandedRowModel: Oe(),
|
|
82
|
+
getFilteredRowModel: Ke(),
|
|
83
|
+
getSortedRowModel: Me(),
|
|
84
|
+
getPaginationRowModel: Ve(),
|
|
85
|
+
getRowId: t.getRowId ?? ((o, x, c) => c ? [c.id, o.id].join(".") : o.id.toString()),
|
|
86
|
+
defaultColumn: k,
|
|
91
87
|
...t,
|
|
92
|
-
enableColumnResizing:
|
|
88
|
+
enableColumnResizing: R,
|
|
93
89
|
sortingFns: {
|
|
94
|
-
[
|
|
90
|
+
[pe]: Z,
|
|
95
91
|
...t.sortingFns
|
|
96
92
|
}
|
|
97
93
|
});
|
|
98
|
-
|
|
99
|
-
const
|
|
94
|
+
T.current = e;
|
|
95
|
+
const f = e.options.meta?.locale, E = I(f);
|
|
100
96
|
C(() => {
|
|
101
|
-
|
|
102
|
-
}, [
|
|
97
|
+
E.current !== f && (E.current = f, e.getState().sorting.length > 0 && e.setSorting((o) => [...o]));
|
|
98
|
+
}, [f, e]), L && (L.current = e), te(e, i ? void 0 : g), ce(e, {
|
|
103
99
|
saved: n,
|
|
104
|
-
reconciling:
|
|
100
|
+
reconciling: Se(e, {
|
|
105
101
|
enabled: i,
|
|
106
102
|
definitionIds: _,
|
|
107
|
-
defaultOrder:
|
|
108
|
-
defaultVisibility:
|
|
103
|
+
defaultOrder: l,
|
|
104
|
+
defaultVisibility: m,
|
|
109
105
|
controlledVisibility: t.state?.columnVisibility !== void 0
|
|
110
106
|
}),
|
|
111
|
-
defaultOrder:
|
|
112
|
-
defaultVisibility:
|
|
107
|
+
defaultOrder: l,
|
|
108
|
+
defaultVisibility: m,
|
|
113
109
|
controlledVisibility: t.state?.columnVisibility !== void 0
|
|
114
110
|
}), C(() => {
|
|
115
|
-
}, [i, t.state?.columnVisibility !== void 0 || t.onColumnVisibilityChange !== void 0]),
|
|
111
|
+
}, [i, t.state?.columnVisibility !== void 0 || t.onColumnVisibilityChange !== void 0]), U({
|
|
116
112
|
storageKey: S,
|
|
117
113
|
state: e.getState().sorting,
|
|
118
|
-
defaultValue:
|
|
119
|
-
saved:
|
|
120
|
-
controlled:
|
|
121
|
-
toSignature:
|
|
122
|
-
toStorage:
|
|
114
|
+
defaultValue: w,
|
|
115
|
+
saved: V,
|
|
116
|
+
controlled: t.state?.sorting !== void 0,
|
|
117
|
+
toSignature: me,
|
|
118
|
+
toStorage: ge,
|
|
123
119
|
applyState: (o) => e.setSorting(o)
|
|
124
|
-
}),
|
|
125
|
-
storageKey:
|
|
120
|
+
}), U({
|
|
121
|
+
storageKey: N,
|
|
126
122
|
state: e.getState().columnSizing,
|
|
127
|
-
defaultValue:
|
|
128
|
-
saved:
|
|
123
|
+
defaultValue: z,
|
|
124
|
+
saved: K,
|
|
129
125
|
settled: !e.getState().columnSizingInfo.isResizingColumn,
|
|
130
|
-
toSignature:
|
|
131
|
-
toStorage:
|
|
126
|
+
toSignature: re,
|
|
127
|
+
toStorage: se,
|
|
132
128
|
applyState: (o) => e.setColumnSizing(o)
|
|
133
129
|
}), e.columnLayoutDefaults = i ? {
|
|
134
|
-
order:
|
|
135
|
-
visibility:
|
|
130
|
+
order: l,
|
|
131
|
+
visibility: m
|
|
136
132
|
} : void 0, e.resetColumnSettings = () => {
|
|
137
|
-
e.setColumnOrder(i ?
|
|
133
|
+
e.setColumnOrder(i ? l : []), e.setColumnSizing(z), i && e.setColumnVisibility(m), S && e.setSorting(w);
|
|
138
134
|
const o = i && n.orderKey !== void 0 ? [
|
|
139
135
|
n.orderKey,
|
|
140
136
|
n.visibilityKey,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
] : [],
|
|
144
|
-
for (const
|
|
137
|
+
g,
|
|
138
|
+
F
|
|
139
|
+
] : [], x = i ? void 0 : g;
|
|
140
|
+
for (const c of [
|
|
145
141
|
S,
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
N,
|
|
143
|
+
x,
|
|
148
144
|
...o
|
|
149
|
-
])
|
|
145
|
+
]) c && h.remove(c);
|
|
150
146
|
};
|
|
151
|
-
const
|
|
147
|
+
const d = ie(a), y = e.getState().pagination?.pageSize, M = I(void 0);
|
|
152
148
|
return C(() => {
|
|
153
|
-
|
|
149
|
+
M.current = void 0, e.getState().pagination?.pageSize !== u && (e.setPageIndex(0), e.setPageSize(u));
|
|
154
150
|
}, [
|
|
151
|
+
u,
|
|
155
152
|
d,
|
|
156
|
-
g,
|
|
157
153
|
e
|
|
158
154
|
]), C(() => {
|
|
159
|
-
if (!(!
|
|
160
|
-
if (
|
|
161
|
-
if (
|
|
162
|
-
|
|
163
|
-
return;
|
|
155
|
+
if (!(!d || y == null)) {
|
|
156
|
+
if (M.current !== d) {
|
|
157
|
+
if (y !== u) return;
|
|
158
|
+
M.current = d;
|
|
164
159
|
}
|
|
165
|
-
|
|
160
|
+
h.set(d, JSON.stringify(y));
|
|
166
161
|
}
|
|
167
162
|
}, [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
163
|
+
y,
|
|
164
|
+
u,
|
|
165
|
+
d
|
|
171
166
|
]), { table: e };
|
|
172
167
|
};
|
|
173
168
|
export {
|
|
174
|
-
|
|
169
|
+
Qe as useStyledTable
|
|
175
170
|
};
|