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