@prefabs.tech/vue3-tanstack-table 0.30.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PrefabsTechVue3TanstackTable.es.js +302 -310
- package/dist/PrefabsTechVue3TanstackTable.umd.js +2 -20
- package/dist/src/components/FilesPresentation/Index.vue.d.ts.map +1 -1
- package/dist/src/components/FilesTable/Index.vue.d.ts.map +1 -1
- package/dist/src/components/Table.vue.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/{utils.d.ts → utilities.d.ts} +1 -1
- package/dist/src/utilities.d.ts.map +1 -0
- package/package.json +14 -24
- package/dist/src/utils.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as Q, h as Y, isRef as Jt, shallowRef as Zt, watch as Ct, ref as K, watchEffect as en, unref as y, computed as B,
|
|
2
|
-
import { DebouncedInput as Ft, ButtonElement as Z, formatDateTime as nn, formatDate as on, Tooltip as rn, Dropdown as ln, ConfirmationModal as sn, Popup as an, SortableList as un, getStorage as
|
|
1
|
+
import { defineComponent as Q, h as Y, isRef as Jt, shallowRef as Zt, watch as Ct, ref as K, watchEffect as en, unref as y, computed as B, openBlock as S, createElementBlock as C, createElementVNode as A, toDisplayString as N, Fragment as H, renderList as z, createCommentVNode as D, createVNode as E, createBlock as _, withCtx as G, normalizeClass as ge, normalizeStyle as oe, mergeProps as te, resolveDynamicComponent as ue, createTextVNode as tn, renderSlot as J, createSlots as Rt } from "vue";
|
|
2
|
+
import { DebouncedInput as Ft, ButtonElement as Z, formatDateTime as nn, formatDate as on, Tooltip as rn, Dropdown as ln, ConfirmationModal as sn, Popup as an, SortableList as un, getStorage as cn, LoadingIcon as dn, FilesList as gn } from "@prefabs.tech/vue3-ui";
|
|
3
3
|
import { SelectInput as fn, DatePicker as pn, NumberInput as tt, Checkbox as Te } from "@prefabs.tech/vue3-form";
|
|
4
4
|
const bt = /^[a-z0-9]+(-[a-z0-9]+)*$/, be = (e, o, t, n = "") => {
|
|
5
5
|
const i = e.split(":");
|
|
@@ -323,12 +323,12 @@ function Dn(e, o) {
|
|
|
323
323
|
));
|
|
324
324
|
});
|
|
325
325
|
const l = n.width, s = n.height, a = i.width, u = i.height;
|
|
326
|
-
let
|
|
327
|
-
l === null ? (f = s === null ? "1em" : s === "auto" ? u : s,
|
|
328
|
-
const g = {},
|
|
326
|
+
let d, f;
|
|
327
|
+
l === null ? (f = s === null ? "1em" : s === "auto" ? u : s, d = it(f, a / u)) : (d = l === "auto" ? a : l, f = s === null ? it(d, u / a) : s === "auto" ? u : s);
|
|
328
|
+
const g = {}, c = (p, h) => {
|
|
329
329
|
An(h) || (g[p] = h.toString());
|
|
330
330
|
};
|
|
331
|
-
|
|
331
|
+
c("width", d), c("height", f);
|
|
332
332
|
const m = [i.left, i.top, a, u];
|
|
333
333
|
return g.viewBox = m.join(" "), {
|
|
334
334
|
attributes: g,
|
|
@@ -525,14 +525,14 @@ function jn(e) {
|
|
|
525
525
|
return;
|
|
526
526
|
n = i;
|
|
527
527
|
const r = i.provider, l = i.prefix, s = i.name, a = t[r] || (t[r] = /* @__PURE__ */ Object.create(null)), u = a[l] || (a[l] = ie(r, l));
|
|
528
|
-
let
|
|
529
|
-
s in u.icons ?
|
|
528
|
+
let d;
|
|
529
|
+
s in u.icons ? d = o.loaded : l === "" || u.missing.has(s) ? d = o.missing : d = o.pending;
|
|
530
530
|
const f = {
|
|
531
531
|
provider: r,
|
|
532
532
|
prefix: l,
|
|
533
533
|
name: s
|
|
534
534
|
};
|
|
535
|
-
|
|
535
|
+
d.push(f);
|
|
536
536
|
}), o;
|
|
537
537
|
}
|
|
538
538
|
function _t(e, o) {
|
|
@@ -622,8 +622,8 @@ function Xn(e, o, t, n) {
|
|
|
622
622
|
} else
|
|
623
623
|
l = e.resources.slice(r).concat(e.resources.slice(0, r));
|
|
624
624
|
const s = Date.now();
|
|
625
|
-
let a = "pending", u = 0,
|
|
626
|
-
typeof n == "function" &&
|
|
625
|
+
let a = "pending", u = 0, d, f = null, g = [], c = [];
|
|
626
|
+
typeof n == "function" && c.push(n);
|
|
627
627
|
function m() {
|
|
628
628
|
f && (clearTimeout(f), f = null);
|
|
629
629
|
}
|
|
@@ -633,7 +633,7 @@ function Xn(e, o, t, n) {
|
|
|
633
633
|
}), g = [];
|
|
634
634
|
}
|
|
635
635
|
function h(w, I) {
|
|
636
|
-
I && (
|
|
636
|
+
I && (c = []), typeof w == "function" && c.push(w);
|
|
637
637
|
}
|
|
638
638
|
function R() {
|
|
639
639
|
return {
|
|
@@ -647,8 +647,8 @@ function Xn(e, o, t, n) {
|
|
|
647
647
|
};
|
|
648
648
|
}
|
|
649
649
|
function $() {
|
|
650
|
-
a = "failed",
|
|
651
|
-
w(void 0,
|
|
650
|
+
a = "failed", c.forEach((w) => {
|
|
651
|
+
w(void 0, d);
|
|
652
652
|
});
|
|
653
653
|
}
|
|
654
654
|
function P() {
|
|
@@ -669,18 +669,18 @@ function Xn(e, o, t, n) {
|
|
|
669
669
|
return;
|
|
670
670
|
}
|
|
671
671
|
if (I === "abort") {
|
|
672
|
-
|
|
672
|
+
d = V, $();
|
|
673
673
|
return;
|
|
674
674
|
}
|
|
675
675
|
if (k) {
|
|
676
|
-
|
|
676
|
+
d = V, g.length || (l.length ? v() : $());
|
|
677
677
|
return;
|
|
678
678
|
}
|
|
679
679
|
if (m(), P(), !e.random) {
|
|
680
680
|
const L = e.resources.indexOf(w.resource);
|
|
681
681
|
L !== -1 && L !== e.index && (e.index = L);
|
|
682
682
|
}
|
|
683
|
-
a = "completed",
|
|
683
|
+
a = "completed", c.forEach((L) => {
|
|
684
684
|
L(V);
|
|
685
685
|
});
|
|
686
686
|
}
|
|
@@ -720,7 +720,7 @@ function Mt(e) {
|
|
|
720
720
|
t = t.filter((s) => s().status === "pending");
|
|
721
721
|
}
|
|
722
722
|
function i(s, a, u) {
|
|
723
|
-
const
|
|
723
|
+
const d = Xn(
|
|
724
724
|
o,
|
|
725
725
|
s,
|
|
726
726
|
a,
|
|
@@ -728,7 +728,7 @@ function Mt(e) {
|
|
|
728
728
|
n(), u && u(f, g);
|
|
729
729
|
}
|
|
730
730
|
);
|
|
731
|
-
return t.push(
|
|
731
|
+
return t.push(d), d;
|
|
732
732
|
}
|
|
733
733
|
function r(s) {
|
|
734
734
|
return t.find((a) => s(a)) || null;
|
|
@@ -829,23 +829,23 @@ function to(e, o) {
|
|
|
829
829
|
if (e.loadIcons && (i.length > 1 || !r)) {
|
|
830
830
|
at(
|
|
831
831
|
e.loadIcons(i, n, t),
|
|
832
|
-
(
|
|
833
|
-
le(e, i,
|
|
832
|
+
(d) => {
|
|
833
|
+
le(e, i, d);
|
|
834
834
|
}
|
|
835
835
|
);
|
|
836
836
|
return;
|
|
837
837
|
}
|
|
838
838
|
if (r) {
|
|
839
|
-
i.forEach((
|
|
840
|
-
const f = r(
|
|
839
|
+
i.forEach((d) => {
|
|
840
|
+
const f = r(d, n, t);
|
|
841
841
|
at(f, (g) => {
|
|
842
|
-
const
|
|
842
|
+
const c = g ? {
|
|
843
843
|
prefix: n,
|
|
844
844
|
icons: {
|
|
845
|
-
[
|
|
845
|
+
[d]: g
|
|
846
846
|
}
|
|
847
847
|
} : null;
|
|
848
|
-
le(e, [
|
|
848
|
+
le(e, [d], c);
|
|
849
849
|
});
|
|
850
850
|
});
|
|
851
851
|
return;
|
|
@@ -858,9 +858,9 @@ function to(e, o) {
|
|
|
858
858
|
le(e, l, null);
|
|
859
859
|
return;
|
|
860
860
|
}
|
|
861
|
-
a.prepare(t, n, l).forEach((
|
|
862
|
-
Jn(t,
|
|
863
|
-
le(e,
|
|
861
|
+
a.prepare(t, n, l).forEach((d) => {
|
|
862
|
+
Jn(t, d, (f) => {
|
|
863
|
+
le(e, d.icons, f);
|
|
864
864
|
});
|
|
865
865
|
});
|
|
866
866
|
}));
|
|
@@ -883,15 +883,15 @@ const no = (e, o) => {
|
|
|
883
883
|
const i = /* @__PURE__ */ Object.create(null), r = [];
|
|
884
884
|
let l, s;
|
|
885
885
|
return n.pending.forEach((a) => {
|
|
886
|
-
const { provider: u, prefix:
|
|
887
|
-
if (
|
|
886
|
+
const { provider: u, prefix: d } = a;
|
|
887
|
+
if (d === s && u === l)
|
|
888
888
|
return;
|
|
889
|
-
l = u, s =
|
|
889
|
+
l = u, s = d, r.push(ie(u, d));
|
|
890
890
|
const f = i[u] || (i[u] = /* @__PURE__ */ Object.create(null));
|
|
891
|
-
f[
|
|
891
|
+
f[d] || (f[d] = []);
|
|
892
892
|
}), n.pending.forEach((a) => {
|
|
893
|
-
const { provider: u, prefix:
|
|
894
|
-
|
|
893
|
+
const { provider: u, prefix: d, name: f } = a, g = ie(u, d), c = g.pendingIcons || (g.pendingIcons = /* @__PURE__ */ new Set());
|
|
894
|
+
c.has(f) || (c.add(f), i[u][d].push(f));
|
|
895
895
|
}), r.forEach((a) => {
|
|
896
896
|
const u = i[a.provider][a.prefix];
|
|
897
897
|
u.length && to(a, u);
|
|
@@ -975,19 +975,19 @@ const ut = {
|
|
|
975
975
|
backgroundColor: "currentColor"
|
|
976
976
|
}, Et = {
|
|
977
977
|
backgroundColor: "transparent"
|
|
978
|
-
},
|
|
978
|
+
}, ct = {
|
|
979
979
|
Image: "var(--svg)",
|
|
980
980
|
Repeat: "no-repeat",
|
|
981
981
|
Size: "100% 100%"
|
|
982
|
-
},
|
|
982
|
+
}, dt = {
|
|
983
983
|
webkitMask: Ge,
|
|
984
984
|
mask: Ge,
|
|
985
985
|
background: Et
|
|
986
986
|
};
|
|
987
|
-
for (const e in
|
|
988
|
-
const o =
|
|
989
|
-
for (const t in
|
|
990
|
-
o[e + t] =
|
|
987
|
+
for (const e in dt) {
|
|
988
|
+
const o = dt[e];
|
|
989
|
+
for (const t in ct)
|
|
990
|
+
o[e + t] = ct[t];
|
|
991
991
|
}
|
|
992
992
|
const Re = {};
|
|
993
993
|
["horizontal", "vertical"].forEach((e) => {
|
|
@@ -1048,7 +1048,7 @@ const ft = (e, o) => {
|
|
|
1048
1048
|
let p = 0, h = o.id;
|
|
1049
1049
|
return typeof h == "string" && (h = h.replace(/-/g, "_")), n.innerHTML = En(a.body, h ? () => h + "ID" + p++ : "iconifyVue"), Y("svg", n);
|
|
1050
1050
|
}
|
|
1051
|
-
const { body:
|
|
1051
|
+
const { body: d, width: f, height: g } = e, c = i === "mask" || (i === "bg" ? !1 : d.indexOf("currentColor") !== -1), m = so(d, {
|
|
1052
1052
|
...u,
|
|
1053
1053
|
width: f + "",
|
|
1054
1054
|
height: g + ""
|
|
@@ -1059,7 +1059,7 @@ const ft = (e, o) => {
|
|
|
1059
1059
|
width: gt(u.width),
|
|
1060
1060
|
height: gt(u.height),
|
|
1061
1061
|
...fo,
|
|
1062
|
-
...
|
|
1062
|
+
...c ? Ge : Et,
|
|
1063
1063
|
...s
|
|
1064
1064
|
}, Y("span", n);
|
|
1065
1065
|
};
|
|
@@ -1167,16 +1167,6 @@ const po = {
|
|
|
1167
1167
|
}, t);
|
|
1168
1168
|
}
|
|
1169
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
1170
|
function mo() {
|
|
1181
1171
|
return {
|
|
1182
1172
|
accessor: (e, o) => typeof e == "function" ? {
|
|
@@ -1223,17 +1213,17 @@ function F(e, o, t) {
|
|
|
1223
1213
|
let l;
|
|
1224
1214
|
t.key && t.debug && (l = Date.now());
|
|
1225
1215
|
const s = e(r);
|
|
1226
|
-
if (!(s.length !== n.length || s.some((
|
|
1216
|
+
if (!(s.length !== n.length || s.some((d, f) => n[f] !== d)))
|
|
1227
1217
|
return i;
|
|
1228
1218
|
n = s;
|
|
1229
1219
|
let u;
|
|
1230
1220
|
if (t.key && t.debug && (u = Date.now()), i = o(...s), t == null || t.onChange == null || t.onChange(i), t.key && t.debug && t != null && t.debug()) {
|
|
1231
|
-
const
|
|
1221
|
+
const d = Math.round((Date.now() - l) * 100) / 100, f = Math.round((Date.now() - u) * 100) / 100, g = f / 16, c = (m, p) => {
|
|
1232
1222
|
for (m = String(m); m.length < p; )
|
|
1233
1223
|
m = " " + m;
|
|
1234
1224
|
return m;
|
|
1235
1225
|
};
|
|
1236
|
-
console.info(`%c⏱ ${
|
|
1226
|
+
console.info(`%c⏱ ${c(f, 5)} /${c(d, 5)} ms`, `
|
|
1237
1227
|
font-size: .6rem;
|
|
1238
1228
|
font-weight: bold;
|
|
1239
1229
|
color: hsl(${Math.max(0, Math.min(120 - 120 * g, 120))}deg 100% 31%);`, t?.key);
|
|
@@ -1280,30 +1270,30 @@ function wo(e, o, t, n) {
|
|
|
1280
1270
|
...e._getDefaultColumnDef(),
|
|
1281
1271
|
...o
|
|
1282
1272
|
}, a = s.accessorKey;
|
|
1283
|
-
let u = (i = (r = s.id) != null ? r : a ? typeof String.prototype.replaceAll == "function" ? a.replaceAll(".", "_") : a.replace(/\./g, "_") : void 0) != null ? i : typeof s.header == "string" ? s.header : void 0,
|
|
1284
|
-
if (s.accessorFn ?
|
|
1285
|
-
let
|
|
1273
|
+
let u = (i = (r = s.id) != null ? r : a ? typeof String.prototype.replaceAll == "function" ? a.replaceAll(".", "_") : a.replace(/\./g, "_") : void 0) != null ? i : typeof s.header == "string" ? s.header : void 0, d;
|
|
1274
|
+
if (s.accessorFn ? d = s.accessorFn : a && (a.includes(".") ? d = (g) => {
|
|
1275
|
+
let c = g;
|
|
1286
1276
|
for (const p of a.split(".")) {
|
|
1287
1277
|
var m;
|
|
1288
|
-
|
|
1278
|
+
c = (m = c) == null ? void 0 : m[p], process.env.NODE_ENV !== "production" && c === void 0 && console.warn(`"${p}" in deeply nested key "${a}" returned undefined.`);
|
|
1289
1279
|
}
|
|
1290
|
-
return
|
|
1291
|
-
} :
|
|
1280
|
+
return c;
|
|
1281
|
+
} : d = (g) => g[s.accessorKey]), !u)
|
|
1292
1282
|
throw process.env.NODE_ENV !== "production" ? new Error(s.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
|
|
1293
1283
|
let f = {
|
|
1294
1284
|
id: `${String(u)}`,
|
|
1295
|
-
accessorFn:
|
|
1285
|
+
accessorFn: d,
|
|
1296
1286
|
parent: n,
|
|
1297
1287
|
depth: t,
|
|
1298
1288
|
columnDef: s,
|
|
1299
1289
|
columns: [],
|
|
1300
1290
|
getFlatColumns: F(() => [!0], () => {
|
|
1301
1291
|
var g;
|
|
1302
|
-
return [f, ...(g = f.columns) == null ? void 0 : g.flatMap((
|
|
1292
|
+
return [f, ...(g = f.columns) == null ? void 0 : g.flatMap((c) => c.getFlatColumns())];
|
|
1303
1293
|
}, b(e.options, "debugColumns", "column.getFlatColumns")),
|
|
1304
1294
|
getLeafColumns: F(() => [e._getOrderColumnsFn()], (g) => {
|
|
1305
|
-
var
|
|
1306
|
-
if ((
|
|
1295
|
+
var c;
|
|
1296
|
+
if ((c = f.columns) != null && c.length) {
|
|
1307
1297
|
let m = f.columns.flatMap((p) => p.getLeafColumns());
|
|
1308
1298
|
return g(m);
|
|
1309
1299
|
}
|
|
@@ -1369,25 +1359,25 @@ const yo = {
|
|
|
1369
1359
|
return !((n = t.subHeaders) != null && n.length);
|
|
1370
1360
|
}), b(e.options, O, "getRightLeafHeaders")), e.getLeafHeaders = F(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
|
|
1371
1361
|
var i, r, l, s, a, u;
|
|
1372
|
-
return [...(i = (r = o[0]) == null ? void 0 : r.headers) != null ? i : [], ...(l = (s = t[0]) == null ? void 0 : s.headers) != null ? l : [], ...(a = (u = n[0]) == null ? void 0 : u.headers) != null ? a : []].map((
|
|
1362
|
+
return [...(i = (r = o[0]) == null ? void 0 : r.headers) != null ? i : [], ...(l = (s = t[0]) == null ? void 0 : s.headers) != null ? l : [], ...(a = (u = n[0]) == null ? void 0 : u.headers) != null ? a : []].map((d) => d.getLeafHeaders()).flat();
|
|
1373
1363
|
}, b(e.options, O, "getLeafHeaders"));
|
|
1374
1364
|
}
|
|
1375
1365
|
};
|
|
1376
1366
|
function me(e, o, t, n) {
|
|
1377
1367
|
var i, r;
|
|
1378
1368
|
let l = 0;
|
|
1379
|
-
const s = function(g,
|
|
1380
|
-
|
|
1369
|
+
const s = function(g, c) {
|
|
1370
|
+
c === void 0 && (c = 1), l = Math.max(l, c), g.filter((m) => m.getIsVisible()).forEach((m) => {
|
|
1381
1371
|
var p;
|
|
1382
|
-
(p = m.columns) != null && p.length && s(m.columns,
|
|
1372
|
+
(p = m.columns) != null && p.length && s(m.columns, c + 1);
|
|
1383
1373
|
}, 0);
|
|
1384
1374
|
};
|
|
1385
1375
|
s(e);
|
|
1386
1376
|
let a = [];
|
|
1387
|
-
const u = (g,
|
|
1377
|
+
const u = (g, c) => {
|
|
1388
1378
|
const m = {
|
|
1389
|
-
depth:
|
|
1390
|
-
id: [n, `${
|
|
1379
|
+
depth: c,
|
|
1380
|
+
id: [n, `${c}`].filter(Boolean).join("_"),
|
|
1391
1381
|
headers: []
|
|
1392
1382
|
}, p = [];
|
|
1393
1383
|
g.forEach((h) => {
|
|
@@ -1397,21 +1387,21 @@ function me(e, o, t, n) {
|
|
|
1397
1387
|
R.subHeaders.push(h);
|
|
1398
1388
|
else {
|
|
1399
1389
|
const v = pt(t, P, {
|
|
1400
|
-
id: [n,
|
|
1390
|
+
id: [n, c, P.id, h?.id].filter(Boolean).join("_"),
|
|
1401
1391
|
isPlaceholder: M,
|
|
1402
1392
|
placeholderId: M ? `${p.filter((w) => w.column === P).length}` : void 0,
|
|
1403
|
-
depth:
|
|
1393
|
+
depth: c,
|
|
1404
1394
|
index: p.length
|
|
1405
1395
|
});
|
|
1406
1396
|
v.subHeaders.push(h), p.push(v);
|
|
1407
1397
|
}
|
|
1408
1398
|
m.headers.push(h), h.headerGroup = m;
|
|
1409
|
-
}), a.push(m),
|
|
1410
|
-
},
|
|
1399
|
+
}), a.push(m), c > 0 && u(p, c - 1);
|
|
1400
|
+
}, d = o.map((g, c) => pt(t, g, {
|
|
1411
1401
|
depth: l,
|
|
1412
|
-
index:
|
|
1402
|
+
index: c
|
|
1413
1403
|
}));
|
|
1414
|
-
u(
|
|
1404
|
+
u(d, l - 1), a.reverse();
|
|
1415
1405
|
const f = (g) => g.filter((m) => m.column.getIsVisible()).map((m) => {
|
|
1416
1406
|
let p = 0, h = 0, R = [0];
|
|
1417
1407
|
m.subHeaders && m.subHeaders.length ? (R = [], f(m.subHeaders).forEach((P) => {
|
|
@@ -1462,14 +1452,14 @@ const Ye = (e, o, t, n, i, r, l) => {
|
|
|
1462
1452
|
getParentRows: () => {
|
|
1463
1453
|
let a = [], u = s;
|
|
1464
1454
|
for (; ; ) {
|
|
1465
|
-
const
|
|
1466
|
-
if (!
|
|
1467
|
-
a.push(
|
|
1455
|
+
const d = u.getParentRow();
|
|
1456
|
+
if (!d) break;
|
|
1457
|
+
a.push(d), u = d;
|
|
1468
1458
|
}
|
|
1469
1459
|
return a.reverse();
|
|
1470
1460
|
},
|
|
1471
1461
|
getAllCells: F(() => [e.getAllLeafColumns()], (a) => a.map((u) => So(e, s, u, u.id)), b(e.options, "debugRows", "getAllCells")),
|
|
1472
|
-
_getAllCellsByColumnId: F(() => [s.getAllCells()], (a) => a.reduce((u,
|
|
1462
|
+
_getAllCellsByColumnId: F(() => [s.getAllCells()], (a) => a.reduce((u, d) => (u[d.column.id] = d, u), {}), b(e.options, "debugRows", "getAllCellsByColumnId"))
|
|
1473
1463
|
};
|
|
1474
1464
|
for (let a = 0; a < e._features.length; a++) {
|
|
1475
1465
|
const u = e._features[a];
|
|
@@ -1580,10 +1570,10 @@ const Ro = {
|
|
|
1580
1570
|
return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((i) => i.id === e.id)) != null ? t : -1;
|
|
1581
1571
|
}, e.setFilterValue = (t) => {
|
|
1582
1572
|
o.setColumnFilters((n) => {
|
|
1583
|
-
const i = e.getFilterFn(), r = n?.find((
|
|
1573
|
+
const i = e.getFilterFn(), r = n?.find((d) => d.id === e.id), l = ee(t, r ? r.value : void 0);
|
|
1584
1574
|
if (mt(i, l, e)) {
|
|
1585
1575
|
var s;
|
|
1586
|
-
return (s = n?.filter((
|
|
1576
|
+
return (s = n?.filter((d) => d.id !== e.id)) != null ? s : [];
|
|
1587
1577
|
}
|
|
1588
1578
|
const a = {
|
|
1589
1579
|
id: e.id,
|
|
@@ -1591,7 +1581,7 @@ const Ro = {
|
|
|
1591
1581
|
};
|
|
1592
1582
|
if (r) {
|
|
1593
1583
|
var u;
|
|
1594
|
-
return (u = n?.map((
|
|
1584
|
+
return (u = n?.map((d) => d.id === e.id ? a : d)) != null ? u : [];
|
|
1595
1585
|
}
|
|
1596
1586
|
return n != null && n.length ? [...n, a] : [a];
|
|
1597
1587
|
});
|
|
@@ -1753,12 +1743,12 @@ const Eo = {
|
|
|
1753
1743
|
onColumnOrderChange: q("columnOrder", e)
|
|
1754
1744
|
}),
|
|
1755
1745
|
createColumn: (e, o) => {
|
|
1756
|
-
e.getIndex = F((t) => [
|
|
1746
|
+
e.getIndex = F((t) => [ce(o, t)], (t) => t.findIndex((n) => n.id === e.id), b(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
|
|
1757
1747
|
var n;
|
|
1758
|
-
return ((n =
|
|
1748
|
+
return ((n = ce(o, t)[0]) == null ? void 0 : n.id) === e.id;
|
|
1759
1749
|
}, e.getIsLastColumn = (t) => {
|
|
1760
1750
|
var n;
|
|
1761
|
-
const i =
|
|
1751
|
+
const i = ce(o, t);
|
|
1762
1752
|
return ((n = i[i.length - 1]) == null ? void 0 : n.id) === e.id;
|
|
1763
1753
|
};
|
|
1764
1754
|
},
|
|
@@ -1773,7 +1763,7 @@ const Eo = {
|
|
|
1773
1763
|
else {
|
|
1774
1764
|
const l = [...o], s = [...i];
|
|
1775
1765
|
for (; s.length && l.length; ) {
|
|
1776
|
-
const a = l.shift(), u = s.findIndex((
|
|
1766
|
+
const a = l.shift(), u = s.findIndex((d) => d.id === a);
|
|
1777
1767
|
u > -1 && r.push(s.splice(u, 1)[0]);
|
|
1778
1768
|
}
|
|
1779
1769
|
r = [...r, ...s];
|
|
@@ -1805,10 +1795,10 @@ const Eo = {
|
|
|
1805
1795
|
};
|
|
1806
1796
|
}
|
|
1807
1797
|
if (t === "left") {
|
|
1808
|
-
var u,
|
|
1798
|
+
var u, d;
|
|
1809
1799
|
return {
|
|
1810
1800
|
left: [...((u = i?.left) != null ? u : []).filter((f) => !(n != null && n.includes(f))), ...n],
|
|
1811
|
-
right: ((
|
|
1801
|
+
right: ((d = i?.right) != null ? d : []).filter((f) => !(n != null && n.includes(f)))
|
|
1812
1802
|
};
|
|
1813
1803
|
}
|
|
1814
1804
|
return {
|
|
@@ -1893,7 +1883,7 @@ const he = {
|
|
|
1893
1883
|
var t, n, i;
|
|
1894
1884
|
const r = o.getState().columnSizing[e.id];
|
|
1895
1885
|
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : he.minSize, (n = r ?? e.columnDef.size) != null ? n : he.size), (i = e.columnDef.maxSize) != null ? i : he.maxSize);
|
|
1896
|
-
}, e.getStart = F((t) => [t,
|
|
1886
|
+
}, e.getStart = F((t) => [t, ce(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, ce(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 = () => {
|
|
1897
1887
|
o.setColumnSizing((t) => {
|
|
1898
1888
|
let {
|
|
1899
1889
|
[e.id]: n,
|
|
@@ -1929,7 +1919,7 @@ const he = {
|
|
|
1929
1919
|
return (r) => {
|
|
1930
1920
|
if (!n || !i || (r.persist == null || r.persist(), _e(r) && r.touches && r.touches.length > 1))
|
|
1931
1921
|
return;
|
|
1932
|
-
const l = e.getSize(), s = e ? e.getLeafHeaders().map((R) => [R.column.id, R.column.getSize()]) : [[n.id, n.getSize()]], a = _e(r) ? Math.round(r.touches[0].clientX) : r.clientX, u = {},
|
|
1922
|
+
const l = e.getSize(), s = e ? e.getLeafHeaders().map((R) => [R.column.id, R.column.getSize()]) : [[n.id, n.getSize()]], a = _e(r) ? Math.round(r.touches[0].clientX) : r.clientX, u = {}, d = (R, $) => {
|
|
1933
1923
|
typeof $ == "number" && (o.setColumnSizingInfo((P) => {
|
|
1934
1924
|
var M, v;
|
|
1935
1925
|
const w = o.options.columnResizeDirection === "rtl" ? -1 : 1, I = ($ - ((M = P?.startOffset) != null ? M : 0)) * w, V = Math.max(I / ((v = P?.startSize) != null ? v : 0), -0.999999);
|
|
@@ -1945,8 +1935,8 @@ const he = {
|
|
|
1945
1935
|
...P,
|
|
1946
1936
|
...u
|
|
1947
1937
|
})));
|
|
1948
|
-
}, f = (R) =>
|
|
1949
|
-
|
|
1938
|
+
}, f = (R) => d("move", R), g = (R) => {
|
|
1939
|
+
d("end", R), o.setColumnSizingInfo(($) => ({
|
|
1950
1940
|
...$,
|
|
1951
1941
|
isResizingColumn: !1,
|
|
1952
1942
|
startOffset: null,
|
|
@@ -1955,21 +1945,21 @@ const he = {
|
|
|
1955
1945
|
deltaPercentage: null,
|
|
1956
1946
|
columnSizingStart: []
|
|
1957
1947
|
}));
|
|
1958
|
-
},
|
|
1948
|
+
}, c = Lo(t), m = {
|
|
1959
1949
|
moveHandler: (R) => f(R.clientX),
|
|
1960
1950
|
upHandler: (R) => {
|
|
1961
|
-
|
|
1951
|
+
c?.removeEventListener("mousemove", m.moveHandler), c?.removeEventListener("mouseup", m.upHandler), g(R.clientX);
|
|
1962
1952
|
}
|
|
1963
1953
|
}, p = {
|
|
1964
1954
|
moveHandler: (R) => (R.cancelable && (R.preventDefault(), R.stopPropagation()), f(R.touches[0].clientX), !1),
|
|
1965
1955
|
upHandler: (R) => {
|
|
1966
1956
|
var $;
|
|
1967
|
-
|
|
1957
|
+
c?.removeEventListener("touchmove", p.moveHandler), c?.removeEventListener("touchend", p.upHandler), R.cancelable && (R.preventDefault(), R.stopPropagation()), g(($ = R.touches[0]) == null ? void 0 : $.clientX);
|
|
1968
1958
|
}
|
|
1969
1959
|
}, h = Ho() ? {
|
|
1970
1960
|
passive: !1
|
|
1971
1961
|
} : !1;
|
|
1972
|
-
_e(r) ? (
|
|
1962
|
+
_e(r) ? (c?.addEventListener("touchmove", p.moveHandler, h), c?.addEventListener("touchend", p.upHandler, h)) : (c?.addEventListener("mousemove", m.moveHandler, h), c?.addEventListener("mouseup", m.upHandler, h)), o.setColumnSizingInfo((R) => ({
|
|
1973
1963
|
...R,
|
|
1974
1964
|
startOffset: a,
|
|
1975
1965
|
startSize: l,
|
|
@@ -2068,7 +2058,7 @@ const Bo = {
|
|
|
2068
2058
|
};
|
|
2069
2059
|
}
|
|
2070
2060
|
};
|
|
2071
|
-
function
|
|
2061
|
+
function ce(e, o) {
|
|
2072
2062
|
return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
|
|
2073
2063
|
}
|
|
2074
2064
|
const Oo = {
|
|
@@ -2306,7 +2296,7 @@ const Oo = {
|
|
|
2306
2296
|
return u;
|
|
2307
2297
|
}) : [], s = /* @__PURE__ */ new Set([...l, e.id, ...r]);
|
|
2308
2298
|
o.setRowPinning((a) => {
|
|
2309
|
-
var u,
|
|
2299
|
+
var u, d;
|
|
2310
2300
|
if (t === "bottom") {
|
|
2311
2301
|
var f, g;
|
|
2312
2302
|
return {
|
|
@@ -2315,15 +2305,15 @@ const Oo = {
|
|
|
2315
2305
|
};
|
|
2316
2306
|
}
|
|
2317
2307
|
if (t === "top") {
|
|
2318
|
-
var
|
|
2308
|
+
var c, m;
|
|
2319
2309
|
return {
|
|
2320
|
-
top: [...((
|
|
2310
|
+
top: [...((c = a?.top) != null ? c : []).filter((p) => !(s != null && s.has(p))), ...Array.from(s)],
|
|
2321
2311
|
bottom: ((m = a?.bottom) != null ? m : []).filter((p) => !(s != null && s.has(p)))
|
|
2322
2312
|
};
|
|
2323
2313
|
}
|
|
2324
2314
|
return {
|
|
2325
2315
|
top: ((u = a?.top) != null ? u : []).filter((p) => !(s != null && s.has(p))),
|
|
2326
|
-
bottom: ((
|
|
2316
|
+
bottom: ((d = a?.bottom) != null ? d : []).filter((p) => !(s != null && s.has(p)))
|
|
2327
2317
|
};
|
|
2328
2318
|
});
|
|
2329
2319
|
}, e.getCanPin = () => {
|
|
@@ -2512,11 +2502,11 @@ function ke(e, o) {
|
|
|
2512
2502
|
const t = e.getState().rowSelection, n = [], i = {}, r = function(l, s) {
|
|
2513
2503
|
return l.map((a) => {
|
|
2514
2504
|
var u;
|
|
2515
|
-
const
|
|
2516
|
-
if (
|
|
2505
|
+
const d = Ze(a, t);
|
|
2506
|
+
if (d && (n.push(a), i[a.id] = a), (u = a.subRows) != null && u.length && (a = {
|
|
2517
2507
|
...a,
|
|
2518
2508
|
subRows: r(a.subRows)
|
|
2519
|
-
}),
|
|
2509
|
+
}), d)
|
|
2520
2510
|
return a;
|
|
2521
2511
|
}).filter(Boolean);
|
|
2522
2512
|
};
|
|
@@ -2614,18 +2604,18 @@ const se = {
|
|
|
2614
2604
|
}, e.toggleSorting = (t, n) => {
|
|
2615
2605
|
const i = e.getNextSortingOrder(), r = typeof t < "u" && t !== null;
|
|
2616
2606
|
o.setSorting((l) => {
|
|
2617
|
-
const s = l?.find((
|
|
2618
|
-
let u = [],
|
|
2619
|
-
if (l != null && l.length && e.getCanMultiSort() && n ? s ?
|
|
2607
|
+
const s = l?.find((c) => c.id === e.id), a = l?.findIndex((c) => c.id === e.id);
|
|
2608
|
+
let u = [], d, f = r ? t : i === "desc";
|
|
2609
|
+
if (l != null && l.length && e.getCanMultiSort() && n ? s ? d = "toggle" : d = "add" : l != null && l.length && a !== l.length - 1 ? d = "replace" : s ? d = "toggle" : d = "replace", d === "toggle" && (r || i || (d = "remove")), d === "add") {
|
|
2620
2610
|
var g;
|
|
2621
2611
|
u = [...l, {
|
|
2622
2612
|
id: e.id,
|
|
2623
2613
|
desc: f
|
|
2624
2614
|
}], u.splice(0, u.length - ((g = o.options.maxMultiSortColCount) != null ? g : Number.MAX_SAFE_INTEGER));
|
|
2625
|
-
} else
|
|
2626
|
-
...
|
|
2615
|
+
} else d === "toggle" ? u = l.map((c) => c.id === e.id ? {
|
|
2616
|
+
...c,
|
|
2627
2617
|
desc: f
|
|
2628
|
-
} :
|
|
2618
|
+
} : c) : d === "remove" ? u = l.filter((c) => c.id !== e.id) : u = [{
|
|
2629
2619
|
id: e.id,
|
|
2630
2620
|
desc: f
|
|
2631
2621
|
}];
|
|
@@ -2694,7 +2684,7 @@ function ei(e) {
|
|
|
2694
2684
|
let i = {
|
|
2695
2685
|
_features: n
|
|
2696
2686
|
};
|
|
2697
|
-
const r = i._features.reduce((g,
|
|
2687
|
+
const r = i._features.reduce((g, c) => Object.assign(g, c.getDefaultOptions == null ? void 0 : c.getDefaultOptions(i)), {}), l = (g) => i.options.mergeOptions ? i.options.mergeOptions(r, g) : {
|
|
2698
2688
|
...r,
|
|
2699
2689
|
...g
|
|
2700
2690
|
};
|
|
@@ -2703,11 +2693,11 @@ function ei(e) {
|
|
|
2703
2693
|
...(t = e.initialState) != null ? t : {}
|
|
2704
2694
|
};
|
|
2705
2695
|
i._features.forEach((g) => {
|
|
2706
|
-
var
|
|
2707
|
-
a = (
|
|
2696
|
+
var c;
|
|
2697
|
+
a = (c = g.getInitialState == null ? void 0 : g.getInitialState(a)) != null ? c : a;
|
|
2708
2698
|
});
|
|
2709
2699
|
const u = [];
|
|
2710
|
-
let
|
|
2700
|
+
let d = !1;
|
|
2711
2701
|
const f = {
|
|
2712
2702
|
_features: n,
|
|
2713
2703
|
options: {
|
|
@@ -2716,43 +2706,43 @@ function ei(e) {
|
|
|
2716
2706
|
},
|
|
2717
2707
|
initialState: a,
|
|
2718
2708
|
_queue: (g) => {
|
|
2719
|
-
u.push(g),
|
|
2709
|
+
u.push(g), d || (d = !0, Promise.resolve().then(() => {
|
|
2720
2710
|
for (; u.length; )
|
|
2721
2711
|
u.shift()();
|
|
2722
|
-
|
|
2723
|
-
}).catch((
|
|
2724
|
-
throw
|
|
2712
|
+
d = !1;
|
|
2713
|
+
}).catch((c) => setTimeout(() => {
|
|
2714
|
+
throw c;
|
|
2725
2715
|
})));
|
|
2726
2716
|
},
|
|
2727
2717
|
reset: () => {
|
|
2728
2718
|
i.setState(i.initialState);
|
|
2729
2719
|
},
|
|
2730
2720
|
setOptions: (g) => {
|
|
2731
|
-
const
|
|
2732
|
-
i.options = l(
|
|
2721
|
+
const c = ee(g, i.options);
|
|
2722
|
+
i.options = l(c);
|
|
2733
2723
|
},
|
|
2734
2724
|
getState: () => i.options.state,
|
|
2735
2725
|
setState: (g) => {
|
|
2736
2726
|
i.options.onStateChange == null || i.options.onStateChange(g);
|
|
2737
2727
|
},
|
|
2738
|
-
_getRowId: (g,
|
|
2728
|
+
_getRowId: (g, c, m) => {
|
|
2739
2729
|
var p;
|
|
2740
|
-
return (p = i.options.getRowId == null ? void 0 : i.options.getRowId(g,
|
|
2730
|
+
return (p = i.options.getRowId == null ? void 0 : i.options.getRowId(g, c, m)) != null ? p : `${m ? [m.id, c].join(".") : c}`;
|
|
2741
2731
|
},
|
|
2742
2732
|
getCoreRowModel: () => (i._getCoreRowModel || (i._getCoreRowModel = i.options.getCoreRowModel(i)), i._getCoreRowModel()),
|
|
2743
2733
|
// The final calls start at the bottom of the model,
|
|
2744
2734
|
// expanded rows, which then work their way up
|
|
2745
2735
|
getRowModel: () => i.getPaginationRowModel(),
|
|
2746
2736
|
//in next version, we should just pass in the row model as the optional 2nd arg
|
|
2747
|
-
getRow: (g,
|
|
2748
|
-
let m = (
|
|
2737
|
+
getRow: (g, c) => {
|
|
2738
|
+
let m = (c ? i.getPrePaginationRowModel() : i.getRowModel()).rowsById[g];
|
|
2749
2739
|
if (!m && (m = i.getCoreRowModel().rowsById[g], !m))
|
|
2750
2740
|
throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${g}`) : new Error();
|
|
2751
2741
|
return m;
|
|
2752
2742
|
},
|
|
2753
2743
|
_getDefaultColumnDef: F(() => [i.options.defaultColumn], (g) => {
|
|
2754
|
-
var
|
|
2755
|
-
return g = (
|
|
2744
|
+
var c;
|
|
2745
|
+
return g = (c = g) != null ? c : {}, {
|
|
2756
2746
|
header: (m) => {
|
|
2757
2747
|
const p = m.header.column.columnDef;
|
|
2758
2748
|
return p.accessorKey ? p.accessorKey : p.accessorFn ? p.id : null;
|
|
@@ -2768,29 +2758,29 @@ function ei(e) {
|
|
|
2768
2758
|
}, b(e, "debugColumns", "_getDefaultColumnDef")),
|
|
2769
2759
|
_getColumnDefs: () => i.options.columns,
|
|
2770
2760
|
getAllColumns: F(() => [i._getColumnDefs()], (g) => {
|
|
2771
|
-
const
|
|
2761
|
+
const c = function(m, p, h) {
|
|
2772
2762
|
return h === void 0 && (h = 0), m.map((R) => {
|
|
2773
2763
|
const $ = wo(i, R, h, p), P = R;
|
|
2774
|
-
return $.columns = P.columns ?
|
|
2764
|
+
return $.columns = P.columns ? c(P.columns, $, h + 1) : [], $;
|
|
2775
2765
|
});
|
|
2776
2766
|
};
|
|
2777
|
-
return
|
|
2767
|
+
return c(g);
|
|
2778
2768
|
}, b(e, "debugColumns", "getAllColumns")),
|
|
2779
|
-
getAllFlatColumns: F(() => [i.getAllColumns()], (g) => g.flatMap((
|
|
2780
|
-
_getAllFlatColumnsById: F(() => [i.getAllFlatColumns()], (g) => g.reduce((
|
|
2781
|
-
getAllLeafColumns: F(() => [i.getAllColumns(), i._getOrderColumnsFn()], (g,
|
|
2769
|
+
getAllFlatColumns: F(() => [i.getAllColumns()], (g) => g.flatMap((c) => c.getFlatColumns()), b(e, "debugColumns", "getAllFlatColumns")),
|
|
2770
|
+
_getAllFlatColumnsById: F(() => [i.getAllFlatColumns()], (g) => g.reduce((c, m) => (c[m.id] = m, c), {}), b(e, "debugColumns", "getAllFlatColumnsById")),
|
|
2771
|
+
getAllLeafColumns: F(() => [i.getAllColumns(), i._getOrderColumnsFn()], (g, c) => {
|
|
2782
2772
|
let m = g.flatMap((p) => p.getLeafColumns());
|
|
2783
|
-
return
|
|
2773
|
+
return c(m);
|
|
2784
2774
|
}, b(e, "debugColumns", "getAllLeafColumns")),
|
|
2785
2775
|
getColumn: (g) => {
|
|
2786
|
-
const
|
|
2787
|
-
return process.env.NODE_ENV !== "production" && !
|
|
2776
|
+
const c = i._getAllFlatColumnsById()[g];
|
|
2777
|
+
return process.env.NODE_ENV !== "production" && !c && console.error(`[Table] Column with id '${g}' does not exist.`), c;
|
|
2788
2778
|
}
|
|
2789
2779
|
};
|
|
2790
2780
|
Object.assign(i, f);
|
|
2791
2781
|
for (let g = 0; g < i._features.length; g++) {
|
|
2792
|
-
const
|
|
2793
|
-
|
|
2782
|
+
const c = i._features[g];
|
|
2783
|
+
c == null || c.createTable == null || c.createTable(i);
|
|
2794
2784
|
}
|
|
2795
2785
|
return i;
|
|
2796
2786
|
}
|
|
@@ -2804,10 +2794,10 @@ function jt() {
|
|
|
2804
2794
|
r === void 0 && (r = 0);
|
|
2805
2795
|
const s = [];
|
|
2806
2796
|
for (let u = 0; u < i.length; u++) {
|
|
2807
|
-
const
|
|
2808
|
-
if (t.flatRows.push(
|
|
2797
|
+
const d = Ye(e, e._getRowId(i[u], u, l), i[u], u, r, void 0, l?.id);
|
|
2798
|
+
if (t.flatRows.push(d), t.rowsById[d.id] = d, s.push(d), e.options.getSubRows) {
|
|
2809
2799
|
var a;
|
|
2810
|
-
|
|
2800
|
+
d.originalSubRows = e.options.getSubRows(i[u], u), (a = d.originalSubRows) != null && a.length && (d.subRows = n(d.originalSubRows, r + 1, d));
|
|
2811
2801
|
}
|
|
2812
2802
|
}
|
|
2813
2803
|
return s;
|
|
@@ -2833,24 +2823,24 @@ function oi(e, o, t) {
|
|
|
2833
2823
|
var n;
|
|
2834
2824
|
const i = [], r = {}, l = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(a, u) {
|
|
2835
2825
|
u === void 0 && (u = 0);
|
|
2836
|
-
const
|
|
2826
|
+
const d = [];
|
|
2837
2827
|
for (let g = 0; g < a.length; g++) {
|
|
2838
2828
|
var f;
|
|
2839
|
-
let
|
|
2840
|
-
const m = Ye(t,
|
|
2841
|
-
if (m.columnFilters =
|
|
2842
|
-
if (m.subRows = s(
|
|
2843
|
-
|
|
2829
|
+
let c = a[g];
|
|
2830
|
+
const m = Ye(t, c.id, c.original, c.index, c.depth, void 0, c.parentId);
|
|
2831
|
+
if (m.columnFilters = c.columnFilters, (f = c.subRows) != null && f.length && u < l) {
|
|
2832
|
+
if (m.subRows = s(c.subRows, u + 1), c = m, o(c) && !m.subRows.length) {
|
|
2833
|
+
d.push(c), r[c.id] = c, i.push(c);
|
|
2844
2834
|
continue;
|
|
2845
2835
|
}
|
|
2846
|
-
if (o(
|
|
2847
|
-
|
|
2836
|
+
if (o(c) || m.subRows.length) {
|
|
2837
|
+
d.push(c), r[c.id] = c, i.push(c);
|
|
2848
2838
|
continue;
|
|
2849
2839
|
}
|
|
2850
2840
|
} else
|
|
2851
|
-
|
|
2841
|
+
c = m, o(c) && (d.push(c), r[c.id] = c, i.push(c));
|
|
2852
2842
|
}
|
|
2853
|
-
return
|
|
2843
|
+
return d;
|
|
2854
2844
|
};
|
|
2855
2845
|
return {
|
|
2856
2846
|
rows: s(e),
|
|
@@ -2862,19 +2852,19 @@ function ii(e, o, t) {
|
|
|
2862
2852
|
var n;
|
|
2863
2853
|
const i = [], r = {}, l = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, s = function(a, u) {
|
|
2864
2854
|
u === void 0 && (u = 0);
|
|
2865
|
-
const
|
|
2855
|
+
const d = [];
|
|
2866
2856
|
for (let g = 0; g < a.length; g++) {
|
|
2867
|
-
let
|
|
2868
|
-
if (o(
|
|
2857
|
+
let c = a[g];
|
|
2858
|
+
if (o(c)) {
|
|
2869
2859
|
var f;
|
|
2870
|
-
if ((f =
|
|
2871
|
-
const p = Ye(t,
|
|
2872
|
-
p.subRows = s(
|
|
2860
|
+
if ((f = c.subRows) != null && f.length && u < l) {
|
|
2861
|
+
const p = Ye(t, c.id, c.original, c.index, c.depth, void 0, c.parentId);
|
|
2862
|
+
p.subRows = s(c.subRows, u + 1), c = p;
|
|
2873
2863
|
}
|
|
2874
|
-
|
|
2864
|
+
d.push(c), i.push(c), r[c.id] = c;
|
|
2875
2865
|
}
|
|
2876
2866
|
}
|
|
2877
|
-
return
|
|
2867
|
+
return d;
|
|
2878
2868
|
};
|
|
2879
2869
|
return {
|
|
2880
2870
|
rows: s(e),
|
|
@@ -2891,7 +2881,7 @@ function qt() {
|
|
|
2891
2881
|
}
|
|
2892
2882
|
const i = [], r = [];
|
|
2893
2883
|
(t ?? []).forEach((g) => {
|
|
2894
|
-
var
|
|
2884
|
+
var c;
|
|
2895
2885
|
const m = e.getColumn(g.id);
|
|
2896
2886
|
if (!m)
|
|
2897
2887
|
return;
|
|
@@ -2903,46 +2893,46 @@ function qt() {
|
|
|
2903
2893
|
i.push({
|
|
2904
2894
|
id: g.id,
|
|
2905
2895
|
filterFn: p,
|
|
2906
|
-
resolvedValue: (
|
|
2896
|
+
resolvedValue: (c = p.resolveFilterValue == null ? void 0 : p.resolveFilterValue(g.value)) != null ? c : g.value
|
|
2907
2897
|
});
|
|
2908
2898
|
});
|
|
2909
2899
|
const l = (t ?? []).map((g) => g.id), s = e.getGlobalFilterFn(), a = e.getAllLeafColumns().filter((g) => g.getCanGlobalFilter());
|
|
2910
2900
|
n && s && a.length && (l.push("__global__"), a.forEach((g) => {
|
|
2911
|
-
var
|
|
2901
|
+
var c;
|
|
2912
2902
|
r.push({
|
|
2913
2903
|
id: g.id,
|
|
2914
2904
|
filterFn: s,
|
|
2915
|
-
resolvedValue: (
|
|
2905
|
+
resolvedValue: (c = s.resolveFilterValue == null ? void 0 : s.resolveFilterValue(n)) != null ? c : n
|
|
2916
2906
|
});
|
|
2917
2907
|
}));
|
|
2918
|
-
let u,
|
|
2908
|
+
let u, d;
|
|
2919
2909
|
for (let g = 0; g < o.flatRows.length; g++) {
|
|
2920
|
-
const
|
|
2921
|
-
if (
|
|
2910
|
+
const c = o.flatRows[g];
|
|
2911
|
+
if (c.columnFilters = {}, i.length)
|
|
2922
2912
|
for (let m = 0; m < i.length; m++) {
|
|
2923
2913
|
u = i[m];
|
|
2924
2914
|
const p = u.id;
|
|
2925
|
-
|
|
2926
|
-
|
|
2915
|
+
c.columnFilters[p] = u.filterFn(c, p, u.resolvedValue, (h) => {
|
|
2916
|
+
c.columnFiltersMeta[p] = h;
|
|
2927
2917
|
});
|
|
2928
2918
|
}
|
|
2929
2919
|
if (r.length) {
|
|
2930
2920
|
for (let m = 0; m < r.length; m++) {
|
|
2931
|
-
|
|
2932
|
-
const p =
|
|
2933
|
-
if (
|
|
2934
|
-
|
|
2921
|
+
d = r[m];
|
|
2922
|
+
const p = d.id;
|
|
2923
|
+
if (d.filterFn(c, p, d.resolvedValue, (h) => {
|
|
2924
|
+
c.columnFiltersMeta[p] = h;
|
|
2935
2925
|
})) {
|
|
2936
|
-
|
|
2926
|
+
c.columnFilters.__global__ = !0;
|
|
2937
2927
|
break;
|
|
2938
2928
|
}
|
|
2939
2929
|
}
|
|
2940
|
-
|
|
2930
|
+
c.columnFilters.__global__ !== !0 && (c.columnFilters.__global__ = !1);
|
|
2941
2931
|
}
|
|
2942
2932
|
}
|
|
2943
2933
|
const f = (g) => {
|
|
2944
|
-
for (let
|
|
2945
|
-
if (g.columnFilters[l[
|
|
2934
|
+
for (let c = 0; c < l.length; c++)
|
|
2935
|
+
if (g.columnFilters[l[c]] === !1)
|
|
2946
2936
|
return !1;
|
|
2947
2937
|
return !0;
|
|
2948
2938
|
};
|
|
@@ -2962,8 +2952,8 @@ function Kt(e) {
|
|
|
2962
2952
|
flatRows: s,
|
|
2963
2953
|
rowsById: a
|
|
2964
2954
|
} = n;
|
|
2965
|
-
const u = i * r,
|
|
2966
|
-
l = l.slice(u,
|
|
2955
|
+
const u = i * r, d = u + i;
|
|
2956
|
+
l = l.slice(u, d);
|
|
2967
2957
|
let f;
|
|
2968
2958
|
o.options.paginateExpandedRows ? f = {
|
|
2969
2959
|
rows: l,
|
|
@@ -2974,8 +2964,8 @@ function Kt(e) {
|
|
|
2974
2964
|
flatRows: s,
|
|
2975
2965
|
rowsById: a
|
|
2976
2966
|
}), f.flatRows = [];
|
|
2977
|
-
const g = (
|
|
2978
|
-
f.flatRows.push(
|
|
2967
|
+
const g = (c) => {
|
|
2968
|
+
f.flatRows.push(c), c.subRows.length && c.subRows.forEach(g);
|
|
2979
2969
|
};
|
|
2980
2970
|
return f.rows.forEach(g), f;
|
|
2981
2971
|
}, b(o.options, "debugTable", "getPaginationRowModel"));
|
|
@@ -2997,29 +2987,29 @@ function Ut() {
|
|
|
2997
2987
|
});
|
|
2998
2988
|
});
|
|
2999
2989
|
const s = (a) => {
|
|
3000
|
-
const u = a.map((
|
|
3001
|
-
...
|
|
2990
|
+
const u = a.map((d) => ({
|
|
2991
|
+
...d
|
|
3002
2992
|
}));
|
|
3003
|
-
return u.sort((
|
|
3004
|
-
for (let
|
|
2993
|
+
return u.sort((d, f) => {
|
|
2994
|
+
for (let c = 0; c < r.length; c += 1) {
|
|
3005
2995
|
var g;
|
|
3006
|
-
const m = r[
|
|
2996
|
+
const m = r[c], p = l[m.id], h = p.sortUndefined, R = (g = m?.desc) != null ? g : !1;
|
|
3007
2997
|
let $ = 0;
|
|
3008
2998
|
if (h) {
|
|
3009
|
-
const P =
|
|
2999
|
+
const P = d.getValue(m.id), M = f.getValue(m.id), v = P === void 0, w = M === void 0;
|
|
3010
3000
|
if (v || w) {
|
|
3011
3001
|
if (h === "first") return v ? -1 : 1;
|
|
3012
3002
|
if (h === "last") return v ? 1 : -1;
|
|
3013
3003
|
$ = v && w ? 0 : v ? h : -h;
|
|
3014
3004
|
}
|
|
3015
3005
|
}
|
|
3016
|
-
if ($ === 0 && ($ = p.sortingFn(
|
|
3006
|
+
if ($ === 0 && ($ = p.sortingFn(d, f, m.id)), $ !== 0)
|
|
3017
3007
|
return R && ($ *= -1), p.invertSorting && ($ *= -1), $;
|
|
3018
3008
|
}
|
|
3019
|
-
return
|
|
3020
|
-
}), u.forEach((
|
|
3009
|
+
return d.index - f.index;
|
|
3010
|
+
}), u.forEach((d) => {
|
|
3021
3011
|
var f;
|
|
3022
|
-
i.push(
|
|
3012
|
+
i.push(d), (f = d.subRows) != null && f.length && (d.subRows = s(d.subRows));
|
|
3023
3013
|
}), u;
|
|
3024
3014
|
};
|
|
3025
3015
|
return {
|
|
@@ -3029,20 +3019,10 @@ function Ut() {
|
|
|
3029
3019
|
};
|
|
3030
3020
|
}, b(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
|
|
3031
3021
|
}
|
|
3032
|
-
/**
|
|
3033
|
-
* vue-table
|
|
3034
|
-
*
|
|
3035
|
-
* Copyright (c) TanStack
|
|
3036
|
-
*
|
|
3037
|
-
* This source code is licensed under the MIT license found in the
|
|
3038
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
3039
|
-
*
|
|
3040
|
-
* @license MIT
|
|
3041
|
-
*/
|
|
3042
3022
|
function Se() {
|
|
3043
3023
|
return !0;
|
|
3044
3024
|
}
|
|
3045
|
-
const ri = Symbol("merge-proxy"), li = {
|
|
3025
|
+
const ri = /* @__PURE__ */ Symbol("merge-proxy"), li = {
|
|
3046
3026
|
get(e, o, t) {
|
|
3047
3027
|
return o === ri ? t : e.get(o);
|
|
3048
3028
|
},
|
|
@@ -3151,7 +3131,7 @@ var x = /* @__PURE__ */ ((e) => (e.BETWEEN = "between", e.CONTAINS = "contains",
|
|
|
3151
3131
|
const si = { class: "pagination" }, ai = {
|
|
3152
3132
|
key: 0,
|
|
3153
3133
|
class: "items-per-page-control"
|
|
3154
|
-
}, ui = ["value"],
|
|
3134
|
+
}, ui = ["value"], ci = ["value"], di = {
|
|
3155
3135
|
key: 1,
|
|
3156
3136
|
class: "page-input-control"
|
|
3157
3137
|
}, gi = {
|
|
@@ -3218,18 +3198,18 @@ const si = { class: "pagination" }, ai = {
|
|
|
3218
3198
|
), r = B(
|
|
3219
3199
|
() => Math.ceil(t.totalItems / i.value)
|
|
3220
3200
|
), l = B(
|
|
3221
|
-
() => Array.from({ length: r.value }, (u,
|
|
3201
|
+
() => Array.from({ length: r.value }, (u, d) => d + 1)
|
|
3222
3202
|
), s = (u) => {
|
|
3223
|
-
const
|
|
3203
|
+
const d = Number.parseInt(
|
|
3224
3204
|
u.target.value,
|
|
3225
3205
|
10
|
|
3226
3206
|
);
|
|
3227
|
-
i.value =
|
|
3207
|
+
i.value = d, n("update:itemsPerPage", i.value);
|
|
3228
3208
|
}, a = (u) => {
|
|
3229
|
-
const
|
|
3230
|
-
!isNaN(
|
|
3209
|
+
const d = Number.parseInt(u.toString(), 10) - 1;
|
|
3210
|
+
!Number.isNaN(d) && d >= 0 && d < r.value && n("update:currentPage", d);
|
|
3231
3211
|
};
|
|
3232
|
-
return (u,
|
|
3212
|
+
return (u, d) => (S(), C("div", si, [
|
|
3233
3213
|
e.showItemsPerPageControl ? (S(), C("div", ai, [
|
|
3234
3214
|
A("span", null, N(e.itemsPerPageControlLabel), 1),
|
|
3235
3215
|
A("select", {
|
|
@@ -3239,10 +3219,10 @@ const si = { class: "pagination" }, ai = {
|
|
|
3239
3219
|
(S(!0), C(H, null, z(e.itemsPerPageOptions, (f) => (S(), C("option", {
|
|
3240
3220
|
key: `items-per-page-option-${f}`,
|
|
3241
3221
|
value: f
|
|
3242
|
-
}, N(f), 9,
|
|
3222
|
+
}, N(f), 9, ci))), 128))
|
|
3243
3223
|
], 40, ui)
|
|
3244
3224
|
])) : D("", !0),
|
|
3245
|
-
r.value > 1 && e.showPageInput ? (S(), C("div",
|
|
3225
|
+
r.value > 1 && e.showPageInput ? (S(), C("div", di, [
|
|
3246
3226
|
A("span", null, N(e.pageInputLabel), 1),
|
|
3247
3227
|
E(y(Ft), {
|
|
3248
3228
|
type: "number",
|
|
@@ -3257,7 +3237,7 @@ const si = { class: "pagination" }, ai = {
|
|
|
3257
3237
|
disabled: !(e.currentPage > 0),
|
|
3258
3238
|
class: "first-page",
|
|
3259
3239
|
size: "small",
|
|
3260
|
-
onClick:
|
|
3240
|
+
onClick: d[0] || (d[0] = (f) => u.$emit("update:currentPage", 0))
|
|
3261
3241
|
}, {
|
|
3262
3242
|
iconLeft: G(() => [
|
|
3263
3243
|
E(y(j), { icon: "prime:angle-double-left" })
|
|
@@ -3269,7 +3249,7 @@ const si = { class: "pagination" }, ai = {
|
|
|
3269
3249
|
disabled: !(e.currentPage > 0),
|
|
3270
3250
|
class: "previous-page",
|
|
3271
3251
|
size: "small",
|
|
3272
|
-
onClick:
|
|
3252
|
+
onClick: d[1] || (d[1] = (f) => u.$emit("update:currentPage", e.currentPage - 1))
|
|
3273
3253
|
}, {
|
|
3274
3254
|
iconLeft: G(() => [
|
|
3275
3255
|
E(y(j), { icon: "prime:angle-left" })
|
|
@@ -3292,7 +3272,7 @@ const si = { class: "pagination" }, ai = {
|
|
|
3292
3272
|
disabled: !(e.currentPage < r.value - 1),
|
|
3293
3273
|
class: "next-page",
|
|
3294
3274
|
size: "small",
|
|
3295
|
-
onClick:
|
|
3275
|
+
onClick: d[2] || (d[2] = (f) => u.$emit("update:currentPage", e.currentPage + 1))
|
|
3296
3276
|
}, {
|
|
3297
3277
|
iconLeft: G(() => [
|
|
3298
3278
|
E(y(j), { icon: "prime:angle-right" })
|
|
@@ -3304,7 +3284,7 @@ const si = { class: "pagination" }, ai = {
|
|
|
3304
3284
|
disabled: !(e.currentPage < r.value - 1),
|
|
3305
3285
|
class: "last-page",
|
|
3306
3286
|
size: "small",
|
|
3307
|
-
onClick:
|
|
3287
|
+
onClick: d[3] || (d[3] = (f) => u.$emit("update:currentPage", r.value - 1))
|
|
3308
3288
|
}, {
|
|
3309
3289
|
iconLeft: G(() => [
|
|
3310
3290
|
E(y(j), { icon: "prime:angle-double-right" })
|
|
@@ -3328,7 +3308,7 @@ const si = { class: "pagination" }, ai = {
|
|
|
3328
3308
|
value: e,
|
|
3329
3309
|
locale: o = "en-GB",
|
|
3330
3310
|
formatOptions: t
|
|
3331
|
-
}) => typeof e != "number" || isNaN(e) ? e : new Intl.NumberFormat(o, t).format(e), Ri = (e, o, t) => on(e, o, t ?? Xt), Fi = (e, o, t) => nn(e, o, t ?? Ci),
|
|
3311
|
+
}) => typeof e != "number" || Number.isNaN(e) ? e : new Intl.NumberFormat(o, t).format(e), Ri = (e, o, t) => on(e, o, t ?? Xt), Fi = (e, o, t) => nn(e, o, t ?? Ci), de = (e) => {
|
|
3332
3312
|
switch (e) {
|
|
3333
3313
|
case x.CONTAINS:
|
|
3334
3314
|
return { operator: T.CONTAINS };
|
|
@@ -3387,31 +3367,35 @@ const si = { class: "pagination" }, ai = {
|
|
|
3387
3367
|
const o = e.value.filter(
|
|
3388
3368
|
(t) => Yt(t)
|
|
3389
3369
|
);
|
|
3390
|
-
return o.length
|
|
3370
|
+
return o.length === 0 ? null : e.filterFn === x.BETWEEN ? o.length > 1 ? {
|
|
3391
3371
|
key: e.id,
|
|
3392
|
-
...
|
|
3372
|
+
...de(e.filterFn),
|
|
3393
3373
|
value: o.slice(0, 2).join(",")
|
|
3394
3374
|
} : null : e.filterFn && !$i(e.filterFn) ? {
|
|
3395
3375
|
key: e.id,
|
|
3396
|
-
...
|
|
3376
|
+
...de(e.filterFn),
|
|
3397
3377
|
value: o[0]
|
|
3398
3378
|
} : {
|
|
3399
3379
|
key: e.id,
|
|
3400
|
-
...
|
|
3380
|
+
...de(e.filterFn || x.IN),
|
|
3401
3381
|
value: o.join(",")
|
|
3402
3382
|
};
|
|
3403
3383
|
}, bi = (e, o, t) => {
|
|
3404
3384
|
const n = () => {
|
|
3405
3385
|
if (!o || o.length === 0) return null;
|
|
3406
|
-
const s = o.filter((a) => Array.isArray(a.value) ? a.value.filter((
|
|
3386
|
+
const s = o.filter((a) => Array.isArray(a.value) ? a.value.filter((d) => Yt(d)).length > 0 : typeof a.value == "string" ? a.value.trim() !== "" : a.value != null);
|
|
3407
3387
|
return s.length === 0 ? null : s.length === 1 ? Array.isArray(s[0].value) ? wt(s[0]) : {
|
|
3408
3388
|
key: s[0].id,
|
|
3409
|
-
...
|
|
3389
|
+
...de(
|
|
3390
|
+
s[0].filterFn || x.CONTAINS
|
|
3391
|
+
),
|
|
3410
3392
|
value: String(s[0].value)
|
|
3411
3393
|
} : {
|
|
3412
3394
|
AND: s.map((a) => Array.isArray(a.value) ? wt(a) : {
|
|
3413
3395
|
key: a.id,
|
|
3414
|
-
...
|
|
3396
|
+
...de(
|
|
3397
|
+
a.filterFn || x.CONTAINS
|
|
3398
|
+
),
|
|
3415
3399
|
value: String(a.value)
|
|
3416
3400
|
})
|
|
3417
3401
|
};
|
|
@@ -3478,7 +3462,7 @@ const si = { class: "pagination" }, ai = {
|
|
|
3478
3462
|
return {
|
|
3479
3463
|
props: r,
|
|
3480
3464
|
render: (() => {
|
|
3481
|
-
const
|
|
3465
|
+
const d = {
|
|
3482
3466
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3483
3467
|
number: (g) => vt({
|
|
3484
3468
|
value: Number(g),
|
|
@@ -3509,7 +3493,7 @@ const si = { class: "pagination" }, ai = {
|
|
|
3509
3493
|
}),
|
|
3510
3494
|
...o.customFormatters
|
|
3511
3495
|
}, f = i.column.columnDef.dataType || "text";
|
|
3512
|
-
return
|
|
3496
|
+
return d?.[f]?.(r.getValue()) || a;
|
|
3513
3497
|
})()
|
|
3514
3498
|
};
|
|
3515
3499
|
}, n = (i) => {
|
|
@@ -3598,27 +3582,27 @@ const si = { class: "pagination" }, ai = {
|
|
|
3598
3582
|
emits: ["action:select"],
|
|
3599
3583
|
setup(e, { emit: o }) {
|
|
3600
3584
|
const t = e, n = o, i = K(!1), r = K(), l = B(
|
|
3601
|
-
() => t.actions.map((
|
|
3602
|
-
...
|
|
3603
|
-
display: typeof
|
|
3604
|
-
disabled: typeof
|
|
3605
|
-
})).filter((
|
|
3585
|
+
() => t.actions.map((c) => ({
|
|
3586
|
+
...c,
|
|
3587
|
+
display: typeof c.display == "function" ? c.display(t.data) : c.display ?? !0,
|
|
3588
|
+
disabled: typeof c.disabled == "function" ? c.disabled(t.data) : c.disabled
|
|
3589
|
+
})).filter((c) => c.display)
|
|
3606
3590
|
), s = B(() => {
|
|
3607
|
-
const
|
|
3608
|
-
if (
|
|
3609
|
-
return typeof
|
|
3591
|
+
const c = r.value?.confirmationOptions;
|
|
3592
|
+
if (c)
|
|
3593
|
+
return typeof c == "function" ? c(t.data) : c;
|
|
3610
3594
|
}), a = B(
|
|
3611
3595
|
() => (typeof t.displayActions == "function" ? t.displayActions(t.data) : t.displayActions) && l.value?.length
|
|
3612
3596
|
), u = B(
|
|
3613
3597
|
() => l.value?.length && t.mode === "buttons" || t.mode === "auto" && l.value?.length <= t.autoModeCount
|
|
3614
|
-
),
|
|
3598
|
+
), d = B(
|
|
3615
3599
|
() => l.value?.length && t.mode === "dropdown" || t.mode === "auto" && l.value?.length > t.autoModeCount
|
|
3616
3600
|
), f = () => {
|
|
3617
3601
|
i.value = !1, n("action:select", r.value);
|
|
3618
|
-
}, g = (
|
|
3619
|
-
r.value =
|
|
3602
|
+
}, g = (c) => {
|
|
3603
|
+
r.value = c, c?.requireConfirmationModal ? i.value = !0 : n("action:select", r.value);
|
|
3620
3604
|
};
|
|
3621
|
-
return (
|
|
3605
|
+
return (c, m) => a.value ? (S(), C("div", Mi, [
|
|
3622
3606
|
u.value ? (S(!0), C(H, { key: 0 }, z(l.value, (p, h) => (S(), _(y(Z), te({ ref_for: !0 }, p, {
|
|
3623
3607
|
key: `mode-button-${h}`,
|
|
3624
3608
|
class: p.class,
|
|
@@ -3629,13 +3613,13 @@ const si = { class: "pagination" }, ai = {
|
|
|
3629
3613
|
rounded: "",
|
|
3630
3614
|
variant: "textOnly",
|
|
3631
3615
|
onClick: (R) => g(p)
|
|
3632
|
-
}), null, 16, ["class", "disabled", "icon-left", "label", "title", "onClick"]))), 128)) :
|
|
3616
|
+
}), null, 16, ["class", "disabled", "icon-left", "label", "title", "onClick"]))), 128)) : d.value ? (S(), _(y(ln), {
|
|
3633
3617
|
key: 1,
|
|
3634
3618
|
menu: l.value,
|
|
3635
3619
|
onSelect: g
|
|
3636
3620
|
}, {
|
|
3637
3621
|
default: G(() => [
|
|
3638
|
-
J(
|
|
3622
|
+
J(c.$slots, "trigger", {}, () => [
|
|
3639
3623
|
E(y(j), {
|
|
3640
3624
|
icon: "prime:cog",
|
|
3641
3625
|
width: "22"
|
|
@@ -3644,7 +3628,7 @@ const si = { class: "pagination" }, ai = {
|
|
|
3644
3628
|
]),
|
|
3645
3629
|
_: 3
|
|
3646
3630
|
}, 8, ["menu"])) : D("", !0),
|
|
3647
|
-
J(
|
|
3631
|
+
J(c.$slots, "confirmationModal", {}, () => [
|
|
3648
3632
|
i.value ? (S(), _(y(sn), {
|
|
3649
3633
|
key: 0,
|
|
3650
3634
|
"onOn:close": m[0] || (m[0] = (p) => i.value = !1),
|
|
@@ -3726,15 +3710,15 @@ const si = { class: "pagination" }, ai = {
|
|
|
3726
3710
|
},
|
|
3727
3711
|
setup(e) {
|
|
3728
3712
|
const o = e, t = (l) => o.highlightActiveColumn && (l.getIsSorted() === "asc" || l.getIsSorted() === "desc" || l.getIsFiltered()) ? "highlight" : "", n = (l) => l.getFilterValue(), i = (l) => l?.length ? l.map((s, a) => {
|
|
3729
|
-
const u = String(s.getDate()).padStart(2, "0"),
|
|
3730
|
-
return `${s.getFullYear()}-${
|
|
3713
|
+
const u = String(s.getDate()).padStart(2, "0"), d = String(s.getMonth() + 1).padStart(2, "0"), f = a === 0 ? "00:00:00" : "23:59:59";
|
|
3714
|
+
return `${s.getFullYear()}-${d}-${u} ${f}`;
|
|
3731
3715
|
}).filter((s) => s !== null) : null, r = (l, s, a) => {
|
|
3732
|
-
const u = l.getFilterValue(),
|
|
3733
|
-
|
|
3734
|
-
const f =
|
|
3716
|
+
const u = l.getFilterValue(), d = Array.isArray(u) ? [...u] : [void 0, void 0];
|
|
3717
|
+
d[s] = a !== void 0 ? Number(a) : void 0;
|
|
3718
|
+
const f = d.some(
|
|
3735
3719
|
(g) => g !== void 0
|
|
3736
3720
|
);
|
|
3737
|
-
l.setFilterValue(f ?
|
|
3721
|
+
l.setFilterValue(f ? d : []);
|
|
3738
3722
|
};
|
|
3739
3723
|
return (l, s) => (S(), C("thead", null, [
|
|
3740
3724
|
(S(!0), C(H, null, z(e.table.getHeaderGroups(), (a) => (S(), C("tr", {
|
|
@@ -3758,7 +3742,7 @@ const si = { class: "pagination" }, ai = {
|
|
|
3758
3742
|
maxWidth: u.column.columnDef.maxWidth,
|
|
3759
3743
|
minWidth: u.column.columnDef.minWidth
|
|
3760
3744
|
}),
|
|
3761
|
-
onClick: (
|
|
3745
|
+
onClick: (d) => u.column.getCanSort() ? u.column.getToggleSortingHandler()?.(d) : null
|
|
3762
3746
|
}, [
|
|
3763
3747
|
u.isPlaceholder ? D("", !0) : (S(), C(H, { key: 0 }, [
|
|
3764
3748
|
E(y(pe), {
|
|
@@ -4063,14 +4047,14 @@ const si = { class: "pagination" }, ai = {
|
|
|
4063
4047
|
const t = e, n = o, i = [], r = K(t.initialFilters), l = K([]), s = K({}), a = K({
|
|
4064
4048
|
pageIndex: we,
|
|
4065
4049
|
pageSize: t.paginated ? t.rowPerPage : t.data.length
|
|
4066
|
-
}), u = K({}),
|
|
4050
|
+
}), u = K({}), d = K(t.initialSorting), f = B(() => t.columnsData.some((v) => v.enableColumnFilter)), g = B(() => ({
|
|
4067
4051
|
columnFilters: r.value,
|
|
4068
4052
|
columnOrder: l.value,
|
|
4069
4053
|
columnVisibility: s.value,
|
|
4070
4054
|
pagination: a.value,
|
|
4071
|
-
sorting:
|
|
4072
|
-
})),
|
|
4073
|
-
() =>
|
|
4055
|
+
sorting: d.value
|
|
4056
|
+
})), c = B(
|
|
4057
|
+
() => cn(t.persistStateStorage)
|
|
4074
4058
|
), m = B(
|
|
4075
4059
|
() => t.isServerTable ? t.totalRecords : h.value.getFilteredRowModel().rows?.length
|
|
4076
4060
|
), p = B(
|
|
@@ -4085,14 +4069,14 @@ const si = { class: "pagination" }, ai = {
|
|
|
4085
4069
|
pagination: a.value,
|
|
4086
4070
|
rowSelection: u.value,
|
|
4087
4071
|
get sorting() {
|
|
4088
|
-
return
|
|
4072
|
+
return d.value;
|
|
4089
4073
|
}
|
|
4090
4074
|
},
|
|
4091
4075
|
onColumnFiltersChange: (v) => {
|
|
4092
4076
|
r.value = typeof v == "function" ? v(r.value) : v, Array.isArray(r.value) || (r.value = []), a.value.pageIndex = we, t.isServerTable && (r.value = t.columnsData.filter(
|
|
4093
4077
|
(w) => w.enableColumnFilter && (t.visibleColumns.includes(
|
|
4094
4078
|
String(w.accessorKey ?? w.id)
|
|
4095
|
-
) ||
|
|
4079
|
+
) || t.visibleColumns.length === 0)
|
|
4096
4080
|
).map((w) => {
|
|
4097
4081
|
if (w.meta?.filterVariant === "range") {
|
|
4098
4082
|
const I = r.value.find(
|
|
@@ -4123,7 +4107,7 @@ const si = { class: "pagination" }, ai = {
|
|
|
4123
4107
|
u.value = typeof v == "function" ? v(u.value) : v, n("change:rowSelection", p.value);
|
|
4124
4108
|
},
|
|
4125
4109
|
onSortingChange: (v) => {
|
|
4126
|
-
|
|
4110
|
+
d.value = typeof v == "function" ? v(d.value) : v, a.value.pageIndex = we, t.isServerTable && R();
|
|
4127
4111
|
},
|
|
4128
4112
|
columnResizeMode: "onChange",
|
|
4129
4113
|
data: t.data,
|
|
@@ -4139,14 +4123,14 @@ const si = { class: "pagination" }, ai = {
|
|
|
4139
4123
|
})
|
|
4140
4124
|
);
|
|
4141
4125
|
Ct(
|
|
4142
|
-
[r, l, s, a,
|
|
4126
|
+
[r, l, s, a, d],
|
|
4143
4127
|
() => {
|
|
4144
|
-
t.persistState && t.id && yt(t.id, g.value,
|
|
4128
|
+
t.persistState && t.id && yt(t.id, g.value, c.value);
|
|
4145
4129
|
}
|
|
4146
4130
|
);
|
|
4147
4131
|
const R = () => {
|
|
4148
4132
|
const v = bi(
|
|
4149
|
-
|
|
4133
|
+
d.value,
|
|
4150
4134
|
r.value,
|
|
4151
4135
|
a.value
|
|
4152
4136
|
);
|
|
@@ -4155,9 +4139,9 @@ const si = { class: "pagination" }, ai = {
|
|
|
4155
4139
|
r.value = t.initialFilters, l.value = [], s.value = {}, a.value = {
|
|
4156
4140
|
pageIndex: we,
|
|
4157
4141
|
pageSize: t.paginated ? t.rowPerPage : t.data.length
|
|
4158
|
-
},
|
|
4142
|
+
}, d.value = t.initialSorting;
|
|
4159
4143
|
}, P = () => {
|
|
4160
|
-
|
|
4144
|
+
t.enableRowSelection && i.push({
|
|
4161
4145
|
accessorKey: "select",
|
|
4162
4146
|
header: ({ table: v }) => Y(Te, {
|
|
4163
4147
|
"aria-label": "Select all",
|
|
@@ -4172,8 +4156,9 @@ const si = { class: "pagination" }, ai = {
|
|
|
4172
4156
|
align: "center",
|
|
4173
4157
|
enableColumnFilter: !1,
|
|
4174
4158
|
enableSorting: !1
|
|
4175
|
-
})
|
|
4176
|
-
|
|
4159
|
+
});
|
|
4160
|
+
for (const v of t.columnsData)
|
|
4161
|
+
t.visibleColumns.length > 0 && !t.visibleColumns.includes(String(v.accessorKey ?? v.id)) || (v.meta?.filterVariant === "multiselect" && !v.filterFn ? v.filterFn = (w, I, V) => !V || V.length === 0 ? w : V.some((k) => w.getValue(I) == k) : v.meta?.filterVariant === "select" && !v.filterFn ? v.filterFn = (w, I, V) => V === void 0 || V.length === 0 ? !0 : String(V) === String(w.getValue(I)) : v.meta?.filterVariant === "dateRange" && !v.filterFn ? v.filterFn = (w, I, V) => {
|
|
4177
4162
|
if (V?.length) {
|
|
4178
4163
|
const k = new Date(V[1]).setHours(23, 59, 59, 999), L = new Date(w.getValue(I)), U = new Date(V[0]).setHours(0, 0, 0, 0);
|
|
4179
4164
|
return L.getTime() >= U && L.getTime() <= k;
|
|
@@ -4189,7 +4174,7 @@ const si = { class: "pagination" }, ai = {
|
|
|
4189
4174
|
enableColumnFilter: v.enableColumnFilter ?? !1,
|
|
4190
4175
|
enableSorting: v.enableSorting ?? !1
|
|
4191
4176
|
}));
|
|
4192
|
-
|
|
4177
|
+
if (t.dataActionMenu?.length && i.push({
|
|
4193
4178
|
accessorKey: "actions",
|
|
4194
4179
|
align: "center",
|
|
4195
4180
|
enableColumnFilter: !1,
|
|
@@ -4216,15 +4201,15 @@ const si = { class: "pagination" }, ai = {
|
|
|
4216
4201
|
}, M = () => {
|
|
4217
4202
|
if (!t.persistState || !t.id)
|
|
4218
4203
|
return;
|
|
4219
|
-
const v = Pi(t.id,
|
|
4220
|
-
v && (r.value = v.columnFilters, l.value = v.columnOrder, s.value = v.columnVisibility,
|
|
4204
|
+
const v = Pi(t.id, c.value);
|
|
4205
|
+
v && (r.value = v.columnFilters, l.value = v.columnOrder, s.value = v.columnVisibility, d.value = v.sorting, t.rowPerPageOptions.includes(v.pagination.pageSize) && (a.value = v.pagination)), yt(t.id, g.value, c.value);
|
|
4221
4206
|
};
|
|
4222
4207
|
return P(), (v, w) => (S(), C("div", {
|
|
4223
4208
|
id: e.id,
|
|
4224
4209
|
class: "table-container"
|
|
4225
4210
|
}, [
|
|
4226
4211
|
e.isLoading ? (S(), C("div", Zi, [
|
|
4227
|
-
E(y(
|
|
4212
|
+
E(y(dn), { class: "loading-icon" })
|
|
4228
4213
|
])) : D("", !0),
|
|
4229
4214
|
e.titleInfo ? (S(), C("span", {
|
|
4230
4215
|
key: 1,
|
|
@@ -4233,7 +4218,7 @@ const si = { class: "pagination" }, ai = {
|
|
|
4233
4218
|
e.showColumnAction || e.showResetButton || v.$slots.toolbar ? (S(), _(Yi, {
|
|
4234
4219
|
key: 2,
|
|
4235
4220
|
"column-action-button-label": e.columnActionButtonLabel,
|
|
4236
|
-
"has-actions-column":
|
|
4221
|
+
"has-actions-column": e.dataActionMenu.length > 0,
|
|
4237
4222
|
"has-selection-column": e.enableRowSelection,
|
|
4238
4223
|
"reset-button-label": e.resetButtonLabel,
|
|
4239
4224
|
"show-column-action": e.showColumnAction,
|
|
@@ -4381,8 +4366,8 @@ const si = { class: "pagination" }, ai = {
|
|
|
4381
4366
|
cell: ({ row: { original: u } }) => u.uploadedBy ? u.uploadedBy.givenName || u.uploadedBy.lastName ? `${u.uploadedBy.givenName || ""} ${u.uploadedBy.lastName || ""}` : u.uploadedBy.email : Y("code", {}, "—"),
|
|
4382
4367
|
enableColumnFilter: !t.isServerTable,
|
|
4383
4368
|
enableSorting: !t.isServerTable,
|
|
4384
|
-
filterFn: (u,
|
|
4385
|
-
const g = u.getValue(
|
|
4369
|
+
filterFn: (u, d, f) => {
|
|
4370
|
+
const g = u.getValue(d);
|
|
4386
4371
|
return !f || f.length === 0 ? !0 : `${g.givenName || ""} ${g.lastName || ""}`.trim().toLowerCase().includes(f.toLowerCase()) || (g.email?.toLowerCase().includes(f.toLowerCase()) ?? !1);
|
|
4387
4372
|
},
|
|
4388
4373
|
filterPlaceholder: "Name",
|
|
@@ -4463,41 +4448,47 @@ const si = { class: "pagination" }, ai = {
|
|
|
4463
4448
|
}), u;
|
|
4464
4449
|
}), l = B(() => [
|
|
4465
4450
|
...i.map((u) => {
|
|
4466
|
-
const
|
|
4451
|
+
const d = t.columnsData.find(
|
|
4467
4452
|
(f) => f.accessorKey === u.accessorKey
|
|
4468
4453
|
);
|
|
4469
|
-
return
|
|
4454
|
+
return d ? { ...u, ...d } : u;
|
|
4470
4455
|
}),
|
|
4471
4456
|
...t.columnsData.filter(
|
|
4472
4457
|
(u) => !i.some(
|
|
4473
|
-
(
|
|
4458
|
+
(d) => d.accessorKey === u.accessorKey
|
|
4474
4459
|
)
|
|
4475
4460
|
)
|
|
4476
4461
|
]), s = (u) => {
|
|
4477
4462
|
switch (u.action) {
|
|
4478
|
-
case "archive":
|
|
4463
|
+
case "archive": {
|
|
4479
4464
|
n("action:archive", u.data);
|
|
4480
4465
|
break;
|
|
4481
|
-
|
|
4466
|
+
}
|
|
4467
|
+
case "delete": {
|
|
4482
4468
|
n("action:delete", u.data);
|
|
4483
4469
|
break;
|
|
4484
|
-
|
|
4470
|
+
}
|
|
4471
|
+
case "download": {
|
|
4485
4472
|
n("action:download", u.data);
|
|
4486
4473
|
break;
|
|
4487
|
-
|
|
4474
|
+
}
|
|
4475
|
+
case "edit": {
|
|
4488
4476
|
n("action:edit", u.data);
|
|
4489
4477
|
break;
|
|
4490
|
-
|
|
4478
|
+
}
|
|
4479
|
+
case "share": {
|
|
4491
4480
|
n("action:share", u.data);
|
|
4492
4481
|
break;
|
|
4493
|
-
|
|
4482
|
+
}
|
|
4483
|
+
case "view": {
|
|
4494
4484
|
n("action:view", u.data);
|
|
4495
4485
|
break;
|
|
4486
|
+
}
|
|
4496
4487
|
}
|
|
4497
4488
|
}, a = (u) => {
|
|
4498
4489
|
n("update:request", u);
|
|
4499
4490
|
};
|
|
4500
|
-
return (u,
|
|
4491
|
+
return (u, d) => (S(), _(ir, te(e.tableOptions, {
|
|
4501
4492
|
id: e.id,
|
|
4502
4493
|
"columns-data": l.value,
|
|
4503
4494
|
data: e.files,
|
|
@@ -4622,9 +4613,10 @@ const si = { class: "pagination" }, ai = {
|
|
|
4622
4613
|
case "download":
|
|
4623
4614
|
case "edit":
|
|
4624
4615
|
case "share":
|
|
4625
|
-
case "view":
|
|
4616
|
+
case "view": {
|
|
4626
4617
|
n(`action:${l}`, s);
|
|
4627
4618
|
break;
|
|
4619
|
+
}
|
|
4628
4620
|
}
|
|
4629
4621
|
};
|
|
4630
4622
|
return (l, s) => e.presentation === "list" ? (S(), _(y(gn), te({ key: 0 }, e.listProps, {
|
|
@@ -4661,7 +4653,7 @@ const si = { class: "pagination" }, ai = {
|
|
|
4661
4653
|
}), ar = { class: "table-wrapper" }, ur = {
|
|
4662
4654
|
key: 0,
|
|
4663
4655
|
class: "toggle-wrap"
|
|
4664
|
-
},
|
|
4656
|
+
}, cr = ["colSpan", "onClick"], dr = { key: 0 }, gr = ["data-label"], fr = { class: "page-navigation-container" }, pr = { class: "page-indicators-selection-container" }, mr = { class: "page-number-indicators" }, hr = { class: "go-to-page-container" }, vr = ["value", "max"], Sr = ["value"], wr = ["value"], yr = { class: "page-navigation-buttons-container" }, Cr = ["disabled"], Rr = ["disabled"], Fr = ["disabled"], br = ["disabled"], Pr = {
|
|
4665
4657
|
name: "TanstackTable"
|
|
4666
4658
|
}, Dr = /* @__PURE__ */ Q({
|
|
4667
4659
|
...Pr,
|
|
@@ -4681,17 +4673,17 @@ const si = { class: "pagination" }, ai = {
|
|
|
4681
4673
|
},
|
|
4682
4674
|
setup(e) {
|
|
4683
4675
|
const o = e, t = mo(), n = [];
|
|
4684
|
-
o.columnsData
|
|
4676
|
+
for (const d of o.columnsData) {
|
|
4685
4677
|
const f = t.accessor(
|
|
4686
|
-
|
|
4678
|
+
d.accessorKey,
|
|
4687
4679
|
{
|
|
4688
|
-
header: () =>
|
|
4680
|
+
header: () => d.header,
|
|
4689
4681
|
footer: (g) => g.column.id,
|
|
4690
|
-
enableSorting:
|
|
4682
|
+
enableSorting: d.sort !== void 0 ? d.sort : !1
|
|
4691
4683
|
}
|
|
4692
4684
|
);
|
|
4693
4685
|
n.push(f);
|
|
4694
|
-
}
|
|
4686
|
+
}
|
|
4695
4687
|
const i = K([]), r = Wt({
|
|
4696
4688
|
columns: n,
|
|
4697
4689
|
state: {
|
|
@@ -4699,8 +4691,8 @@ const si = { class: "pagination" }, ai = {
|
|
|
4699
4691
|
return i.value;
|
|
4700
4692
|
}
|
|
4701
4693
|
},
|
|
4702
|
-
onSortingChange: (
|
|
4703
|
-
i.value = typeof
|
|
4694
|
+
onSortingChange: (d) => {
|
|
4695
|
+
i.value = typeof d == "function" ? d(i.value) : d;
|
|
4704
4696
|
},
|
|
4705
4697
|
columnResizeMode: "onChange",
|
|
4706
4698
|
data: o.rows,
|
|
@@ -4710,14 +4702,14 @@ const si = { class: "pagination" }, ai = {
|
|
|
4710
4702
|
getSortedRowModel: Ut()
|
|
4711
4703
|
}), l = K(!1), s = () => {
|
|
4712
4704
|
l.value = !l.value;
|
|
4713
|
-
}, a = (
|
|
4714
|
-
const f =
|
|
4705
|
+
}, a = (d) => {
|
|
4706
|
+
const f = d.target, g = f.value ? Number(f.value) - 1 : 0;
|
|
4715
4707
|
r.setPageIndex(g);
|
|
4716
|
-
}, u = (
|
|
4717
|
-
const f =
|
|
4708
|
+
}, u = (d) => {
|
|
4709
|
+
const f = d.target, g = f.value ? Number(f.value) : 10;
|
|
4718
4710
|
r.setPageSize(g);
|
|
4719
4711
|
};
|
|
4720
|
-
return (
|
|
4712
|
+
return (d, f) => (S(), C("div", ar, [
|
|
4721
4713
|
A("table", {
|
|
4722
4714
|
style: oe(`width: ${y(r).getCenterTotalSize()}`)
|
|
4723
4715
|
}, [
|
|
@@ -4744,41 +4736,41 @@ const si = { class: "pagination" }, ai = {
|
|
|
4744
4736
|
(S(!0), C(H, null, z(y(r).getHeaderGroups(), (g) => (S(), C("tr", {
|
|
4745
4737
|
key: g.id
|
|
4746
4738
|
}, [
|
|
4747
|
-
(S(!0), C(H, null, z(g.headers, (
|
|
4748
|
-
key:
|
|
4749
|
-
colSpan:
|
|
4750
|
-
onClick: (m) =>
|
|
4739
|
+
(S(!0), C(H, null, z(g.headers, (c) => (S(), C("th", {
|
|
4740
|
+
key: c.id,
|
|
4741
|
+
colSpan: c.colSpan,
|
|
4742
|
+
onClick: (m) => c.column.getCanSort() ? c.column.getToggleSortingHandler()?.(m) : null
|
|
4751
4743
|
}, [
|
|
4752
|
-
|
|
4744
|
+
c.isPlaceholder ? D("", !0) : (S(), C("div", dr, [
|
|
4753
4745
|
E(y(pe), {
|
|
4754
|
-
props:
|
|
4755
|
-
render:
|
|
4746
|
+
props: c.getContext(),
|
|
4747
|
+
render: c.column.columnDef.header
|
|
4756
4748
|
}, null, 8, ["props", "render"]),
|
|
4757
|
-
!
|
|
4749
|
+
!c.column.getIsSorted() && c.column.getCanSort() ? (S(), _(y(j), {
|
|
4758
4750
|
key: 0,
|
|
4759
4751
|
icon: "ri:arrow-up-down-line",
|
|
4760
4752
|
class: "sort-icon"
|
|
4761
4753
|
})) : D("", !0),
|
|
4762
|
-
|
|
4754
|
+
c.column.getIsSorted() && c.column.getCanSort() ? (S(), _(y(j), {
|
|
4763
4755
|
key: 1,
|
|
4764
|
-
icon:
|
|
4756
|
+
icon: c.column.getIsSorted() === "asc" ? "mdi:arrow-up" : "mdi:arrow-down",
|
|
4765
4757
|
class: "sort-icon"
|
|
4766
4758
|
}, null, 8, ["icon"])) : D("", !0)
|
|
4767
4759
|
]))
|
|
4768
|
-
], 8,
|
|
4760
|
+
], 8, cr))), 128))
|
|
4769
4761
|
]))), 128))
|
|
4770
4762
|
], 2),
|
|
4771
4763
|
A("tbody", null, [
|
|
4772
4764
|
(S(!0), C(H, null, z(y(r).getRowModel().rows, (g) => (S(), C("tr", {
|
|
4773
4765
|
key: g.id
|
|
4774
4766
|
}, [
|
|
4775
|
-
(S(!0), C(H, null, z(g.getVisibleCells(), (
|
|
4776
|
-
key:
|
|
4777
|
-
"data-label":
|
|
4767
|
+
(S(!0), C(H, null, z(g.getVisibleCells(), (c) => (S(), C("td", {
|
|
4768
|
+
key: c.id,
|
|
4769
|
+
"data-label": c.column.id
|
|
4778
4770
|
}, [
|
|
4779
4771
|
E(y(pe), {
|
|
4780
|
-
props:
|
|
4781
|
-
render:
|
|
4772
|
+
props: c.getContext(),
|
|
4773
|
+
render: c.column.columnDef.cell
|
|
4782
4774
|
}, null, 8, ["props", "render"])
|
|
4783
4775
|
], 8, gr))), 128))
|
|
4784
4776
|
]))), 128))
|