@acronis-platform/ui-react 5.5.8 → 6.0.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/components/ui/chart/chart.js +14 -11
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/chart-state/chart-state.js +47 -37
- package/dist/components/ui/chart-state/chart-state.js.map +1 -1
- package/dist/components/ui/chart-widget/chart-widget.js +21 -23
- package/dist/components/ui/chart-widget/chart-widget.js.map +1 -1
- package/dist/components/ui/data-table/data-table-column-header.js +22 -14
- package/dist/components/ui/data-table/data-table-column-header.js.map +1 -1
- package/dist/components/ui/data-table/data-table.js +137 -137
- package/dist/components/ui/data-table/data-table.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js +45 -32
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.js +88 -84
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/index.js +86 -87
- package/dist/llms/chart-state.md +81 -164
- package/dist/llms/chart-widget.md +27 -25
- package/dist/llms/dialog-root.md +40 -13
- package/dist/llms/dialog.md +26 -1
- package/dist/llms.txt +3 -3
- package/dist/react.js +86 -87
- package/dist/src/components/ui/chart/chart.d.ts +3 -3
- package/dist/src/components/ui/chart-state/chart-state.d.ts +5 -14
- package/dist/src/components/ui/chart-state/index.d.ts +0 -1
- package/dist/src/components/ui/chart-widget/chart-widget.d.ts +10 -15
- package/dist/src/components/ui/data-table/data-table.d.ts +2 -2
- package/dist/src/components/ui/dialog/dialog.d.ts +9 -0
- package/dist/src/components/ui/dialog/dialog.docs.d.ts +5 -1
- package/dist/src/components/ui/pie-chart/pie-chart.d.ts +1 -1
- package/dist/ui-react.css +1 -1
- package/package.json +13 -13
- package/dist/components/ui/chart-state/chart-state-illustrations.js +0 -412
- package/dist/components/ui/chart-state/chart-state-illustrations.js.map +0 -1
- package/dist/src/components/ui/chart-state/chart-state-illustrations.d.ts +0 -6
|
@@ -2,17 +2,18 @@ import { cn as e } from "../../../lib/utils.js";
|
|
|
2
2
|
import { useIntersectionObserver as t } from "../../../hooks/use-intersection-observer.js";
|
|
3
3
|
import { ButtonIcon as n } from "../button-icon/button-icon.js";
|
|
4
4
|
import { Tooltip as r, TooltipContent as i, TooltipProvider as a, TooltipTrigger as o } from "../tooltip/tooltip.js";
|
|
5
|
+
import { TruncateText as ee } from "../truncate-text/truncate-text.js";
|
|
5
6
|
import { getCoreRowModel as s, getExpandedRowModel as c, getFilteredRowModel as l, getPaginationRowModel as u, getSortedRowModel as d } from "../../../node_modules/.pnpm/@tanstack_table-core@8.21.3/node_modules/@tanstack/table-core/build/lib/index.js";
|
|
6
|
-
import { flexRender as
|
|
7
|
-
import { DropdownMenu as
|
|
8
|
-
import { Table as
|
|
7
|
+
import { flexRender as te, useReactTable as f } from "../../../node_modules/.pnpm/@tanstack_react-table@8.21.3_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@tanstack/react-table/build/lib/index.js";
|
|
8
|
+
import { DropdownMenu as p, DropdownMenuContent as m, DropdownMenuTrigger as ne } from "../dropdown-menu/dropdown-menu.js";
|
|
9
|
+
import { Table as re, TableActionsCell as ie, TableBody as ae, TableCell as h, TableHead as oe, TableHeader as se, TableRow as g, TableSettingsCell as _ } from "../table/table.js";
|
|
9
10
|
import { isBulkSelectionActive as ce } from "./data-table-selection.js";
|
|
10
11
|
import { DataTableViewOptions as le } from "./data-table-view-options.js";
|
|
11
|
-
import { Fragment as
|
|
12
|
-
import { jsx as
|
|
12
|
+
import { Fragment as v, useEffect as ue, useMemo as de, useRef as fe, useState as y } from "react";
|
|
13
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
13
14
|
import { EllipsisIcon as pe } from "@acronis-platform/icons-react/stroke-mono";
|
|
14
15
|
//#region src/components/ui/data-table/data-table.tsx
|
|
15
|
-
function
|
|
16
|
+
function S(e) {
|
|
16
17
|
let t = e.getIsPinned();
|
|
17
18
|
if (t) return {
|
|
18
19
|
position: "sticky",
|
|
@@ -22,25 +23,25 @@ function x(e) {
|
|
|
22
23
|
boxShadow: t === "left" ? "4px 0 4px -4px var(--ui-table-global-row-border-color)" : "-4px 0 4px -4px var(--ui-table-global-row-border-color)"
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
+
function C(e, t) {
|
|
26
27
|
if (e.id === "select") return 48;
|
|
27
28
|
if (t || e.columnDef.size !== void 0) return e.getSize();
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
-
let n =
|
|
30
|
+
function w(e, t) {
|
|
31
|
+
let n = S(e.column), r = e.subHeaders.length === 0 ? C(e.column, t) : void 0;
|
|
31
32
|
if (!(!n && r === void 0)) return {
|
|
32
33
|
...n,
|
|
33
34
|
width: r
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
let n =
|
|
37
|
+
function T(e, t) {
|
|
38
|
+
let n = S(e.column), r = C(e.column, t);
|
|
38
39
|
if (!(!n && r === void 0)) return {
|
|
39
40
|
...n,
|
|
40
41
|
width: r
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
|
-
var
|
|
44
|
+
var me = 20, E = 2 ** 53 - 1;
|
|
44
45
|
function D(e, t, { shiftKey: n, min: r, max: i }) {
|
|
45
46
|
let a = n ? 50 : 10;
|
|
46
47
|
if (e === "ArrowLeft") return Math.min(i, Math.max(r, t - a));
|
|
@@ -52,7 +53,7 @@ function O(e, t, n) {
|
|
|
52
53
|
let a = [...e];
|
|
53
54
|
return a.splice(i, 0, a.splice(r, 1)[0]), a;
|
|
54
55
|
}
|
|
55
|
-
var
|
|
56
|
+
var he = {
|
|
56
57
|
sort: {
|
|
57
58
|
label: "Sort column",
|
|
58
59
|
action: "Click"
|
|
@@ -66,21 +67,21 @@ var me = {
|
|
|
66
67
|
action: "Drag border"
|
|
67
68
|
}
|
|
68
69
|
};
|
|
69
|
-
function k({ columns:
|
|
70
|
-
let
|
|
71
|
-
...
|
|
72
|
-
...
|
|
73
|
-
}, [
|
|
74
|
-
|
|
70
|
+
function k({ columns: S = [], data: C = [], table: k, getRowId: ge, getRowCanExpand: _e, renderExpandedRow: A, striped: j = !1, bordered: ve = !1, highlightCurrentRow: M = !1, skeleton: N = !1, skeletonRows: ye = 5, enableColumnResizing: P = !1, onColumnSizingChange: be, enableColumnReordering: xe = !1, columnOrder: F, onColumnOrderChange: Se, columnVisibility: Ce, onColumnVisibilityChange: we, rowSelection: I, onRowSelectionChange: Te, manualSorting: L = !1, sorting: R, onSortingChange: Ee, renderRow: z, renderEmptyState: B, paginationMode: V = "page", onLoadMore: De, loadMoreRootMargin: Oe, hasNextPage: H = !1, resizeColumnLabel: ke = "Resize column", emptyLabel: Ae = "No results.", isLoadingMore: je = !1, hideActionColumn: Me = !1, renderRowActions: Ne, rowActionsLabel: Pe = "Row actions", columnSettingsLabel: Fe, columnSearchPlaceholder: Ie, showAllColumnsLabel: Le, noColumnsFoundLabel: Re, headerHints: ze }) {
|
|
71
|
+
let U = {
|
|
72
|
+
...he,
|
|
73
|
+
...ze
|
|
74
|
+
}, [Be, Ve] = y([]), He = R ?? Be, [Ue, We] = y([]), [Ge, Ke] = y({}), qe = Ce ?? Ge, [Je, Ye] = y({}), Xe = I ?? Je, [Ze, Qe] = y({}), [$e, et] = y({}), [tt, nt] = y([]), rt = F ?? tt, [W, G] = y(), [it, at] = y(), [ot, st] = y(0), ct = fe([]), lt = (e) => {
|
|
75
|
+
et(e), be?.(e);
|
|
75
76
|
}, ut = (e) => {
|
|
76
|
-
|
|
77
|
+
F === void 0 && nt(e), Se?.(e);
|
|
77
78
|
}, dt = (e) => {
|
|
78
|
-
|
|
79
|
+
Ke(e), we?.(e);
|
|
79
80
|
}, ft = (e) => {
|
|
80
|
-
|
|
81
|
+
R === void 0 && Ve(e), Ee?.(e);
|
|
81
82
|
}, pt = (e) => {
|
|
82
|
-
|
|
83
|
-
},
|
|
83
|
+
I === void 0 && Ye(e), Te?.(e);
|
|
84
|
+
}, K = !Me && !k, mt = de(() => K ? [{
|
|
84
85
|
id: "__actions",
|
|
85
86
|
size: 48,
|
|
86
87
|
enableSorting: !1,
|
|
@@ -88,71 +89,71 @@ function k({ columns: x = [], data: S = [], table: k, getRowId: he, getRowCanExp
|
|
|
88
89
|
meta: { pin: "right" },
|
|
89
90
|
header: () => null,
|
|
90
91
|
cell: () => null
|
|
91
|
-
}] : [], [
|
|
92
|
-
data:
|
|
93
|
-
columns:
|
|
94
|
-
getRowId:
|
|
95
|
-
enableColumnResizing:
|
|
92
|
+
}] : [], [K]), ht = de(() => [...S, ...mt], [S, mt]), [gt, _t] = y(), vt = f({
|
|
93
|
+
data: C,
|
|
94
|
+
columns: ht,
|
|
95
|
+
getRowId: ge,
|
|
96
|
+
enableColumnResizing: P,
|
|
96
97
|
columnResizeMode: "onChange",
|
|
97
98
|
getCoreRowModel: s(),
|
|
98
99
|
getExpandedRowModel: c(),
|
|
99
|
-
...
|
|
100
|
-
getRowCanExpand:
|
|
101
|
-
onExpandedChange:
|
|
102
|
-
manualSorting:
|
|
100
|
+
...V === "page" ? { getPaginationRowModel: u() } : {},
|
|
101
|
+
getRowCanExpand: _e,
|
|
102
|
+
onExpandedChange: Qe,
|
|
103
|
+
manualSorting: L,
|
|
103
104
|
onSortingChange: ft,
|
|
104
|
-
...
|
|
105
|
-
onColumnFiltersChange:
|
|
105
|
+
...L ? {} : { getSortedRowModel: d() },
|
|
106
|
+
onColumnFiltersChange: We,
|
|
106
107
|
getFilteredRowModel: l(),
|
|
107
108
|
onColumnVisibilityChange: dt,
|
|
108
109
|
onRowSelectionChange: pt,
|
|
109
110
|
onColumnSizingChange: lt,
|
|
110
111
|
onColumnOrderChange: ut,
|
|
111
|
-
initialState:
|
|
112
|
+
initialState: K ? { columnPinning: { right: ["__actions"] } } : void 0,
|
|
112
113
|
state: {
|
|
113
|
-
sorting:
|
|
114
|
-
columnFilters:
|
|
115
|
-
columnVisibility:
|
|
116
|
-
rowSelection:
|
|
117
|
-
expanded:
|
|
118
|
-
columnSizing:
|
|
119
|
-
columnOrder:
|
|
114
|
+
sorting: He,
|
|
115
|
+
columnFilters: Ue,
|
|
116
|
+
columnVisibility: qe,
|
|
117
|
+
rowSelection: Xe,
|
|
118
|
+
expanded: Ze,
|
|
119
|
+
columnSizing: $e,
|
|
120
|
+
columnOrder: rt
|
|
120
121
|
}
|
|
121
|
-
}), q = k ??
|
|
122
|
+
}), q = k ?? vt, J = !k && V === "infinite", Y = P && !k, yt = xe && !k, X = !!q.getState().columnSizingInfo.isResizingColumn;
|
|
122
123
|
ue(() => {
|
|
123
124
|
if (X) return document.documentElement.setAttribute("data-ui-column-resizing", ""), () => {
|
|
124
125
|
document.documentElement.removeAttribute("data-ui-column-resizing");
|
|
125
126
|
};
|
|
126
127
|
}, [X]);
|
|
127
|
-
let
|
|
128
|
-
onIntersect: () =>
|
|
129
|
-
disabled: !J || !
|
|
130
|
-
rootMargin:
|
|
131
|
-
}),
|
|
128
|
+
let bt = t({
|
|
129
|
+
onIntersect: () => De?.(),
|
|
130
|
+
disabled: !J || !H || je,
|
|
131
|
+
rootMargin: Oe
|
|
132
|
+
}), xt = (e, t) => {
|
|
132
133
|
if (e.ctrlKey || e.altKey || e.metaKey) return;
|
|
133
134
|
let n = D(e.key, t.column.getSize(), {
|
|
134
135
|
shiftKey: e.shiftKey,
|
|
135
|
-
min: t.column.columnDef.minSize ??
|
|
136
|
+
min: t.column.columnDef.minSize ?? me,
|
|
136
137
|
max: t.column.columnDef.maxSize ?? E
|
|
137
138
|
});
|
|
138
139
|
n !== void 0 && (e.preventDefault(), q.setColumnSizing((e) => ({
|
|
139
140
|
...e,
|
|
140
141
|
[t.column.id]: n
|
|
141
142
|
})));
|
|
142
|
-
}, xt = (e, t) => {
|
|
143
|
-
e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", t)), H(t);
|
|
144
143
|
}, St = (e, t) => {
|
|
144
|
+
e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", t)), G(t);
|
|
145
|
+
}, Ct = (e, t) => {
|
|
145
146
|
if (e.preventDefault(), !e.dataTransfer) return;
|
|
146
|
-
let n =
|
|
147
|
+
let n = W ? q.getColumn(W)?.parent?.id : void 0, r = q.getColumn(t)?.parent?.id;
|
|
147
148
|
e.dataTransfer.dropEffect = n === r ? "move" : "none";
|
|
148
|
-
},
|
|
149
|
-
if (e.preventDefault(), !
|
|
150
|
-
if (q.getColumn(
|
|
151
|
-
|
|
149
|
+
}, wt = (e, t) => {
|
|
150
|
+
if (e.preventDefault(), !W) return;
|
|
151
|
+
if (q.getColumn(W)?.parent?.id !== q.getColumn(t)?.parent?.id) {
|
|
152
|
+
G(void 0);
|
|
152
153
|
return;
|
|
153
154
|
}
|
|
154
155
|
let n = q.getState().columnOrder, r = n.length ? n : q.getAllLeafColumns().map((e) => e.id);
|
|
155
|
-
q.setColumnOrder(O(r,
|
|
156
|
+
q.setColumnOrder(O(r, W, t)), G(void 0);
|
|
156
157
|
};
|
|
157
158
|
ue(() => {
|
|
158
159
|
k || q.getAllLeafColumns().forEach((e) => {
|
|
@@ -160,74 +161,73 @@ function k({ columns: x = [], data: S = [], table: k, getRowId: he, getRowCanExp
|
|
|
160
161
|
});
|
|
161
162
|
}, [
|
|
162
163
|
q,
|
|
163
|
-
|
|
164
|
+
ht,
|
|
164
165
|
k
|
|
165
166
|
]);
|
|
166
|
-
let Z = q.getRowModel().rows, Q = ce(q),
|
|
167
|
-
|
|
168
|
-
},
|
|
167
|
+
let Z = q.getRowModel().rows, Q = ce(q), Tt = Z.length ? Math.min(ot, Z.length - 1) : 0, Et = (e) => {
|
|
168
|
+
st(e);
|
|
169
|
+
}, Dt = (e, t) => {
|
|
169
170
|
if (e.target !== e.currentTarget || e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
170
171
|
let n = e.key === "ArrowDown" ? Math.min(t + 1, Z.length - 1) : Math.max(t - 1, 0);
|
|
171
|
-
n !== t && (e.preventDefault(),
|
|
172
|
-
},
|
|
173
|
-
return /* @__PURE__ */
|
|
174
|
-
className: e("rounded-md border border-[var(--ui-table-global-row-border-color)]",
|
|
175
|
-
children: /* @__PURE__ */
|
|
172
|
+
n !== t && (e.preventDefault(), st(n), ct.current[n]?.focus());
|
|
173
|
+
}, Ot = ve ? "[&_th:not(:last-child)]:border-e [&_td:not(:last-child)]:border-e [&_th]:border-[var(--ui-table-global-row-border-color)] [&_td]:border-[var(--ui-table-global-row-border-color)]" : void 0, $ = "bg-background";
|
|
174
|
+
return /* @__PURE__ */ b("div", {
|
|
175
|
+
className: e("rounded-md border border-[var(--ui-table-global-row-border-color)]", Ot),
|
|
176
|
+
children: /* @__PURE__ */ x(re, {
|
|
176
177
|
style: Y ? { width: q.getCenterTotalSize() } : void 0,
|
|
177
|
-
children: [/* @__PURE__ */
|
|
178
|
+
children: [/* @__PURE__ */ b(a, { children: /* @__PURE__ */ b(se, { children: q.getHeaderGroups().map((t, n, a) => /* @__PURE__ */ b(g, {
|
|
178
179
|
className: "hover:bg-transparent",
|
|
179
180
|
children: t.headers.map((t) => {
|
|
180
|
-
let s = t.column.getIsPinned(), c = t.subHeaders.length > 0, l = !c && Y && t.column.getCanResize() && t.column.id !== "select", u = !c &&
|
|
181
|
-
d &&
|
|
182
|
-
u &&
|
|
183
|
-
l &&
|
|
181
|
+
let s = t.column.getIsPinned(), c = t.subHeaders.length > 0, l = !c && Y && t.column.getCanResize() && t.column.id !== "select", u = !c && yt && !t.isPlaceholder && !s, d = !c && !t.isPlaceholder && t.column.getCanSort(), f = [
|
|
182
|
+
d && U.sort,
|
|
183
|
+
u && U.reorder,
|
|
184
|
+
l && U.resize
|
|
184
185
|
].filter((e) => !!e);
|
|
185
|
-
if (t.column.id === "__actions") return n < a.length - 1 ? /* @__PURE__ */
|
|
186
|
-
style:
|
|
186
|
+
if (t.column.id === "__actions") return n < a.length - 1 ? /* @__PURE__ */ b(_, {
|
|
187
|
+
style: w(t, Y),
|
|
187
188
|
className: $
|
|
188
|
-
}, t.id) : /* @__PURE__ */
|
|
189
|
-
style:
|
|
189
|
+
}, t.id) : /* @__PURE__ */ b(_, {
|
|
190
|
+
style: w(t, Y),
|
|
190
191
|
className: $,
|
|
191
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ b(le, {
|
|
192
193
|
table: q,
|
|
193
194
|
iconOnly: !0,
|
|
194
|
-
triggerAriaLabel:
|
|
195
|
-
searchPlaceholder:
|
|
196
|
-
showAllLabel:
|
|
197
|
-
noResultsLabel:
|
|
195
|
+
triggerAriaLabel: Fe,
|
|
196
|
+
searchPlaceholder: Ie,
|
|
197
|
+
showAllLabel: Le,
|
|
198
|
+
noResultsLabel: Re
|
|
198
199
|
})
|
|
199
200
|
}, t.id);
|
|
200
|
-
let m = /* @__PURE__ */
|
|
201
|
+
let p = t.isPlaceholder ? null : te(t.column.columnDef.header, t.getContext()), m = /* @__PURE__ */ x(oe, {
|
|
201
202
|
colSpan: t.colSpan,
|
|
202
|
-
|
|
203
|
-
style: C(t, Y),
|
|
203
|
+
style: w(t, Y),
|
|
204
204
|
draggable: u && !X || void 0,
|
|
205
|
-
onDragStart: u ? (e) =>
|
|
206
|
-
onDragOver: u ? (e) =>
|
|
207
|
-
onDrop: u ? (e) =>
|
|
208
|
-
onDragEnd: u ? () =>
|
|
209
|
-
className: e(l && "relative", d && !X && "transition-colors hover:bg-[var(--ui-table-header-cell-color-hover)] active:bg-[var(--ui-table-header-cell-color-active)]", u && !X && "cursor-grab select-none active:cursor-grabbing", u &&
|
|
210
|
-
children: [
|
|
205
|
+
onDragStart: u ? (e) => St(e, t.column.id) : void 0,
|
|
206
|
+
onDragOver: u ? (e) => Ct(e, t.column.id) : void 0,
|
|
207
|
+
onDrop: u ? (e) => wt(e, t.column.id) : void 0,
|
|
208
|
+
onDragEnd: u ? () => G(void 0) : void 0,
|
|
209
|
+
className: e(l && "relative", d && !X && "transition-colors hover:bg-[var(--ui-table-header-cell-color-hover)] active:bg-[var(--ui-table-header-cell-color-active)]", u && !X && "cursor-grab select-none active:cursor-grabbing", u && W === t.column.id && "opacity-50", s && $),
|
|
210
|
+
children: [typeof p == "string" && t.column.columnDef.meta?.wrap ? /* @__PURE__ */ b(ee, { children: p }) : p, l && /* @__PURE__ */ b("div", {
|
|
211
211
|
role: "separator",
|
|
212
212
|
"aria-orientation": "vertical",
|
|
213
|
-
"aria-label":
|
|
213
|
+
"aria-label": ke,
|
|
214
214
|
"aria-valuenow": t.column.getSize(),
|
|
215
|
-
"aria-valuemin": t.column.columnDef.minSize ??
|
|
215
|
+
"aria-valuemin": t.column.columnDef.minSize ?? me,
|
|
216
216
|
"aria-valuemax": t.column.columnDef.maxSize ?? E,
|
|
217
217
|
tabIndex: 0,
|
|
218
218
|
draggable: !1,
|
|
219
219
|
onMouseDown: t.getResizeHandler(),
|
|
220
220
|
onTouchStart: t.getResizeHandler(),
|
|
221
|
-
onKeyDown: (e) =>
|
|
221
|
+
onKeyDown: (e) => xt(e, t),
|
|
222
222
|
className: e("absolute end-0 top-0 h-full w-1 cursor-(--ui-resizable-cursor) touch-none select-none bg-[var(--ui-table-global-row-border-color)] opacity-0 transition-[opacity,background-color] hover:bg-[var(--ui-resizable-border-color-hover)] hover:opacity-100 focus-visible:bg-[var(--ui-resizable-border-color-hover)] focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-[var(--ui-focus-primary)]", t.column.getIsResizing() && "bg-[var(--ui-resizable-border-color-active)] opacity-100")
|
|
223
223
|
})]
|
|
224
224
|
});
|
|
225
|
-
return
|
|
226
|
-
disabled: X ||
|
|
227
|
-
children: [/* @__PURE__ */
|
|
225
|
+
return f.length === 0 ? /* @__PURE__ */ b(v, { children: m }, t.id) : /* @__PURE__ */ x(r, {
|
|
226
|
+
disabled: X || W !== void 0,
|
|
227
|
+
children: [/* @__PURE__ */ b(o, { render: m }), /* @__PURE__ */ b(i, {
|
|
228
228
|
className: "flex flex-col gap-1",
|
|
229
|
-
children:
|
|
230
|
-
/* @__PURE__ */
|
|
229
|
+
children: f.map((e) => /* @__PURE__ */ x("span", { children: [
|
|
230
|
+
/* @__PURE__ */ x("span", {
|
|
231
231
|
className: "font-semibold",
|
|
232
232
|
children: [e.label, ":"]
|
|
233
233
|
}),
|
|
@@ -237,80 +237,80 @@ function k({ columns: x = [], data: S = [], table: k, getRowId: he, getRowCanExp
|
|
|
237
237
|
})]
|
|
238
238
|
}, t.id);
|
|
239
239
|
})
|
|
240
|
-
}, t.id)) }) }), /* @__PURE__ */
|
|
241
|
-
|
|
240
|
+
}, t.id)) }) }), /* @__PURE__ */ x(ae, { children: [
|
|
241
|
+
N ? Array.from({ length: ye }).map((e, t) => /* @__PURE__ */ b(g, {
|
|
242
242
|
className: "hover:bg-transparent",
|
|
243
|
-
children: q.getVisibleLeafColumns().map((e) => /* @__PURE__ */
|
|
243
|
+
children: q.getVisibleLeafColumns().map((e) => /* @__PURE__ */ b(h, { children: /* @__PURE__ */ b("div", { className: "h-4 w-full animate-pulse rounded bg-[var(--ui-background-surface-secondary)]" }) }, e.id))
|
|
244
244
|
}, `skeleton-${t}`)) : Z?.length ? Z.map((t, r) => {
|
|
245
|
-
if (
|
|
246
|
-
let i = t.getIsSelected(), a =
|
|
247
|
-
return /* @__PURE__ */
|
|
245
|
+
if (z) return /* @__PURE__ */ b(v, { children: z(t, r) }, t.id);
|
|
246
|
+
let i = t.getIsSelected(), a = M && it === t.id, o = i || a ? "bg-[var(--ui-table-data-row-color-active)]" : j && r % 2 == 1 ? "bg-[var(--ui-background-surface-secondary)]" : "bg-background group-hover:bg-[var(--ui-table-data-row-color-hover)]", ee = !Q && gt === t.id;
|
|
247
|
+
return /* @__PURE__ */ x(v, { children: [/* @__PURE__ */ b(g, {
|
|
248
248
|
ref: (e) => {
|
|
249
|
-
|
|
249
|
+
ct.current[r] = e;
|
|
250
250
|
},
|
|
251
|
-
tabIndex: r ===
|
|
252
|
-
onFocus: () =>
|
|
253
|
-
onKeyDown: (e) =>
|
|
251
|
+
tabIndex: r === Tt ? 0 : -1,
|
|
252
|
+
onFocus: () => Et(r),
|
|
253
|
+
onKeyDown: (e) => Dt(e, r),
|
|
254
254
|
selected: i,
|
|
255
|
-
onClick:
|
|
256
|
-
className: e("group",
|
|
255
|
+
onClick: M ? () => at(t.id) : void 0,
|
|
256
|
+
className: e("group", M && "cursor-pointer", j && r % 2 == 1 && !i && !a && "bg-[var(--ui-background-surface-secondary)]", a && !i && "bg-[var(--ui-table-data-row-color-active)]", ee && "hover:bg-transparent"),
|
|
257
257
|
children: t.getVisibleCells().map((r) => {
|
|
258
258
|
let i = r.column.getIsPinned();
|
|
259
|
-
return r.column.id === "__actions" ? /* @__PURE__ */
|
|
260
|
-
style:
|
|
259
|
+
return r.column.id === "__actions" ? /* @__PURE__ */ b(ie, {
|
|
260
|
+
style: T(r, Y),
|
|
261
261
|
className: o,
|
|
262
262
|
bulkSelectionActive: Q,
|
|
263
|
-
onMouseEnter: Q ? void 0 : () =>
|
|
264
|
-
onMouseLeave: Q ? void 0 : () =>
|
|
265
|
-
children:
|
|
266
|
-
render: /* @__PURE__ */
|
|
267
|
-
children: /* @__PURE__ */
|
|
268
|
-
}), /* @__PURE__ */
|
|
263
|
+
onMouseEnter: Q ? void 0 : () => _t(t.id),
|
|
264
|
+
onMouseLeave: Q ? void 0 : () => _t((e) => e === t.id ? void 0 : e),
|
|
265
|
+
children: Ne && /* @__PURE__ */ x(p, { children: [/* @__PURE__ */ b(ne, {
|
|
266
|
+
render: /* @__PURE__ */ b(n, { "aria-label": Pe }),
|
|
267
|
+
children: /* @__PURE__ */ b(pe, {})
|
|
268
|
+
}), /* @__PURE__ */ b(m, {
|
|
269
269
|
align: "end",
|
|
270
|
-
children:
|
|
270
|
+
children: Ne(t)
|
|
271
271
|
})] })
|
|
272
|
-
}, r.id) : /* @__PURE__ */
|
|
272
|
+
}, r.id) : /* @__PURE__ */ b(h, {
|
|
273
273
|
wrap: r.column.columnDef.meta?.wrap,
|
|
274
|
-
style:
|
|
274
|
+
style: T(r, Y),
|
|
275
275
|
className: e(i && o),
|
|
276
|
-
children:
|
|
276
|
+
children: te(r.column.columnDef.cell, r.getContext())
|
|
277
277
|
}, r.id);
|
|
278
278
|
})
|
|
279
|
-
}),
|
|
279
|
+
}), A && t.getIsExpanded() && /* @__PURE__ */ b(g, {
|
|
280
280
|
className: "hover:bg-transparent",
|
|
281
|
-
children: /* @__PURE__ */
|
|
281
|
+
children: /* @__PURE__ */ b(h, {
|
|
282
282
|
className: "h-auto py-3",
|
|
283
283
|
colSpan: t.getVisibleCells().length,
|
|
284
|
-
children:
|
|
284
|
+
children: A(t)
|
|
285
285
|
})
|
|
286
286
|
})] }, t.id);
|
|
287
|
-
}) :
|
|
287
|
+
}) : B ? /* @__PURE__ */ b(g, { children: /* @__PURE__ */ b(h, {
|
|
288
288
|
colSpan: q.getVisibleLeafColumns().length,
|
|
289
289
|
className: "h-24 text-center",
|
|
290
|
-
children:
|
|
291
|
-
}) }) : /* @__PURE__ */
|
|
290
|
+
children: B({ hasFilters: q.getState().columnFilters.length > 0 })
|
|
291
|
+
}) }) : /* @__PURE__ */ b(g, { children: /* @__PURE__ */ b(h, {
|
|
292
292
|
colSpan: q.getVisibleLeafColumns().length,
|
|
293
293
|
className: "h-24 text-center text-[var(--ui-table-data-value-color-disabled)]",
|
|
294
|
-
children:
|
|
294
|
+
children: Ae
|
|
295
295
|
}) }),
|
|
296
|
-
J && !
|
|
297
|
-
ref:
|
|
296
|
+
J && !N && Z.length > 0 && H && /* @__PURE__ */ b(g, {
|
|
297
|
+
ref: bt,
|
|
298
298
|
"aria-hidden": !0,
|
|
299
299
|
className: "hover:bg-transparent",
|
|
300
|
-
children: /* @__PURE__ */
|
|
300
|
+
children: /* @__PURE__ */ b(h, {
|
|
301
301
|
colSpan: q.getVisibleLeafColumns().length,
|
|
302
302
|
className: "h-1 p-0"
|
|
303
303
|
})
|
|
304
304
|
}),
|
|
305
|
-
J && !
|
|
305
|
+
J && !N && Z.length > 0 && je && /* @__PURE__ */ b(g, {
|
|
306
306
|
className: "hover:bg-transparent",
|
|
307
|
-
children: /* @__PURE__ */
|
|
307
|
+
children: /* @__PURE__ */ b(h, {
|
|
308
308
|
colSpan: q.getVisibleLeafColumns().length,
|
|
309
|
-
children: /* @__PURE__ */
|
|
309
|
+
children: /* @__PURE__ */ b("div", {
|
|
310
310
|
role: "status",
|
|
311
311
|
"aria-live": "polite",
|
|
312
312
|
className: "h-4 w-full animate-pulse rounded bg-[var(--ui-background-surface-secondary)]",
|
|
313
|
-
children: /* @__PURE__ */
|
|
313
|
+
children: /* @__PURE__ */ b("span", {
|
|
314
314
|
className: "sr-only",
|
|
315
315
|
children: "Loading more rows…"
|
|
316
316
|
})
|
|
@@ -322,6 +322,6 @@ function k({ columns: x = [], data: S = [], table: k, getRowId: he, getRowCanExp
|
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
//#endregion
|
|
325
|
-
export { k as DataTable,
|
|
325
|
+
export { k as DataTable, T as getCellStyle, C as getColumnWidth, S as getPinnedStyle, D as getResizeKeyboardStep, O as reorderColumn };
|
|
326
326
|
|
|
327
327
|
//# sourceMappingURL=data-table.js.map
|