@aimerthyr/virtual-table 1.0.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/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +105 -0
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +349 -0
- package/dist/index.js +4484 -0
- package/dist/index.js.map +1 -0
- package/dist/virtual-table.css +1 -0
- package/package.json +55 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4484 @@
|
|
|
1
|
+
import { isRef as Xn, shallowRef as Et, watch as Fe, ref as k, watchEffect as dn, defineComponent as K, h as q, unref as w, computed as R, triggerRef as kt, onScopeDispose as gn, renderSlot as L, openBlock as y, createBlock as Z, resolveDynamicComponent as It, createElementBlock as I, normalizeClass as H, createElementVNode as b, getCurrentScope as Yn, shallowReadonly as Ie, onMounted as fn, onUnmounted as Jn, Fragment as ce, Teleport as Qn, createVNode as ve, Transition as Zn, withCtx as ee, normalizeStyle as pe, createCommentVNode as Q, useSlots as pn, createSlots as Ct, normalizeProps as rt, guardReactiveProps as st, withModifiers as eo, useCssVars as hn, renderList as _e, render as mn, toDisplayString as ze, useModel as Re, onBeforeUnmount as to, nextTick as We, withDirectives as no, mergeProps as ae, createTextVNode as Ht, mergeModels as oo, mergeDefaults as io } from "vue";
|
|
2
|
+
function he(e, o) {
|
|
3
|
+
return typeof e == "function" ? e(o) : e;
|
|
4
|
+
}
|
|
5
|
+
function Y(e, o) {
|
|
6
|
+
return (t) => {
|
|
7
|
+
o.setState((n) => ({
|
|
8
|
+
...n,
|
|
9
|
+
[e]: he(t, n[e])
|
|
10
|
+
}));
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function Ze(e) {
|
|
14
|
+
return e instanceof Function;
|
|
15
|
+
}
|
|
16
|
+
function lo(e) {
|
|
17
|
+
return Array.isArray(e) && e.every((o) => typeof o == "number");
|
|
18
|
+
}
|
|
19
|
+
function ro(e, o) {
|
|
20
|
+
const t = [], n = (i) => {
|
|
21
|
+
i.forEach((l) => {
|
|
22
|
+
t.push(l);
|
|
23
|
+
const r = o(l);
|
|
24
|
+
r != null && r.length && n(r);
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
return n(e), t;
|
|
28
|
+
}
|
|
29
|
+
function _(e, o, t) {
|
|
30
|
+
let n = [], i;
|
|
31
|
+
return (l) => {
|
|
32
|
+
let r;
|
|
33
|
+
t.key && t.debug && (r = Date.now());
|
|
34
|
+
const s = e(l);
|
|
35
|
+
if (!(s.length !== n.length || s.some((c, f) => n[f] !== c)))
|
|
36
|
+
return i;
|
|
37
|
+
n = s;
|
|
38
|
+
let u;
|
|
39
|
+
if (t.key && t.debug && (u = Date.now()), i = o(...s), t == null || t.onChange == null || t.onChange(i), t.key && t.debug && t != null && t.debug()) {
|
|
40
|
+
const c = Math.round((Date.now() - r) * 100) / 100, f = Math.round((Date.now() - u) * 100) / 100, g = f / 16, d = (m, p) => {
|
|
41
|
+
for (m = String(m); m.length < p; )
|
|
42
|
+
m = " " + m;
|
|
43
|
+
return m;
|
|
44
|
+
};
|
|
45
|
+
console.info(`%c⏱ ${d(f, 5)} /${d(c, 5)} ms`, `
|
|
46
|
+
font-size: .6rem;
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * g, 120))}deg 100% 31%);`, t?.key);
|
|
49
|
+
}
|
|
50
|
+
return i;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function F(e, o, t, n) {
|
|
54
|
+
return {
|
|
55
|
+
debug: () => {
|
|
56
|
+
var i;
|
|
57
|
+
return (i = e?.debugAll) != null ? i : e[o];
|
|
58
|
+
},
|
|
59
|
+
key: process.env.NODE_ENV === "development" && t,
|
|
60
|
+
onChange: n
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function so(e, o, t, n) {
|
|
64
|
+
const i = () => {
|
|
65
|
+
var r;
|
|
66
|
+
return (r = l.getValue()) != null ? r : e.options.renderFallbackValue;
|
|
67
|
+
}, l = {
|
|
68
|
+
id: `${o.id}_${t.id}`,
|
|
69
|
+
row: o,
|
|
70
|
+
column: t,
|
|
71
|
+
getValue: () => o.getValue(n),
|
|
72
|
+
renderValue: i,
|
|
73
|
+
getContext: _(() => [e, t, o, l], (r, s, a, u) => ({
|
|
74
|
+
table: r,
|
|
75
|
+
column: s,
|
|
76
|
+
row: a,
|
|
77
|
+
cell: u,
|
|
78
|
+
getValue: u.getValue,
|
|
79
|
+
renderValue: u.renderValue
|
|
80
|
+
}), F(e.options, "debugCells", "cell.getContext"))
|
|
81
|
+
};
|
|
82
|
+
return e._features.forEach((r) => {
|
|
83
|
+
r.createCell == null || r.createCell(l, t, o, e);
|
|
84
|
+
}, {}), l;
|
|
85
|
+
}
|
|
86
|
+
function ao(e, o, t, n) {
|
|
87
|
+
var i, l;
|
|
88
|
+
const s = {
|
|
89
|
+
...e._getDefaultColumnDef(),
|
|
90
|
+
...o
|
|
91
|
+
}, a = s.accessorKey;
|
|
92
|
+
let u = (i = (l = s.id) != null ? l : a ? typeof String.prototype.replaceAll == "function" ? a.replaceAll(".", "_") : a.replace(/\./g, "_") : void 0) != null ? i : typeof s.header == "string" ? s.header : void 0, c;
|
|
93
|
+
if (s.accessorFn ? c = s.accessorFn : a && (a.includes(".") ? c = (g) => {
|
|
94
|
+
let d = g;
|
|
95
|
+
for (const p of a.split(".")) {
|
|
96
|
+
var m;
|
|
97
|
+
d = (m = d) == null ? void 0 : m[p], process.env.NODE_ENV !== "production" && d === void 0 && console.warn(`"${p}" in deeply nested key "${a}" returned undefined.`);
|
|
98
|
+
}
|
|
99
|
+
return d;
|
|
100
|
+
} : c = (g) => g[s.accessorKey]), !u)
|
|
101
|
+
throw process.env.NODE_ENV !== "production" ? new Error(s.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
|
|
102
|
+
let f = {
|
|
103
|
+
id: `${String(u)}`,
|
|
104
|
+
accessorFn: c,
|
|
105
|
+
parent: n,
|
|
106
|
+
depth: t,
|
|
107
|
+
columnDef: s,
|
|
108
|
+
columns: [],
|
|
109
|
+
getFlatColumns: _(() => [!0], () => {
|
|
110
|
+
var g;
|
|
111
|
+
return [f, ...(g = f.columns) == null ? void 0 : g.flatMap((d) => d.getFlatColumns())];
|
|
112
|
+
}, F(e.options, "debugColumns", "column.getFlatColumns")),
|
|
113
|
+
getLeafColumns: _(() => [e._getOrderColumnsFn()], (g) => {
|
|
114
|
+
var d;
|
|
115
|
+
if ((d = f.columns) != null && d.length) {
|
|
116
|
+
let m = f.columns.flatMap((p) => p.getLeafColumns());
|
|
117
|
+
return g(m);
|
|
118
|
+
}
|
|
119
|
+
return [f];
|
|
120
|
+
}, F(e.options, "debugColumns", "column.getLeafColumns"))
|
|
121
|
+
};
|
|
122
|
+
for (const g of e._features)
|
|
123
|
+
g.createColumn == null || g.createColumn(f, e);
|
|
124
|
+
return f;
|
|
125
|
+
}
|
|
126
|
+
const G = "debugHeaders";
|
|
127
|
+
function Tt(e, o, t) {
|
|
128
|
+
var n;
|
|
129
|
+
let l = {
|
|
130
|
+
id: (n = t.id) != null ? n : o.id,
|
|
131
|
+
column: o,
|
|
132
|
+
index: t.index,
|
|
133
|
+
isPlaceholder: !!t.isPlaceholder,
|
|
134
|
+
placeholderId: t.placeholderId,
|
|
135
|
+
depth: t.depth,
|
|
136
|
+
subHeaders: [],
|
|
137
|
+
colSpan: 0,
|
|
138
|
+
rowSpan: 0,
|
|
139
|
+
headerGroup: null,
|
|
140
|
+
getLeafHeaders: () => {
|
|
141
|
+
const r = [], s = (a) => {
|
|
142
|
+
a.subHeaders && a.subHeaders.length && a.subHeaders.map(s), r.push(a);
|
|
143
|
+
};
|
|
144
|
+
return s(l), r;
|
|
145
|
+
},
|
|
146
|
+
getContext: () => ({
|
|
147
|
+
table: e,
|
|
148
|
+
header: l,
|
|
149
|
+
column: o
|
|
150
|
+
})
|
|
151
|
+
};
|
|
152
|
+
return e._features.forEach((r) => {
|
|
153
|
+
r.createHeader == null || r.createHeader(l, e);
|
|
154
|
+
}), l;
|
|
155
|
+
}
|
|
156
|
+
const uo = {
|
|
157
|
+
createTable: (e) => {
|
|
158
|
+
e.getHeaderGroups = _(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, i) => {
|
|
159
|
+
var l, r;
|
|
160
|
+
const s = (l = n?.map((f) => t.find((g) => g.id === f)).filter(Boolean)) != null ? l : [], a = (r = i?.map((f) => t.find((g) => g.id === f)).filter(Boolean)) != null ? r : [], u = t.filter((f) => !(n != null && n.includes(f.id)) && !(i != null && i.includes(f.id)));
|
|
161
|
+
return je(o, [...s, ...u, ...a], e);
|
|
162
|
+
}, F(e.options, G, "getHeaderGroups")), e.getCenterHeaderGroups = _(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, i) => (t = t.filter((l) => !(n != null && n.includes(l.id)) && !(i != null && i.includes(l.id))), je(o, t, e, "center")), F(e.options, G, "getCenterHeaderGroups")), e.getLeftHeaderGroups = _(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
|
|
163
|
+
var i;
|
|
164
|
+
const l = (i = n?.map((r) => t.find((s) => s.id === r)).filter(Boolean)) != null ? i : [];
|
|
165
|
+
return je(o, l, e, "left");
|
|
166
|
+
}, F(e.options, G, "getLeftHeaderGroups")), e.getRightHeaderGroups = _(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
|
|
167
|
+
var i;
|
|
168
|
+
const l = (i = n?.map((r) => t.find((s) => s.id === r)).filter(Boolean)) != null ? i : [];
|
|
169
|
+
return je(o, l, e, "right");
|
|
170
|
+
}, F(e.options, G, "getRightHeaderGroups")), e.getFooterGroups = _(() => [e.getHeaderGroups()], (o) => [...o].reverse(), F(e.options, G, "getFooterGroups")), e.getLeftFooterGroups = _(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), F(e.options, G, "getLeftFooterGroups")), e.getCenterFooterGroups = _(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), F(e.options, G, "getCenterFooterGroups")), e.getRightFooterGroups = _(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), F(e.options, G, "getRightFooterGroups")), e.getFlatHeaders = _(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), F(e.options, G, "getFlatHeaders")), e.getLeftFlatHeaders = _(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), F(e.options, G, "getLeftFlatHeaders")), e.getCenterFlatHeaders = _(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), F(e.options, G, "getCenterFlatHeaders")), e.getRightFlatHeaders = _(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), F(e.options, G, "getRightFlatHeaders")), e.getCenterLeafHeaders = _(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
|
|
171
|
+
var n;
|
|
172
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
173
|
+
}), F(e.options, G, "getCenterLeafHeaders")), e.getLeftLeafHeaders = _(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
|
|
174
|
+
var n;
|
|
175
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
176
|
+
}), F(e.options, G, "getLeftLeafHeaders")), e.getRightLeafHeaders = _(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
|
|
177
|
+
var n;
|
|
178
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
179
|
+
}), F(e.options, G, "getRightLeafHeaders")), e.getLeafHeaders = _(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
|
|
180
|
+
var i, l, r, s, a, u;
|
|
181
|
+
return [...(i = (l = o[0]) == null ? void 0 : l.headers) != null ? i : [], ...(r = (s = t[0]) == null ? void 0 : s.headers) != null ? r : [], ...(a = (u = n[0]) == null ? void 0 : u.headers) != null ? a : []].map((c) => c.getLeafHeaders()).flat();
|
|
182
|
+
}, F(e.options, G, "getLeafHeaders"));
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
function je(e, o, t, n) {
|
|
186
|
+
var i, l;
|
|
187
|
+
let r = 0;
|
|
188
|
+
const s = function(g, d) {
|
|
189
|
+
d === void 0 && (d = 1), r = Math.max(r, d), g.filter((m) => m.getIsVisible()).forEach((m) => {
|
|
190
|
+
var p;
|
|
191
|
+
(p = m.columns) != null && p.length && s(m.columns, d + 1);
|
|
192
|
+
}, 0);
|
|
193
|
+
};
|
|
194
|
+
s(e);
|
|
195
|
+
let a = [];
|
|
196
|
+
const u = (g, d) => {
|
|
197
|
+
const m = {
|
|
198
|
+
depth: d,
|
|
199
|
+
id: [n, `${d}`].filter(Boolean).join("_"),
|
|
200
|
+
headers: []
|
|
201
|
+
}, p = [];
|
|
202
|
+
g.forEach((v) => {
|
|
203
|
+
const C = [...p].reverse()[0], S = v.column.depth === m.depth;
|
|
204
|
+
let x, P = !1;
|
|
205
|
+
if (S && v.column.parent ? x = v.column.parent : (x = v.column, P = !0), C && C?.column === x)
|
|
206
|
+
C.subHeaders.push(v);
|
|
207
|
+
else {
|
|
208
|
+
const A = Tt(t, x, {
|
|
209
|
+
id: [n, d, x.id, v?.id].filter(Boolean).join("_"),
|
|
210
|
+
isPlaceholder: P,
|
|
211
|
+
placeholderId: P ? `${p.filter((D) => D.column === x).length}` : void 0,
|
|
212
|
+
depth: d,
|
|
213
|
+
index: p.length
|
|
214
|
+
});
|
|
215
|
+
A.subHeaders.push(v), p.push(A);
|
|
216
|
+
}
|
|
217
|
+
m.headers.push(v), v.headerGroup = m;
|
|
218
|
+
}), a.push(m), d > 0 && u(p, d - 1);
|
|
219
|
+
}, c = o.map((g, d) => Tt(t, g, {
|
|
220
|
+
depth: r,
|
|
221
|
+
index: d
|
|
222
|
+
}));
|
|
223
|
+
u(c, r - 1), a.reverse();
|
|
224
|
+
const f = (g) => g.filter((m) => m.column.getIsVisible()).map((m) => {
|
|
225
|
+
let p = 0, v = 0, C = [0];
|
|
226
|
+
m.subHeaders && m.subHeaders.length ? (C = [], f(m.subHeaders).forEach((x) => {
|
|
227
|
+
let {
|
|
228
|
+
colSpan: P,
|
|
229
|
+
rowSpan: A
|
|
230
|
+
} = x;
|
|
231
|
+
p += P, C.push(A);
|
|
232
|
+
})) : p = 1;
|
|
233
|
+
const S = Math.min(...C);
|
|
234
|
+
return v = v + S, m.colSpan = p, m.rowSpan = v, {
|
|
235
|
+
colSpan: p,
|
|
236
|
+
rowSpan: v
|
|
237
|
+
};
|
|
238
|
+
});
|
|
239
|
+
return f((i = (l = a[0]) == null ? void 0 : l.headers) != null ? i : []), a;
|
|
240
|
+
}
|
|
241
|
+
const co = (e, o, t, n, i, l, r) => {
|
|
242
|
+
let s = {
|
|
243
|
+
id: o,
|
|
244
|
+
index: n,
|
|
245
|
+
original: t,
|
|
246
|
+
depth: i,
|
|
247
|
+
parentId: r,
|
|
248
|
+
_valuesCache: {},
|
|
249
|
+
_uniqueValuesCache: {},
|
|
250
|
+
getValue: (a) => {
|
|
251
|
+
if (s._valuesCache.hasOwnProperty(a))
|
|
252
|
+
return s._valuesCache[a];
|
|
253
|
+
const u = e.getColumn(a);
|
|
254
|
+
if (u != null && u.accessorFn)
|
|
255
|
+
return s._valuesCache[a] = u.accessorFn(s.original, n), s._valuesCache[a];
|
|
256
|
+
},
|
|
257
|
+
getUniqueValues: (a) => {
|
|
258
|
+
if (s._uniqueValuesCache.hasOwnProperty(a))
|
|
259
|
+
return s._uniqueValuesCache[a];
|
|
260
|
+
const u = e.getColumn(a);
|
|
261
|
+
if (u != null && u.accessorFn)
|
|
262
|
+
return u.columnDef.getUniqueValues ? (s._uniqueValuesCache[a] = u.columnDef.getUniqueValues(s.original, n), s._uniqueValuesCache[a]) : (s._uniqueValuesCache[a] = [s.getValue(a)], s._uniqueValuesCache[a]);
|
|
263
|
+
},
|
|
264
|
+
renderValue: (a) => {
|
|
265
|
+
var u;
|
|
266
|
+
return (u = s.getValue(a)) != null ? u : e.options.renderFallbackValue;
|
|
267
|
+
},
|
|
268
|
+
subRows: [],
|
|
269
|
+
getLeafRows: () => ro(s.subRows, (a) => a.subRows),
|
|
270
|
+
getParentRow: () => s.parentId ? e.getRow(s.parentId, !0) : void 0,
|
|
271
|
+
getParentRows: () => {
|
|
272
|
+
let a = [], u = s;
|
|
273
|
+
for (; ; ) {
|
|
274
|
+
const c = u.getParentRow();
|
|
275
|
+
if (!c) break;
|
|
276
|
+
a.push(c), u = c;
|
|
277
|
+
}
|
|
278
|
+
return a.reverse();
|
|
279
|
+
},
|
|
280
|
+
getAllCells: _(() => [e.getAllLeafColumns()], (a) => a.map((u) => so(e, s, u, u.id)), F(e.options, "debugRows", "getAllCells")),
|
|
281
|
+
_getAllCellsByColumnId: _(() => [s.getAllCells()], (a) => a.reduce((u, c) => (u[c.column.id] = c, u), {}), F(e.options, "debugRows", "getAllCellsByColumnId"))
|
|
282
|
+
};
|
|
283
|
+
for (let a = 0; a < e._features.length; a++) {
|
|
284
|
+
const u = e._features[a];
|
|
285
|
+
u == null || u.createRow == null || u.createRow(s, e);
|
|
286
|
+
}
|
|
287
|
+
return s;
|
|
288
|
+
}, go = {
|
|
289
|
+
createColumn: (e, o) => {
|
|
290
|
+
e._getFacetedRowModel = o.options.getFacetedRowModel && o.options.getFacetedRowModel(o, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : o.getPreFilteredRowModel(), e._getFacetedUniqueValues = o.options.getFacetedUniqueValues && o.options.getFacetedUniqueValues(o, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = o.options.getFacetedMinMaxValues && o.options.getFacetedMinMaxValues(o, e.id), e.getFacetedMinMaxValues = () => {
|
|
291
|
+
if (e._getFacetedMinMaxValues)
|
|
292
|
+
return e._getFacetedMinMaxValues();
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
}, vn = (e, o, t) => {
|
|
296
|
+
var n, i;
|
|
297
|
+
const l = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
|
|
298
|
+
return !!(!((i = e.getValue(o)) == null || (i = i.toString()) == null || (i = i.toLowerCase()) == null) && i.includes(l));
|
|
299
|
+
};
|
|
300
|
+
vn.autoRemove = (e) => te(e);
|
|
301
|
+
const Cn = (e, o, t) => {
|
|
302
|
+
var n;
|
|
303
|
+
return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
|
|
304
|
+
};
|
|
305
|
+
Cn.autoRemove = (e) => te(e);
|
|
306
|
+
const wn = (e, o, t) => {
|
|
307
|
+
var n;
|
|
308
|
+
return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === t?.toLowerCase();
|
|
309
|
+
};
|
|
310
|
+
wn.autoRemove = (e) => te(e);
|
|
311
|
+
const Sn = (e, o, t) => {
|
|
312
|
+
var n;
|
|
313
|
+
return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
|
|
314
|
+
};
|
|
315
|
+
Sn.autoRemove = (e) => te(e);
|
|
316
|
+
const xn = (e, o, t) => !t.some((n) => {
|
|
317
|
+
var i;
|
|
318
|
+
return !((i = e.getValue(o)) != null && i.includes(n));
|
|
319
|
+
});
|
|
320
|
+
xn.autoRemove = (e) => te(e) || !(e != null && e.length);
|
|
321
|
+
const yn = (e, o, t) => t.some((n) => {
|
|
322
|
+
var i;
|
|
323
|
+
return (i = e.getValue(o)) == null ? void 0 : i.includes(n);
|
|
324
|
+
});
|
|
325
|
+
yn.autoRemove = (e) => te(e) || !(e != null && e.length);
|
|
326
|
+
const Rn = (e, o, t) => e.getValue(o) === t;
|
|
327
|
+
Rn.autoRemove = (e) => te(e);
|
|
328
|
+
const _n = (e, o, t) => e.getValue(o) == t;
|
|
329
|
+
_n.autoRemove = (e) => te(e);
|
|
330
|
+
const Pt = (e, o, t) => {
|
|
331
|
+
let [n, i] = t;
|
|
332
|
+
const l = e.getValue(o);
|
|
333
|
+
return l >= n && l <= i;
|
|
334
|
+
};
|
|
335
|
+
Pt.resolveFilterValue = (e) => {
|
|
336
|
+
let [o, t] = e, n = typeof o != "number" ? parseFloat(o) : o, i = typeof t != "number" ? parseFloat(t) : t, l = o === null || Number.isNaN(n) ? -1 / 0 : n, r = t === null || Number.isNaN(i) ? 1 / 0 : i;
|
|
337
|
+
if (l > r) {
|
|
338
|
+
const s = l;
|
|
339
|
+
l = r, r = s;
|
|
340
|
+
}
|
|
341
|
+
return [l, r];
|
|
342
|
+
};
|
|
343
|
+
Pt.autoRemove = (e) => te(e) || te(e[0]) && te(e[1]);
|
|
344
|
+
const ue = {
|
|
345
|
+
includesString: vn,
|
|
346
|
+
includesStringSensitive: Cn,
|
|
347
|
+
equalsString: wn,
|
|
348
|
+
arrIncludes: Sn,
|
|
349
|
+
arrIncludesAll: xn,
|
|
350
|
+
arrIncludesSome: yn,
|
|
351
|
+
equals: Rn,
|
|
352
|
+
weakEquals: _n,
|
|
353
|
+
inNumberRange: Pt
|
|
354
|
+
};
|
|
355
|
+
function te(e) {
|
|
356
|
+
return e == null || e === "";
|
|
357
|
+
}
|
|
358
|
+
const fo = {
|
|
359
|
+
getDefaultColumnDef: () => ({
|
|
360
|
+
filterFn: "auto"
|
|
361
|
+
}),
|
|
362
|
+
getInitialState: (e) => ({
|
|
363
|
+
columnFilters: [],
|
|
364
|
+
...e
|
|
365
|
+
}),
|
|
366
|
+
getDefaultOptions: (e) => ({
|
|
367
|
+
onColumnFiltersChange: Y("columnFilters", e),
|
|
368
|
+
filterFromLeafRows: !1,
|
|
369
|
+
maxLeafRowFilterDepth: 100
|
|
370
|
+
}),
|
|
371
|
+
createColumn: (e, o) => {
|
|
372
|
+
e.getAutoFilterFn = () => {
|
|
373
|
+
const t = o.getCoreRowModel().flatRows[0], n = t?.getValue(e.id);
|
|
374
|
+
return typeof n == "string" ? ue.includesString : typeof n == "number" ? ue.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? ue.equals : Array.isArray(n) ? ue.arrIncludes : ue.weakEquals;
|
|
375
|
+
}, e.getFilterFn = () => {
|
|
376
|
+
var t, n;
|
|
377
|
+
return Ze(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
|
|
378
|
+
// @ts-ignore
|
|
379
|
+
(t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : ue[e.columnDef.filterFn]
|
|
380
|
+
);
|
|
381
|
+
}, e.getCanFilter = () => {
|
|
382
|
+
var t, n, i;
|
|
383
|
+
return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n = o.options.enableColumnFilters) != null ? n : !0) && ((i = o.options.enableFilters) != null ? i : !0) && !!e.accessorFn;
|
|
384
|
+
}, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
|
|
385
|
+
var t;
|
|
386
|
+
return (t = o.getState().columnFilters) == null || (t = t.find((n) => n.id === e.id)) == null ? void 0 : t.value;
|
|
387
|
+
}, e.getFilterIndex = () => {
|
|
388
|
+
var t, n;
|
|
389
|
+
return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((i) => i.id === e.id)) != null ? t : -1;
|
|
390
|
+
}, e.setFilterValue = (t) => {
|
|
391
|
+
o.setColumnFilters((n) => {
|
|
392
|
+
const i = e.getFilterFn(), l = n?.find((c) => c.id === e.id), r = he(t, l ? l.value : void 0);
|
|
393
|
+
if (Gt(i, r, e)) {
|
|
394
|
+
var s;
|
|
395
|
+
return (s = n?.filter((c) => c.id !== e.id)) != null ? s : [];
|
|
396
|
+
}
|
|
397
|
+
const a = {
|
|
398
|
+
id: e.id,
|
|
399
|
+
value: r
|
|
400
|
+
};
|
|
401
|
+
if (l) {
|
|
402
|
+
var u;
|
|
403
|
+
return (u = n?.map((c) => c.id === e.id ? a : c)) != null ? u : [];
|
|
404
|
+
}
|
|
405
|
+
return n != null && n.length ? [...n, a] : [a];
|
|
406
|
+
});
|
|
407
|
+
};
|
|
408
|
+
},
|
|
409
|
+
createRow: (e, o) => {
|
|
410
|
+
e.columnFilters = {}, e.columnFiltersMeta = {};
|
|
411
|
+
},
|
|
412
|
+
createTable: (e) => {
|
|
413
|
+
e.setColumnFilters = (o) => {
|
|
414
|
+
const t = e.getAllLeafColumns(), n = (i) => {
|
|
415
|
+
var l;
|
|
416
|
+
return (l = he(o, i)) == null ? void 0 : l.filter((r) => {
|
|
417
|
+
const s = t.find((a) => a.id === r.id);
|
|
418
|
+
if (s) {
|
|
419
|
+
const a = s.getFilterFn();
|
|
420
|
+
if (Gt(a, r.value, s))
|
|
421
|
+
return !1;
|
|
422
|
+
}
|
|
423
|
+
return !0;
|
|
424
|
+
});
|
|
425
|
+
};
|
|
426
|
+
e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange(n);
|
|
427
|
+
}, e.resetColumnFilters = (o) => {
|
|
428
|
+
var t, n;
|
|
429
|
+
e.setColumnFilters(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.columnFilters) != null ? t : []);
|
|
430
|
+
}, 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());
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
function Gt(e, o, t) {
|
|
434
|
+
return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
|
|
435
|
+
}
|
|
436
|
+
const po = (e, o, t) => t.reduce((n, i) => {
|
|
437
|
+
const l = i.getValue(e);
|
|
438
|
+
return n + (typeof l == "number" ? l : 0);
|
|
439
|
+
}, 0), ho = (e, o, t) => {
|
|
440
|
+
let n;
|
|
441
|
+
return t.forEach((i) => {
|
|
442
|
+
const l = i.getValue(e);
|
|
443
|
+
l != null && (n > l || n === void 0 && l >= l) && (n = l);
|
|
444
|
+
}), n;
|
|
445
|
+
}, mo = (e, o, t) => {
|
|
446
|
+
let n;
|
|
447
|
+
return t.forEach((i) => {
|
|
448
|
+
const l = i.getValue(e);
|
|
449
|
+
l != null && (n < l || n === void 0 && l >= l) && (n = l);
|
|
450
|
+
}), n;
|
|
451
|
+
}, vo = (e, o, t) => {
|
|
452
|
+
let n, i;
|
|
453
|
+
return t.forEach((l) => {
|
|
454
|
+
const r = l.getValue(e);
|
|
455
|
+
r != null && (n === void 0 ? r >= r && (n = i = r) : (n > r && (n = r), i < r && (i = r)));
|
|
456
|
+
}), [n, i];
|
|
457
|
+
}, Co = (e, o) => {
|
|
458
|
+
let t = 0, n = 0;
|
|
459
|
+
if (o.forEach((i) => {
|
|
460
|
+
let l = i.getValue(e);
|
|
461
|
+
l != null && (l = +l) >= l && (++t, n += l);
|
|
462
|
+
}), t) return n / t;
|
|
463
|
+
}, wo = (e, o) => {
|
|
464
|
+
if (!o.length)
|
|
465
|
+
return;
|
|
466
|
+
const t = o.map((l) => l.getValue(e));
|
|
467
|
+
if (!lo(t))
|
|
468
|
+
return;
|
|
469
|
+
if (t.length === 1)
|
|
470
|
+
return t[0];
|
|
471
|
+
const n = Math.floor(t.length / 2), i = t.sort((l, r) => l - r);
|
|
472
|
+
return t.length % 2 !== 0 ? i[n] : (i[n - 1] + i[n]) / 2;
|
|
473
|
+
}, So = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), xo = (e, o) => new Set(o.map((t) => t.getValue(e))).size, yo = (e, o) => o.length, at = {
|
|
474
|
+
sum: po,
|
|
475
|
+
min: ho,
|
|
476
|
+
max: mo,
|
|
477
|
+
extent: vo,
|
|
478
|
+
mean: Co,
|
|
479
|
+
median: wo,
|
|
480
|
+
unique: So,
|
|
481
|
+
uniqueCount: xo,
|
|
482
|
+
count: yo
|
|
483
|
+
}, Ro = {
|
|
484
|
+
getDefaultColumnDef: () => ({
|
|
485
|
+
aggregatedCell: (e) => {
|
|
486
|
+
var o, t;
|
|
487
|
+
return (o = (t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) != null ? o : null;
|
|
488
|
+
},
|
|
489
|
+
aggregationFn: "auto"
|
|
490
|
+
}),
|
|
491
|
+
getInitialState: (e) => ({
|
|
492
|
+
grouping: [],
|
|
493
|
+
...e
|
|
494
|
+
}),
|
|
495
|
+
getDefaultOptions: (e) => ({
|
|
496
|
+
onGroupingChange: Y("grouping", e),
|
|
497
|
+
groupedColumnMode: "reorder"
|
|
498
|
+
}),
|
|
499
|
+
createColumn: (e, o) => {
|
|
500
|
+
e.toggleGrouping = () => {
|
|
501
|
+
o.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((n) => n !== e.id) : [...t ?? [], e.id]);
|
|
502
|
+
}, e.getCanGroup = () => {
|
|
503
|
+
var t, n;
|
|
504
|
+
return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((n = o.options.enableGrouping) != null ? n : !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue);
|
|
505
|
+
}, e.getIsGrouped = () => {
|
|
506
|
+
var t;
|
|
507
|
+
return (t = o.getState().grouping) == null ? void 0 : t.includes(e.id);
|
|
508
|
+
}, e.getGroupedIndex = () => {
|
|
509
|
+
var t;
|
|
510
|
+
return (t = o.getState().grouping) == null ? void 0 : t.indexOf(e.id);
|
|
511
|
+
}, e.getToggleGroupingHandler = () => {
|
|
512
|
+
const t = e.getCanGroup();
|
|
513
|
+
return () => {
|
|
514
|
+
t && e.toggleGrouping();
|
|
515
|
+
};
|
|
516
|
+
}, e.getAutoAggregationFn = () => {
|
|
517
|
+
const t = o.getCoreRowModel().flatRows[0], n = t?.getValue(e.id);
|
|
518
|
+
if (typeof n == "number")
|
|
519
|
+
return at.sum;
|
|
520
|
+
if (Object.prototype.toString.call(n) === "[object Date]")
|
|
521
|
+
return at.extent;
|
|
522
|
+
}, e.getAggregationFn = () => {
|
|
523
|
+
var t, n;
|
|
524
|
+
if (!e)
|
|
525
|
+
throw new Error();
|
|
526
|
+
return Ze(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : (t = (n = o.options.aggregationFns) == null ? void 0 : n[e.columnDef.aggregationFn]) != null ? t : at[e.columnDef.aggregationFn];
|
|
527
|
+
};
|
|
528
|
+
},
|
|
529
|
+
createTable: (e) => {
|
|
530
|
+
e.setGrouping = (o) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(o), e.resetGrouping = (o) => {
|
|
531
|
+
var t, n;
|
|
532
|
+
e.setGrouping(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.grouping) != null ? t : []);
|
|
533
|
+
}, 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());
|
|
534
|
+
},
|
|
535
|
+
createRow: (e, o) => {
|
|
536
|
+
e.getIsGrouped = () => !!e.groupingColumnId, e.getGroupingValue = (t) => {
|
|
537
|
+
if (e._groupingValuesCache.hasOwnProperty(t))
|
|
538
|
+
return e._groupingValuesCache[t];
|
|
539
|
+
const n = o.getColumn(t);
|
|
540
|
+
return n != null && n.columnDef.getGroupingValue ? (e._groupingValuesCache[t] = n.columnDef.getGroupingValue(e.original), e._groupingValuesCache[t]) : e.getValue(t);
|
|
541
|
+
}, e._groupingValuesCache = {};
|
|
542
|
+
},
|
|
543
|
+
createCell: (e, o, t, n) => {
|
|
544
|
+
e.getIsGrouped = () => o.getIsGrouped() && o.id === t.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && o.getIsGrouped(), e.getIsAggregated = () => {
|
|
545
|
+
var i;
|
|
546
|
+
return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((i = t.subRows) != null && i.length);
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
function _o(e, o, t) {
|
|
551
|
+
if (!(o != null && o.length) || !t)
|
|
552
|
+
return e;
|
|
553
|
+
const n = e.filter((l) => !o.includes(l.id));
|
|
554
|
+
return t === "remove" ? n : [...o.map((l) => e.find((r) => r.id === l)).filter(Boolean), ...n];
|
|
555
|
+
}
|
|
556
|
+
const Fo = {
|
|
557
|
+
getInitialState: (e) => ({
|
|
558
|
+
columnOrder: [],
|
|
559
|
+
...e
|
|
560
|
+
}),
|
|
561
|
+
getDefaultOptions: (e) => ({
|
|
562
|
+
onColumnOrderChange: Y("columnOrder", e)
|
|
563
|
+
}),
|
|
564
|
+
createColumn: (e, o) => {
|
|
565
|
+
e.getIndex = _((t) => [He(o, t)], (t) => t.findIndex((n) => n.id === e.id), F(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
|
|
566
|
+
var n;
|
|
567
|
+
return ((n = He(o, t)[0]) == null ? void 0 : n.id) === e.id;
|
|
568
|
+
}, e.getIsLastColumn = (t) => {
|
|
569
|
+
var n;
|
|
570
|
+
const i = He(o, t);
|
|
571
|
+
return ((n = i[i.length - 1]) == null ? void 0 : n.id) === e.id;
|
|
572
|
+
};
|
|
573
|
+
},
|
|
574
|
+
createTable: (e) => {
|
|
575
|
+
e.setColumnOrder = (o) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(o), e.resetColumnOrder = (o) => {
|
|
576
|
+
var t;
|
|
577
|
+
e.setColumnOrder(o ? [] : (t = e.initialState.columnOrder) != null ? t : []);
|
|
578
|
+
}, e._getOrderColumnsFn = _(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (o, t, n) => (i) => {
|
|
579
|
+
let l = [];
|
|
580
|
+
if (!(o != null && o.length))
|
|
581
|
+
l = i;
|
|
582
|
+
else {
|
|
583
|
+
const r = [...o], s = [...i];
|
|
584
|
+
for (; s.length && r.length; ) {
|
|
585
|
+
const a = r.shift(), u = s.findIndex((c) => c.id === a);
|
|
586
|
+
u > -1 && l.push(s.splice(u, 1)[0]);
|
|
587
|
+
}
|
|
588
|
+
l = [...l, ...s];
|
|
589
|
+
}
|
|
590
|
+
return _o(l, t, n);
|
|
591
|
+
}, F(e.options, "debugTable", "_getOrderColumnsFn"));
|
|
592
|
+
}
|
|
593
|
+
}, ut = () => ({
|
|
594
|
+
left: [],
|
|
595
|
+
right: []
|
|
596
|
+
}), Mo = {
|
|
597
|
+
getInitialState: (e) => ({
|
|
598
|
+
columnPinning: ut(),
|
|
599
|
+
...e
|
|
600
|
+
}),
|
|
601
|
+
getDefaultOptions: (e) => ({
|
|
602
|
+
onColumnPinningChange: Y("columnPinning", e)
|
|
603
|
+
}),
|
|
604
|
+
createColumn: (e, o) => {
|
|
605
|
+
e.pin = (t) => {
|
|
606
|
+
const n = e.getLeafColumns().map((i) => i.id).filter(Boolean);
|
|
607
|
+
o.setColumnPinning((i) => {
|
|
608
|
+
var l, r;
|
|
609
|
+
if (t === "right") {
|
|
610
|
+
var s, a;
|
|
611
|
+
return {
|
|
612
|
+
left: ((s = i?.left) != null ? s : []).filter((f) => !(n != null && n.includes(f))),
|
|
613
|
+
right: [...((a = i?.right) != null ? a : []).filter((f) => !(n != null && n.includes(f))), ...n]
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
if (t === "left") {
|
|
617
|
+
var u, c;
|
|
618
|
+
return {
|
|
619
|
+
left: [...((u = i?.left) != null ? u : []).filter((f) => !(n != null && n.includes(f))), ...n],
|
|
620
|
+
right: ((c = i?.right) != null ? c : []).filter((f) => !(n != null && n.includes(f)))
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
return {
|
|
624
|
+
left: ((l = i?.left) != null ? l : []).filter((f) => !(n != null && n.includes(f))),
|
|
625
|
+
right: ((r = i?.right) != null ? r : []).filter((f) => !(n != null && n.includes(f)))
|
|
626
|
+
};
|
|
627
|
+
});
|
|
628
|
+
}, e.getCanPin = () => e.getLeafColumns().some((n) => {
|
|
629
|
+
var i, l, r;
|
|
630
|
+
return ((i = n.columnDef.enablePinning) != null ? i : !0) && ((l = (r = o.options.enableColumnPinning) != null ? r : o.options.enablePinning) != null ? l : !0);
|
|
631
|
+
}), e.getIsPinned = () => {
|
|
632
|
+
const t = e.getLeafColumns().map((s) => s.id), {
|
|
633
|
+
left: n,
|
|
634
|
+
right: i
|
|
635
|
+
} = o.getState().columnPinning, l = t.some((s) => n?.includes(s)), r = t.some((s) => i?.includes(s));
|
|
636
|
+
return l ? "left" : r ? "right" : !1;
|
|
637
|
+
}, e.getPinnedIndex = () => {
|
|
638
|
+
var t, n;
|
|
639
|
+
const i = e.getIsPinned();
|
|
640
|
+
return i ? (t = (n = o.getState().columnPinning) == null || (n = n[i]) == null ? void 0 : n.indexOf(e.id)) != null ? t : -1 : 0;
|
|
641
|
+
};
|
|
642
|
+
},
|
|
643
|
+
createRow: (e, o) => {
|
|
644
|
+
e.getCenterVisibleCells = _(() => [e._getAllVisibleCells(), o.getState().columnPinning.left, o.getState().columnPinning.right], (t, n, i) => {
|
|
645
|
+
const l = [...n ?? [], ...i ?? []];
|
|
646
|
+
return t.filter((r) => !l.includes(r.column.id));
|
|
647
|
+
}, F(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = _(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((l) => t.find((r) => r.column.id === l)).filter(Boolean).map((l) => ({
|
|
648
|
+
...l,
|
|
649
|
+
position: "left"
|
|
650
|
+
})), F(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = _(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((l) => t.find((r) => r.column.id === l)).filter(Boolean).map((l) => ({
|
|
651
|
+
...l,
|
|
652
|
+
position: "right"
|
|
653
|
+
})), F(o.options, "debugRows", "getRightVisibleCells"));
|
|
654
|
+
},
|
|
655
|
+
createTable: (e) => {
|
|
656
|
+
e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
|
|
657
|
+
var t, n;
|
|
658
|
+
return e.setColumnPinning(o ? ut() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : ut());
|
|
659
|
+
}, e.getIsSomeColumnsPinned = (o) => {
|
|
660
|
+
var t;
|
|
661
|
+
const n = e.getState().columnPinning;
|
|
662
|
+
if (!o) {
|
|
663
|
+
var i, l;
|
|
664
|
+
return !!((i = n.left) != null && i.length || (l = n.right) != null && l.length);
|
|
665
|
+
}
|
|
666
|
+
return !!((t = n[o]) != null && t.length);
|
|
667
|
+
}, e.getLeftLeafColumns = _(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (o, t) => (t ?? []).map((n) => o.find((i) => i.id === n)).filter(Boolean), F(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = _(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (o, t) => (t ?? []).map((n) => o.find((i) => i.id === n)).filter(Boolean), F(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = _(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
|
|
668
|
+
const i = [...t ?? [], ...n ?? []];
|
|
669
|
+
return o.filter((l) => !i.includes(l.id));
|
|
670
|
+
}, F(e.options, "debugColumns", "getCenterLeafColumns"));
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
function $o(e) {
|
|
674
|
+
return e || (typeof document < "u" ? document : null);
|
|
675
|
+
}
|
|
676
|
+
const qe = {
|
|
677
|
+
size: 150,
|
|
678
|
+
minSize: 20,
|
|
679
|
+
maxSize: Number.MAX_SAFE_INTEGER
|
|
680
|
+
}, ct = () => ({
|
|
681
|
+
startOffset: null,
|
|
682
|
+
startSize: null,
|
|
683
|
+
deltaOffset: null,
|
|
684
|
+
deltaPercentage: null,
|
|
685
|
+
isResizingColumn: !1,
|
|
686
|
+
columnSizingStart: []
|
|
687
|
+
}), Eo = {
|
|
688
|
+
getDefaultColumnDef: () => qe,
|
|
689
|
+
getInitialState: (e) => ({
|
|
690
|
+
columnSizing: {},
|
|
691
|
+
columnSizingInfo: ct(),
|
|
692
|
+
...e
|
|
693
|
+
}),
|
|
694
|
+
getDefaultOptions: (e) => ({
|
|
695
|
+
columnResizeMode: "onEnd",
|
|
696
|
+
columnResizeDirection: "ltr",
|
|
697
|
+
onColumnSizingChange: Y("columnSizing", e),
|
|
698
|
+
onColumnSizingInfoChange: Y("columnSizingInfo", e)
|
|
699
|
+
}),
|
|
700
|
+
createColumn: (e, o) => {
|
|
701
|
+
e.getSize = () => {
|
|
702
|
+
var t, n, i;
|
|
703
|
+
const l = o.getState().columnSizing[e.id];
|
|
704
|
+
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : qe.minSize, (n = l ?? e.columnDef.size) != null ? n : qe.size), (i = e.columnDef.maxSize) != null ? i : qe.maxSize);
|
|
705
|
+
}, e.getStart = _((t) => [t, He(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((i, l) => i + l.getSize(), 0), F(o.options, "debugColumns", "getStart")), e.getAfter = _((t) => [t, He(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((i, l) => i + l.getSize(), 0), F(o.options, "debugColumns", "getAfter")), e.resetSize = () => {
|
|
706
|
+
o.setColumnSizing((t) => {
|
|
707
|
+
let {
|
|
708
|
+
[e.id]: n,
|
|
709
|
+
...i
|
|
710
|
+
} = t;
|
|
711
|
+
return i;
|
|
712
|
+
});
|
|
713
|
+
}, e.getCanResize = () => {
|
|
714
|
+
var t, n;
|
|
715
|
+
return ((t = e.columnDef.enableResizing) != null ? t : !0) && ((n = o.options.enableColumnResizing) != null ? n : !0);
|
|
716
|
+
}, e.getIsResizing = () => o.getState().columnSizingInfo.isResizingColumn === e.id;
|
|
717
|
+
},
|
|
718
|
+
createHeader: (e, o) => {
|
|
719
|
+
e.getSize = () => {
|
|
720
|
+
let t = 0;
|
|
721
|
+
const n = (i) => {
|
|
722
|
+
if (i.subHeaders.length)
|
|
723
|
+
i.subHeaders.forEach(n);
|
|
724
|
+
else {
|
|
725
|
+
var l;
|
|
726
|
+
t += (l = i.column.getSize()) != null ? l : 0;
|
|
727
|
+
}
|
|
728
|
+
};
|
|
729
|
+
return n(e), t;
|
|
730
|
+
}, e.getStart = () => {
|
|
731
|
+
if (e.index > 0) {
|
|
732
|
+
const t = e.headerGroup.headers[e.index - 1];
|
|
733
|
+
return t.getStart() + t.getSize();
|
|
734
|
+
}
|
|
735
|
+
return 0;
|
|
736
|
+
}, e.getResizeHandler = (t) => {
|
|
737
|
+
const n = o.getColumn(e.column.id), i = n?.getCanResize();
|
|
738
|
+
return (l) => {
|
|
739
|
+
if (!n || !i || (l.persist == null || l.persist(), dt(l) && l.touches && l.touches.length > 1))
|
|
740
|
+
return;
|
|
741
|
+
const r = e.getSize(), s = e ? e.getLeafHeaders().map((C) => [C.column.id, C.column.getSize()]) : [[n.id, n.getSize()]], a = dt(l) ? Math.round(l.touches[0].clientX) : l.clientX, u = {}, c = (C, S) => {
|
|
742
|
+
typeof S == "number" && (o.setColumnSizingInfo((x) => {
|
|
743
|
+
var P, A;
|
|
744
|
+
const D = o.options.columnResizeDirection === "rtl" ? -1 : 1, z = (S - ((P = x?.startOffset) != null ? P : 0)) * D, O = Math.max(z / ((A = x?.startSize) != null ? A : 0), -0.999999);
|
|
745
|
+
return x.columnSizingStart.forEach((T) => {
|
|
746
|
+
let [ie, Se] = T;
|
|
747
|
+
u[ie] = Math.round(Math.max(Se + Se * O, 0) * 100) / 100;
|
|
748
|
+
}), {
|
|
749
|
+
...x,
|
|
750
|
+
deltaOffset: z,
|
|
751
|
+
deltaPercentage: O
|
|
752
|
+
};
|
|
753
|
+
}), (o.options.columnResizeMode === "onChange" || C === "end") && o.setColumnSizing((x) => ({
|
|
754
|
+
...x,
|
|
755
|
+
...u
|
|
756
|
+
})));
|
|
757
|
+
}, f = (C) => c("move", C), g = (C) => {
|
|
758
|
+
c("end", C), o.setColumnSizingInfo((S) => ({
|
|
759
|
+
...S,
|
|
760
|
+
isResizingColumn: !1,
|
|
761
|
+
startOffset: null,
|
|
762
|
+
startSize: null,
|
|
763
|
+
deltaOffset: null,
|
|
764
|
+
deltaPercentage: null,
|
|
765
|
+
columnSizingStart: []
|
|
766
|
+
}));
|
|
767
|
+
}, d = $o(t), m = {
|
|
768
|
+
moveHandler: (C) => f(C.clientX),
|
|
769
|
+
upHandler: (C) => {
|
|
770
|
+
d?.removeEventListener("mousemove", m.moveHandler), d?.removeEventListener("mouseup", m.upHandler), g(C.clientX);
|
|
771
|
+
}
|
|
772
|
+
}, p = {
|
|
773
|
+
moveHandler: (C) => (C.cancelable && (C.preventDefault(), C.stopPropagation()), f(C.touches[0].clientX), !1),
|
|
774
|
+
upHandler: (C) => {
|
|
775
|
+
var S;
|
|
776
|
+
d?.removeEventListener("touchmove", p.moveHandler), d?.removeEventListener("touchend", p.upHandler), C.cancelable && (C.preventDefault(), C.stopPropagation()), g((S = C.touches[0]) == null ? void 0 : S.clientX);
|
|
777
|
+
}
|
|
778
|
+
}, v = Io() ? {
|
|
779
|
+
passive: !1
|
|
780
|
+
} : !1;
|
|
781
|
+
dt(l) ? (d?.addEventListener("touchmove", p.moveHandler, v), d?.addEventListener("touchend", p.upHandler, v)) : (d?.addEventListener("mousemove", m.moveHandler, v), d?.addEventListener("mouseup", m.upHandler, v)), o.setColumnSizingInfo((C) => ({
|
|
782
|
+
...C,
|
|
783
|
+
startOffset: a,
|
|
784
|
+
startSize: r,
|
|
785
|
+
deltaOffset: 0,
|
|
786
|
+
deltaPercentage: 0,
|
|
787
|
+
columnSizingStart: s,
|
|
788
|
+
isResizingColumn: n.id
|
|
789
|
+
}));
|
|
790
|
+
};
|
|
791
|
+
};
|
|
792
|
+
},
|
|
793
|
+
createTable: (e) => {
|
|
794
|
+
e.setColumnSizing = (o) => e.options.onColumnSizingChange == null ? void 0 : e.options.onColumnSizingChange(o), e.setColumnSizingInfo = (o) => e.options.onColumnSizingInfoChange == null ? void 0 : e.options.onColumnSizingInfoChange(o), e.resetColumnSizing = (o) => {
|
|
795
|
+
var t;
|
|
796
|
+
e.setColumnSizing(o ? {} : (t = e.initialState.columnSizing) != null ? t : {});
|
|
797
|
+
}, e.resetHeaderSizeInfo = (o) => {
|
|
798
|
+
var t;
|
|
799
|
+
e.setColumnSizingInfo(o ? ct() : (t = e.initialState.columnSizingInfo) != null ? t : ct());
|
|
800
|
+
}, e.getTotalSize = () => {
|
|
801
|
+
var o, t;
|
|
802
|
+
return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
|
|
803
|
+
}, e.getLeftTotalSize = () => {
|
|
804
|
+
var o, t;
|
|
805
|
+
return (o = (t = e.getLeftHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
|
|
806
|
+
}, e.getCenterTotalSize = () => {
|
|
807
|
+
var o, t;
|
|
808
|
+
return (o = (t = e.getCenterHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
|
|
809
|
+
}, e.getRightTotalSize = () => {
|
|
810
|
+
var o, t;
|
|
811
|
+
return (o = (t = e.getRightHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
let Ke = null;
|
|
816
|
+
function Io() {
|
|
817
|
+
if (typeof Ke == "boolean") return Ke;
|
|
818
|
+
let e = !1;
|
|
819
|
+
try {
|
|
820
|
+
const o = {
|
|
821
|
+
get passive() {
|
|
822
|
+
return e = !0, !1;
|
|
823
|
+
}
|
|
824
|
+
}, t = () => {
|
|
825
|
+
};
|
|
826
|
+
window.addEventListener("test", t, o), window.removeEventListener("test", t);
|
|
827
|
+
} catch {
|
|
828
|
+
e = !1;
|
|
829
|
+
}
|
|
830
|
+
return Ke = e, Ke;
|
|
831
|
+
}
|
|
832
|
+
function dt(e) {
|
|
833
|
+
return e.type === "touchstart";
|
|
834
|
+
}
|
|
835
|
+
const Po = {
|
|
836
|
+
getInitialState: (e) => ({
|
|
837
|
+
columnVisibility: {},
|
|
838
|
+
...e
|
|
839
|
+
}),
|
|
840
|
+
getDefaultOptions: (e) => ({
|
|
841
|
+
onColumnVisibilityChange: Y("columnVisibility", e)
|
|
842
|
+
}),
|
|
843
|
+
createColumn: (e, o) => {
|
|
844
|
+
e.toggleVisibility = (t) => {
|
|
845
|
+
e.getCanHide() && o.setColumnVisibility((n) => ({
|
|
846
|
+
...n,
|
|
847
|
+
[e.id]: t ?? !e.getIsVisible()
|
|
848
|
+
}));
|
|
849
|
+
}, e.getIsVisible = () => {
|
|
850
|
+
var t, n;
|
|
851
|
+
const i = e.columns;
|
|
852
|
+
return (t = i.length ? i.some((l) => l.getIsVisible()) : (n = o.getState().columnVisibility) == null ? void 0 : n[e.id]) != null ? t : !0;
|
|
853
|
+
}, e.getCanHide = () => {
|
|
854
|
+
var t, n;
|
|
855
|
+
return ((t = e.columnDef.enableHiding) != null ? t : !0) && ((n = o.options.enableHiding) != null ? n : !0);
|
|
856
|
+
}, e.getToggleVisibilityHandler = () => (t) => {
|
|
857
|
+
e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
|
|
858
|
+
};
|
|
859
|
+
},
|
|
860
|
+
createRow: (e, o) => {
|
|
861
|
+
e._getAllVisibleCells = _(() => [e.getAllCells(), o.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), F(o.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = _(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, i) => [...t, ...n, ...i], F(o.options, "debugRows", "getVisibleCells"));
|
|
862
|
+
},
|
|
863
|
+
createTable: (e) => {
|
|
864
|
+
const o = (t, n) => _(() => [n(), n().filter((i) => i.getIsVisible()).map((i) => i.id).join("_")], (i) => i.filter((l) => l.getIsVisible == null ? void 0 : l.getIsVisible()), F(e.options, "debugColumns", t));
|
|
865
|
+
e.getVisibleFlatColumns = o("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = o("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = o("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = o("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = o("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
|
|
866
|
+
var n;
|
|
867
|
+
e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
|
|
868
|
+
}, e.toggleAllColumnsVisible = (t) => {
|
|
869
|
+
var n;
|
|
870
|
+
t = (n = t) != null ? n : !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((i, l) => ({
|
|
871
|
+
...i,
|
|
872
|
+
[l.id]: t || !(l.getCanHide != null && l.getCanHide())
|
|
873
|
+
}), {}));
|
|
874
|
+
}, 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) => {
|
|
875
|
+
var n;
|
|
876
|
+
e.toggleAllColumnsVisible((n = t.target) == null ? void 0 : n.checked);
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
function He(e, o) {
|
|
881
|
+
return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
|
|
882
|
+
}
|
|
883
|
+
const Vo = {
|
|
884
|
+
createTable: (e) => {
|
|
885
|
+
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 = () => {
|
|
886
|
+
if (e._getGlobalFacetedMinMaxValues)
|
|
887
|
+
return e._getGlobalFacetedMinMaxValues();
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
}, bo = {
|
|
891
|
+
getInitialState: (e) => ({
|
|
892
|
+
globalFilter: void 0,
|
|
893
|
+
...e
|
|
894
|
+
}),
|
|
895
|
+
getDefaultOptions: (e) => ({
|
|
896
|
+
onGlobalFilterChange: Y("globalFilter", e),
|
|
897
|
+
globalFilterFn: "auto",
|
|
898
|
+
getColumnCanGlobalFilter: (o) => {
|
|
899
|
+
var t;
|
|
900
|
+
const n = (t = e.getCoreRowModel().flatRows[0]) == null || (t = t._getAllCellsByColumnId()[o.id]) == null ? void 0 : t.getValue();
|
|
901
|
+
return typeof n == "string" || typeof n == "number";
|
|
902
|
+
}
|
|
903
|
+
}),
|
|
904
|
+
createColumn: (e, o) => {
|
|
905
|
+
e.getCanGlobalFilter = () => {
|
|
906
|
+
var t, n, i, l;
|
|
907
|
+
return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n = o.options.enableGlobalFilter) != null ? n : !0) && ((i = o.options.enableFilters) != null ? i : !0) && ((l = o.options.getColumnCanGlobalFilter == null ? void 0 : o.options.getColumnCanGlobalFilter(e)) != null ? l : !0) && !!e.accessorFn;
|
|
908
|
+
};
|
|
909
|
+
},
|
|
910
|
+
createTable: (e) => {
|
|
911
|
+
e.getGlobalAutoFilterFn = () => ue.includesString, e.getGlobalFilterFn = () => {
|
|
912
|
+
var o, t;
|
|
913
|
+
const {
|
|
914
|
+
globalFilterFn: n
|
|
915
|
+
} = e.options;
|
|
916
|
+
return Ze(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : ue[n];
|
|
917
|
+
}, e.setGlobalFilter = (o) => {
|
|
918
|
+
e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(o);
|
|
919
|
+
}, e.resetGlobalFilter = (o) => {
|
|
920
|
+
e.setGlobalFilter(o ? void 0 : e.initialState.globalFilter);
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
}, Ao = {
|
|
924
|
+
getInitialState: (e) => ({
|
|
925
|
+
expanded: {},
|
|
926
|
+
...e
|
|
927
|
+
}),
|
|
928
|
+
getDefaultOptions: (e) => ({
|
|
929
|
+
onExpandedChange: Y("expanded", e),
|
|
930
|
+
paginateExpandedRows: !0
|
|
931
|
+
}),
|
|
932
|
+
createTable: (e) => {
|
|
933
|
+
let o = !1, t = !1;
|
|
934
|
+
e._autoResetExpanded = () => {
|
|
935
|
+
var n, i;
|
|
936
|
+
if (!o) {
|
|
937
|
+
e._queue(() => {
|
|
938
|
+
o = !0;
|
|
939
|
+
});
|
|
940
|
+
return;
|
|
941
|
+
}
|
|
942
|
+
if ((n = (i = e.options.autoResetAll) != null ? i : e.options.autoResetExpanded) != null ? n : !e.options.manualExpanding) {
|
|
943
|
+
if (t) return;
|
|
944
|
+
t = !0, e._queue(() => {
|
|
945
|
+
e.resetExpanded(), t = !1;
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
}, e.setExpanded = (n) => e.options.onExpandedChange == null ? void 0 : e.options.onExpandedChange(n), e.toggleAllRowsExpanded = (n) => {
|
|
949
|
+
n ?? !e.getIsAllRowsExpanded() ? e.setExpanded(!0) : e.setExpanded({});
|
|
950
|
+
}, e.resetExpanded = (n) => {
|
|
951
|
+
var i, l;
|
|
952
|
+
e.setExpanded(n ? {} : (i = (l = e.initialState) == null ? void 0 : l.expanded) != null ? i : {});
|
|
953
|
+
}, e.getCanSomeRowsExpand = () => e.getPrePaginationRowModel().flatRows.some((n) => n.getCanExpand()), e.getToggleAllRowsExpandedHandler = () => (n) => {
|
|
954
|
+
n.persist == null || n.persist(), e.toggleAllRowsExpanded();
|
|
955
|
+
}, e.getIsSomeRowsExpanded = () => {
|
|
956
|
+
const n = e.getState().expanded;
|
|
957
|
+
return n === !0 || Object.values(n).some(Boolean);
|
|
958
|
+
}, e.getIsAllRowsExpanded = () => {
|
|
959
|
+
const n = e.getState().expanded;
|
|
960
|
+
return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || e.getRowModel().flatRows.some((i) => !i.getIsExpanded()));
|
|
961
|
+
}, e.getExpandedDepth = () => {
|
|
962
|
+
let n = 0;
|
|
963
|
+
return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((l) => {
|
|
964
|
+
const r = l.split(".");
|
|
965
|
+
n = Math.max(n, r.length);
|
|
966
|
+
}), n;
|
|
967
|
+
}, 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());
|
|
968
|
+
},
|
|
969
|
+
createRow: (e, o) => {
|
|
970
|
+
e.toggleExpanded = (t) => {
|
|
971
|
+
o.setExpanded((n) => {
|
|
972
|
+
var i;
|
|
973
|
+
const l = n === !0 ? !0 : !!(n != null && n[e.id]);
|
|
974
|
+
let r = {};
|
|
975
|
+
if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((s) => {
|
|
976
|
+
r[s] = !0;
|
|
977
|
+
}) : r = n, t = (i = t) != null ? i : !l, !l && t)
|
|
978
|
+
return {
|
|
979
|
+
...r,
|
|
980
|
+
[e.id]: !0
|
|
981
|
+
};
|
|
982
|
+
if (l && !t) {
|
|
983
|
+
const {
|
|
984
|
+
[e.id]: s,
|
|
985
|
+
...a
|
|
986
|
+
} = r;
|
|
987
|
+
return a;
|
|
988
|
+
}
|
|
989
|
+
return n;
|
|
990
|
+
});
|
|
991
|
+
}, e.getIsExpanded = () => {
|
|
992
|
+
var t;
|
|
993
|
+
const n = o.getState().expanded;
|
|
994
|
+
return !!((t = o.options.getIsRowExpanded == null ? void 0 : o.options.getIsRowExpanded(e)) != null ? t : n === !0 || n?.[e.id]);
|
|
995
|
+
}, e.getCanExpand = () => {
|
|
996
|
+
var t, n, i;
|
|
997
|
+
return (t = o.options.getRowCanExpand == null ? void 0 : o.options.getRowCanExpand(e)) != null ? t : ((n = o.options.enableExpanding) != null ? n : !0) && !!((i = e.subRows) != null && i.length);
|
|
998
|
+
}, e.getIsAllParentsExpanded = () => {
|
|
999
|
+
let t = !0, n = e;
|
|
1000
|
+
for (; t && n.parentId; )
|
|
1001
|
+
n = o.getRow(n.parentId, !0), t = n.getIsExpanded();
|
|
1002
|
+
return t;
|
|
1003
|
+
}, e.getToggleExpandedHandler = () => {
|
|
1004
|
+
const t = e.getCanExpand();
|
|
1005
|
+
return () => {
|
|
1006
|
+
t && e.toggleExpanded();
|
|
1007
|
+
};
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
}, wt = 0, St = 10, gt = () => ({
|
|
1011
|
+
pageIndex: wt,
|
|
1012
|
+
pageSize: St
|
|
1013
|
+
}), zo = {
|
|
1014
|
+
getInitialState: (e) => ({
|
|
1015
|
+
...e,
|
|
1016
|
+
pagination: {
|
|
1017
|
+
...gt(),
|
|
1018
|
+
...e?.pagination
|
|
1019
|
+
}
|
|
1020
|
+
}),
|
|
1021
|
+
getDefaultOptions: (e) => ({
|
|
1022
|
+
onPaginationChange: Y("pagination", e)
|
|
1023
|
+
}),
|
|
1024
|
+
createTable: (e) => {
|
|
1025
|
+
let o = !1, t = !1;
|
|
1026
|
+
e._autoResetPageIndex = () => {
|
|
1027
|
+
var n, i;
|
|
1028
|
+
if (!o) {
|
|
1029
|
+
e._queue(() => {
|
|
1030
|
+
o = !0;
|
|
1031
|
+
});
|
|
1032
|
+
return;
|
|
1033
|
+
}
|
|
1034
|
+
if ((n = (i = e.options.autoResetAll) != null ? i : e.options.autoResetPageIndex) != null ? n : !e.options.manualPagination) {
|
|
1035
|
+
if (t) return;
|
|
1036
|
+
t = !0, e._queue(() => {
|
|
1037
|
+
e.resetPageIndex(), t = !1;
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
}, e.setPagination = (n) => {
|
|
1041
|
+
const i = (l) => he(n, l);
|
|
1042
|
+
return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(i);
|
|
1043
|
+
}, e.resetPagination = (n) => {
|
|
1044
|
+
var i;
|
|
1045
|
+
e.setPagination(n ? gt() : (i = e.initialState.pagination) != null ? i : gt());
|
|
1046
|
+
}, e.setPageIndex = (n) => {
|
|
1047
|
+
e.setPagination((i) => {
|
|
1048
|
+
let l = he(n, i.pageIndex);
|
|
1049
|
+
const r = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
|
|
1050
|
+
return l = Math.max(0, Math.min(l, r)), {
|
|
1051
|
+
...i,
|
|
1052
|
+
pageIndex: l
|
|
1053
|
+
};
|
|
1054
|
+
});
|
|
1055
|
+
}, e.resetPageIndex = (n) => {
|
|
1056
|
+
var i, l;
|
|
1057
|
+
e.setPageIndex(n ? wt : (i = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageIndex) != null ? i : wt);
|
|
1058
|
+
}, e.resetPageSize = (n) => {
|
|
1059
|
+
var i, l;
|
|
1060
|
+
e.setPageSize(n ? St : (i = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageSize) != null ? i : St);
|
|
1061
|
+
}, e.setPageSize = (n) => {
|
|
1062
|
+
e.setPagination((i) => {
|
|
1063
|
+
const l = Math.max(1, he(n, i.pageSize)), r = i.pageSize * i.pageIndex, s = Math.floor(r / l);
|
|
1064
|
+
return {
|
|
1065
|
+
...i,
|
|
1066
|
+
pageIndex: s,
|
|
1067
|
+
pageSize: l
|
|
1068
|
+
};
|
|
1069
|
+
});
|
|
1070
|
+
}, e.setPageCount = (n) => e.setPagination((i) => {
|
|
1071
|
+
var l;
|
|
1072
|
+
let r = he(n, (l = e.options.pageCount) != null ? l : -1);
|
|
1073
|
+
return typeof r == "number" && (r = Math.max(-1, r)), {
|
|
1074
|
+
...i,
|
|
1075
|
+
pageCount: r
|
|
1076
|
+
};
|
|
1077
|
+
}), e.getPageOptions = _(() => [e.getPageCount()], (n) => {
|
|
1078
|
+
let i = [];
|
|
1079
|
+
return n && n > 0 && (i = [...new Array(n)].fill(null).map((l, r) => r)), i;
|
|
1080
|
+
}, F(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
|
|
1081
|
+
const {
|
|
1082
|
+
pageIndex: n
|
|
1083
|
+
} = e.getState().pagination, i = e.getPageCount();
|
|
1084
|
+
return i === -1 ? !0 : i === 0 ? !1 : n < i - 1;
|
|
1085
|
+
}, 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 = () => {
|
|
1086
|
+
var n;
|
|
1087
|
+
return (n = e.options.pageCount) != null ? n : Math.ceil(e.getRowCount() / e.getState().pagination.pageSize);
|
|
1088
|
+
}, e.getRowCount = () => {
|
|
1089
|
+
var n;
|
|
1090
|
+
return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
}, ft = () => ({
|
|
1094
|
+
top: [],
|
|
1095
|
+
bottom: []
|
|
1096
|
+
}), Do = {
|
|
1097
|
+
getInitialState: (e) => ({
|
|
1098
|
+
rowPinning: ft(),
|
|
1099
|
+
...e
|
|
1100
|
+
}),
|
|
1101
|
+
getDefaultOptions: (e) => ({
|
|
1102
|
+
onRowPinningChange: Y("rowPinning", e)
|
|
1103
|
+
}),
|
|
1104
|
+
createRow: (e, o) => {
|
|
1105
|
+
e.pin = (t, n, i) => {
|
|
1106
|
+
const l = n ? e.getLeafRows().map((a) => {
|
|
1107
|
+
let {
|
|
1108
|
+
id: u
|
|
1109
|
+
} = a;
|
|
1110
|
+
return u;
|
|
1111
|
+
}) : [], r = i ? e.getParentRows().map((a) => {
|
|
1112
|
+
let {
|
|
1113
|
+
id: u
|
|
1114
|
+
} = a;
|
|
1115
|
+
return u;
|
|
1116
|
+
}) : [], s = /* @__PURE__ */ new Set([...r, e.id, ...l]);
|
|
1117
|
+
o.setRowPinning((a) => {
|
|
1118
|
+
var u, c;
|
|
1119
|
+
if (t === "bottom") {
|
|
1120
|
+
var f, g;
|
|
1121
|
+
return {
|
|
1122
|
+
top: ((f = a?.top) != null ? f : []).filter((p) => !(s != null && s.has(p))),
|
|
1123
|
+
bottom: [...((g = a?.bottom) != null ? g : []).filter((p) => !(s != null && s.has(p))), ...Array.from(s)]
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1126
|
+
if (t === "top") {
|
|
1127
|
+
var d, m;
|
|
1128
|
+
return {
|
|
1129
|
+
top: [...((d = a?.top) != null ? d : []).filter((p) => !(s != null && s.has(p))), ...Array.from(s)],
|
|
1130
|
+
bottom: ((m = a?.bottom) != null ? m : []).filter((p) => !(s != null && s.has(p)))
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
return {
|
|
1134
|
+
top: ((u = a?.top) != null ? u : []).filter((p) => !(s != null && s.has(p))),
|
|
1135
|
+
bottom: ((c = a?.bottom) != null ? c : []).filter((p) => !(s != null && s.has(p)))
|
|
1136
|
+
};
|
|
1137
|
+
});
|
|
1138
|
+
}, e.getCanPin = () => {
|
|
1139
|
+
var t;
|
|
1140
|
+
const {
|
|
1141
|
+
enableRowPinning: n,
|
|
1142
|
+
enablePinning: i
|
|
1143
|
+
} = o.options;
|
|
1144
|
+
return typeof n == "function" ? n(e) : (t = n ?? i) != null ? t : !0;
|
|
1145
|
+
}, e.getIsPinned = () => {
|
|
1146
|
+
const t = [e.id], {
|
|
1147
|
+
top: n,
|
|
1148
|
+
bottom: i
|
|
1149
|
+
} = o.getState().rowPinning, l = t.some((s) => n?.includes(s)), r = t.some((s) => i?.includes(s));
|
|
1150
|
+
return l ? "top" : r ? "bottom" : !1;
|
|
1151
|
+
}, e.getPinnedIndex = () => {
|
|
1152
|
+
var t, n;
|
|
1153
|
+
const i = e.getIsPinned();
|
|
1154
|
+
if (!i) return -1;
|
|
1155
|
+
const l = (t = i === "top" ? o.getTopRows() : o.getBottomRows()) == null ? void 0 : t.map((r) => {
|
|
1156
|
+
let {
|
|
1157
|
+
id: s
|
|
1158
|
+
} = r;
|
|
1159
|
+
return s;
|
|
1160
|
+
});
|
|
1161
|
+
return (n = l?.indexOf(e.id)) != null ? n : -1;
|
|
1162
|
+
};
|
|
1163
|
+
},
|
|
1164
|
+
createTable: (e) => {
|
|
1165
|
+
e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
|
|
1166
|
+
var t, n;
|
|
1167
|
+
return e.setRowPinning(o ? ft() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : ft());
|
|
1168
|
+
}, e.getIsSomeRowsPinned = (o) => {
|
|
1169
|
+
var t;
|
|
1170
|
+
const n = e.getState().rowPinning;
|
|
1171
|
+
if (!o) {
|
|
1172
|
+
var i, l;
|
|
1173
|
+
return !!((i = n.top) != null && i.length || (l = n.bottom) != null && l.length);
|
|
1174
|
+
}
|
|
1175
|
+
return !!((t = n[o]) != null && t.length);
|
|
1176
|
+
}, e._getPinnedRows = (o, t, n) => {
|
|
1177
|
+
var i;
|
|
1178
|
+
return ((i = e.options.keepPinnedRows) == null || i ? (
|
|
1179
|
+
//get all rows that are pinned even if they would not be otherwise visible
|
|
1180
|
+
//account for expanded parent rows, but not pagination or filtering
|
|
1181
|
+
(t ?? []).map((r) => {
|
|
1182
|
+
const s = e.getRow(r, !0);
|
|
1183
|
+
return s.getIsAllParentsExpanded() ? s : null;
|
|
1184
|
+
})
|
|
1185
|
+
) : (
|
|
1186
|
+
//else get only visible rows that are pinned
|
|
1187
|
+
(t ?? []).map((r) => o.find((s) => s.id === r))
|
|
1188
|
+
)).filter(Boolean).map((r) => ({
|
|
1189
|
+
...r,
|
|
1190
|
+
position: n
|
|
1191
|
+
}));
|
|
1192
|
+
}, e.getTopRows = _(() => [e.getRowModel().rows, e.getState().rowPinning.top], (o, t) => e._getPinnedRows(o, t, "top"), F(e.options, "debugRows", "getTopRows")), e.getBottomRows = _(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (o, t) => e._getPinnedRows(o, t, "bottom"), F(e.options, "debugRows", "getBottomRows")), e.getCenterRows = _(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (o, t, n) => {
|
|
1193
|
+
const i = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
|
|
1194
|
+
return o.filter((l) => !i.has(l.id));
|
|
1195
|
+
}, F(e.options, "debugRows", "getCenterRows"));
|
|
1196
|
+
}
|
|
1197
|
+
}, Oo = {
|
|
1198
|
+
getInitialState: (e) => ({
|
|
1199
|
+
rowSelection: {},
|
|
1200
|
+
...e
|
|
1201
|
+
}),
|
|
1202
|
+
getDefaultOptions: (e) => ({
|
|
1203
|
+
onRowSelectionChange: Y("rowSelection", e),
|
|
1204
|
+
enableRowSelection: !0,
|
|
1205
|
+
enableMultiRowSelection: !0,
|
|
1206
|
+
enableSubRowSelection: !0
|
|
1207
|
+
// enableGroupingRowSelection: false,
|
|
1208
|
+
// isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,
|
|
1209
|
+
// isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
|
|
1210
|
+
}),
|
|
1211
|
+
createTable: (e) => {
|
|
1212
|
+
e.setRowSelection = (o) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(o), e.resetRowSelection = (o) => {
|
|
1213
|
+
var t;
|
|
1214
|
+
return e.setRowSelection(o ? {} : (t = e.initialState.rowSelection) != null ? t : {});
|
|
1215
|
+
}, e.toggleAllRowsSelected = (o) => {
|
|
1216
|
+
e.setRowSelection((t) => {
|
|
1217
|
+
o = typeof o < "u" ? o : !e.getIsAllRowsSelected();
|
|
1218
|
+
const n = {
|
|
1219
|
+
...t
|
|
1220
|
+
}, i = e.getPreGroupedRowModel().flatRows;
|
|
1221
|
+
return o ? i.forEach((l) => {
|
|
1222
|
+
l.getCanSelect() && (n[l.id] = !0);
|
|
1223
|
+
}) : i.forEach((l) => {
|
|
1224
|
+
delete n[l.id];
|
|
1225
|
+
}), n;
|
|
1226
|
+
});
|
|
1227
|
+
}, e.toggleAllPageRowsSelected = (o) => e.setRowSelection((t) => {
|
|
1228
|
+
const n = typeof o < "u" ? o : !e.getIsAllPageRowsSelected(), i = {
|
|
1229
|
+
...t
|
|
1230
|
+
};
|
|
1231
|
+
return e.getRowModel().rows.forEach((l) => {
|
|
1232
|
+
xt(i, l.id, n, !0, e);
|
|
1233
|
+
}), i;
|
|
1234
|
+
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = _(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? pt(e, t) : {
|
|
1235
|
+
rows: [],
|
|
1236
|
+
flatRows: [],
|
|
1237
|
+
rowsById: {}
|
|
1238
|
+
}, F(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = _(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? pt(e, t) : {
|
|
1239
|
+
rows: [],
|
|
1240
|
+
flatRows: [],
|
|
1241
|
+
rowsById: {}
|
|
1242
|
+
}, F(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = _(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? pt(e, t) : {
|
|
1243
|
+
rows: [],
|
|
1244
|
+
flatRows: [],
|
|
1245
|
+
rowsById: {}
|
|
1246
|
+
}, F(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
|
|
1247
|
+
const o = e.getFilteredRowModel().flatRows, {
|
|
1248
|
+
rowSelection: t
|
|
1249
|
+
} = e.getState();
|
|
1250
|
+
let n = !!(o.length && Object.keys(t).length);
|
|
1251
|
+
return n && o.some((i) => i.getCanSelect() && !t[i.id]) && (n = !1), n;
|
|
1252
|
+
}, e.getIsAllPageRowsSelected = () => {
|
|
1253
|
+
const o = e.getPaginationRowModel().flatRows.filter((i) => i.getCanSelect()), {
|
|
1254
|
+
rowSelection: t
|
|
1255
|
+
} = e.getState();
|
|
1256
|
+
let n = !!o.length;
|
|
1257
|
+
return n && o.some((i) => !t[i.id]) && (n = !1), n;
|
|
1258
|
+
}, e.getIsSomeRowsSelected = () => {
|
|
1259
|
+
var o;
|
|
1260
|
+
const t = Object.keys((o = e.getState().rowSelection) != null ? o : {}).length;
|
|
1261
|
+
return t > 0 && t < e.getFilteredRowModel().flatRows.length;
|
|
1262
|
+
}, e.getIsSomePageRowsSelected = () => {
|
|
1263
|
+
const o = e.getPaginationRowModel().flatRows;
|
|
1264
|
+
return e.getIsAllPageRowsSelected() ? !1 : o.filter((t) => t.getCanSelect()).some((t) => t.getIsSelected() || t.getIsSomeSelected());
|
|
1265
|
+
}, e.getToggleAllRowsSelectedHandler = () => (o) => {
|
|
1266
|
+
e.toggleAllRowsSelected(o.target.checked);
|
|
1267
|
+
}, e.getToggleAllPageRowsSelectedHandler = () => (o) => {
|
|
1268
|
+
e.toggleAllPageRowsSelected(o.target.checked);
|
|
1269
|
+
};
|
|
1270
|
+
},
|
|
1271
|
+
createRow: (e, o) => {
|
|
1272
|
+
e.toggleSelected = (t, n) => {
|
|
1273
|
+
const i = e.getIsSelected();
|
|
1274
|
+
o.setRowSelection((l) => {
|
|
1275
|
+
var r;
|
|
1276
|
+
if (t = typeof t < "u" ? t : !i, e.getCanSelect() && i === t)
|
|
1277
|
+
return l;
|
|
1278
|
+
const s = {
|
|
1279
|
+
...l
|
|
1280
|
+
};
|
|
1281
|
+
return xt(s, e.id, t, (r = n?.selectChildren) != null ? r : !0, o), s;
|
|
1282
|
+
});
|
|
1283
|
+
}, e.getIsSelected = () => {
|
|
1284
|
+
const {
|
|
1285
|
+
rowSelection: t
|
|
1286
|
+
} = o.getState();
|
|
1287
|
+
return Vt(e, t);
|
|
1288
|
+
}, e.getIsSomeSelected = () => {
|
|
1289
|
+
const {
|
|
1290
|
+
rowSelection: t
|
|
1291
|
+
} = o.getState();
|
|
1292
|
+
return yt(e, t) === "some";
|
|
1293
|
+
}, e.getIsAllSubRowsSelected = () => {
|
|
1294
|
+
const {
|
|
1295
|
+
rowSelection: t
|
|
1296
|
+
} = o.getState();
|
|
1297
|
+
return yt(e, t) === "all";
|
|
1298
|
+
}, e.getCanSelect = () => {
|
|
1299
|
+
var t;
|
|
1300
|
+
return typeof o.options.enableRowSelection == "function" ? o.options.enableRowSelection(e) : (t = o.options.enableRowSelection) != null ? t : !0;
|
|
1301
|
+
}, e.getCanSelectSubRows = () => {
|
|
1302
|
+
var t;
|
|
1303
|
+
return typeof o.options.enableSubRowSelection == "function" ? o.options.enableSubRowSelection(e) : (t = o.options.enableSubRowSelection) != null ? t : !0;
|
|
1304
|
+
}, e.getCanMultiSelect = () => {
|
|
1305
|
+
var t;
|
|
1306
|
+
return typeof o.options.enableMultiRowSelection == "function" ? o.options.enableMultiRowSelection(e) : (t = o.options.enableMultiRowSelection) != null ? t : !0;
|
|
1307
|
+
}, e.getToggleSelectedHandler = () => {
|
|
1308
|
+
const t = e.getCanSelect();
|
|
1309
|
+
return (n) => {
|
|
1310
|
+
var i;
|
|
1311
|
+
t && e.toggleSelected((i = n.target) == null ? void 0 : i.checked);
|
|
1312
|
+
};
|
|
1313
|
+
};
|
|
1314
|
+
}
|
|
1315
|
+
}, xt = (e, o, t, n, i) => {
|
|
1316
|
+
var l;
|
|
1317
|
+
const r = i.getRow(o, !0);
|
|
1318
|
+
t ? (r.getCanMultiSelect() || Object.keys(e).forEach((s) => delete e[s]), r.getCanSelect() && (e[o] = !0)) : delete e[o], n && (l = r.subRows) != null && l.length && r.getCanSelectSubRows() && r.subRows.forEach((s) => xt(e, s.id, t, n, i));
|
|
1319
|
+
};
|
|
1320
|
+
function pt(e, o) {
|
|
1321
|
+
const t = e.getState().rowSelection, n = [], i = {}, l = function(r, s) {
|
|
1322
|
+
return r.map((a) => {
|
|
1323
|
+
var u;
|
|
1324
|
+
const c = Vt(a, t);
|
|
1325
|
+
if (c && (n.push(a), i[a.id] = a), (u = a.subRows) != null && u.length && (a = {
|
|
1326
|
+
...a,
|
|
1327
|
+
subRows: l(a.subRows)
|
|
1328
|
+
}), c)
|
|
1329
|
+
return a;
|
|
1330
|
+
}).filter(Boolean);
|
|
1331
|
+
};
|
|
1332
|
+
return {
|
|
1333
|
+
rows: l(o.rows),
|
|
1334
|
+
flatRows: n,
|
|
1335
|
+
rowsById: i
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
function Vt(e, o) {
|
|
1339
|
+
var t;
|
|
1340
|
+
return (t = o[e.id]) != null ? t : !1;
|
|
1341
|
+
}
|
|
1342
|
+
function yt(e, o, t) {
|
|
1343
|
+
var n;
|
|
1344
|
+
if (!((n = e.subRows) != null && n.length)) return !1;
|
|
1345
|
+
let i = !0, l = !1;
|
|
1346
|
+
return e.subRows.forEach((r) => {
|
|
1347
|
+
if (!(l && !i) && (r.getCanSelect() && (Vt(r, o) ? l = !0 : i = !1), r.subRows && r.subRows.length)) {
|
|
1348
|
+
const s = yt(r, o);
|
|
1349
|
+
s === "all" ? l = !0 : (s === "some" && (l = !0), i = !1);
|
|
1350
|
+
}
|
|
1351
|
+
}), i ? "all" : l ? "some" : !1;
|
|
1352
|
+
}
|
|
1353
|
+
const Rt = /([0-9]+)/gm, Lo = (e, o, t) => Fn(Ce(e.getValue(t)).toLowerCase(), Ce(o.getValue(t)).toLowerCase()), ko = (e, o, t) => Fn(Ce(e.getValue(t)), Ce(o.getValue(t))), Ho = (e, o, t) => bt(Ce(e.getValue(t)).toLowerCase(), Ce(o.getValue(t)).toLowerCase()), To = (e, o, t) => bt(Ce(e.getValue(t)), Ce(o.getValue(t))), Go = (e, o, t) => {
|
|
1354
|
+
const n = e.getValue(t), i = o.getValue(t);
|
|
1355
|
+
return n > i ? 1 : n < i ? -1 : 0;
|
|
1356
|
+
}, No = (e, o, t) => bt(e.getValue(t), o.getValue(t));
|
|
1357
|
+
function bt(e, o) {
|
|
1358
|
+
return e === o ? 0 : e > o ? 1 : -1;
|
|
1359
|
+
}
|
|
1360
|
+
function Ce(e) {
|
|
1361
|
+
return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
|
|
1362
|
+
}
|
|
1363
|
+
function Fn(e, o) {
|
|
1364
|
+
const t = e.split(Rt).filter(Boolean), n = o.split(Rt).filter(Boolean);
|
|
1365
|
+
for (; t.length && n.length; ) {
|
|
1366
|
+
const i = t.shift(), l = n.shift(), r = parseInt(i, 10), s = parseInt(l, 10), a = [r, s].sort();
|
|
1367
|
+
if (isNaN(a[0])) {
|
|
1368
|
+
if (i > l)
|
|
1369
|
+
return 1;
|
|
1370
|
+
if (l > i)
|
|
1371
|
+
return -1;
|
|
1372
|
+
continue;
|
|
1373
|
+
}
|
|
1374
|
+
if (isNaN(a[1]))
|
|
1375
|
+
return isNaN(r) ? -1 : 1;
|
|
1376
|
+
if (r > s)
|
|
1377
|
+
return 1;
|
|
1378
|
+
if (s > r)
|
|
1379
|
+
return -1;
|
|
1380
|
+
}
|
|
1381
|
+
return t.length - n.length;
|
|
1382
|
+
}
|
|
1383
|
+
const Oe = {
|
|
1384
|
+
alphanumeric: Lo,
|
|
1385
|
+
alphanumericCaseSensitive: ko,
|
|
1386
|
+
text: Ho,
|
|
1387
|
+
textCaseSensitive: To,
|
|
1388
|
+
datetime: Go,
|
|
1389
|
+
basic: No
|
|
1390
|
+
}, Bo = {
|
|
1391
|
+
getInitialState: (e) => ({
|
|
1392
|
+
sorting: [],
|
|
1393
|
+
...e
|
|
1394
|
+
}),
|
|
1395
|
+
getDefaultColumnDef: () => ({
|
|
1396
|
+
sortingFn: "auto",
|
|
1397
|
+
sortUndefined: 1
|
|
1398
|
+
}),
|
|
1399
|
+
getDefaultOptions: (e) => ({
|
|
1400
|
+
onSortingChange: Y("sorting", e),
|
|
1401
|
+
isMultiSortEvent: (o) => o.shiftKey
|
|
1402
|
+
}),
|
|
1403
|
+
createColumn: (e, o) => {
|
|
1404
|
+
e.getAutoSortingFn = () => {
|
|
1405
|
+
const t = o.getFilteredRowModel().flatRows.slice(10);
|
|
1406
|
+
let n = !1;
|
|
1407
|
+
for (const i of t) {
|
|
1408
|
+
const l = i?.getValue(e.id);
|
|
1409
|
+
if (Object.prototype.toString.call(l) === "[object Date]")
|
|
1410
|
+
return Oe.datetime;
|
|
1411
|
+
if (typeof l == "string" && (n = !0, l.split(Rt).length > 1))
|
|
1412
|
+
return Oe.alphanumeric;
|
|
1413
|
+
}
|
|
1414
|
+
return n ? Oe.text : Oe.basic;
|
|
1415
|
+
}, e.getAutoSortDir = () => {
|
|
1416
|
+
const t = o.getFilteredRowModel().flatRows[0];
|
|
1417
|
+
return typeof t?.getValue(e.id) == "string" ? "asc" : "desc";
|
|
1418
|
+
}, e.getSortingFn = () => {
|
|
1419
|
+
var t, n;
|
|
1420
|
+
if (!e)
|
|
1421
|
+
throw new Error();
|
|
1422
|
+
return Ze(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : (t = (n = o.options.sortingFns) == null ? void 0 : n[e.columnDef.sortingFn]) != null ? t : Oe[e.columnDef.sortingFn];
|
|
1423
|
+
}, e.toggleSorting = (t, n) => {
|
|
1424
|
+
const i = e.getNextSortingOrder(), l = typeof t < "u" && t !== null;
|
|
1425
|
+
o.setSorting((r) => {
|
|
1426
|
+
const s = r?.find((d) => d.id === e.id), a = r?.findIndex((d) => d.id === e.id);
|
|
1427
|
+
let u = [], c, f = l ? t : i === "desc";
|
|
1428
|
+
if (r != null && r.length && e.getCanMultiSort() && n ? s ? c = "toggle" : c = "add" : r != null && r.length && a !== r.length - 1 ? c = "replace" : s ? c = "toggle" : c = "replace", c === "toggle" && (l || i || (c = "remove")), c === "add") {
|
|
1429
|
+
var g;
|
|
1430
|
+
u = [...r, {
|
|
1431
|
+
id: e.id,
|
|
1432
|
+
desc: f
|
|
1433
|
+
}], u.splice(0, u.length - ((g = o.options.maxMultiSortColCount) != null ? g : Number.MAX_SAFE_INTEGER));
|
|
1434
|
+
} else c === "toggle" ? u = r.map((d) => d.id === e.id ? {
|
|
1435
|
+
...d,
|
|
1436
|
+
desc: f
|
|
1437
|
+
} : d) : c === "remove" ? u = r.filter((d) => d.id !== e.id) : u = [{
|
|
1438
|
+
id: e.id,
|
|
1439
|
+
desc: f
|
|
1440
|
+
}];
|
|
1441
|
+
return u;
|
|
1442
|
+
});
|
|
1443
|
+
}, e.getFirstSortDir = () => {
|
|
1444
|
+
var t, n;
|
|
1445
|
+
return ((t = (n = e.columnDef.sortDescFirst) != null ? n : o.options.sortDescFirst) != null ? t : e.getAutoSortDir() === "desc") ? "desc" : "asc";
|
|
1446
|
+
}, e.getNextSortingOrder = (t) => {
|
|
1447
|
+
var n, i;
|
|
1448
|
+
const l = e.getFirstSortDir(), r = e.getIsSorted();
|
|
1449
|
+
return r ? r !== l && ((n = o.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
|
|
1450
|
+
(!(t && (i = o.options.enableMultiRemove) != null) || i) ? !1 : r === "desc" ? "asc" : "desc" : l;
|
|
1451
|
+
}, e.getCanSort = () => {
|
|
1452
|
+
var t, n;
|
|
1453
|
+
return ((t = e.columnDef.enableSorting) != null ? t : !0) && ((n = o.options.enableSorting) != null ? n : !0) && !!e.accessorFn;
|
|
1454
|
+
}, e.getCanMultiSort = () => {
|
|
1455
|
+
var t, n;
|
|
1456
|
+
return (t = (n = e.columnDef.enableMultiSort) != null ? n : o.options.enableMultiSort) != null ? t : !!e.accessorFn;
|
|
1457
|
+
}, e.getIsSorted = () => {
|
|
1458
|
+
var t;
|
|
1459
|
+
const n = (t = o.getState().sorting) == null ? void 0 : t.find((i) => i.id === e.id);
|
|
1460
|
+
return n ? n.desc ? "desc" : "asc" : !1;
|
|
1461
|
+
}, e.getSortIndex = () => {
|
|
1462
|
+
var t, n;
|
|
1463
|
+
return (t = (n = o.getState().sorting) == null ? void 0 : n.findIndex((i) => i.id === e.id)) != null ? t : -1;
|
|
1464
|
+
}, e.clearSorting = () => {
|
|
1465
|
+
o.setSorting((t) => t != null && t.length ? t.filter((n) => n.id !== e.id) : []);
|
|
1466
|
+
}, e.getToggleSortingHandler = () => {
|
|
1467
|
+
const t = e.getCanSort();
|
|
1468
|
+
return (n) => {
|
|
1469
|
+
t && (n.persist == null || n.persist(), e.toggleSorting == null || e.toggleSorting(void 0, e.getCanMultiSort() ? o.options.isMultiSortEvent == null ? void 0 : o.options.isMultiSortEvent(n) : !1));
|
|
1470
|
+
};
|
|
1471
|
+
};
|
|
1472
|
+
},
|
|
1473
|
+
createTable: (e) => {
|
|
1474
|
+
e.setSorting = (o) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(o), e.resetSorting = (o) => {
|
|
1475
|
+
var t, n;
|
|
1476
|
+
e.setSorting(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
|
|
1477
|
+
}, 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());
|
|
1478
|
+
}
|
|
1479
|
+
}, Wo = [
|
|
1480
|
+
uo,
|
|
1481
|
+
Po,
|
|
1482
|
+
Fo,
|
|
1483
|
+
Mo,
|
|
1484
|
+
go,
|
|
1485
|
+
fo,
|
|
1486
|
+
Vo,
|
|
1487
|
+
//depends on ColumnFaceting
|
|
1488
|
+
bo,
|
|
1489
|
+
//depends on ColumnFiltering
|
|
1490
|
+
Bo,
|
|
1491
|
+
Ro,
|
|
1492
|
+
//depends on RowSorting
|
|
1493
|
+
Ao,
|
|
1494
|
+
zo,
|
|
1495
|
+
Do,
|
|
1496
|
+
Oo,
|
|
1497
|
+
Eo
|
|
1498
|
+
];
|
|
1499
|
+
function jo(e) {
|
|
1500
|
+
var o, t;
|
|
1501
|
+
process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
|
|
1502
|
+
const n = [...Wo, ...(o = e._features) != null ? o : []];
|
|
1503
|
+
let i = {
|
|
1504
|
+
_features: n
|
|
1505
|
+
};
|
|
1506
|
+
const l = i._features.reduce((g, d) => Object.assign(g, d.getDefaultOptions == null ? void 0 : d.getDefaultOptions(i)), {}), r = (g) => i.options.mergeOptions ? i.options.mergeOptions(l, g) : {
|
|
1507
|
+
...l,
|
|
1508
|
+
...g
|
|
1509
|
+
};
|
|
1510
|
+
let a = {
|
|
1511
|
+
...{},
|
|
1512
|
+
...(t = e.initialState) != null ? t : {}
|
|
1513
|
+
};
|
|
1514
|
+
i._features.forEach((g) => {
|
|
1515
|
+
var d;
|
|
1516
|
+
a = (d = g.getInitialState == null ? void 0 : g.getInitialState(a)) != null ? d : a;
|
|
1517
|
+
});
|
|
1518
|
+
const u = [];
|
|
1519
|
+
let c = !1;
|
|
1520
|
+
const f = {
|
|
1521
|
+
_features: n,
|
|
1522
|
+
options: {
|
|
1523
|
+
...l,
|
|
1524
|
+
...e
|
|
1525
|
+
},
|
|
1526
|
+
initialState: a,
|
|
1527
|
+
_queue: (g) => {
|
|
1528
|
+
u.push(g), c || (c = !0, Promise.resolve().then(() => {
|
|
1529
|
+
for (; u.length; )
|
|
1530
|
+
u.shift()();
|
|
1531
|
+
c = !1;
|
|
1532
|
+
}).catch((d) => setTimeout(() => {
|
|
1533
|
+
throw d;
|
|
1534
|
+
})));
|
|
1535
|
+
},
|
|
1536
|
+
reset: () => {
|
|
1537
|
+
i.setState(i.initialState);
|
|
1538
|
+
},
|
|
1539
|
+
setOptions: (g) => {
|
|
1540
|
+
const d = he(g, i.options);
|
|
1541
|
+
i.options = r(d);
|
|
1542
|
+
},
|
|
1543
|
+
getState: () => i.options.state,
|
|
1544
|
+
setState: (g) => {
|
|
1545
|
+
i.options.onStateChange == null || i.options.onStateChange(g);
|
|
1546
|
+
},
|
|
1547
|
+
_getRowId: (g, d, m) => {
|
|
1548
|
+
var p;
|
|
1549
|
+
return (p = i.options.getRowId == null ? void 0 : i.options.getRowId(g, d, m)) != null ? p : `${m ? [m.id, d].join(".") : d}`;
|
|
1550
|
+
},
|
|
1551
|
+
getCoreRowModel: () => (i._getCoreRowModel || (i._getCoreRowModel = i.options.getCoreRowModel(i)), i._getCoreRowModel()),
|
|
1552
|
+
// The final calls start at the bottom of the model,
|
|
1553
|
+
// expanded rows, which then work their way up
|
|
1554
|
+
getRowModel: () => i.getPaginationRowModel(),
|
|
1555
|
+
//in next version, we should just pass in the row model as the optional 2nd arg
|
|
1556
|
+
getRow: (g, d) => {
|
|
1557
|
+
let m = (d ? i.getPrePaginationRowModel() : i.getRowModel()).rowsById[g];
|
|
1558
|
+
if (!m && (m = i.getCoreRowModel().rowsById[g], !m))
|
|
1559
|
+
throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${g}`) : new Error();
|
|
1560
|
+
return m;
|
|
1561
|
+
},
|
|
1562
|
+
_getDefaultColumnDef: _(() => [i.options.defaultColumn], (g) => {
|
|
1563
|
+
var d;
|
|
1564
|
+
return g = (d = g) != null ? d : {}, {
|
|
1565
|
+
header: (m) => {
|
|
1566
|
+
const p = m.header.column.columnDef;
|
|
1567
|
+
return p.accessorKey ? p.accessorKey : p.accessorFn ? p.id : null;
|
|
1568
|
+
},
|
|
1569
|
+
// footer: props => props.header.column.id,
|
|
1570
|
+
cell: (m) => {
|
|
1571
|
+
var p, v;
|
|
1572
|
+
return (p = (v = m.renderValue()) == null || v.toString == null ? void 0 : v.toString()) != null ? p : null;
|
|
1573
|
+
},
|
|
1574
|
+
...i._features.reduce((m, p) => Object.assign(m, p.getDefaultColumnDef == null ? void 0 : p.getDefaultColumnDef()), {}),
|
|
1575
|
+
...g
|
|
1576
|
+
};
|
|
1577
|
+
}, F(e, "debugColumns", "_getDefaultColumnDef")),
|
|
1578
|
+
_getColumnDefs: () => i.options.columns,
|
|
1579
|
+
getAllColumns: _(() => [i._getColumnDefs()], (g) => {
|
|
1580
|
+
const d = function(m, p, v) {
|
|
1581
|
+
return v === void 0 && (v = 0), m.map((C) => {
|
|
1582
|
+
const S = ao(i, C, v, p), x = C;
|
|
1583
|
+
return S.columns = x.columns ? d(x.columns, S, v + 1) : [], S;
|
|
1584
|
+
});
|
|
1585
|
+
};
|
|
1586
|
+
return d(g);
|
|
1587
|
+
}, F(e, "debugColumns", "getAllColumns")),
|
|
1588
|
+
getAllFlatColumns: _(() => [i.getAllColumns()], (g) => g.flatMap((d) => d.getFlatColumns()), F(e, "debugColumns", "getAllFlatColumns")),
|
|
1589
|
+
_getAllFlatColumnsById: _(() => [i.getAllFlatColumns()], (g) => g.reduce((d, m) => (d[m.id] = m, d), {}), F(e, "debugColumns", "getAllFlatColumnsById")),
|
|
1590
|
+
getAllLeafColumns: _(() => [i.getAllColumns(), i._getOrderColumnsFn()], (g, d) => {
|
|
1591
|
+
let m = g.flatMap((p) => p.getLeafColumns());
|
|
1592
|
+
return d(m);
|
|
1593
|
+
}, F(e, "debugColumns", "getAllLeafColumns")),
|
|
1594
|
+
getColumn: (g) => {
|
|
1595
|
+
const d = i._getAllFlatColumnsById()[g];
|
|
1596
|
+
return process.env.NODE_ENV !== "production" && !d && console.error(`[Table] Column with id '${g}' does not exist.`), d;
|
|
1597
|
+
}
|
|
1598
|
+
};
|
|
1599
|
+
Object.assign(i, f);
|
|
1600
|
+
for (let g = 0; g < i._features.length; g++) {
|
|
1601
|
+
const d = i._features[g];
|
|
1602
|
+
d == null || d.createTable == null || d.createTable(i);
|
|
1603
|
+
}
|
|
1604
|
+
return i;
|
|
1605
|
+
}
|
|
1606
|
+
function qo() {
|
|
1607
|
+
return (e) => _(() => [e.options.data], (o) => {
|
|
1608
|
+
const t = {
|
|
1609
|
+
rows: [],
|
|
1610
|
+
flatRows: [],
|
|
1611
|
+
rowsById: {}
|
|
1612
|
+
}, n = function(i, l, r) {
|
|
1613
|
+
l === void 0 && (l = 0);
|
|
1614
|
+
const s = [];
|
|
1615
|
+
for (let u = 0; u < i.length; u++) {
|
|
1616
|
+
const c = co(e, e._getRowId(i[u], u, r), i[u], u, l, void 0, r?.id);
|
|
1617
|
+
if (t.flatRows.push(c), t.rowsById[c.id] = c, s.push(c), e.options.getSubRows) {
|
|
1618
|
+
var a;
|
|
1619
|
+
c.originalSubRows = e.options.getSubRows(i[u], u), (a = c.originalSubRows) != null && a.length && (c.subRows = n(c.originalSubRows, l + 1, c));
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
return s;
|
|
1623
|
+
};
|
|
1624
|
+
return t.rows = n(o), t;
|
|
1625
|
+
}, F(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
|
|
1626
|
+
}
|
|
1627
|
+
function Ko() {
|
|
1628
|
+
return (e) => _(() => [e.getState().expanded, e.getPreExpandedRowModel(), e.options.paginateExpandedRows], (o, t, n) => !t.rows.length || o !== !0 && !Object.keys(o ?? {}).length || !n ? t : Uo(t), F(e.options, "debugTable", "getExpandedRowModel"));
|
|
1629
|
+
}
|
|
1630
|
+
function Uo(e) {
|
|
1631
|
+
const o = [], t = (n) => {
|
|
1632
|
+
var i;
|
|
1633
|
+
o.push(n), (i = n.subRows) != null && i.length && n.getIsExpanded() && n.subRows.forEach(t);
|
|
1634
|
+
};
|
|
1635
|
+
return e.rows.forEach(t), {
|
|
1636
|
+
rows: o,
|
|
1637
|
+
flatRows: e.flatRows,
|
|
1638
|
+
rowsById: e.rowsById
|
|
1639
|
+
};
|
|
1640
|
+
}
|
|
1641
|
+
function Ue() {
|
|
1642
|
+
return !0;
|
|
1643
|
+
}
|
|
1644
|
+
const Xo = /* @__PURE__ */ Symbol("merge-proxy"), Yo = {
|
|
1645
|
+
get(e, o, t) {
|
|
1646
|
+
return o === Xo ? t : e.get(o);
|
|
1647
|
+
},
|
|
1648
|
+
has(e, o) {
|
|
1649
|
+
return e.has(o);
|
|
1650
|
+
},
|
|
1651
|
+
set: Ue,
|
|
1652
|
+
deleteProperty: Ue,
|
|
1653
|
+
getOwnPropertyDescriptor(e, o) {
|
|
1654
|
+
return {
|
|
1655
|
+
configurable: !0,
|
|
1656
|
+
enumerable: !0,
|
|
1657
|
+
get() {
|
|
1658
|
+
return e.get(o);
|
|
1659
|
+
},
|
|
1660
|
+
set: Ue,
|
|
1661
|
+
deleteProperty: Ue
|
|
1662
|
+
};
|
|
1663
|
+
},
|
|
1664
|
+
ownKeys(e) {
|
|
1665
|
+
return e.keys();
|
|
1666
|
+
}
|
|
1667
|
+
};
|
|
1668
|
+
function ht(e) {
|
|
1669
|
+
return "value" in e ? e.value : e;
|
|
1670
|
+
}
|
|
1671
|
+
function ke() {
|
|
1672
|
+
for (var e = arguments.length, o = new Array(e), t = 0; t < e; t++)
|
|
1673
|
+
o[t] = arguments[t];
|
|
1674
|
+
return new Proxy({
|
|
1675
|
+
get(n) {
|
|
1676
|
+
for (let i = o.length - 1; i >= 0; i--) {
|
|
1677
|
+
const l = ht(o[i])[n];
|
|
1678
|
+
if (l !== void 0) return l;
|
|
1679
|
+
}
|
|
1680
|
+
},
|
|
1681
|
+
has(n) {
|
|
1682
|
+
for (let i = o.length - 1; i >= 0; i--)
|
|
1683
|
+
if (n in ht(o[i])) return !0;
|
|
1684
|
+
return !1;
|
|
1685
|
+
},
|
|
1686
|
+
keys() {
|
|
1687
|
+
const n = [];
|
|
1688
|
+
for (let i = 0; i < o.length; i++) n.push(...Object.keys(ht(o[i])));
|
|
1689
|
+
return [...Array.from(new Set(n))];
|
|
1690
|
+
}
|
|
1691
|
+
}, Yo);
|
|
1692
|
+
}
|
|
1693
|
+
const Nt = K({
|
|
1694
|
+
props: ["render", "props"],
|
|
1695
|
+
setup: (e) => () => typeof e.render == "function" || typeof e.render == "object" ? q(e.render, e.props) : e.render
|
|
1696
|
+
});
|
|
1697
|
+
function Bt(e) {
|
|
1698
|
+
return ke(e, {
|
|
1699
|
+
data: w(e.data)
|
|
1700
|
+
});
|
|
1701
|
+
}
|
|
1702
|
+
function Jo(e) {
|
|
1703
|
+
const o = Xn(e.data), t = ke({
|
|
1704
|
+
state: {},
|
|
1705
|
+
// Dummy state
|
|
1706
|
+
onStateChange: () => {
|
|
1707
|
+
},
|
|
1708
|
+
// noop
|
|
1709
|
+
renderFallbackValue: null,
|
|
1710
|
+
mergeOptions(l, r) {
|
|
1711
|
+
return o ? {
|
|
1712
|
+
...l,
|
|
1713
|
+
...r
|
|
1714
|
+
} : ke(l, r);
|
|
1715
|
+
}
|
|
1716
|
+
}, o ? Bt(e) : e), n = jo(t);
|
|
1717
|
+
if (o) {
|
|
1718
|
+
const l = Et(e.data);
|
|
1719
|
+
Fe(l, () => {
|
|
1720
|
+
n.setState((r) => ({
|
|
1721
|
+
...r,
|
|
1722
|
+
data: l.value
|
|
1723
|
+
}));
|
|
1724
|
+
}, {
|
|
1725
|
+
immediate: !0
|
|
1726
|
+
});
|
|
1727
|
+
}
|
|
1728
|
+
const i = k(n.initialState);
|
|
1729
|
+
return dn(() => {
|
|
1730
|
+
n.setOptions((l) => {
|
|
1731
|
+
var r;
|
|
1732
|
+
const s = new Proxy({}, {
|
|
1733
|
+
get: (a, u) => i.value[u]
|
|
1734
|
+
});
|
|
1735
|
+
return ke(l, o ? Bt(e) : e, {
|
|
1736
|
+
// merge the initialState and `options.state`
|
|
1737
|
+
// create a new proxy on each `setOptions` call
|
|
1738
|
+
// and get the value from state on each property access
|
|
1739
|
+
state: ke(s, (r = e.state) != null ? r : {}),
|
|
1740
|
+
// Similarly, we'll maintain both our internal state and any user-provided
|
|
1741
|
+
// state.
|
|
1742
|
+
onStateChange: (a) => {
|
|
1743
|
+
a instanceof Function ? i.value = a(i.value) : i.value = a, e.onStateChange == null || e.onStateChange(a);
|
|
1744
|
+
}
|
|
1745
|
+
});
|
|
1746
|
+
});
|
|
1747
|
+
}), n;
|
|
1748
|
+
}
|
|
1749
|
+
function Pe(e, o, t) {
|
|
1750
|
+
let n = t.initialDeps ?? [], i, l = !0;
|
|
1751
|
+
function r() {
|
|
1752
|
+
var s, a, u;
|
|
1753
|
+
let c;
|
|
1754
|
+
t.key && ((s = t.debug) != null && s.call(t)) && (c = Date.now());
|
|
1755
|
+
const f = e();
|
|
1756
|
+
if (!(f.length !== n.length || f.some((m, p) => n[p] !== m)))
|
|
1757
|
+
return i;
|
|
1758
|
+
n = f;
|
|
1759
|
+
let d;
|
|
1760
|
+
if (t.key && ((a = t.debug) != null && a.call(t)) && (d = Date.now()), i = o(...f), t.key && ((u = t.debug) != null && u.call(t))) {
|
|
1761
|
+
const m = Math.round((Date.now() - c) * 100) / 100, p = Math.round((Date.now() - d) * 100) / 100, v = p / 16, C = (S, x) => {
|
|
1762
|
+
for (S = String(S); S.length < x; )
|
|
1763
|
+
S = " " + S;
|
|
1764
|
+
return S;
|
|
1765
|
+
};
|
|
1766
|
+
console.info(
|
|
1767
|
+
`%c⏱ ${C(p, 5)} /${C(m, 5)} ms`,
|
|
1768
|
+
`
|
|
1769
|
+
font-size: .6rem;
|
|
1770
|
+
font-weight: bold;
|
|
1771
|
+
color: hsl(${Math.max(
|
|
1772
|
+
0,
|
|
1773
|
+
Math.min(120 - 120 * v, 120)
|
|
1774
|
+
)}deg 100% 31%);`,
|
|
1775
|
+
t?.key
|
|
1776
|
+
);
|
|
1777
|
+
}
|
|
1778
|
+
return t?.onChange && !(l && t.skipInitialOnChange) && t.onChange(i), l = !1, i;
|
|
1779
|
+
}
|
|
1780
|
+
return r.updateDeps = (s) => {
|
|
1781
|
+
n = s;
|
|
1782
|
+
}, r;
|
|
1783
|
+
}
|
|
1784
|
+
function Wt(e, o) {
|
|
1785
|
+
if (e === void 0)
|
|
1786
|
+
throw new Error("Unexpected undefined");
|
|
1787
|
+
return e;
|
|
1788
|
+
}
|
|
1789
|
+
const Qo = (e, o) => Math.abs(e - o) < 1.01, Zo = (e, o, t) => {
|
|
1790
|
+
let n;
|
|
1791
|
+
return function(...i) {
|
|
1792
|
+
e.clearTimeout(n), n = e.setTimeout(() => o.apply(this, i), t);
|
|
1793
|
+
};
|
|
1794
|
+
}, jt = (e) => {
|
|
1795
|
+
const { offsetWidth: o, offsetHeight: t } = e;
|
|
1796
|
+
return { width: o, height: t };
|
|
1797
|
+
}, ei = (e) => e, ti = (e) => {
|
|
1798
|
+
const o = Math.max(e.startIndex - e.overscan, 0), t = Math.min(e.endIndex + e.overscan, e.count - 1), n = [];
|
|
1799
|
+
for (let i = o; i <= t; i++)
|
|
1800
|
+
n.push(i);
|
|
1801
|
+
return n;
|
|
1802
|
+
}, ni = (e, o) => {
|
|
1803
|
+
const t = e.scrollElement;
|
|
1804
|
+
if (!t)
|
|
1805
|
+
return;
|
|
1806
|
+
const n = e.targetWindow;
|
|
1807
|
+
if (!n)
|
|
1808
|
+
return;
|
|
1809
|
+
const i = (r) => {
|
|
1810
|
+
const { width: s, height: a } = r;
|
|
1811
|
+
o({ width: Math.round(s), height: Math.round(a) });
|
|
1812
|
+
};
|
|
1813
|
+
if (i(jt(t)), !n.ResizeObserver)
|
|
1814
|
+
return () => {
|
|
1815
|
+
};
|
|
1816
|
+
const l = new n.ResizeObserver((r) => {
|
|
1817
|
+
const s = () => {
|
|
1818
|
+
const a = r[0];
|
|
1819
|
+
if (a?.borderBoxSize) {
|
|
1820
|
+
const u = a.borderBoxSize[0];
|
|
1821
|
+
if (u) {
|
|
1822
|
+
i({ width: u.inlineSize, height: u.blockSize });
|
|
1823
|
+
return;
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
i(jt(t));
|
|
1827
|
+
};
|
|
1828
|
+
e.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(s) : s();
|
|
1829
|
+
});
|
|
1830
|
+
return l.observe(t, { box: "border-box" }), () => {
|
|
1831
|
+
l.unobserve(t);
|
|
1832
|
+
};
|
|
1833
|
+
}, qt = {
|
|
1834
|
+
passive: !0
|
|
1835
|
+
}, Kt = typeof window > "u" ? !0 : "onscrollend" in window, oi = (e, o) => {
|
|
1836
|
+
const t = e.scrollElement;
|
|
1837
|
+
if (!t)
|
|
1838
|
+
return;
|
|
1839
|
+
const n = e.targetWindow;
|
|
1840
|
+
if (!n)
|
|
1841
|
+
return;
|
|
1842
|
+
let i = 0;
|
|
1843
|
+
const l = e.options.useScrollendEvent && Kt ? () => {
|
|
1844
|
+
} : Zo(
|
|
1845
|
+
n,
|
|
1846
|
+
() => {
|
|
1847
|
+
o(i, !1);
|
|
1848
|
+
},
|
|
1849
|
+
e.options.isScrollingResetDelay
|
|
1850
|
+
), r = (c) => () => {
|
|
1851
|
+
const { horizontal: f, isRtl: g } = e.options;
|
|
1852
|
+
i = f ? t.scrollLeft * (g && -1 || 1) : t.scrollTop, l(), o(i, c);
|
|
1853
|
+
}, s = r(!0), a = r(!1);
|
|
1854
|
+
t.addEventListener("scroll", s, qt);
|
|
1855
|
+
const u = e.options.useScrollendEvent && Kt;
|
|
1856
|
+
return u && t.addEventListener("scrollend", a, qt), () => {
|
|
1857
|
+
t.removeEventListener("scroll", s), u && t.removeEventListener("scrollend", a);
|
|
1858
|
+
};
|
|
1859
|
+
}, ii = (e, o, t) => {
|
|
1860
|
+
if (o?.borderBoxSize) {
|
|
1861
|
+
const n = o.borderBoxSize[0];
|
|
1862
|
+
if (n)
|
|
1863
|
+
return Math.round(
|
|
1864
|
+
n[t.options.horizontal ? "inlineSize" : "blockSize"]
|
|
1865
|
+
);
|
|
1866
|
+
}
|
|
1867
|
+
return e[t.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
1868
|
+
}, li = (e, {
|
|
1869
|
+
adjustments: o = 0,
|
|
1870
|
+
behavior: t
|
|
1871
|
+
}, n) => {
|
|
1872
|
+
var i, l;
|
|
1873
|
+
const r = e + o;
|
|
1874
|
+
(l = (i = n.scrollElement) == null ? void 0 : i.scrollTo) == null || l.call(i, {
|
|
1875
|
+
[n.options.horizontal ? "left" : "top"]: r,
|
|
1876
|
+
behavior: t
|
|
1877
|
+
});
|
|
1878
|
+
};
|
|
1879
|
+
class ri {
|
|
1880
|
+
constructor(o) {
|
|
1881
|
+
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.currentScrollToIndex = 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.observer = /* @__PURE__ */ (() => {
|
|
1882
|
+
let t = null;
|
|
1883
|
+
const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((i) => {
|
|
1884
|
+
i.forEach((l) => {
|
|
1885
|
+
const r = () => {
|
|
1886
|
+
this._measureElement(l.target, l);
|
|
1887
|
+
};
|
|
1888
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(r) : r();
|
|
1889
|
+
});
|
|
1890
|
+
}));
|
|
1891
|
+
return {
|
|
1892
|
+
disconnect: () => {
|
|
1893
|
+
var i;
|
|
1894
|
+
(i = n()) == null || i.disconnect(), t = null;
|
|
1895
|
+
},
|
|
1896
|
+
observe: (i) => {
|
|
1897
|
+
var l;
|
|
1898
|
+
return (l = n()) == null ? void 0 : l.observe(i, { box: "border-box" });
|
|
1899
|
+
},
|
|
1900
|
+
unobserve: (i) => {
|
|
1901
|
+
var l;
|
|
1902
|
+
return (l = n()) == null ? void 0 : l.unobserve(i);
|
|
1903
|
+
}
|
|
1904
|
+
};
|
|
1905
|
+
})(), this.range = null, this.setOptions = (t) => {
|
|
1906
|
+
Object.entries(t).forEach(([n, i]) => {
|
|
1907
|
+
typeof i > "u" && delete t[n];
|
|
1908
|
+
}), this.options = {
|
|
1909
|
+
debug: !1,
|
|
1910
|
+
initialOffset: 0,
|
|
1911
|
+
overscan: 1,
|
|
1912
|
+
paddingStart: 0,
|
|
1913
|
+
paddingEnd: 0,
|
|
1914
|
+
scrollPaddingStart: 0,
|
|
1915
|
+
scrollPaddingEnd: 0,
|
|
1916
|
+
horizontal: !1,
|
|
1917
|
+
getItemKey: ei,
|
|
1918
|
+
rangeExtractor: ti,
|
|
1919
|
+
onChange: () => {
|
|
1920
|
+
},
|
|
1921
|
+
measureElement: ii,
|
|
1922
|
+
initialRect: { width: 0, height: 0 },
|
|
1923
|
+
scrollMargin: 0,
|
|
1924
|
+
gap: 0,
|
|
1925
|
+
indexAttribute: "data-index",
|
|
1926
|
+
initialMeasurementsCache: [],
|
|
1927
|
+
lanes: 1,
|
|
1928
|
+
isScrollingResetDelay: 150,
|
|
1929
|
+
enabled: !0,
|
|
1930
|
+
isRtl: !1,
|
|
1931
|
+
useScrollendEvent: !1,
|
|
1932
|
+
useAnimationFrameWithResizeObserver: !1,
|
|
1933
|
+
...t
|
|
1934
|
+
};
|
|
1935
|
+
}, this.notify = (t) => {
|
|
1936
|
+
var n, i;
|
|
1937
|
+
(i = (n = this.options).onChange) == null || i.call(n, this, t);
|
|
1938
|
+
}, this.maybeNotify = Pe(
|
|
1939
|
+
() => (this.calculateRange(), [
|
|
1940
|
+
this.isScrolling,
|
|
1941
|
+
this.range ? this.range.startIndex : null,
|
|
1942
|
+
this.range ? this.range.endIndex : null
|
|
1943
|
+
]),
|
|
1944
|
+
(t) => {
|
|
1945
|
+
this.notify(t);
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
1949
|
+
debug: () => this.options.debug,
|
|
1950
|
+
initialDeps: [
|
|
1951
|
+
this.isScrolling,
|
|
1952
|
+
this.range ? this.range.startIndex : null,
|
|
1953
|
+
this.range ? this.range.endIndex : null
|
|
1954
|
+
]
|
|
1955
|
+
}
|
|
1956
|
+
), this.cleanup = () => {
|
|
1957
|
+
this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
|
|
1958
|
+
}, this._didMount = () => () => {
|
|
1959
|
+
this.cleanup();
|
|
1960
|
+
}, this._willUpdate = () => {
|
|
1961
|
+
var t;
|
|
1962
|
+
const n = this.options.enabled ? this.options.getScrollElement() : null;
|
|
1963
|
+
if (this.scrollElement !== n) {
|
|
1964
|
+
if (this.cleanup(), !n) {
|
|
1965
|
+
this.maybeNotify();
|
|
1966
|
+
return;
|
|
1967
|
+
}
|
|
1968
|
+
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((i) => {
|
|
1969
|
+
this.observer.observe(i);
|
|
1970
|
+
}), this.unsubs.push(
|
|
1971
|
+
this.options.observeElementRect(this, (i) => {
|
|
1972
|
+
this.scrollRect = i, this.maybeNotify();
|
|
1973
|
+
})
|
|
1974
|
+
), this.unsubs.push(
|
|
1975
|
+
this.options.observeElementOffset(this, (i, l) => {
|
|
1976
|
+
this.scrollAdjustments = 0, this.scrollDirection = l ? this.getScrollOffset() < i ? "forward" : "backward" : null, this.scrollOffset = i, this.isScrolling = l, this.maybeNotify();
|
|
1977
|
+
})
|
|
1978
|
+
), this._scrollToOffset(this.getScrollOffset(), {
|
|
1979
|
+
adjustments: void 0,
|
|
1980
|
+
behavior: void 0
|
|
1981
|
+
});
|
|
1982
|
+
}
|
|
1983
|
+
}, 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) => {
|
|
1984
|
+
const i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
1985
|
+
for (let r = n - 1; r >= 0; r--) {
|
|
1986
|
+
const s = t[r];
|
|
1987
|
+
if (i.has(s.lane))
|
|
1988
|
+
continue;
|
|
1989
|
+
const a = l.get(
|
|
1990
|
+
s.lane
|
|
1991
|
+
);
|
|
1992
|
+
if (a == null || s.end > a.end ? l.set(s.lane, s) : s.end < a.end && i.set(s.lane, !0), i.size === this.options.lanes)
|
|
1993
|
+
break;
|
|
1994
|
+
}
|
|
1995
|
+
return l.size === this.options.lanes ? Array.from(l.values()).sort((r, s) => r.end === s.end ? r.index - s.index : r.end - s.end)[0] : void 0;
|
|
1996
|
+
}, this.getMeasurementOptions = Pe(
|
|
1997
|
+
() => [
|
|
1998
|
+
this.options.count,
|
|
1999
|
+
this.options.paddingStart,
|
|
2000
|
+
this.options.scrollMargin,
|
|
2001
|
+
this.options.getItemKey,
|
|
2002
|
+
this.options.enabled,
|
|
2003
|
+
this.options.lanes
|
|
2004
|
+
],
|
|
2005
|
+
(t, n, i, l, r, s) => (this.prevLanes !== void 0 && this.prevLanes !== s && (this.lanesChangedFlag = !0), this.prevLanes = s, this.pendingMeasuredCacheIndexes = [], {
|
|
2006
|
+
count: t,
|
|
2007
|
+
paddingStart: n,
|
|
2008
|
+
scrollMargin: i,
|
|
2009
|
+
getItemKey: l,
|
|
2010
|
+
enabled: r,
|
|
2011
|
+
lanes: s
|
|
2012
|
+
}),
|
|
2013
|
+
{
|
|
2014
|
+
key: !1
|
|
2015
|
+
}
|
|
2016
|
+
), this.getMeasurements = Pe(
|
|
2017
|
+
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
2018
|
+
({ count: t, paddingStart: n, scrollMargin: i, getItemKey: l, enabled: r, lanes: s }, a) => {
|
|
2019
|
+
if (!r)
|
|
2020
|
+
return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
2021
|
+
if (this.laneAssignments.size > t)
|
|
2022
|
+
for (const g of this.laneAssignments.keys())
|
|
2023
|
+
g >= t && this.laneAssignments.delete(g);
|
|
2024
|
+
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((g) => {
|
|
2025
|
+
this.itemSizeCache.set(g.key, g.size);
|
|
2026
|
+
}));
|
|
2027
|
+
const u = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
2028
|
+
this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === t && (this.lanesSettling = !1);
|
|
2029
|
+
const c = this.measurementsCache.slice(0, u), f = new Array(s).fill(
|
|
2030
|
+
void 0
|
|
2031
|
+
);
|
|
2032
|
+
for (let g = 0; g < u; g++) {
|
|
2033
|
+
const d = c[g];
|
|
2034
|
+
d && (f[d.lane] = g);
|
|
2035
|
+
}
|
|
2036
|
+
for (let g = u; g < t; g++) {
|
|
2037
|
+
const d = l(g), m = this.laneAssignments.get(g);
|
|
2038
|
+
let p, v;
|
|
2039
|
+
if (m !== void 0 && this.options.lanes > 1) {
|
|
2040
|
+
p = m;
|
|
2041
|
+
const P = f[p], A = P !== void 0 ? c[P] : void 0;
|
|
2042
|
+
v = A ? A.end + this.options.gap : n + i;
|
|
2043
|
+
} else {
|
|
2044
|
+
const P = this.options.lanes === 1 ? c[g - 1] : this.getFurthestMeasurement(c, g);
|
|
2045
|
+
v = P ? P.end + this.options.gap : n + i, p = P ? P.lane : g % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(g, p);
|
|
2046
|
+
}
|
|
2047
|
+
const C = a.get(d), S = typeof C == "number" ? C : this.options.estimateSize(g), x = v + S;
|
|
2048
|
+
c[g] = {
|
|
2049
|
+
index: g,
|
|
2050
|
+
start: v,
|
|
2051
|
+
size: S,
|
|
2052
|
+
end: x,
|
|
2053
|
+
key: d,
|
|
2054
|
+
lane: p
|
|
2055
|
+
}, f[p] = g;
|
|
2056
|
+
}
|
|
2057
|
+
return this.measurementsCache = c, c;
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
2061
|
+
debug: () => this.options.debug
|
|
2062
|
+
}
|
|
2063
|
+
), this.calculateRange = Pe(
|
|
2064
|
+
() => [
|
|
2065
|
+
this.getMeasurements(),
|
|
2066
|
+
this.getSize(),
|
|
2067
|
+
this.getScrollOffset(),
|
|
2068
|
+
this.options.lanes
|
|
2069
|
+
],
|
|
2070
|
+
(t, n, i, l) => this.range = t.length > 0 && n > 0 ? si({
|
|
2071
|
+
measurements: t,
|
|
2072
|
+
outerSize: n,
|
|
2073
|
+
scrollOffset: i,
|
|
2074
|
+
lanes: l
|
|
2075
|
+
}) : null,
|
|
2076
|
+
{
|
|
2077
|
+
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
2078
|
+
debug: () => this.options.debug
|
|
2079
|
+
}
|
|
2080
|
+
), this.getVirtualIndexes = Pe(
|
|
2081
|
+
() => {
|
|
2082
|
+
let t = null, n = null;
|
|
2083
|
+
const i = this.calculateRange();
|
|
2084
|
+
return i && (t = i.startIndex, n = i.endIndex), this.maybeNotify.updateDeps([this.isScrolling, t, n]), [
|
|
2085
|
+
this.options.rangeExtractor,
|
|
2086
|
+
this.options.overscan,
|
|
2087
|
+
this.options.count,
|
|
2088
|
+
t,
|
|
2089
|
+
n
|
|
2090
|
+
];
|
|
2091
|
+
},
|
|
2092
|
+
(t, n, i, l, r) => l === null || r === null ? [] : t({
|
|
2093
|
+
startIndex: l,
|
|
2094
|
+
endIndex: r,
|
|
2095
|
+
overscan: n,
|
|
2096
|
+
count: i
|
|
2097
|
+
}),
|
|
2098
|
+
{
|
|
2099
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
2100
|
+
debug: () => this.options.debug
|
|
2101
|
+
}
|
|
2102
|
+
), this.indexFromElement = (t) => {
|
|
2103
|
+
const n = this.options.indexAttribute, i = t.getAttribute(n);
|
|
2104
|
+
return i ? parseInt(i, 10) : (console.warn(
|
|
2105
|
+
`Missing attribute name '${n}={index}' on measured element.`
|
|
2106
|
+
), -1);
|
|
2107
|
+
}, this._measureElement = (t, n) => {
|
|
2108
|
+
const i = this.indexFromElement(t), l = this.measurementsCache[i];
|
|
2109
|
+
if (!l)
|
|
2110
|
+
return;
|
|
2111
|
+
const r = l.key, s = this.elementsCache.get(r);
|
|
2112
|
+
s !== t && (s && this.observer.unobserve(s), this.observer.observe(t), this.elementsCache.set(r, t)), t.isConnected && this.resizeItem(i, this.options.measureElement(t, n, this));
|
|
2113
|
+
}, this.resizeItem = (t, n) => {
|
|
2114
|
+
const i = this.measurementsCache[t];
|
|
2115
|
+
if (!i)
|
|
2116
|
+
return;
|
|
2117
|
+
const l = this.itemSizeCache.get(i.key) ?? i.size, r = n - l;
|
|
2118
|
+
r !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(i, r, this) : i.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", r), this._scrollToOffset(this.getScrollOffset(), {
|
|
2119
|
+
adjustments: this.scrollAdjustments += r,
|
|
2120
|
+
behavior: void 0
|
|
2121
|
+
})), this.pendingMeasuredCacheIndexes.push(i.index), this.itemSizeCache = new Map(this.itemSizeCache.set(i.key, n)), this.notify(!1));
|
|
2122
|
+
}, this.measureElement = (t) => {
|
|
2123
|
+
if (!t) {
|
|
2124
|
+
this.elementsCache.forEach((n, i) => {
|
|
2125
|
+
n.isConnected || (this.observer.unobserve(n), this.elementsCache.delete(i));
|
|
2126
|
+
});
|
|
2127
|
+
return;
|
|
2128
|
+
}
|
|
2129
|
+
this._measureElement(t, void 0);
|
|
2130
|
+
}, this.getVirtualItems = Pe(
|
|
2131
|
+
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
2132
|
+
(t, n) => {
|
|
2133
|
+
const i = [];
|
|
2134
|
+
for (let l = 0, r = t.length; l < r; l++) {
|
|
2135
|
+
const s = t[l], a = n[s];
|
|
2136
|
+
i.push(a);
|
|
2137
|
+
}
|
|
2138
|
+
return i;
|
|
2139
|
+
},
|
|
2140
|
+
{
|
|
2141
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
2142
|
+
debug: () => this.options.debug
|
|
2143
|
+
}
|
|
2144
|
+
), this.getVirtualItemForOffset = (t) => {
|
|
2145
|
+
const n = this.getMeasurements();
|
|
2146
|
+
if (n.length !== 0)
|
|
2147
|
+
return Wt(
|
|
2148
|
+
n[Mn(
|
|
2149
|
+
0,
|
|
2150
|
+
n.length - 1,
|
|
2151
|
+
(i) => Wt(n[i]).start,
|
|
2152
|
+
t
|
|
2153
|
+
)]
|
|
2154
|
+
);
|
|
2155
|
+
}, this.getMaxScrollOffset = () => {
|
|
2156
|
+
if (!this.scrollElement) return 0;
|
|
2157
|
+
if ("scrollHeight" in this.scrollElement)
|
|
2158
|
+
return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
2159
|
+
{
|
|
2160
|
+
const t = this.scrollElement.document.documentElement;
|
|
2161
|
+
return this.options.horizontal ? t.scrollWidth - this.scrollElement.innerWidth : t.scrollHeight - this.scrollElement.innerHeight;
|
|
2162
|
+
}
|
|
2163
|
+
}, this.getOffsetForAlignment = (t, n, i = 0) => {
|
|
2164
|
+
if (!this.scrollElement) return 0;
|
|
2165
|
+
const l = this.getSize(), r = this.getScrollOffset();
|
|
2166
|
+
n === "auto" && (n = t >= r + l ? "end" : "start"), n === "center" ? t += (i - l) / 2 : n === "end" && (t -= l);
|
|
2167
|
+
const s = this.getMaxScrollOffset();
|
|
2168
|
+
return Math.max(Math.min(s, t), 0);
|
|
2169
|
+
}, this.getOffsetForIndex = (t, n = "auto") => {
|
|
2170
|
+
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
2171
|
+
const i = this.measurementsCache[t];
|
|
2172
|
+
if (!i)
|
|
2173
|
+
return;
|
|
2174
|
+
const l = this.getSize(), r = this.getScrollOffset();
|
|
2175
|
+
if (n === "auto")
|
|
2176
|
+
if (i.end >= r + l - this.options.scrollPaddingEnd)
|
|
2177
|
+
n = "end";
|
|
2178
|
+
else if (i.start <= r + this.options.scrollPaddingStart)
|
|
2179
|
+
n = "start";
|
|
2180
|
+
else
|
|
2181
|
+
return [r, n];
|
|
2182
|
+
if (n === "end" && t === this.options.count - 1)
|
|
2183
|
+
return [this.getMaxScrollOffset(), n];
|
|
2184
|
+
const s = n === "end" ? i.end + this.options.scrollPaddingEnd : i.start - this.options.scrollPaddingStart;
|
|
2185
|
+
return [
|
|
2186
|
+
this.getOffsetForAlignment(s, n, i.size),
|
|
2187
|
+
n
|
|
2188
|
+
];
|
|
2189
|
+
}, this.isDynamicMode = () => this.elementsCache.size > 0, this.scrollToOffset = (t, { align: n = "start", behavior: i } = {}) => {
|
|
2190
|
+
i === "smooth" && this.isDynamicMode() && console.warn(
|
|
2191
|
+
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
2192
|
+
), this._scrollToOffset(this.getOffsetForAlignment(t, n), {
|
|
2193
|
+
adjustments: void 0,
|
|
2194
|
+
behavior: i
|
|
2195
|
+
});
|
|
2196
|
+
}, this.scrollToIndex = (t, { align: n = "auto", behavior: i } = {}) => {
|
|
2197
|
+
i === "smooth" && this.isDynamicMode() && console.warn(
|
|
2198
|
+
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
2199
|
+
), t = Math.max(0, Math.min(t, this.options.count - 1)), this.currentScrollToIndex = t;
|
|
2200
|
+
let l = 0;
|
|
2201
|
+
const r = 10, s = (u) => {
|
|
2202
|
+
if (!this.targetWindow) return;
|
|
2203
|
+
const c = this.getOffsetForIndex(t, u);
|
|
2204
|
+
if (!c) {
|
|
2205
|
+
console.warn("Failed to get offset for index:", t);
|
|
2206
|
+
return;
|
|
2207
|
+
}
|
|
2208
|
+
const [f, g] = c;
|
|
2209
|
+
this._scrollToOffset(f, { adjustments: void 0, behavior: i }), this.targetWindow.requestAnimationFrame(() => {
|
|
2210
|
+
if (!this.targetWindow) return;
|
|
2211
|
+
const d = () => {
|
|
2212
|
+
if (this.currentScrollToIndex !== t) return;
|
|
2213
|
+
const m = this.getScrollOffset(), p = this.getOffsetForIndex(t, g);
|
|
2214
|
+
if (!p) {
|
|
2215
|
+
console.warn("Failed to get offset for index:", t);
|
|
2216
|
+
return;
|
|
2217
|
+
}
|
|
2218
|
+
Qo(p[0], m) || a(g);
|
|
2219
|
+
};
|
|
2220
|
+
this.isDynamicMode() ? this.targetWindow.requestAnimationFrame(d) : d();
|
|
2221
|
+
});
|
|
2222
|
+
}, a = (u) => {
|
|
2223
|
+
this.targetWindow && this.currentScrollToIndex === t && (l++, l < r ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", l, r), this.targetWindow.requestAnimationFrame(() => s(u))) : console.warn(
|
|
2224
|
+
`Failed to scroll to index ${t} after ${r} attempts.`
|
|
2225
|
+
));
|
|
2226
|
+
};
|
|
2227
|
+
s(n);
|
|
2228
|
+
}, this.scrollBy = (t, { behavior: n } = {}) => {
|
|
2229
|
+
n === "smooth" && this.isDynamicMode() && console.warn(
|
|
2230
|
+
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
2231
|
+
), this._scrollToOffset(this.getScrollOffset() + t, {
|
|
2232
|
+
adjustments: void 0,
|
|
2233
|
+
behavior: n
|
|
2234
|
+
});
|
|
2235
|
+
}, this.getTotalSize = () => {
|
|
2236
|
+
var t;
|
|
2237
|
+
const n = this.getMeasurements();
|
|
2238
|
+
let i;
|
|
2239
|
+
if (n.length === 0)
|
|
2240
|
+
i = this.options.paddingStart;
|
|
2241
|
+
else if (this.options.lanes === 1)
|
|
2242
|
+
i = ((t = n[n.length - 1]) == null ? void 0 : t.end) ?? 0;
|
|
2243
|
+
else {
|
|
2244
|
+
const l = Array(this.options.lanes).fill(null);
|
|
2245
|
+
let r = n.length - 1;
|
|
2246
|
+
for (; r >= 0 && l.some((s) => s === null); ) {
|
|
2247
|
+
const s = n[r];
|
|
2248
|
+
l[s.lane] === null && (l[s.lane] = s.end), r--;
|
|
2249
|
+
}
|
|
2250
|
+
i = Math.max(...l.filter((s) => s !== null));
|
|
2251
|
+
}
|
|
2252
|
+
return Math.max(
|
|
2253
|
+
i - this.options.scrollMargin + this.options.paddingEnd,
|
|
2254
|
+
0
|
|
2255
|
+
);
|
|
2256
|
+
}, this._scrollToOffset = (t, {
|
|
2257
|
+
adjustments: n,
|
|
2258
|
+
behavior: i
|
|
2259
|
+
}) => {
|
|
2260
|
+
this.options.scrollToFn(t, { behavior: i, adjustments: n }, this);
|
|
2261
|
+
}, this.measure = () => {
|
|
2262
|
+
this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.notify(!1);
|
|
2263
|
+
}, this.setOptions(o);
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
const Mn = (e, o, t, n) => {
|
|
2267
|
+
for (; e <= o; ) {
|
|
2268
|
+
const i = (e + o) / 2 | 0, l = t(i);
|
|
2269
|
+
if (l < n)
|
|
2270
|
+
e = i + 1;
|
|
2271
|
+
else if (l > n)
|
|
2272
|
+
o = i - 1;
|
|
2273
|
+
else
|
|
2274
|
+
return i;
|
|
2275
|
+
}
|
|
2276
|
+
return e > 0 ? e - 1 : 0;
|
|
2277
|
+
};
|
|
2278
|
+
function si({
|
|
2279
|
+
measurements: e,
|
|
2280
|
+
outerSize: o,
|
|
2281
|
+
scrollOffset: t,
|
|
2282
|
+
lanes: n
|
|
2283
|
+
}) {
|
|
2284
|
+
const i = e.length - 1, l = (a) => e[a].start;
|
|
2285
|
+
if (e.length <= n)
|
|
2286
|
+
return {
|
|
2287
|
+
startIndex: 0,
|
|
2288
|
+
endIndex: i
|
|
2289
|
+
};
|
|
2290
|
+
let r = Mn(
|
|
2291
|
+
0,
|
|
2292
|
+
i,
|
|
2293
|
+
l,
|
|
2294
|
+
t
|
|
2295
|
+
), s = r;
|
|
2296
|
+
if (n === 1)
|
|
2297
|
+
for (; s < i && e[s].end < t + o; )
|
|
2298
|
+
s++;
|
|
2299
|
+
else if (n > 1) {
|
|
2300
|
+
const a = Array(n).fill(0);
|
|
2301
|
+
for (; s < i && a.some((c) => c < t + o); ) {
|
|
2302
|
+
const c = e[s];
|
|
2303
|
+
a[c.lane] = c.end, s++;
|
|
2304
|
+
}
|
|
2305
|
+
const u = Array(n).fill(t + o);
|
|
2306
|
+
for (; r >= 0 && u.some((c) => c >= t); ) {
|
|
2307
|
+
const c = e[r];
|
|
2308
|
+
u[c.lane] = c.start, r--;
|
|
2309
|
+
}
|
|
2310
|
+
r = Math.max(0, r - r % n), s = Math.min(i, s + (n - 1 - s % n));
|
|
2311
|
+
}
|
|
2312
|
+
return { startIndex: r, endIndex: s };
|
|
2313
|
+
}
|
|
2314
|
+
function ai(e) {
|
|
2315
|
+
const o = new ri(w(e)), t = Et(o), n = o._didMount();
|
|
2316
|
+
return Fe(
|
|
2317
|
+
() => w(e).getScrollElement(),
|
|
2318
|
+
(i) => {
|
|
2319
|
+
i && o._willUpdate();
|
|
2320
|
+
},
|
|
2321
|
+
{
|
|
2322
|
+
immediate: !0
|
|
2323
|
+
}
|
|
2324
|
+
), Fe(
|
|
2325
|
+
() => w(e),
|
|
2326
|
+
(i) => {
|
|
2327
|
+
o.setOptions({
|
|
2328
|
+
...i,
|
|
2329
|
+
onChange: (l, r) => {
|
|
2330
|
+
var s;
|
|
2331
|
+
kt(t), (s = i.onChange) == null || s.call(i, l, r);
|
|
2332
|
+
}
|
|
2333
|
+
}), o._willUpdate(), kt(t);
|
|
2334
|
+
},
|
|
2335
|
+
{
|
|
2336
|
+
immediate: !0
|
|
2337
|
+
}
|
|
2338
|
+
), gn(n), t;
|
|
2339
|
+
}
|
|
2340
|
+
function ui(e) {
|
|
2341
|
+
return ai(
|
|
2342
|
+
R(() => ({
|
|
2343
|
+
observeElementRect: ni,
|
|
2344
|
+
observeElementOffset: oi,
|
|
2345
|
+
scrollToFn: li,
|
|
2346
|
+
...w(e)
|
|
2347
|
+
}))
|
|
2348
|
+
);
|
|
2349
|
+
}
|
|
2350
|
+
const ci = /* @__PURE__ */ K({
|
|
2351
|
+
name: "BodyCell",
|
|
2352
|
+
__name: "BodyCell",
|
|
2353
|
+
props: {
|
|
2354
|
+
cell: {}
|
|
2355
|
+
},
|
|
2356
|
+
setup(e) {
|
|
2357
|
+
const o = e, t = R(() => {
|
|
2358
|
+
const n = o.cell.column.columnDef.cell;
|
|
2359
|
+
if (typeof n == "function") {
|
|
2360
|
+
const i = n(o.cell.getContext());
|
|
2361
|
+
return typeof i == "string" ? q("span", i) : i;
|
|
2362
|
+
}
|
|
2363
|
+
return q("span", o.cell.getValue() ?? "");
|
|
2364
|
+
});
|
|
2365
|
+
return (n, i) => L(n.$slots, "bodyCell", {
|
|
2366
|
+
row: e.cell.row.original,
|
|
2367
|
+
column: e.cell.column.columnDef.meta,
|
|
2368
|
+
columnKey: e.cell.column.id,
|
|
2369
|
+
rowIndex: e.cell.row.index
|
|
2370
|
+
}, () => [
|
|
2371
|
+
(y(), Z(It(t.value)))
|
|
2372
|
+
]);
|
|
2373
|
+
}
|
|
2374
|
+
}), di = { class: "sorter-icon inline-flex flex-col items-center" }, gi = /* @__PURE__ */ K({
|
|
2375
|
+
name: "SorterIcon",
|
|
2376
|
+
__name: "SorterIcon",
|
|
2377
|
+
props: {
|
|
2378
|
+
sort: {}
|
|
2379
|
+
},
|
|
2380
|
+
setup(e) {
|
|
2381
|
+
return (o, t) => (y(), I("div", di, [
|
|
2382
|
+
(y(), I("svg", {
|
|
2383
|
+
class: H(["sorter-up h-[10px] w-[10px]", { "text-[#1677ff]": e.sort === "asc" }]),
|
|
2384
|
+
viewBox: "0 0 1024 1024",
|
|
2385
|
+
version: "1.1",
|
|
2386
|
+
fill: "currentColor",
|
|
2387
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2388
|
+
}, [...t[0] || (t[0] = [
|
|
2389
|
+
b("path", { d: "M76.3 632.8l405.1-489.1c16.9-18.9 46.5-18.9 63.4 0l403.1 489.1c24.4 27.4 5 70.8-31.7 70.8H107.9c-36.6 0-56.1-43.4-31.6-70.8z" }, null, -1)
|
|
2390
|
+
])], 2)),
|
|
2391
|
+
(y(), I("svg", {
|
|
2392
|
+
class: H(["sorter-down h-[10px] w-[10px]", { "text-[#1677ff]": e.sort === "desc" }]),
|
|
2393
|
+
viewBox: "0 0 1024 1024",
|
|
2394
|
+
version: "1.1",
|
|
2395
|
+
fill: "currentColor",
|
|
2396
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2397
|
+
}, [...t[1] || (t[1] = [
|
|
2398
|
+
b("path", { d: "M76.3 392.3l403.1 489.1c16.9 18.9 46.5 18.9 63.4 0l405.1-489.1c24.4-27.4 5-70.8-31.7-70.8H108.1c-36.8 0-56.3 43.4-31.8 70.8z" }, null, -1)
|
|
2399
|
+
])], 2))
|
|
2400
|
+
]));
|
|
2401
|
+
}
|
|
2402
|
+
}), de = (e, o) => {
|
|
2403
|
+
const t = e.__vccOpts || e;
|
|
2404
|
+
for (const [n, i] of o)
|
|
2405
|
+
t[n] = i;
|
|
2406
|
+
return t;
|
|
2407
|
+
}, fi = /* @__PURE__ */ de(gi, [["__scopeId", "data-v-e9e9deda"]]), pi = {
|
|
2408
|
+
class: "h-[12px] w-[12px]",
|
|
2409
|
+
viewBox: "0 0 1024 1024",
|
|
2410
|
+
version: "1.1",
|
|
2411
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2412
|
+
fill: "currentColor"
|
|
2413
|
+
}, hi = /* @__PURE__ */ K({
|
|
2414
|
+
name: "FilterIcon",
|
|
2415
|
+
__name: "FilterIcon",
|
|
2416
|
+
setup(e) {
|
|
2417
|
+
return (o, t) => (y(), I("svg", pi, [...t[0] || (t[0] = [
|
|
2418
|
+
b("path", { d: "M325.714286 884.571429c0 20.228571 16.228571 36.571429 36.342857 36.571428h299.885714c20.114286 0 36.342857-16.342857 36.342857-36.571428V660.571429H325.714286v224z m606.971428-781.714286H91.314286c-28 0-45.485714 30.514286-31.428572 54.857143l252.914286 429.714285h398.628571l252.914286-429.714285c13.828571-24.342857-3.657143-54.857143-31.657143-54.857143z" }, null, -1)
|
|
2419
|
+
])]));
|
|
2420
|
+
}
|
|
2421
|
+
}), _t = Math.min, be = Math.max, Ye = Math.round, re = (e) => ({
|
|
2422
|
+
x: e,
|
|
2423
|
+
y: e
|
|
2424
|
+
}), mi = {
|
|
2425
|
+
left: "right",
|
|
2426
|
+
right: "left",
|
|
2427
|
+
bottom: "top",
|
|
2428
|
+
top: "bottom"
|
|
2429
|
+
}, vi = {
|
|
2430
|
+
start: "end",
|
|
2431
|
+
end: "start"
|
|
2432
|
+
};
|
|
2433
|
+
function Ut(e, o, t) {
|
|
2434
|
+
return be(e, _t(o, t));
|
|
2435
|
+
}
|
|
2436
|
+
function et(e, o) {
|
|
2437
|
+
return typeof e == "function" ? e(o) : e;
|
|
2438
|
+
}
|
|
2439
|
+
function Me(e) {
|
|
2440
|
+
return e.split("-")[0];
|
|
2441
|
+
}
|
|
2442
|
+
function tt(e) {
|
|
2443
|
+
return e.split("-")[1];
|
|
2444
|
+
}
|
|
2445
|
+
function $n(e) {
|
|
2446
|
+
return e === "x" ? "y" : "x";
|
|
2447
|
+
}
|
|
2448
|
+
function En(e) {
|
|
2449
|
+
return e === "y" ? "height" : "width";
|
|
2450
|
+
}
|
|
2451
|
+
const Ci = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
2452
|
+
function me(e) {
|
|
2453
|
+
return Ci.has(Me(e)) ? "y" : "x";
|
|
2454
|
+
}
|
|
2455
|
+
function In(e) {
|
|
2456
|
+
return $n(me(e));
|
|
2457
|
+
}
|
|
2458
|
+
function wi(e, o, t) {
|
|
2459
|
+
t === void 0 && (t = !1);
|
|
2460
|
+
const n = tt(e), i = In(e), l = En(i);
|
|
2461
|
+
let r = i === "x" ? n === (t ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
2462
|
+
return o.reference[l] > o.floating[l] && (r = Je(r)), [r, Je(r)];
|
|
2463
|
+
}
|
|
2464
|
+
function Si(e) {
|
|
2465
|
+
const o = Je(e);
|
|
2466
|
+
return [Ft(e), o, Ft(o)];
|
|
2467
|
+
}
|
|
2468
|
+
function Ft(e) {
|
|
2469
|
+
return e.replace(/start|end/g, (o) => vi[o]);
|
|
2470
|
+
}
|
|
2471
|
+
const Xt = ["left", "right"], Yt = ["right", "left"], xi = ["top", "bottom"], yi = ["bottom", "top"];
|
|
2472
|
+
function Ri(e, o, t) {
|
|
2473
|
+
switch (e) {
|
|
2474
|
+
case "top":
|
|
2475
|
+
case "bottom":
|
|
2476
|
+
return t ? o ? Yt : Xt : o ? Xt : Yt;
|
|
2477
|
+
case "left":
|
|
2478
|
+
case "right":
|
|
2479
|
+
return o ? xi : yi;
|
|
2480
|
+
default:
|
|
2481
|
+
return [];
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
function _i(e, o, t, n) {
|
|
2485
|
+
const i = tt(e);
|
|
2486
|
+
let l = Ri(Me(e), t === "start", n);
|
|
2487
|
+
return i && (l = l.map((r) => r + "-" + i), o && (l = l.concat(l.map(Ft)))), l;
|
|
2488
|
+
}
|
|
2489
|
+
function Je(e) {
|
|
2490
|
+
return e.replace(/left|right|bottom|top/g, (o) => mi[o]);
|
|
2491
|
+
}
|
|
2492
|
+
function Fi(e) {
|
|
2493
|
+
return {
|
|
2494
|
+
top: 0,
|
|
2495
|
+
right: 0,
|
|
2496
|
+
bottom: 0,
|
|
2497
|
+
left: 0,
|
|
2498
|
+
...e
|
|
2499
|
+
};
|
|
2500
|
+
}
|
|
2501
|
+
function Mi(e) {
|
|
2502
|
+
return typeof e != "number" ? Fi(e) : {
|
|
2503
|
+
top: e,
|
|
2504
|
+
right: e,
|
|
2505
|
+
bottom: e,
|
|
2506
|
+
left: e
|
|
2507
|
+
};
|
|
2508
|
+
}
|
|
2509
|
+
function Qe(e) {
|
|
2510
|
+
const {
|
|
2511
|
+
x: o,
|
|
2512
|
+
y: t,
|
|
2513
|
+
width: n,
|
|
2514
|
+
height: i
|
|
2515
|
+
} = e;
|
|
2516
|
+
return {
|
|
2517
|
+
width: n,
|
|
2518
|
+
height: i,
|
|
2519
|
+
top: t,
|
|
2520
|
+
left: o,
|
|
2521
|
+
right: o + n,
|
|
2522
|
+
bottom: t + i,
|
|
2523
|
+
x: o,
|
|
2524
|
+
y: t
|
|
2525
|
+
};
|
|
2526
|
+
}
|
|
2527
|
+
function Jt(e, o, t) {
|
|
2528
|
+
let {
|
|
2529
|
+
reference: n,
|
|
2530
|
+
floating: i
|
|
2531
|
+
} = e;
|
|
2532
|
+
const l = me(o), r = In(o), s = En(r), a = Me(o), u = l === "y", c = n.x + n.width / 2 - i.width / 2, f = n.y + n.height / 2 - i.height / 2, g = n[s] / 2 - i[s] / 2;
|
|
2533
|
+
let d;
|
|
2534
|
+
switch (a) {
|
|
2535
|
+
case "top":
|
|
2536
|
+
d = {
|
|
2537
|
+
x: c,
|
|
2538
|
+
y: n.y - i.height
|
|
2539
|
+
};
|
|
2540
|
+
break;
|
|
2541
|
+
case "bottom":
|
|
2542
|
+
d = {
|
|
2543
|
+
x: c,
|
|
2544
|
+
y: n.y + n.height
|
|
2545
|
+
};
|
|
2546
|
+
break;
|
|
2547
|
+
case "right":
|
|
2548
|
+
d = {
|
|
2549
|
+
x: n.x + n.width,
|
|
2550
|
+
y: f
|
|
2551
|
+
};
|
|
2552
|
+
break;
|
|
2553
|
+
case "left":
|
|
2554
|
+
d = {
|
|
2555
|
+
x: n.x - i.width,
|
|
2556
|
+
y: f
|
|
2557
|
+
};
|
|
2558
|
+
break;
|
|
2559
|
+
default:
|
|
2560
|
+
d = {
|
|
2561
|
+
x: n.x,
|
|
2562
|
+
y: n.y
|
|
2563
|
+
};
|
|
2564
|
+
}
|
|
2565
|
+
switch (tt(o)) {
|
|
2566
|
+
case "start":
|
|
2567
|
+
d[r] -= g * (t && u ? -1 : 1);
|
|
2568
|
+
break;
|
|
2569
|
+
case "end":
|
|
2570
|
+
d[r] += g * (t && u ? -1 : 1);
|
|
2571
|
+
break;
|
|
2572
|
+
}
|
|
2573
|
+
return d;
|
|
2574
|
+
}
|
|
2575
|
+
async function $i(e, o) {
|
|
2576
|
+
var t;
|
|
2577
|
+
o === void 0 && (o = {});
|
|
2578
|
+
const {
|
|
2579
|
+
x: n,
|
|
2580
|
+
y: i,
|
|
2581
|
+
platform: l,
|
|
2582
|
+
rects: r,
|
|
2583
|
+
elements: s,
|
|
2584
|
+
strategy: a
|
|
2585
|
+
} = e, {
|
|
2586
|
+
boundary: u = "clippingAncestors",
|
|
2587
|
+
rootBoundary: c = "viewport",
|
|
2588
|
+
elementContext: f = "floating",
|
|
2589
|
+
altBoundary: g = !1,
|
|
2590
|
+
padding: d = 0
|
|
2591
|
+
} = et(o, e), m = Mi(d), v = s[g ? f === "floating" ? "reference" : "floating" : f], C = Qe(await l.getClippingRect({
|
|
2592
|
+
element: (t = await (l.isElement == null ? void 0 : l.isElement(v))) == null || t ? v : v.contextElement || await (l.getDocumentElement == null ? void 0 : l.getDocumentElement(s.floating)),
|
|
2593
|
+
boundary: u,
|
|
2594
|
+
rootBoundary: c,
|
|
2595
|
+
strategy: a
|
|
2596
|
+
})), S = f === "floating" ? {
|
|
2597
|
+
x: n,
|
|
2598
|
+
y: i,
|
|
2599
|
+
width: r.floating.width,
|
|
2600
|
+
height: r.floating.height
|
|
2601
|
+
} : r.reference, x = await (l.getOffsetParent == null ? void 0 : l.getOffsetParent(s.floating)), P = await (l.isElement == null ? void 0 : l.isElement(x)) ? await (l.getScale == null ? void 0 : l.getScale(x)) || {
|
|
2602
|
+
x: 1,
|
|
2603
|
+
y: 1
|
|
2604
|
+
} : {
|
|
2605
|
+
x: 1,
|
|
2606
|
+
y: 1
|
|
2607
|
+
}, A = Qe(l.convertOffsetParentRelativeRectToViewportRelativeRect ? await l.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2608
|
+
elements: s,
|
|
2609
|
+
rect: S,
|
|
2610
|
+
offsetParent: x,
|
|
2611
|
+
strategy: a
|
|
2612
|
+
}) : S);
|
|
2613
|
+
return {
|
|
2614
|
+
top: (C.top - A.top + m.top) / P.y,
|
|
2615
|
+
bottom: (A.bottom - C.bottom + m.bottom) / P.y,
|
|
2616
|
+
left: (C.left - A.left + m.left) / P.x,
|
|
2617
|
+
right: (A.right - C.right + m.right) / P.x
|
|
2618
|
+
};
|
|
2619
|
+
}
|
|
2620
|
+
const Ei = async (e, o, t) => {
|
|
2621
|
+
const {
|
|
2622
|
+
placement: n = "bottom",
|
|
2623
|
+
strategy: i = "absolute",
|
|
2624
|
+
middleware: l = [],
|
|
2625
|
+
platform: r
|
|
2626
|
+
} = t, s = l.filter(Boolean), a = await (r.isRTL == null ? void 0 : r.isRTL(o));
|
|
2627
|
+
let u = await r.getElementRects({
|
|
2628
|
+
reference: e,
|
|
2629
|
+
floating: o,
|
|
2630
|
+
strategy: i
|
|
2631
|
+
}), {
|
|
2632
|
+
x: c,
|
|
2633
|
+
y: f
|
|
2634
|
+
} = Jt(u, n, a), g = n, d = {}, m = 0;
|
|
2635
|
+
for (let v = 0; v < s.length; v++) {
|
|
2636
|
+
var p;
|
|
2637
|
+
const {
|
|
2638
|
+
name: C,
|
|
2639
|
+
fn: S
|
|
2640
|
+
} = s[v], {
|
|
2641
|
+
x,
|
|
2642
|
+
y: P,
|
|
2643
|
+
data: A,
|
|
2644
|
+
reset: D
|
|
2645
|
+
} = await S({
|
|
2646
|
+
x: c,
|
|
2647
|
+
y: f,
|
|
2648
|
+
initialPlacement: n,
|
|
2649
|
+
placement: g,
|
|
2650
|
+
strategy: i,
|
|
2651
|
+
middlewareData: d,
|
|
2652
|
+
rects: u,
|
|
2653
|
+
platform: {
|
|
2654
|
+
...r,
|
|
2655
|
+
detectOverflow: (p = r.detectOverflow) != null ? p : $i
|
|
2656
|
+
},
|
|
2657
|
+
elements: {
|
|
2658
|
+
reference: e,
|
|
2659
|
+
floating: o
|
|
2660
|
+
}
|
|
2661
|
+
});
|
|
2662
|
+
c = x ?? c, f = P ?? f, d = {
|
|
2663
|
+
...d,
|
|
2664
|
+
[C]: {
|
|
2665
|
+
...d[C],
|
|
2666
|
+
...A
|
|
2667
|
+
}
|
|
2668
|
+
}, D && m <= 50 && (m++, typeof D == "object" && (D.placement && (g = D.placement), D.rects && (u = D.rects === !0 ? await r.getElementRects({
|
|
2669
|
+
reference: e,
|
|
2670
|
+
floating: o,
|
|
2671
|
+
strategy: i
|
|
2672
|
+
}) : D.rects), {
|
|
2673
|
+
x: c,
|
|
2674
|
+
y: f
|
|
2675
|
+
} = Jt(u, g, a)), v = -1);
|
|
2676
|
+
}
|
|
2677
|
+
return {
|
|
2678
|
+
x: c,
|
|
2679
|
+
y: f,
|
|
2680
|
+
placement: g,
|
|
2681
|
+
strategy: i,
|
|
2682
|
+
middlewareData: d
|
|
2683
|
+
};
|
|
2684
|
+
}, Ii = function(e) {
|
|
2685
|
+
return e === void 0 && (e = {}), {
|
|
2686
|
+
name: "flip",
|
|
2687
|
+
options: e,
|
|
2688
|
+
async fn(o) {
|
|
2689
|
+
var t, n;
|
|
2690
|
+
const {
|
|
2691
|
+
placement: i,
|
|
2692
|
+
middlewareData: l,
|
|
2693
|
+
rects: r,
|
|
2694
|
+
initialPlacement: s,
|
|
2695
|
+
platform: a,
|
|
2696
|
+
elements: u
|
|
2697
|
+
} = o, {
|
|
2698
|
+
mainAxis: c = !0,
|
|
2699
|
+
crossAxis: f = !0,
|
|
2700
|
+
fallbackPlacements: g,
|
|
2701
|
+
fallbackStrategy: d = "bestFit",
|
|
2702
|
+
fallbackAxisSideDirection: m = "none",
|
|
2703
|
+
flipAlignment: p = !0,
|
|
2704
|
+
...v
|
|
2705
|
+
} = et(e, o);
|
|
2706
|
+
if ((t = l.arrow) != null && t.alignmentOffset)
|
|
2707
|
+
return {};
|
|
2708
|
+
const C = Me(i), S = me(s), x = Me(s) === s, P = await (a.isRTL == null ? void 0 : a.isRTL(u.floating)), A = g || (x || !p ? [Je(s)] : Si(s)), D = m !== "none";
|
|
2709
|
+
!g && D && A.push(..._i(s, p, m, P));
|
|
2710
|
+
const z = [s, ...A], O = await a.detectOverflow(o, v), T = [];
|
|
2711
|
+
let ie = ((n = l.flip) == null ? void 0 : n.overflows) || [];
|
|
2712
|
+
if (c && T.push(O[C]), f) {
|
|
2713
|
+
const B = wi(i, r, P);
|
|
2714
|
+
T.push(O[B[0]], O[B[1]]);
|
|
2715
|
+
}
|
|
2716
|
+
if (ie = [...ie, {
|
|
2717
|
+
placement: i,
|
|
2718
|
+
overflows: T
|
|
2719
|
+
}], !T.every((B) => B <= 0)) {
|
|
2720
|
+
var Se, N;
|
|
2721
|
+
const B = (((Se = l.flip) == null ? void 0 : Se.index) || 0) + 1, Ee = z[B];
|
|
2722
|
+
if (Ee && (!(f === "alignment" ? S !== me(Ee) : !1) || // We leave the current main axis only if every placement on that axis
|
|
2723
|
+
// overflows the main axis.
|
|
2724
|
+
ie.every((U) => me(U.placement) === S ? U.overflows[0] > 0 : !0)))
|
|
2725
|
+
return {
|
|
2726
|
+
data: {
|
|
2727
|
+
index: B,
|
|
2728
|
+
overflows: ie
|
|
2729
|
+
},
|
|
2730
|
+
reset: {
|
|
2731
|
+
placement: Ee
|
|
2732
|
+
}
|
|
2733
|
+
};
|
|
2734
|
+
let xe = (N = ie.filter((W) => W.overflows[0] <= 0).sort((W, U) => W.overflows[1] - U.overflows[1])[0]) == null ? void 0 : N.placement;
|
|
2735
|
+
if (!xe)
|
|
2736
|
+
switch (d) {
|
|
2737
|
+
case "bestFit": {
|
|
2738
|
+
var j;
|
|
2739
|
+
const W = (j = ie.filter((U) => {
|
|
2740
|
+
if (D) {
|
|
2741
|
+
const J = me(U.placement);
|
|
2742
|
+
return J === S || // Create a bias to the `y` side axis due to horizontal
|
|
2743
|
+
// reading directions favoring greater width.
|
|
2744
|
+
J === "y";
|
|
2745
|
+
}
|
|
2746
|
+
return !0;
|
|
2747
|
+
}).map((U) => [U.placement, U.overflows.filter((J) => J > 0).reduce((J, Ne) => J + Ne, 0)]).sort((U, J) => U[1] - J[1])[0]) == null ? void 0 : j[0];
|
|
2748
|
+
W && (xe = W);
|
|
2749
|
+
break;
|
|
2750
|
+
}
|
|
2751
|
+
case "initialPlacement":
|
|
2752
|
+
xe = s;
|
|
2753
|
+
break;
|
|
2754
|
+
}
|
|
2755
|
+
if (i !== xe)
|
|
2756
|
+
return {
|
|
2757
|
+
reset: {
|
|
2758
|
+
placement: xe
|
|
2759
|
+
}
|
|
2760
|
+
};
|
|
2761
|
+
}
|
|
2762
|
+
return {};
|
|
2763
|
+
}
|
|
2764
|
+
};
|
|
2765
|
+
}, Pi = /* @__PURE__ */ new Set(["left", "top"]);
|
|
2766
|
+
async function Vi(e, o) {
|
|
2767
|
+
const {
|
|
2768
|
+
placement: t,
|
|
2769
|
+
platform: n,
|
|
2770
|
+
elements: i
|
|
2771
|
+
} = e, l = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = Me(t), s = tt(t), a = me(t) === "y", u = Pi.has(r) ? -1 : 1, c = l && a ? -1 : 1, f = et(o, e);
|
|
2772
|
+
let {
|
|
2773
|
+
mainAxis: g,
|
|
2774
|
+
crossAxis: d,
|
|
2775
|
+
alignmentAxis: m
|
|
2776
|
+
} = typeof f == "number" ? {
|
|
2777
|
+
mainAxis: f,
|
|
2778
|
+
crossAxis: 0,
|
|
2779
|
+
alignmentAxis: null
|
|
2780
|
+
} : {
|
|
2781
|
+
mainAxis: f.mainAxis || 0,
|
|
2782
|
+
crossAxis: f.crossAxis || 0,
|
|
2783
|
+
alignmentAxis: f.alignmentAxis
|
|
2784
|
+
};
|
|
2785
|
+
return s && typeof m == "number" && (d = s === "end" ? m * -1 : m), a ? {
|
|
2786
|
+
x: d * c,
|
|
2787
|
+
y: g * u
|
|
2788
|
+
} : {
|
|
2789
|
+
x: g * u,
|
|
2790
|
+
y: d * c
|
|
2791
|
+
};
|
|
2792
|
+
}
|
|
2793
|
+
const bi = function(e) {
|
|
2794
|
+
return e === void 0 && (e = 0), {
|
|
2795
|
+
name: "offset",
|
|
2796
|
+
options: e,
|
|
2797
|
+
async fn(o) {
|
|
2798
|
+
var t, n;
|
|
2799
|
+
const {
|
|
2800
|
+
x: i,
|
|
2801
|
+
y: l,
|
|
2802
|
+
placement: r,
|
|
2803
|
+
middlewareData: s
|
|
2804
|
+
} = o, a = await Vi(o, e);
|
|
2805
|
+
return r === ((t = s.offset) == null ? void 0 : t.placement) && (n = s.arrow) != null && n.alignmentOffset ? {} : {
|
|
2806
|
+
x: i + a.x,
|
|
2807
|
+
y: l + a.y,
|
|
2808
|
+
data: {
|
|
2809
|
+
...a,
|
|
2810
|
+
placement: r
|
|
2811
|
+
}
|
|
2812
|
+
};
|
|
2813
|
+
}
|
|
2814
|
+
};
|
|
2815
|
+
}, Ai = function(e) {
|
|
2816
|
+
return e === void 0 && (e = {}), {
|
|
2817
|
+
name: "shift",
|
|
2818
|
+
options: e,
|
|
2819
|
+
async fn(o) {
|
|
2820
|
+
const {
|
|
2821
|
+
x: t,
|
|
2822
|
+
y: n,
|
|
2823
|
+
placement: i,
|
|
2824
|
+
platform: l
|
|
2825
|
+
} = o, {
|
|
2826
|
+
mainAxis: r = !0,
|
|
2827
|
+
crossAxis: s = !1,
|
|
2828
|
+
limiter: a = {
|
|
2829
|
+
fn: (C) => {
|
|
2830
|
+
let {
|
|
2831
|
+
x: S,
|
|
2832
|
+
y: x
|
|
2833
|
+
} = C;
|
|
2834
|
+
return {
|
|
2835
|
+
x: S,
|
|
2836
|
+
y: x
|
|
2837
|
+
};
|
|
2838
|
+
}
|
|
2839
|
+
},
|
|
2840
|
+
...u
|
|
2841
|
+
} = et(e, o), c = {
|
|
2842
|
+
x: t,
|
|
2843
|
+
y: n
|
|
2844
|
+
}, f = await l.detectOverflow(o, u), g = me(Me(i)), d = $n(g);
|
|
2845
|
+
let m = c[d], p = c[g];
|
|
2846
|
+
if (r) {
|
|
2847
|
+
const C = d === "y" ? "top" : "left", S = d === "y" ? "bottom" : "right", x = m + f[C], P = m - f[S];
|
|
2848
|
+
m = Ut(x, m, P);
|
|
2849
|
+
}
|
|
2850
|
+
if (s) {
|
|
2851
|
+
const C = g === "y" ? "top" : "left", S = g === "y" ? "bottom" : "right", x = p + f[C], P = p - f[S];
|
|
2852
|
+
p = Ut(x, p, P);
|
|
2853
|
+
}
|
|
2854
|
+
const v = a.fn({
|
|
2855
|
+
...o,
|
|
2856
|
+
[d]: m,
|
|
2857
|
+
[g]: p
|
|
2858
|
+
});
|
|
2859
|
+
return {
|
|
2860
|
+
...v,
|
|
2861
|
+
data: {
|
|
2862
|
+
x: v.x - t,
|
|
2863
|
+
y: v.y - n,
|
|
2864
|
+
enabled: {
|
|
2865
|
+
[d]: r,
|
|
2866
|
+
[g]: s
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
};
|
|
2870
|
+
}
|
|
2871
|
+
};
|
|
2872
|
+
};
|
|
2873
|
+
function nt() {
|
|
2874
|
+
return typeof window < "u";
|
|
2875
|
+
}
|
|
2876
|
+
function $e(e) {
|
|
2877
|
+
return At(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
2878
|
+
}
|
|
2879
|
+
function X(e) {
|
|
2880
|
+
var o;
|
|
2881
|
+
return (e == null || (o = e.ownerDocument) == null ? void 0 : o.defaultView) || window;
|
|
2882
|
+
}
|
|
2883
|
+
function ge(e) {
|
|
2884
|
+
var o;
|
|
2885
|
+
return (o = (At(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : o.documentElement;
|
|
2886
|
+
}
|
|
2887
|
+
function At(e) {
|
|
2888
|
+
return nt() ? e instanceof Node || e instanceof X(e).Node : !1;
|
|
2889
|
+
}
|
|
2890
|
+
function ne(e) {
|
|
2891
|
+
return nt() ? e instanceof Element || e instanceof X(e).Element : !1;
|
|
2892
|
+
}
|
|
2893
|
+
function se(e) {
|
|
2894
|
+
return nt() ? e instanceof HTMLElement || e instanceof X(e).HTMLElement : !1;
|
|
2895
|
+
}
|
|
2896
|
+
function Qt(e) {
|
|
2897
|
+
return !nt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof X(e).ShadowRoot;
|
|
2898
|
+
}
|
|
2899
|
+
const zi = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
2900
|
+
function Ge(e) {
|
|
2901
|
+
const {
|
|
2902
|
+
overflow: o,
|
|
2903
|
+
overflowX: t,
|
|
2904
|
+
overflowY: n,
|
|
2905
|
+
display: i
|
|
2906
|
+
} = oe(e);
|
|
2907
|
+
return /auto|scroll|overlay|hidden|clip/.test(o + n + t) && !zi.has(i);
|
|
2908
|
+
}
|
|
2909
|
+
const Di = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
2910
|
+
function Oi(e) {
|
|
2911
|
+
return Di.has($e(e));
|
|
2912
|
+
}
|
|
2913
|
+
const Li = [":popover-open", ":modal"];
|
|
2914
|
+
function ot(e) {
|
|
2915
|
+
return Li.some((o) => {
|
|
2916
|
+
try {
|
|
2917
|
+
return e.matches(o);
|
|
2918
|
+
} catch {
|
|
2919
|
+
return !1;
|
|
2920
|
+
}
|
|
2921
|
+
});
|
|
2922
|
+
}
|
|
2923
|
+
const ki = ["transform", "translate", "scale", "rotate", "perspective"], Hi = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Ti = ["paint", "layout", "strict", "content"];
|
|
2924
|
+
function zt(e) {
|
|
2925
|
+
const o = Dt(), t = ne(e) ? oe(e) : e;
|
|
2926
|
+
return ki.some((n) => t[n] ? t[n] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !o && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !o && (t.filter ? t.filter !== "none" : !1) || Hi.some((n) => (t.willChange || "").includes(n)) || Ti.some((n) => (t.contain || "").includes(n));
|
|
2927
|
+
}
|
|
2928
|
+
function Gi(e) {
|
|
2929
|
+
let o = we(e);
|
|
2930
|
+
for (; se(o) && !De(o); ) {
|
|
2931
|
+
if (zt(o))
|
|
2932
|
+
return o;
|
|
2933
|
+
if (ot(o))
|
|
2934
|
+
return null;
|
|
2935
|
+
o = we(o);
|
|
2936
|
+
}
|
|
2937
|
+
return null;
|
|
2938
|
+
}
|
|
2939
|
+
function Dt() {
|
|
2940
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
2941
|
+
}
|
|
2942
|
+
const Ni = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
2943
|
+
function De(e) {
|
|
2944
|
+
return Ni.has($e(e));
|
|
2945
|
+
}
|
|
2946
|
+
function oe(e) {
|
|
2947
|
+
return X(e).getComputedStyle(e);
|
|
2948
|
+
}
|
|
2949
|
+
function it(e) {
|
|
2950
|
+
return ne(e) ? {
|
|
2951
|
+
scrollLeft: e.scrollLeft,
|
|
2952
|
+
scrollTop: e.scrollTop
|
|
2953
|
+
} : {
|
|
2954
|
+
scrollLeft: e.scrollX,
|
|
2955
|
+
scrollTop: e.scrollY
|
|
2956
|
+
};
|
|
2957
|
+
}
|
|
2958
|
+
function we(e) {
|
|
2959
|
+
if ($e(e) === "html")
|
|
2960
|
+
return e;
|
|
2961
|
+
const o = (
|
|
2962
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
2963
|
+
e.assignedSlot || // DOM Element detected.
|
|
2964
|
+
e.parentNode || // ShadowRoot detected.
|
|
2965
|
+
Qt(e) && e.host || // Fallback.
|
|
2966
|
+
ge(e)
|
|
2967
|
+
);
|
|
2968
|
+
return Qt(o) ? o.host : o;
|
|
2969
|
+
}
|
|
2970
|
+
function Pn(e) {
|
|
2971
|
+
const o = we(e);
|
|
2972
|
+
return De(o) ? e.ownerDocument ? e.ownerDocument.body : e.body : se(o) && Ge(o) ? o : Pn(o);
|
|
2973
|
+
}
|
|
2974
|
+
function Vn(e, o, t) {
|
|
2975
|
+
var n;
|
|
2976
|
+
o === void 0 && (o = []);
|
|
2977
|
+
const i = Pn(e), l = i === ((n = e.ownerDocument) == null ? void 0 : n.body), r = X(i);
|
|
2978
|
+
return l ? (Mt(r), o.concat(r, r.visualViewport || [], Ge(i) ? i : [], [])) : o.concat(i, Vn(i, []));
|
|
2979
|
+
}
|
|
2980
|
+
function Mt(e) {
|
|
2981
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
2982
|
+
}
|
|
2983
|
+
function bn(e) {
|
|
2984
|
+
const o = oe(e);
|
|
2985
|
+
let t = parseFloat(o.width) || 0, n = parseFloat(o.height) || 0;
|
|
2986
|
+
const i = se(e), l = i ? e.offsetWidth : t, r = i ? e.offsetHeight : n, s = Ye(t) !== l || Ye(n) !== r;
|
|
2987
|
+
return s && (t = l, n = r), {
|
|
2988
|
+
width: t,
|
|
2989
|
+
height: n,
|
|
2990
|
+
$: s
|
|
2991
|
+
};
|
|
2992
|
+
}
|
|
2993
|
+
function An(e) {
|
|
2994
|
+
return ne(e) ? e : e.contextElement;
|
|
2995
|
+
}
|
|
2996
|
+
function Ae(e) {
|
|
2997
|
+
const o = An(e);
|
|
2998
|
+
if (!se(o))
|
|
2999
|
+
return re(1);
|
|
3000
|
+
const t = o.getBoundingClientRect(), {
|
|
3001
|
+
width: n,
|
|
3002
|
+
height: i,
|
|
3003
|
+
$: l
|
|
3004
|
+
} = bn(o);
|
|
3005
|
+
let r = (l ? Ye(t.width) : t.width) / n, s = (l ? Ye(t.height) : t.height) / i;
|
|
3006
|
+
return (!r || !Number.isFinite(r)) && (r = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
|
3007
|
+
x: r,
|
|
3008
|
+
y: s
|
|
3009
|
+
};
|
|
3010
|
+
}
|
|
3011
|
+
const Bi = /* @__PURE__ */ re(0);
|
|
3012
|
+
function zn(e) {
|
|
3013
|
+
const o = X(e);
|
|
3014
|
+
return !Dt() || !o.visualViewport ? Bi : {
|
|
3015
|
+
x: o.visualViewport.offsetLeft,
|
|
3016
|
+
y: o.visualViewport.offsetTop
|
|
3017
|
+
};
|
|
3018
|
+
}
|
|
3019
|
+
function Wi(e, o, t) {
|
|
3020
|
+
return o === void 0 && (o = !1), !t || o && t !== X(e) ? !1 : o;
|
|
3021
|
+
}
|
|
3022
|
+
function Te(e, o, t, n) {
|
|
3023
|
+
o === void 0 && (o = !1), t === void 0 && (t = !1);
|
|
3024
|
+
const i = e.getBoundingClientRect(), l = An(e);
|
|
3025
|
+
let r = re(1);
|
|
3026
|
+
o && (n ? ne(n) && (r = Ae(n)) : r = Ae(e));
|
|
3027
|
+
const s = Wi(l, t, n) ? zn(l) : re(0);
|
|
3028
|
+
let a = (i.left + s.x) / r.x, u = (i.top + s.y) / r.y, c = i.width / r.x, f = i.height / r.y;
|
|
3029
|
+
if (l) {
|
|
3030
|
+
const g = X(l), d = n && ne(n) ? X(n) : n;
|
|
3031
|
+
let m = g, p = Mt(m);
|
|
3032
|
+
for (; p && n && d !== m; ) {
|
|
3033
|
+
const v = Ae(p), C = p.getBoundingClientRect(), S = oe(p), x = C.left + (p.clientLeft + parseFloat(S.paddingLeft)) * v.x, P = C.top + (p.clientTop + parseFloat(S.paddingTop)) * v.y;
|
|
3034
|
+
a *= v.x, u *= v.y, c *= v.x, f *= v.y, a += x, u += P, m = X(p), p = Mt(m);
|
|
3035
|
+
}
|
|
3036
|
+
}
|
|
3037
|
+
return Qe({
|
|
3038
|
+
width: c,
|
|
3039
|
+
height: f,
|
|
3040
|
+
x: a,
|
|
3041
|
+
y: u
|
|
3042
|
+
});
|
|
3043
|
+
}
|
|
3044
|
+
function lt(e, o) {
|
|
3045
|
+
const t = it(e).scrollLeft;
|
|
3046
|
+
return o ? o.left + t : Te(ge(e)).left + t;
|
|
3047
|
+
}
|
|
3048
|
+
function Dn(e, o) {
|
|
3049
|
+
const t = e.getBoundingClientRect(), n = t.left + o.scrollLeft - lt(e, t), i = t.top + o.scrollTop;
|
|
3050
|
+
return {
|
|
3051
|
+
x: n,
|
|
3052
|
+
y: i
|
|
3053
|
+
};
|
|
3054
|
+
}
|
|
3055
|
+
function ji(e) {
|
|
3056
|
+
let {
|
|
3057
|
+
elements: o,
|
|
3058
|
+
rect: t,
|
|
3059
|
+
offsetParent: n,
|
|
3060
|
+
strategy: i
|
|
3061
|
+
} = e;
|
|
3062
|
+
const l = i === "fixed", r = ge(n), s = o ? ot(o.floating) : !1;
|
|
3063
|
+
if (n === r || s && l)
|
|
3064
|
+
return t;
|
|
3065
|
+
let a = {
|
|
3066
|
+
scrollLeft: 0,
|
|
3067
|
+
scrollTop: 0
|
|
3068
|
+
}, u = re(1);
|
|
3069
|
+
const c = re(0), f = se(n);
|
|
3070
|
+
if ((f || !f && !l) && (($e(n) !== "body" || Ge(r)) && (a = it(n)), se(n))) {
|
|
3071
|
+
const d = Te(n);
|
|
3072
|
+
u = Ae(n), c.x = d.x + n.clientLeft, c.y = d.y + n.clientTop;
|
|
3073
|
+
}
|
|
3074
|
+
const g = r && !f && !l ? Dn(r, a) : re(0);
|
|
3075
|
+
return {
|
|
3076
|
+
width: t.width * u.x,
|
|
3077
|
+
height: t.height * u.y,
|
|
3078
|
+
x: t.x * u.x - a.scrollLeft * u.x + c.x + g.x,
|
|
3079
|
+
y: t.y * u.y - a.scrollTop * u.y + c.y + g.y
|
|
3080
|
+
};
|
|
3081
|
+
}
|
|
3082
|
+
function qi(e) {
|
|
3083
|
+
return Array.from(e.getClientRects());
|
|
3084
|
+
}
|
|
3085
|
+
function Ki(e) {
|
|
3086
|
+
const o = ge(e), t = it(e), n = e.ownerDocument.body, i = be(o.scrollWidth, o.clientWidth, n.scrollWidth, n.clientWidth), l = be(o.scrollHeight, o.clientHeight, n.scrollHeight, n.clientHeight);
|
|
3087
|
+
let r = -t.scrollLeft + lt(e);
|
|
3088
|
+
const s = -t.scrollTop;
|
|
3089
|
+
return oe(n).direction === "rtl" && (r += be(o.clientWidth, n.clientWidth) - i), {
|
|
3090
|
+
width: i,
|
|
3091
|
+
height: l,
|
|
3092
|
+
x: r,
|
|
3093
|
+
y: s
|
|
3094
|
+
};
|
|
3095
|
+
}
|
|
3096
|
+
const Zt = 25;
|
|
3097
|
+
function Ui(e, o) {
|
|
3098
|
+
const t = X(e), n = ge(e), i = t.visualViewport;
|
|
3099
|
+
let l = n.clientWidth, r = n.clientHeight, s = 0, a = 0;
|
|
3100
|
+
if (i) {
|
|
3101
|
+
l = i.width, r = i.height;
|
|
3102
|
+
const c = Dt();
|
|
3103
|
+
(!c || c && o === "fixed") && (s = i.offsetLeft, a = i.offsetTop);
|
|
3104
|
+
}
|
|
3105
|
+
const u = lt(n);
|
|
3106
|
+
if (u <= 0) {
|
|
3107
|
+
const c = n.ownerDocument, f = c.body, g = getComputedStyle(f), d = c.compatMode === "CSS1Compat" && parseFloat(g.marginLeft) + parseFloat(g.marginRight) || 0, m = Math.abs(n.clientWidth - f.clientWidth - d);
|
|
3108
|
+
m <= Zt && (l -= m);
|
|
3109
|
+
} else u <= Zt && (l += u);
|
|
3110
|
+
return {
|
|
3111
|
+
width: l,
|
|
3112
|
+
height: r,
|
|
3113
|
+
x: s,
|
|
3114
|
+
y: a
|
|
3115
|
+
};
|
|
3116
|
+
}
|
|
3117
|
+
const Xi = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
3118
|
+
function Yi(e, o) {
|
|
3119
|
+
const t = Te(e, !0, o === "fixed"), n = t.top + e.clientTop, i = t.left + e.clientLeft, l = se(e) ? Ae(e) : re(1), r = e.clientWidth * l.x, s = e.clientHeight * l.y, a = i * l.x, u = n * l.y;
|
|
3120
|
+
return {
|
|
3121
|
+
width: r,
|
|
3122
|
+
height: s,
|
|
3123
|
+
x: a,
|
|
3124
|
+
y: u
|
|
3125
|
+
};
|
|
3126
|
+
}
|
|
3127
|
+
function en(e, o, t) {
|
|
3128
|
+
let n;
|
|
3129
|
+
if (o === "viewport")
|
|
3130
|
+
n = Ui(e, t);
|
|
3131
|
+
else if (o === "document")
|
|
3132
|
+
n = Ki(ge(e));
|
|
3133
|
+
else if (ne(o))
|
|
3134
|
+
n = Yi(o, t);
|
|
3135
|
+
else {
|
|
3136
|
+
const i = zn(e);
|
|
3137
|
+
n = {
|
|
3138
|
+
x: o.x - i.x,
|
|
3139
|
+
y: o.y - i.y,
|
|
3140
|
+
width: o.width,
|
|
3141
|
+
height: o.height
|
|
3142
|
+
};
|
|
3143
|
+
}
|
|
3144
|
+
return Qe(n);
|
|
3145
|
+
}
|
|
3146
|
+
function On(e, o) {
|
|
3147
|
+
const t = we(e);
|
|
3148
|
+
return t === o || !ne(t) || De(t) ? !1 : oe(t).position === "fixed" || On(t, o);
|
|
3149
|
+
}
|
|
3150
|
+
function Ji(e, o) {
|
|
3151
|
+
const t = o.get(e);
|
|
3152
|
+
if (t)
|
|
3153
|
+
return t;
|
|
3154
|
+
let n = Vn(e, []).filter((s) => ne(s) && $e(s) !== "body"), i = null;
|
|
3155
|
+
const l = oe(e).position === "fixed";
|
|
3156
|
+
let r = l ? we(e) : e;
|
|
3157
|
+
for (; ne(r) && !De(r); ) {
|
|
3158
|
+
const s = oe(r), a = zt(r);
|
|
3159
|
+
!a && s.position === "fixed" && (i = null), (l ? !a && !i : !a && s.position === "static" && !!i && Xi.has(i.position) || Ge(r) && !a && On(e, r)) ? n = n.filter((c) => c !== r) : i = s, r = we(r);
|
|
3160
|
+
}
|
|
3161
|
+
return o.set(e, n), n;
|
|
3162
|
+
}
|
|
3163
|
+
function Qi(e) {
|
|
3164
|
+
let {
|
|
3165
|
+
element: o,
|
|
3166
|
+
boundary: t,
|
|
3167
|
+
rootBoundary: n,
|
|
3168
|
+
strategy: i
|
|
3169
|
+
} = e;
|
|
3170
|
+
const r = [...t === "clippingAncestors" ? ot(o) ? [] : Ji(o, this._c) : [].concat(t), n], s = r[0], a = r.reduce((u, c) => {
|
|
3171
|
+
const f = en(o, c, i);
|
|
3172
|
+
return u.top = be(f.top, u.top), u.right = _t(f.right, u.right), u.bottom = _t(f.bottom, u.bottom), u.left = be(f.left, u.left), u;
|
|
3173
|
+
}, en(o, s, i));
|
|
3174
|
+
return {
|
|
3175
|
+
width: a.right - a.left,
|
|
3176
|
+
height: a.bottom - a.top,
|
|
3177
|
+
x: a.left,
|
|
3178
|
+
y: a.top
|
|
3179
|
+
};
|
|
3180
|
+
}
|
|
3181
|
+
function Zi(e) {
|
|
3182
|
+
const {
|
|
3183
|
+
width: o,
|
|
3184
|
+
height: t
|
|
3185
|
+
} = bn(e);
|
|
3186
|
+
return {
|
|
3187
|
+
width: o,
|
|
3188
|
+
height: t
|
|
3189
|
+
};
|
|
3190
|
+
}
|
|
3191
|
+
function el(e, o, t) {
|
|
3192
|
+
const n = se(o), i = ge(o), l = t === "fixed", r = Te(e, !0, l, o);
|
|
3193
|
+
let s = {
|
|
3194
|
+
scrollLeft: 0,
|
|
3195
|
+
scrollTop: 0
|
|
3196
|
+
};
|
|
3197
|
+
const a = re(0);
|
|
3198
|
+
function u() {
|
|
3199
|
+
a.x = lt(i);
|
|
3200
|
+
}
|
|
3201
|
+
if (n || !n && !l)
|
|
3202
|
+
if (($e(o) !== "body" || Ge(i)) && (s = it(o)), n) {
|
|
3203
|
+
const d = Te(o, !0, l, o);
|
|
3204
|
+
a.x = d.x + o.clientLeft, a.y = d.y + o.clientTop;
|
|
3205
|
+
} else i && u();
|
|
3206
|
+
l && !n && i && u();
|
|
3207
|
+
const c = i && !n && !l ? Dn(i, s) : re(0), f = r.left + s.scrollLeft - a.x - c.x, g = r.top + s.scrollTop - a.y - c.y;
|
|
3208
|
+
return {
|
|
3209
|
+
x: f,
|
|
3210
|
+
y: g,
|
|
3211
|
+
width: r.width,
|
|
3212
|
+
height: r.height
|
|
3213
|
+
};
|
|
3214
|
+
}
|
|
3215
|
+
function mt(e) {
|
|
3216
|
+
return oe(e).position === "static";
|
|
3217
|
+
}
|
|
3218
|
+
function tn(e, o) {
|
|
3219
|
+
if (!se(e) || oe(e).position === "fixed")
|
|
3220
|
+
return null;
|
|
3221
|
+
if (o)
|
|
3222
|
+
return o(e);
|
|
3223
|
+
let t = e.offsetParent;
|
|
3224
|
+
return ge(e) === t && (t = t.ownerDocument.body), t;
|
|
3225
|
+
}
|
|
3226
|
+
function Ln(e, o) {
|
|
3227
|
+
const t = X(e);
|
|
3228
|
+
if (ot(e))
|
|
3229
|
+
return t;
|
|
3230
|
+
if (!se(e)) {
|
|
3231
|
+
let i = we(e);
|
|
3232
|
+
for (; i && !De(i); ) {
|
|
3233
|
+
if (ne(i) && !mt(i))
|
|
3234
|
+
return i;
|
|
3235
|
+
i = we(i);
|
|
3236
|
+
}
|
|
3237
|
+
return t;
|
|
3238
|
+
}
|
|
3239
|
+
let n = tn(e, o);
|
|
3240
|
+
for (; n && Oi(n) && mt(n); )
|
|
3241
|
+
n = tn(n, o);
|
|
3242
|
+
return n && De(n) && mt(n) && !zt(n) ? t : n || Gi(e) || t;
|
|
3243
|
+
}
|
|
3244
|
+
const tl = async function(e) {
|
|
3245
|
+
const o = this.getOffsetParent || Ln, t = this.getDimensions, n = await t(e.floating);
|
|
3246
|
+
return {
|
|
3247
|
+
reference: el(e.reference, await o(e.floating), e.strategy),
|
|
3248
|
+
floating: {
|
|
3249
|
+
x: 0,
|
|
3250
|
+
y: 0,
|
|
3251
|
+
width: n.width,
|
|
3252
|
+
height: n.height
|
|
3253
|
+
}
|
|
3254
|
+
};
|
|
3255
|
+
};
|
|
3256
|
+
function nl(e) {
|
|
3257
|
+
return oe(e).direction === "rtl";
|
|
3258
|
+
}
|
|
3259
|
+
const ol = {
|
|
3260
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ji,
|
|
3261
|
+
getDocumentElement: ge,
|
|
3262
|
+
getClippingRect: Qi,
|
|
3263
|
+
getOffsetParent: Ln,
|
|
3264
|
+
getElementRects: tl,
|
|
3265
|
+
getClientRects: qi,
|
|
3266
|
+
getDimensions: Zi,
|
|
3267
|
+
getScale: Ae,
|
|
3268
|
+
isElement: ne,
|
|
3269
|
+
isRTL: nl
|
|
3270
|
+
}, il = bi, ll = Ai, rl = Ii, sl = (e, o, t) => {
|
|
3271
|
+
const n = /* @__PURE__ */ new Map(), i = {
|
|
3272
|
+
platform: ol,
|
|
3273
|
+
...t
|
|
3274
|
+
}, l = {
|
|
3275
|
+
...i.platform,
|
|
3276
|
+
_c: n
|
|
3277
|
+
};
|
|
3278
|
+
return Ei(e, o, {
|
|
3279
|
+
...i,
|
|
3280
|
+
platform: l
|
|
3281
|
+
});
|
|
3282
|
+
};
|
|
3283
|
+
function al(e) {
|
|
3284
|
+
return e != null && typeof e == "object" && "$el" in e;
|
|
3285
|
+
}
|
|
3286
|
+
function nn(e) {
|
|
3287
|
+
if (al(e)) {
|
|
3288
|
+
const o = e.$el;
|
|
3289
|
+
return At(o) && $e(o) === "#comment" ? null : o;
|
|
3290
|
+
}
|
|
3291
|
+
return e;
|
|
3292
|
+
}
|
|
3293
|
+
function Le(e) {
|
|
3294
|
+
return typeof e == "function" ? e() : w(e);
|
|
3295
|
+
}
|
|
3296
|
+
function kn(e) {
|
|
3297
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
3298
|
+
}
|
|
3299
|
+
function on(e, o) {
|
|
3300
|
+
const t = kn(e);
|
|
3301
|
+
return Math.round(o * t) / t;
|
|
3302
|
+
}
|
|
3303
|
+
function ul(e, o, t) {
|
|
3304
|
+
t === void 0 && (t = {});
|
|
3305
|
+
const n = t.whileElementsMounted, i = R(() => {
|
|
3306
|
+
var z;
|
|
3307
|
+
return (z = Le(t.open)) != null ? z : !0;
|
|
3308
|
+
}), l = R(() => Le(t.middleware)), r = R(() => {
|
|
3309
|
+
var z;
|
|
3310
|
+
return (z = Le(t.placement)) != null ? z : "bottom";
|
|
3311
|
+
}), s = R(() => {
|
|
3312
|
+
var z;
|
|
3313
|
+
return (z = Le(t.strategy)) != null ? z : "absolute";
|
|
3314
|
+
}), a = R(() => {
|
|
3315
|
+
var z;
|
|
3316
|
+
return (z = Le(t.transform)) != null ? z : !0;
|
|
3317
|
+
}), u = R(() => nn(e.value)), c = R(() => nn(o.value)), f = k(0), g = k(0), d = k(s.value), m = k(r.value), p = Et({}), v = k(!1), C = R(() => {
|
|
3318
|
+
const z = {
|
|
3319
|
+
position: d.value,
|
|
3320
|
+
left: "0",
|
|
3321
|
+
top: "0"
|
|
3322
|
+
};
|
|
3323
|
+
if (!c.value)
|
|
3324
|
+
return z;
|
|
3325
|
+
const O = on(c.value, f.value), T = on(c.value, g.value);
|
|
3326
|
+
return a.value ? {
|
|
3327
|
+
...z,
|
|
3328
|
+
transform: "translate(" + O + "px, " + T + "px)",
|
|
3329
|
+
...kn(c.value) >= 1.5 && {
|
|
3330
|
+
willChange: "transform"
|
|
3331
|
+
}
|
|
3332
|
+
} : {
|
|
3333
|
+
position: d.value,
|
|
3334
|
+
left: O + "px",
|
|
3335
|
+
top: T + "px"
|
|
3336
|
+
};
|
|
3337
|
+
});
|
|
3338
|
+
let S;
|
|
3339
|
+
function x() {
|
|
3340
|
+
if (u.value == null || c.value == null)
|
|
3341
|
+
return;
|
|
3342
|
+
const z = i.value;
|
|
3343
|
+
sl(u.value, c.value, {
|
|
3344
|
+
middleware: l.value,
|
|
3345
|
+
placement: r.value,
|
|
3346
|
+
strategy: s.value
|
|
3347
|
+
}).then((O) => {
|
|
3348
|
+
f.value = O.x, g.value = O.y, d.value = O.strategy, m.value = O.placement, p.value = O.middlewareData, v.value = z !== !1;
|
|
3349
|
+
});
|
|
3350
|
+
}
|
|
3351
|
+
function P() {
|
|
3352
|
+
typeof S == "function" && (S(), S = void 0);
|
|
3353
|
+
}
|
|
3354
|
+
function A() {
|
|
3355
|
+
if (P(), n === void 0) {
|
|
3356
|
+
x();
|
|
3357
|
+
return;
|
|
3358
|
+
}
|
|
3359
|
+
if (u.value != null && c.value != null) {
|
|
3360
|
+
S = n(u.value, c.value, x);
|
|
3361
|
+
return;
|
|
3362
|
+
}
|
|
3363
|
+
}
|
|
3364
|
+
function D() {
|
|
3365
|
+
i.value || (v.value = !1);
|
|
3366
|
+
}
|
|
3367
|
+
return Fe([l, r, s, i], x, {
|
|
3368
|
+
flush: "sync"
|
|
3369
|
+
}), Fe([u, c], A, {
|
|
3370
|
+
flush: "sync"
|
|
3371
|
+
}), Fe(i, D, {
|
|
3372
|
+
flush: "sync"
|
|
3373
|
+
}), Yn() && gn(P), {
|
|
3374
|
+
x: Ie(f),
|
|
3375
|
+
y: Ie(g),
|
|
3376
|
+
strategy: Ie(d),
|
|
3377
|
+
placement: Ie(m),
|
|
3378
|
+
middlewareData: Ie(p),
|
|
3379
|
+
isPositioned: Ie(v),
|
|
3380
|
+
floatingStyles: C,
|
|
3381
|
+
update: x
|
|
3382
|
+
};
|
|
3383
|
+
}
|
|
3384
|
+
const cl = /* @__PURE__ */ K({
|
|
3385
|
+
name: "VPopover",
|
|
3386
|
+
__name: "VPopover",
|
|
3387
|
+
props: {
|
|
3388
|
+
open: { type: Boolean, default: !1 },
|
|
3389
|
+
onOpenChange: { type: Function, default: () => {
|
|
3390
|
+
} },
|
|
3391
|
+
placement: { default: "bottom-start" }
|
|
3392
|
+
},
|
|
3393
|
+
setup(e) {
|
|
3394
|
+
const o = e, t = k(null), n = k(null), i = R(() => {
|
|
3395
|
+
const s = o.placement;
|
|
3396
|
+
return s.includes("-start") ? -12 : s.includes("-end") ? 12 : 0;
|
|
3397
|
+
}), { floatingStyles: l } = ul(t, n, {
|
|
3398
|
+
placement: R(() => o.placement),
|
|
3399
|
+
middleware: [
|
|
3400
|
+
il({
|
|
3401
|
+
mainAxis: 12,
|
|
3402
|
+
crossAxis: i.value
|
|
3403
|
+
}),
|
|
3404
|
+
rl(),
|
|
3405
|
+
ll({ padding: 8 })
|
|
3406
|
+
]
|
|
3407
|
+
}), r = (s) => {
|
|
3408
|
+
if (!o.open) return;
|
|
3409
|
+
const a = s.target;
|
|
3410
|
+
t.value && n.value && !t.value.contains(a) && !n.value.contains(a) && o.onOpenChange(!1);
|
|
3411
|
+
};
|
|
3412
|
+
return fn(() => {
|
|
3413
|
+
document.addEventListener("click", r);
|
|
3414
|
+
}), Jn(() => {
|
|
3415
|
+
document.removeEventListener("click", r);
|
|
3416
|
+
}), (s, a) => (y(), I(ce, null, [
|
|
3417
|
+
b("div", {
|
|
3418
|
+
ref_key: "referenceRef",
|
|
3419
|
+
ref: t,
|
|
3420
|
+
class: "popover-trigger",
|
|
3421
|
+
onClick: a[0] || (a[0] = (u) => o.onOpenChange(!o.open))
|
|
3422
|
+
}, [
|
|
3423
|
+
L(s.$slots, "default", {}, void 0, !0)
|
|
3424
|
+
], 512),
|
|
3425
|
+
(y(), Z(Qn, { to: "body" }, [
|
|
3426
|
+
ve(Zn, { name: "popover-fade" }, {
|
|
3427
|
+
default: ee(() => [
|
|
3428
|
+
e.open ? (y(), I("div", {
|
|
3429
|
+
key: 0,
|
|
3430
|
+
ref_key: "floatingRef",
|
|
3431
|
+
ref: n,
|
|
3432
|
+
style: pe(w(l)),
|
|
3433
|
+
class: "popover-content"
|
|
3434
|
+
}, [
|
|
3435
|
+
L(s.$slots, "content", {}, void 0, !0)
|
|
3436
|
+
], 4)) : Q("", !0)
|
|
3437
|
+
]),
|
|
3438
|
+
_: 3
|
|
3439
|
+
})
|
|
3440
|
+
]))
|
|
3441
|
+
], 64));
|
|
3442
|
+
}
|
|
3443
|
+
}), Hn = /* @__PURE__ */ de(cl, [["__scopeId", "data-v-b6a7152b"]]), dl = /* @__PURE__ */ K({
|
|
3444
|
+
name: "HeaderFilter",
|
|
3445
|
+
props: {
|
|
3446
|
+
header: {
|
|
3447
|
+
type: Object,
|
|
3448
|
+
required: !0
|
|
3449
|
+
}
|
|
3450
|
+
},
|
|
3451
|
+
setup(e) {
|
|
3452
|
+
const o = pn(), t = R(() => e.header.column), n = R(() => t.value.columnDef.meta), i = k(!1), l = k(), r = R({
|
|
3453
|
+
get() {
|
|
3454
|
+
return t.value.getFilterValue();
|
|
3455
|
+
},
|
|
3456
|
+
set(f) {
|
|
3457
|
+
l.value = f;
|
|
3458
|
+
}
|
|
3459
|
+
}), s = () => {
|
|
3460
|
+
t.value.setFilterValue(l.value), i.value = !1;
|
|
3461
|
+
}, a = () => {
|
|
3462
|
+
l.value = null, t.value.setFilterValue(l.value), i.value = !1;
|
|
3463
|
+
}, u = () => ve("div", {
|
|
3464
|
+
class: "relative h-[22px] cursor-pointer"
|
|
3465
|
+
}, [ve("div", {
|
|
3466
|
+
class: "absolute left-1/2 top-1/2 flex h-[30px] w-[20px] translate-x-[-50%] translate-y-[-50%] items-center justify-center text-[#0000004a] hover:bg-[#0000000f] hover:text-[#00000073]"
|
|
3467
|
+
}, [o.customFilterIcon?.({
|
|
3468
|
+
columnKey: t.value.id,
|
|
3469
|
+
filtered: t.value.getIsFiltered(),
|
|
3470
|
+
column: n.value
|
|
3471
|
+
}) || ve(hi, {
|
|
3472
|
+
class: t.value.getIsFiltered() ? "text-[#1677ff]" : ""
|
|
3473
|
+
}, null)])]), c = () => o.customFilterDropdown?.({
|
|
3474
|
+
confirm: s,
|
|
3475
|
+
reset: a,
|
|
3476
|
+
setFilterValue: (f) => r.value = f,
|
|
3477
|
+
column: n.value,
|
|
3478
|
+
filterModelValue: r.value
|
|
3479
|
+
}) || q("div", "我是默认下拉");
|
|
3480
|
+
return () => o?.customPopover?.({
|
|
3481
|
+
open: i.value,
|
|
3482
|
+
onOpenChange: (g) => i.value = g,
|
|
3483
|
+
trigger: u,
|
|
3484
|
+
content: c
|
|
3485
|
+
}) || q(Hn, {
|
|
3486
|
+
open: i.value,
|
|
3487
|
+
onOpenChange: (g) => i.value = g
|
|
3488
|
+
}, {
|
|
3489
|
+
default: u,
|
|
3490
|
+
content: c
|
|
3491
|
+
});
|
|
3492
|
+
}
|
|
3493
|
+
}), gl = { class: "flex h-full w-full items-center" }, fl = { class: "ml-auto flex items-center" }, pl = /* @__PURE__ */ K({
|
|
3494
|
+
name: "HeaderCell",
|
|
3495
|
+
__name: "HeaderCell",
|
|
3496
|
+
props: {
|
|
3497
|
+
header: {}
|
|
3498
|
+
},
|
|
3499
|
+
setup(e) {
|
|
3500
|
+
const o = e, t = R(() => o.header.column), n = R(() => t.value.columnDef), i = R(() => n.value.meta), l = R(() => t.value.id), r = R(() => {
|
|
3501
|
+
const p = n.value.header;
|
|
3502
|
+
if (typeof p == "function") {
|
|
3503
|
+
const v = p(o.header.getContext());
|
|
3504
|
+
return typeof v == "string" ? q("span", v) : v;
|
|
3505
|
+
}
|
|
3506
|
+
return q("span", String(p ?? l.value));
|
|
3507
|
+
}), s = R(() => n.value.enableSorting), a = R(() => t.value.getIsSorted() || null), u = (p) => {
|
|
3508
|
+
s.value && t.value.getToggleSortingHandler()?.(p);
|
|
3509
|
+
}, c = R(() => n.value.enableColumnFilter), f = R(() => t.value.getCanResize()), g = (p) => {
|
|
3510
|
+
o.header.getResizeHandler()?.(p);
|
|
3511
|
+
}, d = (p) => {
|
|
3512
|
+
o.header.getResizeHandler()?.(p);
|
|
3513
|
+
}, m = () => {
|
|
3514
|
+
t.value.resetSize();
|
|
3515
|
+
};
|
|
3516
|
+
return (p, v) => (y(), I("div", gl, [
|
|
3517
|
+
b("div", {
|
|
3518
|
+
class: H([[
|
|
3519
|
+
i.value?.columnAlign === "right" ? "inline-flex" : "flex",
|
|
3520
|
+
s.value ? "cursor-pointer" : ""
|
|
3521
|
+
], "min-w-0 flex-1 items-center gap-[4px]"]),
|
|
3522
|
+
onClick: u
|
|
3523
|
+
}, [
|
|
3524
|
+
L(p.$slots, "headerCell", {
|
|
3525
|
+
column: i.value,
|
|
3526
|
+
columnKey: l.value
|
|
3527
|
+
}, () => [
|
|
3528
|
+
(y(), Z(It(r.value)))
|
|
3529
|
+
], !0),
|
|
3530
|
+
b("div", fl, [
|
|
3531
|
+
s.value ? (y(), Z(fi, {
|
|
3532
|
+
key: 0,
|
|
3533
|
+
class: H({ "mr-[16px]": c.value }),
|
|
3534
|
+
sort: a.value
|
|
3535
|
+
}, null, 8, ["class", "sort"])) : Q("", !0),
|
|
3536
|
+
c.value ? (y(), Z(w(dl), {
|
|
3537
|
+
key: 1,
|
|
3538
|
+
header: o.header
|
|
3539
|
+
}, Ct({ _: 2 }, [
|
|
3540
|
+
p.$slots.customFilterDropdown ? {
|
|
3541
|
+
name: "customFilterDropdown",
|
|
3542
|
+
fn: ee((C) => [
|
|
3543
|
+
L(p.$slots, "customFilterDropdown", rt(st(C)), void 0, !0)
|
|
3544
|
+
]),
|
|
3545
|
+
key: "0"
|
|
3546
|
+
} : void 0,
|
|
3547
|
+
p.$slots.customFilterIcon ? {
|
|
3548
|
+
name: "customFilterIcon",
|
|
3549
|
+
fn: ee((C) => [
|
|
3550
|
+
L(p.$slots, "customFilterIcon", rt(st(C)), void 0, !0)
|
|
3551
|
+
]),
|
|
3552
|
+
key: "1"
|
|
3553
|
+
} : void 0,
|
|
3554
|
+
p.$slots.customPopover ? {
|
|
3555
|
+
name: "customPopover",
|
|
3556
|
+
fn: ee((C) => [
|
|
3557
|
+
L(p.$slots, "customPopover", rt(st(C)), void 0, !0)
|
|
3558
|
+
]),
|
|
3559
|
+
key: "2"
|
|
3560
|
+
} : void 0
|
|
3561
|
+
]), 1032, ["header"])) : Q("", !0)
|
|
3562
|
+
])
|
|
3563
|
+
], 2),
|
|
3564
|
+
f.value ? (y(), I("div", {
|
|
3565
|
+
key: 0,
|
|
3566
|
+
class: H(["resize-handle", [t.value.getIsResizing() ? "isResizing" : ""]]),
|
|
3567
|
+
onMousedown: g,
|
|
3568
|
+
onTouchstart: d,
|
|
3569
|
+
onDblclick: eo(m, ["stop"])
|
|
3570
|
+
}, [...v[0] || (v[0] = [
|
|
3571
|
+
b("div", { class: "resize-handle-line" }, null, -1)
|
|
3572
|
+
])], 34)) : Q("", !0)
|
|
3573
|
+
]));
|
|
3574
|
+
}
|
|
3575
|
+
}), hl = /* @__PURE__ */ de(pl, [["__scopeId", "data-v-1bfd2c2e"]]);
|
|
3576
|
+
const Ve = "CHECKBOX_COLUMN_KEY", vt = "EXPAND_COLUMN_KEY", Xe = "_isExpandRow", Tn = "_expandChildren", ml = {
|
|
3577
|
+
padding: "12px",
|
|
3578
|
+
minWidth: "0px"
|
|
3579
|
+
}, vl = {
|
|
3580
|
+
columns: () => [],
|
|
3581
|
+
data: () => [],
|
|
3582
|
+
rowHeight: void 0,
|
|
3583
|
+
rowKey: void 0,
|
|
3584
|
+
loading: !1,
|
|
3585
|
+
fixedHeader: !0,
|
|
3586
|
+
enableSortingRemoval: !0,
|
|
3587
|
+
enableExpandRow: !1,
|
|
3588
|
+
enableRowHover: !0,
|
|
3589
|
+
adaptiveColumnWidth: 120,
|
|
3590
|
+
defaultExpandAllRows: !1,
|
|
3591
|
+
columnResizeMode: "onChange",
|
|
3592
|
+
borderConfig: () => ({
|
|
3593
|
+
enabled: !1,
|
|
3594
|
+
borderStyle: "solid",
|
|
3595
|
+
borderColor: "#f0f0f0"
|
|
3596
|
+
}),
|
|
3597
|
+
rowSelectionConfig: () => ({
|
|
3598
|
+
enabled: !1,
|
|
3599
|
+
getRowCheckDisabled: () => !1,
|
|
3600
|
+
onChange: () => {
|
|
3601
|
+
}
|
|
3602
|
+
}),
|
|
3603
|
+
loadMoreConfig: () => ({
|
|
3604
|
+
showNoMore: !1,
|
|
3605
|
+
noMoreText: "没有更多了"
|
|
3606
|
+
}),
|
|
3607
|
+
paginationConfig: () => ({
|
|
3608
|
+
enabled: !1,
|
|
3609
|
+
placement: "right",
|
|
3610
|
+
total: 0,
|
|
3611
|
+
mode: "server"
|
|
3612
|
+
}),
|
|
3613
|
+
treeConfig: () => ({
|
|
3614
|
+
enabled: !1,
|
|
3615
|
+
childrenKey: "children",
|
|
3616
|
+
indentSize: 16
|
|
3617
|
+
}),
|
|
3618
|
+
customRow: void 0,
|
|
3619
|
+
customHeaderCell: void 0,
|
|
3620
|
+
customCell: void 0,
|
|
3621
|
+
onTableChange: () => {
|
|
3622
|
+
},
|
|
3623
|
+
onScrollToBottom: () => {
|
|
3624
|
+
},
|
|
3625
|
+
onExpandedRowsChange: () => {
|
|
3626
|
+
}
|
|
3627
|
+
}, Cl = /* @__PURE__ */ K({
|
|
3628
|
+
name: "ExpandIcon",
|
|
3629
|
+
__name: "ExpandIcon",
|
|
3630
|
+
props: {
|
|
3631
|
+
expand: { type: Boolean },
|
|
3632
|
+
expandable: { type: Boolean, default: !0 },
|
|
3633
|
+
onExpand: { type: Function, default: () => {
|
|
3634
|
+
} }
|
|
3635
|
+
},
|
|
3636
|
+
setup(e) {
|
|
3637
|
+
const o = e, t = R(() => ({
|
|
3638
|
+
"row-expand-icon": !0,
|
|
3639
|
+
"row-expand-icon-spaced": !o.expandable,
|
|
3640
|
+
"row-expand-icon-expanded": o.expandable && o.expand,
|
|
3641
|
+
"row-expand-icon-collapsed": o.expandable && !o.expand
|
|
3642
|
+
})), n = (i) => {
|
|
3643
|
+
o.expandable && (o.onExpand?.(o.expand, i), i.stopPropagation());
|
|
3644
|
+
};
|
|
3645
|
+
return (i, l) => (y(), I("button", {
|
|
3646
|
+
type: "button",
|
|
3647
|
+
class: H(w(t)),
|
|
3648
|
+
onClick: n
|
|
3649
|
+
}, null, 2));
|
|
3650
|
+
}
|
|
3651
|
+
}), ln = /* @__PURE__ */ de(Cl, [["__scopeId", "data-v-6353a638"]]), wl = ["checked", "disabled", "indeterminate"], Sl = {
|
|
3652
|
+
key: 0,
|
|
3653
|
+
class: "checkbox-label"
|
|
3654
|
+
}, xl = /* @__PURE__ */ K({
|
|
3655
|
+
name: "VCheckbox",
|
|
3656
|
+
__name: "VCheckbox",
|
|
3657
|
+
props: {
|
|
3658
|
+
checked: { type: Boolean, default: !1 },
|
|
3659
|
+
disabled: { type: Boolean, default: !1 },
|
|
3660
|
+
indeterminate: { type: Boolean, default: !1 },
|
|
3661
|
+
onCheckedChange: { type: Function, default: () => {
|
|
3662
|
+
} }
|
|
3663
|
+
},
|
|
3664
|
+
setup(e) {
|
|
3665
|
+
const o = e, t = R(() => ({
|
|
3666
|
+
"checkbox-wrapper": !0,
|
|
3667
|
+
"checkbox-wrapper-checked": o.checked,
|
|
3668
|
+
"checkbox-wrapper-disabled": o.disabled
|
|
3669
|
+
})), n = R(() => ({
|
|
3670
|
+
checkbox: !0,
|
|
3671
|
+
"checkbox-checked": o.checked && !o.indeterminate,
|
|
3672
|
+
"checkbox-disabled": o.disabled,
|
|
3673
|
+
"checkbox-indeterminate": o.indeterminate
|
|
3674
|
+
})), i = (l) => {
|
|
3675
|
+
o.disabled || o.onCheckedChange?.(l);
|
|
3676
|
+
};
|
|
3677
|
+
return (l, r) => (y(), I("label", {
|
|
3678
|
+
class: H(w(t))
|
|
3679
|
+
}, [
|
|
3680
|
+
b("span", {
|
|
3681
|
+
class: H(w(n))
|
|
3682
|
+
}, [
|
|
3683
|
+
b("input", {
|
|
3684
|
+
type: "checkbox",
|
|
3685
|
+
checked: e.checked,
|
|
3686
|
+
disabled: e.disabled,
|
|
3687
|
+
indeterminate: e.indeterminate,
|
|
3688
|
+
class: "checkbox-input",
|
|
3689
|
+
onChange: i
|
|
3690
|
+
}, null, 40, wl),
|
|
3691
|
+
r[0] || (r[0] = b("span", { class: "checkbox-inner" }, null, -1))
|
|
3692
|
+
], 2),
|
|
3693
|
+
l.$slots.default ? (y(), I("span", Sl, [
|
|
3694
|
+
L(l.$slots, "default", {}, void 0, !0)
|
|
3695
|
+
])) : Q("", !0)
|
|
3696
|
+
], 2));
|
|
3697
|
+
}
|
|
3698
|
+
}), rn = /* @__PURE__ */ de(xl, [["__scopeId", "data-v-0ae2dcb2"]]), yl = { class: "flex h-full items-center justify-center bg-[rgba(255,255,255,0.5)]" }, Rl = { class: "animate-custom-spin dot-container relative" }, _l = /* @__PURE__ */ K({
|
|
3699
|
+
name: "VLoading",
|
|
3700
|
+
__name: "index",
|
|
3701
|
+
props: {
|
|
3702
|
+
size: { default: "default" }
|
|
3703
|
+
},
|
|
3704
|
+
setup(e) {
|
|
3705
|
+
hn((n) => ({
|
|
3706
|
+
v555196f2: w(t).containerSize,
|
|
3707
|
+
v5ea8f08c: w(t).dotSize
|
|
3708
|
+
}));
|
|
3709
|
+
const o = e, t = R(() => ({
|
|
3710
|
+
default: {
|
|
3711
|
+
containerSize: "20px",
|
|
3712
|
+
dotSize: "9px"
|
|
3713
|
+
},
|
|
3714
|
+
small: {
|
|
3715
|
+
containerSize: "14px",
|
|
3716
|
+
dotSize: "6px"
|
|
3717
|
+
},
|
|
3718
|
+
large: {
|
|
3719
|
+
containerSize: "32px",
|
|
3720
|
+
dotSize: "14px"
|
|
3721
|
+
}
|
|
3722
|
+
})[o.size]);
|
|
3723
|
+
return (n, i) => (y(), I("div", yl, [
|
|
3724
|
+
L(n.$slots, "default", {}, () => [
|
|
3725
|
+
b("div", Rl, [
|
|
3726
|
+
(y(), I(ce, null, _e(4, (l) => b("div", {
|
|
3727
|
+
key: l,
|
|
3728
|
+
class: "dot-item animate-fade absolute origin-center scale-75 rounded-full bg-[#1677ff] opacity-[0.3]"
|
|
3729
|
+
})), 64))
|
|
3730
|
+
])
|
|
3731
|
+
], !0)
|
|
3732
|
+
]));
|
|
3733
|
+
}
|
|
3734
|
+
}), sn = /* @__PURE__ */ de(_l, [["__scopeId", "data-v-ae03bf31"]]), an = (e, o = !0) => {
|
|
3735
|
+
if (e._loadingNode && JSON.stringify(e._loadingOptions) === JSON.stringify(o)) return;
|
|
3736
|
+
$t(e);
|
|
3737
|
+
const t = document.createElement("div");
|
|
3738
|
+
t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.right = "0", t.style.bottom = "0", t.style.zIndex = "1000";
|
|
3739
|
+
const n = typeof o == "boolean" ? {} : { size: o.size }, i = typeof o != "boolean" ? o.indicator : void 0, l = i ? q(sn, n, () => i) : q(sn, n);
|
|
3740
|
+
mn(l, t);
|
|
3741
|
+
const r = getComputedStyle(e).position;
|
|
3742
|
+
["relative", "absolute", "fixed"].includes(r) || (e.style.position = "relative"), e.appendChild(t), e._loadingNode = { vNode: l, element: t }, e._loadingOptions = o;
|
|
3743
|
+
}, $t = (e) => {
|
|
3744
|
+
const o = e._loadingNode;
|
|
3745
|
+
o && (mn(null, o.element), e.contains(o.element) && e.removeChild(o.element), delete e._loadingNode, delete e._loadingOptions);
|
|
3746
|
+
}, un = (e) => typeof e == "boolean" ? e : e.spinning, Fl = {
|
|
3747
|
+
mounted(e, o) {
|
|
3748
|
+
un(o.value) && an(e, o.value);
|
|
3749
|
+
},
|
|
3750
|
+
updated(e, o) {
|
|
3751
|
+
un(o.value) ? an(e, o.value) : $t(e);
|
|
3752
|
+
},
|
|
3753
|
+
unmounted(e) {
|
|
3754
|
+
$t(e);
|
|
3755
|
+
}
|
|
3756
|
+
}, Ml = {
|
|
3757
|
+
viewBox: "0 0 1024 1024",
|
|
3758
|
+
width: "1em",
|
|
3759
|
+
height: "1em",
|
|
3760
|
+
fill: "currentColor",
|
|
3761
|
+
"aria-hidden": "true",
|
|
3762
|
+
focusable: "false"
|
|
3763
|
+
}, $l = {
|
|
3764
|
+
key: 0,
|
|
3765
|
+
d: "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"
|
|
3766
|
+
}, El = {
|
|
3767
|
+
key: 1,
|
|
3768
|
+
d: "M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"
|
|
3769
|
+
}, cn = /* @__PURE__ */ K({
|
|
3770
|
+
name: "ArrowIcon",
|
|
3771
|
+
__name: "ArrowIcon",
|
|
3772
|
+
props: {
|
|
3773
|
+
direction: {}
|
|
3774
|
+
},
|
|
3775
|
+
setup(e) {
|
|
3776
|
+
return (o, t) => (y(), I("svg", Ml, [
|
|
3777
|
+
e.direction === "left" ? (y(), I("path", $l)) : (y(), I("path", El))
|
|
3778
|
+
]));
|
|
3779
|
+
}
|
|
3780
|
+
}), Il = { class: "select-selector" }, Pl = { class: "select-selection-item" }, Vl = { class: "select-dropdown-inner" }, bl = ["onClick"], Al = /* @__PURE__ */ K({
|
|
3781
|
+
name: "VSelect",
|
|
3782
|
+
inheritAttrs: !1,
|
|
3783
|
+
__name: "VSelect",
|
|
3784
|
+
props: {
|
|
3785
|
+
value: { default: void 0 },
|
|
3786
|
+
options: { default: () => [] },
|
|
3787
|
+
onSelectChange: { type: Function, default: () => {
|
|
3788
|
+
} }
|
|
3789
|
+
},
|
|
3790
|
+
setup(e) {
|
|
3791
|
+
const o = e, t = k(!1), n = k(null), i = k("auto"), l = R(() => ({
|
|
3792
|
+
select: !0,
|
|
3793
|
+
"select-open": t.value
|
|
3794
|
+
})), r = R(() => o.options.find((c) => c.value === o.value)?.label || ""), s = (u) => {
|
|
3795
|
+
t.value = u, u && n.value && (i.value = `${n.value.offsetWidth}px`);
|
|
3796
|
+
}, a = (u) => {
|
|
3797
|
+
o.onSelectChange?.(u.value), t.value = !1;
|
|
3798
|
+
};
|
|
3799
|
+
return (u, c) => (y(), Z(Hn, {
|
|
3800
|
+
open: w(t),
|
|
3801
|
+
placement: "bottom",
|
|
3802
|
+
onOpenChange: s
|
|
3803
|
+
}, {
|
|
3804
|
+
content: ee(() => [
|
|
3805
|
+
b("div", {
|
|
3806
|
+
class: "select-dropdown",
|
|
3807
|
+
style: pe({ width: w(i) })
|
|
3808
|
+
}, [
|
|
3809
|
+
b("div", Vl, [
|
|
3810
|
+
(y(!0), I(ce, null, _e(o.options, (f) => (y(), I("div", {
|
|
3811
|
+
key: f.value,
|
|
3812
|
+
class: H(["select-item", { "select-item-selected": f.value === o.value }]),
|
|
3813
|
+
onClick: (g) => a(f)
|
|
3814
|
+
}, ze(f.label), 11, bl))), 128))
|
|
3815
|
+
])
|
|
3816
|
+
], 4)
|
|
3817
|
+
]),
|
|
3818
|
+
default: ee(() => [
|
|
3819
|
+
b("div", {
|
|
3820
|
+
ref_key: "selectRef",
|
|
3821
|
+
ref: n,
|
|
3822
|
+
class: H(w(l))
|
|
3823
|
+
}, [
|
|
3824
|
+
b("div", Il, [
|
|
3825
|
+
b("span", Pl, ze(w(r)), 1),
|
|
3826
|
+
c[0] || (c[0] = b("span", { class: "select-arrow" }, "▼", -1))
|
|
3827
|
+
])
|
|
3828
|
+
], 2)
|
|
3829
|
+
]),
|
|
3830
|
+
_: 1
|
|
3831
|
+
}, 8, ["open"]));
|
|
3832
|
+
}
|
|
3833
|
+
}), zl = /* @__PURE__ */ de(Al, [["__scopeId", "data-v-dcbac10d"]]), Dl = { class: "pagination" }, Ol = { class: "pagination-total" }, Ll = { class: "pagination-list" }, kl = ["onClick"], Hl = { class: "pagination-size-changer" }, Tl = /* @__PURE__ */ K({
|
|
3834
|
+
name: "VPagination",
|
|
3835
|
+
__name: "VPagination",
|
|
3836
|
+
props: {
|
|
3837
|
+
pageSize: { default: 10 },
|
|
3838
|
+
pageIndex: { default: 1 },
|
|
3839
|
+
total: { default: 0 },
|
|
3840
|
+
onPageChange: { type: Function, default: () => {
|
|
3841
|
+
} }
|
|
3842
|
+
},
|
|
3843
|
+
setup(e) {
|
|
3844
|
+
const o = e, t = R(() => Math.ceil(o.total / o.pageSize)), n = R(() => {
|
|
3845
|
+
const s = [], a = t.value, u = o.pageIndex;
|
|
3846
|
+
if (a <= 7)
|
|
3847
|
+
for (let c = 1; c <= a; c++)
|
|
3848
|
+
s.push(c);
|
|
3849
|
+
else if (u <= 4) {
|
|
3850
|
+
for (let c = 1; c <= 5; c++)
|
|
3851
|
+
s.push(c);
|
|
3852
|
+
s.push("..."), s.push(a);
|
|
3853
|
+
} else if (u >= a - 3) {
|
|
3854
|
+
s.push(1), s.push("...");
|
|
3855
|
+
for (let c = a - 4; c <= a; c++)
|
|
3856
|
+
s.push(c);
|
|
3857
|
+
} else {
|
|
3858
|
+
s.push(1), s.push("...");
|
|
3859
|
+
for (let c = u - 1; c <= u + 1; c++)
|
|
3860
|
+
s.push(c);
|
|
3861
|
+
s.push("..."), s.push(a);
|
|
3862
|
+
}
|
|
3863
|
+
return s;
|
|
3864
|
+
}), i = () => {
|
|
3865
|
+
o.pageIndex > 1 && r(o.pageIndex - 1);
|
|
3866
|
+
}, l = () => {
|
|
3867
|
+
o.pageIndex < t.value && r(o.pageIndex + 1);
|
|
3868
|
+
}, r = (s) => {
|
|
3869
|
+
s !== o.pageIndex && o.onPageChange?.(s, o.pageSize);
|
|
3870
|
+
};
|
|
3871
|
+
return (s, a) => (y(), I("div", Dl, [
|
|
3872
|
+
b("span", Ol, "共 " + ze(o.total) + " 条", 1),
|
|
3873
|
+
b("ul", Ll, [
|
|
3874
|
+
b("li", {
|
|
3875
|
+
class: H([
|
|
3876
|
+
"pagination-item",
|
|
3877
|
+
"pagination-prev",
|
|
3878
|
+
{ "pagination-disabled": o.pageIndex === 1 }
|
|
3879
|
+
]),
|
|
3880
|
+
onClick: i
|
|
3881
|
+
}, [
|
|
3882
|
+
ve(cn, { direction: "left" })
|
|
3883
|
+
], 2),
|
|
3884
|
+
(y(!0), I(ce, null, _e(w(n), (u, c) => (y(), I("li", {
|
|
3885
|
+
key: c,
|
|
3886
|
+
class: H([
|
|
3887
|
+
"pagination-item",
|
|
3888
|
+
{
|
|
3889
|
+
"pagination-item-active": u === o.pageIndex,
|
|
3890
|
+
"pagination-ellipsis": u === "..."
|
|
3891
|
+
}
|
|
3892
|
+
]),
|
|
3893
|
+
onClick: (f) => u !== "..." && r(u)
|
|
3894
|
+
}, ze(u), 11, kl))), 128)),
|
|
3895
|
+
b("li", {
|
|
3896
|
+
class: H([
|
|
3897
|
+
"pagination-item",
|
|
3898
|
+
"pagination-next",
|
|
3899
|
+
{ "pagination-disabled": o.pageIndex === w(t) }
|
|
3900
|
+
]),
|
|
3901
|
+
onClick: l
|
|
3902
|
+
}, [
|
|
3903
|
+
ve(cn, { direction: "right" })
|
|
3904
|
+
], 2)
|
|
3905
|
+
]),
|
|
3906
|
+
b("div", Hl, [
|
|
3907
|
+
ve(zl, {
|
|
3908
|
+
value: o.pageSize,
|
|
3909
|
+
options: [
|
|
3910
|
+
{ label: "10", value: 10 },
|
|
3911
|
+
{ label: "20", value: 20 },
|
|
3912
|
+
{ label: "50", value: 50 },
|
|
3913
|
+
{ label: "100", value: 100 }
|
|
3914
|
+
],
|
|
3915
|
+
onSelectChange: a[0] || (a[0] = (u) => o.onPageChange?.(1, u))
|
|
3916
|
+
}, null, 8, ["value"]),
|
|
3917
|
+
a[1] || (a[1] = b("span", { class: "pagination-size-text" }, "条/页", -1))
|
|
3918
|
+
])
|
|
3919
|
+
]));
|
|
3920
|
+
}
|
|
3921
|
+
}), Gl = /* @__PURE__ */ de(Tl, [["__scopeId", "data-v-b9fabd3e"]]);
|
|
3922
|
+
function Nl(e, o = 0) {
|
|
3923
|
+
return e.map((t) => ({
|
|
3924
|
+
id: t.columnKey,
|
|
3925
|
+
accessorKey: t.columnKey,
|
|
3926
|
+
// 将百分比转换为像素值
|
|
3927
|
+
size: t.columnWidth ? Gn(t.columnWidth, o) : void 0,
|
|
3928
|
+
header: t.columnHeader,
|
|
3929
|
+
cell: t.columnCell,
|
|
3930
|
+
enableSorting: t.columnEnableSort,
|
|
3931
|
+
enableColumnFilter: t.columnEnableFilter,
|
|
3932
|
+
sortDescFirst: !0,
|
|
3933
|
+
enableResizing: t.columnEnableResize ?? !1,
|
|
3934
|
+
minSize: t.columnMinWidth ?? 50,
|
|
3935
|
+
maxSize: t.columnMaxWidth,
|
|
3936
|
+
meta: t
|
|
3937
|
+
}));
|
|
3938
|
+
}
|
|
3939
|
+
function Bl(e) {
|
|
3940
|
+
return e.map((o) => ({
|
|
3941
|
+
...o,
|
|
3942
|
+
[Tn]: [{ ...o, [Xe]: !0 }]
|
|
3943
|
+
}));
|
|
3944
|
+
}
|
|
3945
|
+
function Wl(e, o, t = "children") {
|
|
3946
|
+
const n = [];
|
|
3947
|
+
function i(l) {
|
|
3948
|
+
l.forEach((r) => {
|
|
3949
|
+
const s = o ? typeof o == "function" ? o(r) : r[o] : r.id;
|
|
3950
|
+
n.push(String(s));
|
|
3951
|
+
const a = r[t];
|
|
3952
|
+
a?.length && i(a);
|
|
3953
|
+
});
|
|
3954
|
+
}
|
|
3955
|
+
return i(e), n;
|
|
3956
|
+
}
|
|
3957
|
+
function jl(e) {
|
|
3958
|
+
let o = "";
|
|
3959
|
+
for (const t in e)
|
|
3960
|
+
Object.prototype.hasOwnProperty.call(e, t) && (o += `${t}:${e[t]};`);
|
|
3961
|
+
return o;
|
|
3962
|
+
}
|
|
3963
|
+
function Gn(e, o) {
|
|
3964
|
+
if (!e) return 0;
|
|
3965
|
+
if (typeof e == "number") return e;
|
|
3966
|
+
if (typeof e == "string" && e.endsWith("%")) {
|
|
3967
|
+
const t = parseFloat(e);
|
|
3968
|
+
return Math.round(o * t / 100);
|
|
3969
|
+
}
|
|
3970
|
+
return typeof e == "string" && e.endsWith("px") ? Math.round(parseFloat(e)) : 0;
|
|
3971
|
+
}
|
|
3972
|
+
const ql = { class: "flex h-full flex-col" }, Kl = { class: "relative min-h-0 flex-1" }, Ul = ["colspan"], Xl = ["data-index"], Yl = { class: "text-lightest flex w-full items-center justify-center" }, Jl = {
|
|
3973
|
+
key: 0,
|
|
3974
|
+
class: "absolute inset-0 flex items-center justify-center"
|
|
3975
|
+
}, Ql = 46, Zl = /* @__PURE__ */ K({
|
|
3976
|
+
name: "VTable",
|
|
3977
|
+
__name: "index",
|
|
3978
|
+
props: /* @__PURE__ */ oo(/* @__PURE__ */ io({
|
|
3979
|
+
data: {},
|
|
3980
|
+
columns: {},
|
|
3981
|
+
rowHeight: {},
|
|
3982
|
+
rowKey: { type: [String, Number, Function] },
|
|
3983
|
+
loading: { type: Boolean },
|
|
3984
|
+
fixedHeader: { type: Boolean },
|
|
3985
|
+
enableSortingRemoval: { type: Boolean },
|
|
3986
|
+
borderConfig: {},
|
|
3987
|
+
rowSelectionConfig: {},
|
|
3988
|
+
loadMoreConfig: {},
|
|
3989
|
+
paginationConfig: {},
|
|
3990
|
+
treeConfig: {},
|
|
3991
|
+
enableExpandRow: { type: Boolean },
|
|
3992
|
+
enableRowHover: { type: Boolean },
|
|
3993
|
+
adaptiveColumnWidth: {},
|
|
3994
|
+
defaultExpandAllRows: { type: Boolean },
|
|
3995
|
+
columnResizeMode: {},
|
|
3996
|
+
customRow: { type: Function },
|
|
3997
|
+
customHeaderCell: { type: Function },
|
|
3998
|
+
customCell: { type: Function },
|
|
3999
|
+
onTableChange: { type: Function },
|
|
4000
|
+
onScrollToBottom: { type: Function },
|
|
4001
|
+
onExpandedRowsChange: { type: Function }
|
|
4002
|
+
}, vl), {
|
|
4003
|
+
defaultFilter: { default: () => [] },
|
|
4004
|
+
defaultFilterModifiers: {},
|
|
4005
|
+
defaultSort: { default: () => [] },
|
|
4006
|
+
defaultSortModifiers: {},
|
|
4007
|
+
defaultPagination: {
|
|
4008
|
+
default: () => ({ pageIndex: 1, pageSize: 20 })
|
|
4009
|
+
},
|
|
4010
|
+
defaultPaginationModifiers: {},
|
|
4011
|
+
defaultExpanded: { type: [Boolean, Object], default: () => ({}) },
|
|
4012
|
+
defaultExpandedModifiers: {},
|
|
4013
|
+
defaultSelection: { default: () => ({}) },
|
|
4014
|
+
defaultSelectionModifiers: {},
|
|
4015
|
+
defaultColumnPinning: {
|
|
4016
|
+
default: () => ({})
|
|
4017
|
+
},
|
|
4018
|
+
defaultColumnPinningModifiers: {},
|
|
4019
|
+
defaultColumnSizing: {
|
|
4020
|
+
default: () => ({})
|
|
4021
|
+
},
|
|
4022
|
+
defaultColumnSizingModifiers: {}
|
|
4023
|
+
}),
|
|
4024
|
+
emits: ["update:defaultFilter", "update:defaultSort", "update:defaultPagination", "update:defaultExpanded", "update:defaultSelection", "update:defaultColumnPinning", "update:defaultColumnSizing"],
|
|
4025
|
+
setup(e, { expose: o }) {
|
|
4026
|
+
hn((h) => ({
|
|
4027
|
+
v261f5928: w(Wn),
|
|
4028
|
+
v24577c8c: w(jn)
|
|
4029
|
+
}));
|
|
4030
|
+
const t = e, n = pn(), i = k(null), l = k(0);
|
|
4031
|
+
let r = null;
|
|
4032
|
+
const s = () => {
|
|
4033
|
+
i.value && (r = new ResizeObserver((h) => {
|
|
4034
|
+
for (const $ of h)
|
|
4035
|
+
l.value = $.contentRect.width;
|
|
4036
|
+
}), r.observe(i.value));
|
|
4037
|
+
}, a = R(() => {
|
|
4038
|
+
const h = T.getAllColumns(), $ = l.value || 0;
|
|
4039
|
+
if ($ === 0) return {};
|
|
4040
|
+
const V = h.reduce((le, fe) => fe.columnDef.size ? le + Math.round(fe.getSize()) : le, 0), M = h.filter((le) => !le.columnDef.size), E = M.length;
|
|
4041
|
+
if (E === 0) return {};
|
|
4042
|
+
const ye = Math.max(0, $ - V);
|
|
4043
|
+
if (ye > 0) {
|
|
4044
|
+
const le = Math.floor(ye / E), fe = ye % E;
|
|
4045
|
+
return M.reduce(
|
|
4046
|
+
(Be, Kn, Un) => (Be[Kn.id] = le + (Un < fe ? 1 : 0), Be),
|
|
4047
|
+
{}
|
|
4048
|
+
);
|
|
4049
|
+
}
|
|
4050
|
+
return M.reduce(
|
|
4051
|
+
(le, fe) => (le[fe.id] = t.adaptiveColumnWidth, le),
|
|
4052
|
+
{}
|
|
4053
|
+
);
|
|
4054
|
+
}), u = (h) => {
|
|
4055
|
+
let $;
|
|
4056
|
+
const V = h.getSize();
|
|
4057
|
+
if (h.columnDef.size)
|
|
4058
|
+
$ = `${V}px`;
|
|
4059
|
+
else {
|
|
4060
|
+
const E = a.value[h.id];
|
|
4061
|
+
E && ($ = `${E}px`);
|
|
4062
|
+
}
|
|
4063
|
+
return $;
|
|
4064
|
+
}, c = R(() => ({
|
|
4065
|
+
id: Ve,
|
|
4066
|
+
accessorKey: Ve,
|
|
4067
|
+
size: 40,
|
|
4068
|
+
header: ({ table: h }) => {
|
|
4069
|
+
const $ = h.getRowModel().rows.filter((E) => E.getCanSelect()), V = $.filter((E) => E.getIsSelected()), M = {
|
|
4070
|
+
indeterminate: V.length > 0 && V.length < $.length,
|
|
4071
|
+
checked: h.getIsAllRowsSelected(),
|
|
4072
|
+
onCheckedChange: (E) => {
|
|
4073
|
+
h.getToggleAllRowsSelectedHandler()?.(E);
|
|
4074
|
+
},
|
|
4075
|
+
disabled: !1
|
|
4076
|
+
};
|
|
4077
|
+
return n?.customCheckbox?.(M) || q(rn, M);
|
|
4078
|
+
},
|
|
4079
|
+
cell: ({ row: h }) => {
|
|
4080
|
+
const $ = {
|
|
4081
|
+
checked: h.getIsSelected(),
|
|
4082
|
+
indeterminate: !1,
|
|
4083
|
+
disabled: !h.getCanSelect(),
|
|
4084
|
+
onCheckedChange: (V) => {
|
|
4085
|
+
h.getToggleSelectedHandler()?.(V);
|
|
4086
|
+
}
|
|
4087
|
+
};
|
|
4088
|
+
return n?.customCheckbox?.($) || q(rn, $);
|
|
4089
|
+
}
|
|
4090
|
+
})), f = {
|
|
4091
|
+
id: vt,
|
|
4092
|
+
accessorKey: vt,
|
|
4093
|
+
size: 50,
|
|
4094
|
+
header: () => "",
|
|
4095
|
+
cell: ({ row: h }) => q(
|
|
4096
|
+
"div",
|
|
4097
|
+
{
|
|
4098
|
+
class: "flex items-center justify-center w-full h-full"
|
|
4099
|
+
},
|
|
4100
|
+
q(ln, {
|
|
4101
|
+
expand: h.getIsExpanded(),
|
|
4102
|
+
onExpand: () => h.toggleExpanded()
|
|
4103
|
+
})
|
|
4104
|
+
)
|
|
4105
|
+
}, g = R(() => N.value.map((h) => `${h.id}_${jl(h.original)}`)), d = Re(e, "defaultFilter"), m = Re(e, "defaultSort"), p = Re(e, "defaultPagination"), v = Re(e, "defaultExpanded"), C = Re(e, "defaultSelection"), S = Re(e, "defaultColumnPinning"), x = Re(e, "defaultColumnSizing"), P = (h, $) => {
|
|
4106
|
+
p.value = { pageIndex: h, pageSize: $ }, A();
|
|
4107
|
+
}, A = () => {
|
|
4108
|
+
We(() => {
|
|
4109
|
+
t.onTableChange?.({
|
|
4110
|
+
pagination: p.value,
|
|
4111
|
+
sortList: m.value,
|
|
4112
|
+
filterList: d.value
|
|
4113
|
+
});
|
|
4114
|
+
});
|
|
4115
|
+
}, D = R(() => S.value.left?.length || S.value.right?.length), z = R(() => {
|
|
4116
|
+
const h = Nl(t.columns, l.value);
|
|
4117
|
+
return t.enableExpandRow && h.unshift(f), t.rowSelectionConfig?.enabled && h.unshift(c.value), h;
|
|
4118
|
+
}), O = R(() => {
|
|
4119
|
+
const h = Bl(t.data);
|
|
4120
|
+
if (t.paginationConfig?.enabled && t.paginationConfig?.mode === "client") {
|
|
4121
|
+
const { pageIndex: $, pageSize: V } = p.value, M = ($ - 1) * V, E = M + V;
|
|
4122
|
+
return h.slice(M, E);
|
|
4123
|
+
}
|
|
4124
|
+
return h;
|
|
4125
|
+
}), T = Jo({
|
|
4126
|
+
state: {
|
|
4127
|
+
get columnFilters() {
|
|
4128
|
+
return d.value;
|
|
4129
|
+
},
|
|
4130
|
+
get sorting() {
|
|
4131
|
+
return m.value;
|
|
4132
|
+
},
|
|
4133
|
+
get pagination() {
|
|
4134
|
+
return p.value;
|
|
4135
|
+
},
|
|
4136
|
+
get rowSelection() {
|
|
4137
|
+
return C.value;
|
|
4138
|
+
},
|
|
4139
|
+
get expanded() {
|
|
4140
|
+
return v.value;
|
|
4141
|
+
},
|
|
4142
|
+
get columnPinning() {
|
|
4143
|
+
return t.treeConfig.enabled ? {} : S.value;
|
|
4144
|
+
},
|
|
4145
|
+
get columnSizing() {
|
|
4146
|
+
return x.value;
|
|
4147
|
+
}
|
|
4148
|
+
},
|
|
4149
|
+
get data() {
|
|
4150
|
+
return O.value;
|
|
4151
|
+
},
|
|
4152
|
+
get columns() {
|
|
4153
|
+
return z.value;
|
|
4154
|
+
},
|
|
4155
|
+
getRowId: t.rowKey ? (h) => {
|
|
4156
|
+
if (h[Xe])
|
|
4157
|
+
return;
|
|
4158
|
+
const $ = typeof t.rowKey == "function" ? t.rowKey(h) : h[t.rowKey];
|
|
4159
|
+
return String($);
|
|
4160
|
+
} : void 0,
|
|
4161
|
+
getCoreRowModel: qo(),
|
|
4162
|
+
getExpandedRowModel: Ko(),
|
|
4163
|
+
enableRowSelection: (h) => !!(t.rowSelectionConfig?.getRowCheckDisabled?.(h.original) ?? !0),
|
|
4164
|
+
manualSorting: !0,
|
|
4165
|
+
// 手动排序,结合后端
|
|
4166
|
+
manualFiltering: !0,
|
|
4167
|
+
// 手动筛选,结合后端
|
|
4168
|
+
manualPagination: !0,
|
|
4169
|
+
enableColumnPinning: !0,
|
|
4170
|
+
enableColumnResizing: !0,
|
|
4171
|
+
columnResizeMode: t.columnResizeMode,
|
|
4172
|
+
enableSortingRemoval: t.enableSortingRemoval,
|
|
4173
|
+
onSortingChange: (h) => {
|
|
4174
|
+
m.value = typeof h == "function" ? h(m.value) : h, A();
|
|
4175
|
+
},
|
|
4176
|
+
onColumnFiltersChange: (h) => {
|
|
4177
|
+
d.value = typeof h == "function" ? h(d.value) : h, A();
|
|
4178
|
+
},
|
|
4179
|
+
onPaginationChange: (h) => {
|
|
4180
|
+
p.value = typeof h == "function" ? h(p.value) : h, A();
|
|
4181
|
+
},
|
|
4182
|
+
onExpandedChange: (h) => {
|
|
4183
|
+
v.value = typeof h == "function" ? h(v.value) : h, We(() => {
|
|
4184
|
+
t.onExpandedRowsChange?.(v.value);
|
|
4185
|
+
});
|
|
4186
|
+
},
|
|
4187
|
+
onRowSelectionChange: (h) => {
|
|
4188
|
+
C.value = typeof h == "function" ? h(C.value) : h, We(() => {
|
|
4189
|
+
t.rowSelectionConfig?.onChange?.(
|
|
4190
|
+
T.getSelectedRowModel().rows.map(($) => $.original)
|
|
4191
|
+
);
|
|
4192
|
+
});
|
|
4193
|
+
},
|
|
4194
|
+
onColumnSizingChange: (h) => {
|
|
4195
|
+
x.value = typeof h == "function" ? h(x.value) : h;
|
|
4196
|
+
},
|
|
4197
|
+
getSubRows: (h) => t.enableExpandRow ? h[Tn] : h[t.treeConfig.childrenKey]
|
|
4198
|
+
}), ie = () => {
|
|
4199
|
+
v.value = Wl(t.data, t.rowKey, t.treeConfig?.childrenKey).reduce(
|
|
4200
|
+
(h, $) => (h[$] = !0, h),
|
|
4201
|
+
{}
|
|
4202
|
+
);
|
|
4203
|
+
}, Se = R(() => {
|
|
4204
|
+
const h = {
|
|
4205
|
+
pageIndex: p.value.pageIndex,
|
|
4206
|
+
pageSize: p.value.pageSize,
|
|
4207
|
+
total: t.paginationConfig.total,
|
|
4208
|
+
onPageChange: P
|
|
4209
|
+
};
|
|
4210
|
+
return () => n?.customPagination?.(h) || q(Gl, h);
|
|
4211
|
+
}), N = R(() => T.getRowModel().rows), j = k([]), B = k(null), Ee = k(0), xe = R(() => ({
|
|
4212
|
+
count: N.value.length,
|
|
4213
|
+
estimateSize: () => t.rowHeight || 48,
|
|
4214
|
+
getScrollElement: () => i.value,
|
|
4215
|
+
overscan: 10,
|
|
4216
|
+
useScrollendEvent: !1,
|
|
4217
|
+
useAnimationFrameWithResizeObserver: !0,
|
|
4218
|
+
onChange: (h) => {
|
|
4219
|
+
if (!h.isScrolling) {
|
|
4220
|
+
j.value = h.getVirtualItems();
|
|
4221
|
+
return;
|
|
4222
|
+
}
|
|
4223
|
+
const $ = performance.now(), V = 1e3 / 60;
|
|
4224
|
+
$ - Ee.value > V && (Ee.value = $, B.value && cancelAnimationFrame(B.value), B.value = requestAnimationFrame(() => {
|
|
4225
|
+
j.value = h.getVirtualItems(), B.value = null;
|
|
4226
|
+
}));
|
|
4227
|
+
}
|
|
4228
|
+
})), W = ui(xe);
|
|
4229
|
+
Fe(
|
|
4230
|
+
() => N.value.length,
|
|
4231
|
+
() => {
|
|
4232
|
+
W.value.measure();
|
|
4233
|
+
},
|
|
4234
|
+
{ immediate: !0 }
|
|
4235
|
+
);
|
|
4236
|
+
function U(h, $) {
|
|
4237
|
+
if (h)
|
|
4238
|
+
if ($)
|
|
4239
|
+
W.value.measureElement(h);
|
|
4240
|
+
else {
|
|
4241
|
+
if (t.rowHeight) return;
|
|
4242
|
+
W.value.measureElement(h);
|
|
4243
|
+
}
|
|
4244
|
+
}
|
|
4245
|
+
dn(() => {
|
|
4246
|
+
const [h] = [...j.value].reverse();
|
|
4247
|
+
!h || !W.value.isScrolling || h.index >= O.value?.length - 1 && !t.loading && t.onScrollToBottom?.();
|
|
4248
|
+
});
|
|
4249
|
+
const J = R(() => j.value.length > 0 ? j.value[0].start : 0), Ne = R(() => {
|
|
4250
|
+
if (j.value.length === 0) return 0;
|
|
4251
|
+
const h = j.value[j.value.length - 1];
|
|
4252
|
+
return W.value.getTotalSize() - (h.start + h.size);
|
|
4253
|
+
}), Nn = R(() => O.value.length > 0 && !t.loading && t.loadMoreConfig?.showNoMore), Bn = R(() => t.loadMoreConfig?.noMoreText || "没有更多了"), Wn = R(() => t.borderConfig?.borderColor || "#f0f0f0"), jn = R(() => t.borderConfig?.borderStyle || "solid"), Ot = (h) => {
|
|
4254
|
+
const $ = h.columnDef.meta, V = h.getIsPinned(), M = u(h), E = {
|
|
4255
|
+
...ml,
|
|
4256
|
+
width: M,
|
|
4257
|
+
flex: M ? `0 0 ${M}` : "1 0 0",
|
|
4258
|
+
textAlign: $?.columnAlign || "left"
|
|
4259
|
+
};
|
|
4260
|
+
return V && (E.position = "sticky", V === "left" ? E.left = `${h.getStart("left")}px` : E.right = `${h.getAfter("right")}px`, E.zIndex = 10, E.backgroundColor = "#ffffff"), h.id === Ve && (E.display = "flex", E.alignItems = "center", E.justifyContent = "flex-end"), E;
|
|
4261
|
+
}, Lt = (h) => {
|
|
4262
|
+
const $ = h.getIsPinned();
|
|
4263
|
+
return $ ? $ === "left" && h.getIsLastColumn("left") ? "pinned-left-shadow" : $ === "right" && h.getIsFirstColumn("right") ? "pinned-right-shadow" : "" : "";
|
|
4264
|
+
}, qn = R(() => {
|
|
4265
|
+
const h = T.getAllColumns(), $ = l.value || 0;
|
|
4266
|
+
if ($ === 0) return "100%";
|
|
4267
|
+
const V = h.reduce((M, E) => {
|
|
4268
|
+
const ye = E.columnDef.size;
|
|
4269
|
+
if (ye) {
|
|
4270
|
+
const Be = Gn(ye, $);
|
|
4271
|
+
return M + Be;
|
|
4272
|
+
}
|
|
4273
|
+
const fe = a.value[E.id] || t.adaptiveColumnWidth;
|
|
4274
|
+
return M + fe;
|
|
4275
|
+
}, 0);
|
|
4276
|
+
return V <= $ ? "100%" : `${V}px`;
|
|
4277
|
+
});
|
|
4278
|
+
return fn(() => {
|
|
4279
|
+
s(), t.defaultExpandAllRows && ie();
|
|
4280
|
+
}), to(() => {
|
|
4281
|
+
B.value && (cancelAnimationFrame(B.value), B.value = null), r && (r.disconnect(), r = null);
|
|
4282
|
+
}), o({
|
|
4283
|
+
/** 滚动到指定行 */
|
|
4284
|
+
scrollToIndex: async (h) => {
|
|
4285
|
+
We(() => {
|
|
4286
|
+
W.value.scrollToIndex(h, { align: "start", behavior: "smooth" }), j.value = W.value.getVirtualItems();
|
|
4287
|
+
});
|
|
4288
|
+
}
|
|
4289
|
+
}), (h, $) => (y(), I("div", ql, [
|
|
4290
|
+
no((y(), I("div", Kl, [
|
|
4291
|
+
b("div", {
|
|
4292
|
+
ref_key: "tableContainerRef",
|
|
4293
|
+
ref: i,
|
|
4294
|
+
class: H(["h-full overflow-x-auto", { "overflow-y-auto": t.fixedHeader }])
|
|
4295
|
+
}, [
|
|
4296
|
+
b("table", {
|
|
4297
|
+
class: H({ "v-table-bordered": t.borderConfig?.enabled }),
|
|
4298
|
+
style: pe({ width: w(qn) })
|
|
4299
|
+
}, [
|
|
4300
|
+
b("thead", {
|
|
4301
|
+
class: H({ sticky: t.fixedHeader }),
|
|
4302
|
+
style: { top: 0, zIndex: 12 }
|
|
4303
|
+
}, [
|
|
4304
|
+
L(h.$slots, "customHeader", {
|
|
4305
|
+
columns: e.columns,
|
|
4306
|
+
table: w(T)
|
|
4307
|
+
}, () => [
|
|
4308
|
+
(y(!0), I(ce, null, _e(w(T).getHeaderGroups(), (V) => (y(), I("tr", {
|
|
4309
|
+
key: V.id,
|
|
4310
|
+
style: { display: "flex" }
|
|
4311
|
+
}, [
|
|
4312
|
+
(y(!0), I(ce, null, _e(V.headers, (M) => (y(), I("th", ae(
|
|
4313
|
+
{
|
|
4314
|
+
key: M.id,
|
|
4315
|
+
colspan: M.colSpan,
|
|
4316
|
+
class: ["relative", [
|
|
4317
|
+
M.id === w(Ve) ? "checkbox-col" : "",
|
|
4318
|
+
M.id === w(vt) ? "expand-col" : "",
|
|
4319
|
+
Lt(M.column)
|
|
4320
|
+
]],
|
|
4321
|
+
style: Ot(M.column)
|
|
4322
|
+
},
|
|
4323
|
+
{ ref_for: !0 },
|
|
4324
|
+
t?.customHeaderCell?.(
|
|
4325
|
+
M.column.columnDef?.meta,
|
|
4326
|
+
M.column.getIndex()
|
|
4327
|
+
)
|
|
4328
|
+
), [
|
|
4329
|
+
M.isPlaceholder ? Q("", !0) : (y(), I(ce, { key: 0 }, [
|
|
4330
|
+
M.id === w(Ve) ? (y(), Z(w(Nt), {
|
|
4331
|
+
key: 0,
|
|
4332
|
+
render: M.column.columnDef.header,
|
|
4333
|
+
props: M.getContext()
|
|
4334
|
+
}, null, 8, ["render", "props"])) : (y(), Z(hl, {
|
|
4335
|
+
key: 1,
|
|
4336
|
+
header: M
|
|
4337
|
+
}, Ct({ _: 2 }, [
|
|
4338
|
+
n.headerCell ? {
|
|
4339
|
+
name: "headerCell",
|
|
4340
|
+
fn: ee((E) => [
|
|
4341
|
+
L(h.$slots, "headerCell", ae({ ref_for: !0 }, E), void 0, !0)
|
|
4342
|
+
]),
|
|
4343
|
+
key: "0"
|
|
4344
|
+
} : void 0,
|
|
4345
|
+
n.customFilterDropdown ? {
|
|
4346
|
+
name: "customFilterDropdown",
|
|
4347
|
+
fn: ee((E) => [
|
|
4348
|
+
L(h.$slots, "customFilterDropdown", ae({ ref_for: !0 }, E), void 0, !0)
|
|
4349
|
+
]),
|
|
4350
|
+
key: "1"
|
|
4351
|
+
} : void 0,
|
|
4352
|
+
n.customFilterIcon ? {
|
|
4353
|
+
name: "customFilterIcon",
|
|
4354
|
+
fn: ee((E) => [
|
|
4355
|
+
L(h.$slots, "customFilterIcon", ae({ ref_for: !0 }, E), void 0, !0)
|
|
4356
|
+
]),
|
|
4357
|
+
key: "2"
|
|
4358
|
+
} : void 0,
|
|
4359
|
+
n.customPopover ? {
|
|
4360
|
+
name: "customPopover",
|
|
4361
|
+
fn: ee((E) => [
|
|
4362
|
+
L(h.$slots, "customPopover", ae({ ref_for: !0 }, E), void 0, !0)
|
|
4363
|
+
]),
|
|
4364
|
+
key: "3"
|
|
4365
|
+
} : void 0
|
|
4366
|
+
]), 1032, ["header"]))
|
|
4367
|
+
], 64))
|
|
4368
|
+
], 16, Ul))), 128))
|
|
4369
|
+
]))), 128))
|
|
4370
|
+
], !0)
|
|
4371
|
+
], 2),
|
|
4372
|
+
b("tbody", null, [
|
|
4373
|
+
w(J) > 0 ? (y(), I("tr", {
|
|
4374
|
+
key: 0,
|
|
4375
|
+
style: pe({ display: "flex", height: `${w(J)}px` })
|
|
4376
|
+
}, null, 4)) : Q("", !0),
|
|
4377
|
+
(y(!0), I(ce, null, _e(w(j), (V) => (y(), I("tr", ae({
|
|
4378
|
+
key: w(g)[V.index],
|
|
4379
|
+
ref_for: !0,
|
|
4380
|
+
ref: (M) => U(M, w(N)[V.index]?.original?.[w(Xe)]),
|
|
4381
|
+
"data-index": V.index,
|
|
4382
|
+
style: {
|
|
4383
|
+
display: "flex",
|
|
4384
|
+
minHeight: `${V.size}px`,
|
|
4385
|
+
width: "100%"
|
|
4386
|
+
},
|
|
4387
|
+
class: [t.enableRowHover ? "group hover:!bg-[#fafafa]" : ""]
|
|
4388
|
+
}, { ref_for: !0 }, t?.customRow?.(w(N)[V.index].original, V.index)), [
|
|
4389
|
+
w(N)[V.index].original?.[w(Xe)] ? (y(), I("td", {
|
|
4390
|
+
key: 1,
|
|
4391
|
+
style: pe({
|
|
4392
|
+
position: w(D) ? "sticky" : "static",
|
|
4393
|
+
left: 0,
|
|
4394
|
+
width: w(D) ? `${w(l)}px` : "auto",
|
|
4395
|
+
maxWidth: w(D) ? `${w(l)}px` : "none"
|
|
4396
|
+
})
|
|
4397
|
+
}, [
|
|
4398
|
+
L(h.$slots, "expandedRowRender", {
|
|
4399
|
+
row: w(N)[V.index].original
|
|
4400
|
+
}, void 0, !0)
|
|
4401
|
+
], 4)) : (y(!0), I(ce, { key: 0 }, _e(w(N)[V.index].getVisibleCells(), (M) => (y(), I("td", ae({
|
|
4402
|
+
key: M.id,
|
|
4403
|
+
style: Ot(M.column),
|
|
4404
|
+
class: ["group-hover:!bg-[#fafafa]", [Lt(M.column)]]
|
|
4405
|
+
}, { ref_for: !0 }, t?.customCell?.(M.column.columnDef?.meta, M.column.getIndex())), [
|
|
4406
|
+
M.column.id === w(Ve) ? (y(), Z(w(Nt), {
|
|
4407
|
+
key: 0,
|
|
4408
|
+
render: M.column.columnDef.cell,
|
|
4409
|
+
props: M.getContext()
|
|
4410
|
+
}, null, 8, ["render", "props"])) : (y(), Z(ci, {
|
|
4411
|
+
key: 1,
|
|
4412
|
+
cell: M
|
|
4413
|
+
}, Ct({ _: 2 }, [
|
|
4414
|
+
n.bodyCell ? {
|
|
4415
|
+
name: "bodyCell",
|
|
4416
|
+
fn: ee((E) => [
|
|
4417
|
+
t.treeConfig?.enabled && M.column.id === t.columns[0]?.columnKey ? (y(), I("div", {
|
|
4418
|
+
key: 0,
|
|
4419
|
+
class: "flex h-full items-center gap-[8px]",
|
|
4420
|
+
style: pe({
|
|
4421
|
+
paddingLeft: `${w(N)[V.index].depth * (t.treeConfig?.indentSize ?? 16)}px`
|
|
4422
|
+
})
|
|
4423
|
+
}, [
|
|
4424
|
+
ve(ln, {
|
|
4425
|
+
class: H([[w(N)[V.index].getCanExpand() ? "visible" : "invisible"], "flex-shrink-0"]),
|
|
4426
|
+
expand: w(N)[V.index].getIsExpanded(),
|
|
4427
|
+
onExpand: (ye) => w(N)[V.index].toggleExpanded()
|
|
4428
|
+
}, null, 8, ["class", "expand", "onExpand"]),
|
|
4429
|
+
L(h.$slots, "bodyCell", ae({ ref_for: !0 }, E), () => [
|
|
4430
|
+
Ht(ze(E.row[E.columnKey]), 1)
|
|
4431
|
+
], !0)
|
|
4432
|
+
], 4)) : L(h.$slots, "bodyCell", ae({
|
|
4433
|
+
key: 1,
|
|
4434
|
+
ref_for: !0
|
|
4435
|
+
}, E), void 0, !0)
|
|
4436
|
+
]),
|
|
4437
|
+
key: "0"
|
|
4438
|
+
} : void 0
|
|
4439
|
+
]), 1032, ["cell"]))
|
|
4440
|
+
], 16))), 128))
|
|
4441
|
+
], 16, Xl))), 128)),
|
|
4442
|
+
w(Ne) > 0 ? (y(), I("tr", {
|
|
4443
|
+
key: 1,
|
|
4444
|
+
style: pe({ display: "flex", height: `${w(Ne)}px`, border: "none" })
|
|
4445
|
+
}, null, 4)) : Q("", !0),
|
|
4446
|
+
w(Nn) ? (y(), I("tr", {
|
|
4447
|
+
key: 2,
|
|
4448
|
+
style: pe({ display: "flex", height: `${Ql}px`, borderBottom: "none" })
|
|
4449
|
+
}, [
|
|
4450
|
+
b("td", Yl, ze(w(Bn)), 1)
|
|
4451
|
+
], 4)) : Q("", !0)
|
|
4452
|
+
])
|
|
4453
|
+
], 6),
|
|
4454
|
+
w(j).length ? Q("", !0) : (y(), I("div", Jl, [
|
|
4455
|
+
L(h.$slots, "customEmpty", {}, () => [
|
|
4456
|
+
$[0] || ($[0] = Ht(" 当前内容为空 ", -1))
|
|
4457
|
+
], !0)
|
|
4458
|
+
]))
|
|
4459
|
+
], 2)
|
|
4460
|
+
])), [
|
|
4461
|
+
[w(Fl), { spinning: t.loading, indicator: n?.customLoadingIcon?.() }]
|
|
4462
|
+
]),
|
|
4463
|
+
t.paginationConfig.enabled ? (y(), I("div", {
|
|
4464
|
+
key: 0,
|
|
4465
|
+
class: H([[
|
|
4466
|
+
t.paginationConfig.placement === "left" ? "justify-start" : t.paginationConfig.placement === "center" ? "justify-center" : "justify-end"
|
|
4467
|
+
], "flex items-center py-[16px]"])
|
|
4468
|
+
}, [
|
|
4469
|
+
(y(), Z(It(w(Se))))
|
|
4470
|
+
], 2)) : Q("", !0)
|
|
4471
|
+
]));
|
|
4472
|
+
}
|
|
4473
|
+
}), tr = /* @__PURE__ */ de(Zl, [["__scopeId", "data-v-d74a23b6"]]);
|
|
4474
|
+
export {
|
|
4475
|
+
Ve as CHECKBOX_COLUMN_KEY,
|
|
4476
|
+
vt as EXPAND_COLUMN_KEY,
|
|
4477
|
+
Tn as EXPAND_ROW_DATA_INDEX,
|
|
4478
|
+
Xe as EXPAND_ROW_KEY,
|
|
4479
|
+
ml as TABLE_DEFAULT_STYLE,
|
|
4480
|
+
tr as VTable,
|
|
4481
|
+
tr as default,
|
|
4482
|
+
vl as vTableDefaultProps
|
|
4483
|
+
};
|
|
4484
|
+
//# sourceMappingURL=index.js.map
|