asma-ui-core 3.133.1 → 3.134.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/dist/asma-ui-core.css +1 -1
- package/dist/src/table/helpers/defaultSortingFn.d.ts +48 -0
- package/dist/src/table/helpers/defaultSortingFn.test.d.ts +1 -0
- package/dist/src/table/types.d.ts +13 -0
- package/dist/table/helpers/defaultSortingFn.js +60 -0
- package/dist/table/hooks/useStyledTable.js +124 -112
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BuiltInSortingFn, SortingFn, Table } from '@tanstack/react-table';
|
|
2
|
+
/**
|
|
3
|
+
* The comparison every `StyledTable` column uses unless the column, or the app's `defaultColumn`, names its own `sortingFn`
|
|
4
|
+
* (ASMA-8597, P2f, DEC-SORTFN). It is registered as `sortingFns.styledDefault`.
|
|
5
|
+
*
|
|
6
|
+
* - Empty cells (`undefined`, `null`, `''`, whitespace only, `NaN`, an invalid `Date`) go last in both directions. Two empty
|
|
7
|
+
* cells tie.
|
|
8
|
+
* - Numbers, `Date`s and booleans compare by value; two ISO 8601 date strings compare by time.
|
|
9
|
+
* - Any other two strings, and two values of different types, compare as text in the table locale: case and accents are
|
|
10
|
+
* ignored and digit runs compare as numbers (`svc-9` before `svc-10`).
|
|
11
|
+
* - Ties return 0, so TanStack keeps the data order.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* The name the comparison is registered under in the table's `sortingFns`. It is typed as a built-in name because TanStack's
|
|
15
|
+
* `SortingFns` interface, which would let `'styledDefault'` type-check, turns `sortingFns` into a required prop of every
|
|
16
|
+
* `StyledTable` once it is augmented; the table registers the function itself, so no app needs to.
|
|
17
|
+
*/
|
|
18
|
+
export declare const STYLED_DEFAULT_SORTING_FN: BuiltInSortingFn;
|
|
19
|
+
/** One collator per locale: building one is the expensive part of a text comparison. */
|
|
20
|
+
export declare const getSortCollator: (locale?: string) => Intl.Collator;
|
|
21
|
+
/** Whether a cell has no value to sort on: such cells always go last. */
|
|
22
|
+
export declare const isEmptySortValue: (value: unknown) => boolean;
|
|
23
|
+
/** Compares two cells that are not empty, ascending. A tie is exactly 0. */
|
|
24
|
+
export declare const compareSortValues: (a: unknown, b: unknown, collator: Intl.Collator) => number;
|
|
25
|
+
/**
|
|
26
|
+
* Builds the comparison. TanStack hands a sorting function only `(rowA, rowB, columnId)` and flips its result afterwards
|
|
27
|
+
* for a descending sort and for `invertSorting`, so an empty cell would swap ends with the direction. To keep it last the
|
|
28
|
+
* comparison reads the column's direction and `invertSorting` live from the table (`getTable` returns the table of the
|
|
29
|
+
* render that sorts) and returns the sign that comes out "after" once TanStack has applied both flips.
|
|
30
|
+
*/
|
|
31
|
+
export declare const createStyledDefaultSortingFn: <TData>(getTable: () => Table<TData> | undefined) => SortingFn<TData>;
|
|
32
|
+
/** The parts of a column definition that decide whether the default comparison applies to it. */
|
|
33
|
+
interface SortUndefinedColumnDef {
|
|
34
|
+
sortingFn?: unknown;
|
|
35
|
+
sortUndefined?: unknown;
|
|
36
|
+
columns?: readonly SortUndefinedColumnDef[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Gives `sortUndefined: false` to the leaf columns that sort with `styledDefault`, and to no other (DeepSeek's audit of
|
|
40
|
+
* #340, round 1). The setting lets `undefined` reach the comparison so that it can put it last. A column with its own
|
|
41
|
+
* `sortingFn` would then receive `undefined` in its own comparator, which was written for TanStack's handling and may not
|
|
42
|
+
* expect it, so it keeps TanStack's default.
|
|
43
|
+
*
|
|
44
|
+
* A leaf gets it only when it sorts with `styledDefault` (neither it nor the app's `defaultColumn` names another
|
|
45
|
+
* `sortingFn`) and neither it nor the app's `defaultColumn` sets `sortUndefined`. Group columns are walked into.
|
|
46
|
+
*/
|
|
47
|
+
export declare const resolveSortUndefinedDefaults: <TColumn extends SortUndefinedColumnDef>(columns: readonly TColumn[], defaultColumn?: SortUndefinedColumnDef) => TColumn[];
|
|
48
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -73,6 +73,19 @@ export type RowActionsState = {
|
|
|
73
73
|
state: 'enabled';
|
|
74
74
|
};
|
|
75
75
|
export type StyledTableProps<TData, TCustomData> = {
|
|
76
|
+
/**
|
|
77
|
+
* The table's language. It sets the labels, and also the text order of the default sort: names compare in this locale,
|
|
78
|
+
* ignoring case and accents, with digit runs as numbers (`'no'` puts æ, ø and å after z).
|
|
79
|
+
*
|
|
80
|
+
* **Default sort.** Unless a column sets its own `sortingFn` (or the table's `defaultColumn` does), the column sorts with
|
|
81
|
+
* `sortingFns.styledDefault` (ASMA-8597, P2f): numbers, dates and booleans by value, ISO date strings by time, other
|
|
82
|
+
* text in the table locale, ties in the data order. Empty cells (`undefined`, `null`, `''`, whitespace, `NaN`, an invalid
|
|
83
|
+
* `Date`) always go last, in both directions. A column with its own `sortingFn`, or one that `defaultColumn: { sortingFn }`
|
|
84
|
+
* covers, is not touched: its comparator, and TanStack's handling of `undefined` before it, stay as they were. A column's own
|
|
85
|
+
* `sortUndefined` only decides where `undefined` goes (TanStack handles it before the comparison); `null`, `''`,
|
|
86
|
+
* whitespace, `NaN` and an invalid `Date` still go last through `styledDefault`. The table's own `sortingFns` are kept
|
|
87
|
+
* beside `styledDefault`.
|
|
88
|
+
*/
|
|
76
89
|
locale?: 'no' | 'en';
|
|
77
90
|
height?: string | number;
|
|
78
91
|
actions?: (row: Row<TData>) => (IAction<TData> | ICustomAction<TData>)[];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var E = "styledDefault", v = (e) => e === "no" ? "nb" : e ?? "en", p = /* @__PURE__ */ new Map(), S = (e) => {
|
|
2
|
+
const t = v(e);
|
|
3
|
+
let r = p.get(t);
|
|
4
|
+
return r || (r = new Intl.Collator(t, {
|
|
5
|
+
numeric: !0,
|
|
6
|
+
sensitivity: "base"
|
|
7
|
+
}), p.set(t, r)), r;
|
|
8
|
+
}, D = /^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:[.,]\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/, y = [
|
|
9
|
+
31,
|
|
10
|
+
28,
|
|
11
|
+
31,
|
|
12
|
+
30,
|
|
13
|
+
31,
|
|
14
|
+
30,
|
|
15
|
+
31,
|
|
16
|
+
31,
|
|
17
|
+
30,
|
|
18
|
+
31,
|
|
19
|
+
30,
|
|
20
|
+
31
|
|
21
|
+
], T = (e) => e % 4 === 0 && e % 100 !== 0 || e % 400 === 0, b = (e, t, r) => t >= 1 && t <= 12 && r >= 1 && r <= (t === 2 && T(e) ? 29 : y[t - 1]), l = (e) => {
|
|
22
|
+
if (!D.test(e) || !b(Number(e.slice(0, 4)), Number(e.slice(5, 7)), Number(e.slice(8, 10)))) return;
|
|
23
|
+
const t = Date.parse(e.replace(" ", "T").replace(",", "."));
|
|
24
|
+
return Number.isNaN(t) ? void 0 : t;
|
|
25
|
+
}, u = (e) => e == null || typeof e == "string" && e.trim() === "" || typeof e == "number" && Number.isNaN(e) || e instanceof Date && Number.isNaN(e.getTime()), f = (e, t) => e < t ? -1 : e > t ? 1 : 0, F = (e, t, r) => {
|
|
26
|
+
if (typeof e == "number" && typeof t == "number") return f(e, t);
|
|
27
|
+
if (e instanceof Date && t instanceof Date) return f(e.getTime(), t.getTime());
|
|
28
|
+
if (typeof e == "boolean" && typeof t == "boolean") return f(Number(e), Number(t));
|
|
29
|
+
if (typeof e == "string" && typeof t == "string") {
|
|
30
|
+
const i = l(e), o = l(t);
|
|
31
|
+
return i !== void 0 && o !== void 0 ? f(i, o) : r.compare(e, t) || 0;
|
|
32
|
+
}
|
|
33
|
+
return r.compare(String(e), String(t)) || 0;
|
|
34
|
+
}, U = (e) => (t, r, i) => {
|
|
35
|
+
const o = t.getValue(i), n = r.getValue(i), s = u(o), a = u(n), d = e();
|
|
36
|
+
if (s || a) {
|
|
37
|
+
if (s && a) return 0;
|
|
38
|
+
const m = d?.getState().sorting.find((N) => N.id === i)?.desc ?? !1, g = d?.getColumn(i)?.columnDef.invertSorting ?? !1, c = (m ? -1 : 1) * (g ? -1 : 1);
|
|
39
|
+
return s ? c : -c;
|
|
40
|
+
}
|
|
41
|
+
return F(o, n, S(d?.options.meta?.locale));
|
|
42
|
+
}, _ = (e, t) => {
|
|
43
|
+
const r = t?.sortingFn, i = t?.sortUndefined !== void 0, o = (n) => {
|
|
44
|
+
if (n.columns?.length) return {
|
|
45
|
+
...n,
|
|
46
|
+
columns: n.columns.map((a) => o(a))
|
|
47
|
+
};
|
|
48
|
+
const s = n.sortingFn ?? r;
|
|
49
|
+
return !(s == null || s === "styledDefault") || n.sortUndefined !== void 0 || i ? n : {
|
|
50
|
+
...n,
|
|
51
|
+
sortUndefined: !1
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
return e.map(o);
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
E as STYLED_DEFAULT_SORTING_FN,
|
|
58
|
+
U as createStyledDefaultSortingFn,
|
|
59
|
+
_ as resolveSortUndefinedDefaults
|
|
60
|
+
};
|
|
@@ -1,158 +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 {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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,
|
|
22
23
|
enableSorting: t.enableSorting,
|
|
23
|
-
canResize:
|
|
24
|
-
}), [
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
canResize: R
|
|
25
|
+
}), r), [
|
|
26
|
+
v,
|
|
27
|
+
r,
|
|
27
28
|
t.enableSorting,
|
|
28
|
-
|
|
29
|
-
]),
|
|
30
|
-
defaultColumn:
|
|
29
|
+
R
|
|
30
|
+
]), O = Ce(v, {
|
|
31
|
+
defaultColumn: r,
|
|
31
32
|
enableSorting: t.enableSorting,
|
|
32
33
|
enableMultiSort: t.enableMultiSort,
|
|
33
34
|
enableHiding: t.enableHiding
|
|
34
|
-
}),
|
|
35
|
-
enabled:
|
|
35
|
+
}), i = j === !0, _ = O.map((o) => o.id), l = ee(s?.columnOrder ?? we, _), m = s?.columnVisibility ?? _e, n = fe({
|
|
36
|
+
enabled: i,
|
|
36
37
|
uniqueKey: a,
|
|
37
|
-
legacyOrderKey:
|
|
38
|
-
legacyVisibilityKey:
|
|
39
|
-
columns:
|
|
40
|
-
defaultOrder:
|
|
41
|
-
defaultVisibility:
|
|
42
|
-
}),
|
|
43
|
-
sortableColumns:
|
|
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),
|
|
44
45
|
maxMultiSortColCount: t.maxMultiSortColCount
|
|
45
|
-
}) : void 0, [
|
|
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({
|
|
46
50
|
_features: [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
Q,
|
|
52
|
+
X,
|
|
53
|
+
$,
|
|
54
|
+
ye
|
|
51
55
|
],
|
|
52
|
-
columns:
|
|
53
|
-
data:
|
|
56
|
+
columns: J,
|
|
57
|
+
data: G,
|
|
54
58
|
meta: {
|
|
55
|
-
locale:
|
|
59
|
+
locale: B ?? "en",
|
|
56
60
|
hideHeader: !!t.hideHeader
|
|
57
61
|
},
|
|
58
62
|
initialState: {
|
|
59
63
|
pagination: {
|
|
60
64
|
pageIndex: 0,
|
|
61
|
-
pageSize:
|
|
65
|
+
pageSize: u
|
|
62
66
|
},
|
|
63
67
|
columnVisibility: {
|
|
64
|
-
...
|
|
65
|
-
[
|
|
68
|
+
...s?.columnVisibility,
|
|
69
|
+
[H]: !1
|
|
66
70
|
},
|
|
67
|
-
...
|
|
68
|
-
...
|
|
69
|
-
...
|
|
71
|
+
...D && { columnOrder: D },
|
|
72
|
+
...s,
|
|
73
|
+
...i && l.length > 0 && { columnOrder: l },
|
|
70
74
|
...n.order && { columnOrder: n.order },
|
|
71
75
|
...n.visibility && { columnVisibility: n.visibility },
|
|
72
|
-
...
|
|
73
|
-
...
|
|
76
|
+
...K && { columnSizing: K },
|
|
77
|
+
...V !== void 0 && { sorting: V }
|
|
74
78
|
},
|
|
75
|
-
enableRowSelection:
|
|
76
|
-
getCoreRowModel:
|
|
77
|
-
getExpandedRowModel:
|
|
78
|
-
getFilteredRowModel:
|
|
79
|
-
getSortedRowModel:
|
|
80
|
-
getPaginationRowModel:
|
|
81
|
-
getRowId: t.getRowId ?? ((
|
|
82
|
-
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,
|
|
83
87
|
...t,
|
|
84
|
-
enableColumnResizing:
|
|
88
|
+
enableColumnResizing: R,
|
|
89
|
+
sortingFns: {
|
|
90
|
+
[pe]: Z,
|
|
91
|
+
...t.sortingFns
|
|
92
|
+
}
|
|
85
93
|
});
|
|
86
|
-
|
|
94
|
+
T.current = e;
|
|
95
|
+
const f = e.options.meta?.locale, E = I(f);
|
|
96
|
+
C(() => {
|
|
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, {
|
|
87
99
|
saved: n,
|
|
88
|
-
reconciling:
|
|
89
|
-
enabled:
|
|
90
|
-
definitionIds:
|
|
91
|
-
defaultOrder:
|
|
92
|
-
defaultVisibility:
|
|
100
|
+
reconciling: Se(e, {
|
|
101
|
+
enabled: i,
|
|
102
|
+
definitionIds: _,
|
|
103
|
+
defaultOrder: l,
|
|
104
|
+
defaultVisibility: m,
|
|
93
105
|
controlledVisibility: t.state?.columnVisibility !== void 0
|
|
94
106
|
}),
|
|
95
|
-
defaultOrder:
|
|
96
|
-
defaultVisibility:
|
|
107
|
+
defaultOrder: l,
|
|
108
|
+
defaultVisibility: m,
|
|
97
109
|
controlledVisibility: t.state?.columnVisibility !== void 0
|
|
98
|
-
}),
|
|
99
|
-
}, [
|
|
100
|
-
storageKey:
|
|
110
|
+
}), C(() => {
|
|
111
|
+
}, [i, t.state?.columnVisibility !== void 0 || t.onColumnVisibilityChange !== void 0]), U({
|
|
112
|
+
storageKey: S,
|
|
101
113
|
state: e.getState().sorting,
|
|
102
|
-
defaultValue:
|
|
103
|
-
saved:
|
|
114
|
+
defaultValue: w,
|
|
115
|
+
saved: V,
|
|
104
116
|
controlled: t.state?.sorting !== void 0,
|
|
105
|
-
toSignature:
|
|
106
|
-
toStorage:
|
|
107
|
-
applyState: (
|
|
108
|
-
}),
|
|
109
|
-
storageKey:
|
|
117
|
+
toSignature: me,
|
|
118
|
+
toStorage: ge,
|
|
119
|
+
applyState: (o) => e.setSorting(o)
|
|
120
|
+
}), U({
|
|
121
|
+
storageKey: N,
|
|
110
122
|
state: e.getState().columnSizing,
|
|
111
|
-
defaultValue:
|
|
112
|
-
saved:
|
|
123
|
+
defaultValue: z,
|
|
124
|
+
saved: K,
|
|
113
125
|
settled: !e.getState().columnSizingInfo.isResizingColumn,
|
|
114
|
-
toSignature:
|
|
115
|
-
toStorage:
|
|
116
|
-
applyState: (
|
|
117
|
-
}), e.columnLayoutDefaults =
|
|
118
|
-
order:
|
|
119
|
-
visibility:
|
|
126
|
+
toSignature: re,
|
|
127
|
+
toStorage: se,
|
|
128
|
+
applyState: (o) => e.setColumnSizing(o)
|
|
129
|
+
}), e.columnLayoutDefaults = i ? {
|
|
130
|
+
order: l,
|
|
131
|
+
visibility: m
|
|
120
132
|
} : void 0, e.resetColumnSettings = () => {
|
|
121
|
-
e.setColumnOrder(
|
|
122
|
-
const
|
|
133
|
+
e.setColumnOrder(i ? l : []), e.setColumnSizing(z), i && e.setColumnVisibility(m), S && e.setSorting(w);
|
|
134
|
+
const o = i && n.orderKey !== void 0 ? [
|
|
123
135
|
n.orderKey,
|
|
124
136
|
n.visibilityKey,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
] : [],
|
|
128
|
-
for (const
|
|
129
|
-
|
|
130
|
-
_,
|
|
137
|
+
g,
|
|
138
|
+
F
|
|
139
|
+
] : [], x = i ? void 0 : g;
|
|
140
|
+
for (const c of [
|
|
141
|
+
S,
|
|
131
142
|
N,
|
|
132
|
-
|
|
133
|
-
|
|
143
|
+
x,
|
|
144
|
+
...o
|
|
145
|
+
]) c && h.remove(c);
|
|
134
146
|
};
|
|
135
|
-
const
|
|
136
|
-
return
|
|
137
|
-
|
|
147
|
+
const d = ie(a), y = e.getState().pagination?.pageSize, M = I(void 0);
|
|
148
|
+
return C(() => {
|
|
149
|
+
M.current = void 0, e.getState().pagination?.pageSize !== u && (e.setPageIndex(0), e.setPageSize(u));
|
|
138
150
|
}, [
|
|
139
|
-
s,
|
|
140
151
|
u,
|
|
152
|
+
d,
|
|
141
153
|
e
|
|
142
|
-
]),
|
|
143
|
-
if (!(!
|
|
144
|
-
if (
|
|
145
|
-
if (
|
|
146
|
-
|
|
154
|
+
]), C(() => {
|
|
155
|
+
if (!(!d || y == null)) {
|
|
156
|
+
if (M.current !== d) {
|
|
157
|
+
if (y !== u) return;
|
|
158
|
+
M.current = d;
|
|
147
159
|
}
|
|
148
|
-
|
|
160
|
+
h.set(d, JSON.stringify(y));
|
|
149
161
|
}
|
|
150
162
|
}, [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
163
|
+
y,
|
|
164
|
+
u,
|
|
165
|
+
d
|
|
154
166
|
]), { table: e };
|
|
155
167
|
};
|
|
156
168
|
export {
|
|
157
|
-
|
|
169
|
+
Qe as useStyledTable
|
|
158
170
|
};
|