@rafal.lemieszewski/tide-ui 0.87.8 → 0.87.9
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.
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { jsx as t, Fragment as ee, jsxs as b } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { useReactTable as
|
|
4
|
-
import { useReactTable as
|
|
5
|
-
import { useSensors as
|
|
6
|
-
import { SortableContext as
|
|
7
|
-
import { CSS as
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { useReactTable as dn, getFacetedMinMaxValues as un, getFacetedUniqueValues as fn, getFacetedRowModel as gn, getGroupedRowModel as mn, getExpandedRowModel as hn, getSortedRowModel as pn, getPaginationRowModel as vn, getFilteredRowModel as bn, getCoreRowModel as xn, flexRender as be } from "@tanstack/react-table";
|
|
4
|
+
import { useReactTable as Ho } from "@tanstack/react-table";
|
|
5
|
+
import { useSensors as yn, useSensor as Rr, MouseSensor as Cn, TouchSensor as wn, DndContext as Sn, closestCenter as Nn } from "@dnd-kit/core";
|
|
6
|
+
import { SortableContext as Rn, horizontalListSortingStrategy as In, arrayMove as En, useSortable as Dn } from "@dnd-kit/sortable";
|
|
7
|
+
import { CSS as kn } from "@dnd-kit/utilities";
|
|
8
8
|
import { cn as V } from "../../lib/utils.js";
|
|
9
9
|
import { Button as Pe } from "../fundamental/button.js";
|
|
10
|
-
import { Input as
|
|
11
|
-
import { AutocompleteSearch as
|
|
12
|
-
import { Table as
|
|
13
|
-
import { Select as
|
|
14
|
-
import { Checkbox as
|
|
10
|
+
import { Input as mt } from "../fundamental/input.js";
|
|
11
|
+
import { AutocompleteSearch as zn } from "../fundamental/autocomplete-search.js";
|
|
12
|
+
import { Table as Bn, TableHeader as Tn, TableRow as G, TableHead as gt, TableBody as Pn, TableCell as ie } from "../fundamental/table.js";
|
|
13
|
+
import { Select as Mn, SelectTrigger as Vn, SelectValue as Fn, SelectContent as $n, SelectItem as Ir } from "../fundamental/select.js";
|
|
14
|
+
import { Checkbox as ht } from "../fundamental/checkbox.js";
|
|
15
15
|
import { Icon as W } from "../fundamental/icon.js";
|
|
16
|
-
import { PlusCircle as
|
|
16
|
+
import { PlusCircle as jn, X as $t, GripVertical as An, ArrowUpToLine as Er, ArrowDownToLine as Dr, AlertCircle as Ln, Filter as On } from "lucide-react";
|
|
17
17
|
import { Badge as xe } from "../fundamental/badge.js";
|
|
18
|
-
import { Popover as
|
|
19
|
-
import { Command as
|
|
20
|
-
import { Pagination as
|
|
21
|
-
import { Skeleton as
|
|
18
|
+
import { Popover as Ar, PopoverTrigger as Lr, PopoverContent as Or } from "../fundamental/popover.js";
|
|
19
|
+
import { Command as Hr, CommandInput as Wr, CommandList as Gr, CommandEmpty as _r, CommandGroup as qr, CommandItem as Ur } from "../fundamental/command.js";
|
|
20
|
+
import { Pagination as Hn } from "../fundamental/pagination.js";
|
|
21
|
+
import { Skeleton as kr } from "../fundamental/skeleton.js";
|
|
22
22
|
import { Spinner as qe } from "../fundamental/spinner.js";
|
|
23
|
-
import { DataTableSettingsMenu as
|
|
24
|
-
import { TooltipProvider as
|
|
25
|
-
function
|
|
26
|
-
const [
|
|
27
|
-
return
|
|
23
|
+
import { DataTableSettingsMenu as Wn } from "./data-table-settings-menu.js";
|
|
24
|
+
import { TooltipProvider as Gn, Tooltip as _n, TooltipTrigger as qn, TooltipContent as Un } from "../fundamental/tooltip.js";
|
|
25
|
+
function Jn(c, n) {
|
|
26
|
+
const [l, a] = i.useState(c);
|
|
27
|
+
return i.useEffect(() => {
|
|
28
28
|
const f = setTimeout(() => {
|
|
29
29
|
a(c);
|
|
30
30
|
}, n);
|
|
31
31
|
return () => {
|
|
32
32
|
clearTimeout(f);
|
|
33
33
|
};
|
|
34
|
-
}, [c, n]),
|
|
34
|
+
}, [c, n]), l;
|
|
35
35
|
}
|
|
36
|
-
const Te = /* @__PURE__ */
|
|
37
|
-
const a =
|
|
38
|
-
return
|
|
36
|
+
const Te = /* @__PURE__ */ i.memo(function({ children: n, align: l = "left" }) {
|
|
37
|
+
const a = i.useRef(null), [f, x] = i.useState(!1), [y, h] = i.useState("");
|
|
38
|
+
return i.useEffect(() => {
|
|
39
39
|
const p = a.current;
|
|
40
40
|
if (!p) return;
|
|
41
41
|
let v;
|
|
42
|
-
const
|
|
42
|
+
const I = () => {
|
|
43
43
|
clearTimeout(v), v = setTimeout(() => {
|
|
44
44
|
if (a.current) {
|
|
45
45
|
const T = a.current.scrollWidth > a.current.clientWidth, C = a.current.firstElementChild, A = C ? C.scrollWidth > C.clientWidth : !1;
|
|
@@ -51,44 +51,44 @@ const Te = /* @__PURE__ */ l.memo(function({ children: n, align: i = "left" }) {
|
|
|
51
51
|
const T = a.current.scrollWidth > a.current.clientWidth, C = a.current.firstElementChild, A = C ? C.scrollWidth > C.clientWidth : !1;
|
|
52
52
|
x(T || A);
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
return
|
|
56
|
-
clearTimeout(v),
|
|
54
|
+
const k = new ResizeObserver(I);
|
|
55
|
+
return k.observe(p), () => {
|
|
56
|
+
clearTimeout(v), k.disconnect();
|
|
57
57
|
};
|
|
58
|
-
}, [n]),
|
|
58
|
+
}, [n]), i.useEffect(() => {
|
|
59
59
|
a.current && h(a.current.textContent || "");
|
|
60
|
-
}, [n]), f ? /* @__PURE__ */ b(
|
|
61
|
-
/* @__PURE__ */ t(
|
|
60
|
+
}, [n]), f ? /* @__PURE__ */ b(_n, { children: [
|
|
61
|
+
/* @__PURE__ */ t(qn, { asChild: !0, children: /* @__PURE__ */ t(
|
|
62
62
|
"div",
|
|
63
63
|
{
|
|
64
64
|
ref: a,
|
|
65
|
-
className: V("min-w-0 overflow-hidden truncate [&>*]:truncate",
|
|
65
|
+
className: V("min-w-0 overflow-hidden truncate [&>*]:truncate", l === "right" && "text-right"),
|
|
66
66
|
children: n
|
|
67
67
|
}
|
|
68
68
|
) }),
|
|
69
|
-
/* @__PURE__ */ t(
|
|
69
|
+
/* @__PURE__ */ t(Un, { side: "top", className: "max-w-xs", children: y })
|
|
70
70
|
] }) : /* @__PURE__ */ t(
|
|
71
71
|
"div",
|
|
72
72
|
{
|
|
73
73
|
ref: a,
|
|
74
|
-
className: V("min-w-0 overflow-hidden truncate [&>*]:truncate",
|
|
74
|
+
className: V("min-w-0 overflow-hidden truncate [&>*]:truncate", l === "right" && "text-right"),
|
|
75
75
|
children: n
|
|
76
76
|
}
|
|
77
77
|
);
|
|
78
|
-
}),
|
|
79
|
-
const f = c.getValue(n), x = f != null ? String(f) : "", y =
|
|
78
|
+
}), zr = (c, n, l, a) => {
|
|
79
|
+
const f = c.getValue(n), x = f != null ? String(f) : "", y = l.toLowerCase();
|
|
80
80
|
return x.toLowerCase().includes(y) ? !0 : x.toLowerCase().split(" ").some((p) => p.startsWith(y));
|
|
81
|
-
},
|
|
82
|
-
if (!
|
|
81
|
+
}, Kn = (c, n, l) => {
|
|
82
|
+
if (!l || l.length === 0) return !0;
|
|
83
83
|
const a = c.getValue(n);
|
|
84
|
-
return
|
|
85
|
-
},
|
|
86
|
-
if (!
|
|
87
|
-
const f = String(
|
|
84
|
+
return l.includes(a);
|
|
85
|
+
}, $o = (c, n, l, a) => {
|
|
86
|
+
if (!l || l.trim() === "") return !0;
|
|
87
|
+
const f = String(l).toLowerCase(), x = (h) => {
|
|
88
88
|
const p = h.getAllCells().map((v) => v.column.id);
|
|
89
89
|
for (const v of p) {
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
90
|
+
const I = h.getValue(v);
|
|
91
|
+
if (I != null && String(I).toLowerCase().includes(f))
|
|
92
92
|
return !0;
|
|
93
93
|
}
|
|
94
94
|
return !1;
|
|
@@ -97,9 +97,9 @@ const Te = /* @__PURE__ */ l.memo(function({ children: n, align: i = "left" }) {
|
|
|
97
97
|
const y = x(c);
|
|
98
98
|
return a && y && a({ itemRank: 1 }), y;
|
|
99
99
|
};
|
|
100
|
-
function
|
|
101
|
-
for (const
|
|
102
|
-
const a = typeof n == "function" ? n(
|
|
100
|
+
function Xn(c, n) {
|
|
101
|
+
for (const l of c) {
|
|
102
|
+
const a = typeof n == "function" ? n(l.original) : l.original?.[n];
|
|
103
103
|
if (a != null) {
|
|
104
104
|
if (typeof a == "number") return "number";
|
|
105
105
|
if (a instanceof Date) return "date";
|
|
@@ -112,114 +112,114 @@ function Jn(c, n) {
|
|
|
112
112
|
}
|
|
113
113
|
return "unknown";
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Br(c) {
|
|
116
116
|
if (c.length === 0) return "";
|
|
117
|
-
const n = Math.min(...c),
|
|
118
|
-
return n ===
|
|
117
|
+
const n = Math.min(...c), l = Math.max(...c);
|
|
118
|
+
return n === l ? String(n) : `${n} – ${l}`;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Qn(c) {
|
|
121
121
|
return c.length === 0 ? "" : `Avg: ${(c.reduce((a, f) => a + f, 0) / c.length).toFixed(2)}`;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
return c.length === 0 ? "" : `Total: ${c.reduce((
|
|
123
|
+
function Yn(c) {
|
|
124
|
+
return c.length === 0 ? "" : `Total: ${c.reduce((l, a) => l + a, 0)}`;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function Tr(c) {
|
|
127
127
|
return `${c} ${c === 1 ? "item" : "items"}`;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Pr(c, n) {
|
|
130
130
|
if (c.length === 0) return "";
|
|
131
131
|
const a = new Set(c).size, f = a === 1 || n.endsWith("s") ? n : n.endsWith("y") ? n.slice(0, -1) + "ies" : n + "s";
|
|
132
132
|
return `${a} ${f.toLowerCase()}`;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function Zn(c) {
|
|
135
135
|
if (c.length === 0) return "";
|
|
136
136
|
const n = /* @__PURE__ */ new Map();
|
|
137
137
|
c.forEach((f) => n.set(f, (n.get(f) || 0) + 1));
|
|
138
|
-
let
|
|
138
|
+
let l = 0, a = "";
|
|
139
139
|
return n.forEach((f, x) => {
|
|
140
|
-
f >
|
|
141
|
-
}), `${a} (${
|
|
140
|
+
f > l && (l = f, a = x);
|
|
141
|
+
}), `${a} (${l})`;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function Mr(c) {
|
|
144
144
|
if (c.length === 0) return "";
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
147
|
-
const a = new Date(Math.min(...
|
|
145
|
+
const l = c.map((y) => y instanceof Date ? y : new Date(y)).filter((y) => !isNaN(y.getTime()));
|
|
146
|
+
if (l.length === 0) return "";
|
|
147
|
+
const a = new Date(Math.min(...l.map((y) => y.getTime()))), f = new Date(Math.max(...l.map((y) => y.getTime()))), x = (y) => y.toISOString().split("T")[0];
|
|
148
148
|
return a.getTime() === f.getTime() ? x(a) : `${x(a)} – ${x(f)}`;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Vr(c, n, l) {
|
|
151
151
|
const a = c.columnDef;
|
|
152
|
-
if (c.id ===
|
|
152
|
+
if (c.id === l || a?.meta?.renderInGroupedRows || a?.meta?.aggregation === !1) return null;
|
|
153
153
|
if (typeof a?.meta?.aggregation == "function") {
|
|
154
|
-
const
|
|
155
|
-
return a.meta.aggregation(n,
|
|
154
|
+
const I = "accessorKey" in a ? a.accessorKey : void 0;
|
|
155
|
+
return a.meta.aggregation(n, I);
|
|
156
156
|
}
|
|
157
157
|
const f = "accessorKey" in a ? a.accessorKey : void 0, x = "accessorFn" in a ? a.accessorFn : void 0, y = f || x;
|
|
158
158
|
if (!y) return null;
|
|
159
|
-
const h = n.map((
|
|
159
|
+
const h = n.map((I) => typeof y == "function" ? y(I.original, I.index) : I.original?.[y]).filter((I) => I != null);
|
|
160
160
|
if (h.length === 0) return null;
|
|
161
161
|
const p = a?.meta?.aggregation;
|
|
162
162
|
if (p && typeof p == "string")
|
|
163
163
|
switch (p) {
|
|
164
164
|
case "range":
|
|
165
|
-
return
|
|
165
|
+
return Br(h);
|
|
166
166
|
case "average":
|
|
167
|
-
return
|
|
167
|
+
return Qn(h);
|
|
168
168
|
case "sum":
|
|
169
|
-
return
|
|
169
|
+
return Yn(h);
|
|
170
170
|
case "count":
|
|
171
|
-
return
|
|
171
|
+
return Tr(h.length);
|
|
172
172
|
case "uniqueCount":
|
|
173
|
-
return
|
|
173
|
+
return Pr(
|
|
174
174
|
h.map(String),
|
|
175
175
|
a?.meta?.label || String(c.id)
|
|
176
176
|
);
|
|
177
177
|
case "mostCommon":
|
|
178
|
-
return
|
|
178
|
+
return Zn(h.map(String));
|
|
179
179
|
case "dateRange":
|
|
180
|
-
return
|
|
180
|
+
return Mr(h);
|
|
181
181
|
default:
|
|
182
182
|
return null;
|
|
183
183
|
}
|
|
184
|
-
switch (
|
|
184
|
+
switch (Xn(n, y)) {
|
|
185
185
|
case "number":
|
|
186
|
-
return
|
|
186
|
+
return Br(h);
|
|
187
187
|
case "string":
|
|
188
|
-
return
|
|
188
|
+
return Pr(
|
|
189
189
|
h.map(String),
|
|
190
190
|
a?.meta?.label || String(c.id)
|
|
191
191
|
);
|
|
192
192
|
case "date":
|
|
193
|
-
return
|
|
193
|
+
return Mr(h);
|
|
194
194
|
default:
|
|
195
|
-
return
|
|
195
|
+
return Tr(h.length);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function Fr({ columns: c, rows: n, showRowBorder: l = !0, showCellBorder: a = !0, skipHeader: f = !1, enableResponsiveWrapper: x = !0 }) {
|
|
199
199
|
const y = x ? "h-4 w-full max-w-full" : "h-4 w-[120px]", h = x ? "h-4 w-full max-w-full" : "h-4 w-[100px]";
|
|
200
200
|
return /* @__PURE__ */ b(ee, { children: [
|
|
201
|
-
!f && /* @__PURE__ */ t(G, { showBorder:
|
|
202
|
-
Array.from({ length: n }).map((p, v) => /* @__PURE__ */ t(G, { showBorder:
|
|
203
|
-
|
|
201
|
+
!f && /* @__PURE__ */ t(G, { showBorder: l, children: Array.from({ length: c }).map((p, v) => /* @__PURE__ */ t(gt, { showBorder: a, className: "overflow-hidden", children: /* @__PURE__ */ t(kr, { className: y }) }, v)) }),
|
|
202
|
+
Array.from({ length: n }).map((p, v) => /* @__PURE__ */ t(G, { showBorder: l, children: Array.from({ length: c }).map((I, k) => /* @__PURE__ */ t(
|
|
203
|
+
ie,
|
|
204
204
|
{
|
|
205
205
|
showBorder: a,
|
|
206
|
-
showRowBorder:
|
|
206
|
+
showRowBorder: l,
|
|
207
207
|
className: "text-body-sm overflow-hidden",
|
|
208
|
-
children: /* @__PURE__ */ t(
|
|
208
|
+
children: /* @__PURE__ */ t(kr, { className: h })
|
|
209
209
|
},
|
|
210
|
-
|
|
210
|
+
k
|
|
211
211
|
)) }, v))
|
|
212
212
|
] });
|
|
213
213
|
}
|
|
214
|
-
const
|
|
214
|
+
const eo = /* @__PURE__ */ i.memo(function({
|
|
215
215
|
title: n = "No data",
|
|
216
|
-
description:
|
|
216
|
+
description: l = "No items to display",
|
|
217
217
|
action: a,
|
|
218
218
|
customContent: f
|
|
219
219
|
}) {
|
|
220
220
|
return f ? /* @__PURE__ */ t(ee, { children: f }) : /* @__PURE__ */ b("div", { className: "flex flex-col items-center justify-center py-[var(--space-2xl)] text-center", children: [
|
|
221
221
|
/* @__PURE__ */ t("p", { className: "text-body-medium-md text-[var(--color-text-primary)]", children: n }),
|
|
222
|
-
|
|
222
|
+
l && /* @__PURE__ */ t("p", { className: "text-body-sm text-[var(--color-text-secondary)] mt-[var(--space-xs)]", children: l }),
|
|
223
223
|
a && /* @__PURE__ */ t(
|
|
224
224
|
Pe,
|
|
225
225
|
{
|
|
@@ -231,15 +231,15 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
231
231
|
}
|
|
232
232
|
)
|
|
233
233
|
] });
|
|
234
|
-
}),
|
|
234
|
+
}), to = /* @__PURE__ */ i.memo(function({
|
|
235
235
|
title: n = "No results found",
|
|
236
|
-
description:
|
|
236
|
+
description: l = "Try adjusting your search or filters",
|
|
237
237
|
action: a,
|
|
238
238
|
customContent: f
|
|
239
239
|
}) {
|
|
240
240
|
return f ? /* @__PURE__ */ t(ee, { children: f }) : /* @__PURE__ */ b("div", { className: "flex flex-col items-center justify-center py-[var(--space-2xl)] text-center", children: [
|
|
241
241
|
/* @__PURE__ */ t("p", { className: "text-body-medium-md text-[var(--color-text-primary)]", children: n }),
|
|
242
|
-
|
|
242
|
+
l && /* @__PURE__ */ t("p", { className: "text-body-sm text-[var(--color-text-secondary)] mt-[var(--space-xs)]", children: l }),
|
|
243
243
|
a && /* @__PURE__ */ t(
|
|
244
244
|
Pe,
|
|
245
245
|
{
|
|
@@ -251,30 +251,30 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
251
251
|
}
|
|
252
252
|
)
|
|
253
253
|
] });
|
|
254
|
-
}),
|
|
254
|
+
}), ro = /* @__PURE__ */ i.memo(function({
|
|
255
255
|
error: n,
|
|
256
|
-
onRetry:
|
|
256
|
+
onRetry: l,
|
|
257
257
|
customContent: a
|
|
258
258
|
}) {
|
|
259
259
|
return a ? /* @__PURE__ */ t(ee, { children: a }) : /* @__PURE__ */ b("div", { className: "flex flex-col items-center justify-center py-[var(--space-2xl)] text-center", children: [
|
|
260
260
|
/* @__PURE__ */ t("p", { className: "text-body-medium-md text-[var(--color-text-primary)]", children: "Something went wrong" }),
|
|
261
261
|
/* @__PURE__ */ t("p", { className: "text-body-sm text-[var(--color-text-secondary)] mt-[var(--space-xs)]", children: n?.message || "An error occurred while loading data" }),
|
|
262
|
-
|
|
262
|
+
l && /* @__PURE__ */ t(
|
|
263
263
|
Pe,
|
|
264
264
|
{
|
|
265
265
|
variant: "default",
|
|
266
266
|
size: "s",
|
|
267
267
|
className: "mt-[var(--space-m)]",
|
|
268
|
-
onClick:
|
|
268
|
+
onClick: l,
|
|
269
269
|
children: "Try again"
|
|
270
270
|
}
|
|
271
271
|
)
|
|
272
272
|
] });
|
|
273
|
-
}),
|
|
273
|
+
}), so = /* @__PURE__ */ i.memo(function() {
|
|
274
274
|
return /* @__PURE__ */ t("div", { className: "absolute top-0 left-0 right-0 h-[2px] overflow-hidden", children: /* @__PURE__ */ t("div", { className: "h-full w-full bg-[var(--color-background-brand)] animate-pulse" }) });
|
|
275
|
-
}),
|
|
275
|
+
}), no = /* @__PURE__ */ i.memo(function({
|
|
276
276
|
table: n,
|
|
277
|
-
searchKey:
|
|
277
|
+
searchKey: l,
|
|
278
278
|
searchPlaceholder: a = "Search...",
|
|
279
279
|
enableGlobalSearch: f = !1,
|
|
280
280
|
globalSearchPlaceholder: x = "Search all columns...",
|
|
@@ -282,16 +282,16 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
282
282
|
onGlobalFilterChange: h,
|
|
283
283
|
enableGlobalFaceting: p = !1,
|
|
284
284
|
enableGrouping: v = !1,
|
|
285
|
-
showSettingsMenu:
|
|
286
|
-
enableAutocomplete:
|
|
285
|
+
showSettingsMenu: I = !1,
|
|
286
|
+
enableAutocomplete: k = !1,
|
|
287
287
|
autocompleteSuggestions: T = [],
|
|
288
288
|
autocompleteMinCharacters: C = 2
|
|
289
289
|
}) {
|
|
290
290
|
const A = n.getState().columnFilters.length > 0 || f && y.length > 0;
|
|
291
291
|
return /* @__PURE__ */ b("div", { className: "flex items-center justify-between", children: [
|
|
292
292
|
/* @__PURE__ */ b("div", { className: "flex flex-1 items-center space-x-2", children: [
|
|
293
|
-
f && h && /* @__PURE__ */ t(ee, { children:
|
|
294
|
-
|
|
293
|
+
f && h && /* @__PURE__ */ t(ee, { children: k && T.length > 0 ? /* @__PURE__ */ t(
|
|
294
|
+
zn,
|
|
295
295
|
{
|
|
296
296
|
value: y,
|
|
297
297
|
onValueChange: h,
|
|
@@ -302,7 +302,7 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
302
302
|
onSelect: h
|
|
303
303
|
}
|
|
304
304
|
) : /* @__PURE__ */ t(
|
|
305
|
-
|
|
305
|
+
mt,
|
|
306
306
|
{
|
|
307
307
|
placeholder: x,
|
|
308
308
|
value: y,
|
|
@@ -310,17 +310,17 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
310
310
|
className: "h-8 w-[150px] lg:w-[250px]"
|
|
311
311
|
}
|
|
312
312
|
) }),
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
l && !f && /* @__PURE__ */ t(
|
|
314
|
+
mt,
|
|
315
315
|
{
|
|
316
316
|
placeholder: a,
|
|
317
|
-
value: n.getColumn(
|
|
318
|
-
onChange: (M) => n.getColumn(
|
|
317
|
+
value: n.getColumn(l)?.getFilterValue() ?? "",
|
|
318
|
+
onChange: (M) => n.getColumn(l)?.setFilterValue(M.target.value),
|
|
319
319
|
className: "h-8 w-[150px] lg:w-[250px]"
|
|
320
320
|
}
|
|
321
321
|
),
|
|
322
|
-
n.getAllColumns().filter((M) => M.getCanFilter() && M.columnDef.meta?.filterVariant).map((M) => /* @__PURE__ */ t(
|
|
323
|
-
p && /* @__PURE__ */ t(
|
|
322
|
+
n.getAllColumns().filter((M) => M.getCanFilter() && M.columnDef.meta?.filterVariant).map((M) => /* @__PURE__ */ t(ao, { column: M }, M.id)),
|
|
323
|
+
p && /* @__PURE__ */ t(oo, { table: n }),
|
|
324
324
|
A && /* @__PURE__ */ b(
|
|
325
325
|
Pe,
|
|
326
326
|
{
|
|
@@ -331,27 +331,27 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
331
331
|
className: "h-8 px-2 lg:px-3",
|
|
332
332
|
children: [
|
|
333
333
|
"Reset",
|
|
334
|
-
/* @__PURE__ */ t(W, { name:
|
|
334
|
+
/* @__PURE__ */ t(W, { name: $t, className: "ml-2 h-4 w-4" })
|
|
335
335
|
]
|
|
336
336
|
}
|
|
337
337
|
)
|
|
338
338
|
] }),
|
|
339
|
-
|
|
339
|
+
I && /* @__PURE__ */ t("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ t(Jr, { table: n, enableGrouping: v }) })
|
|
340
340
|
] });
|
|
341
|
-
}),
|
|
342
|
-
const [
|
|
341
|
+
}), oo = /* @__PURE__ */ i.memo(function({ table: n }) {
|
|
342
|
+
const [l, a] = i.useState([]), f = n.getAllColumns().filter(
|
|
343
343
|
(h) => h.columnDef.meta?.filterOptions && h.getCanFilter()
|
|
344
|
-
), x =
|
|
344
|
+
), x = i.useMemo(() => {
|
|
345
345
|
const h = /* @__PURE__ */ new Map();
|
|
346
346
|
return f.forEach((p) => {
|
|
347
|
-
const v = p.getFacetedUniqueValues(),
|
|
347
|
+
const v = p.getFacetedUniqueValues(), I = p.columnDef.meta?.filterOptions || [], k = p.columnDef.meta?.label || p.columnDef.header;
|
|
348
348
|
v.forEach((T, C) => {
|
|
349
|
-
const A =
|
|
349
|
+
const A = I.find((M) => M.value === C);
|
|
350
350
|
if (A && T > 0) {
|
|
351
|
-
const M = `${
|
|
351
|
+
const M = `${k}:${C}`;
|
|
352
352
|
h.set(M, {
|
|
353
353
|
count: T,
|
|
354
|
-
column:
|
|
354
|
+
column: k,
|
|
355
355
|
label: A.label
|
|
356
356
|
});
|
|
357
357
|
}
|
|
@@ -362,39 +362,39 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
362
362
|
...v
|
|
363
363
|
})).sort((p, v) => v.count - p.count);
|
|
364
364
|
}, [f]), y = (h) => {
|
|
365
|
-
const p =
|
|
365
|
+
const p = l.includes(h) ? l.filter((v) => v !== h) : [...l, h];
|
|
366
366
|
a(p), f.forEach((v) => {
|
|
367
|
-
const
|
|
368
|
-
(T) =>
|
|
367
|
+
const I = v.columnDef.meta?.filterOptions || [], k = p.filter(
|
|
368
|
+
(T) => I.some((C) => C.value === T)
|
|
369
369
|
);
|
|
370
|
-
|
|
370
|
+
k.length > 0 ? v.columnDef.meta?.filterVariant === "multiselect" ? v.setFilterValue(k) : v.columnDef.meta?.filterVariant === "select" && v.setFilterValue(k[0]) : v.setFilterValue(void 0);
|
|
371
371
|
});
|
|
372
372
|
};
|
|
373
|
-
return x.length === 0 ? null : /* @__PURE__ */ b(
|
|
374
|
-
/* @__PURE__ */ t(
|
|
375
|
-
/* @__PURE__ */ t(W, { name:
|
|
373
|
+
return x.length === 0 ? null : /* @__PURE__ */ b(Ar, { children: [
|
|
374
|
+
/* @__PURE__ */ t(Lr, { asChild: !0, children: /* @__PURE__ */ b(Pe, { variant: "ghost", size: "s", className: "h-8 border-dashed", children: [
|
|
375
|
+
/* @__PURE__ */ t(W, { name: On, className: "mr-2 h-4 w-4" }),
|
|
376
376
|
"Global Faceting",
|
|
377
|
-
|
|
377
|
+
l.length > 0 && /* @__PURE__ */ b(ee, { children: [
|
|
378
378
|
/* @__PURE__ */ t("div", { className: "mx-2 h-4 w-px bg-[var(--color-border-primary)]" }),
|
|
379
379
|
/* @__PURE__ */ b(xe, { className: "rounded-[var(--border-radius-s)] px-1 font-normal", children: [
|
|
380
|
-
|
|
380
|
+
l.length,
|
|
381
381
|
" selected"
|
|
382
382
|
] })
|
|
383
383
|
] })
|
|
384
384
|
] }) }),
|
|
385
|
-
/* @__PURE__ */ t(
|
|
386
|
-
/* @__PURE__ */ t(
|
|
387
|
-
/* @__PURE__ */ b(
|
|
388
|
-
/* @__PURE__ */ t(
|
|
389
|
-
/* @__PURE__ */ t(
|
|
390
|
-
const p =
|
|
385
|
+
/* @__PURE__ */ t(Or, { className: "w-[300px] p-0", align: "start", children: /* @__PURE__ */ b(Hr, { children: [
|
|
386
|
+
/* @__PURE__ */ t(Wr, { placeholder: "Search values across all columns..." }),
|
|
387
|
+
/* @__PURE__ */ b(Gr, { children: [
|
|
388
|
+
/* @__PURE__ */ t(_r, { children: "No results found" }),
|
|
389
|
+
/* @__PURE__ */ t(qr, { children: x.map((h) => {
|
|
390
|
+
const p = l.includes(h.value);
|
|
391
391
|
return /* @__PURE__ */ t(
|
|
392
|
-
|
|
392
|
+
Ur,
|
|
393
393
|
{
|
|
394
394
|
onSelect: () => y(h.value),
|
|
395
395
|
children: /* @__PURE__ */ b("div", { className: "flex items-center justify-between flex-1", children: [
|
|
396
396
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
|
|
397
|
-
/* @__PURE__ */ t(
|
|
397
|
+
/* @__PURE__ */ t(ht, { checked: p }),
|
|
398
398
|
/* @__PURE__ */ b("div", { className: "flex flex-col", children: [
|
|
399
399
|
/* @__PURE__ */ t("span", { className: "text-body-sm", children: h.label }),
|
|
400
400
|
/* @__PURE__ */ b("span", { className: "text-caption-sm text-[var(--color-text-secondary)]", children: [
|
|
@@ -412,24 +412,24 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
412
412
|
] })
|
|
413
413
|
] }) })
|
|
414
414
|
] });
|
|
415
|
-
}),
|
|
416
|
-
const { filterVariant:
|
|
417
|
-
if (
|
|
415
|
+
}), ao = /* @__PURE__ */ i.memo(function({ column: n }) {
|
|
416
|
+
const { filterVariant: l, filterOptions: a, label: f, placeholder: x } = n.columnDef.meta || {}, y = n.getFilterValue(), h = n.getFacetedUniqueValues();
|
|
417
|
+
if (l === "select" && a)
|
|
418
418
|
return /* @__PURE__ */ b(
|
|
419
|
-
|
|
419
|
+
Mn,
|
|
420
420
|
{
|
|
421
421
|
value: y || "all",
|
|
422
422
|
onValueChange: (p) => n.setFilterValue(p === "all" ? "" : p),
|
|
423
423
|
children: [
|
|
424
|
-
/* @__PURE__ */ t(
|
|
425
|
-
/* @__PURE__ */ b(
|
|
426
|
-
/* @__PURE__ */ b(
|
|
424
|
+
/* @__PURE__ */ t(Vn, { className: "h-8 w-[150px]", children: /* @__PURE__ */ t(Fn, { placeholder: x || `Filter ${f}` }) }),
|
|
425
|
+
/* @__PURE__ */ b($n, { children: [
|
|
426
|
+
/* @__PURE__ */ b(Ir, { value: "all", children: [
|
|
427
427
|
"All ",
|
|
428
428
|
f
|
|
429
429
|
] }),
|
|
430
430
|
a.map((p) => {
|
|
431
431
|
const v = h.get(p.value) || 0;
|
|
432
|
-
return /* @__PURE__ */ t(
|
|
432
|
+
return /* @__PURE__ */ t(Ir, { value: p.value, children: /* @__PURE__ */ b("div", { className: "flex items-center justify-between w-full gap-2", children: [
|
|
433
433
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
|
|
434
434
|
p.icon && /* @__PURE__ */ t(p.icon, { className: "h-4 w-4" }),
|
|
435
435
|
p.label
|
|
@@ -441,11 +441,11 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
441
441
|
]
|
|
442
442
|
}
|
|
443
443
|
);
|
|
444
|
-
if (
|
|
444
|
+
if (l === "multiselect" && a) {
|
|
445
445
|
const p = y || [];
|
|
446
|
-
return /* @__PURE__ */ b(
|
|
447
|
-
/* @__PURE__ */ t(
|
|
448
|
-
/* @__PURE__ */ t(W, { name:
|
|
446
|
+
return /* @__PURE__ */ b(Ar, { children: [
|
|
447
|
+
/* @__PURE__ */ t(Lr, { asChild: !0, children: /* @__PURE__ */ b(Pe, { variant: "ghost", size: "s", className: "h-8 border-dashed", children: [
|
|
448
|
+
/* @__PURE__ */ t(W, { name: jn, className: "mr-2 h-4 w-4" }),
|
|
449
449
|
f,
|
|
450
450
|
p.length > 0 && /* @__PURE__ */ b(ee, { children: [
|
|
451
451
|
/* @__PURE__ */ t("div", { className: "mx-2 h-4 w-px bg-[var(--color-border-primary)]" }),
|
|
@@ -456,26 +456,26 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
456
456
|
] }) : a.filter((v) => p.includes(v.value)).map((v) => /* @__PURE__ */ t(xe, { className: "rounded-[var(--border-radius-s)] px-1 font-normal", children: v.label }, v.value)) })
|
|
457
457
|
] })
|
|
458
458
|
] }) }),
|
|
459
|
-
/* @__PURE__ */ t(
|
|
460
|
-
/* @__PURE__ */ t(
|
|
461
|
-
/* @__PURE__ */ b(
|
|
462
|
-
/* @__PURE__ */ t(
|
|
463
|
-
/* @__PURE__ */ t(
|
|
464
|
-
const
|
|
459
|
+
/* @__PURE__ */ t(Or, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ b(Hr, { children: [
|
|
460
|
+
/* @__PURE__ */ t(Wr, { placeholder: x || `Search ${f}...` }),
|
|
461
|
+
/* @__PURE__ */ b(Gr, { children: [
|
|
462
|
+
/* @__PURE__ */ t(_r, { children: "No results found" }),
|
|
463
|
+
/* @__PURE__ */ t(qr, { children: a.map((v) => {
|
|
464
|
+
const I = p.includes(v.value), k = h.get(v.value) || 0;
|
|
465
465
|
return /* @__PURE__ */ t(
|
|
466
|
-
|
|
466
|
+
Ur,
|
|
467
467
|
{
|
|
468
468
|
onSelect: () => {
|
|
469
|
-
const T =
|
|
469
|
+
const T = I ? p.filter((C) => C !== v.value) : [...p, v.value];
|
|
470
470
|
n.setFilterValue(T.length ? T : void 0);
|
|
471
471
|
},
|
|
472
472
|
children: /* @__PURE__ */ b("div", { className: "flex items-center justify-between flex-1", children: [
|
|
473
473
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
|
|
474
|
-
/* @__PURE__ */ t(
|
|
474
|
+
/* @__PURE__ */ t(ht, { checked: I }),
|
|
475
475
|
v.icon && /* @__PURE__ */ t(v.icon, { className: "h-4 w-4" }),
|
|
476
476
|
/* @__PURE__ */ t("span", { children: v.label })
|
|
477
477
|
] }),
|
|
478
|
-
|
|
478
|
+
k > 0 && /* @__PURE__ */ t(xe, { className: "ml-auto text-caption-sm px-1 py-0", children: k })
|
|
479
479
|
] })
|
|
480
480
|
},
|
|
481
481
|
v.value
|
|
@@ -485,8 +485,8 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
485
485
|
] }) })
|
|
486
486
|
] });
|
|
487
487
|
}
|
|
488
|
-
return
|
|
489
|
-
|
|
488
|
+
return l === "number" ? /* @__PURE__ */ t(
|
|
489
|
+
mt,
|
|
490
490
|
{
|
|
491
491
|
placeholder: x || `Filter ${f}...`,
|
|
492
492
|
value: y || "",
|
|
@@ -495,7 +495,7 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
495
495
|
type: "number"
|
|
496
496
|
}
|
|
497
497
|
) : /* @__PURE__ */ t(
|
|
498
|
-
|
|
498
|
+
mt,
|
|
499
499
|
{
|
|
500
500
|
placeholder: x || `Filter ${f}...`,
|
|
501
501
|
value: y || "",
|
|
@@ -503,7 +503,7 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
503
503
|
className: "h-8 w-[150px]"
|
|
504
504
|
}
|
|
505
505
|
);
|
|
506
|
-
}),
|
|
506
|
+
}), io = /* @__PURE__ */ i.memo(function({ header: n, enableColumnOrdering: l, children: a }) {
|
|
507
507
|
const {
|
|
508
508
|
attributes: f,
|
|
509
509
|
listeners: x,
|
|
@@ -511,27 +511,27 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
511
511
|
transform: h,
|
|
512
512
|
transition: p,
|
|
513
513
|
isDragging: v
|
|
514
|
-
} =
|
|
514
|
+
} = Dn({
|
|
515
515
|
id: n.id,
|
|
516
|
-
disabled: !
|
|
517
|
-
}),
|
|
518
|
-
transform:
|
|
516
|
+
disabled: !l
|
|
517
|
+
}), I = {
|
|
518
|
+
transform: kn.Translate.toString(h),
|
|
519
519
|
// Only translate, no scale
|
|
520
520
|
transition: p,
|
|
521
521
|
opacity: v ? 0.5 : 1
|
|
522
522
|
};
|
|
523
|
-
return
|
|
523
|
+
return l ? /* @__PURE__ */ b(
|
|
524
524
|
"div",
|
|
525
525
|
{
|
|
526
526
|
ref: y,
|
|
527
|
-
style:
|
|
527
|
+
style: I,
|
|
528
528
|
className: V(
|
|
529
529
|
"relative flex items-center",
|
|
530
530
|
v && "z-50"
|
|
531
531
|
),
|
|
532
532
|
children: [
|
|
533
533
|
/* @__PURE__ */ t("div", { className: "flex-1", children: a }),
|
|
534
|
-
|
|
534
|
+
l && /* @__PURE__ */ t(
|
|
535
535
|
"div",
|
|
536
536
|
{
|
|
537
537
|
className: "ml-2 p-1 !cursor-grab active:!cursor-grabbing hover:bg-[var(--color-background-neutral-subtlest-hovered)] rounded-[var(--border-radius-s)] transition-colors",
|
|
@@ -540,7 +540,7 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
540
540
|
children: /* @__PURE__ */ t(
|
|
541
541
|
W,
|
|
542
542
|
{
|
|
543
|
-
name:
|
|
543
|
+
name: An,
|
|
544
544
|
className: "h-3 w-3 text-[var(--color-text-tertiary)]"
|
|
545
545
|
}
|
|
546
546
|
)
|
|
@@ -549,44 +549,44 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
549
549
|
]
|
|
550
550
|
}
|
|
551
551
|
) : /* @__PURE__ */ t(ee, { children: a });
|
|
552
|
-
}),
|
|
553
|
-
const a = n.getAllColumns().filter((
|
|
554
|
-
id:
|
|
555
|
-
label:
|
|
556
|
-
})), f = n.getAllColumns().filter((
|
|
557
|
-
id:
|
|
558
|
-
label:
|
|
559
|
-
})), x = n.getAllColumns().filter((
|
|
560
|
-
id:
|
|
561
|
-
label:
|
|
562
|
-
})), y = x.filter((
|
|
552
|
+
}), Jr = /* @__PURE__ */ i.memo(function({ table: n, enableGrouping: l = !1 }) {
|
|
553
|
+
const a = n.getAllColumns().filter((R) => R.getCanSort()).map((R) => ({
|
|
554
|
+
id: R.id,
|
|
555
|
+
label: R.columnDef.meta?.label || R.columnDef.header || R.id
|
|
556
|
+
})), f = n.getAllColumns().filter((R) => R.getCanGroup?.() || R.columnDef.enableGrouping).map((R) => ({
|
|
557
|
+
id: R.id,
|
|
558
|
+
label: R.columnDef.meta?.label || R.columnDef.header || R.id
|
|
559
|
+
})), x = n.getAllColumns().filter((R) => typeof R.accessorFn < "u" && R.getCanHide()).map((R) => ({
|
|
560
|
+
id: R.id,
|
|
561
|
+
label: R.columnDef.meta?.label || R.columnDef.header || R.id
|
|
562
|
+
})), y = x.filter((R) => n.getColumn(R.id)?.getIsVisible()).map((R) => R.id), h = n.getState().sorting[0], p = h?.id, v = h?.desc ? "desc" : "asc", k = n.getState().grouping[0] || "";
|
|
563
563
|
return /* @__PURE__ */ t(
|
|
564
|
-
|
|
564
|
+
Wn,
|
|
565
565
|
{
|
|
566
566
|
sortableColumns: a,
|
|
567
567
|
selectedSortColumn: p,
|
|
568
568
|
sortDirection: v,
|
|
569
|
-
onSortChange: (
|
|
570
|
-
n.setSorting([{ id:
|
|
569
|
+
onSortChange: (R) => {
|
|
570
|
+
n.setSorting([{ id: R, desc: v === "desc" }]);
|
|
571
571
|
},
|
|
572
|
-
onSortDirectionChange: (
|
|
573
|
-
h && n.setSorting([{ id: h.id, desc:
|
|
572
|
+
onSortDirectionChange: (R) => {
|
|
573
|
+
h && n.setSorting([{ id: h.id, desc: R === "desc" }]);
|
|
574
574
|
},
|
|
575
|
-
groupableColumns:
|
|
576
|
-
selectedGroupColumn:
|
|
577
|
-
onGroupChange: (
|
|
578
|
-
!
|
|
575
|
+
groupableColumns: l ? f : [],
|
|
576
|
+
selectedGroupColumn: k,
|
|
577
|
+
onGroupChange: (R) => {
|
|
578
|
+
!R || R === "none" ? n.setGrouping([]) : n.setGrouping([R]);
|
|
579
579
|
},
|
|
580
580
|
columns: x,
|
|
581
581
|
visibleColumns: y,
|
|
582
|
-
onColumnVisibilityChange: (
|
|
583
|
-
n.getColumn(
|
|
582
|
+
onColumnVisibilityChange: (R, Ue) => {
|
|
583
|
+
n.getColumn(R)?.toggleVisibility(Ue);
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
586
|
);
|
|
587
|
-
}),
|
|
587
|
+
}), jo = /* @__PURE__ */ i.memo(function({
|
|
588
588
|
column: n,
|
|
589
|
-
title:
|
|
589
|
+
title: l,
|
|
590
590
|
className: a
|
|
591
591
|
}) {
|
|
592
592
|
const f = n.columnDef.meta?.align || "left", x = n.columnDef.meta?.truncate !== !1, y = n.getIsSorted();
|
|
@@ -607,13 +607,13 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
607
607
|
className: "h-4 w-4 !text-[var(--color-icon-brand-bold)]"
|
|
608
608
|
}
|
|
609
609
|
),
|
|
610
|
-
x ? /* @__PURE__ */ t(Te, { align: f, children: /* @__PURE__ */ t("span", { children:
|
|
610
|
+
x ? /* @__PURE__ */ t(Te, { align: f, children: /* @__PURE__ */ t("span", { children: l }) }) : /* @__PURE__ */ t("span", { children: l })
|
|
611
611
|
]
|
|
612
612
|
}
|
|
613
|
-
) : x ? /* @__PURE__ */ t(Te, { align: f, children: /* @__PURE__ */ t("div", { className: V(f === "right" ? "text-right" : "text-left", a), children:
|
|
614
|
-
}),
|
|
613
|
+
) : x ? /* @__PURE__ */ t(Te, { align: f, children: /* @__PURE__ */ t("div", { className: V(f === "right" ? "text-right" : "text-left", a), children: l }) }) : /* @__PURE__ */ t("div", { className: V(f === "right" ? "text-right" : "text-left", a), children: l });
|
|
614
|
+
}), lo = /* @__PURE__ */ i.memo(function({
|
|
615
615
|
table: n,
|
|
616
|
-
enableGrouping:
|
|
616
|
+
enableGrouping: l = !1,
|
|
617
617
|
hideChildrenForSingleItemGroups: a = {},
|
|
618
618
|
footerLabel: f,
|
|
619
619
|
onNextPageHover: x,
|
|
@@ -621,7 +621,7 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
621
621
|
paginationVariant: h = "full",
|
|
622
622
|
pageSizeOptions: p = [10, 25, 50, 100]
|
|
623
623
|
}) {
|
|
624
|
-
const v = n.getState().pagination.pageIndex + 1,
|
|
624
|
+
const v = n.getState().pagination.pageIndex + 1, I = n.getState().pagination.pageSize, k = l && !n.options.manualPagination ? n.getPrePaginationRowModel().rows.filter((M) => M.depth === 0).length : n.getRowCount(), T = n.getFilteredSelectedRowModel().rows.length, C = (M) => {
|
|
625
625
|
n.setPageIndex(M - 1);
|
|
626
626
|
}, A = (M) => {
|
|
627
627
|
n.setPageSize(M);
|
|
@@ -633,22 +633,22 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
633
633
|
"· ",
|
|
634
634
|
T,
|
|
635
635
|
" of ",
|
|
636
|
-
|
|
636
|
+
k,
|
|
637
637
|
" row(s) selected"
|
|
638
638
|
] })
|
|
639
639
|
] }) : T > 0 && /* @__PURE__ */ b("span", { children: [
|
|
640
640
|
T,
|
|
641
641
|
" of ",
|
|
642
|
-
|
|
642
|
+
k,
|
|
643
643
|
" row(s) selected."
|
|
644
644
|
] }) }),
|
|
645
645
|
/* @__PURE__ */ t(
|
|
646
|
-
|
|
646
|
+
Hn,
|
|
647
647
|
{
|
|
648
648
|
variant: h,
|
|
649
649
|
currentPage: v,
|
|
650
|
-
totalItems:
|
|
651
|
-
pageSize:
|
|
650
|
+
totalItems: k,
|
|
651
|
+
pageSize: I,
|
|
652
652
|
onPageChange: C,
|
|
653
653
|
onPageSizeChange: A,
|
|
654
654
|
pageSizeOptions: p,
|
|
@@ -657,14 +657,14 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
657
657
|
}
|
|
658
658
|
)
|
|
659
659
|
] });
|
|
660
|
-
}),
|
|
660
|
+
}), co = /* @__PURE__ */ i.memo(function({
|
|
661
661
|
onLoadMore: n,
|
|
662
|
-
isLoading:
|
|
662
|
+
isLoading: l
|
|
663
663
|
}) {
|
|
664
|
-
const a =
|
|
665
|
-
return
|
|
664
|
+
const a = i.useRef(null);
|
|
665
|
+
return i.useEffect(() => {
|
|
666
666
|
const f = a.current;
|
|
667
|
-
if (!f ||
|
|
667
|
+
if (!f || l) return;
|
|
668
668
|
const x = new IntersectionObserver(
|
|
669
669
|
(y) => {
|
|
670
670
|
y[0].isIntersecting && n();
|
|
@@ -672,26 +672,26 @@ const Yn = /* @__PURE__ */ l.memo(function({
|
|
|
672
672
|
{ threshold: 0.1 }
|
|
673
673
|
);
|
|
674
674
|
return x.observe(f), () => x.disconnect();
|
|
675
|
-
}, [n,
|
|
675
|
+
}, [n, l]), /* @__PURE__ */ t(
|
|
676
676
|
"div",
|
|
677
677
|
{
|
|
678
678
|
ref: a,
|
|
679
679
|
className: "flex justify-center py-[var(--space-m)] border-t border-[var(--color-border-primary-subtle)]",
|
|
680
|
-
children:
|
|
680
|
+
children: l && /* @__PURE__ */ t(qe, { size: "s" })
|
|
681
681
|
}
|
|
682
682
|
);
|
|
683
683
|
});
|
|
684
|
-
function
|
|
684
|
+
function uo(c) {
|
|
685
685
|
let n = 0;
|
|
686
|
-
const
|
|
686
|
+
const l = (a, f) => {
|
|
687
687
|
a.forEach((x) => {
|
|
688
|
-
x.depth > n && (n = x.depth), x.subRows && x.subRows.length > 0 &&
|
|
688
|
+
x.depth > n && (n = x.depth), x.subRows && x.subRows.length > 0 && l(x.subRows);
|
|
689
689
|
});
|
|
690
690
|
};
|
|
691
|
-
return
|
|
691
|
+
return l(c), n;
|
|
692
692
|
}
|
|
693
|
-
function
|
|
694
|
-
const { enableGrouping:
|
|
693
|
+
function $r(c, n) {
|
|
694
|
+
const { enableGrouping: l, enableExpanding: a, nestedRowStyling: f, expandingRowColors: x, maxDepth: y } = n, h = c.depth, p = c.getIsGrouped?.(), v = c.getIsExpanded(), I = c.subRows && c.subRows.length > 0, k = I ? v ? "expanded" : "collapsed" : "leaf", T = () => {
|
|
695
695
|
let C = c;
|
|
696
696
|
for (; C; ) {
|
|
697
697
|
if (C.getIsExpanded()) return !0;
|
|
@@ -704,11 +704,11 @@ function Vr(c, n) {
|
|
|
704
704
|
if (typeof C == "string")
|
|
705
705
|
return C;
|
|
706
706
|
if (typeof C == "object") {
|
|
707
|
-
if (
|
|
707
|
+
if (k === "expanded" && C.expanded)
|
|
708
708
|
return C.expanded;
|
|
709
|
-
if (
|
|
709
|
+
if (k === "collapsed" && C.collapsed)
|
|
710
710
|
return C.collapsed;
|
|
711
|
-
if (
|
|
711
|
+
if (k === "leaf" && C.leaf)
|
|
712
712
|
return C.leaf;
|
|
713
713
|
if (C.default)
|
|
714
714
|
return C.default;
|
|
@@ -725,9 +725,9 @@ function Vr(c, n) {
|
|
|
725
725
|
return x.collapsedParent;
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
|
-
return p ? v ? "var(--blue-50)" : "var(--color-background-neutral-subtlest)" :
|
|
728
|
+
return p ? v ? "var(--blue-50)" : "var(--color-background-neutral-subtlest)" : l && h === 1 ? "var(--blue-25)" : a && !p ? h === 0 && (!I || !T()) ? "" : (y - h) % 2 === 0 ? "var(--blue-25)" : "var(--blue-50)" : "";
|
|
729
729
|
}
|
|
730
|
-
function
|
|
730
|
+
function fo(c, n) {
|
|
731
731
|
if (n) {
|
|
732
732
|
if (n.heights && n.heights[c] !== void 0)
|
|
733
733
|
return n.heights[c];
|
|
@@ -735,8 +735,8 @@ function co(c, n) {
|
|
|
735
735
|
return n.defaultHeight;
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
function
|
|
739
|
-
const y = c.groupingColumnId, h = f[y] ?? !1, p = x[y] ?? !1,
|
|
738
|
+
function jr(c, n, l, a, f, x) {
|
|
739
|
+
const y = c.groupingColumnId, h = f[y] ?? !1, p = x[y] ?? !1, I = h && p && c.subRows.length <= 1 ? null : c.subRows.length > 1 ? /* @__PURE__ */ t(
|
|
740
740
|
"button",
|
|
741
741
|
{
|
|
742
742
|
tabIndex: -1,
|
|
@@ -753,44 +753,44 @@ function Fr(c, n, i, a, f, x) {
|
|
|
753
753
|
) : (
|
|
754
754
|
// Spacer to maintain alignment when there's only 1 item
|
|
755
755
|
/* @__PURE__ */ t("div", { className: "h-[var(--size-s)] w-[var(--size-s)]" })
|
|
756
|
-
),
|
|
757
|
-
if (
|
|
758
|
-
const T = n.getAllColumns().find((C) => C.id ===
|
|
756
|
+
), k = c.subRows.length > 1 ? /* @__PURE__ */ t(xe, { appearance: "subtle", size: "s", truncate: !1, children: c.subRows.length }) : null;
|
|
757
|
+
if (l) {
|
|
758
|
+
const T = n.getAllColumns().find((C) => C.id === l);
|
|
759
759
|
if (T) {
|
|
760
760
|
const C = T.columnDef;
|
|
761
761
|
if (C.aggregatedCell) {
|
|
762
|
-
const A = c.getAllCells().find((M) => M.column.id ===
|
|
762
|
+
const A = c.getAllCells().find((M) => M.column.id === l);
|
|
763
763
|
return /* @__PURE__ */ b("div", { className: "flex items-center gap-[var(--space-s)] font-medium text-[var(--color-text-primary)]", children: [
|
|
764
|
-
|
|
764
|
+
I,
|
|
765
765
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-[var(--space-s)]", children: [
|
|
766
766
|
A ? be(C.aggregatedCell, A.getContext()) : null,
|
|
767
|
-
|
|
767
|
+
k
|
|
768
768
|
] })
|
|
769
769
|
] });
|
|
770
770
|
} else {
|
|
771
|
-
const A = c.subRows[0]?.original?.[
|
|
771
|
+
const A = c.subRows[0]?.original?.[l];
|
|
772
772
|
return /* @__PURE__ */ b("div", { className: "flex items-center gap-[var(--space-s)] font-medium text-[var(--color-text-primary)]", children: [
|
|
773
|
-
|
|
773
|
+
I,
|
|
774
774
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-[var(--space-s)]", children: [
|
|
775
775
|
/* @__PURE__ */ t("span", { className: "font-medium", children: String(A) }),
|
|
776
|
-
|
|
776
|
+
k
|
|
777
777
|
] })
|
|
778
778
|
] });
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
782
|
return /* @__PURE__ */ b("div", { className: "flex items-center gap-[var(--space-s)] font-medium text-[var(--color-text-primary)]", children: [
|
|
783
|
-
|
|
783
|
+
I,
|
|
784
784
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-[var(--space-s)]", children: [
|
|
785
785
|
/* @__PURE__ */ t("span", { className: "font-medium", children: String(c.getGroupingValue(c.groupingColumnId)) }),
|
|
786
|
-
|
|
786
|
+
k
|
|
787
787
|
] })
|
|
788
788
|
] });
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function Ao({
|
|
791
791
|
columns: c,
|
|
792
792
|
data: n,
|
|
793
|
-
searchKey:
|
|
793
|
+
searchKey: l,
|
|
794
794
|
searchPlaceholder: a,
|
|
795
795
|
title: f,
|
|
796
796
|
caption: x,
|
|
@@ -798,128 +798,130 @@ function $o({
|
|
|
798
798
|
stickyHeader: h = !1,
|
|
799
799
|
stickyFirstColumn: p = !1,
|
|
800
800
|
stickyLeftColumns: v = 0,
|
|
801
|
-
stickyRightColumns:
|
|
802
|
-
enableResponsiveWrapper:
|
|
801
|
+
stickyRightColumns: I = 0,
|
|
802
|
+
enableResponsiveWrapper: k = !0,
|
|
803
803
|
showScrollIndicators: T = !1,
|
|
804
804
|
minTableWidth: C = "900px",
|
|
805
805
|
isLoading: A = !1,
|
|
806
806
|
loadingBehavior: M = "replace",
|
|
807
|
-
loadingRowCount:
|
|
807
|
+
loadingRowCount: R = 10,
|
|
808
808
|
borderStyle: Ue = "both",
|
|
809
809
|
defaultVerticalAlign: Ie = "middle",
|
|
810
|
-
enableGlobalSearch:
|
|
811
|
-
globalSearchPlaceholder:
|
|
812
|
-
enableAutocomplete:
|
|
810
|
+
enableGlobalSearch: le = !1,
|
|
811
|
+
globalSearchPlaceholder: Kr = "Search all columns...",
|
|
812
|
+
enableAutocomplete: pt = !1,
|
|
813
813
|
globalSearchColumns: Je,
|
|
814
|
-
autocompleteMinCharacters:
|
|
815
|
-
enableGlobalFaceting:
|
|
814
|
+
autocompleteMinCharacters: Xr = 2,
|
|
815
|
+
enableGlobalFaceting: Qr = !1,
|
|
816
816
|
enableColumnResizing: te = !1,
|
|
817
|
-
columnResizeMode:
|
|
817
|
+
columnResizeMode: Yr = "onChange",
|
|
818
818
|
enableColumnResizePersistence: Ke = !1,
|
|
819
|
-
enablePaginationPersistence:
|
|
819
|
+
enablePaginationPersistence: vt = !1,
|
|
820
820
|
storageKey: Y = "data-table-columns",
|
|
821
821
|
enableExpanding: _ = !1,
|
|
822
|
-
getSubRows:
|
|
822
|
+
getSubRows: Zr,
|
|
823
823
|
expandingRowColors: O,
|
|
824
|
-
nestedRowStyling:
|
|
824
|
+
nestedRowStyling: bt,
|
|
825
825
|
enableGrouping: z = !1,
|
|
826
|
-
groupedColumnMode:
|
|
827
|
-
enableManualGrouping:
|
|
826
|
+
groupedColumnMode: es = !1,
|
|
827
|
+
enableManualGrouping: ts = !1,
|
|
828
828
|
groupDisplayColumn: Xe,
|
|
829
829
|
hideChildrenForSingleItemGroups: ye = {},
|
|
830
|
-
hideExpanderForSingleItemGroups:
|
|
830
|
+
hideExpanderForSingleItemGroups: jt = {},
|
|
831
831
|
enableRowPinning: Ee = !1,
|
|
832
|
-
keepPinnedRows:
|
|
833
|
-
enableVirtualization:
|
|
832
|
+
keepPinnedRows: At = !0,
|
|
833
|
+
enableVirtualization: rs = !1,
|
|
834
834
|
// virtualContainerHeight = 600,
|
|
835
835
|
// virtualRowHeight = 40,
|
|
836
836
|
// virtualOverscan = 10,
|
|
837
837
|
nestedHeaders: Qe = [],
|
|
838
|
-
enableNestedHeaders:
|
|
838
|
+
enableNestedHeaders: ss = !1,
|
|
839
839
|
enableColumnOrdering: Ye = !1,
|
|
840
840
|
enableRowSelection: fe = !1,
|
|
841
841
|
showHeader: Me = !0,
|
|
842
|
-
showPagination:
|
|
843
|
-
paginationVariant:
|
|
844
|
-
pageSizeOptions:
|
|
845
|
-
footerLabel:
|
|
846
|
-
onTableReady:
|
|
842
|
+
showPagination: xt = !0,
|
|
843
|
+
paginationVariant: ns = "full",
|
|
844
|
+
pageSizeOptions: os = [10, 25, 50, 100],
|
|
845
|
+
footerLabel: as,
|
|
846
|
+
onTableReady: yt,
|
|
847
847
|
initialState: Ve,
|
|
848
848
|
// Controlled state props
|
|
849
|
-
sorting:
|
|
850
|
-
onSortingChange:
|
|
851
|
-
columnVisibility:
|
|
852
|
-
onColumnVisibilityChange:
|
|
853
|
-
grouping:
|
|
854
|
-
onGroupingChange:
|
|
855
|
-
columnOrder:
|
|
856
|
-
onColumnOrderChange:
|
|
857
|
-
columnSizing:
|
|
858
|
-
onColumnSizingChange:
|
|
859
|
-
pagination:
|
|
860
|
-
onPaginationChange:
|
|
849
|
+
sorting: Lt,
|
|
850
|
+
onSortingChange: is,
|
|
851
|
+
columnVisibility: Ot,
|
|
852
|
+
onColumnVisibilityChange: ls,
|
|
853
|
+
grouping: Ht,
|
|
854
|
+
onGroupingChange: cs,
|
|
855
|
+
columnOrder: Wt,
|
|
856
|
+
onColumnOrderChange: ds,
|
|
857
|
+
columnSizing: Ct,
|
|
858
|
+
onColumnSizingChange: us,
|
|
859
|
+
pagination: Gt,
|
|
860
|
+
onPaginationChange: fs,
|
|
861
861
|
expanded: Ce,
|
|
862
|
-
onExpandedChange:
|
|
863
|
-
renderSectionHeaderRow:
|
|
862
|
+
onExpandedChange: wt,
|
|
863
|
+
renderSectionHeaderRow: _t,
|
|
864
864
|
renderSubComponent: J,
|
|
865
|
-
getRowCanExpand:
|
|
866
|
-
autoExpandChildren:
|
|
865
|
+
getRowCanExpand: gs,
|
|
866
|
+
autoExpandChildren: qt = !1,
|
|
867
867
|
// Row click props
|
|
868
868
|
onRowClick: K,
|
|
869
|
+
onRowMouseEnter: Ze,
|
|
870
|
+
onRowMouseLeave: et,
|
|
869
871
|
isRowClickable: we,
|
|
870
|
-
clickableRowClassName:
|
|
871
|
-
groupPreservingSearch:
|
|
872
|
+
clickableRowClassName: Ut,
|
|
873
|
+
groupPreservingSearch: tt = !1,
|
|
872
874
|
// Active row props
|
|
873
875
|
activeRowId: Fe,
|
|
874
|
-
activeRowClassName:
|
|
875
|
-
getRowId:
|
|
876
|
-
onActiveRowChange:
|
|
876
|
+
activeRowClassName: Jt,
|
|
877
|
+
getRowId: St,
|
|
878
|
+
onActiveRowChange: Kt,
|
|
877
879
|
// Callback props
|
|
878
|
-
onRowSelectionChange:
|
|
879
|
-
onNextPageHover:
|
|
880
|
-
onPreviousPageHover:
|
|
881
|
-
onRowUpdate:
|
|
880
|
+
onRowSelectionChange: Nt,
|
|
881
|
+
onNextPageHover: ms,
|
|
882
|
+
onPreviousPageHover: hs,
|
|
883
|
+
onRowUpdate: go,
|
|
882
884
|
// Infinite scroll props
|
|
883
|
-
onLoadMore:
|
|
884
|
-
hasMoreData:
|
|
885
|
-
isLoadingMore:
|
|
885
|
+
onLoadMore: Xt,
|
|
886
|
+
hasMoreData: ps,
|
|
887
|
+
isLoadingMore: vs,
|
|
886
888
|
// Error handling props
|
|
887
|
-
error:
|
|
888
|
-
onRetry:
|
|
889
|
-
errorComponent:
|
|
889
|
+
error: Qt,
|
|
890
|
+
onRetry: bs,
|
|
891
|
+
errorComponent: xs,
|
|
890
892
|
// Empty state props
|
|
891
|
-
emptyState:
|
|
892
|
-
emptyStateTitle:
|
|
893
|
-
emptyStateDescription:
|
|
894
|
-
emptyStateAction:
|
|
893
|
+
emptyState: ys,
|
|
894
|
+
emptyStateTitle: Cs = "No data",
|
|
895
|
+
emptyStateDescription: ws = "No items to display",
|
|
896
|
+
emptyStateAction: Ss,
|
|
895
897
|
// No results state props
|
|
896
|
-
noResultsState:
|
|
897
|
-
noResultsTitle:
|
|
898
|
-
noResultsDescription:
|
|
899
|
-
noResultsAction:
|
|
898
|
+
noResultsState: Ns,
|
|
899
|
+
noResultsTitle: Rs = "No results found",
|
|
900
|
+
noResultsDescription: Is = "Try adjusting your search or filters",
|
|
901
|
+
noResultsAction: Es,
|
|
900
902
|
// Refetching props
|
|
901
|
-
isRefetching:
|
|
903
|
+
isRefetching: Ds = !1,
|
|
902
904
|
// Server-side mode props
|
|
903
|
-
manualSorting:
|
|
904
|
-
manualFiltering:
|
|
905
|
-
manualPagination:
|
|
906
|
-
rowCount:
|
|
905
|
+
manualSorting: Yt = !1,
|
|
906
|
+
manualFiltering: Zt = !1,
|
|
907
|
+
manualPagination: rt = !1,
|
|
908
|
+
rowCount: ks,
|
|
907
909
|
// Server-side expansion props
|
|
908
|
-
manualExpanding:
|
|
909
|
-
onLoadChildren:
|
|
910
|
-
expandingRowsLoading:
|
|
911
|
-
subComponentLoading:
|
|
910
|
+
manualExpanding: er = !1,
|
|
911
|
+
onLoadChildren: st,
|
|
912
|
+
expandingRowsLoading: nt,
|
|
913
|
+
subComponentLoading: ot,
|
|
912
914
|
onSubComponentLoad: De,
|
|
913
915
|
// Server-side error handling props
|
|
914
|
-
expandingRowsError:
|
|
915
|
-
subComponentError:
|
|
916
|
+
expandingRowsError: mo,
|
|
917
|
+
subComponentError: tr,
|
|
916
918
|
onExpandError: $e
|
|
917
919
|
}) {
|
|
918
|
-
const
|
|
920
|
+
const at = k || !!(v && v > 0) || !!(I && I > 0), [zs, Bs] = i.useState([]), [Ts, Ps] = i.useState({}), [Ms, Vs] = i.useState(Ve?.grouping || []), [Fs, $s] = i.useState(() => {
|
|
919
921
|
const e = c.map((r) => r.id || r.accessorKey || `column-${Math.random()}`);
|
|
920
922
|
return fe ? ["select", ...e] : e;
|
|
921
|
-
}), [
|
|
922
|
-
if (
|
|
923
|
+
}), [js, As] = i.useState(Ct || Ve?.columnSizing || {}), [Ls, Os] = i.useState(() => {
|
|
924
|
+
if (vt && Y) {
|
|
923
925
|
const e = localStorage.getItem(`${Y}-pagination`);
|
|
924
926
|
if (e)
|
|
925
927
|
try {
|
|
@@ -931,27 +933,27 @@ function $o({
|
|
|
931
933
|
}
|
|
932
934
|
}
|
|
933
935
|
return Ve?.pagination || { pageIndex: 0, pageSize: 10 };
|
|
934
|
-
}), [
|
|
935
|
-
|
|
936
|
+
}), [rr, Hs] = i.useState([]), [ke, Ws] = i.useState({}), [Rt, sr] = i.useState(""), [Gs, nr] = i.useState(Ve?.expanded || {}), [_s, qs] = i.useState(Ve?.rowPinning || { top: [], bottom: [] }), [Us, it] = i.useState(""), [X, It] = i.useState([-1, 0]), Et = i.useRef(null), je = i.useRef(/* @__PURE__ */ new Map()), Ae = i.useRef(/* @__PURE__ */ new Map());
|
|
937
|
+
i.useEffect(() => () => {
|
|
936
938
|
je.current.forEach((e) => e.abort()), Ae.current.forEach((e) => e.abort());
|
|
937
|
-
}, []),
|
|
938
|
-
|
|
939
|
-
}, [ke,
|
|
940
|
-
|
|
941
|
-
}, [Fe,
|
|
942
|
-
const
|
|
939
|
+
}, []), i.useEffect(() => {
|
|
940
|
+
Nt && Nt(ke);
|
|
941
|
+
}, [ke, Nt]), i.useEffect(() => {
|
|
942
|
+
Kt?.(Fe);
|
|
943
|
+
}, [Fe, Kt]);
|
|
944
|
+
const or = Lt !== void 0, ar = Ot !== void 0, ir = Ht !== void 0, lr = Wt !== void 0, cr = Ct !== void 0, dr = Gt !== void 0, Dt = Ce !== void 0, ge = or ? Lt : zs, Js = ar ? Ot : Ts, me = ir ? Ht : Ms, Le = lr ? Wt : Fs, lt = cr ? Ct : js, re = dr ? Gt : Ls, Q = Dt ? Ce : Gs, Ks = or ? is : Bs, Xs = ar ? ls : Ps, Qs = ir ? cs : Vs, ur = lr ? ds : $s, fr = cr ? us : As, Ys = dr ? fs : Os, kt = i.useCallback(
|
|
943
945
|
(e) => {
|
|
944
946
|
const r = typeof e == "object" && e !== null && !(e instanceof Function) && Object.keys(e).length === 0;
|
|
945
|
-
if (
|
|
947
|
+
if (Dt && wt) {
|
|
946
948
|
if (r && (Ce === !0 || typeof Ce == "object" && Ce !== null && Object.keys(Ce).length > 0))
|
|
947
949
|
return;
|
|
948
|
-
|
|
950
|
+
wt(e);
|
|
949
951
|
} else
|
|
950
|
-
|
|
952
|
+
nr(r ? (s) => s === !0 || typeof s == "object" && s !== null && Object.keys(s).length > 0 ? s : e : e);
|
|
951
953
|
},
|
|
952
|
-
[
|
|
953
|
-
),
|
|
954
|
-
if (!
|
|
954
|
+
[Dt, wt, Ce]
|
|
955
|
+
), Zs = i.useMemo(() => R !== void 0 && R !== 10 ? R : re.pageSize, [R, re.pageSize]), L = Jn(Rt, 300), en = i.useMemo(() => {
|
|
956
|
+
if (!pt || !le)
|
|
955
957
|
return [];
|
|
956
958
|
const e = /* @__PURE__ */ new Set();
|
|
957
959
|
return n.forEach((r) => {
|
|
@@ -962,7 +964,7 @@ function $o({
|
|
|
962
964
|
s != null && String(s).trim() !== "" && e.add(String(s));
|
|
963
965
|
});
|
|
964
966
|
}), Array.from(e).sort();
|
|
965
|
-
}, [n, Je,
|
|
967
|
+
}, [n, Je, pt, le]), gr = i.useCallback((e, r, s) => {
|
|
966
968
|
if (!e || !r || r.length === 0)
|
|
967
969
|
return () => !0;
|
|
968
970
|
const u = e.toLowerCase(), g = /* @__PURE__ */ new Set();
|
|
@@ -988,22 +990,22 @@ function $o({
|
|
|
988
990
|
return !1;
|
|
989
991
|
};
|
|
990
992
|
}, []);
|
|
991
|
-
|
|
993
|
+
i.useEffect(() => {
|
|
992
994
|
if (Ke && Y) {
|
|
993
995
|
const e = localStorage.getItem(`${Y}-sizing`);
|
|
994
996
|
if (e)
|
|
995
997
|
try {
|
|
996
|
-
|
|
998
|
+
fr(JSON.parse(e));
|
|
997
999
|
} catch (r) {
|
|
998
1000
|
console.warn("Failed to parse saved column sizing:", r);
|
|
999
1001
|
}
|
|
1000
1002
|
}
|
|
1001
|
-
}, [Ke, Y]),
|
|
1002
|
-
Ke && Y && Object.keys(
|
|
1003
|
-
}, [
|
|
1004
|
-
|
|
1005
|
-
}, [re,
|
|
1006
|
-
const E =
|
|
1003
|
+
}, [Ke, Y]), i.useEffect(() => {
|
|
1004
|
+
Ke && Y && Object.keys(lt).length > 0 && localStorage.setItem(`${Y}-sizing`, JSON.stringify(lt));
|
|
1005
|
+
}, [lt, Ke, Y]), i.useEffect(() => {
|
|
1006
|
+
vt && Y && localStorage.setItem(`${Y}-pagination`, JSON.stringify(re));
|
|
1007
|
+
}, [re, vt, Y]);
|
|
1008
|
+
const E = i.useMemo(() => {
|
|
1007
1009
|
switch (Ue) {
|
|
1008
1010
|
case "horizontal":
|
|
1009
1011
|
return { showRowBorder: !0, showCellBorder: !1 };
|
|
@@ -1016,7 +1018,7 @@ function $o({
|
|
|
1016
1018
|
default:
|
|
1017
1019
|
return { showRowBorder: !0, showCellBorder: !0 };
|
|
1018
1020
|
}
|
|
1019
|
-
}, [Ue]),
|
|
1021
|
+
}, [Ue]), zt = i.useCallback((e, r) => {
|
|
1020
1022
|
if (!K) return;
|
|
1021
1023
|
const s = r.target;
|
|
1022
1024
|
if (!(s.tagName === "BUTTON" || s.tagName === "A" || s.tagName === "INPUT" || s.closest("button") || s.closest("a") || s.closest("input")) && !(we && !we(e))) {
|
|
@@ -1026,17 +1028,17 @@ function $o({
|
|
|
1026
1028
|
}
|
|
1027
1029
|
K(e, r);
|
|
1028
1030
|
}
|
|
1029
|
-
}, [K, we, ye]), Se =
|
|
1031
|
+
}, [K, we, ye]), Se = i.useCallback((e) => {
|
|
1030
1032
|
if (!K) return !1;
|
|
1031
1033
|
if (we) return we(e);
|
|
1032
1034
|
if (!e.getIsGrouped()) return !0;
|
|
1033
1035
|
const s = e.groupingColumnId;
|
|
1034
1036
|
return (ye[s] ?? !1) && e.subRows && e.subRows.length === 1;
|
|
1035
|
-
}, [K, we, ye]),
|
|
1037
|
+
}, [K, we, ye]), mr = (e) => e ? "![box-shadow:inset_3px_0_0_0_var(--color-border-brand-bold),inset_0_-1px_0_0_var(--color-border-primary-medium)]" : "![box-shadow:inset_3px_0_0_0_var(--color-border-brand-bold)]", ze = i.useCallback((e) => {
|
|
1036
1038
|
if (!Fe) return !1;
|
|
1037
|
-
const r =
|
|
1039
|
+
const r = St ? e.id : e.original?.id !== void 0 ? e.original.id : e.id;
|
|
1038
1040
|
return String(r) === String(Fe);
|
|
1039
|
-
}, [Fe,
|
|
1041
|
+
}, [Fe, St]), Oe = i.useMemo(() => p ? 1 : v || 0, [p, v]), Ne = i.useMemo(() => I || 0, [I]), hr = i.useMemo(() => {
|
|
1040
1042
|
const e = /* @__PURE__ */ new Set();
|
|
1041
1043
|
return c.forEach((r) => {
|
|
1042
1044
|
if (r.cell) {
|
|
@@ -1044,7 +1046,7 @@ function $o({
|
|
|
1044
1046
|
s && e.add(String(s));
|
|
1045
1047
|
}
|
|
1046
1048
|
}), e;
|
|
1047
|
-
}, [c]),
|
|
1049
|
+
}, [c]), Bt = i.useMemo(() => {
|
|
1048
1050
|
const e = c.map((r) => {
|
|
1049
1051
|
let s = {
|
|
1050
1052
|
...r,
|
|
@@ -1067,7 +1069,7 @@ function $o({
|
|
|
1067
1069
|
maxSize: 48,
|
|
1068
1070
|
enableResizing: !1,
|
|
1069
1071
|
header: ({ table: s }) => /* @__PURE__ */ t(
|
|
1070
|
-
|
|
1072
|
+
ht,
|
|
1071
1073
|
{
|
|
1072
1074
|
tabIndex: -1,
|
|
1073
1075
|
checked: s.getIsAllPageRowsSelected() || s.getIsSomePageRowsSelected() && "indeterminate",
|
|
@@ -1076,7 +1078,7 @@ function $o({
|
|
|
1076
1078
|
}
|
|
1077
1079
|
),
|
|
1078
1080
|
cell: ({ row: s }) => /* @__PURE__ */ t(
|
|
1079
|
-
|
|
1081
|
+
ht,
|
|
1080
1082
|
{
|
|
1081
1083
|
tabIndex: -1,
|
|
1082
1084
|
checked: s.getIsSelected(),
|
|
@@ -1091,95 +1093,95 @@ function $o({
|
|
|
1091
1093
|
label: "Select"
|
|
1092
1094
|
}
|
|
1093
1095
|
}, ...e] : e;
|
|
1094
|
-
}, [c, fe]),
|
|
1095
|
-
data:
|
|
1096
|
-
columns:
|
|
1097
|
-
getRowId:
|
|
1096
|
+
}, [c, fe]), Tt = i.useMemo(() => n, [n]), tn = i.useMemo(() => !tt || !L ? zr : gr(L, me, Tt), [tt, L, me, Tt, gr]), w = dn({
|
|
1097
|
+
data: Tt,
|
|
1098
|
+
columns: Bt,
|
|
1099
|
+
getRowId: St,
|
|
1098
1100
|
filterFns: {
|
|
1099
|
-
fuzzy:
|
|
1100
|
-
multiSelect:
|
|
1101
|
+
fuzzy: zr,
|
|
1102
|
+
multiSelect: Kn
|
|
1101
1103
|
},
|
|
1102
1104
|
state: {
|
|
1103
1105
|
sorting: ge,
|
|
1104
|
-
columnFilters:
|
|
1105
|
-
columnVisibility:
|
|
1106
|
+
columnFilters: rr,
|
|
1107
|
+
columnVisibility: Js,
|
|
1106
1108
|
rowSelection: ke,
|
|
1107
1109
|
globalFilter: L,
|
|
1108
|
-
columnSizing:
|
|
1110
|
+
columnSizing: lt,
|
|
1109
1111
|
expanded: Q,
|
|
1110
1112
|
grouping: me,
|
|
1111
|
-
rowPinning:
|
|
1113
|
+
rowPinning: _s,
|
|
1112
1114
|
columnOrder: Le,
|
|
1113
1115
|
pagination: re
|
|
1114
1116
|
},
|
|
1115
1117
|
// Server-side mode configuration
|
|
1116
|
-
manualSorting:
|
|
1117
|
-
manualFiltering:
|
|
1118
|
-
manualPagination:
|
|
1119
|
-
rowCount:
|
|
1118
|
+
manualSorting: Yt,
|
|
1119
|
+
manualFiltering: Zt,
|
|
1120
|
+
manualPagination: rt,
|
|
1121
|
+
rowCount: ks,
|
|
1120
1122
|
// Required for server-side pagination
|
|
1121
1123
|
enableRowSelection: fe,
|
|
1122
1124
|
enableColumnPinning: !1,
|
|
1123
1125
|
// Disable TanStack Table pinning - using CSS approach
|
|
1124
|
-
enableGlobalFilter:
|
|
1126
|
+
enableGlobalFilter: le,
|
|
1125
1127
|
// Enable global filtering
|
|
1126
|
-
globalFilterFn:
|
|
1128
|
+
globalFilterFn: tn,
|
|
1127
1129
|
// Use group-preserving filter when enabled
|
|
1128
1130
|
enableColumnResizing: te,
|
|
1129
|
-
columnResizeMode:
|
|
1131
|
+
columnResizeMode: Yr,
|
|
1130
1132
|
enableExpanding: _,
|
|
1131
|
-
getSubRows:
|
|
1132
|
-
getRowCanExpand:
|
|
1133
|
+
getSubRows: Zr,
|
|
1134
|
+
getRowCanExpand: gs,
|
|
1133
1135
|
paginateExpandedRows: !1,
|
|
1134
1136
|
// Only paginate top-level rows, not expanded children
|
|
1135
1137
|
autoResetPageIndex: !1,
|
|
1136
1138
|
// Prevent pagination from resetting on data/filter/grouping changes
|
|
1137
1139
|
enableGrouping: z,
|
|
1138
|
-
groupedColumnMode:
|
|
1139
|
-
manualGrouping:
|
|
1140
|
+
groupedColumnMode: es,
|
|
1141
|
+
manualGrouping: ts,
|
|
1140
1142
|
enableRowPinning: Ee,
|
|
1141
|
-
keepPinnedRows:
|
|
1142
|
-
onRowSelectionChange:
|
|
1143
|
-
onSortingChange:
|
|
1144
|
-
onColumnFiltersChange:
|
|
1145
|
-
onColumnVisibilityChange:
|
|
1146
|
-
onGlobalFilterChange:
|
|
1147
|
-
onColumnSizingChange:
|
|
1148
|
-
onExpandedChange:
|
|
1149
|
-
onGroupingChange:
|
|
1150
|
-
onRowPinningChange:
|
|
1151
|
-
onColumnOrderChange:
|
|
1152
|
-
onPaginationChange:
|
|
1153
|
-
getCoreRowModel:
|
|
1143
|
+
keepPinnedRows: At,
|
|
1144
|
+
onRowSelectionChange: Ws,
|
|
1145
|
+
onSortingChange: Ks,
|
|
1146
|
+
onColumnFiltersChange: Hs,
|
|
1147
|
+
onColumnVisibilityChange: Xs,
|
|
1148
|
+
onGlobalFilterChange: sr,
|
|
1149
|
+
onColumnSizingChange: fr,
|
|
1150
|
+
onExpandedChange: kt,
|
|
1151
|
+
onGroupingChange: Qs,
|
|
1152
|
+
onRowPinningChange: qs,
|
|
1153
|
+
onColumnOrderChange: ur,
|
|
1154
|
+
onPaginationChange: Ys,
|
|
1155
|
+
getCoreRowModel: xn(),
|
|
1154
1156
|
// Conditionally include row models based on manual mode
|
|
1155
|
-
getFilteredRowModel:
|
|
1156
|
-
getPaginationRowModel:
|
|
1157
|
-
getSortedRowModel:
|
|
1158
|
-
getExpandedRowModel: _ ?
|
|
1159
|
-
getGroupedRowModel: z ?
|
|
1160
|
-
getFacetedRowModel:
|
|
1161
|
-
getFacetedUniqueValues:
|
|
1162
|
-
getFacetedMinMaxValues:
|
|
1163
|
-
}),
|
|
1164
|
-
() =>
|
|
1157
|
+
getFilteredRowModel: Zt ? void 0 : bn(),
|
|
1158
|
+
getPaginationRowModel: rt || rs ? void 0 : vn(),
|
|
1159
|
+
getSortedRowModel: Yt ? void 0 : pn(),
|
|
1160
|
+
getExpandedRowModel: _ ? hn() : void 0,
|
|
1161
|
+
getGroupedRowModel: z ? mn() : void 0,
|
|
1162
|
+
getFacetedRowModel: gn(),
|
|
1163
|
+
getFacetedUniqueValues: fn(),
|
|
1164
|
+
getFacetedMinMaxValues: un()
|
|
1165
|
+
}), ct = i.useMemo(
|
|
1166
|
+
() => uo(w.getRowModel().rows),
|
|
1165
1167
|
[w.getRowModel().rows]
|
|
1166
|
-
),
|
|
1168
|
+
), dt = i.useMemo(() => {
|
|
1167
1169
|
if (!z) return null;
|
|
1168
1170
|
const e = /* @__PURE__ */ new Map();
|
|
1169
1171
|
return w.getGroupedRowModel?.()?.rows?.forEach((s) => {
|
|
1170
1172
|
s.subRows && s.subRows.length > 0 && e.set(s.id, s.subRows);
|
|
1171
1173
|
}), e;
|
|
1172
|
-
}, [z, w]), { flatVisibleRows:
|
|
1174
|
+
}, [z, w]), { flatVisibleRows: ut, rowIdToFlatIndex: pr } = i.useMemo(() => {
|
|
1173
1175
|
const e = [], r = /* @__PURE__ */ new Map(), s = (g) => {
|
|
1174
1176
|
const m = e.length;
|
|
1175
|
-
e.push(g), r.set(g.id, m), g.getIsExpanded() && (g.subRows && g.subRows.length > 0 ? g.subRows :
|
|
1177
|
+
e.push(g), r.set(g.id, m), g.getIsExpanded() && (g.subRows && g.subRows.length > 0 ? g.subRows : dt?.get(g.id) || []).forEach(s);
|
|
1176
1178
|
};
|
|
1177
1179
|
return w.getRowModel().rows.filter((g) => J || g.depth === 0).forEach(s), { flatVisibleRows: e, rowIdToFlatIndex: r };
|
|
1178
|
-
}, [w, Q,
|
|
1179
|
-
|
|
1180
|
+
}, [w, Q, dt, J]), vr = i.useRef(void 0);
|
|
1181
|
+
i.useEffect(() => {
|
|
1180
1182
|
if (!z) return;
|
|
1181
1183
|
const r = w.getPrePaginationRowModel().rows.filter((g) => g.depth === 0).length, s = re.pageSize, u = Math.max(1, Math.ceil(r / s));
|
|
1182
|
-
|
|
1184
|
+
vr.current !== u && (vr.current = u, w.setPageCount(u));
|
|
1183
1185
|
}, [
|
|
1184
1186
|
z,
|
|
1185
1187
|
// NOTE: Deliberately NOT including 'table' to avoid re-running on every render
|
|
@@ -1190,26 +1192,26 @@ function $o({
|
|
|
1190
1192
|
w.getPrePaginationRowModel().rows.length
|
|
1191
1193
|
// Row count changes
|
|
1192
1194
|
]);
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1195
|
-
if (!
|
|
1196
|
-
const e = w.getState().expanded, r =
|
|
1195
|
+
const br = i.useRef({});
|
|
1196
|
+
i.useEffect(() => {
|
|
1197
|
+
if (!qt) return;
|
|
1198
|
+
const e = w.getState().expanded, r = br.current, s = { ...e };
|
|
1197
1199
|
let u = !1;
|
|
1198
1200
|
w.getRowModel().rows.forEach((g) => {
|
|
1199
1201
|
const m = g.id, S = e[m] === !0, B = r[m] === !0;
|
|
1200
1202
|
S && !B && g.subRows && g.subRows.length > 0 && g.subRows.forEach((F) => {
|
|
1201
1203
|
e[F.id] !== !0 && (s[F.id] = !0, u = !0);
|
|
1202
1204
|
});
|
|
1203
|
-
}),
|
|
1205
|
+
}), br.current = e, u && kt(s);
|
|
1204
1206
|
}, [
|
|
1205
1207
|
Q,
|
|
1206
|
-
|
|
1208
|
+
qt
|
|
1207
1209
|
// NOTE: Deliberately NOT including 'table' to avoid re-running on every render
|
|
1208
1210
|
]);
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1211
|
-
if (!
|
|
1212
|
-
const e = w.getState().expanded, r =
|
|
1211
|
+
const xr = i.useRef({});
|
|
1212
|
+
i.useEffect(() => {
|
|
1213
|
+
if (!st && !De) return;
|
|
1214
|
+
const e = w.getState().expanded, r = xr.current;
|
|
1213
1215
|
Object.keys(r).forEach((s) => {
|
|
1214
1216
|
const u = r[s], g = e[s];
|
|
1215
1217
|
if (u && !g) {
|
|
@@ -1223,18 +1225,18 @@ function $o({
|
|
|
1223
1225
|
if (u && !g) {
|
|
1224
1226
|
const m = w.getRow(s);
|
|
1225
1227
|
if (!m) return;
|
|
1226
|
-
if (
|
|
1227
|
-
const S = m.getIsGrouped() || m.subRows && m.subRows.length === 0 && m.getCanExpand(), B =
|
|
1228
|
+
if (st && er) {
|
|
1229
|
+
const S = m.getIsGrouped() || m.subRows && m.subRows.length === 0 && m.getCanExpand(), B = nt?.[s] === !0, F = m.subRows && m.subRows.length > 0;
|
|
1228
1230
|
if (S && !B && !F) {
|
|
1229
1231
|
const o = new AbortController();
|
|
1230
|
-
je.current.set(s, o), Promise.resolve(
|
|
1232
|
+
je.current.set(s, o), Promise.resolve(st(m)).catch((P) => {
|
|
1231
1233
|
P?.name !== "AbortError" && $e && $e(m, P, "children");
|
|
1232
1234
|
}).finally(() => {
|
|
1233
1235
|
je.current.delete(s);
|
|
1234
1236
|
});
|
|
1235
1237
|
}
|
|
1236
1238
|
}
|
|
1237
|
-
if (De && J && !m.getIsGrouped() && m.depth === 0 && !(
|
|
1239
|
+
if (De && J && !m.getIsGrouped() && m.depth === 0 && !(ot?.[s] === !0)) {
|
|
1238
1240
|
const B = new AbortController();
|
|
1239
1241
|
Ae.current.set(s, B), Promise.resolve(De(m)).catch((F) => {
|
|
1240
1242
|
F?.name !== "AbortError" && $e && $e(m, F, "subComponent");
|
|
@@ -1243,59 +1245,59 @@ function $o({
|
|
|
1243
1245
|
});
|
|
1244
1246
|
}
|
|
1245
1247
|
}
|
|
1246
|
-
}),
|
|
1248
|
+
}), xr.current = e;
|
|
1247
1249
|
}, [
|
|
1248
1250
|
Q,
|
|
1249
|
-
|
|
1251
|
+
st,
|
|
1250
1252
|
De,
|
|
1251
|
-
|
|
1253
|
+
er,
|
|
1252
1254
|
J,
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
+
nt,
|
|
1256
|
+
ot,
|
|
1255
1257
|
$e
|
|
1256
1258
|
// NOTE: Deliberately NOT including 'table' to avoid re-running on every render
|
|
1257
|
-
]),
|
|
1258
|
-
if (!
|
|
1259
|
+
]), i.useEffect(() => {
|
|
1260
|
+
if (!tt || !L || !z)
|
|
1259
1261
|
return;
|
|
1260
1262
|
const e = {};
|
|
1261
1263
|
w.getFilteredRowModel().rows.forEach((s) => {
|
|
1262
1264
|
s.getIsGrouped() && s.subRows && s.subRows.length > 0 && (e[s.id] = !0);
|
|
1263
|
-
}),
|
|
1265
|
+
}), kt((s) => {
|
|
1264
1266
|
const u = Object.keys(s).sort().join(","), g = Object.keys(e).sort().join(",");
|
|
1265
1267
|
return u === g ? s : e;
|
|
1266
1268
|
});
|
|
1267
|
-
}, [L,
|
|
1268
|
-
const
|
|
1269
|
-
|
|
1270
|
-
if (!
|
|
1271
|
-
const e = JSON.stringify(me) !== JSON.stringify(
|
|
1272
|
-
(e || r) && w.setPageIndex(0),
|
|
1273
|
-
}, [me, ge,
|
|
1274
|
-
|
|
1275
|
-
}, [w,
|
|
1269
|
+
}, [L, tt, z]);
|
|
1270
|
+
const yr = i.useRef(me), Cr = i.useRef(ge);
|
|
1271
|
+
i.useEffect(() => {
|
|
1272
|
+
if (!rt) return;
|
|
1273
|
+
const e = JSON.stringify(me) !== JSON.stringify(yr.current), r = JSON.stringify(ge) !== JSON.stringify(Cr.current);
|
|
1274
|
+
(e || r) && w.setPageIndex(0), yr.current = me, Cr.current = ge;
|
|
1275
|
+
}, [me, ge, rt, w]), i.useEffect(() => {
|
|
1276
|
+
yt && yt(w);
|
|
1277
|
+
}, [w, yt]), i.useEffect(() => {
|
|
1276
1278
|
if (ge.length > 0) {
|
|
1277
1279
|
const e = ge[0], r = c.find(
|
|
1278
1280
|
(g) => g.id === e.id || g.accessorKey === e.id
|
|
1279
1281
|
), s = r?.meta?.label || r?.header || e.id, u = e.desc ? "descending" : "ascending";
|
|
1280
|
-
|
|
1282
|
+
it(`Table sorted by ${s}, ${u}`);
|
|
1281
1283
|
}
|
|
1282
|
-
}, [ge, c]),
|
|
1284
|
+
}, [ge, c]), i.useEffect(() => {
|
|
1283
1285
|
if (L) {
|
|
1284
1286
|
const e = w.getFilteredRowModel().rows.length;
|
|
1285
|
-
|
|
1287
|
+
it(`${e} result${e !== 1 ? "s" : ""} found for "${L}"`);
|
|
1286
1288
|
}
|
|
1287
|
-
}, [L, w]),
|
|
1289
|
+
}, [L, w]), i.useEffect(() => {
|
|
1288
1290
|
const e = Object.keys(ke).filter((r) => ke[r]).length;
|
|
1289
|
-
e > 0 &&
|
|
1290
|
-
}, [ke]),
|
|
1291
|
-
const [e, r] = X, s =
|
|
1291
|
+
e > 0 && it(`${e} row${e !== 1 ? "s" : ""} selected`);
|
|
1292
|
+
}, [ke]), i.useEffect(() => {
|
|
1293
|
+
const [e, r] = X, s = ut.length, u = w.getVisibleLeafColumns();
|
|
1292
1294
|
let g = e, m = r;
|
|
1293
|
-
e >= 0 && e >= s && (g = Math.max(s - 1, -1)), r >= u.length && (m = Math.max(u.length - 1, 0)), (g !== e || m !== r) &&
|
|
1294
|
-
}, [n.length, w, X,
|
|
1295
|
+
e >= 0 && e >= s && (g = Math.max(s - 1, -1)), r >= u.length && (m = Math.max(u.length - 1, 0)), (g !== e || m !== r) && It([g, m]);
|
|
1296
|
+
}, [n.length, w, X, ut.length]), i.useEffect(() => {
|
|
1295
1297
|
const e = w.getPageCount();
|
|
1296
|
-
e > 1 &&
|
|
1298
|
+
e > 1 && it(`Page ${re.pageIndex + 1} of ${e}`);
|
|
1297
1299
|
}, [re.pageIndex, w]);
|
|
1298
|
-
const He =
|
|
1300
|
+
const He = i.useCallback((e, r) => {
|
|
1299
1301
|
if (!r || !e) return e;
|
|
1300
1302
|
const s = e.toLowerCase(), u = r.toLowerCase(), g = [];
|
|
1301
1303
|
let m = 0, S = s.indexOf(u);
|
|
@@ -1316,11 +1318,11 @@ function $o({
|
|
|
1316
1318
|
)
|
|
1317
1319
|
), m = S + r.length, S = s.indexOf(u, m);
|
|
1318
1320
|
return m < e.length && g.push(e.substring(m)), /* @__PURE__ */ t(ee, { children: g });
|
|
1319
|
-
}, []), he =
|
|
1321
|
+
}, []), he = i.useCallback((e) => {
|
|
1320
1322
|
if (e == null) return "";
|
|
1321
1323
|
if (typeof e == "string" || typeof e == "number") return String(e);
|
|
1322
1324
|
if (Array.isArray(e)) return e.map(he).join("");
|
|
1323
|
-
if (
|
|
1325
|
+
if (i.isValidElement(e)) {
|
|
1324
1326
|
const r = e;
|
|
1325
1327
|
if (typeof r.type == "function")
|
|
1326
1328
|
try {
|
|
@@ -1334,27 +1336,27 @@ function $o({
|
|
|
1334
1336
|
return he(r.props.children);
|
|
1335
1337
|
}
|
|
1336
1338
|
return "";
|
|
1337
|
-
}, []),
|
|
1339
|
+
}, []), ft = i.useCallback((e, r) => r ? he(e).toLowerCase().includes(r.toLowerCase()) : !1, [he]), ce = i.useCallback((e, r) => {
|
|
1338
1340
|
if (!r || e == null) return e;
|
|
1339
1341
|
if (typeof e == "string")
|
|
1340
1342
|
return He(e, r);
|
|
1341
1343
|
if (typeof e == "number")
|
|
1342
1344
|
return He(String(e), r);
|
|
1343
1345
|
if (Array.isArray(e))
|
|
1344
|
-
return e.map((s, u) => /* @__PURE__ */ t(
|
|
1345
|
-
if (
|
|
1346
|
+
return e.map((s, u) => /* @__PURE__ */ t(i.Fragment, { children: ce(s, r) }, u));
|
|
1347
|
+
if (i.isValidElement(e)) {
|
|
1346
1348
|
const s = e;
|
|
1347
1349
|
if (typeof s.type == "function")
|
|
1348
1350
|
try {
|
|
1349
1351
|
if (s.type.prototype?.isReactComponent) {
|
|
1350
1352
|
const B = s.props.children;
|
|
1351
|
-
return
|
|
1353
|
+
return i.cloneElement(s, {}, ce(B, r));
|
|
1352
1354
|
}
|
|
1353
1355
|
const S = s.type(s.props);
|
|
1354
1356
|
return ce(S, r);
|
|
1355
1357
|
} catch {
|
|
1356
1358
|
const { children: S, ...B } = s.props;
|
|
1357
|
-
return S == null ? s :
|
|
1359
|
+
return S == null ? s : i.cloneElement(
|
|
1358
1360
|
s,
|
|
1359
1361
|
B,
|
|
1360
1362
|
ce(S, r)
|
|
@@ -1363,19 +1365,19 @@ function $o({
|
|
|
1363
1365
|
if (s.props.children === void 0 || s.props.children === null)
|
|
1364
1366
|
return s;
|
|
1365
1367
|
const { children: u, ...g } = s.props;
|
|
1366
|
-
return
|
|
1368
|
+
return i.cloneElement(
|
|
1367
1369
|
s,
|
|
1368
1370
|
g,
|
|
1369
1371
|
ce(u, r)
|
|
1370
1372
|
);
|
|
1371
1373
|
}
|
|
1372
1374
|
return e;
|
|
1373
|
-
}, [He]), Be =
|
|
1374
|
-
if (!
|
|
1375
|
+
}, [He]), Be = i.useCallback((e) => {
|
|
1376
|
+
if (!le || !L)
|
|
1375
1377
|
return be(e.column.columnDef.cell, e.getContext());
|
|
1376
|
-
if (
|
|
1378
|
+
if (hr.has(e.column.id)) {
|
|
1377
1379
|
const u = be(e.column.columnDef.cell, e.getContext());
|
|
1378
|
-
return u == null || !
|
|
1380
|
+
return u == null || !ft(u, L) ? u : ce(u, L);
|
|
1379
1381
|
}
|
|
1380
1382
|
const s = e.getValue();
|
|
1381
1383
|
if (typeof s == "string" || typeof s == "number") {
|
|
@@ -1383,32 +1385,32 @@ function $o({
|
|
|
1383
1385
|
return He(u, L);
|
|
1384
1386
|
}
|
|
1385
1387
|
return be(e.column.columnDef.cell, e.getContext());
|
|
1386
|
-
}, [
|
|
1387
|
-
if (!
|
|
1388
|
+
}, [le, L, He, hr, ft, ce]), wr = i.useCallback((e) => {
|
|
1389
|
+
if (!le || !L)
|
|
1388
1390
|
return be(e.column.columnDef.aggregatedCell, e.getContext());
|
|
1389
1391
|
const r = be(e.column.columnDef.aggregatedCell, e.getContext());
|
|
1390
|
-
return r == null || !
|
|
1391
|
-
}, [
|
|
1392
|
-
|
|
1392
|
+
return r == null || !ft(r, L) ? r : ce(r, L);
|
|
1393
|
+
}, [le, L, ft, ce, he]), rn = i.useRef(null), sn = yn(
|
|
1394
|
+
Rr(Cn, {
|
|
1393
1395
|
activationConstraint: {
|
|
1394
1396
|
distance: 8
|
|
1395
1397
|
}
|
|
1396
1398
|
}),
|
|
1397
|
-
|
|
1399
|
+
Rr(wn, {
|
|
1398
1400
|
activationConstraint: {
|
|
1399
1401
|
delay: 200,
|
|
1400
1402
|
tolerance: 8
|
|
1401
1403
|
}
|
|
1402
1404
|
})
|
|
1403
|
-
), [,
|
|
1404
|
-
Ye &&
|
|
1405
|
-
},
|
|
1405
|
+
), [, Sr] = i.useState(null), nn = (e) => {
|
|
1406
|
+
Ye && Sr(e.active.id);
|
|
1407
|
+
}, on = (e) => {
|
|
1406
1408
|
if (!Ye) return;
|
|
1407
1409
|
const { active: r, over: s } = e;
|
|
1408
|
-
if (
|
|
1410
|
+
if (Sr(null), r.id !== s?.id && s?.id) {
|
|
1409
1411
|
const u = Le.findIndex((m) => m === r.id), g = Le.findIndex((m) => m === s?.id);
|
|
1410
1412
|
if (u !== -1 && g !== -1) {
|
|
1411
|
-
const m =
|
|
1413
|
+
const m = En(Le, u, g);
|
|
1412
1414
|
console.log("Column reorder:", {
|
|
1413
1415
|
activeId: r.id,
|
|
1414
1416
|
overId: s.id,
|
|
@@ -1416,11 +1418,11 @@ function $o({
|
|
|
1416
1418
|
newIndex: g,
|
|
1417
1419
|
oldOrder: Le,
|
|
1418
1420
|
newOrder: m
|
|
1419
|
-
}),
|
|
1421
|
+
}), ur(m);
|
|
1420
1422
|
}
|
|
1421
1423
|
}
|
|
1422
|
-
},
|
|
1423
|
-
const [r, s] = X, u = w.getVisibleLeafColumns(), g =
|
|
1424
|
+
}, an = i.useCallback((e) => {
|
|
1425
|
+
const [r, s] = X, u = w.getVisibleLeafColumns(), g = ut, m = u.length, S = g.length, B = -1, F = S - 1;
|
|
1424
1426
|
let o = r, P = s, $ = !1;
|
|
1425
1427
|
switch (e.key) {
|
|
1426
1428
|
case "ArrowRight":
|
|
@@ -1454,7 +1456,7 @@ function $o({
|
|
|
1454
1456
|
d?.id === "select" && fe && e.key === " " ? (w.toggleAllPageRowsSelected(), $ = !0) : d?.getCanSort() && (d.toggleSorting(), $ = !0);
|
|
1455
1457
|
} else {
|
|
1456
1458
|
const d = g[r];
|
|
1457
|
-
d && ((_ || z) && d.getCanExpand() ? (d.toggleExpanded(), $ = !0) : fe && e.key === " " && (d.toggleSelected(), $ = !0), !$ && e.key === "Enter" && K && Se(d) && (
|
|
1459
|
+
d && ((_ || z) && d.getCanExpand() ? (d.toggleExpanded(), $ = !0) : fe && e.key === " " && (d.toggleSelected(), $ = !0), !$ && e.key === "Enter" && K && Se(d) && (zt(d, e), $ = !0));
|
|
1458
1460
|
}
|
|
1459
1461
|
break;
|
|
1460
1462
|
case "Escape":
|
|
@@ -1462,13 +1464,13 @@ function $o({
|
|
|
1462
1464
|
break;
|
|
1463
1465
|
}
|
|
1464
1466
|
if ($ && (e.preventDefault(), e.stopPropagation(), o !== r || P !== s)) {
|
|
1465
|
-
|
|
1466
|
-
const d = o === -1 ? `[data-header-col="${P}"]` : `[data-row="${o}"][data-col="${P}"]`,
|
|
1467
|
-
|
|
1467
|
+
It([o, P]);
|
|
1468
|
+
const d = o === -1 ? `[data-header-col="${P}"]` : `[data-row="${o}"][data-col="${P}"]`, D = Et.current?.querySelector(d);
|
|
1469
|
+
D && D.focus();
|
|
1468
1470
|
}
|
|
1469
|
-
}, [X, w,
|
|
1470
|
-
|
|
1471
|
-
}, []), We =
|
|
1471
|
+
}, [X, w, ut, _, z, fe]), ln = i.useCallback((e) => {
|
|
1472
|
+
Et.current?.contains(e.relatedTarget) || It([-1, 0]);
|
|
1473
|
+
}, []), We = i.useMemo(() => {
|
|
1472
1474
|
const e = w.getVisibleFlatColumns(), r = /* @__PURE__ */ new Map();
|
|
1473
1475
|
let s = 0;
|
|
1474
1476
|
e.forEach((g, m) => {
|
|
@@ -1528,22 +1530,22 @@ function $o({
|
|
|
1528
1530
|
} : P;
|
|
1529
1531
|
}
|
|
1530
1532
|
return {};
|
|
1531
|
-
},
|
|
1533
|
+
}, cn = (e) => {
|
|
1532
1534
|
if (!e || typeof e.getSize != "function")
|
|
1533
1535
|
return "";
|
|
1534
1536
|
const r = We.data.get(e.id);
|
|
1535
1537
|
return r ? r.isRightmostLeftSticky ? "border-r-[3px] border-[var(--color-border-primary-medium)]" : r.isLeftmostRightSticky ? "border-l-[3px] border-[var(--color-border-primary-medium)]" : "" : "";
|
|
1536
|
-
},
|
|
1538
|
+
}, Pt = (e) => {
|
|
1537
1539
|
if (!e || typeof e.getSize != "function")
|
|
1538
1540
|
return !1;
|
|
1539
1541
|
const r = We.data.get(e.id);
|
|
1540
1542
|
return r ? r.isRightmostLeftSticky || r.isLeftmostRightSticky : !1;
|
|
1541
|
-
},
|
|
1543
|
+
}, Mt = (e) => {
|
|
1542
1544
|
if (!e || typeof e.getSize != "function" || Ne === 0)
|
|
1543
1545
|
return !1;
|
|
1544
1546
|
const r = We.data.get(e.id);
|
|
1545
1547
|
return r ? r.columnIndex === We.allColumns.length - Ne - 1 : !1;
|
|
1546
|
-
},
|
|
1548
|
+
}, Nr = (e, r = !1) => !te || !e.getCanResize() || !!E.showCellBorder ? "" : V(
|
|
1547
1549
|
// Right side indicator - hidden for last column
|
|
1548
1550
|
!r && [
|
|
1549
1551
|
"after:content-[''] after:absolute after:right-px after:top-1/2 after:-translate-y-1/2",
|
|
@@ -1559,52 +1561,52 @@ function $o({
|
|
|
1559
1561
|
"before:opacity-0 hover:before:opacity-100",
|
|
1560
1562
|
"before:transition-opacity before:pointer-events-none before:z-10"
|
|
1561
1563
|
);
|
|
1562
|
-
return /* @__PURE__ */ t(
|
|
1563
|
-
|
|
1564
|
+
return /* @__PURE__ */ t(Gn, { children: /* @__PURE__ */ t(
|
|
1565
|
+
Sn,
|
|
1564
1566
|
{
|
|
1565
|
-
sensors:
|
|
1566
|
-
collisionDetection:
|
|
1567
|
-
onDragStart:
|
|
1568
|
-
onDragEnd:
|
|
1567
|
+
sensors: sn,
|
|
1568
|
+
collisionDetection: Nn,
|
|
1569
|
+
onDragStart: nn,
|
|
1570
|
+
onDragEnd: on,
|
|
1569
1571
|
children: /* @__PURE__ */ b("div", { className: V(
|
|
1570
1572
|
"border border-[var(--color-border-primary-medium)] bg-[var(--color-surface-primary)] overflow-hidden rounded-[var(--border-radius-l)]",
|
|
1571
1573
|
// Remove bottom border when no pagination to avoid double border with last row
|
|
1572
|
-
!
|
|
1574
|
+
!xt && "border-b-0",
|
|
1573
1575
|
y
|
|
1574
1576
|
), children: [
|
|
1575
|
-
Me && (f ||
|
|
1577
|
+
Me && (f || le) && /* @__PURE__ */ b("div", { className: "border-b border-[var(--color-border-primary-medium)] bg-[var(--color-surface-primary)] px-[var(--space-l)] py-[var(--space-m)]", children: [
|
|
1576
1578
|
f && /* @__PURE__ */ b("div", { className: "flex justify-between items-center", children: [
|
|
1577
1579
|
/* @__PURE__ */ t("h3", { className: "text-heading-sm font-semibold text-[var(--color-text-primary)]", children: f }),
|
|
1578
|
-
/* @__PURE__ */ t(
|
|
1580
|
+
/* @__PURE__ */ t(Jr, { table: w, enableGrouping: z })
|
|
1579
1581
|
] }),
|
|
1580
1582
|
/* @__PURE__ */ t(
|
|
1581
|
-
|
|
1583
|
+
no,
|
|
1582
1584
|
{
|
|
1583
1585
|
table: w,
|
|
1584
|
-
searchKey:
|
|
1586
|
+
searchKey: l,
|
|
1585
1587
|
searchPlaceholder: a,
|
|
1586
1588
|
showSettingsMenu: !1,
|
|
1587
|
-
enableGlobalSearch:
|
|
1588
|
-
globalSearchPlaceholder:
|
|
1589
|
-
globalFilter:
|
|
1590
|
-
onGlobalFilterChange:
|
|
1591
|
-
enableGlobalFaceting:
|
|
1589
|
+
enableGlobalSearch: le,
|
|
1590
|
+
globalSearchPlaceholder: Kr,
|
|
1591
|
+
globalFilter: Rt,
|
|
1592
|
+
onGlobalFilterChange: sr,
|
|
1593
|
+
enableGlobalFaceting: Qr,
|
|
1592
1594
|
enableGrouping: z,
|
|
1593
|
-
enableAutocomplete:
|
|
1594
|
-
autocompleteSuggestions:
|
|
1595
|
-
autocompleteMinCharacters:
|
|
1595
|
+
enableAutocomplete: pt,
|
|
1596
|
+
autocompleteSuggestions: en,
|
|
1597
|
+
autocompleteMinCharacters: Xr
|
|
1596
1598
|
}
|
|
1597
1599
|
)
|
|
1598
1600
|
] }),
|
|
1599
1601
|
/* @__PURE__ */ b(
|
|
1600
1602
|
"div",
|
|
1601
1603
|
{
|
|
1602
|
-
ref:
|
|
1603
|
-
onKeyDown:
|
|
1604
|
-
onFocus:
|
|
1604
|
+
ref: Et,
|
|
1605
|
+
onKeyDown: an,
|
|
1606
|
+
onFocus: ln,
|
|
1605
1607
|
className: V(
|
|
1606
1608
|
"relative",
|
|
1607
|
-
|
|
1609
|
+
at && [
|
|
1608
1610
|
"overflow-x-auto",
|
|
1609
1611
|
"scrollbar-thin scrollbar-track-transparent scrollbar-thumb-[var(--color-border-primary-subtle)]",
|
|
1610
1612
|
"hover:scrollbar-thumb-[var(--color-border-primary)]",
|
|
@@ -1624,13 +1626,13 @@ function $o({
|
|
|
1624
1626
|
"aria-live": "polite",
|
|
1625
1627
|
"aria-atomic": "true",
|
|
1626
1628
|
className: "sr-only",
|
|
1627
|
-
children:
|
|
1629
|
+
children: Us
|
|
1628
1630
|
}
|
|
1629
1631
|
),
|
|
1630
1632
|
/* @__PURE__ */ b(
|
|
1631
|
-
|
|
1633
|
+
Bn,
|
|
1632
1634
|
{
|
|
1633
|
-
ref:
|
|
1635
|
+
ref: rn,
|
|
1634
1636
|
role: "grid",
|
|
1635
1637
|
"aria-label": x || f,
|
|
1636
1638
|
"aria-rowcount": n.length,
|
|
@@ -1642,7 +1644,7 @@ function $o({
|
|
|
1642
1644
|
// Fixed layout for column resizing
|
|
1643
1645
|
),
|
|
1644
1646
|
style: {
|
|
1645
|
-
...
|
|
1647
|
+
...at && { minWidth: C }
|
|
1646
1648
|
},
|
|
1647
1649
|
children: [
|
|
1648
1650
|
/* @__PURE__ */ t("colgroup", { children: w.getVisibleLeafColumns().map((e) => /* @__PURE__ */ t(
|
|
@@ -1654,29 +1656,29 @@ function $o({
|
|
|
1654
1656
|
},
|
|
1655
1657
|
e.id
|
|
1656
1658
|
)) }),
|
|
1657
|
-
/* @__PURE__ */ t(
|
|
1659
|
+
/* @__PURE__ */ t(Tn, { className: V(
|
|
1658
1660
|
h && [
|
|
1659
1661
|
"sticky top-0 z-20",
|
|
1660
1662
|
"after:absolute after:bottom-0 after:left-0 after:right-0 after:h-px after:bg-[var(--color-border-primary-medium)]"
|
|
1661
1663
|
],
|
|
1662
1664
|
// Remove bottom border from last header row when pagination is enabled to avoid double border
|
|
1663
|
-
|
|
1665
|
+
xt && "[&_tr:last-child]:border-b-0"
|
|
1664
1666
|
), children: A ? /* @__PURE__ */ t(
|
|
1665
|
-
|
|
1667
|
+
Fr,
|
|
1666
1668
|
{
|
|
1667
1669
|
columns: w.getVisibleLeafColumns().length,
|
|
1668
1670
|
rows: 0,
|
|
1669
1671
|
showRowBorder: E.showRowBorder,
|
|
1670
1672
|
showCellBorder: E.showCellBorder,
|
|
1671
|
-
enableResponsiveWrapper:
|
|
1673
|
+
enableResponsiveWrapper: at
|
|
1672
1674
|
}
|
|
1673
|
-
) :
|
|
1675
|
+
) : ss && Qe && Qe.length > 0 ? (
|
|
1674
1676
|
// Nested headers rendering
|
|
1675
1677
|
/* @__PURE__ */ b(ee, { children: [
|
|
1676
1678
|
/* @__PURE__ */ t(G, { showBorder: E.showRowBorder, children: Qe.map((e, r) => {
|
|
1677
1679
|
const s = e.columns.length, u = Ge(e, !0, E.showRowBorder);
|
|
1678
1680
|
return /* @__PURE__ */ t(
|
|
1679
|
-
|
|
1681
|
+
gt,
|
|
1680
1682
|
{
|
|
1681
1683
|
colSpan: s,
|
|
1682
1684
|
showBorder: E.showCellBorder,
|
|
@@ -1697,21 +1699,21 @@ function $o({
|
|
|
1697
1699
|
);
|
|
1698
1700
|
}) }),
|
|
1699
1701
|
/* @__PURE__ */ t(G, { showBorder: E.showRowBorder, children: w.getHeaderGroups()[0]?.headers.map((e, r) => {
|
|
1700
|
-
const s = Ge(e.column, !0, E.showRowBorder), u = e.column.columnDef.meta?.align || "left", g = r === w.getHeaderGroups()[0].headers.length - 1, m =
|
|
1702
|
+
const s = Ge(e.column, !0, E.showRowBorder), u = e.column.columnDef.meta?.align || "left", g = r === w.getHeaderGroups()[0].headers.length - 1, m = Pt(e.column);
|
|
1701
1703
|
return /* @__PURE__ */ t(
|
|
1702
|
-
|
|
1704
|
+
gt,
|
|
1703
1705
|
{
|
|
1704
1706
|
scope: "col",
|
|
1705
1707
|
"aria-sort": e.column.getCanSort() ? e.column.getIsSorted() ? e.column.getIsSorted() === "desc" ? "descending" : "ascending" : "none" : void 0,
|
|
1706
1708
|
"aria-colindex": r + 1,
|
|
1707
1709
|
"data-header-col": r,
|
|
1708
1710
|
tabIndex: X[0] === -1 && X[1] === r ? 0 : -1,
|
|
1709
|
-
showBorder: g || m ||
|
|
1711
|
+
showBorder: g || m || Mt(e.column) ? !1 : E.showCellBorder,
|
|
1710
1712
|
className: V(
|
|
1711
1713
|
h && "z-20",
|
|
1712
1714
|
(Oe > 0 || Ne > 0) && "z-30",
|
|
1713
1715
|
te && "relative overflow-visible group",
|
|
1714
|
-
|
|
1716
|
+
Nr(e.column, g),
|
|
1715
1717
|
// Focus ring for keyboard navigation
|
|
1716
1718
|
"focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--color-border-brand-bold)]"
|
|
1717
1719
|
),
|
|
@@ -1754,21 +1756,21 @@ function $o({
|
|
|
1754
1756
|
) : (
|
|
1755
1757
|
// Standard single-level headers
|
|
1756
1758
|
w.getHeaderGroups().map((e) => /* @__PURE__ */ t(
|
|
1757
|
-
|
|
1759
|
+
Rn,
|
|
1758
1760
|
{
|
|
1759
1761
|
items: e.headers.map((r) => r.id),
|
|
1760
|
-
strategy:
|
|
1762
|
+
strategy: In,
|
|
1761
1763
|
children: /* @__PURE__ */ t(G, { showBorder: E.showRowBorder, children: e.headers.map((r, s) => {
|
|
1762
|
-
const u = Ge(r.column, !0, E.showRowBorder), g = r.column.columnDef.meta?.align || "left", m = s === e.headers.length - 1, S =
|
|
1764
|
+
const u = Ge(r.column, !0, E.showRowBorder), g = r.column.columnDef.meta?.align || "left", m = s === e.headers.length - 1, S = Pt(r.column);
|
|
1763
1765
|
return /* @__PURE__ */ t(
|
|
1764
|
-
|
|
1766
|
+
gt,
|
|
1765
1767
|
{
|
|
1766
1768
|
scope: "col",
|
|
1767
1769
|
"aria-sort": r.column.getCanSort() ? r.column.getIsSorted() ? r.column.getIsSorted() === "desc" ? "descending" : "ascending" : "none" : void 0,
|
|
1768
1770
|
"aria-colindex": s + 1,
|
|
1769
1771
|
"data-header-col": s,
|
|
1770
1772
|
tabIndex: X[0] === -1 && X[1] === s ? 0 : -1,
|
|
1771
|
-
showBorder: m || S ||
|
|
1773
|
+
showBorder: m || S || Mt(r.column) ? !1 : E.showCellBorder,
|
|
1772
1774
|
className: V(
|
|
1773
1775
|
h && "z-20",
|
|
1774
1776
|
(Oe > 0 || Ne > 0) && "z-30",
|
|
@@ -1776,7 +1778,7 @@ function $o({
|
|
|
1776
1778
|
Ye && "group",
|
|
1777
1779
|
!Me && s === 0 && "rounded-tl-[var(--border-radius-l)]",
|
|
1778
1780
|
!Me && s === e.headers.length - 1 && "rounded-tr-[var(--border-radius-l)]",
|
|
1779
|
-
|
|
1781
|
+
Nr(r.column, m),
|
|
1780
1782
|
// Focus ring for keyboard navigation
|
|
1781
1783
|
"focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--color-border-brand-bold)]"
|
|
1782
1784
|
),
|
|
@@ -1785,7 +1787,7 @@ function $o({
|
|
|
1785
1787
|
// For table-fixed layout, all columns need explicit width
|
|
1786
1788
|
...te && !u.width ? { width: r.column.getSize() } : {}
|
|
1787
1789
|
},
|
|
1788
|
-
children: /* @__PURE__ */ t(
|
|
1790
|
+
children: /* @__PURE__ */ t(io, { header: r, enableColumnOrdering: Ye, children: /* @__PURE__ */ b("div", { className: V(
|
|
1789
1791
|
g === "right" ? "text-right" : "text-left"
|
|
1790
1792
|
), children: [
|
|
1791
1793
|
r.isPlaceholder ? null : be(
|
|
@@ -1819,33 +1821,33 @@ function $o({
|
|
|
1819
1821
|
e.id
|
|
1820
1822
|
))
|
|
1821
1823
|
) }),
|
|
1822
|
-
/* @__PURE__ */ b(
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1824
|
+
/* @__PURE__ */ b(Pn, { children: [
|
|
1825
|
+
Ds && !A && n.length > 0 && /* @__PURE__ */ t("tr", { className: "absolute top-0 left-0 right-0 z-50 h-0", children: /* @__PURE__ */ t("td", { colSpan: w.getVisibleLeafColumns().length, className: "p-0", children: /* @__PURE__ */ t(so, {}) }) }),
|
|
1826
|
+
Qt ? /* @__PURE__ */ t(G, { showBorder: !1, className: "h-[300px]", children: /* @__PURE__ */ t(
|
|
1827
|
+
ie,
|
|
1826
1828
|
{
|
|
1827
1829
|
colSpan: w.getVisibleLeafColumns().length,
|
|
1828
1830
|
className: "text-center",
|
|
1829
1831
|
showBorder: !1,
|
|
1830
1832
|
showRowBorder: !1,
|
|
1831
1833
|
verticalAlign: "middle",
|
|
1832
|
-
children:
|
|
1833
|
-
|
|
1834
|
+
children: xs || /* @__PURE__ */ t(
|
|
1835
|
+
ro,
|
|
1834
1836
|
{
|
|
1835
|
-
error:
|
|
1836
|
-
onRetry:
|
|
1837
|
+
error: Qt,
|
|
1838
|
+
onRetry: bs
|
|
1837
1839
|
}
|
|
1838
1840
|
)
|
|
1839
1841
|
}
|
|
1840
1842
|
) }) : A && (M === "replace" || n.length === 0) ? /* @__PURE__ */ t(
|
|
1841
|
-
|
|
1843
|
+
Fr,
|
|
1842
1844
|
{
|
|
1843
1845
|
columns: w.getVisibleLeafColumns().length,
|
|
1844
|
-
rows:
|
|
1846
|
+
rows: Zs,
|
|
1845
1847
|
showRowBorder: E.showRowBorder,
|
|
1846
1848
|
showCellBorder: E.showCellBorder,
|
|
1847
1849
|
skipHeader: !0,
|
|
1848
|
-
enableResponsiveWrapper:
|
|
1850
|
+
enableResponsiveWrapper: at
|
|
1849
1851
|
}
|
|
1850
1852
|
) : (
|
|
1851
1853
|
// DISABLED: Virtualization temporarily disabled to fix React hooks error
|
|
@@ -1855,12 +1857,12 @@ function $o({
|
|
|
1855
1857
|
w.getRowModel().rows?.length ? (
|
|
1856
1858
|
// Manual cross-page pinning: organize rows with pinned rows at top/bottom of every page
|
|
1857
1859
|
(() => {
|
|
1858
|
-
if (!Ee ||
|
|
1859
|
-
const o = /* @__PURE__ */ new Set(), P = w.getRowModel().rows.filter((d) => J || d.depth === 0), $ = (d,
|
|
1860
|
+
if (!Ee || !At) {
|
|
1861
|
+
const o = /* @__PURE__ */ new Set(), P = w.getRowModel().rows.filter((d) => J || d.depth === 0), $ = (d, D, H) => {
|
|
1860
1862
|
if (o.has(d.id)) return null;
|
|
1861
1863
|
o.add(d.id);
|
|
1862
|
-
const q =
|
|
1863
|
-
return /* @__PURE__ */ b(
|
|
1864
|
+
const q = pr.get(d.id) ?? -1;
|
|
1865
|
+
return /* @__PURE__ */ b(i.Fragment, { children: [
|
|
1864
1866
|
/* @__PURE__ */ t(
|
|
1865
1867
|
G,
|
|
1866
1868
|
{
|
|
@@ -1878,35 +1880,37 @@ function $o({
|
|
|
1878
1880
|
d.getIsPinned() === "bottom" && "!bg-[var(--color-background-neutral-selected)] !border-t-2 !border-[var(--color-border-primary-medium)]",
|
|
1879
1881
|
// Nested row background colors (grouped and expanding)
|
|
1880
1882
|
(() => {
|
|
1881
|
-
const j = d.getIsGrouped?.() ? "font-medium" : "", se =
|
|
1883
|
+
const j = d.getIsGrouped?.() ? "font-medium" : "", se = $r(d, {
|
|
1882
1884
|
enableGrouping: z,
|
|
1883
1885
|
enableExpanding: _,
|
|
1884
|
-
nestedRowStyling:
|
|
1886
|
+
nestedRowStyling: bt,
|
|
1885
1887
|
expandingRowColors: O,
|
|
1886
|
-
maxDepth:
|
|
1888
|
+
maxDepth: ct
|
|
1887
1889
|
});
|
|
1888
1890
|
return V(se ? `bg-[${se}]` : "", j);
|
|
1889
1891
|
})(),
|
|
1890
1892
|
// Row click styling with smart hover
|
|
1891
|
-
K && Se(d) && (
|
|
1893
|
+
K && Se(d) && (Ut || "cursor-pointer hover:[background-image:linear-gradient(rgba(0,0,0,0.02),rgba(0,0,0,0.02))]")
|
|
1892
1894
|
),
|
|
1893
1895
|
style: {
|
|
1894
|
-
height:
|
|
1896
|
+
height: fo(d.depth, bt)
|
|
1895
1897
|
},
|
|
1896
|
-
onClick: K && Se(d) ? (
|
|
1898
|
+
onClick: K && Se(d) ? (N) => zt(d, N) : void 0,
|
|
1899
|
+
onMouseEnter: Ze ? (N) => Ze(d.original, N) : void 0,
|
|
1900
|
+
onMouseLeave: et ? (N) => et(d.original, N) : void 0,
|
|
1897
1901
|
role: "row",
|
|
1898
1902
|
"aria-label": K && Se(d) ? `View details for row ${d.id}` : void 0,
|
|
1899
1903
|
"aria-current": ze(d) ? "true" : void 0,
|
|
1900
|
-
children: d.getVisibleCells().map((
|
|
1901
|
-
const se = Ge(
|
|
1902
|
-
let Re =
|
|
1904
|
+
children: d.getVisibleCells().map((N, j) => {
|
|
1905
|
+
const se = Ge(N.column, !1, E.showRowBorder), U = j === 0, _e = _ && d.getCanExpand() || z && d.getIsGrouped(), de = d.getIsExpanded(), ue = d.depth, Vt = z && d.getIsGrouped();
|
|
1906
|
+
let Re = _t?.(d);
|
|
1903
1907
|
if (Re == null)
|
|
1904
1908
|
for (const oe of d.getVisibleCells()) {
|
|
1905
1909
|
const ae = oe.column.columnDef.sectionHeaderCell;
|
|
1906
1910
|
if (ae) {
|
|
1907
|
-
const
|
|
1908
|
-
if (
|
|
1909
|
-
Re =
|
|
1911
|
+
const Ft = ae(oe.getContext());
|
|
1912
|
+
if (Ft != null) {
|
|
1913
|
+
Re = Ft;
|
|
1910
1914
|
break;
|
|
1911
1915
|
}
|
|
1912
1916
|
}
|
|
@@ -1916,34 +1920,34 @@ function $o({
|
|
|
1916
1920
|
return null;
|
|
1917
1921
|
const Z = z && d.depth > 0 && j === 0 && !H;
|
|
1918
1922
|
return /* @__PURE__ */ t(
|
|
1919
|
-
|
|
1923
|
+
ie,
|
|
1920
1924
|
{
|
|
1921
1925
|
role: "gridcell",
|
|
1922
1926
|
"aria-colindex": j + 1,
|
|
1923
1927
|
"data-row": q,
|
|
1924
1928
|
"data-col": j,
|
|
1925
1929
|
tabIndex: X[0] === q && X[1] === j ? 0 : -1,
|
|
1926
|
-
showBorder:
|
|
1930
|
+
showBorder: Pt(N.column) || Mt(N.column) ? !1 : E.showCellBorder,
|
|
1927
1931
|
showRowBorder: E.showRowBorder,
|
|
1928
|
-
verticalAlign:
|
|
1932
|
+
verticalAlign: N.column.columnDef.meta?.verticalAlign || Ie,
|
|
1929
1933
|
colSpan: ne ? d.getVisibleCells().length : void 0,
|
|
1930
1934
|
"data-section-header": ne ? !0 : void 0,
|
|
1931
1935
|
className: V(
|
|
1932
1936
|
// Active row indicator on first cell
|
|
1933
|
-
U && ze(d) && (
|
|
1937
|
+
U && ze(d) && (Jt || mr(Z ? !1 : E.showRowBorder)),
|
|
1934
1938
|
// Add sticky border classes for body cells (skip for section headers)
|
|
1935
|
-
!ne &&
|
|
1939
|
+
!ne && cn(N.column),
|
|
1936
1940
|
// Sticky columns need higher z-index and explicit backgrounds
|
|
1937
1941
|
Object.keys(se).length > 0 && [
|
|
1938
1942
|
"z-10",
|
|
1939
1943
|
// Match row backgrounds for sticky cells to prevent transparency
|
|
1940
1944
|
(() => {
|
|
1941
|
-
const oe =
|
|
1945
|
+
const oe = $r(d, {
|
|
1942
1946
|
enableGrouping: z,
|
|
1943
1947
|
enableExpanding: _,
|
|
1944
|
-
nestedRowStyling:
|
|
1948
|
+
nestedRowStyling: bt,
|
|
1945
1949
|
expandingRowColors: O,
|
|
1946
|
-
maxDepth:
|
|
1950
|
+
maxDepth: ct
|
|
1947
1951
|
});
|
|
1948
1952
|
return oe ? `bg-[${oe}]` : "bg-[var(--color-surface-primary)]";
|
|
1949
1953
|
})()
|
|
@@ -1963,24 +1967,24 @@ function $o({
|
|
|
1963
1967
|
children: ne ? (
|
|
1964
1968
|
// Section header row - render custom content
|
|
1965
1969
|
Re
|
|
1966
|
-
) :
|
|
1970
|
+
) : Vt ? (
|
|
1967
1971
|
// Grouped row rendering - only show content in first cell
|
|
1968
|
-
U ?
|
|
1972
|
+
U ? jr(d, w, Xe, de, ye, jt) : N.column.columnDef.meta?.renderInGroupedRows ? (
|
|
1969
1973
|
// Render custom cell content for columns with renderInGroupedRows flag
|
|
1970
|
-
Be(
|
|
1971
|
-
) :
|
|
1974
|
+
Be(N)
|
|
1975
|
+
) : N.column.columnDef.aggregatedCell ? (
|
|
1972
1976
|
// Render custom aggregatedCell if defined
|
|
1973
|
-
|
|
1977
|
+
wr(N)
|
|
1974
1978
|
) : (
|
|
1975
1979
|
// Calculate and show aggregation for other columns in grouped row
|
|
1976
1980
|
(() => {
|
|
1977
|
-
const oe =
|
|
1978
|
-
|
|
1981
|
+
const oe = Vr(
|
|
1982
|
+
N.column,
|
|
1979
1983
|
d.subRows,
|
|
1980
1984
|
d.groupingColumnId
|
|
1981
1985
|
);
|
|
1982
1986
|
if (!oe) return /* @__PURE__ */ t("div", {});
|
|
1983
|
-
const ae =
|
|
1987
|
+
const ae = N.column.columnDef.meta?.align || "left";
|
|
1984
1988
|
return /* @__PURE__ */ t(Te, { align: ae, children: /* @__PURE__ */ t("span", { className: V(
|
|
1985
1989
|
"text-[var(--color-text-secondary)] text-body-sm",
|
|
1986
1990
|
ae === "right" ? "tabular-nums" : ""
|
|
@@ -2005,7 +2009,7 @@ function $o({
|
|
|
2005
2009
|
)
|
|
2006
2010
|
}
|
|
2007
2011
|
),
|
|
2008
|
-
U && Ee && !
|
|
2012
|
+
U && Ee && !Vt && /* @__PURE__ */ b("div", { className: "flex items-center gap-1", children: [
|
|
2009
2013
|
d.getIsPinned() !== "top" && /* @__PURE__ */ t(
|
|
2010
2014
|
"button",
|
|
2011
2015
|
{
|
|
@@ -2013,7 +2017,7 @@ function $o({
|
|
|
2013
2017
|
onClick: () => d.pin("top"),
|
|
2014
2018
|
className: "opacity-0 group-hover:opacity-100 flex h-[var(--size-s)] w-[var(--size-s)] items-center justify-center rounded-[var(--border-radius-s)] text-[var(--color-text-secondary)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)]",
|
|
2015
2019
|
title: "Pin to top",
|
|
2016
|
-
children: /* @__PURE__ */ t(W, { name:
|
|
2020
|
+
children: /* @__PURE__ */ t(W, { name: Er, className: "h-3 w-3" })
|
|
2017
2021
|
}
|
|
2018
2022
|
),
|
|
2019
2023
|
d.getIsPinned() !== "bottom" && /* @__PURE__ */ t(
|
|
@@ -2023,7 +2027,7 @@ function $o({
|
|
|
2023
2027
|
onClick: () => d.pin("bottom"),
|
|
2024
2028
|
className: "opacity-0 group-hover:opacity-100 flex h-[var(--size-s)] w-[var(--size-s)] items-center justify-center rounded-[var(--border-radius-s)] text-[var(--color-text-secondary)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)]",
|
|
2025
2029
|
title: "Pin to bottom",
|
|
2026
|
-
children: /* @__PURE__ */ t(W, { name:
|
|
2030
|
+
children: /* @__PURE__ */ t(W, { name: Dr, className: "h-3 w-3" })
|
|
2027
2031
|
}
|
|
2028
2032
|
),
|
|
2029
2033
|
d.getIsPinned() && /* @__PURE__ */ t(
|
|
@@ -2033,31 +2037,31 @@ function $o({
|
|
|
2033
2037
|
onClick: () => d.pin(!1),
|
|
2034
2038
|
className: "opacity-0 group-hover:opacity-100 flex h-[var(--size-s)] w-[var(--size-s)] items-center justify-center rounded-[var(--border-radius-s)] text-[var(--color-text-secondary)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)]",
|
|
2035
2039
|
title: "Unpin row",
|
|
2036
|
-
children: /* @__PURE__ */ t(W, { name:
|
|
2040
|
+
children: /* @__PURE__ */ t(W, { name: $t, className: "h-3 w-3" })
|
|
2037
2041
|
}
|
|
2038
2042
|
)
|
|
2039
2043
|
] }),
|
|
2040
2044
|
U && !_e && !Ee && (_ || z) && /* @__PURE__ */ t("div", { className: "h-[var(--size-s)] w-[var(--size-s)]" }),
|
|
2041
|
-
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: z && d.depth > 0 && (
|
|
2045
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: z && d.depth > 0 && (N.column.id === d.getParentRow()?.groupingColumnId || N.column.id === Xe) ? (
|
|
2042
2046
|
// Hide grouped column and groupDisplayColumn in detail rows
|
|
2043
2047
|
/* @__PURE__ */ t("div", {})
|
|
2044
|
-
) :
|
|
2048
|
+
) : N.column.columnDef.meta?.truncate !== !1 ? (
|
|
2045
2049
|
// Wrap in TruncatedCell for overflow handling with tooltip
|
|
2046
|
-
/* @__PURE__ */ t(Te, { align:
|
|
2050
|
+
/* @__PURE__ */ t(Te, { align: N.column.columnDef.meta?.align, children: Be(N) })
|
|
2047
2051
|
) : (
|
|
2048
2052
|
// No truncation for this column
|
|
2049
|
-
Be(
|
|
2053
|
+
Be(N)
|
|
2050
2054
|
) })
|
|
2051
2055
|
] })
|
|
2052
2056
|
)
|
|
2053
2057
|
},
|
|
2054
|
-
|
|
2058
|
+
N.id
|
|
2055
2059
|
);
|
|
2056
2060
|
})
|
|
2057
2061
|
}
|
|
2058
2062
|
),
|
|
2059
|
-
|
|
2060
|
-
|
|
2063
|
+
nt?.[d.id] && d.getIsExpanded() && /* @__PURE__ */ t(G, { showBorder: E.showRowBorder, children: /* @__PURE__ */ t(
|
|
2064
|
+
ie,
|
|
2061
2065
|
{
|
|
2062
2066
|
colSpan: d.getVisibleCells().length,
|
|
2063
2067
|
showBorder: E.showCellBorder,
|
|
@@ -2071,7 +2075,7 @@ function $o({
|
|
|
2071
2075
|
}
|
|
2072
2076
|
) }),
|
|
2073
2077
|
J && d.getIsExpanded() && d.depth === 0 && /* @__PURE__ */ t(G, { showBorder: E.showRowBorder, children: /* @__PURE__ */ t(
|
|
2074
|
-
|
|
2078
|
+
ie,
|
|
2075
2079
|
{
|
|
2076
2080
|
colSpan: d.getVisibleCells().length,
|
|
2077
2081
|
showBorder: E.showCellBorder,
|
|
@@ -2079,10 +2083,10 @@ function $o({
|
|
|
2079
2083
|
verticalAlign: Ie,
|
|
2080
2084
|
className: "p-0",
|
|
2081
2085
|
"data-section-header": !0,
|
|
2082
|
-
children:
|
|
2086
|
+
children: tr?.[d.id] ? /* @__PURE__ */ b("div", { className: "flex flex-col items-center justify-center py-[var(--space-l)] gap-[var(--space-s)]", children: [
|
|
2083
2087
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-[var(--space-s)] text-[var(--color-text-danger)]", children: [
|
|
2084
|
-
/* @__PURE__ */ t(W, { name:
|
|
2085
|
-
/* @__PURE__ */ t("span", { className: "text-body-sm", children:
|
|
2088
|
+
/* @__PURE__ */ t(W, { name: Ln, className: "h-4 w-4" }),
|
|
2089
|
+
/* @__PURE__ */ t("span", { className: "text-body-sm", children: tr[d.id]?.message || "Failed to load details" })
|
|
2086
2090
|
] }),
|
|
2087
2091
|
De && /* @__PURE__ */ t(
|
|
2088
2092
|
"button",
|
|
@@ -2092,7 +2096,7 @@ function $o({
|
|
|
2092
2096
|
children: "Try again"
|
|
2093
2097
|
}
|
|
2094
2098
|
)
|
|
2095
|
-
] }) :
|
|
2099
|
+
] }) : ot?.[d.id] ? /* @__PURE__ */ b("div", { className: "flex items-center justify-center py-[var(--space-l)]", children: [
|
|
2096
2100
|
/* @__PURE__ */ t(qe, { size: "s" }),
|
|
2097
2101
|
/* @__PURE__ */ t("span", { className: "ml-[var(--space-s)] text-body-sm text-[var(--color-text-secondary)]", children: "Loading details..." })
|
|
2098
2102
|
] }) : J(d)
|
|
@@ -2100,17 +2104,17 @@ function $o({
|
|
|
2100
2104
|
) }),
|
|
2101
2105
|
(() => {
|
|
2102
2106
|
if (J) return null;
|
|
2103
|
-
const
|
|
2104
|
-
if (
|
|
2107
|
+
const N = d.subRows && d.subRows.length > 0 ? d.subRows : dt?.get(d.id) || [];
|
|
2108
|
+
if (N.length === 0) return null;
|
|
2105
2109
|
let j = d.getIsExpanded();
|
|
2106
|
-
return !j && Q === !0 && d.getCanExpand() && (j = !0), !j && typeof Q == "object" && Q !== null && Q[d.id] && (j = !0), j ?
|
|
2107
|
-
(se, U) => $(se, U, U ===
|
|
2110
|
+
return !j && Q === !0 && d.getCanExpand() && (j = !0), !j && typeof Q == "object" && Q !== null && Q[d.id] && (j = !0), j ? N.map(
|
|
2111
|
+
(se, U) => $(se, U, U === N.length - 1)
|
|
2108
2112
|
) : null;
|
|
2109
2113
|
})()
|
|
2110
2114
|
] }, d.id);
|
|
2111
2115
|
};
|
|
2112
2116
|
return P.map(
|
|
2113
|
-
(d,
|
|
2117
|
+
(d, D) => $(d, D, D === P.length - 1)
|
|
2114
2118
|
);
|
|
2115
2119
|
}
|
|
2116
2120
|
const e = w.getCoreRowModel().rows, r = w.getRowModel().rows, s = e.filter((o) => o.getIsPinned() === "top"), u = e.filter((o) => o.getIsPinned() === "bottom"), g = r.filter((o) => !o.getIsPinned()), m = [
|
|
@@ -2120,8 +2124,8 @@ function $o({
|
|
|
2120
2124
|
], S = /* @__PURE__ */ new Set(), B = m.filter((o) => J || o.depth === 0), F = (o, P, $) => {
|
|
2121
2125
|
if (S.has(o.id)) return null;
|
|
2122
2126
|
S.add(o.id);
|
|
2123
|
-
const d =
|
|
2124
|
-
return /* @__PURE__ */ b(
|
|
2127
|
+
const d = pr.get(o.id) ?? -1;
|
|
2128
|
+
return /* @__PURE__ */ b(i.Fragment, { children: [
|
|
2125
2129
|
/* @__PURE__ */ t(
|
|
2126
2130
|
G,
|
|
2127
2131
|
{
|
|
@@ -2142,7 +2146,7 @@ function $o({
|
|
|
2142
2146
|
z && o.depth === 1 && "bg-[var(--blue-25)]",
|
|
2143
2147
|
// Bottom-up alternating colors for expanding rows (only when expanded)
|
|
2144
2148
|
_ && !o.getIsGrouped?.() && (() => {
|
|
2145
|
-
const
|
|
2149
|
+
const D = o.subRows && o.subRows.length > 0, H = () => {
|
|
2146
2150
|
let j = o;
|
|
2147
2151
|
for (; j; ) {
|
|
2148
2152
|
if (j.getIsExpanded()) return !0;
|
|
@@ -2150,9 +2154,9 @@ function $o({
|
|
|
2150
2154
|
}
|
|
2151
2155
|
return !1;
|
|
2152
2156
|
};
|
|
2153
|
-
if (o.depth === 0 && (!
|
|
2157
|
+
if (o.depth === 0 && (!D || !H()))
|
|
2154
2158
|
return "";
|
|
2155
|
-
const q =
|
|
2159
|
+
const q = ct - o.depth, N = q % 2 === 0 ? "bg-[var(--blue-25)]" : "bg-[var(--blue-50)]";
|
|
2156
2160
|
if (O) {
|
|
2157
2161
|
if (q === 0 && O.children)
|
|
2158
2162
|
return `bg-[${O.children}]`;
|
|
@@ -2161,18 +2165,20 @@ function $o({
|
|
|
2161
2165
|
if (q > 0 && !o.getIsExpanded() && O.collapsedParent)
|
|
2162
2166
|
return `bg-[${O.collapsedParent}]`;
|
|
2163
2167
|
}
|
|
2164
|
-
return
|
|
2168
|
+
return N;
|
|
2165
2169
|
})(),
|
|
2166
2170
|
// Row click styling with smart hover
|
|
2167
|
-
K && Se(o) && (
|
|
2171
|
+
K && Se(o) && (Ut || "cursor-pointer hover:[background-image:linear-gradient(rgba(0,0,0,0.02),rgba(0,0,0,0.02))]")
|
|
2168
2172
|
),
|
|
2169
|
-
onClick: K && Se(o) ? (
|
|
2173
|
+
onClick: K && Se(o) ? (D) => zt(o, D) : void 0,
|
|
2174
|
+
onMouseEnter: Ze ? (D) => Ze(o.original, D) : void 0,
|
|
2175
|
+
onMouseLeave: et ? (D) => et(o.original, D) : void 0,
|
|
2170
2176
|
role: "row",
|
|
2171
2177
|
"aria-label": K && Se(o) ? `View details for row ${o.id}` : void 0,
|
|
2172
2178
|
"aria-current": ze(o) ? "true" : void 0,
|
|
2173
|
-
children: o.getVisibleCells().map((
|
|
2174
|
-
const q = Ge(
|
|
2175
|
-
let de =
|
|
2179
|
+
children: o.getVisibleCells().map((D, H) => {
|
|
2180
|
+
const q = Ge(D.column, !1, E.showRowBorder), N = H === 0, j = _ && o.getCanExpand() || z && o.getIsGrouped(), se = o.getIsExpanded(), U = o.depth, _e = z && o.getIsGrouped();
|
|
2181
|
+
let de = _t?.(o);
|
|
2176
2182
|
if (de == null)
|
|
2177
2183
|
for (const pe of o.getVisibleCells()) {
|
|
2178
2184
|
const ve = pe.column.columnDef.sectionHeaderCell;
|
|
@@ -2185,11 +2191,11 @@ function $o({
|
|
|
2185
2191
|
}
|
|
2186
2192
|
}
|
|
2187
2193
|
const ue = de != null;
|
|
2188
|
-
if (ue && !
|
|
2194
|
+
if (ue && !N)
|
|
2189
2195
|
return null;
|
|
2190
2196
|
const ne = z && o.depth > 0 && H === 0 && !$;
|
|
2191
2197
|
return /* @__PURE__ */ t(
|
|
2192
|
-
|
|
2198
|
+
ie,
|
|
2193
2199
|
{
|
|
2194
2200
|
role: "gridcell",
|
|
2195
2201
|
"aria-colindex": H + 1,
|
|
@@ -2198,11 +2204,11 @@ function $o({
|
|
|
2198
2204
|
tabIndex: X[0] === d && X[1] === H ? 0 : -1,
|
|
2199
2205
|
showBorder: E.showCellBorder,
|
|
2200
2206
|
showRowBorder: E.showRowBorder,
|
|
2201
|
-
verticalAlign:
|
|
2207
|
+
verticalAlign: D.column.columnDef.meta?.verticalAlign || Ie,
|
|
2202
2208
|
colSpan: ue ? o.getVisibleCells().length : void 0,
|
|
2203
2209
|
className: V(
|
|
2204
2210
|
// Active row indicator on first cell
|
|
2205
|
-
|
|
2211
|
+
N && ze(o) && (Jt || mr(ne ? !1 : E.showRowBorder)),
|
|
2206
2212
|
// Focus ring for keyboard navigation
|
|
2207
2213
|
"focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--color-border-brand-bold)]",
|
|
2208
2214
|
// Sticky columns need higher z-index and explicit backgrounds
|
|
@@ -2227,7 +2233,7 @@ function $o({
|
|
|
2227
2233
|
};
|
|
2228
2234
|
if (o.depth === 0 && (!pe || !ve()))
|
|
2229
2235
|
return "";
|
|
2230
|
-
const Z =
|
|
2236
|
+
const Z = ct - o.depth, oe = Z % 2 === 0 ? "bg-[var(--blue-25)]" : "bg-[var(--blue-50)]";
|
|
2231
2237
|
if (O) {
|
|
2232
2238
|
if (Z === 0 && O.children)
|
|
2233
2239
|
return `bg-[${O.children}]`;
|
|
@@ -2248,33 +2254,33 @@ function $o({
|
|
|
2248
2254
|
),
|
|
2249
2255
|
style: {
|
|
2250
2256
|
...q,
|
|
2251
|
-
width:
|
|
2257
|
+
width: D.column.getSize(),
|
|
2252
2258
|
// Section header: fixed height with no padding
|
|
2253
2259
|
...ue ? { height: "32px", padding: "0" } : {},
|
|
2254
2260
|
// Add left padding for nested rows
|
|
2255
|
-
paddingLeft:
|
|
2261
|
+
paddingLeft: N && U > 0 && !ue ? `calc(var(--space-m) + ${U * 20}px)` : void 0
|
|
2256
2262
|
},
|
|
2257
2263
|
children: ue ? (
|
|
2258
2264
|
// Section header row - render custom content
|
|
2259
2265
|
de
|
|
2260
2266
|
) : _e ? (
|
|
2261
2267
|
// Grouped row rendering - only show content in first cell
|
|
2262
|
-
|
|
2268
|
+
N ? jr(o, w, Xe, se, ye, jt) : D.column.columnDef.meta?.renderInGroupedRows ? (
|
|
2263
2269
|
// Render custom cell content for columns with renderInGroupedRows flag
|
|
2264
|
-
Be(
|
|
2265
|
-
) :
|
|
2270
|
+
Be(D)
|
|
2271
|
+
) : D.column.columnDef.aggregatedCell ? (
|
|
2266
2272
|
// Render custom aggregatedCell if defined
|
|
2267
|
-
|
|
2273
|
+
wr(D)
|
|
2268
2274
|
) : (
|
|
2269
2275
|
// Calculate and show aggregation for other columns in grouped row
|
|
2270
2276
|
(() => {
|
|
2271
|
-
const pe =
|
|
2272
|
-
|
|
2277
|
+
const pe = Vr(
|
|
2278
|
+
D.column,
|
|
2273
2279
|
o.subRows,
|
|
2274
2280
|
o.groupingColumnId
|
|
2275
2281
|
);
|
|
2276
2282
|
if (!pe) return /* @__PURE__ */ t("div", {});
|
|
2277
|
-
const ve =
|
|
2283
|
+
const ve = D.column.columnDef.meta?.align || "left";
|
|
2278
2284
|
return /* @__PURE__ */ t(Te, { align: ve, children: /* @__PURE__ */ t("span", { className: V(
|
|
2279
2285
|
"text-[var(--color-text-secondary)] text-body-sm",
|
|
2280
2286
|
ve === "right" ? "tabular-nums" : ""
|
|
@@ -2284,7 +2290,7 @@ function $o({
|
|
|
2284
2290
|
) : (
|
|
2285
2291
|
// Regular row rendering
|
|
2286
2292
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-[var(--space-s)]", children: [
|
|
2287
|
-
|
|
2293
|
+
N && j && /* @__PURE__ */ t(
|
|
2288
2294
|
"button",
|
|
2289
2295
|
{
|
|
2290
2296
|
onClick: o.getToggleExpandedHandler(),
|
|
@@ -2298,14 +2304,14 @@ function $o({
|
|
|
2298
2304
|
)
|
|
2299
2305
|
}
|
|
2300
2306
|
),
|
|
2301
|
-
|
|
2307
|
+
N && Ee && !_e && /* @__PURE__ */ b("div", { className: "flex items-center gap-1", children: [
|
|
2302
2308
|
o.getIsPinned() !== "top" && /* @__PURE__ */ t(
|
|
2303
2309
|
"button",
|
|
2304
2310
|
{
|
|
2305
2311
|
onClick: () => o.pin("top"),
|
|
2306
2312
|
className: "opacity-0 group-hover:opacity-100 flex h-[var(--size-s)] w-[var(--size-s)] items-center justify-center rounded-[var(--border-radius-s)] text-[var(--color-text-secondary)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)]",
|
|
2307
2313
|
title: "Pin to top",
|
|
2308
|
-
children: /* @__PURE__ */ t(W, { name:
|
|
2314
|
+
children: /* @__PURE__ */ t(W, { name: Er, className: "h-3 w-3" })
|
|
2309
2315
|
}
|
|
2310
2316
|
),
|
|
2311
2317
|
o.getIsPinned() !== "bottom" && /* @__PURE__ */ t(
|
|
@@ -2314,7 +2320,7 @@ function $o({
|
|
|
2314
2320
|
onClick: () => o.pin("bottom"),
|
|
2315
2321
|
className: "opacity-0 group-hover:opacity-100 flex h-[var(--size-s)] w-[var(--size-s)] items-center justify-center rounded-[var(--border-radius-s)] text-[var(--color-text-secondary)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)]",
|
|
2316
2322
|
title: "Pin to bottom",
|
|
2317
|
-
children: /* @__PURE__ */ t(W, { name:
|
|
2323
|
+
children: /* @__PURE__ */ t(W, { name: Dr, className: "h-3 w-3" })
|
|
2318
2324
|
}
|
|
2319
2325
|
),
|
|
2320
2326
|
o.getIsPinned() && /* @__PURE__ */ t(
|
|
@@ -2323,31 +2329,31 @@ function $o({
|
|
|
2323
2329
|
onClick: () => o.pin(!1),
|
|
2324
2330
|
className: "opacity-0 group-hover:opacity-100 flex h-[var(--size-s)] w-[var(--size-s)] items-center justify-center rounded-[var(--border-radius-s)] text-[var(--color-text-secondary)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)]",
|
|
2325
2331
|
title: "Unpin row",
|
|
2326
|
-
children: /* @__PURE__ */ t(W, { name:
|
|
2332
|
+
children: /* @__PURE__ */ t(W, { name: $t, className: "h-3 w-3" })
|
|
2327
2333
|
}
|
|
2328
2334
|
)
|
|
2329
2335
|
] }),
|
|
2330
|
-
|
|
2331
|
-
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: z && o.depth > 0 && (
|
|
2336
|
+
N && !j && !Ee && (_ || z) && /* @__PURE__ */ t("div", { className: "h-[var(--size-s)] w-[var(--size-s)]" }),
|
|
2337
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: z && o.depth > 0 && (D.column.id === o.getParentRow()?.groupingColumnId || D.column.id === Xe) ? (
|
|
2332
2338
|
// Hide grouped column and groupDisplayColumn in detail rows
|
|
2333
2339
|
/* @__PURE__ */ t("div", {})
|
|
2334
|
-
) :
|
|
2340
|
+
) : D.column.columnDef.meta?.truncate !== !1 ? (
|
|
2335
2341
|
// Wrap in TruncatedCell for overflow handling with tooltip
|
|
2336
|
-
/* @__PURE__ */ t(Te, { align:
|
|
2342
|
+
/* @__PURE__ */ t(Te, { align: D.column.columnDef.meta?.align, children: Be(D) })
|
|
2337
2343
|
) : (
|
|
2338
2344
|
// No truncation for this column
|
|
2339
|
-
Be(
|
|
2345
|
+
Be(D)
|
|
2340
2346
|
) })
|
|
2341
2347
|
] })
|
|
2342
2348
|
)
|
|
2343
2349
|
},
|
|
2344
|
-
|
|
2350
|
+
D.id
|
|
2345
2351
|
);
|
|
2346
2352
|
})
|
|
2347
2353
|
}
|
|
2348
2354
|
),
|
|
2349
|
-
|
|
2350
|
-
|
|
2355
|
+
nt?.[o.id] && o.getIsExpanded() && /* @__PURE__ */ t(G, { showBorder: E.showRowBorder, children: /* @__PURE__ */ t(
|
|
2356
|
+
ie,
|
|
2351
2357
|
{
|
|
2352
2358
|
colSpan: o.getVisibleCells().length,
|
|
2353
2359
|
showBorder: E.showCellBorder,
|
|
@@ -2361,7 +2367,7 @@ function $o({
|
|
|
2361
2367
|
}
|
|
2362
2368
|
) }),
|
|
2363
2369
|
J && o.getIsExpanded() && o.depth === 0 && /* @__PURE__ */ t(G, { showBorder: E.showRowBorder, children: /* @__PURE__ */ t(
|
|
2364
|
-
|
|
2370
|
+
ie,
|
|
2365
2371
|
{
|
|
2366
2372
|
colSpan: o.getVisibleCells().length,
|
|
2367
2373
|
showBorder: E.showCellBorder,
|
|
@@ -2369,7 +2375,7 @@ function $o({
|
|
|
2369
2375
|
verticalAlign: Ie,
|
|
2370
2376
|
className: "p-0",
|
|
2371
2377
|
"data-section-header": !0,
|
|
2372
|
-
children:
|
|
2378
|
+
children: ot?.[o.id] ? /* @__PURE__ */ b("div", { className: "flex items-center justify-center py-[var(--space-l)]", children: [
|
|
2373
2379
|
/* @__PURE__ */ t(qe, { size: "s" }),
|
|
2374
2380
|
/* @__PURE__ */ t("span", { className: "ml-[var(--space-s)] text-body-sm text-[var(--color-text-secondary)]", children: "Loading details..." })
|
|
2375
2381
|
] }) : J(o)
|
|
@@ -2377,11 +2383,11 @@ function $o({
|
|
|
2377
2383
|
) }),
|
|
2378
2384
|
(() => {
|
|
2379
2385
|
if (J) return null;
|
|
2380
|
-
const
|
|
2381
|
-
if (
|
|
2386
|
+
const D = o.subRows && o.subRows.length > 0 ? o.subRows : dt?.get(o.id) || [];
|
|
2387
|
+
if (D.length === 0) return null;
|
|
2382
2388
|
let H = o.getIsExpanded();
|
|
2383
|
-
return !H && Q === !0 && o.getCanExpand() && (H = !0), !H && typeof Q == "object" && Q !== null && Q[o.id] && (H = !0), H ?
|
|
2384
|
-
(q,
|
|
2389
|
+
return !H && Q === !0 && o.getCanExpand() && (H = !0), !H && typeof Q == "object" && Q !== null && Q[o.id] && (H = !0), H ? D.map(
|
|
2390
|
+
(q, N) => F(q, N, N === D.length - 1)
|
|
2385
2391
|
) : null;
|
|
2386
2392
|
})()
|
|
2387
2393
|
] }, o.id);
|
|
@@ -2392,37 +2398,37 @@ function $o({
|
|
|
2392
2398
|
})()
|
|
2393
2399
|
) : (
|
|
2394
2400
|
// Empty or no results state
|
|
2395
|
-
|
|
2396
|
-
|
|
2401
|
+
rr.length > 0 || Rt !== "" ? /* @__PURE__ */ t(G, { showBorder: !1, className: "h-[300px]", children: /* @__PURE__ */ t(
|
|
2402
|
+
ie,
|
|
2397
2403
|
{
|
|
2398
|
-
colSpan:
|
|
2404
|
+
colSpan: Bt.length,
|
|
2399
2405
|
className: "text-center",
|
|
2400
2406
|
showBorder: !1,
|
|
2401
2407
|
showRowBorder: !1,
|
|
2402
2408
|
verticalAlign: "middle",
|
|
2403
|
-
children:
|
|
2404
|
-
|
|
2409
|
+
children: Ns || /* @__PURE__ */ t(
|
|
2410
|
+
to,
|
|
2405
2411
|
{
|
|
2406
|
-
title:
|
|
2407
|
-
description:
|
|
2408
|
-
action:
|
|
2412
|
+
title: Rs,
|
|
2413
|
+
description: Is,
|
|
2414
|
+
action: Es
|
|
2409
2415
|
}
|
|
2410
2416
|
)
|
|
2411
2417
|
}
|
|
2412
2418
|
) }) : /* @__PURE__ */ t(G, { showBorder: !1, className: "h-[300px]", children: /* @__PURE__ */ t(
|
|
2413
|
-
|
|
2419
|
+
ie,
|
|
2414
2420
|
{
|
|
2415
|
-
colSpan:
|
|
2421
|
+
colSpan: Bt.length,
|
|
2416
2422
|
className: "text-center",
|
|
2417
2423
|
showBorder: !1,
|
|
2418
2424
|
showRowBorder: !1,
|
|
2419
2425
|
verticalAlign: "middle",
|
|
2420
|
-
children:
|
|
2421
|
-
|
|
2426
|
+
children: ys || /* @__PURE__ */ t(
|
|
2427
|
+
eo,
|
|
2422
2428
|
{
|
|
2423
|
-
title:
|
|
2424
|
-
description:
|
|
2425
|
-
action:
|
|
2429
|
+
title: Cs,
|
|
2430
|
+
description: ws,
|
|
2431
|
+
action: Ss
|
|
2426
2432
|
}
|
|
2427
2433
|
)
|
|
2428
2434
|
}
|
|
@@ -2436,24 +2442,24 @@ function $o({
|
|
|
2436
2442
|
]
|
|
2437
2443
|
}
|
|
2438
2444
|
),
|
|
2439
|
-
|
|
2440
|
-
|
|
2445
|
+
xt && /* @__PURE__ */ t("div", { className: "bg-[var(--color-surface-primary)] px-[var(--space-l)] py-[var(--space-m)]", children: /* @__PURE__ */ t(
|
|
2446
|
+
lo,
|
|
2441
2447
|
{
|
|
2442
2448
|
table: w,
|
|
2443
2449
|
enableGrouping: z,
|
|
2444
2450
|
hideChildrenForSingleItemGroups: ye,
|
|
2445
|
-
footerLabel:
|
|
2446
|
-
onNextPageHover:
|
|
2447
|
-
onPreviousPageHover:
|
|
2448
|
-
paginationVariant:
|
|
2449
|
-
pageSizeOptions:
|
|
2451
|
+
footerLabel: as,
|
|
2452
|
+
onNextPageHover: ms,
|
|
2453
|
+
onPreviousPageHover: hs,
|
|
2454
|
+
paginationVariant: ns,
|
|
2455
|
+
pageSizeOptions: os
|
|
2450
2456
|
}
|
|
2451
2457
|
) }),
|
|
2452
|
-
|
|
2453
|
-
|
|
2458
|
+
Xt && ps && /* @__PURE__ */ t(
|
|
2459
|
+
co,
|
|
2454
2460
|
{
|
|
2455
|
-
onLoadMore: () =>
|
|
2456
|
-
isLoading:
|
|
2461
|
+
onLoadMore: () => Xt(re.pageIndex),
|
|
2462
|
+
isLoading: vs
|
|
2457
2463
|
}
|
|
2458
2464
|
)
|
|
2459
2465
|
] })
|
|
@@ -2461,14 +2467,14 @@ function $o({
|
|
|
2461
2467
|
) });
|
|
2462
2468
|
}
|
|
2463
2469
|
export {
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2470
|
+
Ao as DataTable,
|
|
2471
|
+
jo as DataTableColumnHeader,
|
|
2472
|
+
ao as DataTableFilter,
|
|
2473
|
+
lo as DataTablePagination,
|
|
2474
|
+
Fr as DataTableSkeleton,
|
|
2475
|
+
no as DataTableToolbar,
|
|
2476
|
+
zr as fuzzyFilter,
|
|
2477
|
+
$o as groupPreservingGlobalFilter,
|
|
2478
|
+
Kn as multiSelectFilter,
|
|
2479
|
+
Ho as useReactTable
|
|
2474
2480
|
};
|