@prefabs.tech/vue3-tanstack-table 0.12.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/LICENSE +21 -0
- package/dist/PrefabsTechVue3TanstackTable.es.js +4787 -0
- package/dist/PrefabsTechVue3TanstackTable.umd.js +22 -0
- package/dist/menu.png +0 -0
- package/dist/src/components/FilesPresentation/Index.vue.d.ts +94 -0
- package/dist/src/components/FilesPresentation/Index.vue.d.ts.map +1 -0
- package/dist/src/components/FilesTable/Index.vue.d.ts +136 -0
- package/dist/src/components/FilesTable/Index.vue.d.ts.map +1 -0
- package/dist/src/components/Pagination.vue.d.ts +115 -0
- package/dist/src/components/Pagination.vue.d.ts.map +1 -0
- package/dist/src/components/Table.vue.d.ts +267 -0
- package/dist/src/components/Table.vue.d.ts.map +1 -0
- package/dist/src/components/TableBody.vue.d.ts +36 -0
- package/dist/src/components/TableBody.vue.d.ts.map +1 -0
- package/dist/src/components/TableDataActions.vue.d.ts +56 -0
- package/dist/src/components/TableDataActions.vue.d.ts.map +1 -0
- package/dist/src/components/TableHeader.vue.d.ts +33 -0
- package/dist/src/components/TableHeader.vue.d.ts.map +1 -0
- package/dist/src/components/TableToolbar.vue.d.ts +55 -0
- package/dist/src/components/TableToolbar.vue.d.ts.map +1 -0
- package/dist/src/components/TanstackTable.vue.d.ts +49 -0
- package/dist/src/components/TanstackTable.vue.d.ts.map +1 -0
- package/dist/src/constants.d.ts +10 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/types.d.ts +92 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/utils.d.ts +13 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/vue3-tanstack-table.css +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,4787 @@
|
|
|
1
|
+
import { defineComponent as K, h as W, isRef as Wt, shallowRef as Xt, watch as St, ref as j, watchEffect as Qt, unref as C, computed as B, createElementBlock as y, openBlock as S, createCommentVNode as V, createElementVNode as x, toDisplayString as H, Fragment as L, renderList as G, createVNode as A, createBlock as M, withCtx as T, normalizeClass as ae, normalizeStyle as te, mergeProps as ee, resolveDynamicComponent as wt, createTextVNode as Jt, renderSlot as Q, createSlots as Ct } from "vue";
|
|
2
|
+
import { DebouncedInput as yt, ButtonElement as J, Tooltip as Zt, formatDateTime as ke, formatDate as Yt, Dropdown as en, ConfirmationModal as tn, Popup as nn, SortableList as on, getStorage as rn, LoadingIcon as ln, FilesList as sn } from "@prefabs.tech/vue3-ui";
|
|
3
|
+
import { SelectInput as an, DatePicker as un, NumberInput as Ye, Checkbox as Ee } from "@prefabs.tech/vue3-form";
|
|
4
|
+
const Rt = /^[a-z0-9]+(-[a-z0-9]+)*$/, Ce = (e, o, t, n = "") => {
|
|
5
|
+
const i = e.split(":");
|
|
6
|
+
if (e.slice(0, 1) === "@") {
|
|
7
|
+
if (i.length < 2 || i.length > 3)
|
|
8
|
+
return null;
|
|
9
|
+
n = i.shift().slice(1);
|
|
10
|
+
}
|
|
11
|
+
if (i.length > 3 || !i.length)
|
|
12
|
+
return null;
|
|
13
|
+
if (i.length > 1) {
|
|
14
|
+
const l = i.pop(), a = i.pop(), d = {
|
|
15
|
+
// Allow provider without '@': "provider:prefix:name"
|
|
16
|
+
provider: i.length > 0 ? i[0] : n,
|
|
17
|
+
prefix: a,
|
|
18
|
+
name: l
|
|
19
|
+
};
|
|
20
|
+
return o && !he(d) ? null : d;
|
|
21
|
+
}
|
|
22
|
+
const r = i[0], s = r.split("-");
|
|
23
|
+
if (s.length > 1) {
|
|
24
|
+
const l = {
|
|
25
|
+
provider: n,
|
|
26
|
+
prefix: s.shift(),
|
|
27
|
+
name: s.join("-")
|
|
28
|
+
};
|
|
29
|
+
return o && !he(l) ? null : l;
|
|
30
|
+
}
|
|
31
|
+
if (t && n === "") {
|
|
32
|
+
const l = {
|
|
33
|
+
provider: n,
|
|
34
|
+
prefix: "",
|
|
35
|
+
name: r
|
|
36
|
+
};
|
|
37
|
+
return o && !he(l, t) ? null : l;
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}, he = (e, o) => e ? !!// Check prefix: cannot be empty, unless allowSimpleName is enabled
|
|
41
|
+
// Check name: cannot be empty
|
|
42
|
+
((o && e.prefix === "" || e.prefix) && e.name) : !1, Ft = Object.freeze(
|
|
43
|
+
{
|
|
44
|
+
left: 0,
|
|
45
|
+
top: 0,
|
|
46
|
+
width: 16,
|
|
47
|
+
height: 16
|
|
48
|
+
}
|
|
49
|
+
), we = Object.freeze({
|
|
50
|
+
rotate: 0,
|
|
51
|
+
vFlip: !1,
|
|
52
|
+
hFlip: !1
|
|
53
|
+
}), ye = Object.freeze({
|
|
54
|
+
...Ft,
|
|
55
|
+
...we
|
|
56
|
+
}), Le = Object.freeze({
|
|
57
|
+
...ye,
|
|
58
|
+
body: "",
|
|
59
|
+
hidden: !1
|
|
60
|
+
});
|
|
61
|
+
function cn(e, o) {
|
|
62
|
+
const t = {};
|
|
63
|
+
!e.hFlip != !o.hFlip && (t.hFlip = !0), !e.vFlip != !o.vFlip && (t.vFlip = !0);
|
|
64
|
+
const n = ((e.rotate || 0) + (o.rotate || 0)) % 4;
|
|
65
|
+
return n && (t.rotate = n), t;
|
|
66
|
+
}
|
|
67
|
+
function et(e, o) {
|
|
68
|
+
const t = cn(e, o);
|
|
69
|
+
for (const n in Le)
|
|
70
|
+
n in we ? n in e && !(n in t) && (t[n] = we[n]) : n in o ? t[n] = o[n] : n in e && (t[n] = e[n]);
|
|
71
|
+
return t;
|
|
72
|
+
}
|
|
73
|
+
function dn(e, o) {
|
|
74
|
+
const t = e.icons, n = e.aliases || /* @__PURE__ */ Object.create(null), i = /* @__PURE__ */ Object.create(null);
|
|
75
|
+
function r(s) {
|
|
76
|
+
if (t[s])
|
|
77
|
+
return i[s] = [];
|
|
78
|
+
if (!(s in i)) {
|
|
79
|
+
i[s] = null;
|
|
80
|
+
const l = n[s] && n[s].parent, a = l && r(l);
|
|
81
|
+
a && (i[s] = [l].concat(a));
|
|
82
|
+
}
|
|
83
|
+
return i[s];
|
|
84
|
+
}
|
|
85
|
+
return Object.keys(t).concat(Object.keys(n)).forEach(r), i;
|
|
86
|
+
}
|
|
87
|
+
function gn(e, o, t) {
|
|
88
|
+
const n = e.icons, i = e.aliases || /* @__PURE__ */ Object.create(null);
|
|
89
|
+
let r = {};
|
|
90
|
+
function s(l) {
|
|
91
|
+
r = et(
|
|
92
|
+
n[l] || i[l],
|
|
93
|
+
r
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
return s(o), t.forEach(s), et(e, r);
|
|
97
|
+
}
|
|
98
|
+
function bt(e, o) {
|
|
99
|
+
const t = [];
|
|
100
|
+
if (typeof e != "object" || typeof e.icons != "object")
|
|
101
|
+
return t;
|
|
102
|
+
e.not_found instanceof Array && e.not_found.forEach((i) => {
|
|
103
|
+
o(i, null), t.push(i);
|
|
104
|
+
});
|
|
105
|
+
const n = dn(e);
|
|
106
|
+
for (const i in n) {
|
|
107
|
+
const r = n[i];
|
|
108
|
+
r && (o(i, gn(e, i, r)), t.push(i));
|
|
109
|
+
}
|
|
110
|
+
return t;
|
|
111
|
+
}
|
|
112
|
+
const fn = {
|
|
113
|
+
provider: "",
|
|
114
|
+
aliases: {},
|
|
115
|
+
not_found: {},
|
|
116
|
+
...Ft
|
|
117
|
+
};
|
|
118
|
+
function Fe(e, o) {
|
|
119
|
+
for (const t in o)
|
|
120
|
+
if (t in e && typeof e[t] != typeof o[t])
|
|
121
|
+
return !1;
|
|
122
|
+
return !0;
|
|
123
|
+
}
|
|
124
|
+
function Pt(e) {
|
|
125
|
+
if (typeof e != "object" || e === null)
|
|
126
|
+
return null;
|
|
127
|
+
const o = e;
|
|
128
|
+
if (typeof o.prefix != "string" || !e.icons || typeof e.icons != "object" || !Fe(e, fn))
|
|
129
|
+
return null;
|
|
130
|
+
const t = o.icons;
|
|
131
|
+
for (const i in t) {
|
|
132
|
+
const r = t[i];
|
|
133
|
+
if (
|
|
134
|
+
// Name cannot be empty
|
|
135
|
+
!i || // Must have body
|
|
136
|
+
typeof r.body != "string" || // Check other props
|
|
137
|
+
!Fe(
|
|
138
|
+
r,
|
|
139
|
+
Le
|
|
140
|
+
)
|
|
141
|
+
)
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
const n = o.aliases || /* @__PURE__ */ Object.create(null);
|
|
145
|
+
for (const i in n) {
|
|
146
|
+
const r = n[i], s = r.parent;
|
|
147
|
+
if (
|
|
148
|
+
// Name cannot be empty
|
|
149
|
+
!i || // Parent must be set and point to existing icon
|
|
150
|
+
typeof s != "string" || !t[s] && !n[s] || // Check other props
|
|
151
|
+
!Fe(
|
|
152
|
+
r,
|
|
153
|
+
Le
|
|
154
|
+
)
|
|
155
|
+
)
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
return o;
|
|
159
|
+
}
|
|
160
|
+
const tt = /* @__PURE__ */ Object.create(null);
|
|
161
|
+
function pn(e, o) {
|
|
162
|
+
return {
|
|
163
|
+
provider: e,
|
|
164
|
+
prefix: o,
|
|
165
|
+
icons: /* @__PURE__ */ Object.create(null),
|
|
166
|
+
missing: /* @__PURE__ */ new Set()
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function ne(e, o) {
|
|
170
|
+
const t = tt[e] || (tt[e] = /* @__PURE__ */ Object.create(null));
|
|
171
|
+
return t[o] || (t[o] = pn(e, o));
|
|
172
|
+
}
|
|
173
|
+
function $t(e, o) {
|
|
174
|
+
return Pt(o) ? bt(o, (t, n) => {
|
|
175
|
+
n ? e.icons[t] = n : e.missing.add(t);
|
|
176
|
+
}) : [];
|
|
177
|
+
}
|
|
178
|
+
function mn(e, o, t) {
|
|
179
|
+
try {
|
|
180
|
+
if (typeof t.body == "string")
|
|
181
|
+
return e.icons[o] = { ...t }, !0;
|
|
182
|
+
} catch {
|
|
183
|
+
}
|
|
184
|
+
return !1;
|
|
185
|
+
}
|
|
186
|
+
let ue = !1;
|
|
187
|
+
function It(e) {
|
|
188
|
+
return typeof e == "boolean" && (ue = e), ue;
|
|
189
|
+
}
|
|
190
|
+
function hn(e) {
|
|
191
|
+
const o = typeof e == "string" ? Ce(e, !0, ue) : e;
|
|
192
|
+
if (o) {
|
|
193
|
+
const t = ne(o.provider, o.prefix), n = o.name;
|
|
194
|
+
return t.icons[n] || (t.missing.has(n) ? null : void 0);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function vn(e, o) {
|
|
198
|
+
const t = Ce(e, !0, ue);
|
|
199
|
+
if (!t)
|
|
200
|
+
return !1;
|
|
201
|
+
const n = ne(t.provider, t.prefix);
|
|
202
|
+
return o ? mn(n, t.name, o) : (n.missing.add(t.name), !0);
|
|
203
|
+
}
|
|
204
|
+
function Sn(e, o) {
|
|
205
|
+
if (typeof e != "object")
|
|
206
|
+
return !1;
|
|
207
|
+
if (typeof o != "string" && (o = e.provider || ""), ue && !o && !e.prefix) {
|
|
208
|
+
let i = !1;
|
|
209
|
+
return Pt(e) && (e.prefix = "", bt(e, (r, s) => {
|
|
210
|
+
vn(r, s) && (i = !0);
|
|
211
|
+
})), i;
|
|
212
|
+
}
|
|
213
|
+
const t = e.prefix;
|
|
214
|
+
if (!he({
|
|
215
|
+
prefix: t,
|
|
216
|
+
name: "a"
|
|
217
|
+
}))
|
|
218
|
+
return !1;
|
|
219
|
+
const n = ne(o, t);
|
|
220
|
+
return !!$t(n, e);
|
|
221
|
+
}
|
|
222
|
+
const xt = Object.freeze({
|
|
223
|
+
width: null,
|
|
224
|
+
height: null
|
|
225
|
+
}), Vt = Object.freeze({
|
|
226
|
+
// Dimensions
|
|
227
|
+
...xt,
|
|
228
|
+
// Transformations
|
|
229
|
+
...we
|
|
230
|
+
}), wn = /(-?[0-9.]*[0-9]+[0-9.]*)/g, Cn = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
231
|
+
function nt(e, o, t) {
|
|
232
|
+
if (o === 1)
|
|
233
|
+
return e;
|
|
234
|
+
if (t = t || 100, typeof e == "number")
|
|
235
|
+
return Math.ceil(e * o * t) / t;
|
|
236
|
+
if (typeof e != "string")
|
|
237
|
+
return e;
|
|
238
|
+
const n = e.split(wn);
|
|
239
|
+
if (n === null || !n.length)
|
|
240
|
+
return e;
|
|
241
|
+
const i = [];
|
|
242
|
+
let r = n.shift(), s = Cn.test(r);
|
|
243
|
+
for (; ; ) {
|
|
244
|
+
if (s) {
|
|
245
|
+
const l = parseFloat(r);
|
|
246
|
+
isNaN(l) ? i.push(r) : i.push(Math.ceil(l * o * t) / t);
|
|
247
|
+
} else
|
|
248
|
+
i.push(r);
|
|
249
|
+
if (r = n.shift(), r === void 0)
|
|
250
|
+
return i.join("");
|
|
251
|
+
s = !s;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function yn(e, o = "defs") {
|
|
255
|
+
let t = "";
|
|
256
|
+
const n = e.indexOf("<" + o);
|
|
257
|
+
for (; n >= 0; ) {
|
|
258
|
+
const i = e.indexOf(">", n), r = e.indexOf("</" + o);
|
|
259
|
+
if (i === -1 || r === -1)
|
|
260
|
+
break;
|
|
261
|
+
const s = e.indexOf(">", r);
|
|
262
|
+
if (s === -1)
|
|
263
|
+
break;
|
|
264
|
+
t += e.slice(i + 1, r).trim(), e = e.slice(0, n).trim() + e.slice(s + 1);
|
|
265
|
+
}
|
|
266
|
+
return {
|
|
267
|
+
defs: t,
|
|
268
|
+
content: e
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
function Rn(e, o) {
|
|
272
|
+
return e ? "<defs>" + e + "</defs>" + o : o;
|
|
273
|
+
}
|
|
274
|
+
function Fn(e, o, t) {
|
|
275
|
+
const n = yn(e);
|
|
276
|
+
return Rn(n.defs, o + n.content + t);
|
|
277
|
+
}
|
|
278
|
+
const bn = (e) => e === "unset" || e === "undefined" || e === "none";
|
|
279
|
+
function Pn(e, o) {
|
|
280
|
+
const t = {
|
|
281
|
+
...ye,
|
|
282
|
+
...e
|
|
283
|
+
}, n = {
|
|
284
|
+
...Vt,
|
|
285
|
+
...o
|
|
286
|
+
}, i = {
|
|
287
|
+
left: t.left,
|
|
288
|
+
top: t.top,
|
|
289
|
+
width: t.width,
|
|
290
|
+
height: t.height
|
|
291
|
+
};
|
|
292
|
+
let r = t.body;
|
|
293
|
+
[t, n].forEach((m) => {
|
|
294
|
+
const h = [], R = m.hFlip, $ = m.vFlip;
|
|
295
|
+
let P = m.rotate;
|
|
296
|
+
R ? $ ? P += 2 : (h.push(
|
|
297
|
+
"translate(" + (i.width + i.left).toString() + " " + (0 - i.top).toString() + ")"
|
|
298
|
+
), h.push("scale(-1 1)"), i.top = i.left = 0) : $ && (h.push(
|
|
299
|
+
"translate(" + (0 - i.left).toString() + " " + (i.height + i.top).toString() + ")"
|
|
300
|
+
), h.push("scale(1 -1)"), i.top = i.left = 0);
|
|
301
|
+
let D;
|
|
302
|
+
switch (P < 0 && (P -= Math.floor(P / 4) * 4), P = P % 4, P) {
|
|
303
|
+
case 1:
|
|
304
|
+
D = i.height / 2 + i.top, h.unshift(
|
|
305
|
+
"rotate(90 " + D.toString() + " " + D.toString() + ")"
|
|
306
|
+
);
|
|
307
|
+
break;
|
|
308
|
+
case 2:
|
|
309
|
+
h.unshift(
|
|
310
|
+
"rotate(180 " + (i.width / 2 + i.left).toString() + " " + (i.height / 2 + i.top).toString() + ")"
|
|
311
|
+
);
|
|
312
|
+
break;
|
|
313
|
+
case 3:
|
|
314
|
+
D = i.width / 2 + i.left, h.unshift(
|
|
315
|
+
"rotate(-90 " + D.toString() + " " + D.toString() + ")"
|
|
316
|
+
);
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
P % 2 === 1 && (i.left !== i.top && (D = i.left, i.left = i.top, i.top = D), i.width !== i.height && (D = i.width, i.width = i.height, i.height = D)), h.length && (r = Fn(
|
|
320
|
+
r,
|
|
321
|
+
'<g transform="' + h.join(" ") + '">',
|
|
322
|
+
"</g>"
|
|
323
|
+
));
|
|
324
|
+
});
|
|
325
|
+
const s = n.width, l = n.height, a = i.width, d = i.height;
|
|
326
|
+
let u, f;
|
|
327
|
+
s === null ? (f = l === null ? "1em" : l === "auto" ? d : l, u = nt(f, a / d)) : (u = s === "auto" ? a : s, f = l === null ? nt(u, d / a) : l === "auto" ? d : l);
|
|
328
|
+
const g = {}, c = (m, h) => {
|
|
329
|
+
bn(h) || (g[m] = h.toString());
|
|
330
|
+
};
|
|
331
|
+
c("width", u), c("height", f);
|
|
332
|
+
const p = [i.left, i.top, a, d];
|
|
333
|
+
return g.viewBox = p.join(" "), {
|
|
334
|
+
attributes: g,
|
|
335
|
+
viewBox: p,
|
|
336
|
+
body: r
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
const $n = /\sid="(\S+)"/g, In = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
|
|
340
|
+
let xn = 0;
|
|
341
|
+
function Vn(e, o = In) {
|
|
342
|
+
const t = [];
|
|
343
|
+
let n;
|
|
344
|
+
for (; n = $n.exec(e); )
|
|
345
|
+
t.push(n[1]);
|
|
346
|
+
if (!t.length)
|
|
347
|
+
return e;
|
|
348
|
+
const i = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
349
|
+
return t.forEach((r) => {
|
|
350
|
+
const s = typeof o == "function" ? o(r) : o + (xn++).toString(), l = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
351
|
+
e = e.replace(
|
|
352
|
+
// Allowed characters before id: [#;"]
|
|
353
|
+
// Allowed characters after id: [)"], .[a-z]
|
|
354
|
+
new RegExp('([#;"])(' + l + ')([")]|\\.[a-z])', "g"),
|
|
355
|
+
"$1" + s + i + "$3"
|
|
356
|
+
);
|
|
357
|
+
}), e = e.replace(new RegExp(i, "g"), ""), e;
|
|
358
|
+
}
|
|
359
|
+
const Oe = /* @__PURE__ */ Object.create(null);
|
|
360
|
+
function _n(e, o) {
|
|
361
|
+
Oe[e] = o;
|
|
362
|
+
}
|
|
363
|
+
function Te(e) {
|
|
364
|
+
return Oe[e] || Oe[""];
|
|
365
|
+
}
|
|
366
|
+
function Ue(e) {
|
|
367
|
+
let o;
|
|
368
|
+
if (typeof e.resources == "string")
|
|
369
|
+
o = [e.resources];
|
|
370
|
+
else if (o = e.resources, !(o instanceof Array) || !o.length)
|
|
371
|
+
return null;
|
|
372
|
+
return {
|
|
373
|
+
// API hosts
|
|
374
|
+
resources: o,
|
|
375
|
+
// Root path
|
|
376
|
+
path: e.path || "/",
|
|
377
|
+
// URL length limit
|
|
378
|
+
maxURL: e.maxURL || 500,
|
|
379
|
+
// Timeout before next host is used.
|
|
380
|
+
rotate: e.rotate || 750,
|
|
381
|
+
// Timeout before failing query.
|
|
382
|
+
timeout: e.timeout || 5e3,
|
|
383
|
+
// Randomise default API end point.
|
|
384
|
+
random: e.random === !0,
|
|
385
|
+
// Start index
|
|
386
|
+
index: e.index || 0,
|
|
387
|
+
// Receive data after time out (used if time out kicks in first, then API module sends data anyway).
|
|
388
|
+
dataAfterTimeout: e.dataAfterTimeout !== !1
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
const Ke = /* @__PURE__ */ Object.create(null), oe = [
|
|
392
|
+
"https://api.simplesvg.com",
|
|
393
|
+
"https://api.unisvg.com"
|
|
394
|
+
], ve = [];
|
|
395
|
+
for (; oe.length > 0; )
|
|
396
|
+
oe.length === 1 || Math.random() > 0.5 ? ve.push(oe.shift()) : ve.push(oe.pop());
|
|
397
|
+
Ke[""] = Ue({
|
|
398
|
+
resources: ["https://api.iconify.design"].concat(ve)
|
|
399
|
+
});
|
|
400
|
+
function Dn(e, o) {
|
|
401
|
+
const t = Ue(o);
|
|
402
|
+
return t === null ? !1 : (Ke[e] = t, !0);
|
|
403
|
+
}
|
|
404
|
+
function We(e) {
|
|
405
|
+
return Ke[e];
|
|
406
|
+
}
|
|
407
|
+
const An = () => {
|
|
408
|
+
let e;
|
|
409
|
+
try {
|
|
410
|
+
if (e = fetch, typeof e == "function")
|
|
411
|
+
return e;
|
|
412
|
+
} catch {
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
let ot = An();
|
|
416
|
+
function Mn(e, o) {
|
|
417
|
+
const t = We(e);
|
|
418
|
+
if (!t)
|
|
419
|
+
return 0;
|
|
420
|
+
let n;
|
|
421
|
+
if (!t.maxURL)
|
|
422
|
+
n = 0;
|
|
423
|
+
else {
|
|
424
|
+
let i = 0;
|
|
425
|
+
t.resources.forEach((s) => {
|
|
426
|
+
i = Math.max(i, s.length);
|
|
427
|
+
});
|
|
428
|
+
const r = o + ".json?icons=";
|
|
429
|
+
n = t.maxURL - i - t.path.length - r.length;
|
|
430
|
+
}
|
|
431
|
+
return n;
|
|
432
|
+
}
|
|
433
|
+
function kn(e) {
|
|
434
|
+
return e === 404;
|
|
435
|
+
}
|
|
436
|
+
const En = (e, o, t) => {
|
|
437
|
+
const n = [], i = Mn(e, o), r = "icons";
|
|
438
|
+
let s = {
|
|
439
|
+
type: r,
|
|
440
|
+
provider: e,
|
|
441
|
+
prefix: o,
|
|
442
|
+
icons: []
|
|
443
|
+
}, l = 0;
|
|
444
|
+
return t.forEach((a, d) => {
|
|
445
|
+
l += a.length + 1, l >= i && d > 0 && (n.push(s), s = {
|
|
446
|
+
type: r,
|
|
447
|
+
provider: e,
|
|
448
|
+
prefix: o,
|
|
449
|
+
icons: []
|
|
450
|
+
}, l = a.length), s.icons.push(a);
|
|
451
|
+
}), n.push(s), n;
|
|
452
|
+
};
|
|
453
|
+
function Ln(e) {
|
|
454
|
+
if (typeof e == "string") {
|
|
455
|
+
const o = We(e);
|
|
456
|
+
if (o)
|
|
457
|
+
return o.path;
|
|
458
|
+
}
|
|
459
|
+
return "/";
|
|
460
|
+
}
|
|
461
|
+
const On = (e, o, t) => {
|
|
462
|
+
if (!ot) {
|
|
463
|
+
t("abort", 424);
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
let n = Ln(o.provider);
|
|
467
|
+
switch (o.type) {
|
|
468
|
+
case "icons": {
|
|
469
|
+
const r = o.prefix, l = o.icons.join(","), a = new URLSearchParams({
|
|
470
|
+
icons: l
|
|
471
|
+
});
|
|
472
|
+
n += r + ".json?" + a.toString();
|
|
473
|
+
break;
|
|
474
|
+
}
|
|
475
|
+
case "custom": {
|
|
476
|
+
const r = o.uri;
|
|
477
|
+
n += r.slice(0, 1) === "/" ? r.slice(1) : r;
|
|
478
|
+
break;
|
|
479
|
+
}
|
|
480
|
+
default:
|
|
481
|
+
t("abort", 400);
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
let i = 503;
|
|
485
|
+
ot(e + n).then((r) => {
|
|
486
|
+
const s = r.status;
|
|
487
|
+
if (s !== 200) {
|
|
488
|
+
setTimeout(() => {
|
|
489
|
+
t(kn(s) ? "abort" : "next", s);
|
|
490
|
+
});
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
return i = 501, r.json();
|
|
494
|
+
}).then((r) => {
|
|
495
|
+
if (typeof r != "object" || r === null) {
|
|
496
|
+
setTimeout(() => {
|
|
497
|
+
r === 404 ? t("abort", r) : t("next", i);
|
|
498
|
+
});
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
setTimeout(() => {
|
|
502
|
+
t("success", r);
|
|
503
|
+
});
|
|
504
|
+
}).catch(() => {
|
|
505
|
+
t("next", i);
|
|
506
|
+
});
|
|
507
|
+
}, Tn = {
|
|
508
|
+
prepare: En,
|
|
509
|
+
send: On
|
|
510
|
+
};
|
|
511
|
+
function Bn(e) {
|
|
512
|
+
const o = {
|
|
513
|
+
loaded: [],
|
|
514
|
+
missing: [],
|
|
515
|
+
pending: []
|
|
516
|
+
}, t = /* @__PURE__ */ Object.create(null);
|
|
517
|
+
e.sort((i, r) => i.provider !== r.provider ? i.provider.localeCompare(r.provider) : i.prefix !== r.prefix ? i.prefix.localeCompare(r.prefix) : i.name.localeCompare(r.name));
|
|
518
|
+
let n = {
|
|
519
|
+
provider: "",
|
|
520
|
+
prefix: "",
|
|
521
|
+
name: ""
|
|
522
|
+
};
|
|
523
|
+
return e.forEach((i) => {
|
|
524
|
+
if (n.name === i.name && n.prefix === i.prefix && n.provider === i.provider)
|
|
525
|
+
return;
|
|
526
|
+
n = i;
|
|
527
|
+
const r = i.provider, s = i.prefix, l = i.name, a = t[r] || (t[r] = /* @__PURE__ */ Object.create(null)), d = a[s] || (a[s] = ne(r, s));
|
|
528
|
+
let u;
|
|
529
|
+
l in d.icons ? u = o.loaded : s === "" || d.missing.has(l) ? u = o.missing : u = o.pending;
|
|
530
|
+
const f = {
|
|
531
|
+
provider: r,
|
|
532
|
+
prefix: s,
|
|
533
|
+
name: l
|
|
534
|
+
};
|
|
535
|
+
u.push(f);
|
|
536
|
+
}), o;
|
|
537
|
+
}
|
|
538
|
+
function _t(e, o) {
|
|
539
|
+
e.forEach((t) => {
|
|
540
|
+
const n = t.loaderCallbacks;
|
|
541
|
+
n && (t.loaderCallbacks = n.filter((i) => i.id !== o));
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
function Hn(e) {
|
|
545
|
+
e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
|
|
546
|
+
e.pendingCallbacksFlag = !1;
|
|
547
|
+
const o = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
|
|
548
|
+
if (!o.length)
|
|
549
|
+
return;
|
|
550
|
+
let t = !1;
|
|
551
|
+
const n = e.provider, i = e.prefix;
|
|
552
|
+
o.forEach((r) => {
|
|
553
|
+
const s = r.icons, l = s.pending.length;
|
|
554
|
+
s.pending = s.pending.filter((a) => {
|
|
555
|
+
if (a.prefix !== i)
|
|
556
|
+
return !0;
|
|
557
|
+
const d = a.name;
|
|
558
|
+
if (e.icons[d])
|
|
559
|
+
s.loaded.push({
|
|
560
|
+
provider: n,
|
|
561
|
+
prefix: i,
|
|
562
|
+
name: d
|
|
563
|
+
});
|
|
564
|
+
else if (e.missing.has(d))
|
|
565
|
+
s.missing.push({
|
|
566
|
+
provider: n,
|
|
567
|
+
prefix: i,
|
|
568
|
+
name: d
|
|
569
|
+
});
|
|
570
|
+
else
|
|
571
|
+
return t = !0, !0;
|
|
572
|
+
return !1;
|
|
573
|
+
}), s.pending.length !== l && (t || _t([e], r.id), r.callback(
|
|
574
|
+
s.loaded.slice(0),
|
|
575
|
+
s.missing.slice(0),
|
|
576
|
+
s.pending.slice(0),
|
|
577
|
+
r.abort
|
|
578
|
+
));
|
|
579
|
+
});
|
|
580
|
+
}));
|
|
581
|
+
}
|
|
582
|
+
let zn = 0;
|
|
583
|
+
function Gn(e, o, t) {
|
|
584
|
+
const n = zn++, i = _t.bind(null, t, n);
|
|
585
|
+
if (!o.pending.length)
|
|
586
|
+
return i;
|
|
587
|
+
const r = {
|
|
588
|
+
id: n,
|
|
589
|
+
icons: o,
|
|
590
|
+
callback: e,
|
|
591
|
+
abort: i
|
|
592
|
+
};
|
|
593
|
+
return t.forEach((s) => {
|
|
594
|
+
(s.loaderCallbacks || (s.loaderCallbacks = [])).push(r);
|
|
595
|
+
}), i;
|
|
596
|
+
}
|
|
597
|
+
function Nn(e, o = !0, t = !1) {
|
|
598
|
+
const n = [];
|
|
599
|
+
return e.forEach((i) => {
|
|
600
|
+
const r = typeof i == "string" ? Ce(i, o, t) : i;
|
|
601
|
+
r && n.push(r);
|
|
602
|
+
}), n;
|
|
603
|
+
}
|
|
604
|
+
var jn = {
|
|
605
|
+
resources: [],
|
|
606
|
+
index: 0,
|
|
607
|
+
timeout: 2e3,
|
|
608
|
+
rotate: 750,
|
|
609
|
+
random: !1,
|
|
610
|
+
dataAfterTimeout: !1
|
|
611
|
+
};
|
|
612
|
+
function qn(e, o, t, n) {
|
|
613
|
+
const i = e.resources.length, r = e.random ? Math.floor(Math.random() * i) : e.index;
|
|
614
|
+
let s;
|
|
615
|
+
if (e.random) {
|
|
616
|
+
let w = e.resources.slice(0);
|
|
617
|
+
for (s = []; w.length > 1; ) {
|
|
618
|
+
const I = Math.floor(Math.random() * w.length);
|
|
619
|
+
s.push(w[I]), w = w.slice(0, I).concat(w.slice(I + 1));
|
|
620
|
+
}
|
|
621
|
+
s = s.concat(w);
|
|
622
|
+
} else
|
|
623
|
+
s = e.resources.slice(r).concat(e.resources.slice(0, r));
|
|
624
|
+
const l = Date.now();
|
|
625
|
+
let a = "pending", d = 0, u, f = null, g = [], c = [];
|
|
626
|
+
typeof n == "function" && c.push(n);
|
|
627
|
+
function p() {
|
|
628
|
+
f && (clearTimeout(f), f = null);
|
|
629
|
+
}
|
|
630
|
+
function m() {
|
|
631
|
+
a === "pending" && (a = "aborted"), p(), g.forEach((w) => {
|
|
632
|
+
w.status === "pending" && (w.status = "aborted");
|
|
633
|
+
}), g = [];
|
|
634
|
+
}
|
|
635
|
+
function h(w, I) {
|
|
636
|
+
I && (c = []), typeof w == "function" && c.push(w);
|
|
637
|
+
}
|
|
638
|
+
function R() {
|
|
639
|
+
return {
|
|
640
|
+
startTime: l,
|
|
641
|
+
payload: o,
|
|
642
|
+
status: a,
|
|
643
|
+
queriesSent: d,
|
|
644
|
+
queriesPending: g.length,
|
|
645
|
+
subscribe: h,
|
|
646
|
+
abort: m
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
function $() {
|
|
650
|
+
a = "failed", c.forEach((w) => {
|
|
651
|
+
w(void 0, u);
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
function P() {
|
|
655
|
+
g.forEach((w) => {
|
|
656
|
+
w.status === "pending" && (w.status = "aborted");
|
|
657
|
+
}), g = [];
|
|
658
|
+
}
|
|
659
|
+
function D(w, I, _) {
|
|
660
|
+
const k = I !== "success";
|
|
661
|
+
switch (g = g.filter((E) => E !== w), a) {
|
|
662
|
+
case "pending":
|
|
663
|
+
break;
|
|
664
|
+
case "failed":
|
|
665
|
+
if (k || !e.dataAfterTimeout)
|
|
666
|
+
return;
|
|
667
|
+
break;
|
|
668
|
+
default:
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
if (I === "abort") {
|
|
672
|
+
u = _, $();
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
if (k) {
|
|
676
|
+
u = _, g.length || (s.length ? v() : $());
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
if (p(), P(), !e.random) {
|
|
680
|
+
const E = e.resources.indexOf(w.resource);
|
|
681
|
+
E !== -1 && E !== e.index && (e.index = E);
|
|
682
|
+
}
|
|
683
|
+
a = "completed", c.forEach((E) => {
|
|
684
|
+
E(_);
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
function v() {
|
|
688
|
+
if (a !== "pending")
|
|
689
|
+
return;
|
|
690
|
+
p();
|
|
691
|
+
const w = s.shift();
|
|
692
|
+
if (w === void 0) {
|
|
693
|
+
if (g.length) {
|
|
694
|
+
f = setTimeout(() => {
|
|
695
|
+
p(), a === "pending" && (P(), $());
|
|
696
|
+
}, e.timeout);
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
$();
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
const I = {
|
|
703
|
+
status: "pending",
|
|
704
|
+
resource: w,
|
|
705
|
+
callback: (_, k) => {
|
|
706
|
+
D(I, _, k);
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
g.push(I), d++, f = setTimeout(v, e.rotate), t(w, o, I.callback);
|
|
710
|
+
}
|
|
711
|
+
return setTimeout(v), R;
|
|
712
|
+
}
|
|
713
|
+
function Dt(e) {
|
|
714
|
+
const o = {
|
|
715
|
+
...jn,
|
|
716
|
+
...e
|
|
717
|
+
};
|
|
718
|
+
let t = [];
|
|
719
|
+
function n() {
|
|
720
|
+
t = t.filter((l) => l().status === "pending");
|
|
721
|
+
}
|
|
722
|
+
function i(l, a, d) {
|
|
723
|
+
const u = qn(
|
|
724
|
+
o,
|
|
725
|
+
l,
|
|
726
|
+
a,
|
|
727
|
+
(f, g) => {
|
|
728
|
+
n(), d && d(f, g);
|
|
729
|
+
}
|
|
730
|
+
);
|
|
731
|
+
return t.push(u), u;
|
|
732
|
+
}
|
|
733
|
+
function r(l) {
|
|
734
|
+
return t.find((a) => l(a)) || null;
|
|
735
|
+
}
|
|
736
|
+
return {
|
|
737
|
+
query: i,
|
|
738
|
+
find: r,
|
|
739
|
+
setIndex: (l) => {
|
|
740
|
+
o.index = l;
|
|
741
|
+
},
|
|
742
|
+
getIndex: () => o.index,
|
|
743
|
+
cleanup: n
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
function it() {
|
|
747
|
+
}
|
|
748
|
+
const be = /* @__PURE__ */ Object.create(null);
|
|
749
|
+
function Un(e) {
|
|
750
|
+
if (!be[e]) {
|
|
751
|
+
const o = We(e);
|
|
752
|
+
if (!o)
|
|
753
|
+
return;
|
|
754
|
+
const t = Dt(o), n = {
|
|
755
|
+
config: o,
|
|
756
|
+
redundancy: t
|
|
757
|
+
};
|
|
758
|
+
be[e] = n;
|
|
759
|
+
}
|
|
760
|
+
return be[e];
|
|
761
|
+
}
|
|
762
|
+
function Kn(e, o, t) {
|
|
763
|
+
let n, i;
|
|
764
|
+
if (typeof e == "string") {
|
|
765
|
+
const r = Te(e);
|
|
766
|
+
if (!r)
|
|
767
|
+
return t(void 0, 424), it;
|
|
768
|
+
i = r.send;
|
|
769
|
+
const s = Un(e);
|
|
770
|
+
s && (n = s.redundancy);
|
|
771
|
+
} else {
|
|
772
|
+
const r = Ue(e);
|
|
773
|
+
if (r) {
|
|
774
|
+
n = Dt(r);
|
|
775
|
+
const s = e.resources ? e.resources[0] : "", l = Te(s);
|
|
776
|
+
l && (i = l.send);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
return !n || !i ? (t(void 0, 424), it) : n.query(o, i, t)().abort;
|
|
780
|
+
}
|
|
781
|
+
function rt() {
|
|
782
|
+
}
|
|
783
|
+
function Wn(e) {
|
|
784
|
+
e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
|
|
785
|
+
e.iconsLoaderFlag = !1, Hn(e);
|
|
786
|
+
}));
|
|
787
|
+
}
|
|
788
|
+
function Xn(e) {
|
|
789
|
+
const o = [], t = [];
|
|
790
|
+
return e.forEach((n) => {
|
|
791
|
+
(n.match(Rt) ? o : t).push(n);
|
|
792
|
+
}), {
|
|
793
|
+
valid: o,
|
|
794
|
+
invalid: t
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
function ie(e, o, t) {
|
|
798
|
+
function n() {
|
|
799
|
+
const i = e.pendingIcons;
|
|
800
|
+
o.forEach((r) => {
|
|
801
|
+
i && i.delete(r), e.icons[r] || e.missing.add(r);
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
if (t && typeof t == "object")
|
|
805
|
+
try {
|
|
806
|
+
if (!$t(e, t).length) {
|
|
807
|
+
n();
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
} catch (i) {
|
|
811
|
+
console.error(i);
|
|
812
|
+
}
|
|
813
|
+
n(), Wn(e);
|
|
814
|
+
}
|
|
815
|
+
function lt(e, o) {
|
|
816
|
+
e instanceof Promise ? e.then((t) => {
|
|
817
|
+
o(t);
|
|
818
|
+
}).catch(() => {
|
|
819
|
+
o(null);
|
|
820
|
+
}) : o(e);
|
|
821
|
+
}
|
|
822
|
+
function Qn(e, o) {
|
|
823
|
+
e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(o).sort() : e.iconsToLoad = o, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
|
|
824
|
+
e.iconsQueueFlag = !1;
|
|
825
|
+
const { provider: t, prefix: n } = e, i = e.iconsToLoad;
|
|
826
|
+
if (delete e.iconsToLoad, !i || !i.length)
|
|
827
|
+
return;
|
|
828
|
+
const r = e.loadIcon;
|
|
829
|
+
if (e.loadIcons && (i.length > 1 || !r)) {
|
|
830
|
+
lt(
|
|
831
|
+
e.loadIcons(i, n, t),
|
|
832
|
+
(u) => {
|
|
833
|
+
ie(e, i, u);
|
|
834
|
+
}
|
|
835
|
+
);
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
if (r) {
|
|
839
|
+
i.forEach((u) => {
|
|
840
|
+
const f = r(u, n, t);
|
|
841
|
+
lt(f, (g) => {
|
|
842
|
+
const c = g ? {
|
|
843
|
+
prefix: n,
|
|
844
|
+
icons: {
|
|
845
|
+
[u]: g
|
|
846
|
+
}
|
|
847
|
+
} : null;
|
|
848
|
+
ie(e, [u], c);
|
|
849
|
+
});
|
|
850
|
+
});
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
const { valid: s, invalid: l } = Xn(i);
|
|
854
|
+
if (l.length && ie(e, l, null), !s.length)
|
|
855
|
+
return;
|
|
856
|
+
const a = n.match(Rt) ? Te(t) : null;
|
|
857
|
+
if (!a) {
|
|
858
|
+
ie(e, s, null);
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
861
|
+
a.prepare(t, n, s).forEach((u) => {
|
|
862
|
+
Kn(t, u, (f) => {
|
|
863
|
+
ie(e, u.icons, f);
|
|
864
|
+
});
|
|
865
|
+
});
|
|
866
|
+
}));
|
|
867
|
+
}
|
|
868
|
+
const Jn = (e, o) => {
|
|
869
|
+
const t = Nn(e, !0, It()), n = Bn(t);
|
|
870
|
+
if (!n.pending.length) {
|
|
871
|
+
let a = !0;
|
|
872
|
+
return o && setTimeout(() => {
|
|
873
|
+
a && o(
|
|
874
|
+
n.loaded,
|
|
875
|
+
n.missing,
|
|
876
|
+
n.pending,
|
|
877
|
+
rt
|
|
878
|
+
);
|
|
879
|
+
}), () => {
|
|
880
|
+
a = !1;
|
|
881
|
+
};
|
|
882
|
+
}
|
|
883
|
+
const i = /* @__PURE__ */ Object.create(null), r = [];
|
|
884
|
+
let s, l;
|
|
885
|
+
return n.pending.forEach((a) => {
|
|
886
|
+
const { provider: d, prefix: u } = a;
|
|
887
|
+
if (u === l && d === s)
|
|
888
|
+
return;
|
|
889
|
+
s = d, l = u, r.push(ne(d, u));
|
|
890
|
+
const f = i[d] || (i[d] = /* @__PURE__ */ Object.create(null));
|
|
891
|
+
f[u] || (f[u] = []);
|
|
892
|
+
}), n.pending.forEach((a) => {
|
|
893
|
+
const { provider: d, prefix: u, name: f } = a, g = ne(d, u), c = g.pendingIcons || (g.pendingIcons = /* @__PURE__ */ new Set());
|
|
894
|
+
c.has(f) || (c.add(f), i[d][u].push(f));
|
|
895
|
+
}), r.forEach((a) => {
|
|
896
|
+
const d = i[a.provider][a.prefix];
|
|
897
|
+
d.length && Qn(a, d);
|
|
898
|
+
}), o ? Gn(o, n, r) : rt;
|
|
899
|
+
};
|
|
900
|
+
function Zn(e, o) {
|
|
901
|
+
const t = {
|
|
902
|
+
...e
|
|
903
|
+
};
|
|
904
|
+
for (const n in o) {
|
|
905
|
+
const i = o[n], r = typeof i;
|
|
906
|
+
n in xt ? (i === null || i && (r === "string" || r === "number")) && (t[n] = i) : r === typeof t[n] && (t[n] = n === "rotate" ? i % 4 : i);
|
|
907
|
+
}
|
|
908
|
+
return t;
|
|
909
|
+
}
|
|
910
|
+
const Yn = /[\s,]+/;
|
|
911
|
+
function eo(e, o) {
|
|
912
|
+
o.split(Yn).forEach((t) => {
|
|
913
|
+
switch (t.trim()) {
|
|
914
|
+
case "horizontal":
|
|
915
|
+
e.hFlip = !0;
|
|
916
|
+
break;
|
|
917
|
+
case "vertical":
|
|
918
|
+
e.vFlip = !0;
|
|
919
|
+
break;
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
function to(e, o = 0) {
|
|
924
|
+
const t = e.replace(/^-?[0-9.]*/, "");
|
|
925
|
+
function n(i) {
|
|
926
|
+
for (; i < 0; )
|
|
927
|
+
i += 4;
|
|
928
|
+
return i % 4;
|
|
929
|
+
}
|
|
930
|
+
if (t === "") {
|
|
931
|
+
const i = parseInt(e);
|
|
932
|
+
return isNaN(i) ? 0 : n(i);
|
|
933
|
+
} else if (t !== e) {
|
|
934
|
+
let i = 0;
|
|
935
|
+
switch (t) {
|
|
936
|
+
case "%":
|
|
937
|
+
i = 25;
|
|
938
|
+
break;
|
|
939
|
+
case "deg":
|
|
940
|
+
i = 90;
|
|
941
|
+
}
|
|
942
|
+
if (i) {
|
|
943
|
+
let r = parseFloat(e.slice(0, e.length - t.length));
|
|
944
|
+
return isNaN(r) ? 0 : (r = r / i, r % 1 === 0 ? n(r) : 0);
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
return o;
|
|
948
|
+
}
|
|
949
|
+
function no(e, o) {
|
|
950
|
+
let t = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
951
|
+
for (const n in o)
|
|
952
|
+
t += " " + n + '="' + o[n] + '"';
|
|
953
|
+
return '<svg xmlns="http://www.w3.org/2000/svg"' + t + ">" + e + "</svg>";
|
|
954
|
+
}
|
|
955
|
+
function oo(e) {
|
|
956
|
+
return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
957
|
+
}
|
|
958
|
+
function io(e) {
|
|
959
|
+
return "data:image/svg+xml," + oo(e);
|
|
960
|
+
}
|
|
961
|
+
function ro(e) {
|
|
962
|
+
return 'url("' + io(e) + '")';
|
|
963
|
+
}
|
|
964
|
+
const st = {
|
|
965
|
+
...Vt,
|
|
966
|
+
inline: !1
|
|
967
|
+
}, lo = {
|
|
968
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
969
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
970
|
+
"aria-hidden": !0,
|
|
971
|
+
role: "img"
|
|
972
|
+
}, so = {
|
|
973
|
+
display: "inline-block"
|
|
974
|
+
}, Be = {
|
|
975
|
+
backgroundColor: "currentColor"
|
|
976
|
+
}, At = {
|
|
977
|
+
backgroundColor: "transparent"
|
|
978
|
+
}, at = {
|
|
979
|
+
Image: "var(--svg)",
|
|
980
|
+
Repeat: "no-repeat",
|
|
981
|
+
Size: "100% 100%"
|
|
982
|
+
}, ut = {
|
|
983
|
+
webkitMask: Be,
|
|
984
|
+
mask: Be,
|
|
985
|
+
background: At
|
|
986
|
+
};
|
|
987
|
+
for (const e in ut) {
|
|
988
|
+
const o = ut[e];
|
|
989
|
+
for (const t in at)
|
|
990
|
+
o[e + t] = at[t];
|
|
991
|
+
}
|
|
992
|
+
const Se = {};
|
|
993
|
+
["horizontal", "vertical"].forEach((e) => {
|
|
994
|
+
const o = e.slice(0, 1) + "Flip";
|
|
995
|
+
Se[e + "-flip"] = o, Se[e.slice(0, 1) + "-flip"] = o, Se[e + "Flip"] = o;
|
|
996
|
+
});
|
|
997
|
+
function ct(e) {
|
|
998
|
+
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
|
999
|
+
}
|
|
1000
|
+
const dt = (e, o) => {
|
|
1001
|
+
const t = Zn(st, o), n = { ...lo }, i = o.mode || "svg", r = {}, s = o.style, l = typeof s == "object" && !(s instanceof Array) ? s : {};
|
|
1002
|
+
for (let m in o) {
|
|
1003
|
+
const h = o[m];
|
|
1004
|
+
if (h !== void 0)
|
|
1005
|
+
switch (m) {
|
|
1006
|
+
// Properties to ignore
|
|
1007
|
+
case "icon":
|
|
1008
|
+
case "style":
|
|
1009
|
+
case "onLoad":
|
|
1010
|
+
case "mode":
|
|
1011
|
+
case "ssr":
|
|
1012
|
+
break;
|
|
1013
|
+
// Boolean attributes
|
|
1014
|
+
case "inline":
|
|
1015
|
+
case "hFlip":
|
|
1016
|
+
case "vFlip":
|
|
1017
|
+
t[m] = h === !0 || h === "true" || h === 1;
|
|
1018
|
+
break;
|
|
1019
|
+
// Flip as string: 'horizontal,vertical'
|
|
1020
|
+
case "flip":
|
|
1021
|
+
typeof h == "string" && eo(t, h);
|
|
1022
|
+
break;
|
|
1023
|
+
// Color: override style
|
|
1024
|
+
case "color":
|
|
1025
|
+
r.color = h;
|
|
1026
|
+
break;
|
|
1027
|
+
// Rotation as string
|
|
1028
|
+
case "rotate":
|
|
1029
|
+
typeof h == "string" ? t[m] = to(h) : typeof h == "number" && (t[m] = h);
|
|
1030
|
+
break;
|
|
1031
|
+
// Remove aria-hidden
|
|
1032
|
+
case "ariaHidden":
|
|
1033
|
+
case "aria-hidden":
|
|
1034
|
+
h !== !0 && h !== "true" && delete n["aria-hidden"];
|
|
1035
|
+
break;
|
|
1036
|
+
default: {
|
|
1037
|
+
const R = Se[m];
|
|
1038
|
+
R ? (h === !0 || h === "true" || h === 1) && (t[R] = !0) : st[m] === void 0 && (n[m] = h);
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
const a = Pn(e, t), d = a.attributes;
|
|
1043
|
+
if (t.inline && (r.verticalAlign = "-0.125em"), i === "svg") {
|
|
1044
|
+
n.style = {
|
|
1045
|
+
...r,
|
|
1046
|
+
...l
|
|
1047
|
+
}, Object.assign(n, d);
|
|
1048
|
+
let m = 0, h = o.id;
|
|
1049
|
+
return typeof h == "string" && (h = h.replace(/-/g, "_")), n.innerHTML = Vn(a.body, h ? () => h + "ID" + m++ : "iconifyVue"), W("svg", n);
|
|
1050
|
+
}
|
|
1051
|
+
const { body: u, width: f, height: g } = e, c = i === "mask" || (i === "bg" ? !1 : u.indexOf("currentColor") !== -1), p = no(u, {
|
|
1052
|
+
...d,
|
|
1053
|
+
width: f + "",
|
|
1054
|
+
height: g + ""
|
|
1055
|
+
});
|
|
1056
|
+
return n.style = {
|
|
1057
|
+
...r,
|
|
1058
|
+
"--svg": ro(p),
|
|
1059
|
+
width: ct(d.width),
|
|
1060
|
+
height: ct(d.height),
|
|
1061
|
+
...so,
|
|
1062
|
+
...c ? Be : At,
|
|
1063
|
+
...l
|
|
1064
|
+
}, W("span", n);
|
|
1065
|
+
};
|
|
1066
|
+
It(!0);
|
|
1067
|
+
_n("", Tn);
|
|
1068
|
+
if (typeof document < "u" && typeof window < "u") {
|
|
1069
|
+
const e = window;
|
|
1070
|
+
if (e.IconifyPreload !== void 0) {
|
|
1071
|
+
const o = e.IconifyPreload, t = "Invalid IconifyPreload syntax.";
|
|
1072
|
+
typeof o == "object" && o !== null && (o instanceof Array ? o : [o]).forEach((n) => {
|
|
1073
|
+
try {
|
|
1074
|
+
// Check if item is an object and not null/array
|
|
1075
|
+
(typeof n != "object" || n === null || n instanceof Array || // Check for 'icons' and 'prefix'
|
|
1076
|
+
typeof n.icons != "object" || typeof n.prefix != "string" || // Add icon set
|
|
1077
|
+
!Sn(n)) && console.error(t);
|
|
1078
|
+
} catch {
|
|
1079
|
+
console.error(t);
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
if (e.IconifyProviders !== void 0) {
|
|
1084
|
+
const o = e.IconifyProviders;
|
|
1085
|
+
if (typeof o == "object" && o !== null)
|
|
1086
|
+
for (let t in o) {
|
|
1087
|
+
const n = "IconifyProviders[" + t + "] is invalid.";
|
|
1088
|
+
try {
|
|
1089
|
+
const i = o[t];
|
|
1090
|
+
if (typeof i != "object" || !i || i.resources === void 0)
|
|
1091
|
+
continue;
|
|
1092
|
+
Dn(t, i) || console.error(n);
|
|
1093
|
+
} catch {
|
|
1094
|
+
console.error(n);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
const ao = {
|
|
1100
|
+
...ye,
|
|
1101
|
+
body: ""
|
|
1102
|
+
}, z = K({
|
|
1103
|
+
// Do not inherit other attributes: it is handled by render()
|
|
1104
|
+
inheritAttrs: !1,
|
|
1105
|
+
// Set initial data
|
|
1106
|
+
data() {
|
|
1107
|
+
return {
|
|
1108
|
+
// Current icon name
|
|
1109
|
+
_name: "",
|
|
1110
|
+
// Loading
|
|
1111
|
+
_loadingIcon: null,
|
|
1112
|
+
// Mounted status
|
|
1113
|
+
iconMounted: !1,
|
|
1114
|
+
// Callback counter to trigger re-render
|
|
1115
|
+
counter: 0
|
|
1116
|
+
};
|
|
1117
|
+
},
|
|
1118
|
+
mounted() {
|
|
1119
|
+
this.iconMounted = !0;
|
|
1120
|
+
},
|
|
1121
|
+
unmounted() {
|
|
1122
|
+
this.abortLoading();
|
|
1123
|
+
},
|
|
1124
|
+
methods: {
|
|
1125
|
+
abortLoading() {
|
|
1126
|
+
this._loadingIcon && (this._loadingIcon.abort(), this._loadingIcon = null);
|
|
1127
|
+
},
|
|
1128
|
+
// Get data for icon to render or null
|
|
1129
|
+
getIcon(e, o, t) {
|
|
1130
|
+
if (typeof e == "object" && e !== null && typeof e.body == "string")
|
|
1131
|
+
return this._name = "", this.abortLoading(), {
|
|
1132
|
+
data: e
|
|
1133
|
+
};
|
|
1134
|
+
let n;
|
|
1135
|
+
if (typeof e != "string" || (n = Ce(e, !1, !0)) === null)
|
|
1136
|
+
return this.abortLoading(), null;
|
|
1137
|
+
let i = hn(n);
|
|
1138
|
+
if (!i)
|
|
1139
|
+
return (!this._loadingIcon || this._loadingIcon.name !== e) && (this.abortLoading(), this._name = "", i !== null && (this._loadingIcon = {
|
|
1140
|
+
name: e,
|
|
1141
|
+
abort: Jn([n], () => {
|
|
1142
|
+
this.counter++;
|
|
1143
|
+
})
|
|
1144
|
+
})), null;
|
|
1145
|
+
if (this.abortLoading(), this._name !== e && (this._name = e, o && o(e)), t) {
|
|
1146
|
+
i = Object.assign({}, i);
|
|
1147
|
+
const s = t(i.body, n.name, n.prefix, n.provider);
|
|
1148
|
+
typeof s == "string" && (i.body = s);
|
|
1149
|
+
}
|
|
1150
|
+
const r = ["iconify"];
|
|
1151
|
+
return n.prefix !== "" && r.push("iconify--" + n.prefix), n.provider !== "" && r.push("iconify--" + n.provider), { data: i, classes: r };
|
|
1152
|
+
}
|
|
1153
|
+
},
|
|
1154
|
+
// Render icon
|
|
1155
|
+
render() {
|
|
1156
|
+
this.counter;
|
|
1157
|
+
const e = this.$attrs, o = this.iconMounted || e.ssr ? this.getIcon(e.icon, e.onLoad, e.customise) : null;
|
|
1158
|
+
if (!o)
|
|
1159
|
+
return dt(ao, e);
|
|
1160
|
+
let t = e;
|
|
1161
|
+
return o.classes && (t = {
|
|
1162
|
+
...e,
|
|
1163
|
+
class: (typeof e.class == "string" ? e.class + " " : "") + o.classes.join(" ")
|
|
1164
|
+
}), dt({
|
|
1165
|
+
...ye,
|
|
1166
|
+
...o.data
|
|
1167
|
+
}, t);
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
/**
|
|
1171
|
+
* table-core
|
|
1172
|
+
*
|
|
1173
|
+
* Copyright (c) TanStack
|
|
1174
|
+
*
|
|
1175
|
+
* This source code is licensed under the MIT license found in the
|
|
1176
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
1177
|
+
*
|
|
1178
|
+
* @license MIT
|
|
1179
|
+
*/
|
|
1180
|
+
function uo() {
|
|
1181
|
+
return {
|
|
1182
|
+
accessor: (e, o) => typeof e == "function" ? {
|
|
1183
|
+
...o,
|
|
1184
|
+
accessorFn: e
|
|
1185
|
+
} : {
|
|
1186
|
+
...o,
|
|
1187
|
+
accessorKey: e
|
|
1188
|
+
},
|
|
1189
|
+
display: (e) => e,
|
|
1190
|
+
group: (e) => e
|
|
1191
|
+
};
|
|
1192
|
+
}
|
|
1193
|
+
function Z(e, o) {
|
|
1194
|
+
return typeof e == "function" ? e(o) : e;
|
|
1195
|
+
}
|
|
1196
|
+
function N(e, o) {
|
|
1197
|
+
return (t) => {
|
|
1198
|
+
o.setState((n) => ({
|
|
1199
|
+
...n,
|
|
1200
|
+
[e]: Z(t, n[e])
|
|
1201
|
+
}));
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
function Re(e) {
|
|
1205
|
+
return e instanceof Function;
|
|
1206
|
+
}
|
|
1207
|
+
function co(e) {
|
|
1208
|
+
return Array.isArray(e) && e.every((o) => typeof o == "number");
|
|
1209
|
+
}
|
|
1210
|
+
function go(e, o) {
|
|
1211
|
+
const t = [], n = (i) => {
|
|
1212
|
+
i.forEach((r) => {
|
|
1213
|
+
t.push(r);
|
|
1214
|
+
const s = o(r);
|
|
1215
|
+
s != null && s.length && n(s);
|
|
1216
|
+
});
|
|
1217
|
+
};
|
|
1218
|
+
return n(e), t;
|
|
1219
|
+
}
|
|
1220
|
+
function F(e, o, t) {
|
|
1221
|
+
let n = [], i;
|
|
1222
|
+
return (r) => {
|
|
1223
|
+
let s;
|
|
1224
|
+
t.key && t.debug && (s = Date.now());
|
|
1225
|
+
const l = e(r);
|
|
1226
|
+
if (!(l.length !== n.length || l.some((u, f) => n[f] !== u)))
|
|
1227
|
+
return i;
|
|
1228
|
+
n = l;
|
|
1229
|
+
let d;
|
|
1230
|
+
if (t.key && t.debug && (d = Date.now()), i = o(...l), t == null || t.onChange == null || t.onChange(i), t.key && t.debug && t != null && t.debug()) {
|
|
1231
|
+
const u = Math.round((Date.now() - s) * 100) / 100, f = Math.round((Date.now() - d) * 100) / 100, g = f / 16, c = (p, m) => {
|
|
1232
|
+
for (p = String(p); p.length < m; )
|
|
1233
|
+
p = " " + p;
|
|
1234
|
+
return p;
|
|
1235
|
+
};
|
|
1236
|
+
console.info(`%c⏱ ${c(f, 5)} /${c(u, 5)} ms`, `
|
|
1237
|
+
font-size: .6rem;
|
|
1238
|
+
font-weight: bold;
|
|
1239
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * g, 120))}deg 100% 31%);`, t?.key);
|
|
1240
|
+
}
|
|
1241
|
+
return i;
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
function b(e, o, t, n) {
|
|
1245
|
+
return {
|
|
1246
|
+
debug: () => {
|
|
1247
|
+
var i;
|
|
1248
|
+
return (i = e?.debugAll) != null ? i : e[o];
|
|
1249
|
+
},
|
|
1250
|
+
key: process.env.NODE_ENV === "development" && t,
|
|
1251
|
+
onChange: n
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
function fo(e, o, t, n) {
|
|
1255
|
+
const i = () => {
|
|
1256
|
+
var s;
|
|
1257
|
+
return (s = r.getValue()) != null ? s : e.options.renderFallbackValue;
|
|
1258
|
+
}, r = {
|
|
1259
|
+
id: `${o.id}_${t.id}`,
|
|
1260
|
+
row: o,
|
|
1261
|
+
column: t,
|
|
1262
|
+
getValue: () => o.getValue(n),
|
|
1263
|
+
renderValue: i,
|
|
1264
|
+
getContext: F(() => [e, t, o, r], (s, l, a, d) => ({
|
|
1265
|
+
table: s,
|
|
1266
|
+
column: l,
|
|
1267
|
+
row: a,
|
|
1268
|
+
cell: d,
|
|
1269
|
+
getValue: d.getValue,
|
|
1270
|
+
renderValue: d.renderValue
|
|
1271
|
+
}), b(e.options, "debugCells", "cell.getContext"))
|
|
1272
|
+
};
|
|
1273
|
+
return e._features.forEach((s) => {
|
|
1274
|
+
s.createCell == null || s.createCell(r, t, o, e);
|
|
1275
|
+
}, {}), r;
|
|
1276
|
+
}
|
|
1277
|
+
function po(e, o, t, n) {
|
|
1278
|
+
var i, r;
|
|
1279
|
+
const l = {
|
|
1280
|
+
...e._getDefaultColumnDef(),
|
|
1281
|
+
...o
|
|
1282
|
+
}, a = l.accessorKey;
|
|
1283
|
+
let d = (i = (r = l.id) != null ? r : a ? typeof String.prototype.replaceAll == "function" ? a.replaceAll(".", "_") : a.replace(/\./g, "_") : void 0) != null ? i : typeof l.header == "string" ? l.header : void 0, u;
|
|
1284
|
+
if (l.accessorFn ? u = l.accessorFn : a && (a.includes(".") ? u = (g) => {
|
|
1285
|
+
let c = g;
|
|
1286
|
+
for (const m of a.split(".")) {
|
|
1287
|
+
var p;
|
|
1288
|
+
c = (p = c) == null ? void 0 : p[m], process.env.NODE_ENV !== "production" && c === void 0 && console.warn(`"${m}" in deeply nested key "${a}" returned undefined.`);
|
|
1289
|
+
}
|
|
1290
|
+
return c;
|
|
1291
|
+
} : u = (g) => g[l.accessorKey]), !d)
|
|
1292
|
+
throw process.env.NODE_ENV !== "production" ? new Error(l.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
|
|
1293
|
+
let f = {
|
|
1294
|
+
id: `${String(d)}`,
|
|
1295
|
+
accessorFn: u,
|
|
1296
|
+
parent: n,
|
|
1297
|
+
depth: t,
|
|
1298
|
+
columnDef: l,
|
|
1299
|
+
columns: [],
|
|
1300
|
+
getFlatColumns: F(() => [!0], () => {
|
|
1301
|
+
var g;
|
|
1302
|
+
return [f, ...(g = f.columns) == null ? void 0 : g.flatMap((c) => c.getFlatColumns())];
|
|
1303
|
+
}, b(e.options, "debugColumns", "column.getFlatColumns")),
|
|
1304
|
+
getLeafColumns: F(() => [e._getOrderColumnsFn()], (g) => {
|
|
1305
|
+
var c;
|
|
1306
|
+
if ((c = f.columns) != null && c.length) {
|
|
1307
|
+
let p = f.columns.flatMap((m) => m.getLeafColumns());
|
|
1308
|
+
return g(p);
|
|
1309
|
+
}
|
|
1310
|
+
return [f];
|
|
1311
|
+
}, b(e.options, "debugColumns", "column.getLeafColumns"))
|
|
1312
|
+
};
|
|
1313
|
+
for (const g of e._features)
|
|
1314
|
+
g.createColumn == null || g.createColumn(f, e);
|
|
1315
|
+
return f;
|
|
1316
|
+
}
|
|
1317
|
+
const O = "debugHeaders";
|
|
1318
|
+
function gt(e, o, t) {
|
|
1319
|
+
var n;
|
|
1320
|
+
let r = {
|
|
1321
|
+
id: (n = t.id) != null ? n : o.id,
|
|
1322
|
+
column: o,
|
|
1323
|
+
index: t.index,
|
|
1324
|
+
isPlaceholder: !!t.isPlaceholder,
|
|
1325
|
+
placeholderId: t.placeholderId,
|
|
1326
|
+
depth: t.depth,
|
|
1327
|
+
subHeaders: [],
|
|
1328
|
+
colSpan: 0,
|
|
1329
|
+
rowSpan: 0,
|
|
1330
|
+
headerGroup: null,
|
|
1331
|
+
getLeafHeaders: () => {
|
|
1332
|
+
const s = [], l = (a) => {
|
|
1333
|
+
a.subHeaders && a.subHeaders.length && a.subHeaders.map(l), s.push(a);
|
|
1334
|
+
};
|
|
1335
|
+
return l(r), s;
|
|
1336
|
+
},
|
|
1337
|
+
getContext: () => ({
|
|
1338
|
+
table: e,
|
|
1339
|
+
header: r,
|
|
1340
|
+
column: o
|
|
1341
|
+
})
|
|
1342
|
+
};
|
|
1343
|
+
return e._features.forEach((s) => {
|
|
1344
|
+
s.createHeader == null || s.createHeader(r, e);
|
|
1345
|
+
}), r;
|
|
1346
|
+
}
|
|
1347
|
+
const mo = {
|
|
1348
|
+
createTable: (e) => {
|
|
1349
|
+
e.getHeaderGroups = F(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, i) => {
|
|
1350
|
+
var r, s;
|
|
1351
|
+
const l = (r = n?.map((f) => t.find((g) => g.id === f)).filter(Boolean)) != null ? r : [], a = (s = i?.map((f) => t.find((g) => g.id === f)).filter(Boolean)) != null ? s : [], d = t.filter((f) => !(n != null && n.includes(f.id)) && !(i != null && i.includes(f.id)));
|
|
1352
|
+
return de(o, [...l, ...d, ...a], e);
|
|
1353
|
+
}, b(e.options, O, "getHeaderGroups")), e.getCenterHeaderGroups = F(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, i) => (t = t.filter((r) => !(n != null && n.includes(r.id)) && !(i != null && i.includes(r.id))), de(o, t, e, "center")), b(e.options, O, "getCenterHeaderGroups")), e.getLeftHeaderGroups = F(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
|
|
1354
|
+
var i;
|
|
1355
|
+
const r = (i = n?.map((s) => t.find((l) => l.id === s)).filter(Boolean)) != null ? i : [];
|
|
1356
|
+
return de(o, r, e, "left");
|
|
1357
|
+
}, b(e.options, O, "getLeftHeaderGroups")), e.getRightHeaderGroups = F(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
|
|
1358
|
+
var i;
|
|
1359
|
+
const r = (i = n?.map((s) => t.find((l) => l.id === s)).filter(Boolean)) != null ? i : [];
|
|
1360
|
+
return de(o, r, e, "right");
|
|
1361
|
+
}, b(e.options, O, "getRightHeaderGroups")), e.getFooterGroups = F(() => [e.getHeaderGroups()], (o) => [...o].reverse(), b(e.options, O, "getFooterGroups")), e.getLeftFooterGroups = F(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), b(e.options, O, "getLeftFooterGroups")), e.getCenterFooterGroups = F(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), b(e.options, O, "getCenterFooterGroups")), e.getRightFooterGroups = F(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), b(e.options, O, "getRightFooterGroups")), e.getFlatHeaders = F(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), b(e.options, O, "getFlatHeaders")), e.getLeftFlatHeaders = F(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), b(e.options, O, "getLeftFlatHeaders")), e.getCenterFlatHeaders = F(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), b(e.options, O, "getCenterFlatHeaders")), e.getRightFlatHeaders = F(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), b(e.options, O, "getRightFlatHeaders")), e.getCenterLeafHeaders = F(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
|
|
1362
|
+
var n;
|
|
1363
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
1364
|
+
}), b(e.options, O, "getCenterLeafHeaders")), e.getLeftLeafHeaders = F(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
|
|
1365
|
+
var n;
|
|
1366
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
1367
|
+
}), b(e.options, O, "getLeftLeafHeaders")), e.getRightLeafHeaders = F(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
|
|
1368
|
+
var n;
|
|
1369
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
1370
|
+
}), b(e.options, O, "getRightLeafHeaders")), e.getLeafHeaders = F(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
|
|
1371
|
+
var i, r, s, l, a, d;
|
|
1372
|
+
return [...(i = (r = o[0]) == null ? void 0 : r.headers) != null ? i : [], ...(s = (l = t[0]) == null ? void 0 : l.headers) != null ? s : [], ...(a = (d = n[0]) == null ? void 0 : d.headers) != null ? a : []].map((u) => u.getLeafHeaders()).flat();
|
|
1373
|
+
}, b(e.options, O, "getLeafHeaders"));
|
|
1374
|
+
}
|
|
1375
|
+
};
|
|
1376
|
+
function de(e, o, t, n) {
|
|
1377
|
+
var i, r;
|
|
1378
|
+
let s = 0;
|
|
1379
|
+
const l = function(g, c) {
|
|
1380
|
+
c === void 0 && (c = 1), s = Math.max(s, c), g.filter((p) => p.getIsVisible()).forEach((p) => {
|
|
1381
|
+
var m;
|
|
1382
|
+
(m = p.columns) != null && m.length && l(p.columns, c + 1);
|
|
1383
|
+
}, 0);
|
|
1384
|
+
};
|
|
1385
|
+
l(e);
|
|
1386
|
+
let a = [];
|
|
1387
|
+
const d = (g, c) => {
|
|
1388
|
+
const p = {
|
|
1389
|
+
depth: c,
|
|
1390
|
+
id: [n, `${c}`].filter(Boolean).join("_"),
|
|
1391
|
+
headers: []
|
|
1392
|
+
}, m = [];
|
|
1393
|
+
g.forEach((h) => {
|
|
1394
|
+
const R = [...m].reverse()[0], $ = h.column.depth === p.depth;
|
|
1395
|
+
let P, D = !1;
|
|
1396
|
+
if ($ && h.column.parent ? P = h.column.parent : (P = h.column, D = !0), R && R?.column === P)
|
|
1397
|
+
R.subHeaders.push(h);
|
|
1398
|
+
else {
|
|
1399
|
+
const v = gt(t, P, {
|
|
1400
|
+
id: [n, c, P.id, h?.id].filter(Boolean).join("_"),
|
|
1401
|
+
isPlaceholder: D,
|
|
1402
|
+
placeholderId: D ? `${m.filter((w) => w.column === P).length}` : void 0,
|
|
1403
|
+
depth: c,
|
|
1404
|
+
index: m.length
|
|
1405
|
+
});
|
|
1406
|
+
v.subHeaders.push(h), m.push(v);
|
|
1407
|
+
}
|
|
1408
|
+
p.headers.push(h), h.headerGroup = p;
|
|
1409
|
+
}), a.push(p), c > 0 && d(m, c - 1);
|
|
1410
|
+
}, u = o.map((g, c) => gt(t, g, {
|
|
1411
|
+
depth: s,
|
|
1412
|
+
index: c
|
|
1413
|
+
}));
|
|
1414
|
+
d(u, s - 1), a.reverse();
|
|
1415
|
+
const f = (g) => g.filter((p) => p.column.getIsVisible()).map((p) => {
|
|
1416
|
+
let m = 0, h = 0, R = [0];
|
|
1417
|
+
p.subHeaders && p.subHeaders.length ? (R = [], f(p.subHeaders).forEach((P) => {
|
|
1418
|
+
let {
|
|
1419
|
+
colSpan: D,
|
|
1420
|
+
rowSpan: v
|
|
1421
|
+
} = P;
|
|
1422
|
+
m += D, R.push(v);
|
|
1423
|
+
})) : m = 1;
|
|
1424
|
+
const $ = Math.min(...R);
|
|
1425
|
+
return h = h + $, p.colSpan = m, p.rowSpan = h, {
|
|
1426
|
+
colSpan: m,
|
|
1427
|
+
rowSpan: h
|
|
1428
|
+
};
|
|
1429
|
+
});
|
|
1430
|
+
return f((i = (r = a[0]) == null ? void 0 : r.headers) != null ? i : []), a;
|
|
1431
|
+
}
|
|
1432
|
+
const Xe = (e, o, t, n, i, r, s) => {
|
|
1433
|
+
let l = {
|
|
1434
|
+
id: o,
|
|
1435
|
+
index: n,
|
|
1436
|
+
original: t,
|
|
1437
|
+
depth: i,
|
|
1438
|
+
parentId: s,
|
|
1439
|
+
_valuesCache: {},
|
|
1440
|
+
_uniqueValuesCache: {},
|
|
1441
|
+
getValue: (a) => {
|
|
1442
|
+
if (l._valuesCache.hasOwnProperty(a))
|
|
1443
|
+
return l._valuesCache[a];
|
|
1444
|
+
const d = e.getColumn(a);
|
|
1445
|
+
if (d != null && d.accessorFn)
|
|
1446
|
+
return l._valuesCache[a] = d.accessorFn(l.original, n), l._valuesCache[a];
|
|
1447
|
+
},
|
|
1448
|
+
getUniqueValues: (a) => {
|
|
1449
|
+
if (l._uniqueValuesCache.hasOwnProperty(a))
|
|
1450
|
+
return l._uniqueValuesCache[a];
|
|
1451
|
+
const d = e.getColumn(a);
|
|
1452
|
+
if (d != null && d.accessorFn)
|
|
1453
|
+
return d.columnDef.getUniqueValues ? (l._uniqueValuesCache[a] = d.columnDef.getUniqueValues(l.original, n), l._uniqueValuesCache[a]) : (l._uniqueValuesCache[a] = [l.getValue(a)], l._uniqueValuesCache[a]);
|
|
1454
|
+
},
|
|
1455
|
+
renderValue: (a) => {
|
|
1456
|
+
var d;
|
|
1457
|
+
return (d = l.getValue(a)) != null ? d : e.options.renderFallbackValue;
|
|
1458
|
+
},
|
|
1459
|
+
subRows: [],
|
|
1460
|
+
getLeafRows: () => go(l.subRows, (a) => a.subRows),
|
|
1461
|
+
getParentRow: () => l.parentId ? e.getRow(l.parentId, !0) : void 0,
|
|
1462
|
+
getParentRows: () => {
|
|
1463
|
+
let a = [], d = l;
|
|
1464
|
+
for (; ; ) {
|
|
1465
|
+
const u = d.getParentRow();
|
|
1466
|
+
if (!u) break;
|
|
1467
|
+
a.push(u), d = u;
|
|
1468
|
+
}
|
|
1469
|
+
return a.reverse();
|
|
1470
|
+
},
|
|
1471
|
+
getAllCells: F(() => [e.getAllLeafColumns()], (a) => a.map((d) => fo(e, l, d, d.id)), b(e.options, "debugRows", "getAllCells")),
|
|
1472
|
+
_getAllCellsByColumnId: F(() => [l.getAllCells()], (a) => a.reduce((d, u) => (d[u.column.id] = u, d), {}), b(e.options, "debugRows", "getAllCellsByColumnId"))
|
|
1473
|
+
};
|
|
1474
|
+
for (let a = 0; a < e._features.length; a++) {
|
|
1475
|
+
const d = e._features[a];
|
|
1476
|
+
d == null || d.createRow == null || d.createRow(l, e);
|
|
1477
|
+
}
|
|
1478
|
+
return l;
|
|
1479
|
+
}, ho = {
|
|
1480
|
+
createColumn: (e, o) => {
|
|
1481
|
+
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 = () => {
|
|
1482
|
+
if (e._getFacetedMinMaxValues)
|
|
1483
|
+
return e._getFacetedMinMaxValues();
|
|
1484
|
+
};
|
|
1485
|
+
}
|
|
1486
|
+
}, Mt = (e, o, t) => {
|
|
1487
|
+
var n, i;
|
|
1488
|
+
const r = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
|
|
1489
|
+
return !!(!((i = e.getValue(o)) == null || (i = i.toString()) == null || (i = i.toLowerCase()) == null) && i.includes(r));
|
|
1490
|
+
};
|
|
1491
|
+
Mt.autoRemove = (e) => U(e);
|
|
1492
|
+
const kt = (e, o, t) => {
|
|
1493
|
+
var n;
|
|
1494
|
+
return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
|
|
1495
|
+
};
|
|
1496
|
+
kt.autoRemove = (e) => U(e);
|
|
1497
|
+
const Et = (e, o, t) => {
|
|
1498
|
+
var n;
|
|
1499
|
+
return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === t?.toLowerCase();
|
|
1500
|
+
};
|
|
1501
|
+
Et.autoRemove = (e) => U(e);
|
|
1502
|
+
const Lt = (e, o, t) => {
|
|
1503
|
+
var n;
|
|
1504
|
+
return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
|
|
1505
|
+
};
|
|
1506
|
+
Lt.autoRemove = (e) => U(e);
|
|
1507
|
+
const Ot = (e, o, t) => !t.some((n) => {
|
|
1508
|
+
var i;
|
|
1509
|
+
return !((i = e.getValue(o)) != null && i.includes(n));
|
|
1510
|
+
});
|
|
1511
|
+
Ot.autoRemove = (e) => U(e) || !(e != null && e.length);
|
|
1512
|
+
const Tt = (e, o, t) => t.some((n) => {
|
|
1513
|
+
var i;
|
|
1514
|
+
return (i = e.getValue(o)) == null ? void 0 : i.includes(n);
|
|
1515
|
+
});
|
|
1516
|
+
Tt.autoRemove = (e) => U(e) || !(e != null && e.length);
|
|
1517
|
+
const Bt = (e, o, t) => e.getValue(o) === t;
|
|
1518
|
+
Bt.autoRemove = (e) => U(e);
|
|
1519
|
+
const Ht = (e, o, t) => e.getValue(o) == t;
|
|
1520
|
+
Ht.autoRemove = (e) => U(e);
|
|
1521
|
+
const Qe = (e, o, t) => {
|
|
1522
|
+
let [n, i] = t;
|
|
1523
|
+
const r = e.getValue(o);
|
|
1524
|
+
return r >= n && r <= i;
|
|
1525
|
+
};
|
|
1526
|
+
Qe.resolveFilterValue = (e) => {
|
|
1527
|
+
let [o, t] = e, n = typeof o != "number" ? parseFloat(o) : o, i = typeof t != "number" ? parseFloat(t) : t, r = o === null || Number.isNaN(n) ? -1 / 0 : n, s = t === null || Number.isNaN(i) ? 1 / 0 : i;
|
|
1528
|
+
if (r > s) {
|
|
1529
|
+
const l = r;
|
|
1530
|
+
r = s, s = l;
|
|
1531
|
+
}
|
|
1532
|
+
return [r, s];
|
|
1533
|
+
};
|
|
1534
|
+
Qe.autoRemove = (e) => U(e) || U(e[0]) && U(e[1]);
|
|
1535
|
+
const X = {
|
|
1536
|
+
includesString: Mt,
|
|
1537
|
+
includesStringSensitive: kt,
|
|
1538
|
+
equalsString: Et,
|
|
1539
|
+
arrIncludes: Lt,
|
|
1540
|
+
arrIncludesAll: Ot,
|
|
1541
|
+
arrIncludesSome: Tt,
|
|
1542
|
+
equals: Bt,
|
|
1543
|
+
weakEquals: Ht,
|
|
1544
|
+
inNumberRange: Qe
|
|
1545
|
+
};
|
|
1546
|
+
function U(e) {
|
|
1547
|
+
return e == null || e === "";
|
|
1548
|
+
}
|
|
1549
|
+
const vo = {
|
|
1550
|
+
getDefaultColumnDef: () => ({
|
|
1551
|
+
filterFn: "auto"
|
|
1552
|
+
}),
|
|
1553
|
+
getInitialState: (e) => ({
|
|
1554
|
+
columnFilters: [],
|
|
1555
|
+
...e
|
|
1556
|
+
}),
|
|
1557
|
+
getDefaultOptions: (e) => ({
|
|
1558
|
+
onColumnFiltersChange: N("columnFilters", e),
|
|
1559
|
+
filterFromLeafRows: !1,
|
|
1560
|
+
maxLeafRowFilterDepth: 100
|
|
1561
|
+
}),
|
|
1562
|
+
createColumn: (e, o) => {
|
|
1563
|
+
e.getAutoFilterFn = () => {
|
|
1564
|
+
const t = o.getCoreRowModel().flatRows[0], n = t?.getValue(e.id);
|
|
1565
|
+
return typeof n == "string" ? X.includesString : typeof n == "number" ? X.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? X.equals : Array.isArray(n) ? X.arrIncludes : X.weakEquals;
|
|
1566
|
+
}, e.getFilterFn = () => {
|
|
1567
|
+
var t, n;
|
|
1568
|
+
return Re(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
|
|
1569
|
+
// @ts-ignore
|
|
1570
|
+
(t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : X[e.columnDef.filterFn]
|
|
1571
|
+
);
|
|
1572
|
+
}, e.getCanFilter = () => {
|
|
1573
|
+
var t, n, i;
|
|
1574
|
+
return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n = o.options.enableColumnFilters) != null ? n : !0) && ((i = o.options.enableFilters) != null ? i : !0) && !!e.accessorFn;
|
|
1575
|
+
}, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
|
|
1576
|
+
var t;
|
|
1577
|
+
return (t = o.getState().columnFilters) == null || (t = t.find((n) => n.id === e.id)) == null ? void 0 : t.value;
|
|
1578
|
+
}, e.getFilterIndex = () => {
|
|
1579
|
+
var t, n;
|
|
1580
|
+
return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((i) => i.id === e.id)) != null ? t : -1;
|
|
1581
|
+
}, e.setFilterValue = (t) => {
|
|
1582
|
+
o.setColumnFilters((n) => {
|
|
1583
|
+
const i = e.getFilterFn(), r = n?.find((u) => u.id === e.id), s = Z(t, r ? r.value : void 0);
|
|
1584
|
+
if (ft(i, s, e)) {
|
|
1585
|
+
var l;
|
|
1586
|
+
return (l = n?.filter((u) => u.id !== e.id)) != null ? l : [];
|
|
1587
|
+
}
|
|
1588
|
+
const a = {
|
|
1589
|
+
id: e.id,
|
|
1590
|
+
value: s
|
|
1591
|
+
};
|
|
1592
|
+
if (r) {
|
|
1593
|
+
var d;
|
|
1594
|
+
return (d = n?.map((u) => u.id === e.id ? a : u)) != null ? d : [];
|
|
1595
|
+
}
|
|
1596
|
+
return n != null && n.length ? [...n, a] : [a];
|
|
1597
|
+
});
|
|
1598
|
+
};
|
|
1599
|
+
},
|
|
1600
|
+
createRow: (e, o) => {
|
|
1601
|
+
e.columnFilters = {}, e.columnFiltersMeta = {};
|
|
1602
|
+
},
|
|
1603
|
+
createTable: (e) => {
|
|
1604
|
+
e.setColumnFilters = (o) => {
|
|
1605
|
+
const t = e.getAllLeafColumns(), n = (i) => {
|
|
1606
|
+
var r;
|
|
1607
|
+
return (r = Z(o, i)) == null ? void 0 : r.filter((s) => {
|
|
1608
|
+
const l = t.find((a) => a.id === s.id);
|
|
1609
|
+
if (l) {
|
|
1610
|
+
const a = l.getFilterFn();
|
|
1611
|
+
if (ft(a, s.value, l))
|
|
1612
|
+
return !1;
|
|
1613
|
+
}
|
|
1614
|
+
return !0;
|
|
1615
|
+
});
|
|
1616
|
+
};
|
|
1617
|
+
e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange(n);
|
|
1618
|
+
}, e.resetColumnFilters = (o) => {
|
|
1619
|
+
var t, n;
|
|
1620
|
+
e.setColumnFilters(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.columnFilters) != null ? t : []);
|
|
1621
|
+
}, 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());
|
|
1622
|
+
}
|
|
1623
|
+
};
|
|
1624
|
+
function ft(e, o, t) {
|
|
1625
|
+
return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
|
|
1626
|
+
}
|
|
1627
|
+
const So = (e, o, t) => t.reduce((n, i) => {
|
|
1628
|
+
const r = i.getValue(e);
|
|
1629
|
+
return n + (typeof r == "number" ? r : 0);
|
|
1630
|
+
}, 0), wo = (e, o, t) => {
|
|
1631
|
+
let n;
|
|
1632
|
+
return t.forEach((i) => {
|
|
1633
|
+
const r = i.getValue(e);
|
|
1634
|
+
r != null && (n > r || n === void 0 && r >= r) && (n = r);
|
|
1635
|
+
}), n;
|
|
1636
|
+
}, Co = (e, o, t) => {
|
|
1637
|
+
let n;
|
|
1638
|
+
return t.forEach((i) => {
|
|
1639
|
+
const r = i.getValue(e);
|
|
1640
|
+
r != null && (n < r || n === void 0 && r >= r) && (n = r);
|
|
1641
|
+
}), n;
|
|
1642
|
+
}, yo = (e, o, t) => {
|
|
1643
|
+
let n, i;
|
|
1644
|
+
return t.forEach((r) => {
|
|
1645
|
+
const s = r.getValue(e);
|
|
1646
|
+
s != null && (n === void 0 ? s >= s && (n = i = s) : (n > s && (n = s), i < s && (i = s)));
|
|
1647
|
+
}), [n, i];
|
|
1648
|
+
}, Ro = (e, o) => {
|
|
1649
|
+
let t = 0, n = 0;
|
|
1650
|
+
if (o.forEach((i) => {
|
|
1651
|
+
let r = i.getValue(e);
|
|
1652
|
+
r != null && (r = +r) >= r && (++t, n += r);
|
|
1653
|
+
}), t) return n / t;
|
|
1654
|
+
}, Fo = (e, o) => {
|
|
1655
|
+
if (!o.length)
|
|
1656
|
+
return;
|
|
1657
|
+
const t = o.map((r) => r.getValue(e));
|
|
1658
|
+
if (!co(t))
|
|
1659
|
+
return;
|
|
1660
|
+
if (t.length === 1)
|
|
1661
|
+
return t[0];
|
|
1662
|
+
const n = Math.floor(t.length / 2), i = t.sort((r, s) => r - s);
|
|
1663
|
+
return t.length % 2 !== 0 ? i[n] : (i[n - 1] + i[n]) / 2;
|
|
1664
|
+
}, bo = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), Po = (e, o) => new Set(o.map((t) => t.getValue(e))).size, $o = (e, o) => o.length, Pe = {
|
|
1665
|
+
sum: So,
|
|
1666
|
+
min: wo,
|
|
1667
|
+
max: Co,
|
|
1668
|
+
extent: yo,
|
|
1669
|
+
mean: Ro,
|
|
1670
|
+
median: Fo,
|
|
1671
|
+
unique: bo,
|
|
1672
|
+
uniqueCount: Po,
|
|
1673
|
+
count: $o
|
|
1674
|
+
}, Io = {
|
|
1675
|
+
getDefaultColumnDef: () => ({
|
|
1676
|
+
aggregatedCell: (e) => {
|
|
1677
|
+
var o, t;
|
|
1678
|
+
return (o = (t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) != null ? o : null;
|
|
1679
|
+
},
|
|
1680
|
+
aggregationFn: "auto"
|
|
1681
|
+
}),
|
|
1682
|
+
getInitialState: (e) => ({
|
|
1683
|
+
grouping: [],
|
|
1684
|
+
...e
|
|
1685
|
+
}),
|
|
1686
|
+
getDefaultOptions: (e) => ({
|
|
1687
|
+
onGroupingChange: N("grouping", e),
|
|
1688
|
+
groupedColumnMode: "reorder"
|
|
1689
|
+
}),
|
|
1690
|
+
createColumn: (e, o) => {
|
|
1691
|
+
e.toggleGrouping = () => {
|
|
1692
|
+
o.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((n) => n !== e.id) : [...t ?? [], e.id]);
|
|
1693
|
+
}, e.getCanGroup = () => {
|
|
1694
|
+
var t, n;
|
|
1695
|
+
return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((n = o.options.enableGrouping) != null ? n : !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue);
|
|
1696
|
+
}, e.getIsGrouped = () => {
|
|
1697
|
+
var t;
|
|
1698
|
+
return (t = o.getState().grouping) == null ? void 0 : t.includes(e.id);
|
|
1699
|
+
}, e.getGroupedIndex = () => {
|
|
1700
|
+
var t;
|
|
1701
|
+
return (t = o.getState().grouping) == null ? void 0 : t.indexOf(e.id);
|
|
1702
|
+
}, e.getToggleGroupingHandler = () => {
|
|
1703
|
+
const t = e.getCanGroup();
|
|
1704
|
+
return () => {
|
|
1705
|
+
t && e.toggleGrouping();
|
|
1706
|
+
};
|
|
1707
|
+
}, e.getAutoAggregationFn = () => {
|
|
1708
|
+
const t = o.getCoreRowModel().flatRows[0], n = t?.getValue(e.id);
|
|
1709
|
+
if (typeof n == "number")
|
|
1710
|
+
return Pe.sum;
|
|
1711
|
+
if (Object.prototype.toString.call(n) === "[object Date]")
|
|
1712
|
+
return Pe.extent;
|
|
1713
|
+
}, e.getAggregationFn = () => {
|
|
1714
|
+
var t, n;
|
|
1715
|
+
if (!e)
|
|
1716
|
+
throw new Error();
|
|
1717
|
+
return Re(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 : Pe[e.columnDef.aggregationFn];
|
|
1718
|
+
};
|
|
1719
|
+
},
|
|
1720
|
+
createTable: (e) => {
|
|
1721
|
+
e.setGrouping = (o) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(o), e.resetGrouping = (o) => {
|
|
1722
|
+
var t, n;
|
|
1723
|
+
e.setGrouping(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.grouping) != null ? t : []);
|
|
1724
|
+
}, 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());
|
|
1725
|
+
},
|
|
1726
|
+
createRow: (e, o) => {
|
|
1727
|
+
e.getIsGrouped = () => !!e.groupingColumnId, e.getGroupingValue = (t) => {
|
|
1728
|
+
if (e._groupingValuesCache.hasOwnProperty(t))
|
|
1729
|
+
return e._groupingValuesCache[t];
|
|
1730
|
+
const n = o.getColumn(t);
|
|
1731
|
+
return n != null && n.columnDef.getGroupingValue ? (e._groupingValuesCache[t] = n.columnDef.getGroupingValue(e.original), e._groupingValuesCache[t]) : e.getValue(t);
|
|
1732
|
+
}, e._groupingValuesCache = {};
|
|
1733
|
+
},
|
|
1734
|
+
createCell: (e, o, t, n) => {
|
|
1735
|
+
e.getIsGrouped = () => o.getIsGrouped() && o.id === t.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && o.getIsGrouped(), e.getIsAggregated = () => {
|
|
1736
|
+
var i;
|
|
1737
|
+
return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((i = t.subRows) != null && i.length);
|
|
1738
|
+
};
|
|
1739
|
+
}
|
|
1740
|
+
};
|
|
1741
|
+
function xo(e, o, t) {
|
|
1742
|
+
if (!(o != null && o.length) || !t)
|
|
1743
|
+
return e;
|
|
1744
|
+
const n = e.filter((r) => !o.includes(r.id));
|
|
1745
|
+
return t === "remove" ? n : [...o.map((r) => e.find((s) => s.id === r)).filter(Boolean), ...n];
|
|
1746
|
+
}
|
|
1747
|
+
const Vo = {
|
|
1748
|
+
getInitialState: (e) => ({
|
|
1749
|
+
columnOrder: [],
|
|
1750
|
+
...e
|
|
1751
|
+
}),
|
|
1752
|
+
getDefaultOptions: (e) => ({
|
|
1753
|
+
onColumnOrderChange: N("columnOrder", e)
|
|
1754
|
+
}),
|
|
1755
|
+
createColumn: (e, o) => {
|
|
1756
|
+
e.getIndex = F((t) => [se(o, t)], (t) => t.findIndex((n) => n.id === e.id), b(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
|
|
1757
|
+
var n;
|
|
1758
|
+
return ((n = se(o, t)[0]) == null ? void 0 : n.id) === e.id;
|
|
1759
|
+
}, e.getIsLastColumn = (t) => {
|
|
1760
|
+
var n;
|
|
1761
|
+
const i = se(o, t);
|
|
1762
|
+
return ((n = i[i.length - 1]) == null ? void 0 : n.id) === e.id;
|
|
1763
|
+
};
|
|
1764
|
+
},
|
|
1765
|
+
createTable: (e) => {
|
|
1766
|
+
e.setColumnOrder = (o) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(o), e.resetColumnOrder = (o) => {
|
|
1767
|
+
var t;
|
|
1768
|
+
e.setColumnOrder(o ? [] : (t = e.initialState.columnOrder) != null ? t : []);
|
|
1769
|
+
}, e._getOrderColumnsFn = F(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (o, t, n) => (i) => {
|
|
1770
|
+
let r = [];
|
|
1771
|
+
if (!(o != null && o.length))
|
|
1772
|
+
r = i;
|
|
1773
|
+
else {
|
|
1774
|
+
const s = [...o], l = [...i];
|
|
1775
|
+
for (; l.length && s.length; ) {
|
|
1776
|
+
const a = s.shift(), d = l.findIndex((u) => u.id === a);
|
|
1777
|
+
d > -1 && r.push(l.splice(d, 1)[0]);
|
|
1778
|
+
}
|
|
1779
|
+
r = [...r, ...l];
|
|
1780
|
+
}
|
|
1781
|
+
return xo(r, t, n);
|
|
1782
|
+
}, b(e.options, "debugTable", "_getOrderColumnsFn"));
|
|
1783
|
+
}
|
|
1784
|
+
}, $e = () => ({
|
|
1785
|
+
left: [],
|
|
1786
|
+
right: []
|
|
1787
|
+
}), _o = {
|
|
1788
|
+
getInitialState: (e) => ({
|
|
1789
|
+
columnPinning: $e(),
|
|
1790
|
+
...e
|
|
1791
|
+
}),
|
|
1792
|
+
getDefaultOptions: (e) => ({
|
|
1793
|
+
onColumnPinningChange: N("columnPinning", e)
|
|
1794
|
+
}),
|
|
1795
|
+
createColumn: (e, o) => {
|
|
1796
|
+
e.pin = (t) => {
|
|
1797
|
+
const n = e.getLeafColumns().map((i) => i.id).filter(Boolean);
|
|
1798
|
+
o.setColumnPinning((i) => {
|
|
1799
|
+
var r, s;
|
|
1800
|
+
if (t === "right") {
|
|
1801
|
+
var l, a;
|
|
1802
|
+
return {
|
|
1803
|
+
left: ((l = i?.left) != null ? l : []).filter((f) => !(n != null && n.includes(f))),
|
|
1804
|
+
right: [...((a = i?.right) != null ? a : []).filter((f) => !(n != null && n.includes(f))), ...n]
|
|
1805
|
+
};
|
|
1806
|
+
}
|
|
1807
|
+
if (t === "left") {
|
|
1808
|
+
var d, u;
|
|
1809
|
+
return {
|
|
1810
|
+
left: [...((d = i?.left) != null ? d : []).filter((f) => !(n != null && n.includes(f))), ...n],
|
|
1811
|
+
right: ((u = i?.right) != null ? u : []).filter((f) => !(n != null && n.includes(f)))
|
|
1812
|
+
};
|
|
1813
|
+
}
|
|
1814
|
+
return {
|
|
1815
|
+
left: ((r = i?.left) != null ? r : []).filter((f) => !(n != null && n.includes(f))),
|
|
1816
|
+
right: ((s = i?.right) != null ? s : []).filter((f) => !(n != null && n.includes(f)))
|
|
1817
|
+
};
|
|
1818
|
+
});
|
|
1819
|
+
}, e.getCanPin = () => e.getLeafColumns().some((n) => {
|
|
1820
|
+
var i, r, s;
|
|
1821
|
+
return ((i = n.columnDef.enablePinning) != null ? i : !0) && ((r = (s = o.options.enableColumnPinning) != null ? s : o.options.enablePinning) != null ? r : !0);
|
|
1822
|
+
}), e.getIsPinned = () => {
|
|
1823
|
+
const t = e.getLeafColumns().map((l) => l.id), {
|
|
1824
|
+
left: n,
|
|
1825
|
+
right: i
|
|
1826
|
+
} = o.getState().columnPinning, r = t.some((l) => n?.includes(l)), s = t.some((l) => i?.includes(l));
|
|
1827
|
+
return r ? "left" : s ? "right" : !1;
|
|
1828
|
+
}, e.getPinnedIndex = () => {
|
|
1829
|
+
var t, n;
|
|
1830
|
+
const i = e.getIsPinned();
|
|
1831
|
+
return i ? (t = (n = o.getState().columnPinning) == null || (n = n[i]) == null ? void 0 : n.indexOf(e.id)) != null ? t : -1 : 0;
|
|
1832
|
+
};
|
|
1833
|
+
},
|
|
1834
|
+
createRow: (e, o) => {
|
|
1835
|
+
e.getCenterVisibleCells = F(() => [e._getAllVisibleCells(), o.getState().columnPinning.left, o.getState().columnPinning.right], (t, n, i) => {
|
|
1836
|
+
const r = [...n ?? [], ...i ?? []];
|
|
1837
|
+
return t.filter((s) => !r.includes(s.column.id));
|
|
1838
|
+
}, b(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = F(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((r) => t.find((s) => s.column.id === r)).filter(Boolean).map((r) => ({
|
|
1839
|
+
...r,
|
|
1840
|
+
position: "left"
|
|
1841
|
+
})), b(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = F(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((r) => t.find((s) => s.column.id === r)).filter(Boolean).map((r) => ({
|
|
1842
|
+
...r,
|
|
1843
|
+
position: "right"
|
|
1844
|
+
})), b(o.options, "debugRows", "getRightVisibleCells"));
|
|
1845
|
+
},
|
|
1846
|
+
createTable: (e) => {
|
|
1847
|
+
e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
|
|
1848
|
+
var t, n;
|
|
1849
|
+
return e.setColumnPinning(o ? $e() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : $e());
|
|
1850
|
+
}, e.getIsSomeColumnsPinned = (o) => {
|
|
1851
|
+
var t;
|
|
1852
|
+
const n = e.getState().columnPinning;
|
|
1853
|
+
if (!o) {
|
|
1854
|
+
var i, r;
|
|
1855
|
+
return !!((i = n.left) != null && i.length || (r = n.right) != null && r.length);
|
|
1856
|
+
}
|
|
1857
|
+
return !!((t = n[o]) != null && t.length);
|
|
1858
|
+
}, e.getLeftLeafColumns = F(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (o, t) => (t ?? []).map((n) => o.find((i) => i.id === n)).filter(Boolean), b(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = F(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (o, t) => (t ?? []).map((n) => o.find((i) => i.id === n)).filter(Boolean), b(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = F(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
|
|
1859
|
+
const i = [...t ?? [], ...n ?? []];
|
|
1860
|
+
return o.filter((r) => !i.includes(r.id));
|
|
1861
|
+
}, b(e.options, "debugColumns", "getCenterLeafColumns"));
|
|
1862
|
+
}
|
|
1863
|
+
}, ge = {
|
|
1864
|
+
size: 150,
|
|
1865
|
+
minSize: 20,
|
|
1866
|
+
maxSize: Number.MAX_SAFE_INTEGER
|
|
1867
|
+
}, Ie = () => ({
|
|
1868
|
+
startOffset: null,
|
|
1869
|
+
startSize: null,
|
|
1870
|
+
deltaOffset: null,
|
|
1871
|
+
deltaPercentage: null,
|
|
1872
|
+
isResizingColumn: !1,
|
|
1873
|
+
columnSizingStart: []
|
|
1874
|
+
}), Do = {
|
|
1875
|
+
getDefaultColumnDef: () => ge,
|
|
1876
|
+
getInitialState: (e) => ({
|
|
1877
|
+
columnSizing: {},
|
|
1878
|
+
columnSizingInfo: Ie(),
|
|
1879
|
+
...e
|
|
1880
|
+
}),
|
|
1881
|
+
getDefaultOptions: (e) => ({
|
|
1882
|
+
columnResizeMode: "onEnd",
|
|
1883
|
+
columnResizeDirection: "ltr",
|
|
1884
|
+
onColumnSizingChange: N("columnSizing", e),
|
|
1885
|
+
onColumnSizingInfoChange: N("columnSizingInfo", e)
|
|
1886
|
+
}),
|
|
1887
|
+
createColumn: (e, o) => {
|
|
1888
|
+
e.getSize = () => {
|
|
1889
|
+
var t, n, i;
|
|
1890
|
+
const r = o.getState().columnSizing[e.id];
|
|
1891
|
+
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : ge.minSize, (n = r ?? e.columnDef.size) != null ? n : ge.size), (i = e.columnDef.maxSize) != null ? i : ge.maxSize);
|
|
1892
|
+
}, e.getStart = F((t) => [t, se(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((i, r) => i + r.getSize(), 0), b(o.options, "debugColumns", "getStart")), e.getAfter = F((t) => [t, se(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((i, r) => i + r.getSize(), 0), b(o.options, "debugColumns", "getAfter")), e.resetSize = () => {
|
|
1893
|
+
o.setColumnSizing((t) => {
|
|
1894
|
+
let {
|
|
1895
|
+
[e.id]: n,
|
|
1896
|
+
...i
|
|
1897
|
+
} = t;
|
|
1898
|
+
return i;
|
|
1899
|
+
});
|
|
1900
|
+
}, e.getCanResize = () => {
|
|
1901
|
+
var t, n;
|
|
1902
|
+
return ((t = e.columnDef.enableResizing) != null ? t : !0) && ((n = o.options.enableColumnResizing) != null ? n : !0);
|
|
1903
|
+
}, e.getIsResizing = () => o.getState().columnSizingInfo.isResizingColumn === e.id;
|
|
1904
|
+
},
|
|
1905
|
+
createHeader: (e, o) => {
|
|
1906
|
+
e.getSize = () => {
|
|
1907
|
+
let t = 0;
|
|
1908
|
+
const n = (i) => {
|
|
1909
|
+
if (i.subHeaders.length)
|
|
1910
|
+
i.subHeaders.forEach(n);
|
|
1911
|
+
else {
|
|
1912
|
+
var r;
|
|
1913
|
+
t += (r = i.column.getSize()) != null ? r : 0;
|
|
1914
|
+
}
|
|
1915
|
+
};
|
|
1916
|
+
return n(e), t;
|
|
1917
|
+
}, e.getStart = () => {
|
|
1918
|
+
if (e.index > 0) {
|
|
1919
|
+
const t = e.headerGroup.headers[e.index - 1];
|
|
1920
|
+
return t.getStart() + t.getSize();
|
|
1921
|
+
}
|
|
1922
|
+
return 0;
|
|
1923
|
+
}, e.getResizeHandler = (t) => {
|
|
1924
|
+
const n = o.getColumn(e.column.id), i = n?.getCanResize();
|
|
1925
|
+
return (r) => {
|
|
1926
|
+
if (!n || !i || (r.persist == null || r.persist(), xe(r) && r.touches && r.touches.length > 1))
|
|
1927
|
+
return;
|
|
1928
|
+
const s = e.getSize(), l = e ? e.getLeafHeaders().map((R) => [R.column.id, R.column.getSize()]) : [[n.id, n.getSize()]], a = xe(r) ? Math.round(r.touches[0].clientX) : r.clientX, d = {}, u = (R, $) => {
|
|
1929
|
+
typeof $ == "number" && (o.setColumnSizingInfo((P) => {
|
|
1930
|
+
var D, v;
|
|
1931
|
+
const w = o.options.columnResizeDirection === "rtl" ? -1 : 1, I = ($ - ((D = P?.startOffset) != null ? D : 0)) * w, _ = Math.max(I / ((v = P?.startSize) != null ? v : 0), -0.999999);
|
|
1932
|
+
return P.columnSizingStart.forEach((k) => {
|
|
1933
|
+
let [E, q] = k;
|
|
1934
|
+
d[E] = Math.round(Math.max(q + q * _, 0) * 100) / 100;
|
|
1935
|
+
}), {
|
|
1936
|
+
...P,
|
|
1937
|
+
deltaOffset: I,
|
|
1938
|
+
deltaPercentage: _
|
|
1939
|
+
};
|
|
1940
|
+
}), (o.options.columnResizeMode === "onChange" || R === "end") && o.setColumnSizing((P) => ({
|
|
1941
|
+
...P,
|
|
1942
|
+
...d
|
|
1943
|
+
})));
|
|
1944
|
+
}, f = (R) => u("move", R), g = (R) => {
|
|
1945
|
+
u("end", R), o.setColumnSizingInfo(($) => ({
|
|
1946
|
+
...$,
|
|
1947
|
+
isResizingColumn: !1,
|
|
1948
|
+
startOffset: null,
|
|
1949
|
+
startSize: null,
|
|
1950
|
+
deltaOffset: null,
|
|
1951
|
+
deltaPercentage: null,
|
|
1952
|
+
columnSizingStart: []
|
|
1953
|
+
}));
|
|
1954
|
+
}, c = t || typeof document < "u" ? document : null, p = {
|
|
1955
|
+
moveHandler: (R) => f(R.clientX),
|
|
1956
|
+
upHandler: (R) => {
|
|
1957
|
+
c?.removeEventListener("mousemove", p.moveHandler), c?.removeEventListener("mouseup", p.upHandler), g(R.clientX);
|
|
1958
|
+
}
|
|
1959
|
+
}, m = {
|
|
1960
|
+
moveHandler: (R) => (R.cancelable && (R.preventDefault(), R.stopPropagation()), f(R.touches[0].clientX), !1),
|
|
1961
|
+
upHandler: (R) => {
|
|
1962
|
+
var $;
|
|
1963
|
+
c?.removeEventListener("touchmove", m.moveHandler), c?.removeEventListener("touchend", m.upHandler), R.cancelable && (R.preventDefault(), R.stopPropagation()), g(($ = R.touches[0]) == null ? void 0 : $.clientX);
|
|
1964
|
+
}
|
|
1965
|
+
}, h = Ao() ? {
|
|
1966
|
+
passive: !1
|
|
1967
|
+
} : !1;
|
|
1968
|
+
xe(r) ? (c?.addEventListener("touchmove", m.moveHandler, h), c?.addEventListener("touchend", m.upHandler, h)) : (c?.addEventListener("mousemove", p.moveHandler, h), c?.addEventListener("mouseup", p.upHandler, h)), o.setColumnSizingInfo((R) => ({
|
|
1969
|
+
...R,
|
|
1970
|
+
startOffset: a,
|
|
1971
|
+
startSize: s,
|
|
1972
|
+
deltaOffset: 0,
|
|
1973
|
+
deltaPercentage: 0,
|
|
1974
|
+
columnSizingStart: l,
|
|
1975
|
+
isResizingColumn: n.id
|
|
1976
|
+
}));
|
|
1977
|
+
};
|
|
1978
|
+
};
|
|
1979
|
+
},
|
|
1980
|
+
createTable: (e) => {
|
|
1981
|
+
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) => {
|
|
1982
|
+
var t;
|
|
1983
|
+
e.setColumnSizing(o ? {} : (t = e.initialState.columnSizing) != null ? t : {});
|
|
1984
|
+
}, e.resetHeaderSizeInfo = (o) => {
|
|
1985
|
+
var t;
|
|
1986
|
+
e.setColumnSizingInfo(o ? Ie() : (t = e.initialState.columnSizingInfo) != null ? t : Ie());
|
|
1987
|
+
}, e.getTotalSize = () => {
|
|
1988
|
+
var o, t;
|
|
1989
|
+
return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
|
|
1990
|
+
}, e.getLeftTotalSize = () => {
|
|
1991
|
+
var o, t;
|
|
1992
|
+
return (o = (t = e.getLeftHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
|
|
1993
|
+
}, e.getCenterTotalSize = () => {
|
|
1994
|
+
var o, t;
|
|
1995
|
+
return (o = (t = e.getCenterHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
|
|
1996
|
+
}, e.getRightTotalSize = () => {
|
|
1997
|
+
var o, t;
|
|
1998
|
+
return (o = (t = e.getRightHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? o : 0;
|
|
1999
|
+
};
|
|
2000
|
+
}
|
|
2001
|
+
};
|
|
2002
|
+
let fe = null;
|
|
2003
|
+
function Ao() {
|
|
2004
|
+
if (typeof fe == "boolean") return fe;
|
|
2005
|
+
let e = !1;
|
|
2006
|
+
try {
|
|
2007
|
+
const o = {
|
|
2008
|
+
get passive() {
|
|
2009
|
+
return e = !0, !1;
|
|
2010
|
+
}
|
|
2011
|
+
}, t = () => {
|
|
2012
|
+
};
|
|
2013
|
+
window.addEventListener("test", t, o), window.removeEventListener("test", t);
|
|
2014
|
+
} catch {
|
|
2015
|
+
e = !1;
|
|
2016
|
+
}
|
|
2017
|
+
return fe = e, fe;
|
|
2018
|
+
}
|
|
2019
|
+
function xe(e) {
|
|
2020
|
+
return e.type === "touchstart";
|
|
2021
|
+
}
|
|
2022
|
+
const Mo = {
|
|
2023
|
+
getInitialState: (e) => ({
|
|
2024
|
+
columnVisibility: {},
|
|
2025
|
+
...e
|
|
2026
|
+
}),
|
|
2027
|
+
getDefaultOptions: (e) => ({
|
|
2028
|
+
onColumnVisibilityChange: N("columnVisibility", e)
|
|
2029
|
+
}),
|
|
2030
|
+
createColumn: (e, o) => {
|
|
2031
|
+
e.toggleVisibility = (t) => {
|
|
2032
|
+
e.getCanHide() && o.setColumnVisibility((n) => ({
|
|
2033
|
+
...n,
|
|
2034
|
+
[e.id]: t ?? !e.getIsVisible()
|
|
2035
|
+
}));
|
|
2036
|
+
}, e.getIsVisible = () => {
|
|
2037
|
+
var t, n;
|
|
2038
|
+
const i = e.columns;
|
|
2039
|
+
return (t = i.length ? i.some((r) => r.getIsVisible()) : (n = o.getState().columnVisibility) == null ? void 0 : n[e.id]) != null ? t : !0;
|
|
2040
|
+
}, e.getCanHide = () => {
|
|
2041
|
+
var t, n;
|
|
2042
|
+
return ((t = e.columnDef.enableHiding) != null ? t : !0) && ((n = o.options.enableHiding) != null ? n : !0);
|
|
2043
|
+
}, e.getToggleVisibilityHandler = () => (t) => {
|
|
2044
|
+
e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
|
|
2045
|
+
};
|
|
2046
|
+
},
|
|
2047
|
+
createRow: (e, o) => {
|
|
2048
|
+
e._getAllVisibleCells = F(() => [e.getAllCells(), o.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), b(o.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = F(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, i) => [...t, ...n, ...i], b(o.options, "debugRows", "getVisibleCells"));
|
|
2049
|
+
},
|
|
2050
|
+
createTable: (e) => {
|
|
2051
|
+
const o = (t, n) => F(() => [n(), n().filter((i) => i.getIsVisible()).map((i) => i.id).join("_")], (i) => i.filter((r) => r.getIsVisible == null ? void 0 : r.getIsVisible()), b(e.options, "debugColumns", t));
|
|
2052
|
+
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) => {
|
|
2053
|
+
var n;
|
|
2054
|
+
e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
|
|
2055
|
+
}, e.toggleAllColumnsVisible = (t) => {
|
|
2056
|
+
var n;
|
|
2057
|
+
t = (n = t) != null ? n : !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((i, r) => ({
|
|
2058
|
+
...i,
|
|
2059
|
+
[r.id]: t || !(r.getCanHide != null && r.getCanHide())
|
|
2060
|
+
}), {}));
|
|
2061
|
+
}, 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) => {
|
|
2062
|
+
var n;
|
|
2063
|
+
e.toggleAllColumnsVisible((n = t.target) == null ? void 0 : n.checked);
|
|
2064
|
+
};
|
|
2065
|
+
}
|
|
2066
|
+
};
|
|
2067
|
+
function se(e, o) {
|
|
2068
|
+
return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
|
|
2069
|
+
}
|
|
2070
|
+
const ko = {
|
|
2071
|
+
createTable: (e) => {
|
|
2072
|
+
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 = () => {
|
|
2073
|
+
if (e._getGlobalFacetedMinMaxValues)
|
|
2074
|
+
return e._getGlobalFacetedMinMaxValues();
|
|
2075
|
+
};
|
|
2076
|
+
}
|
|
2077
|
+
}, Eo = {
|
|
2078
|
+
getInitialState: (e) => ({
|
|
2079
|
+
globalFilter: void 0,
|
|
2080
|
+
...e
|
|
2081
|
+
}),
|
|
2082
|
+
getDefaultOptions: (e) => ({
|
|
2083
|
+
onGlobalFilterChange: N("globalFilter", e),
|
|
2084
|
+
globalFilterFn: "auto",
|
|
2085
|
+
getColumnCanGlobalFilter: (o) => {
|
|
2086
|
+
var t;
|
|
2087
|
+
const n = (t = e.getCoreRowModel().flatRows[0]) == null || (t = t._getAllCellsByColumnId()[o.id]) == null ? void 0 : t.getValue();
|
|
2088
|
+
return typeof n == "string" || typeof n == "number";
|
|
2089
|
+
}
|
|
2090
|
+
}),
|
|
2091
|
+
createColumn: (e, o) => {
|
|
2092
|
+
e.getCanGlobalFilter = () => {
|
|
2093
|
+
var t, n, i, r;
|
|
2094
|
+
return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n = o.options.enableGlobalFilter) != null ? n : !0) && ((i = o.options.enableFilters) != null ? i : !0) && ((r = o.options.getColumnCanGlobalFilter == null ? void 0 : o.options.getColumnCanGlobalFilter(e)) != null ? r : !0) && !!e.accessorFn;
|
|
2095
|
+
};
|
|
2096
|
+
},
|
|
2097
|
+
createTable: (e) => {
|
|
2098
|
+
e.getGlobalAutoFilterFn = () => X.includesString, e.getGlobalFilterFn = () => {
|
|
2099
|
+
var o, t;
|
|
2100
|
+
const {
|
|
2101
|
+
globalFilterFn: n
|
|
2102
|
+
} = e.options;
|
|
2103
|
+
return Re(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : X[n];
|
|
2104
|
+
}, e.setGlobalFilter = (o) => {
|
|
2105
|
+
e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(o);
|
|
2106
|
+
}, e.resetGlobalFilter = (o) => {
|
|
2107
|
+
e.setGlobalFilter(o ? void 0 : e.initialState.globalFilter);
|
|
2108
|
+
};
|
|
2109
|
+
}
|
|
2110
|
+
}, Lo = {
|
|
2111
|
+
getInitialState: (e) => ({
|
|
2112
|
+
expanded: {},
|
|
2113
|
+
...e
|
|
2114
|
+
}),
|
|
2115
|
+
getDefaultOptions: (e) => ({
|
|
2116
|
+
onExpandedChange: N("expanded", e),
|
|
2117
|
+
paginateExpandedRows: !0
|
|
2118
|
+
}),
|
|
2119
|
+
createTable: (e) => {
|
|
2120
|
+
let o = !1, t = !1;
|
|
2121
|
+
e._autoResetExpanded = () => {
|
|
2122
|
+
var n, i;
|
|
2123
|
+
if (!o) {
|
|
2124
|
+
e._queue(() => {
|
|
2125
|
+
o = !0;
|
|
2126
|
+
});
|
|
2127
|
+
return;
|
|
2128
|
+
}
|
|
2129
|
+
if ((n = (i = e.options.autoResetAll) != null ? i : e.options.autoResetExpanded) != null ? n : !e.options.manualExpanding) {
|
|
2130
|
+
if (t) return;
|
|
2131
|
+
t = !0, e._queue(() => {
|
|
2132
|
+
e.resetExpanded(), t = !1;
|
|
2133
|
+
});
|
|
2134
|
+
}
|
|
2135
|
+
}, e.setExpanded = (n) => e.options.onExpandedChange == null ? void 0 : e.options.onExpandedChange(n), e.toggleAllRowsExpanded = (n) => {
|
|
2136
|
+
n ?? !e.getIsAllRowsExpanded() ? e.setExpanded(!0) : e.setExpanded({});
|
|
2137
|
+
}, e.resetExpanded = (n) => {
|
|
2138
|
+
var i, r;
|
|
2139
|
+
e.setExpanded(n ? {} : (i = (r = e.initialState) == null ? void 0 : r.expanded) != null ? i : {});
|
|
2140
|
+
}, e.getCanSomeRowsExpand = () => e.getPrePaginationRowModel().flatRows.some((n) => n.getCanExpand()), e.getToggleAllRowsExpandedHandler = () => (n) => {
|
|
2141
|
+
n.persist == null || n.persist(), e.toggleAllRowsExpanded();
|
|
2142
|
+
}, e.getIsSomeRowsExpanded = () => {
|
|
2143
|
+
const n = e.getState().expanded;
|
|
2144
|
+
return n === !0 || Object.values(n).some(Boolean);
|
|
2145
|
+
}, e.getIsAllRowsExpanded = () => {
|
|
2146
|
+
const n = e.getState().expanded;
|
|
2147
|
+
return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || e.getRowModel().flatRows.some((i) => !i.getIsExpanded()));
|
|
2148
|
+
}, e.getExpandedDepth = () => {
|
|
2149
|
+
let n = 0;
|
|
2150
|
+
return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((r) => {
|
|
2151
|
+
const s = r.split(".");
|
|
2152
|
+
n = Math.max(n, s.length);
|
|
2153
|
+
}), n;
|
|
2154
|
+
}, 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());
|
|
2155
|
+
},
|
|
2156
|
+
createRow: (e, o) => {
|
|
2157
|
+
e.toggleExpanded = (t) => {
|
|
2158
|
+
o.setExpanded((n) => {
|
|
2159
|
+
var i;
|
|
2160
|
+
const r = n === !0 ? !0 : !!(n != null && n[e.id]);
|
|
2161
|
+
let s = {};
|
|
2162
|
+
if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((l) => {
|
|
2163
|
+
s[l] = !0;
|
|
2164
|
+
}) : s = n, t = (i = t) != null ? i : !r, !r && t)
|
|
2165
|
+
return {
|
|
2166
|
+
...s,
|
|
2167
|
+
[e.id]: !0
|
|
2168
|
+
};
|
|
2169
|
+
if (r && !t) {
|
|
2170
|
+
const {
|
|
2171
|
+
[e.id]: l,
|
|
2172
|
+
...a
|
|
2173
|
+
} = s;
|
|
2174
|
+
return a;
|
|
2175
|
+
}
|
|
2176
|
+
return n;
|
|
2177
|
+
});
|
|
2178
|
+
}, e.getIsExpanded = () => {
|
|
2179
|
+
var t;
|
|
2180
|
+
const n = o.getState().expanded;
|
|
2181
|
+
return !!((t = o.options.getIsRowExpanded == null ? void 0 : o.options.getIsRowExpanded(e)) != null ? t : n === !0 || n?.[e.id]);
|
|
2182
|
+
}, e.getCanExpand = () => {
|
|
2183
|
+
var t, n, i;
|
|
2184
|
+
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);
|
|
2185
|
+
}, e.getIsAllParentsExpanded = () => {
|
|
2186
|
+
let t = !0, n = e;
|
|
2187
|
+
for (; t && n.parentId; )
|
|
2188
|
+
n = o.getRow(n.parentId, !0), t = n.getIsExpanded();
|
|
2189
|
+
return t;
|
|
2190
|
+
}, e.getToggleExpandedHandler = () => {
|
|
2191
|
+
const t = e.getCanExpand();
|
|
2192
|
+
return () => {
|
|
2193
|
+
t && e.toggleExpanded();
|
|
2194
|
+
};
|
|
2195
|
+
};
|
|
2196
|
+
}
|
|
2197
|
+
}, He = 0, ze = 10, Ve = () => ({
|
|
2198
|
+
pageIndex: He,
|
|
2199
|
+
pageSize: ze
|
|
2200
|
+
}), Oo = {
|
|
2201
|
+
getInitialState: (e) => ({
|
|
2202
|
+
...e,
|
|
2203
|
+
pagination: {
|
|
2204
|
+
...Ve(),
|
|
2205
|
+
...e?.pagination
|
|
2206
|
+
}
|
|
2207
|
+
}),
|
|
2208
|
+
getDefaultOptions: (e) => ({
|
|
2209
|
+
onPaginationChange: N("pagination", e)
|
|
2210
|
+
}),
|
|
2211
|
+
createTable: (e) => {
|
|
2212
|
+
let o = !1, t = !1;
|
|
2213
|
+
e._autoResetPageIndex = () => {
|
|
2214
|
+
var n, i;
|
|
2215
|
+
if (!o) {
|
|
2216
|
+
e._queue(() => {
|
|
2217
|
+
o = !0;
|
|
2218
|
+
});
|
|
2219
|
+
return;
|
|
2220
|
+
}
|
|
2221
|
+
if ((n = (i = e.options.autoResetAll) != null ? i : e.options.autoResetPageIndex) != null ? n : !e.options.manualPagination) {
|
|
2222
|
+
if (t) return;
|
|
2223
|
+
t = !0, e._queue(() => {
|
|
2224
|
+
e.resetPageIndex(), t = !1;
|
|
2225
|
+
});
|
|
2226
|
+
}
|
|
2227
|
+
}, e.setPagination = (n) => {
|
|
2228
|
+
const i = (r) => Z(n, r);
|
|
2229
|
+
return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(i);
|
|
2230
|
+
}, e.resetPagination = (n) => {
|
|
2231
|
+
var i;
|
|
2232
|
+
e.setPagination(n ? Ve() : (i = e.initialState.pagination) != null ? i : Ve());
|
|
2233
|
+
}, e.setPageIndex = (n) => {
|
|
2234
|
+
e.setPagination((i) => {
|
|
2235
|
+
let r = Z(n, i.pageIndex);
|
|
2236
|
+
const s = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
|
|
2237
|
+
return r = Math.max(0, Math.min(r, s)), {
|
|
2238
|
+
...i,
|
|
2239
|
+
pageIndex: r
|
|
2240
|
+
};
|
|
2241
|
+
});
|
|
2242
|
+
}, e.resetPageIndex = (n) => {
|
|
2243
|
+
var i, r;
|
|
2244
|
+
e.setPageIndex(n ? He : (i = (r = e.initialState) == null || (r = r.pagination) == null ? void 0 : r.pageIndex) != null ? i : He);
|
|
2245
|
+
}, e.resetPageSize = (n) => {
|
|
2246
|
+
var i, r;
|
|
2247
|
+
e.setPageSize(n ? ze : (i = (r = e.initialState) == null || (r = r.pagination) == null ? void 0 : r.pageSize) != null ? i : ze);
|
|
2248
|
+
}, e.setPageSize = (n) => {
|
|
2249
|
+
e.setPagination((i) => {
|
|
2250
|
+
const r = Math.max(1, Z(n, i.pageSize)), s = i.pageSize * i.pageIndex, l = Math.floor(s / r);
|
|
2251
|
+
return {
|
|
2252
|
+
...i,
|
|
2253
|
+
pageIndex: l,
|
|
2254
|
+
pageSize: r
|
|
2255
|
+
};
|
|
2256
|
+
});
|
|
2257
|
+
}, e.setPageCount = (n) => e.setPagination((i) => {
|
|
2258
|
+
var r;
|
|
2259
|
+
let s = Z(n, (r = e.options.pageCount) != null ? r : -1);
|
|
2260
|
+
return typeof s == "number" && (s = Math.max(-1, s)), {
|
|
2261
|
+
...i,
|
|
2262
|
+
pageCount: s
|
|
2263
|
+
};
|
|
2264
|
+
}), e.getPageOptions = F(() => [e.getPageCount()], (n) => {
|
|
2265
|
+
let i = [];
|
|
2266
|
+
return n && n > 0 && (i = [...new Array(n)].fill(null).map((r, s) => s)), i;
|
|
2267
|
+
}, b(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
|
|
2268
|
+
const {
|
|
2269
|
+
pageIndex: n
|
|
2270
|
+
} = e.getState().pagination, i = e.getPageCount();
|
|
2271
|
+
return i === -1 ? !0 : i === 0 ? !1 : n < i - 1;
|
|
2272
|
+
}, 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 = () => {
|
|
2273
|
+
var n;
|
|
2274
|
+
return (n = e.options.pageCount) != null ? n : Math.ceil(e.getRowCount() / e.getState().pagination.pageSize);
|
|
2275
|
+
}, e.getRowCount = () => {
|
|
2276
|
+
var n;
|
|
2277
|
+
return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
|
|
2278
|
+
};
|
|
2279
|
+
}
|
|
2280
|
+
}, _e = () => ({
|
|
2281
|
+
top: [],
|
|
2282
|
+
bottom: []
|
|
2283
|
+
}), To = {
|
|
2284
|
+
getInitialState: (e) => ({
|
|
2285
|
+
rowPinning: _e(),
|
|
2286
|
+
...e
|
|
2287
|
+
}),
|
|
2288
|
+
getDefaultOptions: (e) => ({
|
|
2289
|
+
onRowPinningChange: N("rowPinning", e)
|
|
2290
|
+
}),
|
|
2291
|
+
createRow: (e, o) => {
|
|
2292
|
+
e.pin = (t, n, i) => {
|
|
2293
|
+
const r = n ? e.getLeafRows().map((a) => {
|
|
2294
|
+
let {
|
|
2295
|
+
id: d
|
|
2296
|
+
} = a;
|
|
2297
|
+
return d;
|
|
2298
|
+
}) : [], s = i ? e.getParentRows().map((a) => {
|
|
2299
|
+
let {
|
|
2300
|
+
id: d
|
|
2301
|
+
} = a;
|
|
2302
|
+
return d;
|
|
2303
|
+
}) : [], l = /* @__PURE__ */ new Set([...s, e.id, ...r]);
|
|
2304
|
+
o.setRowPinning((a) => {
|
|
2305
|
+
var d, u;
|
|
2306
|
+
if (t === "bottom") {
|
|
2307
|
+
var f, g;
|
|
2308
|
+
return {
|
|
2309
|
+
top: ((f = a?.top) != null ? f : []).filter((m) => !(l != null && l.has(m))),
|
|
2310
|
+
bottom: [...((g = a?.bottom) != null ? g : []).filter((m) => !(l != null && l.has(m))), ...Array.from(l)]
|
|
2311
|
+
};
|
|
2312
|
+
}
|
|
2313
|
+
if (t === "top") {
|
|
2314
|
+
var c, p;
|
|
2315
|
+
return {
|
|
2316
|
+
top: [...((c = a?.top) != null ? c : []).filter((m) => !(l != null && l.has(m))), ...Array.from(l)],
|
|
2317
|
+
bottom: ((p = a?.bottom) != null ? p : []).filter((m) => !(l != null && l.has(m)))
|
|
2318
|
+
};
|
|
2319
|
+
}
|
|
2320
|
+
return {
|
|
2321
|
+
top: ((d = a?.top) != null ? d : []).filter((m) => !(l != null && l.has(m))),
|
|
2322
|
+
bottom: ((u = a?.bottom) != null ? u : []).filter((m) => !(l != null && l.has(m)))
|
|
2323
|
+
};
|
|
2324
|
+
});
|
|
2325
|
+
}, e.getCanPin = () => {
|
|
2326
|
+
var t;
|
|
2327
|
+
const {
|
|
2328
|
+
enableRowPinning: n,
|
|
2329
|
+
enablePinning: i
|
|
2330
|
+
} = o.options;
|
|
2331
|
+
return typeof n == "function" ? n(e) : (t = n ?? i) != null ? t : !0;
|
|
2332
|
+
}, e.getIsPinned = () => {
|
|
2333
|
+
const t = [e.id], {
|
|
2334
|
+
top: n,
|
|
2335
|
+
bottom: i
|
|
2336
|
+
} = o.getState().rowPinning, r = t.some((l) => n?.includes(l)), s = t.some((l) => i?.includes(l));
|
|
2337
|
+
return r ? "top" : s ? "bottom" : !1;
|
|
2338
|
+
}, e.getPinnedIndex = () => {
|
|
2339
|
+
var t, n;
|
|
2340
|
+
const i = e.getIsPinned();
|
|
2341
|
+
if (!i) return -1;
|
|
2342
|
+
const r = (t = i === "top" ? o.getTopRows() : o.getBottomRows()) == null ? void 0 : t.map((s) => {
|
|
2343
|
+
let {
|
|
2344
|
+
id: l
|
|
2345
|
+
} = s;
|
|
2346
|
+
return l;
|
|
2347
|
+
});
|
|
2348
|
+
return (n = r?.indexOf(e.id)) != null ? n : -1;
|
|
2349
|
+
};
|
|
2350
|
+
},
|
|
2351
|
+
createTable: (e) => {
|
|
2352
|
+
e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
|
|
2353
|
+
var t, n;
|
|
2354
|
+
return e.setRowPinning(o ? _e() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : _e());
|
|
2355
|
+
}, e.getIsSomeRowsPinned = (o) => {
|
|
2356
|
+
var t;
|
|
2357
|
+
const n = e.getState().rowPinning;
|
|
2358
|
+
if (!o) {
|
|
2359
|
+
var i, r;
|
|
2360
|
+
return !!((i = n.top) != null && i.length || (r = n.bottom) != null && r.length);
|
|
2361
|
+
}
|
|
2362
|
+
return !!((t = n[o]) != null && t.length);
|
|
2363
|
+
}, e._getPinnedRows = (o, t, n) => {
|
|
2364
|
+
var i;
|
|
2365
|
+
return ((i = e.options.keepPinnedRows) == null || i ? (
|
|
2366
|
+
//get all rows that are pinned even if they would not be otherwise visible
|
|
2367
|
+
//account for expanded parent rows, but not pagination or filtering
|
|
2368
|
+
(t ?? []).map((s) => {
|
|
2369
|
+
const l = e.getRow(s, !0);
|
|
2370
|
+
return l.getIsAllParentsExpanded() ? l : null;
|
|
2371
|
+
})
|
|
2372
|
+
) : (
|
|
2373
|
+
//else get only visible rows that are pinned
|
|
2374
|
+
(t ?? []).map((s) => o.find((l) => l.id === s))
|
|
2375
|
+
)).filter(Boolean).map((s) => ({
|
|
2376
|
+
...s,
|
|
2377
|
+
position: n
|
|
2378
|
+
}));
|
|
2379
|
+
}, e.getTopRows = F(() => [e.getRowModel().rows, e.getState().rowPinning.top], (o, t) => e._getPinnedRows(o, t, "top"), b(e.options, "debugRows", "getTopRows")), e.getBottomRows = F(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (o, t) => e._getPinnedRows(o, t, "bottom"), b(e.options, "debugRows", "getBottomRows")), e.getCenterRows = F(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (o, t, n) => {
|
|
2380
|
+
const i = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
|
|
2381
|
+
return o.filter((r) => !i.has(r.id));
|
|
2382
|
+
}, b(e.options, "debugRows", "getCenterRows"));
|
|
2383
|
+
}
|
|
2384
|
+
}, Bo = {
|
|
2385
|
+
getInitialState: (e) => ({
|
|
2386
|
+
rowSelection: {},
|
|
2387
|
+
...e
|
|
2388
|
+
}),
|
|
2389
|
+
getDefaultOptions: (e) => ({
|
|
2390
|
+
onRowSelectionChange: N("rowSelection", e),
|
|
2391
|
+
enableRowSelection: !0,
|
|
2392
|
+
enableMultiRowSelection: !0,
|
|
2393
|
+
enableSubRowSelection: !0
|
|
2394
|
+
// enableGroupingRowSelection: false,
|
|
2395
|
+
// isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,
|
|
2396
|
+
// isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
|
|
2397
|
+
}),
|
|
2398
|
+
createTable: (e) => {
|
|
2399
|
+
e.setRowSelection = (o) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(o), e.resetRowSelection = (o) => {
|
|
2400
|
+
var t;
|
|
2401
|
+
return e.setRowSelection(o ? {} : (t = e.initialState.rowSelection) != null ? t : {});
|
|
2402
|
+
}, e.toggleAllRowsSelected = (o) => {
|
|
2403
|
+
e.setRowSelection((t) => {
|
|
2404
|
+
o = typeof o < "u" ? o : !e.getIsAllRowsSelected();
|
|
2405
|
+
const n = {
|
|
2406
|
+
...t
|
|
2407
|
+
}, i = e.getPreGroupedRowModel().flatRows;
|
|
2408
|
+
return o ? i.forEach((r) => {
|
|
2409
|
+
r.getCanSelect() && (n[r.id] = !0);
|
|
2410
|
+
}) : i.forEach((r) => {
|
|
2411
|
+
delete n[r.id];
|
|
2412
|
+
}), n;
|
|
2413
|
+
});
|
|
2414
|
+
}, e.toggleAllPageRowsSelected = (o) => e.setRowSelection((t) => {
|
|
2415
|
+
const n = typeof o < "u" ? o : !e.getIsAllPageRowsSelected(), i = {
|
|
2416
|
+
...t
|
|
2417
|
+
};
|
|
2418
|
+
return e.getRowModel().rows.forEach((r) => {
|
|
2419
|
+
Ge(i, r.id, n, !0, e);
|
|
2420
|
+
}), i;
|
|
2421
|
+
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = F(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? De(e, t) : {
|
|
2422
|
+
rows: [],
|
|
2423
|
+
flatRows: [],
|
|
2424
|
+
rowsById: {}
|
|
2425
|
+
}, b(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = F(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? De(e, t) : {
|
|
2426
|
+
rows: [],
|
|
2427
|
+
flatRows: [],
|
|
2428
|
+
rowsById: {}
|
|
2429
|
+
}, b(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = F(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? De(e, t) : {
|
|
2430
|
+
rows: [],
|
|
2431
|
+
flatRows: [],
|
|
2432
|
+
rowsById: {}
|
|
2433
|
+
}, b(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
|
|
2434
|
+
const o = e.getFilteredRowModel().flatRows, {
|
|
2435
|
+
rowSelection: t
|
|
2436
|
+
} = e.getState();
|
|
2437
|
+
let n = !!(o.length && Object.keys(t).length);
|
|
2438
|
+
return n && o.some((i) => i.getCanSelect() && !t[i.id]) && (n = !1), n;
|
|
2439
|
+
}, e.getIsAllPageRowsSelected = () => {
|
|
2440
|
+
const o = e.getPaginationRowModel().flatRows.filter((i) => i.getCanSelect()), {
|
|
2441
|
+
rowSelection: t
|
|
2442
|
+
} = e.getState();
|
|
2443
|
+
let n = !!o.length;
|
|
2444
|
+
return n && o.some((i) => !t[i.id]) && (n = !1), n;
|
|
2445
|
+
}, e.getIsSomeRowsSelected = () => {
|
|
2446
|
+
var o;
|
|
2447
|
+
const t = Object.keys((o = e.getState().rowSelection) != null ? o : {}).length;
|
|
2448
|
+
return t > 0 && t < e.getFilteredRowModel().flatRows.length;
|
|
2449
|
+
}, e.getIsSomePageRowsSelected = () => {
|
|
2450
|
+
const o = e.getPaginationRowModel().flatRows;
|
|
2451
|
+
return e.getIsAllPageRowsSelected() ? !1 : o.filter((t) => t.getCanSelect()).some((t) => t.getIsSelected() || t.getIsSomeSelected());
|
|
2452
|
+
}, e.getToggleAllRowsSelectedHandler = () => (o) => {
|
|
2453
|
+
e.toggleAllRowsSelected(o.target.checked);
|
|
2454
|
+
}, e.getToggleAllPageRowsSelectedHandler = () => (o) => {
|
|
2455
|
+
e.toggleAllPageRowsSelected(o.target.checked);
|
|
2456
|
+
};
|
|
2457
|
+
},
|
|
2458
|
+
createRow: (e, o) => {
|
|
2459
|
+
e.toggleSelected = (t, n) => {
|
|
2460
|
+
const i = e.getIsSelected();
|
|
2461
|
+
o.setRowSelection((r) => {
|
|
2462
|
+
var s;
|
|
2463
|
+
if (t = typeof t < "u" ? t : !i, e.getCanSelect() && i === t)
|
|
2464
|
+
return r;
|
|
2465
|
+
const l = {
|
|
2466
|
+
...r
|
|
2467
|
+
};
|
|
2468
|
+
return Ge(l, e.id, t, (s = n?.selectChildren) != null ? s : !0, o), l;
|
|
2469
|
+
});
|
|
2470
|
+
}, e.getIsSelected = () => {
|
|
2471
|
+
const {
|
|
2472
|
+
rowSelection: t
|
|
2473
|
+
} = o.getState();
|
|
2474
|
+
return Je(e, t);
|
|
2475
|
+
}, e.getIsSomeSelected = () => {
|
|
2476
|
+
const {
|
|
2477
|
+
rowSelection: t
|
|
2478
|
+
} = o.getState();
|
|
2479
|
+
return Ne(e, t) === "some";
|
|
2480
|
+
}, e.getIsAllSubRowsSelected = () => {
|
|
2481
|
+
const {
|
|
2482
|
+
rowSelection: t
|
|
2483
|
+
} = o.getState();
|
|
2484
|
+
return Ne(e, t) === "all";
|
|
2485
|
+
}, e.getCanSelect = () => {
|
|
2486
|
+
var t;
|
|
2487
|
+
return typeof o.options.enableRowSelection == "function" ? o.options.enableRowSelection(e) : (t = o.options.enableRowSelection) != null ? t : !0;
|
|
2488
|
+
}, e.getCanSelectSubRows = () => {
|
|
2489
|
+
var t;
|
|
2490
|
+
return typeof o.options.enableSubRowSelection == "function" ? o.options.enableSubRowSelection(e) : (t = o.options.enableSubRowSelection) != null ? t : !0;
|
|
2491
|
+
}, e.getCanMultiSelect = () => {
|
|
2492
|
+
var t;
|
|
2493
|
+
return typeof o.options.enableMultiRowSelection == "function" ? o.options.enableMultiRowSelection(e) : (t = o.options.enableMultiRowSelection) != null ? t : !0;
|
|
2494
|
+
}, e.getToggleSelectedHandler = () => {
|
|
2495
|
+
const t = e.getCanSelect();
|
|
2496
|
+
return (n) => {
|
|
2497
|
+
var i;
|
|
2498
|
+
t && e.toggleSelected((i = n.target) == null ? void 0 : i.checked);
|
|
2499
|
+
};
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
2502
|
+
}, Ge = (e, o, t, n, i) => {
|
|
2503
|
+
var r;
|
|
2504
|
+
const s = i.getRow(o, !0);
|
|
2505
|
+
t ? (s.getCanMultiSelect() || Object.keys(e).forEach((l) => delete e[l]), s.getCanSelect() && (e[o] = !0)) : delete e[o], n && (r = s.subRows) != null && r.length && s.getCanSelectSubRows() && s.subRows.forEach((l) => Ge(e, l.id, t, n, i));
|
|
2506
|
+
};
|
|
2507
|
+
function De(e, o) {
|
|
2508
|
+
const t = e.getState().rowSelection, n = [], i = {}, r = function(s, l) {
|
|
2509
|
+
return s.map((a) => {
|
|
2510
|
+
var d;
|
|
2511
|
+
const u = Je(a, t);
|
|
2512
|
+
if (u && (n.push(a), i[a.id] = a), (d = a.subRows) != null && d.length && (a = {
|
|
2513
|
+
...a,
|
|
2514
|
+
subRows: r(a.subRows)
|
|
2515
|
+
}), u)
|
|
2516
|
+
return a;
|
|
2517
|
+
}).filter(Boolean);
|
|
2518
|
+
};
|
|
2519
|
+
return {
|
|
2520
|
+
rows: r(o.rows),
|
|
2521
|
+
flatRows: n,
|
|
2522
|
+
rowsById: i
|
|
2523
|
+
};
|
|
2524
|
+
}
|
|
2525
|
+
function Je(e, o) {
|
|
2526
|
+
var t;
|
|
2527
|
+
return (t = o[e.id]) != null ? t : !1;
|
|
2528
|
+
}
|
|
2529
|
+
function Ne(e, o, t) {
|
|
2530
|
+
var n;
|
|
2531
|
+
if (!((n = e.subRows) != null && n.length)) return !1;
|
|
2532
|
+
let i = !0, r = !1;
|
|
2533
|
+
return e.subRows.forEach((s) => {
|
|
2534
|
+
if (!(r && !i) && (s.getCanSelect() && (Je(s, o) ? r = !0 : i = !1), s.subRows && s.subRows.length)) {
|
|
2535
|
+
const l = Ne(s, o);
|
|
2536
|
+
l === "all" ? r = !0 : (l === "some" && (r = !0), i = !1);
|
|
2537
|
+
}
|
|
2538
|
+
}), i ? "all" : r ? "some" : !1;
|
|
2539
|
+
}
|
|
2540
|
+
const je = /([0-9]+)/gm, Ho = (e, o, t) => zt(Y(e.getValue(t)).toLowerCase(), Y(o.getValue(t)).toLowerCase()), zo = (e, o, t) => zt(Y(e.getValue(t)), Y(o.getValue(t))), Go = (e, o, t) => Ze(Y(e.getValue(t)).toLowerCase(), Y(o.getValue(t)).toLowerCase()), No = (e, o, t) => Ze(Y(e.getValue(t)), Y(o.getValue(t))), jo = (e, o, t) => {
|
|
2541
|
+
const n = e.getValue(t), i = o.getValue(t);
|
|
2542
|
+
return n > i ? 1 : n < i ? -1 : 0;
|
|
2543
|
+
}, qo = (e, o, t) => Ze(e.getValue(t), o.getValue(t));
|
|
2544
|
+
function Ze(e, o) {
|
|
2545
|
+
return e === o ? 0 : e > o ? 1 : -1;
|
|
2546
|
+
}
|
|
2547
|
+
function Y(e) {
|
|
2548
|
+
return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
|
|
2549
|
+
}
|
|
2550
|
+
function zt(e, o) {
|
|
2551
|
+
const t = e.split(je).filter(Boolean), n = o.split(je).filter(Boolean);
|
|
2552
|
+
for (; t.length && n.length; ) {
|
|
2553
|
+
const i = t.shift(), r = n.shift(), s = parseInt(i, 10), l = parseInt(r, 10), a = [s, l].sort();
|
|
2554
|
+
if (isNaN(a[0])) {
|
|
2555
|
+
if (i > r)
|
|
2556
|
+
return 1;
|
|
2557
|
+
if (r > i)
|
|
2558
|
+
return -1;
|
|
2559
|
+
continue;
|
|
2560
|
+
}
|
|
2561
|
+
if (isNaN(a[1]))
|
|
2562
|
+
return isNaN(s) ? -1 : 1;
|
|
2563
|
+
if (s > l)
|
|
2564
|
+
return 1;
|
|
2565
|
+
if (l > s)
|
|
2566
|
+
return -1;
|
|
2567
|
+
}
|
|
2568
|
+
return t.length - n.length;
|
|
2569
|
+
}
|
|
2570
|
+
const re = {
|
|
2571
|
+
alphanumeric: Ho,
|
|
2572
|
+
alphanumericCaseSensitive: zo,
|
|
2573
|
+
text: Go,
|
|
2574
|
+
textCaseSensitive: No,
|
|
2575
|
+
datetime: jo,
|
|
2576
|
+
basic: qo
|
|
2577
|
+
}, Uo = {
|
|
2578
|
+
getInitialState: (e) => ({
|
|
2579
|
+
sorting: [],
|
|
2580
|
+
...e
|
|
2581
|
+
}),
|
|
2582
|
+
getDefaultColumnDef: () => ({
|
|
2583
|
+
sortingFn: "auto",
|
|
2584
|
+
sortUndefined: 1
|
|
2585
|
+
}),
|
|
2586
|
+
getDefaultOptions: (e) => ({
|
|
2587
|
+
onSortingChange: N("sorting", e),
|
|
2588
|
+
isMultiSortEvent: (o) => o.shiftKey
|
|
2589
|
+
}),
|
|
2590
|
+
createColumn: (e, o) => {
|
|
2591
|
+
e.getAutoSortingFn = () => {
|
|
2592
|
+
const t = o.getFilteredRowModel().flatRows.slice(10);
|
|
2593
|
+
let n = !1;
|
|
2594
|
+
for (const i of t) {
|
|
2595
|
+
const r = i?.getValue(e.id);
|
|
2596
|
+
if (Object.prototype.toString.call(r) === "[object Date]")
|
|
2597
|
+
return re.datetime;
|
|
2598
|
+
if (typeof r == "string" && (n = !0, r.split(je).length > 1))
|
|
2599
|
+
return re.alphanumeric;
|
|
2600
|
+
}
|
|
2601
|
+
return n ? re.text : re.basic;
|
|
2602
|
+
}, e.getAutoSortDir = () => {
|
|
2603
|
+
const t = o.getFilteredRowModel().flatRows[0];
|
|
2604
|
+
return typeof t?.getValue(e.id) == "string" ? "asc" : "desc";
|
|
2605
|
+
}, e.getSortingFn = () => {
|
|
2606
|
+
var t, n;
|
|
2607
|
+
if (!e)
|
|
2608
|
+
throw new Error();
|
|
2609
|
+
return Re(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 : re[e.columnDef.sortingFn];
|
|
2610
|
+
}, e.toggleSorting = (t, n) => {
|
|
2611
|
+
const i = e.getNextSortingOrder(), r = typeof t < "u" && t !== null;
|
|
2612
|
+
o.setSorting((s) => {
|
|
2613
|
+
const l = s?.find((c) => c.id === e.id), a = s?.findIndex((c) => c.id === e.id);
|
|
2614
|
+
let d = [], u, f = r ? t : i === "desc";
|
|
2615
|
+
if (s != null && s.length && e.getCanMultiSort() && n ? l ? u = "toggle" : u = "add" : s != null && s.length && a !== s.length - 1 ? u = "replace" : l ? u = "toggle" : u = "replace", u === "toggle" && (r || i || (u = "remove")), u === "add") {
|
|
2616
|
+
var g;
|
|
2617
|
+
d = [...s, {
|
|
2618
|
+
id: e.id,
|
|
2619
|
+
desc: f
|
|
2620
|
+
}], d.splice(0, d.length - ((g = o.options.maxMultiSortColCount) != null ? g : Number.MAX_SAFE_INTEGER));
|
|
2621
|
+
} else u === "toggle" ? d = s.map((c) => c.id === e.id ? {
|
|
2622
|
+
...c,
|
|
2623
|
+
desc: f
|
|
2624
|
+
} : c) : u === "remove" ? d = s.filter((c) => c.id !== e.id) : d = [{
|
|
2625
|
+
id: e.id,
|
|
2626
|
+
desc: f
|
|
2627
|
+
}];
|
|
2628
|
+
return d;
|
|
2629
|
+
});
|
|
2630
|
+
}, e.getFirstSortDir = () => {
|
|
2631
|
+
var t, n;
|
|
2632
|
+
return ((t = (n = e.columnDef.sortDescFirst) != null ? n : o.options.sortDescFirst) != null ? t : e.getAutoSortDir() === "desc") ? "desc" : "asc";
|
|
2633
|
+
}, e.getNextSortingOrder = (t) => {
|
|
2634
|
+
var n, i;
|
|
2635
|
+
const r = e.getFirstSortDir(), s = e.getIsSorted();
|
|
2636
|
+
return s ? s !== r && ((n = o.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
|
|
2637
|
+
(!(t && (i = o.options.enableMultiRemove) != null) || i) ? !1 : s === "desc" ? "asc" : "desc" : r;
|
|
2638
|
+
}, e.getCanSort = () => {
|
|
2639
|
+
var t, n;
|
|
2640
|
+
return ((t = e.columnDef.enableSorting) != null ? t : !0) && ((n = o.options.enableSorting) != null ? n : !0) && !!e.accessorFn;
|
|
2641
|
+
}, e.getCanMultiSort = () => {
|
|
2642
|
+
var t, n;
|
|
2643
|
+
return (t = (n = e.columnDef.enableMultiSort) != null ? n : o.options.enableMultiSort) != null ? t : !!e.accessorFn;
|
|
2644
|
+
}, e.getIsSorted = () => {
|
|
2645
|
+
var t;
|
|
2646
|
+
const n = (t = o.getState().sorting) == null ? void 0 : t.find((i) => i.id === e.id);
|
|
2647
|
+
return n ? n.desc ? "desc" : "asc" : !1;
|
|
2648
|
+
}, e.getSortIndex = () => {
|
|
2649
|
+
var t, n;
|
|
2650
|
+
return (t = (n = o.getState().sorting) == null ? void 0 : n.findIndex((i) => i.id === e.id)) != null ? t : -1;
|
|
2651
|
+
}, e.clearSorting = () => {
|
|
2652
|
+
o.setSorting((t) => t != null && t.length ? t.filter((n) => n.id !== e.id) : []);
|
|
2653
|
+
}, e.getToggleSortingHandler = () => {
|
|
2654
|
+
const t = e.getCanSort();
|
|
2655
|
+
return (n) => {
|
|
2656
|
+
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));
|
|
2657
|
+
};
|
|
2658
|
+
};
|
|
2659
|
+
},
|
|
2660
|
+
createTable: (e) => {
|
|
2661
|
+
e.setSorting = (o) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(o), e.resetSorting = (o) => {
|
|
2662
|
+
var t, n;
|
|
2663
|
+
e.setSorting(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
|
|
2664
|
+
}, 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());
|
|
2665
|
+
}
|
|
2666
|
+
}, Ko = [
|
|
2667
|
+
mo,
|
|
2668
|
+
Mo,
|
|
2669
|
+
Vo,
|
|
2670
|
+
_o,
|
|
2671
|
+
ho,
|
|
2672
|
+
vo,
|
|
2673
|
+
ko,
|
|
2674
|
+
//depends on ColumnFaceting
|
|
2675
|
+
Eo,
|
|
2676
|
+
//depends on ColumnFiltering
|
|
2677
|
+
Uo,
|
|
2678
|
+
Io,
|
|
2679
|
+
//depends on RowSorting
|
|
2680
|
+
Lo,
|
|
2681
|
+
Oo,
|
|
2682
|
+
To,
|
|
2683
|
+
Bo,
|
|
2684
|
+
Do
|
|
2685
|
+
];
|
|
2686
|
+
function Wo(e) {
|
|
2687
|
+
var o, t;
|
|
2688
|
+
process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
|
|
2689
|
+
const n = [...Ko, ...(o = e._features) != null ? o : []];
|
|
2690
|
+
let i = {
|
|
2691
|
+
_features: n
|
|
2692
|
+
};
|
|
2693
|
+
const r = i._features.reduce((g, c) => Object.assign(g, c.getDefaultOptions == null ? void 0 : c.getDefaultOptions(i)), {}), s = (g) => i.options.mergeOptions ? i.options.mergeOptions(r, g) : {
|
|
2694
|
+
...r,
|
|
2695
|
+
...g
|
|
2696
|
+
};
|
|
2697
|
+
let a = {
|
|
2698
|
+
...{},
|
|
2699
|
+
...(t = e.initialState) != null ? t : {}
|
|
2700
|
+
};
|
|
2701
|
+
i._features.forEach((g) => {
|
|
2702
|
+
var c;
|
|
2703
|
+
a = (c = g.getInitialState == null ? void 0 : g.getInitialState(a)) != null ? c : a;
|
|
2704
|
+
});
|
|
2705
|
+
const d = [];
|
|
2706
|
+
let u = !1;
|
|
2707
|
+
const f = {
|
|
2708
|
+
_features: n,
|
|
2709
|
+
options: {
|
|
2710
|
+
...r,
|
|
2711
|
+
...e
|
|
2712
|
+
},
|
|
2713
|
+
initialState: a,
|
|
2714
|
+
_queue: (g) => {
|
|
2715
|
+
d.push(g), u || (u = !0, Promise.resolve().then(() => {
|
|
2716
|
+
for (; d.length; )
|
|
2717
|
+
d.shift()();
|
|
2718
|
+
u = !1;
|
|
2719
|
+
}).catch((c) => setTimeout(() => {
|
|
2720
|
+
throw c;
|
|
2721
|
+
})));
|
|
2722
|
+
},
|
|
2723
|
+
reset: () => {
|
|
2724
|
+
i.setState(i.initialState);
|
|
2725
|
+
},
|
|
2726
|
+
setOptions: (g) => {
|
|
2727
|
+
const c = Z(g, i.options);
|
|
2728
|
+
i.options = s(c);
|
|
2729
|
+
},
|
|
2730
|
+
getState: () => i.options.state,
|
|
2731
|
+
setState: (g) => {
|
|
2732
|
+
i.options.onStateChange == null || i.options.onStateChange(g);
|
|
2733
|
+
},
|
|
2734
|
+
_getRowId: (g, c, p) => {
|
|
2735
|
+
var m;
|
|
2736
|
+
return (m = i.options.getRowId == null ? void 0 : i.options.getRowId(g, c, p)) != null ? m : `${p ? [p.id, c].join(".") : c}`;
|
|
2737
|
+
},
|
|
2738
|
+
getCoreRowModel: () => (i._getCoreRowModel || (i._getCoreRowModel = i.options.getCoreRowModel(i)), i._getCoreRowModel()),
|
|
2739
|
+
// The final calls start at the bottom of the model,
|
|
2740
|
+
// expanded rows, which then work their way up
|
|
2741
|
+
getRowModel: () => i.getPaginationRowModel(),
|
|
2742
|
+
//in next version, we should just pass in the row model as the optional 2nd arg
|
|
2743
|
+
getRow: (g, c) => {
|
|
2744
|
+
let p = (c ? i.getPrePaginationRowModel() : i.getRowModel()).rowsById[g];
|
|
2745
|
+
if (!p && (p = i.getCoreRowModel().rowsById[g], !p))
|
|
2746
|
+
throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${g}`) : new Error();
|
|
2747
|
+
return p;
|
|
2748
|
+
},
|
|
2749
|
+
_getDefaultColumnDef: F(() => [i.options.defaultColumn], (g) => {
|
|
2750
|
+
var c;
|
|
2751
|
+
return g = (c = g) != null ? c : {}, {
|
|
2752
|
+
header: (p) => {
|
|
2753
|
+
const m = p.header.column.columnDef;
|
|
2754
|
+
return m.accessorKey ? m.accessorKey : m.accessorFn ? m.id : null;
|
|
2755
|
+
},
|
|
2756
|
+
// footer: props => props.header.column.id,
|
|
2757
|
+
cell: (p) => {
|
|
2758
|
+
var m, h;
|
|
2759
|
+
return (m = (h = p.renderValue()) == null || h.toString == null ? void 0 : h.toString()) != null ? m : null;
|
|
2760
|
+
},
|
|
2761
|
+
...i._features.reduce((p, m) => Object.assign(p, m.getDefaultColumnDef == null ? void 0 : m.getDefaultColumnDef()), {}),
|
|
2762
|
+
...g
|
|
2763
|
+
};
|
|
2764
|
+
}, b(e, "debugColumns", "_getDefaultColumnDef")),
|
|
2765
|
+
_getColumnDefs: () => i.options.columns,
|
|
2766
|
+
getAllColumns: F(() => [i._getColumnDefs()], (g) => {
|
|
2767
|
+
const c = function(p, m, h) {
|
|
2768
|
+
return h === void 0 && (h = 0), p.map((R) => {
|
|
2769
|
+
const $ = po(i, R, h, m), P = R;
|
|
2770
|
+
return $.columns = P.columns ? c(P.columns, $, h + 1) : [], $;
|
|
2771
|
+
});
|
|
2772
|
+
};
|
|
2773
|
+
return c(g);
|
|
2774
|
+
}, b(e, "debugColumns", "getAllColumns")),
|
|
2775
|
+
getAllFlatColumns: F(() => [i.getAllColumns()], (g) => g.flatMap((c) => c.getFlatColumns()), b(e, "debugColumns", "getAllFlatColumns")),
|
|
2776
|
+
_getAllFlatColumnsById: F(() => [i.getAllFlatColumns()], (g) => g.reduce((c, p) => (c[p.id] = p, c), {}), b(e, "debugColumns", "getAllFlatColumnsById")),
|
|
2777
|
+
getAllLeafColumns: F(() => [i.getAllColumns(), i._getOrderColumnsFn()], (g, c) => {
|
|
2778
|
+
let p = g.flatMap((m) => m.getLeafColumns());
|
|
2779
|
+
return c(p);
|
|
2780
|
+
}, b(e, "debugColumns", "getAllLeafColumns")),
|
|
2781
|
+
getColumn: (g) => {
|
|
2782
|
+
const c = i._getAllFlatColumnsById()[g];
|
|
2783
|
+
return process.env.NODE_ENV !== "production" && !c && console.error(`[Table] Column with id '${g}' does not exist.`), c;
|
|
2784
|
+
}
|
|
2785
|
+
};
|
|
2786
|
+
Object.assign(i, f);
|
|
2787
|
+
for (let g = 0; g < i._features.length; g++) {
|
|
2788
|
+
const c = i._features[g];
|
|
2789
|
+
c == null || c.createTable == null || c.createTable(i);
|
|
2790
|
+
}
|
|
2791
|
+
return i;
|
|
2792
|
+
}
|
|
2793
|
+
function Gt() {
|
|
2794
|
+
return (e) => F(() => [e.options.data], (o) => {
|
|
2795
|
+
const t = {
|
|
2796
|
+
rows: [],
|
|
2797
|
+
flatRows: [],
|
|
2798
|
+
rowsById: {}
|
|
2799
|
+
}, n = function(i, r, s) {
|
|
2800
|
+
r === void 0 && (r = 0);
|
|
2801
|
+
const l = [];
|
|
2802
|
+
for (let d = 0; d < i.length; d++) {
|
|
2803
|
+
const u = Xe(e, e._getRowId(i[d], d, s), i[d], d, r, void 0, s?.id);
|
|
2804
|
+
if (t.flatRows.push(u), t.rowsById[u.id] = u, l.push(u), e.options.getSubRows) {
|
|
2805
|
+
var a;
|
|
2806
|
+
u.originalSubRows = e.options.getSubRows(i[d], d), (a = u.originalSubRows) != null && a.length && (u.subRows = n(u.originalSubRows, r + 1, u));
|
|
2807
|
+
}
|
|
2808
|
+
}
|
|
2809
|
+
return l;
|
|
2810
|
+
};
|
|
2811
|
+
return t.rows = n(o), t;
|
|
2812
|
+
}, b(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
|
|
2813
|
+
}
|
|
2814
|
+
function Xo(e) {
|
|
2815
|
+
const o = [], t = (n) => {
|
|
2816
|
+
var i;
|
|
2817
|
+
o.push(n), (i = n.subRows) != null && i.length && n.getIsExpanded() && n.subRows.forEach(t);
|
|
2818
|
+
};
|
|
2819
|
+
return e.rows.forEach(t), {
|
|
2820
|
+
rows: o,
|
|
2821
|
+
flatRows: e.flatRows,
|
|
2822
|
+
rowsById: e.rowsById
|
|
2823
|
+
};
|
|
2824
|
+
}
|
|
2825
|
+
function Qo(e, o, t) {
|
|
2826
|
+
return t.options.filterFromLeafRows ? Jo(e, o, t) : Zo(e, o, t);
|
|
2827
|
+
}
|
|
2828
|
+
function Jo(e, o, t) {
|
|
2829
|
+
var n;
|
|
2830
|
+
const i = [], r = {}, s = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, l = function(a, d) {
|
|
2831
|
+
d === void 0 && (d = 0);
|
|
2832
|
+
const u = [];
|
|
2833
|
+
for (let g = 0; g < a.length; g++) {
|
|
2834
|
+
var f;
|
|
2835
|
+
let c = a[g];
|
|
2836
|
+
const p = Xe(t, c.id, c.original, c.index, c.depth, void 0, c.parentId);
|
|
2837
|
+
if (p.columnFilters = c.columnFilters, (f = c.subRows) != null && f.length && d < s) {
|
|
2838
|
+
if (p.subRows = l(c.subRows, d + 1), c = p, o(c) && !p.subRows.length) {
|
|
2839
|
+
u.push(c), r[c.id] = c, i.push(c);
|
|
2840
|
+
continue;
|
|
2841
|
+
}
|
|
2842
|
+
if (o(c) || p.subRows.length) {
|
|
2843
|
+
u.push(c), r[c.id] = c, i.push(c);
|
|
2844
|
+
continue;
|
|
2845
|
+
}
|
|
2846
|
+
} else
|
|
2847
|
+
c = p, o(c) && (u.push(c), r[c.id] = c, i.push(c));
|
|
2848
|
+
}
|
|
2849
|
+
return u;
|
|
2850
|
+
};
|
|
2851
|
+
return {
|
|
2852
|
+
rows: l(e),
|
|
2853
|
+
flatRows: i,
|
|
2854
|
+
rowsById: r
|
|
2855
|
+
};
|
|
2856
|
+
}
|
|
2857
|
+
function Zo(e, o, t) {
|
|
2858
|
+
var n;
|
|
2859
|
+
const i = [], r = {}, s = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, l = function(a, d) {
|
|
2860
|
+
d === void 0 && (d = 0);
|
|
2861
|
+
const u = [];
|
|
2862
|
+
for (let g = 0; g < a.length; g++) {
|
|
2863
|
+
let c = a[g];
|
|
2864
|
+
if (o(c)) {
|
|
2865
|
+
var f;
|
|
2866
|
+
if ((f = c.subRows) != null && f.length && d < s) {
|
|
2867
|
+
const m = Xe(t, c.id, c.original, c.index, c.depth, void 0, c.parentId);
|
|
2868
|
+
m.subRows = l(c.subRows, d + 1), c = m;
|
|
2869
|
+
}
|
|
2870
|
+
u.push(c), i.push(c), r[c.id] = c;
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
return u;
|
|
2874
|
+
};
|
|
2875
|
+
return {
|
|
2876
|
+
rows: l(e),
|
|
2877
|
+
flatRows: i,
|
|
2878
|
+
rowsById: r
|
|
2879
|
+
};
|
|
2880
|
+
}
|
|
2881
|
+
function Nt() {
|
|
2882
|
+
return (e) => F(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
|
|
2883
|
+
if (!o.rows.length || !(t != null && t.length) && !n) {
|
|
2884
|
+
for (let g = 0; g < o.flatRows.length; g++)
|
|
2885
|
+
o.flatRows[g].columnFilters = {}, o.flatRows[g].columnFiltersMeta = {};
|
|
2886
|
+
return o;
|
|
2887
|
+
}
|
|
2888
|
+
const i = [], r = [];
|
|
2889
|
+
(t ?? []).forEach((g) => {
|
|
2890
|
+
var c;
|
|
2891
|
+
const p = e.getColumn(g.id);
|
|
2892
|
+
if (!p)
|
|
2893
|
+
return;
|
|
2894
|
+
const m = p.getFilterFn();
|
|
2895
|
+
if (!m) {
|
|
2896
|
+
process.env.NODE_ENV !== "production" && console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${p.id}.`);
|
|
2897
|
+
return;
|
|
2898
|
+
}
|
|
2899
|
+
i.push({
|
|
2900
|
+
id: g.id,
|
|
2901
|
+
filterFn: m,
|
|
2902
|
+
resolvedValue: (c = m.resolveFilterValue == null ? void 0 : m.resolveFilterValue(g.value)) != null ? c : g.value
|
|
2903
|
+
});
|
|
2904
|
+
});
|
|
2905
|
+
const s = (t ?? []).map((g) => g.id), l = e.getGlobalFilterFn(), a = e.getAllLeafColumns().filter((g) => g.getCanGlobalFilter());
|
|
2906
|
+
n && l && a.length && (s.push("__global__"), a.forEach((g) => {
|
|
2907
|
+
var c;
|
|
2908
|
+
r.push({
|
|
2909
|
+
id: g.id,
|
|
2910
|
+
filterFn: l,
|
|
2911
|
+
resolvedValue: (c = l.resolveFilterValue == null ? void 0 : l.resolveFilterValue(n)) != null ? c : n
|
|
2912
|
+
});
|
|
2913
|
+
}));
|
|
2914
|
+
let d, u;
|
|
2915
|
+
for (let g = 0; g < o.flatRows.length; g++) {
|
|
2916
|
+
const c = o.flatRows[g];
|
|
2917
|
+
if (c.columnFilters = {}, i.length)
|
|
2918
|
+
for (let p = 0; p < i.length; p++) {
|
|
2919
|
+
d = i[p];
|
|
2920
|
+
const m = d.id;
|
|
2921
|
+
c.columnFilters[m] = d.filterFn(c, m, d.resolvedValue, (h) => {
|
|
2922
|
+
c.columnFiltersMeta[m] = h;
|
|
2923
|
+
});
|
|
2924
|
+
}
|
|
2925
|
+
if (r.length) {
|
|
2926
|
+
for (let p = 0; p < r.length; p++) {
|
|
2927
|
+
u = r[p];
|
|
2928
|
+
const m = u.id;
|
|
2929
|
+
if (u.filterFn(c, m, u.resolvedValue, (h) => {
|
|
2930
|
+
c.columnFiltersMeta[m] = h;
|
|
2931
|
+
})) {
|
|
2932
|
+
c.columnFilters.__global__ = !0;
|
|
2933
|
+
break;
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
c.columnFilters.__global__ !== !0 && (c.columnFilters.__global__ = !1);
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2939
|
+
const f = (g) => {
|
|
2940
|
+
for (let c = 0; c < s.length; c++)
|
|
2941
|
+
if (g.columnFilters[s[c]] === !1)
|
|
2942
|
+
return !1;
|
|
2943
|
+
return !0;
|
|
2944
|
+
};
|
|
2945
|
+
return Qo(o.rows, f, e);
|
|
2946
|
+
}, b(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
|
|
2947
|
+
}
|
|
2948
|
+
function jt(e) {
|
|
2949
|
+
return (o) => F(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
|
|
2950
|
+
if (!n.rows.length)
|
|
2951
|
+
return n;
|
|
2952
|
+
const {
|
|
2953
|
+
pageSize: i,
|
|
2954
|
+
pageIndex: r
|
|
2955
|
+
} = t;
|
|
2956
|
+
let {
|
|
2957
|
+
rows: s,
|
|
2958
|
+
flatRows: l,
|
|
2959
|
+
rowsById: a
|
|
2960
|
+
} = n;
|
|
2961
|
+
const d = i * r, u = d + i;
|
|
2962
|
+
s = s.slice(d, u);
|
|
2963
|
+
let f;
|
|
2964
|
+
o.options.paginateExpandedRows ? f = {
|
|
2965
|
+
rows: s,
|
|
2966
|
+
flatRows: l,
|
|
2967
|
+
rowsById: a
|
|
2968
|
+
} : f = Xo({
|
|
2969
|
+
rows: s,
|
|
2970
|
+
flatRows: l,
|
|
2971
|
+
rowsById: a
|
|
2972
|
+
}), f.flatRows = [];
|
|
2973
|
+
const g = (c) => {
|
|
2974
|
+
f.flatRows.push(c), c.subRows.length && c.subRows.forEach(g);
|
|
2975
|
+
};
|
|
2976
|
+
return f.rows.forEach(g), f;
|
|
2977
|
+
}, b(o.options, "debugTable", "getPaginationRowModel"));
|
|
2978
|
+
}
|
|
2979
|
+
function qt() {
|
|
2980
|
+
return (e) => F(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
|
|
2981
|
+
if (!t.rows.length || !(o != null && o.length))
|
|
2982
|
+
return t;
|
|
2983
|
+
const n = e.getState().sorting, i = [], r = n.filter((a) => {
|
|
2984
|
+
var d;
|
|
2985
|
+
return (d = e.getColumn(a.id)) == null ? void 0 : d.getCanSort();
|
|
2986
|
+
}), s = {};
|
|
2987
|
+
r.forEach((a) => {
|
|
2988
|
+
const d = e.getColumn(a.id);
|
|
2989
|
+
d && (s[a.id] = {
|
|
2990
|
+
sortUndefined: d.columnDef.sortUndefined,
|
|
2991
|
+
invertSorting: d.columnDef.invertSorting,
|
|
2992
|
+
sortingFn: d.getSortingFn()
|
|
2993
|
+
});
|
|
2994
|
+
});
|
|
2995
|
+
const l = (a) => {
|
|
2996
|
+
const d = a.map((u) => ({
|
|
2997
|
+
...u
|
|
2998
|
+
}));
|
|
2999
|
+
return d.sort((u, f) => {
|
|
3000
|
+
for (let c = 0; c < r.length; c += 1) {
|
|
3001
|
+
var g;
|
|
3002
|
+
const p = r[c], m = s[p.id], h = m.sortUndefined, R = (g = p?.desc) != null ? g : !1;
|
|
3003
|
+
let $ = 0;
|
|
3004
|
+
if (h) {
|
|
3005
|
+
const P = u.getValue(p.id), D = f.getValue(p.id), v = P === void 0, w = D === void 0;
|
|
3006
|
+
if (v || w) {
|
|
3007
|
+
if (h === "first") return v ? -1 : 1;
|
|
3008
|
+
if (h === "last") return v ? 1 : -1;
|
|
3009
|
+
$ = v && w ? 0 : v ? h : -h;
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
3012
|
+
if ($ === 0 && ($ = m.sortingFn(u, f, p.id)), $ !== 0)
|
|
3013
|
+
return R && ($ *= -1), m.invertSorting && ($ *= -1), $;
|
|
3014
|
+
}
|
|
3015
|
+
return u.index - f.index;
|
|
3016
|
+
}), d.forEach((u) => {
|
|
3017
|
+
var f;
|
|
3018
|
+
i.push(u), (f = u.subRows) != null && f.length && (u.subRows = l(u.subRows));
|
|
3019
|
+
}), d;
|
|
3020
|
+
};
|
|
3021
|
+
return {
|
|
3022
|
+
rows: l(t.rows),
|
|
3023
|
+
flatRows: i,
|
|
3024
|
+
rowsById: t.rowsById
|
|
3025
|
+
};
|
|
3026
|
+
}, b(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
|
|
3027
|
+
}
|
|
3028
|
+
/**
|
|
3029
|
+
* vue-table
|
|
3030
|
+
*
|
|
3031
|
+
* Copyright (c) TanStack
|
|
3032
|
+
*
|
|
3033
|
+
* This source code is licensed under the MIT license found in the
|
|
3034
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
3035
|
+
*
|
|
3036
|
+
* @license MIT
|
|
3037
|
+
*/
|
|
3038
|
+
function pe() {
|
|
3039
|
+
return !0;
|
|
3040
|
+
}
|
|
3041
|
+
const Yo = Symbol("merge-proxy"), ei = {
|
|
3042
|
+
get(e, o, t) {
|
|
3043
|
+
return o === Yo ? t : e.get(o);
|
|
3044
|
+
},
|
|
3045
|
+
has(e, o) {
|
|
3046
|
+
return e.has(o);
|
|
3047
|
+
},
|
|
3048
|
+
set: pe,
|
|
3049
|
+
deleteProperty: pe,
|
|
3050
|
+
getOwnPropertyDescriptor(e, o) {
|
|
3051
|
+
return {
|
|
3052
|
+
configurable: !0,
|
|
3053
|
+
enumerable: !0,
|
|
3054
|
+
get() {
|
|
3055
|
+
return e.get(o);
|
|
3056
|
+
},
|
|
3057
|
+
set: pe,
|
|
3058
|
+
deleteProperty: pe
|
|
3059
|
+
};
|
|
3060
|
+
},
|
|
3061
|
+
ownKeys(e) {
|
|
3062
|
+
return e.keys();
|
|
3063
|
+
}
|
|
3064
|
+
};
|
|
3065
|
+
function Ae(e) {
|
|
3066
|
+
return "value" in e ? e.value : e;
|
|
3067
|
+
}
|
|
3068
|
+
function le() {
|
|
3069
|
+
for (var e = arguments.length, o = new Array(e), t = 0; t < e; t++)
|
|
3070
|
+
o[t] = arguments[t];
|
|
3071
|
+
return new Proxy({
|
|
3072
|
+
get(n) {
|
|
3073
|
+
for (let i = o.length - 1; i >= 0; i--) {
|
|
3074
|
+
const r = Ae(o[i])[n];
|
|
3075
|
+
if (r !== void 0) return r;
|
|
3076
|
+
}
|
|
3077
|
+
},
|
|
3078
|
+
has(n) {
|
|
3079
|
+
for (let i = o.length - 1; i >= 0; i--)
|
|
3080
|
+
if (n in Ae(o[i])) return !0;
|
|
3081
|
+
return !1;
|
|
3082
|
+
},
|
|
3083
|
+
keys() {
|
|
3084
|
+
const n = [];
|
|
3085
|
+
for (let i = 0; i < o.length; i++) n.push(...Object.keys(Ae(o[i])));
|
|
3086
|
+
return [...Array.from(new Set(n))];
|
|
3087
|
+
}
|
|
3088
|
+
}, ei);
|
|
3089
|
+
}
|
|
3090
|
+
const ce = K({
|
|
3091
|
+
props: ["render", "props"],
|
|
3092
|
+
setup: (e) => () => typeof e.render == "function" || typeof e.render == "object" ? W(e.render, e.props) : e.render
|
|
3093
|
+
});
|
|
3094
|
+
function pt(e) {
|
|
3095
|
+
return le(e, {
|
|
3096
|
+
data: C(e.data)
|
|
3097
|
+
});
|
|
3098
|
+
}
|
|
3099
|
+
function Ut(e) {
|
|
3100
|
+
const o = Wt(e.data), t = le({
|
|
3101
|
+
state: {},
|
|
3102
|
+
// Dummy state
|
|
3103
|
+
onStateChange: () => {
|
|
3104
|
+
},
|
|
3105
|
+
// noop
|
|
3106
|
+
renderFallbackValue: null,
|
|
3107
|
+
mergeOptions(r, s) {
|
|
3108
|
+
return o ? {
|
|
3109
|
+
...r,
|
|
3110
|
+
...s
|
|
3111
|
+
} : le(r, s);
|
|
3112
|
+
}
|
|
3113
|
+
}, o ? pt(e) : e), n = Wo(t);
|
|
3114
|
+
if (o) {
|
|
3115
|
+
const r = Xt(e.data);
|
|
3116
|
+
St(r, () => {
|
|
3117
|
+
n.setState((s) => ({
|
|
3118
|
+
...s,
|
|
3119
|
+
data: r.value
|
|
3120
|
+
}));
|
|
3121
|
+
}, {
|
|
3122
|
+
immediate: !0
|
|
3123
|
+
});
|
|
3124
|
+
}
|
|
3125
|
+
const i = j(n.initialState);
|
|
3126
|
+
return Qt(() => {
|
|
3127
|
+
n.setOptions((r) => {
|
|
3128
|
+
var s;
|
|
3129
|
+
const l = new Proxy({}, {
|
|
3130
|
+
get: (a, d) => i.value[d]
|
|
3131
|
+
});
|
|
3132
|
+
return le(r, o ? pt(e) : e, {
|
|
3133
|
+
// merge the initialState and `options.state`
|
|
3134
|
+
// create a new proxy on each `setOptions` call
|
|
3135
|
+
// and get the value from state on each property access
|
|
3136
|
+
state: le(l, (s = e.state) != null ? s : {}),
|
|
3137
|
+
// Similarly, we'll maintain both our internal state and any user-provided
|
|
3138
|
+
// state.
|
|
3139
|
+
onStateChange: (a) => {
|
|
3140
|
+
a instanceof Function ? i.value = a(i.value) : i.value = a, e.onStateChange == null || e.onStateChange(a);
|
|
3141
|
+
}
|
|
3142
|
+
});
|
|
3143
|
+
});
|
|
3144
|
+
}), n;
|
|
3145
|
+
}
|
|
3146
|
+
const ti = { class: "pagination" }, ni = {
|
|
3147
|
+
key: 0,
|
|
3148
|
+
class: "items-per-page-control"
|
|
3149
|
+
}, oi = ["value"], ii = ["value"], ri = {
|
|
3150
|
+
key: 1,
|
|
3151
|
+
class: "page-input-control"
|
|
3152
|
+
}, li = {
|
|
3153
|
+
key: 2,
|
|
3154
|
+
class: "pagination-buttons-wrapper"
|
|
3155
|
+
}, si = { key: 0 }, ai = { key: 1 }, ui = { key: 1 }, ci = { key: 3 }, di = {
|
|
3156
|
+
name: "TablePagination"
|
|
3157
|
+
}, gi = /* @__PURE__ */ K({
|
|
3158
|
+
...di,
|
|
3159
|
+
props: {
|
|
3160
|
+
currentPage: {
|
|
3161
|
+
required: !0,
|
|
3162
|
+
type: Number
|
|
3163
|
+
},
|
|
3164
|
+
defaultItemsPerPage: {
|
|
3165
|
+
default: void 0,
|
|
3166
|
+
type: Number
|
|
3167
|
+
},
|
|
3168
|
+
inputDebounceTime: {
|
|
3169
|
+
default: void 0,
|
|
3170
|
+
type: Number
|
|
3171
|
+
},
|
|
3172
|
+
itemsPerPageControlLabel: {
|
|
3173
|
+
default: "Items per page",
|
|
3174
|
+
type: String
|
|
3175
|
+
},
|
|
3176
|
+
itemsPerPageOptions: {
|
|
3177
|
+
default: () => [5, 10, 20, 30],
|
|
3178
|
+
type: Array
|
|
3179
|
+
},
|
|
3180
|
+
pageInputLabel: {
|
|
3181
|
+
default: "Go to page:",
|
|
3182
|
+
type: String
|
|
3183
|
+
},
|
|
3184
|
+
showFirstLastButtons: {
|
|
3185
|
+
default: !0,
|
|
3186
|
+
type: Boolean
|
|
3187
|
+
},
|
|
3188
|
+
showItemsPerPageControl: {
|
|
3189
|
+
default: !0,
|
|
3190
|
+
type: Boolean
|
|
3191
|
+
},
|
|
3192
|
+
showPageButtons: {
|
|
3193
|
+
default: !1,
|
|
3194
|
+
type: Boolean
|
|
3195
|
+
},
|
|
3196
|
+
showPageInput: {
|
|
3197
|
+
type: Boolean,
|
|
3198
|
+
default: !1
|
|
3199
|
+
},
|
|
3200
|
+
showPreviousNextButtons: {
|
|
3201
|
+
default: !0,
|
|
3202
|
+
type: Boolean
|
|
3203
|
+
},
|
|
3204
|
+
totalItems: {
|
|
3205
|
+
required: !0,
|
|
3206
|
+
type: Number
|
|
3207
|
+
}
|
|
3208
|
+
},
|
|
3209
|
+
emits: ["update:currentPage", "update:itemsPerPage"],
|
|
3210
|
+
setup(e, { emit: o }) {
|
|
3211
|
+
const t = e, n = o, i = j(
|
|
3212
|
+
t.defaultItemsPerPage || t.itemsPerPageOptions[0]
|
|
3213
|
+
), r = B(
|
|
3214
|
+
() => Math.ceil(t.totalItems / i.value)
|
|
3215
|
+
), s = B(
|
|
3216
|
+
() => Array.from({ length: r.value }, (d, u) => u + 1)
|
|
3217
|
+
), l = (d) => {
|
|
3218
|
+
const u = parseInt(
|
|
3219
|
+
d.target.value,
|
|
3220
|
+
10
|
|
3221
|
+
);
|
|
3222
|
+
i.value = u, n("update:itemsPerPage", i.value);
|
|
3223
|
+
}, a = (d) => {
|
|
3224
|
+
const u = parseInt(d.toString(), 10) - 1;
|
|
3225
|
+
!isNaN(u) && u >= 0 && u < r.value && n("update:currentPage", u);
|
|
3226
|
+
};
|
|
3227
|
+
return (d, u) => (S(), y("div", ti, [
|
|
3228
|
+
e.showItemsPerPageControl ? (S(), y("div", ni, [
|
|
3229
|
+
x("span", null, H(e.itemsPerPageControlLabel), 1),
|
|
3230
|
+
x("select", {
|
|
3231
|
+
value: i.value,
|
|
3232
|
+
onChange: l
|
|
3233
|
+
}, [
|
|
3234
|
+
(S(!0), y(L, null, G(e.itemsPerPageOptions, (f) => (S(), y("option", {
|
|
3235
|
+
key: `items-per-page-option-${f}`,
|
|
3236
|
+
value: f
|
|
3237
|
+
}, H(f), 9, ii))), 128))
|
|
3238
|
+
], 40, oi)
|
|
3239
|
+
])) : V("", !0),
|
|
3240
|
+
r.value > 1 && e.showPageInput ? (S(), y("div", ri, [
|
|
3241
|
+
x("span", null, H(e.pageInputLabel), 1),
|
|
3242
|
+
A(C(yt), {
|
|
3243
|
+
type: "number",
|
|
3244
|
+
"debounce-time": e.inputDebounceTime,
|
|
3245
|
+
"onUpdate:modelValue": a
|
|
3246
|
+
}, null, 8, ["debounce-time"])
|
|
3247
|
+
])) : V("", !0),
|
|
3248
|
+
r.value > 1 ? (S(), y("div", li, [
|
|
3249
|
+
e.showFirstLastButtons || e.showPreviousNextButtons ? (S(), y("div", si, [
|
|
3250
|
+
e.showFirstLastButtons ? (S(), M(C(J), {
|
|
3251
|
+
key: 0,
|
|
3252
|
+
disabled: !(e.currentPage > 0),
|
|
3253
|
+
class: "first-page",
|
|
3254
|
+
size: "small",
|
|
3255
|
+
onClick: u[0] || (u[0] = (f) => d.$emit("update:currentPage", 0))
|
|
3256
|
+
}, {
|
|
3257
|
+
iconLeft: T(() => [
|
|
3258
|
+
A(C(z), { icon: "prime:angle-double-left" })
|
|
3259
|
+
]),
|
|
3260
|
+
_: 1
|
|
3261
|
+
}, 8, ["disabled"])) : V("", !0),
|
|
3262
|
+
e.showPreviousNextButtons ? (S(), M(C(J), {
|
|
3263
|
+
key: 1,
|
|
3264
|
+
disabled: !(e.currentPage > 0),
|
|
3265
|
+
class: "previous-page",
|
|
3266
|
+
size: "small",
|
|
3267
|
+
onClick: u[1] || (u[1] = (f) => d.$emit("update:currentPage", e.currentPage - 1))
|
|
3268
|
+
}, {
|
|
3269
|
+
iconLeft: T(() => [
|
|
3270
|
+
A(C(z), { icon: "prime:angle-left" })
|
|
3271
|
+
]),
|
|
3272
|
+
_: 1
|
|
3273
|
+
}, 8, ["disabled"])) : V("", !0)
|
|
3274
|
+
])) : V("", !0),
|
|
3275
|
+
x("div", null, [
|
|
3276
|
+
e.showPageButtons ? (S(!0), y(L, { key: 0 }, G(s.value, (f) => (S(), M(C(J), {
|
|
3277
|
+
key: `page-button-${f}`,
|
|
3278
|
+
class: ae(`page-button ${f === e.currentPage + 1 ? "active" : ""}`),
|
|
3279
|
+
label: `${f}`,
|
|
3280
|
+
size: "small",
|
|
3281
|
+
onClick: (g) => d.$emit("update:currentPage", f - 1)
|
|
3282
|
+
}, null, 8, ["class", "label", "onClick"]))), 128)) : (S(), y("span", ai, H(`${e.currentPage + 1} / ${r.value}`), 1))
|
|
3283
|
+
]),
|
|
3284
|
+
e.showFirstLastButtons || e.showPreviousNextButtons ? (S(), y("div", ui, [
|
|
3285
|
+
e.showPreviousNextButtons ? (S(), M(C(J), {
|
|
3286
|
+
key: 0,
|
|
3287
|
+
disabled: !(e.currentPage < r.value - 1),
|
|
3288
|
+
class: "next-page",
|
|
3289
|
+
size: "small",
|
|
3290
|
+
onClick: u[2] || (u[2] = (f) => d.$emit("update:currentPage", e.currentPage + 1))
|
|
3291
|
+
}, {
|
|
3292
|
+
iconLeft: T(() => [
|
|
3293
|
+
A(C(z), { icon: "prime:angle-right" })
|
|
3294
|
+
]),
|
|
3295
|
+
_: 1
|
|
3296
|
+
}, 8, ["disabled"])) : V("", !0),
|
|
3297
|
+
e.showFirstLastButtons ? (S(), M(C(J), {
|
|
3298
|
+
key: 1,
|
|
3299
|
+
disabled: !(e.currentPage < r.value - 1),
|
|
3300
|
+
class: "last-page",
|
|
3301
|
+
size: "small",
|
|
3302
|
+
onClick: u[3] || (u[3] = (f) => d.$emit("update:currentPage", r.value - 1))
|
|
3303
|
+
}, {
|
|
3304
|
+
iconLeft: T(() => [
|
|
3305
|
+
A(C(z), { icon: "prime:angle-double-right" })
|
|
3306
|
+
]),
|
|
3307
|
+
_: 1
|
|
3308
|
+
}, 8, ["disabled"])) : V("", !0)
|
|
3309
|
+
])) : V("", !0)
|
|
3310
|
+
])) : (S(), y("span", ci, H(`${e.currentPage + 1} / ${r.value}`), 1))
|
|
3311
|
+
]));
|
|
3312
|
+
}
|
|
3313
|
+
}), Me = 0, fi = [10, 20, 30], pi = 10, Kt = "table", mt = ({
|
|
3314
|
+
value: e,
|
|
3315
|
+
locale: o = "en-GB",
|
|
3316
|
+
formatOptions: t
|
|
3317
|
+
}) => typeof e != "number" || isNaN(e) ? e : new Intl.NumberFormat(o, t).format(e), me = (e) => {
|
|
3318
|
+
switch (e) {
|
|
3319
|
+
case "contains":
|
|
3320
|
+
return { operator: "ct" };
|
|
3321
|
+
case "startsWith":
|
|
3322
|
+
return { operator: "sw" };
|
|
3323
|
+
case "endsWith":
|
|
3324
|
+
return { operator: "ew" };
|
|
3325
|
+
case "equals":
|
|
3326
|
+
return { operator: "eq" };
|
|
3327
|
+
case "notEqual":
|
|
3328
|
+
return { operator: "eq", not: !0 };
|
|
3329
|
+
case "greaterThan":
|
|
3330
|
+
return { operator: "gt" };
|
|
3331
|
+
case "greaterThanOrEqual":
|
|
3332
|
+
return { operator: "gte" };
|
|
3333
|
+
case "lessThanOrEqual":
|
|
3334
|
+
return { operator: "lte" };
|
|
3335
|
+
case "lessThan":
|
|
3336
|
+
return { operator: "lt" };
|
|
3337
|
+
case "in":
|
|
3338
|
+
return { operator: "in" };
|
|
3339
|
+
case "notIn":
|
|
3340
|
+
return { operator: "in", not: !0 };
|
|
3341
|
+
case "between":
|
|
3342
|
+
return { operator: "bt" };
|
|
3343
|
+
case "notBetween":
|
|
3344
|
+
return { operator: "bt", not: !0 };
|
|
3345
|
+
case "isNull":
|
|
3346
|
+
return { operator: "null" };
|
|
3347
|
+
case "isNotNull":
|
|
3348
|
+
return { operator: "null", not: !0 };
|
|
3349
|
+
case "isEmpty":
|
|
3350
|
+
return { operator: "empty" };
|
|
3351
|
+
case "isNotEmpty":
|
|
3352
|
+
return { operator: "empty", not: !0 };
|
|
3353
|
+
case "like":
|
|
3354
|
+
return { operator: "like" };
|
|
3355
|
+
case "notLike":
|
|
3356
|
+
return { operator: "like", not: !0 };
|
|
3357
|
+
default:
|
|
3358
|
+
return { operator: "ct" };
|
|
3359
|
+
}
|
|
3360
|
+
}, ht = (e) => {
|
|
3361
|
+
switch (e) {
|
|
3362
|
+
case !1:
|
|
3363
|
+
return "ASC";
|
|
3364
|
+
case !0:
|
|
3365
|
+
return "DESC";
|
|
3366
|
+
default:
|
|
3367
|
+
return "";
|
|
3368
|
+
}
|
|
3369
|
+
}, qe = ({
|
|
3370
|
+
align: e,
|
|
3371
|
+
dataType: o
|
|
3372
|
+
}) => e || (o == "other" ? "center" : o == "number" || o == "currency" ? "right" : "left"), mi = (e, o, t) => {
|
|
3373
|
+
const n = () => {
|
|
3374
|
+
if (!o || o.length === 0) return null;
|
|
3375
|
+
const l = o.filter((a) => Array.isArray(a.value) ? a.value.length > 0 : typeof a.value == "string" ? a.value.trim() !== "" : a.value != null);
|
|
3376
|
+
return l.length === 0 ? null : l.length === 1 ? Array.isArray(l[0].value) ? {
|
|
3377
|
+
key: l[0].id,
|
|
3378
|
+
...me(l[0].filterFn || "in"),
|
|
3379
|
+
value: l[0].value.filter((a) => a !== void 0).join(",")
|
|
3380
|
+
} : {
|
|
3381
|
+
key: l[0].id,
|
|
3382
|
+
...me(l[0].filterFn || "contains"),
|
|
3383
|
+
value: String(l[0].value)
|
|
3384
|
+
} : {
|
|
3385
|
+
AND: l.map((a) => Array.isArray(a.value) ? {
|
|
3386
|
+
key: a.id,
|
|
3387
|
+
...me(a.filterFn || "in"),
|
|
3388
|
+
value: a.value.filter((d) => d !== void 0).join(",")
|
|
3389
|
+
} : {
|
|
3390
|
+
key: a.id,
|
|
3391
|
+
...me(a.filterFn || "contains"),
|
|
3392
|
+
value: String(a.value)
|
|
3393
|
+
})
|
|
3394
|
+
};
|
|
3395
|
+
}, i = () => !t || t && Object.keys(t).length === 0 ? null : t.pageSize, r = () => !t || t && Object.keys(t).length === 0 ? null : t.pageIndex * t.pageSize, s = () => !e || e.length === 0 ? null : e.length > 1 ? e.map((l) => ({
|
|
3396
|
+
key: l.id,
|
|
3397
|
+
direction: ht(l.desc)
|
|
3398
|
+
})) : [
|
|
3399
|
+
{
|
|
3400
|
+
key: e[0].id,
|
|
3401
|
+
direction: ht(e[0].desc)
|
|
3402
|
+
}
|
|
3403
|
+
];
|
|
3404
|
+
return {
|
|
3405
|
+
filter: n(),
|
|
3406
|
+
limit: i(),
|
|
3407
|
+
sort: s(),
|
|
3408
|
+
offset: r()
|
|
3409
|
+
};
|
|
3410
|
+
}, hi = (e, o) => {
|
|
3411
|
+
try {
|
|
3412
|
+
const t = o.getItem(`${Kt}-${e}`);
|
|
3413
|
+
return t && JSON.parse(t);
|
|
3414
|
+
} catch (t) {
|
|
3415
|
+
console.log("[Dz table] Could not restore table state", t);
|
|
3416
|
+
}
|
|
3417
|
+
return null;
|
|
3418
|
+
}, vt = (e, o, t) => {
|
|
3419
|
+
try {
|
|
3420
|
+
t.setItem(`${Kt}-${e}`, JSON.stringify(o));
|
|
3421
|
+
} catch (n) {
|
|
3422
|
+
console.log("[Dz table] Could not store table state", n);
|
|
3423
|
+
}
|
|
3424
|
+
}, vi = ["data-id", "data-selected"], Si = ["data-label", "data-align"], wi = { key: 1 }, Ci = {
|
|
3425
|
+
name: "TableBody"
|
|
3426
|
+
}, yi = /* @__PURE__ */ K({
|
|
3427
|
+
...Ci,
|
|
3428
|
+
props: {
|
|
3429
|
+
customFormatters: {
|
|
3430
|
+
default: () => ({}),
|
|
3431
|
+
type: Object
|
|
3432
|
+
},
|
|
3433
|
+
emptyTableMessage: {
|
|
3434
|
+
default: "No results.",
|
|
3435
|
+
type: String
|
|
3436
|
+
},
|
|
3437
|
+
enableRowSelection: Boolean,
|
|
3438
|
+
table: {
|
|
3439
|
+
required: !0,
|
|
3440
|
+
type: Object
|
|
3441
|
+
}
|
|
3442
|
+
},
|
|
3443
|
+
setup(e) {
|
|
3444
|
+
const o = e, t = (i) => {
|
|
3445
|
+
const r = i.getContext(), s = i.column.columnDef.dateOptions, l = i.column.columnDef.numberOptions, a = i.column.columnDef.cell;
|
|
3446
|
+
return {
|
|
3447
|
+
props: r,
|
|
3448
|
+
render: (() => {
|
|
3449
|
+
const u = {
|
|
3450
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3451
|
+
number: (g) => mt({
|
|
3452
|
+
value: Number(g),
|
|
3453
|
+
locale: l?.locale,
|
|
3454
|
+
formatOptions: l?.formatOptions
|
|
3455
|
+
}),
|
|
3456
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3457
|
+
date: (g) => Yt(
|
|
3458
|
+
g,
|
|
3459
|
+
s?.locale,
|
|
3460
|
+
s?.formatOptions
|
|
3461
|
+
),
|
|
3462
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3463
|
+
datetime: (g) => ke(
|
|
3464
|
+
g,
|
|
3465
|
+
s?.locale,
|
|
3466
|
+
s?.formatOptions
|
|
3467
|
+
),
|
|
3468
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3469
|
+
currency: (g) => mt({
|
|
3470
|
+
value: Number(g),
|
|
3471
|
+
locale: l?.locale,
|
|
3472
|
+
formatOptions: {
|
|
3473
|
+
style: "currency",
|
|
3474
|
+
currency: "USD",
|
|
3475
|
+
...l?.formatOptions && l.formatOptions
|
|
3476
|
+
}
|
|
3477
|
+
}),
|
|
3478
|
+
...o.customFormatters
|
|
3479
|
+
}, f = i.column.columnDef.dataType || "text";
|
|
3480
|
+
return u?.[f]?.(r.getValue()) || a;
|
|
3481
|
+
})()
|
|
3482
|
+
};
|
|
3483
|
+
}, n = (i) => {
|
|
3484
|
+
const r = i.column.columnDef.tooltip;
|
|
3485
|
+
return typeof r == "string" ? r : typeof r == "function" ? r(i) : i.getValue();
|
|
3486
|
+
};
|
|
3487
|
+
return (i, r) => (S(), y("tbody", null, [
|
|
3488
|
+
e.table.getRowModel().rows?.length ? (S(!0), y(L, { key: 0 }, G(e.table.getRowModel().rows, (s) => (S(), y("tr", {
|
|
3489
|
+
key: `table-row-${s.id}`,
|
|
3490
|
+
"data-id": s.id,
|
|
3491
|
+
"data-selected": e.enableRowSelection ? s.getIsSelected() : void 0
|
|
3492
|
+
}, [
|
|
3493
|
+
(S(!0), y(L, null, G(s.getVisibleCells(), (l) => (S(), y("td", {
|
|
3494
|
+
key: `table-data-${s.id}-${l.id}`,
|
|
3495
|
+
class: ae([l.column.id ? `cell-${l.column.id}` : ""]),
|
|
3496
|
+
"data-label": l.column.id,
|
|
3497
|
+
"data-align": C(qe)({
|
|
3498
|
+
align: l.column.columnDef.align,
|
|
3499
|
+
dataType: l.column.columnDef.dataType
|
|
3500
|
+
}),
|
|
3501
|
+
style: te({
|
|
3502
|
+
width: l.column.columnDef.width,
|
|
3503
|
+
maxWidth: l.column.columnDef.maxWidth,
|
|
3504
|
+
minWidth: l.column.columnDef.minWidth
|
|
3505
|
+
})
|
|
3506
|
+
}, [
|
|
3507
|
+
l.column.columnDef.tooltip ? (S(), M(C(Zt), ee({
|
|
3508
|
+
key: 0,
|
|
3509
|
+
ref_for: !0
|
|
3510
|
+
}, l.column.columnDef.tooltipOptions), {
|
|
3511
|
+
content: T(() => [
|
|
3512
|
+
typeof l.column.columnDef.tooltip == "function" && typeof n(l) != "string" ? (S(), M(wt(n(l)), { key: 0 })) : (S(), y(L, { key: 1 }, [
|
|
3513
|
+
Jt(H(n(l)), 1)
|
|
3514
|
+
], 64))
|
|
3515
|
+
]),
|
|
3516
|
+
default: T(() => [
|
|
3517
|
+
A(C(ce), ee({ ref_for: !0 }, t(l)), null, 16)
|
|
3518
|
+
]),
|
|
3519
|
+
_: 2
|
|
3520
|
+
}, 1040)) : (S(), M(C(ce), ee({
|
|
3521
|
+
key: 1,
|
|
3522
|
+
ref_for: !0
|
|
3523
|
+
}, t(l)), null, 16))
|
|
3524
|
+
], 14, Si))), 128))
|
|
3525
|
+
], 8, vi))), 128)) : (S(), y("tr", wi, [
|
|
3526
|
+
x("td", null, H(e.emptyTableMessage), 1)
|
|
3527
|
+
]))
|
|
3528
|
+
]));
|
|
3529
|
+
}
|
|
3530
|
+
}), Ri = {
|
|
3531
|
+
key: 0,
|
|
3532
|
+
class: "data-actions"
|
|
3533
|
+
}, Fi = {
|
|
3534
|
+
name: "TableDataActions"
|
|
3535
|
+
}, bi = /* @__PURE__ */ K({
|
|
3536
|
+
...Fi,
|
|
3537
|
+
props: {
|
|
3538
|
+
actions: {
|
|
3539
|
+
type: Array,
|
|
3540
|
+
required: !0
|
|
3541
|
+
},
|
|
3542
|
+
data: {
|
|
3543
|
+
default: () => ({}),
|
|
3544
|
+
type: Object
|
|
3545
|
+
},
|
|
3546
|
+
displayActions: {
|
|
3547
|
+
default: !0,
|
|
3548
|
+
type: [Boolean, Function]
|
|
3549
|
+
},
|
|
3550
|
+
singleActionMode: {
|
|
3551
|
+
default: "button",
|
|
3552
|
+
type: String,
|
|
3553
|
+
validator: (e) => ["button", "menu"].includes(e)
|
|
3554
|
+
}
|
|
3555
|
+
},
|
|
3556
|
+
emits: ["action:click", "action:select"],
|
|
3557
|
+
setup(e, { emit: o }) {
|
|
3558
|
+
const t = e, n = o, i = j(!1), r = j(), s = B(
|
|
3559
|
+
() => t.actions.map((f) => ({
|
|
3560
|
+
...f,
|
|
3561
|
+
display: typeof f.display == "function" ? f.display(t.data) : f.display ?? !0,
|
|
3562
|
+
disabled: typeof f.disabled == "function" ? f.disabled(t.data) : f.disabled
|
|
3563
|
+
})).filter((f) => f.display)
|
|
3564
|
+
), l = B(
|
|
3565
|
+
() => s.value.length === 1 && s.value[0].icon && t.singleActionMode === "button"
|
|
3566
|
+
), a = B(
|
|
3567
|
+
() => typeof t.displayActions == "function" ? t.displayActions(t.data) : t.displayActions
|
|
3568
|
+
), d = () => {
|
|
3569
|
+
i.value = !1, n("action:select", r.value);
|
|
3570
|
+
}, u = (f) => {
|
|
3571
|
+
r.value = f, f?.requireConfirmationModal ? i.value = !0 : n("action:select", r.value);
|
|
3572
|
+
};
|
|
3573
|
+
return (f, g) => a.value ? (S(), y("div", Ri, [
|
|
3574
|
+
l.value ? (S(), M(C(J), {
|
|
3575
|
+
key: 0,
|
|
3576
|
+
disabled: s.value[0].disabled,
|
|
3577
|
+
"icon-left": s.value[0].icon,
|
|
3578
|
+
label: s.value[0].label,
|
|
3579
|
+
rounded: "",
|
|
3580
|
+
variant: "textOnly",
|
|
3581
|
+
onClick: g[0] || (g[0] = (c) => f.$emit("action:click"))
|
|
3582
|
+
}, null, 8, ["disabled", "icon-left", "label"])) : s.value.length ? (S(), M(C(en), {
|
|
3583
|
+
key: 1,
|
|
3584
|
+
menu: s.value,
|
|
3585
|
+
onSelect: u
|
|
3586
|
+
}, {
|
|
3587
|
+
default: T(() => [
|
|
3588
|
+
Q(f.$slots, "trigger", {}, () => [
|
|
3589
|
+
A(C(z), {
|
|
3590
|
+
icon: "prime:cog",
|
|
3591
|
+
width: "22"
|
|
3592
|
+
})
|
|
3593
|
+
])
|
|
3594
|
+
]),
|
|
3595
|
+
_: 3
|
|
3596
|
+
}, 8, ["menu"])) : V("", !0),
|
|
3597
|
+
Q(f.$slots, "confirmationModal", {}, () => [
|
|
3598
|
+
i.value ? (S(), M(C(tn), {
|
|
3599
|
+
key: 0,
|
|
3600
|
+
"onOn:close": g[1] || (g[1] = (c) => i.value = !1),
|
|
3601
|
+
"onOn:confirm": d
|
|
3602
|
+
}, Ct({ _: 2 }, [
|
|
3603
|
+
r.value?.confirmationOptions?.header ? {
|
|
3604
|
+
name: "header",
|
|
3605
|
+
fn: T(() => [
|
|
3606
|
+
x("p", null, H(r.value?.confirmationOptions?.header), 1)
|
|
3607
|
+
]),
|
|
3608
|
+
key: "0"
|
|
3609
|
+
} : void 0,
|
|
3610
|
+
r.value?.confirmationOptions?.body ? {
|
|
3611
|
+
name: "body",
|
|
3612
|
+
fn: T(() => [
|
|
3613
|
+
x("p", null, H(r.value?.confirmationOptions?.body), 1)
|
|
3614
|
+
]),
|
|
3615
|
+
key: "1"
|
|
3616
|
+
} : void 0,
|
|
3617
|
+
r.value?.confirmationOptions?.footer ? {
|
|
3618
|
+
name: "footer",
|
|
3619
|
+
fn: T(() => [
|
|
3620
|
+
x("p", null, H(r.value?.confirmationOptions?.footer), 1)
|
|
3621
|
+
]),
|
|
3622
|
+
key: "2"
|
|
3623
|
+
} : void 0
|
|
3624
|
+
]), 1024)) : V("", !0)
|
|
3625
|
+
])
|
|
3626
|
+
])) : V("", !0);
|
|
3627
|
+
}
|
|
3628
|
+
}), Pi = ["colSpan", "data-align", "onClick"], $i = {
|
|
3629
|
+
key: 0,
|
|
3630
|
+
class: "sort-state"
|
|
3631
|
+
}, Ii = {
|
|
3632
|
+
key: 0,
|
|
3633
|
+
class: "sort-icon",
|
|
3634
|
+
height: "16",
|
|
3635
|
+
viewBox: "0 0 24 24",
|
|
3636
|
+
width: "16",
|
|
3637
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
3638
|
+
}, xi = {
|
|
3639
|
+
key: 0,
|
|
3640
|
+
class: "sort-icon",
|
|
3641
|
+
height: "16",
|
|
3642
|
+
viewBox: "0 0 24 24",
|
|
3643
|
+
width: "16",
|
|
3644
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
3645
|
+
}, Vi = {
|
|
3646
|
+
key: 1,
|
|
3647
|
+
class: "sort-icon",
|
|
3648
|
+
height: "16",
|
|
3649
|
+
viewBox: "0 0 24 24",
|
|
3650
|
+
width: "16",
|
|
3651
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
3652
|
+
}, _i = {
|
|
3653
|
+
key: 0,
|
|
3654
|
+
class: "header-row filters"
|
|
3655
|
+
}, Di = ["data-align"], Ai = {
|
|
3656
|
+
key: 3,
|
|
3657
|
+
class: "number-range-filter"
|
|
3658
|
+
}, Mi = {
|
|
3659
|
+
name: "TableHeader"
|
|
3660
|
+
}, ki = /* @__PURE__ */ K({
|
|
3661
|
+
...Mi,
|
|
3662
|
+
props: {
|
|
3663
|
+
inputDebounceTime: {
|
|
3664
|
+
default: void 0,
|
|
3665
|
+
type: Number
|
|
3666
|
+
},
|
|
3667
|
+
isFilterRowVisible: {
|
|
3668
|
+
default: !1,
|
|
3669
|
+
type: Boolean
|
|
3670
|
+
},
|
|
3671
|
+
table: {
|
|
3672
|
+
required: !0,
|
|
3673
|
+
type: Object
|
|
3674
|
+
}
|
|
3675
|
+
},
|
|
3676
|
+
setup(e) {
|
|
3677
|
+
const o = (r) => r.getIsSorted() === "asc" || r.getIsSorted() === "desc" || r.getIsFiltered() ? "highlight" : "", t = (r) => r.getFilterValue(), n = (r) => r?.length ? r.map((s, l) => {
|
|
3678
|
+
const a = String(s.getDate()).padStart(2, "0"), d = String(s.getMonth() + 1).padStart(2, "0"), u = l === 0 ? "00:00:00" : "23:59:59";
|
|
3679
|
+
return `${s.getFullYear()}-${d}-${a} ${u}`;
|
|
3680
|
+
}).filter((s) => s !== null) : null, i = (r, s, l) => {
|
|
3681
|
+
const a = r.getFilterValue(), d = Array.isArray(a) ? [...a] : [void 0, void 0];
|
|
3682
|
+
d[s] = l !== void 0 ? Number(l) : void 0;
|
|
3683
|
+
const u = d.some(
|
|
3684
|
+
(f) => f !== void 0
|
|
3685
|
+
);
|
|
3686
|
+
r.setFilterValue(u ? d : []);
|
|
3687
|
+
};
|
|
3688
|
+
return (r, s) => (S(), y("thead", null, [
|
|
3689
|
+
(S(!0), y(L, null, G(e.table.getHeaderGroups(), (l) => (S(), y("tr", {
|
|
3690
|
+
key: l.id,
|
|
3691
|
+
class: "header-row"
|
|
3692
|
+
}, [
|
|
3693
|
+
(S(!0), y(L, null, G(l.headers, (a) => (S(), y("th", {
|
|
3694
|
+
key: `table-header-${a.id}`,
|
|
3695
|
+
class: ae([
|
|
3696
|
+
o(a.column),
|
|
3697
|
+
`column-${a.id}`,
|
|
3698
|
+
a.column.columnDef.enableSorting ? "sortable" : ""
|
|
3699
|
+
]),
|
|
3700
|
+
colSpan: a.colSpan,
|
|
3701
|
+
"data-align": C(qe)({
|
|
3702
|
+
align: a.column.columnDef.align,
|
|
3703
|
+
dataType: a.column.columnDef.dataType
|
|
3704
|
+
}),
|
|
3705
|
+
style: te({
|
|
3706
|
+
width: a.column.columnDef.width,
|
|
3707
|
+
maxWidth: a.column.columnDef.maxWidth,
|
|
3708
|
+
minWidth: a.column.columnDef.minWidth
|
|
3709
|
+
}),
|
|
3710
|
+
onClick: (d) => a.column.getCanSort() ? a.column.getToggleSortingHandler()?.(d) : null
|
|
3711
|
+
}, [
|
|
3712
|
+
a.isPlaceholder ? V("", !0) : (S(), y(L, { key: 0 }, [
|
|
3713
|
+
A(C(ce), {
|
|
3714
|
+
props: a.getContext(),
|
|
3715
|
+
render: a.column.columnDef.header
|
|
3716
|
+
}, null, 8, ["props", "render"]),
|
|
3717
|
+
a.column.columnDef.enableSorting ? (S(), y("span", $i, [
|
|
3718
|
+
!a.column.getIsSorted() && a.column.getCanSort() ? (S(), y("svg", Ii, s[0] || (s[0] = [
|
|
3719
|
+
x("path", {
|
|
3720
|
+
d: "M18 10.75H6a.74.74 0 0 1-.69-.46a.75.75 0 0 1 .16-.82l6-6a.75.75 0 0 1 1.06 0l6 6a.75.75 0 0 1 .16.82a.74.74 0 0 1-.69.46M7.81 9.25h8.38L12 5.06ZM12 20.75a.74.74 0 0 1-.53-.22l-6-6a.75.75 0 0 1-.16-.82a.74.74 0 0 1 .69-.46h12a.74.74 0 0 1 .69.46a.75.75 0 0 1-.16.82l-6 6a.74.74 0 0 1-.53.22m-4.19-6L12 18.94l4.19-4.19Z",
|
|
3721
|
+
fill: "currentColor"
|
|
3722
|
+
}, null, -1)
|
|
3723
|
+
]))) : V("", !0),
|
|
3724
|
+
a.column.getIsSorted() && a.column.getCanSort() ? (S(), y(L, { key: 1 }, [
|
|
3725
|
+
a.column.getIsSorted() === "asc" ? (S(), y("svg", xi, s[1] || (s[1] = [
|
|
3726
|
+
x("path", {
|
|
3727
|
+
d: "M12.53 7.97a.75.75 0 0 0-1.06 0l-7 7A.75.75 0 0 0 5 16.25h14a.75.75 0 0 0 .53-1.28z",
|
|
3728
|
+
fill: "currentColor"
|
|
3729
|
+
}, null, -1)
|
|
3730
|
+
]))) : (S(), y("svg", Vi, s[2] || (s[2] = [
|
|
3731
|
+
x("path", {
|
|
3732
|
+
d: "M5 7.75a.75.75 0 0 0-.53 1.28l7 7a.75.75 0 0 0 1.06 0l7-7A.75.75 0 0 0 19 7.75z",
|
|
3733
|
+
fill: "currentColor"
|
|
3734
|
+
}, null, -1)
|
|
3735
|
+
])))
|
|
3736
|
+
], 64)) : V("", !0)
|
|
3737
|
+
])) : V("", !0)
|
|
3738
|
+
], 64))
|
|
3739
|
+
], 14, Pi))), 128))
|
|
3740
|
+
]))), 128)),
|
|
3741
|
+
e.isFilterRowVisible ? (S(), y("tr", _i, [
|
|
3742
|
+
(S(!0), y(L, null, G(e.table.getVisibleLeafColumns(), (l) => (S(), y("th", {
|
|
3743
|
+
key: `table-filter-${l.id}`,
|
|
3744
|
+
class: ae([
|
|
3745
|
+
o(l),
|
|
3746
|
+
l.id ? `column-${l.id}` : "",
|
|
3747
|
+
l.columnDef.className || "",
|
|
3748
|
+
l.getCanFilter() ? `filter ${l.columnDef.meta?.filterVariant}` : ""
|
|
3749
|
+
]),
|
|
3750
|
+
"data-align": C(qe)({
|
|
3751
|
+
align: l.columnDef.align,
|
|
3752
|
+
dataType: l.columnDef.dataType
|
|
3753
|
+
}),
|
|
3754
|
+
style: te({
|
|
3755
|
+
width: l.columnDef.width,
|
|
3756
|
+
maxWidth: l.columnDef.maxWidth,
|
|
3757
|
+
minWidth: l.columnDef.minWidth
|
|
3758
|
+
})
|
|
3759
|
+
}, [
|
|
3760
|
+
l.getCanFilter() ? (S(), y(L, { key: 0 }, [
|
|
3761
|
+
l.columnDef.customFilterComponent ? (S(), M(wt(l.columnDef.customFilterComponent(l)), { key: 0 })) : l.columnDef.meta?.filterVariant === "multiselect" || l.columnDef.meta?.filterVariant === "select" ? (S(), M(C(an), {
|
|
3762
|
+
key: 1,
|
|
3763
|
+
"model-value": t(l),
|
|
3764
|
+
options: l.columnDef.meta?.filterOptions || [],
|
|
3765
|
+
placeholder: l.columnDef.filterPlaceholder,
|
|
3766
|
+
name: `multiselect-filter-${l.columnDef.accessorKey}`,
|
|
3767
|
+
multiple: l.columnDef.meta?.filterVariant === "multiselect",
|
|
3768
|
+
"enable-tooltip": "",
|
|
3769
|
+
"onUpdate:modelValue": (a) => l.setFilterValue(a)
|
|
3770
|
+
}, null, 8, ["model-value", "options", "placeholder", "name", "multiple", "onUpdate:modelValue"])) : l.columnDef.meta?.filterVariant === "dateRange" ? (S(), M(C(un), {
|
|
3771
|
+
key: 2,
|
|
3772
|
+
"model-value": t(l),
|
|
3773
|
+
placeholder: l.columnDef.filterPlaceholder,
|
|
3774
|
+
name: "`date-range-${column.columnDef.accessorKey}`",
|
|
3775
|
+
range: "",
|
|
3776
|
+
"onUpdate:modelValue": (a) => l.setFilterValue(n(a))
|
|
3777
|
+
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : l.columnDef.meta?.filterVariant === "range" ? (S(), y("div", Ai, [
|
|
3778
|
+
A(C(Ye), {
|
|
3779
|
+
"model-value": Array.isArray(t(l)) ? Number(t(l)[0]) : void 0,
|
|
3780
|
+
placeholder: l.columnDef.filterPlaceholder?.split(",")[0],
|
|
3781
|
+
name: "`range-${column.columnDef.accessorKey}-start`",
|
|
3782
|
+
"onUpdate:modelValue": (a) => i(l, 0, a)
|
|
3783
|
+
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"]),
|
|
3784
|
+
A(C(Ye), {
|
|
3785
|
+
"model-value": Array.isArray(t(l)) ? Number(t(l)[1]) : void 0,
|
|
3786
|
+
placeholder: l.columnDef.filterPlaceholder?.split(",")[1] ?? l.columnDef.filterPlaceholder,
|
|
3787
|
+
name: "`range-${column.columnDef.accessorKey}-end`",
|
|
3788
|
+
"onUpdate:modelValue": (a) => i(l, 1, a)
|
|
3789
|
+
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])
|
|
3790
|
+
])) : (S(), M(C(yt), {
|
|
3791
|
+
key: 4,
|
|
3792
|
+
id: `input-filter-${l.id}`,
|
|
3793
|
+
"debounce-time": e.inputDebounceTime,
|
|
3794
|
+
"model-value": typeof t(l) == "string" ? String(t(l)) : "",
|
|
3795
|
+
placeholder: l.columnDef.filterPlaceholder,
|
|
3796
|
+
"onUpdate:modelValue": (a) => l.setFilterValue(a)
|
|
3797
|
+
}, null, 8, ["id", "debounce-time", "model-value", "placeholder", "onUpdate:modelValue"]))
|
|
3798
|
+
], 64)) : V("", !0)
|
|
3799
|
+
], 14, Di))), 128))
|
|
3800
|
+
])) : V("", !0)
|
|
3801
|
+
]));
|
|
3802
|
+
}
|
|
3803
|
+
}), Ei = { class: "toolbar" }, Li = {
|
|
3804
|
+
name: "TableToolbar"
|
|
3805
|
+
}, Oi = /* @__PURE__ */ K({
|
|
3806
|
+
...Li,
|
|
3807
|
+
props: {
|
|
3808
|
+
columnActionButtonLabel: {
|
|
3809
|
+
default: "Columns",
|
|
3810
|
+
type: String
|
|
3811
|
+
},
|
|
3812
|
+
hasActionsColumn: Boolean,
|
|
3813
|
+
hasSelectionColumn: Boolean,
|
|
3814
|
+
resetButtonLabel: {
|
|
3815
|
+
default: "Reset all",
|
|
3816
|
+
type: String
|
|
3817
|
+
},
|
|
3818
|
+
showColumnAction: Boolean,
|
|
3819
|
+
showResetButton: Boolean,
|
|
3820
|
+
table: {
|
|
3821
|
+
required: !0,
|
|
3822
|
+
type: Object
|
|
3823
|
+
}
|
|
3824
|
+
},
|
|
3825
|
+
emits: ["on:drag", "on:reset"],
|
|
3826
|
+
setup(e, { emit: o }) {
|
|
3827
|
+
const t = e, n = o, i = B(
|
|
3828
|
+
() => t.table.getAllLeafColumns().filter((s) => s.id !== "select" && s.id !== "actions").map((s, l) => ({
|
|
3829
|
+
id: l,
|
|
3830
|
+
data: s,
|
|
3831
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3832
|
+
render: (a) => {
|
|
3833
|
+
let d = a.columnDef.header;
|
|
3834
|
+
return typeof a.columnDef.header == "function" && (d = a.columnDef.header()), W(Ee, {
|
|
3835
|
+
label: d,
|
|
3836
|
+
modelValue: a.getIsVisible(),
|
|
3837
|
+
name: a.columnDef.accessorKey,
|
|
3838
|
+
"onUpdate:modelValue": () => a.toggleVisibility()
|
|
3839
|
+
});
|
|
3840
|
+
}
|
|
3841
|
+
}))
|
|
3842
|
+
), r = (s) => {
|
|
3843
|
+
const l = [
|
|
3844
|
+
...t.hasSelectionColumn ? ["select"] : [],
|
|
3845
|
+
...s.map((a) => String(a?.data?.id)),
|
|
3846
|
+
...t.hasActionsColumn ? ["actions"] : []
|
|
3847
|
+
];
|
|
3848
|
+
n("on:drag", l);
|
|
3849
|
+
};
|
|
3850
|
+
return (s, l) => (S(), y("div", Ei, [
|
|
3851
|
+
e.showResetButton ? (S(), M(C(J), {
|
|
3852
|
+
key: 0,
|
|
3853
|
+
label: e.resetButtonLabel,
|
|
3854
|
+
variant: "outlined",
|
|
3855
|
+
severity: "secondary",
|
|
3856
|
+
onClick: l[0] || (l[0] = (a) => s.$emit("on:reset"))
|
|
3857
|
+
}, null, 8, ["label"])) : V("", !0),
|
|
3858
|
+
e.showColumnAction ? (S(), M(C(nn), {
|
|
3859
|
+
key: 1,
|
|
3860
|
+
position: "bottom"
|
|
3861
|
+
}, {
|
|
3862
|
+
content: T(() => [
|
|
3863
|
+
A(C(on), {
|
|
3864
|
+
list: i.value,
|
|
3865
|
+
onOnDrag: r
|
|
3866
|
+
}, null, 8, ["list"])
|
|
3867
|
+
]),
|
|
3868
|
+
default: T(() => [
|
|
3869
|
+
A(C(J), {
|
|
3870
|
+
label: e.columnActionButtonLabel,
|
|
3871
|
+
variant: "outlined",
|
|
3872
|
+
severity: "secondary"
|
|
3873
|
+
}, null, 8, ["label"])
|
|
3874
|
+
]),
|
|
3875
|
+
_: 1
|
|
3876
|
+
})) : V("", !0),
|
|
3877
|
+
Q(s.$slots, "default")
|
|
3878
|
+
]));
|
|
3879
|
+
}
|
|
3880
|
+
}), Ti = ["id"], Bi = {
|
|
3881
|
+
key: 0,
|
|
3882
|
+
class: "loading-overlay"
|
|
3883
|
+
}, Hi = ["data-align"], zi = { class: "table-wrapper" }, Gi = { key: 0 }, Ni = {
|
|
3884
|
+
name: "DataTable"
|
|
3885
|
+
}, ji = /* @__PURE__ */ K({
|
|
3886
|
+
...Ni,
|
|
3887
|
+
props: {
|
|
3888
|
+
dataActionMenu: {
|
|
3889
|
+
default: () => [],
|
|
3890
|
+
type: Array
|
|
3891
|
+
},
|
|
3892
|
+
columnActionButtonLabel: {
|
|
3893
|
+
default: void 0,
|
|
3894
|
+
type: String
|
|
3895
|
+
},
|
|
3896
|
+
columnsData: {
|
|
3897
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3898
|
+
type: Array,
|
|
3899
|
+
default: () => []
|
|
3900
|
+
},
|
|
3901
|
+
customFormatters: {
|
|
3902
|
+
default: () => ({}),
|
|
3903
|
+
type: Object
|
|
3904
|
+
},
|
|
3905
|
+
data: {
|
|
3906
|
+
type: Array,
|
|
3907
|
+
default: () => []
|
|
3908
|
+
},
|
|
3909
|
+
displayActions: {
|
|
3910
|
+
default: !0,
|
|
3911
|
+
type: [Boolean, Function]
|
|
3912
|
+
},
|
|
3913
|
+
emptyTableMessage: {
|
|
3914
|
+
default: void 0,
|
|
3915
|
+
type: String
|
|
3916
|
+
},
|
|
3917
|
+
enableRowSelection: {
|
|
3918
|
+
default: !1,
|
|
3919
|
+
type: Boolean
|
|
3920
|
+
},
|
|
3921
|
+
enableSortingRemoval: {
|
|
3922
|
+
default: !1,
|
|
3923
|
+
type: Boolean
|
|
3924
|
+
},
|
|
3925
|
+
id: {
|
|
3926
|
+
default: void 0,
|
|
3927
|
+
type: String
|
|
3928
|
+
},
|
|
3929
|
+
initialFilters: {
|
|
3930
|
+
default: () => [],
|
|
3931
|
+
type: Array
|
|
3932
|
+
},
|
|
3933
|
+
initialSorting: {
|
|
3934
|
+
default: () => [],
|
|
3935
|
+
type: Array
|
|
3936
|
+
},
|
|
3937
|
+
inputDebounceTime: {
|
|
3938
|
+
default: void 0,
|
|
3939
|
+
type: Number
|
|
3940
|
+
},
|
|
3941
|
+
isLoading: Boolean,
|
|
3942
|
+
isServerTable: Boolean,
|
|
3943
|
+
paginated: {
|
|
3944
|
+
default: !0,
|
|
3945
|
+
type: Boolean
|
|
3946
|
+
},
|
|
3947
|
+
paginationOptions: {
|
|
3948
|
+
default: () => ({}),
|
|
3949
|
+
type: Object
|
|
3950
|
+
},
|
|
3951
|
+
persistState: Boolean,
|
|
3952
|
+
persistStateStorage: {
|
|
3953
|
+
default: "localStorage",
|
|
3954
|
+
type: String,
|
|
3955
|
+
validator: (e) => ["localStorage", "sessionStorage"].includes(e)
|
|
3956
|
+
},
|
|
3957
|
+
resetButtonLabel: {
|
|
3958
|
+
default: void 0,
|
|
3959
|
+
type: String
|
|
3960
|
+
},
|
|
3961
|
+
rowPerPage: {
|
|
3962
|
+
default: pi,
|
|
3963
|
+
type: Number
|
|
3964
|
+
},
|
|
3965
|
+
rowPerPageOptions: {
|
|
3966
|
+
default: () => fi,
|
|
3967
|
+
type: Array
|
|
3968
|
+
},
|
|
3969
|
+
showColumnAction: Boolean,
|
|
3970
|
+
showResetButton: Boolean,
|
|
3971
|
+
singleActionMode: {
|
|
3972
|
+
default: "button",
|
|
3973
|
+
type: String,
|
|
3974
|
+
validator: (e) => ["button", "menu"].includes(e)
|
|
3975
|
+
},
|
|
3976
|
+
tableOptions: {
|
|
3977
|
+
default: () => ({}),
|
|
3978
|
+
type: Object
|
|
3979
|
+
},
|
|
3980
|
+
titleInfo: {
|
|
3981
|
+
default: void 0,
|
|
3982
|
+
type: Object
|
|
3983
|
+
},
|
|
3984
|
+
totalRecords: {
|
|
3985
|
+
default: 0,
|
|
3986
|
+
type: Number
|
|
3987
|
+
},
|
|
3988
|
+
visibleColumns: {
|
|
3989
|
+
default: () => [],
|
|
3990
|
+
type: Array
|
|
3991
|
+
}
|
|
3992
|
+
},
|
|
3993
|
+
emits: [
|
|
3994
|
+
"action:click",
|
|
3995
|
+
"action:select",
|
|
3996
|
+
"change:rowSelection",
|
|
3997
|
+
"update:request"
|
|
3998
|
+
],
|
|
3999
|
+
setup(e, { emit: o }) {
|
|
4000
|
+
const t = e, n = o, i = [], r = j(t.initialFilters), s = j([]), l = j({}), a = j({
|
|
4001
|
+
pageIndex: Me,
|
|
4002
|
+
pageSize: t.paginated ? t.rowPerPage : t.data.length
|
|
4003
|
+
}), d = j({}), u = j(t.initialSorting), f = B(() => t.columnsData.some((v) => v.enableColumnFilter)), g = B(() => ({
|
|
4004
|
+
columnFilters: r.value,
|
|
4005
|
+
columnOrder: s.value,
|
|
4006
|
+
columnVisibility: l.value,
|
|
4007
|
+
pagination: a.value,
|
|
4008
|
+
sorting: u.value
|
|
4009
|
+
})), c = B(
|
|
4010
|
+
() => rn(t.persistStateStorage)
|
|
4011
|
+
), p = B(
|
|
4012
|
+
() => t.isServerTable ? t.totalRecords : h.value.getFilteredRowModel().rows?.length
|
|
4013
|
+
), m = B(
|
|
4014
|
+
() => h.value.getSelectedRowModel().rows.map((v) => v.original)
|
|
4015
|
+
), h = B(
|
|
4016
|
+
() => Ut({
|
|
4017
|
+
columns: i,
|
|
4018
|
+
state: {
|
|
4019
|
+
columnFilters: r.value,
|
|
4020
|
+
columnOrder: s.value?.length ? s.value : t.visibleColumns,
|
|
4021
|
+
columnVisibility: l.value,
|
|
4022
|
+
pagination: a.value,
|
|
4023
|
+
rowSelection: d.value,
|
|
4024
|
+
get sorting() {
|
|
4025
|
+
return u.value;
|
|
4026
|
+
}
|
|
4027
|
+
},
|
|
4028
|
+
onColumnFiltersChange: (v) => {
|
|
4029
|
+
r.value = typeof v == "function" ? v(r.value) : v, Array.isArray(r.value) || (r.value = []), a.value.pageIndex = Me, t.isServerTable && (r.value = t.columnsData.filter(
|
|
4030
|
+
(w) => w.enableColumnFilter && (t.visibleColumns.includes(
|
|
4031
|
+
String(w.accessorKey ?? w.id)
|
|
4032
|
+
) || !t.visibleColumns.length)
|
|
4033
|
+
).map((w) => {
|
|
4034
|
+
if (w.meta?.filterVariant === "range") {
|
|
4035
|
+
const I = r.value.find(
|
|
4036
|
+
(q) => q?.id === w.accessorKey
|
|
4037
|
+
)?.value, [_, k] = I || [], E = w.meta?.serverFilterFn || (typeof _ == "number" && typeof k == "number" && _ <= k ? "between" : typeof _ == "number" && !k ? "greaterThanOrEqual" : typeof k == "number" ? "lessThanOrEqual" : null);
|
|
4038
|
+
return E && I?.length ? {
|
|
4039
|
+
filterFn: E,
|
|
4040
|
+
id: w.accessorKey,
|
|
4041
|
+
value: I
|
|
4042
|
+
} : void 0;
|
|
4043
|
+
} else
|
|
4044
|
+
return {
|
|
4045
|
+
filterFn: w?.meta?.serverFilterFn,
|
|
4046
|
+
id: w.accessorKey,
|
|
4047
|
+
value: r.value.find(
|
|
4048
|
+
(I) => I.id === w.accessorKey
|
|
4049
|
+
)?.value
|
|
4050
|
+
};
|
|
4051
|
+
}).filter(Boolean), R());
|
|
4052
|
+
},
|
|
4053
|
+
onColumnVisibilityChange: (v) => {
|
|
4054
|
+
l.value = typeof v == "function" ? v(l.value) : v;
|
|
4055
|
+
},
|
|
4056
|
+
onPaginationChange: (v) => {
|
|
4057
|
+
a.value = typeof v == "function" ? v(a.value) : v, t.isServerTable && R();
|
|
4058
|
+
},
|
|
4059
|
+
onRowSelectionChange: (v) => {
|
|
4060
|
+
d.value = typeof v == "function" ? v(d.value) : v, n("change:rowSelection", m.value);
|
|
4061
|
+
},
|
|
4062
|
+
onSortingChange: (v) => {
|
|
4063
|
+
u.value = typeof v == "function" ? v(u.value) : v, t.isServerTable && R();
|
|
4064
|
+
},
|
|
4065
|
+
columnResizeMode: "onChange",
|
|
4066
|
+
data: t.data,
|
|
4067
|
+
enableSortingRemoval: t.enableSortingRemoval,
|
|
4068
|
+
getCoreRowModel: Gt(),
|
|
4069
|
+
getFilteredRowModel: Nt(),
|
|
4070
|
+
getPaginationRowModel: jt(),
|
|
4071
|
+
getSortedRowModel: qt(),
|
|
4072
|
+
manualFiltering: t.isServerTable,
|
|
4073
|
+
manualSorting: t.isServerTable,
|
|
4074
|
+
manualPagination: t.isServerTable,
|
|
4075
|
+
...t.tableOptions
|
|
4076
|
+
})
|
|
4077
|
+
);
|
|
4078
|
+
St(
|
|
4079
|
+
[r, s, l, a, u],
|
|
4080
|
+
() => {
|
|
4081
|
+
t.persistState && t.id && vt(t.id, g.value, c.value);
|
|
4082
|
+
}
|
|
4083
|
+
);
|
|
4084
|
+
const R = () => {
|
|
4085
|
+
const v = mi(
|
|
4086
|
+
u.value,
|
|
4087
|
+
r.value,
|
|
4088
|
+
a.value
|
|
4089
|
+
);
|
|
4090
|
+
n("update:request", v);
|
|
4091
|
+
}, $ = () => {
|
|
4092
|
+
r.value = t.initialFilters, s.value = [], l.value = {}, a.value = {
|
|
4093
|
+
pageIndex: Me,
|
|
4094
|
+
pageSize: t.paginated ? t.rowPerPage : t.data.length
|
|
4095
|
+
}, u.value = t.initialSorting;
|
|
4096
|
+
}, P = () => {
|
|
4097
|
+
if (t.enableRowSelection && i.push({
|
|
4098
|
+
accessorKey: "select",
|
|
4099
|
+
header: ({ table: v }) => W(Ee, {
|
|
4100
|
+
"aria-label": "Select all",
|
|
4101
|
+
modelValue: v.getIsAllPageRowsSelected(),
|
|
4102
|
+
"onUpdate:modelValue": () => v.toggleAllPageRowsSelected(!v.getIsAllPageRowsSelected())
|
|
4103
|
+
}),
|
|
4104
|
+
cell: ({ row: v }) => W(Ee, {
|
|
4105
|
+
"aria-label": "Select row",
|
|
4106
|
+
modelValue: v.getIsSelected(),
|
|
4107
|
+
"onUpdate:modelValue": () => v.toggleSelected(!v.getIsSelected())
|
|
4108
|
+
}),
|
|
4109
|
+
align: "center",
|
|
4110
|
+
enableColumnFilter: !1,
|
|
4111
|
+
enableSorting: !1
|
|
4112
|
+
}), t.columnsData.forEach((v) => {
|
|
4113
|
+
t.visibleColumns.length && !t.visibleColumns.includes(String(v.accessorKey ?? v.id)) || (v.meta?.filterVariant === "multiselect" && !v.filterFn ? v.filterFn = (w, I, _) => !_ || _.length === 0 ? w : _.some((k) => w.getValue(I) == k) : v.meta?.filterVariant === "select" && !v.filterFn ? v.filterFn = (w, I, _) => _ === void 0 || _.length === 0 ? !0 : String(_) === String(w.getValue(I)) : v.meta?.filterVariant === "dateRange" && !v.filterFn ? v.filterFn = (w, I, _) => {
|
|
4114
|
+
if (_?.length) {
|
|
4115
|
+
const k = new Date(_[1]).setHours(23, 59, 59, 999), E = new Date(w.getValue(I)), q = new Date(_[0]).setHours(0, 0, 0, 0);
|
|
4116
|
+
return E.getTime() >= q && E.getTime() <= k;
|
|
4117
|
+
}
|
|
4118
|
+
return !0;
|
|
4119
|
+
} : v.meta?.filterVariant === "range" && (v.filterFn = (w, I, _) => {
|
|
4120
|
+
if (!Array.isArray(_))
|
|
4121
|
+
return !0;
|
|
4122
|
+
const [k, E] = _, q = w.getValue(I);
|
|
4123
|
+
return k && E ? q >= k && q <= E : k ? q >= k : E ? q <= E : !0;
|
|
4124
|
+
}), i.push({
|
|
4125
|
+
...v,
|
|
4126
|
+
enableColumnFilter: v.enableColumnFilter ?? !1,
|
|
4127
|
+
enableSorting: v.enableSorting ?? !1
|
|
4128
|
+
}));
|
|
4129
|
+
}), t.dataActionMenu.length && i.push({
|
|
4130
|
+
accessorKey: "actions",
|
|
4131
|
+
align: "center",
|
|
4132
|
+
enableColumnFilter: !1,
|
|
4133
|
+
enableSorting: !1,
|
|
4134
|
+
header: () => W(z, {
|
|
4135
|
+
icon: "prime:cog",
|
|
4136
|
+
width: "24"
|
|
4137
|
+
}),
|
|
4138
|
+
cell: ({ row: v }) => W(bi, {
|
|
4139
|
+
actions: t.dataActionMenu,
|
|
4140
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4141
|
+
data: v.original,
|
|
4142
|
+
displayActions: t.displayActions,
|
|
4143
|
+
singleActionMode: t.singleActionMode,
|
|
4144
|
+
"onAction:click": () => n("action:click", v.original),
|
|
4145
|
+
"onAction:select": (w) => n("action:select", {
|
|
4146
|
+
action: w?.key || w?.label,
|
|
4147
|
+
data: v.original
|
|
4148
|
+
})
|
|
4149
|
+
})
|
|
4150
|
+
}), t.persistState && !t.id)
|
|
4151
|
+
throw new Error('Id is required when prop "persistState" is true');
|
|
4152
|
+
D(), t.isServerTable && R();
|
|
4153
|
+
}, D = () => {
|
|
4154
|
+
if (!t.persistState || !t.id)
|
|
4155
|
+
return;
|
|
4156
|
+
const v = hi(t.id, c.value);
|
|
4157
|
+
v && (r.value = v.columnFilters, s.value = v.columnOrder, l.value = v.columnVisibility, u.value = v.sorting, t.rowPerPageOptions.includes(v.pagination.pageSize) && (a.value = v.pagination)), vt(t.id, g.value, c.value);
|
|
4158
|
+
};
|
|
4159
|
+
return P(), (v, w) => (S(), y("div", {
|
|
4160
|
+
id: e.id,
|
|
4161
|
+
class: "table-container"
|
|
4162
|
+
}, [
|
|
4163
|
+
e.isLoading ? (S(), y("div", Bi, [
|
|
4164
|
+
A(C(ln), { class: "loading-icon" })
|
|
4165
|
+
])) : V("", !0),
|
|
4166
|
+
e.titleInfo ? (S(), y("span", {
|
|
4167
|
+
key: 1,
|
|
4168
|
+
"data-align": e.titleInfo.align || "center"
|
|
4169
|
+
}, H(e.titleInfo.text), 9, Hi)) : V("", !0),
|
|
4170
|
+
e.showColumnAction || e.showResetButton || v.$slots.toolbar ? (S(), M(Oi, {
|
|
4171
|
+
key: 2,
|
|
4172
|
+
"column-action-button-label": e.columnActionButtonLabel,
|
|
4173
|
+
"has-actions-column": !!e.dataActionMenu.length,
|
|
4174
|
+
"has-selection-column": e.enableRowSelection,
|
|
4175
|
+
"reset-button-label": e.resetButtonLabel,
|
|
4176
|
+
"show-column-action": e.showColumnAction,
|
|
4177
|
+
"show-reset-button": e.showResetButton,
|
|
4178
|
+
table: h.value,
|
|
4179
|
+
"onOn:reset": $,
|
|
4180
|
+
"onOn:drag": w[0] || (w[0] = (I) => s.value = I)
|
|
4181
|
+
}, {
|
|
4182
|
+
default: T(() => [
|
|
4183
|
+
Q(v.$slots, "toolbar")
|
|
4184
|
+
]),
|
|
4185
|
+
_: 3
|
|
4186
|
+
}, 8, ["column-action-button-label", "has-actions-column", "has-selection-column", "reset-button-label", "show-column-action", "show-reset-button", "table"])) : V("", !0),
|
|
4187
|
+
x("div", zi, [
|
|
4188
|
+
x("table", {
|
|
4189
|
+
style: te(`width: ${h.value.getCenterTotalSize()}`)
|
|
4190
|
+
}, [
|
|
4191
|
+
A(ki, {
|
|
4192
|
+
"input-debounce-time": e.inputDebounceTime,
|
|
4193
|
+
"is-filter-row-visible": f.value,
|
|
4194
|
+
table: h.value
|
|
4195
|
+
}, null, 8, ["input-debounce-time", "is-filter-row-visible", "table"]),
|
|
4196
|
+
A(yi, {
|
|
4197
|
+
"custom-formatters": e.customFormatters,
|
|
4198
|
+
"empty-table-message": e.emptyTableMessage,
|
|
4199
|
+
table: h.value
|
|
4200
|
+
}, null, 8, ["custom-formatters", "empty-table-message", "table"]),
|
|
4201
|
+
v.$slots.footer ? (S(), y("tfoot", Gi, [
|
|
4202
|
+
Q(v.$slots, "footer")
|
|
4203
|
+
])) : V("", !0)
|
|
4204
|
+
], 4),
|
|
4205
|
+
(e.isServerTable || e.paginated) && p.value > 0 ? Q(v.$slots, "pagination", { key: 0 }, () => [
|
|
4206
|
+
A(gi, ee(e.paginationOptions, {
|
|
4207
|
+
"current-page": a.value.pageIndex,
|
|
4208
|
+
"default-items-per-page": a.value.pageSize,
|
|
4209
|
+
"items-per-page-options": e.rowPerPageOptions,
|
|
4210
|
+
"total-items": p.value,
|
|
4211
|
+
"onUpdate:currentPage": h.value.setPageIndex,
|
|
4212
|
+
"onUpdate:itemsPerPage": h.value.setPageSize
|
|
4213
|
+
}), null, 16, ["current-page", "default-items-per-page", "items-per-page-options", "total-items", "onUpdate:currentPage", "onUpdate:itemsPerPage"])
|
|
4214
|
+
]) : V("", !0)
|
|
4215
|
+
])
|
|
4216
|
+
], 8, Ti));
|
|
4217
|
+
}
|
|
4218
|
+
}), qi = {
|
|
4219
|
+
name: "FilesTable"
|
|
4220
|
+
}, Ui = /* @__PURE__ */ K({
|
|
4221
|
+
...qi,
|
|
4222
|
+
props: {
|
|
4223
|
+
archiveFile: Boolean,
|
|
4224
|
+
columnsData: {
|
|
4225
|
+
default: () => [],
|
|
4226
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4227
|
+
type: Array
|
|
4228
|
+
},
|
|
4229
|
+
deleteFile: Boolean,
|
|
4230
|
+
downloadFile: Boolean,
|
|
4231
|
+
editDescription: Boolean,
|
|
4232
|
+
initialSorting: {
|
|
4233
|
+
default: () => [],
|
|
4234
|
+
type: Array
|
|
4235
|
+
},
|
|
4236
|
+
files: {
|
|
4237
|
+
default: () => [],
|
|
4238
|
+
type: Array
|
|
4239
|
+
},
|
|
4240
|
+
id: {
|
|
4241
|
+
default: "files-table",
|
|
4242
|
+
type: String
|
|
4243
|
+
},
|
|
4244
|
+
isLoading: Boolean,
|
|
4245
|
+
isServerTable: Boolean,
|
|
4246
|
+
persistState: Boolean,
|
|
4247
|
+
persistStateStorage: {
|
|
4248
|
+
default: "localStorage",
|
|
4249
|
+
type: String,
|
|
4250
|
+
validator: (e) => ["localStorage", "sessionStorage"].includes(e)
|
|
4251
|
+
},
|
|
4252
|
+
messages: {
|
|
4253
|
+
default: void 0,
|
|
4254
|
+
type: Object
|
|
4255
|
+
},
|
|
4256
|
+
shareFile: Boolean,
|
|
4257
|
+
tableOptions: {
|
|
4258
|
+
default: () => ({}),
|
|
4259
|
+
type: Object
|
|
4260
|
+
},
|
|
4261
|
+
totalRecords: {
|
|
4262
|
+
default: 0,
|
|
4263
|
+
type: Number
|
|
4264
|
+
},
|
|
4265
|
+
viewFile: Boolean,
|
|
4266
|
+
visibleColumns: {
|
|
4267
|
+
default: () => [],
|
|
4268
|
+
type: Array
|
|
4269
|
+
}
|
|
4270
|
+
},
|
|
4271
|
+
emits: [
|
|
4272
|
+
"action:archive",
|
|
4273
|
+
"action:delete",
|
|
4274
|
+
"action:download",
|
|
4275
|
+
"action:edit",
|
|
4276
|
+
"action:share",
|
|
4277
|
+
"action:view",
|
|
4278
|
+
"update:request"
|
|
4279
|
+
],
|
|
4280
|
+
setup(e, { emit: o }) {
|
|
4281
|
+
const t = e, n = o, i = [
|
|
4282
|
+
{
|
|
4283
|
+
accessorKey: "originalFileName",
|
|
4284
|
+
enableColumnFilter: !0,
|
|
4285
|
+
enableSorting: !0,
|
|
4286
|
+
filterPlaceholder: "File name",
|
|
4287
|
+
header: "File"
|
|
4288
|
+
},
|
|
4289
|
+
{
|
|
4290
|
+
accessorKey: "description",
|
|
4291
|
+
enableColumnFilter: !0,
|
|
4292
|
+
enableSorting: !0,
|
|
4293
|
+
filterPlaceholder: "Description",
|
|
4294
|
+
header: "Description",
|
|
4295
|
+
tooltip: !0
|
|
4296
|
+
},
|
|
4297
|
+
{
|
|
4298
|
+
accessorKey: "size",
|
|
4299
|
+
enableColumnFilter: !t.isServerTable,
|
|
4300
|
+
enableSorting: !t.isServerTable,
|
|
4301
|
+
filterPlaceholder: "Size",
|
|
4302
|
+
header: "Size",
|
|
4303
|
+
meta: {
|
|
4304
|
+
filterVariant: "range"
|
|
4305
|
+
}
|
|
4306
|
+
},
|
|
4307
|
+
{
|
|
4308
|
+
accessorKey: "uploadedBy",
|
|
4309
|
+
cell: ({ row: { original: u } }) => u.uploadedBy ? u.uploadedBy.givenName || u.uploadedBy.lastName ? `${u.uploadedBy.givenName || ""} ${u.uploadedBy.lastName || ""}` : u.uploadedBy.email : W("code", {}, "—"),
|
|
4310
|
+
enableColumnFilter: !t.isServerTable,
|
|
4311
|
+
enableSorting: !t.isServerTable,
|
|
4312
|
+
filterFn: (u, f, g) => {
|
|
4313
|
+
const c = u.getValue(f);
|
|
4314
|
+
return !g || g.length === 0 ? !0 : `${c.givenName || ""} ${c.lastName || ""}`.trim().toLowerCase().includes(g.toLowerCase()) || (c.email?.toLowerCase().includes(g.toLowerCase()) ?? !1);
|
|
4315
|
+
},
|
|
4316
|
+
filterPlaceholder: "Name",
|
|
4317
|
+
header: "Uploaded by"
|
|
4318
|
+
},
|
|
4319
|
+
{
|
|
4320
|
+
accessorKey: "uploadedAt",
|
|
4321
|
+
cell: ({ getValue: u }) => ke(u()),
|
|
4322
|
+
enableColumnFilter: !0,
|
|
4323
|
+
enableSorting: !0,
|
|
4324
|
+
filterPlaceholder: "Date range",
|
|
4325
|
+
header: "Uploaded at",
|
|
4326
|
+
meta: {
|
|
4327
|
+
filterVariant: "dateRange",
|
|
4328
|
+
serverFilterFn: "between"
|
|
4329
|
+
}
|
|
4330
|
+
},
|
|
4331
|
+
{
|
|
4332
|
+
accessorKey: "downloadCount",
|
|
4333
|
+
align: "right",
|
|
4334
|
+
enableColumnFilter: !0,
|
|
4335
|
+
enableSorting: !0,
|
|
4336
|
+
filterPlaceholder: "Number of downloads",
|
|
4337
|
+
header: "Download count",
|
|
4338
|
+
meta: {
|
|
4339
|
+
filterVariant: "range"
|
|
4340
|
+
}
|
|
4341
|
+
},
|
|
4342
|
+
{
|
|
4343
|
+
accessorKey: "lastDownloadedAt",
|
|
4344
|
+
cell: ({ getValue: u }) => u() ? ke(u()) : W("code", {}, "—"),
|
|
4345
|
+
enableColumnFilter: !0,
|
|
4346
|
+
enableSorting: !0,
|
|
4347
|
+
filterPlaceholder: "Date range",
|
|
4348
|
+
header: "Last downloaded at",
|
|
4349
|
+
meta: {
|
|
4350
|
+
filterVariant: "dateRange",
|
|
4351
|
+
serverFilterFn: "between"
|
|
4352
|
+
}
|
|
4353
|
+
}
|
|
4354
|
+
], r = B(() => {
|
|
4355
|
+
const u = [];
|
|
4356
|
+
return t.archiveFile && u.push({
|
|
4357
|
+
confirmationOptions: {
|
|
4358
|
+
body: t.messages?.archiveConfirmationMessage || "Are you sure you want to archive this file?",
|
|
4359
|
+
header: t.messages?.archiveConfirmationHeader || "Archive file"
|
|
4360
|
+
},
|
|
4361
|
+
icon: "pi pi-book",
|
|
4362
|
+
key: "archive",
|
|
4363
|
+
label: t.messages?.archiveAction || "Archive",
|
|
4364
|
+
requireConfirmationModal: !0
|
|
4365
|
+
}), t.downloadFile && u.push({
|
|
4366
|
+
icon: "pi pi-download",
|
|
4367
|
+
key: "download",
|
|
4368
|
+
label: t.messages?.downloadAction || "Download"
|
|
4369
|
+
}), t.editDescription && u.push({
|
|
4370
|
+
icon: "pi pi-pencil",
|
|
4371
|
+
key: "edit",
|
|
4372
|
+
label: t.messages?.editDescriptionAction || "Edit description"
|
|
4373
|
+
}), t.shareFile && u.push({
|
|
4374
|
+
icon: "pi pi-share-alt",
|
|
4375
|
+
key: "share",
|
|
4376
|
+
label: t.messages?.shareAction || "Share"
|
|
4377
|
+
}), t.viewFile && u.push({
|
|
4378
|
+
icon: "pi pi-eye",
|
|
4379
|
+
key: "view",
|
|
4380
|
+
label: t.messages?.viewAction || "View"
|
|
4381
|
+
}), t.deleteFile && u.push({
|
|
4382
|
+
class: "danger",
|
|
4383
|
+
confirmationOptions: {
|
|
4384
|
+
body: t.messages?.deleteConfirmationMessage || "Are you sure you want to delete this file?",
|
|
4385
|
+
header: t.messages?.deleteConfirmationHeader || "Delete file"
|
|
4386
|
+
},
|
|
4387
|
+
icon: "pi pi-trash",
|
|
4388
|
+
label: t.messages?.deleteAction || "Delete",
|
|
4389
|
+
key: "delete",
|
|
4390
|
+
requireConfirmationModal: !0
|
|
4391
|
+
}), u;
|
|
4392
|
+
}), s = B(() => [
|
|
4393
|
+
...i.map((u) => {
|
|
4394
|
+
const f = t.columnsData.find(
|
|
4395
|
+
(g) => g.accessorKey === u.accessorKey
|
|
4396
|
+
);
|
|
4397
|
+
return f ? { ...u, ...f } : u;
|
|
4398
|
+
}),
|
|
4399
|
+
...t.columnsData.filter(
|
|
4400
|
+
(u) => !i.some(
|
|
4401
|
+
(f) => f.accessorKey === u.accessorKey
|
|
4402
|
+
)
|
|
4403
|
+
)
|
|
4404
|
+
]), l = (u) => {
|
|
4405
|
+
t.archiveFile ? n("action:archive", u) : t.downloadFile ? n("action:download", u) : t.editDescription ? n("action:edit", u) : t.shareFile ? n("action:share", u) : t.viewFile ? n("action:view", u) : t.deleteFile && n("action:delete", u);
|
|
4406
|
+
}, a = (u) => {
|
|
4407
|
+
switch (u.action) {
|
|
4408
|
+
case "archive":
|
|
4409
|
+
n("action:archive", u.data);
|
|
4410
|
+
break;
|
|
4411
|
+
case "delete":
|
|
4412
|
+
n("action:delete", u.data);
|
|
4413
|
+
break;
|
|
4414
|
+
case "download":
|
|
4415
|
+
n("action:download", u.data);
|
|
4416
|
+
break;
|
|
4417
|
+
case "edit":
|
|
4418
|
+
n("action:edit", u.data);
|
|
4419
|
+
break;
|
|
4420
|
+
case "share":
|
|
4421
|
+
n("action:share", u.data);
|
|
4422
|
+
break;
|
|
4423
|
+
case "view":
|
|
4424
|
+
n("action:view", u.data);
|
|
4425
|
+
break;
|
|
4426
|
+
}
|
|
4427
|
+
}, d = (u) => {
|
|
4428
|
+
n("update:request", u);
|
|
4429
|
+
};
|
|
4430
|
+
return (u, f) => (S(), M(ji, ee(e.tableOptions, {
|
|
4431
|
+
id: e.id,
|
|
4432
|
+
"columns-data": s.value,
|
|
4433
|
+
data: e.files,
|
|
4434
|
+
"data-action-menu": r.value,
|
|
4435
|
+
"empty-table-message": t.messages?.tableEmpty || "The table is empty",
|
|
4436
|
+
"initial-sorting": e.initialSorting,
|
|
4437
|
+
"is-loading": e.isLoading,
|
|
4438
|
+
"is-server-table": e.isServerTable,
|
|
4439
|
+
"persist-state": e.persistState,
|
|
4440
|
+
"persist-state-storage": e.persistStateStorage,
|
|
4441
|
+
"total-records": e.totalRecords,
|
|
4442
|
+
"visible-columns": e.visibleColumns,
|
|
4443
|
+
class: "table-files",
|
|
4444
|
+
"onAction:click": l,
|
|
4445
|
+
"onAction:select": a,
|
|
4446
|
+
"onUpdate:request": d
|
|
4447
|
+
}), Ct({ _: 2 }, [
|
|
4448
|
+
u.$slots.toolbar ? {
|
|
4449
|
+
name: "toolbar",
|
|
4450
|
+
fn: T(() => [
|
|
4451
|
+
Q(u.$slots, "toolbar")
|
|
4452
|
+
]),
|
|
4453
|
+
key: "0"
|
|
4454
|
+
} : void 0,
|
|
4455
|
+
u.$slots.footer ? {
|
|
4456
|
+
name: "footer",
|
|
4457
|
+
fn: T(() => [
|
|
4458
|
+
Q(u.$slots, "footer")
|
|
4459
|
+
]),
|
|
4460
|
+
key: "1"
|
|
4461
|
+
} : void 0,
|
|
4462
|
+
u.$slots.pagination ? {
|
|
4463
|
+
name: "pagination",
|
|
4464
|
+
fn: T(() => [
|
|
4465
|
+
Q(u.$slots, "pagination")
|
|
4466
|
+
]),
|
|
4467
|
+
key: "2"
|
|
4468
|
+
} : void 0
|
|
4469
|
+
]), 1040, ["id", "columns-data", "data", "data-action-menu", "empty-table-message", "initial-sorting", "is-loading", "is-server-table", "persist-state", "persist-state-storage", "total-records", "visible-columns"]));
|
|
4470
|
+
}
|
|
4471
|
+
}), Ki = {
|
|
4472
|
+
name: "FilesPresentation"
|
|
4473
|
+
}, mr = /* @__PURE__ */ K({
|
|
4474
|
+
...Ki,
|
|
4475
|
+
props: {
|
|
4476
|
+
actionButtonsVisibility: {
|
|
4477
|
+
default: () => ({
|
|
4478
|
+
archive: !0,
|
|
4479
|
+
delete: !0,
|
|
4480
|
+
download: !0,
|
|
4481
|
+
edit: !0,
|
|
4482
|
+
share: !0,
|
|
4483
|
+
view: !0
|
|
4484
|
+
}),
|
|
4485
|
+
type: Object
|
|
4486
|
+
},
|
|
4487
|
+
files: {
|
|
4488
|
+
default: () => [],
|
|
4489
|
+
type: Array
|
|
4490
|
+
},
|
|
4491
|
+
messages: {
|
|
4492
|
+
default: void 0,
|
|
4493
|
+
type: Object
|
|
4494
|
+
},
|
|
4495
|
+
listProps: {
|
|
4496
|
+
default: () => {
|
|
4497
|
+
},
|
|
4498
|
+
type: Object
|
|
4499
|
+
},
|
|
4500
|
+
presentation: {
|
|
4501
|
+
default: () => "list",
|
|
4502
|
+
type: String,
|
|
4503
|
+
validator: (e) => ["list", "table"].includes(e)
|
|
4504
|
+
},
|
|
4505
|
+
tableProps: {
|
|
4506
|
+
default: () => {
|
|
4507
|
+
},
|
|
4508
|
+
type: Object
|
|
4509
|
+
},
|
|
4510
|
+
visibleFileDetails: {
|
|
4511
|
+
default: () => [
|
|
4512
|
+
"actions",
|
|
4513
|
+
"description",
|
|
4514
|
+
"downloadCount",
|
|
4515
|
+
"lastDownloadedAt",
|
|
4516
|
+
"originalFileName",
|
|
4517
|
+
"size",
|
|
4518
|
+
"uploadedAt",
|
|
4519
|
+
"uploadedBy"
|
|
4520
|
+
],
|
|
4521
|
+
type: Array
|
|
4522
|
+
}
|
|
4523
|
+
},
|
|
4524
|
+
emits: [
|
|
4525
|
+
"action:archive",
|
|
4526
|
+
"action:delete",
|
|
4527
|
+
"action:download",
|
|
4528
|
+
"action:edit",
|
|
4529
|
+
"action:share",
|
|
4530
|
+
"action:view"
|
|
4531
|
+
],
|
|
4532
|
+
setup(e, { emit: o }) {
|
|
4533
|
+
const t = e, n = o, i = B(() => Object.fromEntries(
|
|
4534
|
+
[
|
|
4535
|
+
"actions",
|
|
4536
|
+
"description",
|
|
4537
|
+
"downloadCount",
|
|
4538
|
+
"lastDownloadedAt",
|
|
4539
|
+
"originalFileName",
|
|
4540
|
+
"size",
|
|
4541
|
+
"uploadedAt",
|
|
4542
|
+
"uploadedBy"
|
|
4543
|
+
].map((l) => [l, t.visibleFileDetails.includes(l)])
|
|
4544
|
+
)), r = (s, l) => {
|
|
4545
|
+
switch (s) {
|
|
4546
|
+
case "archive":
|
|
4547
|
+
case "delete":
|
|
4548
|
+
case "download":
|
|
4549
|
+
case "edit":
|
|
4550
|
+
case "share":
|
|
4551
|
+
case "view":
|
|
4552
|
+
n(`action:${s}`, l);
|
|
4553
|
+
break;
|
|
4554
|
+
}
|
|
4555
|
+
};
|
|
4556
|
+
return (s, l) => e.presentation === "list" ? (S(), M(C(sn), ee({ key: 0 }, e.listProps, {
|
|
4557
|
+
"action-buttons-visibility": e.actionButtonsVisibility,
|
|
4558
|
+
files: e.files,
|
|
4559
|
+
"file-detail-visibility": i.value,
|
|
4560
|
+
messages: e.messages,
|
|
4561
|
+
"onAction:archive": l[0] || (l[0] = (a) => r("archive", a)),
|
|
4562
|
+
"onAction:delete": l[1] || (l[1] = (a) => r("delete", a)),
|
|
4563
|
+
"onAction:download": l[2] || (l[2] = (a) => r("download", a)),
|
|
4564
|
+
"onAction:edit": l[3] || (l[3] = (a) => r("edit", a)),
|
|
4565
|
+
"onAction:share": l[4] || (l[4] = (a) => r("share", a)),
|
|
4566
|
+
"onAction:view": l[5] || (l[5] = (a) => r("view", a))
|
|
4567
|
+
}), null, 16, ["action-buttons-visibility", "files", "file-detail-visibility", "messages"])) : (S(), M(Ui, ee({ key: 1 }, e.tableProps, {
|
|
4568
|
+
"archive-file": e.actionButtonsVisibility.archive,
|
|
4569
|
+
"delete-file": e.actionButtonsVisibility.delete,
|
|
4570
|
+
"download-file": e.actionButtonsVisibility.download,
|
|
4571
|
+
"edit-description": e.actionButtonsVisibility.edit,
|
|
4572
|
+
files: e.files,
|
|
4573
|
+
messages: e.messages,
|
|
4574
|
+
"share-file": e.actionButtonsVisibility.share,
|
|
4575
|
+
"view-file": e.actionButtonsVisibility.view,
|
|
4576
|
+
"visible-columns": e.visibleFileDetails,
|
|
4577
|
+
"onAction:archive": l[6] || (l[6] = (a) => r("archive", a)),
|
|
4578
|
+
"onAction:delete": l[7] || (l[7] = (a) => r("delete", a)),
|
|
4579
|
+
"onAction:download": l[8] || (l[8] = (a) => r("download", a)),
|
|
4580
|
+
"onAction:edit": l[9] || (l[9] = (a) => r("edit", a)),
|
|
4581
|
+
"onAction:share": l[10] || (l[10] = (a) => r("share", a)),
|
|
4582
|
+
"onAction:view": l[11] || (l[11] = (a) => r("view", a))
|
|
4583
|
+
}), null, 16, ["archive-file", "delete-file", "download-file", "edit-description", "files", "messages", "share-file", "view-file", "visible-columns"]));
|
|
4584
|
+
}
|
|
4585
|
+
}), Wi = { class: "table-wrapper" }, Xi = {
|
|
4586
|
+
key: 0,
|
|
4587
|
+
class: "toggle-wrap"
|
|
4588
|
+
}, Qi = ["colSpan", "onClick"], Ji = { key: 0 }, Zi = ["data-label"], Yi = { class: "page-navigation-container" }, er = { class: "page-indicators-selection-container" }, tr = { class: "page-number-indicators" }, nr = { class: "go-to-page-container" }, or = ["value", "max"], ir = ["value"], rr = ["value"], lr = { class: "page-navigation-buttons-container" }, sr = ["disabled"], ar = ["disabled"], ur = ["disabled"], cr = ["disabled"], dr = {
|
|
4589
|
+
name: "TanstackTable"
|
|
4590
|
+
}, hr = /* @__PURE__ */ K({
|
|
4591
|
+
...dr,
|
|
4592
|
+
props: {
|
|
4593
|
+
columnsData: {
|
|
4594
|
+
type: Array,
|
|
4595
|
+
default: () => []
|
|
4596
|
+
},
|
|
4597
|
+
rows: {
|
|
4598
|
+
type: Array,
|
|
4599
|
+
default: () => []
|
|
4600
|
+
},
|
|
4601
|
+
enableToggle: {
|
|
4602
|
+
type: Boolean,
|
|
4603
|
+
default: () => !1
|
|
4604
|
+
}
|
|
4605
|
+
},
|
|
4606
|
+
setup(e) {
|
|
4607
|
+
const o = e, t = uo(), n = [];
|
|
4608
|
+
o.columnsData.forEach((u) => {
|
|
4609
|
+
const f = t.accessor(
|
|
4610
|
+
u.accessorKey,
|
|
4611
|
+
{
|
|
4612
|
+
header: () => u.header,
|
|
4613
|
+
footer: (g) => g.column.id,
|
|
4614
|
+
enableSorting: u.sort !== void 0 ? u.sort : !1
|
|
4615
|
+
}
|
|
4616
|
+
);
|
|
4617
|
+
n.push(f);
|
|
4618
|
+
});
|
|
4619
|
+
const i = j([]), r = Ut({
|
|
4620
|
+
columns: n,
|
|
4621
|
+
state: {
|
|
4622
|
+
get sorting() {
|
|
4623
|
+
return i.value;
|
|
4624
|
+
}
|
|
4625
|
+
},
|
|
4626
|
+
onSortingChange: (u) => {
|
|
4627
|
+
i.value = typeof u == "function" ? u(i.value) : u;
|
|
4628
|
+
},
|
|
4629
|
+
columnResizeMode: "onChange",
|
|
4630
|
+
data: o.rows,
|
|
4631
|
+
getCoreRowModel: Gt(),
|
|
4632
|
+
getFilteredRowModel: Nt(),
|
|
4633
|
+
getPaginationRowModel: jt(),
|
|
4634
|
+
getSortedRowModel: qt()
|
|
4635
|
+
}), s = j(!1), l = () => {
|
|
4636
|
+
s.value = !s.value;
|
|
4637
|
+
}, a = (u) => {
|
|
4638
|
+
const f = u.target, g = f.value ? Number(f.value) - 1 : 0;
|
|
4639
|
+
r.setPageIndex(g);
|
|
4640
|
+
}, d = (u) => {
|
|
4641
|
+
const f = u.target, g = f.value ? Number(f.value) : 10;
|
|
4642
|
+
r.setPageSize(g);
|
|
4643
|
+
};
|
|
4644
|
+
return (u, f) => (S(), y("div", Wi, [
|
|
4645
|
+
x("table", {
|
|
4646
|
+
style: te(`width: ${C(r).getCenterTotalSize()}`)
|
|
4647
|
+
}, [
|
|
4648
|
+
o.enableToggle ? (S(), y("div", Xi, [
|
|
4649
|
+
x("button", {
|
|
4650
|
+
class: "table-toggle",
|
|
4651
|
+
onClick: l
|
|
4652
|
+
}, [
|
|
4653
|
+
A(C(z), {
|
|
4654
|
+
icon: "mingcute:menu-fill",
|
|
4655
|
+
class: "toggle-icon"
|
|
4656
|
+
})
|
|
4657
|
+
])
|
|
4658
|
+
])) : V("", !0),
|
|
4659
|
+
x("colgroup", null, [
|
|
4660
|
+
(S(!0), y(L, null, G(o.columnsData, (g) => (S(), y("col", {
|
|
4661
|
+
key: g.accessorKey,
|
|
4662
|
+
style: te(`width: ${g.size}px`)
|
|
4663
|
+
}, null, 4))), 128))
|
|
4664
|
+
]),
|
|
4665
|
+
x("thead", {
|
|
4666
|
+
class: ae({ expand: s.value })
|
|
4667
|
+
}, [
|
|
4668
|
+
(S(!0), y(L, null, G(C(r).getHeaderGroups(), (g) => (S(), y("tr", {
|
|
4669
|
+
key: g.id
|
|
4670
|
+
}, [
|
|
4671
|
+
(S(!0), y(L, null, G(g.headers, (c) => (S(), y("th", {
|
|
4672
|
+
key: c.id,
|
|
4673
|
+
colSpan: c.colSpan,
|
|
4674
|
+
onClick: (p) => c.column.getCanSort() ? c.column.getToggleSortingHandler()?.(p) : null
|
|
4675
|
+
}, [
|
|
4676
|
+
c.isPlaceholder ? V("", !0) : (S(), y("div", Ji, [
|
|
4677
|
+
A(C(ce), {
|
|
4678
|
+
props: c.getContext(),
|
|
4679
|
+
render: c.column.columnDef.header
|
|
4680
|
+
}, null, 8, ["props", "render"]),
|
|
4681
|
+
!c.column.getIsSorted() && c.column.getCanSort() ? (S(), M(C(z), {
|
|
4682
|
+
key: 0,
|
|
4683
|
+
icon: "ri:arrow-up-down-line",
|
|
4684
|
+
class: "sort-icon"
|
|
4685
|
+
})) : V("", !0),
|
|
4686
|
+
c.column.getIsSorted() && c.column.getCanSort() ? (S(), M(C(z), {
|
|
4687
|
+
key: 1,
|
|
4688
|
+
icon: c.column.getIsSorted() === "asc" ? "mdi:arrow-up" : "mdi:arrow-down",
|
|
4689
|
+
class: "sort-icon"
|
|
4690
|
+
}, null, 8, ["icon"])) : V("", !0)
|
|
4691
|
+
]))
|
|
4692
|
+
], 8, Qi))), 128))
|
|
4693
|
+
]))), 128))
|
|
4694
|
+
], 2),
|
|
4695
|
+
x("tbody", null, [
|
|
4696
|
+
(S(!0), y(L, null, G(C(r).getRowModel().rows, (g) => (S(), y("tr", {
|
|
4697
|
+
key: g.id
|
|
4698
|
+
}, [
|
|
4699
|
+
(S(!0), y(L, null, G(g.getVisibleCells(), (c) => (S(), y("td", {
|
|
4700
|
+
key: c.id,
|
|
4701
|
+
"data-label": c.column.id
|
|
4702
|
+
}, [
|
|
4703
|
+
A(C(ce), {
|
|
4704
|
+
props: c.getContext(),
|
|
4705
|
+
render: c.column.columnDef.cell
|
|
4706
|
+
}, null, 8, ["props", "render"])
|
|
4707
|
+
], 8, Zi))), 128))
|
|
4708
|
+
]))), 128))
|
|
4709
|
+
])
|
|
4710
|
+
], 4),
|
|
4711
|
+
x("div", Yi, [
|
|
4712
|
+
x("div", er, [
|
|
4713
|
+
x("span", tr, H(C(r).getState().pagination.pageIndex + 1) + " of " + H(C(r).getPageCount()), 1),
|
|
4714
|
+
x("span", nr, [
|
|
4715
|
+
f[6] || (f[6] = x("span", { class: "go-to-page-text" }, " Go to page: ", -1)),
|
|
4716
|
+
x("input", {
|
|
4717
|
+
class: "page-input",
|
|
4718
|
+
type: "number",
|
|
4719
|
+
value: C(r).getState().pagination.pageIndex + 1,
|
|
4720
|
+
max: C(r).getPageCount(),
|
|
4721
|
+
onInput: f[0] || (f[0] = (g) => a(g))
|
|
4722
|
+
}, null, 40, or)
|
|
4723
|
+
]),
|
|
4724
|
+
x("select", {
|
|
4725
|
+
value: C(r).getState().pagination.pageSize,
|
|
4726
|
+
onChange: f[1] || (f[1] = (g) => d(g))
|
|
4727
|
+
}, [
|
|
4728
|
+
(S(), y(L, null, G([10, 20, 30, 40, 50], (g) => x("option", {
|
|
4729
|
+
key: g,
|
|
4730
|
+
value: g
|
|
4731
|
+
}, " Show " + H(g), 9, rr)), 64))
|
|
4732
|
+
], 40, ir)
|
|
4733
|
+
]),
|
|
4734
|
+
x("div", lr, [
|
|
4735
|
+
x("button", {
|
|
4736
|
+
class: "page-navigation-button",
|
|
4737
|
+
disabled: !C(r).getCanPreviousPage(),
|
|
4738
|
+
onClick: f[2] || (f[2] = (g) => C(r).setPageIndex(0))
|
|
4739
|
+
}, [
|
|
4740
|
+
A(C(z), {
|
|
4741
|
+
icon: "material-symbols:keyboard-double-arrow-left-rounded",
|
|
4742
|
+
class: "navigation-button-icon"
|
|
4743
|
+
})
|
|
4744
|
+
], 8, sr),
|
|
4745
|
+
x("button", {
|
|
4746
|
+
class: "page-navigation-button",
|
|
4747
|
+
disabled: !C(r).getCanPreviousPage(),
|
|
4748
|
+
onClick: f[3] || (f[3] = (g) => C(r).previousPage())
|
|
4749
|
+
}, [
|
|
4750
|
+
A(C(z), {
|
|
4751
|
+
icon: "material-symbols:arrow-back-ios-new-rounded",
|
|
4752
|
+
class: "navigation-button-icon"
|
|
4753
|
+
})
|
|
4754
|
+
], 8, ar),
|
|
4755
|
+
x("button", {
|
|
4756
|
+
class: "page-navigation-button",
|
|
4757
|
+
disabled: !C(r).getCanNextPage(),
|
|
4758
|
+
onClick: f[4] || (f[4] = (g) => C(r).nextPage())
|
|
4759
|
+
}, [
|
|
4760
|
+
A(C(z), {
|
|
4761
|
+
icon: "material-symbols:arrow-forward-ios-rounded",
|
|
4762
|
+
class: "navigation-button-icon"
|
|
4763
|
+
})
|
|
4764
|
+
], 8, ur),
|
|
4765
|
+
x("button", {
|
|
4766
|
+
class: "page-navigation-button",
|
|
4767
|
+
disabled: !C(r).getCanNextPage(),
|
|
4768
|
+
onClick: f[5] || (f[5] = (g) => C(r).setPageIndex(C(r).getPageCount() - 1))
|
|
4769
|
+
}, [
|
|
4770
|
+
A(C(z), {
|
|
4771
|
+
icon: "material-symbols:keyboard-double-arrow-right-rounded",
|
|
4772
|
+
class: "navigation-button-icon"
|
|
4773
|
+
})
|
|
4774
|
+
], 8, cr)
|
|
4775
|
+
])
|
|
4776
|
+
])
|
|
4777
|
+
]));
|
|
4778
|
+
}
|
|
4779
|
+
});
|
|
4780
|
+
export {
|
|
4781
|
+
mr as FilesPresentation,
|
|
4782
|
+
Ui as FilesTable,
|
|
4783
|
+
ji as Table,
|
|
4784
|
+
yi as TableBody,
|
|
4785
|
+
ki as TableHeader,
|
|
4786
|
+
hr as TanstackTable
|
|
4787
|
+
};
|