@zhanxp/station-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/dist/components/em-box/index.d.ts +24 -0
- package/dist/components/em-button/index.d.ts +9 -0
- package/dist/components/em-drawer/index.d.ts +11 -0
- package/dist/components/em-grid/index.d.ts +10 -0
- package/dist/components/em-input/index.d.ts +13 -0
- package/dist/components/em-modal/index.d.ts +11 -0
- package/dist/components/em-pagination/index.d.ts +10 -0
- package/dist/components/em-select/index.d.ts +33 -0
- package/dist/components/em-table/index.d.ts +31 -0
- package/dist/components/ui/Dialog.d.ts +23 -0
- package/dist/components/ui/Loading.d.ts +6 -0
- package/dist/components/ui/Toast.d.ts +9 -0
- package/dist/index.d.ts +23 -0
- package/dist/station-ui.js +3230 -0
- package/dist/station-ui.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/utils.d.ts +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,3230 @@
|
|
|
1
|
+
import { jsx as f, jsxs as _, Fragment as Ze } from "react/jsx-runtime";
|
|
2
|
+
import * as B from "react";
|
|
3
|
+
import { useState as q, useRef as yt, useCallback as W, useMemo as se, Fragment as L, forwardRef as et, useEffect as be } from "react";
|
|
4
|
+
import { flushSync as _t, createPortal as tt } from "react-dom";
|
|
5
|
+
import { Transition as G, Dialog as U, Listbox as D } from "@headlessui/react";
|
|
6
|
+
import { Close as nt, Down as ke, Check as Te, Info as Ft, Attention as it, CloseOne as Mt, CheckOne as $t } from "@icon-park/react";
|
|
7
|
+
/**
|
|
8
|
+
* table-core
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) TanStack
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
14
|
+
*
|
|
15
|
+
* @license MIT
|
|
16
|
+
*/
|
|
17
|
+
function H(e, i) {
|
|
18
|
+
return typeof e == "function" ? e(i) : e;
|
|
19
|
+
}
|
|
20
|
+
function b(e, i) {
|
|
21
|
+
return (t) => {
|
|
22
|
+
i.setState((n) => ({
|
|
23
|
+
...n,
|
|
24
|
+
[e]: H(t, n[e])
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function pe(e) {
|
|
29
|
+
return e instanceof Function;
|
|
30
|
+
}
|
|
31
|
+
function It(e) {
|
|
32
|
+
return Array.isArray(e) && e.every((i) => typeof i == "number");
|
|
33
|
+
}
|
|
34
|
+
function Et(e, i) {
|
|
35
|
+
const t = [], n = (o) => {
|
|
36
|
+
o.forEach((r) => {
|
|
37
|
+
t.push(r);
|
|
38
|
+
const s = i(r);
|
|
39
|
+
s != null && s.length && n(s);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
return n(e), t;
|
|
43
|
+
}
|
|
44
|
+
function C(e, i, t) {
|
|
45
|
+
let n = [], o;
|
|
46
|
+
return (r) => {
|
|
47
|
+
let s;
|
|
48
|
+
t.key && t.debug && (s = Date.now());
|
|
49
|
+
const l = e(r);
|
|
50
|
+
if (!(l.length !== n.length || l.some((g, m) => n[m] !== g)))
|
|
51
|
+
return o;
|
|
52
|
+
n = l;
|
|
53
|
+
let u;
|
|
54
|
+
if (t.key && t.debug && (u = Date.now()), o = i(...l), t == null || t.onChange == null || t.onChange(o), t.key && t.debug && t != null && t.debug()) {
|
|
55
|
+
const g = Math.round((Date.now() - s) * 100) / 100, m = Math.round((Date.now() - u) * 100) / 100, c = m / 16, d = (p, h) => {
|
|
56
|
+
for (p = String(p); p.length < h; )
|
|
57
|
+
p = " " + p;
|
|
58
|
+
return p;
|
|
59
|
+
};
|
|
60
|
+
console.info(`%c⏱ ${d(m, 5)} /${d(g, 5)} ms`, `
|
|
61
|
+
font-size: .6rem;
|
|
62
|
+
font-weight: bold;
|
|
63
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * c, 120))}deg 100% 31%);`, t == null ? void 0 : t.key);
|
|
64
|
+
}
|
|
65
|
+
return o;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function x(e, i, t, n) {
|
|
69
|
+
return {
|
|
70
|
+
debug: () => {
|
|
71
|
+
var o;
|
|
72
|
+
return (o = e == null ? void 0 : e.debugAll) != null ? o : e[i];
|
|
73
|
+
},
|
|
74
|
+
key: process.env.NODE_ENV === "development" && t,
|
|
75
|
+
onChange: n
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function bt(e, i, t, n) {
|
|
79
|
+
const o = () => {
|
|
80
|
+
var s;
|
|
81
|
+
return (s = r.getValue()) != null ? s : e.options.renderFallbackValue;
|
|
82
|
+
}, r = {
|
|
83
|
+
id: `${i.id}_${t.id}`,
|
|
84
|
+
row: i,
|
|
85
|
+
column: t,
|
|
86
|
+
getValue: () => i.getValue(n),
|
|
87
|
+
renderValue: o,
|
|
88
|
+
getContext: C(() => [e, t, i, r], (s, l, a, u) => ({
|
|
89
|
+
table: s,
|
|
90
|
+
column: l,
|
|
91
|
+
row: a,
|
|
92
|
+
cell: u,
|
|
93
|
+
getValue: u.getValue,
|
|
94
|
+
renderValue: u.renderValue
|
|
95
|
+
}), x(e.options, "debugCells", "cell.getContext"))
|
|
96
|
+
};
|
|
97
|
+
return e._features.forEach((s) => {
|
|
98
|
+
s.createCell == null || s.createCell(r, t, i, e);
|
|
99
|
+
}, {}), r;
|
|
100
|
+
}
|
|
101
|
+
function Vt(e, i, t, n) {
|
|
102
|
+
var o, r;
|
|
103
|
+
const l = {
|
|
104
|
+
...e._getDefaultColumnDef(),
|
|
105
|
+
...i
|
|
106
|
+
}, a = l.accessorKey;
|
|
107
|
+
let u = (o = (r = l.id) != null ? r : a ? typeof String.prototype.replaceAll == "function" ? a.replaceAll(".", "_") : a.replace(/\./g, "_") : void 0) != null ? o : typeof l.header == "string" ? l.header : void 0, g;
|
|
108
|
+
if (l.accessorFn ? g = l.accessorFn : a && (a.includes(".") ? g = (c) => {
|
|
109
|
+
let d = c;
|
|
110
|
+
for (const h of a.split(".")) {
|
|
111
|
+
var p;
|
|
112
|
+
d = (p = d) == null ? void 0 : p[h], process.env.NODE_ENV !== "production" && d === void 0 && console.warn(`"${h}" in deeply nested key "${a}" returned undefined.`);
|
|
113
|
+
}
|
|
114
|
+
return d;
|
|
115
|
+
} : g = (c) => c[l.accessorKey]), !u)
|
|
116
|
+
throw process.env.NODE_ENV !== "production" ? new Error(l.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
|
|
117
|
+
let m = {
|
|
118
|
+
id: `${String(u)}`,
|
|
119
|
+
accessorFn: g,
|
|
120
|
+
parent: n,
|
|
121
|
+
depth: t,
|
|
122
|
+
columnDef: l,
|
|
123
|
+
columns: [],
|
|
124
|
+
getFlatColumns: C(() => [!0], () => {
|
|
125
|
+
var c;
|
|
126
|
+
return [m, ...(c = m.columns) == null ? void 0 : c.flatMap((d) => d.getFlatColumns())];
|
|
127
|
+
}, x(e.options, "debugColumns", "column.getFlatColumns")),
|
|
128
|
+
getLeafColumns: C(() => [e._getOrderColumnsFn()], (c) => {
|
|
129
|
+
var d;
|
|
130
|
+
if ((d = m.columns) != null && d.length) {
|
|
131
|
+
let p = m.columns.flatMap((h) => h.getLeafColumns());
|
|
132
|
+
return c(p);
|
|
133
|
+
}
|
|
134
|
+
return [m];
|
|
135
|
+
}, x(e.options, "debugColumns", "column.getLeafColumns"))
|
|
136
|
+
};
|
|
137
|
+
for (const c of e._features)
|
|
138
|
+
c.createColumn == null || c.createColumn(m, e);
|
|
139
|
+
return m;
|
|
140
|
+
}
|
|
141
|
+
const E = "debugHeaders";
|
|
142
|
+
function Be(e, i, t) {
|
|
143
|
+
var n;
|
|
144
|
+
let r = {
|
|
145
|
+
id: (n = t.id) != null ? n : i.id,
|
|
146
|
+
column: i,
|
|
147
|
+
index: t.index,
|
|
148
|
+
isPlaceholder: !!t.isPlaceholder,
|
|
149
|
+
placeholderId: t.placeholderId,
|
|
150
|
+
depth: t.depth,
|
|
151
|
+
subHeaders: [],
|
|
152
|
+
colSpan: 0,
|
|
153
|
+
rowSpan: 0,
|
|
154
|
+
headerGroup: null,
|
|
155
|
+
getLeafHeaders: () => {
|
|
156
|
+
const s = [], l = (a) => {
|
|
157
|
+
a.subHeaders && a.subHeaders.length && a.subHeaders.map(l), s.push(a);
|
|
158
|
+
};
|
|
159
|
+
return l(r), s;
|
|
160
|
+
},
|
|
161
|
+
getContext: () => ({
|
|
162
|
+
table: e,
|
|
163
|
+
header: r,
|
|
164
|
+
column: i
|
|
165
|
+
})
|
|
166
|
+
};
|
|
167
|
+
return e._features.forEach((s) => {
|
|
168
|
+
s.createHeader == null || s.createHeader(r, e);
|
|
169
|
+
}), r;
|
|
170
|
+
}
|
|
171
|
+
const Pt = {
|
|
172
|
+
createTable: (e) => {
|
|
173
|
+
e.getHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (i, t, n, o) => {
|
|
174
|
+
var r, s;
|
|
175
|
+
const l = (r = n == null ? void 0 : n.map((m) => t.find((c) => c.id === m)).filter(Boolean)) != null ? r : [], a = (s = o == null ? void 0 : o.map((m) => t.find((c) => c.id === m)).filter(Boolean)) != null ? s : [], u = t.filter((m) => !(n != null && n.includes(m.id)) && !(o != null && o.includes(m.id)));
|
|
176
|
+
return le(i, [...l, ...u, ...a], e);
|
|
177
|
+
}, x(e.options, E, "getHeaderGroups")), e.getCenterHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (i, t, n, o) => (t = t.filter((r) => !(n != null && n.includes(r.id)) && !(o != null && o.includes(r.id))), le(i, t, e, "center")), x(e.options, E, "getCenterHeaderGroups")), e.getLeftHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (i, t, n) => {
|
|
178
|
+
var o;
|
|
179
|
+
const r = (o = n == null ? void 0 : n.map((s) => t.find((l) => l.id === s)).filter(Boolean)) != null ? o : [];
|
|
180
|
+
return le(i, r, e, "left");
|
|
181
|
+
}, x(e.options, E, "getLeftHeaderGroups")), e.getRightHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (i, t, n) => {
|
|
182
|
+
var o;
|
|
183
|
+
const r = (o = n == null ? void 0 : n.map((s) => t.find((l) => l.id === s)).filter(Boolean)) != null ? o : [];
|
|
184
|
+
return le(i, r, e, "right");
|
|
185
|
+
}, x(e.options, E, "getRightHeaderGroups")), e.getFooterGroups = C(() => [e.getHeaderGroups()], (i) => [...i].reverse(), x(e.options, E, "getFooterGroups")), e.getLeftFooterGroups = C(() => [e.getLeftHeaderGroups()], (i) => [...i].reverse(), x(e.options, E, "getLeftFooterGroups")), e.getCenterFooterGroups = C(() => [e.getCenterHeaderGroups()], (i) => [...i].reverse(), x(e.options, E, "getCenterFooterGroups")), e.getRightFooterGroups = C(() => [e.getRightHeaderGroups()], (i) => [...i].reverse(), x(e.options, E, "getRightFooterGroups")), e.getFlatHeaders = C(() => [e.getHeaderGroups()], (i) => i.map((t) => t.headers).flat(), x(e.options, E, "getFlatHeaders")), e.getLeftFlatHeaders = C(() => [e.getLeftHeaderGroups()], (i) => i.map((t) => t.headers).flat(), x(e.options, E, "getLeftFlatHeaders")), e.getCenterFlatHeaders = C(() => [e.getCenterHeaderGroups()], (i) => i.map((t) => t.headers).flat(), x(e.options, E, "getCenterFlatHeaders")), e.getRightFlatHeaders = C(() => [e.getRightHeaderGroups()], (i) => i.map((t) => t.headers).flat(), x(e.options, E, "getRightFlatHeaders")), e.getCenterLeafHeaders = C(() => [e.getCenterFlatHeaders()], (i) => i.filter((t) => {
|
|
186
|
+
var n;
|
|
187
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
188
|
+
}), x(e.options, E, "getCenterLeafHeaders")), e.getLeftLeafHeaders = C(() => [e.getLeftFlatHeaders()], (i) => i.filter((t) => {
|
|
189
|
+
var n;
|
|
190
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
191
|
+
}), x(e.options, E, "getLeftLeafHeaders")), e.getRightLeafHeaders = C(() => [e.getRightFlatHeaders()], (i) => i.filter((t) => {
|
|
192
|
+
var n;
|
|
193
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
194
|
+
}), x(e.options, E, "getRightLeafHeaders")), e.getLeafHeaders = C(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (i, t, n) => {
|
|
195
|
+
var o, r, s, l, a, u;
|
|
196
|
+
return [...(o = (r = i[0]) == null ? void 0 : r.headers) != null ? o : [], ...(s = (l = t[0]) == null ? void 0 : l.headers) != null ? s : [], ...(a = (u = n[0]) == null ? void 0 : u.headers) != null ? a : []].map((g) => g.getLeafHeaders()).flat();
|
|
197
|
+
}, x(e.options, E, "getLeafHeaders"));
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
function le(e, i, t, n) {
|
|
201
|
+
var o, r;
|
|
202
|
+
let s = 0;
|
|
203
|
+
const l = function(c, d) {
|
|
204
|
+
d === void 0 && (d = 1), s = Math.max(s, d), c.filter((p) => p.getIsVisible()).forEach((p) => {
|
|
205
|
+
var h;
|
|
206
|
+
(h = p.columns) != null && h.length && l(p.columns, d + 1);
|
|
207
|
+
}, 0);
|
|
208
|
+
};
|
|
209
|
+
l(e);
|
|
210
|
+
let a = [];
|
|
211
|
+
const u = (c, d) => {
|
|
212
|
+
const p = {
|
|
213
|
+
depth: d,
|
|
214
|
+
id: [n, `${d}`].filter(Boolean).join("_"),
|
|
215
|
+
headers: []
|
|
216
|
+
}, h = [];
|
|
217
|
+
c.forEach((w) => {
|
|
218
|
+
const S = [...h].reverse()[0], v = w.column.depth === p.depth;
|
|
219
|
+
let F, $ = !1;
|
|
220
|
+
if (v && w.column.parent ? F = w.column.parent : (F = w.column, $ = !0), S && (S == null ? void 0 : S.column) === F)
|
|
221
|
+
S.subHeaders.push(w);
|
|
222
|
+
else {
|
|
223
|
+
const I = Be(t, F, {
|
|
224
|
+
id: [n, d, F.id, w == null ? void 0 : w.id].filter(Boolean).join("_"),
|
|
225
|
+
isPlaceholder: $,
|
|
226
|
+
placeholderId: $ ? `${h.filter((P) => P.column === F).length}` : void 0,
|
|
227
|
+
depth: d,
|
|
228
|
+
index: h.length
|
|
229
|
+
});
|
|
230
|
+
I.subHeaders.push(w), h.push(I);
|
|
231
|
+
}
|
|
232
|
+
p.headers.push(w), w.headerGroup = p;
|
|
233
|
+
}), a.push(p), d > 0 && u(h, d - 1);
|
|
234
|
+
}, g = i.map((c, d) => Be(t, c, {
|
|
235
|
+
depth: s,
|
|
236
|
+
index: d
|
|
237
|
+
}));
|
|
238
|
+
u(g, s - 1), a.reverse();
|
|
239
|
+
const m = (c) => c.filter((p) => p.column.getIsVisible()).map((p) => {
|
|
240
|
+
let h = 0, w = 0, S = [0];
|
|
241
|
+
p.subHeaders && p.subHeaders.length ? (S = [], m(p.subHeaders).forEach((F) => {
|
|
242
|
+
let {
|
|
243
|
+
colSpan: $,
|
|
244
|
+
rowSpan: I
|
|
245
|
+
} = F;
|
|
246
|
+
h += $, S.push(I);
|
|
247
|
+
})) : h = 1;
|
|
248
|
+
const v = Math.min(...S);
|
|
249
|
+
return w = w + v, p.colSpan = h, p.rowSpan = w, {
|
|
250
|
+
colSpan: h,
|
|
251
|
+
rowSpan: w
|
|
252
|
+
};
|
|
253
|
+
});
|
|
254
|
+
return m((o = (r = a[0]) == null ? void 0 : r.headers) != null ? o : []), a;
|
|
255
|
+
}
|
|
256
|
+
const zt = (e, i, t, n, o, r, s) => {
|
|
257
|
+
let l = {
|
|
258
|
+
id: i,
|
|
259
|
+
index: n,
|
|
260
|
+
original: t,
|
|
261
|
+
depth: o,
|
|
262
|
+
parentId: s,
|
|
263
|
+
_valuesCache: {},
|
|
264
|
+
_uniqueValuesCache: {},
|
|
265
|
+
getValue: (a) => {
|
|
266
|
+
if (l._valuesCache.hasOwnProperty(a))
|
|
267
|
+
return l._valuesCache[a];
|
|
268
|
+
const u = e.getColumn(a);
|
|
269
|
+
if (u != null && u.accessorFn)
|
|
270
|
+
return l._valuesCache[a] = u.accessorFn(l.original, n), l._valuesCache[a];
|
|
271
|
+
},
|
|
272
|
+
getUniqueValues: (a) => {
|
|
273
|
+
if (l._uniqueValuesCache.hasOwnProperty(a))
|
|
274
|
+
return l._uniqueValuesCache[a];
|
|
275
|
+
const u = e.getColumn(a);
|
|
276
|
+
if (u != null && u.accessorFn)
|
|
277
|
+
return u.columnDef.getUniqueValues ? (l._uniqueValuesCache[a] = u.columnDef.getUniqueValues(l.original, n), l._uniqueValuesCache[a]) : (l._uniqueValuesCache[a] = [l.getValue(a)], l._uniqueValuesCache[a]);
|
|
278
|
+
},
|
|
279
|
+
renderValue: (a) => {
|
|
280
|
+
var u;
|
|
281
|
+
return (u = l.getValue(a)) != null ? u : e.options.renderFallbackValue;
|
|
282
|
+
},
|
|
283
|
+
subRows: [],
|
|
284
|
+
getLeafRows: () => Et(l.subRows, (a) => a.subRows),
|
|
285
|
+
getParentRow: () => l.parentId ? e.getRow(l.parentId, !0) : void 0,
|
|
286
|
+
getParentRows: () => {
|
|
287
|
+
let a = [], u = l;
|
|
288
|
+
for (; ; ) {
|
|
289
|
+
const g = u.getParentRow();
|
|
290
|
+
if (!g) break;
|
|
291
|
+
a.push(g), u = g;
|
|
292
|
+
}
|
|
293
|
+
return a.reverse();
|
|
294
|
+
},
|
|
295
|
+
getAllCells: C(() => [e.getAllLeafColumns()], (a) => a.map((u) => bt(e, l, u, u.id)), x(e.options, "debugRows", "getAllCells")),
|
|
296
|
+
_getAllCellsByColumnId: C(() => [l.getAllCells()], (a) => a.reduce((u, g) => (u[g.column.id] = g, u), {}), x(e.options, "debugRows", "getAllCellsByColumnId"))
|
|
297
|
+
};
|
|
298
|
+
for (let a = 0; a < e._features.length; a++) {
|
|
299
|
+
const u = e._features[a];
|
|
300
|
+
u == null || u.createRow == null || u.createRow(l, e);
|
|
301
|
+
}
|
|
302
|
+
return l;
|
|
303
|
+
}, Nt = {
|
|
304
|
+
createColumn: (e, i) => {
|
|
305
|
+
e._getFacetedRowModel = i.options.getFacetedRowModel && i.options.getFacetedRowModel(i, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : i.getPreFilteredRowModel(), e._getFacetedUniqueValues = i.options.getFacetedUniqueValues && i.options.getFacetedUniqueValues(i, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = i.options.getFacetedMinMaxValues && i.options.getFacetedMinMaxValues(i, e.id), e.getFacetedMinMaxValues = () => {
|
|
306
|
+
if (e._getFacetedMinMaxValues)
|
|
307
|
+
return e._getFacetedMinMaxValues();
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
}, ot = (e, i, t) => {
|
|
311
|
+
var n, o;
|
|
312
|
+
const r = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
|
|
313
|
+
return !!(!((o = e.getValue(i)) == null || (o = o.toString()) == null || (o = o.toLowerCase()) == null) && o.includes(r));
|
|
314
|
+
};
|
|
315
|
+
ot.autoRemove = (e) => V(e);
|
|
316
|
+
const rt = (e, i, t) => {
|
|
317
|
+
var n;
|
|
318
|
+
return !!(!((n = e.getValue(i)) == null || (n = n.toString()) == null) && n.includes(t));
|
|
319
|
+
};
|
|
320
|
+
rt.autoRemove = (e) => V(e);
|
|
321
|
+
const st = (e, i, t) => {
|
|
322
|
+
var n;
|
|
323
|
+
return ((n = e.getValue(i)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
|
|
324
|
+
};
|
|
325
|
+
st.autoRemove = (e) => V(e);
|
|
326
|
+
const lt = (e, i, t) => {
|
|
327
|
+
var n;
|
|
328
|
+
return (n = e.getValue(i)) == null ? void 0 : n.includes(t);
|
|
329
|
+
};
|
|
330
|
+
lt.autoRemove = (e) => V(e);
|
|
331
|
+
const at = (e, i, t) => !t.some((n) => {
|
|
332
|
+
var o;
|
|
333
|
+
return !((o = e.getValue(i)) != null && o.includes(n));
|
|
334
|
+
});
|
|
335
|
+
at.autoRemove = (e) => V(e) || !(e != null && e.length);
|
|
336
|
+
const ut = (e, i, t) => t.some((n) => {
|
|
337
|
+
var o;
|
|
338
|
+
return (o = e.getValue(i)) == null ? void 0 : o.includes(n);
|
|
339
|
+
});
|
|
340
|
+
ut.autoRemove = (e) => V(e) || !(e != null && e.length);
|
|
341
|
+
const dt = (e, i, t) => e.getValue(i) === t;
|
|
342
|
+
dt.autoRemove = (e) => V(e);
|
|
343
|
+
const gt = (e, i, t) => e.getValue(i) == t;
|
|
344
|
+
gt.autoRemove = (e) => V(e);
|
|
345
|
+
const Ve = (e, i, t) => {
|
|
346
|
+
let [n, o] = t;
|
|
347
|
+
const r = e.getValue(i);
|
|
348
|
+
return r >= n && r <= o;
|
|
349
|
+
};
|
|
350
|
+
Ve.resolveFilterValue = (e) => {
|
|
351
|
+
let [i, t] = e, n = typeof i != "number" ? parseFloat(i) : i, o = typeof t != "number" ? parseFloat(t) : t, r = i === null || Number.isNaN(n) ? -1 / 0 : n, s = t === null || Number.isNaN(o) ? 1 / 0 : o;
|
|
352
|
+
if (r > s) {
|
|
353
|
+
const l = r;
|
|
354
|
+
r = s, s = l;
|
|
355
|
+
}
|
|
356
|
+
return [r, s];
|
|
357
|
+
};
|
|
358
|
+
Ve.autoRemove = (e) => V(e) || V(e[0]) && V(e[1]);
|
|
359
|
+
const N = {
|
|
360
|
+
includesString: ot,
|
|
361
|
+
includesStringSensitive: rt,
|
|
362
|
+
equalsString: st,
|
|
363
|
+
arrIncludes: lt,
|
|
364
|
+
arrIncludesAll: at,
|
|
365
|
+
arrIncludesSome: ut,
|
|
366
|
+
equals: dt,
|
|
367
|
+
weakEquals: gt,
|
|
368
|
+
inNumberRange: Ve
|
|
369
|
+
};
|
|
370
|
+
function V(e) {
|
|
371
|
+
return e == null || e === "";
|
|
372
|
+
}
|
|
373
|
+
const Ot = {
|
|
374
|
+
getDefaultColumnDef: () => ({
|
|
375
|
+
filterFn: "auto"
|
|
376
|
+
}),
|
|
377
|
+
getInitialState: (e) => ({
|
|
378
|
+
columnFilters: [],
|
|
379
|
+
...e
|
|
380
|
+
}),
|
|
381
|
+
getDefaultOptions: (e) => ({
|
|
382
|
+
onColumnFiltersChange: b("columnFilters", e),
|
|
383
|
+
filterFromLeafRows: !1,
|
|
384
|
+
maxLeafRowFilterDepth: 100
|
|
385
|
+
}),
|
|
386
|
+
createColumn: (e, i) => {
|
|
387
|
+
e.getAutoFilterFn = () => {
|
|
388
|
+
const t = i.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
389
|
+
return typeof n == "string" ? N.includesString : typeof n == "number" ? N.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? N.equals : Array.isArray(n) ? N.arrIncludes : N.weakEquals;
|
|
390
|
+
}, e.getFilterFn = () => {
|
|
391
|
+
var t, n;
|
|
392
|
+
return pe(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
|
|
393
|
+
// @ts-ignore
|
|
394
|
+
(t = (n = i.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : N[e.columnDef.filterFn]
|
|
395
|
+
);
|
|
396
|
+
}, e.getCanFilter = () => {
|
|
397
|
+
var t, n, o;
|
|
398
|
+
return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n = i.options.enableColumnFilters) != null ? n : !0) && ((o = i.options.enableFilters) != null ? o : !0) && !!e.accessorFn;
|
|
399
|
+
}, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
|
|
400
|
+
var t;
|
|
401
|
+
return (t = i.getState().columnFilters) == null || (t = t.find((n) => n.id === e.id)) == null ? void 0 : t.value;
|
|
402
|
+
}, e.getFilterIndex = () => {
|
|
403
|
+
var t, n;
|
|
404
|
+
return (t = (n = i.getState().columnFilters) == null ? void 0 : n.findIndex((o) => o.id === e.id)) != null ? t : -1;
|
|
405
|
+
}, e.setFilterValue = (t) => {
|
|
406
|
+
i.setColumnFilters((n) => {
|
|
407
|
+
const o = e.getFilterFn(), r = n == null ? void 0 : n.find((g) => g.id === e.id), s = H(t, r ? r.value : void 0);
|
|
408
|
+
if (je(o, s, e)) {
|
|
409
|
+
var l;
|
|
410
|
+
return (l = n == null ? void 0 : n.filter((g) => g.id !== e.id)) != null ? l : [];
|
|
411
|
+
}
|
|
412
|
+
const a = {
|
|
413
|
+
id: e.id,
|
|
414
|
+
value: s
|
|
415
|
+
};
|
|
416
|
+
if (r) {
|
|
417
|
+
var u;
|
|
418
|
+
return (u = n == null ? void 0 : n.map((g) => g.id === e.id ? a : g)) != null ? u : [];
|
|
419
|
+
}
|
|
420
|
+
return n != null && n.length ? [...n, a] : [a];
|
|
421
|
+
});
|
|
422
|
+
};
|
|
423
|
+
},
|
|
424
|
+
createRow: (e, i) => {
|
|
425
|
+
e.columnFilters = {}, e.columnFiltersMeta = {};
|
|
426
|
+
},
|
|
427
|
+
createTable: (e) => {
|
|
428
|
+
e.setColumnFilters = (i) => {
|
|
429
|
+
const t = e.getAllLeafColumns(), n = (o) => {
|
|
430
|
+
var r;
|
|
431
|
+
return (r = H(i, o)) == null ? void 0 : r.filter((s) => {
|
|
432
|
+
const l = t.find((a) => a.id === s.id);
|
|
433
|
+
if (l) {
|
|
434
|
+
const a = l.getFilterFn();
|
|
435
|
+
if (je(a, s.value, l))
|
|
436
|
+
return !1;
|
|
437
|
+
}
|
|
438
|
+
return !0;
|
|
439
|
+
});
|
|
440
|
+
};
|
|
441
|
+
e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange(n);
|
|
442
|
+
}, e.resetColumnFilters = (i) => {
|
|
443
|
+
var t, n;
|
|
444
|
+
e.setColumnFilters(i ? [] : (t = (n = e.initialState) == null ? void 0 : n.columnFilters) != null ? t : []);
|
|
445
|
+
}, 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());
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
function je(e, i, t) {
|
|
449
|
+
return (e && e.autoRemove ? e.autoRemove(i, t) : !1) || typeof i > "u" || typeof i == "string" && !i;
|
|
450
|
+
}
|
|
451
|
+
const At = (e, i, t) => t.reduce((n, o) => {
|
|
452
|
+
const r = o.getValue(e);
|
|
453
|
+
return n + (typeof r == "number" ? r : 0);
|
|
454
|
+
}, 0), Dt = (e, i, t) => {
|
|
455
|
+
let n;
|
|
456
|
+
return t.forEach((o) => {
|
|
457
|
+
const r = o.getValue(e);
|
|
458
|
+
r != null && (n > r || n === void 0 && r >= r) && (n = r);
|
|
459
|
+
}), n;
|
|
460
|
+
}, Ht = (e, i, t) => {
|
|
461
|
+
let n;
|
|
462
|
+
return t.forEach((o) => {
|
|
463
|
+
const r = o.getValue(e);
|
|
464
|
+
r != null && (n < r || n === void 0 && r >= r) && (n = r);
|
|
465
|
+
}), n;
|
|
466
|
+
}, Lt = (e, i, t) => {
|
|
467
|
+
let n, o;
|
|
468
|
+
return t.forEach((r) => {
|
|
469
|
+
const s = r.getValue(e);
|
|
470
|
+
s != null && (n === void 0 ? s >= s && (n = o = s) : (n > s && (n = s), o < s && (o = s)));
|
|
471
|
+
}), [n, o];
|
|
472
|
+
}, Gt = (e, i) => {
|
|
473
|
+
let t = 0, n = 0;
|
|
474
|
+
if (i.forEach((o) => {
|
|
475
|
+
let r = o.getValue(e);
|
|
476
|
+
r != null && (r = +r) >= r && (++t, n += r);
|
|
477
|
+
}), t) return n / t;
|
|
478
|
+
}, kt = (e, i) => {
|
|
479
|
+
if (!i.length)
|
|
480
|
+
return;
|
|
481
|
+
const t = i.map((r) => r.getValue(e));
|
|
482
|
+
if (!It(t))
|
|
483
|
+
return;
|
|
484
|
+
if (t.length === 1)
|
|
485
|
+
return t[0];
|
|
486
|
+
const n = Math.floor(t.length / 2), o = t.sort((r, s) => r - s);
|
|
487
|
+
return t.length % 2 !== 0 ? o[n] : (o[n - 1] + o[n]) / 2;
|
|
488
|
+
}, Tt = (e, i) => Array.from(new Set(i.map((t) => t.getValue(e))).values()), Bt = (e, i) => new Set(i.map((t) => t.getValue(e))).size, jt = (e, i) => i.length, Se = {
|
|
489
|
+
sum: At,
|
|
490
|
+
min: Dt,
|
|
491
|
+
max: Ht,
|
|
492
|
+
extent: Lt,
|
|
493
|
+
mean: Gt,
|
|
494
|
+
median: kt,
|
|
495
|
+
unique: Tt,
|
|
496
|
+
uniqueCount: Bt,
|
|
497
|
+
count: jt
|
|
498
|
+
}, qt = {
|
|
499
|
+
getDefaultColumnDef: () => ({
|
|
500
|
+
aggregatedCell: (e) => {
|
|
501
|
+
var i, t;
|
|
502
|
+
return (i = (t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) != null ? i : null;
|
|
503
|
+
},
|
|
504
|
+
aggregationFn: "auto"
|
|
505
|
+
}),
|
|
506
|
+
getInitialState: (e) => ({
|
|
507
|
+
grouping: [],
|
|
508
|
+
...e
|
|
509
|
+
}),
|
|
510
|
+
getDefaultOptions: (e) => ({
|
|
511
|
+
onGroupingChange: b("grouping", e),
|
|
512
|
+
groupedColumnMode: "reorder"
|
|
513
|
+
}),
|
|
514
|
+
createColumn: (e, i) => {
|
|
515
|
+
e.toggleGrouping = () => {
|
|
516
|
+
i.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((n) => n !== e.id) : [...t ?? [], e.id]);
|
|
517
|
+
}, e.getCanGroup = () => {
|
|
518
|
+
var t, n;
|
|
519
|
+
return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((n = i.options.enableGrouping) != null ? n : !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue);
|
|
520
|
+
}, e.getIsGrouped = () => {
|
|
521
|
+
var t;
|
|
522
|
+
return (t = i.getState().grouping) == null ? void 0 : t.includes(e.id);
|
|
523
|
+
}, e.getGroupedIndex = () => {
|
|
524
|
+
var t;
|
|
525
|
+
return (t = i.getState().grouping) == null ? void 0 : t.indexOf(e.id);
|
|
526
|
+
}, e.getToggleGroupingHandler = () => {
|
|
527
|
+
const t = e.getCanGroup();
|
|
528
|
+
return () => {
|
|
529
|
+
t && e.toggleGrouping();
|
|
530
|
+
};
|
|
531
|
+
}, e.getAutoAggregationFn = () => {
|
|
532
|
+
const t = i.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
533
|
+
if (typeof n == "number")
|
|
534
|
+
return Se.sum;
|
|
535
|
+
if (Object.prototype.toString.call(n) === "[object Date]")
|
|
536
|
+
return Se.extent;
|
|
537
|
+
}, e.getAggregationFn = () => {
|
|
538
|
+
var t, n;
|
|
539
|
+
if (!e)
|
|
540
|
+
throw new Error();
|
|
541
|
+
return pe(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : (t = (n = i.options.aggregationFns) == null ? void 0 : n[e.columnDef.aggregationFn]) != null ? t : Se[e.columnDef.aggregationFn];
|
|
542
|
+
};
|
|
543
|
+
},
|
|
544
|
+
createTable: (e) => {
|
|
545
|
+
e.setGrouping = (i) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(i), e.resetGrouping = (i) => {
|
|
546
|
+
var t, n;
|
|
547
|
+
e.setGrouping(i ? [] : (t = (n = e.initialState) == null ? void 0 : n.grouping) != null ? t : []);
|
|
548
|
+
}, 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());
|
|
549
|
+
},
|
|
550
|
+
createRow: (e, i) => {
|
|
551
|
+
e.getIsGrouped = () => !!e.groupingColumnId, e.getGroupingValue = (t) => {
|
|
552
|
+
if (e._groupingValuesCache.hasOwnProperty(t))
|
|
553
|
+
return e._groupingValuesCache[t];
|
|
554
|
+
const n = i.getColumn(t);
|
|
555
|
+
return n != null && n.columnDef.getGroupingValue ? (e._groupingValuesCache[t] = n.columnDef.getGroupingValue(e.original), e._groupingValuesCache[t]) : e.getValue(t);
|
|
556
|
+
}, e._groupingValuesCache = {};
|
|
557
|
+
},
|
|
558
|
+
createCell: (e, i, t, n) => {
|
|
559
|
+
e.getIsGrouped = () => i.getIsGrouped() && i.id === t.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && i.getIsGrouped(), e.getIsAggregated = () => {
|
|
560
|
+
var o;
|
|
561
|
+
return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((o = t.subRows) != null && o.length);
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
function Wt(e, i, t) {
|
|
566
|
+
if (!(i != null && i.length) || !t)
|
|
567
|
+
return e;
|
|
568
|
+
const n = e.filter((r) => !i.includes(r.id));
|
|
569
|
+
return t === "remove" ? n : [...i.map((r) => e.find((s) => s.id === r)).filter(Boolean), ...n];
|
|
570
|
+
}
|
|
571
|
+
const Ut = {
|
|
572
|
+
getInitialState: (e) => ({
|
|
573
|
+
columnOrder: [],
|
|
574
|
+
...e
|
|
575
|
+
}),
|
|
576
|
+
getDefaultOptions: (e) => ({
|
|
577
|
+
onColumnOrderChange: b("columnOrder", e)
|
|
578
|
+
}),
|
|
579
|
+
createColumn: (e, i) => {
|
|
580
|
+
e.getIndex = C((t) => [ee(i, t)], (t) => t.findIndex((n) => n.id === e.id), x(i.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
|
|
581
|
+
var n;
|
|
582
|
+
return ((n = ee(i, t)[0]) == null ? void 0 : n.id) === e.id;
|
|
583
|
+
}, e.getIsLastColumn = (t) => {
|
|
584
|
+
var n;
|
|
585
|
+
const o = ee(i, t);
|
|
586
|
+
return ((n = o[o.length - 1]) == null ? void 0 : n.id) === e.id;
|
|
587
|
+
};
|
|
588
|
+
},
|
|
589
|
+
createTable: (e) => {
|
|
590
|
+
e.setColumnOrder = (i) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(i), e.resetColumnOrder = (i) => {
|
|
591
|
+
var t;
|
|
592
|
+
e.setColumnOrder(i ? [] : (t = e.initialState.columnOrder) != null ? t : []);
|
|
593
|
+
}, e._getOrderColumnsFn = C(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (i, t, n) => (o) => {
|
|
594
|
+
let r = [];
|
|
595
|
+
if (!(i != null && i.length))
|
|
596
|
+
r = o;
|
|
597
|
+
else {
|
|
598
|
+
const s = [...i], l = [...o];
|
|
599
|
+
for (; l.length && s.length; ) {
|
|
600
|
+
const a = s.shift(), u = l.findIndex((g) => g.id === a);
|
|
601
|
+
u > -1 && r.push(l.splice(u, 1)[0]);
|
|
602
|
+
}
|
|
603
|
+
r = [...r, ...l];
|
|
604
|
+
}
|
|
605
|
+
return Wt(r, t, n);
|
|
606
|
+
}, x(e.options, "debugTable", "_getOrderColumnsFn"));
|
|
607
|
+
}
|
|
608
|
+
}, ve = () => ({
|
|
609
|
+
left: [],
|
|
610
|
+
right: []
|
|
611
|
+
}), Kt = {
|
|
612
|
+
getInitialState: (e) => ({
|
|
613
|
+
columnPinning: ve(),
|
|
614
|
+
...e
|
|
615
|
+
}),
|
|
616
|
+
getDefaultOptions: (e) => ({
|
|
617
|
+
onColumnPinningChange: b("columnPinning", e)
|
|
618
|
+
}),
|
|
619
|
+
createColumn: (e, i) => {
|
|
620
|
+
e.pin = (t) => {
|
|
621
|
+
const n = e.getLeafColumns().map((o) => o.id).filter(Boolean);
|
|
622
|
+
i.setColumnPinning((o) => {
|
|
623
|
+
var r, s;
|
|
624
|
+
if (t === "right") {
|
|
625
|
+
var l, a;
|
|
626
|
+
return {
|
|
627
|
+
left: ((l = o == null ? void 0 : o.left) != null ? l : []).filter((m) => !(n != null && n.includes(m))),
|
|
628
|
+
right: [...((a = o == null ? void 0 : o.right) != null ? a : []).filter((m) => !(n != null && n.includes(m))), ...n]
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
if (t === "left") {
|
|
632
|
+
var u, g;
|
|
633
|
+
return {
|
|
634
|
+
left: [...((u = o == null ? void 0 : o.left) != null ? u : []).filter((m) => !(n != null && n.includes(m))), ...n],
|
|
635
|
+
right: ((g = o == null ? void 0 : o.right) != null ? g : []).filter((m) => !(n != null && n.includes(m)))
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
return {
|
|
639
|
+
left: ((r = o == null ? void 0 : o.left) != null ? r : []).filter((m) => !(n != null && n.includes(m))),
|
|
640
|
+
right: ((s = o == null ? void 0 : o.right) != null ? s : []).filter((m) => !(n != null && n.includes(m)))
|
|
641
|
+
};
|
|
642
|
+
});
|
|
643
|
+
}, e.getCanPin = () => e.getLeafColumns().some((n) => {
|
|
644
|
+
var o, r, s;
|
|
645
|
+
return ((o = n.columnDef.enablePinning) != null ? o : !0) && ((r = (s = i.options.enableColumnPinning) != null ? s : i.options.enablePinning) != null ? r : !0);
|
|
646
|
+
}), e.getIsPinned = () => {
|
|
647
|
+
const t = e.getLeafColumns().map((l) => l.id), {
|
|
648
|
+
left: n,
|
|
649
|
+
right: o
|
|
650
|
+
} = i.getState().columnPinning, r = t.some((l) => n == null ? void 0 : n.includes(l)), s = t.some((l) => o == null ? void 0 : o.includes(l));
|
|
651
|
+
return r ? "left" : s ? "right" : !1;
|
|
652
|
+
}, e.getPinnedIndex = () => {
|
|
653
|
+
var t, n;
|
|
654
|
+
const o = e.getIsPinned();
|
|
655
|
+
return o ? (t = (n = i.getState().columnPinning) == null || (n = n[o]) == null ? void 0 : n.indexOf(e.id)) != null ? t : -1 : 0;
|
|
656
|
+
};
|
|
657
|
+
},
|
|
658
|
+
createRow: (e, i) => {
|
|
659
|
+
e.getCenterVisibleCells = C(() => [e._getAllVisibleCells(), i.getState().columnPinning.left, i.getState().columnPinning.right], (t, n, o) => {
|
|
660
|
+
const r = [...n ?? [], ...o ?? []];
|
|
661
|
+
return t.filter((s) => !r.includes(s.column.id));
|
|
662
|
+
}, x(i.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = C(() => [e._getAllVisibleCells(), i.getState().columnPinning.left], (t, n) => (n ?? []).map((r) => t.find((s) => s.column.id === r)).filter(Boolean).map((r) => ({
|
|
663
|
+
...r,
|
|
664
|
+
position: "left"
|
|
665
|
+
})), x(i.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = C(() => [e._getAllVisibleCells(), i.getState().columnPinning.right], (t, n) => (n ?? []).map((r) => t.find((s) => s.column.id === r)).filter(Boolean).map((r) => ({
|
|
666
|
+
...r,
|
|
667
|
+
position: "right"
|
|
668
|
+
})), x(i.options, "debugRows", "getRightVisibleCells"));
|
|
669
|
+
},
|
|
670
|
+
createTable: (e) => {
|
|
671
|
+
e.setColumnPinning = (i) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(i), e.resetColumnPinning = (i) => {
|
|
672
|
+
var t, n;
|
|
673
|
+
return e.setColumnPinning(i ? ve() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : ve());
|
|
674
|
+
}, e.getIsSomeColumnsPinned = (i) => {
|
|
675
|
+
var t;
|
|
676
|
+
const n = e.getState().columnPinning;
|
|
677
|
+
if (!i) {
|
|
678
|
+
var o, r;
|
|
679
|
+
return !!((o = n.left) != null && o.length || (r = n.right) != null && r.length);
|
|
680
|
+
}
|
|
681
|
+
return !!((t = n[i]) != null && t.length);
|
|
682
|
+
}, e.getLeftLeafColumns = C(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (i, t) => (t ?? []).map((n) => i.find((o) => o.id === n)).filter(Boolean), x(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = C(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (i, t) => (t ?? []).map((n) => i.find((o) => o.id === n)).filter(Boolean), x(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = C(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (i, t, n) => {
|
|
683
|
+
const o = [...t ?? [], ...n ?? []];
|
|
684
|
+
return i.filter((r) => !o.includes(r.id));
|
|
685
|
+
}, x(e.options, "debugColumns", "getCenterLeafColumns"));
|
|
686
|
+
}
|
|
687
|
+
};
|
|
688
|
+
function Xt(e) {
|
|
689
|
+
return e || (typeof document < "u" ? document : null);
|
|
690
|
+
}
|
|
691
|
+
const ae = {
|
|
692
|
+
size: 150,
|
|
693
|
+
minSize: 20,
|
|
694
|
+
maxSize: Number.MAX_SAFE_INTEGER
|
|
695
|
+
}, we = () => ({
|
|
696
|
+
startOffset: null,
|
|
697
|
+
startSize: null,
|
|
698
|
+
deltaOffset: null,
|
|
699
|
+
deltaPercentage: null,
|
|
700
|
+
isResizingColumn: !1,
|
|
701
|
+
columnSizingStart: []
|
|
702
|
+
}), Jt = {
|
|
703
|
+
getDefaultColumnDef: () => ae,
|
|
704
|
+
getInitialState: (e) => ({
|
|
705
|
+
columnSizing: {},
|
|
706
|
+
columnSizingInfo: we(),
|
|
707
|
+
...e
|
|
708
|
+
}),
|
|
709
|
+
getDefaultOptions: (e) => ({
|
|
710
|
+
columnResizeMode: "onEnd",
|
|
711
|
+
columnResizeDirection: "ltr",
|
|
712
|
+
onColumnSizingChange: b("columnSizing", e),
|
|
713
|
+
onColumnSizingInfoChange: b("columnSizingInfo", e)
|
|
714
|
+
}),
|
|
715
|
+
createColumn: (e, i) => {
|
|
716
|
+
e.getSize = () => {
|
|
717
|
+
var t, n, o;
|
|
718
|
+
const r = i.getState().columnSizing[e.id];
|
|
719
|
+
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : ae.minSize, (n = r ?? e.columnDef.size) != null ? n : ae.size), (o = e.columnDef.maxSize) != null ? o : ae.maxSize);
|
|
720
|
+
}, e.getStart = C((t) => [t, ee(i, t), i.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((o, r) => o + r.getSize(), 0), x(i.options, "debugColumns", "getStart")), e.getAfter = C((t) => [t, ee(i, t), i.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((o, r) => o + r.getSize(), 0), x(i.options, "debugColumns", "getAfter")), e.resetSize = () => {
|
|
721
|
+
i.setColumnSizing((t) => {
|
|
722
|
+
let {
|
|
723
|
+
[e.id]: n,
|
|
724
|
+
...o
|
|
725
|
+
} = t;
|
|
726
|
+
return o;
|
|
727
|
+
});
|
|
728
|
+
}, e.getCanResize = () => {
|
|
729
|
+
var t, n;
|
|
730
|
+
return ((t = e.columnDef.enableResizing) != null ? t : !0) && ((n = i.options.enableColumnResizing) != null ? n : !0);
|
|
731
|
+
}, e.getIsResizing = () => i.getState().columnSizingInfo.isResizingColumn === e.id;
|
|
732
|
+
},
|
|
733
|
+
createHeader: (e, i) => {
|
|
734
|
+
e.getSize = () => {
|
|
735
|
+
let t = 0;
|
|
736
|
+
const n = (o) => {
|
|
737
|
+
if (o.subHeaders.length)
|
|
738
|
+
o.subHeaders.forEach(n);
|
|
739
|
+
else {
|
|
740
|
+
var r;
|
|
741
|
+
t += (r = o.column.getSize()) != null ? r : 0;
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
return n(e), t;
|
|
745
|
+
}, e.getStart = () => {
|
|
746
|
+
if (e.index > 0) {
|
|
747
|
+
const t = e.headerGroup.headers[e.index - 1];
|
|
748
|
+
return t.getStart() + t.getSize();
|
|
749
|
+
}
|
|
750
|
+
return 0;
|
|
751
|
+
}, e.getResizeHandler = (t) => {
|
|
752
|
+
const n = i.getColumn(e.column.id), o = n == null ? void 0 : n.getCanResize();
|
|
753
|
+
return (r) => {
|
|
754
|
+
if (!n || !o || (r.persist == null || r.persist(), Ce(r) && r.touches && r.touches.length > 1))
|
|
755
|
+
return;
|
|
756
|
+
const s = e.getSize(), l = e ? e.getLeafHeaders().map((S) => [S.column.id, S.column.getSize()]) : [[n.id, n.getSize()]], a = Ce(r) ? Math.round(r.touches[0].clientX) : r.clientX, u = {}, g = (S, v) => {
|
|
757
|
+
typeof v == "number" && (i.setColumnSizingInfo((F) => {
|
|
758
|
+
var $, I;
|
|
759
|
+
const P = i.options.columnResizeDirection === "rtl" ? -1 : 1, ne = (v - (($ = F == null ? void 0 : F.startOffset) != null ? $ : 0)) * P, ie = Math.max(ne / ((I = F == null ? void 0 : F.startSize) != null ? I : 0), -0.999999);
|
|
760
|
+
return F.columnSizingStart.forEach((X) => {
|
|
761
|
+
let [J, O] = X;
|
|
762
|
+
u[J] = Math.round(Math.max(O + O * ie, 0) * 100) / 100;
|
|
763
|
+
}), {
|
|
764
|
+
...F,
|
|
765
|
+
deltaOffset: ne,
|
|
766
|
+
deltaPercentage: ie
|
|
767
|
+
};
|
|
768
|
+
}), (i.options.columnResizeMode === "onChange" || S === "end") && i.setColumnSizing((F) => ({
|
|
769
|
+
...F,
|
|
770
|
+
...u
|
|
771
|
+
})));
|
|
772
|
+
}, m = (S) => g("move", S), c = (S) => {
|
|
773
|
+
g("end", S), i.setColumnSizingInfo((v) => ({
|
|
774
|
+
...v,
|
|
775
|
+
isResizingColumn: !1,
|
|
776
|
+
startOffset: null,
|
|
777
|
+
startSize: null,
|
|
778
|
+
deltaOffset: null,
|
|
779
|
+
deltaPercentage: null,
|
|
780
|
+
columnSizingStart: []
|
|
781
|
+
}));
|
|
782
|
+
}, d = Xt(t), p = {
|
|
783
|
+
moveHandler: (S) => m(S.clientX),
|
|
784
|
+
upHandler: (S) => {
|
|
785
|
+
d == null || d.removeEventListener("mousemove", p.moveHandler), d == null || d.removeEventListener("mouseup", p.upHandler), c(S.clientX);
|
|
786
|
+
}
|
|
787
|
+
}, h = {
|
|
788
|
+
moveHandler: (S) => (S.cancelable && (S.preventDefault(), S.stopPropagation()), m(S.touches[0].clientX), !1),
|
|
789
|
+
upHandler: (S) => {
|
|
790
|
+
var v;
|
|
791
|
+
d == null || d.removeEventListener("touchmove", h.moveHandler), d == null || d.removeEventListener("touchend", h.upHandler), S.cancelable && (S.preventDefault(), S.stopPropagation()), c((v = S.touches[0]) == null ? void 0 : v.clientX);
|
|
792
|
+
}
|
|
793
|
+
}, w = Qt() ? {
|
|
794
|
+
passive: !1
|
|
795
|
+
} : !1;
|
|
796
|
+
Ce(r) ? (d == null || d.addEventListener("touchmove", h.moveHandler, w), d == null || d.addEventListener("touchend", h.upHandler, w)) : (d == null || d.addEventListener("mousemove", p.moveHandler, w), d == null || d.addEventListener("mouseup", p.upHandler, w)), i.setColumnSizingInfo((S) => ({
|
|
797
|
+
...S,
|
|
798
|
+
startOffset: a,
|
|
799
|
+
startSize: s,
|
|
800
|
+
deltaOffset: 0,
|
|
801
|
+
deltaPercentage: 0,
|
|
802
|
+
columnSizingStart: l,
|
|
803
|
+
isResizingColumn: n.id
|
|
804
|
+
}));
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
},
|
|
808
|
+
createTable: (e) => {
|
|
809
|
+
e.setColumnSizing = (i) => e.options.onColumnSizingChange == null ? void 0 : e.options.onColumnSizingChange(i), e.setColumnSizingInfo = (i) => e.options.onColumnSizingInfoChange == null ? void 0 : e.options.onColumnSizingInfoChange(i), e.resetColumnSizing = (i) => {
|
|
810
|
+
var t;
|
|
811
|
+
e.setColumnSizing(i ? {} : (t = e.initialState.columnSizing) != null ? t : {});
|
|
812
|
+
}, e.resetHeaderSizeInfo = (i) => {
|
|
813
|
+
var t;
|
|
814
|
+
e.setColumnSizingInfo(i ? we() : (t = e.initialState.columnSizingInfo) != null ? t : we());
|
|
815
|
+
}, e.getTotalSize = () => {
|
|
816
|
+
var i, t;
|
|
817
|
+
return (i = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, o) => n + o.getSize(), 0)) != null ? i : 0;
|
|
818
|
+
}, e.getLeftTotalSize = () => {
|
|
819
|
+
var i, t;
|
|
820
|
+
return (i = (t = e.getLeftHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, o) => n + o.getSize(), 0)) != null ? i : 0;
|
|
821
|
+
}, e.getCenterTotalSize = () => {
|
|
822
|
+
var i, t;
|
|
823
|
+
return (i = (t = e.getCenterHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, o) => n + o.getSize(), 0)) != null ? i : 0;
|
|
824
|
+
}, e.getRightTotalSize = () => {
|
|
825
|
+
var i, t;
|
|
826
|
+
return (i = (t = e.getRightHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, o) => n + o.getSize(), 0)) != null ? i : 0;
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
};
|
|
830
|
+
let ue = null;
|
|
831
|
+
function Qt() {
|
|
832
|
+
if (typeof ue == "boolean") return ue;
|
|
833
|
+
let e = !1;
|
|
834
|
+
try {
|
|
835
|
+
const i = {
|
|
836
|
+
get passive() {
|
|
837
|
+
return e = !0, !1;
|
|
838
|
+
}
|
|
839
|
+
}, t = () => {
|
|
840
|
+
};
|
|
841
|
+
window.addEventListener("test", t, i), window.removeEventListener("test", t);
|
|
842
|
+
} catch {
|
|
843
|
+
e = !1;
|
|
844
|
+
}
|
|
845
|
+
return ue = e, ue;
|
|
846
|
+
}
|
|
847
|
+
function Ce(e) {
|
|
848
|
+
return e.type === "touchstart";
|
|
849
|
+
}
|
|
850
|
+
const Yt = {
|
|
851
|
+
getInitialState: (e) => ({
|
|
852
|
+
columnVisibility: {},
|
|
853
|
+
...e
|
|
854
|
+
}),
|
|
855
|
+
getDefaultOptions: (e) => ({
|
|
856
|
+
onColumnVisibilityChange: b("columnVisibility", e)
|
|
857
|
+
}),
|
|
858
|
+
createColumn: (e, i) => {
|
|
859
|
+
e.toggleVisibility = (t) => {
|
|
860
|
+
e.getCanHide() && i.setColumnVisibility((n) => ({
|
|
861
|
+
...n,
|
|
862
|
+
[e.id]: t ?? !e.getIsVisible()
|
|
863
|
+
}));
|
|
864
|
+
}, e.getIsVisible = () => {
|
|
865
|
+
var t, n;
|
|
866
|
+
const o = e.columns;
|
|
867
|
+
return (t = o.length ? o.some((r) => r.getIsVisible()) : (n = i.getState().columnVisibility) == null ? void 0 : n[e.id]) != null ? t : !0;
|
|
868
|
+
}, e.getCanHide = () => {
|
|
869
|
+
var t, n;
|
|
870
|
+
return ((t = e.columnDef.enableHiding) != null ? t : !0) && ((n = i.options.enableHiding) != null ? n : !0);
|
|
871
|
+
}, e.getToggleVisibilityHandler = () => (t) => {
|
|
872
|
+
e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
|
|
873
|
+
};
|
|
874
|
+
},
|
|
875
|
+
createRow: (e, i) => {
|
|
876
|
+
e._getAllVisibleCells = C(() => [e.getAllCells(), i.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), x(i.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = C(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, o) => [...t, ...n, ...o], x(i.options, "debugRows", "getVisibleCells"));
|
|
877
|
+
},
|
|
878
|
+
createTable: (e) => {
|
|
879
|
+
const i = (t, n) => C(() => [n(), n().filter((o) => o.getIsVisible()).map((o) => o.id).join("_")], (o) => o.filter((r) => r.getIsVisible == null ? void 0 : r.getIsVisible()), x(e.options, "debugColumns", t));
|
|
880
|
+
e.getVisibleFlatColumns = i("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = i("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = i("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = i("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = i("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
|
|
881
|
+
var n;
|
|
882
|
+
e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
|
|
883
|
+
}, e.toggleAllColumnsVisible = (t) => {
|
|
884
|
+
var n;
|
|
885
|
+
t = (n = t) != null ? n : !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((o, r) => ({
|
|
886
|
+
...o,
|
|
887
|
+
[r.id]: t || !(r.getCanHide != null && r.getCanHide())
|
|
888
|
+
}), {}));
|
|
889
|
+
}, 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) => {
|
|
890
|
+
var n;
|
|
891
|
+
e.toggleAllColumnsVisible((n = t.target) == null ? void 0 : n.checked);
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
};
|
|
895
|
+
function ee(e, i) {
|
|
896
|
+
return i ? i === "center" ? e.getCenterVisibleLeafColumns() : i === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
|
|
897
|
+
}
|
|
898
|
+
const Zt = {
|
|
899
|
+
createTable: (e) => {
|
|
900
|
+
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 = () => {
|
|
901
|
+
if (e._getGlobalFacetedMinMaxValues)
|
|
902
|
+
return e._getGlobalFacetedMinMaxValues();
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
}, en = {
|
|
906
|
+
getInitialState: (e) => ({
|
|
907
|
+
globalFilter: void 0,
|
|
908
|
+
...e
|
|
909
|
+
}),
|
|
910
|
+
getDefaultOptions: (e) => ({
|
|
911
|
+
onGlobalFilterChange: b("globalFilter", e),
|
|
912
|
+
globalFilterFn: "auto",
|
|
913
|
+
getColumnCanGlobalFilter: (i) => {
|
|
914
|
+
var t;
|
|
915
|
+
const n = (t = e.getCoreRowModel().flatRows[0]) == null || (t = t._getAllCellsByColumnId()[i.id]) == null ? void 0 : t.getValue();
|
|
916
|
+
return typeof n == "string" || typeof n == "number";
|
|
917
|
+
}
|
|
918
|
+
}),
|
|
919
|
+
createColumn: (e, i) => {
|
|
920
|
+
e.getCanGlobalFilter = () => {
|
|
921
|
+
var t, n, o, r;
|
|
922
|
+
return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n = i.options.enableGlobalFilter) != null ? n : !0) && ((o = i.options.enableFilters) != null ? o : !0) && ((r = i.options.getColumnCanGlobalFilter == null ? void 0 : i.options.getColumnCanGlobalFilter(e)) != null ? r : !0) && !!e.accessorFn;
|
|
923
|
+
};
|
|
924
|
+
},
|
|
925
|
+
createTable: (e) => {
|
|
926
|
+
e.getGlobalAutoFilterFn = () => N.includesString, e.getGlobalFilterFn = () => {
|
|
927
|
+
var i, t;
|
|
928
|
+
const {
|
|
929
|
+
globalFilterFn: n
|
|
930
|
+
} = e.options;
|
|
931
|
+
return pe(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (i = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? i : N[n];
|
|
932
|
+
}, e.setGlobalFilter = (i) => {
|
|
933
|
+
e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(i);
|
|
934
|
+
}, e.resetGlobalFilter = (i) => {
|
|
935
|
+
e.setGlobalFilter(i ? void 0 : e.initialState.globalFilter);
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
}, tn = {
|
|
939
|
+
getInitialState: (e) => ({
|
|
940
|
+
expanded: {},
|
|
941
|
+
...e
|
|
942
|
+
}),
|
|
943
|
+
getDefaultOptions: (e) => ({
|
|
944
|
+
onExpandedChange: b("expanded", e),
|
|
945
|
+
paginateExpandedRows: !0
|
|
946
|
+
}),
|
|
947
|
+
createTable: (e) => {
|
|
948
|
+
let i = !1, t = !1;
|
|
949
|
+
e._autoResetExpanded = () => {
|
|
950
|
+
var n, o;
|
|
951
|
+
if (!i) {
|
|
952
|
+
e._queue(() => {
|
|
953
|
+
i = !0;
|
|
954
|
+
});
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
957
|
+
if ((n = (o = e.options.autoResetAll) != null ? o : e.options.autoResetExpanded) != null ? n : !e.options.manualExpanding) {
|
|
958
|
+
if (t) return;
|
|
959
|
+
t = !0, e._queue(() => {
|
|
960
|
+
e.resetExpanded(), t = !1;
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
}, e.setExpanded = (n) => e.options.onExpandedChange == null ? void 0 : e.options.onExpandedChange(n), e.toggleAllRowsExpanded = (n) => {
|
|
964
|
+
n ?? !e.getIsAllRowsExpanded() ? e.setExpanded(!0) : e.setExpanded({});
|
|
965
|
+
}, e.resetExpanded = (n) => {
|
|
966
|
+
var o, r;
|
|
967
|
+
e.setExpanded(n ? {} : (o = (r = e.initialState) == null ? void 0 : r.expanded) != null ? o : {});
|
|
968
|
+
}, e.getCanSomeRowsExpand = () => e.getPrePaginationRowModel().flatRows.some((n) => n.getCanExpand()), e.getToggleAllRowsExpandedHandler = () => (n) => {
|
|
969
|
+
n.persist == null || n.persist(), e.toggleAllRowsExpanded();
|
|
970
|
+
}, e.getIsSomeRowsExpanded = () => {
|
|
971
|
+
const n = e.getState().expanded;
|
|
972
|
+
return n === !0 || Object.values(n).some(Boolean);
|
|
973
|
+
}, e.getIsAllRowsExpanded = () => {
|
|
974
|
+
const n = e.getState().expanded;
|
|
975
|
+
return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || e.getRowModel().flatRows.some((o) => !o.getIsExpanded()));
|
|
976
|
+
}, e.getExpandedDepth = () => {
|
|
977
|
+
let n = 0;
|
|
978
|
+
return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((r) => {
|
|
979
|
+
const s = r.split(".");
|
|
980
|
+
n = Math.max(n, s.length);
|
|
981
|
+
}), n;
|
|
982
|
+
}, 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());
|
|
983
|
+
},
|
|
984
|
+
createRow: (e, i) => {
|
|
985
|
+
e.toggleExpanded = (t) => {
|
|
986
|
+
i.setExpanded((n) => {
|
|
987
|
+
var o;
|
|
988
|
+
const r = n === !0 ? !0 : !!(n != null && n[e.id]);
|
|
989
|
+
let s = {};
|
|
990
|
+
if (n === !0 ? Object.keys(i.getRowModel().rowsById).forEach((l) => {
|
|
991
|
+
s[l] = !0;
|
|
992
|
+
}) : s = n, t = (o = t) != null ? o : !r, !r && t)
|
|
993
|
+
return {
|
|
994
|
+
...s,
|
|
995
|
+
[e.id]: !0
|
|
996
|
+
};
|
|
997
|
+
if (r && !t) {
|
|
998
|
+
const {
|
|
999
|
+
[e.id]: l,
|
|
1000
|
+
...a
|
|
1001
|
+
} = s;
|
|
1002
|
+
return a;
|
|
1003
|
+
}
|
|
1004
|
+
return n;
|
|
1005
|
+
});
|
|
1006
|
+
}, e.getIsExpanded = () => {
|
|
1007
|
+
var t;
|
|
1008
|
+
const n = i.getState().expanded;
|
|
1009
|
+
return !!((t = i.options.getIsRowExpanded == null ? void 0 : i.options.getIsRowExpanded(e)) != null ? t : n === !0 || n != null && n[e.id]);
|
|
1010
|
+
}, e.getCanExpand = () => {
|
|
1011
|
+
var t, n, o;
|
|
1012
|
+
return (t = i.options.getRowCanExpand == null ? void 0 : i.options.getRowCanExpand(e)) != null ? t : ((n = i.options.enableExpanding) != null ? n : !0) && !!((o = e.subRows) != null && o.length);
|
|
1013
|
+
}, e.getIsAllParentsExpanded = () => {
|
|
1014
|
+
let t = !0, n = e;
|
|
1015
|
+
for (; t && n.parentId; )
|
|
1016
|
+
n = i.getRow(n.parentId, !0), t = n.getIsExpanded();
|
|
1017
|
+
return t;
|
|
1018
|
+
}, e.getToggleExpandedHandler = () => {
|
|
1019
|
+
const t = e.getCanExpand();
|
|
1020
|
+
return () => {
|
|
1021
|
+
t && e.toggleExpanded();
|
|
1022
|
+
};
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
}, _e = 0, Fe = 10, xe = () => ({
|
|
1026
|
+
pageIndex: _e,
|
|
1027
|
+
pageSize: Fe
|
|
1028
|
+
}), nn = {
|
|
1029
|
+
getInitialState: (e) => ({
|
|
1030
|
+
...e,
|
|
1031
|
+
pagination: {
|
|
1032
|
+
...xe(),
|
|
1033
|
+
...e == null ? void 0 : e.pagination
|
|
1034
|
+
}
|
|
1035
|
+
}),
|
|
1036
|
+
getDefaultOptions: (e) => ({
|
|
1037
|
+
onPaginationChange: b("pagination", e)
|
|
1038
|
+
}),
|
|
1039
|
+
createTable: (e) => {
|
|
1040
|
+
let i = !1, t = !1;
|
|
1041
|
+
e._autoResetPageIndex = () => {
|
|
1042
|
+
var n, o;
|
|
1043
|
+
if (!i) {
|
|
1044
|
+
e._queue(() => {
|
|
1045
|
+
i = !0;
|
|
1046
|
+
});
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
if ((n = (o = e.options.autoResetAll) != null ? o : e.options.autoResetPageIndex) != null ? n : !e.options.manualPagination) {
|
|
1050
|
+
if (t) return;
|
|
1051
|
+
t = !0, e._queue(() => {
|
|
1052
|
+
e.resetPageIndex(), t = !1;
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
}, e.setPagination = (n) => {
|
|
1056
|
+
const o = (r) => H(n, r);
|
|
1057
|
+
return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(o);
|
|
1058
|
+
}, e.resetPagination = (n) => {
|
|
1059
|
+
var o;
|
|
1060
|
+
e.setPagination(n ? xe() : (o = e.initialState.pagination) != null ? o : xe());
|
|
1061
|
+
}, e.setPageIndex = (n) => {
|
|
1062
|
+
e.setPagination((o) => {
|
|
1063
|
+
let r = H(n, o.pageIndex);
|
|
1064
|
+
const s = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
|
|
1065
|
+
return r = Math.max(0, Math.min(r, s)), {
|
|
1066
|
+
...o,
|
|
1067
|
+
pageIndex: r
|
|
1068
|
+
};
|
|
1069
|
+
});
|
|
1070
|
+
}, e.resetPageIndex = (n) => {
|
|
1071
|
+
var o, r;
|
|
1072
|
+
e.setPageIndex(n ? _e : (o = (r = e.initialState) == null || (r = r.pagination) == null ? void 0 : r.pageIndex) != null ? o : _e);
|
|
1073
|
+
}, e.resetPageSize = (n) => {
|
|
1074
|
+
var o, r;
|
|
1075
|
+
e.setPageSize(n ? Fe : (o = (r = e.initialState) == null || (r = r.pagination) == null ? void 0 : r.pageSize) != null ? o : Fe);
|
|
1076
|
+
}, e.setPageSize = (n) => {
|
|
1077
|
+
e.setPagination((o) => {
|
|
1078
|
+
const r = Math.max(1, H(n, o.pageSize)), s = o.pageSize * o.pageIndex, l = Math.floor(s / r);
|
|
1079
|
+
return {
|
|
1080
|
+
...o,
|
|
1081
|
+
pageIndex: l,
|
|
1082
|
+
pageSize: r
|
|
1083
|
+
};
|
|
1084
|
+
});
|
|
1085
|
+
}, e.setPageCount = (n) => e.setPagination((o) => {
|
|
1086
|
+
var r;
|
|
1087
|
+
let s = H(n, (r = e.options.pageCount) != null ? r : -1);
|
|
1088
|
+
return typeof s == "number" && (s = Math.max(-1, s)), {
|
|
1089
|
+
...o,
|
|
1090
|
+
pageCount: s
|
|
1091
|
+
};
|
|
1092
|
+
}), e.getPageOptions = C(() => [e.getPageCount()], (n) => {
|
|
1093
|
+
let o = [];
|
|
1094
|
+
return n && n > 0 && (o = [...new Array(n)].fill(null).map((r, s) => s)), o;
|
|
1095
|
+
}, x(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
|
|
1096
|
+
const {
|
|
1097
|
+
pageIndex: n
|
|
1098
|
+
} = e.getState().pagination, o = e.getPageCount();
|
|
1099
|
+
return o === -1 ? !0 : o === 0 ? !1 : n < o - 1;
|
|
1100
|
+
}, 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 = () => {
|
|
1101
|
+
var n;
|
|
1102
|
+
return (n = e.options.pageCount) != null ? n : Math.ceil(e.getRowCount() / e.getState().pagination.pageSize);
|
|
1103
|
+
}, e.getRowCount = () => {
|
|
1104
|
+
var n;
|
|
1105
|
+
return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
|
|
1106
|
+
};
|
|
1107
|
+
}
|
|
1108
|
+
}, Re = () => ({
|
|
1109
|
+
top: [],
|
|
1110
|
+
bottom: []
|
|
1111
|
+
}), on = {
|
|
1112
|
+
getInitialState: (e) => ({
|
|
1113
|
+
rowPinning: Re(),
|
|
1114
|
+
...e
|
|
1115
|
+
}),
|
|
1116
|
+
getDefaultOptions: (e) => ({
|
|
1117
|
+
onRowPinningChange: b("rowPinning", e)
|
|
1118
|
+
}),
|
|
1119
|
+
createRow: (e, i) => {
|
|
1120
|
+
e.pin = (t, n, o) => {
|
|
1121
|
+
const r = n ? e.getLeafRows().map((a) => {
|
|
1122
|
+
let {
|
|
1123
|
+
id: u
|
|
1124
|
+
} = a;
|
|
1125
|
+
return u;
|
|
1126
|
+
}) : [], s = o ? e.getParentRows().map((a) => {
|
|
1127
|
+
let {
|
|
1128
|
+
id: u
|
|
1129
|
+
} = a;
|
|
1130
|
+
return u;
|
|
1131
|
+
}) : [], l = /* @__PURE__ */ new Set([...s, e.id, ...r]);
|
|
1132
|
+
i.setRowPinning((a) => {
|
|
1133
|
+
var u, g;
|
|
1134
|
+
if (t === "bottom") {
|
|
1135
|
+
var m, c;
|
|
1136
|
+
return {
|
|
1137
|
+
top: ((m = a == null ? void 0 : a.top) != null ? m : []).filter((h) => !(l != null && l.has(h))),
|
|
1138
|
+
bottom: [...((c = a == null ? void 0 : a.bottom) != null ? c : []).filter((h) => !(l != null && l.has(h))), ...Array.from(l)]
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
if (t === "top") {
|
|
1142
|
+
var d, p;
|
|
1143
|
+
return {
|
|
1144
|
+
top: [...((d = a == null ? void 0 : a.top) != null ? d : []).filter((h) => !(l != null && l.has(h))), ...Array.from(l)],
|
|
1145
|
+
bottom: ((p = a == null ? void 0 : a.bottom) != null ? p : []).filter((h) => !(l != null && l.has(h)))
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
1148
|
+
return {
|
|
1149
|
+
top: ((u = a == null ? void 0 : a.top) != null ? u : []).filter((h) => !(l != null && l.has(h))),
|
|
1150
|
+
bottom: ((g = a == null ? void 0 : a.bottom) != null ? g : []).filter((h) => !(l != null && l.has(h)))
|
|
1151
|
+
};
|
|
1152
|
+
});
|
|
1153
|
+
}, e.getCanPin = () => {
|
|
1154
|
+
var t;
|
|
1155
|
+
const {
|
|
1156
|
+
enableRowPinning: n,
|
|
1157
|
+
enablePinning: o
|
|
1158
|
+
} = i.options;
|
|
1159
|
+
return typeof n == "function" ? n(e) : (t = n ?? o) != null ? t : !0;
|
|
1160
|
+
}, e.getIsPinned = () => {
|
|
1161
|
+
const t = [e.id], {
|
|
1162
|
+
top: n,
|
|
1163
|
+
bottom: o
|
|
1164
|
+
} = i.getState().rowPinning, r = t.some((l) => n == null ? void 0 : n.includes(l)), s = t.some((l) => o == null ? void 0 : o.includes(l));
|
|
1165
|
+
return r ? "top" : s ? "bottom" : !1;
|
|
1166
|
+
}, e.getPinnedIndex = () => {
|
|
1167
|
+
var t, n;
|
|
1168
|
+
const o = e.getIsPinned();
|
|
1169
|
+
if (!o) return -1;
|
|
1170
|
+
const r = (t = o === "top" ? i.getTopRows() : i.getBottomRows()) == null ? void 0 : t.map((s) => {
|
|
1171
|
+
let {
|
|
1172
|
+
id: l
|
|
1173
|
+
} = s;
|
|
1174
|
+
return l;
|
|
1175
|
+
});
|
|
1176
|
+
return (n = r == null ? void 0 : r.indexOf(e.id)) != null ? n : -1;
|
|
1177
|
+
};
|
|
1178
|
+
},
|
|
1179
|
+
createTable: (e) => {
|
|
1180
|
+
e.setRowPinning = (i) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(i), e.resetRowPinning = (i) => {
|
|
1181
|
+
var t, n;
|
|
1182
|
+
return e.setRowPinning(i ? Re() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : Re());
|
|
1183
|
+
}, e.getIsSomeRowsPinned = (i) => {
|
|
1184
|
+
var t;
|
|
1185
|
+
const n = e.getState().rowPinning;
|
|
1186
|
+
if (!i) {
|
|
1187
|
+
var o, r;
|
|
1188
|
+
return !!((o = n.top) != null && o.length || (r = n.bottom) != null && r.length);
|
|
1189
|
+
}
|
|
1190
|
+
return !!((t = n[i]) != null && t.length);
|
|
1191
|
+
}, e._getPinnedRows = (i, t, n) => {
|
|
1192
|
+
var o;
|
|
1193
|
+
return ((o = e.options.keepPinnedRows) == null || o ? (
|
|
1194
|
+
//get all rows that are pinned even if they would not be otherwise visible
|
|
1195
|
+
//account for expanded parent rows, but not pagination or filtering
|
|
1196
|
+
(t ?? []).map((s) => {
|
|
1197
|
+
const l = e.getRow(s, !0);
|
|
1198
|
+
return l.getIsAllParentsExpanded() ? l : null;
|
|
1199
|
+
})
|
|
1200
|
+
) : (
|
|
1201
|
+
//else get only visible rows that are pinned
|
|
1202
|
+
(t ?? []).map((s) => i.find((l) => l.id === s))
|
|
1203
|
+
)).filter(Boolean).map((s) => ({
|
|
1204
|
+
...s,
|
|
1205
|
+
position: n
|
|
1206
|
+
}));
|
|
1207
|
+
}, e.getTopRows = C(() => [e.getRowModel().rows, e.getState().rowPinning.top], (i, t) => e._getPinnedRows(i, t, "top"), x(e.options, "debugRows", "getTopRows")), e.getBottomRows = C(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (i, t) => e._getPinnedRows(i, t, "bottom"), x(e.options, "debugRows", "getBottomRows")), e.getCenterRows = C(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (i, t, n) => {
|
|
1208
|
+
const o = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
|
|
1209
|
+
return i.filter((r) => !o.has(r.id));
|
|
1210
|
+
}, x(e.options, "debugRows", "getCenterRows"));
|
|
1211
|
+
}
|
|
1212
|
+
}, rn = {
|
|
1213
|
+
getInitialState: (e) => ({
|
|
1214
|
+
rowSelection: {},
|
|
1215
|
+
...e
|
|
1216
|
+
}),
|
|
1217
|
+
getDefaultOptions: (e) => ({
|
|
1218
|
+
onRowSelectionChange: b("rowSelection", e),
|
|
1219
|
+
enableRowSelection: !0,
|
|
1220
|
+
enableMultiRowSelection: !0,
|
|
1221
|
+
enableSubRowSelection: !0
|
|
1222
|
+
// enableGroupingRowSelection: false,
|
|
1223
|
+
// isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,
|
|
1224
|
+
// isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
|
|
1225
|
+
}),
|
|
1226
|
+
createTable: (e) => {
|
|
1227
|
+
e.setRowSelection = (i) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(i), e.resetRowSelection = (i) => {
|
|
1228
|
+
var t;
|
|
1229
|
+
return e.setRowSelection(i ? {} : (t = e.initialState.rowSelection) != null ? t : {});
|
|
1230
|
+
}, e.toggleAllRowsSelected = (i) => {
|
|
1231
|
+
e.setRowSelection((t) => {
|
|
1232
|
+
i = typeof i < "u" ? i : !e.getIsAllRowsSelected();
|
|
1233
|
+
const n = {
|
|
1234
|
+
...t
|
|
1235
|
+
}, o = e.getPreGroupedRowModel().flatRows;
|
|
1236
|
+
return i ? o.forEach((r) => {
|
|
1237
|
+
r.getCanSelect() && (n[r.id] = !0);
|
|
1238
|
+
}) : o.forEach((r) => {
|
|
1239
|
+
delete n[r.id];
|
|
1240
|
+
}), n;
|
|
1241
|
+
});
|
|
1242
|
+
}, e.toggleAllPageRowsSelected = (i) => e.setRowSelection((t) => {
|
|
1243
|
+
const n = typeof i < "u" ? i : !e.getIsAllPageRowsSelected(), o = {
|
|
1244
|
+
...t
|
|
1245
|
+
};
|
|
1246
|
+
return e.getRowModel().rows.forEach((r) => {
|
|
1247
|
+
Me(o, r.id, n, !0, e);
|
|
1248
|
+
}), o;
|
|
1249
|
+
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = C(() => [e.getState().rowSelection, e.getCoreRowModel()], (i, t) => Object.keys(i).length ? ye(e, t) : {
|
|
1250
|
+
rows: [],
|
|
1251
|
+
flatRows: [],
|
|
1252
|
+
rowsById: {}
|
|
1253
|
+
}, x(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = C(() => [e.getState().rowSelection, e.getFilteredRowModel()], (i, t) => Object.keys(i).length ? ye(e, t) : {
|
|
1254
|
+
rows: [],
|
|
1255
|
+
flatRows: [],
|
|
1256
|
+
rowsById: {}
|
|
1257
|
+
}, x(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = C(() => [e.getState().rowSelection, e.getSortedRowModel()], (i, t) => Object.keys(i).length ? ye(e, t) : {
|
|
1258
|
+
rows: [],
|
|
1259
|
+
flatRows: [],
|
|
1260
|
+
rowsById: {}
|
|
1261
|
+
}, x(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
|
|
1262
|
+
const i = e.getFilteredRowModel().flatRows, {
|
|
1263
|
+
rowSelection: t
|
|
1264
|
+
} = e.getState();
|
|
1265
|
+
let n = !!(i.length && Object.keys(t).length);
|
|
1266
|
+
return n && i.some((o) => o.getCanSelect() && !t[o.id]) && (n = !1), n;
|
|
1267
|
+
}, e.getIsAllPageRowsSelected = () => {
|
|
1268
|
+
const i = e.getPaginationRowModel().flatRows.filter((o) => o.getCanSelect()), {
|
|
1269
|
+
rowSelection: t
|
|
1270
|
+
} = e.getState();
|
|
1271
|
+
let n = !!i.length;
|
|
1272
|
+
return n && i.some((o) => !t[o.id]) && (n = !1), n;
|
|
1273
|
+
}, e.getIsSomeRowsSelected = () => {
|
|
1274
|
+
var i;
|
|
1275
|
+
const t = Object.keys((i = e.getState().rowSelection) != null ? i : {}).length;
|
|
1276
|
+
return t > 0 && t < e.getFilteredRowModel().flatRows.length;
|
|
1277
|
+
}, e.getIsSomePageRowsSelected = () => {
|
|
1278
|
+
const i = e.getPaginationRowModel().flatRows;
|
|
1279
|
+
return e.getIsAllPageRowsSelected() ? !1 : i.filter((t) => t.getCanSelect()).some((t) => t.getIsSelected() || t.getIsSomeSelected());
|
|
1280
|
+
}, e.getToggleAllRowsSelectedHandler = () => (i) => {
|
|
1281
|
+
e.toggleAllRowsSelected(i.target.checked);
|
|
1282
|
+
}, e.getToggleAllPageRowsSelectedHandler = () => (i) => {
|
|
1283
|
+
e.toggleAllPageRowsSelected(i.target.checked);
|
|
1284
|
+
};
|
|
1285
|
+
},
|
|
1286
|
+
createRow: (e, i) => {
|
|
1287
|
+
e.toggleSelected = (t, n) => {
|
|
1288
|
+
const o = e.getIsSelected();
|
|
1289
|
+
i.setRowSelection((r) => {
|
|
1290
|
+
var s;
|
|
1291
|
+
if (t = typeof t < "u" ? t : !o, e.getCanSelect() && o === t)
|
|
1292
|
+
return r;
|
|
1293
|
+
const l = {
|
|
1294
|
+
...r
|
|
1295
|
+
};
|
|
1296
|
+
return Me(l, e.id, t, (s = n == null ? void 0 : n.selectChildren) != null ? s : !0, i), l;
|
|
1297
|
+
});
|
|
1298
|
+
}, e.getIsSelected = () => {
|
|
1299
|
+
const {
|
|
1300
|
+
rowSelection: t
|
|
1301
|
+
} = i.getState();
|
|
1302
|
+
return Pe(e, t);
|
|
1303
|
+
}, e.getIsSomeSelected = () => {
|
|
1304
|
+
const {
|
|
1305
|
+
rowSelection: t
|
|
1306
|
+
} = i.getState();
|
|
1307
|
+
return $e(e, t) === "some";
|
|
1308
|
+
}, e.getIsAllSubRowsSelected = () => {
|
|
1309
|
+
const {
|
|
1310
|
+
rowSelection: t
|
|
1311
|
+
} = i.getState();
|
|
1312
|
+
return $e(e, t) === "all";
|
|
1313
|
+
}, e.getCanSelect = () => {
|
|
1314
|
+
var t;
|
|
1315
|
+
return typeof i.options.enableRowSelection == "function" ? i.options.enableRowSelection(e) : (t = i.options.enableRowSelection) != null ? t : !0;
|
|
1316
|
+
}, e.getCanSelectSubRows = () => {
|
|
1317
|
+
var t;
|
|
1318
|
+
return typeof i.options.enableSubRowSelection == "function" ? i.options.enableSubRowSelection(e) : (t = i.options.enableSubRowSelection) != null ? t : !0;
|
|
1319
|
+
}, e.getCanMultiSelect = () => {
|
|
1320
|
+
var t;
|
|
1321
|
+
return typeof i.options.enableMultiRowSelection == "function" ? i.options.enableMultiRowSelection(e) : (t = i.options.enableMultiRowSelection) != null ? t : !0;
|
|
1322
|
+
}, e.getToggleSelectedHandler = () => {
|
|
1323
|
+
const t = e.getCanSelect();
|
|
1324
|
+
return (n) => {
|
|
1325
|
+
var o;
|
|
1326
|
+
t && e.toggleSelected((o = n.target) == null ? void 0 : o.checked);
|
|
1327
|
+
};
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
}, Me = (e, i, t, n, o) => {
|
|
1331
|
+
var r;
|
|
1332
|
+
const s = o.getRow(i, !0);
|
|
1333
|
+
t ? (s.getCanMultiSelect() || Object.keys(e).forEach((l) => delete e[l]), s.getCanSelect() && (e[i] = !0)) : delete e[i], n && (r = s.subRows) != null && r.length && s.getCanSelectSubRows() && s.subRows.forEach((l) => Me(e, l.id, t, n, o));
|
|
1334
|
+
};
|
|
1335
|
+
function ye(e, i) {
|
|
1336
|
+
const t = e.getState().rowSelection, n = [], o = {}, r = function(s, l) {
|
|
1337
|
+
return s.map((a) => {
|
|
1338
|
+
var u;
|
|
1339
|
+
const g = Pe(a, t);
|
|
1340
|
+
if (g && (n.push(a), o[a.id] = a), (u = a.subRows) != null && u.length && (a = {
|
|
1341
|
+
...a,
|
|
1342
|
+
subRows: r(a.subRows)
|
|
1343
|
+
}), g)
|
|
1344
|
+
return a;
|
|
1345
|
+
}).filter(Boolean);
|
|
1346
|
+
};
|
|
1347
|
+
return {
|
|
1348
|
+
rows: r(i.rows),
|
|
1349
|
+
flatRows: n,
|
|
1350
|
+
rowsById: o
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
function Pe(e, i) {
|
|
1354
|
+
var t;
|
|
1355
|
+
return (t = i[e.id]) != null ? t : !1;
|
|
1356
|
+
}
|
|
1357
|
+
function $e(e, i, t) {
|
|
1358
|
+
var n;
|
|
1359
|
+
if (!((n = e.subRows) != null && n.length)) return !1;
|
|
1360
|
+
let o = !0, r = !1;
|
|
1361
|
+
return e.subRows.forEach((s) => {
|
|
1362
|
+
if (!(r && !o) && (s.getCanSelect() && (Pe(s, i) ? r = !0 : o = !1), s.subRows && s.subRows.length)) {
|
|
1363
|
+
const l = $e(s, i);
|
|
1364
|
+
l === "all" ? r = !0 : (l === "some" && (r = !0), o = !1);
|
|
1365
|
+
}
|
|
1366
|
+
}), o ? "all" : r ? "some" : !1;
|
|
1367
|
+
}
|
|
1368
|
+
const Ie = /([0-9]+)/gm, sn = (e, i, t) => ct(k(e.getValue(t)).toLowerCase(), k(i.getValue(t)).toLowerCase()), ln = (e, i, t) => ct(k(e.getValue(t)), k(i.getValue(t))), an = (e, i, t) => ze(k(e.getValue(t)).toLowerCase(), k(i.getValue(t)).toLowerCase()), un = (e, i, t) => ze(k(e.getValue(t)), k(i.getValue(t))), dn = (e, i, t) => {
|
|
1369
|
+
const n = e.getValue(t), o = i.getValue(t);
|
|
1370
|
+
return n > o ? 1 : n < o ? -1 : 0;
|
|
1371
|
+
}, gn = (e, i, t) => ze(e.getValue(t), i.getValue(t));
|
|
1372
|
+
function ze(e, i) {
|
|
1373
|
+
return e === i ? 0 : e > i ? 1 : -1;
|
|
1374
|
+
}
|
|
1375
|
+
function k(e) {
|
|
1376
|
+
return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
|
|
1377
|
+
}
|
|
1378
|
+
function ct(e, i) {
|
|
1379
|
+
const t = e.split(Ie).filter(Boolean), n = i.split(Ie).filter(Boolean);
|
|
1380
|
+
for (; t.length && n.length; ) {
|
|
1381
|
+
const o = t.shift(), r = n.shift(), s = parseInt(o, 10), l = parseInt(r, 10), a = [s, l].sort();
|
|
1382
|
+
if (isNaN(a[0])) {
|
|
1383
|
+
if (o > r)
|
|
1384
|
+
return 1;
|
|
1385
|
+
if (r > o)
|
|
1386
|
+
return -1;
|
|
1387
|
+
continue;
|
|
1388
|
+
}
|
|
1389
|
+
if (isNaN(a[1]))
|
|
1390
|
+
return isNaN(s) ? -1 : 1;
|
|
1391
|
+
if (s > l)
|
|
1392
|
+
return 1;
|
|
1393
|
+
if (l > s)
|
|
1394
|
+
return -1;
|
|
1395
|
+
}
|
|
1396
|
+
return t.length - n.length;
|
|
1397
|
+
}
|
|
1398
|
+
const Q = {
|
|
1399
|
+
alphanumeric: sn,
|
|
1400
|
+
alphanumericCaseSensitive: ln,
|
|
1401
|
+
text: an,
|
|
1402
|
+
textCaseSensitive: un,
|
|
1403
|
+
datetime: dn,
|
|
1404
|
+
basic: gn
|
|
1405
|
+
}, cn = {
|
|
1406
|
+
getInitialState: (e) => ({
|
|
1407
|
+
sorting: [],
|
|
1408
|
+
...e
|
|
1409
|
+
}),
|
|
1410
|
+
getDefaultColumnDef: () => ({
|
|
1411
|
+
sortingFn: "auto",
|
|
1412
|
+
sortUndefined: 1
|
|
1413
|
+
}),
|
|
1414
|
+
getDefaultOptions: (e) => ({
|
|
1415
|
+
onSortingChange: b("sorting", e),
|
|
1416
|
+
isMultiSortEvent: (i) => i.shiftKey
|
|
1417
|
+
}),
|
|
1418
|
+
createColumn: (e, i) => {
|
|
1419
|
+
e.getAutoSortingFn = () => {
|
|
1420
|
+
const t = i.getFilteredRowModel().flatRows.slice(10);
|
|
1421
|
+
let n = !1;
|
|
1422
|
+
for (const o of t) {
|
|
1423
|
+
const r = o == null ? void 0 : o.getValue(e.id);
|
|
1424
|
+
if (Object.prototype.toString.call(r) === "[object Date]")
|
|
1425
|
+
return Q.datetime;
|
|
1426
|
+
if (typeof r == "string" && (n = !0, r.split(Ie).length > 1))
|
|
1427
|
+
return Q.alphanumeric;
|
|
1428
|
+
}
|
|
1429
|
+
return n ? Q.text : Q.basic;
|
|
1430
|
+
}, e.getAutoSortDir = () => {
|
|
1431
|
+
const t = i.getFilteredRowModel().flatRows[0];
|
|
1432
|
+
return typeof (t == null ? void 0 : t.getValue(e.id)) == "string" ? "asc" : "desc";
|
|
1433
|
+
}, e.getSortingFn = () => {
|
|
1434
|
+
var t, n;
|
|
1435
|
+
if (!e)
|
|
1436
|
+
throw new Error();
|
|
1437
|
+
return pe(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : (t = (n = i.options.sortingFns) == null ? void 0 : n[e.columnDef.sortingFn]) != null ? t : Q[e.columnDef.sortingFn];
|
|
1438
|
+
}, e.toggleSorting = (t, n) => {
|
|
1439
|
+
const o = e.getNextSortingOrder(), r = typeof t < "u" && t !== null;
|
|
1440
|
+
i.setSorting((s) => {
|
|
1441
|
+
const l = s == null ? void 0 : s.find((d) => d.id === e.id), a = s == null ? void 0 : s.findIndex((d) => d.id === e.id);
|
|
1442
|
+
let u = [], g, m = r ? t : o === "desc";
|
|
1443
|
+
if (s != null && s.length && e.getCanMultiSort() && n ? l ? g = "toggle" : g = "add" : s != null && s.length && a !== s.length - 1 ? g = "replace" : l ? g = "toggle" : g = "replace", g === "toggle" && (r || o || (g = "remove")), g === "add") {
|
|
1444
|
+
var c;
|
|
1445
|
+
u = [...s, {
|
|
1446
|
+
id: e.id,
|
|
1447
|
+
desc: m
|
|
1448
|
+
}], u.splice(0, u.length - ((c = i.options.maxMultiSortColCount) != null ? c : Number.MAX_SAFE_INTEGER));
|
|
1449
|
+
} else g === "toggle" ? u = s.map((d) => d.id === e.id ? {
|
|
1450
|
+
...d,
|
|
1451
|
+
desc: m
|
|
1452
|
+
} : d) : g === "remove" ? u = s.filter((d) => d.id !== e.id) : u = [{
|
|
1453
|
+
id: e.id,
|
|
1454
|
+
desc: m
|
|
1455
|
+
}];
|
|
1456
|
+
return u;
|
|
1457
|
+
});
|
|
1458
|
+
}, e.getFirstSortDir = () => {
|
|
1459
|
+
var t, n;
|
|
1460
|
+
return ((t = (n = e.columnDef.sortDescFirst) != null ? n : i.options.sortDescFirst) != null ? t : e.getAutoSortDir() === "desc") ? "desc" : "asc";
|
|
1461
|
+
}, e.getNextSortingOrder = (t) => {
|
|
1462
|
+
var n, o;
|
|
1463
|
+
const r = e.getFirstSortDir(), s = e.getIsSorted();
|
|
1464
|
+
return s ? s !== r && ((n = i.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
|
|
1465
|
+
(!(t && (o = i.options.enableMultiRemove) != null) || o) ? !1 : s === "desc" ? "asc" : "desc" : r;
|
|
1466
|
+
}, e.getCanSort = () => {
|
|
1467
|
+
var t, n;
|
|
1468
|
+
return ((t = e.columnDef.enableSorting) != null ? t : !0) && ((n = i.options.enableSorting) != null ? n : !0) && !!e.accessorFn;
|
|
1469
|
+
}, e.getCanMultiSort = () => {
|
|
1470
|
+
var t, n;
|
|
1471
|
+
return (t = (n = e.columnDef.enableMultiSort) != null ? n : i.options.enableMultiSort) != null ? t : !!e.accessorFn;
|
|
1472
|
+
}, e.getIsSorted = () => {
|
|
1473
|
+
var t;
|
|
1474
|
+
const n = (t = i.getState().sorting) == null ? void 0 : t.find((o) => o.id === e.id);
|
|
1475
|
+
return n ? n.desc ? "desc" : "asc" : !1;
|
|
1476
|
+
}, e.getSortIndex = () => {
|
|
1477
|
+
var t, n;
|
|
1478
|
+
return (t = (n = i.getState().sorting) == null ? void 0 : n.findIndex((o) => o.id === e.id)) != null ? t : -1;
|
|
1479
|
+
}, e.clearSorting = () => {
|
|
1480
|
+
i.setSorting((t) => t != null && t.length ? t.filter((n) => n.id !== e.id) : []);
|
|
1481
|
+
}, e.getToggleSortingHandler = () => {
|
|
1482
|
+
const t = e.getCanSort();
|
|
1483
|
+
return (n) => {
|
|
1484
|
+
t && (n.persist == null || n.persist(), e.toggleSorting == null || e.toggleSorting(void 0, e.getCanMultiSort() ? i.options.isMultiSortEvent == null ? void 0 : i.options.isMultiSortEvent(n) : !1));
|
|
1485
|
+
};
|
|
1486
|
+
};
|
|
1487
|
+
},
|
|
1488
|
+
createTable: (e) => {
|
|
1489
|
+
e.setSorting = (i) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(i), e.resetSorting = (i) => {
|
|
1490
|
+
var t, n;
|
|
1491
|
+
e.setSorting(i ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
|
|
1492
|
+
}, 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());
|
|
1493
|
+
}
|
|
1494
|
+
}, fn = [
|
|
1495
|
+
Pt,
|
|
1496
|
+
Yt,
|
|
1497
|
+
Ut,
|
|
1498
|
+
Kt,
|
|
1499
|
+
Nt,
|
|
1500
|
+
Ot,
|
|
1501
|
+
Zt,
|
|
1502
|
+
//depends on ColumnFaceting
|
|
1503
|
+
en,
|
|
1504
|
+
//depends on ColumnFiltering
|
|
1505
|
+
cn,
|
|
1506
|
+
qt,
|
|
1507
|
+
//depends on RowSorting
|
|
1508
|
+
tn,
|
|
1509
|
+
nn,
|
|
1510
|
+
on,
|
|
1511
|
+
rn,
|
|
1512
|
+
Jt
|
|
1513
|
+
];
|
|
1514
|
+
function pn(e) {
|
|
1515
|
+
var i, t;
|
|
1516
|
+
process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
|
|
1517
|
+
const n = [...fn, ...(i = e._features) != null ? i : []];
|
|
1518
|
+
let o = {
|
|
1519
|
+
_features: n
|
|
1520
|
+
};
|
|
1521
|
+
const r = o._features.reduce((c, d) => Object.assign(c, d.getDefaultOptions == null ? void 0 : d.getDefaultOptions(o)), {}), s = (c) => o.options.mergeOptions ? o.options.mergeOptions(r, c) : {
|
|
1522
|
+
...r,
|
|
1523
|
+
...c
|
|
1524
|
+
};
|
|
1525
|
+
let a = {
|
|
1526
|
+
...{},
|
|
1527
|
+
...(t = e.initialState) != null ? t : {}
|
|
1528
|
+
};
|
|
1529
|
+
o._features.forEach((c) => {
|
|
1530
|
+
var d;
|
|
1531
|
+
a = (d = c.getInitialState == null ? void 0 : c.getInitialState(a)) != null ? d : a;
|
|
1532
|
+
});
|
|
1533
|
+
const u = [];
|
|
1534
|
+
let g = !1;
|
|
1535
|
+
const m = {
|
|
1536
|
+
_features: n,
|
|
1537
|
+
options: {
|
|
1538
|
+
...r,
|
|
1539
|
+
...e
|
|
1540
|
+
},
|
|
1541
|
+
initialState: a,
|
|
1542
|
+
_queue: (c) => {
|
|
1543
|
+
u.push(c), g || (g = !0, Promise.resolve().then(() => {
|
|
1544
|
+
for (; u.length; )
|
|
1545
|
+
u.shift()();
|
|
1546
|
+
g = !1;
|
|
1547
|
+
}).catch((d) => setTimeout(() => {
|
|
1548
|
+
throw d;
|
|
1549
|
+
})));
|
|
1550
|
+
},
|
|
1551
|
+
reset: () => {
|
|
1552
|
+
o.setState(o.initialState);
|
|
1553
|
+
},
|
|
1554
|
+
setOptions: (c) => {
|
|
1555
|
+
const d = H(c, o.options);
|
|
1556
|
+
o.options = s(d);
|
|
1557
|
+
},
|
|
1558
|
+
getState: () => o.options.state,
|
|
1559
|
+
setState: (c) => {
|
|
1560
|
+
o.options.onStateChange == null || o.options.onStateChange(c);
|
|
1561
|
+
},
|
|
1562
|
+
_getRowId: (c, d, p) => {
|
|
1563
|
+
var h;
|
|
1564
|
+
return (h = o.options.getRowId == null ? void 0 : o.options.getRowId(c, d, p)) != null ? h : `${p ? [p.id, d].join(".") : d}`;
|
|
1565
|
+
},
|
|
1566
|
+
getCoreRowModel: () => (o._getCoreRowModel || (o._getCoreRowModel = o.options.getCoreRowModel(o)), o._getCoreRowModel()),
|
|
1567
|
+
// The final calls start at the bottom of the model,
|
|
1568
|
+
// expanded rows, which then work their way up
|
|
1569
|
+
getRowModel: () => o.getPaginationRowModel(),
|
|
1570
|
+
//in next version, we should just pass in the row model as the optional 2nd arg
|
|
1571
|
+
getRow: (c, d) => {
|
|
1572
|
+
let p = (d ? o.getPrePaginationRowModel() : o.getRowModel()).rowsById[c];
|
|
1573
|
+
if (!p && (p = o.getCoreRowModel().rowsById[c], !p))
|
|
1574
|
+
throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${c}`) : new Error();
|
|
1575
|
+
return p;
|
|
1576
|
+
},
|
|
1577
|
+
_getDefaultColumnDef: C(() => [o.options.defaultColumn], (c) => {
|
|
1578
|
+
var d;
|
|
1579
|
+
return c = (d = c) != null ? d : {}, {
|
|
1580
|
+
header: (p) => {
|
|
1581
|
+
const h = p.header.column.columnDef;
|
|
1582
|
+
return h.accessorKey ? h.accessorKey : h.accessorFn ? h.id : null;
|
|
1583
|
+
},
|
|
1584
|
+
// footer: props => props.header.column.id,
|
|
1585
|
+
cell: (p) => {
|
|
1586
|
+
var h, w;
|
|
1587
|
+
return (h = (w = p.renderValue()) == null || w.toString == null ? void 0 : w.toString()) != null ? h : null;
|
|
1588
|
+
},
|
|
1589
|
+
...o._features.reduce((p, h) => Object.assign(p, h.getDefaultColumnDef == null ? void 0 : h.getDefaultColumnDef()), {}),
|
|
1590
|
+
...c
|
|
1591
|
+
};
|
|
1592
|
+
}, x(e, "debugColumns", "_getDefaultColumnDef")),
|
|
1593
|
+
_getColumnDefs: () => o.options.columns,
|
|
1594
|
+
getAllColumns: C(() => [o._getColumnDefs()], (c) => {
|
|
1595
|
+
const d = function(p, h, w) {
|
|
1596
|
+
return w === void 0 && (w = 0), p.map((S) => {
|
|
1597
|
+
const v = Vt(o, S, w, h), F = S;
|
|
1598
|
+
return v.columns = F.columns ? d(F.columns, v, w + 1) : [], v;
|
|
1599
|
+
});
|
|
1600
|
+
};
|
|
1601
|
+
return d(c);
|
|
1602
|
+
}, x(e, "debugColumns", "getAllColumns")),
|
|
1603
|
+
getAllFlatColumns: C(() => [o.getAllColumns()], (c) => c.flatMap((d) => d.getFlatColumns()), x(e, "debugColumns", "getAllFlatColumns")),
|
|
1604
|
+
_getAllFlatColumnsById: C(() => [o.getAllFlatColumns()], (c) => c.reduce((d, p) => (d[p.id] = p, d), {}), x(e, "debugColumns", "getAllFlatColumnsById")),
|
|
1605
|
+
getAllLeafColumns: C(() => [o.getAllColumns(), o._getOrderColumnsFn()], (c, d) => {
|
|
1606
|
+
let p = c.flatMap((h) => h.getLeafColumns());
|
|
1607
|
+
return d(p);
|
|
1608
|
+
}, x(e, "debugColumns", "getAllLeafColumns")),
|
|
1609
|
+
getColumn: (c) => {
|
|
1610
|
+
const d = o._getAllFlatColumnsById()[c];
|
|
1611
|
+
return process.env.NODE_ENV !== "production" && !d && console.error(`[Table] Column with id '${c}' does not exist.`), d;
|
|
1612
|
+
}
|
|
1613
|
+
};
|
|
1614
|
+
Object.assign(o, m);
|
|
1615
|
+
for (let c = 0; c < o._features.length; c++) {
|
|
1616
|
+
const d = o._features[c];
|
|
1617
|
+
d == null || d.createTable == null || d.createTable(o);
|
|
1618
|
+
}
|
|
1619
|
+
return o;
|
|
1620
|
+
}
|
|
1621
|
+
function hn() {
|
|
1622
|
+
return (e) => C(() => [e.options.data], (i) => {
|
|
1623
|
+
const t = {
|
|
1624
|
+
rows: [],
|
|
1625
|
+
flatRows: [],
|
|
1626
|
+
rowsById: {}
|
|
1627
|
+
}, n = function(o, r, s) {
|
|
1628
|
+
r === void 0 && (r = 0);
|
|
1629
|
+
const l = [];
|
|
1630
|
+
for (let u = 0; u < o.length; u++) {
|
|
1631
|
+
const g = zt(e, e._getRowId(o[u], u, s), o[u], u, r, void 0, s == null ? void 0 : s.id);
|
|
1632
|
+
if (t.flatRows.push(g), t.rowsById[g.id] = g, l.push(g), e.options.getSubRows) {
|
|
1633
|
+
var a;
|
|
1634
|
+
g.originalSubRows = e.options.getSubRows(o[u], u), (a = g.originalSubRows) != null && a.length && (g.subRows = n(g.originalSubRows, r + 1, g));
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
return l;
|
|
1638
|
+
};
|
|
1639
|
+
return t.rows = n(i), t;
|
|
1640
|
+
}, x(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
|
|
1641
|
+
}
|
|
1642
|
+
function mn() {
|
|
1643
|
+
return (e) => C(() => [e.getState().expanded, e.getPreExpandedRowModel(), e.options.paginateExpandedRows], (i, t, n) => !t.rows.length || i !== !0 && !Object.keys(i ?? {}).length || !n ? t : Sn(t), x(e.options, "debugTable", "getExpandedRowModel"));
|
|
1644
|
+
}
|
|
1645
|
+
function Sn(e) {
|
|
1646
|
+
const i = [], t = (n) => {
|
|
1647
|
+
var o;
|
|
1648
|
+
i.push(n), (o = n.subRows) != null && o.length && n.getIsExpanded() && n.subRows.forEach(t);
|
|
1649
|
+
};
|
|
1650
|
+
return e.rows.forEach(t), {
|
|
1651
|
+
rows: i,
|
|
1652
|
+
flatRows: e.flatRows,
|
|
1653
|
+
rowsById: e.rowsById
|
|
1654
|
+
};
|
|
1655
|
+
}
|
|
1656
|
+
function vn() {
|
|
1657
|
+
return (e) => C(() => [e.getState().sorting, e.getPreSortedRowModel()], (i, t) => {
|
|
1658
|
+
if (!t.rows.length || !(i != null && i.length))
|
|
1659
|
+
return t;
|
|
1660
|
+
const n = e.getState().sorting, o = [], r = n.filter((a) => {
|
|
1661
|
+
var u;
|
|
1662
|
+
return (u = e.getColumn(a.id)) == null ? void 0 : u.getCanSort();
|
|
1663
|
+
}), s = {};
|
|
1664
|
+
r.forEach((a) => {
|
|
1665
|
+
const u = e.getColumn(a.id);
|
|
1666
|
+
u && (s[a.id] = {
|
|
1667
|
+
sortUndefined: u.columnDef.sortUndefined,
|
|
1668
|
+
invertSorting: u.columnDef.invertSorting,
|
|
1669
|
+
sortingFn: u.getSortingFn()
|
|
1670
|
+
});
|
|
1671
|
+
});
|
|
1672
|
+
const l = (a) => {
|
|
1673
|
+
const u = a.map((g) => ({
|
|
1674
|
+
...g
|
|
1675
|
+
}));
|
|
1676
|
+
return u.sort((g, m) => {
|
|
1677
|
+
for (let d = 0; d < r.length; d += 1) {
|
|
1678
|
+
var c;
|
|
1679
|
+
const p = r[d], h = s[p.id], w = h.sortUndefined, S = (c = p == null ? void 0 : p.desc) != null ? c : !1;
|
|
1680
|
+
let v = 0;
|
|
1681
|
+
if (w) {
|
|
1682
|
+
const F = g.getValue(p.id), $ = m.getValue(p.id), I = F === void 0, P = $ === void 0;
|
|
1683
|
+
if (I || P) {
|
|
1684
|
+
if (w === "first") return I ? -1 : 1;
|
|
1685
|
+
if (w === "last") return I ? 1 : -1;
|
|
1686
|
+
v = I && P ? 0 : I ? w : -w;
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
if (v === 0 && (v = h.sortingFn(g, m, p.id)), v !== 0)
|
|
1690
|
+
return S && (v *= -1), h.invertSorting && (v *= -1), v;
|
|
1691
|
+
}
|
|
1692
|
+
return g.index - m.index;
|
|
1693
|
+
}), u.forEach((g) => {
|
|
1694
|
+
var m;
|
|
1695
|
+
o.push(g), (m = g.subRows) != null && m.length && (g.subRows = l(g.subRows));
|
|
1696
|
+
}), u;
|
|
1697
|
+
};
|
|
1698
|
+
return {
|
|
1699
|
+
rows: l(t.rows),
|
|
1700
|
+
flatRows: o,
|
|
1701
|
+
rowsById: t.rowsById
|
|
1702
|
+
};
|
|
1703
|
+
}, x(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* react-table
|
|
1707
|
+
*
|
|
1708
|
+
* Copyright (c) TanStack
|
|
1709
|
+
*
|
|
1710
|
+
* This source code is licensed under the MIT license found in the
|
|
1711
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
1712
|
+
*
|
|
1713
|
+
* @license MIT
|
|
1714
|
+
*/
|
|
1715
|
+
function qe(e, i) {
|
|
1716
|
+
return e ? wn(e) ? /* @__PURE__ */ B.createElement(e, i) : e : null;
|
|
1717
|
+
}
|
|
1718
|
+
function wn(e) {
|
|
1719
|
+
return Cn(e) || typeof e == "function" || xn(e);
|
|
1720
|
+
}
|
|
1721
|
+
function Cn(e) {
|
|
1722
|
+
return typeof e == "function" && (() => {
|
|
1723
|
+
const i = Object.getPrototypeOf(e);
|
|
1724
|
+
return i.prototype && i.prototype.isReactComponent;
|
|
1725
|
+
})();
|
|
1726
|
+
}
|
|
1727
|
+
function xn(e) {
|
|
1728
|
+
return typeof e == "object" && typeof e.$$typeof == "symbol" && ["react.memo", "react.forward_ref"].includes(e.$$typeof.description);
|
|
1729
|
+
}
|
|
1730
|
+
function Rn(e) {
|
|
1731
|
+
const i = {
|
|
1732
|
+
state: {},
|
|
1733
|
+
// Dummy state
|
|
1734
|
+
onStateChange: () => {
|
|
1735
|
+
},
|
|
1736
|
+
// noop
|
|
1737
|
+
renderFallbackValue: null,
|
|
1738
|
+
...e
|
|
1739
|
+
}, [t] = B.useState(() => ({
|
|
1740
|
+
current: pn(i)
|
|
1741
|
+
})), [n, o] = B.useState(() => t.current.initialState);
|
|
1742
|
+
return t.current.setOptions((r) => ({
|
|
1743
|
+
...r,
|
|
1744
|
+
...e,
|
|
1745
|
+
state: {
|
|
1746
|
+
...n,
|
|
1747
|
+
...e.state
|
|
1748
|
+
},
|
|
1749
|
+
// Similarly, we'll maintain both our internal state and any user-provided
|
|
1750
|
+
// state.
|
|
1751
|
+
onStateChange: (s) => {
|
|
1752
|
+
o(s), e.onStateChange == null || e.onStateChange(s);
|
|
1753
|
+
}
|
|
1754
|
+
})), t.current;
|
|
1755
|
+
}
|
|
1756
|
+
function j(e, i, t) {
|
|
1757
|
+
let n = t.initialDeps ?? [], o, r = !0;
|
|
1758
|
+
function s() {
|
|
1759
|
+
var l, a, u;
|
|
1760
|
+
let g;
|
|
1761
|
+
t.key && ((l = t.debug) != null && l.call(t)) && (g = Date.now());
|
|
1762
|
+
const m = e();
|
|
1763
|
+
if (!(m.length !== n.length || m.some((p, h) => n[h] !== p)))
|
|
1764
|
+
return o;
|
|
1765
|
+
n = m;
|
|
1766
|
+
let d;
|
|
1767
|
+
if (t.key && ((a = t.debug) != null && a.call(t)) && (d = Date.now()), o = i(...m), t.key && ((u = t.debug) != null && u.call(t))) {
|
|
1768
|
+
const p = Math.round((Date.now() - g) * 100) / 100, h = Math.round((Date.now() - d) * 100) / 100, w = h / 16, S = (v, F) => {
|
|
1769
|
+
for (v = String(v); v.length < F; )
|
|
1770
|
+
v = " " + v;
|
|
1771
|
+
return v;
|
|
1772
|
+
};
|
|
1773
|
+
console.info(
|
|
1774
|
+
`%c⏱ ${S(h, 5)} /${S(p, 5)} ms`,
|
|
1775
|
+
`
|
|
1776
|
+
font-size: .6rem;
|
|
1777
|
+
font-weight: bold;
|
|
1778
|
+
color: hsl(${Math.max(
|
|
1779
|
+
0,
|
|
1780
|
+
Math.min(120 - 120 * w, 120)
|
|
1781
|
+
)}deg 100% 31%);`,
|
|
1782
|
+
t == null ? void 0 : t.key
|
|
1783
|
+
);
|
|
1784
|
+
}
|
|
1785
|
+
return t != null && t.onChange && !(r && t.skipInitialOnChange) && t.onChange(o), r = !1, o;
|
|
1786
|
+
}
|
|
1787
|
+
return s.updateDeps = (l) => {
|
|
1788
|
+
n = l;
|
|
1789
|
+
}, s;
|
|
1790
|
+
}
|
|
1791
|
+
function We(e, i) {
|
|
1792
|
+
if (e === void 0)
|
|
1793
|
+
throw new Error("Unexpected undefined");
|
|
1794
|
+
return e;
|
|
1795
|
+
}
|
|
1796
|
+
const yn = (e, i) => Math.abs(e - i) < 1.01, _n = (e, i, t) => {
|
|
1797
|
+
let n;
|
|
1798
|
+
return function(...o) {
|
|
1799
|
+
e.clearTimeout(n), n = e.setTimeout(() => i.apply(this, o), t);
|
|
1800
|
+
};
|
|
1801
|
+
}, Ue = (e) => {
|
|
1802
|
+
const { offsetWidth: i, offsetHeight: t } = e;
|
|
1803
|
+
return { width: i, height: t };
|
|
1804
|
+
}, Fn = (e) => e, Mn = (e) => {
|
|
1805
|
+
const i = Math.max(e.startIndex - e.overscan, 0), t = Math.min(e.endIndex + e.overscan, e.count - 1), n = [];
|
|
1806
|
+
for (let o = i; o <= t; o++)
|
|
1807
|
+
n.push(o);
|
|
1808
|
+
return n;
|
|
1809
|
+
}, $n = (e, i) => {
|
|
1810
|
+
const t = e.scrollElement;
|
|
1811
|
+
if (!t)
|
|
1812
|
+
return;
|
|
1813
|
+
const n = e.targetWindow;
|
|
1814
|
+
if (!n)
|
|
1815
|
+
return;
|
|
1816
|
+
const o = (s) => {
|
|
1817
|
+
const { width: l, height: a } = s;
|
|
1818
|
+
i({ width: Math.round(l), height: Math.round(a) });
|
|
1819
|
+
};
|
|
1820
|
+
if (o(Ue(t)), !n.ResizeObserver)
|
|
1821
|
+
return () => {
|
|
1822
|
+
};
|
|
1823
|
+
const r = new n.ResizeObserver((s) => {
|
|
1824
|
+
const l = () => {
|
|
1825
|
+
const a = s[0];
|
|
1826
|
+
if (a != null && a.borderBoxSize) {
|
|
1827
|
+
const u = a.borderBoxSize[0];
|
|
1828
|
+
if (u) {
|
|
1829
|
+
o({ width: u.inlineSize, height: u.blockSize });
|
|
1830
|
+
return;
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
o(Ue(t));
|
|
1834
|
+
};
|
|
1835
|
+
e.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(l) : l();
|
|
1836
|
+
});
|
|
1837
|
+
return r.observe(t, { box: "border-box" }), () => {
|
|
1838
|
+
r.unobserve(t);
|
|
1839
|
+
};
|
|
1840
|
+
}, Ke = {
|
|
1841
|
+
passive: !0
|
|
1842
|
+
}, Xe = typeof window > "u" ? !0 : "onscrollend" in window, In = (e, i) => {
|
|
1843
|
+
const t = e.scrollElement;
|
|
1844
|
+
if (!t)
|
|
1845
|
+
return;
|
|
1846
|
+
const n = e.targetWindow;
|
|
1847
|
+
if (!n)
|
|
1848
|
+
return;
|
|
1849
|
+
let o = 0;
|
|
1850
|
+
const r = e.options.useScrollendEvent && Xe ? () => {
|
|
1851
|
+
} : _n(
|
|
1852
|
+
n,
|
|
1853
|
+
() => {
|
|
1854
|
+
i(o, !1);
|
|
1855
|
+
},
|
|
1856
|
+
e.options.isScrollingResetDelay
|
|
1857
|
+
), s = (g) => () => {
|
|
1858
|
+
const { horizontal: m, isRtl: c } = e.options;
|
|
1859
|
+
o = m ? t.scrollLeft * (c && -1 || 1) : t.scrollTop, r(), i(o, g);
|
|
1860
|
+
}, l = s(!0), a = s(!1);
|
|
1861
|
+
t.addEventListener("scroll", l, Ke);
|
|
1862
|
+
const u = e.options.useScrollendEvent && Xe;
|
|
1863
|
+
return u && t.addEventListener("scrollend", a, Ke), () => {
|
|
1864
|
+
t.removeEventListener("scroll", l), u && t.removeEventListener("scrollend", a);
|
|
1865
|
+
};
|
|
1866
|
+
}, En = (e, i, t) => {
|
|
1867
|
+
if (i != null && i.borderBoxSize) {
|
|
1868
|
+
const n = i.borderBoxSize[0];
|
|
1869
|
+
if (n)
|
|
1870
|
+
return Math.round(
|
|
1871
|
+
n[t.options.horizontal ? "inlineSize" : "blockSize"]
|
|
1872
|
+
);
|
|
1873
|
+
}
|
|
1874
|
+
return e[t.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
1875
|
+
}, bn = (e, {
|
|
1876
|
+
adjustments: i = 0,
|
|
1877
|
+
behavior: t
|
|
1878
|
+
}, n) => {
|
|
1879
|
+
var o, r;
|
|
1880
|
+
const s = e + i;
|
|
1881
|
+
(r = (o = n.scrollElement) == null ? void 0 : o.scrollTo) == null || r.call(o, {
|
|
1882
|
+
[n.options.horizontal ? "left" : "top"]: s,
|
|
1883
|
+
behavior: t
|
|
1884
|
+
});
|
|
1885
|
+
};
|
|
1886
|
+
class Vn {
|
|
1887
|
+
constructor(i) {
|
|
1888
|
+
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
|
|
1889
|
+
var t, n, o;
|
|
1890
|
+
return ((o = (n = (t = this.targetWindow) == null ? void 0 : t.performance) == null ? void 0 : n.now) == null ? void 0 : o.call(n)) ?? Date.now();
|
|
1891
|
+
}, this.observer = /* @__PURE__ */ (() => {
|
|
1892
|
+
let t = null;
|
|
1893
|
+
const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((o) => {
|
|
1894
|
+
o.forEach((r) => {
|
|
1895
|
+
const s = () => {
|
|
1896
|
+
const l = r.target, a = this.indexFromElement(l);
|
|
1897
|
+
if (!l.isConnected) {
|
|
1898
|
+
this.observer.unobserve(l);
|
|
1899
|
+
return;
|
|
1900
|
+
}
|
|
1901
|
+
this.shouldMeasureDuringScroll(a) && this.resizeItem(
|
|
1902
|
+
a,
|
|
1903
|
+
this.options.measureElement(l, r, this)
|
|
1904
|
+
);
|
|
1905
|
+
};
|
|
1906
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(s) : s();
|
|
1907
|
+
});
|
|
1908
|
+
}));
|
|
1909
|
+
return {
|
|
1910
|
+
disconnect: () => {
|
|
1911
|
+
var o;
|
|
1912
|
+
(o = n()) == null || o.disconnect(), t = null;
|
|
1913
|
+
},
|
|
1914
|
+
observe: (o) => {
|
|
1915
|
+
var r;
|
|
1916
|
+
return (r = n()) == null ? void 0 : r.observe(o, { box: "border-box" });
|
|
1917
|
+
},
|
|
1918
|
+
unobserve: (o) => {
|
|
1919
|
+
var r;
|
|
1920
|
+
return (r = n()) == null ? void 0 : r.unobserve(o);
|
|
1921
|
+
}
|
|
1922
|
+
};
|
|
1923
|
+
})(), this.range = null, this.setOptions = (t) => {
|
|
1924
|
+
Object.entries(t).forEach(([n, o]) => {
|
|
1925
|
+
typeof o > "u" && delete t[n];
|
|
1926
|
+
}), this.options = {
|
|
1927
|
+
debug: !1,
|
|
1928
|
+
initialOffset: 0,
|
|
1929
|
+
overscan: 1,
|
|
1930
|
+
paddingStart: 0,
|
|
1931
|
+
paddingEnd: 0,
|
|
1932
|
+
scrollPaddingStart: 0,
|
|
1933
|
+
scrollPaddingEnd: 0,
|
|
1934
|
+
horizontal: !1,
|
|
1935
|
+
getItemKey: Fn,
|
|
1936
|
+
rangeExtractor: Mn,
|
|
1937
|
+
onChange: () => {
|
|
1938
|
+
},
|
|
1939
|
+
measureElement: En,
|
|
1940
|
+
initialRect: { width: 0, height: 0 },
|
|
1941
|
+
scrollMargin: 0,
|
|
1942
|
+
gap: 0,
|
|
1943
|
+
indexAttribute: "data-index",
|
|
1944
|
+
initialMeasurementsCache: [],
|
|
1945
|
+
lanes: 1,
|
|
1946
|
+
isScrollingResetDelay: 150,
|
|
1947
|
+
enabled: !0,
|
|
1948
|
+
isRtl: !1,
|
|
1949
|
+
useScrollendEvent: !1,
|
|
1950
|
+
useAnimationFrameWithResizeObserver: !1,
|
|
1951
|
+
...t
|
|
1952
|
+
};
|
|
1953
|
+
}, this.notify = (t) => {
|
|
1954
|
+
var n, o;
|
|
1955
|
+
(o = (n = this.options).onChange) == null || o.call(n, this, t);
|
|
1956
|
+
}, this.maybeNotify = j(
|
|
1957
|
+
() => (this.calculateRange(), [
|
|
1958
|
+
this.isScrolling,
|
|
1959
|
+
this.range ? this.range.startIndex : null,
|
|
1960
|
+
this.range ? this.range.endIndex : null
|
|
1961
|
+
]),
|
|
1962
|
+
(t) => {
|
|
1963
|
+
this.notify(t);
|
|
1964
|
+
},
|
|
1965
|
+
{
|
|
1966
|
+
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
1967
|
+
debug: () => this.options.debug,
|
|
1968
|
+
initialDeps: [
|
|
1969
|
+
this.isScrolling,
|
|
1970
|
+
this.range ? this.range.startIndex : null,
|
|
1971
|
+
this.range ? this.range.endIndex : null
|
|
1972
|
+
]
|
|
1973
|
+
}
|
|
1974
|
+
), this.cleanup = () => {
|
|
1975
|
+
this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
|
|
1976
|
+
}, this._didMount = () => () => {
|
|
1977
|
+
this.cleanup();
|
|
1978
|
+
}, this._willUpdate = () => {
|
|
1979
|
+
var t;
|
|
1980
|
+
const n = this.options.enabled ? this.options.getScrollElement() : null;
|
|
1981
|
+
if (this.scrollElement !== n) {
|
|
1982
|
+
if (this.cleanup(), !n) {
|
|
1983
|
+
this.maybeNotify();
|
|
1984
|
+
return;
|
|
1985
|
+
}
|
|
1986
|
+
this.scrollElement = n, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((o) => {
|
|
1987
|
+
this.observer.observe(o);
|
|
1988
|
+
}), this.unsubs.push(
|
|
1989
|
+
this.options.observeElementRect(this, (o) => {
|
|
1990
|
+
this.scrollRect = o, this.maybeNotify();
|
|
1991
|
+
})
|
|
1992
|
+
), this.unsubs.push(
|
|
1993
|
+
this.options.observeElementOffset(this, (o, r) => {
|
|
1994
|
+
this.scrollAdjustments = 0, this.scrollDirection = r ? this.getScrollOffset() < o ? "forward" : "backward" : null, this.scrollOffset = o, this.isScrolling = r, this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
|
|
1995
|
+
})
|
|
1996
|
+
), this._scrollToOffset(this.getScrollOffset(), {
|
|
1997
|
+
adjustments: void 0,
|
|
1998
|
+
behavior: void 0
|
|
1999
|
+
});
|
|
2000
|
+
}
|
|
2001
|
+
}, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, n) => {
|
|
2002
|
+
const o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
2003
|
+
for (let s = n - 1; s >= 0; s--) {
|
|
2004
|
+
const l = t[s];
|
|
2005
|
+
if (o.has(l.lane))
|
|
2006
|
+
continue;
|
|
2007
|
+
const a = r.get(
|
|
2008
|
+
l.lane
|
|
2009
|
+
);
|
|
2010
|
+
if (a == null || l.end > a.end ? r.set(l.lane, l) : l.end < a.end && o.set(l.lane, !0), o.size === this.options.lanes)
|
|
2011
|
+
break;
|
|
2012
|
+
}
|
|
2013
|
+
return r.size === this.options.lanes ? Array.from(r.values()).sort((s, l) => s.end === l.end ? s.index - l.index : s.end - l.end)[0] : void 0;
|
|
2014
|
+
}, this.getMeasurementOptions = j(
|
|
2015
|
+
() => [
|
|
2016
|
+
this.options.count,
|
|
2017
|
+
this.options.paddingStart,
|
|
2018
|
+
this.options.scrollMargin,
|
|
2019
|
+
this.options.getItemKey,
|
|
2020
|
+
this.options.enabled,
|
|
2021
|
+
this.options.lanes
|
|
2022
|
+
],
|
|
2023
|
+
(t, n, o, r, s, l) => (this.prevLanes !== void 0 && this.prevLanes !== l && (this.lanesChangedFlag = !0), this.prevLanes = l, this.pendingMeasuredCacheIndexes = [], {
|
|
2024
|
+
count: t,
|
|
2025
|
+
paddingStart: n,
|
|
2026
|
+
scrollMargin: o,
|
|
2027
|
+
getItemKey: r,
|
|
2028
|
+
enabled: s,
|
|
2029
|
+
lanes: l
|
|
2030
|
+
}),
|
|
2031
|
+
{
|
|
2032
|
+
key: !1
|
|
2033
|
+
}
|
|
2034
|
+
), this.getMeasurements = j(
|
|
2035
|
+
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
2036
|
+
({ count: t, paddingStart: n, scrollMargin: o, getItemKey: r, enabled: s, lanes: l }, a) => {
|
|
2037
|
+
if (!s)
|
|
2038
|
+
return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
2039
|
+
if (this.laneAssignments.size > t)
|
|
2040
|
+
for (const c of this.laneAssignments.keys())
|
|
2041
|
+
c >= t && this.laneAssignments.delete(c);
|
|
2042
|
+
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((c) => {
|
|
2043
|
+
this.itemSizeCache.set(c.key, c.size);
|
|
2044
|
+
}));
|
|
2045
|
+
const u = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
2046
|
+
this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === t && (this.lanesSettling = !1);
|
|
2047
|
+
const g = this.measurementsCache.slice(0, u), m = new Array(l).fill(
|
|
2048
|
+
void 0
|
|
2049
|
+
);
|
|
2050
|
+
for (let c = 0; c < u; c++) {
|
|
2051
|
+
const d = g[c];
|
|
2052
|
+
d && (m[d.lane] = c);
|
|
2053
|
+
}
|
|
2054
|
+
for (let c = u; c < t; c++) {
|
|
2055
|
+
const d = r(c), p = this.laneAssignments.get(c);
|
|
2056
|
+
let h, w;
|
|
2057
|
+
if (p !== void 0 && this.options.lanes > 1) {
|
|
2058
|
+
h = p;
|
|
2059
|
+
const $ = m[h], I = $ !== void 0 ? g[$] : void 0;
|
|
2060
|
+
w = I ? I.end + this.options.gap : n + o;
|
|
2061
|
+
} else {
|
|
2062
|
+
const $ = this.options.lanes === 1 ? g[c - 1] : this.getFurthestMeasurement(g, c);
|
|
2063
|
+
w = $ ? $.end + this.options.gap : n + o, h = $ ? $.lane : c % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(c, h);
|
|
2064
|
+
}
|
|
2065
|
+
const S = a.get(d), v = typeof S == "number" ? S : this.options.estimateSize(c), F = w + v;
|
|
2066
|
+
g[c] = {
|
|
2067
|
+
index: c,
|
|
2068
|
+
start: w,
|
|
2069
|
+
size: v,
|
|
2070
|
+
end: F,
|
|
2071
|
+
key: d,
|
|
2072
|
+
lane: h
|
|
2073
|
+
}, m[h] = c;
|
|
2074
|
+
}
|
|
2075
|
+
return this.measurementsCache = g, g;
|
|
2076
|
+
},
|
|
2077
|
+
{
|
|
2078
|
+
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
2079
|
+
debug: () => this.options.debug
|
|
2080
|
+
}
|
|
2081
|
+
), this.calculateRange = j(
|
|
2082
|
+
() => [
|
|
2083
|
+
this.getMeasurements(),
|
|
2084
|
+
this.getSize(),
|
|
2085
|
+
this.getScrollOffset(),
|
|
2086
|
+
this.options.lanes
|
|
2087
|
+
],
|
|
2088
|
+
(t, n, o, r) => this.range = t.length > 0 && n > 0 ? Pn({
|
|
2089
|
+
measurements: t,
|
|
2090
|
+
outerSize: n,
|
|
2091
|
+
scrollOffset: o,
|
|
2092
|
+
lanes: r
|
|
2093
|
+
}) : null,
|
|
2094
|
+
{
|
|
2095
|
+
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
2096
|
+
debug: () => this.options.debug
|
|
2097
|
+
}
|
|
2098
|
+
), this.getVirtualIndexes = j(
|
|
2099
|
+
() => {
|
|
2100
|
+
let t = null, n = null;
|
|
2101
|
+
const o = this.calculateRange();
|
|
2102
|
+
return o && (t = o.startIndex, n = o.endIndex), this.maybeNotify.updateDeps([this.isScrolling, t, n]), [
|
|
2103
|
+
this.options.rangeExtractor,
|
|
2104
|
+
this.options.overscan,
|
|
2105
|
+
this.options.count,
|
|
2106
|
+
t,
|
|
2107
|
+
n
|
|
2108
|
+
];
|
|
2109
|
+
},
|
|
2110
|
+
(t, n, o, r, s) => r === null || s === null ? [] : t({
|
|
2111
|
+
startIndex: r,
|
|
2112
|
+
endIndex: s,
|
|
2113
|
+
overscan: n,
|
|
2114
|
+
count: o
|
|
2115
|
+
}),
|
|
2116
|
+
{
|
|
2117
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
2118
|
+
debug: () => this.options.debug
|
|
2119
|
+
}
|
|
2120
|
+
), this.indexFromElement = (t) => {
|
|
2121
|
+
const n = this.options.indexAttribute, o = t.getAttribute(n);
|
|
2122
|
+
return o ? parseInt(o, 10) : (console.warn(
|
|
2123
|
+
`Missing attribute name '${n}={index}' on measured element.`
|
|
2124
|
+
), -1);
|
|
2125
|
+
}, this.shouldMeasureDuringScroll = (t) => {
|
|
2126
|
+
var n;
|
|
2127
|
+
if (!this.scrollState || this.scrollState.behavior !== "smooth")
|
|
2128
|
+
return !0;
|
|
2129
|
+
const o = this.scrollState.index ?? ((n = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : n.index);
|
|
2130
|
+
if (o !== void 0 && this.range) {
|
|
2131
|
+
const r = Math.max(
|
|
2132
|
+
this.options.overscan,
|
|
2133
|
+
Math.ceil((this.range.endIndex - this.range.startIndex) / 2)
|
|
2134
|
+
), s = Math.max(0, o - r), l = Math.min(
|
|
2135
|
+
this.options.count - 1,
|
|
2136
|
+
o + r
|
|
2137
|
+
);
|
|
2138
|
+
return t >= s && t <= l;
|
|
2139
|
+
}
|
|
2140
|
+
return !0;
|
|
2141
|
+
}, this.measureElement = (t) => {
|
|
2142
|
+
if (!t) {
|
|
2143
|
+
this.elementsCache.forEach((s, l) => {
|
|
2144
|
+
s.isConnected || (this.observer.unobserve(s), this.elementsCache.delete(l));
|
|
2145
|
+
});
|
|
2146
|
+
return;
|
|
2147
|
+
}
|
|
2148
|
+
const n = this.indexFromElement(t), o = this.options.getItemKey(n), r = this.elementsCache.get(o);
|
|
2149
|
+
r !== t && (r && this.observer.unobserve(r), this.observer.observe(t), this.elementsCache.set(o, t)), (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(n) && this.resizeItem(n, this.options.measureElement(t, void 0, this));
|
|
2150
|
+
}, this.resizeItem = (t, n) => {
|
|
2151
|
+
var o;
|
|
2152
|
+
const r = this.measurementsCache[t];
|
|
2153
|
+
if (!r) return;
|
|
2154
|
+
const s = this.itemSizeCache.get(r.key) ?? r.size, l = n - s;
|
|
2155
|
+
l !== 0 && (((o = this.scrollState) == null ? void 0 : o.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(r, l, this) : r.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", l), this._scrollToOffset(this.getScrollOffset(), {
|
|
2156
|
+
adjustments: this.scrollAdjustments += l,
|
|
2157
|
+
behavior: void 0
|
|
2158
|
+
})), this.pendingMeasuredCacheIndexes.push(r.index), this.itemSizeCache = new Map(this.itemSizeCache.set(r.key, n)), this.notify(!1));
|
|
2159
|
+
}, this.getVirtualItems = j(
|
|
2160
|
+
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
2161
|
+
(t, n) => {
|
|
2162
|
+
const o = [];
|
|
2163
|
+
for (let r = 0, s = t.length; r < s; r++) {
|
|
2164
|
+
const l = t[r], a = n[l];
|
|
2165
|
+
o.push(a);
|
|
2166
|
+
}
|
|
2167
|
+
return o;
|
|
2168
|
+
},
|
|
2169
|
+
{
|
|
2170
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
2171
|
+
debug: () => this.options.debug
|
|
2172
|
+
}
|
|
2173
|
+
), this.getVirtualItemForOffset = (t) => {
|
|
2174
|
+
const n = this.getMeasurements();
|
|
2175
|
+
if (n.length !== 0)
|
|
2176
|
+
return We(
|
|
2177
|
+
n[ft(
|
|
2178
|
+
0,
|
|
2179
|
+
n.length - 1,
|
|
2180
|
+
(o) => We(n[o]).start,
|
|
2181
|
+
t
|
|
2182
|
+
)]
|
|
2183
|
+
);
|
|
2184
|
+
}, this.getMaxScrollOffset = () => {
|
|
2185
|
+
if (!this.scrollElement) return 0;
|
|
2186
|
+
if ("scrollHeight" in this.scrollElement)
|
|
2187
|
+
return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
2188
|
+
{
|
|
2189
|
+
const t = this.scrollElement.document.documentElement;
|
|
2190
|
+
return this.options.horizontal ? t.scrollWidth - this.scrollElement.innerWidth : t.scrollHeight - this.scrollElement.innerHeight;
|
|
2191
|
+
}
|
|
2192
|
+
}, this.getOffsetForAlignment = (t, n, o = 0) => {
|
|
2193
|
+
if (!this.scrollElement) return 0;
|
|
2194
|
+
const r = this.getSize(), s = this.getScrollOffset();
|
|
2195
|
+
n === "auto" && (n = t >= s + r ? "end" : "start"), n === "center" ? t += (o - r) / 2 : n === "end" && (t -= r);
|
|
2196
|
+
const l = this.getMaxScrollOffset();
|
|
2197
|
+
return Math.max(Math.min(l, t), 0);
|
|
2198
|
+
}, this.getOffsetForIndex = (t, n = "auto") => {
|
|
2199
|
+
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
2200
|
+
const o = this.getSize(), r = this.getScrollOffset(), s = this.measurementsCache[t];
|
|
2201
|
+
if (!s) return;
|
|
2202
|
+
if (n === "auto")
|
|
2203
|
+
if (s.end >= r + o - this.options.scrollPaddingEnd)
|
|
2204
|
+
n = "end";
|
|
2205
|
+
else if (s.start <= r + this.options.scrollPaddingStart)
|
|
2206
|
+
n = "start";
|
|
2207
|
+
else
|
|
2208
|
+
return [r, n];
|
|
2209
|
+
if (n === "end" && t === this.options.count - 1)
|
|
2210
|
+
return [this.getMaxScrollOffset(), n];
|
|
2211
|
+
const l = n === "end" ? s.end + this.options.scrollPaddingEnd : s.start - this.options.scrollPaddingStart;
|
|
2212
|
+
return [
|
|
2213
|
+
this.getOffsetForAlignment(l, n, s.size),
|
|
2214
|
+
n
|
|
2215
|
+
];
|
|
2216
|
+
}, this.scrollToOffset = (t, { align: n = "start", behavior: o = "auto" } = {}) => {
|
|
2217
|
+
const r = this.getOffsetForAlignment(t, n), s = this.now();
|
|
2218
|
+
this.scrollState = {
|
|
2219
|
+
index: null,
|
|
2220
|
+
align: n,
|
|
2221
|
+
behavior: o,
|
|
2222
|
+
startedAt: s,
|
|
2223
|
+
lastTargetOffset: r,
|
|
2224
|
+
stableFrames: 0
|
|
2225
|
+
}, this._scrollToOffset(r, { adjustments: void 0, behavior: o }), this.scheduleScrollReconcile();
|
|
2226
|
+
}, this.scrollToIndex = (t, {
|
|
2227
|
+
align: n = "auto",
|
|
2228
|
+
behavior: o = "auto"
|
|
2229
|
+
} = {}) => {
|
|
2230
|
+
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
2231
|
+
const r = this.getOffsetForIndex(t, n);
|
|
2232
|
+
if (!r)
|
|
2233
|
+
return;
|
|
2234
|
+
const [s, l] = r, a = this.now();
|
|
2235
|
+
this.scrollState = {
|
|
2236
|
+
index: t,
|
|
2237
|
+
align: l,
|
|
2238
|
+
behavior: o,
|
|
2239
|
+
startedAt: a,
|
|
2240
|
+
lastTargetOffset: s,
|
|
2241
|
+
stableFrames: 0
|
|
2242
|
+
}, this._scrollToOffset(s, { adjustments: void 0, behavior: o }), this.scheduleScrollReconcile();
|
|
2243
|
+
}, this.scrollBy = (t, { behavior: n = "auto" } = {}) => {
|
|
2244
|
+
const o = this.getScrollOffset() + t, r = this.now();
|
|
2245
|
+
this.scrollState = {
|
|
2246
|
+
index: null,
|
|
2247
|
+
align: "start",
|
|
2248
|
+
behavior: n,
|
|
2249
|
+
startedAt: r,
|
|
2250
|
+
lastTargetOffset: o,
|
|
2251
|
+
stableFrames: 0
|
|
2252
|
+
}, this._scrollToOffset(o, { adjustments: void 0, behavior: n }), this.scheduleScrollReconcile();
|
|
2253
|
+
}, this.getTotalSize = () => {
|
|
2254
|
+
var t;
|
|
2255
|
+
const n = this.getMeasurements();
|
|
2256
|
+
let o;
|
|
2257
|
+
if (n.length === 0)
|
|
2258
|
+
o = this.options.paddingStart;
|
|
2259
|
+
else if (this.options.lanes === 1)
|
|
2260
|
+
o = ((t = n[n.length - 1]) == null ? void 0 : t.end) ?? 0;
|
|
2261
|
+
else {
|
|
2262
|
+
const r = Array(this.options.lanes).fill(null);
|
|
2263
|
+
let s = n.length - 1;
|
|
2264
|
+
for (; s >= 0 && r.some((l) => l === null); ) {
|
|
2265
|
+
const l = n[s];
|
|
2266
|
+
r[l.lane] === null && (r[l.lane] = l.end), s--;
|
|
2267
|
+
}
|
|
2268
|
+
o = Math.max(...r.filter((l) => l !== null));
|
|
2269
|
+
}
|
|
2270
|
+
return Math.max(
|
|
2271
|
+
o - this.options.scrollMargin + this.options.paddingEnd,
|
|
2272
|
+
0
|
|
2273
|
+
);
|
|
2274
|
+
}, this._scrollToOffset = (t, {
|
|
2275
|
+
adjustments: n,
|
|
2276
|
+
behavior: o
|
|
2277
|
+
}) => {
|
|
2278
|
+
this.options.scrollToFn(t, { behavior: o, adjustments: n }, this);
|
|
2279
|
+
}, this.measure = () => {
|
|
2280
|
+
this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.notify(!1);
|
|
2281
|
+
}, this.setOptions(i);
|
|
2282
|
+
}
|
|
2283
|
+
scheduleScrollReconcile() {
|
|
2284
|
+
if (!this.targetWindow) {
|
|
2285
|
+
this.scrollState = null;
|
|
2286
|
+
return;
|
|
2287
|
+
}
|
|
2288
|
+
this.rafId == null && (this.rafId = this.targetWindow.requestAnimationFrame(() => {
|
|
2289
|
+
this.rafId = null, this.reconcileScroll();
|
|
2290
|
+
}));
|
|
2291
|
+
}
|
|
2292
|
+
reconcileScroll() {
|
|
2293
|
+
if (!this.scrollState || !this.scrollElement) return;
|
|
2294
|
+
if (this.now() - this.scrollState.startedAt > 5e3) {
|
|
2295
|
+
this.scrollState = null;
|
|
2296
|
+
return;
|
|
2297
|
+
}
|
|
2298
|
+
const n = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, o = n ? n[0] : this.scrollState.lastTargetOffset, r = 1, s = o !== this.scrollState.lastTargetOffset;
|
|
2299
|
+
if (!s && yn(o, this.getScrollOffset())) {
|
|
2300
|
+
if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= r) {
|
|
2301
|
+
this.scrollState = null;
|
|
2302
|
+
return;
|
|
2303
|
+
}
|
|
2304
|
+
} else
|
|
2305
|
+
this.scrollState.stableFrames = 0, s && (this.scrollState.lastTargetOffset = o, this.scrollState.behavior = "auto", this._scrollToOffset(o, {
|
|
2306
|
+
adjustments: void 0,
|
|
2307
|
+
behavior: "auto"
|
|
2308
|
+
}));
|
|
2309
|
+
this.scheduleScrollReconcile();
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
const ft = (e, i, t, n) => {
|
|
2313
|
+
for (; e <= i; ) {
|
|
2314
|
+
const o = (e + i) / 2 | 0, r = t(o);
|
|
2315
|
+
if (r < n)
|
|
2316
|
+
e = o + 1;
|
|
2317
|
+
else if (r > n)
|
|
2318
|
+
i = o - 1;
|
|
2319
|
+
else
|
|
2320
|
+
return o;
|
|
2321
|
+
}
|
|
2322
|
+
return e > 0 ? e - 1 : 0;
|
|
2323
|
+
};
|
|
2324
|
+
function Pn({
|
|
2325
|
+
measurements: e,
|
|
2326
|
+
outerSize: i,
|
|
2327
|
+
scrollOffset: t,
|
|
2328
|
+
lanes: n
|
|
2329
|
+
}) {
|
|
2330
|
+
const o = e.length - 1, r = (a) => e[a].start;
|
|
2331
|
+
if (e.length <= n)
|
|
2332
|
+
return {
|
|
2333
|
+
startIndex: 0,
|
|
2334
|
+
endIndex: o
|
|
2335
|
+
};
|
|
2336
|
+
let s = ft(
|
|
2337
|
+
0,
|
|
2338
|
+
o,
|
|
2339
|
+
r,
|
|
2340
|
+
t
|
|
2341
|
+
), l = s;
|
|
2342
|
+
if (n === 1)
|
|
2343
|
+
for (; l < o && e[l].end < t + i; )
|
|
2344
|
+
l++;
|
|
2345
|
+
else if (n > 1) {
|
|
2346
|
+
const a = Array(n).fill(0);
|
|
2347
|
+
for (; l < o && a.some((g) => g < t + i); ) {
|
|
2348
|
+
const g = e[l];
|
|
2349
|
+
a[g.lane] = g.end, l++;
|
|
2350
|
+
}
|
|
2351
|
+
const u = Array(n).fill(t + i);
|
|
2352
|
+
for (; s >= 0 && u.some((g) => g >= t); ) {
|
|
2353
|
+
const g = e[s];
|
|
2354
|
+
u[g.lane] = g.start, s--;
|
|
2355
|
+
}
|
|
2356
|
+
s = Math.max(0, s - s % n), l = Math.min(o, l + (n - 1 - l % n));
|
|
2357
|
+
}
|
|
2358
|
+
return { startIndex: s, endIndex: l };
|
|
2359
|
+
}
|
|
2360
|
+
const Je = typeof document < "u" ? B.useLayoutEffect : B.useEffect;
|
|
2361
|
+
function zn({
|
|
2362
|
+
useFlushSync: e = !0,
|
|
2363
|
+
...i
|
|
2364
|
+
}) {
|
|
2365
|
+
const t = B.useReducer(() => ({}), {})[1], n = {
|
|
2366
|
+
...i,
|
|
2367
|
+
onChange: (r, s) => {
|
|
2368
|
+
var l;
|
|
2369
|
+
e && s ? _t(t) : t(), (l = i.onChange) == null || l.call(i, r, s);
|
|
2370
|
+
}
|
|
2371
|
+
}, [o] = B.useState(
|
|
2372
|
+
() => new Vn(n)
|
|
2373
|
+
);
|
|
2374
|
+
return o.setOptions(n), Je(() => o._didMount(), []), Je(() => o._willUpdate()), o;
|
|
2375
|
+
}
|
|
2376
|
+
function Nn(e) {
|
|
2377
|
+
return zn({
|
|
2378
|
+
observeElementRect: $n,
|
|
2379
|
+
observeElementOffset: In,
|
|
2380
|
+
scrollToFn: bn,
|
|
2381
|
+
...e
|
|
2382
|
+
});
|
|
2383
|
+
}
|
|
2384
|
+
function On(e) {
|
|
2385
|
+
const i = {}, t = {};
|
|
2386
|
+
let n = 0;
|
|
2387
|
+
for (const r of e)
|
|
2388
|
+
r.fixed === "left" && (i[r.key] = n, n += r.width || r.minWidth || 100);
|
|
2389
|
+
let o = 0;
|
|
2390
|
+
for (let r = e.length - 1; r >= 0; r--) {
|
|
2391
|
+
const s = e[r];
|
|
2392
|
+
s.fixed === "right" && (t[s.key] = o, o += s.width || s.minWidth || 100);
|
|
2393
|
+
}
|
|
2394
|
+
return { leftOffsets: i, rightOffsets: t };
|
|
2395
|
+
}
|
|
2396
|
+
function Jn({
|
|
2397
|
+
columns: e,
|
|
2398
|
+
data: i,
|
|
2399
|
+
rowKey: t = "id",
|
|
2400
|
+
childrenKey: n = "children",
|
|
2401
|
+
height: o,
|
|
2402
|
+
estimateRowHeight: r = 48,
|
|
2403
|
+
bordered: s = !1,
|
|
2404
|
+
striped: l = !1,
|
|
2405
|
+
emptyText: a = "暂无数据",
|
|
2406
|
+
selectable: u = !1,
|
|
2407
|
+
onSelectionChange: g,
|
|
2408
|
+
onSortChange: m,
|
|
2409
|
+
onRowClick: c,
|
|
2410
|
+
rowClassName: d,
|
|
2411
|
+
loading: p = !1,
|
|
2412
|
+
className: h = ""
|
|
2413
|
+
}) {
|
|
2414
|
+
const [w, S] = q([]), [v, F] = q({}), [$, I] = q({}), P = yt(null), ne = W(
|
|
2415
|
+
(R) => {
|
|
2416
|
+
S((y) => {
|
|
2417
|
+
const M = typeof R == "function" ? R(y) : R;
|
|
2418
|
+
return m == null || m(M), M;
|
|
2419
|
+
});
|
|
2420
|
+
},
|
|
2421
|
+
[m]
|
|
2422
|
+
), ie = W(
|
|
2423
|
+
(R) => {
|
|
2424
|
+
I((y) => typeof R == "function" ? R(y) : R);
|
|
2425
|
+
},
|
|
2426
|
+
[]
|
|
2427
|
+
), { leftOffsets: X, rightOffsets: J } = se(() => On(e), [e]), O = se(() => {
|
|
2428
|
+
const R = [];
|
|
2429
|
+
u && R.push({
|
|
2430
|
+
id: "__selection",
|
|
2431
|
+
size: 48,
|
|
2432
|
+
minSize: 48,
|
|
2433
|
+
enableSorting: !1,
|
|
2434
|
+
header: ({ table: y }) => /* @__PURE__ */ f(
|
|
2435
|
+
"input",
|
|
2436
|
+
{
|
|
2437
|
+
type: "checkbox",
|
|
2438
|
+
className: "em-table-checkbox",
|
|
2439
|
+
checked: y.getIsAllRowsSelected(),
|
|
2440
|
+
onChange: y.getToggleAllRowsSelectedHandler(),
|
|
2441
|
+
"aria-label": "全选"
|
|
2442
|
+
}
|
|
2443
|
+
),
|
|
2444
|
+
cell: ({ row: y }) => /* @__PURE__ */ f(
|
|
2445
|
+
"input",
|
|
2446
|
+
{
|
|
2447
|
+
type: "checkbox",
|
|
2448
|
+
className: "em-table-checkbox",
|
|
2449
|
+
checked: y.getIsSelected(),
|
|
2450
|
+
onChange: y.getToggleSelectedHandler(),
|
|
2451
|
+
onClick: (M) => M.stopPropagation(),
|
|
2452
|
+
"aria-label": "选择行"
|
|
2453
|
+
}
|
|
2454
|
+
)
|
|
2455
|
+
});
|
|
2456
|
+
for (const y of e)
|
|
2457
|
+
R.push({
|
|
2458
|
+
id: y.key,
|
|
2459
|
+
accessorKey: y.key,
|
|
2460
|
+
header: y.title,
|
|
2461
|
+
size: y.width,
|
|
2462
|
+
minSize: y.minWidth || 80,
|
|
2463
|
+
enableSorting: y.sortable ?? !1,
|
|
2464
|
+
cell: (M) => {
|
|
2465
|
+
var Ge;
|
|
2466
|
+
const A = M.getValue(), he = M.row.original, xt = M.row.index, me = ((Ge = e[0]) == null ? void 0 : Ge.key) === y.key, Le = me && M.row.getCanExpand();
|
|
2467
|
+
return /* @__PURE__ */ _("div", { className: "flex items-center gap-1", style: { paddingLeft: me ? `${M.row.depth * 20}px` : void 0 }, children: [
|
|
2468
|
+
Le && /* @__PURE__ */ f(
|
|
2469
|
+
"button",
|
|
2470
|
+
{
|
|
2471
|
+
className: "em-table-expand-btn",
|
|
2472
|
+
onClick: (Rt) => {
|
|
2473
|
+
Rt.stopPropagation(), M.row.toggleExpanded();
|
|
2474
|
+
},
|
|
2475
|
+
"aria-label": M.row.getIsExpanded() ? "收起" : "展开",
|
|
2476
|
+
children: /* @__PURE__ */ f("svg", { className: `w-4 h-4 transition-transform ${M.row.getIsExpanded() ? "rotate-90" : ""}`, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ f("path", { fillRule: "evenodd", d: "M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z", clipRule: "evenodd" }) })
|
|
2477
|
+
}
|
|
2478
|
+
),
|
|
2479
|
+
me && !Le && M.row.depth > 0 && /* @__PURE__ */ f("span", { className: "w-4" }),
|
|
2480
|
+
/* @__PURE__ */ f("span", { className: `truncate ${y.align === "center" ? "text-center w-full" : y.align === "right" ? "text-right w-full" : ""}`, children: y.render ? y.render(A, he, xt) : A ?? "-" })
|
|
2481
|
+
] });
|
|
2482
|
+
}
|
|
2483
|
+
});
|
|
2484
|
+
return R;
|
|
2485
|
+
}, [e, u]), oe = Rn({
|
|
2486
|
+
data: i,
|
|
2487
|
+
columns: O,
|
|
2488
|
+
state: { sorting: w, expanded: v, rowSelection: $ },
|
|
2489
|
+
onSortingChange: ne,
|
|
2490
|
+
onExpandedChange: F,
|
|
2491
|
+
onRowSelectionChange: ie,
|
|
2492
|
+
getRowId: (R) => String(R[t] ?? ""),
|
|
2493
|
+
getSubRows: (R) => R[n],
|
|
2494
|
+
getCoreRowModel: hn(),
|
|
2495
|
+
getSortedRowModel: vn(),
|
|
2496
|
+
getExpandedRowModel: mn(),
|
|
2497
|
+
enableRowSelection: u
|
|
2498
|
+
}), Ne = se(() => u ? oe.getSelectedRowModel().rows.map((R) => R.original) : [], [oe, u, $]);
|
|
2499
|
+
se(() => {
|
|
2500
|
+
u && g && g(Ne);
|
|
2501
|
+
}, [Ne]);
|
|
2502
|
+
const { rows: re } = oe.getRowModel(), Oe = Nn({
|
|
2503
|
+
count: re.length,
|
|
2504
|
+
getScrollElement: () => P.current,
|
|
2505
|
+
estimateSize: () => r,
|
|
2506
|
+
overscan: 10,
|
|
2507
|
+
enabled: !!o
|
|
2508
|
+
}), St = W((R, y) => {
|
|
2509
|
+
const M = ["em-table-row", l && y % 2 === 1 ? "em-table-row--striped" : "", c ? "cursor-pointer" : ""];
|
|
2510
|
+
return typeof d == "function" ? M.push(d(R.original, y)) : d && M.push(d), M.filter(Boolean).join(" ");
|
|
2511
|
+
}, [l, c, d]), Ae = (R) => R in X ? { position: "sticky", left: X[R], zIndex: 1 } : R in J ? { position: "sticky", right: J[R], zIndex: 1 } : {}, De = (R) => R in X ? "em-table-cell--sticky-left" : R in J ? "em-table-cell--sticky-right" : "", vt = () => /* @__PURE__ */ f("thead", { className: "em-table-thead", children: oe.getHeaderGroups().map((R) => /* @__PURE__ */ f("tr", { children: R.headers.map((y) => {
|
|
2512
|
+
const M = e.find((A) => A.key === y.id);
|
|
2513
|
+
return /* @__PURE__ */ f(
|
|
2514
|
+
"th",
|
|
2515
|
+
{
|
|
2516
|
+
className: `em-table-th ${De(y.id)} ${y.column.getCanSort() ? "cursor-pointer select-none" : ""}`,
|
|
2517
|
+
style: { width: y.getSize(), minWidth: y.column.columnDef.minSize, textAlign: (M == null ? void 0 : M.align) || "left", ...Ae(y.id) },
|
|
2518
|
+
onClick: y.column.getToggleSortingHandler(),
|
|
2519
|
+
children: /* @__PURE__ */ _("div", { className: "flex items-center gap-1", children: [
|
|
2520
|
+
qe(y.column.columnDef.header, y.getContext()),
|
|
2521
|
+
y.column.getCanSort() && /* @__PURE__ */ f("span", { className: "em-table-sort-icon", children: { asc: "↑", desc: "↓" }[y.column.getIsSorted()] ?? "↕" })
|
|
2522
|
+
] })
|
|
2523
|
+
},
|
|
2524
|
+
y.id
|
|
2525
|
+
);
|
|
2526
|
+
}) }, R.id)) }), He = (R, y) => /* @__PURE__ */ f("tr", { className: St(R, y), onClick: () => c == null ? void 0 : c(R.original), children: R.getVisibleCells().map((M) => {
|
|
2527
|
+
const A = e.find((he) => he.key === M.column.id);
|
|
2528
|
+
return /* @__PURE__ */ f(
|
|
2529
|
+
"td",
|
|
2530
|
+
{
|
|
2531
|
+
className: `em-table-td ${De(M.column.id)}`,
|
|
2532
|
+
style: { width: M.column.getSize(), minWidth: M.column.columnDef.minSize, textAlign: (A == null ? void 0 : A.align) || "left", ...Ae(M.column.id) },
|
|
2533
|
+
children: qe(M.column.columnDef.cell, M.getContext())
|
|
2534
|
+
},
|
|
2535
|
+
M.id
|
|
2536
|
+
);
|
|
2537
|
+
}) }, R.id), wt = () => {
|
|
2538
|
+
const R = Oe.getVirtualItems(), y = Oe.getTotalSize();
|
|
2539
|
+
return /* @__PURE__ */ f("tbody", { children: R.length === 0 ? /* @__PURE__ */ f("tr", { children: /* @__PURE__ */ f("td", { colSpan: O.length, className: "em-table-empty", children: a }) }) : /* @__PURE__ */ _(Ze, { children: [
|
|
2540
|
+
R[0].start > 0 && /* @__PURE__ */ f("tr", { children: /* @__PURE__ */ f("td", { colSpan: O.length, style: { height: R[0].start } }) }),
|
|
2541
|
+
R.map((M) => He(re[M.index], M.index)),
|
|
2542
|
+
R[R.length - 1].end < y && /* @__PURE__ */ f("tr", { children: /* @__PURE__ */ f("td", { colSpan: O.length, style: { height: y - R[R.length - 1].end } }) })
|
|
2543
|
+
] }) });
|
|
2544
|
+
}, Ct = () => /* @__PURE__ */ f("tbody", { children: re.length === 0 ? /* @__PURE__ */ f("tr", { children: /* @__PURE__ */ f("td", { colSpan: O.length, className: "em-table-empty", children: a }) }) : re.map((R, y) => He(R, y)) });
|
|
2545
|
+
return /* @__PURE__ */ _("div", { className: `em-table-wrapper ${s ? "em-table--bordered" : ""} ${h}`, children: [
|
|
2546
|
+
p && /* @__PURE__ */ f("div", { className: "em-table-loading", children: /* @__PURE__ */ f("div", { className: "em-table-loading-spinner" }) }),
|
|
2547
|
+
/* @__PURE__ */ f(
|
|
2548
|
+
"div",
|
|
2549
|
+
{
|
|
2550
|
+
ref: P,
|
|
2551
|
+
className: "em-table-container",
|
|
2552
|
+
style: o ? { height: o, overflow: "auto" } : { overflow: "auto" },
|
|
2553
|
+
children: /* @__PURE__ */ _("table", { className: "em-table", children: [
|
|
2554
|
+
vt(),
|
|
2555
|
+
o ? wt() : Ct()
|
|
2556
|
+
] })
|
|
2557
|
+
}
|
|
2558
|
+
)
|
|
2559
|
+
] });
|
|
2560
|
+
}
|
|
2561
|
+
function Qn({
|
|
2562
|
+
total: e,
|
|
2563
|
+
pageIndex: i,
|
|
2564
|
+
pageSize: t,
|
|
2565
|
+
pageSizes: n = [10, 20, 50, 100],
|
|
2566
|
+
onChange: o,
|
|
2567
|
+
onPageSizeChange: r,
|
|
2568
|
+
className: s = ""
|
|
2569
|
+
}) {
|
|
2570
|
+
if (e <= 0) return null;
|
|
2571
|
+
const l = Math.ceil(e / t), a = () => {
|
|
2572
|
+
const u = [];
|
|
2573
|
+
if (l <= 7)
|
|
2574
|
+
for (let g = 1; g <= l; g++) u.push(g);
|
|
2575
|
+
else {
|
|
2576
|
+
u.push(1), i > 4 && u.push("ellipsis-left");
|
|
2577
|
+
const g = Math.max(2, i - 2), m = Math.min(l - 1, i + 2);
|
|
2578
|
+
for (let c = g; c <= m; c++) u.push(c);
|
|
2579
|
+
i < l - 3 && u.push("ellipsis-right"), u.push(l);
|
|
2580
|
+
}
|
|
2581
|
+
return u;
|
|
2582
|
+
};
|
|
2583
|
+
return /* @__PURE__ */ _("div", { className: `em-pagination ${s}`, children: [
|
|
2584
|
+
/* @__PURE__ */ _("span", { className: "em-pagination-total", children: [
|
|
2585
|
+
"共 ",
|
|
2586
|
+
e,
|
|
2587
|
+
" 条"
|
|
2588
|
+
] }),
|
|
2589
|
+
r && /* @__PURE__ */ f(
|
|
2590
|
+
"select",
|
|
2591
|
+
{
|
|
2592
|
+
value: t,
|
|
2593
|
+
onChange: (u) => r(Number(u.target.value)),
|
|
2594
|
+
className: "em-pagination-size-select",
|
|
2595
|
+
children: n.map((u) => /* @__PURE__ */ _("option", { value: u, children: [
|
|
2596
|
+
u,
|
|
2597
|
+
"条/页"
|
|
2598
|
+
] }, u))
|
|
2599
|
+
}
|
|
2600
|
+
),
|
|
2601
|
+
/* @__PURE__ */ _("div", { className: "em-pagination-pages", children: [
|
|
2602
|
+
/* @__PURE__ */ f(
|
|
2603
|
+
"button",
|
|
2604
|
+
{
|
|
2605
|
+
className: "em-pagination-btn",
|
|
2606
|
+
disabled: i <= 1,
|
|
2607
|
+
onClick: () => o(i - 1),
|
|
2608
|
+
"aria-label": "上一页",
|
|
2609
|
+
children: "‹"
|
|
2610
|
+
}
|
|
2611
|
+
),
|
|
2612
|
+
a().map(
|
|
2613
|
+
(u, g) => typeof u == "string" ? /* @__PURE__ */ f("span", { className: "em-pagination-ellipsis", children: "…" }, u + g) : /* @__PURE__ */ f(
|
|
2614
|
+
"button",
|
|
2615
|
+
{
|
|
2616
|
+
className: `em-pagination-btn ${u === i ? "em-pagination-btn--active" : ""}`,
|
|
2617
|
+
onClick: () => o(u),
|
|
2618
|
+
children: u
|
|
2619
|
+
},
|
|
2620
|
+
u
|
|
2621
|
+
)
|
|
2622
|
+
),
|
|
2623
|
+
/* @__PURE__ */ f(
|
|
2624
|
+
"button",
|
|
2625
|
+
{
|
|
2626
|
+
className: "em-pagination-btn",
|
|
2627
|
+
disabled: i >= l,
|
|
2628
|
+
onClick: () => o(i + 1),
|
|
2629
|
+
"aria-label": "下一页",
|
|
2630
|
+
children: "›"
|
|
2631
|
+
}
|
|
2632
|
+
)
|
|
2633
|
+
] })
|
|
2634
|
+
] });
|
|
2635
|
+
}
|
|
2636
|
+
function Yn({
|
|
2637
|
+
actions: e,
|
|
2638
|
+
search: i,
|
|
2639
|
+
footer: t,
|
|
2640
|
+
children: n,
|
|
2641
|
+
className: o = "",
|
|
2642
|
+
noPadding: r = !1
|
|
2643
|
+
}) {
|
|
2644
|
+
return /* @__PURE__ */ _("div", { className: `em-grid ${o}`, children: [
|
|
2645
|
+
(e || i) && /* @__PURE__ */ _("div", { className: "em-grid-toolbar", style: { display: "flex", alignItems: "center", justifyContent: "space-between", padding: "8px 12px", background: "#f8f8f8", borderBottom: "1px solid #e1e4eb", position: "relative" }, children: [
|
|
2646
|
+
e && /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: e }),
|
|
2647
|
+
i && /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: i })
|
|
2648
|
+
] }),
|
|
2649
|
+
/* @__PURE__ */ f("div", { className: "em-grid-body", style: { padding: r ? 0 : "12px" }, children: n }),
|
|
2650
|
+
t && /* @__PURE__ */ f("div", { className: "em-grid-footer", style: { padding: "8px 12px", textAlign: "center", borderTop: "1px solid #e1e4eb", background: "#f6f6f6", fontSize: "14px", color: "#6b7280" }, children: t })
|
|
2651
|
+
] });
|
|
2652
|
+
}
|
|
2653
|
+
function pt(e) {
|
|
2654
|
+
var i, t, n = "";
|
|
2655
|
+
if (typeof e == "string" || typeof e == "number") n += e;
|
|
2656
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
2657
|
+
var o = e.length;
|
|
2658
|
+
for (i = 0; i < o; i++) e[i] && (t = pt(e[i])) && (n && (n += " "), n += t);
|
|
2659
|
+
} else for (t in e) e[t] && (n && (n += " "), n += t);
|
|
2660
|
+
return n;
|
|
2661
|
+
}
|
|
2662
|
+
function An() {
|
|
2663
|
+
for (var e, i, t = 0, n = "", o = arguments.length; t < o; t++) (e = arguments[t]) && (i = pt(e)) && (n && (n += " "), n += i);
|
|
2664
|
+
return n;
|
|
2665
|
+
}
|
|
2666
|
+
function Dn(...e) {
|
|
2667
|
+
return An(e);
|
|
2668
|
+
}
|
|
2669
|
+
const Hn = {
|
|
2670
|
+
default: "#d2d6de",
|
|
2671
|
+
primary: "#3c8dbc",
|
|
2672
|
+
info: "#00c0ef",
|
|
2673
|
+
danger: "#dd4b39",
|
|
2674
|
+
warning: "#f39c12",
|
|
2675
|
+
success: "#00a65a",
|
|
2676
|
+
simple: "transparent"
|
|
2677
|
+
};
|
|
2678
|
+
function Zn({
|
|
2679
|
+
theme: e = "default",
|
|
2680
|
+
title: i,
|
|
2681
|
+
showClose: t = !1,
|
|
2682
|
+
noPadding: n = !1,
|
|
2683
|
+
fixtop: o,
|
|
2684
|
+
bodyStyle: r = {},
|
|
2685
|
+
tabs: s = [],
|
|
2686
|
+
header: l,
|
|
2687
|
+
tools: a,
|
|
2688
|
+
breadcrumb: u,
|
|
2689
|
+
footer: g,
|
|
2690
|
+
children: m,
|
|
2691
|
+
onClose: c,
|
|
2692
|
+
onTabClick: d,
|
|
2693
|
+
className: p = ""
|
|
2694
|
+
}) {
|
|
2695
|
+
const h = i || l || a || t, w = { ...r };
|
|
2696
|
+
if (o && o > 0) {
|
|
2697
|
+
const S = typeof window < "u" ? window.innerHeight : 800;
|
|
2698
|
+
w.height = `${S - o}px`, w.overflow = "auto";
|
|
2699
|
+
}
|
|
2700
|
+
return /* @__PURE__ */ _("div", { className: Dn("box", p), style: {
|
|
2701
|
+
borderRadius: "2px",
|
|
2702
|
+
background: "#fff",
|
|
2703
|
+
borderTop: `3px solid ${Hn[e]}`,
|
|
2704
|
+
marginBottom: "10px",
|
|
2705
|
+
boxShadow: "0 1px 1px rgba(0,0,0,0.1)"
|
|
2706
|
+
}, children: [
|
|
2707
|
+
h && /* @__PURE__ */ _("div", { style: { borderBottom: "1px solid #f4f4f4", color: "#444", position: "relative" }, children: [
|
|
2708
|
+
i && /* @__PURE__ */ f("h3", { style: { fontSize: "18px", margin: 0, padding: "10px 0 10px 15px", lineHeight: 1, fontWeight: 600 }, dangerouslySetInnerHTML: { __html: i } }),
|
|
2709
|
+
s.map((S, v) => /* @__PURE__ */ f(
|
|
2710
|
+
"h3",
|
|
2711
|
+
{
|
|
2712
|
+
style: { cursor: "pointer", padding: "10px 12px", margin: 0, fontSize: "14px", fontWeight: 400, display: "inline-block", borderBottom: S.active ? "2px solid #3c8dbc" : "none" },
|
|
2713
|
+
onClick: () => d == null ? void 0 : d(S),
|
|
2714
|
+
dangerouslySetInnerHTML: { __html: S.title }
|
|
2715
|
+
},
|
|
2716
|
+
v
|
|
2717
|
+
)),
|
|
2718
|
+
l,
|
|
2719
|
+
(a || t) && /* @__PURE__ */ _("div", { style: { position: "absolute", right: "10px", top: 0 }, children: [
|
|
2720
|
+
a,
|
|
2721
|
+
t && /* @__PURE__ */ f("button", { onClick: c, style: { padding: "4px", marginRight: "4px", fontSize: "14px", background: "transparent", border: "none", color: "#97a0b3", cursor: "pointer" }, children: "✕" })
|
|
2722
|
+
] })
|
|
2723
|
+
] }),
|
|
2724
|
+
/* @__PURE__ */ f("div", { style: { padding: n ? 0 : "16px", ...w }, children: m }),
|
|
2725
|
+
g && /* @__PURE__ */ f("div", { style: { borderTop: "1px solid #f4f4f4", background: "#fff", padding: "8px", borderRadius: "0 0 2px 2px" }, children: g })
|
|
2726
|
+
] });
|
|
2727
|
+
}
|
|
2728
|
+
const Ln = {
|
|
2729
|
+
sm: "max-w-sm",
|
|
2730
|
+
md: "max-w-md",
|
|
2731
|
+
lg: "max-w-lg",
|
|
2732
|
+
xl: "max-w-xl"
|
|
2733
|
+
};
|
|
2734
|
+
function ei({
|
|
2735
|
+
open: e,
|
|
2736
|
+
onClose: i,
|
|
2737
|
+
title: t,
|
|
2738
|
+
children: n,
|
|
2739
|
+
footer: o,
|
|
2740
|
+
maskClosable: r = !0,
|
|
2741
|
+
size: s = "md",
|
|
2742
|
+
className: l = ""
|
|
2743
|
+
}) {
|
|
2744
|
+
return /* @__PURE__ */ f(G, { appear: !0, show: e, as: L, children: /* @__PURE__ */ _(U, { as: "div", className: "relative z-[9990]", onClose: r ? i : () => {
|
|
2745
|
+
}, children: [
|
|
2746
|
+
/* @__PURE__ */ f(
|
|
2747
|
+
G.Child,
|
|
2748
|
+
{
|
|
2749
|
+
as: L,
|
|
2750
|
+
enter: "ease-out duration-200",
|
|
2751
|
+
enterFrom: "opacity-0",
|
|
2752
|
+
enterTo: "opacity-100",
|
|
2753
|
+
leave: "ease-in duration-150",
|
|
2754
|
+
leaveFrom: "opacity-100",
|
|
2755
|
+
leaveTo: "opacity-0",
|
|
2756
|
+
children: /* @__PURE__ */ f("div", { className: "fixed inset-0 bg-black/50" })
|
|
2757
|
+
}
|
|
2758
|
+
),
|
|
2759
|
+
/* @__PURE__ */ f("div", { className: "fixed inset-0 overflow-y-auto", children: /* @__PURE__ */ f("div", { className: "flex min-h-full items-center justify-center p-4", children: /* @__PURE__ */ f(
|
|
2760
|
+
G.Child,
|
|
2761
|
+
{
|
|
2762
|
+
as: L,
|
|
2763
|
+
enter: "ease-out duration-200",
|
|
2764
|
+
enterFrom: "opacity-0 scale-95",
|
|
2765
|
+
enterTo: "opacity-100 scale-100",
|
|
2766
|
+
leave: "ease-in duration-150",
|
|
2767
|
+
leaveFrom: "opacity-100 scale-100",
|
|
2768
|
+
leaveTo: "opacity-0 scale-95",
|
|
2769
|
+
children: /* @__PURE__ */ _(
|
|
2770
|
+
U.Panel,
|
|
2771
|
+
{
|
|
2772
|
+
className: `w-full ${Ln[s]} transform overflow-hidden rounded-lg bg-white shadow-xl transition-all ${l}`,
|
|
2773
|
+
children: [
|
|
2774
|
+
t && /* @__PURE__ */ _("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200", children: [
|
|
2775
|
+
/* @__PURE__ */ f(U.Title, { as: "h3", className: "text-lg font-semibold text-gray-900", children: t }),
|
|
2776
|
+
/* @__PURE__ */ f(
|
|
2777
|
+
"button",
|
|
2778
|
+
{
|
|
2779
|
+
onClick: i,
|
|
2780
|
+
className: "p-1 rounded hover:bg-gray-100 text-gray-400 hover:text-gray-600",
|
|
2781
|
+
children: /* @__PURE__ */ f(nt, { size: 20 })
|
|
2782
|
+
}
|
|
2783
|
+
)
|
|
2784
|
+
] }),
|
|
2785
|
+
/* @__PURE__ */ f("div", { className: "px-6 py-4", children: n }),
|
|
2786
|
+
o && /* @__PURE__ */ f("div", { className: "px-6 py-4 bg-gray-50 border-t border-gray-200 flex justify-end gap-3", children: o })
|
|
2787
|
+
]
|
|
2788
|
+
}
|
|
2789
|
+
)
|
|
2790
|
+
}
|
|
2791
|
+
) }) })
|
|
2792
|
+
] }) });
|
|
2793
|
+
}
|
|
2794
|
+
const Gn = {
|
|
2795
|
+
sm: "max-w-sm",
|
|
2796
|
+
md: "max-w-md",
|
|
2797
|
+
lg: "max-w-2xl",
|
|
2798
|
+
xl: "max-w-4xl",
|
|
2799
|
+
full: "max-w-full"
|
|
2800
|
+
};
|
|
2801
|
+
function ti({
|
|
2802
|
+
open: e,
|
|
2803
|
+
onClose: i,
|
|
2804
|
+
title: t,
|
|
2805
|
+
children: n,
|
|
2806
|
+
footer: o,
|
|
2807
|
+
size: r = "md",
|
|
2808
|
+
maskClosable: s = !0,
|
|
2809
|
+
className: l = ""
|
|
2810
|
+
}) {
|
|
2811
|
+
return /* @__PURE__ */ f(G, { appear: !0, show: e, as: L, children: /* @__PURE__ */ _(U, { as: "div", className: "relative z-[9990]", onClose: s ? i : () => {
|
|
2812
|
+
}, children: [
|
|
2813
|
+
/* @__PURE__ */ f(
|
|
2814
|
+
G.Child,
|
|
2815
|
+
{
|
|
2816
|
+
as: L,
|
|
2817
|
+
enter: "ease-out duration-300",
|
|
2818
|
+
enterFrom: "opacity-0",
|
|
2819
|
+
enterTo: "opacity-100",
|
|
2820
|
+
leave: "ease-in duration-200",
|
|
2821
|
+
leaveFrom: "opacity-100",
|
|
2822
|
+
leaveTo: "opacity-0",
|
|
2823
|
+
children: /* @__PURE__ */ f("div", { className: "fixed inset-0 bg-black/50" })
|
|
2824
|
+
}
|
|
2825
|
+
),
|
|
2826
|
+
/* @__PURE__ */ f("div", { className: "fixed inset-0 overflow-hidden", children: /* @__PURE__ */ f("div", { className: "absolute inset-0 overflow-hidden", children: /* @__PURE__ */ f("div", { className: "pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10", children: /* @__PURE__ */ f(
|
|
2827
|
+
G.Child,
|
|
2828
|
+
{
|
|
2829
|
+
as: L,
|
|
2830
|
+
enter: "transform transition ease-out duration-300",
|
|
2831
|
+
enterFrom: "translate-x-full",
|
|
2832
|
+
enterTo: "translate-x-0",
|
|
2833
|
+
leave: "transform transition ease-in duration-200",
|
|
2834
|
+
leaveFrom: "translate-x-0",
|
|
2835
|
+
leaveTo: "translate-x-full",
|
|
2836
|
+
children: /* @__PURE__ */ f(
|
|
2837
|
+
U.Panel,
|
|
2838
|
+
{
|
|
2839
|
+
className: `pointer-events-auto w-screen ${Gn[r]} ${l}`,
|
|
2840
|
+
children: /* @__PURE__ */ _("div", { className: "flex h-full flex-col bg-white shadow-xl", children: [
|
|
2841
|
+
t && /* @__PURE__ */ _("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200", children: [
|
|
2842
|
+
/* @__PURE__ */ f(U.Title, { as: "h3", className: "text-lg font-semibold text-gray-900", children: t }),
|
|
2843
|
+
/* @__PURE__ */ f(
|
|
2844
|
+
"button",
|
|
2845
|
+
{
|
|
2846
|
+
onClick: i,
|
|
2847
|
+
className: "p-1 rounded hover:bg-gray-100 text-gray-400 hover:text-gray-600",
|
|
2848
|
+
children: /* @__PURE__ */ f(nt, { size: 20 })
|
|
2849
|
+
}
|
|
2850
|
+
)
|
|
2851
|
+
] }),
|
|
2852
|
+
/* @__PURE__ */ f("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: n }),
|
|
2853
|
+
o && /* @__PURE__ */ f("div", { className: "px-6 py-4 bg-gray-50 border-t border-gray-200 flex justify-center gap-3", children: o })
|
|
2854
|
+
] })
|
|
2855
|
+
}
|
|
2856
|
+
)
|
|
2857
|
+
}
|
|
2858
|
+
) }) }) })
|
|
2859
|
+
] }) });
|
|
2860
|
+
}
|
|
2861
|
+
const kn = et(
|
|
2862
|
+
({ variant: e = "default", size: i = "md", loading: t, children: n, className: o = "", disabled: r, icon: s, type: l = "button", ...a }, u) => {
|
|
2863
|
+
const g = "inline-flex items-center justify-center font-medium rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary", m = {
|
|
2864
|
+
primary: "bg-primary text-white hover:bg-primary/90 disabled:bg-primary/50",
|
|
2865
|
+
default: "bg-white text-gray-700 border border-gray-300 hover:bg-gray-50 disabled:bg-gray-50",
|
|
2866
|
+
danger: "bg-red-600 text-white hover:bg-red-700 disabled:bg-red-400",
|
|
2867
|
+
text: "text-primary hover:bg-primary/10 disabled:bg-transparent"
|
|
2868
|
+
}, c = {
|
|
2869
|
+
sm: "px-3 py-1.5 text-sm gap-1.5",
|
|
2870
|
+
md: "px-4 py-2 text-sm gap-2",
|
|
2871
|
+
lg: "px-6 py-3 text-base gap-2"
|
|
2872
|
+
};
|
|
2873
|
+
return /* @__PURE__ */ _(
|
|
2874
|
+
"button",
|
|
2875
|
+
{
|
|
2876
|
+
ref: u,
|
|
2877
|
+
type: l,
|
|
2878
|
+
className: `${g} ${m[e]} ${c[i]} ${o}`,
|
|
2879
|
+
disabled: r || t,
|
|
2880
|
+
...a,
|
|
2881
|
+
children: [
|
|
2882
|
+
t && /* @__PURE__ */ _("svg", { className: "animate-spin h-4 w-4", viewBox: "0 0 24 24", children: [
|
|
2883
|
+
/* @__PURE__ */ f("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", fill: "none" }),
|
|
2884
|
+
/* @__PURE__ */ f("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
|
|
2885
|
+
] }),
|
|
2886
|
+
s && /* @__PURE__ */ f("span", { className: "inline-flex", children: s }),
|
|
2887
|
+
n
|
|
2888
|
+
]
|
|
2889
|
+
}
|
|
2890
|
+
);
|
|
2891
|
+
}
|
|
2892
|
+
);
|
|
2893
|
+
kn.displayName = "EmButton";
|
|
2894
|
+
const Tn = et(
|
|
2895
|
+
({ label: e, error: i, prefix: t, suffix: n, className: o = "", allowClear: r, showCount: s, maxLength: l, value: a, onChange: u, onPressEnter: g, ...m }, c) => {
|
|
2896
|
+
const d = () => {
|
|
2897
|
+
u && u({ target: { value: "" } });
|
|
2898
|
+
};
|
|
2899
|
+
return /* @__PURE__ */ _("div", { className: "w-full", children: [
|
|
2900
|
+
e && /* @__PURE__ */ f("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: e }),
|
|
2901
|
+
/* @__PURE__ */ _("div", { className: "relative", children: [
|
|
2902
|
+
t && /* @__PURE__ */ f("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-gray-400", children: t }),
|
|
2903
|
+
/* @__PURE__ */ f(
|
|
2904
|
+
"input",
|
|
2905
|
+
{
|
|
2906
|
+
ref: c,
|
|
2907
|
+
value: a,
|
|
2908
|
+
maxLength: l,
|
|
2909
|
+
onChange: u,
|
|
2910
|
+
onKeyDown: (h) => {
|
|
2911
|
+
h.key === "Enter" && g && g();
|
|
2912
|
+
},
|
|
2913
|
+
className: `w-full px-3 py-2 text-sm border rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-primary/50 ${i ? "border-red-500 focus:border-red-500" : "border-gray-300 focus:border-primary"} ${t ? "pl-10" : ""} ${n || r ? "pr-10" : ""} ${o}`,
|
|
2914
|
+
...m
|
|
2915
|
+
}
|
|
2916
|
+
),
|
|
2917
|
+
s && l && /* @__PURE__ */ _("div", { className: "absolute inset-y-0 right-3 flex items-center pointer-events-none text-gray-400 text-xs", children: [
|
|
2918
|
+
String(a || "").length,
|
|
2919
|
+
"/",
|
|
2920
|
+
l
|
|
2921
|
+
] }),
|
|
2922
|
+
r && a && /* @__PURE__ */ f(
|
|
2923
|
+
"button",
|
|
2924
|
+
{
|
|
2925
|
+
type: "button",
|
|
2926
|
+
onClick: d,
|
|
2927
|
+
className: "absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600",
|
|
2928
|
+
children: /* @__PURE__ */ f("span", { className: "text-xs", children: "×" })
|
|
2929
|
+
}
|
|
2930
|
+
),
|
|
2931
|
+
n && !r && /* @__PURE__ */ f("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none text-gray-400", children: n })
|
|
2932
|
+
] }),
|
|
2933
|
+
i && /* @__PURE__ */ f("p", { className: "mt-1 text-sm text-red-500", children: i })
|
|
2934
|
+
] });
|
|
2935
|
+
}
|
|
2936
|
+
);
|
|
2937
|
+
Tn.displayName = "EmInput";
|
|
2938
|
+
function ni(e) {
|
|
2939
|
+
const {
|
|
2940
|
+
label: i,
|
|
2941
|
+
value: t,
|
|
2942
|
+
options: n,
|
|
2943
|
+
onChange: o,
|
|
2944
|
+
placeholder: r = "请选择",
|
|
2945
|
+
error: s,
|
|
2946
|
+
disabled: l,
|
|
2947
|
+
className: a = "",
|
|
2948
|
+
style: u,
|
|
2949
|
+
mode: g
|
|
2950
|
+
} = e;
|
|
2951
|
+
if (g === "multiple") {
|
|
2952
|
+
const p = t || [], h = o, w = (v) => {
|
|
2953
|
+
p.includes(v) ? h(p.filter((F) => F !== v)) : h([...p, v]);
|
|
2954
|
+
}, S = n.filter((v) => p.includes(v.value)).map((v) => v.label);
|
|
2955
|
+
return /* @__PURE__ */ _("div", { className: `w-full ${a}`, style: u, children: [
|
|
2956
|
+
i && /* @__PURE__ */ f("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: i }),
|
|
2957
|
+
/* @__PURE__ */ f("div", { className: "relative", children: /* @__PURE__ */ f(D, { value: p, onChange: () => {
|
|
2958
|
+
}, multiple: !0, disabled: l, children: /* @__PURE__ */ _("div", { className: "relative", children: [
|
|
2959
|
+
/* @__PURE__ */ _(
|
|
2960
|
+
D.Button,
|
|
2961
|
+
{
|
|
2962
|
+
className: `relative w-full cursor-pointer rounded-md border text-left text-sm shadow-sm transition-colors focus:outline-none focus:ring-2 focus:ring-primary/50 ${s ? "border-red-500 focus:border-red-500" : "border-gray-300 focus:border-primary"} ${l ? "bg-gray-100 cursor-not-allowed" : "bg-white hover:border-gray-400"}`,
|
|
2963
|
+
children: [
|
|
2964
|
+
/* @__PURE__ */ f("span", { className: `block px-3 py-2 ${S.length ? "text-gray-900" : "text-gray-400"}`, children: S.length ? S.join("、") : r }),
|
|
2965
|
+
/* @__PURE__ */ f("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ f(ke, { size: 16, className: "text-gray-400" }) })
|
|
2966
|
+
]
|
|
2967
|
+
}
|
|
2968
|
+
),
|
|
2969
|
+
/* @__PURE__ */ f(
|
|
2970
|
+
G,
|
|
2971
|
+
{
|
|
2972
|
+
as: L,
|
|
2973
|
+
leave: "transition ease-in duration-100",
|
|
2974
|
+
leaveFrom: "opacity-100",
|
|
2975
|
+
leaveTo: "opacity-0",
|
|
2976
|
+
children: /* @__PURE__ */ f(D.Options, { className: "absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-sm shadow-lg ring-1 ring-black/5 focus:outline-none", children: n.map((v) => {
|
|
2977
|
+
const F = p.includes(v.value);
|
|
2978
|
+
return /* @__PURE__ */ _(
|
|
2979
|
+
D.Option,
|
|
2980
|
+
{
|
|
2981
|
+
value: v.value,
|
|
2982
|
+
disabled: v.disabled,
|
|
2983
|
+
onClick: () => w(v.value),
|
|
2984
|
+
className: ({ active: $ }) => `relative cursor-pointer select-none py-2 pl-10 pr-4 ${$ ? "bg-primary/10 text-primary" : "text-gray-900"} ${v.disabled ? "cursor-not-allowed opacity-50" : ""} ${F ? "bg-primary/5 font-medium" : ""}`,
|
|
2985
|
+
children: [
|
|
2986
|
+
/* @__PURE__ */ f("span", { className: `block truncate ${F ? "font-medium" : "font-normal"}`, children: v.label }),
|
|
2987
|
+
F && /* @__PURE__ */ f("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-primary", children: /* @__PURE__ */ f(Te, { size: 16 }) })
|
|
2988
|
+
]
|
|
2989
|
+
},
|
|
2990
|
+
v.value
|
|
2991
|
+
);
|
|
2992
|
+
}) })
|
|
2993
|
+
}
|
|
2994
|
+
)
|
|
2995
|
+
] }) }) }),
|
|
2996
|
+
s && /* @__PURE__ */ f("p", { className: "mt-1 text-sm text-red-500", children: s })
|
|
2997
|
+
] });
|
|
2998
|
+
}
|
|
2999
|
+
const m = t, c = o, d = n.find((p) => p.value === m);
|
|
3000
|
+
return /* @__PURE__ */ _("div", { className: `w-full ${a}`, style: u, children: [
|
|
3001
|
+
i && /* @__PURE__ */ f("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: i }),
|
|
3002
|
+
/* @__PURE__ */ f(D, { value: m, onChange: c, disabled: l, children: /* @__PURE__ */ _("div", { className: "relative", children: [
|
|
3003
|
+
/* @__PURE__ */ _(
|
|
3004
|
+
D.Button,
|
|
3005
|
+
{
|
|
3006
|
+
className: `relative w-full cursor-pointer rounded-md border text-left text-sm shadow-sm transition-colors focus:outline-none focus:ring-2 focus:ring-primary/50 ${s ? "border-red-500 focus:border-red-500" : "border-gray-300 focus:border-primary"} ${l ? "bg-gray-100 cursor-not-allowed" : "bg-white hover:border-gray-400"}`,
|
|
3007
|
+
children: [
|
|
3008
|
+
/* @__PURE__ */ f("span", { className: `block px-3 py-2 ${d ? "text-gray-900" : "text-gray-400"}`, children: (d == null ? void 0 : d.label) || r }),
|
|
3009
|
+
/* @__PURE__ */ f("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ f(ke, { size: 16, className: "text-gray-400" }) })
|
|
3010
|
+
]
|
|
3011
|
+
}
|
|
3012
|
+
),
|
|
3013
|
+
/* @__PURE__ */ f(
|
|
3014
|
+
G,
|
|
3015
|
+
{
|
|
3016
|
+
as: L,
|
|
3017
|
+
leave: "transition ease-in duration-100",
|
|
3018
|
+
leaveFrom: "opacity-100",
|
|
3019
|
+
leaveTo: "opacity-0",
|
|
3020
|
+
children: /* @__PURE__ */ f(D.Options, { className: "absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-sm shadow-lg ring-1 ring-black/5 focus:outline-none", children: n.map((p) => /* @__PURE__ */ f(
|
|
3021
|
+
D.Option,
|
|
3022
|
+
{
|
|
3023
|
+
value: p.value,
|
|
3024
|
+
disabled: p.disabled,
|
|
3025
|
+
className: ({ active: h, selected: w }) => `relative cursor-pointer select-none py-2 pl-10 pr-4 ${h ? "bg-primary/10 text-primary" : "text-gray-900"} ${p.disabled ? "cursor-not-allowed opacity-50" : ""} ${w ? "bg-primary/5 font-medium" : ""}`,
|
|
3026
|
+
children: ({ selected: h }) => /* @__PURE__ */ _(Ze, { children: [
|
|
3027
|
+
/* @__PURE__ */ f("span", { className: `block truncate ${h ? "font-medium" : "font-normal"}`, children: p.label }),
|
|
3028
|
+
h && /* @__PURE__ */ f("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-primary", children: /* @__PURE__ */ f(Te, { size: 16 }) })
|
|
3029
|
+
] })
|
|
3030
|
+
},
|
|
3031
|
+
p.value
|
|
3032
|
+
)) })
|
|
3033
|
+
}
|
|
3034
|
+
)
|
|
3035
|
+
] }) }),
|
|
3036
|
+
s && /* @__PURE__ */ f("p", { className: "mt-1 text-sm text-red-500", children: s })
|
|
3037
|
+
] });
|
|
3038
|
+
}
|
|
3039
|
+
function ii({ size: e = "md", className: i, text: t }) {
|
|
3040
|
+
const n = {
|
|
3041
|
+
sm: "w-4 h-4 border-2",
|
|
3042
|
+
md: "w-8 h-8 border-3",
|
|
3043
|
+
lg: "w-12 h-12 border-4"
|
|
3044
|
+
};
|
|
3045
|
+
return /* @__PURE__ */ _("div", { className: `flex flex-col items-center justify-center gap-2 ${i || ""}`, children: [
|
|
3046
|
+
/* @__PURE__ */ f(
|
|
3047
|
+
"div",
|
|
3048
|
+
{
|
|
3049
|
+
className: `animate-spin rounded-full border-primary border-t-transparent ${n[e]}`
|
|
3050
|
+
}
|
|
3051
|
+
),
|
|
3052
|
+
t && /* @__PURE__ */ f("p", { className: "text-sm text-gray-600", children: t })
|
|
3053
|
+
] });
|
|
3054
|
+
}
|
|
3055
|
+
let Y = [], Bn = 0, de = [];
|
|
3056
|
+
function Qe() {
|
|
3057
|
+
de.forEach((e) => e([...Y]));
|
|
3058
|
+
}
|
|
3059
|
+
function T(e, i = "info", t = 3e3) {
|
|
3060
|
+
const n = Bn++;
|
|
3061
|
+
return Y = [...Y, { id: n, message: e, type: i, duration: t }], Qe(), t > 0 && setTimeout(() => {
|
|
3062
|
+
Y = Y.filter((o) => o.id !== n), Qe();
|
|
3063
|
+
}, t), n;
|
|
3064
|
+
}
|
|
3065
|
+
T.success = (e, i) => T(e, "success", i);
|
|
3066
|
+
T.error = (e, i) => T(e, "error", i ?? 5e3);
|
|
3067
|
+
T.warning = (e, i) => T(e, "warning", i);
|
|
3068
|
+
T.info = (e, i) => T(e, "info", i);
|
|
3069
|
+
const jn = {
|
|
3070
|
+
success: $t,
|
|
3071
|
+
error: Mt,
|
|
3072
|
+
warning: it,
|
|
3073
|
+
info: Ft
|
|
3074
|
+
}, Ye = {
|
|
3075
|
+
success: "#2b9b6a",
|
|
3076
|
+
error: "#f56c6c",
|
|
3077
|
+
warning: "#e6a23c",
|
|
3078
|
+
info: "#909399"
|
|
3079
|
+
};
|
|
3080
|
+
function oi() {
|
|
3081
|
+
const [e, i] = q([]);
|
|
3082
|
+
return be(() => (de.push(i), () => {
|
|
3083
|
+
de = de.filter((t) => t !== i);
|
|
3084
|
+
}), []), e.length === 0 ? null : tt(
|
|
3085
|
+
/* @__PURE__ */ f("div", { className: "fixed top-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col items-center gap-2 pointer-events-none", children: e.map((t) => {
|
|
3086
|
+
const n = jn[t.type];
|
|
3087
|
+
return /* @__PURE__ */ _(
|
|
3088
|
+
"div",
|
|
3089
|
+
{
|
|
3090
|
+
className: "pointer-events-auto px-5 py-3 rounded-lg shadow-lg flex items-center gap-2 text-sm animate-slide-down bg-white border",
|
|
3091
|
+
style: {
|
|
3092
|
+
borderColor: `${Ye[t.type]}20`,
|
|
3093
|
+
color: "#303133",
|
|
3094
|
+
minWidth: "200px"
|
|
3095
|
+
},
|
|
3096
|
+
children: [
|
|
3097
|
+
/* @__PURE__ */ f(n, { size: 18, style: { color: Ye[t.type] } }),
|
|
3098
|
+
/* @__PURE__ */ f("span", { children: t.message })
|
|
3099
|
+
]
|
|
3100
|
+
},
|
|
3101
|
+
t.id
|
|
3102
|
+
);
|
|
3103
|
+
}) }),
|
|
3104
|
+
document.body
|
|
3105
|
+
);
|
|
3106
|
+
}
|
|
3107
|
+
function ht({ open: e, onClose: i, children: t, maskClosable: n = !0 }) {
|
|
3108
|
+
return e ? tt(
|
|
3109
|
+
/* @__PURE__ */ _("div", { className: "fixed inset-0 z-[9990] flex items-center justify-center", children: [
|
|
3110
|
+
/* @__PURE__ */ f(
|
|
3111
|
+
"div",
|
|
3112
|
+
{
|
|
3113
|
+
className: "absolute inset-0 bg-black/50 transition-opacity",
|
|
3114
|
+
onClick: n ? i : void 0
|
|
3115
|
+
}
|
|
3116
|
+
),
|
|
3117
|
+
/* @__PURE__ */ f("div", { className: "relative bg-white rounded-lg shadow-xl max-w-[420px] w-[90%] animate-scale-in", children: t })
|
|
3118
|
+
] }),
|
|
3119
|
+
document.body
|
|
3120
|
+
) : null;
|
|
3121
|
+
}
|
|
3122
|
+
let Z = null, fe = null, ge = [];
|
|
3123
|
+
function mt() {
|
|
3124
|
+
ge.forEach((e) => e(fe ? { ...fe } : null));
|
|
3125
|
+
}
|
|
3126
|
+
function K(e, i, t) {
|
|
3127
|
+
return new Promise((n) => {
|
|
3128
|
+
Z = n, fe = { message: e, title: i || "提示", type: t || "info", confirmText: "确定" }, mt();
|
|
3129
|
+
});
|
|
3130
|
+
}
|
|
3131
|
+
K.success = (e, i) => K(e, i, "success");
|
|
3132
|
+
K.error = (e, i) => K(e, i, "error");
|
|
3133
|
+
K.warning = (e, i) => K(e, i, "warning");
|
|
3134
|
+
function ri() {
|
|
3135
|
+
const [e, i] = q(null);
|
|
3136
|
+
be(() => (ge.push(i), () => {
|
|
3137
|
+
ge = ge.filter((n) => n !== i);
|
|
3138
|
+
}), []);
|
|
3139
|
+
const t = W(() => {
|
|
3140
|
+
fe = null, mt(), Z == null || Z(), Z = null;
|
|
3141
|
+
}, []);
|
|
3142
|
+
return /* @__PURE__ */ f(ht, { open: !!e, onClose: t, maskClosable: !1, children: e && /* @__PURE__ */ _("div", { className: "p-6", children: [
|
|
3143
|
+
/* @__PURE__ */ f("h3", { className: "text-base font-semibold text-gray-900 mb-2", children: e.title }),
|
|
3144
|
+
/* @__PURE__ */ f("p", { className: "text-sm text-gray-600 leading-relaxed whitespace-pre-wrap", children: e.message }),
|
|
3145
|
+
/* @__PURE__ */ f("div", { className: "flex justify-end mt-5", children: /* @__PURE__ */ f(
|
|
3146
|
+
"button",
|
|
3147
|
+
{
|
|
3148
|
+
onClick: t,
|
|
3149
|
+
className: "px-5 py-2 text-sm text-white rounded-md transition-opacity hover:opacity-90 bg-primary",
|
|
3150
|
+
children: e.confirmText
|
|
3151
|
+
}
|
|
3152
|
+
) })
|
|
3153
|
+
] }) });
|
|
3154
|
+
}
|
|
3155
|
+
let z = null, te = null, ce = [];
|
|
3156
|
+
function Ee() {
|
|
3157
|
+
ce.forEach((e) => e(te ? { ...te } : null));
|
|
3158
|
+
}
|
|
3159
|
+
function si(e, i, t) {
|
|
3160
|
+
return new Promise((n) => {
|
|
3161
|
+
z = n, te = {
|
|
3162
|
+
message: e,
|
|
3163
|
+
title: i || "确认操作",
|
|
3164
|
+
type: t || "warning",
|
|
3165
|
+
confirmText: "确定",
|
|
3166
|
+
cancelText: "取消"
|
|
3167
|
+
}, Ee();
|
|
3168
|
+
});
|
|
3169
|
+
}
|
|
3170
|
+
function li() {
|
|
3171
|
+
const [e, i] = q(null);
|
|
3172
|
+
be(() => (ce.push(i), () => {
|
|
3173
|
+
ce = ce.filter((r) => r !== i);
|
|
3174
|
+
}), []);
|
|
3175
|
+
const t = W(() => {
|
|
3176
|
+
te = null, Ee(), z == null || z(!0), z = null;
|
|
3177
|
+
}, []), n = W(() => {
|
|
3178
|
+
te = null, Ee(), z == null || z(!1), z = null;
|
|
3179
|
+
}, []);
|
|
3180
|
+
return /* @__PURE__ */ f(ht, { open: !!e, onClose: n, children: e && /* @__PURE__ */ _("div", { className: "p-6", children: [
|
|
3181
|
+
/* @__PURE__ */ _("h3", { className: "text-base font-semibold text-gray-900 mb-2 flex items-center gap-2", children: [
|
|
3182
|
+
/* @__PURE__ */ f(it, { size: 18, style: { color: {
|
|
3183
|
+
info: "#909399",
|
|
3184
|
+
success: "#2b9b6a",
|
|
3185
|
+
warning: "#e6a23c",
|
|
3186
|
+
error: "#f56c6c"
|
|
3187
|
+
}[e.type || "warning"] } }),
|
|
3188
|
+
e.title
|
|
3189
|
+
] }),
|
|
3190
|
+
/* @__PURE__ */ f("p", { className: "text-sm text-gray-600 leading-relaxed whitespace-pre-wrap ml-6", children: e.message }),
|
|
3191
|
+
/* @__PURE__ */ _("div", { className: "flex justify-end gap-3 mt-5", children: [
|
|
3192
|
+
/* @__PURE__ */ f(
|
|
3193
|
+
"button",
|
|
3194
|
+
{
|
|
3195
|
+
onClick: n,
|
|
3196
|
+
className: "px-5 py-2 text-sm text-gray-700 border border-gray-300 rounded-md hover:bg-gray-50 transition-colors",
|
|
3197
|
+
children: e.cancelText
|
|
3198
|
+
}
|
|
3199
|
+
),
|
|
3200
|
+
/* @__PURE__ */ f(
|
|
3201
|
+
"button",
|
|
3202
|
+
{
|
|
3203
|
+
onClick: t,
|
|
3204
|
+
className: "px-5 py-2 text-sm text-white rounded-md transition-opacity hover:opacity-90 bg-primary",
|
|
3205
|
+
children: e.confirmText
|
|
3206
|
+
}
|
|
3207
|
+
)
|
|
3208
|
+
] })
|
|
3209
|
+
] }) });
|
|
3210
|
+
}
|
|
3211
|
+
export {
|
|
3212
|
+
ri as AlertContainer,
|
|
3213
|
+
li as ConfirmContainer,
|
|
3214
|
+
Zn as EmBox,
|
|
3215
|
+
kn as EmButton,
|
|
3216
|
+
ti as EmDrawer,
|
|
3217
|
+
Yn as EmGrid,
|
|
3218
|
+
Tn as EmInput,
|
|
3219
|
+
ei as EmModal,
|
|
3220
|
+
Qn as EmPagination,
|
|
3221
|
+
ni as EmSelect,
|
|
3222
|
+
Jn as EmTable,
|
|
3223
|
+
ii as Loading,
|
|
3224
|
+
oi as ToastContainer,
|
|
3225
|
+
K as alert,
|
|
3226
|
+
Dn as cn,
|
|
3227
|
+
si as confirm,
|
|
3228
|
+
T as toast
|
|
3229
|
+
};
|
|
3230
|
+
//# sourceMappingURL=station-ui.js.map
|