@rafal.lemieszewski/tide-ui 0.85.1 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/fundamental/breadcrumb.cjs +1 -1
- package/dist/cjs/components/fundamental/button.cjs +1 -1
- package/dist/cjs/components/fundamental/calendar.cjs +1 -1
- package/dist/cjs/components/fundamental/country-dropdown.cjs +1 -1
- package/dist/cjs/components/fundamental/custom-icons.cjs +1 -1
- package/dist/cjs/components/fundamental/dialog.cjs +1 -1
- package/dist/cjs/components/fundamental/file-upload.cjs +1 -1
- package/dist/cjs/components/fundamental/icon.cjs +1 -1
- package/dist/cjs/components/fundamental/month-picker.cjs +1 -1
- package/dist/cjs/components/fundamental/pagination.cjs +1 -1
- package/dist/cjs/components/fundamental/select.cjs +1 -1
- package/dist/cjs/components/fundamental/separator.cjs +1 -1
- package/dist/cjs/components/fundamental/sidebar.cjs +1 -1
- package/dist/cjs/components/fundamental/toast.cjs +1 -1
- package/dist/cjs/components/fundamental/tree.cjs +1 -1
- package/dist/cjs/components/product/app-frame.cjs +1 -1
- package/dist/cjs/components/product/attributes-list.cjs +1 -1
- package/dist/cjs/components/product/bookmarks.cjs +1 -1
- package/dist/cjs/components/product/data-table-settings-menu.cjs +1 -1
- package/dist/cjs/components/product/data-table.cjs +1 -1
- package/dist/cjs/components/product/filters.cjs +1 -1
- package/dist/cjs/components/product/fixture-status.cjs +1 -1
- package/dist/cjs/components/product/linked-chart.cjs +1 -1
- package/dist/cjs/components/product/view-mode-menu.cjs +1 -1
- package/dist/es/components/fundamental/button.js +10 -9
- package/dist/es/components/fundamental/calendar.js +18 -17
- package/dist/es/components/fundamental/custom-icons.js +283 -517
- package/dist/es/components/fundamental/dialog.js +25 -24
- package/dist/es/components/fundamental/file-upload.js +17 -16
- package/dist/es/components/fundamental/icon.js +68 -147
- package/dist/es/components/fundamental/month-picker.js +21 -20
- package/dist/es/components/fundamental/pagination.js +44 -43
- package/dist/es/components/fundamental/select.js +40 -39
- package/dist/es/components/fundamental/separator.js +11 -10
- package/dist/es/components/fundamental/sidebar.js +85 -84
- package/dist/es/components/fundamental/toast.js +8 -7
- package/dist/es/components/product/app-frame.js +83 -82
- package/dist/es/components/product/attributes-list.js +61 -60
- package/dist/es/components/product/bookmarks.js +170 -169
- package/dist/es/components/product/data-table-settings-menu.js +38 -37
- package/dist/es/components/product/data-table.js +374 -373
- package/dist/es/components/product/filters.js +93 -92
- package/dist/es/components/product/fixture-status.js +89 -87
- package/dist/es/components/product/linked-chart.js +54 -53
- package/dist/es/components/product/view-mode-menu.js +176 -175
- package/dist/types/components/core-index.d.cts +1 -1
- package/dist/types/components/core-index.d.ts +1 -1
- package/dist/types/components/fundamental/custom-icons.d.ts +32 -36
- package/dist/types/components/fundamental/dropdown-menu.d.ts +2 -1
- package/dist/types/components/fundamental/icon.d.ts +1 -3
- package/dist/types/components/index.d.ts +2 -1
- package/dist/types/components/product/fixture-status.d.ts +2 -2
- package/dist/types/lib/index.d.cts +1 -1
- package/dist/types/lib/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { jsx as t, Fragment as ee, jsxs as b } from "react/jsx-runtime";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import { useReactTable as
|
|
4
|
-
import { useReactTable as
|
|
5
|
-
import { useSensors as
|
|
6
|
-
import { SortableContext as
|
|
7
|
-
import { CSS as
|
|
3
|
+
import { useReactTable as is, getFacetedMinMaxValues as cs, getFacetedUniqueValues as ds, getFacetedRowModel as us, getGroupedRowModel as fs, getExpandedRowModel as gs, getSortedRowModel as ms, getPaginationRowModel as hs, getFilteredRowModel as ps, getCoreRowModel as vs, flexRender as be } from "@tanstack/react-table";
|
|
4
|
+
import { useReactTable as Lo } from "@tanstack/react-table";
|
|
5
|
+
import { useSensors as bs, useSensor as Sr, MouseSensor as xs, TouchSensor as ys, DndContext as Cs, closestCenter as ws } from "@dnd-kit/core";
|
|
6
|
+
import { SortableContext as Ss, horizontalListSortingStrategy as Ns, arrayMove as Rs, useSortable as Is } from "@dnd-kit/sortable";
|
|
7
|
+
import { CSS as Es } from "@dnd-kit/utilities";
|
|
8
8
|
import { cn as V } from "../../lib/utils.js";
|
|
9
|
-
import { Button as
|
|
9
|
+
import { Button as Pe } from "../fundamental/button.js";
|
|
10
10
|
import { Input as ft } from "../fundamental/input.js";
|
|
11
|
-
import { AutocompleteSearch as
|
|
12
|
-
import { Table as
|
|
13
|
-
import { Select as
|
|
11
|
+
import { AutocompleteSearch as Ds } from "../fundamental/autocomplete-search.js";
|
|
12
|
+
import { Table as ks, TableHeader as zs, TableRow as G, TableHead as ut, TableBody as Bs, TableCell as le } from "../fundamental/table.js";
|
|
13
|
+
import { Select as Ts, SelectTrigger as Ps, SelectValue as Ms, SelectContent as Vs, SelectItem as Nr } from "../fundamental/select.js";
|
|
14
14
|
import { Checkbox as gt } from "../fundamental/checkbox.js";
|
|
15
15
|
import { Icon as W } from "../fundamental/icon.js";
|
|
16
|
+
import { PlusCircle as Fs, X as Vt, GripVertical as $s, ArrowUpToLine as Rr, ArrowDownToLine as Ir, AlertCircle as js, Filter as As } from "lucide-react";
|
|
16
17
|
import { Badge as xe } from "../fundamental/badge.js";
|
|
17
|
-
import { Popover as
|
|
18
|
-
import { Command as
|
|
19
|
-
import { Pagination as
|
|
20
|
-
import { Skeleton as
|
|
18
|
+
import { Popover as $r, PopoverTrigger as jr, PopoverContent as Ar } from "../fundamental/popover.js";
|
|
19
|
+
import { Command as Lr, CommandInput as Or, CommandList as Hr, CommandEmpty as Wr, CommandGroup as Gr, CommandItem as _r } from "../fundamental/command.js";
|
|
20
|
+
import { Pagination as Ls } from "../fundamental/pagination.js";
|
|
21
|
+
import { Skeleton as Er } from "../fundamental/skeleton.js";
|
|
21
22
|
import { Spinner as qe } from "../fundamental/spinner.js";
|
|
22
|
-
import { DataTableSettingsMenu as
|
|
23
|
-
import { TooltipProvider as
|
|
24
|
-
function
|
|
23
|
+
import { DataTableSettingsMenu as Os } from "./data-table-settings-menu.js";
|
|
24
|
+
import { TooltipProvider as Hs, Tooltip as Ws, TooltipTrigger as Gs, TooltipContent as _s } from "../fundamental/tooltip.js";
|
|
25
|
+
function qs(c, s) {
|
|
25
26
|
const [i, a] = l.useState(c);
|
|
26
27
|
return l.useEffect(() => {
|
|
27
28
|
const f = setTimeout(() => {
|
|
@@ -56,8 +57,8 @@ const Te = /* @__PURE__ */ l.memo(function({ children: s, align: i = "left" }) {
|
|
|
56
57
|
};
|
|
57
58
|
}, [s]), l.useEffect(() => {
|
|
58
59
|
a.current && h(a.current.textContent || "");
|
|
59
|
-
}, [s]), f ? /* @__PURE__ */ b(
|
|
60
|
-
/* @__PURE__ */ t(
|
|
60
|
+
}, [s]), f ? /* @__PURE__ */ b(Ws, { children: [
|
|
61
|
+
/* @__PURE__ */ t(Gs, { asChild: !0, children: /* @__PURE__ */ t(
|
|
61
62
|
"div",
|
|
62
63
|
{
|
|
63
64
|
ref: a,
|
|
@@ -65,7 +66,7 @@ const Te = /* @__PURE__ */ l.memo(function({ children: s, align: i = "left" }) {
|
|
|
65
66
|
children: s
|
|
66
67
|
}
|
|
67
68
|
) }),
|
|
68
|
-
/* @__PURE__ */ t(
|
|
69
|
+
/* @__PURE__ */ t(_s, { side: "top", className: "max-w-xs", children: y })
|
|
69
70
|
] }) : /* @__PURE__ */ t(
|
|
70
71
|
"div",
|
|
71
72
|
{
|
|
@@ -74,14 +75,14 @@ const Te = /* @__PURE__ */ l.memo(function({ children: s, align: i = "left" }) {
|
|
|
74
75
|
children: s
|
|
75
76
|
}
|
|
76
77
|
);
|
|
77
|
-
}),
|
|
78
|
+
}), Dr = (c, s, i, a) => {
|
|
78
79
|
const f = c.getValue(s), x = f != null ? String(f) : "", y = i.toLowerCase();
|
|
79
80
|
return x.toLowerCase().includes(y) ? !0 : x.toLowerCase().split(" ").some((p) => p.startsWith(y));
|
|
80
|
-
},
|
|
81
|
+
}, Us = (c, s, i) => {
|
|
81
82
|
if (!i || i.length === 0) return !0;
|
|
82
83
|
const a = c.getValue(s);
|
|
83
84
|
return i.includes(a);
|
|
84
|
-
},
|
|
85
|
+
}, Vo = (c, s, i, a) => {
|
|
85
86
|
if (!i || i.trim() === "") return !0;
|
|
86
87
|
const f = String(i).toLowerCase(), x = (h) => {
|
|
87
88
|
const p = h.getAllCells().map((v) => v.column.id);
|
|
@@ -96,7 +97,7 @@ const Te = /* @__PURE__ */ l.memo(function({ children: s, align: i = "left" }) {
|
|
|
96
97
|
const y = x(c);
|
|
97
98
|
return a && y && a({ itemRank: 1 }), y;
|
|
98
99
|
};
|
|
99
|
-
function
|
|
100
|
+
function Js(c, s) {
|
|
100
101
|
for (const i of c) {
|
|
101
102
|
const a = typeof s == "function" ? s(i.original) : i.original?.[s];
|
|
102
103
|
if (a != null) {
|
|
@@ -111,26 +112,26 @@ function Os(c, s) {
|
|
|
111
112
|
}
|
|
112
113
|
return "unknown";
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
+
function kr(c) {
|
|
115
116
|
if (c.length === 0) return "";
|
|
116
117
|
const s = Math.min(...c), i = Math.max(...c);
|
|
117
118
|
return s === i ? String(s) : `${s} – ${i}`;
|
|
118
119
|
}
|
|
119
|
-
function
|
|
120
|
+
function Ks(c) {
|
|
120
121
|
return c.length === 0 ? "" : `Avg: ${(c.reduce((a, f) => a + f, 0) / c.length).toFixed(2)}`;
|
|
121
122
|
}
|
|
122
|
-
function
|
|
123
|
+
function Xs(c) {
|
|
123
124
|
return c.length === 0 ? "" : `Total: ${c.reduce((i, a) => i + a, 0)}`;
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
+
function zr(c) {
|
|
126
127
|
return `${c} ${c === 1 ? "item" : "items"}`;
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
+
function Br(c, s) {
|
|
129
130
|
if (c.length === 0) return "";
|
|
130
131
|
const a = new Set(c).size, f = a === 1 || s.endsWith("s") ? s : s.endsWith("y") ? s.slice(0, -1) + "ies" : s + "s";
|
|
131
132
|
return `${a} ${f.toLowerCase()}`;
|
|
132
133
|
}
|
|
133
|
-
function
|
|
134
|
+
function Qs(c) {
|
|
134
135
|
if (c.length === 0) return "";
|
|
135
136
|
const s = /* @__PURE__ */ new Map();
|
|
136
137
|
c.forEach((f) => s.set(f, (s.get(f) || 0) + 1));
|
|
@@ -139,14 +140,14 @@ function Gs(c) {
|
|
|
139
140
|
f > i && (i = f, a = x);
|
|
140
141
|
}), `${a} (${i})`;
|
|
141
142
|
}
|
|
142
|
-
function
|
|
143
|
+
function Tr(c) {
|
|
143
144
|
if (c.length === 0) return "";
|
|
144
145
|
const i = c.map((y) => y instanceof Date ? y : new Date(y)).filter((y) => !isNaN(y.getTime()));
|
|
145
146
|
if (i.length === 0) return "";
|
|
146
147
|
const a = new Date(Math.min(...i.map((y) => y.getTime()))), f = new Date(Math.max(...i.map((y) => y.getTime()))), x = (y) => y.toISOString().split("T")[0];
|
|
147
148
|
return a.getTime() === f.getTime() ? x(a) : `${x(a)} – ${x(f)}`;
|
|
148
149
|
}
|
|
149
|
-
function
|
|
150
|
+
function Pr(c, s, i) {
|
|
150
151
|
const a = c.columnDef;
|
|
151
152
|
if (c.id === i || a?.meta?.renderInGroupedRows || a?.meta?.aggregation === !1) return null;
|
|
152
153
|
if (typeof a?.meta?.aggregation == "function") {
|
|
@@ -161,56 +162,56 @@ function zr(c, s, i) {
|
|
|
161
162
|
if (p && typeof p == "string")
|
|
162
163
|
switch (p) {
|
|
163
164
|
case "range":
|
|
164
|
-
return
|
|
165
|
+
return kr(h);
|
|
165
166
|
case "average":
|
|
166
|
-
return
|
|
167
|
+
return Ks(h);
|
|
167
168
|
case "sum":
|
|
168
|
-
return
|
|
169
|
+
return Xs(h);
|
|
169
170
|
case "count":
|
|
170
|
-
return
|
|
171
|
+
return zr(h.length);
|
|
171
172
|
case "uniqueCount":
|
|
172
|
-
return
|
|
173
|
+
return Br(
|
|
173
174
|
h.map(String),
|
|
174
175
|
a?.meta?.label || String(c.id)
|
|
175
176
|
);
|
|
176
177
|
case "mostCommon":
|
|
177
|
-
return
|
|
178
|
+
return Qs(h.map(String));
|
|
178
179
|
case "dateRange":
|
|
179
|
-
return
|
|
180
|
+
return Tr(h);
|
|
180
181
|
default:
|
|
181
182
|
return null;
|
|
182
183
|
}
|
|
183
|
-
switch (
|
|
184
|
+
switch (Js(s, y)) {
|
|
184
185
|
case "number":
|
|
185
|
-
return
|
|
186
|
+
return kr(h);
|
|
186
187
|
case "string":
|
|
187
|
-
return
|
|
188
|
+
return Br(
|
|
188
189
|
h.map(String),
|
|
189
190
|
a?.meta?.label || String(c.id)
|
|
190
191
|
);
|
|
191
192
|
case "date":
|
|
192
|
-
return
|
|
193
|
+
return Tr(h);
|
|
193
194
|
default:
|
|
194
|
-
return
|
|
195
|
+
return zr(h.length);
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
|
-
function
|
|
198
|
+
function Mr({ columns: c, rows: s, showRowBorder: i = !0, showCellBorder: a = !0, skipHeader: f = !1, enableResponsiveWrapper: x = !0 }) {
|
|
198
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]";
|
|
199
200
|
return /* @__PURE__ */ b(ee, { children: [
|
|
200
|
-
!f && /* @__PURE__ */ t(G, { showBorder: i, children: Array.from({ length: c }).map((p, v) => /* @__PURE__ */ t(ut, { showBorder: a, className: "overflow-hidden", children: /* @__PURE__ */ t(
|
|
201
|
+
!f && /* @__PURE__ */ t(G, { showBorder: i, children: Array.from({ length: c }).map((p, v) => /* @__PURE__ */ t(ut, { showBorder: a, className: "overflow-hidden", children: /* @__PURE__ */ t(Er, { className: y }) }, v)) }),
|
|
201
202
|
Array.from({ length: s }).map((p, v) => /* @__PURE__ */ t(G, { showBorder: i, children: Array.from({ length: c }).map((R, D) => /* @__PURE__ */ t(
|
|
202
203
|
le,
|
|
203
204
|
{
|
|
204
205
|
showBorder: a,
|
|
205
206
|
showRowBorder: i,
|
|
206
207
|
className: "text-body-sm overflow-hidden",
|
|
207
|
-
children: /* @__PURE__ */ t(
|
|
208
|
+
children: /* @__PURE__ */ t(Er, { className: h })
|
|
208
209
|
},
|
|
209
210
|
D
|
|
210
211
|
)) }, v))
|
|
211
212
|
] });
|
|
212
213
|
}
|
|
213
|
-
const
|
|
214
|
+
const Ys = /* @__PURE__ */ l.memo(function({
|
|
214
215
|
title: s = "No data",
|
|
215
216
|
description: i = "No items to display",
|
|
216
217
|
action: a,
|
|
@@ -220,7 +221,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
220
221
|
/* @__PURE__ */ t("p", { className: "text-body-medium-md text-[var(--color-text-primary)]", children: s }),
|
|
221
222
|
i && /* @__PURE__ */ t("p", { className: "text-body-sm text-[var(--color-text-secondary)] mt-[var(--space-xs)]", children: i }),
|
|
222
223
|
a && /* @__PURE__ */ t(
|
|
223
|
-
|
|
224
|
+
Pe,
|
|
224
225
|
{
|
|
225
226
|
variant: "primary",
|
|
226
227
|
size: "s",
|
|
@@ -230,7 +231,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
230
231
|
}
|
|
231
232
|
)
|
|
232
233
|
] });
|
|
233
|
-
}),
|
|
234
|
+
}), Zs = /* @__PURE__ */ l.memo(function({
|
|
234
235
|
title: s = "No results found",
|
|
235
236
|
description: i = "Try adjusting your search or filters",
|
|
236
237
|
action: a,
|
|
@@ -240,7 +241,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
240
241
|
/* @__PURE__ */ t("p", { className: "text-body-medium-md text-[var(--color-text-primary)]", children: s }),
|
|
241
242
|
i && /* @__PURE__ */ t("p", { className: "text-body-sm text-[var(--color-text-secondary)] mt-[var(--space-xs)]", children: i }),
|
|
242
243
|
a && /* @__PURE__ */ t(
|
|
243
|
-
|
|
244
|
+
Pe,
|
|
244
245
|
{
|
|
245
246
|
variant: "default",
|
|
246
247
|
size: "s",
|
|
@@ -250,7 +251,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
250
251
|
}
|
|
251
252
|
)
|
|
252
253
|
] });
|
|
253
|
-
}),
|
|
254
|
+
}), eo = /* @__PURE__ */ l.memo(function({
|
|
254
255
|
error: s,
|
|
255
256
|
onRetry: i,
|
|
256
257
|
customContent: a
|
|
@@ -259,7 +260,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
259
260
|
/* @__PURE__ */ t("p", { className: "text-body-medium-md text-[var(--color-text-primary)]", children: "Something went wrong" }),
|
|
260
261
|
/* @__PURE__ */ t("p", { className: "text-body-sm text-[var(--color-text-secondary)] mt-[var(--space-xs)]", children: s?.message || "An error occurred while loading data" }),
|
|
261
262
|
i && /* @__PURE__ */ t(
|
|
262
|
-
|
|
263
|
+
Pe,
|
|
263
264
|
{
|
|
264
265
|
variant: "default",
|
|
265
266
|
size: "s",
|
|
@@ -269,9 +270,9 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
269
270
|
}
|
|
270
271
|
)
|
|
271
272
|
] });
|
|
272
|
-
}),
|
|
273
|
+
}), to = /* @__PURE__ */ l.memo(function() {
|
|
273
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" }) });
|
|
274
|
-
}),
|
|
275
|
+
}), ro = /* @__PURE__ */ l.memo(function({
|
|
275
276
|
table: s,
|
|
276
277
|
searchKey: i,
|
|
277
278
|
searchPlaceholder: a = "Search...",
|
|
@@ -290,7 +291,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
290
291
|
return /* @__PURE__ */ b("div", { className: "flex items-center justify-between", children: [
|
|
291
292
|
/* @__PURE__ */ b("div", { className: "flex flex-1 items-center space-x-2", children: [
|
|
292
293
|
f && h && /* @__PURE__ */ t(ee, { children: D && T.length > 0 ? /* @__PURE__ */ t(
|
|
293
|
-
|
|
294
|
+
Ds,
|
|
294
295
|
{
|
|
295
296
|
value: y,
|
|
296
297
|
onValueChange: h,
|
|
@@ -305,7 +306,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
305
306
|
{
|
|
306
307
|
placeholder: x,
|
|
307
308
|
value: y,
|
|
308
|
-
onChange: (
|
|
309
|
+
onChange: (M) => h(M.target.value),
|
|
309
310
|
className: "h-8 w-[150px] lg:w-[250px]"
|
|
310
311
|
}
|
|
311
312
|
) }),
|
|
@@ -314,14 +315,14 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
314
315
|
{
|
|
315
316
|
placeholder: a,
|
|
316
317
|
value: s.getColumn(i)?.getFilterValue() ?? "",
|
|
317
|
-
onChange: (
|
|
318
|
+
onChange: (M) => s.getColumn(i)?.setFilterValue(M.target.value),
|
|
318
319
|
className: "h-8 w-[150px] lg:w-[250px]"
|
|
319
320
|
}
|
|
320
321
|
),
|
|
321
|
-
s.getAllColumns().filter((
|
|
322
|
-
p && /* @__PURE__ */ t(
|
|
322
|
+
s.getAllColumns().filter((M) => M.getCanFilter() && M.columnDef.meta?.filterVariant).map((M) => /* @__PURE__ */ t(so, { column: M }, M.id)),
|
|
323
|
+
p && /* @__PURE__ */ t(no, { table: s }),
|
|
323
324
|
A && /* @__PURE__ */ b(
|
|
324
|
-
|
|
325
|
+
Pe,
|
|
325
326
|
{
|
|
326
327
|
variant: "ghost",
|
|
327
328
|
onClick: () => {
|
|
@@ -330,14 +331,14 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
330
331
|
className: "h-8 px-2 lg:px-3",
|
|
331
332
|
children: [
|
|
332
333
|
"Reset",
|
|
333
|
-
/* @__PURE__ */ t(W, { name:
|
|
334
|
+
/* @__PURE__ */ t(W, { name: Vt, className: "ml-2 h-4 w-4" })
|
|
334
335
|
]
|
|
335
336
|
}
|
|
336
337
|
)
|
|
337
338
|
] }),
|
|
338
|
-
R && /* @__PURE__ */ t("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ t(
|
|
339
|
+
R && /* @__PURE__ */ t("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ t(qr, { table: s, enableGrouping: v }) })
|
|
339
340
|
] });
|
|
340
|
-
}),
|
|
341
|
+
}), no = /* @__PURE__ */ l.memo(function({ table: s }) {
|
|
341
342
|
const [i, a] = l.useState([]), f = s.getAllColumns().filter(
|
|
342
343
|
(h) => h.columnDef.meta?.filterOptions && h.getCanFilter()
|
|
343
344
|
), x = l.useMemo(() => {
|
|
@@ -345,10 +346,10 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
345
346
|
return f.forEach((p) => {
|
|
346
347
|
const v = p.getFacetedUniqueValues(), R = p.columnDef.meta?.filterOptions || [], D = p.columnDef.meta?.label || p.columnDef.header;
|
|
347
348
|
v.forEach((T, C) => {
|
|
348
|
-
const A = R.find((
|
|
349
|
+
const A = R.find((M) => M.value === C);
|
|
349
350
|
if (A && T > 0) {
|
|
350
|
-
const
|
|
351
|
-
h.set(
|
|
351
|
+
const M = `${D}:${C}`;
|
|
352
|
+
h.set(M, {
|
|
352
353
|
count: T,
|
|
353
354
|
column: D,
|
|
354
355
|
label: A.label
|
|
@@ -369,9 +370,9 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
369
370
|
D.length > 0 ? v.columnDef.meta?.filterVariant === "multiselect" ? v.setFilterValue(D) : v.columnDef.meta?.filterVariant === "select" && v.setFilterValue(D[0]) : v.setFilterValue(void 0);
|
|
370
371
|
});
|
|
371
372
|
};
|
|
372
|
-
return x.length === 0 ? null : /* @__PURE__ */ b(
|
|
373
|
-
/* @__PURE__ */ t(
|
|
374
|
-
/* @__PURE__ */ t(W, { name:
|
|
373
|
+
return x.length === 0 ? null : /* @__PURE__ */ b($r, { children: [
|
|
374
|
+
/* @__PURE__ */ t(jr, { asChild: !0, children: /* @__PURE__ */ b(Pe, { variant: "ghost", size: "s", className: "h-8 border-dashed", children: [
|
|
375
|
+
/* @__PURE__ */ t(W, { name: As, className: "mr-2 h-4 w-4" }),
|
|
375
376
|
"Global Faceting",
|
|
376
377
|
i.length > 0 && /* @__PURE__ */ b(ee, { children: [
|
|
377
378
|
/* @__PURE__ */ t("div", { className: "mx-2 h-4 w-px bg-[var(--color-border-primary)]" }),
|
|
@@ -381,14 +382,14 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
381
382
|
] })
|
|
382
383
|
] })
|
|
383
384
|
] }) }),
|
|
384
|
-
/* @__PURE__ */ t(
|
|
385
|
-
/* @__PURE__ */ t(
|
|
386
|
-
/* @__PURE__ */ b(
|
|
387
|
-
/* @__PURE__ */ t(
|
|
388
|
-
/* @__PURE__ */ t(
|
|
385
|
+
/* @__PURE__ */ t(Ar, { className: "w-[300px] p-0", align: "start", children: /* @__PURE__ */ b(Lr, { children: [
|
|
386
|
+
/* @__PURE__ */ t(Or, { placeholder: "Search values across all columns..." }),
|
|
387
|
+
/* @__PURE__ */ b(Hr, { children: [
|
|
388
|
+
/* @__PURE__ */ t(Wr, { children: "No results found" }),
|
|
389
|
+
/* @__PURE__ */ t(Gr, { children: x.map((h) => {
|
|
389
390
|
const p = i.includes(h.value);
|
|
390
391
|
return /* @__PURE__ */ t(
|
|
391
|
-
|
|
392
|
+
_r,
|
|
392
393
|
{
|
|
393
394
|
onSelect: () => y(h.value),
|
|
394
395
|
children: /* @__PURE__ */ b("div", { className: "flex items-center justify-between flex-1", children: [
|
|
@@ -411,24 +412,24 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
411
412
|
] })
|
|
412
413
|
] }) })
|
|
413
414
|
] });
|
|
414
|
-
}),
|
|
415
|
+
}), so = /* @__PURE__ */ l.memo(function({ column: s }) {
|
|
415
416
|
const { filterVariant: i, filterOptions: a, label: f, placeholder: x } = s.columnDef.meta || {}, y = s.getFilterValue(), h = s.getFacetedUniqueValues();
|
|
416
417
|
if (i === "select" && a)
|
|
417
418
|
return /* @__PURE__ */ b(
|
|
418
|
-
|
|
419
|
+
Ts,
|
|
419
420
|
{
|
|
420
421
|
value: y || "all",
|
|
421
422
|
onValueChange: (p) => s.setFilterValue(p === "all" ? "" : p),
|
|
422
423
|
children: [
|
|
423
|
-
/* @__PURE__ */ t(
|
|
424
|
-
/* @__PURE__ */ b(
|
|
425
|
-
/* @__PURE__ */ b(
|
|
424
|
+
/* @__PURE__ */ t(Ps, { className: "h-8 w-[150px]", children: /* @__PURE__ */ t(Ms, { placeholder: x || `Filter ${f}` }) }),
|
|
425
|
+
/* @__PURE__ */ b(Vs, { children: [
|
|
426
|
+
/* @__PURE__ */ b(Nr, { value: "all", children: [
|
|
426
427
|
"All ",
|
|
427
428
|
f
|
|
428
429
|
] }),
|
|
429
430
|
a.map((p) => {
|
|
430
431
|
const v = h.get(p.value) || 0;
|
|
431
|
-
return /* @__PURE__ */ t(
|
|
432
|
+
return /* @__PURE__ */ t(Nr, { value: p.value, children: /* @__PURE__ */ b("div", { className: "flex items-center justify-between w-full gap-2", children: [
|
|
432
433
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
|
|
433
434
|
p.icon && /* @__PURE__ */ t(p.icon, { className: "h-4 w-4" }),
|
|
434
435
|
p.label
|
|
@@ -442,9 +443,9 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
442
443
|
);
|
|
443
444
|
if (i === "multiselect" && a) {
|
|
444
445
|
const p = y || [];
|
|
445
|
-
return /* @__PURE__ */ b(
|
|
446
|
-
/* @__PURE__ */ t(
|
|
447
|
-
/* @__PURE__ */ t(W, { name:
|
|
446
|
+
return /* @__PURE__ */ b($r, { children: [
|
|
447
|
+
/* @__PURE__ */ t(jr, { asChild: !0, children: /* @__PURE__ */ b(Pe, { variant: "ghost", size: "s", className: "h-8 border-dashed", children: [
|
|
448
|
+
/* @__PURE__ */ t(W, { name: Fs, className: "mr-2 h-4 w-4" }),
|
|
448
449
|
f,
|
|
449
450
|
p.length > 0 && /* @__PURE__ */ b(ee, { children: [
|
|
450
451
|
/* @__PURE__ */ t("div", { className: "mx-2 h-4 w-px bg-[var(--color-border-primary)]" }),
|
|
@@ -455,14 +456,14 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
455
456
|
] }) : a.filter((v) => p.includes(v.value)).map((v) => /* @__PURE__ */ t(xe, { className: "rounded-s px-1 font-normal", children: v.label }, v.value)) })
|
|
456
457
|
] })
|
|
457
458
|
] }) }),
|
|
458
|
-
/* @__PURE__ */ t(
|
|
459
|
-
/* @__PURE__ */ t(
|
|
460
|
-
/* @__PURE__ */ b(
|
|
461
|
-
/* @__PURE__ */ t(
|
|
462
|
-
/* @__PURE__ */ t(
|
|
459
|
+
/* @__PURE__ */ t(Ar, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ b(Lr, { children: [
|
|
460
|
+
/* @__PURE__ */ t(Or, { placeholder: x || `Search ${f}...` }),
|
|
461
|
+
/* @__PURE__ */ b(Hr, { children: [
|
|
462
|
+
/* @__PURE__ */ t(Wr, { children: "No results found" }),
|
|
463
|
+
/* @__PURE__ */ t(Gr, { children: a.map((v) => {
|
|
463
464
|
const R = p.includes(v.value), D = h.get(v.value) || 0;
|
|
464
465
|
return /* @__PURE__ */ t(
|
|
465
|
-
|
|
466
|
+
_r,
|
|
466
467
|
{
|
|
467
468
|
onSelect: () => {
|
|
468
469
|
const T = R ? p.filter((C) => C !== v.value) : [...p, v.value];
|
|
@@ -502,7 +503,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
502
503
|
className: "h-8 w-[150px]"
|
|
503
504
|
}
|
|
504
505
|
);
|
|
505
|
-
}),
|
|
506
|
+
}), oo = /* @__PURE__ */ l.memo(function({ header: s, enableColumnOrdering: i, children: a }) {
|
|
506
507
|
const {
|
|
507
508
|
attributes: f,
|
|
508
509
|
listeners: x,
|
|
@@ -510,11 +511,11 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
510
511
|
transform: h,
|
|
511
512
|
transition: p,
|
|
512
513
|
isDragging: v
|
|
513
|
-
} =
|
|
514
|
+
} = Is({
|
|
514
515
|
id: s.id,
|
|
515
516
|
disabled: !i
|
|
516
517
|
}), R = {
|
|
517
|
-
transform:
|
|
518
|
+
transform: Es.Translate.toString(h),
|
|
518
519
|
// Only translate, no scale
|
|
519
520
|
transition: p,
|
|
520
521
|
opacity: v ? 0.5 : 1
|
|
@@ -539,7 +540,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
539
540
|
children: /* @__PURE__ */ t(
|
|
540
541
|
W,
|
|
541
542
|
{
|
|
542
|
-
name:
|
|
543
|
+
name: $s,
|
|
543
544
|
className: "h-3 w-3 text-[var(--color-text-tertiary)]"
|
|
544
545
|
}
|
|
545
546
|
)
|
|
@@ -548,7 +549,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
548
549
|
]
|
|
549
550
|
}
|
|
550
551
|
) : /* @__PURE__ */ t(ee, { children: a });
|
|
551
|
-
}),
|
|
552
|
+
}), qr = /* @__PURE__ */ l.memo(function({ table: s, enableGrouping: i = !1 }) {
|
|
552
553
|
const a = s.getAllColumns().filter((N) => N.getCanSort()).map((N) => ({
|
|
553
554
|
id: N.id,
|
|
554
555
|
label: N.columnDef.meta?.label || N.columnDef.header || N.id
|
|
@@ -560,7 +561,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
560
561
|
label: N.columnDef.meta?.label || N.columnDef.header || N.id
|
|
561
562
|
})), y = x.filter((N) => s.getColumn(N.id)?.getIsVisible()).map((N) => N.id), h = s.getState().sorting[0], p = h?.id, v = h?.desc ? "desc" : "asc", D = s.getState().grouping[0] || "";
|
|
562
563
|
return /* @__PURE__ */ t(
|
|
563
|
-
|
|
564
|
+
Os,
|
|
564
565
|
{
|
|
565
566
|
sortableColumns: a,
|
|
566
567
|
selectedSortColumn: p,
|
|
@@ -583,7 +584,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
583
584
|
}
|
|
584
585
|
}
|
|
585
586
|
);
|
|
586
|
-
}),
|
|
587
|
+
}), Fo = /* @__PURE__ */ l.memo(function({
|
|
587
588
|
column: s,
|
|
588
589
|
title: i,
|
|
589
590
|
className: a
|
|
@@ -610,7 +611,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
610
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: i }) }) : /* @__PURE__ */ t("div", { className: V(f === "right" ? "text-right" : "text-left", a), children: i });
|
|
613
|
-
}),
|
|
614
|
+
}), ao = /* @__PURE__ */ l.memo(function({
|
|
614
615
|
table: s,
|
|
615
616
|
enableGrouping: i = !1,
|
|
616
617
|
hideChildrenForSingleItemGroups: a = {},
|
|
@@ -620,10 +621,10 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
620
621
|
paginationVariant: h = "full",
|
|
621
622
|
pageSizeOptions: p = [10, 25, 50, 100]
|
|
622
623
|
}) {
|
|
623
|
-
const v = s.getState().pagination.pageIndex + 1, R = s.getState().pagination.pageSize, D = i && !s.options.manualPagination ? s.getPrePaginationRowModel().rows.filter((
|
|
624
|
-
s.setPageIndex(
|
|
625
|
-
}, A = (
|
|
626
|
-
s.setPageSize(
|
|
624
|
+
const v = s.getState().pagination.pageIndex + 1, R = s.getState().pagination.pageSize, D = i && !s.options.manualPagination ? s.getPrePaginationRowModel().rows.filter((M) => M.depth === 0).length : s.getRowCount(), T = s.getFilteredSelectedRowModel().rows.length, C = (M) => {
|
|
625
|
+
s.setPageIndex(M - 1);
|
|
626
|
+
}, A = (M) => {
|
|
627
|
+
s.setPageSize(M);
|
|
627
628
|
};
|
|
628
629
|
return /* @__PURE__ */ b("div", { className: "flex items-center justify-between", children: [
|
|
629
630
|
/* @__PURE__ */ t("div", { className: "flex-1 text-body-sm text-[var(--color-text-secondary)]", children: f ? /* @__PURE__ */ b("div", { className: "flex items-center gap-[var(--space-m)]", children: [
|
|
@@ -642,7 +643,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
642
643
|
" row(s) selected."
|
|
643
644
|
] }) }),
|
|
644
645
|
/* @__PURE__ */ t(
|
|
645
|
-
|
|
646
|
+
Ls,
|
|
646
647
|
{
|
|
647
648
|
variant: h,
|
|
648
649
|
currentPage: v,
|
|
@@ -656,7 +657,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
656
657
|
}
|
|
657
658
|
)
|
|
658
659
|
] });
|
|
659
|
-
}),
|
|
660
|
+
}), lo = /* @__PURE__ */ l.memo(function({
|
|
660
661
|
onLoadMore: s,
|
|
661
662
|
isLoading: i
|
|
662
663
|
}) {
|
|
@@ -680,7 +681,7 @@ const _s = /* @__PURE__ */ l.memo(function({
|
|
|
680
681
|
}
|
|
681
682
|
);
|
|
682
683
|
});
|
|
683
|
-
function
|
|
684
|
+
function io(c) {
|
|
684
685
|
let s = 0;
|
|
685
686
|
const i = (a, f) => {
|
|
686
687
|
a.forEach((x) => {
|
|
@@ -689,7 +690,7 @@ function to(c) {
|
|
|
689
690
|
};
|
|
690
691
|
return i(c), s;
|
|
691
692
|
}
|
|
692
|
-
function
|
|
693
|
+
function Vr(c, s) {
|
|
693
694
|
const { enableGrouping: i, enableExpanding: a, nestedRowStyling: f, expandingRowColors: x, maxDepth: y } = s, h = c.depth, p = c.getIsGrouped?.(), v = c.getIsExpanded(), R = c.subRows && c.subRows.length > 0, D = R ? v ? "expanded" : "collapsed" : "leaf", T = () => {
|
|
694
695
|
let C = c;
|
|
695
696
|
for (; C; ) {
|
|
@@ -726,7 +727,7 @@ function Tr(c, s) {
|
|
|
726
727
|
}
|
|
727
728
|
return p ? v ? "var(--blue-50)" : "var(--color-background-neutral-subtlest)" : i && h === 1 ? "var(--blue-25)" : a && !p ? h === 0 && (!R || !T()) ? "" : (y - h) % 2 === 0 ? "var(--blue-25)" : "var(--blue-50)" : "";
|
|
728
729
|
}
|
|
729
|
-
function
|
|
730
|
+
function co(c, s) {
|
|
730
731
|
if (s) {
|
|
731
732
|
if (s.heights && s.heights[c] !== void 0)
|
|
732
733
|
return s.heights[c];
|
|
@@ -734,7 +735,7 @@ function ro(c, s) {
|
|
|
734
735
|
return s.defaultHeight;
|
|
735
736
|
}
|
|
736
737
|
}
|
|
737
|
-
function
|
|
738
|
+
function Fr(c, s, i, a, f, x) {
|
|
738
739
|
const y = c.groupingColumnId, h = f[y] ?? !1, p = x[y] ?? !1, R = h && p && c.subRows.length <= 1 ? null : c.subRows.length > 1 ? /* @__PURE__ */ t(
|
|
739
740
|
"button",
|
|
740
741
|
{
|
|
@@ -758,7 +759,7 @@ function Mr(c, s, i, a, f, x) {
|
|
|
758
759
|
if (T) {
|
|
759
760
|
const C = T.columnDef;
|
|
760
761
|
if (C.aggregatedCell) {
|
|
761
|
-
const A = c.getAllCells().find((
|
|
762
|
+
const A = c.getAllCells().find((M) => M.column.id === i);
|
|
762
763
|
return /* @__PURE__ */ b("div", { className: "flex items-center gap-[var(--space-s)] font-medium text-[var(--color-text-primary)]", children: [
|
|
763
764
|
R,
|
|
764
765
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-[var(--space-s)]", children: [
|
|
@@ -786,7 +787,7 @@ function Mr(c, s, i, a, f, x) {
|
|
|
786
787
|
] })
|
|
787
788
|
] });
|
|
788
789
|
}
|
|
789
|
-
function
|
|
790
|
+
function $o({
|
|
790
791
|
columns: c,
|
|
791
792
|
data: s,
|
|
792
793
|
searchKey: i,
|
|
@@ -802,122 +803,122 @@ function ko({
|
|
|
802
803
|
showScrollIndicators: T = !1,
|
|
803
804
|
minTableWidth: C = "900px",
|
|
804
805
|
isLoading: A = !1,
|
|
805
|
-
loadingBehavior:
|
|
806
|
+
loadingBehavior: M = "replace",
|
|
806
807
|
loadingRowCount: N = 10,
|
|
807
808
|
borderStyle: Ue = "both",
|
|
808
809
|
defaultVerticalAlign: Ie = "middle",
|
|
809
810
|
enableGlobalSearch: ie = !1,
|
|
810
|
-
globalSearchPlaceholder:
|
|
811
|
+
globalSearchPlaceholder: Ur = "Search all columns...",
|
|
811
812
|
enableAutocomplete: mt = !1,
|
|
812
813
|
globalSearchColumns: Je,
|
|
813
|
-
autocompleteMinCharacters:
|
|
814
|
-
enableGlobalFaceting:
|
|
814
|
+
autocompleteMinCharacters: Jr = 2,
|
|
815
|
+
enableGlobalFaceting: Kr = !1,
|
|
815
816
|
enableColumnResizing: te = !1,
|
|
816
|
-
columnResizeMode:
|
|
817
|
+
columnResizeMode: Xr = "onChange",
|
|
817
818
|
enableColumnResizePersistence: Ke = !1,
|
|
818
819
|
enablePaginationPersistence: ht = !1,
|
|
819
820
|
storageKey: Y = "data-table-columns",
|
|
820
821
|
enableExpanding: _ = !1,
|
|
821
|
-
getSubRows:
|
|
822
|
+
getSubRows: Qr,
|
|
822
823
|
expandingRowColors: O,
|
|
823
824
|
nestedRowStyling: pt,
|
|
824
825
|
enableGrouping: z = !1,
|
|
825
|
-
groupedColumnMode:
|
|
826
|
-
enableManualGrouping:
|
|
826
|
+
groupedColumnMode: Yr = !1,
|
|
827
|
+
enableManualGrouping: Zr = !1,
|
|
827
828
|
groupDisplayColumn: Xe,
|
|
828
829
|
hideChildrenForSingleItemGroups: ye = {},
|
|
829
|
-
hideExpanderForSingleItemGroups:
|
|
830
|
+
hideExpanderForSingleItemGroups: Ft = {},
|
|
830
831
|
enableRowPinning: Ee = !1,
|
|
831
|
-
keepPinnedRows:
|
|
832
|
-
enableVirtualization:
|
|
832
|
+
keepPinnedRows: $t = !0,
|
|
833
|
+
enableVirtualization: en = !1,
|
|
833
834
|
// virtualContainerHeight = 600,
|
|
834
835
|
// virtualRowHeight = 40,
|
|
835
836
|
// virtualOverscan = 10,
|
|
836
837
|
nestedHeaders: Qe = [],
|
|
837
|
-
enableNestedHeaders:
|
|
838
|
+
enableNestedHeaders: tn = !1,
|
|
838
839
|
enableColumnOrdering: Ye = !1,
|
|
839
840
|
enableRowSelection: fe = !1,
|
|
840
|
-
showHeader:
|
|
841
|
+
showHeader: Me = !0,
|
|
841
842
|
showPagination: vt = !0,
|
|
842
|
-
paginationVariant:
|
|
843
|
-
pageSizeOptions:
|
|
844
|
-
footerLabel:
|
|
843
|
+
paginationVariant: rn = "full",
|
|
844
|
+
pageSizeOptions: nn = [10, 25, 50, 100],
|
|
845
|
+
footerLabel: sn,
|
|
845
846
|
onTableReady: bt,
|
|
846
847
|
initialState: Ve,
|
|
847
848
|
// Controlled state props
|
|
848
|
-
sorting:
|
|
849
|
-
onSortingChange:
|
|
850
|
-
columnVisibility:
|
|
851
|
-
onColumnVisibilityChange:
|
|
852
|
-
grouping:
|
|
853
|
-
onGroupingChange:
|
|
854
|
-
columnOrder:
|
|
855
|
-
onColumnOrderChange:
|
|
849
|
+
sorting: jt,
|
|
850
|
+
onSortingChange: on,
|
|
851
|
+
columnVisibility: At,
|
|
852
|
+
onColumnVisibilityChange: an,
|
|
853
|
+
grouping: Lt,
|
|
854
|
+
onGroupingChange: ln,
|
|
855
|
+
columnOrder: Ot,
|
|
856
|
+
onColumnOrderChange: cn,
|
|
856
857
|
columnSizing: xt,
|
|
857
|
-
onColumnSizingChange:
|
|
858
|
-
pagination:
|
|
859
|
-
onPaginationChange:
|
|
858
|
+
onColumnSizingChange: dn,
|
|
859
|
+
pagination: Ht,
|
|
860
|
+
onPaginationChange: un,
|
|
860
861
|
expanded: Ce,
|
|
861
862
|
onExpandedChange: yt,
|
|
862
|
-
renderSectionHeaderRow:
|
|
863
|
+
renderSectionHeaderRow: Wt,
|
|
863
864
|
renderSubComponent: J,
|
|
864
|
-
getRowCanExpand:
|
|
865
|
-
autoExpandChildren:
|
|
865
|
+
getRowCanExpand: fn,
|
|
866
|
+
autoExpandChildren: Gt = !1,
|
|
866
867
|
// Row click props
|
|
867
868
|
onRowClick: K,
|
|
868
869
|
isRowClickable: we,
|
|
869
|
-
clickableRowClassName:
|
|
870
|
+
clickableRowClassName: _t,
|
|
870
871
|
groupPreservingSearch: Ze = !1,
|
|
871
872
|
// Active row props
|
|
872
873
|
activeRowId: Fe,
|
|
873
|
-
activeRowClassName:
|
|
874
|
+
activeRowClassName: qt,
|
|
874
875
|
getRowId: Ct,
|
|
875
|
-
onActiveRowChange:
|
|
876
|
+
onActiveRowChange: Ut,
|
|
876
877
|
// Callback props
|
|
877
878
|
onRowSelectionChange: wt,
|
|
878
|
-
onNextPageHover:
|
|
879
|
-
onPreviousPageHover:
|
|
880
|
-
onRowUpdate:
|
|
879
|
+
onNextPageHover: gn,
|
|
880
|
+
onPreviousPageHover: mn,
|
|
881
|
+
onRowUpdate: uo,
|
|
881
882
|
// Infinite scroll props
|
|
882
|
-
onLoadMore:
|
|
883
|
-
hasMoreData:
|
|
884
|
-
isLoadingMore:
|
|
883
|
+
onLoadMore: Jt,
|
|
884
|
+
hasMoreData: hn,
|
|
885
|
+
isLoadingMore: pn,
|
|
885
886
|
// Error handling props
|
|
886
|
-
error:
|
|
887
|
-
onRetry:
|
|
888
|
-
errorComponent:
|
|
887
|
+
error: Kt,
|
|
888
|
+
onRetry: vn,
|
|
889
|
+
errorComponent: bn,
|
|
889
890
|
// Empty state props
|
|
890
|
-
emptyState:
|
|
891
|
-
emptyStateTitle:
|
|
892
|
-
emptyStateDescription:
|
|
893
|
-
emptyStateAction:
|
|
891
|
+
emptyState: xn,
|
|
892
|
+
emptyStateTitle: yn = "No data",
|
|
893
|
+
emptyStateDescription: Cn = "No items to display",
|
|
894
|
+
emptyStateAction: wn,
|
|
894
895
|
// No results state props
|
|
895
|
-
noResultsState:
|
|
896
|
-
noResultsTitle:
|
|
897
|
-
noResultsDescription:
|
|
898
|
-
noResultsAction:
|
|
896
|
+
noResultsState: Sn,
|
|
897
|
+
noResultsTitle: Nn = "No results found",
|
|
898
|
+
noResultsDescription: Rn = "Try adjusting your search or filters",
|
|
899
|
+
noResultsAction: In,
|
|
899
900
|
// Refetching props
|
|
900
|
-
isRefetching:
|
|
901
|
+
isRefetching: En = !1,
|
|
901
902
|
// Server-side mode props
|
|
902
|
-
manualSorting:
|
|
903
|
-
manualFiltering:
|
|
903
|
+
manualSorting: Xt = !1,
|
|
904
|
+
manualFiltering: Qt = !1,
|
|
904
905
|
manualPagination: et = !1,
|
|
905
|
-
rowCount:
|
|
906
|
+
rowCount: Dn,
|
|
906
907
|
// Server-side expansion props
|
|
907
|
-
manualExpanding:
|
|
908
|
+
manualExpanding: Yt = !1,
|
|
908
909
|
onLoadChildren: tt,
|
|
909
910
|
expandingRowsLoading: rt,
|
|
910
911
|
subComponentLoading: nt,
|
|
911
912
|
onSubComponentLoad: De,
|
|
912
913
|
// Server-side error handling props
|
|
913
|
-
expandingRowsError:
|
|
914
|
-
subComponentError:
|
|
914
|
+
expandingRowsError: fo,
|
|
915
|
+
subComponentError: Zt,
|
|
915
916
|
onExpandError: $e
|
|
916
917
|
}) {
|
|
917
|
-
const st = D || !!(v && v > 0) || !!(R && R > 0), [
|
|
918
|
+
const st = D || !!(v && v > 0) || !!(R && R > 0), [kn, zn] = l.useState([]), [Bn, Tn] = l.useState({}), [Pn, Mn] = l.useState(Ve?.grouping || []), [Vn, Fn] = l.useState(() => {
|
|
918
919
|
const e = c.map((r) => r.id || r.accessorKey || `column-${Math.random()}`);
|
|
919
920
|
return fe ? ["select", ...e] : e;
|
|
920
|
-
}), [
|
|
921
|
+
}), [$n, jn] = l.useState(xt || Ve?.columnSizing || {}), [An, Ln] = l.useState(() => {
|
|
921
922
|
if (ht && Y) {
|
|
922
923
|
const e = localStorage.getItem(`${Y}-pagination`);
|
|
923
924
|
if (e)
|
|
@@ -930,15 +931,15 @@ function ko({
|
|
|
930
931
|
}
|
|
931
932
|
}
|
|
932
933
|
return Ve?.pagination || { pageIndex: 0, pageSize: 10 };
|
|
933
|
-
}), [
|
|
934
|
+
}), [er, On] = l.useState([]), [ke, Hn] = l.useState({}), [St, tr] = l.useState(""), [Wn, rr] = l.useState(Ve?.expanded || {}), [Gn, _n] = l.useState(Ve?.rowPinning || { top: [], bottom: [] }), [qn, ot] = l.useState(""), [X, Nt] = l.useState([-1, 0]), Rt = l.useRef(null), je = l.useRef(/* @__PURE__ */ new Map()), Ae = l.useRef(/* @__PURE__ */ new Map());
|
|
934
935
|
l.useEffect(() => () => {
|
|
935
936
|
je.current.forEach((e) => e.abort()), Ae.current.forEach((e) => e.abort());
|
|
936
937
|
}, []), l.useEffect(() => {
|
|
937
938
|
wt && wt(ke);
|
|
938
939
|
}, [ke, wt]), l.useEffect(() => {
|
|
939
|
-
|
|
940
|
-
}, [Fe,
|
|
941
|
-
const
|
|
940
|
+
Ut?.(Fe);
|
|
941
|
+
}, [Fe, Ut]);
|
|
942
|
+
const nr = jt !== void 0, sr = At !== void 0, or = Lt !== void 0, ar = Ot !== void 0, lr = xt !== void 0, ir = Ht !== void 0, It = Ce !== void 0, ge = nr ? jt : kn, Un = sr ? At : Bn, me = or ? Lt : Pn, Le = ar ? Ot : Vn, at = lr ? xt : $n, re = ir ? Ht : An, Q = It ? Ce : Wn, Jn = nr ? on : zn, Kn = sr ? an : Tn, Xn = or ? ln : Mn, cr = ar ? cn : Fn, dr = lr ? dn : jn, Qn = ir ? un : Ln, Et = l.useCallback(
|
|
942
943
|
(e) => {
|
|
943
944
|
const r = typeof e == "object" && e !== null && !(e instanceof Function) && Object.keys(e).length === 0;
|
|
944
945
|
if (It && yt) {
|
|
@@ -946,10 +947,10 @@ function ko({
|
|
|
946
947
|
return;
|
|
947
948
|
yt(e);
|
|
948
949
|
} else
|
|
949
|
-
|
|
950
|
+
rr(r ? (n) => n === !0 || typeof n == "object" && n !== null && Object.keys(n).length > 0 ? n : e : e);
|
|
950
951
|
},
|
|
951
952
|
[It, yt, Ce]
|
|
952
|
-
),
|
|
953
|
+
), Yn = l.useMemo(() => N !== void 0 && N !== 10 ? N : re.pageSize, [N, re.pageSize]), L = qs(St, 300), Zn = l.useMemo(() => {
|
|
953
954
|
if (!mt || !ie)
|
|
954
955
|
return [];
|
|
955
956
|
const e = /* @__PURE__ */ new Set();
|
|
@@ -961,7 +962,7 @@ function ko({
|
|
|
961
962
|
n != null && String(n).trim() !== "" && e.add(String(n));
|
|
962
963
|
});
|
|
963
964
|
}), Array.from(e).sort();
|
|
964
|
-
}, [s, Je, mt, ie]),
|
|
965
|
+
}, [s, Je, mt, ie]), ur = l.useCallback((e, r, n) => {
|
|
965
966
|
if (!e || !r || r.length === 0)
|
|
966
967
|
return () => !0;
|
|
967
968
|
const u = e.toLowerCase(), g = /* @__PURE__ */ new Set();
|
|
@@ -992,7 +993,7 @@ function ko({
|
|
|
992
993
|
const e = localStorage.getItem(`${Y}-sizing`);
|
|
993
994
|
if (e)
|
|
994
995
|
try {
|
|
995
|
-
|
|
996
|
+
dr(JSON.parse(e));
|
|
996
997
|
} catch (r) {
|
|
997
998
|
console.warn("Failed to parse saved column sizing:", r);
|
|
998
999
|
}
|
|
@@ -1031,11 +1032,11 @@ function ko({
|
|
|
1031
1032
|
if (!e.getIsGrouped()) return !0;
|
|
1032
1033
|
const n = e.groupingColumnId;
|
|
1033
1034
|
return (ye[n] ?? !1) && e.subRows && e.subRows.length === 1;
|
|
1034
|
-
}, [K, we, ye]),
|
|
1035
|
+
}, [K, we, ye]), fr = (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 = l.useCallback((e) => {
|
|
1035
1036
|
if (!Fe) return !1;
|
|
1036
1037
|
const r = Ct ? e.id : e.original?.id !== void 0 ? e.original.id : e.id;
|
|
1037
1038
|
return String(r) === String(Fe);
|
|
1038
|
-
}, [Fe, Ct]), Oe = l.useMemo(() => p ? 1 : v || 0, [p, v]), Ne = l.useMemo(() => R || 0, [R]),
|
|
1039
|
+
}, [Fe, Ct]), Oe = l.useMemo(() => p ? 1 : v || 0, [p, v]), Ne = l.useMemo(() => R || 0, [R]), gr = l.useMemo(() => {
|
|
1039
1040
|
const e = /* @__PURE__ */ new Set();
|
|
1040
1041
|
return c.forEach((r) => {
|
|
1041
1042
|
if (r.cell) {
|
|
@@ -1090,77 +1091,77 @@ function ko({
|
|
|
1090
1091
|
label: "Select"
|
|
1091
1092
|
}
|
|
1092
1093
|
}, ...e] : e;
|
|
1093
|
-
}, [c, fe]), zt = l.useMemo(() => s, [s]),
|
|
1094
|
+
}, [c, fe]), zt = l.useMemo(() => s, [s]), es = l.useMemo(() => !Ze || !L ? Dr : ur(L, me, zt), [Ze, L, me, zt, ur]), w = is({
|
|
1094
1095
|
data: zt,
|
|
1095
1096
|
columns: kt,
|
|
1096
1097
|
getRowId: Ct,
|
|
1097
1098
|
filterFns: {
|
|
1098
|
-
fuzzy:
|
|
1099
|
-
multiSelect:
|
|
1099
|
+
fuzzy: Dr,
|
|
1100
|
+
multiSelect: Us
|
|
1100
1101
|
},
|
|
1101
1102
|
state: {
|
|
1102
1103
|
sorting: ge,
|
|
1103
|
-
columnFilters:
|
|
1104
|
-
columnVisibility:
|
|
1104
|
+
columnFilters: er,
|
|
1105
|
+
columnVisibility: Un,
|
|
1105
1106
|
rowSelection: ke,
|
|
1106
1107
|
globalFilter: L,
|
|
1107
1108
|
columnSizing: at,
|
|
1108
1109
|
expanded: Q,
|
|
1109
1110
|
grouping: me,
|
|
1110
|
-
rowPinning:
|
|
1111
|
+
rowPinning: Gn,
|
|
1111
1112
|
columnOrder: Le,
|
|
1112
1113
|
pagination: re
|
|
1113
1114
|
},
|
|
1114
1115
|
// Server-side mode configuration
|
|
1115
|
-
manualSorting:
|
|
1116
|
-
manualFiltering:
|
|
1116
|
+
manualSorting: Xt,
|
|
1117
|
+
manualFiltering: Qt,
|
|
1117
1118
|
manualPagination: et,
|
|
1118
|
-
rowCount:
|
|
1119
|
+
rowCount: Dn,
|
|
1119
1120
|
// Required for server-side pagination
|
|
1120
1121
|
enableRowSelection: fe,
|
|
1121
1122
|
enableColumnPinning: !1,
|
|
1122
1123
|
// Disable TanStack Table pinning - using CSS approach
|
|
1123
1124
|
enableGlobalFilter: ie,
|
|
1124
1125
|
// Enable global filtering
|
|
1125
|
-
globalFilterFn:
|
|
1126
|
+
globalFilterFn: es,
|
|
1126
1127
|
// Use group-preserving filter when enabled
|
|
1127
1128
|
enableColumnResizing: te,
|
|
1128
|
-
columnResizeMode:
|
|
1129
|
+
columnResizeMode: Xr,
|
|
1129
1130
|
enableExpanding: _,
|
|
1130
|
-
getSubRows:
|
|
1131
|
-
getRowCanExpand:
|
|
1131
|
+
getSubRows: Qr,
|
|
1132
|
+
getRowCanExpand: fn,
|
|
1132
1133
|
paginateExpandedRows: !1,
|
|
1133
1134
|
// Only paginate top-level rows, not expanded children
|
|
1134
1135
|
autoResetPageIndex: !1,
|
|
1135
1136
|
// Prevent pagination from resetting on data/filter/grouping changes
|
|
1136
1137
|
enableGrouping: z,
|
|
1137
|
-
groupedColumnMode:
|
|
1138
|
-
manualGrouping:
|
|
1138
|
+
groupedColumnMode: Yr,
|
|
1139
|
+
manualGrouping: Zr,
|
|
1139
1140
|
enableRowPinning: Ee,
|
|
1140
|
-
keepPinnedRows:
|
|
1141
|
-
onRowSelectionChange:
|
|
1142
|
-
onSortingChange:
|
|
1143
|
-
onColumnFiltersChange:
|
|
1144
|
-
onColumnVisibilityChange:
|
|
1145
|
-
onGlobalFilterChange:
|
|
1146
|
-
onColumnSizingChange:
|
|
1141
|
+
keepPinnedRows: $t,
|
|
1142
|
+
onRowSelectionChange: Hn,
|
|
1143
|
+
onSortingChange: Jn,
|
|
1144
|
+
onColumnFiltersChange: On,
|
|
1145
|
+
onColumnVisibilityChange: Kn,
|
|
1146
|
+
onGlobalFilterChange: tr,
|
|
1147
|
+
onColumnSizingChange: dr,
|
|
1147
1148
|
onExpandedChange: Et,
|
|
1148
|
-
onGroupingChange:
|
|
1149
|
-
onRowPinningChange:
|
|
1150
|
-
onColumnOrderChange:
|
|
1151
|
-
onPaginationChange:
|
|
1152
|
-
getCoreRowModel:
|
|
1149
|
+
onGroupingChange: Xn,
|
|
1150
|
+
onRowPinningChange: _n,
|
|
1151
|
+
onColumnOrderChange: cr,
|
|
1152
|
+
onPaginationChange: Qn,
|
|
1153
|
+
getCoreRowModel: vs(),
|
|
1153
1154
|
// Conditionally include row models based on manual mode
|
|
1154
|
-
getFilteredRowModel:
|
|
1155
|
-
getPaginationRowModel: et ||
|
|
1156
|
-
getSortedRowModel:
|
|
1157
|
-
getExpandedRowModel: _ ?
|
|
1158
|
-
getGroupedRowModel: z ?
|
|
1159
|
-
getFacetedRowModel:
|
|
1160
|
-
getFacetedUniqueValues:
|
|
1161
|
-
getFacetedMinMaxValues:
|
|
1155
|
+
getFilteredRowModel: Qt ? void 0 : ps(),
|
|
1156
|
+
getPaginationRowModel: et || en ? void 0 : hs(),
|
|
1157
|
+
getSortedRowModel: Xt ? void 0 : ms(),
|
|
1158
|
+
getExpandedRowModel: _ ? gs() : void 0,
|
|
1159
|
+
getGroupedRowModel: z ? fs() : void 0,
|
|
1160
|
+
getFacetedRowModel: us(),
|
|
1161
|
+
getFacetedUniqueValues: ds(),
|
|
1162
|
+
getFacetedMinMaxValues: cs()
|
|
1162
1163
|
}), lt = l.useMemo(
|
|
1163
|
-
() =>
|
|
1164
|
+
() => io(w.getRowModel().rows),
|
|
1164
1165
|
[w.getRowModel().rows]
|
|
1165
1166
|
), it = l.useMemo(() => {
|
|
1166
1167
|
if (!z) return null;
|
|
@@ -1168,17 +1169,17 @@ function ko({
|
|
|
1168
1169
|
return w.getGroupedRowModel?.()?.rows?.forEach((n) => {
|
|
1169
1170
|
n.subRows && n.subRows.length > 0 && e.set(n.id, n.subRows);
|
|
1170
1171
|
}), e;
|
|
1171
|
-
}, [z, w]), { flatVisibleRows: ct, rowIdToFlatIndex:
|
|
1172
|
+
}, [z, w]), { flatVisibleRows: ct, rowIdToFlatIndex: mr } = l.useMemo(() => {
|
|
1172
1173
|
const e = [], r = /* @__PURE__ */ new Map(), n = (g) => {
|
|
1173
1174
|
const m = e.length;
|
|
1174
1175
|
e.push(g), r.set(g.id, m), g.getIsExpanded() && (g.subRows && g.subRows.length > 0 ? g.subRows : it?.get(g.id) || []).forEach(n);
|
|
1175
1176
|
};
|
|
1176
1177
|
return w.getRowModel().rows.filter((g) => J || g.depth === 0).forEach(n), { flatVisibleRows: e, rowIdToFlatIndex: r };
|
|
1177
|
-
}, [w, Q, it, J]),
|
|
1178
|
+
}, [w, Q, it, J]), hr = l.useRef(void 0);
|
|
1178
1179
|
l.useEffect(() => {
|
|
1179
1180
|
if (!z) return;
|
|
1180
1181
|
const r = w.getPrePaginationRowModel().rows.filter((g) => g.depth === 0).length, n = re.pageSize, u = Math.max(1, Math.ceil(r / n));
|
|
1181
|
-
|
|
1182
|
+
hr.current !== u && (hr.current = u, w.setPageCount(u));
|
|
1182
1183
|
}, [
|
|
1183
1184
|
z,
|
|
1184
1185
|
// NOTE: Deliberately NOT including 'table' to avoid re-running on every render
|
|
@@ -1189,26 +1190,26 @@ function ko({
|
|
|
1189
1190
|
w.getPrePaginationRowModel().rows.length
|
|
1190
1191
|
// Row count changes
|
|
1191
1192
|
]);
|
|
1192
|
-
const
|
|
1193
|
+
const pr = l.useRef({});
|
|
1193
1194
|
l.useEffect(() => {
|
|
1194
|
-
if (!
|
|
1195
|
-
const e = w.getState().expanded, r =
|
|
1195
|
+
if (!Gt) return;
|
|
1196
|
+
const e = w.getState().expanded, r = pr.current, n = { ...e };
|
|
1196
1197
|
let u = !1;
|
|
1197
1198
|
w.getRowModel().rows.forEach((g) => {
|
|
1198
1199
|
const m = g.id, S = e[m] === !0, B = r[m] === !0;
|
|
1199
1200
|
S && !B && g.subRows && g.subRows.length > 0 && g.subRows.forEach((F) => {
|
|
1200
1201
|
e[F.id] !== !0 && (n[F.id] = !0, u = !0);
|
|
1201
1202
|
});
|
|
1202
|
-
}),
|
|
1203
|
+
}), pr.current = e, u && Et(n);
|
|
1203
1204
|
}, [
|
|
1204
1205
|
Q,
|
|
1205
|
-
|
|
1206
|
+
Gt
|
|
1206
1207
|
// NOTE: Deliberately NOT including 'table' to avoid re-running on every render
|
|
1207
1208
|
]);
|
|
1208
|
-
const
|
|
1209
|
+
const vr = l.useRef({});
|
|
1209
1210
|
l.useEffect(() => {
|
|
1210
1211
|
if (!tt && !De) return;
|
|
1211
|
-
const e = w.getState().expanded, r =
|
|
1212
|
+
const e = w.getState().expanded, r = vr.current;
|
|
1212
1213
|
Object.keys(r).forEach((n) => {
|
|
1213
1214
|
const u = r[n], g = e[n];
|
|
1214
1215
|
if (u && !g) {
|
|
@@ -1222,12 +1223,12 @@ function ko({
|
|
|
1222
1223
|
if (u && !g) {
|
|
1223
1224
|
const m = w.getRow(n);
|
|
1224
1225
|
if (!m) return;
|
|
1225
|
-
if (tt &&
|
|
1226
|
+
if (tt && Yt) {
|
|
1226
1227
|
const S = m.getIsGrouped() || m.subRows && m.subRows.length === 0 && m.getCanExpand(), B = rt?.[n] === !0, F = m.subRows && m.subRows.length > 0;
|
|
1227
1228
|
if (S && !B && !F) {
|
|
1228
1229
|
const o = new AbortController();
|
|
1229
|
-
je.current.set(n, o), Promise.resolve(tt(m)).catch((
|
|
1230
|
-
|
|
1230
|
+
je.current.set(n, o), Promise.resolve(tt(m)).catch((P) => {
|
|
1231
|
+
P?.name !== "AbortError" && $e && $e(m, P, "children");
|
|
1231
1232
|
}).finally(() => {
|
|
1232
1233
|
je.current.delete(n);
|
|
1233
1234
|
});
|
|
@@ -1242,12 +1243,12 @@ function ko({
|
|
|
1242
1243
|
});
|
|
1243
1244
|
}
|
|
1244
1245
|
}
|
|
1245
|
-
}),
|
|
1246
|
+
}), vr.current = e;
|
|
1246
1247
|
}, [
|
|
1247
1248
|
Q,
|
|
1248
1249
|
tt,
|
|
1249
1250
|
De,
|
|
1250
|
-
|
|
1251
|
+
Yt,
|
|
1251
1252
|
J,
|
|
1252
1253
|
rt,
|
|
1253
1254
|
nt,
|
|
@@ -1264,11 +1265,11 @@ function ko({
|
|
|
1264
1265
|
return u === g ? n : e;
|
|
1265
1266
|
});
|
|
1266
1267
|
}, [L, Ze, z]);
|
|
1267
|
-
const
|
|
1268
|
+
const br = l.useRef(me), xr = l.useRef(ge);
|
|
1268
1269
|
l.useEffect(() => {
|
|
1269
1270
|
if (!et) return;
|
|
1270
|
-
const e = JSON.stringify(me) !== JSON.stringify(
|
|
1271
|
-
(e || r) && w.setPageIndex(0),
|
|
1271
|
+
const e = JSON.stringify(me) !== JSON.stringify(br.current), r = JSON.stringify(ge) !== JSON.stringify(xr.current);
|
|
1272
|
+
(e || r) && w.setPageIndex(0), br.current = me, xr.current = ge;
|
|
1272
1273
|
}, [me, ge, et, w]), l.useEffect(() => {
|
|
1273
1274
|
bt && bt(w);
|
|
1274
1275
|
}, [w, bt]), l.useEffect(() => {
|
|
@@ -1372,7 +1373,7 @@ function ko({
|
|
|
1372
1373
|
}, [He]), Be = l.useCallback((e) => {
|
|
1373
1374
|
if (!ie || !L)
|
|
1374
1375
|
return be(e.column.columnDef.cell, e.getContext());
|
|
1375
|
-
if (
|
|
1376
|
+
if (gr.has(e.column.id)) {
|
|
1376
1377
|
const u = be(e.column.columnDef.cell, e.getContext());
|
|
1377
1378
|
return u == null || !dt(u, L) ? u : ce(u, L);
|
|
1378
1379
|
}
|
|
@@ -1382,32 +1383,32 @@ function ko({
|
|
|
1382
1383
|
return He(u, L);
|
|
1383
1384
|
}
|
|
1384
1385
|
return be(e.column.columnDef.cell, e.getContext());
|
|
1385
|
-
}, [ie, L, He,
|
|
1386
|
+
}, [ie, L, He, gr, dt, ce]), yr = l.useCallback((e) => {
|
|
1386
1387
|
if (!ie || !L)
|
|
1387
1388
|
return be(e.column.columnDef.aggregatedCell, e.getContext());
|
|
1388
1389
|
const r = be(e.column.columnDef.aggregatedCell, e.getContext());
|
|
1389
1390
|
return r == null || !dt(r, L) ? r : ce(r, L);
|
|
1390
|
-
}, [ie, L, dt, ce, he]),
|
|
1391
|
-
|
|
1391
|
+
}, [ie, L, dt, ce, he]), ts = l.useRef(null), rs = bs(
|
|
1392
|
+
Sr(xs, {
|
|
1392
1393
|
activationConstraint: {
|
|
1393
1394
|
distance: 8
|
|
1394
1395
|
}
|
|
1395
1396
|
}),
|
|
1396
|
-
|
|
1397
|
+
Sr(ys, {
|
|
1397
1398
|
activationConstraint: {
|
|
1398
1399
|
delay: 200,
|
|
1399
1400
|
tolerance: 8
|
|
1400
1401
|
}
|
|
1401
1402
|
})
|
|
1402
|
-
), [,
|
|
1403
|
-
Ye &&
|
|
1404
|
-
},
|
|
1403
|
+
), [, Cr] = l.useState(null), ns = (e) => {
|
|
1404
|
+
Ye && Cr(e.active.id);
|
|
1405
|
+
}, ss = (e) => {
|
|
1405
1406
|
if (!Ye) return;
|
|
1406
1407
|
const { active: r, over: n } = e;
|
|
1407
|
-
if (
|
|
1408
|
+
if (Cr(null), r.id !== n?.id && n?.id) {
|
|
1408
1409
|
const u = Le.findIndex((m) => m === r.id), g = Le.findIndex((m) => m === n?.id);
|
|
1409
1410
|
if (u !== -1 && g !== -1) {
|
|
1410
|
-
const m =
|
|
1411
|
+
const m = Rs(Le, u, g);
|
|
1411
1412
|
console.log("Column reorder:", {
|
|
1412
1413
|
activeId: r.id,
|
|
1413
1414
|
overId: n.id,
|
|
@@ -1415,18 +1416,18 @@ function ko({
|
|
|
1415
1416
|
newIndex: g,
|
|
1416
1417
|
oldOrder: Le,
|
|
1417
1418
|
newOrder: m
|
|
1418
|
-
}),
|
|
1419
|
+
}), cr(m);
|
|
1419
1420
|
}
|
|
1420
1421
|
}
|
|
1421
|
-
},
|
|
1422
|
+
}, os = l.useCallback((e) => {
|
|
1422
1423
|
const [r, n] = X, u = w.getVisibleLeafColumns(), g = ct, m = u.length, S = g.length, B = -1, F = S - 1;
|
|
1423
|
-
let o = r,
|
|
1424
|
+
let o = r, P = n, $ = !1;
|
|
1424
1425
|
switch (e.key) {
|
|
1425
1426
|
case "ArrowRight":
|
|
1426
|
-
n < m - 1 && (
|
|
1427
|
+
n < m - 1 && (P = n + 1, $ = !0);
|
|
1427
1428
|
break;
|
|
1428
1429
|
case "ArrowLeft":
|
|
1429
|
-
n > 0 && (
|
|
1430
|
+
n > 0 && (P = n - 1, $ = !0);
|
|
1430
1431
|
break;
|
|
1431
1432
|
case "ArrowDown":
|
|
1432
1433
|
r < F && (o = r + 1, $ = !0);
|
|
@@ -1435,10 +1436,10 @@ function ko({
|
|
|
1435
1436
|
r > B && (o = r - 1, $ = !0);
|
|
1436
1437
|
break;
|
|
1437
1438
|
case "Home":
|
|
1438
|
-
(e.ctrlKey || e.metaKey) && (o = B),
|
|
1439
|
+
(e.ctrlKey || e.metaKey) && (o = B), P = 0, $ = !0;
|
|
1439
1440
|
break;
|
|
1440
1441
|
case "End":
|
|
1441
|
-
(e.ctrlKey || e.metaKey) && (o = F),
|
|
1442
|
+
(e.ctrlKey || e.metaKey) && (o = F), P = m - 1, $ = !0;
|
|
1442
1443
|
break;
|
|
1443
1444
|
case "PageDown":
|
|
1444
1445
|
o = Math.min(r + 10, F), $ = !0;
|
|
@@ -1460,12 +1461,12 @@ function ko({
|
|
|
1460
1461
|
document.activeElement instanceof HTMLElement && document.activeElement.blur(), $ = !0;
|
|
1461
1462
|
break;
|
|
1462
1463
|
}
|
|
1463
|
-
if ($ && (e.preventDefault(), e.stopPropagation(), o !== r ||
|
|
1464
|
-
Nt([o,
|
|
1465
|
-
const d = o === -1 ? `[data-header-col="${
|
|
1464
|
+
if ($ && (e.preventDefault(), e.stopPropagation(), o !== r || P !== n)) {
|
|
1465
|
+
Nt([o, P]);
|
|
1466
|
+
const d = o === -1 ? `[data-header-col="${P}"]` : `[data-row="${o}"][data-col="${P}"]`, k = Rt.current?.querySelector(d);
|
|
1466
1467
|
k && k.focus();
|
|
1467
1468
|
}
|
|
1468
|
-
}, [X, w, ct, _, z, fe]),
|
|
1469
|
+
}, [X, w, ct, _, z, fe]), as = l.useCallback((e) => {
|
|
1469
1470
|
Rt.current?.contains(e.relatedTarget) || Nt([-1, 0]);
|
|
1470
1471
|
}, []), We = l.useMemo(() => {
|
|
1471
1472
|
const e = w.getVisibleFlatColumns(), r = /* @__PURE__ */ new Map();
|
|
@@ -1497,7 +1498,7 @@ function ko({
|
|
|
1497
1498
|
return {};
|
|
1498
1499
|
const { isLeftSticky: g, isRightSticky: m, leftPosition: S, rightPosition: B, isRightmostLeftSticky: F, isLeftmostRightSticky: o } = u;
|
|
1499
1500
|
if (g) {
|
|
1500
|
-
const
|
|
1501
|
+
const P = {
|
|
1501
1502
|
position: "sticky",
|
|
1502
1503
|
left: `${S}px`,
|
|
1503
1504
|
...r && { backgroundColor: "var(--grey-25)" },
|
|
@@ -1506,13 +1507,13 @@ function ko({
|
|
|
1506
1507
|
maxWidth: `${e.getSize()}px`
|
|
1507
1508
|
};
|
|
1508
1509
|
return F && r ? {
|
|
1509
|
-
...
|
|
1510
|
+
...P,
|
|
1510
1511
|
backgroundImage: "linear-gradient(to right, var(--grey-25) calc(100% - 3px), var(--color-border-primary-medium) calc(100% - 3px), var(--color-border-primary-medium) 100%)",
|
|
1511
1512
|
backgroundColor: "transparent"
|
|
1512
|
-
} :
|
|
1513
|
+
} : P;
|
|
1513
1514
|
}
|
|
1514
1515
|
if (m) {
|
|
1515
|
-
const
|
|
1516
|
+
const P = {
|
|
1516
1517
|
position: "sticky",
|
|
1517
1518
|
right: `${B}px`,
|
|
1518
1519
|
...r && { backgroundColor: "var(--grey-25)" },
|
|
@@ -1521,13 +1522,13 @@ function ko({
|
|
|
1521
1522
|
maxWidth: `${e.getSize()}px`
|
|
1522
1523
|
};
|
|
1523
1524
|
return o && r ? {
|
|
1524
|
-
...
|
|
1525
|
+
...P,
|
|
1525
1526
|
backgroundImage: "linear-gradient(to right, var(--color-border-primary-medium) 0, var(--color-border-primary-medium) 3px, var(--grey-25) 3px)",
|
|
1526
1527
|
backgroundColor: "transparent"
|
|
1527
|
-
} :
|
|
1528
|
+
} : P;
|
|
1528
1529
|
}
|
|
1529
1530
|
return {};
|
|
1530
|
-
},
|
|
1531
|
+
}, ls = (e) => {
|
|
1531
1532
|
if (!e || typeof e.getSize != "function")
|
|
1532
1533
|
return "";
|
|
1533
1534
|
const r = We.data.get(e.id);
|
|
@@ -1542,7 +1543,7 @@ function ko({
|
|
|
1542
1543
|
return !1;
|
|
1543
1544
|
const r = We.data.get(e.id);
|
|
1544
1545
|
return r ? r.columnIndex === We.allColumns.length - Ne - 1 : !1;
|
|
1545
|
-
},
|
|
1546
|
+
}, wr = (e, r = !1) => !te || !e.getCanResize() || !!E.showCellBorder ? "" : V(
|
|
1546
1547
|
// Right side indicator - hidden for last column
|
|
1547
1548
|
!r && [
|
|
1548
1549
|
"after:content-[''] after:absolute after:right-px after:top-1/2 after:-translate-y-1/2",
|
|
@@ -1558,40 +1559,40 @@ function ko({
|
|
|
1558
1559
|
"before:opacity-0 hover:before:opacity-100",
|
|
1559
1560
|
"before:transition-opacity before:pointer-events-none before:z-10"
|
|
1560
1561
|
);
|
|
1561
|
-
return /* @__PURE__ */ t(
|
|
1562
|
-
|
|
1562
|
+
return /* @__PURE__ */ t(Hs, { children: /* @__PURE__ */ t(
|
|
1563
|
+
Cs,
|
|
1563
1564
|
{
|
|
1564
|
-
sensors:
|
|
1565
|
-
collisionDetection:
|
|
1566
|
-
onDragStart:
|
|
1567
|
-
onDragEnd:
|
|
1565
|
+
sensors: rs,
|
|
1566
|
+
collisionDetection: ws,
|
|
1567
|
+
onDragStart: ns,
|
|
1568
|
+
onDragEnd: ss,
|
|
1568
1569
|
children: /* @__PURE__ */ b("div", { className: V(
|
|
1569
1570
|
"border border-[var(--color-border-primary-medium)] bg-[var(--color-surface-primary)] overflow-hidden rounded-l",
|
|
1570
1571
|
// Remove bottom border when no pagination to avoid double border with last row
|
|
1571
1572
|
!vt && "border-b-0",
|
|
1572
1573
|
y
|
|
1573
1574
|
), children: [
|
|
1574
|
-
|
|
1575
|
+
Me && (f || ie) && /* @__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: [
|
|
1575
1576
|
f && /* @__PURE__ */ b("div", { className: "flex justify-between items-center", children: [
|
|
1576
1577
|
/* @__PURE__ */ t("h3", { className: "text-heading-sm font-semibold text-[var(--color-text-primary)]", children: f }),
|
|
1577
|
-
/* @__PURE__ */ t(
|
|
1578
|
+
/* @__PURE__ */ t(qr, { table: w, enableGrouping: z })
|
|
1578
1579
|
] }),
|
|
1579
1580
|
/* @__PURE__ */ t(
|
|
1580
|
-
|
|
1581
|
+
ro,
|
|
1581
1582
|
{
|
|
1582
1583
|
table: w,
|
|
1583
1584
|
searchKey: i,
|
|
1584
1585
|
searchPlaceholder: a,
|
|
1585
1586
|
showSettingsMenu: !1,
|
|
1586
1587
|
enableGlobalSearch: ie,
|
|
1587
|
-
globalSearchPlaceholder:
|
|
1588
|
+
globalSearchPlaceholder: Ur,
|
|
1588
1589
|
globalFilter: St,
|
|
1589
|
-
onGlobalFilterChange:
|
|
1590
|
-
enableGlobalFaceting:
|
|
1590
|
+
onGlobalFilterChange: tr,
|
|
1591
|
+
enableGlobalFaceting: Kr,
|
|
1591
1592
|
enableGrouping: z,
|
|
1592
1593
|
enableAutocomplete: mt,
|
|
1593
|
-
autocompleteSuggestions:
|
|
1594
|
-
autocompleteMinCharacters:
|
|
1594
|
+
autocompleteSuggestions: Zn,
|
|
1595
|
+
autocompleteMinCharacters: Jr
|
|
1595
1596
|
}
|
|
1596
1597
|
)
|
|
1597
1598
|
] }),
|
|
@@ -1599,8 +1600,8 @@ function ko({
|
|
|
1599
1600
|
"div",
|
|
1600
1601
|
{
|
|
1601
1602
|
ref: Rt,
|
|
1602
|
-
onKeyDown:
|
|
1603
|
-
onFocus:
|
|
1603
|
+
onKeyDown: os,
|
|
1604
|
+
onFocus: as,
|
|
1604
1605
|
className: V(
|
|
1605
1606
|
"relative",
|
|
1606
1607
|
st && [
|
|
@@ -1623,13 +1624,13 @@ function ko({
|
|
|
1623
1624
|
"aria-live": "polite",
|
|
1624
1625
|
"aria-atomic": "true",
|
|
1625
1626
|
className: "sr-only",
|
|
1626
|
-
children:
|
|
1627
|
+
children: qn
|
|
1627
1628
|
}
|
|
1628
1629
|
),
|
|
1629
1630
|
/* @__PURE__ */ b(
|
|
1630
|
-
|
|
1631
|
+
ks,
|
|
1631
1632
|
{
|
|
1632
|
-
ref:
|
|
1633
|
+
ref: ts,
|
|
1633
1634
|
role: "grid",
|
|
1634
1635
|
"aria-label": x || f,
|
|
1635
1636
|
"aria-rowcount": s.length,
|
|
@@ -1653,7 +1654,7 @@ function ko({
|
|
|
1653
1654
|
},
|
|
1654
1655
|
e.id
|
|
1655
1656
|
)) }),
|
|
1656
|
-
/* @__PURE__ */ t(
|
|
1657
|
+
/* @__PURE__ */ t(zs, { className: V(
|
|
1657
1658
|
h && [
|
|
1658
1659
|
"sticky top-0 z-20",
|
|
1659
1660
|
"after:absolute after:bottom-0 after:left-0 after:right-0 after:h-px after:bg-[var(--color-border-primary-medium)]"
|
|
@@ -1661,7 +1662,7 @@ function ko({
|
|
|
1661
1662
|
// Remove bottom border from last header row when pagination is enabled to avoid double border
|
|
1662
1663
|
vt && "[&_tr:last-child]:border-b-0"
|
|
1663
1664
|
), children: A ? /* @__PURE__ */ t(
|
|
1664
|
-
|
|
1665
|
+
Mr,
|
|
1665
1666
|
{
|
|
1666
1667
|
columns: w.getVisibleLeafColumns().length,
|
|
1667
1668
|
rows: 0,
|
|
@@ -1669,7 +1670,7 @@ function ko({
|
|
|
1669
1670
|
showCellBorder: E.showCellBorder,
|
|
1670
1671
|
enableResponsiveWrapper: st
|
|
1671
1672
|
}
|
|
1672
|
-
) :
|
|
1673
|
+
) : tn && Qe && Qe.length > 0 ? (
|
|
1673
1674
|
// Nested headers rendering
|
|
1674
1675
|
/* @__PURE__ */ b(ee, { children: [
|
|
1675
1676
|
/* @__PURE__ */ t(G, { showBorder: E.showRowBorder, children: Qe.map((e, r) => {
|
|
@@ -1682,8 +1683,8 @@ function ko({
|
|
|
1682
1683
|
className: V(
|
|
1683
1684
|
"text-center bg-[var(--color-background-neutral-subtlest)] font-medium border-b border-[var(--color-border-primary-medium)]",
|
|
1684
1685
|
h && "z-20",
|
|
1685
|
-
!
|
|
1686
|
-
!
|
|
1686
|
+
!Me && r === 0 && "rounded-tl-l",
|
|
1687
|
+
!Me && r === Qe.length - 1 && "rounded-tr-l",
|
|
1687
1688
|
e.className
|
|
1688
1689
|
),
|
|
1689
1690
|
style: {
|
|
@@ -1710,7 +1711,7 @@ function ko({
|
|
|
1710
1711
|
h && "z-20",
|
|
1711
1712
|
(Oe > 0 || Ne > 0) && "z-30",
|
|
1712
1713
|
te && "relative overflow-visible group",
|
|
1713
|
-
|
|
1714
|
+
wr(e.column, g),
|
|
1714
1715
|
// Focus ring for keyboard navigation
|
|
1715
1716
|
"focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--color-border-brand-bold)]"
|
|
1716
1717
|
),
|
|
@@ -1753,10 +1754,10 @@ function ko({
|
|
|
1753
1754
|
) : (
|
|
1754
1755
|
// Standard single-level headers
|
|
1755
1756
|
w.getHeaderGroups().map((e) => /* @__PURE__ */ t(
|
|
1756
|
-
|
|
1757
|
+
Ss,
|
|
1757
1758
|
{
|
|
1758
1759
|
items: e.headers.map((r) => r.id),
|
|
1759
|
-
strategy:
|
|
1760
|
+
strategy: Ns,
|
|
1760
1761
|
children: /* @__PURE__ */ t(G, { showBorder: E.showRowBorder, children: e.headers.map((r, n) => {
|
|
1761
1762
|
const u = Ge(r.column, !0, E.showRowBorder), g = r.column.columnDef.meta?.align || "left", m = n === e.headers.length - 1, S = Bt(r.column);
|
|
1762
1763
|
return /* @__PURE__ */ t(
|
|
@@ -1773,9 +1774,9 @@ function ko({
|
|
|
1773
1774
|
(Oe > 0 || Ne > 0) && "z-30",
|
|
1774
1775
|
te && "relative overflow-visible group",
|
|
1775
1776
|
Ye && "group",
|
|
1776
|
-
!
|
|
1777
|
-
!
|
|
1778
|
-
|
|
1777
|
+
!Me && n === 0 && "rounded-tl-l",
|
|
1778
|
+
!Me && n === e.headers.length - 1 && "rounded-tr-l",
|
|
1779
|
+
wr(r.column, m),
|
|
1779
1780
|
// Focus ring for keyboard navigation
|
|
1780
1781
|
"focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--color-border-brand-bold)]"
|
|
1781
1782
|
),
|
|
@@ -1784,7 +1785,7 @@ function ko({
|
|
|
1784
1785
|
// For table-fixed layout, all columns need explicit width
|
|
1785
1786
|
...te && !u.width ? { width: r.column.getSize() } : {}
|
|
1786
1787
|
},
|
|
1787
|
-
children: /* @__PURE__ */ t(
|
|
1788
|
+
children: /* @__PURE__ */ t(oo, { header: r, enableColumnOrdering: Ye, children: /* @__PURE__ */ b("div", { className: V(
|
|
1788
1789
|
g === "right" ? "text-right" : "text-left"
|
|
1789
1790
|
), children: [
|
|
1790
1791
|
r.isPlaceholder ? null : be(
|
|
@@ -1818,9 +1819,9 @@ function ko({
|
|
|
1818
1819
|
e.id
|
|
1819
1820
|
))
|
|
1820
1821
|
) }),
|
|
1821
|
-
/* @__PURE__ */ b(
|
|
1822
|
-
|
|
1823
|
-
|
|
1822
|
+
/* @__PURE__ */ b(Bs, { children: [
|
|
1823
|
+
En && !A && s.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(to, {}) }) }),
|
|
1824
|
+
Kt ? /* @__PURE__ */ t(G, { showBorder: !1, className: "h-[300px]", children: /* @__PURE__ */ t(
|
|
1824
1825
|
le,
|
|
1825
1826
|
{
|
|
1826
1827
|
colSpan: w.getVisibleLeafColumns().length,
|
|
@@ -1828,19 +1829,19 @@ function ko({
|
|
|
1828
1829
|
showBorder: !1,
|
|
1829
1830
|
showRowBorder: !1,
|
|
1830
1831
|
verticalAlign: "middle",
|
|
1831
|
-
children:
|
|
1832
|
-
|
|
1832
|
+
children: bn || /* @__PURE__ */ t(
|
|
1833
|
+
eo,
|
|
1833
1834
|
{
|
|
1834
|
-
error:
|
|
1835
|
-
onRetry:
|
|
1835
|
+
error: Kt,
|
|
1836
|
+
onRetry: vn
|
|
1836
1837
|
}
|
|
1837
1838
|
)
|
|
1838
1839
|
}
|
|
1839
|
-
) }) : A && (
|
|
1840
|
-
|
|
1840
|
+
) }) : A && (M === "replace" || s.length === 0) ? /* @__PURE__ */ t(
|
|
1841
|
+
Mr,
|
|
1841
1842
|
{
|
|
1842
1843
|
columns: w.getVisibleLeafColumns().length,
|
|
1843
|
-
rows:
|
|
1844
|
+
rows: Yn,
|
|
1844
1845
|
showRowBorder: E.showRowBorder,
|
|
1845
1846
|
showCellBorder: E.showCellBorder,
|
|
1846
1847
|
skipHeader: !0,
|
|
@@ -1854,11 +1855,11 @@ function ko({
|
|
|
1854
1855
|
w.getRowModel().rows?.length ? (
|
|
1855
1856
|
// Manual cross-page pinning: organize rows with pinned rows at top/bottom of every page
|
|
1856
1857
|
(() => {
|
|
1857
|
-
if (!Ee ||
|
|
1858
|
-
const o = /* @__PURE__ */ new Set(),
|
|
1858
|
+
if (!Ee || !$t) {
|
|
1859
|
+
const o = /* @__PURE__ */ new Set(), P = w.getRowModel().rows.filter((d) => J || d.depth === 0), $ = (d, k, H) => {
|
|
1859
1860
|
if (o.has(d.id)) return null;
|
|
1860
1861
|
o.add(d.id);
|
|
1861
|
-
const q =
|
|
1862
|
+
const q = mr.get(d.id) ?? -1;
|
|
1862
1863
|
return /* @__PURE__ */ b(l.Fragment, { children: [
|
|
1863
1864
|
/* @__PURE__ */ t(
|
|
1864
1865
|
G,
|
|
@@ -1877,7 +1878,7 @@ function ko({
|
|
|
1877
1878
|
d.getIsPinned() === "bottom" && "!bg-[var(--color-background-neutral-selected)] !border-t-2 !border-[var(--color-border-primary-medium)]",
|
|
1878
1879
|
// Nested row background colors (grouped and expanding)
|
|
1879
1880
|
(() => {
|
|
1880
|
-
const j = d.getIsGrouped?.() ? "font-medium" : "", ne =
|
|
1881
|
+
const j = d.getIsGrouped?.() ? "font-medium" : "", ne = Vr(d, {
|
|
1881
1882
|
enableGrouping: z,
|
|
1882
1883
|
enableExpanding: _,
|
|
1883
1884
|
nestedRowStyling: pt,
|
|
@@ -1887,25 +1888,25 @@ function ko({
|
|
|
1887
1888
|
return V(ne ? `bg-[${ne}]` : "", j);
|
|
1888
1889
|
})(),
|
|
1889
1890
|
// Row click styling with smart hover
|
|
1890
|
-
K && Se(d) && (
|
|
1891
|
+
K && Se(d) && (_t || "cursor-pointer hover:[background-image:linear-gradient(rgba(0,0,0,0.02),rgba(0,0,0,0.02))]")
|
|
1891
1892
|
),
|
|
1892
1893
|
style: {
|
|
1893
|
-
height:
|
|
1894
|
+
height: co(d.depth, pt)
|
|
1894
1895
|
},
|
|
1895
1896
|
onClick: K && Se(d) ? (I) => Dt(d, I) : void 0,
|
|
1896
1897
|
role: "row",
|
|
1897
1898
|
"aria-label": K && Se(d) ? `View details for row ${d.id}` : void 0,
|
|
1898
1899
|
"aria-current": ze(d) ? "true" : void 0,
|
|
1899
1900
|
children: d.getVisibleCells().map((I, j) => {
|
|
1900
|
-
const ne = Ge(I.column, !1, E.showRowBorder), U = j === 0, _e = _ && d.getCanExpand() || z && d.getIsGrouped(), de = d.getIsExpanded(), ue = d.depth,
|
|
1901
|
-
let Re =
|
|
1901
|
+
const ne = Ge(I.column, !1, E.showRowBorder), U = j === 0, _e = _ && d.getCanExpand() || z && d.getIsGrouped(), de = d.getIsExpanded(), ue = d.depth, Pt = z && d.getIsGrouped();
|
|
1902
|
+
let Re = Wt?.(d);
|
|
1902
1903
|
if (Re == null)
|
|
1903
1904
|
for (const oe of d.getVisibleCells()) {
|
|
1904
1905
|
const ae = oe.column.columnDef.sectionHeaderCell;
|
|
1905
1906
|
if (ae) {
|
|
1906
|
-
const
|
|
1907
|
-
if (
|
|
1908
|
-
Re =
|
|
1907
|
+
const Mt = ae(oe.getContext());
|
|
1908
|
+
if (Mt != null) {
|
|
1909
|
+
Re = Mt;
|
|
1909
1910
|
break;
|
|
1910
1911
|
}
|
|
1911
1912
|
}
|
|
@@ -1929,15 +1930,15 @@ function ko({
|
|
|
1929
1930
|
"data-section-header": se ? !0 : void 0,
|
|
1930
1931
|
className: V(
|
|
1931
1932
|
// Active row indicator on first cell
|
|
1932
|
-
U && ze(d) && (
|
|
1933
|
+
U && ze(d) && (qt || fr(Z ? !1 : E.showRowBorder)),
|
|
1933
1934
|
// Add sticky border classes for body cells (skip for section headers)
|
|
1934
|
-
!se &&
|
|
1935
|
+
!se && ls(I.column),
|
|
1935
1936
|
// Sticky columns need higher z-index and explicit backgrounds
|
|
1936
1937
|
Object.keys(ne).length > 0 && [
|
|
1937
1938
|
"z-10",
|
|
1938
1939
|
// Match row backgrounds for sticky cells to prevent transparency
|
|
1939
1940
|
(() => {
|
|
1940
|
-
const oe =
|
|
1941
|
+
const oe = Vr(d, {
|
|
1941
1942
|
enableGrouping: z,
|
|
1942
1943
|
enableExpanding: _,
|
|
1943
1944
|
nestedRowStyling: pt,
|
|
@@ -1962,18 +1963,18 @@ function ko({
|
|
|
1962
1963
|
children: se ? (
|
|
1963
1964
|
// Section header row - render custom content
|
|
1964
1965
|
Re
|
|
1965
|
-
) :
|
|
1966
|
+
) : Pt ? (
|
|
1966
1967
|
// Grouped row rendering - only show content in first cell
|
|
1967
|
-
U ?
|
|
1968
|
+
U ? Fr(d, w, Xe, de, ye, Ft) : I.column.columnDef.meta?.renderInGroupedRows ? (
|
|
1968
1969
|
// Render custom cell content for columns with renderInGroupedRows flag
|
|
1969
1970
|
Be(I)
|
|
1970
1971
|
) : I.column.columnDef.aggregatedCell ? (
|
|
1971
1972
|
// Render custom aggregatedCell if defined
|
|
1972
|
-
|
|
1973
|
+
yr(I)
|
|
1973
1974
|
) : (
|
|
1974
1975
|
// Calculate and show aggregation for other columns in grouped row
|
|
1975
1976
|
(() => {
|
|
1976
|
-
const oe =
|
|
1977
|
+
const oe = Pr(
|
|
1977
1978
|
I.column,
|
|
1978
1979
|
d.subRows,
|
|
1979
1980
|
d.groupingColumnId
|
|
@@ -2004,7 +2005,7 @@ function ko({
|
|
|
2004
2005
|
)
|
|
2005
2006
|
}
|
|
2006
2007
|
),
|
|
2007
|
-
U && Ee && !
|
|
2008
|
+
U && Ee && !Pt && /* @__PURE__ */ b("div", { className: "flex items-center gap-1", children: [
|
|
2008
2009
|
d.getIsPinned() !== "top" && /* @__PURE__ */ t(
|
|
2009
2010
|
"button",
|
|
2010
2011
|
{
|
|
@@ -2012,7 +2013,7 @@ function ko({
|
|
|
2012
2013
|
onClick: () => d.pin("top"),
|
|
2013
2014
|
className: "opacity-0 group-hover:opacity-100 flex h-[var(--size-s)] w-[var(--size-s)] items-center justify-center rounded-s text-[var(--color-text-secondary)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)]",
|
|
2014
2015
|
title: "Pin to top",
|
|
2015
|
-
children: /* @__PURE__ */ t(W, { name:
|
|
2016
|
+
children: /* @__PURE__ */ t(W, { name: Rr, className: "h-3 w-3" })
|
|
2016
2017
|
}
|
|
2017
2018
|
),
|
|
2018
2019
|
d.getIsPinned() !== "bottom" && /* @__PURE__ */ t(
|
|
@@ -2022,7 +2023,7 @@ function ko({
|
|
|
2022
2023
|
onClick: () => d.pin("bottom"),
|
|
2023
2024
|
className: "opacity-0 group-hover:opacity-100 flex h-[var(--size-s)] w-[var(--size-s)] items-center justify-center rounded-s text-[var(--color-text-secondary)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)]",
|
|
2024
2025
|
title: "Pin to bottom",
|
|
2025
|
-
children: /* @__PURE__ */ t(W, { name:
|
|
2026
|
+
children: /* @__PURE__ */ t(W, { name: Ir, className: "h-3 w-3" })
|
|
2026
2027
|
}
|
|
2027
2028
|
),
|
|
2028
2029
|
d.getIsPinned() && /* @__PURE__ */ t(
|
|
@@ -2032,7 +2033,7 @@ function ko({
|
|
|
2032
2033
|
onClick: () => d.pin(!1),
|
|
2033
2034
|
className: "opacity-0 group-hover:opacity-100 flex h-[var(--size-s)] w-[var(--size-s)] items-center justify-center rounded-s text-[var(--color-text-secondary)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)]",
|
|
2034
2035
|
title: "Unpin row",
|
|
2035
|
-
children: /* @__PURE__ */ t(W, { name:
|
|
2036
|
+
children: /* @__PURE__ */ t(W, { name: Vt, className: "h-3 w-3" })
|
|
2036
2037
|
}
|
|
2037
2038
|
)
|
|
2038
2039
|
] }),
|
|
@@ -2078,10 +2079,10 @@ function ko({
|
|
|
2078
2079
|
verticalAlign: Ie,
|
|
2079
2080
|
className: "p-0",
|
|
2080
2081
|
"data-section-header": !0,
|
|
2081
|
-
children:
|
|
2082
|
+
children: Zt?.[d.id] ? /* @__PURE__ */ b("div", { className: "flex flex-col items-center justify-center py-[var(--space-l)] gap-[var(--space-s)]", children: [
|
|
2082
2083
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-[var(--space-s)] text-[var(--color-text-danger)]", children: [
|
|
2083
|
-
/* @__PURE__ */ t(W, { name:
|
|
2084
|
-
/* @__PURE__ */ t("span", { className: "text-body-sm", children:
|
|
2084
|
+
/* @__PURE__ */ t(W, { name: js, className: "h-4 w-4" }),
|
|
2085
|
+
/* @__PURE__ */ t("span", { className: "text-body-sm", children: Zt[d.id]?.message || "Failed to load details" })
|
|
2085
2086
|
] }),
|
|
2086
2087
|
De && /* @__PURE__ */ t(
|
|
2087
2088
|
"button",
|
|
@@ -2108,18 +2109,18 @@ function ko({
|
|
|
2108
2109
|
})()
|
|
2109
2110
|
] }, d.id);
|
|
2110
2111
|
};
|
|
2111
|
-
return
|
|
2112
|
-
(d, k) => $(d, k, k ===
|
|
2112
|
+
return P.map(
|
|
2113
|
+
(d, k) => $(d, k, k === P.length - 1)
|
|
2113
2114
|
);
|
|
2114
2115
|
}
|
|
2115
2116
|
const e = w.getCoreRowModel().rows, r = w.getRowModel().rows, n = e.filter((o) => o.getIsPinned() === "top"), u = e.filter((o) => o.getIsPinned() === "bottom"), g = r.filter((o) => !o.getIsPinned()), m = [
|
|
2116
2117
|
...n,
|
|
2117
2118
|
...g,
|
|
2118
2119
|
...u
|
|
2119
|
-
], S = /* @__PURE__ */ new Set(), B = m.filter((o) => J || o.depth === 0), F = (o,
|
|
2120
|
+
], S = /* @__PURE__ */ new Set(), B = m.filter((o) => J || o.depth === 0), F = (o, P, $) => {
|
|
2120
2121
|
if (S.has(o.id)) return null;
|
|
2121
2122
|
S.add(o.id);
|
|
2122
|
-
const d =
|
|
2123
|
+
const d = mr.get(o.id) ?? -1;
|
|
2123
2124
|
return /* @__PURE__ */ b(l.Fragment, { children: [
|
|
2124
2125
|
/* @__PURE__ */ t(
|
|
2125
2126
|
G,
|
|
@@ -2163,7 +2164,7 @@ function ko({
|
|
|
2163
2164
|
return I;
|
|
2164
2165
|
})(),
|
|
2165
2166
|
// Row click styling with smart hover
|
|
2166
|
-
K && Se(o) && (
|
|
2167
|
+
K && Se(o) && (_t || "cursor-pointer hover:[background-image:linear-gradient(rgba(0,0,0,0.02),rgba(0,0,0,0.02))]")
|
|
2167
2168
|
),
|
|
2168
2169
|
onClick: K && Se(o) ? (k) => Dt(o, k) : void 0,
|
|
2169
2170
|
role: "row",
|
|
@@ -2171,7 +2172,7 @@ function ko({
|
|
|
2171
2172
|
"aria-current": ze(o) ? "true" : void 0,
|
|
2172
2173
|
children: o.getVisibleCells().map((k, H) => {
|
|
2173
2174
|
const q = Ge(k.column, !1, E.showRowBorder), I = H === 0, j = _ && o.getCanExpand() || z && o.getIsGrouped(), ne = o.getIsExpanded(), U = o.depth, _e = z && o.getIsGrouped();
|
|
2174
|
-
let de =
|
|
2175
|
+
let de = Wt?.(o);
|
|
2175
2176
|
if (de == null)
|
|
2176
2177
|
for (const pe of o.getVisibleCells()) {
|
|
2177
2178
|
const ve = pe.column.columnDef.sectionHeaderCell;
|
|
@@ -2201,7 +2202,7 @@ function ko({
|
|
|
2201
2202
|
colSpan: ue ? o.getVisibleCells().length : void 0,
|
|
2202
2203
|
className: V(
|
|
2203
2204
|
// Active row indicator on first cell
|
|
2204
|
-
I && ze(o) && (
|
|
2205
|
+
I && ze(o) && (qt || fr(se ? !1 : E.showRowBorder)),
|
|
2205
2206
|
// Focus ring for keyboard navigation
|
|
2206
2207
|
"focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--color-border-brand-bold)]",
|
|
2207
2208
|
// Sticky columns need higher z-index and explicit backgrounds
|
|
@@ -2258,16 +2259,16 @@ function ko({
|
|
|
2258
2259
|
de
|
|
2259
2260
|
) : _e ? (
|
|
2260
2261
|
// Grouped row rendering - only show content in first cell
|
|
2261
|
-
I ?
|
|
2262
|
+
I ? Fr(o, w, Xe, ne, ye, Ft) : k.column.columnDef.meta?.renderInGroupedRows ? (
|
|
2262
2263
|
// Render custom cell content for columns with renderInGroupedRows flag
|
|
2263
2264
|
Be(k)
|
|
2264
2265
|
) : k.column.columnDef.aggregatedCell ? (
|
|
2265
2266
|
// Render custom aggregatedCell if defined
|
|
2266
|
-
|
|
2267
|
+
yr(k)
|
|
2267
2268
|
) : (
|
|
2268
2269
|
// Calculate and show aggregation for other columns in grouped row
|
|
2269
2270
|
(() => {
|
|
2270
|
-
const pe =
|
|
2271
|
+
const pe = Pr(
|
|
2271
2272
|
k.column,
|
|
2272
2273
|
o.subRows,
|
|
2273
2274
|
o.groupingColumnId
|
|
@@ -2304,7 +2305,7 @@ function ko({
|
|
|
2304
2305
|
onClick: () => o.pin("top"),
|
|
2305
2306
|
className: "opacity-0 group-hover:opacity-100 flex h-[var(--size-s)] w-[var(--size-s)] items-center justify-center rounded-s text-[var(--color-text-secondary)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)]",
|
|
2306
2307
|
title: "Pin to top",
|
|
2307
|
-
children: /* @__PURE__ */ t(W, { name:
|
|
2308
|
+
children: /* @__PURE__ */ t(W, { name: Rr, className: "h-3 w-3" })
|
|
2308
2309
|
}
|
|
2309
2310
|
),
|
|
2310
2311
|
o.getIsPinned() !== "bottom" && /* @__PURE__ */ t(
|
|
@@ -2313,7 +2314,7 @@ function ko({
|
|
|
2313
2314
|
onClick: () => o.pin("bottom"),
|
|
2314
2315
|
className: "opacity-0 group-hover:opacity-100 flex h-[var(--size-s)] w-[var(--size-s)] items-center justify-center rounded-s text-[var(--color-text-secondary)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)]",
|
|
2315
2316
|
title: "Pin to bottom",
|
|
2316
|
-
children: /* @__PURE__ */ t(W, { name:
|
|
2317
|
+
children: /* @__PURE__ */ t(W, { name: Ir, className: "h-3 w-3" })
|
|
2317
2318
|
}
|
|
2318
2319
|
),
|
|
2319
2320
|
o.getIsPinned() && /* @__PURE__ */ t(
|
|
@@ -2322,7 +2323,7 @@ function ko({
|
|
|
2322
2323
|
onClick: () => o.pin(!1),
|
|
2323
2324
|
className: "opacity-0 group-hover:opacity-100 flex h-[var(--size-s)] w-[var(--size-s)] items-center justify-center rounded-s text-[var(--color-text-secondary)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)]",
|
|
2324
2325
|
title: "Unpin row",
|
|
2325
|
-
children: /* @__PURE__ */ t(W, { name:
|
|
2326
|
+
children: /* @__PURE__ */ t(W, { name: Vt, className: "h-3 w-3" })
|
|
2326
2327
|
}
|
|
2327
2328
|
)
|
|
2328
2329
|
] }),
|
|
@@ -2386,12 +2387,12 @@ function ko({
|
|
|
2386
2387
|
] }, o.id);
|
|
2387
2388
|
};
|
|
2388
2389
|
return B.map(
|
|
2389
|
-
(o,
|
|
2390
|
+
(o, P) => F(o, P, P === B.length - 1)
|
|
2390
2391
|
);
|
|
2391
2392
|
})()
|
|
2392
2393
|
) : (
|
|
2393
2394
|
// Empty or no results state
|
|
2394
|
-
|
|
2395
|
+
er.length > 0 || St !== "" ? /* @__PURE__ */ t(G, { showBorder: !1, className: "h-[300px]", children: /* @__PURE__ */ t(
|
|
2395
2396
|
le,
|
|
2396
2397
|
{
|
|
2397
2398
|
colSpan: kt.length,
|
|
@@ -2399,12 +2400,12 @@ function ko({
|
|
|
2399
2400
|
showBorder: !1,
|
|
2400
2401
|
showRowBorder: !1,
|
|
2401
2402
|
verticalAlign: "middle",
|
|
2402
|
-
children:
|
|
2403
|
-
|
|
2403
|
+
children: Sn || /* @__PURE__ */ t(
|
|
2404
|
+
Zs,
|
|
2404
2405
|
{
|
|
2405
|
-
title:
|
|
2406
|
-
description:
|
|
2407
|
-
action:
|
|
2406
|
+
title: Nn,
|
|
2407
|
+
description: Rn,
|
|
2408
|
+
action: In
|
|
2408
2409
|
}
|
|
2409
2410
|
)
|
|
2410
2411
|
}
|
|
@@ -2416,12 +2417,12 @@ function ko({
|
|
|
2416
2417
|
showBorder: !1,
|
|
2417
2418
|
showRowBorder: !1,
|
|
2418
2419
|
verticalAlign: "middle",
|
|
2419
|
-
children:
|
|
2420
|
-
|
|
2420
|
+
children: xn || /* @__PURE__ */ t(
|
|
2421
|
+
Ys,
|
|
2421
2422
|
{
|
|
2422
|
-
title:
|
|
2423
|
-
description:
|
|
2424
|
-
action:
|
|
2423
|
+
title: yn,
|
|
2424
|
+
description: Cn,
|
|
2425
|
+
action: wn
|
|
2425
2426
|
}
|
|
2426
2427
|
)
|
|
2427
2428
|
}
|
|
@@ -2436,23 +2437,23 @@ function ko({
|
|
|
2436
2437
|
}
|
|
2437
2438
|
),
|
|
2438
2439
|
vt && /* @__PURE__ */ t("div", { className: "bg-[var(--color-surface-primary)] px-[var(--space-l)] py-[var(--space-m)]", children: /* @__PURE__ */ t(
|
|
2439
|
-
|
|
2440
|
+
ao,
|
|
2440
2441
|
{
|
|
2441
2442
|
table: w,
|
|
2442
2443
|
enableGrouping: z,
|
|
2443
2444
|
hideChildrenForSingleItemGroups: ye,
|
|
2444
|
-
footerLabel:
|
|
2445
|
-
onNextPageHover:
|
|
2446
|
-
onPreviousPageHover:
|
|
2447
|
-
paginationVariant:
|
|
2448
|
-
pageSizeOptions:
|
|
2445
|
+
footerLabel: sn,
|
|
2446
|
+
onNextPageHover: gn,
|
|
2447
|
+
onPreviousPageHover: mn,
|
|
2448
|
+
paginationVariant: rn,
|
|
2449
|
+
pageSizeOptions: nn
|
|
2449
2450
|
}
|
|
2450
2451
|
) }),
|
|
2451
|
-
|
|
2452
|
-
|
|
2452
|
+
Jt && hn && /* @__PURE__ */ t(
|
|
2453
|
+
lo,
|
|
2453
2454
|
{
|
|
2454
|
-
onLoadMore: () =>
|
|
2455
|
-
isLoading:
|
|
2455
|
+
onLoadMore: () => Jt(re.pageIndex),
|
|
2456
|
+
isLoading: pn
|
|
2456
2457
|
}
|
|
2457
2458
|
)
|
|
2458
2459
|
] })
|
|
@@ -2460,14 +2461,14 @@ function ko({
|
|
|
2460
2461
|
) });
|
|
2461
2462
|
}
|
|
2462
2463
|
export {
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2464
|
+
$o as DataTable,
|
|
2465
|
+
Fo as DataTableColumnHeader,
|
|
2466
|
+
so as DataTableFilter,
|
|
2467
|
+
ao as DataTablePagination,
|
|
2468
|
+
Mr as DataTableSkeleton,
|
|
2469
|
+
ro as DataTableToolbar,
|
|
2470
|
+
Dr as fuzzyFilter,
|
|
2471
|
+
Vo as groupPreservingGlobalFilter,
|
|
2472
|
+
Us as multiSelectFilter,
|
|
2473
|
+
Lo as useReactTable
|
|
2473
2474
|
};
|