@sequenceholdings/atlas-ui 3.7.1 → 4.1.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/index.d.ts +196 -65
- package/dist/index.mjs +61 -59
- package/dist/next.mjs +1 -1
- package/dist/shared/components/ui/alert-dialog.mjs +41 -38
- package/dist/shared/components/ui/button.mjs +13 -13
- package/dist/shared/components/ui/chart.mjs +1 -1
- package/dist/shared/components/ui/date-field.mjs +83 -66
- package/dist/shared/components/ui/dialog.mjs +43 -40
- package/dist/shared/components/ui/iso-date-field.mjs +11 -10
- package/dist/shared/components/ui/pro-data-table.mjs +274 -251
- package/dist/shared/components/ui/segmented-control.mjs +2 -2
- package/dist/shared/components/ui/spinner.mjs +11 -9
- package/dist/shared/components/ui/table-heatmap.mjs +40 -0
- package/dist/shared/components/ui/tabs.mjs +2 -2
- package/dist/shared/components/ui/toggle-group.mjs +22 -22
- package/dist/shared/components/ui/toggle.mjs +13 -8
- package/dist/shared/components/ui/use-overlay-portal-target.mjs +18 -15
- package/package.json +1 -1
|
@@ -8,34 +8,35 @@ import u from "../../../vendor/@tabler_icons-react@3.45.0_react@19.2.6/dist/esm/
|
|
|
8
8
|
import d from "../../../vendor/@tabler_icons-react@3.45.0_react@19.2.6/dist/esm/icons/IconChevronRight.mjs";
|
|
9
9
|
import f from "../../../vendor/@tabler_icons-react@3.45.0_react@19.2.6/dist/esm/icons/IconChevronUp.mjs";
|
|
10
10
|
import p from "../../../vendor/@tabler_icons-react@3.45.0_react@19.2.6/dist/esm/icons/IconDotsVertical.mjs";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { DropdownMenu as
|
|
14
|
-
import { Spinner as
|
|
15
|
-
import { getCoreRowModel as
|
|
16
|
-
import { flexRender as
|
|
17
|
-
import { TableBody as
|
|
18
|
-
import { Checkbox as
|
|
19
|
-
import { Popover as
|
|
11
|
+
import ee from "../../../vendor/@tabler_icons-react@3.45.0_react@19.2.6/dist/esm/icons/IconSelector.mjs";
|
|
12
|
+
import m from "../../../vendor/@tabler_icons-react@3.45.0_react@19.2.6/dist/esm/icons/IconX.mjs";
|
|
13
|
+
import { DropdownMenu as h, DropdownMenuContent as g, DropdownMenuItem as te, DropdownMenuSeparator as _, DropdownMenuTrigger as v } from "./dropdown-menu.mjs";
|
|
14
|
+
import { Spinner as ne } from "./spinner.mjs";
|
|
15
|
+
import { getCoreRowModel as re, getFilteredRowModel as ie, getPaginationRowModel as ae, getSortedRowModel as oe } from "../../../vendor/@tanstack_table-core@8.21.3/build/lib/index.mjs";
|
|
16
|
+
import { flexRender as se, useReactTable as ce } from "../../../vendor/@tanstack_react-table@8.21.3_react-dom@19.2.6_react@19.2.6__react@19.2.6/build/lib/index.mjs";
|
|
17
|
+
import { TableBody as le, TableCell as y, TableHead as ue, TableHeader as de, TableRow as b } from "./table.mjs";
|
|
18
|
+
import { Checkbox as fe } from "./checkbox.mjs";
|
|
19
|
+
import { Popover as x, PopoverContent as S, PopoverTrigger as pe } from "./popover.mjs";
|
|
20
20
|
import { MultiSelectList as me, SingleSelectList as C } from "./multi-select.mjs";
|
|
21
21
|
import { FilterMenu as he } from "./filter-menu.mjs";
|
|
22
22
|
import { StatusDot as ge } from "./status-dot.mjs";
|
|
23
|
+
import { heatCellStyle as _e, heatmapDomain as ve } from "./table-heatmap.mjs";
|
|
23
24
|
import * as w from "react";
|
|
24
|
-
import { Fragment as
|
|
25
|
+
import { Fragment as ye, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
25
26
|
//#region ../../../atlas/src/shared/components/ui/pro-data-table.tsx
|
|
26
|
-
var
|
|
27
|
-
function
|
|
27
|
+
var be = 80;
|
|
28
|
+
function xe(e) {
|
|
28
29
|
return e == null ? "" : typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : e instanceof Date ? e.toISOString() : String(e);
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function Se(e, t) {
|
|
31
32
|
if (t == null) return !0;
|
|
32
|
-
let n =
|
|
33
|
+
let n = xe(e);
|
|
33
34
|
return Array.isArray(t) ? t.length === 0 || t.includes(n) : t === "" || n === t;
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function Ce(e, t) {
|
|
36
37
|
return e == null || e === t ? void 0 : e;
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function we(e, t, n) {
|
|
39
40
|
let r = e;
|
|
40
41
|
if (typeof r.accessorFn == "function") return r.accessorFn(t, n);
|
|
41
42
|
let i = r.accessorKey;
|
|
@@ -43,13 +44,13 @@ function Se(e, t, n) {
|
|
|
43
44
|
}
|
|
44
45
|
function D(e) {
|
|
45
46
|
let t = e.meta ?? {};
|
|
46
|
-
return t.width ?? t.minWidth ?? (typeof e.size == "number" ? e.size : void 0) ??
|
|
47
|
+
return t.width ?? t.minWidth ?? (typeof e.size == "number" ? e.size : void 0) ?? be;
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
-
return e.minWidth ?? e.width ??
|
|
49
|
+
function Te(e) {
|
|
50
|
+
return e.minWidth ?? e.width ?? be;
|
|
50
51
|
}
|
|
51
52
|
var O = "pro-data-table:column-sizing:";
|
|
52
|
-
function
|
|
53
|
+
function Ee(e, t = () => 0) {
|
|
53
54
|
if (!e || typeof window > "u") return {};
|
|
54
55
|
try {
|
|
55
56
|
let n = window.localStorage.getItem(O + e);
|
|
@@ -63,12 +64,12 @@ function we(e, t = () => 0) {
|
|
|
63
64
|
return {};
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
+
function De(e, t) {
|
|
67
68
|
if (!(!e || typeof window > "u")) try {
|
|
68
69
|
Object.keys(t).length === 0 ? window.localStorage.removeItem(O + e) : window.localStorage.setItem(O + e, JSON.stringify(t));
|
|
69
70
|
} catch {}
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
+
function Oe(e) {
|
|
72
73
|
if (!e.interactive) return;
|
|
73
74
|
let t = (e) => e.stopPropagation();
|
|
74
75
|
return {
|
|
@@ -76,7 +77,7 @@ function Ee(e) {
|
|
|
76
77
|
onAuxClick: t
|
|
77
78
|
};
|
|
78
79
|
}
|
|
79
|
-
var
|
|
80
|
+
var ke = "bg-surface", Ae = "group-hover:bg-surface-hover", je = "transition-shadow duration-150 ease-out", Me = e("[scrollbar-width:thin]", "[&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2", "[&::-webkit-scrollbar-track]:bg-transparent", "[&::-webkit-scrollbar-thumb]:rounded-full", "[&::-webkit-scrollbar-thumb]:bg-border", "hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground");
|
|
80
81
|
function k(e) {
|
|
81
82
|
return e.sticky === !0 || e.sticky === "left" ? "left" : e.sticky === "right" ? "right" : null;
|
|
82
83
|
}
|
|
@@ -84,7 +85,7 @@ function A(e) {
|
|
|
84
85
|
let t = e;
|
|
85
86
|
return t.id == null ? t.accessorKey == null ? typeof t.header == "string" ? t.header : "" : String(t.accessorKey).replace(/\./g, "_") : t.id;
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
+
function Ne(e, t = D) {
|
|
88
89
|
let n = /* @__PURE__ */ new Map(), r = 0, i = !1, a = [];
|
|
89
90
|
for (let o of e) {
|
|
90
91
|
let e = o.meta ?? {}, s = k(e), c = A(o);
|
|
@@ -138,8 +139,8 @@ function je(e, t = D) {
|
|
|
138
139
|
function j(e, t) {
|
|
139
140
|
e.grow === !0 && process.env.NODE_ENV !== "production" && console.warn(`[ProDataTable] Column "${t}" is sticky and has \`grow: true\`. Sticky columns must have a deterministic width — \`grow\` is ignored. Set an explicit \`width\` (and optional \`minWidth\`) instead.`);
|
|
140
141
|
}
|
|
141
|
-
function
|
|
142
|
-
let r =
|
|
142
|
+
function Pe(e, t = !1, n) {
|
|
143
|
+
let r = Te(e);
|
|
143
144
|
return n == null ? e.grow && !t ? {
|
|
144
145
|
minWidth: r,
|
|
145
146
|
width: "100%"
|
|
@@ -151,46 +152,46 @@ function Me(e, t = !1, n) {
|
|
|
151
152
|
width: n
|
|
152
153
|
};
|
|
153
154
|
}
|
|
154
|
-
var
|
|
155
|
-
function
|
|
155
|
+
var Fe = "__select__", Ie = "__row_actions__", Le = 44, M = 48, Re = "text-muted-foreground opacity-0 hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100";
|
|
156
|
+
function ze({ actions: n, label: r }) {
|
|
156
157
|
let i = n.filter((e) => !e.hidden);
|
|
157
158
|
if (i.length === 0) return null;
|
|
158
|
-
let a = i.filter((e) => !e.destructive), o = i.filter((e) => e.destructive), s = (e, t) => /* @__PURE__ */ E(
|
|
159
|
+
let a = i.filter((e) => !e.destructive), o = i.filter((e) => e.destructive), s = (e, t) => /* @__PURE__ */ E(te, {
|
|
159
160
|
variant: e.destructive ? "destructive" : void 0,
|
|
160
161
|
disabled: e.disabled,
|
|
161
162
|
onSelect: () => e.onSelect(),
|
|
162
163
|
children: [e.icon, e.label]
|
|
163
164
|
}, t);
|
|
164
|
-
return /* @__PURE__ */ E(
|
|
165
|
+
return /* @__PURE__ */ E(h, { children: [/* @__PURE__ */ T(v, {
|
|
165
166
|
asChild: !0,
|
|
166
167
|
children: /* @__PURE__ */ T(t, {
|
|
167
168
|
variant: "ghost",
|
|
168
169
|
size: "icon-sm",
|
|
169
170
|
"aria-label": r ? `Actions for ${r}` : "Row actions",
|
|
170
|
-
className: e(
|
|
171
|
+
className: e(Re, "data-[state=open]:opacity-100 data-[state=open]:text-foreground"),
|
|
171
172
|
children: /* @__PURE__ */ T(p, { stroke: 1.75 })
|
|
172
173
|
})
|
|
173
|
-
}), /* @__PURE__ */ E(
|
|
174
|
+
}), /* @__PURE__ */ E(g, {
|
|
174
175
|
align: "end",
|
|
175
176
|
className: "w-44",
|
|
176
177
|
children: [
|
|
177
178
|
a.map((e, t) => s(e, t)),
|
|
178
|
-
o.length > 0 && a.length > 0 && /* @__PURE__ */ T(
|
|
179
|
+
o.length > 0 && a.length > 0 && /* @__PURE__ */ T(_, {}),
|
|
179
180
|
o.map((e, t) => s(e, a.length + t))
|
|
180
181
|
]
|
|
181
182
|
})] });
|
|
182
183
|
}
|
|
183
|
-
function
|
|
184
|
+
function Be(e) {
|
|
184
185
|
return {
|
|
185
|
-
id:
|
|
186
|
+
id: Fe,
|
|
186
187
|
enableSorting: !1,
|
|
187
188
|
enableHiding: !1,
|
|
188
|
-
header: ({ table: e }) => /* @__PURE__ */ T(
|
|
189
|
+
header: ({ table: e }) => /* @__PURE__ */ T(fe, {
|
|
189
190
|
"aria-label": "Select all rows",
|
|
190
191
|
checked: e.getIsAllPageRowsSelected() ? !0 : e.getIsSomePageRowsSelected() ? "indeterminate" : !1,
|
|
191
192
|
onCheckedChange: (t) => t ? e.toggleAllPageRowsSelected(!0) : e.setRowSelection({})
|
|
192
193
|
}),
|
|
193
|
-
cell: ({ row: t }) => /* @__PURE__ */ T(
|
|
194
|
+
cell: ({ row: t }) => /* @__PURE__ */ T(fe, {
|
|
194
195
|
"aria-label": e ? `Select ${e(t.original)}` : "Select row",
|
|
195
196
|
checked: t.getIsSelected(),
|
|
196
197
|
disabled: !t.getCanSelect(),
|
|
@@ -198,21 +199,21 @@ function Re(e) {
|
|
|
198
199
|
}),
|
|
199
200
|
meta: {
|
|
200
201
|
sticky: "left",
|
|
201
|
-
width:
|
|
202
|
-
minWidth:
|
|
202
|
+
width: Le,
|
|
203
|
+
minWidth: Le,
|
|
203
204
|
align: "left",
|
|
204
205
|
enableResizing: !1,
|
|
205
206
|
interactive: !0
|
|
206
207
|
}
|
|
207
208
|
};
|
|
208
209
|
}
|
|
209
|
-
function
|
|
210
|
+
function Ve(e, t) {
|
|
210
211
|
return {
|
|
211
|
-
id:
|
|
212
|
+
id: Ie,
|
|
212
213
|
enableSorting: !1,
|
|
213
214
|
enableHiding: !1,
|
|
214
215
|
header: () => null,
|
|
215
|
-
cell: ({ row: n }) => /* @__PURE__ */ T(
|
|
216
|
+
cell: ({ row: n }) => /* @__PURE__ */ T(ze, {
|
|
216
217
|
actions: e(n.original),
|
|
217
218
|
label: t?.(n.original)
|
|
218
219
|
}),
|
|
@@ -226,7 +227,7 @@ function ze(e, t) {
|
|
|
226
227
|
}
|
|
227
228
|
};
|
|
228
229
|
}
|
|
229
|
-
function
|
|
230
|
+
function He(e) {
|
|
230
231
|
let t = e?.value, n = !!e?.onChange && t != null, [r, i] = w.useState(t ?? ""), [a, o] = w.useState(null), s = n ? a ?? t ?? "" : r, c = w.useRef(null), l = w.useCallback(() => {
|
|
231
232
|
c.current != null && (window.clearTimeout(c.current), c.current = null);
|
|
232
233
|
}, []);
|
|
@@ -257,7 +258,7 @@ function Be(e) {
|
|
|
257
258
|
])
|
|
258
259
|
};
|
|
259
260
|
}
|
|
260
|
-
function
|
|
261
|
+
function Ue({ rows: e, groupBy: t, isGroupExpanded: n, groupKeys: r }) {
|
|
261
262
|
let i = /* @__PURE__ */ new Map();
|
|
262
263
|
for (let n of e) {
|
|
263
264
|
let e = t(n.original), r = i.get(e);
|
|
@@ -283,125 +284,129 @@ function Ve({ rows: e, groupBy: t, isGroupExpanded: n, groupKeys: r }) {
|
|
|
283
284
|
}
|
|
284
285
|
return c;
|
|
285
286
|
}
|
|
286
|
-
function
|
|
287
|
+
function We({ defaultExpandedGroups: e, groupKeys: t }) {
|
|
287
288
|
return e === "all" ? new Set(t) : e === "none" ? /* @__PURE__ */ new Set() : new Set(e);
|
|
288
289
|
}
|
|
289
|
-
function
|
|
290
|
+
function Ge(e) {
|
|
290
291
|
if (Array.isArray(e.columns)) return;
|
|
291
292
|
let t = e.children == null ? `Received ${e.columns === null ? "null" : typeof e.columns}.` : "It was given `children`, so this is probably composition markup: use `<TablePrimitive.Root>` (with TableHeader/TableRow/TableCell) for a static table, or pass `columns` + `data` to use this one.";
|
|
292
293
|
throw Error(`Table: \`columns\` must be an array. ${t}`);
|
|
293
294
|
}
|
|
294
295
|
function N(t) {
|
|
295
|
-
|
|
296
|
-
let { columns: r, data: i, selectable: a = !1, getRowId: o, selectedRowIds: s, onSelectionChange: c, enableRowSelection: l, rowActions: u, getRowLabel: d, searchable: f, filters: p, toolbar:
|
|
296
|
+
Ge(t);
|
|
297
|
+
let { columns: r, data: i, selectable: a = !1, getRowId: o, selectedRowIds: s, onSelectionChange: c, enableRowSelection: l, rowActions: u, getRowLabel: d, searchable: f, filters: p, toolbar: ee, actions: m, footer: h, pageSize: g = 50, disablePagination: te, resizableColumns: _ = !1, columnSizingStorageKey: v, defaultSort: fe, manualPagination: x = !1, rowCount: S, pageIndex: pe, onPageChange: me, manualSorting: C = !1, sorting: ge, onSortingChange: O, manualFiltering: k = !1, columnFilters: j, onColumnFiltersChange: Fe, loading: Ie = !1, emptyMessage: Le = "No data", onRowClick: M, rowHref: Re, rowClassName: ze, minWidth: N, height: P, bordered: $e = !0, variant: F = "table", ariaLabel: tt, className: nt, groupBy: I, groupKeys: L, renderGroupHeader: rt, collapsibleGroups: R = !1, expandedGroups: z, defaultExpandedGroups: B = "all", onExpandedGroupsChange: it } = t, V = !!(te || I && !x), H = w.useRef(!1);
|
|
297
298
|
w.useEffect(() => {
|
|
298
|
-
process.env.NODE_ENV === "production" || !I ||
|
|
299
|
+
process.env.NODE_ENV === "production" || !I || te === !0 || x || H.current || (H.current = !0, console.warn("ProDataTable: `groupBy` forces pagination off (v1). Pass `disablePagination` explicitly to silence this."));
|
|
299
300
|
}, [
|
|
300
301
|
I,
|
|
301
|
-
|
|
302
|
-
|
|
302
|
+
te,
|
|
303
|
+
x
|
|
303
304
|
]);
|
|
304
|
-
let U = w.useMemo(() =>
|
|
305
|
+
let U = w.useMemo(() => {
|
|
306
|
+
let e = f ?? !x;
|
|
307
|
+
if (x && e && (typeof e != "object" || !e.onChange)) throw Error("Table: manualPagination requires controlled searchable.onChange.");
|
|
308
|
+
return e ? typeof e == "object" ? e : {} : null;
|
|
309
|
+
}, [x, f]), [at, ot] = w.useState(fe ?? []), st = C ? ge ?? [] : at, ct = w.useCallback((e) => {
|
|
305
310
|
if (C) {
|
|
306
311
|
let t = typeof e == "function" ? e(ge ?? []) : e;
|
|
307
312
|
O?.(t);
|
|
308
|
-
} else
|
|
313
|
+
} else ot(e);
|
|
309
314
|
}, [
|
|
310
315
|
C,
|
|
311
316
|
ge,
|
|
312
317
|
O
|
|
313
|
-
]), [
|
|
318
|
+
]), [lt, ut] = w.useState({
|
|
314
319
|
pageIndex: 0,
|
|
315
|
-
pageSize:
|
|
316
|
-
}),
|
|
320
|
+
pageSize: g
|
|
321
|
+
}), dt = x ? {
|
|
317
322
|
pageIndex: pe ?? 0,
|
|
318
|
-
pageSize:
|
|
319
|
-
} :
|
|
320
|
-
if (
|
|
323
|
+
pageSize: g
|
|
324
|
+
} : lt, ft = w.useCallback((e) => {
|
|
325
|
+
if (x) {
|
|
321
326
|
let t = {
|
|
322
327
|
pageIndex: pe ?? 0,
|
|
323
|
-
pageSize:
|
|
328
|
+
pageSize: g
|
|
324
329
|
}, n = typeof e == "function" ? e(t) : e;
|
|
325
330
|
n.pageIndex !== t.pageIndex && me?.(n.pageIndex);
|
|
326
|
-
} else
|
|
331
|
+
} else ut(e);
|
|
327
332
|
}, [
|
|
328
|
-
|
|
333
|
+
x,
|
|
329
334
|
pe,
|
|
330
|
-
|
|
335
|
+
g,
|
|
331
336
|
me
|
|
332
|
-
]), { searchQuery: W, handleSearchInput:
|
|
333
|
-
q ||
|
|
334
|
-
}, [q,
|
|
337
|
+
]), { searchQuery: W, handleSearchInput: pt } = He(U), [G, mt] = w.useState(() => /* @__PURE__ */ new Set()), ht = w.useRef(!1), K = W.trim().length > 0, q = z != null, gt = w.useCallback((e) => {
|
|
338
|
+
q || mt(e), it?.(e);
|
|
339
|
+
}, [q, it]), _t = w.useCallback((e) => {
|
|
335
340
|
if (!R || K) return;
|
|
336
341
|
let t = new Set(q ? z : G);
|
|
337
|
-
t.has(e) ? t.delete(e) : t.add(e),
|
|
342
|
+
t.has(e) ? t.delete(e) : t.add(e), gt(t);
|
|
338
343
|
}, [
|
|
339
344
|
R,
|
|
340
345
|
K,
|
|
341
346
|
q,
|
|
342
347
|
z,
|
|
343
348
|
G,
|
|
344
|
-
|
|
345
|
-
]), J = !
|
|
349
|
+
gt
|
|
350
|
+
]), J = !x || k, [vt, yt] = w.useState([]), bt = w.useMemo(() => k ? j ?? [] : vt, [
|
|
346
351
|
k,
|
|
347
352
|
j,
|
|
348
|
-
|
|
349
|
-
]),
|
|
353
|
+
vt
|
|
354
|
+
]), xt = w.useCallback((e) => {
|
|
350
355
|
if (k) {
|
|
351
356
|
let t = typeof e == "function" ? e(j ?? []) : e;
|
|
352
|
-
|
|
353
|
-
} else
|
|
357
|
+
Fe?.(t);
|
|
358
|
+
} else yt(e);
|
|
354
359
|
}, [
|
|
355
360
|
k,
|
|
356
361
|
j,
|
|
357
|
-
|
|
358
|
-
]),
|
|
359
|
-
if (!
|
|
360
|
-
let e = new Map(r.map((e) => [A(e),
|
|
361
|
-
return
|
|
362
|
+
Fe
|
|
363
|
+
]), St = w.useCallback((e, t, n) => Se(e.getValue(t), n), []), Ct = w.useCallback((e, t, n) => Se(e.getValue(t), n), []), [Y, wt] = w.useState(() => {
|
|
364
|
+
if (!_) return {};
|
|
365
|
+
let e = new Map(r.map((e) => [A(e), Te(e.meta ?? {})]));
|
|
366
|
+
return Ee(v, (t) => e.get(t) ?? 0);
|
|
362
367
|
});
|
|
363
368
|
w.useEffect(() => {
|
|
364
|
-
|
|
369
|
+
_ && De(v, Y);
|
|
365
370
|
}, [
|
|
371
|
+
_,
|
|
366
372
|
v,
|
|
367
|
-
y,
|
|
368
373
|
Y
|
|
369
374
|
]);
|
|
370
|
-
let [
|
|
371
|
-
if (!
|
|
375
|
+
let [Tt, Et] = w.useState({}), Dt = s != null, Ot = w.useMemo(() => {
|
|
376
|
+
if (!Dt) return Tt;
|
|
372
377
|
let e = {};
|
|
373
378
|
for (let t of s ?? []) e[t] = !0;
|
|
374
379
|
return e;
|
|
375
380
|
}, [
|
|
376
|
-
|
|
381
|
+
Dt,
|
|
377
382
|
s,
|
|
378
|
-
|
|
379
|
-
]),
|
|
380
|
-
let t = typeof e == "function" ? e(
|
|
381
|
-
|
|
383
|
+
Tt
|
|
384
|
+
]), kt = w.useCallback((e) => {
|
|
385
|
+
let t = typeof e == "function" ? e(Ot) : e;
|
|
386
|
+
Dt || Et(t), c?.(Object.keys(t).filter((e) => t[e]));
|
|
382
387
|
}, [
|
|
383
|
-
|
|
384
|
-
|
|
388
|
+
Ot,
|
|
389
|
+
Dt,
|
|
385
390
|
c
|
|
386
391
|
]);
|
|
387
392
|
process.env.NODE_ENV !== "production" && a && !o && console.warn("ProDataTable: `selectable` without `getRowId` keys selection by row index — selection will not survive sort/filter/paging. Pass `getRowId`.");
|
|
388
393
|
let X = w.useMemo(() => {
|
|
389
394
|
let e = [
|
|
390
|
-
...a ? [
|
|
395
|
+
...a ? [Be(d)] : [],
|
|
391
396
|
...r,
|
|
392
|
-
...u ? [
|
|
397
|
+
...u ? [Ve(u, d)] : []
|
|
393
398
|
];
|
|
394
|
-
return !
|
|
399
|
+
return !_ && !J ? e : e.map((e) => {
|
|
395
400
|
let t = e.meta ?? {}, n = e;
|
|
396
|
-
return
|
|
401
|
+
return _ && (n = {
|
|
397
402
|
...n,
|
|
398
403
|
size: D(e),
|
|
399
|
-
minSize:
|
|
404
|
+
minSize: Te(t),
|
|
400
405
|
enableResizing: t.enableResizing !== !1
|
|
401
406
|
}), J && t.filter && n.filterFn == null && (n = {
|
|
402
407
|
...n,
|
|
403
408
|
enableColumnFilter: !0,
|
|
404
|
-
filterFn: t.filter.type === "single" ?
|
|
409
|
+
filterFn: t.filter.type === "single" ? Ct : St
|
|
405
410
|
}), n;
|
|
406
411
|
});
|
|
407
412
|
}, [
|
|
@@ -409,18 +414,18 @@ function N(t) {
|
|
|
409
414
|
a,
|
|
410
415
|
u,
|
|
411
416
|
d,
|
|
412
|
-
|
|
417
|
+
_,
|
|
413
418
|
J,
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
]),
|
|
417
|
-
let e =
|
|
419
|
+
Ct,
|
|
420
|
+
St
|
|
421
|
+
]), At = w.useRef(null), [jt, Mt] = w.useState(!1), Z = w.useCallback(() => {
|
|
422
|
+
let e = At.current;
|
|
418
423
|
if (!e) return;
|
|
419
424
|
let t = e.scrollWidth - e.clientWidth;
|
|
420
|
-
|
|
425
|
+
Mt(e.scrollLeft < t - 1);
|
|
421
426
|
}, []);
|
|
422
427
|
w.useEffect(() => {
|
|
423
|
-
let e =
|
|
428
|
+
let e = At.current;
|
|
424
429
|
if (!e) return;
|
|
425
430
|
Z(), e.addEventListener("scroll", Z, { passive: !0 });
|
|
426
431
|
let t = 0, n = new ResizeObserver(() => {
|
|
@@ -432,7 +437,7 @@ function N(t) {
|
|
|
432
437
|
}, [Z]), w.useEffect(() => {
|
|
433
438
|
Z();
|
|
434
439
|
}, [Y, Z]);
|
|
435
|
-
let
|
|
440
|
+
let Nt = w.useMemo(() => {
|
|
436
441
|
if (!U || U.onChange) return i;
|
|
437
442
|
let e = W.trim().toLowerCase();
|
|
438
443
|
if (!e) return i;
|
|
@@ -442,38 +447,54 @@ function N(t) {
|
|
|
442
447
|
i,
|
|
443
448
|
W,
|
|
444
449
|
U
|
|
445
|
-
]), Q =
|
|
446
|
-
data:
|
|
450
|
+
]), Q = ce({
|
|
451
|
+
data: Nt,
|
|
447
452
|
columns: X,
|
|
448
453
|
state: {
|
|
449
|
-
sorting:
|
|
450
|
-
pagination:
|
|
451
|
-
...
|
|
452
|
-
...J ? { columnFilters:
|
|
453
|
-
...a ? { rowSelection:
|
|
454
|
+
sorting: st,
|
|
455
|
+
pagination: dt,
|
|
456
|
+
..._ ? { columnSizing: Y } : {},
|
|
457
|
+
...J ? { columnFilters: bt } : {},
|
|
458
|
+
...a ? { rowSelection: Ot } : {}
|
|
454
459
|
},
|
|
455
460
|
getRowId: o ? (e) => o(e) : void 0,
|
|
456
461
|
enableRowSelection: a ? l ? (e) => l(e.original) : !0 : !1,
|
|
457
|
-
onRowSelectionChange: a ?
|
|
458
|
-
onSortingChange:
|
|
459
|
-
onPaginationChange:
|
|
460
|
-
onColumnFiltersChange: J ?
|
|
461
|
-
getFilteredRowModel: J && !k ?
|
|
462
|
+
onRowSelectionChange: a ? kt : void 0,
|
|
463
|
+
onSortingChange: ct,
|
|
464
|
+
onPaginationChange: ft,
|
|
465
|
+
onColumnFiltersChange: J ? xt : void 0,
|
|
466
|
+
getFilteredRowModel: J && !k ? ie() : void 0,
|
|
462
467
|
manualFiltering: k || void 0,
|
|
463
|
-
onColumnSizingChange:
|
|
464
|
-
enableColumnResizing:
|
|
468
|
+
onColumnSizingChange: _ ? wt : void 0,
|
|
469
|
+
enableColumnResizing: _,
|
|
465
470
|
columnResizeMode: "onChange",
|
|
466
471
|
manualSorting: C,
|
|
467
|
-
manualPagination:
|
|
468
|
-
...
|
|
469
|
-
getCoreRowModel:
|
|
470
|
-
getSortedRowModel: C ? void 0 :
|
|
471
|
-
getPaginationRowModel: V ||
|
|
472
|
-
}), $ = Q.getRowModel();
|
|
472
|
+
manualPagination: x,
|
|
473
|
+
...x ? { rowCount: S ?? Nt.length } : {},
|
|
474
|
+
getCoreRowModel: re(),
|
|
475
|
+
getSortedRowModel: C ? void 0 : oe(),
|
|
476
|
+
getPaginationRowModel: V || x ? void 0 : ae()
|
|
477
|
+
}), $ = Q.getRowModel(), Pt = /* @__PURE__ */ new Map();
|
|
478
|
+
for (let e of Q.getAllLeafColumns()) {
|
|
479
|
+
let t = e.columnDef.meta?.heatmap;
|
|
480
|
+
if (!t) continue;
|
|
481
|
+
if (t.domain !== "filteredRows") {
|
|
482
|
+
Pt.set(e.id, t.domain);
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
if (x) throw Error(`Table: heatmap column "${e.id}" needs an explicit domain under manual pagination.`);
|
|
486
|
+
let n = Q.getPrePaginationRowModel().rows.map((t) => t.getValue(e.id));
|
|
487
|
+
Pt.set(e.id, ve(n.filter((e) => typeof e == "number")));
|
|
488
|
+
}
|
|
489
|
+
let Ft = (e, t, n) => {
|
|
490
|
+
if (!e.heatmap || typeof t != "number") return;
|
|
491
|
+
let r = Pt.get(n);
|
|
492
|
+
return r ? _e(t, r) : void 0;
|
|
493
|
+
};
|
|
473
494
|
w.useEffect(() => {
|
|
474
|
-
if (!I || q ||
|
|
495
|
+
if (!I || q || ht.current) return;
|
|
475
496
|
let e = L !== void 0, t = e ? [...L] : [...new Set(i.map((e) => I(e)))];
|
|
476
|
-
t.length === 0 && !e || (
|
|
497
|
+
t.length === 0 && !e || (ht.current = !0, mt(We({
|
|
477
498
|
defaultExpandedGroups: B,
|
|
478
499
|
groupKeys: t
|
|
479
500
|
})));
|
|
@@ -484,20 +505,20 @@ function N(t) {
|
|
|
484
505
|
i,
|
|
485
506
|
B
|
|
486
507
|
]);
|
|
487
|
-
let
|
|
508
|
+
let It = w.useCallback((e) => !R || K || !q && !ht.current && B === "all" ? !0 : (q ? z : G).has(e), [
|
|
488
509
|
R,
|
|
489
510
|
K,
|
|
490
511
|
q,
|
|
491
512
|
z,
|
|
492
513
|
G,
|
|
493
514
|
B
|
|
494
|
-
]),
|
|
515
|
+
]), Lt = w.useMemo(() => {
|
|
495
516
|
if (!I) return null;
|
|
496
517
|
let e = !K && L && L.length > 0 ? L : void 0;
|
|
497
|
-
return
|
|
518
|
+
return Ue({
|
|
498
519
|
rows: $.rows,
|
|
499
520
|
groupBy: I,
|
|
500
|
-
isGroupExpanded:
|
|
521
|
+
isGroupExpanded: It,
|
|
501
522
|
groupKeys: e
|
|
502
523
|
});
|
|
503
524
|
}, [
|
|
@@ -505,30 +526,30 @@ function N(t) {
|
|
|
505
526
|
L,
|
|
506
527
|
K,
|
|
507
528
|
$.rows,
|
|
508
|
-
|
|
509
|
-
]),
|
|
529
|
+
It
|
|
530
|
+
]), Rt = X.length + +!!_, zt = F === "list" ? "top-0" : "top-10";
|
|
510
531
|
w.useEffect(() => {
|
|
511
|
-
!J ||
|
|
532
|
+
!J || x || V || ut((e) => e.pageIndex === 0 ? e : {
|
|
512
533
|
...e,
|
|
513
534
|
pageIndex: 0
|
|
514
535
|
});
|
|
515
536
|
}, [
|
|
516
|
-
|
|
537
|
+
bt,
|
|
517
538
|
J,
|
|
518
|
-
|
|
539
|
+
x,
|
|
519
540
|
V
|
|
520
541
|
]);
|
|
521
|
-
let
|
|
522
|
-
|
|
523
|
-
|
|
542
|
+
let Bt = _ ? Q.getState().columnSizingInfo.isResizingColumn : null, Vt = w.useRef(!1), Ht = w.useRef(null), Ut = w.useCallback(() => {
|
|
543
|
+
Vt.current = !0, Ht.current != null && window.clearTimeout(Ht.current), Ht.current = window.setTimeout(() => {
|
|
544
|
+
Vt.current = !1, Ht.current = null;
|
|
524
545
|
}, 0);
|
|
525
|
-
}, []),
|
|
526
|
-
if (
|
|
527
|
-
}, [
|
|
528
|
-
if (!
|
|
546
|
+
}, []), Wt = w.useCallback((e, t, n) => {
|
|
547
|
+
if (_ && !(t.grow && !n && Y[e.id] == null)) return e.getSize();
|
|
548
|
+
}, [_, Y]), Gt = w.useCallback((e) => {
|
|
549
|
+
if (!_) return D(e);
|
|
529
550
|
let t = A(e), n = Y[t];
|
|
530
551
|
return typeof n == "number" && n > 0 ? n : D(e);
|
|
531
|
-
}, [
|
|
552
|
+
}, [_, Y]), Kt = w.useMemo(() => Ne(X, Gt), [X, Gt]), qt = w.useMemo(() => {
|
|
532
553
|
let e = /* @__PURE__ */ new Map();
|
|
533
554
|
if (!J) return e;
|
|
534
555
|
for (let t of r) {
|
|
@@ -540,7 +561,7 @@ function N(t) {
|
|
|
540
561
|
}
|
|
541
562
|
let r = /* @__PURE__ */ new Set();
|
|
542
563
|
i.forEach((e, n) => {
|
|
543
|
-
let i =
|
|
564
|
+
let i = xe(we(t, e, n));
|
|
544
565
|
i !== "" && r.add(i);
|
|
545
566
|
});
|
|
546
567
|
let a = Array.from(r).sort((e, t) => e.localeCompare(t)).map((e) => ({
|
|
@@ -555,15 +576,15 @@ function N(t) {
|
|
|
555
576
|
i,
|
|
556
577
|
J,
|
|
557
578
|
k
|
|
558
|
-
]),
|
|
579
|
+
]), Jt = w.useMemo(() => {
|
|
559
580
|
if (!J) return [];
|
|
560
|
-
let e = new Map(
|
|
581
|
+
let e = new Map(bt.map((e) => [e.id, e.value])), t = [];
|
|
561
582
|
for (let n of r) {
|
|
562
583
|
let r = (n.meta ?? {}).filter;
|
|
563
584
|
if (!r) continue;
|
|
564
585
|
let i = A(n), a = Q.getColumn(i);
|
|
565
586
|
if (!a) continue;
|
|
566
|
-
let o = r.options ??
|
|
587
|
+
let o = r.options ?? qt.get(i) ?? [], s = r.label ?? (typeof n.header == "string" ? n.header : i), c = r.searchPlaceholder;
|
|
567
588
|
if (r.type === "single") {
|
|
568
589
|
let n = e.get(i);
|
|
569
590
|
t.push({
|
|
@@ -574,7 +595,7 @@ function N(t) {
|
|
|
574
595
|
options: o,
|
|
575
596
|
defaultValue: r.defaultValue,
|
|
576
597
|
value: n ?? r.defaultValue ?? null,
|
|
577
|
-
onChange: (e) => a.setFilterValue(
|
|
598
|
+
onChange: (e) => a.setFilterValue(Ce(e, r.defaultValue))
|
|
578
599
|
});
|
|
579
600
|
} else t.push({
|
|
580
601
|
type: "multi",
|
|
@@ -590,131 +611,131 @@ function N(t) {
|
|
|
590
611
|
}, [
|
|
591
612
|
r,
|
|
592
613
|
Q,
|
|
593
|
-
|
|
614
|
+
qt,
|
|
594
615
|
J,
|
|
595
|
-
|
|
596
|
-
]),
|
|
616
|
+
bt
|
|
617
|
+
]), Yt = !!(U || p || ee || m || Jt.length > 0), Xt = P == null ? void 0 : typeof P == "number" ? `${P}px` : P, Zt = w.useMemo(() => {
|
|
597
618
|
if (N != null) return N;
|
|
598
619
|
let e = 0;
|
|
599
|
-
for (let t of X) e +=
|
|
620
|
+
for (let t of X) e += _ ? Gt(t) : (t.meta ?? {}).minWidth ?? (t.meta ?? {}).width ?? be;
|
|
600
621
|
return e;
|
|
601
622
|
}, [
|
|
602
623
|
X,
|
|
603
624
|
N,
|
|
604
|
-
|
|
605
|
-
|
|
625
|
+
_,
|
|
626
|
+
Gt
|
|
606
627
|
]);
|
|
607
628
|
return /* @__PURE__ */ E("div", {
|
|
608
629
|
"data-slot": "table",
|
|
609
|
-
className: e(
|
|
610
|
-
style:
|
|
630
|
+
className: e(nt, "flex flex-col min-h-0 bg-card", P == null && "flex-1 h-full", $e && "rounded-surface border border-border overflow-hidden"),
|
|
631
|
+
style: Xt == null ? void 0 : { height: Xt },
|
|
611
632
|
children: [
|
|
612
|
-
|
|
633
|
+
Yt && /* @__PURE__ */ T("div", {
|
|
613
634
|
className: "shrink-0 border-b border-border",
|
|
614
|
-
children: /* @__PURE__ */ E(
|
|
635
|
+
children: /* @__PURE__ */ E(Xe, { children: [
|
|
615
636
|
U && /* @__PURE__ */ T(n, {
|
|
616
637
|
containerClassName: "shrink-0",
|
|
617
638
|
style: { width: U.width ?? 240 },
|
|
618
639
|
value: W,
|
|
619
|
-
onChange: (e) =>
|
|
640
|
+
onChange: (e) => pt(e.currentTarget.value),
|
|
620
641
|
placeholder: U.placeholder ?? "Search",
|
|
621
642
|
className: "h-8 text-body"
|
|
622
643
|
}),
|
|
623
|
-
|
|
624
|
-
facets:
|
|
644
|
+
Jt.length > 0 && /* @__PURE__ */ E(ye, { children: [/* @__PURE__ */ T(he, {
|
|
645
|
+
facets: Jt,
|
|
625
646
|
align: "start",
|
|
626
647
|
onClearAll: () => Q.resetColumnFilters()
|
|
627
|
-
}),
|
|
628
|
-
p && /* @__PURE__ */ T(
|
|
629
|
-
|
|
630
|
-
|
|
648
|
+
}), Jt.filter(Qe).map((e) => /* @__PURE__ */ T(et, { facet: e }, e.key))] }),
|
|
649
|
+
p && /* @__PURE__ */ T(Ze, { filters: p }),
|
|
650
|
+
ee,
|
|
651
|
+
m && /* @__PURE__ */ T("div", {
|
|
631
652
|
className: "ml-auto flex items-center gap-2",
|
|
632
|
-
children:
|
|
653
|
+
children: m
|
|
633
654
|
})
|
|
634
655
|
] })
|
|
635
656
|
}),
|
|
636
657
|
/* @__PURE__ */ E("div", {
|
|
637
658
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
638
659
|
children: [/* @__PURE__ */ T("div", {
|
|
639
|
-
ref:
|
|
640
|
-
className: e("flex-1 min-h-0 overflow-auto",
|
|
660
|
+
ref: At,
|
|
661
|
+
className: e("flex-1 min-h-0 overflow-auto", Me),
|
|
641
662
|
children: /* @__PURE__ */ E("table", {
|
|
642
|
-
"aria-label":
|
|
663
|
+
"aria-label": tt,
|
|
643
664
|
className: "caption-bottom w-full text-cell",
|
|
644
665
|
style: {
|
|
645
666
|
tableLayout: "fixed",
|
|
646
|
-
minWidth:
|
|
667
|
+
minWidth: Zt
|
|
647
668
|
},
|
|
648
|
-
children: [F !== "list" && /* @__PURE__ */ T(
|
|
669
|
+
children: [F !== "list" && /* @__PURE__ */ T(de, {
|
|
649
670
|
className: "sticky top-0 z-[2]",
|
|
650
|
-
children: Q.getHeaderGroups().map((t) => /* @__PURE__ */ E(
|
|
671
|
+
children: Q.getHeaderGroups().map((t) => /* @__PURE__ */ E(b, {
|
|
651
672
|
className: "border-b-0 bg-surface hover:bg-surface",
|
|
652
673
|
children: [t.headers.map((t) => {
|
|
653
|
-
let n = t.column.columnDef.meta ?? {}, r = n.align ?? "left", i = t.column.getCanSort(), a = t.column.getIsSorted(), o =
|
|
654
|
-
return /* @__PURE__ */ E(
|
|
674
|
+
let n = t.column.columnDef.meta ?? {}, r = n.align ?? "left", i = t.column.getCanSort(), a = t.column.getIsSorted(), o = Kt.get(t.column.id), s = _ && t.column.getCanResize(), c = Bt === t.column.id;
|
|
675
|
+
return /* @__PURE__ */ E(ue, {
|
|
655
676
|
onClick: i ? (e) => {
|
|
656
|
-
if (
|
|
657
|
-
|
|
677
|
+
if (Bt || Vt.current) {
|
|
678
|
+
Vt.current = !1;
|
|
658
679
|
return;
|
|
659
680
|
}
|
|
660
681
|
t.column.getToggleSortingHandler()?.(e);
|
|
661
682
|
} : void 0,
|
|
662
|
-
className: e(
|
|
683
|
+
className: e(_ && "relative select-none", "min-h-10 py-2 px-3 text-eyebrow text-muted-foreground align-middle", "first:pl-4 last:pr-4", r === "right" && "text-right", r === "center" && "text-center", i && "cursor-pointer select-none hover:text-foreground", o && ["sticky z-[3]", ke], o && s && "hover:z-[4]", o && s && c && "z-[4]", o?.isEdge && je, n.headerMono && "font-mono", n.headerClassName),
|
|
663
684
|
style: {
|
|
664
|
-
...
|
|
685
|
+
...Pe(n, !!o, Wt(t.column, n, !!o)),
|
|
665
686
|
...o ? o.side === "left" ? { left: `${o.offset}px` } : { right: `${o.offset}px` } : null,
|
|
666
|
-
boxShadow: [o?.isEdge && o.side === "left" ? "8px 0 12px -6px rgba(9, 10, 12, 0.14)" : null, o?.isEdge && o.side === "right" &&
|
|
687
|
+
boxShadow: [o?.isEdge && o.side === "left" ? "8px 0 12px -6px rgba(9, 10, 12, 0.14)" : null, o?.isEdge && o.side === "right" && jt ? "-8px 0 12px -6px rgba(9, 10, 12, 0.14)" : null].filter(Boolean).join(", ")
|
|
667
688
|
},
|
|
668
689
|
children: [/* @__PURE__ */ E("span", {
|
|
669
690
|
className: e("flex w-full items-center gap-inline", r === "right" && "justify-end", r === "center" && "justify-center"),
|
|
670
|
-
children: [typeof t.column.columnDef.header == "string" ? /* @__PURE__ */ T(
|
|
691
|
+
children: [typeof t.column.columnDef.header == "string" ? /* @__PURE__ */ T(qe, {
|
|
671
692
|
label: t.column.columnDef.header,
|
|
672
693
|
align: r
|
|
673
694
|
}) : /* @__PURE__ */ T("span", {
|
|
674
695
|
className: e("min-w-0 line-clamp-2", r === "right" && "text-right", r === "center" && "text-center"),
|
|
675
|
-
children:
|
|
696
|
+
children: se(t.column.columnDef.header, t.getContext())
|
|
676
697
|
}), i && !n.hideSortIndicator && /* @__PURE__ */ T("span", {
|
|
677
698
|
className: "shrink-0",
|
|
678
|
-
children: /* @__PURE__ */ T(
|
|
699
|
+
children: /* @__PURE__ */ T(Je, { direction: a })
|
|
679
700
|
})]
|
|
680
|
-
}), s && /* @__PURE__ */ T(
|
|
701
|
+
}), s && /* @__PURE__ */ T(Ke, {
|
|
681
702
|
header: t,
|
|
682
703
|
isResizing: c,
|
|
683
|
-
armSuppressSortClick:
|
|
704
|
+
armSuppressSortClick: Ut
|
|
684
705
|
})]
|
|
685
706
|
}, t.id);
|
|
686
|
-
}),
|
|
707
|
+
}), _ && /* @__PURE__ */ T(ue, {
|
|
687
708
|
"aria-hidden": !0,
|
|
688
709
|
className: "p-0",
|
|
689
710
|
style: { minWidth: 0 }
|
|
690
711
|
})]
|
|
691
712
|
}, t.id))
|
|
692
|
-
}), /* @__PURE__ */ E(
|
|
713
|
+
}), /* @__PURE__ */ E(le, { children: [Lt ? Lt.map((t) => {
|
|
693
714
|
if (t.kind === "header") {
|
|
694
|
-
let n =
|
|
715
|
+
let n = It(t.groupKey), r = rt ? rt({
|
|
695
716
|
groupKey: t.groupKey,
|
|
696
717
|
rows: t.rows.map((e) => e.original),
|
|
697
718
|
expanded: n,
|
|
698
|
-
toggle: () =>
|
|
719
|
+
toggle: () => _t(t.groupKey)
|
|
699
720
|
}) : /* @__PURE__ */ T("div", {
|
|
700
721
|
className: "px-default py-compact text-body font-medium",
|
|
701
722
|
children: t.groupKey
|
|
702
723
|
});
|
|
703
|
-
return /* @__PURE__ */ T(
|
|
724
|
+
return /* @__PURE__ */ T(b, {
|
|
704
725
|
"data-slot": "table-group-header",
|
|
705
726
|
"data-group-key": t.groupKey,
|
|
706
727
|
"data-expanded": n ? "true" : "false",
|
|
707
|
-
className: e("group sticky z-[1] border-b-0 bg-muted", R ? "hover:bg-accent" : "hover:bg-muted",
|
|
708
|
-
children: /* @__PURE__ */ T(
|
|
709
|
-
colSpan:
|
|
728
|
+
className: e("group sticky z-[1] border-b-0 bg-muted", R ? "hover:bg-accent" : "hover:bg-muted", zt),
|
|
729
|
+
children: /* @__PURE__ */ T(y, {
|
|
730
|
+
colSpan: Rt,
|
|
710
731
|
className: "p-0 align-middle",
|
|
711
732
|
style: { boxShadow: "inset 0 -1px 0 var(--color-border)" },
|
|
712
733
|
children: r
|
|
713
734
|
})
|
|
714
735
|
}, `group:${t.groupKey}`);
|
|
715
736
|
}
|
|
716
|
-
let n = t.row, r = t.isLastVisible, i =
|
|
717
|
-
return /* @__PURE__ */ E(
|
|
737
|
+
let n = t.row, r = t.isLastVisible, i = Re?.(n.original);
|
|
738
|
+
return /* @__PURE__ */ E(b, {
|
|
718
739
|
onClick: M || i ? (e) => {
|
|
719
740
|
if (i && (e.metaKey || e.ctrlKey || e.shiftKey)) {
|
|
720
741
|
e.preventDefault(), window.open(i, "_blank", "noopener,noreferrer");
|
|
@@ -725,24 +746,25 @@ function N(t) {
|
|
|
725
746
|
onAuxClick: i ? (e) => {
|
|
726
747
|
e.button === 1 && (e.preventDefault(), window.open(i, "_blank", "noopener,noreferrer"));
|
|
727
748
|
} : void 0,
|
|
728
|
-
className: e("group border-b-0 hover:bg-surface-hover transition-none", (M || i) && "cursor-pointer",
|
|
749
|
+
className: e("group border-b-0 hover:bg-surface-hover transition-none", (M || i) && "cursor-pointer", ze?.(n)),
|
|
729
750
|
children: [n.getVisibleCells().map((t) => {
|
|
730
|
-
let n = t.column.columnDef.meta ?? {}, i = n.align ?? "left", a =
|
|
731
|
-
return /* @__PURE__ */ T(
|
|
732
|
-
...
|
|
733
|
-
className: e("py-default px-3 align-middle text-cell text-foreground overflow-hidden first:pl-4 last:pr-4", i === "right" && "text-right", i === "center" && "text-center", a && ["sticky z-[1] bg-card",
|
|
751
|
+
let n = t.column.columnDef.meta ?? {}, i = n.align ?? "left", a = Kt.get(t.column.id);
|
|
752
|
+
return /* @__PURE__ */ T(y, {
|
|
753
|
+
...Oe(n),
|
|
754
|
+
className: e("py-default px-3 align-middle text-cell text-foreground overflow-hidden first:pl-4 last:pr-4", i === "right" && "text-right", i === "center" && "text-center", a && ["sticky z-[1] bg-card", Ae], a?.isEdge && je, n.cellClassName),
|
|
734
755
|
style: {
|
|
735
|
-
...
|
|
756
|
+
...Ft(n, t.getValue(), t.column.id),
|
|
757
|
+
...Pe(n, !!a, Wt(t.column, n, !!a)),
|
|
736
758
|
...a ? a.side === "left" ? { left: `${a.offset}px` } : { right: `${a.offset}px` } : null,
|
|
737
759
|
boxShadow: [
|
|
738
760
|
r ? null : "inset 0 -1px 0 var(--color-border)",
|
|
739
761
|
a?.isEdge && a.side === "left" ? "8px 0 12px -6px rgba(9, 10, 12, 0.14)" : null,
|
|
740
|
-
a?.isEdge && a.side === "right" &&
|
|
762
|
+
a?.isEdge && a.side === "right" && jt ? "-8px 0 12px -6px rgba(9, 10, 12, 0.14)" : null
|
|
741
763
|
].filter(Boolean).join(", ") || void 0
|
|
742
764
|
},
|
|
743
|
-
children:
|
|
765
|
+
children: se(t.column.columnDef.cell, t.getContext())
|
|
744
766
|
}, t.id);
|
|
745
|
-
}),
|
|
767
|
+
}), _ && /* @__PURE__ */ T(y, {
|
|
746
768
|
"aria-hidden": !0,
|
|
747
769
|
className: "p-0",
|
|
748
770
|
style: {
|
|
@@ -752,8 +774,8 @@ function N(t) {
|
|
|
752
774
|
})]
|
|
753
775
|
}, n.id);
|
|
754
776
|
}) : $.rows.map((t, n) => {
|
|
755
|
-
let r = n === $.rows.length - 1, i =
|
|
756
|
-
return /* @__PURE__ */ E(
|
|
777
|
+
let r = n === $.rows.length - 1, i = Re?.(t.original);
|
|
778
|
+
return /* @__PURE__ */ E(b, {
|
|
757
779
|
onClick: M || i ? (e) => {
|
|
758
780
|
if (i && (e.metaKey || e.ctrlKey || e.shiftKey)) {
|
|
759
781
|
e.preventDefault(), window.open(i, "_blank", "noopener,noreferrer");
|
|
@@ -764,24 +786,25 @@ function N(t) {
|
|
|
764
786
|
onAuxClick: i ? (e) => {
|
|
765
787
|
e.button === 1 && (e.preventDefault(), window.open(i, "_blank", "noopener,noreferrer"));
|
|
766
788
|
} : void 0,
|
|
767
|
-
className: e("group border-b-0 hover:bg-surface-hover transition-none", (M || i) && "cursor-pointer",
|
|
789
|
+
className: e("group border-b-0 hover:bg-surface-hover transition-none", (M || i) && "cursor-pointer", ze?.(t)),
|
|
768
790
|
children: [t.getVisibleCells().map((t) => {
|
|
769
|
-
let n = t.column.columnDef.meta ?? {}, i = n.align ?? "left", a =
|
|
770
|
-
return /* @__PURE__ */ T(
|
|
771
|
-
...
|
|
772
|
-
className: e("py-default px-3 align-middle text-cell text-foreground overflow-hidden first:pl-4 last:pr-4", i === "right" && "text-right", i === "center" && "text-center", a && ["sticky z-[1] bg-card",
|
|
791
|
+
let n = t.column.columnDef.meta ?? {}, i = n.align ?? "left", a = Kt.get(t.column.id);
|
|
792
|
+
return /* @__PURE__ */ T(y, {
|
|
793
|
+
...Oe(n),
|
|
794
|
+
className: e("py-default px-3 align-middle text-cell text-foreground overflow-hidden first:pl-4 last:pr-4", i === "right" && "text-right", i === "center" && "text-center", a && ["sticky z-[1] bg-card", Ae], a?.isEdge && je, n.cellClassName),
|
|
773
795
|
style: {
|
|
774
|
-
...
|
|
796
|
+
...Ft(n, t.getValue(), t.column.id),
|
|
797
|
+
...Pe(n, !!a, Wt(t.column, n, !!a)),
|
|
775
798
|
...a ? a.side === "left" ? { left: `${a.offset}px` } : { right: `${a.offset}px` } : null,
|
|
776
799
|
boxShadow: [
|
|
777
800
|
r ? null : "inset 0 -1px 0 var(--color-border)",
|
|
778
801
|
a?.isEdge && a.side === "left" ? "8px 0 12px -6px rgba(9, 10, 12, 0.14)" : null,
|
|
779
|
-
a?.isEdge && a.side === "right" &&
|
|
802
|
+
a?.isEdge && a.side === "right" && jt ? "-8px 0 12px -6px rgba(9, 10, 12, 0.14)" : null
|
|
780
803
|
].filter(Boolean).join(", ") || void 0
|
|
781
804
|
},
|
|
782
|
-
children:
|
|
805
|
+
children: se(t.column.columnDef.cell, t.getContext())
|
|
783
806
|
}, t.id);
|
|
784
|
-
}),
|
|
807
|
+
}), _ && /* @__PURE__ */ T(y, {
|
|
785
808
|
"aria-hidden": !0,
|
|
786
809
|
className: "p-0",
|
|
787
810
|
style: {
|
|
@@ -790,36 +813,36 @@ function N(t) {
|
|
|
790
813
|
}
|
|
791
814
|
})]
|
|
792
815
|
}, t.id);
|
|
793
|
-
}), $.rows.length === 0 && !(
|
|
816
|
+
}), $.rows.length === 0 && !(Lt && Lt.length > 0) && /* @__PURE__ */ T(b, {
|
|
794
817
|
className: "hover:bg-transparent",
|
|
795
|
-
children: /* @__PURE__ */ T(
|
|
796
|
-
colSpan:
|
|
818
|
+
children: /* @__PURE__ */ T(y, {
|
|
819
|
+
colSpan: Rt,
|
|
797
820
|
className: "h-24 px-4 text-center text-cell text-muted-foreground",
|
|
798
|
-
children:
|
|
821
|
+
children: Le
|
|
799
822
|
})
|
|
800
823
|
})] })]
|
|
801
824
|
})
|
|
802
|
-
}),
|
|
825
|
+
}), Ie && /* @__PURE__ */ T("div", {
|
|
803
826
|
"aria-hidden": !0,
|
|
804
827
|
className: "absolute inset-0 z-[5] flex items-center justify-center bg-card/70",
|
|
805
|
-
children: /* @__PURE__ */ T(
|
|
828
|
+
children: /* @__PURE__ */ T(ne, { size: "sm" })
|
|
806
829
|
})]
|
|
807
830
|
}),
|
|
808
|
-
|
|
831
|
+
h && /* @__PURE__ */ T("div", {
|
|
809
832
|
className: "shrink-0",
|
|
810
|
-
children:
|
|
833
|
+
children: h
|
|
811
834
|
}),
|
|
812
|
-
!V && !
|
|
835
|
+
!V && !h && (x ? (S ?? 0) > dt.pageSize : i.length > dt.pageSize) && /* @__PURE__ */ T("div", {
|
|
813
836
|
className: "shrink-0",
|
|
814
|
-
children: /* @__PURE__ */ T(
|
|
837
|
+
children: /* @__PURE__ */ T(Ye, {
|
|
815
838
|
table: Q,
|
|
816
|
-
total:
|
|
839
|
+
total: x ? S ?? 0 : void 0
|
|
817
840
|
})
|
|
818
841
|
})
|
|
819
842
|
]
|
|
820
843
|
});
|
|
821
844
|
}
|
|
822
|
-
function
|
|
845
|
+
function Ke({ header: t, isResizing: n, armSuppressSortClick: r }) {
|
|
823
846
|
let i = t.getResizeHandler();
|
|
824
847
|
return /* @__PURE__ */ T("div", {
|
|
825
848
|
"aria-hidden": !0,
|
|
@@ -857,7 +880,7 @@ function We({ header: t, isResizing: n, armSuppressSortClick: r }) {
|
|
|
857
880
|
})
|
|
858
881
|
});
|
|
859
882
|
}
|
|
860
|
-
function
|
|
883
|
+
function qe({ label: t, align: n }) {
|
|
861
884
|
let c = w.useRef(null), [l, u] = w.useState(!1);
|
|
862
885
|
return w.useEffect(() => {
|
|
863
886
|
let e = c.current;
|
|
@@ -885,19 +908,19 @@ function Ge({ label: t, align: n }) {
|
|
|
885
908
|
})
|
|
886
909
|
});
|
|
887
910
|
}
|
|
888
|
-
function
|
|
911
|
+
function Je({ direction: e }) {
|
|
889
912
|
return e === "asc" ? /* @__PURE__ */ T(f, {
|
|
890
913
|
strokeWidth: 2,
|
|
891
914
|
className: "size-icon-sm text-foreground"
|
|
892
915
|
}) : e === "desc" ? /* @__PURE__ */ T(l, {
|
|
893
916
|
strokeWidth: 2,
|
|
894
917
|
className: "size-icon-sm text-foreground"
|
|
895
|
-
}) : /* @__PURE__ */ T(
|
|
918
|
+
}) : /* @__PURE__ */ T(ee, {
|
|
896
919
|
strokeWidth: 1.6,
|
|
897
920
|
className: "size-icon-sm text-muted-foreground"
|
|
898
921
|
});
|
|
899
922
|
}
|
|
900
|
-
function
|
|
923
|
+
function Ye({ table: n, className: r, totalLabel: i, total: a }) {
|
|
901
924
|
let o = a ?? n.getFilteredRowModel().rows.length, { pageIndex: s, pageSize: c } = n.getState().pagination, l = o === 0 ? 0 : s * c + 1, f = Math.min((s + 1) * c, o);
|
|
902
925
|
return /* @__PURE__ */ E("div", {
|
|
903
926
|
className: e("flex items-center gap-2 border-t border-border bg-surface px-4 py-compact text-caption text-muted-foreground", r),
|
|
@@ -937,13 +960,13 @@ function qe({ table: n, className: r, totalLabel: i, total: a }) {
|
|
|
937
960
|
]
|
|
938
961
|
});
|
|
939
962
|
}
|
|
940
|
-
function
|
|
963
|
+
function Xe({ className: t, children: n }) {
|
|
941
964
|
return /* @__PURE__ */ T("div", {
|
|
942
965
|
className: e("flex flex-wrap items-center gap-2 px-4 py-2", t),
|
|
943
966
|
children: n
|
|
944
967
|
});
|
|
945
968
|
}
|
|
946
|
-
function
|
|
969
|
+
function Ze({ filters: t }) {
|
|
947
970
|
return /* @__PURE__ */ T("div", {
|
|
948
971
|
className: "flex items-center gap-inline",
|
|
949
972
|
role: "group",
|
|
@@ -957,20 +980,20 @@ function Ye({ filters: t }) {
|
|
|
957
980
|
}, n.id))
|
|
958
981
|
});
|
|
959
982
|
}
|
|
960
|
-
function
|
|
983
|
+
function Qe(e) {
|
|
961
984
|
return e.type === "multi" ? e.selected.length > 0 : e.value != null && e.value !== (e.defaultValue ?? null);
|
|
962
985
|
}
|
|
963
986
|
function P(e) {
|
|
964
987
|
let t = (t) => e.options.find((e) => e.value === t)?.label ?? t;
|
|
965
988
|
return e.type === "single" ? e.value == null ? "" : t(e.value) : e.selected.length === 1 ? t(e.selected[0]) : `${e.selected.length} selected`;
|
|
966
989
|
}
|
|
967
|
-
function
|
|
990
|
+
function $e(e) {
|
|
968
991
|
e.type === "multi" ? e.onChange([]) : e.onChange(e.defaultValue ?? null);
|
|
969
992
|
}
|
|
970
|
-
function
|
|
993
|
+
function et({ facet: e }) {
|
|
971
994
|
return /* @__PURE__ */ E("div", {
|
|
972
995
|
className: "inline-flex h-8 items-center rounded-sm border border-border bg-background text-control-sm",
|
|
973
|
-
children: [/* @__PURE__ */ E(
|
|
996
|
+
children: [/* @__PURE__ */ E(x, { children: [/* @__PURE__ */ T(pe, {
|
|
974
997
|
asChild: !0,
|
|
975
998
|
children: /* @__PURE__ */ E("button", {
|
|
976
999
|
type: "button",
|
|
@@ -983,7 +1006,7 @@ function Qe({ facet: e }) {
|
|
|
983
1006
|
children: P(e)
|
|
984
1007
|
})]
|
|
985
1008
|
})
|
|
986
|
-
}), /* @__PURE__ */ T(
|
|
1009
|
+
}), /* @__PURE__ */ T(S, {
|
|
987
1010
|
align: "start",
|
|
988
1011
|
className: "w-64 p-0",
|
|
989
1012
|
children: e.type === "multi" ? /* @__PURE__ */ T(me, {
|
|
@@ -1001,9 +1024,9 @@ function Qe({ facet: e }) {
|
|
|
1001
1024
|
})] }), /* @__PURE__ */ T("button", {
|
|
1002
1025
|
type: "button",
|
|
1003
1026
|
"aria-label": `Remove ${e.label} filter`,
|
|
1004
|
-
onClick: () =>
|
|
1027
|
+
onClick: () => $e(e),
|
|
1005
1028
|
className: "flex h-full items-center rounded-r-sm border-l border-border px-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-muted-foreground",
|
|
1006
|
-
children: /* @__PURE__ */ T(
|
|
1029
|
+
children: /* @__PURE__ */ T(m, { className: "size-icon-sm" })
|
|
1007
1030
|
})]
|
|
1008
1031
|
});
|
|
1009
1032
|
}
|
|
@@ -1044,7 +1067,7 @@ var F = {
|
|
|
1044
1067
|
bg: "bg-muted",
|
|
1045
1068
|
fg: "text-foreground"
|
|
1046
1069
|
}
|
|
1047
|
-
},
|
|
1070
|
+
}, tt = [
|
|
1048
1071
|
"identity-1",
|
|
1049
1072
|
"identity-2",
|
|
1050
1073
|
"identity-3",
|
|
@@ -1054,10 +1077,10 @@ var F = {
|
|
|
1054
1077
|
"identity-7",
|
|
1055
1078
|
"identity-8"
|
|
1056
1079
|
];
|
|
1057
|
-
function
|
|
1080
|
+
function nt(e) {
|
|
1058
1081
|
let t = 0;
|
|
1059
1082
|
for (let n = 0; n < e.length; n++) t = e.charCodeAt(n) + ((t << 5) - t);
|
|
1060
|
-
return
|
|
1083
|
+
return tt[Math.abs(t) % tt.length];
|
|
1061
1084
|
}
|
|
1062
1085
|
function I({ icon: t, initials: n, title: r, subtitle: i, tag: a, tint: o = "neutral", rightSlot: s, className: l }) {
|
|
1063
1086
|
let u = F[o] ?? F.neutral;
|
|
@@ -1157,7 +1180,7 @@ var L = {
|
|
|
1157
1180
|
dot: "bg-muted-foreground"
|
|
1158
1181
|
}
|
|
1159
1182
|
};
|
|
1160
|
-
function
|
|
1183
|
+
function rt({ tone: t, label: n, pulse: r, className: i }) {
|
|
1161
1184
|
let a = L[t] ?? L.neutral;
|
|
1162
1185
|
return /* @__PURE__ */ E("span", {
|
|
1163
1186
|
className: e("inline-flex items-center gap-1.5 px-2 py-0.5 rounded-badge text-badge", a.bg, a.fg, i),
|
|
@@ -1224,7 +1247,7 @@ function z({ values: t, width: n = 140, height: r = 40, scaleMax: i = 100, color
|
|
|
1224
1247
|
x: t.length === 1 ? c.left + l / 2 : c.left + n / (t.length - 1) * l,
|
|
1225
1248
|
y: c.top + u - r / i * u
|
|
1226
1249
|
};
|
|
1227
|
-
}), f = d.map((e, t) => `${t === 0 ? "M" : "L"} ${e.x} ${e.y}`).join(" "), p = c.top + u,
|
|
1250
|
+
}), f = d.map((e, t) => `${t === 0 ? "M" : "L"} ${e.x} ${e.y}`).join(" "), p = c.top + u, ee = `${f} L ${d[d.length - 1].x} ${p} L ${d[0].x} ${p} Z`, m = c.top + u / 2;
|
|
1228
1251
|
return /* @__PURE__ */ E("div", {
|
|
1229
1252
|
className: e("flex items-center gap-2 min-w-0", s),
|
|
1230
1253
|
children: [/* @__PURE__ */ E("svg", {
|
|
@@ -1243,15 +1266,15 @@ function z({ values: t, width: n = 140, height: r = 40, scaleMax: i = 100, color
|
|
|
1243
1266
|
}),
|
|
1244
1267
|
/* @__PURE__ */ T("line", {
|
|
1245
1268
|
x1: c.left,
|
|
1246
|
-
y1:
|
|
1269
|
+
y1: m,
|
|
1247
1270
|
x2: n - c.right,
|
|
1248
|
-
y2:
|
|
1271
|
+
y2: m,
|
|
1249
1272
|
className: "stroke-border",
|
|
1250
1273
|
strokeWidth: 1,
|
|
1251
1274
|
strokeDasharray: "3 3"
|
|
1252
1275
|
}),
|
|
1253
1276
|
/* @__PURE__ */ T("path", {
|
|
1254
|
-
d:
|
|
1277
|
+
d: ee,
|
|
1255
1278
|
fill: a,
|
|
1256
1279
|
fillOpacity: .14
|
|
1257
1280
|
}),
|
|
@@ -1285,7 +1308,7 @@ function B({ value: t, total: n, label: r, tone: i = "neutral", className: a })
|
|
|
1285
1308
|
})]
|
|
1286
1309
|
});
|
|
1287
1310
|
}
|
|
1288
|
-
function
|
|
1311
|
+
function it({ passed: t, warn: n = 0, failed: r = 0, className: i }) {
|
|
1289
1312
|
let a = Math.max(1, t + n + r);
|
|
1290
1313
|
return /* @__PURE__ */ E("div", {
|
|
1291
1314
|
className: e("flex items-center gap-1.5", i),
|
|
@@ -1345,7 +1368,7 @@ function U({ value: t, className: n, bands: r }) {
|
|
|
1345
1368
|
})]
|
|
1346
1369
|
});
|
|
1347
1370
|
}
|
|
1348
|
-
function
|
|
1371
|
+
function at({ value: t, dangerBelow: n = 90, className: r }) {
|
|
1349
1372
|
return t == null ? /* @__PURE__ */ T("span", {
|
|
1350
1373
|
className: "text-muted-foreground",
|
|
1351
1374
|
children: "—"
|
|
@@ -1354,14 +1377,14 @@ function rt({ value: t, dangerBelow: n = 90, className: r }) {
|
|
|
1354
1377
|
children: [t.toFixed(0), "%"]
|
|
1355
1378
|
});
|
|
1356
1379
|
}
|
|
1357
|
-
function
|
|
1380
|
+
function ot({ value: e, className: t }) {
|
|
1358
1381
|
return /* @__PURE__ */ T(c, {
|
|
1359
1382
|
size: "md",
|
|
1360
1383
|
className: t,
|
|
1361
1384
|
children: e
|
|
1362
1385
|
});
|
|
1363
1386
|
}
|
|
1364
|
-
function
|
|
1387
|
+
function st({ primary: t, secondary: n, className: r }) {
|
|
1365
1388
|
return /* @__PURE__ */ E("div", {
|
|
1366
1389
|
className: e("flex flex-col leading-tight", r),
|
|
1367
1390
|
children: [/* @__PURE__ */ T("span", {
|
|
@@ -1374,4 +1397,4 @@ function at({ primary: t, secondary: n, className: r }) {
|
|
|
1374
1397
|
});
|
|
1375
1398
|
}
|
|
1376
1399
|
//#endregion
|
|
1377
|
-
export { F as AGENT_TINTS, I as AvatarTextCell,
|
|
1400
|
+
export { F as AGENT_TINTS, I as AvatarTextCell, ot as CodePillCell, V as DEFAULT_SCORE_BANDS, z as LineSparklineCell, at as PercentCell, N as ProDataTable, N as Table, Ye as ProDataTablePagination, Xe as ProDataTableToolbar, B as ProgressBarCell, st as RelativeTimeCell, it as ResultsBarCell, L as STATUS_TONES, U as ScoreBarCell, R as SparklineCell, rt as StatusDotBadge, Se as facetFilterMatches, Qe as facetIsActive, Re as rowActionTriggerClasses, H as scoreBand, Ce as singleFilterValue, nt as tintForString };
|