@pstdio/ui 0.16.0 → 0.18.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/{MermaidComponent-BCMQqPqu.js → MermaidComponent-BPiVFNYK.js} +2 -2
- package/dist/{MermaidComponent-BCMQqPqu.js.map → MermaidComponent-BPiVFNYK.js.map} +1 -1
- package/dist/chat-ui.js +1618 -1102
- package/dist/chat-ui.js.map +1 -1
- package/dist/{checkbox-D5AzFRlb.js → checkbox-B2zYVemL.js} +28 -28
- package/dist/checkbox-B2zYVemL.js.map +1 -0
- package/dist/components/chat-ui/components/chat-input-actions.d.ts +1 -0
- package/dist/components/chat-ui/components/chat-input.d.ts +8 -2
- package/dist/components/chat-ui/components/chat-panel.d.ts +11 -5
- package/dist/components/chat-ui/components/composer-constants.d.ts +1 -0
- package/dist/components/chat-ui/components/conversation-browse.d.ts +22 -0
- package/dist/components/chat-ui/components/message-types.d.ts +14 -0
- package/dist/components/chat-ui/components/queued-follow-up-list-state.d.ts +4 -0
- package/dist/components/chat-ui/components/queued-follow-up-list.d.ts +11 -0
- package/dist/components/chat-ui/components/timeline.d.ts +5 -0
- package/dist/components/chat-ui/components/working-indicator.d.ts +9 -0
- package/dist/components/chat-ui/components/workspace-hub.d.ts +8 -1
- package/dist/components/chat-ui/index.d.ts +4 -2
- package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +2 -2
- package/dist/components/chat-ui/tool-rendering/question-prompt.d.ts +9 -0
- package/dist/components/data-table/build-columns.d.ts +13 -2
- package/dist/components/data-table/categorical-color-cell.d.ts +8 -0
- package/dist/components/data-table/color-cell-style.d.ts +13 -0
- package/dist/components/data-table/color-scale-cell.d.ts +7 -0
- package/dist/components/data-table/data-table-column-menu.d.ts +15 -0
- package/dist/components/data-table/data-table-header.d.ts +10 -0
- package/dist/components/data-table/data-table-stat-chart.d.ts +21 -0
- package/dist/components/data-table/data-table-state.d.ts +27 -0
- package/dist/components/data-table/data-table-stats-row.d.ts +11 -0
- package/dist/components/data-table/data-table-stats.d.ts +19 -0
- package/dist/components/data-table/data-table-table-parts.d.ts +21 -0
- package/dist/components/data-table/data-table.story-descriptions.d.ts +6 -0
- package/dist/components/data-table/data-table.story-fixtures.d.ts +6 -0
- package/dist/components/data-table/editable-cells-story.d.ts +9 -0
- package/dist/components/data-table/friendly-json-display.d.ts +31 -0
- package/dist/components/data-table/index.d.ts +3 -1
- package/dist/components/data-table/json-cell.d.ts +6 -0
- package/dist/components/data-table/pagination-footer.d.ts +4 -1
- package/dist/components/data-table/selection-toolbar.d.ts +3 -1
- package/dist/components/data-table/types.d.ts +72 -0
- package/dist/components/diff-viewer/code-editor.d.ts +2 -0
- package/dist/components/diff-viewer/index.d.ts +1 -1
- package/dist/components/diff-viewer/monaco-browser.d.ts +1 -0
- package/dist/components/{data-renderer → kanban-renderer}/display-menu.d.ts +4 -4
- package/dist/components/{data-renderer → kanban-renderer}/filter-menu.d.ts +3 -3
- package/dist/components/kanban-renderer/index.d.ts +19 -0
- package/dist/components/kanban-renderer/kanban-renderer-attribute-badge.d.ts +7 -0
- package/dist/components/{data-renderer/data-renderer-board-column-header.d.ts → kanban-renderer/kanban-renderer-board-column-header.d.ts} +2 -2
- package/dist/components/{data-renderer/data-renderer-board-group-section.d.ts → kanban-renderer/kanban-renderer-board-group-section.d.ts} +2 -2
- package/dist/components/{data-renderer/data-renderer-board-move.d.ts → kanban-renderer/kanban-renderer-board-move.d.ts} +3 -3
- package/dist/components/{data-renderer/data-renderer-board.d.ts → kanban-renderer/kanban-renderer-board.d.ts} +15 -14
- package/dist/components/{data-renderer/data-renderer-card.d.ts → kanban-renderer/kanban-renderer-card.d.ts} +4 -3
- package/dist/components/{data-renderer/data-renderer-content.d.ts → kanban-renderer/kanban-renderer-content.d.ts} +8 -8
- package/dist/components/kanban-renderer/kanban-renderer-create-dialog.d.ts +12 -0
- package/dist/components/kanban-renderer/kanban-renderer-create-field.d.ts +10 -0
- package/dist/components/kanban-renderer/kanban-renderer-grouping.d.ts +23 -0
- package/dist/components/{data-renderer/data-renderer-helpers.d.ts → kanban-renderer/kanban-renderer-helpers.d.ts} +15 -15
- package/dist/components/kanban-renderer/kanban-renderer-list-items.d.ts +25 -0
- package/dist/components/kanban-renderer/kanban-renderer-list.d.ts +43 -0
- package/dist/components/{data-renderer/data-renderer-story-fixtures.d.ts → kanban-renderer/kanban-renderer-story-fixtures.d.ts} +3 -2
- package/dist/components/kanban-renderer/kanban-renderer-toolbar.d.ts +15 -0
- package/dist/components/kanban-renderer/kanban-renderer-view-bar.d.ts +14 -0
- package/dist/components/kanban-renderer/kanban-renderer-views.d.ts +12 -0
- package/dist/components/{data-renderer/data-renderer.d.ts → kanban-renderer/kanban-renderer.d.ts} +11 -8
- package/dist/components/{data-renderer → kanban-renderer}/types.d.ts +51 -8
- package/dist/components/kanban-renderer/use-kanban-renderer-store.d.ts +78 -0
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/panel-header.constants.d.ts +2 -0
- package/dist/components/layout/resizable-split-layout.d.ts +3 -2
- package/dist/components/layout/resizable-split-layout.geometry.d.ts +56 -0
- package/dist/components/layout/resizable-split-layout.handle.d.ts +6 -2
- package/dist/components/layout/resizable-split-layout.panels.d.ts +25 -0
- package/dist/components/list-row/list-row-actions.d.ts +1 -0
- package/dist/components/list-row/list-row-content.d.ts +7 -0
- package/dist/components/list-row/list-row.types.d.ts +4 -1
- package/dist/components/overlays/attached-menu.d.ts +6 -0
- package/dist/components/overlays/attachment-chip.d.ts +13 -0
- package/dist/components/overlays/index.d.ts +6 -2
- package/dist/components/overlays/resource-context-menu.d.ts +13 -1
- package/dist/components/overlays/searchable-menu-input.d.ts +9 -0
- package/dist/components/param-editor/index.d.ts +6 -2
- package/dist/components/param-editor/inputs/action-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/boolean-input.d.ts +13 -0
- package/dist/components/param-editor/inputs/color-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/date-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/file-upload-input.d.ts +15 -0
- package/dist/components/param-editor/inputs/file-upload-value.d.ts +7 -0
- package/dist/components/param-editor/inputs/horizontal-text-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/markdown-input.d.ts +13 -0
- package/dist/components/param-editor/inputs/number-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/range-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/resource-input.d.ts +2 -0
- package/dist/components/param-editor/inputs/segmented-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/selection-input.d.ts +7 -6
- package/dist/components/param-editor/inputs/selection-menu.d.ts +33 -0
- package/dist/components/param-editor/inputs/text-input.d.ts +1 -0
- package/dist/components/param-editor/param-editor-advanced-field.d.ts +14 -0
- package/dist/components/param-editor/param-editor-control-fixtures.d.ts +24 -0
- package/dist/components/param-editor/param-editor-field.d.ts +2 -0
- package/dist/components/param-editor/param-editor-horizontal.d.ts +3 -2
- package/dist/components/param-editor/param-editor-label.d.ts +1 -0
- package/dist/components/param-editor/param-editor-presentation.d.ts +3 -0
- package/dist/components/param-editor/param-editor-read-only-field.d.ts +9 -0
- package/dist/components/param-editor/param-editor-section.d.ts +1 -0
- package/dist/components/param-editor/param-editor.d.ts +1 -0
- package/dist/components/param-editor/param-editor.types.d.ts +59 -18
- package/dist/components/param-editor/resolve-param-value.d.ts +2 -0
- package/dist/components/primitives/chip.d.ts +4 -0
- package/dist/components/primitives/index.d.ts +2 -0
- package/dist/components/primitives/resource-badge.d.ts +12 -10
- package/dist/components/rich-text/index.d.ts +1 -0
- package/dist/components/rich-text/lazy-markdown-editor.d.ts +2 -0
- package/dist/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/ReferenceMenuPlugin.d.ts +2 -1
- package/dist/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/hooks/useContextLookup.d.ts +2 -1
- package/dist/components/rich-text/prompt-input/plugins/ReferencePlugin/ReferencePlugin.d.ts +2 -1
- package/dist/components/rich-text/prompt-input/prompt-input.d.ts +3 -2
- package/dist/components/rich-text/types.d.ts +1 -1
- package/dist/components/rich-text/utils/inferResourceType.d.ts +1 -1
- package/dist/components/{sidebar/sidebar-footer.d.ts → sidenav/sidenav-footer.d.ts} +2 -2
- package/dist/components/{sidebar/sidebar-header.d.ts → sidenav/sidenav-header.d.ts} +2 -2
- package/dist/components/sidenav/sidenav.d.ts +2 -0
- package/dist/components/sidenav/sidenav.store.d.ts +49 -0
- package/dist/components/{sidebar/sidebar.types.d.ts → sidenav/sidenav.types.d.ts} +5 -5
- package/dist/components/tab-strip/tab-visibility-filter.d.ts +1 -0
- package/dist/components/terminal/terminal.d.ts +11 -0
- package/dist/components/tree-list/tree-list-visibility-filter.d.ts +0 -1
- package/dist/components/tree-list/tree-list.d.ts +1 -1
- package/dist/components/tree-list/tree-list.types.d.ts +4 -0
- package/dist/data-table.js +1321 -0
- package/dist/data-table.js.map +1 -0
- package/dist/diff.js +370 -366
- package/dist/diff.js.map +1 -1
- package/dist/font/css/prompt-studio-icons.css +690 -0
- package/dist/font/prompt-studio-icons.eot +0 -0
- package/dist/font/prompt-studio-icons.svg +1 -0
- package/dist/font/prompt-studio-icons.ttf +0 -0
- package/dist/font/prompt-studio-icons.woff +0 -0
- package/dist/font/prompt-studio-icons.woff2 +0 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1854 -3381
- package/dist/index.js.map +1 -1
- package/dist/kanban-renderer-toolbar-Db1mIWWd.js +1318 -0
- package/dist/kanban-renderer-toolbar-Db1mIWWd.js.map +1 -0
- package/dist/kanban-renderer.js +1101 -0
- package/dist/kanban-renderer.js.map +1 -0
- package/dist/lazy-markdown-editor-DwhqQ-NN.js +26 -0
- package/dist/lazy-markdown-editor-DwhqQ-NN.js.map +1 -0
- package/dist/list-row-BYWwcbGK.js +823 -0
- package/dist/list-row-BYWwcbGK.js.map +1 -0
- package/dist/markdown-DDd2ESoH.js +743 -0
- package/dist/markdown-DDd2ESoH.js.map +1 -0
- package/dist/markdown-editor-CYVkzt8t.js +741 -0
- package/dist/markdown-editor-CYVkzt8t.js.map +1 -0
- package/dist/monaco-browser-CO0NxK_Z.js +19 -0
- package/dist/monaco-browser-CO0NxK_Z.js.map +1 -0
- package/dist/param-editor-BCZOw5Gt.js +140 -0
- package/dist/param-editor-BCZOw5Gt.js.map +1 -0
- package/dist/param-editor-field-ZzZwgjZ_.js +2094 -0
- package/dist/param-editor-field-ZzZwgjZ_.js.map +1 -0
- package/dist/resource-badge-CuItchgL.js +98 -0
- package/dist/resource-badge-CuItchgL.js.map +1 -0
- package/dist/rich-message--eRzjWYK.js +730 -0
- package/dist/rich-message--eRzjWYK.js.map +1 -0
- package/dist/rich-text.js +114 -827
- package/dist/rich-text.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/terminal.js +197 -177
- package/dist/terminal.js.map +1 -1
- package/dist/theme/primitives/fonts.d.ts +3 -0
- package/dist/theme/primitives/sizes.d.ts +23 -0
- package/dist/theme/recipes/badge.d.ts +8 -0
- package/dist/theme/recipes/button.d.ts +6 -0
- package/dist/theme/recipes/color-picker.d.ts +18 -1
- package/dist/theme/recipes/switch.d.ts +17 -0
- package/dist/theme/recipes/tabs.d.ts +4 -4
- package/dist/theme/tokens/colors.d.ts +18 -24
- package/dist/{theme-CJBYBJaA.js → theme-poQlUgt0.js} +414 -240
- package/dist/theme-poQlUgt0.js.map +1 -0
- package/dist/theme.js +1 -1
- package/dist/tree-list-BAja2eXU.js +1033 -0
- package/dist/tree-list-BAja2eXU.js.map +1 -0
- package/package.json +11 -4
- package/dist/checkbox-D5AzFRlb.js.map +0 -1
- package/dist/components/data-renderer/card-interaction-guard.d.ts +0 -2
- package/dist/components/data-renderer/data-renderer-attribute-badge.d.ts +0 -7
- package/dist/components/data-renderer/data-renderer-grouping.d.ts +0 -23
- package/dist/components/data-renderer/data-renderer-list.d.ts +0 -39
- package/dist/components/data-renderer/data-renderer-toolbar.d.ts +0 -12
- package/dist/components/data-renderer/index.d.ts +0 -18
- package/dist/components/data-renderer/use-data-renderer-store.d.ts +0 -59
- package/dist/components/param-editor/inputs/file-accept.d.ts +0 -22
- package/dist/components/param-editor/inputs/file-drop-input.d.ts +0 -14
- package/dist/components/sidebar/sidebar.d.ts +0 -2
- package/dist/components/sidebar/sidebar.store.d.ts +0 -49
- package/dist/data-renderer.js +0 -1669
- package/dist/data-renderer.js.map +0 -1
- package/dist/list-row-mi3Hn-Um.js +0 -740
- package/dist/list-row-mi3Hn-Um.js.map +0 -1
- package/dist/resource-badge-qCWHP-wQ.js +0 -99
- package/dist/resource-badge-qCWHP-wQ.js.map +0 -1
- package/dist/rich-message-DBf_5YlW.js +0 -1450
- package/dist/rich-message-DBf_5YlW.js.map +0 -1
- package/dist/theme-CJBYBJaA.js.map +0 -1
- package/dist/tree-list-CcuZMLS5.js +0 -930
- package/dist/tree-list-CcuZMLS5.js.map +0 -1
- package/dist/workspace-badge-Fuo-1zPj.js +0 -314
- package/dist/workspace-badge-Fuo-1zPj.js.map +0 -1
- /package/dist/components/{data-renderer/data-renderer-badge-helpers.d.ts → kanban-renderer/kanban-renderer-badge-helpers.d.ts} +0 -0
- /package/dist/components/{data-renderer/data-renderer-enum-helpers.d.ts → kanban-renderer/kanban-renderer-enum-helpers.d.ts} +0 -0
- /package/dist/components/{data-renderer → kanban-renderer}/use-resolved-attributes.d.ts +0 -0
|
@@ -0,0 +1,1321 @@
|
|
|
1
|
+
import { jsx as r, jsxs as z, Fragment as ut } from "react/jsx-runtime";
|
|
2
|
+
import { Text as B, Icon as X, Popover as oe, HStack as Je, Portal as ae, Image as mt, Button as ce, chakra as pe, Menu as L, IconButton as re, Stack as Se, Box as ue, Table as te, Flex as U } from "@chakra-ui/react";
|
|
3
|
+
import { createColumnHelper as ft, flexRender as Ie, useReactTable as ht, getPaginationRowModel as gt, getCoreRowModel as bt, getSortedRowModel as pt } from "@tanstack/react-table";
|
|
4
|
+
import { isValidElement as ye, cloneElement as St, useRef as Ne, useState as le, useEffect as Ge, Fragment as xt } from "react";
|
|
5
|
+
import { S as Ae, T as Ue } from "./scroll-area-BMbg1WcD.js";
|
|
6
|
+
import { K as yt, e as Ct, d as wt } from "./kanban-renderer-toolbar-Db1mIWWd.js";
|
|
7
|
+
import { c as P } from "react/compiler-runtime";
|
|
8
|
+
import { CalendarClock as vt, Type as Rt, Hash as It, CheckCircle2 as zt, Braces as kt, ChevronRight as qe, CircleHelp as _t, Minus as At, Check as $e, ChevronDown as $t, Settings2 as Tt, GripVertical as Vt, ArrowUpAZ as Ye, ArrowDownAZ as Ze, MoreVertical as Dt, ChevronsLeft as Pt, ChevronLeft as Mt, ChevronsRight as Nt, X as Lt } from "lucide-react";
|
|
9
|
+
import { C as Te } from "./checkbox-B2zYVemL.js";
|
|
10
|
+
import { L as se, a as Ht, R as Ot } from "./list-row-BYWwcbGK.js";
|
|
11
|
+
import { P as jt } from "./param-editor-BCZOw5Gt.js";
|
|
12
|
+
import { useSensors as Bt, useSensor as Et, PointerSensor as Ft, DndContext as Wt, closestCenter as Kt } from "@dnd-kit/core";
|
|
13
|
+
import { SortableContext as Xt, verticalListSortingStrategy as Jt, useSortable as Gt } from "@dnd-kit/sortable";
|
|
14
|
+
import { CSS as Ut } from "@dnd-kit/utilities";
|
|
15
|
+
import { b as qt, N as Yt, c as Zt } from "./param-editor-field-ZzZwgjZ_.js";
|
|
16
|
+
import { useChart as Qt, Chart as Le } from "@chakra-ui/charts";
|
|
17
|
+
import { XAxis as en, YAxis as tn, Bar as nn, Tooltip as ln, BarChart as on, useActiveTooltipCoordinate as rn, usePlotArea as sn } from "recharts";
|
|
18
|
+
const Qe = (n, e) => e.find((t) => Object.is(t.value, n))?.color ?? null, an = (n) => {
|
|
19
|
+
const {
|
|
20
|
+
children: e
|
|
21
|
+
} = n;
|
|
22
|
+
return e;
|
|
23
|
+
}, cn = "#111827", dn = "#ffffff", un = "#000000", mn = 4.5, fn = (n) => n.split("").map((e) => e + e).join(""), de = (n) => {
|
|
24
|
+
const e = n.trim(), t = e.startsWith("#") ? e.slice(1) : e, l = t.length === 3 ? fn(t) : t;
|
|
25
|
+
return /^[\da-f]{6}$/i.test(l) ? {
|
|
26
|
+
r: Number.parseInt(l.slice(0, 2), 16),
|
|
27
|
+
g: Number.parseInt(l.slice(2, 4), 16),
|
|
28
|
+
b: Number.parseInt(l.slice(4, 6), 16)
|
|
29
|
+
} : null;
|
|
30
|
+
}, ve = (n) => {
|
|
31
|
+
const e = n / 255;
|
|
32
|
+
return e <= 0.03928 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
|
|
33
|
+
}, He = (n) => 0.2126 * ve(n.r) + 0.7152 * ve(n.g) + 0.0722 * ve(n.b), hn = (n, e) => {
|
|
34
|
+
const t = He(n), l = He(e), o = Math.max(t, l), a = Math.min(t, l);
|
|
35
|
+
return (o + 0.05) / (a + 0.05);
|
|
36
|
+
}, ze = (n) => {
|
|
37
|
+
const e = (t) => Math.round(t).toString(16).padStart(2, "0");
|
|
38
|
+
return `#${e(n.r)}${e(n.g)}${e(n.b)}`;
|
|
39
|
+
}, et = (n, e, t) => ({
|
|
40
|
+
r: n.r * (1 - t) + e.r * t,
|
|
41
|
+
g: n.g * (1 - t) + e.g * t,
|
|
42
|
+
b: n.b * (1 - t) + e.b * t
|
|
43
|
+
}), Oe = (n, e) => {
|
|
44
|
+
for (let t = 1; t <= 50; t += 1) {
|
|
45
|
+
const l = et(n, e, t / 50);
|
|
46
|
+
if (hn(l, n) >= mn)
|
|
47
|
+
return {
|
|
48
|
+
color: ze(l),
|
|
49
|
+
step: t
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
color: ze(e),
|
|
54
|
+
step: 50
|
|
55
|
+
};
|
|
56
|
+
}, je = (n) => {
|
|
57
|
+
const e = de(n);
|
|
58
|
+
if (!e) return cn;
|
|
59
|
+
const t = de(un), l = de(dn), o = Oe(e, t), a = Oe(e, l);
|
|
60
|
+
return o.step <= a.step ? o.color : a.color;
|
|
61
|
+
}, gn = (n, e, t) => {
|
|
62
|
+
const l = de(n), o = de(e);
|
|
63
|
+
return !l || !o ? null : ze(et(l, o, 1 - t));
|
|
64
|
+
}, Be = (n) => {
|
|
65
|
+
const e = n.foreground?.light ?? je(n.light), t = n.foreground?.dark ?? je(n.dark);
|
|
66
|
+
return {
|
|
67
|
+
backgroundColor: `light-dark(${n.light}, ${n.dark})`,
|
|
68
|
+
color: `light-dark(${e}, ${t})`
|
|
69
|
+
};
|
|
70
|
+
}, bn = (n) => Math.round(n * 100) / 100, he = (n, e, t) => {
|
|
71
|
+
const l = gn(n, e, t);
|
|
72
|
+
return l || `color-mix(in srgb, ${n} ${bn(t * 100)}%, ${e})`;
|
|
73
|
+
}, pn = (n, e, t) => {
|
|
74
|
+
const l = n.foreground && e.foreground ? {
|
|
75
|
+
light: he(n.foreground.light, e.foreground.light, t),
|
|
76
|
+
dark: he(n.foreground.dark, e.foreground.dark, t)
|
|
77
|
+
} : void 0;
|
|
78
|
+
return {
|
|
79
|
+
light: he(n.light, e.light, t),
|
|
80
|
+
dark: he(n.dark, e.dark, t),
|
|
81
|
+
...l ? {
|
|
82
|
+
foreground: l
|
|
83
|
+
} : {}
|
|
84
|
+
};
|
|
85
|
+
}, tt = (n, e) => {
|
|
86
|
+
if (typeof n != "number" || !Number.isFinite(n) || e.length < 2) return null;
|
|
87
|
+
const t = e[0], l = e[e.length - 1];
|
|
88
|
+
if (l.value - t.value <= 0) return null;
|
|
89
|
+
if (n <= t.value) return t.color;
|
|
90
|
+
if (n >= l.value) return l.color;
|
|
91
|
+
const a = e.findIndex((m) => n <= m.value), s = e[a - 1], i = e[a], d = 1 - (n - s.value) / (i.value - s.value);
|
|
92
|
+
return pn(s.color, i.color, d);
|
|
93
|
+
}, Sn = (n) => {
|
|
94
|
+
const e = P(2), {
|
|
95
|
+
value: t
|
|
96
|
+
} = n;
|
|
97
|
+
let l;
|
|
98
|
+
return e[0] !== t ? (l = /* @__PURE__ */ r(B, { textStyle: "paragraph/S/medium", fontVariantNumeric: "tabular-nums", truncate: !0, children: t }), e[0] = t, e[1] = l) : l = e[1], l;
|
|
99
|
+
}, me = (n) => typeof n == "object" && n !== null && "display" in n, Ee = (n) => typeof n == "string" || n instanceof String, xn = (n) => typeof n == "number" || n instanceof Number, yn = (n) => typeof n == "boolean" || n instanceof Boolean, Cn = (n) => {
|
|
100
|
+
const e = n.map((t) => me(t) ? t.sortValue ?? null : t instanceof String || t instanceof Number || t instanceof Boolean ? t.valueOf() : ye(t) ? null : t).filter((t) => t != null);
|
|
101
|
+
return e.length === 0 ? "unknown" : e.every((t) => Ee(t) && !Number.isNaN(Date.parse(t.toString()))) ? "date" : e.every((t) => xn(t)) ? "number" : e.every((t) => yn(t)) ? "boolean" : e.every((t) => Ee(t)) ? "string" : "unknown";
|
|
102
|
+
}, ge = {
|
|
103
|
+
boxSize: "14px",
|
|
104
|
+
marginRight: "2px"
|
|
105
|
+
}, wn = (n) => {
|
|
106
|
+
const e = Cn(n);
|
|
107
|
+
return e === "date" ? /* @__PURE__ */ r(X, { as: vt, ...ge }) : e === "string" ? /* @__PURE__ */ r(X, { as: Rt, ...ge }) : e === "number" ? /* @__PURE__ */ r(X, { as: It, ...ge }) : e === "boolean" ? /* @__PURE__ */ r(X, { as: zt, ...ge }) : null;
|
|
108
|
+
};
|
|
109
|
+
function vn(n) {
|
|
110
|
+
if (me(n)) return n.display;
|
|
111
|
+
if (ye(n)) return n;
|
|
112
|
+
switch ((n instanceof String || n instanceof Number || n instanceof Boolean) && (n = n.valueOf()), typeof n) {
|
|
113
|
+
case "boolean":
|
|
114
|
+
return n ? "TRUE" : "FALSE";
|
|
115
|
+
case "number":
|
|
116
|
+
return n;
|
|
117
|
+
case "object":
|
|
118
|
+
return n !== null ? JSON.stringify(n) : "-";
|
|
119
|
+
case "undefined":
|
|
120
|
+
return "-";
|
|
121
|
+
default:
|
|
122
|
+
return n ? String(n) : "-";
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const be = ft(), Rn = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, In = /(^|\s)(avatar|image|logo|photo|picture|thumbnail)(\s|$)/i, zn = (n) => {
|
|
126
|
+
const e = n.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim().toLowerCase();
|
|
127
|
+
return e ? `${e[0]?.toUpperCase()}${e.slice(1)}` : "Details";
|
|
128
|
+
}, Re = (n) => n.map((e) => /^\d+$/.test(e) ? e : zn(e)).join(" / "), kn = (n) => n.every((e) => e === null || typeof e != "object"), ke = (n, e, t) => {
|
|
129
|
+
if (Array.isArray(n)) {
|
|
130
|
+
if (n.length === 0 || kn(n)) {
|
|
131
|
+
t.push({
|
|
132
|
+
label: Re(e),
|
|
133
|
+
value: n
|
|
134
|
+
});
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
n.forEach((l, o) => {
|
|
138
|
+
ke(l, [...e, String(o + 1)], t);
|
|
139
|
+
});
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (n !== null && typeof n == "object") {
|
|
143
|
+
const l = Object.entries(n);
|
|
144
|
+
if (l.length === 0) {
|
|
145
|
+
t.push({
|
|
146
|
+
label: Re(e),
|
|
147
|
+
value: null
|
|
148
|
+
});
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
l.forEach(([o, a]) => {
|
|
152
|
+
ke(a, [...e, o], t);
|
|
153
|
+
});
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
t.push({
|
|
157
|
+
label: Re(e),
|
|
158
|
+
value: n
|
|
159
|
+
});
|
|
160
|
+
}, nt = (n) => {
|
|
161
|
+
if (typeof n != "string") return n;
|
|
162
|
+
try {
|
|
163
|
+
return JSON.parse(n);
|
|
164
|
+
} catch {
|
|
165
|
+
return n;
|
|
166
|
+
}
|
|
167
|
+
}, Ve = (n) => {
|
|
168
|
+
const e = [];
|
|
169
|
+
return ke(nt(n), [], e), e.map((t) => ({
|
|
170
|
+
...t,
|
|
171
|
+
label: t.label || "Value"
|
|
172
|
+
}));
|
|
173
|
+
}, Ce = (n, e) => {
|
|
174
|
+
if (typeof n != "string") return !1;
|
|
175
|
+
if (n.startsWith("data:image/")) return !0;
|
|
176
|
+
try {
|
|
177
|
+
const t = new URL(n);
|
|
178
|
+
return t.protocol !== "http:" && t.protocol !== "https:" ? !1 : Rn.test(t.pathname) || In.test(e);
|
|
179
|
+
} catch {
|
|
180
|
+
return !1;
|
|
181
|
+
}
|
|
182
|
+
}, De = (n, e) => Array.isArray(n) && n.length > 0 && n.every((t) => Ce(t, e)), Fe = (n) => n == null || n === "" ? "Not provided" : typeof n == "boolean" ? n ? "Yes" : "No" : String(n), _n = (n) => Array.isArray(n) ? n.length === 0 ? "None" : n.map(Fe).join(", ") : Fe(n), An = (n) => {
|
|
183
|
+
const e = nt(n);
|
|
184
|
+
if (Array.isArray(e) && e.length === 0 || e !== null && typeof e == "object" && Object.keys(e).length === 0)
|
|
185
|
+
return "No details";
|
|
186
|
+
const t = Ve(n).filter((a) => !Ce(a.value, a.label) && !De(a.value, a.label));
|
|
187
|
+
if (t.length === 0) return "No details";
|
|
188
|
+
const l = t.slice(0, 2).map((a) => _n(a.value)), o = t.length - l.length;
|
|
189
|
+
return [...l, o > 0 ? `${o} more` : null].filter(Boolean).join(" · ");
|
|
190
|
+
}, $n = (n) => {
|
|
191
|
+
const {
|
|
192
|
+
label: e,
|
|
193
|
+
value: t
|
|
194
|
+
} = n;
|
|
195
|
+
return Ce(t, e) ? {
|
|
196
|
+
type: "image",
|
|
197
|
+
src: String(t),
|
|
198
|
+
alt: `${e} preview`
|
|
199
|
+
} : Array.isArray(t) && De(t, e) ? {
|
|
200
|
+
type: "image-gallery",
|
|
201
|
+
images: t.map((l, o) => ({
|
|
202
|
+
src: String(l),
|
|
203
|
+
alt: `${e} ${o + 1} preview`
|
|
204
|
+
}))
|
|
205
|
+
} : Array.isArray(t) ? t : t === void 0 ? null : t;
|
|
206
|
+
}, Tn = (n) => Ve(n).map((e, t) => ({
|
|
207
|
+
id: `friendly-json-${t}`,
|
|
208
|
+
name: e.label,
|
|
209
|
+
type: "readOnly",
|
|
210
|
+
value: $n(e)
|
|
211
|
+
})), Vn = (n) => {
|
|
212
|
+
const e = P(4), {
|
|
213
|
+
value: t
|
|
214
|
+
} = n;
|
|
215
|
+
let l;
|
|
216
|
+
e[0] !== t ? (l = Tn(t), e[0] = t, e[1] = l) : l = e[1];
|
|
217
|
+
let o;
|
|
218
|
+
return e[2] !== l ? (o = /* @__PURE__ */ r(jt, { params: l, readOnly: !0, fullWidth: !0 }), e[2] = l, e[3] = o) : o = e[3], o;
|
|
219
|
+
}, Dn = (n) => n.stopPropagation(), Pn = (n) => {
|
|
220
|
+
const e = P(49), {
|
|
221
|
+
columnLabel: t,
|
|
222
|
+
value: l
|
|
223
|
+
} = n;
|
|
224
|
+
let o, a, s, i, c, d, m, u, f, b, h, g, S, y, x, v;
|
|
225
|
+
if (e[0] !== t || e[1] !== l) {
|
|
226
|
+
const T = Ve(l).flatMap(Mn).slice(0, 2);
|
|
227
|
+
let V;
|
|
228
|
+
e[18] !== l ? (V = An(l), e[18] = l, e[19] = V) : V = e[19], i = V, s = oe.Root, e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = {
|
|
229
|
+
placement: "bottom-start",
|
|
230
|
+
offset: {
|
|
231
|
+
mainAxis: 6
|
|
232
|
+
}
|
|
233
|
+
}, e[20] = u) : u = e[20], a = oe.Trigger, m = !0, o = ce, c = `View ${t} details`, d = "ghost", f = "xs", b = "full", h = "0", g = "28px", S = "2xs", y = "flex-start", x = Dn, v = T.length > 0 ? /* @__PURE__ */ r(Je, { gap: "-1", flexShrink: "0", children: T.map(Nn) }) : /* @__PURE__ */ r(kt, { size: 14 }), e[0] = t, e[1] = l, e[2] = o, e[3] = a, e[4] = s, e[5] = i, e[6] = c, e[7] = d, e[8] = m, e[9] = u, e[10] = f, e[11] = b, e[12] = h, e[13] = g, e[14] = S, e[15] = y, e[16] = x, e[17] = v;
|
|
234
|
+
} else
|
|
235
|
+
o = e[2], a = e[3], s = e[4], i = e[5], c = e[6], d = e[7], m = e[8], u = e[9], f = e[10], b = e[11], h = e[12], g = e[13], S = e[14], y = e[15], x = e[16], v = e[17];
|
|
236
|
+
let C;
|
|
237
|
+
e[21] !== i ? (C = /* @__PURE__ */ r(B, { flex: "1", minWidth: "0", textAlign: "left", textStyle: "paragraph/S/regular", truncate: !0, children: i }), e[21] = i, e[22] = C) : C = e[22];
|
|
238
|
+
let p;
|
|
239
|
+
e[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ r(qe, { size: 12 }), e[23] = p) : p = e[23];
|
|
240
|
+
let w;
|
|
241
|
+
e[24] !== o || e[25] !== c || e[26] !== d || e[27] !== C || e[28] !== f || e[29] !== b || e[30] !== h || e[31] !== g || e[32] !== S || e[33] !== y || e[34] !== x || e[35] !== v ? (w = /* @__PURE__ */ z(o, { "aria-label": c, variant: d, size: f, width: b, minWidth: h, height: g, paddingX: S, justifyContent: y, onClick: x, children: [
|
|
242
|
+
v,
|
|
243
|
+
C,
|
|
244
|
+
p
|
|
245
|
+
] }), e[24] = o, e[25] = c, e[26] = d, e[27] = C, e[28] = f, e[29] = b, e[30] = h, e[31] = g, e[32] = S, e[33] = y, e[34] = x, e[35] = v, e[36] = w) : w = e[36];
|
|
246
|
+
let I;
|
|
247
|
+
e[37] !== a || e[38] !== m || e[39] !== w ? (I = /* @__PURE__ */ r(a, { asChild: m, children: w }), e[37] = a, e[38] = m, e[39] = w, e[40] = I) : I = e[40];
|
|
248
|
+
let k;
|
|
249
|
+
e[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = {
|
|
250
|
+
overscrollBehavior: "contain"
|
|
251
|
+
}, e[41] = k) : k = e[41];
|
|
252
|
+
let _;
|
|
253
|
+
e[42] !== l ? (_ = /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r(oe.Positioner, { children: /* @__PURE__ */ r(oe.Content, { width: "min(380px, calc(100vw - 32px))", padding: "0", background: "bg", overflow: "hidden", children: /* @__PURE__ */ r(Ae, { maxH: "360px", viewportProps: k, children: /* @__PURE__ */ r(Vn, { value: l }) }) }) }) }), e[42] = l, e[43] = _) : _ = e[43];
|
|
254
|
+
let $;
|
|
255
|
+
return e[44] !== s || e[45] !== u || e[46] !== I || e[47] !== _ ? ($ = /* @__PURE__ */ z(s, { positioning: u, children: [
|
|
256
|
+
I,
|
|
257
|
+
_
|
|
258
|
+
] }), e[44] = s, e[45] = u, e[46] = I, e[47] = _, e[48] = $) : $ = e[48], $;
|
|
259
|
+
};
|
|
260
|
+
function Mn(n) {
|
|
261
|
+
return Ce(n.value, n.label) ? [n] : !Array.isArray(n.value) || !De(n.value, n.label) ? [] : n.value.map((e, t) => ({
|
|
262
|
+
label: `${n.label} ${t + 1}`,
|
|
263
|
+
value: e
|
|
264
|
+
}));
|
|
265
|
+
}
|
|
266
|
+
function Nn(n) {
|
|
267
|
+
return /* @__PURE__ */ r(mt, { src: String(n.value), alt: `${n.label} preview`, boxSize: "22px", borderRadius: "xs", borderWidth: "1px", borderColor: "border.subtle", objectFit: "cover" }, n.label);
|
|
268
|
+
}
|
|
269
|
+
const We = (n) => me(n) ? n.sortValue : n, Ln = (n, e) => n === e ? 0 : n == null ? 1 : e == null ? -1 : typeof n == "number" && typeof e == "number" ? n - e : String(n).localeCompare(String(e)), Hn = (n) => ye(n) ? St(n, {
|
|
270
|
+
style: {
|
|
271
|
+
...n.props.style,
|
|
272
|
+
flexWrap: "nowrap",
|
|
273
|
+
minWidth: 0,
|
|
274
|
+
whiteSpace: "nowrap"
|
|
275
|
+
}
|
|
276
|
+
}) : n, xe = (n) => {
|
|
277
|
+
n.stopPropagation();
|
|
278
|
+
}, On = (n) => {
|
|
279
|
+
const e = P(8), {
|
|
280
|
+
table: t
|
|
281
|
+
} = n, l = t.getIsAllRowsSelected(), o = !l && t.getIsSomeRowsSelected(), a = l ? !0 : o ? "indeterminate" : !1, s = o ? At : $e;
|
|
282
|
+
let i;
|
|
283
|
+
e[0] !== s ? (i = /* @__PURE__ */ r(X, { as: s, boxSize: "12px", strokeWidth: "3" }), e[0] = s, e[1] = i) : i = e[1];
|
|
284
|
+
let c;
|
|
285
|
+
e[2] !== t ? (c = (m) => t.toggleAllRowsSelected(m.checked === !0), e[2] = t, e[3] = c) : c = e[3];
|
|
286
|
+
let d;
|
|
287
|
+
return e[4] !== a || e[5] !== i || e[6] !== c ? (d = /* @__PURE__ */ r(Te, { checked: a, "aria-label": "Select all", icon: i, onClick: xe, onCheckedChange: c }), e[4] = a, e[5] = i, e[6] = c, e[7] = d) : d = e[7], d;
|
|
288
|
+
}, jn = (n) => {
|
|
289
|
+
const e = P(6), {
|
|
290
|
+
row: t,
|
|
291
|
+
selectedRowIds: l
|
|
292
|
+
} = n, o = !!l?.[t.id];
|
|
293
|
+
let a;
|
|
294
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ r(X, { as: $e, boxSize: "12px", strokeWidth: "3" }), e[0] = a) : a = e[0];
|
|
295
|
+
let s;
|
|
296
|
+
e[1] !== t ? (s = (c) => t.toggleSelected(c.checked === !0), e[1] = t, e[2] = s) : s = e[2];
|
|
297
|
+
let i;
|
|
298
|
+
return e[3] !== o || e[4] !== s ? (i = /* @__PURE__ */ r(Te, { checked: o, "aria-label": "Select row", icon: a, onClick: xe, onCheckedChange: s }), e[3] = o, e[4] = s, e[5] = i) : i = e[5], i;
|
|
299
|
+
}, Bn = (n) => {
|
|
300
|
+
const e = P(8), {
|
|
301
|
+
row: t,
|
|
302
|
+
actions: l
|
|
303
|
+
} = n;
|
|
304
|
+
let o;
|
|
305
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ r(L.Trigger, { asChild: !0, children: /* @__PURE__ */ r(re, { "aria-label": "Row actions", size: "2xs", variant: "ghost", onClick: xe, children: /* @__PURE__ */ r(X, { as: $t, boxSize: "14px" }) }) }), e[0] = o) : o = e[0];
|
|
306
|
+
let a;
|
|
307
|
+
if (e[1] !== l || e[2] !== t) {
|
|
308
|
+
let i;
|
|
309
|
+
e[4] !== t ? (i = (c) => /* @__PURE__ */ r(L.Item, { value: c.label, asChild: !0, children: /* @__PURE__ */ r(se, { asChild: !0, variant: "full-width", tone: c.destructive ? "danger" : "default", label: c.label, icon: c.icon, onClick: xe, onActivate: () => c.onSelect(t.original) }) }, c.label), e[4] = t, e[5] = i) : i = e[5], a = l.map(i), e[1] = l, e[2] = t, e[3] = a;
|
|
310
|
+
} else
|
|
311
|
+
a = e[3];
|
|
312
|
+
let s;
|
|
313
|
+
return e[6] !== a ? (s = /* @__PURE__ */ z(L.Root, { children: [
|
|
314
|
+
o,
|
|
315
|
+
/* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r(L.Positioner, { children: /* @__PURE__ */ r(L.Content, { zIndex: "popover", bg: "bg", children: a }) }) })
|
|
316
|
+
] }), e[6] = a, e[7] = s) : s = e[7], s;
|
|
317
|
+
}, Ke = (n) => {
|
|
318
|
+
const e = P(5), {
|
|
319
|
+
value: t
|
|
320
|
+
} = n;
|
|
321
|
+
let l, o;
|
|
322
|
+
if (e[0] !== t) {
|
|
323
|
+
o = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
324
|
+
e:
|
|
325
|
+
if (l = vn(t), ye(l)) {
|
|
326
|
+
o = /* @__PURE__ */ r(pe.span, { display: "inline-flex", maxWidth: "full", minW: "0", overflow: "hidden", whiteSpace: "nowrap", children: Hn(l) });
|
|
327
|
+
break e;
|
|
328
|
+
}
|
|
329
|
+
e[0] = t, e[1] = l, e[2] = o;
|
|
330
|
+
} else
|
|
331
|
+
l = e[1], o = e[2];
|
|
332
|
+
if (o !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
|
|
333
|
+
return o;
|
|
334
|
+
let a;
|
|
335
|
+
return e[3] !== l ? (a = /* @__PURE__ */ r(B, { maxWidth: "full", overflow: "hidden", textOverflow: "ellipsis", textStyle: "paragraph/S/regular", whiteSpace: "nowrap", children: l }), e[3] = l, e[4] = a) : a = e[4], a;
|
|
336
|
+
}, En = (n) => {
|
|
337
|
+
const e = P(9), {
|
|
338
|
+
columnLabel: t,
|
|
339
|
+
renderer: l,
|
|
340
|
+
value: o
|
|
341
|
+
} = n;
|
|
342
|
+
if (l?.type === "json") {
|
|
343
|
+
let s;
|
|
344
|
+
return e[0] !== t || e[1] !== o ? (s = /* @__PURE__ */ r(Pn, { columnLabel: t, value: o }), e[0] = t, e[1] = o, e[2] = s) : s = e[2], s;
|
|
345
|
+
}
|
|
346
|
+
if (l?.type === "color-scale" && tt(o, l.stops) && typeof o == "number") {
|
|
347
|
+
let i;
|
|
348
|
+
return e[3] !== o ? (i = /* @__PURE__ */ r(Sn, { value: o }), e[3] = o, e[4] = i) : i = e[4], i;
|
|
349
|
+
}
|
|
350
|
+
if (l?.type === "categorical-color" && Qe(o, l.categories)) {
|
|
351
|
+
let i;
|
|
352
|
+
return e[5] !== o ? (i = /* @__PURE__ */ r(an, { children: /* @__PURE__ */ r(Ke, { value: o }) }), e[5] = o, e[6] = i) : i = e[6], i;
|
|
353
|
+
}
|
|
354
|
+
let a;
|
|
355
|
+
return e[7] !== o ? (a = /* @__PURE__ */ r(Ke, { value: o }), e[7] = o, e[8] = a) : a = e[8], a;
|
|
356
|
+
}, Fn = (n, e) => {
|
|
357
|
+
if (e?.type === "color-scale") {
|
|
358
|
+
const t = tt(n, e.stops);
|
|
359
|
+
if (t && typeof n == "number") return Be(t);
|
|
360
|
+
}
|
|
361
|
+
if (e?.type === "categorical-color") {
|
|
362
|
+
const t = Qe(n, e.categories);
|
|
363
|
+
if (t) return Be(t);
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
function Wn(n, e, t = {}) {
|
|
367
|
+
const {
|
|
368
|
+
columnIcons: l,
|
|
369
|
+
columnDescriptions: o,
|
|
370
|
+
compactHeaders: a,
|
|
371
|
+
enableSelection: s = !1,
|
|
372
|
+
rowActions: i = [],
|
|
373
|
+
selectedRowIds: c,
|
|
374
|
+
columnRenderers: d
|
|
375
|
+
} = t, m = be.accessor((h, g) => g + 1, {
|
|
376
|
+
header: "",
|
|
377
|
+
id: "rowIndex",
|
|
378
|
+
enableResizing: !1,
|
|
379
|
+
size: 20,
|
|
380
|
+
cell: (h) => /* @__PURE__ */ r(pe.span, { display: "block", textStyle: "paragraph/S/regular", textAlign: "center", children: h.getValue() })
|
|
381
|
+
}), u = be.display({
|
|
382
|
+
id: "rowSelection",
|
|
383
|
+
header: On,
|
|
384
|
+
cell: (h) => /* @__PURE__ */ r(jn, { ...h, selectedRowIds: c }),
|
|
385
|
+
enableResizing: !1,
|
|
386
|
+
enableSorting: !1,
|
|
387
|
+
size: 36
|
|
388
|
+
}), f = e.map((h) => {
|
|
389
|
+
const g = h || "-", S = n.map((p) => p[g]), y = d?.[g], x = l?.[g], v = x === void 0 ? wn(S) : x, C = o?.[g];
|
|
390
|
+
return be.accessor((p) => p[g], {
|
|
391
|
+
id: g,
|
|
392
|
+
header: () => {
|
|
393
|
+
const p = a?.[g] ?? g;
|
|
394
|
+
return /* @__PURE__ */ z(pe.span, { display: "inline-flex", alignItems: "center", gap: "4px", minW: "0", maxW: "full", overflow: "hidden", children: [
|
|
395
|
+
v,
|
|
396
|
+
/* @__PURE__ */ r(pe.span, { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: p }),
|
|
397
|
+
C ? /* @__PURE__ */ r(Ue, { content: C, children: /* @__PURE__ */ r(X, { as: _t, "aria-label": `About ${p}`, boxSize: "12px", color: "fg.muted", cursor: "help", flexShrink: 0, opacity: 0.6, tabIndex: 0 }) }) : null
|
|
398
|
+
] });
|
|
399
|
+
},
|
|
400
|
+
cell: (p) => /* @__PURE__ */ r(En, { columnLabel: g, renderer: y, value: p.getValue() }),
|
|
401
|
+
meta: {
|
|
402
|
+
getCellStyle: (p) => Fn(p, y)
|
|
403
|
+
},
|
|
404
|
+
sortingFn: (p, w) => {
|
|
405
|
+
const I = We(p.original[g]), k = We(w.original[g]);
|
|
406
|
+
return Ln(I, k);
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
}), b = be.display({
|
|
410
|
+
id: "rowActions",
|
|
411
|
+
header: "",
|
|
412
|
+
cell: (h) => /* @__PURE__ */ r(Bn, { ...h, actions: i }),
|
|
413
|
+
enableResizing: !1,
|
|
414
|
+
enableSorting: !1,
|
|
415
|
+
size: 36
|
|
416
|
+
});
|
|
417
|
+
return [m, ...s ? [u] : [], ...f, ...i.length > 0 ? [b] : []];
|
|
418
|
+
}
|
|
419
|
+
const Kn = (n) => {
|
|
420
|
+
const e = P(28), {
|
|
421
|
+
column: t,
|
|
422
|
+
checked: l,
|
|
423
|
+
onColumnVisibilityChange: o
|
|
424
|
+
} = n;
|
|
425
|
+
let a;
|
|
426
|
+
e[0] !== t.id ? (a = {
|
|
427
|
+
id: t.id
|
|
428
|
+
}, e[0] = t.id, e[1] = a) : a = e[1];
|
|
429
|
+
const {
|
|
430
|
+
attributes: s,
|
|
431
|
+
listeners: i,
|
|
432
|
+
setNodeRef: c,
|
|
433
|
+
transform: d,
|
|
434
|
+
transition: m,
|
|
435
|
+
isDragging: u
|
|
436
|
+
} = Gt(a);
|
|
437
|
+
let f;
|
|
438
|
+
e[2] !== d ? (f = Ut.Transform.toString(d), e[2] = d, e[3] = f) : f = e[3];
|
|
439
|
+
const b = u ? 0.5 : 1;
|
|
440
|
+
let h;
|
|
441
|
+
e[4] !== f || e[5] !== b || e[6] !== m ? (h = {
|
|
442
|
+
transform: f,
|
|
443
|
+
transition: m,
|
|
444
|
+
opacity: b
|
|
445
|
+
}, e[4] = f, e[5] = b, e[6] = m, e[7] = h) : h = e[7];
|
|
446
|
+
const g = h;
|
|
447
|
+
let S;
|
|
448
|
+
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = {
|
|
449
|
+
bg: "bg.hover"
|
|
450
|
+
}, e[8] = S) : S = e[8];
|
|
451
|
+
let y;
|
|
452
|
+
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ r(Vt, { size: 14 }), e[9] = y) : y = e[9];
|
|
453
|
+
let x;
|
|
454
|
+
e[10] !== s || e[11] !== i ? (x = /* @__PURE__ */ r(ue, { as: "span", display: "inline-flex", cursor: "grab", color: "fg.muted", ...s, ...i, children: y }), e[10] = s, e[11] = i, e[12] = x) : x = e[12];
|
|
455
|
+
let v;
|
|
456
|
+
e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ r(X, { as: $e, boxSize: "12px", strokeWidth: "3" }), e[13] = v) : v = e[13];
|
|
457
|
+
let C;
|
|
458
|
+
e[14] !== t.id || e[15] !== o ? (C = (k) => o(t.id, k.checked === !0), e[14] = t.id, e[15] = o, e[16] = C) : C = e[16];
|
|
459
|
+
let p;
|
|
460
|
+
e[17] !== t.label ? (p = /* @__PURE__ */ r(B, { as: "span", textStyle: "label/S/regular", truncate: !0, children: t.label }), e[17] = t.label, e[18] = p) : p = e[18];
|
|
461
|
+
let w;
|
|
462
|
+
e[19] !== l || e[20] !== C || e[21] !== p ? (w = /* @__PURE__ */ r(Te, { checked: l, flex: "1", minW: "0", width: "full", flexDirection: "row-reverse", justifyContent: "space-between", size: "sm", icon: v, onCheckedChange: C, children: p }), e[19] = l, e[20] = C, e[21] = p, e[22] = w) : w = e[22];
|
|
463
|
+
let I;
|
|
464
|
+
return e[23] !== c || e[24] !== g || e[25] !== w || e[26] !== x ? (I = /* @__PURE__ */ z(Je, { ref: c, style: g, gap: "2xs", minW: "0", width: "full", borderRadius: "xs", px: "xs", py: "2xs", _hover: S, children: [
|
|
465
|
+
x,
|
|
466
|
+
w
|
|
467
|
+
] }), e[23] = c, e[24] = g, e[25] = w, e[26] = x, e[27] = I) : I = e[27], I;
|
|
468
|
+
}, Xn = (n) => {
|
|
469
|
+
const e = P(43), {
|
|
470
|
+
columns: t,
|
|
471
|
+
visibleColumnIds: l,
|
|
472
|
+
showStats: o,
|
|
473
|
+
statsAvailable: a,
|
|
474
|
+
onColumnVisibilityChange: s,
|
|
475
|
+
onColumnReorder: i,
|
|
476
|
+
onStatsVisibilityChange: c
|
|
477
|
+
} = n, d = Ne(null), m = Ne(null), [u, f] = le(!1), [b, h] = le("");
|
|
478
|
+
let g;
|
|
479
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = {
|
|
480
|
+
activationConstraint: {
|
|
481
|
+
distance: 5
|
|
482
|
+
}
|
|
483
|
+
}, e[0] = g) : g = e[0];
|
|
484
|
+
const S = Bt(Et(Ft, g));
|
|
485
|
+
let y;
|
|
486
|
+
if (e[1] !== t || e[2] !== b) {
|
|
487
|
+
const A = b.trim().toLowerCase();
|
|
488
|
+
y = A ? t.filter((D) => D.label.toLowerCase().includes(A)) : t, e[1] = t, e[2] = b, e[3] = y;
|
|
489
|
+
} else
|
|
490
|
+
y = e[3];
|
|
491
|
+
const x = y;
|
|
492
|
+
let v;
|
|
493
|
+
e[4] !== i ? (v = (A) => {
|
|
494
|
+
const {
|
|
495
|
+
active: D,
|
|
496
|
+
over: M
|
|
497
|
+
} = A;
|
|
498
|
+
!M || D.id === M.id || i(String(D.id), String(M.id));
|
|
499
|
+
}, e[4] = i, e[5] = v) : v = e[5];
|
|
500
|
+
const C = v;
|
|
501
|
+
let p, w;
|
|
502
|
+
e[6] !== u ? (p = () => {
|
|
503
|
+
if (!u)
|
|
504
|
+
return;
|
|
505
|
+
const A = (M) => {
|
|
506
|
+
const j = M.target;
|
|
507
|
+
j instanceof Node && (m.current?.contains(j) || d.current?.contains(j) || f(!1));
|
|
508
|
+
}, D = (M) => {
|
|
509
|
+
M.key === "Escape" && f(!1);
|
|
510
|
+
};
|
|
511
|
+
return document.addEventListener("pointerdown", A), document.addEventListener("keydown", D, !0), () => {
|
|
512
|
+
document.removeEventListener("pointerdown", A), document.removeEventListener("keydown", D, !0);
|
|
513
|
+
};
|
|
514
|
+
}, w = [u], e[6] = u, e[7] = p, e[8] = w) : (p = e[7], w = e[8]), Ge(p, w);
|
|
515
|
+
let I;
|
|
516
|
+
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = {
|
|
517
|
+
placement: "bottom-end",
|
|
518
|
+
offset: {
|
|
519
|
+
mainAxis: 8
|
|
520
|
+
},
|
|
521
|
+
getAnchorElement: () => d.current
|
|
522
|
+
}, e[9] = I) : I = e[9];
|
|
523
|
+
let k;
|
|
524
|
+
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ r(oe.Trigger, { asChild: !0, children: /* @__PURE__ */ r(re, { ref: d, "aria-label": "Display settings", variant: "ghost", size: "sm", onClick: () => f(Jn), children: /* @__PURE__ */ r(X, { as: Tt, boxSize: "14px" }) }) }), e[10] = k) : k = e[10];
|
|
525
|
+
let _;
|
|
526
|
+
e[11] !== c || e[12] !== o || e[13] !== a ? (_ = a ? /* @__PURE__ */ r(ue, { borderBottomWidth: "1px", borderColor: "border.subtle", padding: "xs", children: /* @__PURE__ */ r(qt, { checked: o, inputProps: {
|
|
527
|
+
role: "switch"
|
|
528
|
+
}, width: "full", flexDirection: "row-reverse", justifyContent: "space-between", onCheckedChange: (A) => c(A.checked === !0), children: /* @__PURE__ */ r(B, { as: "span", textStyle: "label/S/regular", children: "Statistics" }) }) }) : null, e[11] = c, e[12] = o, e[13] = a, e[14] = _) : _ = e[14];
|
|
529
|
+
let $;
|
|
530
|
+
e[15] !== b ? ($ = /* @__PURE__ */ r(Ht, { value: b, placeholder: "Search columns", onValueChange: h }), e[15] = b, e[16] = $) : $ = e[16];
|
|
531
|
+
let E;
|
|
532
|
+
e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = {
|
|
533
|
+
overscrollBehavior: "contain"
|
|
534
|
+
}, e[17] = E) : E = e[17];
|
|
535
|
+
let T;
|
|
536
|
+
e[18] !== t ? (T = t.map(Gn), e[18] = t, e[19] = T) : T = e[19];
|
|
537
|
+
let V;
|
|
538
|
+
if (e[20] !== x || e[21] !== s || e[22] !== l) {
|
|
539
|
+
let A;
|
|
540
|
+
e[24] !== s || e[25] !== l ? (A = (D) => /* @__PURE__ */ r(Kn, { column: D, checked: l.has(D.id), onColumnVisibilityChange: s }, D.id), e[24] = s, e[25] = l, e[26] = A) : A = e[26], V = x.map(A), e[20] = x, e[21] = s, e[22] = l, e[23] = V;
|
|
541
|
+
} else
|
|
542
|
+
V = e[23];
|
|
543
|
+
let F;
|
|
544
|
+
e[27] !== V ? (F = /* @__PURE__ */ r(Se, { gap: "1px", children: V }), e[27] = V, e[28] = F) : F = e[28];
|
|
545
|
+
let H;
|
|
546
|
+
e[29] !== T || e[30] !== F ? (H = /* @__PURE__ */ r(Xt, { items: T, strategy: Jt, children: F }), e[29] = T, e[30] = F, e[31] = H) : H = e[31];
|
|
547
|
+
let N;
|
|
548
|
+
e[32] !== C || e[33] !== S || e[34] !== H ? (N = /* @__PURE__ */ r(Ae, { maxH: "280px", viewportProps: E, children: /* @__PURE__ */ r(ue, { padding: "2xs", children: /* @__PURE__ */ r(Wt, { sensors: S, collisionDetection: Kt, onDragEnd: C, children: H }) }) }), e[32] = C, e[33] = S, e[34] = H, e[35] = N) : N = e[35];
|
|
549
|
+
let O;
|
|
550
|
+
e[36] !== N || e[37] !== _ || e[38] !== $ ? (O = /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r(oe.Positioner, { children: /* @__PURE__ */ r(oe.Content, { ref: m, width: "min(320px, calc(100vw - 32px))", p: "0", bg: "bg", overflow: "hidden", children: /* @__PURE__ */ z(Se, { gap: "0", children: [
|
|
551
|
+
_,
|
|
552
|
+
$,
|
|
553
|
+
N
|
|
554
|
+
] }) }) }) }), e[36] = N, e[37] = _, e[38] = $, e[39] = O) : O = e[39];
|
|
555
|
+
let W;
|
|
556
|
+
return e[40] !== u || e[41] !== O ? (W = /* @__PURE__ */ z(oe.Root, { open: u, closeOnInteractOutside: !1, positioning: I, children: [
|
|
557
|
+
k,
|
|
558
|
+
O
|
|
559
|
+
] }), e[40] = u, e[41] = O, e[42] = W) : W = e[42], W;
|
|
560
|
+
};
|
|
561
|
+
function Jn(n) {
|
|
562
|
+
return !n;
|
|
563
|
+
}
|
|
564
|
+
function Gn(n) {
|
|
565
|
+
return n.id;
|
|
566
|
+
}
|
|
567
|
+
const Un = (n) => {
|
|
568
|
+
const e = P(6), {
|
|
569
|
+
rows: t,
|
|
570
|
+
attributes: l,
|
|
571
|
+
storageKey: o,
|
|
572
|
+
columnControl: a
|
|
573
|
+
} = n;
|
|
574
|
+
let s;
|
|
575
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
576
|
+
viewMode: "list"
|
|
577
|
+
}, e[0] = s) : s = e[0];
|
|
578
|
+
let i;
|
|
579
|
+
return e[1] !== l || e[2] !== a || e[3] !== t || e[4] !== o ? (i = /* @__PURE__ */ r(yt, { rows: t, storageKey: o, attributes: l, defaultSettings: s, displayControl: a }), e[1] = l, e[2] = a, e[3] = t, e[4] = o, e[5] = i) : i = e[5], i;
|
|
580
|
+
}, qn = 30, Pe = (n, e, t) => t ? t(n, e) : typeof n.id == "string" ? n.id : String(e), Yn = (n) => typeof n.initialPageSize == "number" && n.initialPageSize > 0 ? n.initialPageSize : qn, Zn = (n) => n.map((e) => e.original), Qn = (n) => {
|
|
581
|
+
const e = [...n.selectionActions ?? []];
|
|
582
|
+
return n.onCSVDownload && e.push({
|
|
583
|
+
label: "Download CSV",
|
|
584
|
+
onSelect: (t) => {
|
|
585
|
+
n.onCSVDownload?.(t.map((l, o) => Pe(l, o, n.getRowId)));
|
|
586
|
+
}
|
|
587
|
+
}), e;
|
|
588
|
+
}, el = (n) => n.selectionMode === "multiple" || !!n.onCSVDownload || !!n.selectionActions?.length, tl = (n) => n.enableRowActivation === !0 && n.activeRowId === n.rowId, _e = (n) => {
|
|
589
|
+
const e = me(n) ? n.sortValue : n;
|
|
590
|
+
return typeof e == "boolean" ? String(e) : e;
|
|
591
|
+
}, nl = (n, e) => {
|
|
592
|
+
const t = n.map((l) => _e(l[e])).filter((l) => l != null);
|
|
593
|
+
return t.length > 0 && t.every((l) => typeof l == "number");
|
|
594
|
+
}, ll = (n, e) => nl(n, e) ? {
|
|
595
|
+
kind: "number"
|
|
596
|
+
} : {
|
|
597
|
+
kind: "string"
|
|
598
|
+
}, ol = (n, e, t) => e.map((l) => ({
|
|
599
|
+
id: l,
|
|
600
|
+
label: t?.[l] ?? l,
|
|
601
|
+
type: ll(n, l),
|
|
602
|
+
filterable: !0,
|
|
603
|
+
sortable: !0,
|
|
604
|
+
displayable: !0
|
|
605
|
+
})), rl = (n, e, t) => n.map((l, o) => {
|
|
606
|
+
const a = Object.fromEntries(e.map((c) => [c, _e(l[c])])), s = Pe(l, o, t), i = e.length > 0 ? _e(l[e[0]]) : s;
|
|
607
|
+
return {
|
|
608
|
+
id: s,
|
|
609
|
+
title: String(i ?? s),
|
|
610
|
+
attributes: a,
|
|
611
|
+
sourceRow: l
|
|
612
|
+
};
|
|
613
|
+
}), il = (n, e, t) => Ct(n, e, t), Xe = (n, e) => {
|
|
614
|
+
const t = new Set(n), l = e.filter((s) => t.has(s)), o = new Set(l), a = n.filter((s) => !o.has(s));
|
|
615
|
+
return [...l, ...a];
|
|
616
|
+
}, sl = (n, e, t) => {
|
|
617
|
+
const l = n.indexOf(e), o = n.indexOf(t);
|
|
618
|
+
if (l < 0 || o < 0 || l === o) return n;
|
|
619
|
+
const a = [...n], [s] = a.splice(l, 1);
|
|
620
|
+
return s ? (a.splice(o, 0, s), a) : n;
|
|
621
|
+
}, al = (n) => n.toolbarStorageKey ?? `data-table:${n.columnKeys.join("|") || "empty"}`, cl = () => {
|
|
622
|
+
const n = P(11), e = rn(), t = sn();
|
|
623
|
+
if (!e || !t)
|
|
624
|
+
return null;
|
|
625
|
+
const l = t.y + t.height;
|
|
626
|
+
let o;
|
|
627
|
+
n[0] !== e.x || n[1] !== t.y || n[2] !== l ? (o = /* @__PURE__ */ r("line", { x1: e.x, x2: e.x, y1: t.y, y2: l }), n[0] = e.x, n[1] = t.y, n[2] = l, n[3] = o) : o = n[3];
|
|
628
|
+
const a = t.x + t.width;
|
|
629
|
+
let s;
|
|
630
|
+
n[4] !== e.y || n[5] !== t.x || n[6] !== a ? (s = /* @__PURE__ */ r("line", { x1: t.x, x2: a, y1: e.y, y2: e.y }), n[4] = e.y, n[5] = t.x, n[6] = a, n[7] = s) : s = n[7];
|
|
631
|
+
let i;
|
|
632
|
+
return n[8] !== o || n[9] !== s ? (i = /* @__PURE__ */ z("g", { pointerEvents: "none", stroke: "var(--chakra-colors-border-emphasized)", strokeWidth: "1", children: [
|
|
633
|
+
o,
|
|
634
|
+
s
|
|
635
|
+
] }), n[8] = o, n[9] = s, n[10] = i) : i = n[10], i;
|
|
636
|
+
}, lt = (n) => {
|
|
637
|
+
const e = P(47), {
|
|
638
|
+
data: t,
|
|
639
|
+
dataKey: l,
|
|
640
|
+
color: o,
|
|
641
|
+
height: a,
|
|
642
|
+
ariaLabel: s,
|
|
643
|
+
tooltipLabel: i,
|
|
644
|
+
tooltipValue: c,
|
|
645
|
+
tooltipSeriesLabel: d,
|
|
646
|
+
layout: m,
|
|
647
|
+
categoryKey: u,
|
|
648
|
+
domain: f,
|
|
649
|
+
barSize: b,
|
|
650
|
+
barCategoryGap: h
|
|
651
|
+
} = n, g = m === void 0 ? "horizontal" : m, S = h === void 0 ? 1 : h;
|
|
652
|
+
let y;
|
|
653
|
+
e[0] !== o || e[1] !== l ? (y = [{
|
|
654
|
+
name: l,
|
|
655
|
+
color: o
|
|
656
|
+
}], e[0] = o, e[1] = l, e[2] = y) : y = e[2];
|
|
657
|
+
let x;
|
|
658
|
+
e[3] !== t || e[4] !== y ? (x = {
|
|
659
|
+
data: t,
|
|
660
|
+
series: y
|
|
661
|
+
}, e[3] = t, e[4] = y, e[5] = x) : x = e[5];
|
|
662
|
+
const v = Qt(x);
|
|
663
|
+
let C;
|
|
664
|
+
e[6] !== l ? (C = (j) => j[l], e[6] = l, e[7] = C) : C = e[7];
|
|
665
|
+
const p = C;
|
|
666
|
+
let w;
|
|
667
|
+
e[8] !== u ? (w = u ? (j) => j[u] : void 0, e[8] = u, e[9] = w) : w = e[9];
|
|
668
|
+
const I = w, k = v.data;
|
|
669
|
+
let _;
|
|
670
|
+
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = {
|
|
671
|
+
top: 2,
|
|
672
|
+
right: 0,
|
|
673
|
+
bottom: 0,
|
|
674
|
+
left: 0
|
|
675
|
+
}, e[10] = _) : _ = e[10];
|
|
676
|
+
let $;
|
|
677
|
+
e[11] !== f || e[12] !== I || e[13] !== g ? ($ = g === "vertical" ? /* @__PURE__ */ z(ut, { children: [
|
|
678
|
+
/* @__PURE__ */ r(en, { type: "number", domain: f, hide: !0 }),
|
|
679
|
+
/* @__PURE__ */ r(tn, { type: "category", dataKey: I, hide: !0 })
|
|
680
|
+
] }) : null, e[11] = f, e[12] = I, e[13] = g, e[14] = $) : $ = e[14];
|
|
681
|
+
let E;
|
|
682
|
+
e[15] !== v || e[16] !== o ? (E = v.color(o), e[15] = v, e[16] = o, e[17] = E) : E = e[17];
|
|
683
|
+
let T;
|
|
684
|
+
e[18] !== b || e[19] !== p || e[20] !== E ? (T = /* @__PURE__ */ r(nn, { dataKey: p, fill: E, barSize: b, isAnimationActive: !1 }), e[18] = b, e[19] = p, e[20] = E, e[21] = T) : T = e[21];
|
|
685
|
+
let V;
|
|
686
|
+
e[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = {
|
|
687
|
+
x: !0,
|
|
688
|
+
y: !0
|
|
689
|
+
}, e[22] = V) : V = e[22];
|
|
690
|
+
let F;
|
|
691
|
+
e[23] !== i ? (F = (j, q) => {
|
|
692
|
+
const G = q[0]?.payload;
|
|
693
|
+
return G ? i(G) : j;
|
|
694
|
+
}, e[23] = i, e[24] = F) : F = e[24];
|
|
695
|
+
let H;
|
|
696
|
+
e[25] !== d || e[26] !== c ? (H = (j) => [c(j), d], e[25] = d, e[26] = c, e[27] = H) : H = e[27];
|
|
697
|
+
let N;
|
|
698
|
+
e[28] !== F || e[29] !== H ? (N = /* @__PURE__ */ r(Le.Tooltip, { labelFormatter: F, formatter: H }), e[28] = F, e[29] = H, e[30] = N) : N = e[30];
|
|
699
|
+
let O;
|
|
700
|
+
e[31] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ r(cl, {}), e[31] = O) : O = e[31];
|
|
701
|
+
let W;
|
|
702
|
+
e[32] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = {
|
|
703
|
+
zIndex: 1800
|
|
704
|
+
}, e[32] = W) : W = e[32];
|
|
705
|
+
let A;
|
|
706
|
+
e[33] !== N ? (A = /* @__PURE__ */ r(ln, { allowEscapeViewBox: V, content: N, cursor: O, isAnimationActive: !1, wrapperStyle: W }), e[33] = N, e[34] = A) : A = e[34];
|
|
707
|
+
let D;
|
|
708
|
+
e[35] !== S || e[36] !== v.data || e[37] !== g || e[38] !== T || e[39] !== A || e[40] !== $ ? (D = /* @__PURE__ */ z(on, { responsive: !0, data: k, layout: g, margin: _, barCategoryGap: S, children: [
|
|
709
|
+
$,
|
|
710
|
+
T,
|
|
711
|
+
A
|
|
712
|
+
] }), e[35] = S, e[36] = v.data, e[37] = g, e[38] = T, e[39] = A, e[40] = $, e[41] = D) : D = e[41];
|
|
713
|
+
let M;
|
|
714
|
+
return e[42] !== s || e[43] !== v || e[44] !== a || e[45] !== D ? (M = /* @__PURE__ */ r(Le.Root, { chart: v, height: a, aspectRatio: "auto", cursor: "crosshair", "aria-label": s, children: D }), e[42] = s, e[43] = v, e[44] = a, e[45] = D, e[46] = M) : M = e[46], M;
|
|
715
|
+
}, dl = (n) => me(n) ? n.sortValue : n, Me = (n, e) => n.map((t) => dl(t[e])).filter((t) => t != null && t !== ""), ul = (n, e) => new Set(Me(n, e)).size, ml = (n, e, t) => {
|
|
716
|
+
const l = Me(n, e), o = /* @__PURE__ */ new Map();
|
|
717
|
+
for (const c of l)
|
|
718
|
+
o.set(c, (o.get(c) ?? 0) + 1);
|
|
719
|
+
const a = [...o.entries()].map(([c, d]) => ({
|
|
720
|
+
label: String(c),
|
|
721
|
+
count: d,
|
|
722
|
+
percentage: Math.round(d / l.length * 100)
|
|
723
|
+
})).sort((c, d) => d.count - c.count || c.label.localeCompare(d.label)), s = a.slice(0, t), i = a.slice(t).reduce((c, d) => c + d.count, 0);
|
|
724
|
+
return i === 0 ? s : [...s, {
|
|
725
|
+
label: "Other",
|
|
726
|
+
count: i,
|
|
727
|
+
percentage: Math.round(i / l.length * 100)
|
|
728
|
+
}];
|
|
729
|
+
}, fl = (n, e, t) => {
|
|
730
|
+
const l = Me(n, e).filter((c) => typeof c == "number");
|
|
731
|
+
if (l.length === 0) return null;
|
|
732
|
+
const o = Math.min(...l), a = Math.max(...l), s = (a - o) / t, i = Array.from({
|
|
733
|
+
length: t
|
|
734
|
+
}, (c, d) => ({
|
|
735
|
+
start: o + s * d,
|
|
736
|
+
end: o + s * (d + 1),
|
|
737
|
+
count: 0
|
|
738
|
+
}));
|
|
739
|
+
for (const c of l) {
|
|
740
|
+
const d = c === a || s === 0 ? t - 1 : Math.floor((c - o) / s);
|
|
741
|
+
i[d].count += 1;
|
|
742
|
+
}
|
|
743
|
+
return {
|
|
744
|
+
min: o,
|
|
745
|
+
max: a,
|
|
746
|
+
bins: i
|
|
747
|
+
};
|
|
748
|
+
}, Z = new Intl.NumberFormat(void 0, {
|
|
749
|
+
maximumFractionDigits: 2
|
|
750
|
+
}).format, ot = "vis.categorical.1", rt = (n) => {
|
|
751
|
+
const e = P(10), {
|
|
752
|
+
value: t,
|
|
753
|
+
count: l
|
|
754
|
+
} = n;
|
|
755
|
+
let o;
|
|
756
|
+
e[0] !== t ? (o = /* @__PURE__ */ r(B, { textStyle: "label/L/medium", lineHeight: "1", maxWidth: "100%", truncate: !0, children: t }), e[0] = t, e[1] = o) : o = e[1];
|
|
757
|
+
let a;
|
|
758
|
+
e[2] !== l ? (a = Z(l), e[2] = l, e[3] = a) : a = e[3];
|
|
759
|
+
const s = l === 1 ? "value" : "values";
|
|
760
|
+
let i;
|
|
761
|
+
e[4] !== a || e[5] !== s ? (i = /* @__PURE__ */ z(B, { textStyle: "label/XS", color: "fg.muted", children: [
|
|
762
|
+
a,
|
|
763
|
+
" ",
|
|
764
|
+
s
|
|
765
|
+
] }), e[4] = a, e[5] = s, e[6] = i) : i = e[6];
|
|
766
|
+
let c;
|
|
767
|
+
return e[7] !== o || e[8] !== i ? (c = /* @__PURE__ */ z(U, { "data-single-value-stat": !0, direction: "column", gap: "2xs", alignItems: "flex-start", minWidth: "0", children: [
|
|
768
|
+
o,
|
|
769
|
+
i
|
|
770
|
+
] }), e[7] = o, e[8] = i, e[9] = c) : c = e[9], c;
|
|
771
|
+
}, hl = (n) => {
|
|
772
|
+
const e = P(22), {
|
|
773
|
+
rows: t,
|
|
774
|
+
columnId: l
|
|
775
|
+
} = n;
|
|
776
|
+
let o, a, s, i, c, d, m, u;
|
|
777
|
+
if (e[0] !== l || e[1] !== t) {
|
|
778
|
+
const g = ul(t, l);
|
|
779
|
+
a = U, d = "column", m = "2xs", u = "flex-start", o = B, s = "label/L/medium", i = "1", c = Z(g), e[0] = l, e[1] = t, e[2] = o, e[3] = a, e[4] = s, e[5] = i, e[6] = c, e[7] = d, e[8] = m, e[9] = u;
|
|
780
|
+
} else
|
|
781
|
+
o = e[2], a = e[3], s = e[4], i = e[5], c = e[6], d = e[7], m = e[8], u = e[9];
|
|
782
|
+
let f;
|
|
783
|
+
e[10] !== o || e[11] !== s || e[12] !== i || e[13] !== c ? (f = /* @__PURE__ */ r(o, { textStyle: s, lineHeight: i, children: c }), e[10] = o, e[11] = s, e[12] = i, e[13] = c, e[14] = f) : f = e[14];
|
|
784
|
+
let b;
|
|
785
|
+
e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ r(B, { textStyle: "label/XS/regular", color: "fg.muted", children: "unique values" }), e[15] = b) : b = e[15];
|
|
786
|
+
let h;
|
|
787
|
+
return e[16] !== a || e[17] !== d || e[18] !== m || e[19] !== u || e[20] !== f ? (h = /* @__PURE__ */ z(a, { direction: d, gap: m, alignItems: u, children: [
|
|
788
|
+
f,
|
|
789
|
+
b
|
|
790
|
+
] }), e[16] = a, e[17] = d, e[18] = m, e[19] = u, e[20] = f, e[21] = h) : h = e[21], h;
|
|
791
|
+
}, gl = (n) => {
|
|
792
|
+
const e = P(36), {
|
|
793
|
+
rows: t,
|
|
794
|
+
columnId: l,
|
|
795
|
+
binCount: o
|
|
796
|
+
} = n;
|
|
797
|
+
let a, s, i, c, d, m, u, f, b, h, g, S, y, x;
|
|
798
|
+
if (e[0] !== o || e[1] !== l || e[2] !== t) {
|
|
799
|
+
m = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
800
|
+
e: {
|
|
801
|
+
const w = fl(t, l, o);
|
|
802
|
+
if (!w) {
|
|
803
|
+
let k;
|
|
804
|
+
e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ r(B, { textStyle: "label/XS/regular", color: "fg.muted", children: "No numeric values" }), e[17] = k) : k = e[17], m = k;
|
|
805
|
+
break e;
|
|
806
|
+
}
|
|
807
|
+
const I = w.bins.reduce(yl, 0);
|
|
808
|
+
if (w.min === w.max) {
|
|
809
|
+
m = /* @__PURE__ */ r(rt, { value: Z(w.min), count: I });
|
|
810
|
+
break e;
|
|
811
|
+
}
|
|
812
|
+
i = U, g = "column", S = "100%", y = "2xs", x = /* @__PURE__ */ r(lt, { data: w.bins, dataKey: "count", color: ot, height: "40px", ariaLabel: `Distribution for ${l}`, tooltipLabel: Cl, tooltipValue: wl, tooltipSeriesLabel: "Count" }), s = U, f = "space-between", b = "xs", h = /* @__PURE__ */ r(B, { textStyle: "label/XS/regular", color: "fg.muted", children: Z(w.min) }), a = B, c = "label/XS/regular", d = "fg.muted", u = Z(w.max);
|
|
813
|
+
}
|
|
814
|
+
e[0] = o, e[1] = l, e[2] = t, e[3] = a, e[4] = s, e[5] = i, e[6] = c, e[7] = d, e[8] = m, e[9] = u, e[10] = f, e[11] = b, e[12] = h, e[13] = g, e[14] = S, e[15] = y, e[16] = x;
|
|
815
|
+
} else
|
|
816
|
+
a = e[3], s = e[4], i = e[5], c = e[6], d = e[7], m = e[8], u = e[9], f = e[10], b = e[11], h = e[12], g = e[13], S = e[14], y = e[15], x = e[16];
|
|
817
|
+
if (m !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
|
|
818
|
+
return m;
|
|
819
|
+
let v;
|
|
820
|
+
e[18] !== a || e[19] !== c || e[20] !== d || e[21] !== u ? (v = /* @__PURE__ */ r(a, { textStyle: c, color: d, children: u }), e[18] = a, e[19] = c, e[20] = d, e[21] = u, e[22] = v) : v = e[22];
|
|
821
|
+
let C;
|
|
822
|
+
e[23] !== s || e[24] !== v || e[25] !== f || e[26] !== b || e[27] !== h ? (C = /* @__PURE__ */ z(s, { justifyContent: f, gap: b, children: [
|
|
823
|
+
h,
|
|
824
|
+
v
|
|
825
|
+
] }), e[23] = s, e[24] = v, e[25] = f, e[26] = b, e[27] = h, e[28] = C) : C = e[28];
|
|
826
|
+
let p;
|
|
827
|
+
return e[29] !== i || e[30] !== C || e[31] !== g || e[32] !== S || e[33] !== y || e[34] !== x ? (p = /* @__PURE__ */ z(i, { direction: g, width: S, gap: y, children: [
|
|
828
|
+
x,
|
|
829
|
+
C
|
|
830
|
+
] }), e[29] = i, e[30] = C, e[31] = g, e[32] = S, e[33] = y, e[34] = x, e[35] = p) : p = e[35], p;
|
|
831
|
+
}, bl = (n) => {
|
|
832
|
+
const e = P(15), {
|
|
833
|
+
rows: t,
|
|
834
|
+
columnId: l,
|
|
835
|
+
limit: o
|
|
836
|
+
} = n;
|
|
837
|
+
let a, s, i, c, d, m;
|
|
838
|
+
if (e[0] !== l || e[1] !== o || e[2] !== t) {
|
|
839
|
+
m = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
840
|
+
e: {
|
|
841
|
+
const f = ml(t, l, o);
|
|
842
|
+
if (f.length === 1 && f[0]) {
|
|
843
|
+
m = /* @__PURE__ */ r(rt, { value: f[0].label, count: f[0].count });
|
|
844
|
+
break e;
|
|
845
|
+
}
|
|
846
|
+
a = U, s = "column", i = "100%", c = "2xs", d = f.map(Il);
|
|
847
|
+
}
|
|
848
|
+
e[0] = l, e[1] = o, e[2] = t, e[3] = a, e[4] = s, e[5] = i, e[6] = c, e[7] = d, e[8] = m;
|
|
849
|
+
} else
|
|
850
|
+
a = e[3], s = e[4], i = e[5], c = e[6], d = e[7], m = e[8];
|
|
851
|
+
if (m !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
|
|
852
|
+
return m;
|
|
853
|
+
let u;
|
|
854
|
+
return e[9] !== a || e[10] !== s || e[11] !== i || e[12] !== c || e[13] !== d ? (u = /* @__PURE__ */ r(a, { direction: s, width: i, gap: c, children: d }), e[9] = a, e[10] = s, e[11] = i, e[12] = c, e[13] = d, e[14] = u) : u = e[14], u;
|
|
855
|
+
}, pl = (n) => {
|
|
856
|
+
const e = P(11), {
|
|
857
|
+
rows: t,
|
|
858
|
+
columnId: l,
|
|
859
|
+
stat: o
|
|
860
|
+
} = n;
|
|
861
|
+
if (o.type === "unique") {
|
|
862
|
+
let i;
|
|
863
|
+
return e[0] !== l || e[1] !== t ? (i = /* @__PURE__ */ r(hl, { rows: t, columnId: l }), e[0] = l, e[1] = t, e[2] = i) : i = e[2], i;
|
|
864
|
+
}
|
|
865
|
+
if (o.type === "histogram") {
|
|
866
|
+
const i = o.bins ?? 10;
|
|
867
|
+
let c;
|
|
868
|
+
return e[3] !== l || e[4] !== t || e[5] !== i ? (c = /* @__PURE__ */ r(gl, { rows: t, columnId: l, binCount: i }), e[3] = l, e[4] = t, e[5] = i, e[6] = c) : c = e[6], c;
|
|
869
|
+
}
|
|
870
|
+
const a = o.limit ?? 2;
|
|
871
|
+
let s;
|
|
872
|
+
return e[7] !== l || e[8] !== t || e[9] !== a ? (s = /* @__PURE__ */ r(bl, { rows: t, columnId: l, limit: a }), e[7] = l, e[8] = t, e[9] = a, e[10] = s) : s = e[10], s;
|
|
873
|
+
}, Sl = (n) => {
|
|
874
|
+
const e = P(12), {
|
|
875
|
+
header: t,
|
|
876
|
+
headerGroup: l,
|
|
877
|
+
rows: o,
|
|
878
|
+
columnStats: a,
|
|
879
|
+
fullWidth: s
|
|
880
|
+
} = n, i = a[t.column.id], c = i?.type;
|
|
881
|
+
let d;
|
|
882
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = {
|
|
883
|
+
borderRight: "none"
|
|
884
|
+
}, e[0] = d) : d = e[0];
|
|
885
|
+
const m = s && l.headers.indexOf(t) === l.headers.length - 1 ? void 0 : `calc(var(--header-${t.id}-size) * 1px)`;
|
|
886
|
+
let u;
|
|
887
|
+
e[1] !== m ? (u = {
|
|
888
|
+
width: m
|
|
889
|
+
}, e[1] = m, e[2] = u) : u = e[2];
|
|
890
|
+
let f;
|
|
891
|
+
e[3] !== t.column.id || e[4] !== o || e[5] !== i ? (f = i ? /* @__PURE__ */ r(pl, { rows: o, columnId: t.column.id, stat: i }) : null, e[3] = t.column.id, e[4] = o, e[5] = i, e[6] = f) : f = e[6];
|
|
892
|
+
let b;
|
|
893
|
+
return e[7] !== t.column.id || e[8] !== c || e[9] !== u || e[10] !== f ? (b = /* @__PURE__ */ r(te.ColumnHeader, { "data-column-id": t.column.id, "data-stat-type": c, borderRight: "1px solid", _last: d, borderColor: "border.subtle", padding: "xs", verticalAlign: "middle", overflow: "hidden", style: u, children: f }), e[7] = t.column.id, e[8] = c, e[9] = u, e[10] = f, e[11] = b) : b = e[11], b;
|
|
894
|
+
}, xl = (n) => {
|
|
895
|
+
const e = P(8), {
|
|
896
|
+
headerGroup: t,
|
|
897
|
+
rows: l,
|
|
898
|
+
columnStats: o,
|
|
899
|
+
fullWidth: a,
|
|
900
|
+
noBorder: s
|
|
901
|
+
} = n;
|
|
902
|
+
if (!t.headers.some((u) => o[u.column.id]))
|
|
903
|
+
return null;
|
|
904
|
+
const c = s ? "none" : "1px solid";
|
|
905
|
+
let d;
|
|
906
|
+
e[0] !== o || e[1] !== a || e[2] !== t || e[3] !== l ? (d = t.headers.map((u) => /* @__PURE__ */ r(Sl, { header: u, headerGroup: t, rows: l, columnStats: o, fullWidth: a }, u.id)), e[0] = o, e[1] = a, e[2] = t, e[3] = l, e[4] = d) : d = e[4];
|
|
907
|
+
let m;
|
|
908
|
+
return e[5] !== c || e[6] !== d ? (m = /* @__PURE__ */ r(te.Row, { className: "data-table-stats-row", borderRight: c, borderColor: "border.subtle", children: d }), e[5] = c, e[6] = d, e[7] = m) : m = e[7], m;
|
|
909
|
+
};
|
|
910
|
+
function yl(n, e) {
|
|
911
|
+
return n + e.count;
|
|
912
|
+
}
|
|
913
|
+
function Cl(n) {
|
|
914
|
+
return `${Z(n.start)} – ${Z(n.end)}`;
|
|
915
|
+
}
|
|
916
|
+
function wl(n) {
|
|
917
|
+
return `${Z(Number(n))} values`;
|
|
918
|
+
}
|
|
919
|
+
function vl(n) {
|
|
920
|
+
return `${n.label} · ${Z(n.count)} values`;
|
|
921
|
+
}
|
|
922
|
+
function Rl(n) {
|
|
923
|
+
return `${Z(Number(n))}%`;
|
|
924
|
+
}
|
|
925
|
+
function Il(n) {
|
|
926
|
+
return /* @__PURE__ */ z(ue, { position: "relative", height: "18px", children: [
|
|
927
|
+
/* @__PURE__ */ r(lt, { data: [n], dataKey: "percentage", categoryKey: "label", color: ot, height: "18px", ariaLabel: `${n.label}: ${n.percentage}%`, layout: "vertical", domain: [0, 100], barSize: 18, tooltipLabel: vl, tooltipValue: Rl, tooltipSeriesLabel: "Share" }),
|
|
928
|
+
/* @__PURE__ */ z(U, { position: "absolute", inset: "0", paddingX: "2xs", justifyContent: "space-between", gap: "xs", pointerEvents: "none", children: [
|
|
929
|
+
/* @__PURE__ */ r(B, { textStyle: "label/2XS", color: "fg.inverted", truncate: !0, children: n.label }),
|
|
930
|
+
/* @__PURE__ */ z(B, { textStyle: "label/2XS/medium", color: "fg.muted", children: [
|
|
931
|
+
n.percentage,
|
|
932
|
+
"%"
|
|
933
|
+
] })
|
|
934
|
+
] })
|
|
935
|
+
] }, n.label);
|
|
936
|
+
}
|
|
937
|
+
const zl = /* @__PURE__ */ new Set(["rowIndex", "rowSelection", "rowActions"]), kl = (n) => n === "asc" ? Ye : n === "desc" ? Ze : Dt, _l = (n) => {
|
|
938
|
+
const e = P(37), {
|
|
939
|
+
header: t,
|
|
940
|
+
headerGroup: l,
|
|
941
|
+
table: o,
|
|
942
|
+
fullWidth: a,
|
|
943
|
+
hasDescription: s
|
|
944
|
+
} = n;
|
|
945
|
+
let i, c, d;
|
|
946
|
+
if (e[0] !== t.column || e[1] !== o) {
|
|
947
|
+
c = t.column.getIsSorted();
|
|
948
|
+
let _;
|
|
949
|
+
e[5] !== t.column.id || e[6] !== o ? (_ = !zl.has(t.column.id) && o.getCoreRowModel().rows.length > 1, e[5] = t.column.id, e[6] = o, e[7] = _) : _ = e[7], i = _, d = kl(c), e[0] = t.column, e[1] = o, e[2] = i, e[3] = c, e[4] = d;
|
|
950
|
+
} else
|
|
951
|
+
i = e[2], c = e[3], d = e[4];
|
|
952
|
+
const m = d;
|
|
953
|
+
let u;
|
|
954
|
+
e[8] !== t ? (u = t.column.id === "rowSelection" ? "Select all" : Ie(t.column.columnDef.header, t.getContext()), e[8] = t, e[9] = u) : u = e[9];
|
|
955
|
+
const f = u, b = t.column.id;
|
|
956
|
+
let h;
|
|
957
|
+
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = {
|
|
958
|
+
borderRight: "none"
|
|
959
|
+
}, e[10] = h) : h = e[10];
|
|
960
|
+
const g = t.id, S = a && l.headers.indexOf(t) === l.headers.length - 1 ? void 0 : `calc(var(--header-${t.id}-size) * 1px)`;
|
|
961
|
+
let y;
|
|
962
|
+
e[11] !== S ? (y = {
|
|
963
|
+
width: S
|
|
964
|
+
}, e[11] = S, e[12] = y) : y = e[12];
|
|
965
|
+
let x;
|
|
966
|
+
e[13] !== t ? (x = Ie(t.column.columnDef.header, t.getContext()), e[13] = t, e[14] = x) : x = e[14];
|
|
967
|
+
let v;
|
|
968
|
+
e[15] !== x ? (v = /* @__PURE__ */ r(B, { as: "div", textStyle: "label/S/medium", lineHeight: "1.2", truncate: !0, children: x }), e[15] = x, e[16] = v) : v = e[16];
|
|
969
|
+
let C;
|
|
970
|
+
e[17] !== m || e[18] !== i || e[19] !== t.column || e[20] !== c ? (C = i && /* @__PURE__ */ z(L.Root, { children: [
|
|
971
|
+
/* @__PURE__ */ r(L.Trigger, { asChild: !0, children: /* @__PURE__ */ r(re, { ml: "2px", size: "2xs", "aria-label": c ? `Sorted ${c}` : "Sort column", variant: "ghost", visibility: c ? "visible" : "hidden", _groupHover: {
|
|
972
|
+
visibility: "visible"
|
|
973
|
+
}, children: /* @__PURE__ */ r(X, { as: m, boxSize: "14px" }) }) }),
|
|
974
|
+
/* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r(L.Positioner, { children: /* @__PURE__ */ z(L.Content, { zIndex: "popover", bg: "bg", children: [
|
|
975
|
+
/* @__PURE__ */ r(L.Item, { value: "sort-asc", asChild: !0, children: /* @__PURE__ */ r(se, { asChild: !0, variant: "full-width", label: "Sort ascending", icon: /* @__PURE__ */ r(X, { as: Ye, boxSize: "16px" }), disabled: c === "asc", onActivate: () => t.column.toggleSorting(!1) }) }),
|
|
976
|
+
/* @__PURE__ */ r(L.Item, { value: "sort-desc", asChild: !0, children: /* @__PURE__ */ r(se, { asChild: !0, variant: "full-width", label: "Sort descending", icon: /* @__PURE__ */ r(X, { as: Ze, boxSize: "16px" }), disabled: c === "desc", onActivate: () => t.column.toggleSorting(!0) }) }),
|
|
977
|
+
c && /* @__PURE__ */ r(L.Item, { value: "clear-sort", asChild: !0, children: /* @__PURE__ */ r(se, { asChild: !0, variant: "full-width", label: "Clear sort", onActivate: () => t.column.clearSorting() }) })
|
|
978
|
+
] }) }) })
|
|
979
|
+
] }), e[17] = m, e[18] = i, e[19] = t.column, e[20] = c, e[21] = C) : C = e[21];
|
|
980
|
+
let p;
|
|
981
|
+
e[22] !== t ? (p = t.column.getCanResize() && /* @__PURE__ */ r("span", { onDoubleClick: () => t.column.resetSize(), onMouseDown: t.getResizeHandler(), onTouchStart: t.getResizeHandler(), className: `resizer ${t.column.getIsResizing() ? "isResizing" : ""}` }), e[22] = t, e[23] = p) : p = e[23];
|
|
982
|
+
let w;
|
|
983
|
+
e[24] !== p || e[25] !== v || e[26] !== C ? (w = /* @__PURE__ */ z(U, { className: "group", alignItems: "center", justifyContent: "space-between", gap: "1", flex: "1", minW: "0", children: [
|
|
984
|
+
v,
|
|
985
|
+
C,
|
|
986
|
+
p
|
|
987
|
+
] }), e[24] = p, e[25] = v, e[26] = C, e[27] = w) : w = e[27];
|
|
988
|
+
let I;
|
|
989
|
+
e[28] !== s || e[29] !== w || e[30] !== f ? (I = /* @__PURE__ */ r(Ue, { content: f, disabled: s, children: w }), e[28] = s, e[29] = w, e[30] = f, e[31] = I) : I = e[31];
|
|
990
|
+
let k;
|
|
991
|
+
return e[32] !== t.column.id || e[33] !== t.id || e[34] !== I || e[35] !== y ? (k = /* @__PURE__ */ r(te.ColumnHeader, { "data-column-id": b, textTransform: "none", borderRight: "1px solid", _last: h, borderColor: "border.subtle", paddingX: "xs", paddingY: "xs", overflow: "hidden", position: "relative", verticalAlign: "middle", whiteSpace: "nowrap", style: y, children: I }, g), e[32] = t.column.id, e[33] = t.id, e[34] = I, e[35] = y, e[36] = k) : k = e[36], k;
|
|
992
|
+
}, Al = (n) => {
|
|
993
|
+
const e = P(20), {
|
|
994
|
+
cell: t,
|
|
995
|
+
row: l,
|
|
996
|
+
getCellContextMenuActions: o
|
|
997
|
+
} = n, a = t.column.columnDef.meta;
|
|
998
|
+
let s;
|
|
999
|
+
e[0] !== t || e[1] !== a ? (s = a?.getCellStyle?.(t.getValue()), e[0] = t, e[1] = a, e[2] = s) : s = e[2];
|
|
1000
|
+
const i = s;
|
|
1001
|
+
let c;
|
|
1002
|
+
if (e[3] !== t || e[4] !== o || e[5] !== l.id || e[6] !== l.original) {
|
|
1003
|
+
const y = {
|
|
1004
|
+
row: l.original,
|
|
1005
|
+
rowId: l.id,
|
|
1006
|
+
columnId: t.column.id,
|
|
1007
|
+
value: t.getValue()
|
|
1008
|
+
};
|
|
1009
|
+
c = o?.(y).map((x) => ({
|
|
1010
|
+
key: x.label,
|
|
1011
|
+
label: x.label,
|
|
1012
|
+
icon: x.icon,
|
|
1013
|
+
onClick: () => x.onSelect(y)
|
|
1014
|
+
})) ?? [], e[3] = t, e[4] = o, e[5] = l.id, e[6] = l.original, e[7] = c;
|
|
1015
|
+
} else
|
|
1016
|
+
c = e[7];
|
|
1017
|
+
const d = c, m = t.column.id;
|
|
1018
|
+
let u;
|
|
1019
|
+
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = {
|
|
1020
|
+
borderRight: "none"
|
|
1021
|
+
}, e[8] = u) : u = e[8];
|
|
1022
|
+
const f = t.id;
|
|
1023
|
+
let b;
|
|
1024
|
+
e[9] !== t ? (b = Ie(t.column.columnDef.cell, t.getContext()), e[9] = t, e[10] = b) : b = e[10];
|
|
1025
|
+
let h;
|
|
1026
|
+
e[11] !== t.column.id || e[12] !== t.id || e[13] !== i || e[14] !== b ? (h = /* @__PURE__ */ r(te.Cell, { "data-column-id": m, width: "fit-content", maxWidth: "12rem", overflow: "hidden", padding: "xs", borderRight: "1px solid", borderColor: "border.subtle", _last: u, borderBottom: "none", textStyle: "paragraph/S/regular", textOverflow: "ellipsis", whiteSpace: "nowrap", style: i, children: b }, f), e[11] = t.column.id, e[12] = t.id, e[13] = i, e[14] = b, e[15] = h) : h = e[15];
|
|
1027
|
+
const g = h;
|
|
1028
|
+
if (d.length === 0)
|
|
1029
|
+
return g;
|
|
1030
|
+
let S;
|
|
1031
|
+
return e[16] !== t.id || e[17] !== g || e[18] !== d ? (S = /* @__PURE__ */ r(Ot, { actions: d, children: g }, t.id), e[16] = t.id, e[17] = g, e[18] = d, e[19] = S) : S = e[19], S;
|
|
1032
|
+
}, $l = (n) => {
|
|
1033
|
+
const e = P(21), {
|
|
1034
|
+
row: t,
|
|
1035
|
+
noBorder: l,
|
|
1036
|
+
rowIsInteractive: o,
|
|
1037
|
+
rowIsActive: a,
|
|
1038
|
+
rowIsSelected: s,
|
|
1039
|
+
onRowClick: i,
|
|
1040
|
+
getCellContextMenuActions: c
|
|
1041
|
+
} = n, d = t.id, m = a ? "true" : void 0, u = s ? "true" : void 0, f = s ? "true" : void 0, b = o ? "pointer" : void 0;
|
|
1042
|
+
let h;
|
|
1043
|
+
e[0] !== i || e[1] !== t.original || e[2] !== o ? (h = o ? () => i?.(t.original) : void 0, e[0] = i, e[1] = t.original, e[2] = o, e[3] = h) : h = e[3];
|
|
1044
|
+
const g = l ? "none" : "1px solid", S = l ? "none" : "1px solid", y = l ? "none" : "1px solid";
|
|
1045
|
+
let x;
|
|
1046
|
+
e[4] !== y ? (x = {
|
|
1047
|
+
borderBottom: y,
|
|
1048
|
+
borderColor: "border.subtle"
|
|
1049
|
+
}, e[4] = y, e[5] = x) : x = e[5];
|
|
1050
|
+
const v = a ? "bg.active" : "bg";
|
|
1051
|
+
let C;
|
|
1052
|
+
e[6] !== c || e[7] !== t ? (C = t.getVisibleCells().map((w) => /* @__PURE__ */ r(Al, { cell: w, row: t, getCellContextMenuActions: c }, w.id)), e[6] = c, e[7] = t, e[8] = C) : C = e[8];
|
|
1053
|
+
let p;
|
|
1054
|
+
return e[9] !== t.id || e[10] !== m || e[11] !== v || e[12] !== C || e[13] !== u || e[14] !== f || e[15] !== b || e[16] !== h || e[17] !== g || e[18] !== S || e[19] !== x ? (p = /* @__PURE__ */ r(te.Row, { "data-active": m, "data-selected": u, "aria-selected": f, cursor: b, onClick: h, borderTop: g, borderBottom: "1px solid", borderRight: S, _last: x, borderColor: "border.subtle", background: v, children: C }, d), e[9] = t.id, e[10] = m, e[11] = v, e[12] = C, e[13] = u, e[14] = f, e[15] = b, e[16] = h, e[17] = g, e[18] = S, e[19] = x, e[20] = p) : p = e[20], p;
|
|
1055
|
+
};
|
|
1056
|
+
function Tl(n) {
|
|
1057
|
+
const e = P(71), {
|
|
1058
|
+
table: t,
|
|
1059
|
+
pageIndex: l,
|
|
1060
|
+
pageSize: o,
|
|
1061
|
+
pageSizeOptions: a
|
|
1062
|
+
} = n;
|
|
1063
|
+
let s;
|
|
1064
|
+
e[0] !== t ? (s = t.getPageCount(), e[0] = t, e[1] = s) : s = e[1];
|
|
1065
|
+
const i = Math.max(s, 1), c = l > 0, d = l < i - 1;
|
|
1066
|
+
let m;
|
|
1067
|
+
e[2] !== t ? (m = t.getCoreRowModel(), e[2] = t, e[3] = m) : m = e[3];
|
|
1068
|
+
let u;
|
|
1069
|
+
e[4] !== m.rows.length ? (u = /* @__PURE__ */ z(B, { textStyle: "label/S/regular", children: [
|
|
1070
|
+
m.rows.length,
|
|
1071
|
+
" rows"
|
|
1072
|
+
] }), e[4] = m.rows.length, e[5] = u) : u = e[5];
|
|
1073
|
+
let f;
|
|
1074
|
+
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ r(B, { textStyle: "label/S/regular", children: "Rows per page" }), e[6] = f) : f = e[6];
|
|
1075
|
+
let b;
|
|
1076
|
+
e[7] !== o ? (b = /* @__PURE__ */ r(L.Trigger, { asChild: !0, children: /* @__PURE__ */ r(ce, { size: "xs", variant: "outline", children: o }) }), e[7] = o, e[8] = b) : b = e[8];
|
|
1077
|
+
let h;
|
|
1078
|
+
if (e[9] !== o || e[10] !== a || e[11] !== t) {
|
|
1079
|
+
let Q;
|
|
1080
|
+
e[13] !== o || e[14] !== t ? (Q = (ne) => /* @__PURE__ */ r(L.Item, { value: `${ne}`, asChild: !0, children: /* @__PURE__ */ r(se, { asChild: !0, variant: "full-width", label: `${ne}`, isSelected: ne === o, onActivate: () => t.setPageSize(ne) }) }, ne), e[13] = o, e[14] = t, e[15] = Q) : Q = e[15], h = a.map(Q), e[9] = o, e[10] = a, e[11] = t, e[12] = h;
|
|
1081
|
+
} else
|
|
1082
|
+
h = e[12];
|
|
1083
|
+
let g;
|
|
1084
|
+
e[16] !== h ? (g = /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r(L.Positioner, { children: /* @__PURE__ */ r(L.Content, { zIndex: "popover", bg: "bg", children: h }) }) }), e[16] = h, e[17] = g) : g = e[17];
|
|
1085
|
+
let S;
|
|
1086
|
+
e[18] !== b || e[19] !== g ? (S = /* @__PURE__ */ z(U, { alignItems: "center", gap: "xs", marginRight: "sm", children: [
|
|
1087
|
+
f,
|
|
1088
|
+
/* @__PURE__ */ z(L.Root, { children: [
|
|
1089
|
+
b,
|
|
1090
|
+
g
|
|
1091
|
+
] })
|
|
1092
|
+
] }), e[18] = b, e[19] = g, e[20] = S) : S = e[20];
|
|
1093
|
+
let y;
|
|
1094
|
+
e[21] !== t ? (y = () => t.setPageIndex(0), e[21] = t, e[22] = y) : y = e[22];
|
|
1095
|
+
const x = !c;
|
|
1096
|
+
let v;
|
|
1097
|
+
e[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ r(X, { as: Pt, boxSize: "14px" }), e[23] = v) : v = e[23];
|
|
1098
|
+
let C;
|
|
1099
|
+
e[24] !== x || e[25] !== y ? (C = /* @__PURE__ */ r(re, { size: "xs", "aria-label": "Go to first page", onClick: y, disabled: x, children: v }), e[24] = x, e[25] = y, e[26] = C) : C = e[26];
|
|
1100
|
+
let p;
|
|
1101
|
+
e[27] !== l || e[28] !== t ? (p = () => t.setPageIndex(l - 1), e[27] = l, e[28] = t, e[29] = p) : p = e[29];
|
|
1102
|
+
const w = !c;
|
|
1103
|
+
let I;
|
|
1104
|
+
e[30] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ r(X, { as: Mt, boxSize: "14px" }), e[30] = I) : I = e[30];
|
|
1105
|
+
let k;
|
|
1106
|
+
e[31] !== p || e[32] !== w ? (k = /* @__PURE__ */ r(re, { size: "xs", "aria-label": "Go to previous page", onClick: p, disabled: w, children: I }), e[31] = p, e[32] = w, e[33] = k) : k = e[33];
|
|
1107
|
+
let _;
|
|
1108
|
+
e[34] !== l || e[35] !== t ? (_ = () => t.setPageIndex(l + 1), e[34] = l, e[35] = t, e[36] = _) : _ = e[36];
|
|
1109
|
+
const $ = !d;
|
|
1110
|
+
let E;
|
|
1111
|
+
e[37] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ r(X, { as: qe, boxSize: "14px" }), e[37] = E) : E = e[37];
|
|
1112
|
+
let T;
|
|
1113
|
+
e[38] !== _ || e[39] !== $ ? (T = /* @__PURE__ */ r(re, { size: "xs", "aria-label": "Go to next page", onClick: _, disabled: $, children: E }), e[38] = _, e[39] = $, e[40] = T) : T = e[40];
|
|
1114
|
+
let V;
|
|
1115
|
+
e[41] !== t ? (V = () => t.setPageIndex(t.getPageCount() - 1), e[41] = t, e[42] = V) : V = e[42];
|
|
1116
|
+
const F = !d;
|
|
1117
|
+
let H;
|
|
1118
|
+
e[43] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ r(X, { as: Nt, boxSize: "14px" }), e[43] = H) : H = e[43];
|
|
1119
|
+
let N;
|
|
1120
|
+
e[44] !== V || e[45] !== F ? (N = /* @__PURE__ */ r(re, { size: "xs", "aria-label": "Go to last page", onClick: V, disabled: F, children: H }), e[44] = V, e[45] = F, e[46] = N) : N = e[46];
|
|
1121
|
+
let O;
|
|
1122
|
+
e[47] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ r(B, { children: "Page" }), e[47] = O) : O = e[47];
|
|
1123
|
+
const W = `${l + 1}`;
|
|
1124
|
+
let A;
|
|
1125
|
+
e[48] !== t || e[49] !== i ? (A = (Q) => {
|
|
1126
|
+
const ne = Number.isNaN(Q.valueAsNumber) ? 1 : Q.valueAsNumber, fe = Math.min(i, Math.max(1, ne));
|
|
1127
|
+
t.setPageIndex(fe - 1);
|
|
1128
|
+
}, e[48] = t, e[49] = i, e[50] = A) : A = e[50];
|
|
1129
|
+
let D;
|
|
1130
|
+
e[51] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ r(Yt, { className: "nodrag" }), e[51] = D) : D = e[51];
|
|
1131
|
+
let M;
|
|
1132
|
+
e[52] !== W || e[53] !== A || e[54] !== i ? (M = /* @__PURE__ */ r(Zt, { margin: "2xs", width: "3rem", size: "xs", min: 1, max: i, value: W, onValueChange: A, children: D }), e[52] = W, e[53] = A, e[54] = i, e[55] = M) : M = e[55];
|
|
1133
|
+
let j;
|
|
1134
|
+
e[56] !== i ? (j = /* @__PURE__ */ z(B, { children: [
|
|
1135
|
+
"of ",
|
|
1136
|
+
i
|
|
1137
|
+
] }), e[56] = i, e[57] = j) : j = e[57];
|
|
1138
|
+
let q;
|
|
1139
|
+
e[58] !== M || e[59] !== j ? (q = /* @__PURE__ */ z(U, { alignItems: "center", height: "100%", marginLeft: "sm", marginRight: "md", gap: "xs", children: [
|
|
1140
|
+
O,
|
|
1141
|
+
M,
|
|
1142
|
+
j
|
|
1143
|
+
] }), e[58] = M, e[59] = j, e[60] = q) : q = e[60];
|
|
1144
|
+
let G;
|
|
1145
|
+
e[61] !== C || e[62] !== k || e[63] !== T || e[64] !== N || e[65] !== q || e[66] !== S ? (G = /* @__PURE__ */ z(Se, { alignItems: "center", direction: "row", justifyContent: "flex-end", paddingY: "xs", children: [
|
|
1146
|
+
S,
|
|
1147
|
+
C,
|
|
1148
|
+
k,
|
|
1149
|
+
T,
|
|
1150
|
+
N,
|
|
1151
|
+
q
|
|
1152
|
+
] }), e[61] = C, e[62] = k, e[63] = T, e[64] = N, e[65] = q, e[66] = S, e[67] = G) : G = e[67];
|
|
1153
|
+
let ie;
|
|
1154
|
+
return e[68] !== u || e[69] !== G ? (ie = /* @__PURE__ */ z(U, { alignItems: "center", justifyContent: "space-between", borderTop: "1px solid", borderColor: "border.subtle", paddingX: "xs", children: [
|
|
1155
|
+
u,
|
|
1156
|
+
G
|
|
1157
|
+
] }), e[68] = u, e[69] = G, e[70] = ie) : ie = e[70], ie;
|
|
1158
|
+
}
|
|
1159
|
+
function Vl(n) {
|
|
1160
|
+
const e = P(24), {
|
|
1161
|
+
selectedCount: t,
|
|
1162
|
+
totalCount: l,
|
|
1163
|
+
onClearSelection: o,
|
|
1164
|
+
onSelectAll: a,
|
|
1165
|
+
actions: s,
|
|
1166
|
+
selectedRows: i
|
|
1167
|
+
} = n, c = s.length === 1 ? s[0]?.label : "Actions";
|
|
1168
|
+
let d;
|
|
1169
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ r(X, { as: Lt, boxSize: "16px" }), e[0] = d) : d = e[0];
|
|
1170
|
+
let m;
|
|
1171
|
+
e[1] !== o ? (m = /* @__PURE__ */ r(re, { "aria-label": "clear-selection", onClick: o, size: "xs", children: d }), e[1] = o, e[2] = m) : m = e[2];
|
|
1172
|
+
let u;
|
|
1173
|
+
e[3] !== t ? (u = /* @__PURE__ */ z(B, { children: [
|
|
1174
|
+
t,
|
|
1175
|
+
" rows selected"
|
|
1176
|
+
] }), e[3] = t, e[4] = u) : u = e[4];
|
|
1177
|
+
let f;
|
|
1178
|
+
e[5] !== a || e[6] !== t || e[7] !== l ? (f = t !== l && /* @__PURE__ */ z(ce, { size: "xs", onClick: a, children: [
|
|
1179
|
+
"Select all ",
|
|
1180
|
+
l,
|
|
1181
|
+
" rows"
|
|
1182
|
+
] }), e[5] = a, e[6] = t, e[7] = l, e[8] = f) : f = e[8];
|
|
1183
|
+
let b;
|
|
1184
|
+
e[9] !== c || e[10] !== s[0] || e[11] !== s.length || e[12] !== i ? (b = s.length === 1 && s[0] ? /* @__PURE__ */ r(ce, { size: "xs", onClick: () => s[0]?.onSelect(i), children: c }) : null, e[9] = c, e[10] = s[0], e[11] = s.length, e[12] = i, e[13] = b) : b = e[13];
|
|
1185
|
+
let h;
|
|
1186
|
+
e[14] !== c || e[15] !== s || e[16] !== i ? (h = s.length > 1 ? /* @__PURE__ */ z(L.Root, { children: [
|
|
1187
|
+
/* @__PURE__ */ r(L.Trigger, { asChild: !0, children: /* @__PURE__ */ r(ce, { size: "xs", children: c }) }),
|
|
1188
|
+
/* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r(L.Positioner, { children: /* @__PURE__ */ r(L.Content, { zIndex: "popover", bg: "bg", children: s.map((S) => /* @__PURE__ */ r(L.Item, { value: S.label, asChild: !0, children: /* @__PURE__ */ r(se, { asChild: !0, variant: "full-width", tone: S.destructive ? "danger" : "default", label: S.label, icon: S.icon, onActivate: () => S.onSelect(i) }) }, S.label)) }) }) })
|
|
1189
|
+
] }) : null, e[14] = c, e[15] = s, e[16] = i, e[17] = h) : h = e[17];
|
|
1190
|
+
let g;
|
|
1191
|
+
return e[18] !== m || e[19] !== u || e[20] !== f || e[21] !== b || e[22] !== h ? (g = /* @__PURE__ */ r(U, { position: "absolute", insetX: "sm", bottom: "sm", zIndex: "popover", justifyContent: "center", pointerEvents: "none", children: /* @__PURE__ */ z(Se, { role: "toolbar", "aria-label": "Selection actions", direction: "row", alignItems: "center", layerStyle: "floatingBar", pointerEvents: "auto", maxWidth: "100%", overflowX: "auto", children: [
|
|
1192
|
+
m,
|
|
1193
|
+
u,
|
|
1194
|
+
f,
|
|
1195
|
+
b,
|
|
1196
|
+
h
|
|
1197
|
+
] }) }), e[18] = m, e[19] = u, e[20] = f, e[21] = b, e[22] = h, e[23] = g) : g = e[23], g;
|
|
1198
|
+
}
|
|
1199
|
+
const ql = (n) => {
|
|
1200
|
+
const {
|
|
1201
|
+
data: e,
|
|
1202
|
+
noBorder: t,
|
|
1203
|
+
fullWidth: l,
|
|
1204
|
+
hiddenColumns: o,
|
|
1205
|
+
onRowClick: a,
|
|
1206
|
+
isRowInteractive: s,
|
|
1207
|
+
activeRowId: i,
|
|
1208
|
+
columnIcons: c,
|
|
1209
|
+
columnDescriptions: d,
|
|
1210
|
+
compactHeaders: m,
|
|
1211
|
+
columnStats: u,
|
|
1212
|
+
columnRenderers: f,
|
|
1213
|
+
initialPageSize: b,
|
|
1214
|
+
pageSizeOptions: h = [10, 20, 30, 50, 100],
|
|
1215
|
+
rowActions: g = [],
|
|
1216
|
+
getRowId: S,
|
|
1217
|
+
toolbarStorageKey: y,
|
|
1218
|
+
enableRowActivation: x = !1,
|
|
1219
|
+
getCellContextMenuActions: v
|
|
1220
|
+
} = n, [C, p] = le([]), [w, I] = le(() => ({
|
|
1221
|
+
pageIndex: 0,
|
|
1222
|
+
pageSize: Yn({
|
|
1223
|
+
initialPageSize: b
|
|
1224
|
+
})
|
|
1225
|
+
})), [k, _] = le({}), [$, E] = le(!0), [T, V] = le(() => {
|
|
1226
|
+
const R = new Set(o ?? []);
|
|
1227
|
+
return Object.keys(e[0] || {}).filter((K) => !R.has(K));
|
|
1228
|
+
}), [F, H] = le(() => /* @__PURE__ */ new Set()), N = new Set(o ?? []), O = Object.keys(e[0] || {}).filter((R) => !N.has(R)), W = Xe(O, T), A = new Set(W.filter((R) => !F.has(R))), D = W.filter((R) => A.has(R)), M = el(n), j = Qn(n), q = ol(e, W, m), G = rl(e, W, S), ie = al({
|
|
1229
|
+
toolbarStorageKey: y,
|
|
1230
|
+
columnKeys: O
|
|
1231
|
+
}), Q = wt(ie, (R) => R.filters, {
|
|
1232
|
+
settings: {
|
|
1233
|
+
viewMode: "list"
|
|
1234
|
+
}
|
|
1235
|
+
}), fe = il(G, Q, q).map((R) => R.sourceRow), it = Wn(e, D, {
|
|
1236
|
+
columnIcons: c,
|
|
1237
|
+
columnDescriptions: d,
|
|
1238
|
+
compactHeaders: m,
|
|
1239
|
+
enableSelection: M,
|
|
1240
|
+
rowActions: g,
|
|
1241
|
+
selectedRowIds: k,
|
|
1242
|
+
columnRenderers: f
|
|
1243
|
+
}), J = ht({
|
|
1244
|
+
data: fe,
|
|
1245
|
+
columns: it,
|
|
1246
|
+
defaultColumn: {
|
|
1247
|
+
size: 150,
|
|
1248
|
+
minSize: 40,
|
|
1249
|
+
maxSize: 800
|
|
1250
|
+
},
|
|
1251
|
+
state: {
|
|
1252
|
+
sorting: C,
|
|
1253
|
+
pagination: w,
|
|
1254
|
+
rowSelection: k
|
|
1255
|
+
},
|
|
1256
|
+
getRowId: (R, K) => Pe(R, K, S),
|
|
1257
|
+
columnResizeMode: "onChange",
|
|
1258
|
+
columnResizeDirection: "ltr",
|
|
1259
|
+
onSortingChange: p,
|
|
1260
|
+
onPaginationChange: I,
|
|
1261
|
+
onRowSelectionChange: _,
|
|
1262
|
+
getSortedRowModel: pt(),
|
|
1263
|
+
getCoreRowModel: bt(),
|
|
1264
|
+
getPaginationRowModel: gt(),
|
|
1265
|
+
enableMultiRowSelection: M,
|
|
1266
|
+
enableRowSelection: M,
|
|
1267
|
+
autoResetAll: !1
|
|
1268
|
+
});
|
|
1269
|
+
Ge(() => {
|
|
1270
|
+
const R = J.getPageCount();
|
|
1271
|
+
R === 0 || w.pageIndex < R || I((K) => ({
|
|
1272
|
+
...K,
|
|
1273
|
+
pageIndex: Math.max(R - 1, 0)
|
|
1274
|
+
}));
|
|
1275
|
+
}, [w.pageIndex, J]);
|
|
1276
|
+
const st = (() => {
|
|
1277
|
+
const R = J.getFlatHeaders(), K = {};
|
|
1278
|
+
for (let ee = 0; ee < R.length; ee++) {
|
|
1279
|
+
const Y = R[ee];
|
|
1280
|
+
K[`--header-${Y.id}-size`] = Y.getSize(), K[`--col-${Y.column.id}-size`] = Y.column.getSize();
|
|
1281
|
+
}
|
|
1282
|
+
return K;
|
|
1283
|
+
})(), we = J.getSelectedRowModel().rows, at = J.getCoreRowModel().rows, ct = Zn(we), dt = /* @__PURE__ */ r(Xn, { columns: W.map((R) => ({
|
|
1284
|
+
id: R,
|
|
1285
|
+
label: m?.[R] ?? R
|
|
1286
|
+
})), visibleColumnIds: A, showStats: $, statsAvailable: !!u, onColumnVisibilityChange: (R, K) => H((ee) => {
|
|
1287
|
+
const Y = new Set(ee);
|
|
1288
|
+
return K ? Y.delete(R) : Y.add(R), Y;
|
|
1289
|
+
}), onColumnReorder: (R, K) => V((ee) => sl(Xe(O, ee), R, K)), onStatsVisibilityChange: E });
|
|
1290
|
+
return /* @__PURE__ */ z(U, { direction: "column", height: "100%", width: "100%", children: [
|
|
1291
|
+
/* @__PURE__ */ r(Un, { rows: G, storageKey: ie, attributes: q, columnControl: dt }),
|
|
1292
|
+
/* @__PURE__ */ z(ue, { position: "relative", flex: "1", minHeight: "0", children: [
|
|
1293
|
+
/* @__PURE__ */ r(Ae, { height: "100%", maxWidth: "unset", showHorizontalScrollbar: !0, children: /* @__PURE__ */ z(te.Root, { className: `data-table${l ? " full-width" : ""}`, style: {
|
|
1294
|
+
...st,
|
|
1295
|
+
width: l ? "100%" : J.getTotalSize()
|
|
1296
|
+
}, children: [
|
|
1297
|
+
/* @__PURE__ */ r(te.Header, { children: J.getHeaderGroups().map((R) => /* @__PURE__ */ z(xt, { children: [
|
|
1298
|
+
/* @__PURE__ */ r(te.Row, { className: "data-table-column-header-row", borderRight: t ? "none" : "1px solid", borderColor: "border.subtle", children: R.headers.map((K) => /* @__PURE__ */ r(_l, { header: K, headerGroup: R, table: J, fullWidth: l, hasDescription: !!d?.[K.column.id] }, K.id)) }),
|
|
1299
|
+
u && $ ? /* @__PURE__ */ r(xl, { headerGroup: R, rows: fe, columnStats: u, noBorder: t, fullWidth: l }) : null
|
|
1300
|
+
] }, R.id)) }),
|
|
1301
|
+
/* @__PURE__ */ r(te.Body, { children: J.getRowModel().rows.map((R) => {
|
|
1302
|
+
const K = a ? s?.(R.original) ?? !0 : !1, ee = tl({
|
|
1303
|
+
enableRowActivation: x,
|
|
1304
|
+
activeRowId: i,
|
|
1305
|
+
rowId: R.id
|
|
1306
|
+
}), Y = R.getIsSelected();
|
|
1307
|
+
return /* @__PURE__ */ r($l, { row: R, noBorder: t, rowIsInteractive: K, rowIsActive: ee, rowIsSelected: Y, onRowClick: a, getCellContextMenuActions: v }, R.id);
|
|
1308
|
+
}) })
|
|
1309
|
+
] }) }),
|
|
1310
|
+
M && we.length > 0 ? /* @__PURE__ */ r(Vl, { selectedCount: we.length, totalCount: at.length, onClearSelection: () => J.toggleAllRowsSelected(!1), onSelectAll: () => J.toggleAllRowsSelected(!0), actions: j, selectedRows: ct }) : null
|
|
1311
|
+
] }),
|
|
1312
|
+
J.getPageCount() > 1 && /* @__PURE__ */ r(Tl, { table: J, pageIndex: w.pageIndex, pageSize: w.pageSize, pageSizeOptions: h })
|
|
1313
|
+
] });
|
|
1314
|
+
};
|
|
1315
|
+
export {
|
|
1316
|
+
ql as DataTable,
|
|
1317
|
+
Vn as FriendlyJsonDisplay,
|
|
1318
|
+
vn as formatDisplayValue,
|
|
1319
|
+
wn as getIcon
|
|
1320
|
+
};
|
|
1321
|
+
//# sourceMappingURL=data-table.js.map
|