@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.
@@ -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 { 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";
10
- import { isBulkSelectionActive as ce } from "./data-table-selection.js";
11
- import { DataTableViewOptions as le } from "./data-table-view-options.js";
12
- import { Fragment as v, useEffect as ue, useMemo as de, useRef as fe, useState as y } from "react";
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 pe } from "@acronis-platform/icons-react/stroke-mono";
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 me = 20, E = 2 ** 53 - 1;
45
- function D(e, t, { shiftKey: n, min: r, max: i }) {
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 O(e, t, n) {
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 he = {
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: 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);
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
- I === void 0 && Ye(e), Te?.(e);
84
- }, K = !Me && !k, mt = de(() => K ? [{
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
- }] : [], [K]), ht = de(() => [...S, ...mt], [S, mt]), [gt, _t] = y(), vt = f({
93
+ }] : [], [G]), vt = fe(() => [...S, ..._t], [S, _t]), [yt, K] = y(), bt = f({
93
94
  data: C,
94
- columns: ht,
95
- getRowId: ge,
96
- enableColumnResizing: P,
95
+ columns: vt,
96
+ getRowId: _e,
97
+ enableColumnResizing: Ce,
97
98
  columnResizeMode: "onChange",
98
99
  getCoreRowModel: s(),
99
100
  getExpandedRowModel: c(),
100
- ...V === "page" ? { getPaginationRowModel: u() } : {},
101
- getRowCanExpand: _e,
102
- onExpandedChange: Qe,
103
- manualSorting: L,
104
- onSortingChange: ft,
105
- ...L ? {} : { getSortedRowModel: d() },
106
- onColumnFiltersChange: We,
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: dt,
109
- onRowSelectionChange: pt,
110
- onColumnSizingChange: lt,
111
- onColumnOrderChange: ut,
112
- initialState: K ? { columnPinning: { right: ["__actions"] } } : void 0,
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: He,
115
- columnFilters: Ue,
116
- columnVisibility: qe,
117
- rowSelection: Xe,
118
- expanded: Ze,
119
- columnSizing: $e,
120
- columnOrder: rt
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 ?? vt, J = !k && V === "infinite", Y = P && !k, yt = xe && !k, X = !!q.getState().columnSizingInfo.isResizingColumn;
123
- ue(() => {
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 bt = t({
129
- onIntersect: () => De?.(),
130
- disabled: !J || !H || je,
131
- rootMargin: Oe
132
- }), xt = (e, t) => {
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 = D(e.key, t.column.getSize(), {
135
+ let n = O(e.key, t.column.getSize(), {
135
136
  shiftKey: e.shiftKey,
136
- min: t.column.columnDef.minSize ?? me,
137
- max: t.column.columnDef.maxSize ?? E
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
- }, St = (e, t) => {
144
- e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", t)), G(t);
145
- }, Ct = (e, t) => {
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 = W ? q.getColumn(W)?.parent?.id : void 0, r = q.getColumn(t)?.parent?.id;
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
- }, 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);
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(O(r, W, t)), G(void 0);
157
+ q.setColumnOrder(he(r, V, t)), H(void 0);
157
158
  };
158
- ue(() => {
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
- ht,
165
+ vt,
165
166
  k
166
167
  ]);
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) => {
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(), 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";
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)]", Ot),
176
- children: /* @__PURE__ */ x(re, {
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(se, { children: q.getHeaderGroups().map((t, n, a) => /* @__PURE__ */ b(g, {
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 && yt && !t.isPlaceholder && !s, d = !c && !t.isPlaceholder && t.column.getCanSort(), f = [
182
- d && U.sort,
183
- u && U.reorder,
184
- l && U.resize
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(le, {
193
+ children: /* @__PURE__ */ b(de, {
193
194
  table: q,
194
195
  iconOnly: !0,
195
- triggerAriaLabel: Fe,
196
- searchPlaceholder: Ie,
197
- showAllLabel: Le,
198
- noResultsLabel: Re
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(oe, {
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) => 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 && $),
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": ke,
214
+ "aria-label": Fe,
214
215
  "aria-valuenow": t.column.getSize(),
215
- "aria-valuemin": t.column.columnDef.minSize ?? me,
216
- "aria-valuemax": t.column.columnDef.maxSize ?? E,
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) => xt(e, t),
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(v, { children: m }, t.id) : /* @__PURE__ */ x(r, {
226
- disabled: X || W !== void 0,
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(ae, { children: [
241
- N ? Array.from({ length: ye }).map((e, t) => /* @__PURE__ */ b(g, {
242
- className: "hover:bg-transparent",
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
- }, `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
- className: "h-auto py-3",
283
- colSpan: t.getVisibleCells().length,
284
- children: A(t)
285
- })
286
- })] }, t.id);
287
- }) : B ? /* @__PURE__ */ b(g, { children: /* @__PURE__ */ b(h, {
288
- colSpan: q.getVisibleLeafColumns().length,
289
- className: "h-24 text-center",
290
- children: B({ hasFilters: q.getState().columnFilters.length > 0 })
291
- }) }) : /* @__PURE__ */ b(g, { children: /* @__PURE__ */ b(h, {
292
- colSpan: q.getVisibleLeafColumns().length,
293
- className: "h-24 text-center text-[var(--ui-table-data-value-color-disabled)]",
294
- children: Ae
295
- }) }),
296
- J && !N && Z.length > 0 && H && /* @__PURE__ */ b(g, {
297
- ref: bt,
298
- "aria-hidden": !0,
299
- className: "hover:bg-transparent",
300
- children: /* @__PURE__ */ b(h, {
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-1 p-0"
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
- children: /* @__PURE__ */ b("div", {
310
- role: "status",
311
- "aria-live": "polite",
312
- className: "h-4 w-full animate-pulse rounded bg-[var(--ui-background-surface-secondary)]",
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
- className: "sr-only",
315
- children: "Loading more rows…"
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, D as getResizeKeyboardStep, O as reorderColumn };
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