@senitix/ui 0.4.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/avatar-C0aVNCG9.cjs +2 -0
- package/dist/avatar-C0aVNCG9.cjs.map +1 -0
- package/dist/avatar-CN6wcrqY.js +288 -0
- package/dist/avatar-CN6wcrqY.js.map +1 -0
- package/dist/calendar-BFWc4IB7.js +1182 -0
- package/dist/calendar-BFWc4IB7.js.map +1 -0
- package/dist/calendar-BUm7YrNf.cjs +2 -0
- package/dist/calendar-BUm7YrNf.cjs.map +1 -0
- package/dist/calendar-ChJkFXXr.js +11 -0
- package/dist/calendar-ChJkFXXr.js.map +1 -0
- package/dist/calendar-SwL5isYC.cjs +2 -0
- package/dist/calendar-SwL5isYC.cjs.map +1 -0
- package/dist/card-K4fxyYwE.js +51 -0
- package/dist/card-K4fxyYwE.js.map +1 -0
- package/dist/card-tMkUxpmW.cjs +2 -0
- package/dist/card-tMkUxpmW.cjs.map +1 -0
- package/dist/checkbox-CpOq5hkT.js +289 -0
- package/dist/checkbox-CpOq5hkT.js.map +1 -0
- package/dist/checkbox-D7-LQyCl.cjs +2 -0
- package/dist/checkbox-D7-LQyCl.cjs.map +1 -0
- package/dist/chevron-down-DHdXqOqK.cjs +2 -0
- package/dist/chevron-down-DHdXqOqK.cjs.map +1 -0
- package/dist/chevron-down-DJ1_YIFu.js +8 -0
- package/dist/chevron-down-DJ1_YIFu.js.map +1 -0
- package/dist/chevron-right-B3bovvh0.js +8 -0
- package/dist/chevron-right-B3bovvh0.js.map +1 -0
- package/dist/chevron-right-Dvyd11q0.cjs +2 -0
- package/dist/chevron-right-Dvyd11q0.cjs.map +1 -0
- package/dist/chevron-up-B9fuiZhc.cjs +2 -0
- package/dist/chevron-up-B9fuiZhc.cjs.map +1 -0
- package/dist/chevron-up-CGtXOr51.js +6 -0
- package/dist/chevron-up-CGtXOr51.js.map +1 -0
- package/dist/components/charts/index.cjs.js +2 -0
- package/dist/components/charts/index.cjs.js.map +1 -0
- package/dist/components/charts/index.es.js +12 -0
- package/dist/components/charts/index.es.js.map +1 -0
- package/dist/components/data-display/index.cjs.js +2 -0
- package/dist/components/data-display/index.cjs.js.map +1 -0
- package/dist/components/data-display/index.es.js +25 -0
- package/dist/components/data-display/index.es.js.map +1 -0
- package/dist/components/dnd/index.cjs.js +2 -0
- package/dist/components/dnd/index.cjs.js.map +1 -0
- package/dist/components/dnd/index.es.js +9 -0
- package/dist/components/dnd/index.es.js.map +1 -0
- package/dist/components/feedback/index.cjs.js +2 -0
- package/dist/components/feedback/index.cjs.js.map +1 -0
- package/dist/components/feedback/index.es.js +16 -0
- package/dist/components/feedback/index.es.js.map +1 -0
- package/dist/components/forms/index.cjs.js +2 -0
- package/dist/components/forms/index.cjs.js.map +1 -0
- package/dist/components/forms/index.es.js +27 -0
- package/dist/components/forms/index.es.js.map +1 -0
- package/dist/components/layouts/index.cjs.js +2 -0
- package/dist/components/layouts/index.cjs.js.map +1 -0
- package/dist/components/layouts/index.es.js +25 -0
- package/dist/components/layouts/index.es.js.map +1 -0
- package/dist/components/navigation/index.cjs.js +2 -0
- package/dist/components/navigation/index.cjs.js.map +1 -0
- package/dist/components/navigation/index.es.js +42 -0
- package/dist/components/navigation/index.es.js.map +1 -0
- package/dist/components/ui/index.cjs.js +2 -0
- package/dist/components/ui/index.cjs.js.map +1 -0
- package/dist/components/ui/index.es.js +165 -0
- package/dist/components/ui/index.es.js.map +1 -0
- package/dist/createLucideIcon-BbeNo6vq.js +56 -0
- package/dist/createLucideIcon-BbeNo6vq.js.map +1 -0
- package/dist/createLucideIcon-i5GEhNMV.cjs +2 -0
- package/dist/createLucideIcon-i5GEhNMV.cjs.map +1 -0
- package/dist/ellipsis-BW2gWki8.cjs +2 -0
- package/dist/ellipsis-BW2gWki8.cjs.map +1 -0
- package/dist/ellipsis-CiKEaUNP.js +10 -0
- package/dist/ellipsis-CiKEaUNP.js.map +1 -0
- package/dist/file-V_hhCUhr.cjs +2 -0
- package/dist/file-V_hhCUhr.cjs.map +1 -0
- package/dist/file-wzTXnWqz.js +9 -0
- package/dist/file-wzTXnWqz.js.map +1 -0
- package/dist/filter-tags-DjUaNXHR.cjs +5 -0
- package/dist/filter-tags-DjUaNXHR.cjs.map +1 -0
- package/dist/filter-tags-i_I8qV1N.js +2658 -0
- package/dist/filter-tags-i_I8qV1N.js.map +1 -0
- package/dist/full-calendar-7ac2FFU6.js +3518 -0
- package/dist/full-calendar-7ac2FFU6.js.map +1 -0
- package/dist/full-calendar-Cpeh5xMP.cjs +8 -0
- package/dist/full-calendar-Cpeh5xMP.cjs.map +1 -0
- package/dist/global-search-UNXjoFlI.cjs +2 -0
- package/dist/global-search-UNXjoFlI.cjs.map +1 -0
- package/dist/global-search-h1rVbP2q.js +1188 -0
- package/dist/global-search-h1rVbP2q.js.map +1 -0
- package/dist/hooks/index.cjs.js +2 -0
- package/dist/hooks/index.cjs.js.map +1 -0
- package/dist/hooks/index.es.js +13 -0
- package/dist/hooks/index.es.js.map +1 -0
- package/dist/index-Co9o9StL.js +33 -0
- package/dist/index-Co9o9StL.js.map +1 -0
- package/dist/index-CwJPJKOE.js +2278 -0
- package/dist/index-CwJPJKOE.js.map +1 -0
- package/dist/index-CzVK9Zyb.cjs +6 -0
- package/dist/index-CzVK9Zyb.cjs.map +1 -0
- package/dist/index-l828OqQN.js +288 -0
- package/dist/index-l828OqQN.js.map +1 -0
- package/dist/index-lGzB9daF.cjs +2 -0
- package/dist/index-lGzB9daF.cjs.map +1 -0
- package/dist/index-lT9bLt9X.cjs +2 -0
- package/dist/index-lT9bLt9X.cjs.map +1 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.js +332 -0
- package/dist/index.es.js.map +1 -0
- package/dist/input-CZrckPLk.cjs +42 -0
- package/dist/input-CZrckPLk.cjs.map +1 -0
- package/dist/input-D4AoiWxo.js +3629 -0
- package/dist/input-D4AoiWxo.js.map +1 -0
- package/dist/locale-provider-DHMwuneF.cjs +2 -0
- package/dist/locale-provider-DHMwuneF.cjs.map +1 -0
- package/dist/locale-provider-DanG6RRG.js +1012 -0
- package/dist/locale-provider-DanG6RRG.js.map +1 -0
- package/dist/locale-selector-Ppe0KTi-.cjs +2 -0
- package/dist/locale-selector-Ppe0KTi-.cjs.map +1 -0
- package/dist/locale-selector-xn2GpdP9.js +1745 -0
- package/dist/locale-selector-xn2GpdP9.js.map +1 -0
- package/dist/minus-BXBFZSZs.cjs +2 -0
- package/dist/minus-BXBFZSZs.cjs.map +1 -0
- package/dist/minus-DvlYtl96.js +6 -0
- package/dist/minus-DvlYtl96.js.map +1 -0
- package/dist/multi-container-C2UpSw5f.js +731 -0
- package/dist/multi-container-C2UpSw5f.js.map +1 -0
- package/dist/multi-container-DMKL8c9B.cjs +2 -0
- package/dist/multi-container-DMKL8c9B.cjs.map +1 -0
- package/dist/pipeline-By5_8AFg.cjs +2 -0
- package/dist/pipeline-By5_8AFg.cjs.map +1 -0
- package/dist/pipeline-D-QNSU0U.js +1036 -0
- package/dist/pipeline-D-QNSU0U.js.map +1 -0
- package/dist/plus-8wKRkVu-.cjs +2 -0
- package/dist/plus-8wKRkVu-.cjs.map +1 -0
- package/dist/plus-CJD68KQD.js +9 -0
- package/dist/plus-CJD68KQD.js.map +1 -0
- package/dist/popover-4V4sGe1U.js +765 -0
- package/dist/popover-4V4sGe1U.js.map +1 -0
- package/dist/popover-ivh-plLc.cjs +2 -0
- package/dist/popover-ivh-plLc.cjs.map +1 -0
- package/dist/progress-CFnuLqnS.cjs +7 -0
- package/dist/progress-CFnuLqnS.cjs.map +1 -0
- package/dist/progress-D5AsrWa6.js +222 -0
- package/dist/progress-D5AsrWa6.js.map +1 -0
- package/dist/providers/index.cjs.js +2 -0
- package/dist/providers/index.cjs.js.map +1 -0
- package/dist/providers/index.es.js +9 -0
- package/dist/providers/index.es.js.map +1 -0
- package/dist/scroll-area-DQeqDp3Y.js +952 -0
- package/dist/scroll-area-DQeqDp3Y.js.map +1 -0
- package/dist/scroll-area-DYOiJMXh.cjs +2 -0
- package/dist/scroll-area-DYOiJMXh.cjs.map +1 -0
- package/dist/select-C1rNBi6c.js +974 -0
- package/dist/select-C1rNBi6c.js.map +1 -0
- package/dist/select-m-Mqwxu3.cjs +2 -0
- package/dist/select-m-Mqwxu3.cjs.map +1 -0
- package/dist/separator-DBUivkHq.cjs +2 -0
- package/dist/separator-DBUivkHq.cjs.map +1 -0
- package/dist/separator-DsfoJx-2.js +395 -0
- package/dist/separator-DsfoJx-2.js.map +1 -0
- package/dist/sheet-BVWCpq7E.js +84 -0
- package/dist/sheet-BVWCpq7E.js.map +1 -0
- package/dist/sheet-mKiFLVnK.cjs +2 -0
- package/dist/sheet-mKiFLVnK.cjs.map +1 -0
- package/dist/skeleton-BSwwYaQU.cjs +2 -0
- package/dist/skeleton-BSwwYaQU.cjs.map +1 -0
- package/dist/skeleton-BmGbfJw3.js +9 -0
- package/dist/skeleton-BmGbfJw3.js.map +1 -0
- package/dist/sortable.esm-Blhf_jh1.js +3391 -0
- package/dist/sortable.esm-Blhf_jh1.js.map +1 -0
- package/dist/sortable.esm-DcQYlXi3.cjs +6 -0
- package/dist/sortable.esm-DcQYlXi3.cjs.map +1 -0
- package/dist/sparkline-chart-Da-ehDGv.js +21082 -0
- package/dist/sparkline-chart-Da-ehDGv.js.map +1 -0
- package/dist/sparkline-chart-ca3uTzVK.cjs +68 -0
- package/dist/sparkline-chart-ca3uTzVK.cjs.map +1 -0
- package/dist/trending-up-D3Nfrhi3.cjs +2 -0
- package/dist/trending-up-D3Nfrhi3.cjs.map +1 -0
- package/dist/trending-up-DPwlYzQb.js +9 -0
- package/dist/trending-up-DPwlYzQb.js.map +1 -0
- package/dist/ui.css +1 -0
- package/dist/use-formatters-d97RVcmg.cjs +2 -0
- package/dist/use-formatters-d97RVcmg.cjs.map +1 -0
- package/dist/use-formatters-l1_2c8z0.js +6682 -0
- package/dist/use-formatters-l1_2c8z0.js.map +1 -0
- package/dist/use-local-storage-BjlrKzE-.js +42 -0
- package/dist/use-local-storage-BjlrKzE-.js.map +1 -0
- package/dist/use-local-storage-q-1odzIu.cjs +2 -0
- package/dist/use-local-storage-q-1odzIu.cjs.map +1 -0
- package/dist/use-mobile-C-LMK4T8.js +15 -0
- package/dist/use-mobile-C-LMK4T8.js.map +1 -0
- package/dist/use-mobile-DY7TJ5lx.cjs +2 -0
- package/dist/use-mobile-DY7TJ5lx.cjs.map +1 -0
- package/dist/use-toast-DG2qdYhl.js +97 -0
- package/dist/use-toast-DG2qdYhl.js.map +1 -0
- package/dist/use-toast-DxZJ8uUm.cjs +2 -0
- package/dist/use-toast-DxZJ8uUm.cjs.map +1 -0
- package/dist/utils/index.cjs.js +2 -0
- package/dist/utils/index.cjs.js.map +1 -0
- package/dist/utils/index.es.js +5 -0
- package/dist/utils/index.es.js.map +1 -0
- package/dist/welcome-card-CPolYl1D.cjs +2 -0
- package/dist/welcome-card-CPolYl1D.cjs.map +1 -0
- package/dist/welcome-card-CxMJZ8bv.js +963 -0
- package/dist/welcome-card-CxMJZ8bv.js.map +1 -0
- package/package.json +179 -0
|
@@ -0,0 +1,2658 @@
|
|
|
1
|
+
import { jsx as c, jsxs as C, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import * as F from "react";
|
|
3
|
+
import { c as y } from "./index-CwJPJKOE.js";
|
|
4
|
+
import { a as I, S as Ke, X as U, B as Re } from "./scroll-area-DQeqDp3Y.js";
|
|
5
|
+
import { C as X } from "./checkbox-CpOq5hkT.js";
|
|
6
|
+
import { I as Qe, D as z, a as k, b as O, d as xe, f as de, g as K, c as _e } from "./input-D4AoiWxo.js";
|
|
7
|
+
import { S as Fe, c as ye, b as $e, d as Ve, f as Me } from "./select-C1rNBi6c.js";
|
|
8
|
+
import { C as Pe } from "./chevron-down-DJ1_YIFu.js";
|
|
9
|
+
import { c as T } from "./createLucideIcon-BbeNo6vq.js";
|
|
10
|
+
import { E as Ie } from "./ellipsis-CiKEaUNP.js";
|
|
11
|
+
import { C as Ne, a as Ze, c as Je, e as De } from "./card-K4fxyYwE.js";
|
|
12
|
+
import { T as We } from "./trending-up-DPwlYzQb.js";
|
|
13
|
+
import { M as Ye } from "./minus-DvlYtl96.js";
|
|
14
|
+
import { A as et, a as tt, b as nt } from "./avatar-CN6wcrqY.js";
|
|
15
|
+
const ot = T("ArrowUpDown", [
|
|
16
|
+
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
|
|
17
|
+
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
18
|
+
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
19
|
+
["path", { d: "M7 4v16", key: "1glfcx" }]
|
|
20
|
+
]);
|
|
21
|
+
const rt = T("EyeOff", [
|
|
22
|
+
[
|
|
23
|
+
"path",
|
|
24
|
+
{
|
|
25
|
+
d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
|
|
26
|
+
key: "ct8e1f"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
["path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242", key: "151rxh" }],
|
|
30
|
+
[
|
|
31
|
+
"path",
|
|
32
|
+
{
|
|
33
|
+
d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",
|
|
34
|
+
key: "13bj9a"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
["path", { d: "m2 2 20 20", key: "1ooewy" }]
|
|
38
|
+
]);
|
|
39
|
+
const lt = T("Eye", [
|
|
40
|
+
[
|
|
41
|
+
"path",
|
|
42
|
+
{
|
|
43
|
+
d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
|
|
44
|
+
key: "1nclc0"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
48
|
+
]);
|
|
49
|
+
const it = T("Settings2", [
|
|
50
|
+
["path", { d: "M20 7h-9", key: "3s1dr2" }],
|
|
51
|
+
["path", { d: "M14 17H5", key: "gfn3mx" }],
|
|
52
|
+
["circle", { cx: "17", cy: "17", r: "3", key: "18b49y" }],
|
|
53
|
+
["circle", { cx: "7", cy: "7", r: "3", key: "dfmy0x" }]
|
|
54
|
+
]);
|
|
55
|
+
const st = T("TrendingDown", [
|
|
56
|
+
["polyline", { points: "22 17 13.5 8.5 8.5 13.5 2 7", key: "1r2t7k" }],
|
|
57
|
+
["polyline", { points: "16 17 22 17 22 11", key: "11uiuu" }]
|
|
58
|
+
]);
|
|
59
|
+
function A(e, o) {
|
|
60
|
+
return typeof e == "function" ? e(o) : e;
|
|
61
|
+
}
|
|
62
|
+
function N(e, o) {
|
|
63
|
+
return (t) => {
|
|
64
|
+
o.setState((n) => ({
|
|
65
|
+
...n,
|
|
66
|
+
[e]: A(t, n[e])
|
|
67
|
+
}));
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function Z(e) {
|
|
71
|
+
return e instanceof Function;
|
|
72
|
+
}
|
|
73
|
+
function at(e) {
|
|
74
|
+
return Array.isArray(e) && e.every((o) => typeof o == "number");
|
|
75
|
+
}
|
|
76
|
+
function ut(e, o) {
|
|
77
|
+
const t = [], n = (r) => {
|
|
78
|
+
r.forEach((l) => {
|
|
79
|
+
t.push(l);
|
|
80
|
+
const i = o(l);
|
|
81
|
+
i != null && i.length && n(i);
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
return n(e), t;
|
|
85
|
+
}
|
|
86
|
+
function S(e, o, t) {
|
|
87
|
+
let n = [], r;
|
|
88
|
+
return (l) => {
|
|
89
|
+
let i;
|
|
90
|
+
t.key && t.debug && (i = Date.now());
|
|
91
|
+
const a = e(l);
|
|
92
|
+
if (!(a.length !== n.length || a.some((f, p) => n[p] !== f)))
|
|
93
|
+
return r;
|
|
94
|
+
n = a;
|
|
95
|
+
let d;
|
|
96
|
+
if (t.key && t.debug && (d = Date.now()), r = o(...a), t == null || t.onChange == null || t.onChange(r), t.key && t.debug && t != null && t.debug()) {
|
|
97
|
+
const f = Math.round((Date.now() - i) * 100) / 100, p = Math.round((Date.now() - d) * 100) / 100, g = p / 16, s = (m, h) => {
|
|
98
|
+
for (m = String(m); m.length < h; )
|
|
99
|
+
m = " " + m;
|
|
100
|
+
return m;
|
|
101
|
+
};
|
|
102
|
+
console.info(`%c⏱ ${s(p, 5)} /${s(f, 5)} ms`, `
|
|
103
|
+
font-size: .6rem;
|
|
104
|
+
font-weight: bold;
|
|
105
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * g, 120))}deg 100% 31%);`, t?.key);
|
|
106
|
+
}
|
|
107
|
+
return r;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function w(e, o, t, n) {
|
|
111
|
+
return {
|
|
112
|
+
debug: () => {
|
|
113
|
+
var r;
|
|
114
|
+
return (r = e?.debugAll) != null ? r : e[o];
|
|
115
|
+
},
|
|
116
|
+
key: process.env.NODE_ENV === "development" && t,
|
|
117
|
+
onChange: n
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function dt(e, o, t, n) {
|
|
121
|
+
const r = () => {
|
|
122
|
+
var i;
|
|
123
|
+
return (i = l.getValue()) != null ? i : e.options.renderFallbackValue;
|
|
124
|
+
}, l = {
|
|
125
|
+
id: `${o.id}_${t.id}`,
|
|
126
|
+
row: o,
|
|
127
|
+
column: t,
|
|
128
|
+
getValue: () => o.getValue(n),
|
|
129
|
+
renderValue: r,
|
|
130
|
+
getContext: S(() => [e, t, o, l], (i, a, u, d) => ({
|
|
131
|
+
table: i,
|
|
132
|
+
column: a,
|
|
133
|
+
row: u,
|
|
134
|
+
cell: d,
|
|
135
|
+
getValue: d.getValue,
|
|
136
|
+
renderValue: d.renderValue
|
|
137
|
+
}), w(e.options, "debugCells", "cell.getContext"))
|
|
138
|
+
};
|
|
139
|
+
return e._features.forEach((i) => {
|
|
140
|
+
i.createCell == null || i.createCell(l, t, o, e);
|
|
141
|
+
}, {}), l;
|
|
142
|
+
}
|
|
143
|
+
function gt(e, o, t, n) {
|
|
144
|
+
var r, l;
|
|
145
|
+
const a = {
|
|
146
|
+
...e._getDefaultColumnDef(),
|
|
147
|
+
...o
|
|
148
|
+
}, u = a.accessorKey;
|
|
149
|
+
let d = (r = (l = a.id) != null ? l : u ? typeof String.prototype.replaceAll == "function" ? u.replaceAll(".", "_") : u.replace(/\./g, "_") : void 0) != null ? r : typeof a.header == "string" ? a.header : void 0, f;
|
|
150
|
+
if (a.accessorFn ? f = a.accessorFn : u && (u.includes(".") ? f = (g) => {
|
|
151
|
+
let s = g;
|
|
152
|
+
for (const h of u.split(".")) {
|
|
153
|
+
var m;
|
|
154
|
+
s = (m = s) == null ? void 0 : m[h], process.env.NODE_ENV !== "production" && s === void 0 && console.warn(`"${h}" in deeply nested key "${u}" returned undefined.`);
|
|
155
|
+
}
|
|
156
|
+
return s;
|
|
157
|
+
} : f = (g) => g[a.accessorKey]), !d)
|
|
158
|
+
throw process.env.NODE_ENV !== "production" ? new Error(a.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
|
|
159
|
+
let p = {
|
|
160
|
+
id: `${String(d)}`,
|
|
161
|
+
accessorFn: f,
|
|
162
|
+
parent: n,
|
|
163
|
+
depth: t,
|
|
164
|
+
columnDef: a,
|
|
165
|
+
columns: [],
|
|
166
|
+
getFlatColumns: S(() => [!0], () => {
|
|
167
|
+
var g;
|
|
168
|
+
return [p, ...(g = p.columns) == null ? void 0 : g.flatMap((s) => s.getFlatColumns())];
|
|
169
|
+
}, w(e.options, "debugColumns", "column.getFlatColumns")),
|
|
170
|
+
getLeafColumns: S(() => [e._getOrderColumnsFn()], (g) => {
|
|
171
|
+
var s;
|
|
172
|
+
if ((s = p.columns) != null && s.length) {
|
|
173
|
+
let m = p.columns.flatMap((h) => h.getLeafColumns());
|
|
174
|
+
return g(m);
|
|
175
|
+
}
|
|
176
|
+
return [p];
|
|
177
|
+
}, w(e.options, "debugColumns", "column.getLeafColumns"))
|
|
178
|
+
};
|
|
179
|
+
for (const g of e._features)
|
|
180
|
+
g.createColumn == null || g.createColumn(p, e);
|
|
181
|
+
return p;
|
|
182
|
+
}
|
|
183
|
+
const P = "debugHeaders";
|
|
184
|
+
function Se(e, o, t) {
|
|
185
|
+
var n;
|
|
186
|
+
let l = {
|
|
187
|
+
id: (n = t.id) != null ? n : o.id,
|
|
188
|
+
column: o,
|
|
189
|
+
index: t.index,
|
|
190
|
+
isPlaceholder: !!t.isPlaceholder,
|
|
191
|
+
placeholderId: t.placeholderId,
|
|
192
|
+
depth: t.depth,
|
|
193
|
+
subHeaders: [],
|
|
194
|
+
colSpan: 0,
|
|
195
|
+
rowSpan: 0,
|
|
196
|
+
headerGroup: null,
|
|
197
|
+
getLeafHeaders: () => {
|
|
198
|
+
const i = [], a = (u) => {
|
|
199
|
+
u.subHeaders && u.subHeaders.length && u.subHeaders.map(a), i.push(u);
|
|
200
|
+
};
|
|
201
|
+
return a(l), i;
|
|
202
|
+
},
|
|
203
|
+
getContext: () => ({
|
|
204
|
+
table: e,
|
|
205
|
+
header: l,
|
|
206
|
+
column: o
|
|
207
|
+
})
|
|
208
|
+
};
|
|
209
|
+
return e._features.forEach((i) => {
|
|
210
|
+
i.createHeader == null || i.createHeader(l, e);
|
|
211
|
+
}), l;
|
|
212
|
+
}
|
|
213
|
+
const ct = {
|
|
214
|
+
createTable: (e) => {
|
|
215
|
+
e.getHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
|
|
216
|
+
var l, i;
|
|
217
|
+
const a = (l = n?.map((p) => t.find((g) => g.id === p)).filter(Boolean)) != null ? l : [], u = (i = r?.map((p) => t.find((g) => g.id === p)).filter(Boolean)) != null ? i : [], d = t.filter((p) => !(n != null && n.includes(p.id)) && !(r != null && r.includes(p.id)));
|
|
218
|
+
return B(o, [...a, ...d, ...u], e);
|
|
219
|
+
}, w(e.options, P, "getHeaderGroups")), e.getCenterHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => (t = t.filter((l) => !(n != null && n.includes(l.id)) && !(r != null && r.includes(l.id))), B(o, t, e, "center")), w(e.options, P, "getCenterHeaderGroups")), e.getLeftHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
|
|
220
|
+
var r;
|
|
221
|
+
const l = (r = n?.map((i) => t.find((a) => a.id === i)).filter(Boolean)) != null ? r : [];
|
|
222
|
+
return B(o, l, e, "left");
|
|
223
|
+
}, w(e.options, P, "getLeftHeaderGroups")), e.getRightHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
|
|
224
|
+
var r;
|
|
225
|
+
const l = (r = n?.map((i) => t.find((a) => a.id === i)).filter(Boolean)) != null ? r : [];
|
|
226
|
+
return B(o, l, e, "right");
|
|
227
|
+
}, w(e.options, P, "getRightHeaderGroups")), e.getFooterGroups = S(() => [e.getHeaderGroups()], (o) => [...o].reverse(), w(e.options, P, "getFooterGroups")), e.getLeftFooterGroups = S(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), w(e.options, P, "getLeftFooterGroups")), e.getCenterFooterGroups = S(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), w(e.options, P, "getCenterFooterGroups")), e.getRightFooterGroups = S(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), w(e.options, P, "getRightFooterGroups")), e.getFlatHeaders = S(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), w(e.options, P, "getFlatHeaders")), e.getLeftFlatHeaders = S(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), w(e.options, P, "getLeftFlatHeaders")), e.getCenterFlatHeaders = S(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), w(e.options, P, "getCenterFlatHeaders")), e.getRightFlatHeaders = S(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), w(e.options, P, "getRightFlatHeaders")), e.getCenterLeafHeaders = S(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
|
|
228
|
+
var n;
|
|
229
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
230
|
+
}), w(e.options, P, "getCenterLeafHeaders")), e.getLeftLeafHeaders = S(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
|
|
231
|
+
var n;
|
|
232
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
233
|
+
}), w(e.options, P, "getLeftLeafHeaders")), e.getRightLeafHeaders = S(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
|
|
234
|
+
var n;
|
|
235
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
236
|
+
}), w(e.options, P, "getRightLeafHeaders")), e.getLeafHeaders = S(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
|
|
237
|
+
var r, l, i, a, u, d;
|
|
238
|
+
return [...(r = (l = o[0]) == null ? void 0 : l.headers) != null ? r : [], ...(i = (a = t[0]) == null ? void 0 : a.headers) != null ? i : [], ...(u = (d = n[0]) == null ? void 0 : d.headers) != null ? u : []].map((f) => f.getLeafHeaders()).flat();
|
|
239
|
+
}, w(e.options, P, "getLeafHeaders"));
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
function B(e, o, t, n) {
|
|
243
|
+
var r, l;
|
|
244
|
+
let i = 0;
|
|
245
|
+
const a = function(g, s) {
|
|
246
|
+
s === void 0 && (s = 1), i = Math.max(i, s), g.filter((m) => m.getIsVisible()).forEach((m) => {
|
|
247
|
+
var h;
|
|
248
|
+
(h = m.columns) != null && h.length && a(m.columns, s + 1);
|
|
249
|
+
}, 0);
|
|
250
|
+
};
|
|
251
|
+
a(e);
|
|
252
|
+
let u = [];
|
|
253
|
+
const d = (g, s) => {
|
|
254
|
+
const m = {
|
|
255
|
+
depth: s,
|
|
256
|
+
id: [n, `${s}`].filter(Boolean).join("_"),
|
|
257
|
+
headers: []
|
|
258
|
+
}, h = [];
|
|
259
|
+
g.forEach((R) => {
|
|
260
|
+
const x = [...h].reverse()[0], $ = R.column.depth === m.depth;
|
|
261
|
+
let V, _ = !1;
|
|
262
|
+
if ($ && R.column.parent ? V = R.column.parent : (V = R.column, _ = !0), x && x?.column === V)
|
|
263
|
+
x.subHeaders.push(R);
|
|
264
|
+
else {
|
|
265
|
+
const v = Se(t, V, {
|
|
266
|
+
id: [n, s, V.id, R?.id].filter(Boolean).join("_"),
|
|
267
|
+
isPlaceholder: _,
|
|
268
|
+
placeholderId: _ ? `${h.filter((M) => M.column === V).length}` : void 0,
|
|
269
|
+
depth: s,
|
|
270
|
+
index: h.length
|
|
271
|
+
});
|
|
272
|
+
v.subHeaders.push(R), h.push(v);
|
|
273
|
+
}
|
|
274
|
+
m.headers.push(R), R.headerGroup = m;
|
|
275
|
+
}), u.push(m), s > 0 && d(h, s - 1);
|
|
276
|
+
}, f = o.map((g, s) => Se(t, g, {
|
|
277
|
+
depth: i,
|
|
278
|
+
index: s
|
|
279
|
+
}));
|
|
280
|
+
d(f, i - 1), u.reverse();
|
|
281
|
+
const p = (g) => g.filter((m) => m.column.getIsVisible()).map((m) => {
|
|
282
|
+
let h = 0, R = 0, x = [0];
|
|
283
|
+
m.subHeaders && m.subHeaders.length ? (x = [], p(m.subHeaders).forEach((V) => {
|
|
284
|
+
let {
|
|
285
|
+
colSpan: _,
|
|
286
|
+
rowSpan: v
|
|
287
|
+
} = V;
|
|
288
|
+
h += _, x.push(v);
|
|
289
|
+
})) : h = 1;
|
|
290
|
+
const $ = Math.min(...x);
|
|
291
|
+
return R = R + $, m.colSpan = h, m.rowSpan = R, {
|
|
292
|
+
colSpan: h,
|
|
293
|
+
rowSpan: R
|
|
294
|
+
};
|
|
295
|
+
});
|
|
296
|
+
return p((r = (l = u[0]) == null ? void 0 : l.headers) != null ? r : []), u;
|
|
297
|
+
}
|
|
298
|
+
const ge = (e, o, t, n, r, l, i) => {
|
|
299
|
+
let a = {
|
|
300
|
+
id: o,
|
|
301
|
+
index: n,
|
|
302
|
+
original: t,
|
|
303
|
+
depth: r,
|
|
304
|
+
parentId: i,
|
|
305
|
+
_valuesCache: {},
|
|
306
|
+
_uniqueValuesCache: {},
|
|
307
|
+
getValue: (u) => {
|
|
308
|
+
if (a._valuesCache.hasOwnProperty(u))
|
|
309
|
+
return a._valuesCache[u];
|
|
310
|
+
const d = e.getColumn(u);
|
|
311
|
+
if (d != null && d.accessorFn)
|
|
312
|
+
return a._valuesCache[u] = d.accessorFn(a.original, n), a._valuesCache[u];
|
|
313
|
+
},
|
|
314
|
+
getUniqueValues: (u) => {
|
|
315
|
+
if (a._uniqueValuesCache.hasOwnProperty(u))
|
|
316
|
+
return a._uniqueValuesCache[u];
|
|
317
|
+
const d = e.getColumn(u);
|
|
318
|
+
if (d != null && d.accessorFn)
|
|
319
|
+
return d.columnDef.getUniqueValues ? (a._uniqueValuesCache[u] = d.columnDef.getUniqueValues(a.original, n), a._uniqueValuesCache[u]) : (a._uniqueValuesCache[u] = [a.getValue(u)], a._uniqueValuesCache[u]);
|
|
320
|
+
},
|
|
321
|
+
renderValue: (u) => {
|
|
322
|
+
var d;
|
|
323
|
+
return (d = a.getValue(u)) != null ? d : e.options.renderFallbackValue;
|
|
324
|
+
},
|
|
325
|
+
subRows: [],
|
|
326
|
+
getLeafRows: () => ut(a.subRows, (u) => u.subRows),
|
|
327
|
+
getParentRow: () => a.parentId ? e.getRow(a.parentId, !0) : void 0,
|
|
328
|
+
getParentRows: () => {
|
|
329
|
+
let u = [], d = a;
|
|
330
|
+
for (; ; ) {
|
|
331
|
+
const f = d.getParentRow();
|
|
332
|
+
if (!f) break;
|
|
333
|
+
u.push(f), d = f;
|
|
334
|
+
}
|
|
335
|
+
return u.reverse();
|
|
336
|
+
},
|
|
337
|
+
getAllCells: S(() => [e.getAllLeafColumns()], (u) => u.map((d) => dt(e, a, d, d.id)), w(e.options, "debugRows", "getAllCells")),
|
|
338
|
+
_getAllCellsByColumnId: S(() => [a.getAllCells()], (u) => u.reduce((d, f) => (d[f.column.id] = f, d), {}), w(e.options, "debugRows", "getAllCellsByColumnId"))
|
|
339
|
+
};
|
|
340
|
+
for (let u = 0; u < e._features.length; u++) {
|
|
341
|
+
const d = e._features[u];
|
|
342
|
+
d == null || d.createRow == null || d.createRow(a, e);
|
|
343
|
+
}
|
|
344
|
+
return a;
|
|
345
|
+
}, ft = {
|
|
346
|
+
createColumn: (e, o) => {
|
|
347
|
+
e._getFacetedRowModel = o.options.getFacetedRowModel && o.options.getFacetedRowModel(o, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : o.getPreFilteredRowModel(), e._getFacetedUniqueValues = o.options.getFacetedUniqueValues && o.options.getFacetedUniqueValues(o, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = o.options.getFacetedMinMaxValues && o.options.getFacetedMinMaxValues(o, e.id), e.getFacetedMinMaxValues = () => {
|
|
348
|
+
if (e._getFacetedMinMaxValues)
|
|
349
|
+
return e._getFacetedMinMaxValues();
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
}, Ee = (e, o, t) => {
|
|
353
|
+
var n, r;
|
|
354
|
+
const l = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
|
|
355
|
+
return !!(!((r = e.getValue(o)) == null || (r = r.toString()) == null || (r = r.toLowerCase()) == null) && r.includes(l));
|
|
356
|
+
};
|
|
357
|
+
Ee.autoRemove = (e) => D(e);
|
|
358
|
+
const Ae = (e, o, t) => {
|
|
359
|
+
var n;
|
|
360
|
+
return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
|
|
361
|
+
};
|
|
362
|
+
Ae.autoRemove = (e) => D(e);
|
|
363
|
+
const He = (e, o, t) => {
|
|
364
|
+
var n;
|
|
365
|
+
return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === t?.toLowerCase();
|
|
366
|
+
};
|
|
367
|
+
He.autoRemove = (e) => D(e);
|
|
368
|
+
const Ge = (e, o, t) => {
|
|
369
|
+
var n;
|
|
370
|
+
return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
|
|
371
|
+
};
|
|
372
|
+
Ge.autoRemove = (e) => D(e);
|
|
373
|
+
const Le = (e, o, t) => !t.some((n) => {
|
|
374
|
+
var r;
|
|
375
|
+
return !((r = e.getValue(o)) != null && r.includes(n));
|
|
376
|
+
});
|
|
377
|
+
Le.autoRemove = (e) => D(e) || !(e != null && e.length);
|
|
378
|
+
const ze = (e, o, t) => t.some((n) => {
|
|
379
|
+
var r;
|
|
380
|
+
return (r = e.getValue(o)) == null ? void 0 : r.includes(n);
|
|
381
|
+
});
|
|
382
|
+
ze.autoRemove = (e) => D(e) || !(e != null && e.length);
|
|
383
|
+
const ke = (e, o, t) => e.getValue(o) === t;
|
|
384
|
+
ke.autoRemove = (e) => D(e);
|
|
385
|
+
const Oe = (e, o, t) => e.getValue(o) == t;
|
|
386
|
+
Oe.autoRemove = (e) => D(e);
|
|
387
|
+
const ce = (e, o, t) => {
|
|
388
|
+
let [n, r] = t;
|
|
389
|
+
const l = e.getValue(o);
|
|
390
|
+
return l >= n && l <= r;
|
|
391
|
+
};
|
|
392
|
+
ce.resolveFilterValue = (e) => {
|
|
393
|
+
let [o, t] = e, n = typeof o != "number" ? parseFloat(o) : o, r = typeof t != "number" ? parseFloat(t) : t, l = o === null || Number.isNaN(n) ? -1 / 0 : n, i = t === null || Number.isNaN(r) ? 1 / 0 : r;
|
|
394
|
+
if (l > i) {
|
|
395
|
+
const a = l;
|
|
396
|
+
l = i, i = a;
|
|
397
|
+
}
|
|
398
|
+
return [l, i];
|
|
399
|
+
};
|
|
400
|
+
ce.autoRemove = (e) => D(e) || D(e[0]) && D(e[1]);
|
|
401
|
+
const E = {
|
|
402
|
+
includesString: Ee,
|
|
403
|
+
includesStringSensitive: Ae,
|
|
404
|
+
equalsString: He,
|
|
405
|
+
arrIncludes: Ge,
|
|
406
|
+
arrIncludesAll: Le,
|
|
407
|
+
arrIncludesSome: ze,
|
|
408
|
+
equals: ke,
|
|
409
|
+
weakEquals: Oe,
|
|
410
|
+
inNumberRange: ce
|
|
411
|
+
};
|
|
412
|
+
function D(e) {
|
|
413
|
+
return e == null || e === "";
|
|
414
|
+
}
|
|
415
|
+
const pt = {
|
|
416
|
+
getDefaultColumnDef: () => ({
|
|
417
|
+
filterFn: "auto"
|
|
418
|
+
}),
|
|
419
|
+
getInitialState: (e) => ({
|
|
420
|
+
columnFilters: [],
|
|
421
|
+
...e
|
|
422
|
+
}),
|
|
423
|
+
getDefaultOptions: (e) => ({
|
|
424
|
+
onColumnFiltersChange: N("columnFilters", e),
|
|
425
|
+
filterFromLeafRows: !1,
|
|
426
|
+
maxLeafRowFilterDepth: 100
|
|
427
|
+
}),
|
|
428
|
+
createColumn: (e, o) => {
|
|
429
|
+
e.getAutoFilterFn = () => {
|
|
430
|
+
const t = o.getCoreRowModel().flatRows[0], n = t?.getValue(e.id);
|
|
431
|
+
return typeof n == "string" ? E.includesString : typeof n == "number" ? E.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? E.equals : Array.isArray(n) ? E.arrIncludes : E.weakEquals;
|
|
432
|
+
}, e.getFilterFn = () => {
|
|
433
|
+
var t, n;
|
|
434
|
+
return Z(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
|
|
435
|
+
// @ts-ignore
|
|
436
|
+
(t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : E[e.columnDef.filterFn]
|
|
437
|
+
);
|
|
438
|
+
}, e.getCanFilter = () => {
|
|
439
|
+
var t, n, r;
|
|
440
|
+
return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n = o.options.enableColumnFilters) != null ? n : !0) && ((r = o.options.enableFilters) != null ? r : !0) && !!e.accessorFn;
|
|
441
|
+
}, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
|
|
442
|
+
var t;
|
|
443
|
+
return (t = o.getState().columnFilters) == null || (t = t.find((n) => n.id === e.id)) == null ? void 0 : t.value;
|
|
444
|
+
}, e.getFilterIndex = () => {
|
|
445
|
+
var t, n;
|
|
446
|
+
return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
|
|
447
|
+
}, e.setFilterValue = (t) => {
|
|
448
|
+
o.setColumnFilters((n) => {
|
|
449
|
+
const r = e.getFilterFn(), l = n?.find((f) => f.id === e.id), i = A(t, l ? l.value : void 0);
|
|
450
|
+
if (we(r, i, e)) {
|
|
451
|
+
var a;
|
|
452
|
+
return (a = n?.filter((f) => f.id !== e.id)) != null ? a : [];
|
|
453
|
+
}
|
|
454
|
+
const u = {
|
|
455
|
+
id: e.id,
|
|
456
|
+
value: i
|
|
457
|
+
};
|
|
458
|
+
if (l) {
|
|
459
|
+
var d;
|
|
460
|
+
return (d = n?.map((f) => f.id === e.id ? u : f)) != null ? d : [];
|
|
461
|
+
}
|
|
462
|
+
return n != null && n.length ? [...n, u] : [u];
|
|
463
|
+
});
|
|
464
|
+
};
|
|
465
|
+
},
|
|
466
|
+
createRow: (e, o) => {
|
|
467
|
+
e.columnFilters = {}, e.columnFiltersMeta = {};
|
|
468
|
+
},
|
|
469
|
+
createTable: (e) => {
|
|
470
|
+
e.setColumnFilters = (o) => {
|
|
471
|
+
const t = e.getAllLeafColumns(), n = (r) => {
|
|
472
|
+
var l;
|
|
473
|
+
return (l = A(o, r)) == null ? void 0 : l.filter((i) => {
|
|
474
|
+
const a = t.find((u) => u.id === i.id);
|
|
475
|
+
if (a) {
|
|
476
|
+
const u = a.getFilterFn();
|
|
477
|
+
if (we(u, i.value, a))
|
|
478
|
+
return !1;
|
|
479
|
+
}
|
|
480
|
+
return !0;
|
|
481
|
+
});
|
|
482
|
+
};
|
|
483
|
+
e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange(n);
|
|
484
|
+
}, e.resetColumnFilters = (o) => {
|
|
485
|
+
var t, n;
|
|
486
|
+
e.setColumnFilters(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.columnFilters) != null ? t : []);
|
|
487
|
+
}, e.getPreFilteredRowModel = () => e.getCoreRowModel(), e.getFilteredRowModel = () => (!e._getFilteredRowModel && e.options.getFilteredRowModel && (e._getFilteredRowModel = e.options.getFilteredRowModel(e)), e.options.manualFiltering || !e._getFilteredRowModel ? e.getPreFilteredRowModel() : e._getFilteredRowModel());
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
function we(e, o, t) {
|
|
491
|
+
return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
|
|
492
|
+
}
|
|
493
|
+
const mt = (e, o, t) => t.reduce((n, r) => {
|
|
494
|
+
const l = r.getValue(e);
|
|
495
|
+
return n + (typeof l == "number" ? l : 0);
|
|
496
|
+
}, 0), ht = (e, o, t) => {
|
|
497
|
+
let n;
|
|
498
|
+
return t.forEach((r) => {
|
|
499
|
+
const l = r.getValue(e);
|
|
500
|
+
l != null && (n > l || n === void 0 && l >= l) && (n = l);
|
|
501
|
+
}), n;
|
|
502
|
+
}, Ct = (e, o, t) => {
|
|
503
|
+
let n;
|
|
504
|
+
return t.forEach((r) => {
|
|
505
|
+
const l = r.getValue(e);
|
|
506
|
+
l != null && (n < l || n === void 0 && l >= l) && (n = l);
|
|
507
|
+
}), n;
|
|
508
|
+
}, St = (e, o, t) => {
|
|
509
|
+
let n, r;
|
|
510
|
+
return t.forEach((l) => {
|
|
511
|
+
const i = l.getValue(e);
|
|
512
|
+
i != null && (n === void 0 ? i >= i && (n = r = i) : (n > i && (n = i), r < i && (r = i)));
|
|
513
|
+
}), [n, r];
|
|
514
|
+
}, wt = (e, o) => {
|
|
515
|
+
let t = 0, n = 0;
|
|
516
|
+
if (o.forEach((r) => {
|
|
517
|
+
let l = r.getValue(e);
|
|
518
|
+
l != null && (l = +l) >= l && (++t, n += l);
|
|
519
|
+
}), t) return n / t;
|
|
520
|
+
}, vt = (e, o) => {
|
|
521
|
+
if (!o.length)
|
|
522
|
+
return;
|
|
523
|
+
const t = o.map((l) => l.getValue(e));
|
|
524
|
+
if (!at(t))
|
|
525
|
+
return;
|
|
526
|
+
if (t.length === 1)
|
|
527
|
+
return t[0];
|
|
528
|
+
const n = Math.floor(t.length / 2), r = t.sort((l, i) => l - i);
|
|
529
|
+
return t.length % 2 !== 0 ? r[n] : (r[n - 1] + r[n]) / 2;
|
|
530
|
+
}, Rt = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), xt = (e, o) => new Set(o.map((t) => t.getValue(e))).size, _t = (e, o) => o.length, J = {
|
|
531
|
+
sum: mt,
|
|
532
|
+
min: ht,
|
|
533
|
+
max: Ct,
|
|
534
|
+
extent: St,
|
|
535
|
+
mean: wt,
|
|
536
|
+
median: vt,
|
|
537
|
+
unique: Rt,
|
|
538
|
+
uniqueCount: xt,
|
|
539
|
+
count: _t
|
|
540
|
+
}, Ft = {
|
|
541
|
+
getDefaultColumnDef: () => ({
|
|
542
|
+
aggregatedCell: (e) => {
|
|
543
|
+
var o, t;
|
|
544
|
+
return (o = (t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) != null ? o : null;
|
|
545
|
+
},
|
|
546
|
+
aggregationFn: "auto"
|
|
547
|
+
}),
|
|
548
|
+
getInitialState: (e) => ({
|
|
549
|
+
grouping: [],
|
|
550
|
+
...e
|
|
551
|
+
}),
|
|
552
|
+
getDefaultOptions: (e) => ({
|
|
553
|
+
onGroupingChange: N("grouping", e),
|
|
554
|
+
groupedColumnMode: "reorder"
|
|
555
|
+
}),
|
|
556
|
+
createColumn: (e, o) => {
|
|
557
|
+
e.toggleGrouping = () => {
|
|
558
|
+
o.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((n) => n !== e.id) : [...t ?? [], e.id]);
|
|
559
|
+
}, e.getCanGroup = () => {
|
|
560
|
+
var t, n;
|
|
561
|
+
return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((n = o.options.enableGrouping) != null ? n : !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue);
|
|
562
|
+
}, e.getIsGrouped = () => {
|
|
563
|
+
var t;
|
|
564
|
+
return (t = o.getState().grouping) == null ? void 0 : t.includes(e.id);
|
|
565
|
+
}, e.getGroupedIndex = () => {
|
|
566
|
+
var t;
|
|
567
|
+
return (t = o.getState().grouping) == null ? void 0 : t.indexOf(e.id);
|
|
568
|
+
}, e.getToggleGroupingHandler = () => {
|
|
569
|
+
const t = e.getCanGroup();
|
|
570
|
+
return () => {
|
|
571
|
+
t && e.toggleGrouping();
|
|
572
|
+
};
|
|
573
|
+
}, e.getAutoAggregationFn = () => {
|
|
574
|
+
const t = o.getCoreRowModel().flatRows[0], n = t?.getValue(e.id);
|
|
575
|
+
if (typeof n == "number")
|
|
576
|
+
return J.sum;
|
|
577
|
+
if (Object.prototype.toString.call(n) === "[object Date]")
|
|
578
|
+
return J.extent;
|
|
579
|
+
}, e.getAggregationFn = () => {
|
|
580
|
+
var t, n;
|
|
581
|
+
if (!e)
|
|
582
|
+
throw new Error();
|
|
583
|
+
return Z(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : (t = (n = o.options.aggregationFns) == null ? void 0 : n[e.columnDef.aggregationFn]) != null ? t : J[e.columnDef.aggregationFn];
|
|
584
|
+
};
|
|
585
|
+
},
|
|
586
|
+
createTable: (e) => {
|
|
587
|
+
e.setGrouping = (o) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(o), e.resetGrouping = (o) => {
|
|
588
|
+
var t, n;
|
|
589
|
+
e.setGrouping(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.grouping) != null ? t : []);
|
|
590
|
+
}, e.getPreGroupedRowModel = () => e.getFilteredRowModel(), e.getGroupedRowModel = () => (!e._getGroupedRowModel && e.options.getGroupedRowModel && (e._getGroupedRowModel = e.options.getGroupedRowModel(e)), e.options.manualGrouping || !e._getGroupedRowModel ? e.getPreGroupedRowModel() : e._getGroupedRowModel());
|
|
591
|
+
},
|
|
592
|
+
createRow: (e, o) => {
|
|
593
|
+
e.getIsGrouped = () => !!e.groupingColumnId, e.getGroupingValue = (t) => {
|
|
594
|
+
if (e._groupingValuesCache.hasOwnProperty(t))
|
|
595
|
+
return e._groupingValuesCache[t];
|
|
596
|
+
const n = o.getColumn(t);
|
|
597
|
+
return n != null && n.columnDef.getGroupingValue ? (e._groupingValuesCache[t] = n.columnDef.getGroupingValue(e.original), e._groupingValuesCache[t]) : e.getValue(t);
|
|
598
|
+
}, e._groupingValuesCache = {};
|
|
599
|
+
},
|
|
600
|
+
createCell: (e, o, t, n) => {
|
|
601
|
+
e.getIsGrouped = () => o.getIsGrouped() && o.id === t.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && o.getIsGrouped(), e.getIsAggregated = () => {
|
|
602
|
+
var r;
|
|
603
|
+
return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((r = t.subRows) != null && r.length);
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
function yt(e, o, t) {
|
|
608
|
+
if (!(o != null && o.length) || !t)
|
|
609
|
+
return e;
|
|
610
|
+
const n = e.filter((l) => !o.includes(l.id));
|
|
611
|
+
return t === "remove" ? n : [...o.map((l) => e.find((i) => i.id === l)).filter(Boolean), ...n];
|
|
612
|
+
}
|
|
613
|
+
const $t = {
|
|
614
|
+
getInitialState: (e) => ({
|
|
615
|
+
columnOrder: [],
|
|
616
|
+
...e
|
|
617
|
+
}),
|
|
618
|
+
getDefaultOptions: (e) => ({
|
|
619
|
+
onColumnOrderChange: N("columnOrder", e)
|
|
620
|
+
}),
|
|
621
|
+
createColumn: (e, o) => {
|
|
622
|
+
e.getIndex = S((t) => [L(o, t)], (t) => t.findIndex((n) => n.id === e.id), w(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
|
|
623
|
+
var n;
|
|
624
|
+
return ((n = L(o, t)[0]) == null ? void 0 : n.id) === e.id;
|
|
625
|
+
}, e.getIsLastColumn = (t) => {
|
|
626
|
+
var n;
|
|
627
|
+
const r = L(o, t);
|
|
628
|
+
return ((n = r[r.length - 1]) == null ? void 0 : n.id) === e.id;
|
|
629
|
+
};
|
|
630
|
+
},
|
|
631
|
+
createTable: (e) => {
|
|
632
|
+
e.setColumnOrder = (o) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(o), e.resetColumnOrder = (o) => {
|
|
633
|
+
var t;
|
|
634
|
+
e.setColumnOrder(o ? [] : (t = e.initialState.columnOrder) != null ? t : []);
|
|
635
|
+
}, e._getOrderColumnsFn = S(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (o, t, n) => (r) => {
|
|
636
|
+
let l = [];
|
|
637
|
+
if (!(o != null && o.length))
|
|
638
|
+
l = r;
|
|
639
|
+
else {
|
|
640
|
+
const i = [...o], a = [...r];
|
|
641
|
+
for (; a.length && i.length; ) {
|
|
642
|
+
const u = i.shift(), d = a.findIndex((f) => f.id === u);
|
|
643
|
+
d > -1 && l.push(a.splice(d, 1)[0]);
|
|
644
|
+
}
|
|
645
|
+
l = [...l, ...a];
|
|
646
|
+
}
|
|
647
|
+
return yt(l, t, n);
|
|
648
|
+
}, w(e.options, "debugTable", "_getOrderColumnsFn"));
|
|
649
|
+
}
|
|
650
|
+
}, W = () => ({
|
|
651
|
+
left: [],
|
|
652
|
+
right: []
|
|
653
|
+
}), Vt = {
|
|
654
|
+
getInitialState: (e) => ({
|
|
655
|
+
columnPinning: W(),
|
|
656
|
+
...e
|
|
657
|
+
}),
|
|
658
|
+
getDefaultOptions: (e) => ({
|
|
659
|
+
onColumnPinningChange: N("columnPinning", e)
|
|
660
|
+
}),
|
|
661
|
+
createColumn: (e, o) => {
|
|
662
|
+
e.pin = (t) => {
|
|
663
|
+
const n = e.getLeafColumns().map((r) => r.id).filter(Boolean);
|
|
664
|
+
o.setColumnPinning((r) => {
|
|
665
|
+
var l, i;
|
|
666
|
+
if (t === "right") {
|
|
667
|
+
var a, u;
|
|
668
|
+
return {
|
|
669
|
+
left: ((a = r?.left) != null ? a : []).filter((p) => !(n != null && n.includes(p))),
|
|
670
|
+
right: [...((u = r?.right) != null ? u : []).filter((p) => !(n != null && n.includes(p))), ...n]
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
if (t === "left") {
|
|
674
|
+
var d, f;
|
|
675
|
+
return {
|
|
676
|
+
left: [...((d = r?.left) != null ? d : []).filter((p) => !(n != null && n.includes(p))), ...n],
|
|
677
|
+
right: ((f = r?.right) != null ? f : []).filter((p) => !(n != null && n.includes(p)))
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
return {
|
|
681
|
+
left: ((l = r?.left) != null ? l : []).filter((p) => !(n != null && n.includes(p))),
|
|
682
|
+
right: ((i = r?.right) != null ? i : []).filter((p) => !(n != null && n.includes(p)))
|
|
683
|
+
};
|
|
684
|
+
});
|
|
685
|
+
}, e.getCanPin = () => e.getLeafColumns().some((n) => {
|
|
686
|
+
var r, l, i;
|
|
687
|
+
return ((r = n.columnDef.enablePinning) != null ? r : !0) && ((l = (i = o.options.enableColumnPinning) != null ? i : o.options.enablePinning) != null ? l : !0);
|
|
688
|
+
}), e.getIsPinned = () => {
|
|
689
|
+
const t = e.getLeafColumns().map((a) => a.id), {
|
|
690
|
+
left: n,
|
|
691
|
+
right: r
|
|
692
|
+
} = o.getState().columnPinning, l = t.some((a) => n?.includes(a)), i = t.some((a) => r?.includes(a));
|
|
693
|
+
return l ? "left" : i ? "right" : !1;
|
|
694
|
+
}, e.getPinnedIndex = () => {
|
|
695
|
+
var t, n;
|
|
696
|
+
const r = e.getIsPinned();
|
|
697
|
+
return r ? (t = (n = o.getState().columnPinning) == null || (n = n[r]) == null ? void 0 : n.indexOf(e.id)) != null ? t : -1 : 0;
|
|
698
|
+
};
|
|
699
|
+
},
|
|
700
|
+
createRow: (e, o) => {
|
|
701
|
+
e.getCenterVisibleCells = S(() => [e._getAllVisibleCells(), o.getState().columnPinning.left, o.getState().columnPinning.right], (t, n, r) => {
|
|
702
|
+
const l = [...n ?? [], ...r ?? []];
|
|
703
|
+
return t.filter((i) => !l.includes(i.column.id));
|
|
704
|
+
}, w(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = S(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((l) => t.find((i) => i.column.id === l)).filter(Boolean).map((l) => ({
|
|
705
|
+
...l,
|
|
706
|
+
position: "left"
|
|
707
|
+
})), w(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = S(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((l) => t.find((i) => i.column.id === l)).filter(Boolean).map((l) => ({
|
|
708
|
+
...l,
|
|
709
|
+
position: "right"
|
|
710
|
+
})), w(o.options, "debugRows", "getRightVisibleCells"));
|
|
711
|
+
},
|
|
712
|
+
createTable: (e) => {
|
|
713
|
+
e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
|
|
714
|
+
var t, n;
|
|
715
|
+
return e.setColumnPinning(o ? W() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : W());
|
|
716
|
+
}, e.getIsSomeColumnsPinned = (o) => {
|
|
717
|
+
var t;
|
|
718
|
+
const n = e.getState().columnPinning;
|
|
719
|
+
if (!o) {
|
|
720
|
+
var r, l;
|
|
721
|
+
return !!((r = n.left) != null && r.length || (l = n.right) != null && l.length);
|
|
722
|
+
}
|
|
723
|
+
return !!((t = n[o]) != null && t.length);
|
|
724
|
+
}, e.getLeftLeafColumns = S(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), w(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = S(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), w(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = S(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
|
|
725
|
+
const r = [...t ?? [], ...n ?? []];
|
|
726
|
+
return o.filter((l) => !r.includes(l.id));
|
|
727
|
+
}, w(e.options, "debugColumns", "getCenterLeafColumns"));
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
function Mt(e) {
|
|
731
|
+
return e || (typeof document < "u" ? document : null);
|
|
732
|
+
}
|
|
733
|
+
const b = {
|
|
734
|
+
size: 150,
|
|
735
|
+
minSize: 20,
|
|
736
|
+
maxSize: Number.MAX_SAFE_INTEGER
|
|
737
|
+
}, Y = () => ({
|
|
738
|
+
startOffset: null,
|
|
739
|
+
startSize: null,
|
|
740
|
+
deltaOffset: null,
|
|
741
|
+
deltaPercentage: null,
|
|
742
|
+
isResizingColumn: !1,
|
|
743
|
+
columnSizingStart: []
|
|
744
|
+
}), Pt = {
|
|
745
|
+
getDefaultColumnDef: () => b,
|
|
746
|
+
getInitialState: (e) => ({
|
|
747
|
+
columnSizing: {},
|
|
748
|
+
columnSizingInfo: Y(),
|
|
749
|
+
...e
|
|
750
|
+
}),
|
|
751
|
+
getDefaultOptions: (e) => ({
|
|
752
|
+
columnResizeMode: "onEnd",
|
|
753
|
+
columnResizeDirection: "ltr",
|
|
754
|
+
onColumnSizingChange: N("columnSizing", e),
|
|
755
|
+
onColumnSizingInfoChange: N("columnSizingInfo", e)
|
|
756
|
+
}),
|
|
757
|
+
createColumn: (e, o) => {
|
|
758
|
+
e.getSize = () => {
|
|
759
|
+
var t, n, r;
|
|
760
|
+
const l = o.getState().columnSizing[e.id];
|
|
761
|
+
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : b.minSize, (n = l ?? e.columnDef.size) != null ? n : b.size), (r = e.columnDef.maxSize) != null ? r : b.maxSize);
|
|
762
|
+
}, e.getStart = S((t) => [t, L(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((r, l) => r + l.getSize(), 0), w(o.options, "debugColumns", "getStart")), e.getAfter = S((t) => [t, L(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((r, l) => r + l.getSize(), 0), w(o.options, "debugColumns", "getAfter")), e.resetSize = () => {
|
|
763
|
+
o.setColumnSizing((t) => {
|
|
764
|
+
let {
|
|
765
|
+
[e.id]: n,
|
|
766
|
+
...r
|
|
767
|
+
} = t;
|
|
768
|
+
return r;
|
|
769
|
+
});
|
|
770
|
+
}, e.getCanResize = () => {
|
|
771
|
+
var t, n;
|
|
772
|
+
return ((t = e.columnDef.enableResizing) != null ? t : !0) && ((n = o.options.enableColumnResizing) != null ? n : !0);
|
|
773
|
+
}, e.getIsResizing = () => o.getState().columnSizingInfo.isResizingColumn === e.id;
|
|
774
|
+
},
|
|
775
|
+
createHeader: (e, o) => {
|
|
776
|
+
e.getSize = () => {
|
|
777
|
+
let t = 0;
|
|
778
|
+
const n = (r) => {
|
|
779
|
+
if (r.subHeaders.length)
|
|
780
|
+
r.subHeaders.forEach(n);
|
|
781
|
+
else {
|
|
782
|
+
var l;
|
|
783
|
+
t += (l = r.column.getSize()) != null ? l : 0;
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
return n(e), t;
|
|
787
|
+
}, e.getStart = () => {
|
|
788
|
+
if (e.index > 0) {
|
|
789
|
+
const t = e.headerGroup.headers[e.index - 1];
|
|
790
|
+
return t.getStart() + t.getSize();
|
|
791
|
+
}
|
|
792
|
+
return 0;
|
|
793
|
+
}, e.getResizeHandler = (t) => {
|
|
794
|
+
const n = o.getColumn(e.column.id), r = n?.getCanResize();
|
|
795
|
+
return (l) => {
|
|
796
|
+
if (!n || !r || (l.persist == null || l.persist(), ee(l) && l.touches && l.touches.length > 1))
|
|
797
|
+
return;
|
|
798
|
+
const i = e.getSize(), a = e ? e.getLeafHeaders().map((x) => [x.column.id, x.column.getSize()]) : [[n.id, n.getSize()]], u = ee(l) ? Math.round(l.touches[0].clientX) : l.clientX, d = {}, f = (x, $) => {
|
|
799
|
+
typeof $ == "number" && (o.setColumnSizingInfo((V) => {
|
|
800
|
+
var _, v;
|
|
801
|
+
const M = o.options.columnResizeDirection === "rtl" ? -1 : 1, me = ($ - ((_ = V?.startOffset) != null ? _ : 0)) * M, he = Math.max(me / ((v = V?.startSize) != null ? v : 0), -0.999999);
|
|
802
|
+
return V.columnSizingStart.forEach((Ue) => {
|
|
803
|
+
let [Xe, Ce] = Ue;
|
|
804
|
+
d[Xe] = Math.round(Math.max(Ce + Ce * he, 0) * 100) / 100;
|
|
805
|
+
}), {
|
|
806
|
+
...V,
|
|
807
|
+
deltaOffset: me,
|
|
808
|
+
deltaPercentage: he
|
|
809
|
+
};
|
|
810
|
+
}), (o.options.columnResizeMode === "onChange" || x === "end") && o.setColumnSizing((V) => ({
|
|
811
|
+
...V,
|
|
812
|
+
...d
|
|
813
|
+
})));
|
|
814
|
+
}, p = (x) => f("move", x), g = (x) => {
|
|
815
|
+
f("end", x), o.setColumnSizingInfo(($) => ({
|
|
816
|
+
...$,
|
|
817
|
+
isResizingColumn: !1,
|
|
818
|
+
startOffset: null,
|
|
819
|
+
startSize: null,
|
|
820
|
+
deltaOffset: null,
|
|
821
|
+
deltaPercentage: null,
|
|
822
|
+
columnSizingStart: []
|
|
823
|
+
}));
|
|
824
|
+
}, s = Mt(t), m = {
|
|
825
|
+
moveHandler: (x) => p(x.clientX),
|
|
826
|
+
upHandler: (x) => {
|
|
827
|
+
s?.removeEventListener("mousemove", m.moveHandler), s?.removeEventListener("mouseup", m.upHandler), g(x.clientX);
|
|
828
|
+
}
|
|
829
|
+
}, h = {
|
|
830
|
+
moveHandler: (x) => (x.cancelable && (x.preventDefault(), x.stopPropagation()), p(x.touches[0].clientX), !1),
|
|
831
|
+
upHandler: (x) => {
|
|
832
|
+
var $;
|
|
833
|
+
s?.removeEventListener("touchmove", h.moveHandler), s?.removeEventListener("touchend", h.upHandler), x.cancelable && (x.preventDefault(), x.stopPropagation()), g(($ = x.touches[0]) == null ? void 0 : $.clientX);
|
|
834
|
+
}
|
|
835
|
+
}, R = It() ? {
|
|
836
|
+
passive: !1
|
|
837
|
+
} : !1;
|
|
838
|
+
ee(l) ? (s?.addEventListener("touchmove", h.moveHandler, R), s?.addEventListener("touchend", h.upHandler, R)) : (s?.addEventListener("mousemove", m.moveHandler, R), s?.addEventListener("mouseup", m.upHandler, R)), o.setColumnSizingInfo((x) => ({
|
|
839
|
+
...x,
|
|
840
|
+
startOffset: u,
|
|
841
|
+
startSize: i,
|
|
842
|
+
deltaOffset: 0,
|
|
843
|
+
deltaPercentage: 0,
|
|
844
|
+
columnSizingStart: a,
|
|
845
|
+
isResizingColumn: n.id
|
|
846
|
+
}));
|
|
847
|
+
};
|
|
848
|
+
};
|
|
849
|
+
},
|
|
850
|
+
createTable: (e) => {
|
|
851
|
+
e.setColumnSizing = (o) => e.options.onColumnSizingChange == null ? void 0 : e.options.onColumnSizingChange(o), e.setColumnSizingInfo = (o) => e.options.onColumnSizingInfoChange == null ? void 0 : e.options.onColumnSizingInfoChange(o), e.resetColumnSizing = (o) => {
|
|
852
|
+
var t;
|
|
853
|
+
e.setColumnSizing(o ? {} : (t = e.initialState.columnSizing) != null ? t : {});
|
|
854
|
+
}, e.resetHeaderSizeInfo = (o) => {
|
|
855
|
+
var t;
|
|
856
|
+
e.setColumnSizingInfo(o ? Y() : (t = e.initialState.columnSizingInfo) != null ? t : Y());
|
|
857
|
+
}, e.getTotalSize = () => {
|
|
858
|
+
var o, t;
|
|
859
|
+
return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
|
|
860
|
+
}, e.getLeftTotalSize = () => {
|
|
861
|
+
var o, t;
|
|
862
|
+
return (o = (t = e.getLeftHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
|
|
863
|
+
}, e.getCenterTotalSize = () => {
|
|
864
|
+
var o, t;
|
|
865
|
+
return (o = (t = e.getCenterHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
|
|
866
|
+
}, e.getRightTotalSize = () => {
|
|
867
|
+
var o, t;
|
|
868
|
+
return (o = (t = e.getRightHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
let q = null;
|
|
873
|
+
function It() {
|
|
874
|
+
if (typeof q == "boolean") return q;
|
|
875
|
+
let e = !1;
|
|
876
|
+
try {
|
|
877
|
+
const o = {
|
|
878
|
+
get passive() {
|
|
879
|
+
return e = !0, !1;
|
|
880
|
+
}
|
|
881
|
+
}, t = () => {
|
|
882
|
+
};
|
|
883
|
+
window.addEventListener("test", t, o), window.removeEventListener("test", t);
|
|
884
|
+
} catch {
|
|
885
|
+
e = !1;
|
|
886
|
+
}
|
|
887
|
+
return q = e, q;
|
|
888
|
+
}
|
|
889
|
+
function ee(e) {
|
|
890
|
+
return e.type === "touchstart";
|
|
891
|
+
}
|
|
892
|
+
const Nt = {
|
|
893
|
+
getInitialState: (e) => ({
|
|
894
|
+
columnVisibility: {},
|
|
895
|
+
...e
|
|
896
|
+
}),
|
|
897
|
+
getDefaultOptions: (e) => ({
|
|
898
|
+
onColumnVisibilityChange: N("columnVisibility", e)
|
|
899
|
+
}),
|
|
900
|
+
createColumn: (e, o) => {
|
|
901
|
+
e.toggleVisibility = (t) => {
|
|
902
|
+
e.getCanHide() && o.setColumnVisibility((n) => ({
|
|
903
|
+
...n,
|
|
904
|
+
[e.id]: t ?? !e.getIsVisible()
|
|
905
|
+
}));
|
|
906
|
+
}, e.getIsVisible = () => {
|
|
907
|
+
var t, n;
|
|
908
|
+
const r = e.columns;
|
|
909
|
+
return (t = r.length ? r.some((l) => l.getIsVisible()) : (n = o.getState().columnVisibility) == null ? void 0 : n[e.id]) != null ? t : !0;
|
|
910
|
+
}, e.getCanHide = () => {
|
|
911
|
+
var t, n;
|
|
912
|
+
return ((t = e.columnDef.enableHiding) != null ? t : !0) && ((n = o.options.enableHiding) != null ? n : !0);
|
|
913
|
+
}, e.getToggleVisibilityHandler = () => (t) => {
|
|
914
|
+
e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
|
|
915
|
+
};
|
|
916
|
+
},
|
|
917
|
+
createRow: (e, o) => {
|
|
918
|
+
e._getAllVisibleCells = S(() => [e.getAllCells(), o.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), w(o.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = S(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, r) => [...t, ...n, ...r], w(o.options, "debugRows", "getVisibleCells"));
|
|
919
|
+
},
|
|
920
|
+
createTable: (e) => {
|
|
921
|
+
const o = (t, n) => S(() => [n(), n().filter((r) => r.getIsVisible()).map((r) => r.id).join("_")], (r) => r.filter((l) => l.getIsVisible == null ? void 0 : l.getIsVisible()), w(e.options, "debugColumns", t));
|
|
922
|
+
e.getVisibleFlatColumns = o("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = o("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = o("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = o("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = o("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
|
|
923
|
+
var n;
|
|
924
|
+
e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
|
|
925
|
+
}, e.toggleAllColumnsVisible = (t) => {
|
|
926
|
+
var n;
|
|
927
|
+
t = (n = t) != null ? n : !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((r, l) => ({
|
|
928
|
+
...r,
|
|
929
|
+
[l.id]: t || !(l.getCanHide != null && l.getCanHide())
|
|
930
|
+
}), {}));
|
|
931
|
+
}, e.getIsAllColumnsVisible = () => !e.getAllLeafColumns().some((t) => !(t.getIsVisible != null && t.getIsVisible())), e.getIsSomeColumnsVisible = () => e.getAllLeafColumns().some((t) => t.getIsVisible == null ? void 0 : t.getIsVisible()), e.getToggleAllColumnsVisibilityHandler = () => (t) => {
|
|
932
|
+
var n;
|
|
933
|
+
e.toggleAllColumnsVisible((n = t.target) == null ? void 0 : n.checked);
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
function L(e, o) {
|
|
938
|
+
return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
|
|
939
|
+
}
|
|
940
|
+
const Dt = {
|
|
941
|
+
createTable: (e) => {
|
|
942
|
+
e._getGlobalFacetedRowModel = e.options.getFacetedRowModel && e.options.getFacetedRowModel(e, "__global__"), e.getGlobalFacetedRowModel = () => e.options.manualFiltering || !e._getGlobalFacetedRowModel ? e.getPreFilteredRowModel() : e._getGlobalFacetedRowModel(), e._getGlobalFacetedUniqueValues = e.options.getFacetedUniqueValues && e.options.getFacetedUniqueValues(e, "__global__"), e.getGlobalFacetedUniqueValues = () => e._getGlobalFacetedUniqueValues ? e._getGlobalFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getGlobalFacetedMinMaxValues = e.options.getFacetedMinMaxValues && e.options.getFacetedMinMaxValues(e, "__global__"), e.getGlobalFacetedMinMaxValues = () => {
|
|
943
|
+
if (e._getGlobalFacetedMinMaxValues)
|
|
944
|
+
return e._getGlobalFacetedMinMaxValues();
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
}, Et = {
|
|
948
|
+
getInitialState: (e) => ({
|
|
949
|
+
globalFilter: void 0,
|
|
950
|
+
...e
|
|
951
|
+
}),
|
|
952
|
+
getDefaultOptions: (e) => ({
|
|
953
|
+
onGlobalFilterChange: N("globalFilter", e),
|
|
954
|
+
globalFilterFn: "auto",
|
|
955
|
+
getColumnCanGlobalFilter: (o) => {
|
|
956
|
+
var t;
|
|
957
|
+
const n = (t = e.getCoreRowModel().flatRows[0]) == null || (t = t._getAllCellsByColumnId()[o.id]) == null ? void 0 : t.getValue();
|
|
958
|
+
return typeof n == "string" || typeof n == "number";
|
|
959
|
+
}
|
|
960
|
+
}),
|
|
961
|
+
createColumn: (e, o) => {
|
|
962
|
+
e.getCanGlobalFilter = () => {
|
|
963
|
+
var t, n, r, l;
|
|
964
|
+
return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n = o.options.enableGlobalFilter) != null ? n : !0) && ((r = o.options.enableFilters) != null ? r : !0) && ((l = o.options.getColumnCanGlobalFilter == null ? void 0 : o.options.getColumnCanGlobalFilter(e)) != null ? l : !0) && !!e.accessorFn;
|
|
965
|
+
};
|
|
966
|
+
},
|
|
967
|
+
createTable: (e) => {
|
|
968
|
+
e.getGlobalAutoFilterFn = () => E.includesString, e.getGlobalFilterFn = () => {
|
|
969
|
+
var o, t;
|
|
970
|
+
const {
|
|
971
|
+
globalFilterFn: n
|
|
972
|
+
} = e.options;
|
|
973
|
+
return Z(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : E[n];
|
|
974
|
+
}, e.setGlobalFilter = (o) => {
|
|
975
|
+
e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(o);
|
|
976
|
+
}, e.resetGlobalFilter = (o) => {
|
|
977
|
+
e.setGlobalFilter(o ? void 0 : e.initialState.globalFilter);
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
}, At = {
|
|
981
|
+
getInitialState: (e) => ({
|
|
982
|
+
expanded: {},
|
|
983
|
+
...e
|
|
984
|
+
}),
|
|
985
|
+
getDefaultOptions: (e) => ({
|
|
986
|
+
onExpandedChange: N("expanded", e),
|
|
987
|
+
paginateExpandedRows: !0
|
|
988
|
+
}),
|
|
989
|
+
createTable: (e) => {
|
|
990
|
+
let o = !1, t = !1;
|
|
991
|
+
e._autoResetExpanded = () => {
|
|
992
|
+
var n, r;
|
|
993
|
+
if (!o) {
|
|
994
|
+
e._queue(() => {
|
|
995
|
+
o = !0;
|
|
996
|
+
});
|
|
997
|
+
return;
|
|
998
|
+
}
|
|
999
|
+
if ((n = (r = e.options.autoResetAll) != null ? r : e.options.autoResetExpanded) != null ? n : !e.options.manualExpanding) {
|
|
1000
|
+
if (t) return;
|
|
1001
|
+
t = !0, e._queue(() => {
|
|
1002
|
+
e.resetExpanded(), t = !1;
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
}, e.setExpanded = (n) => e.options.onExpandedChange == null ? void 0 : e.options.onExpandedChange(n), e.toggleAllRowsExpanded = (n) => {
|
|
1006
|
+
n ?? !e.getIsAllRowsExpanded() ? e.setExpanded(!0) : e.setExpanded({});
|
|
1007
|
+
}, e.resetExpanded = (n) => {
|
|
1008
|
+
var r, l;
|
|
1009
|
+
e.setExpanded(n ? {} : (r = (l = e.initialState) == null ? void 0 : l.expanded) != null ? r : {});
|
|
1010
|
+
}, e.getCanSomeRowsExpand = () => e.getPrePaginationRowModel().flatRows.some((n) => n.getCanExpand()), e.getToggleAllRowsExpandedHandler = () => (n) => {
|
|
1011
|
+
n.persist == null || n.persist(), e.toggleAllRowsExpanded();
|
|
1012
|
+
}, e.getIsSomeRowsExpanded = () => {
|
|
1013
|
+
const n = e.getState().expanded;
|
|
1014
|
+
return n === !0 || Object.values(n).some(Boolean);
|
|
1015
|
+
}, e.getIsAllRowsExpanded = () => {
|
|
1016
|
+
const n = e.getState().expanded;
|
|
1017
|
+
return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || e.getRowModel().flatRows.some((r) => !r.getIsExpanded()));
|
|
1018
|
+
}, e.getExpandedDepth = () => {
|
|
1019
|
+
let n = 0;
|
|
1020
|
+
return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((l) => {
|
|
1021
|
+
const i = l.split(".");
|
|
1022
|
+
n = Math.max(n, i.length);
|
|
1023
|
+
}), n;
|
|
1024
|
+
}, e.getPreExpandedRowModel = () => e.getSortedRowModel(), e.getExpandedRowModel = () => (!e._getExpandedRowModel && e.options.getExpandedRowModel && (e._getExpandedRowModel = e.options.getExpandedRowModel(e)), e.options.manualExpanding || !e._getExpandedRowModel ? e.getPreExpandedRowModel() : e._getExpandedRowModel());
|
|
1025
|
+
},
|
|
1026
|
+
createRow: (e, o) => {
|
|
1027
|
+
e.toggleExpanded = (t) => {
|
|
1028
|
+
o.setExpanded((n) => {
|
|
1029
|
+
var r;
|
|
1030
|
+
const l = n === !0 ? !0 : !!(n != null && n[e.id]);
|
|
1031
|
+
let i = {};
|
|
1032
|
+
if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((a) => {
|
|
1033
|
+
i[a] = !0;
|
|
1034
|
+
}) : i = n, t = (r = t) != null ? r : !l, !l && t)
|
|
1035
|
+
return {
|
|
1036
|
+
...i,
|
|
1037
|
+
[e.id]: !0
|
|
1038
|
+
};
|
|
1039
|
+
if (l && !t) {
|
|
1040
|
+
const {
|
|
1041
|
+
[e.id]: a,
|
|
1042
|
+
...u
|
|
1043
|
+
} = i;
|
|
1044
|
+
return u;
|
|
1045
|
+
}
|
|
1046
|
+
return n;
|
|
1047
|
+
});
|
|
1048
|
+
}, e.getIsExpanded = () => {
|
|
1049
|
+
var t;
|
|
1050
|
+
const n = o.getState().expanded;
|
|
1051
|
+
return !!((t = o.options.getIsRowExpanded == null ? void 0 : o.options.getIsRowExpanded(e)) != null ? t : n === !0 || n?.[e.id]);
|
|
1052
|
+
}, e.getCanExpand = () => {
|
|
1053
|
+
var t, n, r;
|
|
1054
|
+
return (t = o.options.getRowCanExpand == null ? void 0 : o.options.getRowCanExpand(e)) != null ? t : ((n = o.options.enableExpanding) != null ? n : !0) && !!((r = e.subRows) != null && r.length);
|
|
1055
|
+
}, e.getIsAllParentsExpanded = () => {
|
|
1056
|
+
let t = !0, n = e;
|
|
1057
|
+
for (; t && n.parentId; )
|
|
1058
|
+
n = o.getRow(n.parentId, !0), t = n.getIsExpanded();
|
|
1059
|
+
return t;
|
|
1060
|
+
}, e.getToggleExpandedHandler = () => {
|
|
1061
|
+
const t = e.getCanExpand();
|
|
1062
|
+
return () => {
|
|
1063
|
+
t && e.toggleExpanded();
|
|
1064
|
+
};
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
}, re = 0, le = 10, te = () => ({
|
|
1068
|
+
pageIndex: re,
|
|
1069
|
+
pageSize: le
|
|
1070
|
+
}), Ht = {
|
|
1071
|
+
getInitialState: (e) => ({
|
|
1072
|
+
...e,
|
|
1073
|
+
pagination: {
|
|
1074
|
+
...te(),
|
|
1075
|
+
...e?.pagination
|
|
1076
|
+
}
|
|
1077
|
+
}),
|
|
1078
|
+
getDefaultOptions: (e) => ({
|
|
1079
|
+
onPaginationChange: N("pagination", e)
|
|
1080
|
+
}),
|
|
1081
|
+
createTable: (e) => {
|
|
1082
|
+
let o = !1, t = !1;
|
|
1083
|
+
e._autoResetPageIndex = () => {
|
|
1084
|
+
var n, r;
|
|
1085
|
+
if (!o) {
|
|
1086
|
+
e._queue(() => {
|
|
1087
|
+
o = !0;
|
|
1088
|
+
});
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
if ((n = (r = e.options.autoResetAll) != null ? r : e.options.autoResetPageIndex) != null ? n : !e.options.manualPagination) {
|
|
1092
|
+
if (t) return;
|
|
1093
|
+
t = !0, e._queue(() => {
|
|
1094
|
+
e.resetPageIndex(), t = !1;
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
}, e.setPagination = (n) => {
|
|
1098
|
+
const r = (l) => A(n, l);
|
|
1099
|
+
return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(r);
|
|
1100
|
+
}, e.resetPagination = (n) => {
|
|
1101
|
+
var r;
|
|
1102
|
+
e.setPagination(n ? te() : (r = e.initialState.pagination) != null ? r : te());
|
|
1103
|
+
}, e.setPageIndex = (n) => {
|
|
1104
|
+
e.setPagination((r) => {
|
|
1105
|
+
let l = A(n, r.pageIndex);
|
|
1106
|
+
const i = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
|
|
1107
|
+
return l = Math.max(0, Math.min(l, i)), {
|
|
1108
|
+
...r,
|
|
1109
|
+
pageIndex: l
|
|
1110
|
+
};
|
|
1111
|
+
});
|
|
1112
|
+
}, e.resetPageIndex = (n) => {
|
|
1113
|
+
var r, l;
|
|
1114
|
+
e.setPageIndex(n ? re : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageIndex) != null ? r : re);
|
|
1115
|
+
}, e.resetPageSize = (n) => {
|
|
1116
|
+
var r, l;
|
|
1117
|
+
e.setPageSize(n ? le : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageSize) != null ? r : le);
|
|
1118
|
+
}, e.setPageSize = (n) => {
|
|
1119
|
+
e.setPagination((r) => {
|
|
1120
|
+
const l = Math.max(1, A(n, r.pageSize)), i = r.pageSize * r.pageIndex, a = Math.floor(i / l);
|
|
1121
|
+
return {
|
|
1122
|
+
...r,
|
|
1123
|
+
pageIndex: a,
|
|
1124
|
+
pageSize: l
|
|
1125
|
+
};
|
|
1126
|
+
});
|
|
1127
|
+
}, e.setPageCount = (n) => e.setPagination((r) => {
|
|
1128
|
+
var l;
|
|
1129
|
+
let i = A(n, (l = e.options.pageCount) != null ? l : -1);
|
|
1130
|
+
return typeof i == "number" && (i = Math.max(-1, i)), {
|
|
1131
|
+
...r,
|
|
1132
|
+
pageCount: i
|
|
1133
|
+
};
|
|
1134
|
+
}), e.getPageOptions = S(() => [e.getPageCount()], (n) => {
|
|
1135
|
+
let r = [];
|
|
1136
|
+
return n && n > 0 && (r = [...new Array(n)].fill(null).map((l, i) => i)), r;
|
|
1137
|
+
}, w(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
|
|
1138
|
+
const {
|
|
1139
|
+
pageIndex: n
|
|
1140
|
+
} = e.getState().pagination, r = e.getPageCount();
|
|
1141
|
+
return r === -1 ? !0 : r === 0 ? !1 : n < r - 1;
|
|
1142
|
+
}, e.previousPage = () => e.setPageIndex((n) => n - 1), e.nextPage = () => e.setPageIndex((n) => n + 1), e.firstPage = () => e.setPageIndex(0), e.lastPage = () => e.setPageIndex(e.getPageCount() - 1), e.getPrePaginationRowModel = () => e.getExpandedRowModel(), e.getPaginationRowModel = () => (!e._getPaginationRowModel && e.options.getPaginationRowModel && (e._getPaginationRowModel = e.options.getPaginationRowModel(e)), e.options.manualPagination || !e._getPaginationRowModel ? e.getPrePaginationRowModel() : e._getPaginationRowModel()), e.getPageCount = () => {
|
|
1143
|
+
var n;
|
|
1144
|
+
return (n = e.options.pageCount) != null ? n : Math.ceil(e.getRowCount() / e.getState().pagination.pageSize);
|
|
1145
|
+
}, e.getRowCount = () => {
|
|
1146
|
+
var n;
|
|
1147
|
+
return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
|
|
1148
|
+
};
|
|
1149
|
+
}
|
|
1150
|
+
}, ne = () => ({
|
|
1151
|
+
top: [],
|
|
1152
|
+
bottom: []
|
|
1153
|
+
}), Gt = {
|
|
1154
|
+
getInitialState: (e) => ({
|
|
1155
|
+
rowPinning: ne(),
|
|
1156
|
+
...e
|
|
1157
|
+
}),
|
|
1158
|
+
getDefaultOptions: (e) => ({
|
|
1159
|
+
onRowPinningChange: N("rowPinning", e)
|
|
1160
|
+
}),
|
|
1161
|
+
createRow: (e, o) => {
|
|
1162
|
+
e.pin = (t, n, r) => {
|
|
1163
|
+
const l = n ? e.getLeafRows().map((u) => {
|
|
1164
|
+
let {
|
|
1165
|
+
id: d
|
|
1166
|
+
} = u;
|
|
1167
|
+
return d;
|
|
1168
|
+
}) : [], i = r ? e.getParentRows().map((u) => {
|
|
1169
|
+
let {
|
|
1170
|
+
id: d
|
|
1171
|
+
} = u;
|
|
1172
|
+
return d;
|
|
1173
|
+
}) : [], a = /* @__PURE__ */ new Set([...i, e.id, ...l]);
|
|
1174
|
+
o.setRowPinning((u) => {
|
|
1175
|
+
var d, f;
|
|
1176
|
+
if (t === "bottom") {
|
|
1177
|
+
var p, g;
|
|
1178
|
+
return {
|
|
1179
|
+
top: ((p = u?.top) != null ? p : []).filter((h) => !(a != null && a.has(h))),
|
|
1180
|
+
bottom: [...((g = u?.bottom) != null ? g : []).filter((h) => !(a != null && a.has(h))), ...Array.from(a)]
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
if (t === "top") {
|
|
1184
|
+
var s, m;
|
|
1185
|
+
return {
|
|
1186
|
+
top: [...((s = u?.top) != null ? s : []).filter((h) => !(a != null && a.has(h))), ...Array.from(a)],
|
|
1187
|
+
bottom: ((m = u?.bottom) != null ? m : []).filter((h) => !(a != null && a.has(h)))
|
|
1188
|
+
};
|
|
1189
|
+
}
|
|
1190
|
+
return {
|
|
1191
|
+
top: ((d = u?.top) != null ? d : []).filter((h) => !(a != null && a.has(h))),
|
|
1192
|
+
bottom: ((f = u?.bottom) != null ? f : []).filter((h) => !(a != null && a.has(h)))
|
|
1193
|
+
};
|
|
1194
|
+
});
|
|
1195
|
+
}, e.getCanPin = () => {
|
|
1196
|
+
var t;
|
|
1197
|
+
const {
|
|
1198
|
+
enableRowPinning: n,
|
|
1199
|
+
enablePinning: r
|
|
1200
|
+
} = o.options;
|
|
1201
|
+
return typeof n == "function" ? n(e) : (t = n ?? r) != null ? t : !0;
|
|
1202
|
+
}, e.getIsPinned = () => {
|
|
1203
|
+
const t = [e.id], {
|
|
1204
|
+
top: n,
|
|
1205
|
+
bottom: r
|
|
1206
|
+
} = o.getState().rowPinning, l = t.some((a) => n?.includes(a)), i = t.some((a) => r?.includes(a));
|
|
1207
|
+
return l ? "top" : i ? "bottom" : !1;
|
|
1208
|
+
}, e.getPinnedIndex = () => {
|
|
1209
|
+
var t, n;
|
|
1210
|
+
const r = e.getIsPinned();
|
|
1211
|
+
if (!r) return -1;
|
|
1212
|
+
const l = (t = r === "top" ? o.getTopRows() : o.getBottomRows()) == null ? void 0 : t.map((i) => {
|
|
1213
|
+
let {
|
|
1214
|
+
id: a
|
|
1215
|
+
} = i;
|
|
1216
|
+
return a;
|
|
1217
|
+
});
|
|
1218
|
+
return (n = l?.indexOf(e.id)) != null ? n : -1;
|
|
1219
|
+
};
|
|
1220
|
+
},
|
|
1221
|
+
createTable: (e) => {
|
|
1222
|
+
e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
|
|
1223
|
+
var t, n;
|
|
1224
|
+
return e.setRowPinning(o ? ne() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : ne());
|
|
1225
|
+
}, e.getIsSomeRowsPinned = (o) => {
|
|
1226
|
+
var t;
|
|
1227
|
+
const n = e.getState().rowPinning;
|
|
1228
|
+
if (!o) {
|
|
1229
|
+
var r, l;
|
|
1230
|
+
return !!((r = n.top) != null && r.length || (l = n.bottom) != null && l.length);
|
|
1231
|
+
}
|
|
1232
|
+
return !!((t = n[o]) != null && t.length);
|
|
1233
|
+
}, e._getPinnedRows = (o, t, n) => {
|
|
1234
|
+
var r;
|
|
1235
|
+
return ((r = e.options.keepPinnedRows) == null || r ? (
|
|
1236
|
+
//get all rows that are pinned even if they would not be otherwise visible
|
|
1237
|
+
//account for expanded parent rows, but not pagination or filtering
|
|
1238
|
+
(t ?? []).map((i) => {
|
|
1239
|
+
const a = e.getRow(i, !0);
|
|
1240
|
+
return a.getIsAllParentsExpanded() ? a : null;
|
|
1241
|
+
})
|
|
1242
|
+
) : (
|
|
1243
|
+
//else get only visible rows that are pinned
|
|
1244
|
+
(t ?? []).map((i) => o.find((a) => a.id === i))
|
|
1245
|
+
)).filter(Boolean).map((i) => ({
|
|
1246
|
+
...i,
|
|
1247
|
+
position: n
|
|
1248
|
+
}));
|
|
1249
|
+
}, e.getTopRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.top], (o, t) => e._getPinnedRows(o, t, "top"), w(e.options, "debugRows", "getTopRows")), e.getBottomRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (o, t) => e._getPinnedRows(o, t, "bottom"), w(e.options, "debugRows", "getBottomRows")), e.getCenterRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (o, t, n) => {
|
|
1250
|
+
const r = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
|
|
1251
|
+
return o.filter((l) => !r.has(l.id));
|
|
1252
|
+
}, w(e.options, "debugRows", "getCenterRows"));
|
|
1253
|
+
}
|
|
1254
|
+
}, Lt = {
|
|
1255
|
+
getInitialState: (e) => ({
|
|
1256
|
+
rowSelection: {},
|
|
1257
|
+
...e
|
|
1258
|
+
}),
|
|
1259
|
+
getDefaultOptions: (e) => ({
|
|
1260
|
+
onRowSelectionChange: N("rowSelection", e),
|
|
1261
|
+
enableRowSelection: !0,
|
|
1262
|
+
enableMultiRowSelection: !0,
|
|
1263
|
+
enableSubRowSelection: !0
|
|
1264
|
+
// enableGroupingRowSelection: false,
|
|
1265
|
+
// isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,
|
|
1266
|
+
// isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
|
|
1267
|
+
}),
|
|
1268
|
+
createTable: (e) => {
|
|
1269
|
+
e.setRowSelection = (o) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(o), e.resetRowSelection = (o) => {
|
|
1270
|
+
var t;
|
|
1271
|
+
return e.setRowSelection(o ? {} : (t = e.initialState.rowSelection) != null ? t : {});
|
|
1272
|
+
}, e.toggleAllRowsSelected = (o) => {
|
|
1273
|
+
e.setRowSelection((t) => {
|
|
1274
|
+
o = typeof o < "u" ? o : !e.getIsAllRowsSelected();
|
|
1275
|
+
const n = {
|
|
1276
|
+
...t
|
|
1277
|
+
}, r = e.getPreGroupedRowModel().flatRows;
|
|
1278
|
+
return o ? r.forEach((l) => {
|
|
1279
|
+
l.getCanSelect() && (n[l.id] = !0);
|
|
1280
|
+
}) : r.forEach((l) => {
|
|
1281
|
+
delete n[l.id];
|
|
1282
|
+
}), n;
|
|
1283
|
+
});
|
|
1284
|
+
}, e.toggleAllPageRowsSelected = (o) => e.setRowSelection((t) => {
|
|
1285
|
+
const n = typeof o < "u" ? o : !e.getIsAllPageRowsSelected(), r = {
|
|
1286
|
+
...t
|
|
1287
|
+
};
|
|
1288
|
+
return e.getRowModel().rows.forEach((l) => {
|
|
1289
|
+
ie(r, l.id, n, !0, e);
|
|
1290
|
+
}), r;
|
|
1291
|
+
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = S(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? oe(e, t) : {
|
|
1292
|
+
rows: [],
|
|
1293
|
+
flatRows: [],
|
|
1294
|
+
rowsById: {}
|
|
1295
|
+
}, w(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = S(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? oe(e, t) : {
|
|
1296
|
+
rows: [],
|
|
1297
|
+
flatRows: [],
|
|
1298
|
+
rowsById: {}
|
|
1299
|
+
}, w(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = S(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? oe(e, t) : {
|
|
1300
|
+
rows: [],
|
|
1301
|
+
flatRows: [],
|
|
1302
|
+
rowsById: {}
|
|
1303
|
+
}, w(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
|
|
1304
|
+
const o = e.getFilteredRowModel().flatRows, {
|
|
1305
|
+
rowSelection: t
|
|
1306
|
+
} = e.getState();
|
|
1307
|
+
let n = !!(o.length && Object.keys(t).length);
|
|
1308
|
+
return n && o.some((r) => r.getCanSelect() && !t[r.id]) && (n = !1), n;
|
|
1309
|
+
}, e.getIsAllPageRowsSelected = () => {
|
|
1310
|
+
const o = e.getPaginationRowModel().flatRows.filter((r) => r.getCanSelect()), {
|
|
1311
|
+
rowSelection: t
|
|
1312
|
+
} = e.getState();
|
|
1313
|
+
let n = !!o.length;
|
|
1314
|
+
return n && o.some((r) => !t[r.id]) && (n = !1), n;
|
|
1315
|
+
}, e.getIsSomeRowsSelected = () => {
|
|
1316
|
+
var o;
|
|
1317
|
+
const t = Object.keys((o = e.getState().rowSelection) != null ? o : {}).length;
|
|
1318
|
+
return t > 0 && t < e.getFilteredRowModel().flatRows.length;
|
|
1319
|
+
}, e.getIsSomePageRowsSelected = () => {
|
|
1320
|
+
const o = e.getPaginationRowModel().flatRows;
|
|
1321
|
+
return e.getIsAllPageRowsSelected() ? !1 : o.filter((t) => t.getCanSelect()).some((t) => t.getIsSelected() || t.getIsSomeSelected());
|
|
1322
|
+
}, e.getToggleAllRowsSelectedHandler = () => (o) => {
|
|
1323
|
+
e.toggleAllRowsSelected(o.target.checked);
|
|
1324
|
+
}, e.getToggleAllPageRowsSelectedHandler = () => (o) => {
|
|
1325
|
+
e.toggleAllPageRowsSelected(o.target.checked);
|
|
1326
|
+
};
|
|
1327
|
+
},
|
|
1328
|
+
createRow: (e, o) => {
|
|
1329
|
+
e.toggleSelected = (t, n) => {
|
|
1330
|
+
const r = e.getIsSelected();
|
|
1331
|
+
o.setRowSelection((l) => {
|
|
1332
|
+
var i;
|
|
1333
|
+
if (t = typeof t < "u" ? t : !r, e.getCanSelect() && r === t)
|
|
1334
|
+
return l;
|
|
1335
|
+
const a = {
|
|
1336
|
+
...l
|
|
1337
|
+
};
|
|
1338
|
+
return ie(a, e.id, t, (i = n?.selectChildren) != null ? i : !0, o), a;
|
|
1339
|
+
});
|
|
1340
|
+
}, e.getIsSelected = () => {
|
|
1341
|
+
const {
|
|
1342
|
+
rowSelection: t
|
|
1343
|
+
} = o.getState();
|
|
1344
|
+
return fe(e, t);
|
|
1345
|
+
}, e.getIsSomeSelected = () => {
|
|
1346
|
+
const {
|
|
1347
|
+
rowSelection: t
|
|
1348
|
+
} = o.getState();
|
|
1349
|
+
return se(e, t) === "some";
|
|
1350
|
+
}, e.getIsAllSubRowsSelected = () => {
|
|
1351
|
+
const {
|
|
1352
|
+
rowSelection: t
|
|
1353
|
+
} = o.getState();
|
|
1354
|
+
return se(e, t) === "all";
|
|
1355
|
+
}, e.getCanSelect = () => {
|
|
1356
|
+
var t;
|
|
1357
|
+
return typeof o.options.enableRowSelection == "function" ? o.options.enableRowSelection(e) : (t = o.options.enableRowSelection) != null ? t : !0;
|
|
1358
|
+
}, e.getCanSelectSubRows = () => {
|
|
1359
|
+
var t;
|
|
1360
|
+
return typeof o.options.enableSubRowSelection == "function" ? o.options.enableSubRowSelection(e) : (t = o.options.enableSubRowSelection) != null ? t : !0;
|
|
1361
|
+
}, e.getCanMultiSelect = () => {
|
|
1362
|
+
var t;
|
|
1363
|
+
return typeof o.options.enableMultiRowSelection == "function" ? o.options.enableMultiRowSelection(e) : (t = o.options.enableMultiRowSelection) != null ? t : !0;
|
|
1364
|
+
}, e.getToggleSelectedHandler = () => {
|
|
1365
|
+
const t = e.getCanSelect();
|
|
1366
|
+
return (n) => {
|
|
1367
|
+
var r;
|
|
1368
|
+
t && e.toggleSelected((r = n.target) == null ? void 0 : r.checked);
|
|
1369
|
+
};
|
|
1370
|
+
};
|
|
1371
|
+
}
|
|
1372
|
+
}, ie = (e, o, t, n, r) => {
|
|
1373
|
+
var l;
|
|
1374
|
+
const i = r.getRow(o, !0);
|
|
1375
|
+
t ? (i.getCanMultiSelect() || Object.keys(e).forEach((a) => delete e[a]), i.getCanSelect() && (e[o] = !0)) : delete e[o], n && (l = i.subRows) != null && l.length && i.getCanSelectSubRows() && i.subRows.forEach((a) => ie(e, a.id, t, n, r));
|
|
1376
|
+
};
|
|
1377
|
+
function oe(e, o) {
|
|
1378
|
+
const t = e.getState().rowSelection, n = [], r = {}, l = function(i, a) {
|
|
1379
|
+
return i.map((u) => {
|
|
1380
|
+
var d;
|
|
1381
|
+
const f = fe(u, t);
|
|
1382
|
+
if (f && (n.push(u), r[u.id] = u), (d = u.subRows) != null && d.length && (u = {
|
|
1383
|
+
...u,
|
|
1384
|
+
subRows: l(u.subRows)
|
|
1385
|
+
}), f)
|
|
1386
|
+
return u;
|
|
1387
|
+
}).filter(Boolean);
|
|
1388
|
+
};
|
|
1389
|
+
return {
|
|
1390
|
+
rows: l(o.rows),
|
|
1391
|
+
flatRows: n,
|
|
1392
|
+
rowsById: r
|
|
1393
|
+
};
|
|
1394
|
+
}
|
|
1395
|
+
function fe(e, o) {
|
|
1396
|
+
var t;
|
|
1397
|
+
return (t = o[e.id]) != null ? t : !1;
|
|
1398
|
+
}
|
|
1399
|
+
function se(e, o, t) {
|
|
1400
|
+
var n;
|
|
1401
|
+
if (!((n = e.subRows) != null && n.length)) return !1;
|
|
1402
|
+
let r = !0, l = !1;
|
|
1403
|
+
return e.subRows.forEach((i) => {
|
|
1404
|
+
if (!(l && !r) && (i.getCanSelect() && (fe(i, o) ? l = !0 : r = !1), i.subRows && i.subRows.length)) {
|
|
1405
|
+
const a = se(i, o);
|
|
1406
|
+
a === "all" ? l = !0 : (a === "some" && (l = !0), r = !1);
|
|
1407
|
+
}
|
|
1408
|
+
}), r ? "all" : l ? "some" : !1;
|
|
1409
|
+
}
|
|
1410
|
+
const ae = /([0-9]+)/gm, zt = (e, o, t) => Te(H(e.getValue(t)).toLowerCase(), H(o.getValue(t)).toLowerCase()), kt = (e, o, t) => Te(H(e.getValue(t)), H(o.getValue(t))), Ot = (e, o, t) => pe(H(e.getValue(t)).toLowerCase(), H(o.getValue(t)).toLowerCase()), Tt = (e, o, t) => pe(H(e.getValue(t)), H(o.getValue(t))), Bt = (e, o, t) => {
|
|
1411
|
+
const n = e.getValue(t), r = o.getValue(t);
|
|
1412
|
+
return n > r ? 1 : n < r ? -1 : 0;
|
|
1413
|
+
}, bt = (e, o, t) => pe(e.getValue(t), o.getValue(t));
|
|
1414
|
+
function pe(e, o) {
|
|
1415
|
+
return e === o ? 0 : e > o ? 1 : -1;
|
|
1416
|
+
}
|
|
1417
|
+
function H(e) {
|
|
1418
|
+
return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
|
|
1419
|
+
}
|
|
1420
|
+
function Te(e, o) {
|
|
1421
|
+
const t = e.split(ae).filter(Boolean), n = o.split(ae).filter(Boolean);
|
|
1422
|
+
for (; t.length && n.length; ) {
|
|
1423
|
+
const r = t.shift(), l = n.shift(), i = parseInt(r, 10), a = parseInt(l, 10), u = [i, a].sort();
|
|
1424
|
+
if (isNaN(u[0])) {
|
|
1425
|
+
if (r > l)
|
|
1426
|
+
return 1;
|
|
1427
|
+
if (l > r)
|
|
1428
|
+
return -1;
|
|
1429
|
+
continue;
|
|
1430
|
+
}
|
|
1431
|
+
if (isNaN(u[1]))
|
|
1432
|
+
return isNaN(i) ? -1 : 1;
|
|
1433
|
+
if (i > a)
|
|
1434
|
+
return 1;
|
|
1435
|
+
if (a > i)
|
|
1436
|
+
return -1;
|
|
1437
|
+
}
|
|
1438
|
+
return t.length - n.length;
|
|
1439
|
+
}
|
|
1440
|
+
const G = {
|
|
1441
|
+
alphanumeric: zt,
|
|
1442
|
+
alphanumericCaseSensitive: kt,
|
|
1443
|
+
text: Ot,
|
|
1444
|
+
textCaseSensitive: Tt,
|
|
1445
|
+
datetime: Bt,
|
|
1446
|
+
basic: bt
|
|
1447
|
+
}, qt = {
|
|
1448
|
+
getInitialState: (e) => ({
|
|
1449
|
+
sorting: [],
|
|
1450
|
+
...e
|
|
1451
|
+
}),
|
|
1452
|
+
getDefaultColumnDef: () => ({
|
|
1453
|
+
sortingFn: "auto",
|
|
1454
|
+
sortUndefined: 1
|
|
1455
|
+
}),
|
|
1456
|
+
getDefaultOptions: (e) => ({
|
|
1457
|
+
onSortingChange: N("sorting", e),
|
|
1458
|
+
isMultiSortEvent: (o) => o.shiftKey
|
|
1459
|
+
}),
|
|
1460
|
+
createColumn: (e, o) => {
|
|
1461
|
+
e.getAutoSortingFn = () => {
|
|
1462
|
+
const t = o.getFilteredRowModel().flatRows.slice(10);
|
|
1463
|
+
let n = !1;
|
|
1464
|
+
for (const r of t) {
|
|
1465
|
+
const l = r?.getValue(e.id);
|
|
1466
|
+
if (Object.prototype.toString.call(l) === "[object Date]")
|
|
1467
|
+
return G.datetime;
|
|
1468
|
+
if (typeof l == "string" && (n = !0, l.split(ae).length > 1))
|
|
1469
|
+
return G.alphanumeric;
|
|
1470
|
+
}
|
|
1471
|
+
return n ? G.text : G.basic;
|
|
1472
|
+
}, e.getAutoSortDir = () => {
|
|
1473
|
+
const t = o.getFilteredRowModel().flatRows[0];
|
|
1474
|
+
return typeof t?.getValue(e.id) == "string" ? "asc" : "desc";
|
|
1475
|
+
}, e.getSortingFn = () => {
|
|
1476
|
+
var t, n;
|
|
1477
|
+
if (!e)
|
|
1478
|
+
throw new Error();
|
|
1479
|
+
return Z(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : (t = (n = o.options.sortingFns) == null ? void 0 : n[e.columnDef.sortingFn]) != null ? t : G[e.columnDef.sortingFn];
|
|
1480
|
+
}, e.toggleSorting = (t, n) => {
|
|
1481
|
+
const r = e.getNextSortingOrder(), l = typeof t < "u" && t !== null;
|
|
1482
|
+
o.setSorting((i) => {
|
|
1483
|
+
const a = i?.find((s) => s.id === e.id), u = i?.findIndex((s) => s.id === e.id);
|
|
1484
|
+
let d = [], f, p = l ? t : r === "desc";
|
|
1485
|
+
if (i != null && i.length && e.getCanMultiSort() && n ? a ? f = "toggle" : f = "add" : i != null && i.length && u !== i.length - 1 ? f = "replace" : a ? f = "toggle" : f = "replace", f === "toggle" && (l || r || (f = "remove")), f === "add") {
|
|
1486
|
+
var g;
|
|
1487
|
+
d = [...i, {
|
|
1488
|
+
id: e.id,
|
|
1489
|
+
desc: p
|
|
1490
|
+
}], d.splice(0, d.length - ((g = o.options.maxMultiSortColCount) != null ? g : Number.MAX_SAFE_INTEGER));
|
|
1491
|
+
} else f === "toggle" ? d = i.map((s) => s.id === e.id ? {
|
|
1492
|
+
...s,
|
|
1493
|
+
desc: p
|
|
1494
|
+
} : s) : f === "remove" ? d = i.filter((s) => s.id !== e.id) : d = [{
|
|
1495
|
+
id: e.id,
|
|
1496
|
+
desc: p
|
|
1497
|
+
}];
|
|
1498
|
+
return d;
|
|
1499
|
+
});
|
|
1500
|
+
}, e.getFirstSortDir = () => {
|
|
1501
|
+
var t, n;
|
|
1502
|
+
return ((t = (n = e.columnDef.sortDescFirst) != null ? n : o.options.sortDescFirst) != null ? t : e.getAutoSortDir() === "desc") ? "desc" : "asc";
|
|
1503
|
+
}, e.getNextSortingOrder = (t) => {
|
|
1504
|
+
var n, r;
|
|
1505
|
+
const l = e.getFirstSortDir(), i = e.getIsSorted();
|
|
1506
|
+
return i ? i !== l && ((n = o.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
|
|
1507
|
+
(!(t && (r = o.options.enableMultiRemove) != null) || r) ? !1 : i === "desc" ? "asc" : "desc" : l;
|
|
1508
|
+
}, e.getCanSort = () => {
|
|
1509
|
+
var t, n;
|
|
1510
|
+
return ((t = e.columnDef.enableSorting) != null ? t : !0) && ((n = o.options.enableSorting) != null ? n : !0) && !!e.accessorFn;
|
|
1511
|
+
}, e.getCanMultiSort = () => {
|
|
1512
|
+
var t, n;
|
|
1513
|
+
return (t = (n = e.columnDef.enableMultiSort) != null ? n : o.options.enableMultiSort) != null ? t : !!e.accessorFn;
|
|
1514
|
+
}, e.getIsSorted = () => {
|
|
1515
|
+
var t;
|
|
1516
|
+
const n = (t = o.getState().sorting) == null ? void 0 : t.find((r) => r.id === e.id);
|
|
1517
|
+
return n ? n.desc ? "desc" : "asc" : !1;
|
|
1518
|
+
}, e.getSortIndex = () => {
|
|
1519
|
+
var t, n;
|
|
1520
|
+
return (t = (n = o.getState().sorting) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
|
|
1521
|
+
}, e.clearSorting = () => {
|
|
1522
|
+
o.setSorting((t) => t != null && t.length ? t.filter((n) => n.id !== e.id) : []);
|
|
1523
|
+
}, e.getToggleSortingHandler = () => {
|
|
1524
|
+
const t = e.getCanSort();
|
|
1525
|
+
return (n) => {
|
|
1526
|
+
t && (n.persist == null || n.persist(), e.toggleSorting == null || e.toggleSorting(void 0, e.getCanMultiSort() ? o.options.isMultiSortEvent == null ? void 0 : o.options.isMultiSortEvent(n) : !1));
|
|
1527
|
+
};
|
|
1528
|
+
};
|
|
1529
|
+
},
|
|
1530
|
+
createTable: (e) => {
|
|
1531
|
+
e.setSorting = (o) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(o), e.resetSorting = (o) => {
|
|
1532
|
+
var t, n;
|
|
1533
|
+
e.setSorting(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
|
|
1534
|
+
}, e.getPreSortedRowModel = () => e.getGroupedRowModel(), e.getSortedRowModel = () => (!e._getSortedRowModel && e.options.getSortedRowModel && (e._getSortedRowModel = e.options.getSortedRowModel(e)), e.options.manualSorting || !e._getSortedRowModel ? e.getPreSortedRowModel() : e._getSortedRowModel());
|
|
1535
|
+
}
|
|
1536
|
+
}, jt = [
|
|
1537
|
+
ct,
|
|
1538
|
+
Nt,
|
|
1539
|
+
$t,
|
|
1540
|
+
Vt,
|
|
1541
|
+
ft,
|
|
1542
|
+
pt,
|
|
1543
|
+
Dt,
|
|
1544
|
+
//depends on ColumnFaceting
|
|
1545
|
+
Et,
|
|
1546
|
+
//depends on ColumnFiltering
|
|
1547
|
+
qt,
|
|
1548
|
+
Ft,
|
|
1549
|
+
//depends on RowSorting
|
|
1550
|
+
At,
|
|
1551
|
+
Ht,
|
|
1552
|
+
Gt,
|
|
1553
|
+
Lt,
|
|
1554
|
+
Pt
|
|
1555
|
+
];
|
|
1556
|
+
function Ut(e) {
|
|
1557
|
+
var o, t;
|
|
1558
|
+
process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
|
|
1559
|
+
const n = [...jt, ...(o = e._features) != null ? o : []];
|
|
1560
|
+
let r = {
|
|
1561
|
+
_features: n
|
|
1562
|
+
};
|
|
1563
|
+
const l = r._features.reduce((g, s) => Object.assign(g, s.getDefaultOptions == null ? void 0 : s.getDefaultOptions(r)), {}), i = (g) => r.options.mergeOptions ? r.options.mergeOptions(l, g) : {
|
|
1564
|
+
...l,
|
|
1565
|
+
...g
|
|
1566
|
+
};
|
|
1567
|
+
let u = {
|
|
1568
|
+
...{},
|
|
1569
|
+
...(t = e.initialState) != null ? t : {}
|
|
1570
|
+
};
|
|
1571
|
+
r._features.forEach((g) => {
|
|
1572
|
+
var s;
|
|
1573
|
+
u = (s = g.getInitialState == null ? void 0 : g.getInitialState(u)) != null ? s : u;
|
|
1574
|
+
});
|
|
1575
|
+
const d = [];
|
|
1576
|
+
let f = !1;
|
|
1577
|
+
const p = {
|
|
1578
|
+
_features: n,
|
|
1579
|
+
options: {
|
|
1580
|
+
...l,
|
|
1581
|
+
...e
|
|
1582
|
+
},
|
|
1583
|
+
initialState: u,
|
|
1584
|
+
_queue: (g) => {
|
|
1585
|
+
d.push(g), f || (f = !0, Promise.resolve().then(() => {
|
|
1586
|
+
for (; d.length; )
|
|
1587
|
+
d.shift()();
|
|
1588
|
+
f = !1;
|
|
1589
|
+
}).catch((s) => setTimeout(() => {
|
|
1590
|
+
throw s;
|
|
1591
|
+
})));
|
|
1592
|
+
},
|
|
1593
|
+
reset: () => {
|
|
1594
|
+
r.setState(r.initialState);
|
|
1595
|
+
},
|
|
1596
|
+
setOptions: (g) => {
|
|
1597
|
+
const s = A(g, r.options);
|
|
1598
|
+
r.options = i(s);
|
|
1599
|
+
},
|
|
1600
|
+
getState: () => r.options.state,
|
|
1601
|
+
setState: (g) => {
|
|
1602
|
+
r.options.onStateChange == null || r.options.onStateChange(g);
|
|
1603
|
+
},
|
|
1604
|
+
_getRowId: (g, s, m) => {
|
|
1605
|
+
var h;
|
|
1606
|
+
return (h = r.options.getRowId == null ? void 0 : r.options.getRowId(g, s, m)) != null ? h : `${m ? [m.id, s].join(".") : s}`;
|
|
1607
|
+
},
|
|
1608
|
+
getCoreRowModel: () => (r._getCoreRowModel || (r._getCoreRowModel = r.options.getCoreRowModel(r)), r._getCoreRowModel()),
|
|
1609
|
+
// The final calls start at the bottom of the model,
|
|
1610
|
+
// expanded rows, which then work their way up
|
|
1611
|
+
getRowModel: () => r.getPaginationRowModel(),
|
|
1612
|
+
//in next version, we should just pass in the row model as the optional 2nd arg
|
|
1613
|
+
getRow: (g, s) => {
|
|
1614
|
+
let m = (s ? r.getPrePaginationRowModel() : r.getRowModel()).rowsById[g];
|
|
1615
|
+
if (!m && (m = r.getCoreRowModel().rowsById[g], !m))
|
|
1616
|
+
throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${g}`) : new Error();
|
|
1617
|
+
return m;
|
|
1618
|
+
},
|
|
1619
|
+
_getDefaultColumnDef: S(() => [r.options.defaultColumn], (g) => {
|
|
1620
|
+
var s;
|
|
1621
|
+
return g = (s = g) != null ? s : {}, {
|
|
1622
|
+
header: (m) => {
|
|
1623
|
+
const h = m.header.column.columnDef;
|
|
1624
|
+
return h.accessorKey ? h.accessorKey : h.accessorFn ? h.id : null;
|
|
1625
|
+
},
|
|
1626
|
+
// footer: props => props.header.column.id,
|
|
1627
|
+
cell: (m) => {
|
|
1628
|
+
var h, R;
|
|
1629
|
+
return (h = (R = m.renderValue()) == null || R.toString == null ? void 0 : R.toString()) != null ? h : null;
|
|
1630
|
+
},
|
|
1631
|
+
...r._features.reduce((m, h) => Object.assign(m, h.getDefaultColumnDef == null ? void 0 : h.getDefaultColumnDef()), {}),
|
|
1632
|
+
...g
|
|
1633
|
+
};
|
|
1634
|
+
}, w(e, "debugColumns", "_getDefaultColumnDef")),
|
|
1635
|
+
_getColumnDefs: () => r.options.columns,
|
|
1636
|
+
getAllColumns: S(() => [r._getColumnDefs()], (g) => {
|
|
1637
|
+
const s = function(m, h, R) {
|
|
1638
|
+
return R === void 0 && (R = 0), m.map((x) => {
|
|
1639
|
+
const $ = gt(r, x, R, h), V = x;
|
|
1640
|
+
return $.columns = V.columns ? s(V.columns, $, R + 1) : [], $;
|
|
1641
|
+
});
|
|
1642
|
+
};
|
|
1643
|
+
return s(g);
|
|
1644
|
+
}, w(e, "debugColumns", "getAllColumns")),
|
|
1645
|
+
getAllFlatColumns: S(() => [r.getAllColumns()], (g) => g.flatMap((s) => s.getFlatColumns()), w(e, "debugColumns", "getAllFlatColumns")),
|
|
1646
|
+
_getAllFlatColumnsById: S(() => [r.getAllFlatColumns()], (g) => g.reduce((s, m) => (s[m.id] = m, s), {}), w(e, "debugColumns", "getAllFlatColumnsById")),
|
|
1647
|
+
getAllLeafColumns: S(() => [r.getAllColumns(), r._getOrderColumnsFn()], (g, s) => {
|
|
1648
|
+
let m = g.flatMap((h) => h.getLeafColumns());
|
|
1649
|
+
return s(m);
|
|
1650
|
+
}, w(e, "debugColumns", "getAllLeafColumns")),
|
|
1651
|
+
getColumn: (g) => {
|
|
1652
|
+
const s = r._getAllFlatColumnsById()[g];
|
|
1653
|
+
return process.env.NODE_ENV !== "production" && !s && console.error(`[Table] Column with id '${g}' does not exist.`), s;
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
Object.assign(r, p);
|
|
1657
|
+
for (let g = 0; g < r._features.length; g++) {
|
|
1658
|
+
const s = r._features[g];
|
|
1659
|
+
s == null || s.createTable == null || s.createTable(r);
|
|
1660
|
+
}
|
|
1661
|
+
return r;
|
|
1662
|
+
}
|
|
1663
|
+
function Xt() {
|
|
1664
|
+
return (e) => S(() => [e.options.data], (o) => {
|
|
1665
|
+
const t = {
|
|
1666
|
+
rows: [],
|
|
1667
|
+
flatRows: [],
|
|
1668
|
+
rowsById: {}
|
|
1669
|
+
}, n = function(r, l, i) {
|
|
1670
|
+
l === void 0 && (l = 0);
|
|
1671
|
+
const a = [];
|
|
1672
|
+
for (let d = 0; d < r.length; d++) {
|
|
1673
|
+
const f = ge(e, e._getRowId(r[d], d, i), r[d], d, l, void 0, i?.id);
|
|
1674
|
+
if (t.flatRows.push(f), t.rowsById[f.id] = f, a.push(f), e.options.getSubRows) {
|
|
1675
|
+
var u;
|
|
1676
|
+
f.originalSubRows = e.options.getSubRows(r[d], d), (u = f.originalSubRows) != null && u.length && (f.subRows = n(f.originalSubRows, l + 1, f));
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
return a;
|
|
1680
|
+
};
|
|
1681
|
+
return t.rows = n(o), t;
|
|
1682
|
+
}, w(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
|
|
1683
|
+
}
|
|
1684
|
+
function Kt(e) {
|
|
1685
|
+
const o = [], t = (n) => {
|
|
1686
|
+
var r;
|
|
1687
|
+
o.push(n), (r = n.subRows) != null && r.length && n.getIsExpanded() && n.subRows.forEach(t);
|
|
1688
|
+
};
|
|
1689
|
+
return e.rows.forEach(t), {
|
|
1690
|
+
rows: o,
|
|
1691
|
+
flatRows: e.flatRows,
|
|
1692
|
+
rowsById: e.rowsById
|
|
1693
|
+
};
|
|
1694
|
+
}
|
|
1695
|
+
function Qt(e, o, t) {
|
|
1696
|
+
return t.options.filterFromLeafRows ? Zt(e, o, t) : Jt(e, o, t);
|
|
1697
|
+
}
|
|
1698
|
+
function Zt(e, o, t) {
|
|
1699
|
+
var n;
|
|
1700
|
+
const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, a = function(u, d) {
|
|
1701
|
+
d === void 0 && (d = 0);
|
|
1702
|
+
const f = [];
|
|
1703
|
+
for (let g = 0; g < u.length; g++) {
|
|
1704
|
+
var p;
|
|
1705
|
+
let s = u[g];
|
|
1706
|
+
const m = ge(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
|
|
1707
|
+
if (m.columnFilters = s.columnFilters, (p = s.subRows) != null && p.length && d < i) {
|
|
1708
|
+
if (m.subRows = a(s.subRows, d + 1), s = m, o(s) && !m.subRows.length) {
|
|
1709
|
+
f.push(s), l[s.id] = s, r.push(s);
|
|
1710
|
+
continue;
|
|
1711
|
+
}
|
|
1712
|
+
if (o(s) || m.subRows.length) {
|
|
1713
|
+
f.push(s), l[s.id] = s, r.push(s);
|
|
1714
|
+
continue;
|
|
1715
|
+
}
|
|
1716
|
+
} else
|
|
1717
|
+
s = m, o(s) && (f.push(s), l[s.id] = s, r.push(s));
|
|
1718
|
+
}
|
|
1719
|
+
return f;
|
|
1720
|
+
};
|
|
1721
|
+
return {
|
|
1722
|
+
rows: a(e),
|
|
1723
|
+
flatRows: r,
|
|
1724
|
+
rowsById: l
|
|
1725
|
+
};
|
|
1726
|
+
}
|
|
1727
|
+
function Jt(e, o, t) {
|
|
1728
|
+
var n;
|
|
1729
|
+
const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, a = function(u, d) {
|
|
1730
|
+
d === void 0 && (d = 0);
|
|
1731
|
+
const f = [];
|
|
1732
|
+
for (let g = 0; g < u.length; g++) {
|
|
1733
|
+
let s = u[g];
|
|
1734
|
+
if (o(s)) {
|
|
1735
|
+
var p;
|
|
1736
|
+
if ((p = s.subRows) != null && p.length && d < i) {
|
|
1737
|
+
const h = ge(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
|
|
1738
|
+
h.subRows = a(s.subRows, d + 1), s = h;
|
|
1739
|
+
}
|
|
1740
|
+
f.push(s), r.push(s), l[s.id] = s;
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
return f;
|
|
1744
|
+
};
|
|
1745
|
+
return {
|
|
1746
|
+
rows: a(e),
|
|
1747
|
+
flatRows: r,
|
|
1748
|
+
rowsById: l
|
|
1749
|
+
};
|
|
1750
|
+
}
|
|
1751
|
+
function Wt() {
|
|
1752
|
+
return (e) => S(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
|
|
1753
|
+
if (!o.rows.length || !(t != null && t.length) && !n) {
|
|
1754
|
+
for (let g = 0; g < o.flatRows.length; g++)
|
|
1755
|
+
o.flatRows[g].columnFilters = {}, o.flatRows[g].columnFiltersMeta = {};
|
|
1756
|
+
return o;
|
|
1757
|
+
}
|
|
1758
|
+
const r = [], l = [];
|
|
1759
|
+
(t ?? []).forEach((g) => {
|
|
1760
|
+
var s;
|
|
1761
|
+
const m = e.getColumn(g.id);
|
|
1762
|
+
if (!m)
|
|
1763
|
+
return;
|
|
1764
|
+
const h = m.getFilterFn();
|
|
1765
|
+
if (!h) {
|
|
1766
|
+
process.env.NODE_ENV !== "production" && console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${m.id}.`);
|
|
1767
|
+
return;
|
|
1768
|
+
}
|
|
1769
|
+
r.push({
|
|
1770
|
+
id: g.id,
|
|
1771
|
+
filterFn: h,
|
|
1772
|
+
resolvedValue: (s = h.resolveFilterValue == null ? void 0 : h.resolveFilterValue(g.value)) != null ? s : g.value
|
|
1773
|
+
});
|
|
1774
|
+
});
|
|
1775
|
+
const i = (t ?? []).map((g) => g.id), a = e.getGlobalFilterFn(), u = e.getAllLeafColumns().filter((g) => g.getCanGlobalFilter());
|
|
1776
|
+
n && a && u.length && (i.push("__global__"), u.forEach((g) => {
|
|
1777
|
+
var s;
|
|
1778
|
+
l.push({
|
|
1779
|
+
id: g.id,
|
|
1780
|
+
filterFn: a,
|
|
1781
|
+
resolvedValue: (s = a.resolveFilterValue == null ? void 0 : a.resolveFilterValue(n)) != null ? s : n
|
|
1782
|
+
});
|
|
1783
|
+
}));
|
|
1784
|
+
let d, f;
|
|
1785
|
+
for (let g = 0; g < o.flatRows.length; g++) {
|
|
1786
|
+
const s = o.flatRows[g];
|
|
1787
|
+
if (s.columnFilters = {}, r.length)
|
|
1788
|
+
for (let m = 0; m < r.length; m++) {
|
|
1789
|
+
d = r[m];
|
|
1790
|
+
const h = d.id;
|
|
1791
|
+
s.columnFilters[h] = d.filterFn(s, h, d.resolvedValue, (R) => {
|
|
1792
|
+
s.columnFiltersMeta[h] = R;
|
|
1793
|
+
});
|
|
1794
|
+
}
|
|
1795
|
+
if (l.length) {
|
|
1796
|
+
for (let m = 0; m < l.length; m++) {
|
|
1797
|
+
f = l[m];
|
|
1798
|
+
const h = f.id;
|
|
1799
|
+
if (f.filterFn(s, h, f.resolvedValue, (R) => {
|
|
1800
|
+
s.columnFiltersMeta[h] = R;
|
|
1801
|
+
})) {
|
|
1802
|
+
s.columnFilters.__global__ = !0;
|
|
1803
|
+
break;
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
s.columnFilters.__global__ !== !0 && (s.columnFilters.__global__ = !1);
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
const p = (g) => {
|
|
1810
|
+
for (let s = 0; s < i.length; s++)
|
|
1811
|
+
if (g.columnFilters[i[s]] === !1)
|
|
1812
|
+
return !1;
|
|
1813
|
+
return !0;
|
|
1814
|
+
};
|
|
1815
|
+
return Qt(o.rows, p, e);
|
|
1816
|
+
}, w(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
|
|
1817
|
+
}
|
|
1818
|
+
function Yt(e) {
|
|
1819
|
+
return (o) => S(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
|
|
1820
|
+
if (!n.rows.length)
|
|
1821
|
+
return n;
|
|
1822
|
+
const {
|
|
1823
|
+
pageSize: r,
|
|
1824
|
+
pageIndex: l
|
|
1825
|
+
} = t;
|
|
1826
|
+
let {
|
|
1827
|
+
rows: i,
|
|
1828
|
+
flatRows: a,
|
|
1829
|
+
rowsById: u
|
|
1830
|
+
} = n;
|
|
1831
|
+
const d = r * l, f = d + r;
|
|
1832
|
+
i = i.slice(d, f);
|
|
1833
|
+
let p;
|
|
1834
|
+
o.options.paginateExpandedRows ? p = {
|
|
1835
|
+
rows: i,
|
|
1836
|
+
flatRows: a,
|
|
1837
|
+
rowsById: u
|
|
1838
|
+
} : p = Kt({
|
|
1839
|
+
rows: i,
|
|
1840
|
+
flatRows: a,
|
|
1841
|
+
rowsById: u
|
|
1842
|
+
}), p.flatRows = [];
|
|
1843
|
+
const g = (s) => {
|
|
1844
|
+
p.flatRows.push(s), s.subRows.length && s.subRows.forEach(g);
|
|
1845
|
+
};
|
|
1846
|
+
return p.rows.forEach(g), p;
|
|
1847
|
+
}, w(o.options, "debugTable", "getPaginationRowModel"));
|
|
1848
|
+
}
|
|
1849
|
+
function en() {
|
|
1850
|
+
return (e) => S(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
|
|
1851
|
+
if (!t.rows.length || !(o != null && o.length))
|
|
1852
|
+
return t;
|
|
1853
|
+
const n = e.getState().sorting, r = [], l = n.filter((u) => {
|
|
1854
|
+
var d;
|
|
1855
|
+
return (d = e.getColumn(u.id)) == null ? void 0 : d.getCanSort();
|
|
1856
|
+
}), i = {};
|
|
1857
|
+
l.forEach((u) => {
|
|
1858
|
+
const d = e.getColumn(u.id);
|
|
1859
|
+
d && (i[u.id] = {
|
|
1860
|
+
sortUndefined: d.columnDef.sortUndefined,
|
|
1861
|
+
invertSorting: d.columnDef.invertSorting,
|
|
1862
|
+
sortingFn: d.getSortingFn()
|
|
1863
|
+
});
|
|
1864
|
+
});
|
|
1865
|
+
const a = (u) => {
|
|
1866
|
+
const d = u.map((f) => ({
|
|
1867
|
+
...f
|
|
1868
|
+
}));
|
|
1869
|
+
return d.sort((f, p) => {
|
|
1870
|
+
for (let s = 0; s < l.length; s += 1) {
|
|
1871
|
+
var g;
|
|
1872
|
+
const m = l[s], h = i[m.id], R = h.sortUndefined, x = (g = m?.desc) != null ? g : !1;
|
|
1873
|
+
let $ = 0;
|
|
1874
|
+
if (R) {
|
|
1875
|
+
const V = f.getValue(m.id), _ = p.getValue(m.id), v = V === void 0, M = _ === void 0;
|
|
1876
|
+
if (v || M) {
|
|
1877
|
+
if (R === "first") return v ? -1 : 1;
|
|
1878
|
+
if (R === "last") return v ? 1 : -1;
|
|
1879
|
+
$ = v && M ? 0 : v ? R : -R;
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
if ($ === 0 && ($ = h.sortingFn(f, p, m.id)), $ !== 0)
|
|
1883
|
+
return x && ($ *= -1), h.invertSorting && ($ *= -1), $;
|
|
1884
|
+
}
|
|
1885
|
+
return f.index - p.index;
|
|
1886
|
+
}), d.forEach((f) => {
|
|
1887
|
+
var p;
|
|
1888
|
+
r.push(f), (p = f.subRows) != null && p.length && (f.subRows = a(f.subRows));
|
|
1889
|
+
}), d;
|
|
1890
|
+
};
|
|
1891
|
+
return {
|
|
1892
|
+
rows: a(t.rows),
|
|
1893
|
+
flatRows: r,
|
|
1894
|
+
rowsById: t.rowsById
|
|
1895
|
+
};
|
|
1896
|
+
}, w(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
|
|
1897
|
+
}
|
|
1898
|
+
function ve(e, o) {
|
|
1899
|
+
return e ? tn(e) ? /* @__PURE__ */ F.createElement(e, o) : e : null;
|
|
1900
|
+
}
|
|
1901
|
+
function tn(e) {
|
|
1902
|
+
return nn(e) || typeof e == "function" || on(e);
|
|
1903
|
+
}
|
|
1904
|
+
function nn(e) {
|
|
1905
|
+
return typeof e == "function" && (() => {
|
|
1906
|
+
const o = Object.getPrototypeOf(e);
|
|
1907
|
+
return o.prototype && o.prototype.isReactComponent;
|
|
1908
|
+
})();
|
|
1909
|
+
}
|
|
1910
|
+
function on(e) {
|
|
1911
|
+
return typeof e == "object" && typeof e.$$typeof == "symbol" && ["react.memo", "react.forward_ref"].includes(e.$$typeof.description);
|
|
1912
|
+
}
|
|
1913
|
+
function rn(e) {
|
|
1914
|
+
const o = {
|
|
1915
|
+
state: {},
|
|
1916
|
+
// Dummy state
|
|
1917
|
+
onStateChange: () => {
|
|
1918
|
+
},
|
|
1919
|
+
// noop
|
|
1920
|
+
renderFallbackValue: null,
|
|
1921
|
+
...e
|
|
1922
|
+
}, [t] = F.useState(() => ({
|
|
1923
|
+
current: Ut(o)
|
|
1924
|
+
})), [n, r] = F.useState(() => t.current.initialState);
|
|
1925
|
+
return t.current.setOptions((l) => ({
|
|
1926
|
+
...l,
|
|
1927
|
+
...e,
|
|
1928
|
+
state: {
|
|
1929
|
+
...n,
|
|
1930
|
+
...e.state
|
|
1931
|
+
},
|
|
1932
|
+
// Similarly, we'll maintain both our internal state and any user-provided
|
|
1933
|
+
// state.
|
|
1934
|
+
onStateChange: (i) => {
|
|
1935
|
+
r(i), e.onStateChange == null || e.onStateChange(i);
|
|
1936
|
+
}
|
|
1937
|
+
})), t.current;
|
|
1938
|
+
}
|
|
1939
|
+
const Be = F.forwardRef(
|
|
1940
|
+
({ className: e, ...o }, t) => /* @__PURE__ */ c("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ c("table", { ref: t, className: y("w-full caption-bottom text-sm", e), ...o }) })
|
|
1941
|
+
);
|
|
1942
|
+
Be.displayName = "Table";
|
|
1943
|
+
const be = F.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ c("thead", { ref: t, className: y("[&_tr]:border-b", e), ...o }));
|
|
1944
|
+
be.displayName = "TableHeader";
|
|
1945
|
+
const qe = F.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ c("tbody", { ref: t, className: y("[&_tr:last-child]:border-0", e), ...o }));
|
|
1946
|
+
qe.displayName = "TableBody";
|
|
1947
|
+
const ln = F.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ c(
|
|
1948
|
+
"tfoot",
|
|
1949
|
+
{
|
|
1950
|
+
ref: t,
|
|
1951
|
+
className: y("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", e),
|
|
1952
|
+
...o
|
|
1953
|
+
}
|
|
1954
|
+
));
|
|
1955
|
+
ln.displayName = "TableFooter";
|
|
1956
|
+
const j = F.forwardRef(
|
|
1957
|
+
({ className: e, ...o }, t) => /* @__PURE__ */ c(
|
|
1958
|
+
"tr",
|
|
1959
|
+
{
|
|
1960
|
+
ref: t,
|
|
1961
|
+
className: y(
|
|
1962
|
+
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
1963
|
+
e
|
|
1964
|
+
),
|
|
1965
|
+
...o
|
|
1966
|
+
}
|
|
1967
|
+
)
|
|
1968
|
+
);
|
|
1969
|
+
j.displayName = "TableRow";
|
|
1970
|
+
const je = F.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ c(
|
|
1971
|
+
"th",
|
|
1972
|
+
{
|
|
1973
|
+
ref: t,
|
|
1974
|
+
className: y(
|
|
1975
|
+
"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
|
|
1976
|
+
e
|
|
1977
|
+
),
|
|
1978
|
+
...o
|
|
1979
|
+
}
|
|
1980
|
+
));
|
|
1981
|
+
je.displayName = "TableHead";
|
|
1982
|
+
const ue = F.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ c(
|
|
1983
|
+
"td",
|
|
1984
|
+
{
|
|
1985
|
+
ref: t,
|
|
1986
|
+
className: y("p-4 align-middle [&:has([role=checkbox])]:pr-0", e),
|
|
1987
|
+
...o
|
|
1988
|
+
}
|
|
1989
|
+
));
|
|
1990
|
+
ue.displayName = "TableCell";
|
|
1991
|
+
const sn = F.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ c("caption", { ref: t, className: y("mt-4 text-sm text-muted-foreground", e), ...o }));
|
|
1992
|
+
sn.displayName = "TableCaption";
|
|
1993
|
+
const an = [10, 20, 30, 40, 50];
|
|
1994
|
+
function Dn({
|
|
1995
|
+
columns: e,
|
|
1996
|
+
data: o,
|
|
1997
|
+
searchKey: t,
|
|
1998
|
+
searchPlaceholder: n = "Search...",
|
|
1999
|
+
showColumnToggle: r = !0,
|
|
2000
|
+
showPagination: l = !0,
|
|
2001
|
+
showRowSelection: i = !1,
|
|
2002
|
+
pageSize: a = 10,
|
|
2003
|
+
pageSizeOptions: u = an,
|
|
2004
|
+
onRowClick: d,
|
|
2005
|
+
className: f
|
|
2006
|
+
}) {
|
|
2007
|
+
const [p, g] = F.useState([]), [s, m] = F.useState([]), [h, R] = F.useState({}), [x, $] = F.useState({}), V = F.useMemo(() => i ? [
|
|
2008
|
+
{
|
|
2009
|
+
id: "select",
|
|
2010
|
+
header: ({ table: v }) => /* @__PURE__ */ c(
|
|
2011
|
+
X,
|
|
2012
|
+
{
|
|
2013
|
+
checked: v.getIsAllPageRowsSelected() || v.getIsSomePageRowsSelected() && "indeterminate",
|
|
2014
|
+
onCheckedChange: (M) => v.toggleAllPageRowsSelected(!!M),
|
|
2015
|
+
"aria-label": "Select all"
|
|
2016
|
+
}
|
|
2017
|
+
),
|
|
2018
|
+
cell: ({ row: v }) => /* @__PURE__ */ c(
|
|
2019
|
+
X,
|
|
2020
|
+
{
|
|
2021
|
+
checked: v.getIsSelected(),
|
|
2022
|
+
onCheckedChange: (M) => v.toggleSelected(!!M),
|
|
2023
|
+
"aria-label": "Select row"
|
|
2024
|
+
}
|
|
2025
|
+
),
|
|
2026
|
+
enableSorting: !1,
|
|
2027
|
+
enableHiding: !1
|
|
2028
|
+
},
|
|
2029
|
+
...e
|
|
2030
|
+
] : e, [e, i]), _ = rn({
|
|
2031
|
+
data: o,
|
|
2032
|
+
columns: V,
|
|
2033
|
+
onSortingChange: g,
|
|
2034
|
+
onColumnFiltersChange: m,
|
|
2035
|
+
getCoreRowModel: Xt(),
|
|
2036
|
+
getPaginationRowModel: Yt(),
|
|
2037
|
+
getSortedRowModel: en(),
|
|
2038
|
+
getFilteredRowModel: Wt(),
|
|
2039
|
+
onColumnVisibilityChange: R,
|
|
2040
|
+
onRowSelectionChange: $,
|
|
2041
|
+
initialState: {
|
|
2042
|
+
pagination: {
|
|
2043
|
+
pageSize: a
|
|
2044
|
+
}
|
|
2045
|
+
},
|
|
2046
|
+
state: {
|
|
2047
|
+
sorting: p,
|
|
2048
|
+
columnFilters: s,
|
|
2049
|
+
columnVisibility: h,
|
|
2050
|
+
rowSelection: x
|
|
2051
|
+
}
|
|
2052
|
+
});
|
|
2053
|
+
return /* @__PURE__ */ C("div", { className: y("w-full", f), children: [
|
|
2054
|
+
/* @__PURE__ */ C("div", { className: "flex items-center gap-4 py-4", children: [
|
|
2055
|
+
t && /* @__PURE__ */ c(
|
|
2056
|
+
Qe,
|
|
2057
|
+
{
|
|
2058
|
+
placeholder: n,
|
|
2059
|
+
value: _.getColumn(t)?.getFilterValue() ?? "",
|
|
2060
|
+
onChange: (v) => _.getColumn(t)?.setFilterValue(v.target.value),
|
|
2061
|
+
className: "max-w-sm"
|
|
2062
|
+
}
|
|
2063
|
+
),
|
|
2064
|
+
r && /* @__PURE__ */ C(z, { children: [
|
|
2065
|
+
/* @__PURE__ */ c(k, { asChild: !0, children: /* @__PURE__ */ C(I, { variant: "outline", className: "ml-auto", children: [
|
|
2066
|
+
"Columns ",
|
|
2067
|
+
/* @__PURE__ */ c(Pe, { className: "ml-2 h-4 w-4" })
|
|
2068
|
+
] }) }),
|
|
2069
|
+
/* @__PURE__ */ c(O, { align: "end", children: _.getAllColumns().filter((v) => v.getCanHide()).map((v) => /* @__PURE__ */ c(
|
|
2070
|
+
xe,
|
|
2071
|
+
{
|
|
2072
|
+
className: "capitalize",
|
|
2073
|
+
checked: v.getIsVisible(),
|
|
2074
|
+
onCheckedChange: (M) => v.toggleVisibility(!!M),
|
|
2075
|
+
children: v.id
|
|
2076
|
+
},
|
|
2077
|
+
v.id
|
|
2078
|
+
)) })
|
|
2079
|
+
] })
|
|
2080
|
+
] }),
|
|
2081
|
+
/* @__PURE__ */ c("div", { className: "rounded-md border", children: /* @__PURE__ */ C(Be, { children: [
|
|
2082
|
+
/* @__PURE__ */ c(be, { children: _.getHeaderGroups().map((v) => /* @__PURE__ */ c(j, { children: v.headers.map((M) => /* @__PURE__ */ c(je, { children: M.isPlaceholder ? null : ve(M.column.columnDef.header, M.getContext()) }, M.id)) }, v.id)) }),
|
|
2083
|
+
/* @__PURE__ */ c(qe, { children: _.getRowModel().rows?.length ? _.getRowModel().rows.map((v) => /* @__PURE__ */ c(
|
|
2084
|
+
j,
|
|
2085
|
+
{
|
|
2086
|
+
"data-state": v.getIsSelected() && "selected",
|
|
2087
|
+
onClick: () => d?.(v.original),
|
|
2088
|
+
className: d ? "cursor-pointer" : "",
|
|
2089
|
+
children: v.getVisibleCells().map((M) => /* @__PURE__ */ c(ue, { children: ve(M.column.columnDef.cell, M.getContext()) }, M.id))
|
|
2090
|
+
},
|
|
2091
|
+
v.id
|
|
2092
|
+
)) : /* @__PURE__ */ c(j, { children: /* @__PURE__ */ c(ue, { colSpan: V.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2093
|
+
] }) }),
|
|
2094
|
+
l && /* @__PURE__ */ C("div", { className: "flex items-center justify-between space-x-2 py-4", children: [
|
|
2095
|
+
/* @__PURE__ */ c("div", { className: "flex-1 text-sm text-muted-foreground", children: i && /* @__PURE__ */ C(Q, { children: [
|
|
2096
|
+
_.getFilteredSelectedRowModel().rows.length,
|
|
2097
|
+
" of",
|
|
2098
|
+
" ",
|
|
2099
|
+
_.getFilteredRowModel().rows.length,
|
|
2100
|
+
" row(s) selected."
|
|
2101
|
+
] }) }),
|
|
2102
|
+
/* @__PURE__ */ C("div", { className: "flex items-center space-x-6 lg:space-x-8", children: [
|
|
2103
|
+
/* @__PURE__ */ C("div", { className: "flex items-center space-x-2", children: [
|
|
2104
|
+
/* @__PURE__ */ c("p", { className: "text-sm font-medium", children: "Rows per page" }),
|
|
2105
|
+
/* @__PURE__ */ C(
|
|
2106
|
+
Fe,
|
|
2107
|
+
{
|
|
2108
|
+
value: `${_.getState().pagination.pageSize}`,
|
|
2109
|
+
onValueChange: (v) => {
|
|
2110
|
+
_.setPageSize(Number(v));
|
|
2111
|
+
},
|
|
2112
|
+
children: [
|
|
2113
|
+
/* @__PURE__ */ c(ye, { size: "sm", width: "sm", children: /* @__PURE__ */ c($e, { placeholder: _.getState().pagination.pageSize }) }),
|
|
2114
|
+
/* @__PURE__ */ c(Ve, { side: "top", children: u.map((v) => /* @__PURE__ */ c(Me, { value: `${v}`, children: v }, v)) })
|
|
2115
|
+
]
|
|
2116
|
+
}
|
|
2117
|
+
)
|
|
2118
|
+
] }),
|
|
2119
|
+
/* @__PURE__ */ C("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
|
|
2120
|
+
"Page ",
|
|
2121
|
+
_.getState().pagination.pageIndex + 1,
|
|
2122
|
+
" of ",
|
|
2123
|
+
_.getPageCount()
|
|
2124
|
+
] }),
|
|
2125
|
+
/* @__PURE__ */ C("div", { className: "flex items-center space-x-2", children: [
|
|
2126
|
+
/* @__PURE__ */ c(
|
|
2127
|
+
I,
|
|
2128
|
+
{
|
|
2129
|
+
variant: "outline",
|
|
2130
|
+
size: "sm",
|
|
2131
|
+
onClick: () => _.previousPage(),
|
|
2132
|
+
disabled: !_.getCanPreviousPage(),
|
|
2133
|
+
children: "Previous"
|
|
2134
|
+
}
|
|
2135
|
+
),
|
|
2136
|
+
/* @__PURE__ */ c(
|
|
2137
|
+
I,
|
|
2138
|
+
{
|
|
2139
|
+
variant: "outline",
|
|
2140
|
+
size: "sm",
|
|
2141
|
+
onClick: () => _.nextPage(),
|
|
2142
|
+
disabled: !_.getCanNextPage(),
|
|
2143
|
+
children: "Next"
|
|
2144
|
+
}
|
|
2145
|
+
)
|
|
2146
|
+
] })
|
|
2147
|
+
] })
|
|
2148
|
+
] })
|
|
2149
|
+
] });
|
|
2150
|
+
}
|
|
2151
|
+
function En(e) {
|
|
2152
|
+
return ({ column: o }) => /* @__PURE__ */ C(
|
|
2153
|
+
I,
|
|
2154
|
+
{
|
|
2155
|
+
variant: "ghost",
|
|
2156
|
+
onClick: () => o.toggleSorting(o.getIsSorted() === "asc"),
|
|
2157
|
+
children: [
|
|
2158
|
+
e,
|
|
2159
|
+
/* @__PURE__ */ c(ot, { className: "ml-2 h-4 w-4" })
|
|
2160
|
+
]
|
|
2161
|
+
}
|
|
2162
|
+
);
|
|
2163
|
+
}
|
|
2164
|
+
function An(e) {
|
|
2165
|
+
return ({ row: o }) => /* @__PURE__ */ C(z, { children: [
|
|
2166
|
+
/* @__PURE__ */ c(k, { asChild: !0, children: /* @__PURE__ */ C(I, { variant: "ghost", className: "h-8 w-8 p-0", children: [
|
|
2167
|
+
/* @__PURE__ */ c("span", { className: "sr-only", children: "Open menu" }),
|
|
2168
|
+
/* @__PURE__ */ c(Ie, { className: "h-4 w-4" })
|
|
2169
|
+
] }) }),
|
|
2170
|
+
/* @__PURE__ */ C(O, { align: "end", children: [
|
|
2171
|
+
/* @__PURE__ */ c(de, { children: "Actions" }),
|
|
2172
|
+
/* @__PURE__ */ c(K, {}),
|
|
2173
|
+
e.map((t, n) => /* @__PURE__ */ C(_e, { onClick: () => t.onClick(o.original), children: [
|
|
2174
|
+
t.icon && /* @__PURE__ */ c("span", { className: "mr-2", children: t.icon }),
|
|
2175
|
+
t.label
|
|
2176
|
+
] }, n))
|
|
2177
|
+
] })
|
|
2178
|
+
] });
|
|
2179
|
+
}
|
|
2180
|
+
const un = F.forwardRef(
|
|
2181
|
+
({ className: e, title: o, value: t, description: n, trend: r, icon: l, loading: i = !1, ...a }, u) => {
|
|
2182
|
+
const d = r?.direction || (r?.value && r.value > 0 ? "up" : r?.value && r.value < 0 ? "down" : "neutral"), f = d === "up" ? We : d === "down" ? st : Ye, p = d === "up" ? "text-success" : d === "down" ? "text-destructive" : "text-muted-foreground";
|
|
2183
|
+
return /* @__PURE__ */ C(Ne, { ref: u, className: y("", e), ...a, children: [
|
|
2184
|
+
/* @__PURE__ */ C(Ze, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
2185
|
+
/* @__PURE__ */ c(Je, { className: "text-sm font-medium", children: o }),
|
|
2186
|
+
l && /* @__PURE__ */ c("div", { className: "text-muted-foreground", children: l })
|
|
2187
|
+
] }),
|
|
2188
|
+
/* @__PURE__ */ c(De, { children: i ? /* @__PURE__ */ C("div", { className: "space-y-2", children: [
|
|
2189
|
+
/* @__PURE__ */ c("div", { className: "h-8 w-24 animate-pulse rounded bg-muted" }),
|
|
2190
|
+
/* @__PURE__ */ c("div", { className: "h-4 w-32 animate-pulse rounded bg-muted" })
|
|
2191
|
+
] }) : /* @__PURE__ */ C(Q, { children: [
|
|
2192
|
+
/* @__PURE__ */ c("div", { className: "text-2xl font-bold", children: t }),
|
|
2193
|
+
(n || r) && /* @__PURE__ */ C("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
2194
|
+
r && /* @__PURE__ */ C("span", { className: y("flex items-center gap-1", p), children: [
|
|
2195
|
+
/* @__PURE__ */ c(f, { className: "h-3 w-3" }),
|
|
2196
|
+
Math.abs(r.value),
|
|
2197
|
+
"%",
|
|
2198
|
+
r.label && /* @__PURE__ */ c("span", { children: r.label })
|
|
2199
|
+
] }),
|
|
2200
|
+
n && /* @__PURE__ */ c("span", { children: n })
|
|
2201
|
+
] })
|
|
2202
|
+
] }) })
|
|
2203
|
+
] });
|
|
2204
|
+
}
|
|
2205
|
+
);
|
|
2206
|
+
un.displayName = "KPICard";
|
|
2207
|
+
const dn = F.forwardRef(
|
|
2208
|
+
({ className: e, title: o, value: t, subtitle: n, icon: r, iconBackground: l = "bg-primary/10", loading: i = !1, ...a }, u) => /* @__PURE__ */ c(Ne, { ref: u, className: y("", e), ...a, children: /* @__PURE__ */ C(De, { className: "flex items-center gap-4 p-6", children: [
|
|
2209
|
+
r && /* @__PURE__ */ c("div", { className: y("flex h-12 w-12 items-center justify-center rounded-full", l), children: r }),
|
|
2210
|
+
/* @__PURE__ */ c("div", { className: "flex-1", children: i ? /* @__PURE__ */ C("div", { className: "space-y-2", children: [
|
|
2211
|
+
/* @__PURE__ */ c("div", { className: "h-4 w-20 animate-pulse rounded bg-muted" }),
|
|
2212
|
+
/* @__PURE__ */ c("div", { className: "h-6 w-16 animate-pulse rounded bg-muted" })
|
|
2213
|
+
] }) : /* @__PURE__ */ C(Q, { children: [
|
|
2214
|
+
/* @__PURE__ */ c("p", { className: "text-sm font-medium text-muted-foreground", children: o }),
|
|
2215
|
+
/* @__PURE__ */ c("p", { className: "text-2xl font-bold", children: t }),
|
|
2216
|
+
n && /* @__PURE__ */ c("p", { className: "text-xs text-muted-foreground", children: n })
|
|
2217
|
+
] }) })
|
|
2218
|
+
] }) })
|
|
2219
|
+
);
|
|
2220
|
+
dn.displayName = "StatCard";
|
|
2221
|
+
const gn = F.forwardRef(
|
|
2222
|
+
({ className: e, icon: o, title: t, description: n, action: r, ...l }, i) => /* @__PURE__ */ C(
|
|
2223
|
+
"div",
|
|
2224
|
+
{
|
|
2225
|
+
ref: i,
|
|
2226
|
+
className: y(
|
|
2227
|
+
"flex min-h-[400px] flex-col items-center justify-center rounded-lg border border-dashed p-8 text-center",
|
|
2228
|
+
e
|
|
2229
|
+
),
|
|
2230
|
+
...l,
|
|
2231
|
+
children: [
|
|
2232
|
+
o && /* @__PURE__ */ c("div", { className: "mb-4 flex h-20 w-20 items-center justify-center rounded-full bg-muted", children: o }),
|
|
2233
|
+
/* @__PURE__ */ c("h3", { className: "mb-2 text-lg font-semibold", children: t }),
|
|
2234
|
+
n && /* @__PURE__ */ c("p", { className: "mb-6 max-w-sm text-sm text-muted-foreground", children: n }),
|
|
2235
|
+
r && /* @__PURE__ */ c("div", { children: r })
|
|
2236
|
+
]
|
|
2237
|
+
}
|
|
2238
|
+
)
|
|
2239
|
+
);
|
|
2240
|
+
gn.displayName = "EmptyState";
|
|
2241
|
+
const cn = F.forwardRef(
|
|
2242
|
+
({ className: e, items: o, ...t }, n) => /* @__PURE__ */ c("div", { ref: n, className: y("relative space-y-0", e), ...t, children: o.map((r, l) => /* @__PURE__ */ C("div", { className: "relative pb-8 last:pb-0", children: [
|
|
2243
|
+
l !== o.length - 1 && /* @__PURE__ */ c(
|
|
2244
|
+
"span",
|
|
2245
|
+
{
|
|
2246
|
+
className: "absolute left-4 top-4 -ml-px h-full w-0.5 bg-border",
|
|
2247
|
+
"aria-hidden": "true"
|
|
2248
|
+
}
|
|
2249
|
+
),
|
|
2250
|
+
/* @__PURE__ */ C("div", { className: "relative flex items-start space-x-4", children: [
|
|
2251
|
+
/* @__PURE__ */ c(
|
|
2252
|
+
"div",
|
|
2253
|
+
{
|
|
2254
|
+
className: y(
|
|
2255
|
+
"relative flex h-8 w-8 items-center justify-center rounded-full border-2",
|
|
2256
|
+
r.status === "completed" && "border-primary bg-primary text-primary-foreground",
|
|
2257
|
+
r.status === "current" && "border-primary bg-background",
|
|
2258
|
+
r.status === "upcoming" && "border-muted bg-background",
|
|
2259
|
+
!r.status && "border-muted bg-background"
|
|
2260
|
+
),
|
|
2261
|
+
children: r.icon || /* @__PURE__ */ c(
|
|
2262
|
+
"div",
|
|
2263
|
+
{
|
|
2264
|
+
className: y(
|
|
2265
|
+
"h-2.5 w-2.5 rounded-full",
|
|
2266
|
+
r.status === "completed" && "bg-primary-foreground",
|
|
2267
|
+
r.status === "current" && "bg-primary",
|
|
2268
|
+
r.status === "upcoming" && "bg-muted-foreground",
|
|
2269
|
+
!r.status && "bg-muted-foreground"
|
|
2270
|
+
)
|
|
2271
|
+
}
|
|
2272
|
+
)
|
|
2273
|
+
}
|
|
2274
|
+
),
|
|
2275
|
+
/* @__PURE__ */ C("div", { className: "min-w-0 flex-1 pt-1", children: [
|
|
2276
|
+
/* @__PURE__ */ C("div", { className: "flex items-center justify-between", children: [
|
|
2277
|
+
/* @__PURE__ */ c(
|
|
2278
|
+
"p",
|
|
2279
|
+
{
|
|
2280
|
+
className: y(
|
|
2281
|
+
"text-sm font-medium",
|
|
2282
|
+
r.status === "upcoming" && "text-muted-foreground"
|
|
2283
|
+
),
|
|
2284
|
+
children: r.title
|
|
2285
|
+
}
|
|
2286
|
+
),
|
|
2287
|
+
r.date && /* @__PURE__ */ c("time", { className: "text-xs text-muted-foreground", children: r.date })
|
|
2288
|
+
] }),
|
|
2289
|
+
r.description && /* @__PURE__ */ c("p", { className: "mt-1 text-sm text-muted-foreground", children: r.description })
|
|
2290
|
+
] })
|
|
2291
|
+
] })
|
|
2292
|
+
] }, r.id)) })
|
|
2293
|
+
);
|
|
2294
|
+
cn.displayName = "Timeline";
|
|
2295
|
+
const fn = F.forwardRef(
|
|
2296
|
+
({ className: e, items: o, showAvatar: t = !0, ...n }, r) => /* @__PURE__ */ c("div", { ref: r, className: y("space-y-4", e), ...n, children: o.map((l) => /* @__PURE__ */ C("div", { className: "flex gap-4", children: [
|
|
2297
|
+
t && /* @__PURE__ */ C(et, { className: "h-8 w-8", children: [
|
|
2298
|
+
l.user.avatar && /* @__PURE__ */ c(tt, { src: l.user.avatar, alt: l.user.name }),
|
|
2299
|
+
/* @__PURE__ */ c(nt, { children: l.user.initials || l.user.name.charAt(0).toUpperCase() })
|
|
2300
|
+
] }),
|
|
2301
|
+
/* @__PURE__ */ C("div", { className: "flex-1 space-y-1", children: [
|
|
2302
|
+
/* @__PURE__ */ C("p", { className: "text-sm", children: [
|
|
2303
|
+
/* @__PURE__ */ c("span", { className: "font-medium", children: l.user.name }),
|
|
2304
|
+
" ",
|
|
2305
|
+
/* @__PURE__ */ c("span", { className: "text-muted-foreground", children: l.action }),
|
|
2306
|
+
l.target && /* @__PURE__ */ C("span", { className: "font-medium", children: [
|
|
2307
|
+
" ",
|
|
2308
|
+
l.target
|
|
2309
|
+
] })
|
|
2310
|
+
] }),
|
|
2311
|
+
/* @__PURE__ */ c("p", { className: "text-xs text-muted-foreground", children: l.timestamp })
|
|
2312
|
+
] }),
|
|
2313
|
+
l.icon && /* @__PURE__ */ c("div", { className: "text-muted-foreground", children: l.icon })
|
|
2314
|
+
] }, l.id)) })
|
|
2315
|
+
);
|
|
2316
|
+
fn.displayName = "ActivityFeed";
|
|
2317
|
+
const pn = F.forwardRef(
|
|
2318
|
+
({ columns: e, onChange: o, showSelectAll: t = !0, maxHeight: n = 300, className: r }, l) => {
|
|
2319
|
+
const i = e.filter((p) => p.visible).length, a = e.length, u = (p) => {
|
|
2320
|
+
const g = e.map(
|
|
2321
|
+
(s) => s.id === p && !s.locked ? { ...s, visible: !s.visible } : s
|
|
2322
|
+
);
|
|
2323
|
+
o(g);
|
|
2324
|
+
}, d = () => {
|
|
2325
|
+
const p = e.every((s) => s.visible || s.locked), g = e.map(
|
|
2326
|
+
(s) => s.locked ? s : { ...s, visible: !p }
|
|
2327
|
+
);
|
|
2328
|
+
o(g);
|
|
2329
|
+
}, f = () => {
|
|
2330
|
+
const p = e.map((g) => ({ ...g, visible: !0 }));
|
|
2331
|
+
o(p);
|
|
2332
|
+
};
|
|
2333
|
+
return /* @__PURE__ */ C(z, { children: [
|
|
2334
|
+
/* @__PURE__ */ c(k, { asChild: !0, children: /* @__PURE__ */ C(I, { ref: l, variant: "outline", size: "sm", className: y("gap-2", r), children: [
|
|
2335
|
+
/* @__PURE__ */ c(it, { className: "h-4 w-4" }),
|
|
2336
|
+
/* @__PURE__ */ c("span", { children: "Columns" }),
|
|
2337
|
+
/* @__PURE__ */ C("span", { className: "text-xs text-muted-foreground", children: [
|
|
2338
|
+
"(",
|
|
2339
|
+
i,
|
|
2340
|
+
"/",
|
|
2341
|
+
a,
|
|
2342
|
+
")"
|
|
2343
|
+
] })
|
|
2344
|
+
] }) }),
|
|
2345
|
+
/* @__PURE__ */ C(O, { align: "end", className: "w-56", children: [
|
|
2346
|
+
/* @__PURE__ */ C(de, { className: "flex items-center justify-between", children: [
|
|
2347
|
+
/* @__PURE__ */ c("span", { children: "Toggle Columns" }),
|
|
2348
|
+
/* @__PURE__ */ c(I, { variant: "ghost", size: "sm", className: "h-auto p-1 text-xs", onClick: f, children: "Reset" })
|
|
2349
|
+
] }),
|
|
2350
|
+
/* @__PURE__ */ c(K, {}),
|
|
2351
|
+
t && /* @__PURE__ */ C(Q, { children: [
|
|
2352
|
+
/* @__PURE__ */ C("div", { className: "flex items-center gap-2 px-2 py-1.5", children: [
|
|
2353
|
+
/* @__PURE__ */ c(
|
|
2354
|
+
X,
|
|
2355
|
+
{
|
|
2356
|
+
id: "select-all",
|
|
2357
|
+
checked: e.every((p) => p.visible || p.locked),
|
|
2358
|
+
onCheckedChange: d
|
|
2359
|
+
}
|
|
2360
|
+
),
|
|
2361
|
+
/* @__PURE__ */ c(
|
|
2362
|
+
"label",
|
|
2363
|
+
{
|
|
2364
|
+
htmlFor: "select-all",
|
|
2365
|
+
className: "flex-1 cursor-pointer text-sm font-medium",
|
|
2366
|
+
children: "Select All"
|
|
2367
|
+
}
|
|
2368
|
+
)
|
|
2369
|
+
] }),
|
|
2370
|
+
/* @__PURE__ */ c(K, {})
|
|
2371
|
+
] }),
|
|
2372
|
+
/* @__PURE__ */ c(Ke, { style: { maxHeight: n }, children: /* @__PURE__ */ c("div", { className: "space-y-1 p-1", children: e.map((p) => /* @__PURE__ */ C(
|
|
2373
|
+
"div",
|
|
2374
|
+
{
|
|
2375
|
+
className: y(
|
|
2376
|
+
"flex items-center gap-2 rounded-md px-2 py-1.5 transition-colors hover:bg-muted",
|
|
2377
|
+
p.locked && "opacity-50"
|
|
2378
|
+
),
|
|
2379
|
+
children: [
|
|
2380
|
+
/* @__PURE__ */ c(
|
|
2381
|
+
X,
|
|
2382
|
+
{
|
|
2383
|
+
id: p.id,
|
|
2384
|
+
checked: p.visible,
|
|
2385
|
+
onCheckedChange: () => u(p.id),
|
|
2386
|
+
disabled: p.locked
|
|
2387
|
+
}
|
|
2388
|
+
),
|
|
2389
|
+
/* @__PURE__ */ C(
|
|
2390
|
+
"label",
|
|
2391
|
+
{
|
|
2392
|
+
htmlFor: p.id,
|
|
2393
|
+
className: y(
|
|
2394
|
+
"flex flex-1 cursor-pointer items-center gap-2 text-sm",
|
|
2395
|
+
p.locked && "cursor-not-allowed"
|
|
2396
|
+
),
|
|
2397
|
+
children: [
|
|
2398
|
+
p.visible ? /* @__PURE__ */ c(lt, { className: "h-3.5 w-3.5 text-muted-foreground" }) : /* @__PURE__ */ c(rt, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
2399
|
+
p.label
|
|
2400
|
+
]
|
|
2401
|
+
}
|
|
2402
|
+
)
|
|
2403
|
+
]
|
|
2404
|
+
},
|
|
2405
|
+
p.id
|
|
2406
|
+
)) }) })
|
|
2407
|
+
] })
|
|
2408
|
+
] });
|
|
2409
|
+
}
|
|
2410
|
+
);
|
|
2411
|
+
pn.displayName = "ColumnVisibility";
|
|
2412
|
+
const mn = F.forwardRef(
|
|
2413
|
+
({
|
|
2414
|
+
selectedCount: e,
|
|
2415
|
+
selectedIds: o,
|
|
2416
|
+
onClearSelection: t,
|
|
2417
|
+
actions: n,
|
|
2418
|
+
maxVisibleActions: r = 3,
|
|
2419
|
+
className: l
|
|
2420
|
+
}, i) => {
|
|
2421
|
+
if (e === 0) return null;
|
|
2422
|
+
const a = n.slice(0, r), u = n.slice(r);
|
|
2423
|
+
return /* @__PURE__ */ C(
|
|
2424
|
+
"div",
|
|
2425
|
+
{
|
|
2426
|
+
ref: i,
|
|
2427
|
+
className: y(
|
|
2428
|
+
"flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2",
|
|
2429
|
+
l
|
|
2430
|
+
),
|
|
2431
|
+
children: [
|
|
2432
|
+
/* @__PURE__ */ C("div", { className: "flex items-center gap-2", children: [
|
|
2433
|
+
/* @__PURE__ */ c(
|
|
2434
|
+
I,
|
|
2435
|
+
{
|
|
2436
|
+
variant: "ghost",
|
|
2437
|
+
size: "icon",
|
|
2438
|
+
className: "h-8 w-8",
|
|
2439
|
+
onClick: t,
|
|
2440
|
+
children: /* @__PURE__ */ c(U, { className: "h-4 w-4" })
|
|
2441
|
+
}
|
|
2442
|
+
),
|
|
2443
|
+
/* @__PURE__ */ C("span", { className: "text-sm font-medium", children: [
|
|
2444
|
+
e,
|
|
2445
|
+
" selected"
|
|
2446
|
+
] })
|
|
2447
|
+
] }),
|
|
2448
|
+
/* @__PURE__ */ c("div", { className: "mx-2 h-6 w-px bg-border" }),
|
|
2449
|
+
/* @__PURE__ */ C("div", { className: "flex items-center gap-1", children: [
|
|
2450
|
+
a.map((d) => /* @__PURE__ */ C(
|
|
2451
|
+
I,
|
|
2452
|
+
{
|
|
2453
|
+
variant: d.variant === "destructive" ? "destructive" : "ghost",
|
|
2454
|
+
size: "sm",
|
|
2455
|
+
className: "gap-2",
|
|
2456
|
+
onClick: () => d.onClick(o),
|
|
2457
|
+
disabled: d.disabled,
|
|
2458
|
+
children: [
|
|
2459
|
+
d.icon,
|
|
2460
|
+
/* @__PURE__ */ c("span", { children: d.label })
|
|
2461
|
+
]
|
|
2462
|
+
},
|
|
2463
|
+
d.id
|
|
2464
|
+
)),
|
|
2465
|
+
u.length > 0 && /* @__PURE__ */ C(z, { children: [
|
|
2466
|
+
/* @__PURE__ */ c(k, { asChild: !0, children: /* @__PURE__ */ c(I, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ c(Ie, { className: "h-4 w-4" }) }) }),
|
|
2467
|
+
/* @__PURE__ */ c(O, { align: "end", children: u.map((d) => /* @__PURE__ */ C(
|
|
2468
|
+
_e,
|
|
2469
|
+
{
|
|
2470
|
+
onClick: () => d.onClick(o),
|
|
2471
|
+
disabled: d.disabled,
|
|
2472
|
+
className: y(
|
|
2473
|
+
"flex items-center gap-2",
|
|
2474
|
+
d.variant === "destructive" && "text-destructive"
|
|
2475
|
+
),
|
|
2476
|
+
children: [
|
|
2477
|
+
d.icon,
|
|
2478
|
+
/* @__PURE__ */ c("span", { children: d.label })
|
|
2479
|
+
]
|
|
2480
|
+
},
|
|
2481
|
+
d.id
|
|
2482
|
+
)) })
|
|
2483
|
+
] })
|
|
2484
|
+
] })
|
|
2485
|
+
]
|
|
2486
|
+
}
|
|
2487
|
+
);
|
|
2488
|
+
}
|
|
2489
|
+
);
|
|
2490
|
+
mn.displayName = "BulkActionsToolbar";
|
|
2491
|
+
const hn = F.forwardRef(
|
|
2492
|
+
({
|
|
2493
|
+
value: e,
|
|
2494
|
+
onChange: o,
|
|
2495
|
+
options: t = [10, 20, 50, 100],
|
|
2496
|
+
label: n = "Rows per page",
|
|
2497
|
+
className: r
|
|
2498
|
+
}, l) => /* @__PURE__ */ C("div", { className: y("flex items-center gap-2", r), children: [
|
|
2499
|
+
/* @__PURE__ */ c("span", { className: "text-sm text-muted-foreground", children: n }),
|
|
2500
|
+
/* @__PURE__ */ C(
|
|
2501
|
+
Fe,
|
|
2502
|
+
{
|
|
2503
|
+
value: e.toString(),
|
|
2504
|
+
onValueChange: (i) => o(parseInt(i, 10)),
|
|
2505
|
+
children: [
|
|
2506
|
+
/* @__PURE__ */ c(ye, { ref: l, size: "sm", width: "sm", children: /* @__PURE__ */ c($e, {}) }),
|
|
2507
|
+
/* @__PURE__ */ c(Ve, { align: "end", children: t.map((i) => /* @__PURE__ */ c(Me, { value: i.toString(), children: i }, i)) })
|
|
2508
|
+
]
|
|
2509
|
+
}
|
|
2510
|
+
)
|
|
2511
|
+
] })
|
|
2512
|
+
);
|
|
2513
|
+
hn.displayName = "PerPageSelector";
|
|
2514
|
+
const Cn = F.forwardRef(
|
|
2515
|
+
({ className: e, filters: o, onClearAll: t, ...n }, r) => {
|
|
2516
|
+
const l = o.reduce((i, a) => i + a.value.length, 0);
|
|
2517
|
+
return /* @__PURE__ */ C("div", { ref: r, className: y("flex flex-wrap items-center gap-2", e), ...n, children: [
|
|
2518
|
+
o.map((i) => /* @__PURE__ */ C(z, { children: [
|
|
2519
|
+
/* @__PURE__ */ c(k, { asChild: !0, children: /* @__PURE__ */ C(
|
|
2520
|
+
I,
|
|
2521
|
+
{
|
|
2522
|
+
variant: i.value.length > 0 ? "secondary" : "outline",
|
|
2523
|
+
size: "sm",
|
|
2524
|
+
className: "gap-1",
|
|
2525
|
+
children: [
|
|
2526
|
+
i.label,
|
|
2527
|
+
i.value.length > 0 && /* @__PURE__ */ c(Re, { variant: "default", className: "ml-1 h-5 px-1.5", children: i.value.length }),
|
|
2528
|
+
/* @__PURE__ */ c(Pe, { className: "h-3.5 w-3.5 opacity-50" })
|
|
2529
|
+
]
|
|
2530
|
+
}
|
|
2531
|
+
) }),
|
|
2532
|
+
/* @__PURE__ */ C(O, { align: "start", className: "w-48", children: [
|
|
2533
|
+
/* @__PURE__ */ c(de, { children: i.label }),
|
|
2534
|
+
/* @__PURE__ */ c(K, {}),
|
|
2535
|
+
i.options.map((a) => /* @__PURE__ */ C(
|
|
2536
|
+
xe,
|
|
2537
|
+
{
|
|
2538
|
+
checked: i.value.includes(a.value),
|
|
2539
|
+
onCheckedChange: (u) => {
|
|
2540
|
+
if (i.multiple !== !1) {
|
|
2541
|
+
const d = u ? [...i.value, a.value] : i.value.filter((f) => f !== a.value);
|
|
2542
|
+
i.onChange(d);
|
|
2543
|
+
} else
|
|
2544
|
+
i.onChange(u ? [a.value] : []);
|
|
2545
|
+
},
|
|
2546
|
+
children: [
|
|
2547
|
+
/* @__PURE__ */ c("span", { className: "flex-1", children: a.label }),
|
|
2548
|
+
a.count !== void 0 && /* @__PURE__ */ c("span", { className: "text-xs text-muted-foreground", children: a.count })
|
|
2549
|
+
]
|
|
2550
|
+
},
|
|
2551
|
+
a.value
|
|
2552
|
+
))
|
|
2553
|
+
] })
|
|
2554
|
+
] }, i.id)),
|
|
2555
|
+
l > 0 && t && /* @__PURE__ */ C(
|
|
2556
|
+
I,
|
|
2557
|
+
{
|
|
2558
|
+
variant: "ghost",
|
|
2559
|
+
size: "sm",
|
|
2560
|
+
className: "gap-1 text-muted-foreground",
|
|
2561
|
+
onClick: t,
|
|
2562
|
+
children: [
|
|
2563
|
+
/* @__PURE__ */ c(U, { className: "h-3.5 w-3.5" }),
|
|
2564
|
+
"Clear all"
|
|
2565
|
+
]
|
|
2566
|
+
}
|
|
2567
|
+
)
|
|
2568
|
+
] });
|
|
2569
|
+
}
|
|
2570
|
+
);
|
|
2571
|
+
Cn.displayName = "QuickFilters";
|
|
2572
|
+
const Sn = F.forwardRef(
|
|
2573
|
+
({ className: e, tags: o, onRemove: t, onClearAll: n, maxVisible: r = 5, ...l }, i) => {
|
|
2574
|
+
const [a, u] = F.useState(!1);
|
|
2575
|
+
if (o.length === 0) return null;
|
|
2576
|
+
const d = a ? o : o.slice(0, r), f = o.length - r;
|
|
2577
|
+
return /* @__PURE__ */ C("div", { ref: i, className: y("flex flex-wrap items-center gap-2", e), ...l, children: [
|
|
2578
|
+
/* @__PURE__ */ c("span", { className: "text-sm text-muted-foreground", children: "Active filters:" }),
|
|
2579
|
+
d.map((p) => /* @__PURE__ */ C(Re, { variant: "secondary", className: "gap-1 pr-1", children: [
|
|
2580
|
+
p.category && /* @__PURE__ */ C("span", { className: "text-muted-foreground", children: [
|
|
2581
|
+
p.category,
|
|
2582
|
+
":"
|
|
2583
|
+
] }),
|
|
2584
|
+
/* @__PURE__ */ c("span", { children: p.label }),
|
|
2585
|
+
/* @__PURE__ */ c(
|
|
2586
|
+
"button",
|
|
2587
|
+
{
|
|
2588
|
+
onClick: () => t(p.id),
|
|
2589
|
+
className: "ml-1 rounded-full p-0.5 hover:bg-muted-foreground/20",
|
|
2590
|
+
children: /* @__PURE__ */ c(U, { className: "h-3 w-3" })
|
|
2591
|
+
}
|
|
2592
|
+
)
|
|
2593
|
+
] }, p.id)),
|
|
2594
|
+
!a && f > 0 && /* @__PURE__ */ C(
|
|
2595
|
+
I,
|
|
2596
|
+
{
|
|
2597
|
+
variant: "ghost",
|
|
2598
|
+
size: "sm",
|
|
2599
|
+
className: "h-6 px-2 text-xs",
|
|
2600
|
+
onClick: () => u(!0),
|
|
2601
|
+
children: [
|
|
2602
|
+
"+",
|
|
2603
|
+
f,
|
|
2604
|
+
" more"
|
|
2605
|
+
]
|
|
2606
|
+
}
|
|
2607
|
+
),
|
|
2608
|
+
a && f > 0 && /* @__PURE__ */ c(
|
|
2609
|
+
I,
|
|
2610
|
+
{
|
|
2611
|
+
variant: "ghost",
|
|
2612
|
+
size: "sm",
|
|
2613
|
+
className: "h-6 px-2 text-xs",
|
|
2614
|
+
onClick: () => u(!1),
|
|
2615
|
+
children: "Show less"
|
|
2616
|
+
}
|
|
2617
|
+
),
|
|
2618
|
+
n && o.length > 1 && /* @__PURE__ */ C(
|
|
2619
|
+
I,
|
|
2620
|
+
{
|
|
2621
|
+
variant: "ghost",
|
|
2622
|
+
size: "sm",
|
|
2623
|
+
className: "h-6 gap-1 px-2 text-xs text-muted-foreground",
|
|
2624
|
+
onClick: n,
|
|
2625
|
+
children: [
|
|
2626
|
+
/* @__PURE__ */ c(U, { className: "h-3 w-3" }),
|
|
2627
|
+
"Clear all"
|
|
2628
|
+
]
|
|
2629
|
+
}
|
|
2630
|
+
)
|
|
2631
|
+
] });
|
|
2632
|
+
}
|
|
2633
|
+
);
|
|
2634
|
+
Sn.displayName = "FilterTags";
|
|
2635
|
+
export {
|
|
2636
|
+
fn as A,
|
|
2637
|
+
mn as B,
|
|
2638
|
+
pn as C,
|
|
2639
|
+
Dn as D,
|
|
2640
|
+
gn as E,
|
|
2641
|
+
Sn as F,
|
|
2642
|
+
un as K,
|
|
2643
|
+
hn as P,
|
|
2644
|
+
Cn as Q,
|
|
2645
|
+
dn as S,
|
|
2646
|
+
Be as T,
|
|
2647
|
+
be as a,
|
|
2648
|
+
qe as b,
|
|
2649
|
+
ln as c,
|
|
2650
|
+
je as d,
|
|
2651
|
+
j as e,
|
|
2652
|
+
ue as f,
|
|
2653
|
+
sn as g,
|
|
2654
|
+
En as h,
|
|
2655
|
+
An as i,
|
|
2656
|
+
cn as j
|
|
2657
|
+
};
|
|
2658
|
+
//# sourceMappingURL=filter-tags-i_I8qV1N.js.map
|