laif-ds 0.1.5 → 0.1.6
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/ui/data-table.js +122 -0
- package/dist/components/ui/toaster.js +26 -0
- package/dist/dist/_virtual/jsx-runtime.js +6 -0
- package/dist/dist/_virtual/jsx-runtime2.js +5 -0
- package/dist/dist/_virtual/react-jsx-runtime.development.js +5 -0
- package/dist/dist/_virtual/react-jsx-runtime.production.js +5 -0
- package/dist/dist/components/ui/checkbox.js +32 -0
- package/dist/dist/components/ui/scroll-area.js +61 -0
- package/dist/dist/components/ui/table.js +87 -0
- package/dist/dist/lib/utils.js +9 -0
- package/dist/dist/node_modules/@radix-ui/number/dist/index.js +7 -0
- package/dist/dist/node_modules/@radix-ui/primitive/dist/index.js +10 -0
- package/dist/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +136 -0
- package/dist/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +30 -0
- package/dist/dist/node_modules/@radix-ui/react-context/dist/index.js +56 -0
- package/dist/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
- package/dist/dist/node_modules/@radix-ui/react-presence/dist/index.js +72 -0
- package/dist/dist/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js +534 -0
- package/dist/dist/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +14 -0
- package/dist/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +33 -0
- package/dist/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
- package/dist/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +9 -0
- package/dist/dist/node_modules/@radix-ui/react-use-size/dist/index.js +28 -0
- package/dist/dist/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/Icon.js +41 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +28 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +21 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/icons/check.js +13 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +20 -0
- package/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.js +248 -0
- package/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.js +36 -0
- package/dist/dist/node_modules/react/jsx-runtime.js +11 -0
- package/dist/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2732 -0
- package/dist/index.d.ts +23 -1
- package/dist/index.js +164 -162
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +103 -0
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1896 -0
- package/dist/styles.css +1 -1
- package/package.json +9 -7
- package/dist/components/ui/sonner.js +0 -23
|
@@ -0,0 +1,1896 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/**
|
|
3
|
+
* table-core
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) TanStack
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
9
|
+
*
|
|
10
|
+
* @license MIT
|
|
11
|
+
*/
|
|
12
|
+
function I(e, o) {
|
|
13
|
+
return typeof e == "function" ? e(o) : e;
|
|
14
|
+
}
|
|
15
|
+
function $(e, o) {
|
|
16
|
+
return (t) => {
|
|
17
|
+
o.setState((n) => ({
|
|
18
|
+
...n,
|
|
19
|
+
[e]: I(t, n[e])
|
|
20
|
+
}));
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function A(e) {
|
|
24
|
+
return e instanceof Function;
|
|
25
|
+
}
|
|
26
|
+
function Se(e) {
|
|
27
|
+
return Array.isArray(e) && e.every((o) => typeof o == "number");
|
|
28
|
+
}
|
|
29
|
+
function me(e, o) {
|
|
30
|
+
const t = [], n = (i) => {
|
|
31
|
+
i.forEach((r) => {
|
|
32
|
+
t.push(r);
|
|
33
|
+
const l = o(r);
|
|
34
|
+
l != null && l.length && n(l);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
return n(e), t;
|
|
38
|
+
}
|
|
39
|
+
function m(e, o, t) {
|
|
40
|
+
let n = [], i;
|
|
41
|
+
return (r) => {
|
|
42
|
+
let l;
|
|
43
|
+
t.key && t.debug && (l = Date.now());
|
|
44
|
+
const u = e(r);
|
|
45
|
+
if (!(u.length !== n.length || u.some((f, S) => n[S] !== f)))
|
|
46
|
+
return i;
|
|
47
|
+
n = u;
|
|
48
|
+
let a;
|
|
49
|
+
if (t.key && t.debug && (a = Date.now()), i = o(...u), t == null || t.onChange == null || t.onChange(i), t.key && t.debug && t != null && t.debug()) {
|
|
50
|
+
const f = Math.round((Date.now() - l) * 100) / 100, S = Math.round((Date.now() - a) * 100) / 100, d = S / 16, s = (c, p) => {
|
|
51
|
+
for (c = String(c); c.length < p; )
|
|
52
|
+
c = " " + c;
|
|
53
|
+
return c;
|
|
54
|
+
};
|
|
55
|
+
console.info(`%c⏱ ${s(S, 5)} /${s(f, 5)} ms`, `
|
|
56
|
+
font-size: .6rem;
|
|
57
|
+
font-weight: bold;
|
|
58
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * d, 120))}deg 100% 31%);`, t == null ? void 0 : t.key);
|
|
59
|
+
}
|
|
60
|
+
return i;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function C(e, o, t, n) {
|
|
64
|
+
return {
|
|
65
|
+
debug: () => {
|
|
66
|
+
var i;
|
|
67
|
+
return (i = e == null ? void 0 : e.debugAll) != null ? i : e[o];
|
|
68
|
+
},
|
|
69
|
+
key: process.env.NODE_ENV === "development" && t,
|
|
70
|
+
onChange: n
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function Ce(e, o, t, n) {
|
|
74
|
+
const i = () => {
|
|
75
|
+
var l;
|
|
76
|
+
return (l = r.getValue()) != null ? l : e.options.renderFallbackValue;
|
|
77
|
+
}, r = {
|
|
78
|
+
id: `${o.id}_${t.id}`,
|
|
79
|
+
row: o,
|
|
80
|
+
column: t,
|
|
81
|
+
getValue: () => o.getValue(n),
|
|
82
|
+
renderValue: i,
|
|
83
|
+
getContext: m(() => [e, t, o, r], (l, u, g, a) => ({
|
|
84
|
+
table: l,
|
|
85
|
+
column: u,
|
|
86
|
+
row: g,
|
|
87
|
+
cell: a,
|
|
88
|
+
getValue: a.getValue,
|
|
89
|
+
renderValue: a.renderValue
|
|
90
|
+
}), C(e.options, "debugCells", "cell.getContext"))
|
|
91
|
+
};
|
|
92
|
+
return e._features.forEach((l) => {
|
|
93
|
+
l.createCell == null || l.createCell(r, t, o, e);
|
|
94
|
+
}, {}), r;
|
|
95
|
+
}
|
|
96
|
+
function Re(e, o, t, n) {
|
|
97
|
+
var i, r;
|
|
98
|
+
const u = {
|
|
99
|
+
...e._getDefaultColumnDef(),
|
|
100
|
+
...o
|
|
101
|
+
}, g = u.accessorKey;
|
|
102
|
+
let a = (i = (r = u.id) != null ? r : g ? typeof String.prototype.replaceAll == "function" ? g.replaceAll(".", "_") : g.replace(/\./g, "_") : void 0) != null ? i : typeof u.header == "string" ? u.header : void 0, f;
|
|
103
|
+
if (u.accessorFn ? f = u.accessorFn : g && (g.includes(".") ? f = (d) => {
|
|
104
|
+
let s = d;
|
|
105
|
+
for (const p of g.split(".")) {
|
|
106
|
+
var c;
|
|
107
|
+
s = (c = s) == null ? void 0 : c[p], process.env.NODE_ENV !== "production" && s === void 0 && console.warn(`"${p}" in deeply nested key "${g}" returned undefined.`);
|
|
108
|
+
}
|
|
109
|
+
return s;
|
|
110
|
+
} : f = (d) => d[u.accessorKey]), !a)
|
|
111
|
+
throw process.env.NODE_ENV !== "production" ? new Error(u.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
|
|
112
|
+
let S = {
|
|
113
|
+
id: `${String(a)}`,
|
|
114
|
+
accessorFn: f,
|
|
115
|
+
parent: n,
|
|
116
|
+
depth: t,
|
|
117
|
+
columnDef: u,
|
|
118
|
+
columns: [],
|
|
119
|
+
getFlatColumns: m(() => [!0], () => {
|
|
120
|
+
var d;
|
|
121
|
+
return [S, ...(d = S.columns) == null ? void 0 : d.flatMap((s) => s.getFlatColumns())];
|
|
122
|
+
}, C(e.options, "debugColumns", "column.getFlatColumns")),
|
|
123
|
+
getLeafColumns: m(() => [e._getOrderColumnsFn()], (d) => {
|
|
124
|
+
var s;
|
|
125
|
+
if ((s = S.columns) != null && s.length) {
|
|
126
|
+
let c = S.columns.flatMap((p) => p.getLeafColumns());
|
|
127
|
+
return d(c);
|
|
128
|
+
}
|
|
129
|
+
return [S];
|
|
130
|
+
}, C(e.options, "debugColumns", "column.getLeafColumns"))
|
|
131
|
+
};
|
|
132
|
+
for (const d of e._features)
|
|
133
|
+
d.createColumn == null || d.createColumn(S, e);
|
|
134
|
+
return S;
|
|
135
|
+
}
|
|
136
|
+
const _ = "debugHeaders";
|
|
137
|
+
function ne(e, o, t) {
|
|
138
|
+
var n;
|
|
139
|
+
let r = {
|
|
140
|
+
id: (n = t.id) != null ? n : o.id,
|
|
141
|
+
column: o,
|
|
142
|
+
index: t.index,
|
|
143
|
+
isPlaceholder: !!t.isPlaceholder,
|
|
144
|
+
placeholderId: t.placeholderId,
|
|
145
|
+
depth: t.depth,
|
|
146
|
+
subHeaders: [],
|
|
147
|
+
colSpan: 0,
|
|
148
|
+
rowSpan: 0,
|
|
149
|
+
headerGroup: null,
|
|
150
|
+
getLeafHeaders: () => {
|
|
151
|
+
const l = [], u = (g) => {
|
|
152
|
+
g.subHeaders && g.subHeaders.length && g.subHeaders.map(u), l.push(g);
|
|
153
|
+
};
|
|
154
|
+
return u(r), l;
|
|
155
|
+
},
|
|
156
|
+
getContext: () => ({
|
|
157
|
+
table: e,
|
|
158
|
+
header: r,
|
|
159
|
+
column: o
|
|
160
|
+
})
|
|
161
|
+
};
|
|
162
|
+
return e._features.forEach((l) => {
|
|
163
|
+
l.createHeader == null || l.createHeader(r, e);
|
|
164
|
+
}), r;
|
|
165
|
+
}
|
|
166
|
+
const we = {
|
|
167
|
+
createTable: (e) => {
|
|
168
|
+
e.getHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, i) => {
|
|
169
|
+
var r, l;
|
|
170
|
+
const u = (r = n == null ? void 0 : n.map((S) => t.find((d) => d.id === S)).filter(Boolean)) != null ? r : [], g = (l = i == null ? void 0 : i.map((S) => t.find((d) => d.id === S)).filter(Boolean)) != null ? l : [], a = t.filter((S) => !(n != null && n.includes(S.id)) && !(i != null && i.includes(S.id)));
|
|
171
|
+
return G(o, [...u, ...a, ...g], e);
|
|
172
|
+
}, C(e.options, _, "getHeaderGroups")), e.getCenterHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, i) => (t = t.filter((r) => !(n != null && n.includes(r.id)) && !(i != null && i.includes(r.id))), G(o, t, e, "center")), C(e.options, _, "getCenterHeaderGroups")), e.getLeftHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
|
|
173
|
+
var i;
|
|
174
|
+
const r = (i = n == null ? void 0 : n.map((l) => t.find((u) => u.id === l)).filter(Boolean)) != null ? i : [];
|
|
175
|
+
return G(o, r, e, "left");
|
|
176
|
+
}, C(e.options, _, "getLeftHeaderGroups")), e.getRightHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
|
|
177
|
+
var i;
|
|
178
|
+
const r = (i = n == null ? void 0 : n.map((l) => t.find((u) => u.id === l)).filter(Boolean)) != null ? i : [];
|
|
179
|
+
return G(o, r, e, "right");
|
|
180
|
+
}, C(e.options, _, "getRightHeaderGroups")), e.getFooterGroups = m(() => [e.getHeaderGroups()], (o) => [...o].reverse(), C(e.options, _, "getFooterGroups")), e.getLeftFooterGroups = m(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), C(e.options, _, "getLeftFooterGroups")), e.getCenterFooterGroups = m(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), C(e.options, _, "getCenterFooterGroups")), e.getRightFooterGroups = m(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), C(e.options, _, "getRightFooterGroups")), e.getFlatHeaders = m(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, _, "getFlatHeaders")), e.getLeftFlatHeaders = m(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, _, "getLeftFlatHeaders")), e.getCenterFlatHeaders = m(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, _, "getCenterFlatHeaders")), e.getRightFlatHeaders = m(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, _, "getRightFlatHeaders")), e.getCenterLeafHeaders = m(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
|
|
181
|
+
var n;
|
|
182
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
183
|
+
}), C(e.options, _, "getCenterLeafHeaders")), e.getLeftLeafHeaders = m(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
|
|
184
|
+
var n;
|
|
185
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
186
|
+
}), C(e.options, _, "getLeftLeafHeaders")), e.getRightLeafHeaders = m(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
|
|
187
|
+
var n;
|
|
188
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
189
|
+
}), C(e.options, _, "getRightLeafHeaders")), e.getLeafHeaders = m(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
|
|
190
|
+
var i, r, l, u, g, a;
|
|
191
|
+
return [...(i = (r = o[0]) == null ? void 0 : r.headers) != null ? i : [], ...(l = (u = t[0]) == null ? void 0 : u.headers) != null ? l : [], ...(g = (a = n[0]) == null ? void 0 : a.headers) != null ? g : []].map((f) => f.getLeafHeaders()).flat();
|
|
192
|
+
}, C(e.options, _, "getLeafHeaders"));
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
function G(e, o, t, n) {
|
|
196
|
+
var i, r;
|
|
197
|
+
let l = 0;
|
|
198
|
+
const u = function(d, s) {
|
|
199
|
+
s === void 0 && (s = 1), l = Math.max(l, s), d.filter((c) => c.getIsVisible()).forEach((c) => {
|
|
200
|
+
var p;
|
|
201
|
+
(p = c.columns) != null && p.length && u(c.columns, s + 1);
|
|
202
|
+
}, 0);
|
|
203
|
+
};
|
|
204
|
+
u(e);
|
|
205
|
+
let g = [];
|
|
206
|
+
const a = (d, s) => {
|
|
207
|
+
const c = {
|
|
208
|
+
depth: s,
|
|
209
|
+
id: [n, `${s}`].filter(Boolean).join("_"),
|
|
210
|
+
headers: []
|
|
211
|
+
}, p = [];
|
|
212
|
+
d.forEach((R) => {
|
|
213
|
+
const w = [...p].reverse()[0], h = R.column.depth === c.depth;
|
|
214
|
+
let v, M = !1;
|
|
215
|
+
if (h && R.column.parent ? v = R.column.parent : (v = R.column, M = !0), w && (w == null ? void 0 : w.column) === v)
|
|
216
|
+
w.subHeaders.push(R);
|
|
217
|
+
else {
|
|
218
|
+
const F = ne(t, v, {
|
|
219
|
+
id: [n, s, v.id, R == null ? void 0 : R.id].filter(Boolean).join("_"),
|
|
220
|
+
isPlaceholder: M,
|
|
221
|
+
placeholderId: M ? `${p.filter((E) => E.column === v).length}` : void 0,
|
|
222
|
+
depth: s,
|
|
223
|
+
index: p.length
|
|
224
|
+
});
|
|
225
|
+
F.subHeaders.push(R), p.push(F);
|
|
226
|
+
}
|
|
227
|
+
c.headers.push(R), R.headerGroup = c;
|
|
228
|
+
}), g.push(c), s > 0 && a(p, s - 1);
|
|
229
|
+
}, f = o.map((d, s) => ne(t, d, {
|
|
230
|
+
depth: l,
|
|
231
|
+
index: s
|
|
232
|
+
}));
|
|
233
|
+
a(f, l - 1), g.reverse();
|
|
234
|
+
const S = (d) => d.filter((c) => c.column.getIsVisible()).map((c) => {
|
|
235
|
+
let p = 0, R = 0, w = [0];
|
|
236
|
+
c.subHeaders && c.subHeaders.length ? (w = [], S(c.subHeaders).forEach((v) => {
|
|
237
|
+
let {
|
|
238
|
+
colSpan: M,
|
|
239
|
+
rowSpan: F
|
|
240
|
+
} = v;
|
|
241
|
+
p += M, w.push(F);
|
|
242
|
+
})) : p = 1;
|
|
243
|
+
const h = Math.min(...w);
|
|
244
|
+
return R = R + h, c.colSpan = p, c.rowSpan = R, {
|
|
245
|
+
colSpan: p,
|
|
246
|
+
rowSpan: R
|
|
247
|
+
};
|
|
248
|
+
});
|
|
249
|
+
return S((i = (r = g[0]) == null ? void 0 : r.headers) != null ? i : []), g;
|
|
250
|
+
}
|
|
251
|
+
const Q = (e, o, t, n, i, r, l) => {
|
|
252
|
+
let u = {
|
|
253
|
+
id: o,
|
|
254
|
+
index: n,
|
|
255
|
+
original: t,
|
|
256
|
+
depth: i,
|
|
257
|
+
parentId: l,
|
|
258
|
+
_valuesCache: {},
|
|
259
|
+
_uniqueValuesCache: {},
|
|
260
|
+
getValue: (g) => {
|
|
261
|
+
if (u._valuesCache.hasOwnProperty(g))
|
|
262
|
+
return u._valuesCache[g];
|
|
263
|
+
const a = e.getColumn(g);
|
|
264
|
+
if (a != null && a.accessorFn)
|
|
265
|
+
return u._valuesCache[g] = a.accessorFn(u.original, n), u._valuesCache[g];
|
|
266
|
+
},
|
|
267
|
+
getUniqueValues: (g) => {
|
|
268
|
+
if (u._uniqueValuesCache.hasOwnProperty(g))
|
|
269
|
+
return u._uniqueValuesCache[g];
|
|
270
|
+
const a = e.getColumn(g);
|
|
271
|
+
if (a != null && a.accessorFn)
|
|
272
|
+
return a.columnDef.getUniqueValues ? (u._uniqueValuesCache[g] = a.columnDef.getUniqueValues(u.original, n), u._uniqueValuesCache[g]) : (u._uniqueValuesCache[g] = [u.getValue(g)], u._uniqueValuesCache[g]);
|
|
273
|
+
},
|
|
274
|
+
renderValue: (g) => {
|
|
275
|
+
var a;
|
|
276
|
+
return (a = u.getValue(g)) != null ? a : e.options.renderFallbackValue;
|
|
277
|
+
},
|
|
278
|
+
subRows: [],
|
|
279
|
+
getLeafRows: () => me(u.subRows, (g) => g.subRows),
|
|
280
|
+
getParentRow: () => u.parentId ? e.getRow(u.parentId, !0) : void 0,
|
|
281
|
+
getParentRows: () => {
|
|
282
|
+
let g = [], a = u;
|
|
283
|
+
for (; ; ) {
|
|
284
|
+
const f = a.getParentRow();
|
|
285
|
+
if (!f) break;
|
|
286
|
+
g.push(f), a = f;
|
|
287
|
+
}
|
|
288
|
+
return g.reverse();
|
|
289
|
+
},
|
|
290
|
+
getAllCells: m(() => [e.getAllLeafColumns()], (g) => g.map((a) => Ce(e, u, a, a.id)), C(e.options, "debugRows", "getAllCells")),
|
|
291
|
+
_getAllCellsByColumnId: m(() => [u.getAllCells()], (g) => g.reduce((a, f) => (a[f.column.id] = f, a), {}), C(e.options, "debugRows", "getAllCellsByColumnId"))
|
|
292
|
+
};
|
|
293
|
+
for (let g = 0; g < e._features.length; g++) {
|
|
294
|
+
const a = e._features[g];
|
|
295
|
+
a == null || a.createRow == null || a.createRow(u, e);
|
|
296
|
+
}
|
|
297
|
+
return u;
|
|
298
|
+
}, he = {
|
|
299
|
+
createColumn: (e, o) => {
|
|
300
|
+
e._getFacetedRowModel = o.options.getFacetedRowModel && o.options.getFacetedRowModel(o, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : o.getPreFilteredRowModel(), e._getFacetedUniqueValues = o.options.getFacetedUniqueValues && o.options.getFacetedUniqueValues(o, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = o.options.getFacetedMinMaxValues && o.options.getFacetedMinMaxValues(o, e.id), e.getFacetedMinMaxValues = () => {
|
|
301
|
+
if (e._getFacetedMinMaxValues)
|
|
302
|
+
return e._getFacetedMinMaxValues();
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
}, ie = (e, o, t) => {
|
|
306
|
+
var n, i;
|
|
307
|
+
const r = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
|
|
308
|
+
return !!(!((i = e.getValue(o)) == null || (i = i.toString()) == null || (i = i.toLowerCase()) == null) && i.includes(r));
|
|
309
|
+
};
|
|
310
|
+
ie.autoRemove = (e) => V(e);
|
|
311
|
+
const re = (e, o, t) => {
|
|
312
|
+
var n;
|
|
313
|
+
return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
|
|
314
|
+
};
|
|
315
|
+
re.autoRemove = (e) => V(e);
|
|
316
|
+
const le = (e, o, t) => {
|
|
317
|
+
var n;
|
|
318
|
+
return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
|
|
319
|
+
};
|
|
320
|
+
le.autoRemove = (e) => V(e);
|
|
321
|
+
const se = (e, o, t) => {
|
|
322
|
+
var n;
|
|
323
|
+
return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
|
|
324
|
+
};
|
|
325
|
+
se.autoRemove = (e) => V(e);
|
|
326
|
+
const ue = (e, o, t) => !t.some((n) => {
|
|
327
|
+
var i;
|
|
328
|
+
return !((i = e.getValue(o)) != null && i.includes(n));
|
|
329
|
+
});
|
|
330
|
+
ue.autoRemove = (e) => V(e) || !(e != null && e.length);
|
|
331
|
+
const ge = (e, o, t) => t.some((n) => {
|
|
332
|
+
var i;
|
|
333
|
+
return (i = e.getValue(o)) == null ? void 0 : i.includes(n);
|
|
334
|
+
});
|
|
335
|
+
ge.autoRemove = (e) => V(e) || !(e != null && e.length);
|
|
336
|
+
const ae = (e, o, t) => e.getValue(o) === t;
|
|
337
|
+
ae.autoRemove = (e) => V(e);
|
|
338
|
+
const de = (e, o, t) => e.getValue(o) == t;
|
|
339
|
+
de.autoRemove = (e) => V(e);
|
|
340
|
+
const W = (e, o, t) => {
|
|
341
|
+
let [n, i] = t;
|
|
342
|
+
const r = e.getValue(o);
|
|
343
|
+
return r >= n && r <= i;
|
|
344
|
+
};
|
|
345
|
+
W.resolveFilterValue = (e) => {
|
|
346
|
+
let [o, t] = e, n = typeof o != "number" ? parseFloat(o) : o, i = typeof t != "number" ? parseFloat(t) : t, r = o === null || Number.isNaN(n) ? -1 / 0 : n, l = t === null || Number.isNaN(i) ? 1 / 0 : i;
|
|
347
|
+
if (r > l) {
|
|
348
|
+
const u = r;
|
|
349
|
+
r = l, l = u;
|
|
350
|
+
}
|
|
351
|
+
return [r, l];
|
|
352
|
+
};
|
|
353
|
+
W.autoRemove = (e) => V(e) || V(e[0]) && V(e[1]);
|
|
354
|
+
const P = {
|
|
355
|
+
includesString: ie,
|
|
356
|
+
includesStringSensitive: re,
|
|
357
|
+
equalsString: le,
|
|
358
|
+
arrIncludes: se,
|
|
359
|
+
arrIncludesAll: ue,
|
|
360
|
+
arrIncludesSome: ge,
|
|
361
|
+
equals: ae,
|
|
362
|
+
weakEquals: de,
|
|
363
|
+
inNumberRange: W
|
|
364
|
+
};
|
|
365
|
+
function V(e) {
|
|
366
|
+
return e == null || e === "";
|
|
367
|
+
}
|
|
368
|
+
const ve = {
|
|
369
|
+
getDefaultColumnDef: () => ({
|
|
370
|
+
filterFn: "auto"
|
|
371
|
+
}),
|
|
372
|
+
getInitialState: (e) => ({
|
|
373
|
+
columnFilters: [],
|
|
374
|
+
...e
|
|
375
|
+
}),
|
|
376
|
+
getDefaultOptions: (e) => ({
|
|
377
|
+
onColumnFiltersChange: $("columnFilters", e),
|
|
378
|
+
filterFromLeafRows: !1,
|
|
379
|
+
maxLeafRowFilterDepth: 100
|
|
380
|
+
}),
|
|
381
|
+
createColumn: (e, o) => {
|
|
382
|
+
e.getAutoFilterFn = () => {
|
|
383
|
+
const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
384
|
+
return typeof n == "string" ? P.includesString : typeof n == "number" ? P.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? P.equals : Array.isArray(n) ? P.arrIncludes : P.weakEquals;
|
|
385
|
+
}, e.getFilterFn = () => {
|
|
386
|
+
var t, n;
|
|
387
|
+
return A(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
|
|
388
|
+
// @ts-ignore
|
|
389
|
+
(t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : P[e.columnDef.filterFn]
|
|
390
|
+
);
|
|
391
|
+
}, e.getCanFilter = () => {
|
|
392
|
+
var t, n, i;
|
|
393
|
+
return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n = o.options.enableColumnFilters) != null ? n : !0) && ((i = o.options.enableFilters) != null ? i : !0) && !!e.accessorFn;
|
|
394
|
+
}, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
|
|
395
|
+
var t;
|
|
396
|
+
return (t = o.getState().columnFilters) == null || (t = t.find((n) => n.id === e.id)) == null ? void 0 : t.value;
|
|
397
|
+
}, e.getFilterIndex = () => {
|
|
398
|
+
var t, n;
|
|
399
|
+
return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((i) => i.id === e.id)) != null ? t : -1;
|
|
400
|
+
}, e.setFilterValue = (t) => {
|
|
401
|
+
o.setColumnFilters((n) => {
|
|
402
|
+
const i = e.getFilterFn(), r = n == null ? void 0 : n.find((f) => f.id === e.id), l = I(t, r ? r.value : void 0);
|
|
403
|
+
if (oe(i, l, e)) {
|
|
404
|
+
var u;
|
|
405
|
+
return (u = n == null ? void 0 : n.filter((f) => f.id !== e.id)) != null ? u : [];
|
|
406
|
+
}
|
|
407
|
+
const g = {
|
|
408
|
+
id: e.id,
|
|
409
|
+
value: l
|
|
410
|
+
};
|
|
411
|
+
if (r) {
|
|
412
|
+
var a;
|
|
413
|
+
return (a = n == null ? void 0 : n.map((f) => f.id === e.id ? g : f)) != null ? a : [];
|
|
414
|
+
}
|
|
415
|
+
return n != null && n.length ? [...n, g] : [g];
|
|
416
|
+
});
|
|
417
|
+
};
|
|
418
|
+
},
|
|
419
|
+
createRow: (e, o) => {
|
|
420
|
+
e.columnFilters = {}, e.columnFiltersMeta = {};
|
|
421
|
+
},
|
|
422
|
+
createTable: (e) => {
|
|
423
|
+
e.setColumnFilters = (o) => {
|
|
424
|
+
const t = e.getAllLeafColumns(), n = (i) => {
|
|
425
|
+
var r;
|
|
426
|
+
return (r = I(o, i)) == null ? void 0 : r.filter((l) => {
|
|
427
|
+
const u = t.find((g) => g.id === l.id);
|
|
428
|
+
if (u) {
|
|
429
|
+
const g = u.getFilterFn();
|
|
430
|
+
if (oe(g, l.value, u))
|
|
431
|
+
return !1;
|
|
432
|
+
}
|
|
433
|
+
return !0;
|
|
434
|
+
});
|
|
435
|
+
};
|
|
436
|
+
e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange(n);
|
|
437
|
+
}, e.resetColumnFilters = (o) => {
|
|
438
|
+
var t, n;
|
|
439
|
+
e.setColumnFilters(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.columnFilters) != null ? t : []);
|
|
440
|
+
}, e.getPreFilteredRowModel = () => e.getCoreRowModel(), e.getFilteredRowModel = () => (!e._getFilteredRowModel && e.options.getFilteredRowModel && (e._getFilteredRowModel = e.options.getFilteredRowModel(e)), e.options.manualFiltering || !e._getFilteredRowModel ? e.getPreFilteredRowModel() : e._getFilteredRowModel());
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
function oe(e, o, t) {
|
|
444
|
+
return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
|
|
445
|
+
}
|
|
446
|
+
const _e = (e, o, t) => t.reduce((n, i) => {
|
|
447
|
+
const r = i.getValue(e);
|
|
448
|
+
return n + (typeof r == "number" ? r : 0);
|
|
449
|
+
}, 0), Fe = (e, o, t) => {
|
|
450
|
+
let n;
|
|
451
|
+
return t.forEach((i) => {
|
|
452
|
+
const r = i.getValue(e);
|
|
453
|
+
r != null && (n > r || n === void 0 && r >= r) && (n = r);
|
|
454
|
+
}), n;
|
|
455
|
+
}, $e = (e, o, t) => {
|
|
456
|
+
let n;
|
|
457
|
+
return t.forEach((i) => {
|
|
458
|
+
const r = i.getValue(e);
|
|
459
|
+
r != null && (n < r || n === void 0 && r >= r) && (n = r);
|
|
460
|
+
}), n;
|
|
461
|
+
}, Ve = (e, o, t) => {
|
|
462
|
+
let n, i;
|
|
463
|
+
return t.forEach((r) => {
|
|
464
|
+
const l = r.getValue(e);
|
|
465
|
+
l != null && (n === void 0 ? l >= l && (n = i = l) : (n > l && (n = l), i < l && (i = l)));
|
|
466
|
+
}), [n, i];
|
|
467
|
+
}, Me = (e, o) => {
|
|
468
|
+
let t = 0, n = 0;
|
|
469
|
+
if (o.forEach((i) => {
|
|
470
|
+
let r = i.getValue(e);
|
|
471
|
+
r != null && (r = +r) >= r && (++t, n += r);
|
|
472
|
+
}), t) return n / t;
|
|
473
|
+
}, Pe = (e, o) => {
|
|
474
|
+
if (!o.length)
|
|
475
|
+
return;
|
|
476
|
+
const t = o.map((r) => r.getValue(e));
|
|
477
|
+
if (!Se(t))
|
|
478
|
+
return;
|
|
479
|
+
if (t.length === 1)
|
|
480
|
+
return t[0];
|
|
481
|
+
const n = Math.floor(t.length / 2), i = t.sort((r, l) => r - l);
|
|
482
|
+
return t.length % 2 !== 0 ? i[n] : (i[n - 1] + i[n]) / 2;
|
|
483
|
+
}, Ie = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), xe = (e, o) => new Set(o.map((t) => t.getValue(e))).size, Ee = (e, o) => o.length, z = {
|
|
484
|
+
sum: _e,
|
|
485
|
+
min: Fe,
|
|
486
|
+
max: $e,
|
|
487
|
+
extent: Ve,
|
|
488
|
+
mean: Me,
|
|
489
|
+
median: Pe,
|
|
490
|
+
unique: Ie,
|
|
491
|
+
uniqueCount: xe,
|
|
492
|
+
count: Ee
|
|
493
|
+
}, De = {
|
|
494
|
+
getDefaultColumnDef: () => ({
|
|
495
|
+
aggregatedCell: (e) => {
|
|
496
|
+
var o, t;
|
|
497
|
+
return (o = (t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) != null ? o : null;
|
|
498
|
+
},
|
|
499
|
+
aggregationFn: "auto"
|
|
500
|
+
}),
|
|
501
|
+
getInitialState: (e) => ({
|
|
502
|
+
grouping: [],
|
|
503
|
+
...e
|
|
504
|
+
}),
|
|
505
|
+
getDefaultOptions: (e) => ({
|
|
506
|
+
onGroupingChange: $("grouping", e),
|
|
507
|
+
groupedColumnMode: "reorder"
|
|
508
|
+
}),
|
|
509
|
+
createColumn: (e, o) => {
|
|
510
|
+
e.toggleGrouping = () => {
|
|
511
|
+
o.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((n) => n !== e.id) : [...t ?? [], e.id]);
|
|
512
|
+
}, e.getCanGroup = () => {
|
|
513
|
+
var t, n;
|
|
514
|
+
return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((n = o.options.enableGrouping) != null ? n : !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue);
|
|
515
|
+
}, e.getIsGrouped = () => {
|
|
516
|
+
var t;
|
|
517
|
+
return (t = o.getState().grouping) == null ? void 0 : t.includes(e.id);
|
|
518
|
+
}, e.getGroupedIndex = () => {
|
|
519
|
+
var t;
|
|
520
|
+
return (t = o.getState().grouping) == null ? void 0 : t.indexOf(e.id);
|
|
521
|
+
}, e.getToggleGroupingHandler = () => {
|
|
522
|
+
const t = e.getCanGroup();
|
|
523
|
+
return () => {
|
|
524
|
+
t && e.toggleGrouping();
|
|
525
|
+
};
|
|
526
|
+
}, e.getAutoAggregationFn = () => {
|
|
527
|
+
const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
528
|
+
if (typeof n == "number")
|
|
529
|
+
return z.sum;
|
|
530
|
+
if (Object.prototype.toString.call(n) === "[object Date]")
|
|
531
|
+
return z.extent;
|
|
532
|
+
}, e.getAggregationFn = () => {
|
|
533
|
+
var t, n;
|
|
534
|
+
if (!e)
|
|
535
|
+
throw new Error();
|
|
536
|
+
return A(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : (t = (n = o.options.aggregationFns) == null ? void 0 : n[e.columnDef.aggregationFn]) != null ? t : z[e.columnDef.aggregationFn];
|
|
537
|
+
};
|
|
538
|
+
},
|
|
539
|
+
createTable: (e) => {
|
|
540
|
+
e.setGrouping = (o) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(o), e.resetGrouping = (o) => {
|
|
541
|
+
var t, n;
|
|
542
|
+
e.setGrouping(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.grouping) != null ? t : []);
|
|
543
|
+
}, e.getPreGroupedRowModel = () => e.getFilteredRowModel(), e.getGroupedRowModel = () => (!e._getGroupedRowModel && e.options.getGroupedRowModel && (e._getGroupedRowModel = e.options.getGroupedRowModel(e)), e.options.manualGrouping || !e._getGroupedRowModel ? e.getPreGroupedRowModel() : e._getGroupedRowModel());
|
|
544
|
+
},
|
|
545
|
+
createRow: (e, o) => {
|
|
546
|
+
e.getIsGrouped = () => !!e.groupingColumnId, e.getGroupingValue = (t) => {
|
|
547
|
+
if (e._groupingValuesCache.hasOwnProperty(t))
|
|
548
|
+
return e._groupingValuesCache[t];
|
|
549
|
+
const n = o.getColumn(t);
|
|
550
|
+
return n != null && n.columnDef.getGroupingValue ? (e._groupingValuesCache[t] = n.columnDef.getGroupingValue(e.original), e._groupingValuesCache[t]) : e.getValue(t);
|
|
551
|
+
}, e._groupingValuesCache = {};
|
|
552
|
+
},
|
|
553
|
+
createCell: (e, o, t, n) => {
|
|
554
|
+
e.getIsGrouped = () => o.getIsGrouped() && o.id === t.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && o.getIsGrouped(), e.getIsAggregated = () => {
|
|
555
|
+
var i;
|
|
556
|
+
return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((i = t.subRows) != null && i.length);
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
function ye(e, o, t) {
|
|
561
|
+
if (!(o != null && o.length) || !t)
|
|
562
|
+
return e;
|
|
563
|
+
const n = e.filter((r) => !o.includes(r.id));
|
|
564
|
+
return t === "remove" ? n : [...o.map((r) => e.find((l) => l.id === r)).filter(Boolean), ...n];
|
|
565
|
+
}
|
|
566
|
+
const Ge = {
|
|
567
|
+
getInitialState: (e) => ({
|
|
568
|
+
columnOrder: [],
|
|
569
|
+
...e
|
|
570
|
+
}),
|
|
571
|
+
getDefaultOptions: (e) => ({
|
|
572
|
+
onColumnOrderChange: $("columnOrder", e)
|
|
573
|
+
}),
|
|
574
|
+
createColumn: (e, o) => {
|
|
575
|
+
e.getIndex = m((t) => [y(o, t)], (t) => t.findIndex((n) => n.id === e.id), C(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
|
|
576
|
+
var n;
|
|
577
|
+
return ((n = y(o, t)[0]) == null ? void 0 : n.id) === e.id;
|
|
578
|
+
}, e.getIsLastColumn = (t) => {
|
|
579
|
+
var n;
|
|
580
|
+
const i = y(o, t);
|
|
581
|
+
return ((n = i[i.length - 1]) == null ? void 0 : n.id) === e.id;
|
|
582
|
+
};
|
|
583
|
+
},
|
|
584
|
+
createTable: (e) => {
|
|
585
|
+
e.setColumnOrder = (o) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(o), e.resetColumnOrder = (o) => {
|
|
586
|
+
var t;
|
|
587
|
+
e.setColumnOrder(o ? [] : (t = e.initialState.columnOrder) != null ? t : []);
|
|
588
|
+
}, e._getOrderColumnsFn = m(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (o, t, n) => (i) => {
|
|
589
|
+
let r = [];
|
|
590
|
+
if (!(o != null && o.length))
|
|
591
|
+
r = i;
|
|
592
|
+
else {
|
|
593
|
+
const l = [...o], u = [...i];
|
|
594
|
+
for (; u.length && l.length; ) {
|
|
595
|
+
const g = l.shift(), a = u.findIndex((f) => f.id === g);
|
|
596
|
+
a > -1 && r.push(u.splice(a, 1)[0]);
|
|
597
|
+
}
|
|
598
|
+
r = [...r, ...u];
|
|
599
|
+
}
|
|
600
|
+
return ye(r, t, n);
|
|
601
|
+
}, C(e.options, "debugTable", "_getOrderColumnsFn"));
|
|
602
|
+
}
|
|
603
|
+
}, O = () => ({
|
|
604
|
+
left: [],
|
|
605
|
+
right: []
|
|
606
|
+
}), He = {
|
|
607
|
+
getInitialState: (e) => ({
|
|
608
|
+
columnPinning: O(),
|
|
609
|
+
...e
|
|
610
|
+
}),
|
|
611
|
+
getDefaultOptions: (e) => ({
|
|
612
|
+
onColumnPinningChange: $("columnPinning", e)
|
|
613
|
+
}),
|
|
614
|
+
createColumn: (e, o) => {
|
|
615
|
+
e.pin = (t) => {
|
|
616
|
+
const n = e.getLeafColumns().map((i) => i.id).filter(Boolean);
|
|
617
|
+
o.setColumnPinning((i) => {
|
|
618
|
+
var r, l;
|
|
619
|
+
if (t === "right") {
|
|
620
|
+
var u, g;
|
|
621
|
+
return {
|
|
622
|
+
left: ((u = i == null ? void 0 : i.left) != null ? u : []).filter((S) => !(n != null && n.includes(S))),
|
|
623
|
+
right: [...((g = i == null ? void 0 : i.right) != null ? g : []).filter((S) => !(n != null && n.includes(S))), ...n]
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
if (t === "left") {
|
|
627
|
+
var a, f;
|
|
628
|
+
return {
|
|
629
|
+
left: [...((a = i == null ? void 0 : i.left) != null ? a : []).filter((S) => !(n != null && n.includes(S))), ...n],
|
|
630
|
+
right: ((f = i == null ? void 0 : i.right) != null ? f : []).filter((S) => !(n != null && n.includes(S)))
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
return {
|
|
634
|
+
left: ((r = i == null ? void 0 : i.left) != null ? r : []).filter((S) => !(n != null && n.includes(S))),
|
|
635
|
+
right: ((l = i == null ? void 0 : i.right) != null ? l : []).filter((S) => !(n != null && n.includes(S)))
|
|
636
|
+
};
|
|
637
|
+
});
|
|
638
|
+
}, e.getCanPin = () => e.getLeafColumns().some((n) => {
|
|
639
|
+
var i, r, l;
|
|
640
|
+
return ((i = n.columnDef.enablePinning) != null ? i : !0) && ((r = (l = o.options.enableColumnPinning) != null ? l : o.options.enablePinning) != null ? r : !0);
|
|
641
|
+
}), e.getIsPinned = () => {
|
|
642
|
+
const t = e.getLeafColumns().map((u) => u.id), {
|
|
643
|
+
left: n,
|
|
644
|
+
right: i
|
|
645
|
+
} = o.getState().columnPinning, r = t.some((u) => n == null ? void 0 : n.includes(u)), l = t.some((u) => i == null ? void 0 : i.includes(u));
|
|
646
|
+
return r ? "left" : l ? "right" : !1;
|
|
647
|
+
}, e.getPinnedIndex = () => {
|
|
648
|
+
var t, n;
|
|
649
|
+
const i = e.getIsPinned();
|
|
650
|
+
return i ? (t = (n = o.getState().columnPinning) == null || (n = n[i]) == null ? void 0 : n.indexOf(e.id)) != null ? t : -1 : 0;
|
|
651
|
+
};
|
|
652
|
+
},
|
|
653
|
+
createRow: (e, o) => {
|
|
654
|
+
e.getCenterVisibleCells = m(() => [e._getAllVisibleCells(), o.getState().columnPinning.left, o.getState().columnPinning.right], (t, n, i) => {
|
|
655
|
+
const r = [...n ?? [], ...i ?? []];
|
|
656
|
+
return t.filter((l) => !r.includes(l.column.id));
|
|
657
|
+
}, C(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = m(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((r) => t.find((l) => l.column.id === r)).filter(Boolean).map((r) => ({
|
|
658
|
+
...r,
|
|
659
|
+
position: "left"
|
|
660
|
+
})), C(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = m(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((r) => t.find((l) => l.column.id === r)).filter(Boolean).map((r) => ({
|
|
661
|
+
...r,
|
|
662
|
+
position: "right"
|
|
663
|
+
})), C(o.options, "debugRows", "getRightVisibleCells"));
|
|
664
|
+
},
|
|
665
|
+
createTable: (e) => {
|
|
666
|
+
e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
|
|
667
|
+
var t, n;
|
|
668
|
+
return e.setColumnPinning(o ? O() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : O());
|
|
669
|
+
}, e.getIsSomeColumnsPinned = (o) => {
|
|
670
|
+
var t;
|
|
671
|
+
const n = e.getState().columnPinning;
|
|
672
|
+
if (!o) {
|
|
673
|
+
var i, r;
|
|
674
|
+
return !!((i = n.left) != null && i.length || (r = n.right) != null && r.length);
|
|
675
|
+
}
|
|
676
|
+
return !!((t = n[o]) != null && t.length);
|
|
677
|
+
}, e.getLeftLeafColumns = m(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (o, t) => (t ?? []).map((n) => o.find((i) => i.id === n)).filter(Boolean), C(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = m(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (o, t) => (t ?? []).map((n) => o.find((i) => i.id === n)).filter(Boolean), C(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = m(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
|
|
678
|
+
const i = [...t ?? [], ...n ?? []];
|
|
679
|
+
return o.filter((r) => !i.includes(r.id));
|
|
680
|
+
}, C(e.options, "debugColumns", "getCenterLeafColumns"));
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
function Le(e) {
|
|
684
|
+
return e || (typeof document < "u" ? document : null);
|
|
685
|
+
}
|
|
686
|
+
const H = {
|
|
687
|
+
size: 150,
|
|
688
|
+
minSize: 20,
|
|
689
|
+
maxSize: Number.MAX_SAFE_INTEGER
|
|
690
|
+
}, B = () => ({
|
|
691
|
+
startOffset: null,
|
|
692
|
+
startSize: null,
|
|
693
|
+
deltaOffset: null,
|
|
694
|
+
deltaPercentage: null,
|
|
695
|
+
isResizingColumn: !1,
|
|
696
|
+
columnSizingStart: []
|
|
697
|
+
}), Ae = {
|
|
698
|
+
getDefaultColumnDef: () => H,
|
|
699
|
+
getInitialState: (e) => ({
|
|
700
|
+
columnSizing: {},
|
|
701
|
+
columnSizingInfo: B(),
|
|
702
|
+
...e
|
|
703
|
+
}),
|
|
704
|
+
getDefaultOptions: (e) => ({
|
|
705
|
+
columnResizeMode: "onEnd",
|
|
706
|
+
columnResizeDirection: "ltr",
|
|
707
|
+
onColumnSizingChange: $("columnSizing", e),
|
|
708
|
+
onColumnSizingInfoChange: $("columnSizingInfo", e)
|
|
709
|
+
}),
|
|
710
|
+
createColumn: (e, o) => {
|
|
711
|
+
e.getSize = () => {
|
|
712
|
+
var t, n, i;
|
|
713
|
+
const r = o.getState().columnSizing[e.id];
|
|
714
|
+
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : H.minSize, (n = r ?? e.columnDef.size) != null ? n : H.size), (i = e.columnDef.maxSize) != null ? i : H.maxSize);
|
|
715
|
+
}, e.getStart = m((t) => [t, y(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((i, r) => i + r.getSize(), 0), C(o.options, "debugColumns", "getStart")), e.getAfter = m((t) => [t, y(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((i, r) => i + r.getSize(), 0), C(o.options, "debugColumns", "getAfter")), e.resetSize = () => {
|
|
716
|
+
o.setColumnSizing((t) => {
|
|
717
|
+
let {
|
|
718
|
+
[e.id]: n,
|
|
719
|
+
...i
|
|
720
|
+
} = t;
|
|
721
|
+
return i;
|
|
722
|
+
});
|
|
723
|
+
}, e.getCanResize = () => {
|
|
724
|
+
var t, n;
|
|
725
|
+
return ((t = e.columnDef.enableResizing) != null ? t : !0) && ((n = o.options.enableColumnResizing) != null ? n : !0);
|
|
726
|
+
}, e.getIsResizing = () => o.getState().columnSizingInfo.isResizingColumn === e.id;
|
|
727
|
+
},
|
|
728
|
+
createHeader: (e, o) => {
|
|
729
|
+
e.getSize = () => {
|
|
730
|
+
let t = 0;
|
|
731
|
+
const n = (i) => {
|
|
732
|
+
if (i.subHeaders.length)
|
|
733
|
+
i.subHeaders.forEach(n);
|
|
734
|
+
else {
|
|
735
|
+
var r;
|
|
736
|
+
t += (r = i.column.getSize()) != null ? r : 0;
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
return n(e), t;
|
|
740
|
+
}, e.getStart = () => {
|
|
741
|
+
if (e.index > 0) {
|
|
742
|
+
const t = e.headerGroup.headers[e.index - 1];
|
|
743
|
+
return t.getStart() + t.getSize();
|
|
744
|
+
}
|
|
745
|
+
return 0;
|
|
746
|
+
}, e.getResizeHandler = (t) => {
|
|
747
|
+
const n = o.getColumn(e.column.id), i = n == null ? void 0 : n.getCanResize();
|
|
748
|
+
return (r) => {
|
|
749
|
+
if (!n || !i || (r.persist == null || r.persist(), T(r) && r.touches && r.touches.length > 1))
|
|
750
|
+
return;
|
|
751
|
+
const l = e.getSize(), u = e ? e.getLeafHeaders().map((w) => [w.column.id, w.column.getSize()]) : [[n.id, n.getSize()]], g = T(r) ? Math.round(r.touches[0].clientX) : r.clientX, a = {}, f = (w, h) => {
|
|
752
|
+
typeof h == "number" && (o.setColumnSizingInfo((v) => {
|
|
753
|
+
var M, F;
|
|
754
|
+
const E = o.options.columnResizeDirection === "rtl" ? -1 : 1, b = (h - ((M = v == null ? void 0 : v.startOffset) != null ? M : 0)) * E, ee = Math.max(b / ((F = v == null ? void 0 : v.startSize) != null ? F : 0), -0.999999);
|
|
755
|
+
return v.columnSizingStart.forEach((ce) => {
|
|
756
|
+
let [pe, te] = ce;
|
|
757
|
+
a[pe] = Math.round(Math.max(te + te * ee, 0) * 100) / 100;
|
|
758
|
+
}), {
|
|
759
|
+
...v,
|
|
760
|
+
deltaOffset: b,
|
|
761
|
+
deltaPercentage: ee
|
|
762
|
+
};
|
|
763
|
+
}), (o.options.columnResizeMode === "onChange" || w === "end") && o.setColumnSizing((v) => ({
|
|
764
|
+
...v,
|
|
765
|
+
...a
|
|
766
|
+
})));
|
|
767
|
+
}, S = (w) => f("move", w), d = (w) => {
|
|
768
|
+
f("end", w), o.setColumnSizingInfo((h) => ({
|
|
769
|
+
...h,
|
|
770
|
+
isResizingColumn: !1,
|
|
771
|
+
startOffset: null,
|
|
772
|
+
startSize: null,
|
|
773
|
+
deltaOffset: null,
|
|
774
|
+
deltaPercentage: null,
|
|
775
|
+
columnSizingStart: []
|
|
776
|
+
}));
|
|
777
|
+
}, s = Le(t), c = {
|
|
778
|
+
moveHandler: (w) => S(w.clientX),
|
|
779
|
+
upHandler: (w) => {
|
|
780
|
+
s == null || s.removeEventListener("mousemove", c.moveHandler), s == null || s.removeEventListener("mouseup", c.upHandler), d(w.clientX);
|
|
781
|
+
}
|
|
782
|
+
}, p = {
|
|
783
|
+
moveHandler: (w) => (w.cancelable && (w.preventDefault(), w.stopPropagation()), S(w.touches[0].clientX), !1),
|
|
784
|
+
upHandler: (w) => {
|
|
785
|
+
var h;
|
|
786
|
+
s == null || s.removeEventListener("touchmove", p.moveHandler), s == null || s.removeEventListener("touchend", p.upHandler), w.cancelable && (w.preventDefault(), w.stopPropagation()), d((h = w.touches[0]) == null ? void 0 : h.clientX);
|
|
787
|
+
}
|
|
788
|
+
}, R = ze() ? {
|
|
789
|
+
passive: !1
|
|
790
|
+
} : !1;
|
|
791
|
+
T(r) ? (s == null || s.addEventListener("touchmove", p.moveHandler, R), s == null || s.addEventListener("touchend", p.upHandler, R)) : (s == null || s.addEventListener("mousemove", c.moveHandler, R), s == null || s.addEventListener("mouseup", c.upHandler, R)), o.setColumnSizingInfo((w) => ({
|
|
792
|
+
...w,
|
|
793
|
+
startOffset: g,
|
|
794
|
+
startSize: l,
|
|
795
|
+
deltaOffset: 0,
|
|
796
|
+
deltaPercentage: 0,
|
|
797
|
+
columnSizingStart: u,
|
|
798
|
+
isResizingColumn: n.id
|
|
799
|
+
}));
|
|
800
|
+
};
|
|
801
|
+
};
|
|
802
|
+
},
|
|
803
|
+
createTable: (e) => {
|
|
804
|
+
e.setColumnSizing = (o) => e.options.onColumnSizingChange == null ? void 0 : e.options.onColumnSizingChange(o), e.setColumnSizingInfo = (o) => e.options.onColumnSizingInfoChange == null ? void 0 : e.options.onColumnSizingInfoChange(o), e.resetColumnSizing = (o) => {
|
|
805
|
+
var t;
|
|
806
|
+
e.setColumnSizing(o ? {} : (t = e.initialState.columnSizing) != null ? t : {});
|
|
807
|
+
}, e.resetHeaderSizeInfo = (o) => {
|
|
808
|
+
var t;
|
|
809
|
+
e.setColumnSizingInfo(o ? B() : (t = e.initialState.columnSizingInfo) != null ? t : B());
|
|
810
|
+
}, e.getTotalSize = () => {
|
|
811
|
+
var o, t;
|
|
812
|
+
return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
|
|
813
|
+
}, e.getLeftTotalSize = () => {
|
|
814
|
+
var o, t;
|
|
815
|
+
return (o = (t = e.getLeftHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
|
|
816
|
+
}, e.getCenterTotalSize = () => {
|
|
817
|
+
var o, t;
|
|
818
|
+
return (o = (t = e.getCenterHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
|
|
819
|
+
}, e.getRightTotalSize = () => {
|
|
820
|
+
var o, t;
|
|
821
|
+
return (o = (t = e.getRightHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
let L = null;
|
|
826
|
+
function ze() {
|
|
827
|
+
if (typeof L == "boolean") return L;
|
|
828
|
+
let e = !1;
|
|
829
|
+
try {
|
|
830
|
+
const o = {
|
|
831
|
+
get passive() {
|
|
832
|
+
return e = !0, !1;
|
|
833
|
+
}
|
|
834
|
+
}, t = () => {
|
|
835
|
+
};
|
|
836
|
+
window.addEventListener("test", t, o), window.removeEventListener("test", t);
|
|
837
|
+
} catch {
|
|
838
|
+
e = !1;
|
|
839
|
+
}
|
|
840
|
+
return L = e, L;
|
|
841
|
+
}
|
|
842
|
+
function T(e) {
|
|
843
|
+
return e.type === "touchstart";
|
|
844
|
+
}
|
|
845
|
+
const Oe = {
|
|
846
|
+
getInitialState: (e) => ({
|
|
847
|
+
columnVisibility: {},
|
|
848
|
+
...e
|
|
849
|
+
}),
|
|
850
|
+
getDefaultOptions: (e) => ({
|
|
851
|
+
onColumnVisibilityChange: $("columnVisibility", e)
|
|
852
|
+
}),
|
|
853
|
+
createColumn: (e, o) => {
|
|
854
|
+
e.toggleVisibility = (t) => {
|
|
855
|
+
e.getCanHide() && o.setColumnVisibility((n) => ({
|
|
856
|
+
...n,
|
|
857
|
+
[e.id]: t ?? !e.getIsVisible()
|
|
858
|
+
}));
|
|
859
|
+
}, e.getIsVisible = () => {
|
|
860
|
+
var t, n;
|
|
861
|
+
const i = e.columns;
|
|
862
|
+
return (t = i.length ? i.some((r) => r.getIsVisible()) : (n = o.getState().columnVisibility) == null ? void 0 : n[e.id]) != null ? t : !0;
|
|
863
|
+
}, e.getCanHide = () => {
|
|
864
|
+
var t, n;
|
|
865
|
+
return ((t = e.columnDef.enableHiding) != null ? t : !0) && ((n = o.options.enableHiding) != null ? n : !0);
|
|
866
|
+
}, e.getToggleVisibilityHandler = () => (t) => {
|
|
867
|
+
e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
|
|
868
|
+
};
|
|
869
|
+
},
|
|
870
|
+
createRow: (e, o) => {
|
|
871
|
+
e._getAllVisibleCells = m(() => [e.getAllCells(), o.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), C(o.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = m(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, i) => [...t, ...n, ...i], C(o.options, "debugRows", "getVisibleCells"));
|
|
872
|
+
},
|
|
873
|
+
createTable: (e) => {
|
|
874
|
+
const o = (t, n) => m(() => [n(), n().filter((i) => i.getIsVisible()).map((i) => i.id).join("_")], (i) => i.filter((r) => r.getIsVisible == null ? void 0 : r.getIsVisible()), C(e.options, "debugColumns", t));
|
|
875
|
+
e.getVisibleFlatColumns = o("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = o("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = o("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = o("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = o("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
|
|
876
|
+
var n;
|
|
877
|
+
e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
|
|
878
|
+
}, e.toggleAllColumnsVisible = (t) => {
|
|
879
|
+
var n;
|
|
880
|
+
t = (n = t) != null ? n : !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((i, r) => ({
|
|
881
|
+
...i,
|
|
882
|
+
[r.id]: t || !(r.getCanHide != null && r.getCanHide())
|
|
883
|
+
}), {}));
|
|
884
|
+
}, e.getIsAllColumnsVisible = () => !e.getAllLeafColumns().some((t) => !(t.getIsVisible != null && t.getIsVisible())), e.getIsSomeColumnsVisible = () => e.getAllLeafColumns().some((t) => t.getIsVisible == null ? void 0 : t.getIsVisible()), e.getToggleAllColumnsVisibilityHandler = () => (t) => {
|
|
885
|
+
var n;
|
|
886
|
+
e.toggleAllColumnsVisible((n = t.target) == null ? void 0 : n.checked);
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
function y(e, o) {
|
|
891
|
+
return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
|
|
892
|
+
}
|
|
893
|
+
const Be = {
|
|
894
|
+
createTable: (e) => {
|
|
895
|
+
e._getGlobalFacetedRowModel = e.options.getFacetedRowModel && e.options.getFacetedRowModel(e, "__global__"), e.getGlobalFacetedRowModel = () => e.options.manualFiltering || !e._getGlobalFacetedRowModel ? e.getPreFilteredRowModel() : e._getGlobalFacetedRowModel(), e._getGlobalFacetedUniqueValues = e.options.getFacetedUniqueValues && e.options.getFacetedUniqueValues(e, "__global__"), e.getGlobalFacetedUniqueValues = () => e._getGlobalFacetedUniqueValues ? e._getGlobalFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getGlobalFacetedMinMaxValues = e.options.getFacetedMinMaxValues && e.options.getFacetedMinMaxValues(e, "__global__"), e.getGlobalFacetedMinMaxValues = () => {
|
|
896
|
+
if (e._getGlobalFacetedMinMaxValues)
|
|
897
|
+
return e._getGlobalFacetedMinMaxValues();
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
}, Te = {
|
|
901
|
+
getInitialState: (e) => ({
|
|
902
|
+
globalFilter: void 0,
|
|
903
|
+
...e
|
|
904
|
+
}),
|
|
905
|
+
getDefaultOptions: (e) => ({
|
|
906
|
+
onGlobalFilterChange: $("globalFilter", e),
|
|
907
|
+
globalFilterFn: "auto",
|
|
908
|
+
getColumnCanGlobalFilter: (o) => {
|
|
909
|
+
var t;
|
|
910
|
+
const n = (t = e.getCoreRowModel().flatRows[0]) == null || (t = t._getAllCellsByColumnId()[o.id]) == null ? void 0 : t.getValue();
|
|
911
|
+
return typeof n == "string" || typeof n == "number";
|
|
912
|
+
}
|
|
913
|
+
}),
|
|
914
|
+
createColumn: (e, o) => {
|
|
915
|
+
e.getCanGlobalFilter = () => {
|
|
916
|
+
var t, n, i, r;
|
|
917
|
+
return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n = o.options.enableGlobalFilter) != null ? n : !0) && ((i = o.options.enableFilters) != null ? i : !0) && ((r = o.options.getColumnCanGlobalFilter == null ? void 0 : o.options.getColumnCanGlobalFilter(e)) != null ? r : !0) && !!e.accessorFn;
|
|
918
|
+
};
|
|
919
|
+
},
|
|
920
|
+
createTable: (e) => {
|
|
921
|
+
e.getGlobalAutoFilterFn = () => P.includesString, e.getGlobalFilterFn = () => {
|
|
922
|
+
var o, t;
|
|
923
|
+
const {
|
|
924
|
+
globalFilterFn: n
|
|
925
|
+
} = e.options;
|
|
926
|
+
return A(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : P[n];
|
|
927
|
+
}, e.setGlobalFilter = (o) => {
|
|
928
|
+
e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(o);
|
|
929
|
+
}, e.resetGlobalFilter = (o) => {
|
|
930
|
+
e.setGlobalFilter(o ? void 0 : e.initialState.globalFilter);
|
|
931
|
+
};
|
|
932
|
+
}
|
|
933
|
+
}, qe = {
|
|
934
|
+
getInitialState: (e) => ({
|
|
935
|
+
expanded: {},
|
|
936
|
+
...e
|
|
937
|
+
}),
|
|
938
|
+
getDefaultOptions: (e) => ({
|
|
939
|
+
onExpandedChange: $("expanded", e),
|
|
940
|
+
paginateExpandedRows: !0
|
|
941
|
+
}),
|
|
942
|
+
createTable: (e) => {
|
|
943
|
+
let o = !1, t = !1;
|
|
944
|
+
e._autoResetExpanded = () => {
|
|
945
|
+
var n, i;
|
|
946
|
+
if (!o) {
|
|
947
|
+
e._queue(() => {
|
|
948
|
+
o = !0;
|
|
949
|
+
});
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
952
|
+
if ((n = (i = e.options.autoResetAll) != null ? i : e.options.autoResetExpanded) != null ? n : !e.options.manualExpanding) {
|
|
953
|
+
if (t) return;
|
|
954
|
+
t = !0, e._queue(() => {
|
|
955
|
+
e.resetExpanded(), t = !1;
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
}, e.setExpanded = (n) => e.options.onExpandedChange == null ? void 0 : e.options.onExpandedChange(n), e.toggleAllRowsExpanded = (n) => {
|
|
959
|
+
n ?? !e.getIsAllRowsExpanded() ? e.setExpanded(!0) : e.setExpanded({});
|
|
960
|
+
}, e.resetExpanded = (n) => {
|
|
961
|
+
var i, r;
|
|
962
|
+
e.setExpanded(n ? {} : (i = (r = e.initialState) == null ? void 0 : r.expanded) != null ? i : {});
|
|
963
|
+
}, e.getCanSomeRowsExpand = () => e.getPrePaginationRowModel().flatRows.some((n) => n.getCanExpand()), e.getToggleAllRowsExpandedHandler = () => (n) => {
|
|
964
|
+
n.persist == null || n.persist(), e.toggleAllRowsExpanded();
|
|
965
|
+
}, e.getIsSomeRowsExpanded = () => {
|
|
966
|
+
const n = e.getState().expanded;
|
|
967
|
+
return n === !0 || Object.values(n).some(Boolean);
|
|
968
|
+
}, e.getIsAllRowsExpanded = () => {
|
|
969
|
+
const n = e.getState().expanded;
|
|
970
|
+
return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || e.getRowModel().flatRows.some((i) => !i.getIsExpanded()));
|
|
971
|
+
}, e.getExpandedDepth = () => {
|
|
972
|
+
let n = 0;
|
|
973
|
+
return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((r) => {
|
|
974
|
+
const l = r.split(".");
|
|
975
|
+
n = Math.max(n, l.length);
|
|
976
|
+
}), n;
|
|
977
|
+
}, e.getPreExpandedRowModel = () => e.getSortedRowModel(), e.getExpandedRowModel = () => (!e._getExpandedRowModel && e.options.getExpandedRowModel && (e._getExpandedRowModel = e.options.getExpandedRowModel(e)), e.options.manualExpanding || !e._getExpandedRowModel ? e.getPreExpandedRowModel() : e._getExpandedRowModel());
|
|
978
|
+
},
|
|
979
|
+
createRow: (e, o) => {
|
|
980
|
+
e.toggleExpanded = (t) => {
|
|
981
|
+
o.setExpanded((n) => {
|
|
982
|
+
var i;
|
|
983
|
+
const r = n === !0 ? !0 : !!(n != null && n[e.id]);
|
|
984
|
+
let l = {};
|
|
985
|
+
if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((u) => {
|
|
986
|
+
l[u] = !0;
|
|
987
|
+
}) : l = n, t = (i = t) != null ? i : !r, !r && t)
|
|
988
|
+
return {
|
|
989
|
+
...l,
|
|
990
|
+
[e.id]: !0
|
|
991
|
+
};
|
|
992
|
+
if (r && !t) {
|
|
993
|
+
const {
|
|
994
|
+
[e.id]: u,
|
|
995
|
+
...g
|
|
996
|
+
} = l;
|
|
997
|
+
return g;
|
|
998
|
+
}
|
|
999
|
+
return n;
|
|
1000
|
+
});
|
|
1001
|
+
}, e.getIsExpanded = () => {
|
|
1002
|
+
var t;
|
|
1003
|
+
const n = o.getState().expanded;
|
|
1004
|
+
return !!((t = o.options.getIsRowExpanded == null ? void 0 : o.options.getIsRowExpanded(e)) != null ? t : n === !0 || n != null && n[e.id]);
|
|
1005
|
+
}, e.getCanExpand = () => {
|
|
1006
|
+
var t, n, i;
|
|
1007
|
+
return (t = o.options.getRowCanExpand == null ? void 0 : o.options.getRowCanExpand(e)) != null ? t : ((n = o.options.enableExpanding) != null ? n : !0) && !!((i = e.subRows) != null && i.length);
|
|
1008
|
+
}, e.getIsAllParentsExpanded = () => {
|
|
1009
|
+
let t = !0, n = e;
|
|
1010
|
+
for (; t && n.parentId; )
|
|
1011
|
+
n = o.getRow(n.parentId, !0), t = n.getIsExpanded();
|
|
1012
|
+
return t;
|
|
1013
|
+
}, e.getToggleExpandedHandler = () => {
|
|
1014
|
+
const t = e.getCanExpand();
|
|
1015
|
+
return () => {
|
|
1016
|
+
t && e.toggleExpanded();
|
|
1017
|
+
};
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
}, U = 0, j = 10, q = () => ({
|
|
1021
|
+
pageIndex: U,
|
|
1022
|
+
pageSize: j
|
|
1023
|
+
}), Ne = {
|
|
1024
|
+
getInitialState: (e) => ({
|
|
1025
|
+
...e,
|
|
1026
|
+
pagination: {
|
|
1027
|
+
...q(),
|
|
1028
|
+
...e == null ? void 0 : e.pagination
|
|
1029
|
+
}
|
|
1030
|
+
}),
|
|
1031
|
+
getDefaultOptions: (e) => ({
|
|
1032
|
+
onPaginationChange: $("pagination", e)
|
|
1033
|
+
}),
|
|
1034
|
+
createTable: (e) => {
|
|
1035
|
+
let o = !1, t = !1;
|
|
1036
|
+
e._autoResetPageIndex = () => {
|
|
1037
|
+
var n, i;
|
|
1038
|
+
if (!o) {
|
|
1039
|
+
e._queue(() => {
|
|
1040
|
+
o = !0;
|
|
1041
|
+
});
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
1044
|
+
if ((n = (i = e.options.autoResetAll) != null ? i : e.options.autoResetPageIndex) != null ? n : !e.options.manualPagination) {
|
|
1045
|
+
if (t) return;
|
|
1046
|
+
t = !0, e._queue(() => {
|
|
1047
|
+
e.resetPageIndex(), t = !1;
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
}, e.setPagination = (n) => {
|
|
1051
|
+
const i = (r) => I(n, r);
|
|
1052
|
+
return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(i);
|
|
1053
|
+
}, e.resetPagination = (n) => {
|
|
1054
|
+
var i;
|
|
1055
|
+
e.setPagination(n ? q() : (i = e.initialState.pagination) != null ? i : q());
|
|
1056
|
+
}, e.setPageIndex = (n) => {
|
|
1057
|
+
e.setPagination((i) => {
|
|
1058
|
+
let r = I(n, i.pageIndex);
|
|
1059
|
+
const l = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
|
|
1060
|
+
return r = Math.max(0, Math.min(r, l)), {
|
|
1061
|
+
...i,
|
|
1062
|
+
pageIndex: r
|
|
1063
|
+
};
|
|
1064
|
+
});
|
|
1065
|
+
}, e.resetPageIndex = (n) => {
|
|
1066
|
+
var i, r;
|
|
1067
|
+
e.setPageIndex(n ? U : (i = (r = e.initialState) == null || (r = r.pagination) == null ? void 0 : r.pageIndex) != null ? i : U);
|
|
1068
|
+
}, e.resetPageSize = (n) => {
|
|
1069
|
+
var i, r;
|
|
1070
|
+
e.setPageSize(n ? j : (i = (r = e.initialState) == null || (r = r.pagination) == null ? void 0 : r.pageSize) != null ? i : j);
|
|
1071
|
+
}, e.setPageSize = (n) => {
|
|
1072
|
+
e.setPagination((i) => {
|
|
1073
|
+
const r = Math.max(1, I(n, i.pageSize)), l = i.pageSize * i.pageIndex, u = Math.floor(l / r);
|
|
1074
|
+
return {
|
|
1075
|
+
...i,
|
|
1076
|
+
pageIndex: u,
|
|
1077
|
+
pageSize: r
|
|
1078
|
+
};
|
|
1079
|
+
});
|
|
1080
|
+
}, e.setPageCount = (n) => e.setPagination((i) => {
|
|
1081
|
+
var r;
|
|
1082
|
+
let l = I(n, (r = e.options.pageCount) != null ? r : -1);
|
|
1083
|
+
return typeof l == "number" && (l = Math.max(-1, l)), {
|
|
1084
|
+
...i,
|
|
1085
|
+
pageCount: l
|
|
1086
|
+
};
|
|
1087
|
+
}), e.getPageOptions = m(() => [e.getPageCount()], (n) => {
|
|
1088
|
+
let i = [];
|
|
1089
|
+
return n && n > 0 && (i = [...new Array(n)].fill(null).map((r, l) => l)), i;
|
|
1090
|
+
}, C(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
|
|
1091
|
+
const {
|
|
1092
|
+
pageIndex: n
|
|
1093
|
+
} = e.getState().pagination, i = e.getPageCount();
|
|
1094
|
+
return i === -1 ? !0 : i === 0 ? !1 : n < i - 1;
|
|
1095
|
+
}, e.previousPage = () => e.setPageIndex((n) => n - 1), e.nextPage = () => e.setPageIndex((n) => n + 1), e.firstPage = () => e.setPageIndex(0), e.lastPage = () => e.setPageIndex(e.getPageCount() - 1), e.getPrePaginationRowModel = () => e.getExpandedRowModel(), e.getPaginationRowModel = () => (!e._getPaginationRowModel && e.options.getPaginationRowModel && (e._getPaginationRowModel = e.options.getPaginationRowModel(e)), e.options.manualPagination || !e._getPaginationRowModel ? e.getPrePaginationRowModel() : e._getPaginationRowModel()), e.getPageCount = () => {
|
|
1096
|
+
var n;
|
|
1097
|
+
return (n = e.options.pageCount) != null ? n : Math.ceil(e.getRowCount() / e.getState().pagination.pageSize);
|
|
1098
|
+
}, e.getRowCount = () => {
|
|
1099
|
+
var n;
|
|
1100
|
+
return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1103
|
+
}, N = () => ({
|
|
1104
|
+
top: [],
|
|
1105
|
+
bottom: []
|
|
1106
|
+
}), ke = {
|
|
1107
|
+
getInitialState: (e) => ({
|
|
1108
|
+
rowPinning: N(),
|
|
1109
|
+
...e
|
|
1110
|
+
}),
|
|
1111
|
+
getDefaultOptions: (e) => ({
|
|
1112
|
+
onRowPinningChange: $("rowPinning", e)
|
|
1113
|
+
}),
|
|
1114
|
+
createRow: (e, o) => {
|
|
1115
|
+
e.pin = (t, n, i) => {
|
|
1116
|
+
const r = n ? e.getLeafRows().map((g) => {
|
|
1117
|
+
let {
|
|
1118
|
+
id: a
|
|
1119
|
+
} = g;
|
|
1120
|
+
return a;
|
|
1121
|
+
}) : [], l = i ? e.getParentRows().map((g) => {
|
|
1122
|
+
let {
|
|
1123
|
+
id: a
|
|
1124
|
+
} = g;
|
|
1125
|
+
return a;
|
|
1126
|
+
}) : [], u = /* @__PURE__ */ new Set([...l, e.id, ...r]);
|
|
1127
|
+
o.setRowPinning((g) => {
|
|
1128
|
+
var a, f;
|
|
1129
|
+
if (t === "bottom") {
|
|
1130
|
+
var S, d;
|
|
1131
|
+
return {
|
|
1132
|
+
top: ((S = g == null ? void 0 : g.top) != null ? S : []).filter((p) => !(u != null && u.has(p))),
|
|
1133
|
+
bottom: [...((d = g == null ? void 0 : g.bottom) != null ? d : []).filter((p) => !(u != null && u.has(p))), ...Array.from(u)]
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1136
|
+
if (t === "top") {
|
|
1137
|
+
var s, c;
|
|
1138
|
+
return {
|
|
1139
|
+
top: [...((s = g == null ? void 0 : g.top) != null ? s : []).filter((p) => !(u != null && u.has(p))), ...Array.from(u)],
|
|
1140
|
+
bottom: ((c = g == null ? void 0 : g.bottom) != null ? c : []).filter((p) => !(u != null && u.has(p)))
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1143
|
+
return {
|
|
1144
|
+
top: ((a = g == null ? void 0 : g.top) != null ? a : []).filter((p) => !(u != null && u.has(p))),
|
|
1145
|
+
bottom: ((f = g == null ? void 0 : g.bottom) != null ? f : []).filter((p) => !(u != null && u.has(p)))
|
|
1146
|
+
};
|
|
1147
|
+
});
|
|
1148
|
+
}, e.getCanPin = () => {
|
|
1149
|
+
var t;
|
|
1150
|
+
const {
|
|
1151
|
+
enableRowPinning: n,
|
|
1152
|
+
enablePinning: i
|
|
1153
|
+
} = o.options;
|
|
1154
|
+
return typeof n == "function" ? n(e) : (t = n ?? i) != null ? t : !0;
|
|
1155
|
+
}, e.getIsPinned = () => {
|
|
1156
|
+
const t = [e.id], {
|
|
1157
|
+
top: n,
|
|
1158
|
+
bottom: i
|
|
1159
|
+
} = o.getState().rowPinning, r = t.some((u) => n == null ? void 0 : n.includes(u)), l = t.some((u) => i == null ? void 0 : i.includes(u));
|
|
1160
|
+
return r ? "top" : l ? "bottom" : !1;
|
|
1161
|
+
}, e.getPinnedIndex = () => {
|
|
1162
|
+
var t, n;
|
|
1163
|
+
const i = e.getIsPinned();
|
|
1164
|
+
if (!i) return -1;
|
|
1165
|
+
const r = (t = i === "top" ? o.getTopRows() : o.getBottomRows()) == null ? void 0 : t.map((l) => {
|
|
1166
|
+
let {
|
|
1167
|
+
id: u
|
|
1168
|
+
} = l;
|
|
1169
|
+
return u;
|
|
1170
|
+
});
|
|
1171
|
+
return (n = r == null ? void 0 : r.indexOf(e.id)) != null ? n : -1;
|
|
1172
|
+
};
|
|
1173
|
+
},
|
|
1174
|
+
createTable: (e) => {
|
|
1175
|
+
e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
|
|
1176
|
+
var t, n;
|
|
1177
|
+
return e.setRowPinning(o ? N() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : N());
|
|
1178
|
+
}, e.getIsSomeRowsPinned = (o) => {
|
|
1179
|
+
var t;
|
|
1180
|
+
const n = e.getState().rowPinning;
|
|
1181
|
+
if (!o) {
|
|
1182
|
+
var i, r;
|
|
1183
|
+
return !!((i = n.top) != null && i.length || (r = n.bottom) != null && r.length);
|
|
1184
|
+
}
|
|
1185
|
+
return !!((t = n[o]) != null && t.length);
|
|
1186
|
+
}, e._getPinnedRows = (o, t, n) => {
|
|
1187
|
+
var i;
|
|
1188
|
+
return ((i = e.options.keepPinnedRows) == null || i ? (
|
|
1189
|
+
//get all rows that are pinned even if they would not be otherwise visible
|
|
1190
|
+
//account for expanded parent rows, but not pagination or filtering
|
|
1191
|
+
(t ?? []).map((l) => {
|
|
1192
|
+
const u = e.getRow(l, !0);
|
|
1193
|
+
return u.getIsAllParentsExpanded() ? u : null;
|
|
1194
|
+
})
|
|
1195
|
+
) : (
|
|
1196
|
+
//else get only visible rows that are pinned
|
|
1197
|
+
(t ?? []).map((l) => o.find((u) => u.id === l))
|
|
1198
|
+
)).filter(Boolean).map((l) => ({
|
|
1199
|
+
...l,
|
|
1200
|
+
position: n
|
|
1201
|
+
}));
|
|
1202
|
+
}, e.getTopRows = m(() => [e.getRowModel().rows, e.getState().rowPinning.top], (o, t) => e._getPinnedRows(o, t, "top"), C(e.options, "debugRows", "getTopRows")), e.getBottomRows = m(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (o, t) => e._getPinnedRows(o, t, "bottom"), C(e.options, "debugRows", "getBottomRows")), e.getCenterRows = m(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (o, t, n) => {
|
|
1203
|
+
const i = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
|
|
1204
|
+
return o.filter((r) => !i.has(r.id));
|
|
1205
|
+
}, C(e.options, "debugRows", "getCenterRows"));
|
|
1206
|
+
}
|
|
1207
|
+
}, Ue = {
|
|
1208
|
+
getInitialState: (e) => ({
|
|
1209
|
+
rowSelection: {},
|
|
1210
|
+
...e
|
|
1211
|
+
}),
|
|
1212
|
+
getDefaultOptions: (e) => ({
|
|
1213
|
+
onRowSelectionChange: $("rowSelection", e),
|
|
1214
|
+
enableRowSelection: !0,
|
|
1215
|
+
enableMultiRowSelection: !0,
|
|
1216
|
+
enableSubRowSelection: !0
|
|
1217
|
+
// enableGroupingRowSelection: false,
|
|
1218
|
+
// isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,
|
|
1219
|
+
// isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
|
|
1220
|
+
}),
|
|
1221
|
+
createTable: (e) => {
|
|
1222
|
+
e.setRowSelection = (o) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(o), e.resetRowSelection = (o) => {
|
|
1223
|
+
var t;
|
|
1224
|
+
return e.setRowSelection(o ? {} : (t = e.initialState.rowSelection) != null ? t : {});
|
|
1225
|
+
}, e.toggleAllRowsSelected = (o) => {
|
|
1226
|
+
e.setRowSelection((t) => {
|
|
1227
|
+
o = typeof o < "u" ? o : !e.getIsAllRowsSelected();
|
|
1228
|
+
const n = {
|
|
1229
|
+
...t
|
|
1230
|
+
}, i = e.getPreGroupedRowModel().flatRows;
|
|
1231
|
+
return o ? i.forEach((r) => {
|
|
1232
|
+
r.getCanSelect() && (n[r.id] = !0);
|
|
1233
|
+
}) : i.forEach((r) => {
|
|
1234
|
+
delete n[r.id];
|
|
1235
|
+
}), n;
|
|
1236
|
+
});
|
|
1237
|
+
}, e.toggleAllPageRowsSelected = (o) => e.setRowSelection((t) => {
|
|
1238
|
+
const n = typeof o < "u" ? o : !e.getIsAllPageRowsSelected(), i = {
|
|
1239
|
+
...t
|
|
1240
|
+
};
|
|
1241
|
+
return e.getRowModel().rows.forEach((r) => {
|
|
1242
|
+
X(i, r.id, n, !0, e);
|
|
1243
|
+
}), i;
|
|
1244
|
+
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = m(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? k(e, t) : {
|
|
1245
|
+
rows: [],
|
|
1246
|
+
flatRows: [],
|
|
1247
|
+
rowsById: {}
|
|
1248
|
+
}, C(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = m(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? k(e, t) : {
|
|
1249
|
+
rows: [],
|
|
1250
|
+
flatRows: [],
|
|
1251
|
+
rowsById: {}
|
|
1252
|
+
}, C(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = m(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? k(e, t) : {
|
|
1253
|
+
rows: [],
|
|
1254
|
+
flatRows: [],
|
|
1255
|
+
rowsById: {}
|
|
1256
|
+
}, C(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
|
|
1257
|
+
const o = e.getFilteredRowModel().flatRows, {
|
|
1258
|
+
rowSelection: t
|
|
1259
|
+
} = e.getState();
|
|
1260
|
+
let n = !!(o.length && Object.keys(t).length);
|
|
1261
|
+
return n && o.some((i) => i.getCanSelect() && !t[i.id]) && (n = !1), n;
|
|
1262
|
+
}, e.getIsAllPageRowsSelected = () => {
|
|
1263
|
+
const o = e.getPaginationRowModel().flatRows.filter((i) => i.getCanSelect()), {
|
|
1264
|
+
rowSelection: t
|
|
1265
|
+
} = e.getState();
|
|
1266
|
+
let n = !!o.length;
|
|
1267
|
+
return n && o.some((i) => !t[i.id]) && (n = !1), n;
|
|
1268
|
+
}, e.getIsSomeRowsSelected = () => {
|
|
1269
|
+
var o;
|
|
1270
|
+
const t = Object.keys((o = e.getState().rowSelection) != null ? o : {}).length;
|
|
1271
|
+
return t > 0 && t < e.getFilteredRowModel().flatRows.length;
|
|
1272
|
+
}, e.getIsSomePageRowsSelected = () => {
|
|
1273
|
+
const o = e.getPaginationRowModel().flatRows;
|
|
1274
|
+
return e.getIsAllPageRowsSelected() ? !1 : o.filter((t) => t.getCanSelect()).some((t) => t.getIsSelected() || t.getIsSomeSelected());
|
|
1275
|
+
}, e.getToggleAllRowsSelectedHandler = () => (o) => {
|
|
1276
|
+
e.toggleAllRowsSelected(o.target.checked);
|
|
1277
|
+
}, e.getToggleAllPageRowsSelectedHandler = () => (o) => {
|
|
1278
|
+
e.toggleAllPageRowsSelected(o.target.checked);
|
|
1279
|
+
};
|
|
1280
|
+
},
|
|
1281
|
+
createRow: (e, o) => {
|
|
1282
|
+
e.toggleSelected = (t, n) => {
|
|
1283
|
+
const i = e.getIsSelected();
|
|
1284
|
+
o.setRowSelection((r) => {
|
|
1285
|
+
var l;
|
|
1286
|
+
if (t = typeof t < "u" ? t : !i, e.getCanSelect() && i === t)
|
|
1287
|
+
return r;
|
|
1288
|
+
const u = {
|
|
1289
|
+
...r
|
|
1290
|
+
};
|
|
1291
|
+
return X(u, e.id, t, (l = n == null ? void 0 : n.selectChildren) != null ? l : !0, o), u;
|
|
1292
|
+
});
|
|
1293
|
+
}, e.getIsSelected = () => {
|
|
1294
|
+
const {
|
|
1295
|
+
rowSelection: t
|
|
1296
|
+
} = o.getState();
|
|
1297
|
+
return Y(e, t);
|
|
1298
|
+
}, e.getIsSomeSelected = () => {
|
|
1299
|
+
const {
|
|
1300
|
+
rowSelection: t
|
|
1301
|
+
} = o.getState();
|
|
1302
|
+
return K(e, t) === "some";
|
|
1303
|
+
}, e.getIsAllSubRowsSelected = () => {
|
|
1304
|
+
const {
|
|
1305
|
+
rowSelection: t
|
|
1306
|
+
} = o.getState();
|
|
1307
|
+
return K(e, t) === "all";
|
|
1308
|
+
}, e.getCanSelect = () => {
|
|
1309
|
+
var t;
|
|
1310
|
+
return typeof o.options.enableRowSelection == "function" ? o.options.enableRowSelection(e) : (t = o.options.enableRowSelection) != null ? t : !0;
|
|
1311
|
+
}, e.getCanSelectSubRows = () => {
|
|
1312
|
+
var t;
|
|
1313
|
+
return typeof o.options.enableSubRowSelection == "function" ? o.options.enableSubRowSelection(e) : (t = o.options.enableSubRowSelection) != null ? t : !0;
|
|
1314
|
+
}, e.getCanMultiSelect = () => {
|
|
1315
|
+
var t;
|
|
1316
|
+
return typeof o.options.enableMultiRowSelection == "function" ? o.options.enableMultiRowSelection(e) : (t = o.options.enableMultiRowSelection) != null ? t : !0;
|
|
1317
|
+
}, e.getToggleSelectedHandler = () => {
|
|
1318
|
+
const t = e.getCanSelect();
|
|
1319
|
+
return (n) => {
|
|
1320
|
+
var i;
|
|
1321
|
+
t && e.toggleSelected((i = n.target) == null ? void 0 : i.checked);
|
|
1322
|
+
};
|
|
1323
|
+
};
|
|
1324
|
+
}
|
|
1325
|
+
}, X = (e, o, t, n, i) => {
|
|
1326
|
+
var r;
|
|
1327
|
+
const l = i.getRow(o, !0);
|
|
1328
|
+
t ? (l.getCanMultiSelect() || Object.keys(e).forEach((u) => delete e[u]), l.getCanSelect() && (e[o] = !0)) : delete e[o], n && (r = l.subRows) != null && r.length && l.getCanSelectSubRows() && l.subRows.forEach((u) => X(e, u.id, t, n, i));
|
|
1329
|
+
};
|
|
1330
|
+
function k(e, o) {
|
|
1331
|
+
const t = e.getState().rowSelection, n = [], i = {}, r = function(l, u) {
|
|
1332
|
+
return l.map((g) => {
|
|
1333
|
+
var a;
|
|
1334
|
+
const f = Y(g, t);
|
|
1335
|
+
if (f && (n.push(g), i[g.id] = g), (a = g.subRows) != null && a.length && (g = {
|
|
1336
|
+
...g,
|
|
1337
|
+
subRows: r(g.subRows)
|
|
1338
|
+
}), f)
|
|
1339
|
+
return g;
|
|
1340
|
+
}).filter(Boolean);
|
|
1341
|
+
};
|
|
1342
|
+
return {
|
|
1343
|
+
rows: r(o.rows),
|
|
1344
|
+
flatRows: n,
|
|
1345
|
+
rowsById: i
|
|
1346
|
+
};
|
|
1347
|
+
}
|
|
1348
|
+
function Y(e, o) {
|
|
1349
|
+
var t;
|
|
1350
|
+
return (t = o[e.id]) != null ? t : !1;
|
|
1351
|
+
}
|
|
1352
|
+
function K(e, o, t) {
|
|
1353
|
+
var n;
|
|
1354
|
+
if (!((n = e.subRows) != null && n.length)) return !1;
|
|
1355
|
+
let i = !0, r = !1;
|
|
1356
|
+
return e.subRows.forEach((l) => {
|
|
1357
|
+
if (!(r && !i) && (l.getCanSelect() && (Y(l, o) ? r = !0 : i = !1), l.subRows && l.subRows.length)) {
|
|
1358
|
+
const u = K(l, o);
|
|
1359
|
+
u === "all" ? r = !0 : (u === "some" && (r = !0), i = !1);
|
|
1360
|
+
}
|
|
1361
|
+
}), i ? "all" : r ? "some" : !1;
|
|
1362
|
+
}
|
|
1363
|
+
const J = /([0-9]+)/gm, je = (e, o, t) => fe(x(e.getValue(t)).toLowerCase(), x(o.getValue(t)).toLowerCase()), Xe = (e, o, t) => fe(x(e.getValue(t)), x(o.getValue(t))), Ke = (e, o, t) => Z(x(e.getValue(t)).toLowerCase(), x(o.getValue(t)).toLowerCase()), Je = (e, o, t) => Z(x(e.getValue(t)), x(o.getValue(t))), Qe = (e, o, t) => {
|
|
1364
|
+
const n = e.getValue(t), i = o.getValue(t);
|
|
1365
|
+
return n > i ? 1 : n < i ? -1 : 0;
|
|
1366
|
+
}, We = (e, o, t) => Z(e.getValue(t), o.getValue(t));
|
|
1367
|
+
function Z(e, o) {
|
|
1368
|
+
return e === o ? 0 : e > o ? 1 : -1;
|
|
1369
|
+
}
|
|
1370
|
+
function x(e) {
|
|
1371
|
+
return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
|
|
1372
|
+
}
|
|
1373
|
+
function fe(e, o) {
|
|
1374
|
+
const t = e.split(J).filter(Boolean), n = o.split(J).filter(Boolean);
|
|
1375
|
+
for (; t.length && n.length; ) {
|
|
1376
|
+
const i = t.shift(), r = n.shift(), l = parseInt(i, 10), u = parseInt(r, 10), g = [l, u].sort();
|
|
1377
|
+
if (isNaN(g[0])) {
|
|
1378
|
+
if (i > r)
|
|
1379
|
+
return 1;
|
|
1380
|
+
if (r > i)
|
|
1381
|
+
return -1;
|
|
1382
|
+
continue;
|
|
1383
|
+
}
|
|
1384
|
+
if (isNaN(g[1]))
|
|
1385
|
+
return isNaN(l) ? -1 : 1;
|
|
1386
|
+
if (l > u)
|
|
1387
|
+
return 1;
|
|
1388
|
+
if (u > l)
|
|
1389
|
+
return -1;
|
|
1390
|
+
}
|
|
1391
|
+
return t.length - n.length;
|
|
1392
|
+
}
|
|
1393
|
+
const D = {
|
|
1394
|
+
alphanumeric: je,
|
|
1395
|
+
alphanumericCaseSensitive: Xe,
|
|
1396
|
+
text: Ke,
|
|
1397
|
+
textCaseSensitive: Je,
|
|
1398
|
+
datetime: Qe,
|
|
1399
|
+
basic: We
|
|
1400
|
+
}, Ye = {
|
|
1401
|
+
getInitialState: (e) => ({
|
|
1402
|
+
sorting: [],
|
|
1403
|
+
...e
|
|
1404
|
+
}),
|
|
1405
|
+
getDefaultColumnDef: () => ({
|
|
1406
|
+
sortingFn: "auto",
|
|
1407
|
+
sortUndefined: 1
|
|
1408
|
+
}),
|
|
1409
|
+
getDefaultOptions: (e) => ({
|
|
1410
|
+
onSortingChange: $("sorting", e),
|
|
1411
|
+
isMultiSortEvent: (o) => o.shiftKey
|
|
1412
|
+
}),
|
|
1413
|
+
createColumn: (e, o) => {
|
|
1414
|
+
e.getAutoSortingFn = () => {
|
|
1415
|
+
const t = o.getFilteredRowModel().flatRows.slice(10);
|
|
1416
|
+
let n = !1;
|
|
1417
|
+
for (const i of t) {
|
|
1418
|
+
const r = i == null ? void 0 : i.getValue(e.id);
|
|
1419
|
+
if (Object.prototype.toString.call(r) === "[object Date]")
|
|
1420
|
+
return D.datetime;
|
|
1421
|
+
if (typeof r == "string" && (n = !0, r.split(J).length > 1))
|
|
1422
|
+
return D.alphanumeric;
|
|
1423
|
+
}
|
|
1424
|
+
return n ? D.text : D.basic;
|
|
1425
|
+
}, e.getAutoSortDir = () => {
|
|
1426
|
+
const t = o.getFilteredRowModel().flatRows[0];
|
|
1427
|
+
return typeof (t == null ? void 0 : t.getValue(e.id)) == "string" ? "asc" : "desc";
|
|
1428
|
+
}, e.getSortingFn = () => {
|
|
1429
|
+
var t, n;
|
|
1430
|
+
if (!e)
|
|
1431
|
+
throw new Error();
|
|
1432
|
+
return A(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : (t = (n = o.options.sortingFns) == null ? void 0 : n[e.columnDef.sortingFn]) != null ? t : D[e.columnDef.sortingFn];
|
|
1433
|
+
}, e.toggleSorting = (t, n) => {
|
|
1434
|
+
const i = e.getNextSortingOrder(), r = typeof t < "u" && t !== null;
|
|
1435
|
+
o.setSorting((l) => {
|
|
1436
|
+
const u = l == null ? void 0 : l.find((s) => s.id === e.id), g = l == null ? void 0 : l.findIndex((s) => s.id === e.id);
|
|
1437
|
+
let a = [], f, S = r ? t : i === "desc";
|
|
1438
|
+
if (l != null && l.length && e.getCanMultiSort() && n ? u ? f = "toggle" : f = "add" : l != null && l.length && g !== l.length - 1 ? f = "replace" : u ? f = "toggle" : f = "replace", f === "toggle" && (r || i || (f = "remove")), f === "add") {
|
|
1439
|
+
var d;
|
|
1440
|
+
a = [...l, {
|
|
1441
|
+
id: e.id,
|
|
1442
|
+
desc: S
|
|
1443
|
+
}], a.splice(0, a.length - ((d = o.options.maxMultiSortColCount) != null ? d : Number.MAX_SAFE_INTEGER));
|
|
1444
|
+
} else f === "toggle" ? a = l.map((s) => s.id === e.id ? {
|
|
1445
|
+
...s,
|
|
1446
|
+
desc: S
|
|
1447
|
+
} : s) : f === "remove" ? a = l.filter((s) => s.id !== e.id) : a = [{
|
|
1448
|
+
id: e.id,
|
|
1449
|
+
desc: S
|
|
1450
|
+
}];
|
|
1451
|
+
return a;
|
|
1452
|
+
});
|
|
1453
|
+
}, e.getFirstSortDir = () => {
|
|
1454
|
+
var t, n;
|
|
1455
|
+
return ((t = (n = e.columnDef.sortDescFirst) != null ? n : o.options.sortDescFirst) != null ? t : e.getAutoSortDir() === "desc") ? "desc" : "asc";
|
|
1456
|
+
}, e.getNextSortingOrder = (t) => {
|
|
1457
|
+
var n, i;
|
|
1458
|
+
const r = e.getFirstSortDir(), l = e.getIsSorted();
|
|
1459
|
+
return l ? l !== r && ((n = o.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
|
|
1460
|
+
(!(t && (i = o.options.enableMultiRemove) != null) || i) ? !1 : l === "desc" ? "asc" : "desc" : r;
|
|
1461
|
+
}, e.getCanSort = () => {
|
|
1462
|
+
var t, n;
|
|
1463
|
+
return ((t = e.columnDef.enableSorting) != null ? t : !0) && ((n = o.options.enableSorting) != null ? n : !0) && !!e.accessorFn;
|
|
1464
|
+
}, e.getCanMultiSort = () => {
|
|
1465
|
+
var t, n;
|
|
1466
|
+
return (t = (n = e.columnDef.enableMultiSort) != null ? n : o.options.enableMultiSort) != null ? t : !!e.accessorFn;
|
|
1467
|
+
}, e.getIsSorted = () => {
|
|
1468
|
+
var t;
|
|
1469
|
+
const n = (t = o.getState().sorting) == null ? void 0 : t.find((i) => i.id === e.id);
|
|
1470
|
+
return n ? n.desc ? "desc" : "asc" : !1;
|
|
1471
|
+
}, e.getSortIndex = () => {
|
|
1472
|
+
var t, n;
|
|
1473
|
+
return (t = (n = o.getState().sorting) == null ? void 0 : n.findIndex((i) => i.id === e.id)) != null ? t : -1;
|
|
1474
|
+
}, e.clearSorting = () => {
|
|
1475
|
+
o.setSorting((t) => t != null && t.length ? t.filter((n) => n.id !== e.id) : []);
|
|
1476
|
+
}, e.getToggleSortingHandler = () => {
|
|
1477
|
+
const t = e.getCanSort();
|
|
1478
|
+
return (n) => {
|
|
1479
|
+
t && (n.persist == null || n.persist(), e.toggleSorting == null || e.toggleSorting(void 0, e.getCanMultiSort() ? o.options.isMultiSortEvent == null ? void 0 : o.options.isMultiSortEvent(n) : !1));
|
|
1480
|
+
};
|
|
1481
|
+
};
|
|
1482
|
+
},
|
|
1483
|
+
createTable: (e) => {
|
|
1484
|
+
e.setSorting = (o) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(o), e.resetSorting = (o) => {
|
|
1485
|
+
var t, n;
|
|
1486
|
+
e.setSorting(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
|
|
1487
|
+
}, e.getPreSortedRowModel = () => e.getGroupedRowModel(), e.getSortedRowModel = () => (!e._getSortedRowModel && e.options.getSortedRowModel && (e._getSortedRowModel = e.options.getSortedRowModel(e)), e.options.manualSorting || !e._getSortedRowModel ? e.getPreSortedRowModel() : e._getSortedRowModel());
|
|
1488
|
+
}
|
|
1489
|
+
}, Ze = [
|
|
1490
|
+
we,
|
|
1491
|
+
Oe,
|
|
1492
|
+
Ge,
|
|
1493
|
+
He,
|
|
1494
|
+
he,
|
|
1495
|
+
ve,
|
|
1496
|
+
Be,
|
|
1497
|
+
//depends on ColumnFaceting
|
|
1498
|
+
Te,
|
|
1499
|
+
//depends on ColumnFiltering
|
|
1500
|
+
Ye,
|
|
1501
|
+
De,
|
|
1502
|
+
//depends on RowSorting
|
|
1503
|
+
qe,
|
|
1504
|
+
Ne,
|
|
1505
|
+
ke,
|
|
1506
|
+
Ue,
|
|
1507
|
+
Ae
|
|
1508
|
+
];
|
|
1509
|
+
function ot(e) {
|
|
1510
|
+
var o, t;
|
|
1511
|
+
process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
|
|
1512
|
+
const n = [...Ze, ...(o = e._features) != null ? o : []];
|
|
1513
|
+
let i = {
|
|
1514
|
+
_features: n
|
|
1515
|
+
};
|
|
1516
|
+
const r = i._features.reduce((d, s) => Object.assign(d, s.getDefaultOptions == null ? void 0 : s.getDefaultOptions(i)), {}), l = (d) => i.options.mergeOptions ? i.options.mergeOptions(r, d) : {
|
|
1517
|
+
...r,
|
|
1518
|
+
...d
|
|
1519
|
+
};
|
|
1520
|
+
let g = {
|
|
1521
|
+
...{},
|
|
1522
|
+
...(t = e.initialState) != null ? t : {}
|
|
1523
|
+
};
|
|
1524
|
+
i._features.forEach((d) => {
|
|
1525
|
+
var s;
|
|
1526
|
+
g = (s = d.getInitialState == null ? void 0 : d.getInitialState(g)) != null ? s : g;
|
|
1527
|
+
});
|
|
1528
|
+
const a = [];
|
|
1529
|
+
let f = !1;
|
|
1530
|
+
const S = {
|
|
1531
|
+
_features: n,
|
|
1532
|
+
options: {
|
|
1533
|
+
...r,
|
|
1534
|
+
...e
|
|
1535
|
+
},
|
|
1536
|
+
initialState: g,
|
|
1537
|
+
_queue: (d) => {
|
|
1538
|
+
a.push(d), f || (f = !0, Promise.resolve().then(() => {
|
|
1539
|
+
for (; a.length; )
|
|
1540
|
+
a.shift()();
|
|
1541
|
+
f = !1;
|
|
1542
|
+
}).catch((s) => setTimeout(() => {
|
|
1543
|
+
throw s;
|
|
1544
|
+
})));
|
|
1545
|
+
},
|
|
1546
|
+
reset: () => {
|
|
1547
|
+
i.setState(i.initialState);
|
|
1548
|
+
},
|
|
1549
|
+
setOptions: (d) => {
|
|
1550
|
+
const s = I(d, i.options);
|
|
1551
|
+
i.options = l(s);
|
|
1552
|
+
},
|
|
1553
|
+
getState: () => i.options.state,
|
|
1554
|
+
setState: (d) => {
|
|
1555
|
+
i.options.onStateChange == null || i.options.onStateChange(d);
|
|
1556
|
+
},
|
|
1557
|
+
_getRowId: (d, s, c) => {
|
|
1558
|
+
var p;
|
|
1559
|
+
return (p = i.options.getRowId == null ? void 0 : i.options.getRowId(d, s, c)) != null ? p : `${c ? [c.id, s].join(".") : s}`;
|
|
1560
|
+
},
|
|
1561
|
+
getCoreRowModel: () => (i._getCoreRowModel || (i._getCoreRowModel = i.options.getCoreRowModel(i)), i._getCoreRowModel()),
|
|
1562
|
+
// The final calls start at the bottom of the model,
|
|
1563
|
+
// expanded rows, which then work their way up
|
|
1564
|
+
getRowModel: () => i.getPaginationRowModel(),
|
|
1565
|
+
//in next version, we should just pass in the row model as the optional 2nd arg
|
|
1566
|
+
getRow: (d, s) => {
|
|
1567
|
+
let c = (s ? i.getPrePaginationRowModel() : i.getRowModel()).rowsById[d];
|
|
1568
|
+
if (!c && (c = i.getCoreRowModel().rowsById[d], !c))
|
|
1569
|
+
throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${d}`) : new Error();
|
|
1570
|
+
return c;
|
|
1571
|
+
},
|
|
1572
|
+
_getDefaultColumnDef: m(() => [i.options.defaultColumn], (d) => {
|
|
1573
|
+
var s;
|
|
1574
|
+
return d = (s = d) != null ? s : {}, {
|
|
1575
|
+
header: (c) => {
|
|
1576
|
+
const p = c.header.column.columnDef;
|
|
1577
|
+
return p.accessorKey ? p.accessorKey : p.accessorFn ? p.id : null;
|
|
1578
|
+
},
|
|
1579
|
+
// footer: props => props.header.column.id,
|
|
1580
|
+
cell: (c) => {
|
|
1581
|
+
var p, R;
|
|
1582
|
+
return (p = (R = c.renderValue()) == null || R.toString == null ? void 0 : R.toString()) != null ? p : null;
|
|
1583
|
+
},
|
|
1584
|
+
...i._features.reduce((c, p) => Object.assign(c, p.getDefaultColumnDef == null ? void 0 : p.getDefaultColumnDef()), {}),
|
|
1585
|
+
...d
|
|
1586
|
+
};
|
|
1587
|
+
}, C(e, "debugColumns", "_getDefaultColumnDef")),
|
|
1588
|
+
_getColumnDefs: () => i.options.columns,
|
|
1589
|
+
getAllColumns: m(() => [i._getColumnDefs()], (d) => {
|
|
1590
|
+
const s = function(c, p, R) {
|
|
1591
|
+
return R === void 0 && (R = 0), c.map((w) => {
|
|
1592
|
+
const h = Re(i, w, R, p), v = w;
|
|
1593
|
+
return h.columns = v.columns ? s(v.columns, h, R + 1) : [], h;
|
|
1594
|
+
});
|
|
1595
|
+
};
|
|
1596
|
+
return s(d);
|
|
1597
|
+
}, C(e, "debugColumns", "getAllColumns")),
|
|
1598
|
+
getAllFlatColumns: m(() => [i.getAllColumns()], (d) => d.flatMap((s) => s.getFlatColumns()), C(e, "debugColumns", "getAllFlatColumns")),
|
|
1599
|
+
_getAllFlatColumnsById: m(() => [i.getAllFlatColumns()], (d) => d.reduce((s, c) => (s[c.id] = c, s), {}), C(e, "debugColumns", "getAllFlatColumnsById")),
|
|
1600
|
+
getAllLeafColumns: m(() => [i.getAllColumns(), i._getOrderColumnsFn()], (d, s) => {
|
|
1601
|
+
let c = d.flatMap((p) => p.getLeafColumns());
|
|
1602
|
+
return s(c);
|
|
1603
|
+
}, C(e, "debugColumns", "getAllLeafColumns")),
|
|
1604
|
+
getColumn: (d) => {
|
|
1605
|
+
const s = i._getAllFlatColumnsById()[d];
|
|
1606
|
+
return process.env.NODE_ENV !== "production" && !s && console.error(`[Table] Column with id '${d}' does not exist.`), s;
|
|
1607
|
+
}
|
|
1608
|
+
};
|
|
1609
|
+
Object.assign(i, S);
|
|
1610
|
+
for (let d = 0; d < i._features.length; d++) {
|
|
1611
|
+
const s = i._features[d];
|
|
1612
|
+
s == null || s.createTable == null || s.createTable(i);
|
|
1613
|
+
}
|
|
1614
|
+
return i;
|
|
1615
|
+
}
|
|
1616
|
+
function it() {
|
|
1617
|
+
return (e) => m(() => [e.options.data], (o) => {
|
|
1618
|
+
const t = {
|
|
1619
|
+
rows: [],
|
|
1620
|
+
flatRows: [],
|
|
1621
|
+
rowsById: {}
|
|
1622
|
+
}, n = function(i, r, l) {
|
|
1623
|
+
r === void 0 && (r = 0);
|
|
1624
|
+
const u = [];
|
|
1625
|
+
for (let a = 0; a < i.length; a++) {
|
|
1626
|
+
const f = Q(e, e._getRowId(i[a], a, l), i[a], a, r, void 0, l == null ? void 0 : l.id);
|
|
1627
|
+
if (t.flatRows.push(f), t.rowsById[f.id] = f, u.push(f), e.options.getSubRows) {
|
|
1628
|
+
var g;
|
|
1629
|
+
f.originalSubRows = e.options.getSubRows(i[a], a), (g = f.originalSubRows) != null && g.length && (f.subRows = n(f.originalSubRows, r + 1, f));
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
return u;
|
|
1633
|
+
};
|
|
1634
|
+
return t.rows = n(o), t;
|
|
1635
|
+
}, C(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
|
|
1636
|
+
}
|
|
1637
|
+
function be(e) {
|
|
1638
|
+
const o = [], t = (n) => {
|
|
1639
|
+
var i;
|
|
1640
|
+
o.push(n), (i = n.subRows) != null && i.length && n.getIsExpanded() && n.subRows.forEach(t);
|
|
1641
|
+
};
|
|
1642
|
+
return e.rows.forEach(t), {
|
|
1643
|
+
rows: o,
|
|
1644
|
+
flatRows: e.flatRows,
|
|
1645
|
+
rowsById: e.rowsById
|
|
1646
|
+
};
|
|
1647
|
+
}
|
|
1648
|
+
function et(e, o, t) {
|
|
1649
|
+
return t.options.filterFromLeafRows ? tt(e, o, t) : nt(e, o, t);
|
|
1650
|
+
}
|
|
1651
|
+
function tt(e, o, t) {
|
|
1652
|
+
var n;
|
|
1653
|
+
const i = [], r = {}, l = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, u = function(g, a) {
|
|
1654
|
+
a === void 0 && (a = 0);
|
|
1655
|
+
const f = [];
|
|
1656
|
+
for (let d = 0; d < g.length; d++) {
|
|
1657
|
+
var S;
|
|
1658
|
+
let s = g[d];
|
|
1659
|
+
const c = Q(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
|
|
1660
|
+
if (c.columnFilters = s.columnFilters, (S = s.subRows) != null && S.length && a < l) {
|
|
1661
|
+
if (c.subRows = u(s.subRows, a + 1), s = c, o(s) && !c.subRows.length) {
|
|
1662
|
+
f.push(s), r[s.id] = s, i.push(s);
|
|
1663
|
+
continue;
|
|
1664
|
+
}
|
|
1665
|
+
if (o(s) || c.subRows.length) {
|
|
1666
|
+
f.push(s), r[s.id] = s, i.push(s);
|
|
1667
|
+
continue;
|
|
1668
|
+
}
|
|
1669
|
+
} else
|
|
1670
|
+
s = c, o(s) && (f.push(s), r[s.id] = s, i.push(s));
|
|
1671
|
+
}
|
|
1672
|
+
return f;
|
|
1673
|
+
};
|
|
1674
|
+
return {
|
|
1675
|
+
rows: u(e),
|
|
1676
|
+
flatRows: i,
|
|
1677
|
+
rowsById: r
|
|
1678
|
+
};
|
|
1679
|
+
}
|
|
1680
|
+
function nt(e, o, t) {
|
|
1681
|
+
var n;
|
|
1682
|
+
const i = [], r = {}, l = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, u = function(g, a) {
|
|
1683
|
+
a === void 0 && (a = 0);
|
|
1684
|
+
const f = [];
|
|
1685
|
+
for (let d = 0; d < g.length; d++) {
|
|
1686
|
+
let s = g[d];
|
|
1687
|
+
if (o(s)) {
|
|
1688
|
+
var S;
|
|
1689
|
+
if ((S = s.subRows) != null && S.length && a < l) {
|
|
1690
|
+
const p = Q(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
|
|
1691
|
+
p.subRows = u(s.subRows, a + 1), s = p;
|
|
1692
|
+
}
|
|
1693
|
+
f.push(s), i.push(s), r[s.id] = s;
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
return f;
|
|
1697
|
+
};
|
|
1698
|
+
return {
|
|
1699
|
+
rows: u(e),
|
|
1700
|
+
flatRows: i,
|
|
1701
|
+
rowsById: r
|
|
1702
|
+
};
|
|
1703
|
+
}
|
|
1704
|
+
function rt() {
|
|
1705
|
+
return (e) => m(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
|
|
1706
|
+
if (!o.rows.length || !(t != null && t.length) && !n) {
|
|
1707
|
+
for (let d = 0; d < o.flatRows.length; d++)
|
|
1708
|
+
o.flatRows[d].columnFilters = {}, o.flatRows[d].columnFiltersMeta = {};
|
|
1709
|
+
return o;
|
|
1710
|
+
}
|
|
1711
|
+
const i = [], r = [];
|
|
1712
|
+
(t ?? []).forEach((d) => {
|
|
1713
|
+
var s;
|
|
1714
|
+
const c = e.getColumn(d.id);
|
|
1715
|
+
if (!c)
|
|
1716
|
+
return;
|
|
1717
|
+
const p = c.getFilterFn();
|
|
1718
|
+
if (!p) {
|
|
1719
|
+
process.env.NODE_ENV !== "production" && console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${c.id}.`);
|
|
1720
|
+
return;
|
|
1721
|
+
}
|
|
1722
|
+
i.push({
|
|
1723
|
+
id: d.id,
|
|
1724
|
+
filterFn: p,
|
|
1725
|
+
resolvedValue: (s = p.resolveFilterValue == null ? void 0 : p.resolveFilterValue(d.value)) != null ? s : d.value
|
|
1726
|
+
});
|
|
1727
|
+
});
|
|
1728
|
+
const l = (t ?? []).map((d) => d.id), u = e.getGlobalFilterFn(), g = e.getAllLeafColumns().filter((d) => d.getCanGlobalFilter());
|
|
1729
|
+
n && u && g.length && (l.push("__global__"), g.forEach((d) => {
|
|
1730
|
+
var s;
|
|
1731
|
+
r.push({
|
|
1732
|
+
id: d.id,
|
|
1733
|
+
filterFn: u,
|
|
1734
|
+
resolvedValue: (s = u.resolveFilterValue == null ? void 0 : u.resolveFilterValue(n)) != null ? s : n
|
|
1735
|
+
});
|
|
1736
|
+
}));
|
|
1737
|
+
let a, f;
|
|
1738
|
+
for (let d = 0; d < o.flatRows.length; d++) {
|
|
1739
|
+
const s = o.flatRows[d];
|
|
1740
|
+
if (s.columnFilters = {}, i.length)
|
|
1741
|
+
for (let c = 0; c < i.length; c++) {
|
|
1742
|
+
a = i[c];
|
|
1743
|
+
const p = a.id;
|
|
1744
|
+
s.columnFilters[p] = a.filterFn(s, p, a.resolvedValue, (R) => {
|
|
1745
|
+
s.columnFiltersMeta[p] = R;
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1748
|
+
if (r.length) {
|
|
1749
|
+
for (let c = 0; c < r.length; c++) {
|
|
1750
|
+
f = r[c];
|
|
1751
|
+
const p = f.id;
|
|
1752
|
+
if (f.filterFn(s, p, f.resolvedValue, (R) => {
|
|
1753
|
+
s.columnFiltersMeta[p] = R;
|
|
1754
|
+
})) {
|
|
1755
|
+
s.columnFilters.__global__ = !0;
|
|
1756
|
+
break;
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
s.columnFilters.__global__ !== !0 && (s.columnFilters.__global__ = !1);
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
const S = (d) => {
|
|
1763
|
+
for (let s = 0; s < l.length; s++)
|
|
1764
|
+
if (d.columnFilters[l[s]] === !1)
|
|
1765
|
+
return !1;
|
|
1766
|
+
return !0;
|
|
1767
|
+
};
|
|
1768
|
+
return et(o.rows, S, e);
|
|
1769
|
+
}, C(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
|
|
1770
|
+
}
|
|
1771
|
+
function lt(e) {
|
|
1772
|
+
return (o) => m(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
|
|
1773
|
+
if (!n.rows.length)
|
|
1774
|
+
return n;
|
|
1775
|
+
const {
|
|
1776
|
+
pageSize: i,
|
|
1777
|
+
pageIndex: r
|
|
1778
|
+
} = t;
|
|
1779
|
+
let {
|
|
1780
|
+
rows: l,
|
|
1781
|
+
flatRows: u,
|
|
1782
|
+
rowsById: g
|
|
1783
|
+
} = n;
|
|
1784
|
+
const a = i * r, f = a + i;
|
|
1785
|
+
l = l.slice(a, f);
|
|
1786
|
+
let S;
|
|
1787
|
+
o.options.paginateExpandedRows ? S = {
|
|
1788
|
+
rows: l,
|
|
1789
|
+
flatRows: u,
|
|
1790
|
+
rowsById: g
|
|
1791
|
+
} : S = be({
|
|
1792
|
+
rows: l,
|
|
1793
|
+
flatRows: u,
|
|
1794
|
+
rowsById: g
|
|
1795
|
+
}), S.flatRows = [];
|
|
1796
|
+
const d = (s) => {
|
|
1797
|
+
S.flatRows.push(s), s.subRows.length && s.subRows.forEach(d);
|
|
1798
|
+
};
|
|
1799
|
+
return S.rows.forEach(d), S;
|
|
1800
|
+
}, C(o.options, "debugTable", "getPaginationRowModel"));
|
|
1801
|
+
}
|
|
1802
|
+
function st() {
|
|
1803
|
+
return (e) => m(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
|
|
1804
|
+
if (!t.rows.length || !(o != null && o.length))
|
|
1805
|
+
return t;
|
|
1806
|
+
const n = e.getState().sorting, i = [], r = n.filter((g) => {
|
|
1807
|
+
var a;
|
|
1808
|
+
return (a = e.getColumn(g.id)) == null ? void 0 : a.getCanSort();
|
|
1809
|
+
}), l = {};
|
|
1810
|
+
r.forEach((g) => {
|
|
1811
|
+
const a = e.getColumn(g.id);
|
|
1812
|
+
a && (l[g.id] = {
|
|
1813
|
+
sortUndefined: a.columnDef.sortUndefined,
|
|
1814
|
+
invertSorting: a.columnDef.invertSorting,
|
|
1815
|
+
sortingFn: a.getSortingFn()
|
|
1816
|
+
});
|
|
1817
|
+
});
|
|
1818
|
+
const u = (g) => {
|
|
1819
|
+
const a = g.map((f) => ({
|
|
1820
|
+
...f
|
|
1821
|
+
}));
|
|
1822
|
+
return a.sort((f, S) => {
|
|
1823
|
+
for (let s = 0; s < r.length; s += 1) {
|
|
1824
|
+
var d;
|
|
1825
|
+
const c = r[s], p = l[c.id], R = p.sortUndefined, w = (d = c == null ? void 0 : c.desc) != null ? d : !1;
|
|
1826
|
+
let h = 0;
|
|
1827
|
+
if (R) {
|
|
1828
|
+
const v = f.getValue(c.id), M = S.getValue(c.id), F = v === void 0, E = M === void 0;
|
|
1829
|
+
if (F || E) {
|
|
1830
|
+
if (R === "first") return F ? -1 : 1;
|
|
1831
|
+
if (R === "last") return F ? 1 : -1;
|
|
1832
|
+
h = F && E ? 0 : F ? R : -R;
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
if (h === 0 && (h = p.sortingFn(f, S, c.id)), h !== 0)
|
|
1836
|
+
return w && (h *= -1), p.invertSorting && (h *= -1), h;
|
|
1837
|
+
}
|
|
1838
|
+
return f.index - S.index;
|
|
1839
|
+
}), a.forEach((f) => {
|
|
1840
|
+
var S;
|
|
1841
|
+
i.push(f), (S = f.subRows) != null && S.length && (f.subRows = u(f.subRows));
|
|
1842
|
+
}), a;
|
|
1843
|
+
};
|
|
1844
|
+
return {
|
|
1845
|
+
rows: u(t.rows),
|
|
1846
|
+
flatRows: i,
|
|
1847
|
+
rowsById: t.rowsById
|
|
1848
|
+
};
|
|
1849
|
+
}, C(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
|
|
1850
|
+
}
|
|
1851
|
+
export {
|
|
1852
|
+
he as ColumnFaceting,
|
|
1853
|
+
ve as ColumnFiltering,
|
|
1854
|
+
De as ColumnGrouping,
|
|
1855
|
+
Ge as ColumnOrdering,
|
|
1856
|
+
He as ColumnPinning,
|
|
1857
|
+
Ae as ColumnSizing,
|
|
1858
|
+
Oe as ColumnVisibility,
|
|
1859
|
+
Be as GlobalFaceting,
|
|
1860
|
+
Te as GlobalFiltering,
|
|
1861
|
+
we as Headers,
|
|
1862
|
+
qe as RowExpanding,
|
|
1863
|
+
Ne as RowPagination,
|
|
1864
|
+
ke as RowPinning,
|
|
1865
|
+
Ue as RowSelection,
|
|
1866
|
+
Ye as RowSorting,
|
|
1867
|
+
y as _getVisibleLeafColumns,
|
|
1868
|
+
z as aggregationFns,
|
|
1869
|
+
G as buildHeaderGroups,
|
|
1870
|
+
Ce as createCell,
|
|
1871
|
+
Re as createColumn,
|
|
1872
|
+
Q as createRow,
|
|
1873
|
+
ot as createTable,
|
|
1874
|
+
H as defaultColumnSizing,
|
|
1875
|
+
be as expandRows,
|
|
1876
|
+
P as filterFns,
|
|
1877
|
+
me as flattenBy,
|
|
1878
|
+
I as functionalUpdate,
|
|
1879
|
+
it as getCoreRowModel,
|
|
1880
|
+
rt as getFilteredRowModel,
|
|
1881
|
+
C as getMemoOptions,
|
|
1882
|
+
lt as getPaginationRowModel,
|
|
1883
|
+
st as getSortedRowModel,
|
|
1884
|
+
A as isFunction,
|
|
1885
|
+
Se as isNumberArray,
|
|
1886
|
+
Y as isRowSelected,
|
|
1887
|
+
K as isSubRowSelected,
|
|
1888
|
+
$ as makeStateUpdater,
|
|
1889
|
+
m as memo,
|
|
1890
|
+
ye as orderColumns,
|
|
1891
|
+
ze as passiveEventSupported,
|
|
1892
|
+
J as reSplitAlphaNumeric,
|
|
1893
|
+
k as selectRowsFn,
|
|
1894
|
+
oe as shouldAutoRemoveFilter,
|
|
1895
|
+
D as sortingFns
|
|
1896
|
+
};
|