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