@logicplanes/kaeso-ui 0.5.4 → 0.5.6
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/ai/component-guides.md +2 -2
- package/ai/component-registry.json +19 -5
- package/ai/component-registry.md +6 -4
- package/ai/icons.md +1 -1
- package/ai/tokens.md +1 -1
- package/dist/blocks/delete-resource.js +1 -1
- package/dist/blocks/pages.js +2 -2
- package/dist/blocks/resource-list.js +3 -3
- package/dist/chunks/{app-frame-B1FXVFYx.js → app-frame-P0frr7bS.js} +3 -3
- package/dist/chunks/{app-frame-B1FXVFYx.js.map → app-frame-P0frr7bS.js.map} +1 -1
- package/dist/chunks/{banner-BinTH032.js → banner-DEbXXqmm.js} +2 -2
- package/dist/chunks/{banner-BinTH032.js.map → banner-DEbXXqmm.js.map} +1 -1
- package/dist/chunks/{button-DrmFgdIi.js → button-DAzCLcr-.js} +2 -2
- package/dist/chunks/{button-DrmFgdIi.js.map → button-DAzCLcr-.js.map} +1 -1
- package/dist/chunks/{code-block-CE3H3nMu.js → code-block-CgFazxDO.js} +3 -3
- package/dist/chunks/{code-block-CE3H3nMu.js.map → code-block-CgFazxDO.js.map} +1 -1
- package/dist/chunks/{code-block-O_EPmMIQ.js → code-block-DlepLS16.js} +3 -3
- package/dist/chunks/{code-block-O_EPmMIQ.js.map → code-block-DlepLS16.js.map} +1 -1
- package/dist/chunks/{combobox-DghYPLVQ.js → combobox-Bl6ewCVK.js} +5 -4
- package/dist/chunks/combobox-Bl6ewCVK.js.map +1 -0
- package/dist/chunks/{command-list-BUmEaaBi.js → command-list-CmFekgMn.js} +2 -2
- package/dist/chunks/{command-list-BUmEaaBi.js.map → command-list-CmFekgMn.js.map} +1 -1
- package/dist/chunks/{copy-button-DBPAA1g0.js → copy-button-8W-3B59C.js} +2 -2
- package/dist/chunks/{copy-button-DBPAA1g0.js.map → copy-button-8W-3B59C.js.map} +1 -1
- package/dist/chunks/{core-Cw3pNRp3.js → core-eNNh7t33.js} +3 -3
- package/dist/chunks/{core-Cw3pNRp3.js.map → core-eNNh7t33.js.map} +1 -1
- package/dist/chunks/{data-table-CGecI-FI.js → data-table-DvErn5iF.js} +208 -206
- package/dist/chunks/data-table-DvErn5iF.js.map +1 -0
- package/dist/chunks/{date-popup-C6vVOOWF.js → date-popup-DOoksCNY.js} +2 -2
- package/dist/chunks/{date-popup-C6vVOOWF.js.map → date-popup-DOoksCNY.js.map} +1 -1
- package/dist/chunks/{dialog-s3_LUPBi.js → dialog-bUFUnQC0.js} +4 -4
- package/dist/chunks/{dialog-s3_LUPBi.js.map → dialog-bUFUnQC0.js.map} +1 -1
- package/dist/chunks/{domain-CrQX3p6E.js → domain-D-rdW5fm.js} +2 -2
- package/dist/chunks/{domain-CrQX3p6E.js.map → domain-D-rdW5fm.js.map} +1 -1
- package/dist/chunks/{icon-button-6kOn2zrP.js → icon-button--mBwM08L.js} +2 -2
- package/dist/chunks/{icon-button-6kOn2zrP.js.map → icon-button--mBwM08L.js.map} +1 -1
- package/dist/chunks/{identity-BwYixi8Q.js → identity-mwyVq4mE.js} +24 -2
- package/dist/chunks/identity-mwyVq4mE.js.map +1 -0
- package/dist/chunks/{input-D1SeLe3X.js → input-BJpzRpEj.js} +2 -2
- package/dist/chunks/{input-D1SeLe3X.js.map → input-BJpzRpEj.js.map} +1 -1
- package/dist/chunks/{input-group-BbxwEAUP.js → input-group-BpHmsM9g.js} +2 -2
- package/dist/chunks/{input-group-BbxwEAUP.js.map → input-group-BpHmsM9g.js.map} +1 -1
- package/dist/chunks/{iso-field-BVOKAY4H.js → iso-field-C97XNnpF.js} +2 -2
- package/dist/chunks/{iso-field-BVOKAY4H.js.map → iso-field-C97XNnpF.js.map} +1 -1
- package/dist/chunks/{list-o8wcuBOz.js → list-DBltIx9B.js} +213 -217
- package/dist/chunks/list-DBltIx9B.js.map +1 -0
- package/dist/chunks/{markdown-BZKZi9d8.js → markdown-C0_t7T9r.js} +3 -3
- package/dist/chunks/{markdown-BZKZi9d8.js.map → markdown-C0_t7T9r.js.map} +1 -1
- package/dist/chunks/{page-header-DUaKLpK3.js → page-header-D-8GD_Dz.js} +2 -2
- package/dist/chunks/{page-header-DUaKLpK3.js.map → page-header-D-8GD_Dz.js.map} +1 -1
- package/dist/chunks/{pagination-D9hM6W2z.js → pagination-DMb0xe4q.js} +3 -3
- package/dist/chunks/{pagination-D9hM6W2z.js.map → pagination-DMb0xe4q.js.map} +1 -1
- package/dist/chunks/{picker-popover-PzVOo62-.js → picker-popover-DuhzZbyA.js} +3 -3
- package/dist/chunks/{picker-popover-PzVOo62-.js.map → picker-popover-DuhzZbyA.js.map} +1 -1
- package/dist/chunks/{range-popup-Dt6Q0Ryw.js → range-popup-BHgt4Buj.js} +3 -3
- package/dist/chunks/{range-popup-Dt6Q0Ryw.js.map → range-popup-BHgt4Buj.js.map} +1 -1
- package/dist/chunks/{rights-DAHTG_kH.js → rights-DWXZSM9D.js} +3 -3
- package/dist/chunks/{rights-DAHTG_kH.js.map → rights-DWXZSM9D.js.map} +1 -1
- package/dist/chunks/{use-coarse-pointer-Ml5oE6oX.js → selects-text-R1lZHLKm.js} +8 -2
- package/dist/chunks/selects-text-R1lZHLKm.js.map +1 -0
- package/dist/chunks/{swap-text-SlUjrTlG.js → swap-text-D88Zlu4i.js} +5 -5
- package/dist/chunks/swap-text-D88Zlu4i.js.map +1 -0
- package/dist/chunks/{textarea-CRmvC4jd.js → textarea-CmUdpNFk.js} +3 -3
- package/dist/chunks/{textarea-CRmvC4jd.js.map → textarea-CmUdpNFk.js.map} +1 -1
- package/dist/chunks/{timeseries-CK86u7M0.js → timeseries-DY9PLLDJ.js} +3 -3
- package/dist/chunks/{timeseries-CK86u7M0.js.map → timeseries-DY9PLLDJ.js.map} +1 -1
- package/dist/components/app-frame.js +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/button-group.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/charts/bar.js +2 -2
- package/dist/components/charts/donut.js +1 -1
- package/dist/components/charts/gauge.js +1 -1
- package/dist/components/charts/heatmap.js +1 -1
- package/dist/components/charts/sankey.js +2 -2
- package/dist/components/charts/timeseries.js +1 -1
- package/dist/components/charts.js +2 -2
- package/dist/components/code-block.js +2 -2
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-list.js +2 -2
- package/dist/components/command-palette.js +1 -1
- package/dist/components/copy-button.js +1 -1
- package/dist/components/data-table.js +1 -1
- package/dist/components/date-picker.js +86 -82
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/dialog.js +96 -92
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/display-options.js +1 -1
- package/dist/components/filter-chip.js +2 -2
- package/dist/components/icon-button.js +1 -1
- package/dist/components/input.js +8 -8
- package/dist/components/input.js.map +1 -1
- package/dist/components/kaeso/conversation.js +2 -2
- package/dist/components/kaeso/identity.js +1 -1
- package/dist/components/kaeso/moments.js +3 -3
- package/dist/components/kaeso/rights.js +1 -1
- package/dist/components/kaeso/usage.js +1 -1
- package/dist/components/kaeso.js +5 -5
- package/dist/components/key-value.js +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/markdown.js +1 -1
- package/dist/components/page-header.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/playground.js +8 -8
- package/dist/components/sheet.js +1 -1
- package/dist/components/swap-text.js +1 -1
- package/dist/components/theme-menu.js +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/index.js +23 -23
- package/dist/kaeso.css +8 -0
- package/dist/styles.css +1 -1
- package/dist/types/components/dialog/docs.d.ts +1 -0
- package/dist/types/components/dialog/step-dialog.d.ts +1 -0
- package/dist/types/components/input/otp-input.d.ts +4 -4
- package/dist/types/components/swap-text/docs.d.ts +1 -0
- package/dist/types/components/swap-text/swap-text.d.ts +1 -0
- package/dist/types/utils/selects-text.d.ts +1 -0
- package/package.json +2 -2
- package/dist/chunks/combobox-DghYPLVQ.js.map +0 -1
- package/dist/chunks/data-table-CGecI-FI.js.map +0 -1
- package/dist/chunks/identity-BwYixi8Q.js.map +0 -1
- package/dist/chunks/list-o8wcuBOz.js.map +0 -1
- package/dist/chunks/swap-text-SlUjrTlG.js.map +0 -1
- package/dist/chunks/use-coarse-pointer-Ml5oE6oX.js.map +0 -1
|
@@ -7,35 +7,35 @@ import { t as d } from "./icon-CBzOwqrX.js";
|
|
|
7
7
|
import { r as f } from "./tooltip-Tkm-urbi.js";
|
|
8
8
|
import { t as ee } from "./observe-resize-DhxhmoyB.js";
|
|
9
9
|
import { r as p } from "./text-DkKdTVUf.js";
|
|
10
|
-
import { n as te } from "./button-
|
|
10
|
+
import { n as te } from "./button-DAzCLcr-.js";
|
|
11
11
|
import { n as ne } from "./checkbox-ahl1SOqU.js";
|
|
12
12
|
import { t as m } from "./menu-BDce2kiw.js";
|
|
13
13
|
import { r as re } from "./skeleton-D-qk3mes.js";
|
|
14
|
-
import { r as ie } from "./pagination-
|
|
14
|
+
import { r as ie } from "./pagination-DMb0xe4q.js";
|
|
15
15
|
import { t as ae } from "./empty-BpiUgGzm.js";
|
|
16
16
|
import { t as h } from "./truncated-d1afmUJT.js";
|
|
17
17
|
import { i as g } from "./status-dot-CP6runiC.js";
|
|
18
18
|
import { t as oe } from "./use-scroll-fade-uc8mWSDX.js";
|
|
19
19
|
import { t as _ } from "./avatar-CYNMK7uY.js";
|
|
20
|
-
import { n as se,
|
|
21
|
-
import { t as
|
|
22
|
-
import { t as
|
|
23
|
-
import { forwardRef as
|
|
24
|
-
import { Fragment as
|
|
25
|
-
import { ArrowDown01Icon as
|
|
26
|
-
import { useVirtualizer as
|
|
27
|
-
import { flexRender as
|
|
20
|
+
import { n as se, r as ce, t as le } from "./selects-text-R1lZHLKm.js";
|
|
21
|
+
import { t as ue } from "./tone-CWpsHPb6.js";
|
|
22
|
+
import { t as de } from "./use-scroll-margin-atRtf0v_.js";
|
|
23
|
+
import { forwardRef as fe, useLayoutEffect as v, useMemo as pe, useRef as y, useState as b } from "react";
|
|
24
|
+
import { Fragment as me, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
25
|
+
import { ArrowDown01Icon as he, ArrowUp01Icon as ge } from "@hugeicons/core-free-icons";
|
|
26
|
+
import { useVirtualizer as _e } from "@tanstack/react-virtual";
|
|
27
|
+
import { flexRender as ve, getCoreRowModel as ye, getSortedRowModel as be, useReactTable as xe } from "@tanstack/react-table";
|
|
28
28
|
//#region src/components/data-table/time-columns.ts
|
|
29
29
|
var C = /* @__PURE__ */ new WeakSet(), w = { density: {
|
|
30
30
|
compact: { classes: "h-36 coarse:h-44" },
|
|
31
31
|
default: { classes: "h-40 coarse:h-44" },
|
|
32
32
|
comfortable: { classes: "h-48" }
|
|
33
|
-
} },
|
|
33
|
+
} }, Se = { density: "default" }, Ce = {
|
|
34
34
|
compact: 36,
|
|
35
35
|
default: 40,
|
|
36
36
|
comfortable: 48
|
|
37
|
-
},
|
|
38
|
-
function
|
|
37
|
+
}, we = 136;
|
|
38
|
+
function Te(e, t, n = 48) {
|
|
39
39
|
if (!t) return {
|
|
40
40
|
hidden: [],
|
|
41
41
|
tight: !1,
|
|
@@ -43,7 +43,7 @@ function we(e, t, n = 48) {
|
|
|
43
43
|
};
|
|
44
44
|
let r = [...e].sort((e, t) => e.priority - t.priority), i = n, a = /* @__PURE__ */ new Set();
|
|
45
45
|
for (let e of r) i += e.size, (i <= t || e.priority <= 1 || e.fixed) && a.add(e.id);
|
|
46
|
-
let o = e.filter((e) => a.has(e.id)), s = o.reduce((e, t) => e + t.size, n), c = o.reduce((e, t) => e + (t.grow ?
|
|
46
|
+
let o = e.filter((e) => a.has(e.id)), s = o.reduce((e, t) => e + t.size, n), c = o.reduce((e, t) => e + (t.grow ? Me(t) : t.size), 0);
|
|
47
47
|
if (c > t && o.some((e) => e.grow)) {
|
|
48
48
|
let e = o[o.length - 1];
|
|
49
49
|
for (let n of [...o].reverse()) {
|
|
@@ -57,23 +57,23 @@ function we(e, t, n = 48) {
|
|
|
57
57
|
overflow: c > t
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Ee(e) {
|
|
61
61
|
let t = getComputedStyle(e);
|
|
62
62
|
return e.getBoundingClientRect().width - (parseFloat(t.paddingLeft) || 0) - (parseFloat(t.paddingRight) || 0);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function De(e) {
|
|
65
65
|
let t = e.filter((e) => e.id && e.meta?.text && e.meta.align !== "end");
|
|
66
66
|
return t.find((e) => !C.has(e)) ?? t[0] ?? e[0];
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Oe(e, t) {
|
|
69
69
|
if (!e?.id) return;
|
|
70
70
|
let n = e.meta?.text?.(t.original);
|
|
71
71
|
if (n) return n;
|
|
72
72
|
let r = t.getValue(e.id);
|
|
73
73
|
return typeof r == "string" && r ? r : void 0;
|
|
74
74
|
}
|
|
75
|
-
var T = "a[href], button, input, select, textarea, [tabindex], [contenteditable=true]",
|
|
76
|
-
function
|
|
75
|
+
var T = "a[href], button, input, select, textarea, [tabindex], [contenteditable=true]", ke = "input:not([type=checkbox]):not([type=radio]), textarea, select, [contenteditable=true]";
|
|
76
|
+
function Ae(e) {
|
|
77
77
|
return [...e.querySelectorAll(T)].filter((e) => !e.closest("[role=checkbox], [aria-hidden=true], [hidden]") && !e.matches(":disabled, input[type=checkbox]"));
|
|
78
78
|
}
|
|
79
79
|
function E(e) {
|
|
@@ -82,27 +82,27 @@ function E(e) {
|
|
|
82
82
|
return t ? [t] : [];
|
|
83
83
|
}) : [];
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function je(t, n) {
|
|
86
86
|
return n ? e("controls-on-fill", t ? "bg-raised-pressed hover:raised-selected-hover active:raised-selected-hover" : "bg-fill-2 hover:bg-fill-3 active:bg-fill-3") : t ? "hover:bg-raised-hover active:bg-raised-pressed hover:controls-on-fill" : "hover:bg-fill-1 active:bg-fill-2 hover:controls-on-fill";
|
|
87
87
|
}
|
|
88
|
-
var
|
|
89
|
-
function
|
|
90
|
-
let
|
|
88
|
+
var Me = (e) => Math.min(e.size, e.minWidth ?? 136);
|
|
89
|
+
function Ne({ data: a, columns: o, getRowId: s, density: c = "default", onRowClick: l, rowMenu: u, selectable: f, canSelectRow: g, selection: _, onSelectionChange: fe, sorting: C, onSortingChange: Se, manualSorting: we, loading: Ne, error: Pe, onRetry: D, empty: Fe, hasMore: O, loadingMore: Ie, onLoadMore: Le, stickyFirstColumn: k, virtualizeAbove: Re = 100, className: ze, activeRowId: Be, freshRowIds: Ve, onHiddenColumnsChange: He, "aria-label": Ue, "data-force-row": We }, A) {
|
|
90
|
+
let j = t(), Ge = r(), Ke = n(), M = i(), [qe, Je] = b([]), [Ye, Xe] = b({}), [Ze, Qe] = b(0), [$e, N] = b("body"), [et, tt] = b(0), P = y(null), nt = C ?? qe, F = _ ?? Ye, rt = pe(() => f ? [{
|
|
91
91
|
id: "__select",
|
|
92
92
|
size: 44,
|
|
93
93
|
enableSorting: !1,
|
|
94
94
|
enableResizing: !1,
|
|
95
95
|
meta: { priority: 1 },
|
|
96
96
|
header: ({ table: e }) => /* @__PURE__ */ x(ne, {
|
|
97
|
-
"aria-label":
|
|
97
|
+
"aria-label": M("dataTable.selectAllRows", "Select all rows"),
|
|
98
98
|
checked: e.getIsAllRowsSelected(),
|
|
99
99
|
indeterminate: e.getIsSomeRowsSelected() && !e.getIsAllRowsSelected(),
|
|
100
100
|
onCheckedChange: (t) => e.toggleAllRowsSelected(t)
|
|
101
101
|
}),
|
|
102
102
|
cell: ({ row: e }) => {
|
|
103
|
-
let t = De(
|
|
103
|
+
let t = Oe(De(o), e);
|
|
104
104
|
return /* @__PURE__ */ x(ne, {
|
|
105
|
-
"aria-label": t ?
|
|
105
|
+
"aria-label": t ? M("dataTable.selectNamed", "Select {name}", { name: t }) : M("dataTable.selectRow", "Select row"),
|
|
106
106
|
checked: e.getIsSelected(),
|
|
107
107
|
disabled: !e.getCanSelect(),
|
|
108
108
|
onCheckedChange: (t) => e.toggleSelected(t)
|
|
@@ -111,25 +111,25 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
111
111
|
}, ...o] : o, [
|
|
112
112
|
o,
|
|
113
113
|
f,
|
|
114
|
-
|
|
115
|
-
]),
|
|
114
|
+
M
|
|
115
|
+
]), I = xe({
|
|
116
116
|
data: a,
|
|
117
|
-
columns:
|
|
117
|
+
columns: rt,
|
|
118
118
|
state: {
|
|
119
|
-
sorting:
|
|
120
|
-
rowSelection:
|
|
119
|
+
sorting: nt,
|
|
120
|
+
rowSelection: F
|
|
121
121
|
},
|
|
122
122
|
onSortingChange: (e) => {
|
|
123
|
-
let t = typeof e == "function" ? e(
|
|
124
|
-
|
|
123
|
+
let t = typeof e == "function" ? e(nt) : e;
|
|
124
|
+
P.current = null, C || Je(t), Se?.(t);
|
|
125
125
|
},
|
|
126
126
|
onRowSelectionChange: (e) => {
|
|
127
|
-
let t = typeof e == "function" ? e(
|
|
128
|
-
_ ||
|
|
127
|
+
let t = typeof e == "function" ? e(F) : e;
|
|
128
|
+
_ || Xe(t), fe?.(t);
|
|
129
129
|
},
|
|
130
|
-
getCoreRowModel:
|
|
131
|
-
getSortedRowModel:
|
|
132
|
-
manualSorting: !!
|
|
130
|
+
getCoreRowModel: ye(),
|
|
131
|
+
getSortedRowModel: be(),
|
|
132
|
+
manualSorting: !!we,
|
|
133
133
|
enableRowSelection: f ? g ? (e) => g(e.original) : !0 : !1,
|
|
134
134
|
columnResizeMode: "onChange",
|
|
135
135
|
...s ? { getRowId: (e) => s(e) } : {},
|
|
@@ -138,61 +138,61 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
138
138
|
minSize: 64,
|
|
139
139
|
maxSize: 640
|
|
140
140
|
}
|
|
141
|
-
}),
|
|
141
|
+
}), L = y(null), R = y(null), z = y(null), it = I.getVisibleLeafColumns(), at = it.map((e) => ({
|
|
142
142
|
id: e.id,
|
|
143
143
|
size: e.getSize(),
|
|
144
144
|
priority: e.columnDef.meta?.priority ?? 2,
|
|
145
145
|
grow: !!e.columnDef.meta?.grow,
|
|
146
146
|
minWidth: e.columnDef.meta?.minWidth,
|
|
147
147
|
fixed: e.id === "__select"
|
|
148
|
-
})),
|
|
149
|
-
let t =
|
|
148
|
+
})), ot = JSON.stringify(at), st = (e) => {
|
|
149
|
+
let t = Te(at, e, j ? 48 : 0);
|
|
150
150
|
return `${t.tight ? "!" : ""}${t.overflow ? ">" : ""}|${t.hidden.join(" ")}`;
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
let [
|
|
151
|
+
}, B = y(st);
|
|
152
|
+
B.current = st;
|
|
153
|
+
let [ct, lt] = b("|");
|
|
154
154
|
v(() => {
|
|
155
|
-
let e =
|
|
156
|
-
if (e) return ee([e], ([e]) =>
|
|
155
|
+
let e = L.current;
|
|
156
|
+
if (e) return ee([e], ([e]) => lt(B.current(Math.round(e?.contentRect.width ?? 0))));
|
|
157
157
|
}, []), v(() => {
|
|
158
|
-
|
|
159
|
-
}, [
|
|
160
|
-
let [
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}, [
|
|
164
|
-
let
|
|
158
|
+
L.current && lt(B.current(Math.round(Ee(L.current))));
|
|
159
|
+
}, [ot]);
|
|
160
|
+
let [ut = "", dt = ""] = ct.split("|"), ft = ut.includes("!"), pt = ut.includes(">"), V = pe(() => new Set(dt.split(" ").filter(Boolean)), [dt]), mt = y(He);
|
|
161
|
+
mt.current = He, v(() => {
|
|
162
|
+
mt.current?.([...V]);
|
|
163
|
+
}, [V]);
|
|
164
|
+
let H = it.filter((e) => !V.has(e.id)), ht = (e) => e.columnDef.meta?.grow && ft ? Me({
|
|
165
165
|
size: e.getSize(),
|
|
166
166
|
minWidth: e.columnDef.meta.minWidth
|
|
167
|
-
}) : e.getSize(),
|
|
168
|
-
gridTemplateColumns:
|
|
169
|
-
minWidth:
|
|
170
|
-
},
|
|
171
|
-
count:
|
|
172
|
-
getScrollElement:
|
|
173
|
-
estimateSize: () =>
|
|
167
|
+
}) : e.getSize(), U = {
|
|
168
|
+
gridTemplateColumns: H.map((e) => e.columnDef.meta?.grow ? `minmax(${ht(e)}px, 1fr)` : `${e.getSize()}px`).join(" "),
|
|
169
|
+
minWidth: H.reduce((e, t) => e + ht(t), 0)
|
|
170
|
+
}, gt = pt && H.length > 1 && !H[H.length - 1]?.columnDef.meta?.grow, W = I.getRowModel().rows, G = W.length > Re, _t = Math.max(Ce[c], se() ? 44 : 0), K = () => ce(L.current), vt = de(z, K, W.length, G), q = _e({
|
|
171
|
+
count: W.length,
|
|
172
|
+
getScrollElement: K,
|
|
173
|
+
estimateSize: () => _t,
|
|
174
174
|
overscan: 16,
|
|
175
|
-
enabled:
|
|
176
|
-
scrollMargin:
|
|
177
|
-
}),
|
|
178
|
-
let t = Math.max(0, Math.min(
|
|
179
|
-
|
|
180
|
-
let n = () =>
|
|
175
|
+
enabled: G,
|
|
176
|
+
scrollMargin: vt
|
|
177
|
+
}), J = (t) => e("flex min-w-0 items-center px-12", j && t === 0 && "pl-20", j && t === H.length - 1 && "pr-20"), Y = j || Ge, X = (t, n = !1, r = !1) => (k && t === 0 || gt && t === H.length - 1) && e("sticky z-10", n ? Y ? "bg-raised" : "bg-panel" : r ? "bg-inherit" : Y ? "bg-raised group-hover/tr:bg-raised-hover group-active/tr:bg-raised-pressed" : "bg-panel group-hover/tr:bg-fill-1 group-active/tr:bg-fill-2", t === 0 ? "left-0" : "right-0", !j && !n && (t === 0 ? "rounded-l-item" : "rounded-r-item")), Z = !!l || !!f, Q = Z ? "gridcell" : "cell", yt = Z && W.length > 0 && $e === "body", bt = Math.min(Ze, Math.max(W.length - 1, 0)), xt = (e) => {
|
|
178
|
+
let t = Math.max(0, Math.min(W.length - 1, e));
|
|
179
|
+
N("body"), Qe(t), G && q.scrollToIndex(t, { align: "auto" });
|
|
180
|
+
let n = () => z.current?.querySelector(`[data-row-index="${t}"]`), r = n();
|
|
181
181
|
r ? r.focus() : requestAnimationFrame(() => n()?.focus());
|
|
182
|
-
},
|
|
183
|
-
let t = E(
|
|
184
|
-
return n ? (
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
let e = E(
|
|
188
|
-
for (let n of
|
|
189
|
-
let r = e.indexOf(n) === t && !
|
|
182
|
+
}, St = (e) => {
|
|
183
|
+
let t = E(R.current), n = t[Math.max(0, Math.min(t.length - 1, e))];
|
|
184
|
+
return n ? (N("head"), tt(t.indexOf(n)), n.focus(), !0) : !1;
|
|
185
|
+
}, Ct = y(() => {});
|
|
186
|
+
Ct.current = () => {
|
|
187
|
+
let e = E(R.current), t = Math.min(et, e.length - 1);
|
|
188
|
+
for (let n of R.current?.querySelectorAll(T) ?? []) {
|
|
189
|
+
let r = e.indexOf(n) === t && !yt ? "0" : "-1";
|
|
190
190
|
n.getAttribute("tabindex") !== r && n.setAttribute("tabindex", r);
|
|
191
191
|
}
|
|
192
|
-
}, v(() =>
|
|
193
|
-
let e =
|
|
192
|
+
}, v(() => Ct.current()), v(() => {
|
|
193
|
+
let e = R.current;
|
|
194
194
|
if (!e) return;
|
|
195
|
-
let t = new MutationObserver(() =>
|
|
195
|
+
let t = new MutationObserver(() => Ct.current());
|
|
196
196
|
return t.observe(e, {
|
|
197
197
|
subtree: !0,
|
|
198
198
|
childList: !0,
|
|
@@ -200,8 +200,8 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
200
200
|
attributeFilter: ["tabindex"]
|
|
201
201
|
}), () => t.disconnect();
|
|
202
202
|
}, []), v(() => {
|
|
203
|
-
let e =
|
|
204
|
-
if (!e || !
|
|
203
|
+
let e = z.current;
|
|
204
|
+
if (!e || !Z) return;
|
|
205
205
|
let t = () => {
|
|
206
206
|
for (let t of e.querySelectorAll("[data-row-index]")) for (let e of t.querySelectorAll(T)) e.getAttribute("tabindex") !== "-1" && e.setAttribute("tabindex", "-1");
|
|
207
207
|
};
|
|
@@ -213,25 +213,25 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
213
213
|
attributes: !0,
|
|
214
214
|
attributeFilter: ["tabindex"]
|
|
215
215
|
}), () => n.disconnect();
|
|
216
|
-
}, [
|
|
217
|
-
let
|
|
218
|
-
let n = e ?
|
|
216
|
+
}, [Z]), oe(z, "[role=row]");
|
|
217
|
+
let wt = (e, t) => {
|
|
218
|
+
let n = e ? I.getColumn(e) : void 0;
|
|
219
219
|
if (!n?.getCanResize()) return !1;
|
|
220
220
|
let r = n.columnDef.minSize ?? 64, i = n.columnDef.maxSize ?? 640;
|
|
221
|
-
return
|
|
221
|
+
return I.setColumnSizing((e) => ({
|
|
222
222
|
...e,
|
|
223
223
|
[n.id]: Math.max(r, Math.min(i, n.getSize() + t))
|
|
224
224
|
})), !0;
|
|
225
|
-
},
|
|
225
|
+
}, Tt = (e) => {
|
|
226
226
|
if (e.altKey || e.metaKey || e.ctrlKey) return;
|
|
227
|
-
let t = E(
|
|
227
|
+
let t = E(R.current), n = t.indexOf(e.target);
|
|
228
228
|
if (n < 0) return;
|
|
229
229
|
let r = {
|
|
230
230
|
ArrowLeft: -16,
|
|
231
231
|
ArrowRight: 16
|
|
232
232
|
}[e.key];
|
|
233
233
|
if (e.shiftKey) {
|
|
234
|
-
r !== void 0 &&
|
|
234
|
+
r !== void 0 && wt(e.target.closest("[role=columnheader]")?.dataset.col, r) && e.preventDefault();
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
let i = {
|
|
@@ -240,21 +240,21 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
240
240
|
Home: 0,
|
|
241
241
|
End: t.length - 1
|
|
242
242
|
}[e.key];
|
|
243
|
-
i === void 0 ? e.key === "ArrowDown" &&
|
|
244
|
-
},
|
|
245
|
-
let n =
|
|
246
|
-
n < 0 && (
|
|
247
|
-
id:
|
|
248
|
-
base:
|
|
243
|
+
i === void 0 ? e.key === "ArrowDown" && Z && W.length && (e.preventDefault(), xt(bt)) : (e.preventDefault(), i >= 0 && i < t.length && St(i));
|
|
244
|
+
}, Et = () => Math.max(1, Math.floor((K()?.clientHeight ?? 400) / _t) - 1), Dt = (e, t) => {
|
|
245
|
+
let n = P.current ? W.findIndex((e) => e.id === P.current?.id) : -1;
|
|
246
|
+
n < 0 && (P.current = {
|
|
247
|
+
id: W[e].id,
|
|
248
|
+
base: F
|
|
249
249
|
});
|
|
250
|
-
let r = n < 0 ? e : n, i = { ...
|
|
251
|
-
for (let e of
|
|
252
|
-
|
|
253
|
-
},
|
|
250
|
+
let r = n < 0 ? e : n, i = { ...P.current?.base };
|
|
251
|
+
for (let e of W.slice(Math.min(r, t), Math.max(r, t) + 1)) e.getCanSelect() && (i[e.id] = !0);
|
|
252
|
+
I.setRowSelection(i);
|
|
253
|
+
}, Ot = (e, t, n) => {
|
|
254
254
|
let r = e.currentTarget, i = e.target;
|
|
255
255
|
if (i !== r) {
|
|
256
|
-
if (e.altKey || e.metaKey || e.ctrlKey || i.closest(
|
|
257
|
-
let t =
|
|
256
|
+
if (e.altKey || e.metaKey || e.ctrlKey || i.closest(ke)) return;
|
|
257
|
+
let t = Ae(r), n = t.indexOf(i);
|
|
258
258
|
if (n < 0) return;
|
|
259
259
|
if (e.key === "Escape" && !i.closest("[data-popup-open], [aria-expanded=true]")) e.preventDefault(), r.focus();
|
|
260
260
|
else if (e.defaultPrevented) return;
|
|
@@ -263,42 +263,43 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
263
263
|
}
|
|
264
264
|
if (e.altKey) return;
|
|
265
265
|
if (e.metaKey || e.ctrlKey) {
|
|
266
|
-
e.key.toLowerCase() === "a" && f && !e.shiftKey && (e.preventDefault(),
|
|
266
|
+
e.key.toLowerCase() === "a" && f && !e.shiftKey && (e.preventDefault(), P.current = null, I.toggleAllRowsSelected(!0));
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
269
|
let a = {
|
|
270
270
|
ArrowDown: n + 1,
|
|
271
271
|
ArrowUp: n - 1,
|
|
272
272
|
Home: 0,
|
|
273
|
-
End:
|
|
274
|
-
PageDown: n +
|
|
275
|
-
PageUp: n -
|
|
273
|
+
End: W.length - 1,
|
|
274
|
+
PageDown: n + Et(),
|
|
275
|
+
PageUp: n - Et()
|
|
276
276
|
}[e.key];
|
|
277
277
|
if (a !== void 0) {
|
|
278
|
-
if (e.preventDefault(), e.key === "ArrowUp" && !e.shiftKey && a < 0 &&
|
|
279
|
-
let t = Math.max(0, Math.min(
|
|
280
|
-
e.shiftKey && f ?
|
|
278
|
+
if (e.preventDefault(), e.key === "ArrowUp" && !e.shiftKey && a < 0 && St(et)) return;
|
|
279
|
+
let t = Math.max(0, Math.min(W.length - 1, a));
|
|
280
|
+
e.shiftKey && f ? Dt(n, t) : P.current = null, xt(t);
|
|
281
281
|
} else if (e.shiftKey) return;
|
|
282
282
|
else if (e.key === "ArrowRight") {
|
|
283
|
-
let t =
|
|
283
|
+
let t = Ae(r)[0];
|
|
284
284
|
if (!t) return;
|
|
285
285
|
e.preventDefault(), t.focus();
|
|
286
|
-
} else e.key === "Enter" ? (e.preventDefault(), l?.(t.original)) : (e.key === " " || e.key === "x") && f ? (e.preventDefault(),
|
|
287
|
-
},
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
286
|
+
} else e.key === "Enter" ? (e.preventDefault(), l?.(t.original)) : (e.key === " " || e.key === "x") && f ? (e.preventDefault(), P.current = null, t.getCanSelect() && t.toggleSelected()) : e.key === "Escape" && f && Object.keys(F).length && (e.preventDefault(), P.current = null, I.toggleAllRowsSelected(!1));
|
|
287
|
+
}, kt = [
|
|
288
|
+
rt,
|
|
289
|
+
H.map((e) => e.id).join(" "),
|
|
290
|
+
j,
|
|
291
|
+
gt,
|
|
292
|
+
k,
|
|
293
|
+
Y,
|
|
294
|
+
Q
|
|
294
295
|
], $ = y(null);
|
|
295
|
-
(!$.current ||
|
|
296
|
-
deps:
|
|
296
|
+
(!$.current || kt.some((e, t) => e !== $.current?.deps[t])) && ($.current = {
|
|
297
|
+
deps: kt,
|
|
297
298
|
rows: /* @__PURE__ */ new WeakMap()
|
|
298
299
|
});
|
|
299
|
-
let
|
|
300
|
-
let i = t.id ===
|
|
301
|
-
d?.state !== s &&
|
|
300
|
+
let At = $.current.rows, jt = (t, n, r) => {
|
|
301
|
+
let i = t.id === Be, a = !!f && t.getIsSelected(), o = i || a, s = `${i} ${a}`, d = At.get(t), ee = d?.state === s ? d.cells : Mt(t, o);
|
|
302
|
+
d?.state !== s && At.set(t, {
|
|
302
303
|
state: s,
|
|
303
304
|
cells: ee
|
|
304
305
|
});
|
|
@@ -308,32 +309,32 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
308
309
|
"aria-selected": f ? t.getIsSelected() : void 0,
|
|
309
310
|
"aria-current": i || void 0,
|
|
310
311
|
"data-active": i || void 0,
|
|
311
|
-
"data-fresh":
|
|
312
|
+
"data-fresh": Ve?.has(t.id) || void 0,
|
|
312
313
|
"data-row-index": n,
|
|
313
|
-
...
|
|
314
|
-
tabIndex:
|
|
314
|
+
...We && n === 0 ? { "data-force": We } : {},
|
|
315
|
+
tabIndex: Z ? yt && n === bt ? 0 : -1 : void 0,
|
|
315
316
|
onFocus: (e) => {
|
|
316
|
-
e.target === e.currentTarget && (
|
|
317
|
+
e.target === e.currentTarget && (N("body"), n !== Ze && Qe(n));
|
|
317
318
|
},
|
|
318
319
|
onClick: (e) => {
|
|
319
|
-
|
|
320
|
+
P.current = null, !(e.target.closest("button, a, [role=checkbox]") || le(e.currentTarget)) && l?.(t.original);
|
|
320
321
|
},
|
|
321
|
-
onKeyDown: (e) =>
|
|
322
|
+
onKeyDown: (e) => Ot(e, t, n),
|
|
322
323
|
style: {
|
|
323
|
-
...
|
|
324
|
+
...U,
|
|
324
325
|
...r
|
|
325
326
|
},
|
|
326
|
-
className: e("group/tr grid w-full text-body text-fg transition-control focus-ring-inset", !
|
|
327
|
+
className: e("group/tr grid w-full text-body text-fg transition-control focus-ring-inset", !j && "rounded-item", w.density[c].classes, l && "cursor-pointer", je(Y, o), "data-fresh:animate-row-fresh", r?.transform !== void 0 && "[transition-property:background-color,color,box-shadow,opacity]", "forced-colors:data-active:outline-2 forced-colors:data-active:-outline-offset-2 forced-colors:data-active:outline-solid"),
|
|
327
328
|
children: ee
|
|
328
329
|
});
|
|
329
330
|
return u ? /* @__PURE__ */ S(m, { children: [/* @__PURE__ */ x(m.Trigger, { children: p }), /* @__PURE__ */ x(m.Content, { children: u(t.original) })] }, t.id) : /* @__PURE__ */ x("div", { children: p }, t.id);
|
|
330
331
|
};
|
|
331
|
-
function
|
|
332
|
-
return t.getVisibleCells().filter((e) => !
|
|
333
|
-
let a = r.column.columnDef.meta, o =
|
|
332
|
+
function Mt(t, n) {
|
|
333
|
+
return t.getVisibleCells().filter((e) => !V.has(e.column.id)).map((r, i) => {
|
|
334
|
+
let a = r.column.columnDef.meta, o = ve(r.column.columnDef.cell, r.getContext()), s = r.getValue(), c = a?.text ? a.text(t.original) : typeof s == "string" ? s : void 0, l = a?.tone?.(t.original);
|
|
334
335
|
return /* @__PURE__ */ x("div", {
|
|
335
|
-
role:
|
|
336
|
-
className: e(
|
|
336
|
+
role: Q,
|
|
337
|
+
className: e(J(i), a?.align === "end" && "justify-end text-right tabular", a?.mono && "mono text-small", l && ue[l], X(i, !1, n)),
|
|
337
338
|
children: c !== void 0 && typeof o != "object" ? /* @__PURE__ */ x(p, {
|
|
338
339
|
truncate: !0,
|
|
339
340
|
tone: l ?? "default",
|
|
@@ -350,13 +351,13 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
350
351
|
}, r.id);
|
|
351
352
|
});
|
|
352
353
|
}
|
|
353
|
-
let
|
|
354
|
-
let r = t.column.columnDef.meta, i = t.column.getCanSort(), a = t.column.getCanResize(), o = t.column.getIsSorted(), s =
|
|
354
|
+
let Nt = (t, n) => {
|
|
355
|
+
let r = t.column.columnDef.meta, i = t.column.getCanSort(), a = t.column.getCanResize(), o = t.column.getIsSorted(), s = ve(t.column.columnDef.header, t.getContext()), c = /* @__PURE__ */ S(me, { children: [i ? /* @__PURE__ */ S("button", {
|
|
355
356
|
type: "button",
|
|
356
357
|
onClick: t.column.getToggleSortingHandler(),
|
|
357
|
-
className: e("relative -mx-6 inline-flex h-28 min-w-0 cursor-pointer items-center gap-4 rounded-pill px-6 text-caption font-medium transition-control focus-ring tap-target",
|
|
358
|
+
className: e("relative -mx-6 inline-flex h-28 min-w-0 cursor-pointer items-center gap-4 rounded-pill px-6 text-caption font-medium transition-control focus-ring tap-target", Y ? "hover:bg-raised-hover active:bg-raised-pressed" : "hover:bg-fill-1 active:bg-fill-2", "hover:text-fg", o ? "text-fg" : "text-fg-secondary", r?.align === "end" && "flex-row-reverse"),
|
|
358
359
|
children: [/* @__PURE__ */ x(h, { children: s }), /* @__PURE__ */ x(d, {
|
|
359
|
-
icon: o === "desc" ?
|
|
360
|
+
icon: o === "desc" ? he : ge,
|
|
360
361
|
size: "xs",
|
|
361
362
|
className: e("shrink-0 transition-control", o ? "opacity-100" : "opacity-0 group-hover/th:opacity-60")
|
|
362
363
|
})]
|
|
@@ -366,7 +367,7 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
366
367
|
}), a && /* @__PURE__ */ x("div", {
|
|
367
368
|
role: "separator",
|
|
368
369
|
"aria-orientation": "vertical",
|
|
369
|
-
"aria-label":
|
|
370
|
+
"aria-label": M("dataTable.resizeColumn", "Resize column"),
|
|
370
371
|
"aria-valuenow": t.column.getSize(),
|
|
371
372
|
"aria-valuemin": t.column.columnDef.minSize ?? 64,
|
|
372
373
|
"aria-valuemax": t.column.columnDef.maxSize ?? 640,
|
|
@@ -380,134 +381,135 @@ function Me({ data: a, columns: o, getRowId: s, density: c = "default", onRowCli
|
|
|
380
381
|
role: "columnheader",
|
|
381
382
|
"data-col": t.column.id,
|
|
382
383
|
"aria-sort": o === "asc" ? "ascending" : o === "desc" ? "descending" : i ? "none" : void 0,
|
|
383
|
-
className: e("group/th relative",
|
|
384
|
+
className: e("group/th relative", J(n), r?.align === "end" && "justify-end", X(n, !0), X(n, !0) && "hairline-b-strong"),
|
|
384
385
|
children: a ? /* @__PURE__ */ S(m, { children: [/* @__PURE__ */ x(m.Trigger, {
|
|
385
386
|
className: e("flex min-w-0 flex-1 items-center self-stretch", r?.align === "end" && "justify-end"),
|
|
386
387
|
children: c
|
|
387
388
|
}), /* @__PURE__ */ S(m.Content, { children: [
|
|
388
389
|
/* @__PURE__ */ x(m.Item, {
|
|
389
|
-
onClick: () =>
|
|
390
|
-
children:
|
|
390
|
+
onClick: () => wt(t.column.id, 32),
|
|
391
|
+
children: M("dataTable.widenColumn", "Widen column")
|
|
391
392
|
}),
|
|
392
393
|
/* @__PURE__ */ x(m.Item, {
|
|
393
|
-
onClick: () =>
|
|
394
|
-
children:
|
|
394
|
+
onClick: () => wt(t.column.id, -32),
|
|
395
|
+
children: M("dataTable.narrowColumn", "Narrow column")
|
|
395
396
|
}),
|
|
396
397
|
/* @__PURE__ */ x(m.Item, {
|
|
397
398
|
onClick: () => t.column.resetSize(),
|
|
398
|
-
children:
|
|
399
|
+
children: M("dataTable.resetWidth", "Reset width")
|
|
399
400
|
})
|
|
400
401
|
] })] }) : c
|
|
401
402
|
}, t.id);
|
|
402
403
|
};
|
|
403
404
|
return /* @__PURE__ */ S("div", {
|
|
404
405
|
ref: (e) => {
|
|
405
|
-
|
|
406
|
+
L.current = e, typeof A == "function" ? A(e) : A && (A.current = e);
|
|
406
407
|
},
|
|
407
|
-
className: e("relative w-full min-w-0", !
|
|
408
|
+
className: e("relative w-full min-w-0", !j && !Ke && "px-24", ze),
|
|
408
409
|
children: [/* @__PURE__ */ S("div", {
|
|
409
|
-
role: "table",
|
|
410
|
-
"aria-label":
|
|
411
|
-
"aria-rowcount":
|
|
412
|
-
"aria-
|
|
413
|
-
|
|
410
|
+
role: Z ? "grid" : "table",
|
|
411
|
+
"aria-label": Ue,
|
|
412
|
+
"aria-rowcount": W.length + 1,
|
|
413
|
+
"aria-multiselectable": f || void 0,
|
|
414
|
+
"aria-busy": Ne || void 0,
|
|
415
|
+
className: e("w-full overflow-clip", j && "rounded-group bg-raised shadow-xs"),
|
|
414
416
|
children: [/* @__PURE__ */ x("div", {
|
|
415
|
-
ref:
|
|
417
|
+
ref: R,
|
|
416
418
|
role: "rowgroup",
|
|
417
|
-
className: e("sticky top-0 z-20 overflow-hidden",
|
|
418
|
-
onKeyDown:
|
|
419
|
+
className: e("sticky top-0 z-20 overflow-hidden", Y ? "bg-raised" : "bg-panel"),
|
|
420
|
+
onKeyDown: Tt,
|
|
419
421
|
onFocus: (e) => {
|
|
420
|
-
let t = E(
|
|
421
|
-
t < 0 || (
|
|
422
|
+
let t = E(R.current).indexOf(e.target);
|
|
423
|
+
t < 0 || (P.current = null, N("head"), tt(t));
|
|
422
424
|
},
|
|
423
425
|
onScroll: (e) => {
|
|
424
|
-
|
|
426
|
+
z.current && z.current.scrollLeft !== e.currentTarget.scrollLeft && (z.current.scrollLeft = e.currentTarget.scrollLeft);
|
|
425
427
|
},
|
|
426
|
-
children:
|
|
428
|
+
children: I.getHeaderGroups().map((e) => /* @__PURE__ */ x("div", {
|
|
427
429
|
role: "row",
|
|
428
430
|
"aria-rowindex": 1,
|
|
429
431
|
className: "grid h-36 hairline-b-strong",
|
|
430
|
-
style:
|
|
431
|
-
children: e.headers.filter((e) => !
|
|
432
|
+
style: U,
|
|
433
|
+
children: e.headers.filter((e) => !V.has(e.column.id)).map(Nt)
|
|
432
434
|
}, e.id))
|
|
433
435
|
}), /* @__PURE__ */ x("div", {
|
|
434
|
-
ref:
|
|
436
|
+
ref: z,
|
|
435
437
|
role: "rowgroup",
|
|
436
438
|
className: "overflow-x-auto scrollbar-quiet scroll-fade-x",
|
|
437
439
|
onScroll: (e) => {
|
|
438
|
-
|
|
440
|
+
R.current && R.current.scrollLeft !== e.currentTarget.scrollLeft && (R.current.scrollLeft = e.currentTarget.scrollLeft);
|
|
439
441
|
},
|
|
440
|
-
children:
|
|
442
|
+
children: Pe ? /* @__PURE__ */ x("div", {
|
|
441
443
|
role: "row",
|
|
442
444
|
children: /* @__PURE__ */ x("div", {
|
|
443
|
-
role:
|
|
444
|
-
"aria-colspan":
|
|
445
|
+
role: Q,
|
|
446
|
+
"aria-colspan": H.length,
|
|
445
447
|
className: "block",
|
|
446
448
|
children: /* @__PURE__ */ x("div", {
|
|
447
449
|
role: "alert",
|
|
448
450
|
children: /* @__PURE__ */ x(ae, {
|
|
449
451
|
size: "compact",
|
|
450
|
-
title:
|
|
451
|
-
...D ? {} : { description:
|
|
452
|
+
title: M("dataTable.loadFailed", "Couldn't load these rows"),
|
|
453
|
+
...D ? {} : { description: M("dataTable.reloadToRetry", "Reload the page to try again.") },
|
|
452
454
|
actions: D && /* @__PURE__ */ x(te, {
|
|
453
455
|
size: "sm",
|
|
454
456
|
onClick: D,
|
|
455
|
-
children:
|
|
457
|
+
children: M("dataTable.tryAgain", "Try again")
|
|
456
458
|
})
|
|
457
459
|
})
|
|
458
460
|
})
|
|
459
461
|
})
|
|
460
|
-
}) :
|
|
462
|
+
}) : Ne && W.length === 0 ? Array.from({ length: 8 }, (t, n) => /* @__PURE__ */ x("div", {
|
|
461
463
|
role: "row",
|
|
462
464
|
className: e("grid", w.density[c].classes),
|
|
463
|
-
style:
|
|
464
|
-
children:
|
|
465
|
-
role:
|
|
466
|
-
className: e(
|
|
465
|
+
style: U,
|
|
466
|
+
children: H.map((t, r) => /* @__PURE__ */ x("div", {
|
|
467
|
+
role: Q,
|
|
468
|
+
className: e(J(r), t.columnDef.meta?.align === "end" && "justify-end"),
|
|
467
469
|
children: /* @__PURE__ */ x(re, {
|
|
468
470
|
shape: "line",
|
|
469
471
|
style: { width: `${40 + (n * 7 + r * 13) % 45}%` }
|
|
470
472
|
})
|
|
471
473
|
}, t.id))
|
|
472
|
-
}, n)) :
|
|
474
|
+
}, n)) : W.length === 0 ? /* @__PURE__ */ x("div", {
|
|
473
475
|
role: "row",
|
|
474
476
|
children: /* @__PURE__ */ x("div", {
|
|
475
|
-
role:
|
|
476
|
-
"aria-colspan":
|
|
477
|
+
role: Q,
|
|
478
|
+
"aria-colspan": H.length,
|
|
477
479
|
className: "block",
|
|
478
|
-
children:
|
|
480
|
+
children: Fe ?? /* @__PURE__ */ x(ae, {
|
|
479
481
|
size: "compact",
|
|
480
|
-
title:
|
|
482
|
+
title: M("dataTable.noRows", "No rows")
|
|
481
483
|
})
|
|
482
484
|
})
|
|
483
|
-
}) :
|
|
485
|
+
}) : G ? /* @__PURE__ */ x("div", {
|
|
484
486
|
className: "relative",
|
|
485
|
-
style: { height:
|
|
486
|
-
children:
|
|
487
|
+
style: { height: q.getTotalSize() },
|
|
488
|
+
children: q.getVirtualItems().map((e) => jt(W[e.index], e.index, {
|
|
487
489
|
position: "absolute",
|
|
488
490
|
top: 0,
|
|
489
491
|
left: 0,
|
|
490
|
-
transform: `translateY(${Math.round(e.start -
|
|
492
|
+
transform: `translateY(${Math.round(e.start - vt)}px)`
|
|
491
493
|
}))
|
|
492
|
-
}) :
|
|
494
|
+
}) : W.map((e, t) => jt(e, t))
|
|
493
495
|
})]
|
|
494
496
|
}), /* @__PURE__ */ x(ie, {
|
|
495
497
|
variant: "load-more",
|
|
496
|
-
hasMore: !!
|
|
497
|
-
loading:
|
|
498
|
-
onLoadMore:
|
|
498
|
+
hasMore: !!O,
|
|
499
|
+
loading: Ie,
|
|
500
|
+
onLoadMore: Le
|
|
499
501
|
})]
|
|
500
502
|
});
|
|
501
503
|
}
|
|
502
|
-
var
|
|
503
|
-
process.env.NODE_ENV !== "production" && (
|
|
504
|
-
var D =
|
|
504
|
+
var Pe = /* @__PURE__ */ fe(Ne);
|
|
505
|
+
process.env.NODE_ENV !== "production" && (Pe.displayName = "DataTable");
|
|
506
|
+
var D = Pe;
|
|
505
507
|
//#endregion
|
|
506
508
|
//#region src/components/data-table/columns.tsx
|
|
507
|
-
function
|
|
509
|
+
function Fe(e) {
|
|
508
510
|
return C.add(e), e;
|
|
509
511
|
}
|
|
510
|
-
function
|
|
512
|
+
function O(e, t, n, r = {}, i) {
|
|
511
513
|
return {
|
|
512
514
|
id: e.id,
|
|
513
515
|
header: () => e.header,
|
|
@@ -524,7 +526,7 @@ function k(e, t, n, r = {}, i) {
|
|
|
524
526
|
}
|
|
525
527
|
};
|
|
526
528
|
}
|
|
527
|
-
function
|
|
529
|
+
function Ie({ value: e }) {
|
|
528
530
|
let t = i()("dataTable.tokenCount", "{count} tokens", { count: s(e) });
|
|
529
531
|
return /* @__PURE__ */ x(f, {
|
|
530
532
|
content: t,
|
|
@@ -537,7 +539,7 @@ function Pe({ value: e }) {
|
|
|
537
539
|
})] })
|
|
538
540
|
});
|
|
539
541
|
}
|
|
540
|
-
function
|
|
542
|
+
function Le({ value: e, now: t }) {
|
|
541
543
|
let n = a(e, {
|
|
542
544
|
time: !0,
|
|
543
545
|
seconds: !0
|
|
@@ -560,32 +562,32 @@ function Fe({ value: e, now: t }) {
|
|
|
560
562
|
})
|
|
561
563
|
});
|
|
562
564
|
}
|
|
563
|
-
var
|
|
564
|
-
text: (e, t) =>
|
|
565
|
-
mono: (e, t) =>
|
|
565
|
+
var k = {
|
|
566
|
+
text: (e, t) => O(e, t, (e) => e, { text: (e) => t(e) }),
|
|
567
|
+
mono: (e, t) => O(e, t, (e) => e, {
|
|
566
568
|
mono: !0,
|
|
567
569
|
text: (e) => t(e)
|
|
568
570
|
}),
|
|
569
|
-
number: (e, t) =>
|
|
570
|
-
money: (e, t, n = {}) =>
|
|
571
|
+
number: (e, t) => O(e, t, (e) => s(e), { align: "end" }),
|
|
572
|
+
money: (e, t, n = {}) => O(e, t, (e) => u(e, n.decimals === void 0 ? {} : { decimals: n.decimals }), {
|
|
571
573
|
align: "end",
|
|
572
574
|
mono: !1
|
|
573
575
|
}, (e, t, n) => Number(e.getValue(n)) - Number(t.getValue(n))),
|
|
574
|
-
tokens: (e, t) =>
|
|
575
|
-
duration: (e, t) =>
|
|
576
|
-
date: (e, t) => O(
|
|
576
|
+
tokens: (e, t) => O(e, t, (e) => /* @__PURE__ */ x(Ie, { value: e }), { align: "end" }),
|
|
577
|
+
duration: (e, t) => O(e, t, (e) => o(e), { align: "end" }),
|
|
578
|
+
date: (e, t) => Fe(O(e, t, (e) => /* @__PURE__ */ x("time", {
|
|
577
579
|
dateTime: new Date(e).toISOString(),
|
|
578
580
|
children: a(e, { time: !0 })
|
|
579
581
|
}), { text: (e) => a(t(e), { time: !0 }) }, "datetime")),
|
|
580
|
-
relative: (e, t, n = {}) => O(
|
|
582
|
+
relative: (e, t, n = {}) => Fe(O(e, t, (e) => /* @__PURE__ */ x(Le, {
|
|
581
583
|
value: e,
|
|
582
584
|
now: n.now ?? Date.now()
|
|
583
585
|
}), { text: (e) => a(t(e), { time: !0 }) }, (e, t, n) => new Date(e.getValue(n)).getTime() - new Date(t.getValue(n)).getTime())),
|
|
584
|
-
status: (e, t) =>
|
|
586
|
+
status: (e, t) => O(e, t, (e) => /* @__PURE__ */ x(g, {
|
|
585
587
|
tone: e.tone,
|
|
586
588
|
children: e.label
|
|
587
589
|
}), { text: void 0 }),
|
|
588
|
-
avatar: (e, t) =>
|
|
590
|
+
avatar: (e, t) => O(e, t, (e) => /* @__PURE__ */ S("span", {
|
|
589
591
|
className: "inline-flex min-w-0 items-center gap-8",
|
|
590
592
|
children: [/* @__PURE__ */ x(_, {
|
|
591
593
|
name: e.name,
|
|
@@ -594,9 +596,9 @@ var A = {
|
|
|
594
596
|
decorative: !0
|
|
595
597
|
}), /* @__PURE__ */ x(h, { children: e.name })]
|
|
596
598
|
}), { text: (e) => t(e).name }),
|
|
597
|
-
custom: (e, t, n, r = {}) =>
|
|
599
|
+
custom: (e, t, n, r = {}) => O(e, t, n, r)
|
|
598
600
|
};
|
|
599
601
|
//#endregion
|
|
600
|
-
export { w as a,
|
|
602
|
+
export { w as a, Se as i, we as n, Te as o, D as r, k as t };
|
|
601
603
|
|
|
602
|
-
//# sourceMappingURL=data-table-
|
|
604
|
+
//# sourceMappingURL=data-table-DvErn5iF.js.map
|