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