@soft-stech/bootsman-ui-shadcn 1.1.2 → 1.1.5
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/{BuiDataTable.vue_vue_type_script_setup_true_lang-R89LBsoI.js → BuiDataTable.vue_vue_type_script_setup_true_lang-pgkgRvqY.js} +154 -152
- package/dist/assets/main.css +1 -1
- package/dist/components/ui/badge/index.js +1 -1
- package/dist/components/ui/pagination/BuiPaginationCommon.js +1 -1
- package/dist/components/ui/pagination/index.js +1 -1
- package/dist/components/ui/table/BuiDataTable.js +1 -1
- package/dist/components/ui/table/BuiDataTable.vue.d.ts +4 -1
- package/dist/components/ui/table/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/variables.css +1 -0
- package/package.json +1 -1
- package/src/assets/base.css +0 -87
- package/src/assets/main.css +1 -0
- package/src/assets/variables.css +82 -0
- package/src/components/stories/BuiDataTable.story.vue +1 -0
- package/src/components/ui/badge/index.ts +1 -1
- package/src/components/ui/table/BuiDataTable.vue +5 -2
- package/src/index.ts +1 -0
- /package/dist/{BuiPaginationCommon.vue_vue_type_script_setup_true_lang-4tLnC9mc.js → variables-pHubWfbo.js} +0 -0
@@ -8,7 +8,7 @@ import { _ as j } from "./BuiTableRow.vue_vue_type_script_setup_true_lang-rLz2bJ
|
|
8
8
|
import { _ as ke } from "./BuiTableCaption.vue_vue_type_script_setup_true_lang-OnsFZa8H.js";
|
9
9
|
import { _ as be } from "./BuiTableEmpty.vue_vue_type_script_setup_true_lang-4QJziEvg.js";
|
10
10
|
import { _ as Be } from "./BuiTableFooter.vue_vue_type_script_setup_true_lang-DN__NJQ9.js";
|
11
|
-
import { _ as Te } from "./
|
11
|
+
import { _ as Te } from "./variables-pHubWfbo.js";
|
12
12
|
import { v as X } from "./utils-Fb7ZR83r.js";
|
13
13
|
/**
|
14
14
|
* table-core
|
@@ -53,17 +53,17 @@ function m(e, n, t) {
|
|
53
53
|
let i;
|
54
54
|
t.key && t.debug && (i = Date.now());
|
55
55
|
const l = e();
|
56
|
-
if (!(l.length !== o.length || l.some((
|
56
|
+
if (!(l.length !== o.length || l.some((a, g) => o[g] !== a)))
|
57
57
|
return r;
|
58
58
|
o = l;
|
59
59
|
let s;
|
60
60
|
if (t.key && t.debug && (s = Date.now()), r = n(...l), t == null || t.onChange == null || t.onChange(r), t.key && t.debug && t != null && t.debug()) {
|
61
|
-
const
|
61
|
+
const a = Math.round((Date.now() - i) * 100) / 100, g = Math.round((Date.now() - s) * 100) / 100, d = g / 16, p = (c, f) => {
|
62
62
|
for (c = String(c); c.length < f; )
|
63
63
|
c = " " + c;
|
64
64
|
return c;
|
65
65
|
};
|
66
|
-
console.info(`%c⏱ ${p(
|
66
|
+
console.info(`%c⏱ ${p(g, 5)} /${p(a, 5)} ms`, `
|
67
67
|
font-size: .6rem;
|
68
68
|
font-weight: bold;
|
69
69
|
color: hsl(${Math.max(0, Math.min(120 - 120 * d, 120))}deg 100% 31%);`, t?.key);
|
@@ -77,19 +77,19 @@ function je(e, n, t, o) {
|
|
77
77
|
...e._getDefaultColumnDef(),
|
78
78
|
...n
|
79
79
|
}, s = u.accessorKey;
|
80
|
-
let
|
81
|
-
if (u.accessorFn ?
|
80
|
+
let a = (r = (i = u.id) != null ? i : s ? s.replace(".", "_") : void 0) != null ? r : typeof u.header == "string" ? u.header : void 0, g;
|
81
|
+
if (u.accessorFn ? g = u.accessorFn : s && (s.includes(".") ? g = (p) => {
|
82
82
|
let c = p;
|
83
83
|
for (const S of s.split(".")) {
|
84
84
|
var f;
|
85
85
|
c = (f = c) == null ? void 0 : f[S], process.env.NODE_ENV !== "production" && c === void 0 && console.warn(`"${S}" in deeply nested key "${s}" returned undefined.`);
|
86
86
|
}
|
87
87
|
return c;
|
88
|
-
} :
|
88
|
+
} : g = (p) => p[u.accessorKey]), !a)
|
89
89
|
throw process.env.NODE_ENV !== "production" ? new Error(u.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
|
90
90
|
let d = {
|
91
|
-
id: `${String(
|
92
|
-
accessorFn:
|
91
|
+
id: `${String(a)}`,
|
92
|
+
accessorFn: g,
|
93
93
|
parent: o,
|
94
94
|
depth: t,
|
95
95
|
columnDef: u,
|
@@ -156,8 +156,8 @@ const Xe = {
|
|
156
156
|
createTable: (e) => {
|
157
157
|
e.getHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (n, t, o, r) => {
|
158
158
|
var i, l;
|
159
|
-
const u = (i = o?.map((d) => t.find((p) => p.id === d)).filter(Boolean)) != null ? i : [], s = (l = r?.map((d) => t.find((p) => p.id === d)).filter(Boolean)) != null ? l : [],
|
160
|
-
return G(n, [...u, ...
|
159
|
+
const u = (i = o?.map((d) => t.find((p) => p.id === d)).filter(Boolean)) != null ? i : [], s = (l = r?.map((d) => t.find((p) => p.id === d)).filter(Boolean)) != null ? l : [], a = t.filter((d) => !(o != null && o.includes(d.id)) && !(r != null && r.includes(d.id)));
|
160
|
+
return G(n, [...u, ...a, ...s], e);
|
161
161
|
}, {
|
162
162
|
key: process.env.NODE_ENV === "development" && "getHeaderGroups",
|
163
163
|
debug: () => {
|
@@ -266,8 +266,8 @@ const Xe = {
|
|
266
266
|
return (n = e.options.debugAll) != null ? n : e.options.debugHeaders;
|
267
267
|
}
|
268
268
|
}), e.getLeafHeaders = m(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (n, t, o) => {
|
269
|
-
var r, i, l, u, s,
|
270
|
-
return [...(r = (i = n[0]) == null ? void 0 : i.headers) != null ? r : [], ...(l = (u = t[0]) == null ? void 0 : u.headers) != null ? l : [], ...(s = (
|
269
|
+
var r, i, l, u, s, a;
|
270
|
+
return [...(r = (i = n[0]) == null ? void 0 : i.headers) != null ? r : [], ...(l = (u = t[0]) == null ? void 0 : u.headers) != null ? l : [], ...(s = (a = o[0]) == null ? void 0 : a.headers) != null ? s : []].map((g) => g.getLeafHeaders()).flat();
|
271
271
|
}, {
|
272
272
|
key: process.env.NODE_ENV === "development" && "getLeafHeaders",
|
273
273
|
debug: () => {
|
@@ -288,7 +288,7 @@ function G(e, n, t, o) {
|
|
288
288
|
};
|
289
289
|
u(e);
|
290
290
|
let s = [];
|
291
|
-
const
|
291
|
+
const a = (p, c) => {
|
292
292
|
const f = {
|
293
293
|
depth: c,
|
294
294
|
id: [o, `${c}`].filter(Boolean).join("_"),
|
@@ -310,12 +310,12 @@ function G(e, n, t, o) {
|
|
310
310
|
P.subHeaders.push(C), S.push(P);
|
311
311
|
}
|
312
312
|
f.headers.push(C), C.headerGroup = f;
|
313
|
-
}), s.push(f), c > 0 &&
|
314
|
-
},
|
313
|
+
}), s.push(f), c > 0 && a(S, c - 1);
|
314
|
+
}, g = n.map((p, c) => fe(t, p, {
|
315
315
|
depth: l,
|
316
316
|
index: c
|
317
317
|
}));
|
318
|
-
g
|
318
|
+
a(g, l - 1), s.reverse();
|
319
319
|
const d = (p) => p.filter((f) => f.column.getIsVisible()).map((f) => {
|
320
320
|
let S = 0, C = 0, v = [0];
|
321
321
|
f.subHeaders && f.subHeaders.length ? (v = [], d(f.subHeaders).forEach((w) => {
|
@@ -405,24 +405,24 @@ const L = {
|
|
405
405
|
return (i) => {
|
406
406
|
if (!o || !r || (i.persist == null || i.persist(), Y(i) && i.touches && i.touches.length > 1))
|
407
407
|
return;
|
408
|
-
const l = e.getSize(), u = e ? e.getLeafHeaders().map((v) => [v.column.id, v.column.getSize()]) : [[o.id, o.getSize()]], s = Y(i) ? Math.round(i.touches[0].clientX) : i.clientX,
|
408
|
+
const l = e.getSize(), u = e ? e.getLeafHeaders().map((v) => [v.column.id, v.column.getSize()]) : [[o.id, o.getSize()]], s = Y(i) ? Math.round(i.touches[0].clientX) : i.clientX, a = {}, g = (v, R) => {
|
409
409
|
typeof R == "number" && (n.setColumnSizingInfo((w) => {
|
410
410
|
var F, P;
|
411
|
-
const T = n.options.columnResizeDirection === "rtl" ? -1 : 1,
|
411
|
+
const T = n.options.columnResizeDirection === "rtl" ? -1 : 1, ae = (R - ((F = w?.startOffset) != null ? F : 0)) * T, de = Math.max(ae / ((P = w?.startSize) != null ? P : 0), -0.999999);
|
412
412
|
return w.columnSizingStart.forEach((Me) => {
|
413
413
|
let [Ae, ce] = Me;
|
414
|
-
|
414
|
+
a[Ae] = Math.round(Math.max(ce + ce * de, 0) * 100) / 100;
|
415
415
|
}), {
|
416
416
|
...w,
|
417
|
-
deltaOffset:
|
417
|
+
deltaOffset: ae,
|
418
418
|
deltaPercentage: de
|
419
419
|
};
|
420
420
|
}), (n.options.columnResizeMode === "onChange" || v === "end") && n.setColumnSizing((w) => ({
|
421
421
|
...w,
|
422
|
-
...
|
422
|
+
...a
|
423
423
|
})));
|
424
|
-
}, d = (v) =>
|
425
|
-
|
424
|
+
}, d = (v) => g("move", v), p = (v) => {
|
425
|
+
g("end", v), n.setColumnSizingInfo((R) => ({
|
426
426
|
...R,
|
427
427
|
isResizingColumn: !1,
|
428
428
|
startOffset: null,
|
@@ -698,18 +698,18 @@ const Qe = {
|
|
698
698
|
return (t = (o = n.getState().columnFilters) == null ? void 0 : o.findIndex((r) => r.id === e.id)) != null ? t : -1;
|
699
699
|
}, e.setFilterValue = (t) => {
|
700
700
|
n.setColumnFilters((o) => {
|
701
|
-
const r = e.getFilterFn(), i = o?.find((
|
701
|
+
const r = e.getFilterFn(), i = o?.find((g) => g.id === e.id), l = y(t, i ? i.value : void 0);
|
702
702
|
if (me(r, l, e)) {
|
703
703
|
var u;
|
704
|
-
return (u = o?.filter((
|
704
|
+
return (u = o?.filter((g) => g.id !== e.id)) != null ? u : [];
|
705
705
|
}
|
706
706
|
const s = {
|
707
707
|
id: e.id,
|
708
708
|
value: l
|
709
709
|
};
|
710
710
|
if (i) {
|
711
|
-
var
|
712
|
-
return (
|
711
|
+
var a;
|
712
|
+
return (a = o?.map((g) => g.id === e.id ? s : g)) != null ? a : [];
|
713
713
|
}
|
714
714
|
return o != null && o.length ? [...o, s] : [s];
|
715
715
|
});
|
@@ -882,7 +882,7 @@ function st(e, n, t) {
|
|
882
882
|
const o = e.filter((i) => !n.includes(i.id));
|
883
883
|
return t === "remove" ? o : [...n.map((i) => e.find((l) => l.id === i)).filter(Boolean), ...o];
|
884
884
|
}
|
885
|
-
const
|
885
|
+
const gt = {
|
886
886
|
getInitialState: (e) => ({
|
887
887
|
columnOrder: [],
|
888
888
|
...e
|
@@ -901,8 +901,8 @@ const at = {
|
|
901
901
|
else {
|
902
902
|
const l = [...n], u = [...r];
|
903
903
|
for (; u.length && l.length; ) {
|
904
|
-
const s = l.shift(),
|
905
|
-
|
904
|
+
const s = l.shift(), a = u.findIndex((g) => g.id === s);
|
905
|
+
a > -1 && i.push(u.splice(a, 1)[0]);
|
906
906
|
}
|
907
907
|
i = [...i, ...u];
|
908
908
|
}
|
@@ -915,7 +915,7 @@ const at = {
|
|
915
915
|
}, ne = 0, oe = 10, Q = () => ({
|
916
916
|
pageIndex: ne,
|
917
917
|
pageSize: oe
|
918
|
-
}),
|
918
|
+
}), at = {
|
919
919
|
getInitialState: (e) => ({
|
920
920
|
...e,
|
921
921
|
pagination: {
|
@@ -1028,10 +1028,10 @@ const at = {
|
|
1028
1028
|
};
|
1029
1029
|
}
|
1030
1030
|
if (t === "left") {
|
1031
|
-
var
|
1031
|
+
var a, g;
|
1032
1032
|
return {
|
1033
|
-
left: [...((
|
1034
|
-
right: ((
|
1033
|
+
left: [...((a = r?.left) != null ? a : []).filter((d) => !(o != null && o.includes(d))), ...o],
|
1034
|
+
right: ((g = r?.right) != null ? g : []).filter((d) => !(o != null && o.includes(d)))
|
1035
1035
|
};
|
1036
1036
|
}
|
1037
1037
|
return {
|
@@ -1058,17 +1058,17 @@ const at = {
|
|
1058
1058
|
e.pin = (t, o, r) => {
|
1059
1059
|
const i = o ? e.getLeafRows().map((s) => {
|
1060
1060
|
let {
|
1061
|
-
id:
|
1061
|
+
id: a
|
1062
1062
|
} = s;
|
1063
|
-
return
|
1063
|
+
return a;
|
1064
1064
|
}) : [], l = r ? e.getParentRows().map((s) => {
|
1065
1065
|
let {
|
1066
|
-
id:
|
1066
|
+
id: a
|
1067
1067
|
} = s;
|
1068
|
-
return
|
1068
|
+
return a;
|
1069
1069
|
}) : [], u = /* @__PURE__ */ new Set([...l, e.id, ...i]);
|
1070
1070
|
n.setRowPinning((s) => {
|
1071
|
-
var
|
1071
|
+
var a, g;
|
1072
1072
|
if (t === "bottom") {
|
1073
1073
|
var d, p;
|
1074
1074
|
return {
|
@@ -1084,8 +1084,8 @@ const at = {
|
|
1084
1084
|
};
|
1085
1085
|
}
|
1086
1086
|
return {
|
1087
|
-
top: ((
|
1088
|
-
bottom: ((
|
1087
|
+
top: ((a = s?.top) != null ? a : []).filter((S) => !(u != null && u.has(S))),
|
1088
|
+
bottom: ((g = s?.bottom) != null ? g : []).filter((S) => !(u != null && u.has(S)))
|
1089
1089
|
};
|
1090
1090
|
});
|
1091
1091
|
}, e.getCanPin = () => {
|
@@ -1363,12 +1363,12 @@ const at = {
|
|
1363
1363
|
function ee(e, n) {
|
1364
1364
|
const t = e.getState().rowSelection, o = [], r = {}, i = function(l, u) {
|
1365
1365
|
return l.map((s) => {
|
1366
|
-
var
|
1367
|
-
const
|
1368
|
-
if (
|
1366
|
+
var a;
|
1367
|
+
const g = se(s, t);
|
1368
|
+
if (g && (o.push(s), r[s.id] = s), (a = s.subRows) != null && a.length && (s = {
|
1369
1369
|
...s,
|
1370
1370
|
subRows: i(s.subRows)
|
1371
|
-
}),
|
1371
|
+
}), g)
|
1372
1372
|
return s;
|
1373
1373
|
}).filter(Boolean);
|
1374
1374
|
};
|
@@ -1394,11 +1394,11 @@ function ie(e, n, t) {
|
|
1394
1394
|
}
|
1395
1395
|
}), r ? "all" : i ? "some" : !1;
|
1396
1396
|
}
|
1397
|
-
const le = /([0-9]+)/gm, pt = (e, n, t) => Pe(x(e.getValue(t)).toLowerCase(), x(n.getValue(t)).toLowerCase()), ft = (e, n, t) => Pe(x(e.getValue(t)), x(n.getValue(t))), mt = (e, n, t) =>
|
1397
|
+
const le = /([0-9]+)/gm, pt = (e, n, t) => Pe(x(e.getValue(t)).toLowerCase(), x(n.getValue(t)).toLowerCase()), ft = (e, n, t) => Pe(x(e.getValue(t)), x(n.getValue(t))), mt = (e, n, t) => ge(x(e.getValue(t)).toLowerCase(), x(n.getValue(t)).toLowerCase()), St = (e, n, t) => ge(x(e.getValue(t)), x(n.getValue(t))), vt = (e, n, t) => {
|
1398
1398
|
const o = e.getValue(t), r = n.getValue(t);
|
1399
1399
|
return o > r ? 1 : o < r ? -1 : 0;
|
1400
|
-
}, Ct = (e, n, t) =>
|
1401
|
-
function
|
1400
|
+
}, Ct = (e, n, t) => ge(e.getValue(t), n.getValue(t));
|
1401
|
+
function ge(e, n) {
|
1402
1402
|
return e === n ? 0 : e > n ? 1 : -1;
|
1403
1403
|
}
|
1404
1404
|
function x(e) {
|
@@ -1468,22 +1468,22 @@ const D = {
|
|
1468
1468
|
const r = e.getNextSortingOrder(), i = typeof t < "u" && t !== null;
|
1469
1469
|
n.setSorting((l) => {
|
1470
1470
|
const u = l?.find((c) => c.id === e.id), s = l?.findIndex((c) => c.id === e.id);
|
1471
|
-
let
|
1472
|
-
if (l != null && l.length && e.getCanMultiSort() && o ? u ?
|
1471
|
+
let a = [], g, d = i ? t : r === "desc";
|
1472
|
+
if (l != null && l.length && e.getCanMultiSort() && o ? u ? g = "toggle" : g = "add" : l != null && l.length && s !== l.length - 1 ? g = "replace" : u ? g = "toggle" : g = "replace", g === "toggle" && (i || r || (g = "remove")), g === "add") {
|
1473
1473
|
var p;
|
1474
|
-
|
1474
|
+
a = [...l, {
|
1475
1475
|
id: e.id,
|
1476
1476
|
desc: d
|
1477
|
-
}],
|
1477
|
+
}], a.splice(0, a.length - ((p = n.options.maxMultiSortColCount) != null ? p : Number.MAX_SAFE_INTEGER));
|
1478
1478
|
} else
|
1479
|
-
|
1479
|
+
g === "toggle" ? a = l.map((c) => c.id === e.id ? {
|
1480
1480
|
...c,
|
1481
1481
|
desc: d
|
1482
|
-
} : c) :
|
1482
|
+
} : c) : g === "remove" ? a = l.filter((c) => c.id !== e.id) : a = [{
|
1483
1483
|
id: e.id,
|
1484
1484
|
desc: d
|
1485
1485
|
}];
|
1486
|
-
return
|
1486
|
+
return a;
|
1487
1487
|
});
|
1488
1488
|
}, e.getFirstSortDir = () => {
|
1489
1489
|
var t, o;
|
@@ -1582,36 +1582,36 @@ const D = {
|
|
1582
1582
|
e.toggleAllColumnsVisible((o = t.target) == null ? void 0 : o.checked);
|
1583
1583
|
};
|
1584
1584
|
}
|
1585
|
-
}, Se = [Xe, wt,
|
1585
|
+
}, Se = [Xe, wt, gt, dt, Qe, _t, ut, Je, at, ct, Ke];
|
1586
1586
|
function Rt(e) {
|
1587
1587
|
var n;
|
1588
1588
|
(e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
|
1589
1589
|
let t = {
|
1590
1590
|
_features: Se
|
1591
1591
|
};
|
1592
|
-
const o = t._features.reduce((
|
1592
|
+
const o = t._features.reduce((g, d) => Object.assign(g, d.getDefaultOptions == null ? void 0 : d.getDefaultOptions(t)), {}), r = (g) => t.options.mergeOptions ? t.options.mergeOptions(o, g) : {
|
1593
1593
|
...o,
|
1594
|
-
...
|
1594
|
+
...g
|
1595
1595
|
};
|
1596
1596
|
let l = {
|
1597
1597
|
...{},
|
1598
1598
|
...(n = e.initialState) != null ? n : {}
|
1599
1599
|
};
|
1600
|
-
t._features.forEach((
|
1600
|
+
t._features.forEach((g) => {
|
1601
1601
|
var d;
|
1602
|
-
l = (d =
|
1602
|
+
l = (d = g.getInitialState == null ? void 0 : g.getInitialState(l)) != null ? d : l;
|
1603
1603
|
});
|
1604
1604
|
const u = [];
|
1605
1605
|
let s = !1;
|
1606
|
-
const
|
1606
|
+
const a = {
|
1607
1607
|
_features: Se,
|
1608
1608
|
options: {
|
1609
1609
|
...o,
|
1610
1610
|
...e
|
1611
1611
|
},
|
1612
1612
|
initialState: l,
|
1613
|
-
_queue: (
|
1614
|
-
u.push(
|
1613
|
+
_queue: (g) => {
|
1614
|
+
u.push(g), s || (s = !0, Promise.resolve().then(() => {
|
1615
1615
|
for (; u.length; )
|
1616
1616
|
u.shift()();
|
1617
1617
|
s = !1;
|
@@ -1622,32 +1622,32 @@ function Rt(e) {
|
|
1622
1622
|
reset: () => {
|
1623
1623
|
t.setState(t.initialState);
|
1624
1624
|
},
|
1625
|
-
setOptions: (
|
1626
|
-
const d = y(
|
1625
|
+
setOptions: (g) => {
|
1626
|
+
const d = y(g, t.options);
|
1627
1627
|
t.options = r(d);
|
1628
1628
|
},
|
1629
1629
|
getState: () => t.options.state,
|
1630
|
-
setState: (
|
1631
|
-
t.options.onStateChange == null || t.options.onStateChange(
|
1630
|
+
setState: (g) => {
|
1631
|
+
t.options.onStateChange == null || t.options.onStateChange(g);
|
1632
1632
|
},
|
1633
|
-
_getRowId: (
|
1633
|
+
_getRowId: (g, d, p) => {
|
1634
1634
|
var c;
|
1635
|
-
return (c = t.options.getRowId == null ? void 0 : t.options.getRowId(
|
1635
|
+
return (c = t.options.getRowId == null ? void 0 : t.options.getRowId(g, d, p)) != null ? c : `${p ? [p.id, d].join(".") : d}`;
|
1636
1636
|
},
|
1637
1637
|
getCoreRowModel: () => (t._getCoreRowModel || (t._getCoreRowModel = t.options.getCoreRowModel(t)), t._getCoreRowModel()),
|
1638
1638
|
// The final calls start at the bottom of the model,
|
1639
1639
|
// expanded rows, which then work their way up
|
1640
1640
|
getRowModel: () => t.getPaginationRowModel(),
|
1641
1641
|
//in next version, we should just pass in the row model as the optional 2nd arg
|
1642
|
-
getRow: (
|
1643
|
-
let p = (d ? t.getPrePaginationRowModel() : t.getRowModel()).rowsById[
|
1644
|
-
if (!p && (p = t.getCoreRowModel().rowsById[
|
1645
|
-
throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${
|
1642
|
+
getRow: (g, d) => {
|
1643
|
+
let p = (d ? t.getPrePaginationRowModel() : t.getRowModel()).rowsById[g];
|
1644
|
+
if (!p && (p = t.getCoreRowModel().rowsById[g], !p))
|
1645
|
+
throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${g}`) : new Error();
|
1646
1646
|
return p;
|
1647
1647
|
},
|
1648
|
-
_getDefaultColumnDef: m(() => [t.options.defaultColumn], (
|
1648
|
+
_getDefaultColumnDef: m(() => [t.options.defaultColumn], (g) => {
|
1649
1649
|
var d;
|
1650
|
-
return
|
1650
|
+
return g = (d = g) != null ? d : {}, {
|
1651
1651
|
header: (p) => {
|
1652
1652
|
const c = p.header.column.columnDef;
|
1653
1653
|
return c.accessorKey ? c.accessorKey : c.accessorFn ? c.id : null;
|
@@ -1658,63 +1658,63 @@ function Rt(e) {
|
|
1658
1658
|
return (c = (f = p.renderValue()) == null || f.toString == null ? void 0 : f.toString()) != null ? c : null;
|
1659
1659
|
},
|
1660
1660
|
...t._features.reduce((p, c) => Object.assign(p, c.getDefaultColumnDef == null ? void 0 : c.getDefaultColumnDef()), {}),
|
1661
|
-
...
|
1661
|
+
...g
|
1662
1662
|
};
|
1663
1663
|
}, {
|
1664
1664
|
debug: () => {
|
1665
|
-
var
|
1666
|
-
return (
|
1665
|
+
var g;
|
1666
|
+
return (g = t.options.debugAll) != null ? g : t.options.debugColumns;
|
1667
1667
|
},
|
1668
1668
|
key: process.env.NODE_ENV === "development" && "getDefaultColumnDef"
|
1669
1669
|
}),
|
1670
1670
|
_getColumnDefs: () => t.options.columns,
|
1671
|
-
getAllColumns: m(() => [t._getColumnDefs()], (
|
1671
|
+
getAllColumns: m(() => [t._getColumnDefs()], (g) => {
|
1672
1672
|
const d = function(p, c, f) {
|
1673
1673
|
return f === void 0 && (f = 0), p.map((S) => {
|
1674
1674
|
const C = je(t, S, f, c), v = S;
|
1675
1675
|
return C.columns = v.columns ? d(v.columns, C, f + 1) : [], C;
|
1676
1676
|
});
|
1677
1677
|
};
|
1678
|
-
return d(
|
1678
|
+
return d(g);
|
1679
1679
|
}, {
|
1680
1680
|
key: process.env.NODE_ENV === "development" && "getAllColumns",
|
1681
1681
|
debug: () => {
|
1682
|
-
var
|
1683
|
-
return (
|
1682
|
+
var g;
|
1683
|
+
return (g = t.options.debugAll) != null ? g : t.options.debugColumns;
|
1684
1684
|
}
|
1685
1685
|
}),
|
1686
|
-
getAllFlatColumns: m(() => [t.getAllColumns()], (
|
1686
|
+
getAllFlatColumns: m(() => [t.getAllColumns()], (g) => g.flatMap((d) => d.getFlatColumns()), {
|
1687
1687
|
key: process.env.NODE_ENV === "development" && "getAllFlatColumns",
|
1688
1688
|
debug: () => {
|
1689
|
-
var
|
1690
|
-
return (
|
1689
|
+
var g;
|
1690
|
+
return (g = t.options.debugAll) != null ? g : t.options.debugColumns;
|
1691
1691
|
}
|
1692
1692
|
}),
|
1693
|
-
_getAllFlatColumnsById: m(() => [t.getAllFlatColumns()], (
|
1693
|
+
_getAllFlatColumnsById: m(() => [t.getAllFlatColumns()], (g) => g.reduce((d, p) => (d[p.id] = p, d), {}), {
|
1694
1694
|
key: process.env.NODE_ENV === "development" && "getAllFlatColumnsById",
|
1695
1695
|
debug: () => {
|
1696
|
-
var
|
1697
|
-
return (
|
1696
|
+
var g;
|
1697
|
+
return (g = t.options.debugAll) != null ? g : t.options.debugColumns;
|
1698
1698
|
}
|
1699
1699
|
}),
|
1700
|
-
getAllLeafColumns: m(() => [t.getAllColumns(), t._getOrderColumnsFn()], (
|
1701
|
-
let p =
|
1700
|
+
getAllLeafColumns: m(() => [t.getAllColumns(), t._getOrderColumnsFn()], (g, d) => {
|
1701
|
+
let p = g.flatMap((c) => c.getLeafColumns());
|
1702
1702
|
return d(p);
|
1703
1703
|
}, {
|
1704
1704
|
key: process.env.NODE_ENV === "development" && "getAllLeafColumns",
|
1705
1705
|
debug: () => {
|
1706
|
-
var
|
1707
|
-
return (
|
1706
|
+
var g;
|
1707
|
+
return (g = t.options.debugAll) != null ? g : t.options.debugColumns;
|
1708
1708
|
}
|
1709
1709
|
}),
|
1710
|
-
getColumn: (
|
1711
|
-
const d = t._getAllFlatColumnsById()[
|
1712
|
-
return process.env.NODE_ENV !== "production" && !d && console.error(`[Table] Column with id '${
|
1710
|
+
getColumn: (g) => {
|
1711
|
+
const d = t._getAllFlatColumnsById()[g];
|
1712
|
+
return process.env.NODE_ENV !== "production" && !d && console.error(`[Table] Column with id '${g}' does not exist.`), d;
|
1713
1713
|
}
|
1714
1714
|
};
|
1715
|
-
Object.assign(t,
|
1716
|
-
for (let
|
1717
|
-
const d = t._features[
|
1715
|
+
Object.assign(t, a);
|
1716
|
+
for (let g = 0; g < t._features.length; g++) {
|
1717
|
+
const d = t._features[g];
|
1718
1718
|
d == null || d.createTable == null || d.createTable(t);
|
1719
1719
|
}
|
1720
1720
|
return t;
|
@@ -1729,13 +1729,13 @@ function ht(e, n, t, o) {
|
|
1729
1729
|
column: t,
|
1730
1730
|
getValue: () => n.getValue(o),
|
1731
1731
|
renderValue: r,
|
1732
|
-
getContext: m(() => [e, t, n, i], (l, u, s,
|
1732
|
+
getContext: m(() => [e, t, n, i], (l, u, s, a) => ({
|
1733
1733
|
table: l,
|
1734
1734
|
column: u,
|
1735
1735
|
row: s,
|
1736
|
-
cell:
|
1737
|
-
getValue:
|
1738
|
-
renderValue:
|
1736
|
+
cell: a,
|
1737
|
+
getValue: a.getValue,
|
1738
|
+
renderValue: a.renderValue
|
1739
1739
|
}), {
|
1740
1740
|
key: process.env.NODE_ENV === "development" && "cell.getContext",
|
1741
1741
|
debug: () => e.options.debugAll
|
@@ -1757,42 +1757,42 @@ const $t = (e, n, t, o, r, i, l) => {
|
|
1757
1757
|
getValue: (s) => {
|
1758
1758
|
if (u._valuesCache.hasOwnProperty(s))
|
1759
1759
|
return u._valuesCache[s];
|
1760
|
-
const
|
1761
|
-
if (
|
1762
|
-
return u._valuesCache[s] =
|
1760
|
+
const a = e.getColumn(s);
|
1761
|
+
if (a != null && a.accessorFn)
|
1762
|
+
return u._valuesCache[s] = a.accessorFn(u.original, o), u._valuesCache[s];
|
1763
1763
|
},
|
1764
1764
|
getUniqueValues: (s) => {
|
1765
1765
|
if (u._uniqueValuesCache.hasOwnProperty(s))
|
1766
1766
|
return u._uniqueValuesCache[s];
|
1767
|
-
const
|
1768
|
-
if (
|
1769
|
-
return
|
1767
|
+
const a = e.getColumn(s);
|
1768
|
+
if (a != null && a.accessorFn)
|
1769
|
+
return a.columnDef.getUniqueValues ? (u._uniqueValuesCache[s] = a.columnDef.getUniqueValues(u.original, o), u._uniqueValuesCache[s]) : (u._uniqueValuesCache[s] = [u.getValue(s)], u._uniqueValuesCache[s]);
|
1770
1770
|
},
|
1771
1771
|
renderValue: (s) => {
|
1772
|
-
var
|
1773
|
-
return (
|
1772
|
+
var a;
|
1773
|
+
return (a = u.getValue(s)) != null ? a : e.options.renderFallbackValue;
|
1774
1774
|
},
|
1775
1775
|
subRows: i ?? [],
|
1776
1776
|
getLeafRows: () => Ue(u.subRows, (s) => s.subRows),
|
1777
1777
|
getParentRow: () => u.parentId ? e.getRow(u.parentId, !0) : void 0,
|
1778
1778
|
getParentRows: () => {
|
1779
|
-
let s = [],
|
1779
|
+
let s = [], a = u;
|
1780
1780
|
for (; ; ) {
|
1781
|
-
const
|
1782
|
-
if (!
|
1781
|
+
const g = a.getParentRow();
|
1782
|
+
if (!g)
|
1783
1783
|
break;
|
1784
|
-
s.push(
|
1784
|
+
s.push(g), a = g;
|
1785
1785
|
}
|
1786
1786
|
return s.reverse();
|
1787
1787
|
},
|
1788
|
-
getAllCells: m(() => [e.getAllLeafColumns()], (s) => s.map((
|
1788
|
+
getAllCells: m(() => [e.getAllLeafColumns()], (s) => s.map((a) => ht(e, u, a, a.id)), {
|
1789
1789
|
key: process.env.NODE_ENV === "development" && "row.getAllCells",
|
1790
1790
|
debug: () => {
|
1791
1791
|
var s;
|
1792
1792
|
return (s = e.options.debugAll) != null ? s : e.options.debugRows;
|
1793
1793
|
}
|
1794
1794
|
}),
|
1795
|
-
_getAllCellsByColumnId: m(() => [u.getAllCells()], (s) => s.reduce((
|
1795
|
+
_getAllCellsByColumnId: m(() => [u.getAllCells()], (s) => s.reduce((a, g) => (a[g.column.id] = g, a), {}), {
|
1796
1796
|
key: process.env.NODE_ENV === "production" && "row.getAllCellsByColumnId",
|
1797
1797
|
debug: () => {
|
1798
1798
|
var s;
|
@@ -1801,8 +1801,8 @@ const $t = (e, n, t, o, r, i, l) => {
|
|
1801
1801
|
})
|
1802
1802
|
};
|
1803
1803
|
for (let s = 0; s < e._features.length; s++) {
|
1804
|
-
const
|
1805
|
-
|
1804
|
+
const a = e._features[s];
|
1805
|
+
a == null || a.createRow == null || a.createRow(u, e);
|
1806
1806
|
}
|
1807
1807
|
return u;
|
1808
1808
|
};
|
@@ -1815,11 +1815,11 @@ function Ft() {
|
|
1815
1815
|
}, o = function(r, i, l) {
|
1816
1816
|
i === void 0 && (i = 0);
|
1817
1817
|
const u = [];
|
1818
|
-
for (let
|
1819
|
-
const
|
1820
|
-
if (t.flatRows.push(
|
1818
|
+
for (let a = 0; a < r.length; a++) {
|
1819
|
+
const g = $t(e, e._getRowId(r[a], a, l), r[a], a, i, void 0, l?.id);
|
1820
|
+
if (t.flatRows.push(g), t.rowsById[g.id] = g, u.push(g), e.options.getSubRows) {
|
1821
1821
|
var s;
|
1822
|
-
|
1822
|
+
g.originalSubRows = e.options.getSubRows(r[a], a), (s = g.originalSubRows) != null && s.length && (g.subRows = o(g.originalSubRows, i + 1, g));
|
1823
1823
|
}
|
1824
1824
|
}
|
1825
1825
|
return u;
|
@@ -1841,38 +1841,38 @@ function Vt() {
|
|
1841
1841
|
if (!t.rows.length || !(n != null && n.length))
|
1842
1842
|
return t;
|
1843
1843
|
const o = e.getState().sorting, r = [], i = o.filter((s) => {
|
1844
|
-
var
|
1845
|
-
return (
|
1844
|
+
var a;
|
1845
|
+
return (a = e.getColumn(s.id)) == null ? void 0 : a.getCanSort();
|
1846
1846
|
}), l = {};
|
1847
1847
|
i.forEach((s) => {
|
1848
|
-
const
|
1849
|
-
|
1850
|
-
sortUndefined:
|
1851
|
-
invertSorting:
|
1852
|
-
sortingFn:
|
1848
|
+
const a = e.getColumn(s.id);
|
1849
|
+
a && (l[s.id] = {
|
1850
|
+
sortUndefined: a.columnDef.sortUndefined,
|
1851
|
+
invertSorting: a.columnDef.invertSorting,
|
1852
|
+
sortingFn: a.getSortingFn()
|
1853
1853
|
});
|
1854
1854
|
});
|
1855
1855
|
const u = (s) => {
|
1856
|
-
const
|
1857
|
-
...
|
1856
|
+
const a = s.map((g) => ({
|
1857
|
+
...g
|
1858
1858
|
}));
|
1859
|
-
return
|
1859
|
+
return a.sort((g, d) => {
|
1860
1860
|
for (let c = 0; c < i.length; c += 1) {
|
1861
1861
|
var p;
|
1862
1862
|
const f = i[c], S = l[f.id], C = (p = f?.desc) != null ? p : !1;
|
1863
1863
|
let v = 0;
|
1864
1864
|
if (S.sortUndefined) {
|
1865
|
-
const R =
|
1865
|
+
const R = g.getValue(f.id), w = d.getValue(f.id), F = R === void 0, P = w === void 0;
|
1866
1866
|
(F || P) && (v = F && P ? 0 : F ? S.sortUndefined : -S.sortUndefined);
|
1867
1867
|
}
|
1868
|
-
if (v === 0 && (v = S.sortingFn(
|
1868
|
+
if (v === 0 && (v = S.sortingFn(g, d, f.id)), v !== 0)
|
1869
1869
|
return C && (v *= -1), S.invertSorting && (v *= -1), v;
|
1870
1870
|
}
|
1871
|
-
return
|
1872
|
-
}),
|
1871
|
+
return g.index - d.index;
|
1872
|
+
}), a.forEach((g) => {
|
1873
1873
|
var d;
|
1874
|
-
r.push(
|
1875
|
-
}),
|
1874
|
+
r.push(g), (d = g.subRows) != null && d.length && (g.subRows = u(g.subRows));
|
1875
|
+
}), a;
|
1876
1876
|
};
|
1877
1877
|
return {
|
1878
1878
|
rows: u(t.rows),
|
@@ -1914,8 +1914,8 @@ function Pt(e) {
|
|
1914
1914
|
flatRows: u,
|
1915
1915
|
rowsById: s
|
1916
1916
|
} = o;
|
1917
|
-
const
|
1918
|
-
l = l.slice(
|
1917
|
+
const a = r * i, g = a + r;
|
1918
|
+
l = l.slice(a, g);
|
1919
1919
|
let d;
|
1920
1920
|
n.options.paginateExpandedRows ? d = {
|
1921
1921
|
rows: l,
|
@@ -2046,7 +2046,8 @@ const Tt = /* @__PURE__ */ Ce({
|
|
2046
2046
|
data: {},
|
2047
2047
|
pageSize: { default: 10 },
|
2048
2048
|
showPagination: { type: Boolean, default: !0 },
|
2049
|
-
totalItems: { default: 0 }
|
2049
|
+
totalItems: { default: 0 },
|
2050
|
+
getRowId: {}
|
2050
2051
|
}, {
|
2051
2052
|
sorting: {},
|
2052
2053
|
sortingModifiers: {},
|
@@ -2089,7 +2090,8 @@ const Tt = /* @__PURE__ */ Ce({
|
|
2089
2090
|
get rowSelection() {
|
2090
2091
|
return r.value;
|
2091
2092
|
}
|
2092
|
-
}
|
2093
|
+
},
|
2094
|
+
getRowId: n.getRowId
|
2093
2095
|
});
|
2094
2096
|
return (l, u) => (h(), M(_(Oe), null, {
|
2095
2097
|
default: V(() => [
|
@@ -2105,14 +2107,14 @@ const Tt = /* @__PURE__ */ Ce({
|
|
2105
2107
|
key: s.id
|
2106
2108
|
}, {
|
2107
2109
|
default: V(() => [
|
2108
|
-
(h(!0), H(N, null, O(s.headers, (
|
2109
|
-
key:
|
2110
|
+
(h(!0), H(N, null, O(s.headers, (a) => (h(), M(_(Le), {
|
2111
|
+
key: a.id
|
2110
2112
|
}, {
|
2111
2113
|
default: V(() => [
|
2112
|
-
|
2114
|
+
a.isPlaceholder ? U("", !0) : (h(), M(_(ve), {
|
2113
2115
|
key: 0,
|
2114
|
-
render:
|
2115
|
-
props:
|
2116
|
+
render: a.column.columnDef.header,
|
2117
|
+
props: a.getContext()
|
2116
2118
|
}, null, 8, ["render", "props"]))
|
2117
2119
|
]),
|
2118
2120
|
_: 2
|
@@ -2130,13 +2132,13 @@ const Tt = /* @__PURE__ */ Ce({
|
|
2130
2132
|
"data-state": s.getIsSelected() ? "selected" : void 0
|
2131
2133
|
}, {
|
2132
2134
|
default: V(() => [
|
2133
|
-
(h(!0), H(N, null, O(s.getVisibleCells(), (
|
2134
|
-
key:
|
2135
|
+
(h(!0), H(N, null, O(s.getVisibleCells(), (a) => (h(), M(_(pe), {
|
2136
|
+
key: a.id
|
2135
2137
|
}, {
|
2136
2138
|
default: V(() => [
|
2137
2139
|
I(_(ve), {
|
2138
|
-
render:
|
2139
|
-
props:
|
2140
|
+
render: a.column.columnDef.cell,
|
2141
|
+
props: a.getContext()
|
2140
2142
|
}, null, 8, ["render", "props"])
|
2141
2143
|
]),
|
2142
2144
|
_: 2
|