@pibit.ai/cure-design-system 0.3.30 → 0.3.35

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.
@@ -1,203 +1,203 @@
1
- import { jsx as c, jsxs as _, Fragment as zt } from "react/jsx-runtime";
2
- import { forwardRef as Fr, useState as q, useRef as ae, useCallback as v, useMemo as k, useEffect as $, useLayoutEffect as Gr } from "react";
1
+ import { jsx as c, jsxs as _, Fragment as Mt } from "react/jsx-runtime";
2
+ import { forwardRef as Fr, useState as A, useRef as le, useCallback as v, useMemo as k, useEffect as B, useLayoutEffect as Gr } from "react";
3
3
  import { ChevronRight as zr } from "@untitledui/icons";
4
4
  import { cx as m } from "../../utils/cn.js";
5
- import { TableCard as Yr, Table as w } from "./table.js";
5
+ import { TableCard as Yr, Table as g } from "./table.js";
6
6
  import { TablePagination as Mr } from "./TablePagination.js";
7
- import { getEffectiveAlignment as At, resolveColumnLabel as Ur, alignmentClass as Xr } from "./toolbar/tableToolbarHelpers.js";
8
- import { findGridCell as $r, isWithinCellEditor as We, getGridNeighbor as jr, getGridTabNeighbor as Br, focusGridCell as Yt, GridNavProvider as qr } from "./useGridKeyboardNavigation.js";
9
- import { ROW_DRAG_THRESHOLD_PX as Ar, computeDropTarget as Hr, clipDropLineToScrollport as Kr, ROW_REORDER_ATTR as Mt, measureRowPreview as Jr, cloneRowForPreview as Vr, FloatingRowPreview as Qr, DropIndicatorLine as Zr, getRowDragScrollDelta as en, ROW_DRAG_SOURCE_STYLE as tn, ROW_SOURCE_INDEX_ATTR as rn } from "./rowReorderDrag.js";
10
- import { selectionFromSingleCell as _e, resolveCellCoordFromElement as Se, buildCellRangeRect as it, CELL_RANGE_DRAG_THRESHOLD_PX as nn, hitTestGridCell as on, canStartCellRangeFromTarget as Ut, getDragScrollDeltas as sn, getCellRangeVisualState as an, cellRangeEdgeBoxShadow as cn } from "./cellRangeSelection.js";
11
- import { BulkActionBar as dn } from "./toolbar/BulkActionBar.js";
12
- import { TableToolbar as ln } from "./toolbar/TableToolbar.js";
13
- import { Checkbox as Xt } from "../../primitives/checkbox/checkbox.js";
14
- import { ColumnHeaderMenu as un } from "./toolbar/ColumnHeaderMenu.js";
15
- import { Button as fn } from "../../primitives/button/button.js";
16
- import { SummaryFooterRow as pn } from "./toolbar/SummaryFooter.js";
17
- import { RowActionsMenu as hn } from "./toolbar/RowActionsMenu.js";
18
- import { Icon as yn } from "../../primitives/icon/icon.js";
19
- import { ShimmerLine as wn } from "../../primitives/shimmer/shimmer.js";
20
- const mn = 5, gn = "__all__", $t = {
7
+ import { getEffectiveAlignment as Ht, resolveColumnLabel as Ur, alignmentClass as Xr } from "./toolbar/tableToolbarHelpers.js";
8
+ import { findGridCell as $r, isWithinCellEditor as Te, getGridNeighbor as jr, getGridTabNeighbor as Br, focusGridCell as Ut, GridNavProvider as qr } from "./useGridKeyboardNavigation.js";
9
+ import { ROW_DRAG_THRESHOLD_PX as Ar, computeDropTarget as Kr, clipDropLineToScrollport as Hr, ROW_REORDER_ATTR as Xt, measureRowPreview as Jr, cloneRowForPreview as Vr, FloatingRowPreview as Qr, DropIndicatorLine as Zr, getRowDragScrollDelta as en, ROW_DRAG_SOURCE_STYLE as tn, ROW_SOURCE_INDEX_ATTR as rn } from "./rowReorderDrag.js";
10
+ import { selectionFromSingleCell as st, resolveCellCoordFromElement as Oe, resolveRowAnchorCoordFromTarget as nn, buildCellRangeRect as at, nextKeyboardCellSelection as on, CELL_RANGE_DRAG_THRESHOLD_PX as sn, hitTestGridCell as an, canStartCellRangeFromTarget as $t, getDragScrollDeltas as cn, getCellRangeVisualState as dn, cellRangeEdgeBoxShadow as ln } from "./cellRangeSelection.js";
11
+ import { BulkActionBar as un } from "./toolbar/BulkActionBar.js";
12
+ import { TableToolbar as fn } from "./toolbar/TableToolbar.js";
13
+ import { Checkbox as jt } from "../../primitives/checkbox/checkbox.js";
14
+ import { ColumnHeaderMenu as pn } from "./toolbar/ColumnHeaderMenu.js";
15
+ import { Button as hn } from "../../primitives/button/button.js";
16
+ import { SummaryFooterRow as yn } from "./toolbar/SummaryFooter.js";
17
+ import { RowActionsMenu as wn } from "./toolbar/RowActionsMenu.js";
18
+ import { Icon as gn } from "../../primitives/icon/icon.js";
19
+ import { ShimmerLine as mn } from "../../primitives/shimmer/shimmer.js";
20
+ const xn = 5, bn = "__all__", Bt = {
21
21
  ArrowUp: "up",
22
22
  ArrowDown: "down",
23
23
  ArrowLeft: "left",
24
24
  ArrowRight: "right"
25
- }, ce = (o) => o.__rowId ?? o.id ?? o.rule_id ?? String(o);
26
- function jt(o, d) {
27
- return o === "all" ? new Set(d) : o ?? /* @__PURE__ */ new Set();
25
+ }, ue = (i) => i.__rowId ?? i.id ?? i.rule_id ?? String(i);
26
+ function qt(i, d) {
27
+ return i === "all" ? new Set(d) : i ?? /* @__PURE__ */ new Set();
28
28
  }
29
- function xn(o, d, u) {
30
- return o ? o === "all" ? u.includes(d) : o.has(d) : !1;
29
+ function Rn(i, d, u) {
30
+ return i ? i === "all" ? u.includes(d) : i.has(d) : !1;
31
31
  }
32
- function bn(o, d) {
33
- return o ? o === "all" ? d.length : o.size : 0;
32
+ function vn(i, d) {
33
+ return i ? i === "all" ? d.length : i.size : 0;
34
34
  }
35
- function Rn(o, d) {
36
- return d.length === 0 ? !1 : o === "all" ? !0 : d.every((u) => (o == null ? void 0 : o.has(u)) ?? !1);
35
+ function kn(i, d) {
36
+ return d.length === 0 ? !1 : i === "all" ? !0 : d.every((u) => (i == null ? void 0 : i.has(u)) ?? !1);
37
37
  }
38
- function vn(o, d) {
39
- return o === "all" ? d.length > 0 : d.some((u) => (o == null ? void 0 : o.has(u)) ?? !1);
38
+ function En(i, d) {
39
+ return i === "all" ? d.length > 0 : d.some((u) => (i == null ? void 0 : i.has(u)) ?? !1);
40
40
  }
41
- function kn(o) {
42
- if (o)
41
+ function In(i) {
42
+ if (i)
43
43
  return (d) => {
44
- o(d === "all" ? "all" : new Set([...d].map(String)));
44
+ i(d === "all" ? "all" : new Set([...d].map(String)));
45
45
  };
46
46
  }
47
- function En(o) {
47
+ function Ln(i) {
48
48
  var d;
49
- return o != null && o.length ? o.length > 1 ? !0 : ((d = o[0]) == null ? void 0 : d.key) !== gn : !1;
49
+ return i != null && i.length ? i.length > 1 ? !0 : ((d = i[0]) == null ? void 0 : d.key) !== bn : !1;
50
50
  }
51
- function Bt(o, d, u) {
52
- return u ? At(u, d ?? /* @__PURE__ */ new Map()) : (d == null ? void 0 : d.get(o)) ?? "left";
51
+ function At(i, d, u) {
52
+ return u ? Ht(u, d ?? /* @__PURE__ */ new Map()) : (d == null ? void 0 : d.get(i)) ?? "left";
53
53
  }
54
- const at = "300px", ot = (o) => {
55
- if (!o) return 0;
56
- const d = o.match(/^(\d+(?:\.\d+)?)px$/);
54
+ const lt = "300px", ct = (i) => {
55
+ if (!i) return 0;
56
+ const d = i.match(/^(\d+(?:\.\d+)?)px$/);
57
57
  return d ? Number(d[1]) : 0;
58
- }, de = (o) => !!o.width || !!(o.maxWidth && o.sticky === "right"), st = (o) => o.width ?? (o.maxWidth && o.sticky === "right" ? o.maxWidth : void 0), In = (o) => ({
59
- width: o.width,
60
- maxWidth: o.maxWidth ?? at,
61
- minWidth: o.minWidth ?? o.width
62
- }), qt = (o) => {
63
- const d = st(o);
58
+ }, fe = (i) => !!i.width || !!(i.maxWidth && i.sticky === "right"), dt = (i) => i.width ?? (i.maxWidth && i.sticky === "right" ? i.maxWidth : void 0), Nn = (i) => ({
59
+ width: i.width,
60
+ maxWidth: i.maxWidth ?? lt,
61
+ minWidth: i.minWidth ?? i.width
62
+ }), Kt = (i) => {
63
+ const d = dt(i);
64
64
  return d ? {
65
65
  minWidth: d,
66
66
  width: d,
67
- maxWidth: o.maxWidth ?? d
67
+ maxWidth: i.maxWidth ?? d
68
68
  } : {
69
- minWidth: o.minWidth,
70
- maxWidth: o.maxWidth ?? at
69
+ minWidth: i.minWidth,
70
+ maxWidth: i.maxWidth ?? lt
71
71
  };
72
- }, qn = Fr(
72
+ }, Kn = Fr(
73
73
  function({
74
74
  data: d,
75
75
  columns: u,
76
- renderRowCell: ct,
77
- onRowClick: le,
78
- onRowHover: A,
79
- arialabel: Ht,
80
- size: dt = "sm",
81
- allowDefaultRowClass: Kt = !1,
82
- centeredHeaders: Jt = [],
83
- rootClassName: Vt,
84
- removeBorders: lt,
85
- headerClassName: Qt,
86
- isRowExpandable: ut,
87
- renderExpandedContent: Zt,
88
- loading: M = !1,
89
- loadingRowCount: ft = mn,
90
- renderHeaderCell: Ce,
91
- tableClassName: er,
92
- getRowClassName: Te,
93
- selectionMode: Z = "none",
76
+ renderRowCell: ut,
77
+ onRowClick: pe,
78
+ onRowHover: K,
79
+ arialabel: Jt,
80
+ size: ft = "sm",
81
+ allowDefaultRowClass: Vt = !1,
82
+ centeredHeaders: Qt = [],
83
+ rootClassName: Zt,
84
+ removeBorders: pt,
85
+ headerClassName: er,
86
+ isRowExpandable: ht,
87
+ renderExpandedContent: tr,
88
+ loading: X = !1,
89
+ loadingRowCount: yt = xn,
90
+ renderHeaderCell: Fe,
91
+ tableClassName: rr,
92
+ getRowClassName: Ge,
93
+ selectionMode: te = "none",
94
94
  selectedKeys: C,
95
95
  onSelectionChange: D,
96
- inlineSelection: ue = !1,
96
+ inlineSelection: he = !1,
97
97
  toolbar: R,
98
- showToolbar: tr,
99
- toolbarTitle: pt,
100
- toolbarTrailing: ht,
101
- disableExtendedTools: Oe,
98
+ showToolbar: nr,
99
+ toolbarTitle: wt,
100
+ toolbarTrailing: gt,
101
+ disableExtendedTools: ze,
102
102
  pagination: P,
103
- showBorders: fe,
104
- emptyState: yt,
105
- editChrome: O,
106
- showEditActions: rr = !1,
107
- searchCollapsible: wt,
108
- isEditable: nr,
109
- toolbarSlot: Fe,
110
- rowHeightClass: mt,
103
+ showBorders: ye,
104
+ emptyState: mt,
105
+ editChrome: F,
106
+ showEditActions: or = !1,
107
+ searchCollapsible: xt,
108
+ isEditable: ir,
109
+ toolbarSlot: Ye,
110
+ rowHeightClass: bt,
111
111
  groupedData: H,
112
- showSummaryFooter: ir,
113
- summaryFooterProps: Ge,
114
- bulkActionBar: pe,
115
- renderBulkActionBar: he,
116
- onBulkDuplicate: ye,
117
- onBulkDelete: we,
118
- bulkActionBusy: me,
119
- columnAlignments: K,
120
- onColumnHeaderAction: ge,
121
- showColumnHeaderMenu: or,
122
- columnMenuCapabilities: sr,
123
- renderGroupHeader: gt,
124
- columnMenuSchema: ee,
125
- columnSchema: te,
126
- labelMeta: ar,
127
- renderColumnHeaderMenuExtraItems: cr,
112
+ showSummaryFooter: sr,
113
+ summaryFooterProps: Me,
114
+ bulkActionBar: we,
115
+ renderBulkActionBar: ge,
116
+ onBulkDuplicate: me,
117
+ onBulkDelete: xe,
118
+ bulkActionBusy: be,
119
+ columnAlignments: J,
120
+ onColumnHeaderAction: Re,
121
+ showColumnHeaderMenu: ar,
122
+ columnMenuCapabilities: cr,
123
+ renderGroupHeader: Rt,
124
+ columnMenuSchema: re,
125
+ columnSchema: ne,
126
+ labelMeta: dr,
127
+ renderColumnHeaderMenuExtraItems: lr,
128
128
  fillWidth: L = !1,
129
129
  rowActions: E,
130
- onCellActivate: J,
131
- cellSelection: h = null,
130
+ onCellActivate: V,
131
+ cellSelection: y = null,
132
132
  onCellSelectionChange: N,
133
- onCopyCells: ze,
134
- onPasteCells: Ye,
135
- onClearCells: Me
136
- }, re) {
137
- const [xe, dr] = q(
133
+ onCopyCells: Ue,
134
+ onPasteCells: Xe,
135
+ onClearCells: $e
136
+ }, oe) {
137
+ const [ve, ur] = A(
138
138
  () => /* @__PURE__ */ new Set()
139
- ), [lr, xt] = q(
139
+ ), [fr, vt] = A(
140
140
  null
141
- ), [f, ur] = q(null), F = ae(null), Ue = ae({ x: 0, y: 0 }), V = v((e) => {
142
- F.current = e, ur(e);
143
- }, []), [j, bt] = q(null), [Q, fr] = q(null), y = typeof N == "function", U = ae(null), Xe = ae({ x: 0, y: 0 }), [be, Rt] = q(!1), Re = Z === "single" || Z === "multiple", $e = !!E, G = Re && !ue, ve = En(H), je = !!(E != null && E.onReorderRows) && (E == null ? void 0 : E.enableRowReorder) !== !1 && !ve && !M, pr = k(() => ee != null && ee.length ? new Map(ee.map((e) => [e.key, e])) : /* @__PURE__ */ new Map(), [ee]), vt = k(() => te != null && te.length ? new Map(te.map((e) => [e.value, e])) : /* @__PURE__ */ new Map(), [te]), z = k(
141
+ ), [f, pr] = A(null), G = le(null), je = le({ x: 0, y: 0 }), Q = v((e) => {
142
+ G.current = e, pr(e);
143
+ }, []), [q, kt] = A(null), [Z, hr] = A(null), h = typeof N == "function", $ = le(null), Be = le({ x: 0, y: 0 }), [ke, Et] = A(!1), Ee = te === "single" || te === "multiple", qe = !!E, z = Ee && !he, Ie = Ln(H), Ae = !!(E != null && E.onReorderRows) && (E == null ? void 0 : E.enableRowReorder) !== !1 && !Ie && !X, yr = k(() => re != null && re.length ? new Map(re.map((e) => [e.key, e])) : /* @__PURE__ */ new Map(), [re]), It = k(() => ne != null && ne.length ? new Map(ne.map((e) => [e.value, e])) : /* @__PURE__ */ new Map(), [ne]), Y = k(
144
144
  () => u.map((e) => e.key),
145
145
  [u]
146
- ), hr = v((e) => {
147
- dr((r) => {
146
+ ), wr = v((e) => {
147
+ ur((r) => {
148
148
  const t = new Set(r);
149
149
  return t.has(e) ? t.delete(e) : t.add(e), t;
150
150
  });
151
- }, []), ke = k(() => M ? Array.from({ length: ft }, (e, r) => ({
151
+ }, []), Le = k(() => X ? Array.from({ length: yt }, (e, r) => ({
152
152
  id: `loading-${r}`
153
153
  })) : d.map((e) => {
154
154
  const r = e;
155
155
  if (r.__rowId != null)
156
156
  return r;
157
- const t = ce(r);
157
+ const t = ue(r);
158
158
  return r.id != null && String(r.id) === t ? r : { ...r, id: t };
159
- }), [M, d, ft]), x = k(() => M ? [] : ve && H ? H.flatMap(
160
- (e) => xe.has(e.key) ? [] : e.rows.map((r) => ce(r))
161
- ) : ke.map((e) => ce(e)), [M, ve, H, xe, ke]), Be = k(
162
- () => jt(C, x),
163
- [C, x]
164
- ), qe = bn(C, x), Ae = qe > 0, kt = Ae && !!(pe ?? he ?? ye ?? we), ne = k(() => {
165
- if (!Ae) return;
159
+ }), [X, d, yt]), b = k(() => X ? [] : Ie && H ? H.flatMap(
160
+ (e) => ve.has(e.key) ? [] : e.rows.map((r) => ue(r))
161
+ ) : Le.map((e) => ue(e)), [X, Ie, H, ve, Le]), ie = k(
162
+ () => qt(C, b),
163
+ [C, b]
164
+ ), Ke = vn(C, b), He = Ke > 0, Lt = He && !!(we ?? ge ?? me ?? xe), se = k(() => {
165
+ if (!He) return;
166
166
  const e = d.filter(
167
- (r) => Be.has(ce(r))
167
+ (r) => ie.has(ue(r))
168
168
  );
169
169
  return {
170
- selectedKeys: Be,
170
+ selectedKeys: ie,
171
171
  selectedRows: e,
172
172
  clearSelection: () => D == null ? void 0 : D(/* @__PURE__ */ new Set()),
173
- busy: me
173
+ busy: be
174
174
  };
175
175
  }, [
176
- Ae,
177
- Be,
176
+ He,
177
+ ie,
178
178
  d,
179
179
  D,
180
- me
181
- ]), Et = k(() => {
182
- if (Fe != null) return Fe;
183
- if (kt) {
184
- if (pe != null) return pe;
185
- if (he && ne)
186
- return he(ne);
187
- if (ne && (ye || we))
180
+ be
181
+ ]), Nt = k(() => {
182
+ if (Ye != null) return Ye;
183
+ if (Lt) {
184
+ if (we != null) return we;
185
+ if (ge && se)
186
+ return ge(se);
187
+ if (se && (me || xe))
188
188
  return /* @__PURE__ */ c(
189
- dn,
189
+ un,
190
190
  {
191
- count: qe,
192
- onDuplicate: ye,
193
- onDelete: we,
194
- onClearSelection: ne.clearSelection,
195
- busy: me
191
+ count: Ke,
192
+ onDuplicate: me,
193
+ onDelete: xe,
194
+ onClearSelection: se.clearSelection,
195
+ busy: be
196
196
  }
197
197
  );
198
198
  }
199
199
  return R ? /* @__PURE__ */ c(
200
- ln,
200
+ fn,
201
201
  {
202
202
  sort: R.sort,
203
203
  filter: R.filter,
@@ -209,204 +209,212 @@ const at = "300px", ot = (o) => {
209
209
  summary: R.summary,
210
210
  sortContent: R.sortContent,
211
211
  filterContent: R.filterContent,
212
- fallbackTitle: pt,
213
- trailing: ht,
214
- searchCollapsible: wt,
215
- disableExtendedTools: Oe,
212
+ fallbackTitle: wt,
213
+ trailing: gt,
214
+ searchCollapsible: xt,
215
+ disableExtendedTools: ze,
216
216
  undoRedo: R.undoRedo ? {
217
217
  ...R.undoRedo,
218
- isDisabled: R.undoRedo.isDisabled ?? Oe
218
+ isDisabled: R.undoRedo.isDisabled ?? ze
219
219
  } : void 0
220
220
  }
221
221
  ) : null;
222
222
  }, [
223
- Fe,
224
- kt,
225
- pe,
226
- he,
227
- ne,
228
- ye,
223
+ Ye,
224
+ Lt,
229
225
  we,
226
+ ge,
227
+ se,
230
228
  me,
231
- qe,
229
+ xe,
230
+ be,
231
+ Ke,
232
232
  R,
233
- pt,
234
- ht,
235
233
  wt,
236
- Oe
237
- ]), It = Et != null && tr !== !1, Lt = !!P && (P == null ? void 0 : P.showPagination) !== !1, yr = It || Lt, Nt = !M && d.length === 0 && yt != null, S = !!(rr && O), He = !!(O != null && O.showFooterRow), W = nr ?? (S || He || $e), wr = Nt && !(He && O), ie = u.length + (G ? 1 : 0) + (S ? 1 : 0), mr = !!(ir && Ge), I = fe ? "border-r border-secondary last:border-r-0" : void 0, X = k(() => {
234
+ gt,
235
+ xt,
236
+ ze
237
+ ]), Dt = Nt != null && nr !== !1, Pt = !!P && (P == null ? void 0 : P.showPagination) !== !1, gr = Dt || Pt, Wt = !X && d.length === 0 && mt != null, S = !!(or && F), Je = !!(F != null && F.showFooterRow), W = ir ?? (S || Je || qe), mr = Wt && !(Je && F), ae = u.length + (z ? 1 : 0) + (S ? 1 : 0), xr = !!(sr && Me), I = ye ? "border-r border-secondary last:border-r-0" : void 0, j = k(() => {
238
238
  if (!L) return null;
239
239
  const e = u.reduce(
240
- (i, n) => de(n) ? i + ot(st(n)) : i,
240
+ (o, n) => fe(n) ? o + ct(dt(n)) : o,
241
241
  0
242
242
  );
243
243
  return { minTableWidth: u.filter(
244
- (i) => !de(i)
244
+ (o) => !fe(o)
245
245
  ).reduce(
246
- (i, n) => i + ot(n.minWidth),
246
+ (o, n) => o + ct(n.minWidth),
247
247
  0
248
248
  ) + e };
249
- }, [u, L]), gr = k(() => {
249
+ }, [u, L]), br = k(() => {
250
250
  const e = /* @__PURE__ */ new Map();
251
- return ge && u.forEach((r) => {
251
+ return Re && u.forEach((r) => {
252
252
  e.set(
253
253
  r.key,
254
- (t) => ge(r.key, t)
254
+ (t) => Re(r.key, t)
255
255
  );
256
256
  }), e;
257
- }, [u, ge]), g = ae(null), [oe, Dt] = q(null), Ke = v(
257
+ }, [u, Re]), x = le(null), [ce, _t] = A(null), Ve = v(
258
258
  (e, r, t) => {
259
- var a;
260
- let i = t ?? null;
261
- if (i == null) {
262
- const l = (a = $r(
263
- g.current,
259
+ var s;
260
+ let o = t ?? null;
261
+ if (o == null) {
262
+ const l = (s = $r(
263
+ x.current,
264
264
  e,
265
265
  r
266
- )) == null ? void 0 : a.getAttribute("data-grid-source-index"), p = l != null && l !== "" ? Number(l) : NaN;
267
- i = Number.isNaN(p) ? null : p;
266
+ )) == null ? void 0 : s.getAttribute("data-grid-source-index"), p = l != null && l !== "" ? Number(l) : NaN;
267
+ o = Number.isNaN(p) ? null : p;
268
268
  }
269
269
  const n = {
270
270
  rowId: e,
271
271
  columnKey: r,
272
- sourceIndex: i
272
+ sourceIndex: o
273
273
  };
274
- if (y) {
275
- N == null || N(_e(n));
274
+ if (h) {
275
+ N == null || N(st(n));
276
276
  return;
277
277
  }
278
- bt(n);
278
+ kt(n);
279
279
  },
280
- [y, N]
281
- ), Ee = v(() => {
282
- if (y) {
280
+ [h, N]
281
+ ), Ne = v(() => {
282
+ if (h) {
283
283
  N == null || N(null);
284
284
  return;
285
285
  }
286
- bt(null);
287
- }, [y, N]), se = y ? (h == null ? void 0 : h.focus) ?? null : j, T = v(
286
+ kt(null);
287
+ }, [h, N]), ee = h ? (y == null ? void 0 : y.focus) ?? null : q, M = v(
288
288
  (e) => {
289
- y && (N == null || N(e));
289
+ h && (N == null || N(e));
290
290
  },
291
- [y, N]
292
- ), xr = v(
291
+ [h, N]
292
+ ), Rr = v(
293
293
  (e) => {
294
- var b, s, De;
295
- const r = e.key in $t;
296
- if (e.key !== "Enter" && e.key !== "Tab" && e.key !== "Escape" && e.key !== "Delete" && e.key !== "Backspace" && !r || We(e.target)) return;
294
+ var de, T, Ce;
295
+ const r = e.key in Bt;
296
+ if (e.key !== "Enter" && e.key !== "Tab" && e.key !== "Escape" && e.key !== "Delete" && e.key !== "Backspace" && !r || Te(e.target)) return;
297
297
  if (e.key === "Escape") {
298
- if (!se && !h) return;
299
- e.preventDefault(), e.stopPropagation(), Ee(), (b = g.current) != null && b.contains(document.activeElement) && document.activeElement.blur();
298
+ if (!ee && !y) return;
299
+ e.preventDefault(), e.stopPropagation(), Ne(), (de = x.current) != null && de.contains(document.activeElement) && document.activeElement.blur();
300
300
  return;
301
301
  }
302
- const t = (De = (s = e.target).closest) == null ? void 0 : De.call(
303
- s,
302
+ const t = (Ce = (T = e.target).closest) == null ? void 0 : Ce.call(
303
+ T,
304
304
  "[data-grid-cell]"
305
- ), i = t ? Se(t) : null, n = se ?? i;
306
- if (!n) return;
305
+ ), o = t ? Oe(t) : null, n = h && r && e.shiftKey && !ee && !o ? nn(e.target, x.current) : null, s = n != null && ie.has(n.rowId), l = ee ?? o ?? (s ? n : null);
306
+ if (!l) return;
307
307
  if (e.key === "Delete" || e.key === "Backspace") {
308
- if (!y || !h || !Me) return;
309
- const Pe = it(
310
- h,
311
- x,
312
- z
308
+ if (!h || !y || !$e) return;
309
+ const O = at(
310
+ y,
311
+ b,
312
+ Y
313
313
  );
314
- if (!Pe) return;
315
- e.preventDefault(), e.stopPropagation(), Me({ selection: h, rect: Pe, event: e.nativeEvent });
314
+ if (!O) return;
315
+ e.preventDefault(), e.stopPropagation(), $e({ selection: y, rect: O, event: e.nativeEvent });
316
316
  return;
317
317
  }
318
318
  if (e.key === "Enter") {
319
- if (!J) return;
320
- e.preventDefault(), e.stopPropagation(), J({
321
- rowId: n.rowId,
322
- columnKey: n.columnKey,
323
- sourceIndex: n.sourceIndex
319
+ if (!V) return;
320
+ e.preventDefault(), e.stopPropagation(), V({
321
+ rowId: l.rowId,
322
+ columnKey: l.columnKey,
323
+ sourceIndex: l.sourceIndex
324
324
  });
325
325
  return;
326
326
  }
327
- const a = y && e.shiftKey && r && h != null, l = r ? jr(
328
- g.current,
329
- x,
330
- z,
331
- n.rowId,
332
- n.columnKey,
333
- $t[e.key]
327
+ const p = h && e.shiftKey && r, w = r ? jr(
328
+ x.current,
329
+ b,
330
+ Y,
331
+ l.rowId,
332
+ l.columnKey,
333
+ Bt[e.key]
334
334
  ) : Br(
335
- g.current,
336
- x,
337
- z,
338
- n.rowId,
339
- n.columnKey,
335
+ x.current,
336
+ b,
337
+ Y,
338
+ l.rowId,
339
+ l.columnKey,
340
340
  !e.shiftKey
341
341
  );
342
- if (!l) {
342
+ if (!w && !(p && !y)) {
343
343
  r && (e.preventDefault(), e.stopPropagation());
344
344
  return;
345
345
  }
346
346
  e.preventDefault(), e.stopPropagation();
347
- const p = {
348
- rowId: l.rowId,
349
- columnKey: l.columnKey,
350
- sourceIndex: l.sourceIndex
351
- };
352
- a && h ? T({
353
- anchor: h.anchor,
354
- focus: p
355
- }) : y ? T(_e(p)) : Ke(l.rowId, l.columnKey, l.sourceIndex), requestAnimationFrame(
356
- () => Yt(
357
- g.current,
358
- l.rowId,
359
- l.columnKey
347
+ const it = w ? {
348
+ rowId: w.rowId,
349
+ columnKey: w.columnKey,
350
+ sourceIndex: w.sourceIndex
351
+ } : null, _e = s ? null : it;
352
+ if (h) {
353
+ const O = on(
354
+ l,
355
+ _e,
356
+ y,
357
+ p
358
+ );
359
+ O && O !== y && M(O);
360
+ } else w && Ve(w.rowId, w.columnKey, w.sourceIndex);
361
+ const Se = _e ?? l;
362
+ requestAnimationFrame(
363
+ () => Ut(
364
+ x.current,
365
+ Se.rowId,
366
+ Se.columnKey
360
367
  )
361
368
  );
362
369
  },
363
370
  [
364
- se,
365
- x,
366
- y,
371
+ ee,
372
+ b,
367
373
  h,
368
- Ee,
369
- z,
370
- T,
371
- J,
372
- Me,
373
- Ke
374
+ y,
375
+ Ne,
376
+ Y,
377
+ M,
378
+ ie,
379
+ V,
380
+ $e,
381
+ Ve
374
382
  ]
375
383
  );
376
- $(() => {
377
- if (!W || !se && !h) return;
384
+ B(() => {
385
+ if (!W || !ee && !y) return;
378
386
  const e = (r) => {
379
- const t = g.current;
380
- t && !t.contains(r.target) && Ee();
387
+ const t = x.current;
388
+ t && !t.contains(r.target) && Ne();
381
389
  };
382
390
  return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
383
- }, [W, se, h, Ee]);
384
- const Pt = k(() => {
391
+ }, [W, ee, y, Ne]);
392
+ const St = k(() => {
385
393
  let e = 0;
386
- return G && (e += 40), S && (e += 56), u.forEach((r) => {
387
- de(r) && (e += ot(st(r)));
394
+ return z && (e += 40), S && (e += 56), u.forEach((r) => {
395
+ fe(r) && (e += ct(dt(r)));
388
396
  }), e;
389
- }, [u, S, G]), Je = k(
390
- () => u.filter((e) => !de(e)).length,
397
+ }, [u, S, z]), Qe = k(
398
+ () => u.filter((e) => !fe(e)).length,
391
399
  [u]
392
- ), Ve = k(() => {
393
- if (!L || !X) return null;
394
- const { minTableWidth: e } = X;
395
- return oe ? Math.max(oe, e) : e;
396
- }, [oe, L, X]), Qe = !!(L && X && oe && oe < X.minTableWidth), Ze = k(() => !Ve || Je === 0 ? null : Math.max(
400
+ ), Ze = k(() => {
401
+ if (!L || !j) return null;
402
+ const { minTableWidth: e } = j;
403
+ return ce ? Math.max(ce, e) : e;
404
+ }, [ce, L, j]), et = !!(L && j && ce && ce < j.minTableWidth), tt = k(() => !Ze || Qe === 0 ? null : Math.max(
397
405
  0,
398
- (Ve - Pt) / Je
399
- ), [Ve, Pt, Je]);
406
+ (Ze - St) / Qe
407
+ ), [Ze, St, Qe]);
400
408
  Gr(() => {
401
409
  if (!L) {
402
- Dt(null);
410
+ _t(null);
403
411
  return;
404
412
  }
405
- const e = g.current;
413
+ const e = x.current;
406
414
  if (!e) return;
407
415
  const r = () => {
408
- const i = e.clientWidth;
409
- i > 0 && Dt((n) => n === i ? n : i);
416
+ const o = e.clientWidth;
417
+ o > 0 && _t((n) => n === o ? n : o);
410
418
  };
411
419
  r();
412
420
  const t = new ResizeObserver(r);
@@ -417,52 +425,52 @@ const at = "300px", ot = (o) => {
417
425
  u.length,
418
426
  d.length,
419
427
  L,
420
- M,
428
+ X,
421
429
  S,
422
- G
430
+ z
423
431
  ]);
424
- const et = v(
425
- (e) => L ? de(e) ? qt(e) : Ze != null ? {
426
- width: `${Ze}px`,
432
+ const rt = v(
433
+ (e) => L ? fe(e) ? Kt(e) : tt != null ? {
434
+ width: `${tt}px`,
427
435
  minWidth: e.minWidth,
428
- maxWidth: e.maxWidth ?? at
429
- } : qt(e) : In(e),
430
- [L, Ze]
431
- ), br = k(() => {
432
- if (!(!L || !X))
433
- return Qe ? {
434
- width: `${X.minTableWidth}px`,
436
+ maxWidth: e.maxWidth ?? lt
437
+ } : Kt(e) : Nn(e),
438
+ [L, tt]
439
+ ), vr = k(() => {
440
+ if (!(!L || !j))
441
+ return et ? {
442
+ width: `${j.minTableWidth}px`,
435
443
  tableLayout: "fixed"
436
444
  } : {
437
445
  width: "100%",
438
446
  tableLayout: "fixed"
439
447
  };
440
- }, [L, X, Qe]), Rr = v(
448
+ }, [L, j, et]), kr = v(
441
449
  (e) => {
442
- g.current = e, typeof re == "function" ? re(e) : re && (re.current = e);
450
+ x.current = e, typeof oe == "function" ? oe(e) : oe && (oe.current = e);
443
451
  },
444
- [re]
445
- ), vr = Re && ue ? {
446
- selectionMode: Z,
452
+ [oe]
453
+ ), Er = Ee && he ? {
454
+ selectionMode: te,
447
455
  selectedKeys: C === "all" ? "all" : C,
448
- onSelectionChange: kn(D)
449
- } : {}, kr = (e, r = 0) => {
456
+ onSelectionChange: In(D)
457
+ } : {}, Ir = (e, r = 0) => {
450
458
  const t = e.__sourceIndex;
451
459
  return typeof t == "number" ? t : r;
452
- }, Ie = v(
460
+ }, De = v(
453
461
  (e) => {
454
- const r = F.current;
462
+ const r = G.current;
455
463
  if (!r) return;
456
- const { fromSourceIndex: t, toSourceIndex: i, item: n, active: a } = r;
457
- V(null), e && a && t !== i && (E != null && E.onReorderRows) && E.onReorderRows(t, i, n);
464
+ const { fromSourceIndex: t, toSourceIndex: o, item: n, active: s } = r;
465
+ Q(null), e && s && t !== o && (E != null && E.onReorderRows) && E.onReorderRows(t, o, n);
458
466
  },
459
- [E, V]
460
- ), Le = v(
467
+ [E, Q]
468
+ ), Pe = v(
461
469
  (e, r) => {
462
- const t = F.current;
470
+ const t = G.current;
463
471
  if (!t) return;
464
- Ue.current = { x: e, y: r };
465
- const i = e - t.startX, n = r - t.startY, a = Math.hypot(i, n), l = t.active || a >= Ar;
472
+ je.current = { x: e, y: r };
473
+ const o = e - t.startX, n = r - t.startY, s = Math.hypot(o, n), l = t.active || s >= Ar;
466
474
  let p = {
467
475
  ...t,
468
476
  currentX: e,
@@ -470,37 +478,37 @@ const at = "300px", ot = (o) => {
470
478
  active: l
471
479
  };
472
480
  if (l) {
473
- t.active || xt(null);
474
- const b = g.current;
475
- if (b) {
476
- const s = Hr(
477
- b,
481
+ t.active || vt(null);
482
+ const w = x.current;
483
+ if (w) {
484
+ const a = Kr(
485
+ w,
478
486
  r,
479
487
  t.fromSourceIndex,
480
488
  t.rowId
481
489
  );
482
- s && (p = {
490
+ a && (p = {
483
491
  ...p,
484
- toSourceIndex: s.toSourceIndex,
492
+ toSourceIndex: a.toSourceIndex,
485
493
  // Clip to scrollport so the line never draws over the header / outside the card.
486
- dropLineY: Kr(
487
- s.dropLineY,
488
- b
494
+ dropLineY: Hr(
495
+ a.dropLineY,
496
+ w
489
497
  ),
490
- dropLineLeft: s.dropLineLeft,
491
- dropLineWidth: s.dropLineWidth
498
+ dropLineLeft: a.dropLineLeft,
499
+ dropLineWidth: a.dropLineWidth
492
500
  });
493
501
  }
494
502
  }
495
- V(p);
503
+ Q(p);
496
504
  },
497
- [V]
498
- ), Er = v(
499
- (e, r, t, i) => {
500
- var b, s;
501
- if (!je || e.button !== 0) return;
502
- const n = (b = g.current) == null ? void 0 : b.querySelector(
503
- `tr[${Mt}="${CSS.escape(r)}"]`
505
+ [Q]
506
+ ), Lr = v(
507
+ (e, r, t, o) => {
508
+ var w, a;
509
+ if (!Ae || e.button !== 0) return;
510
+ const n = (w = x.current) == null ? void 0 : w.querySelector(
511
+ `tr[${Xt}="${CSS.escape(r)}"]`
504
512
  );
505
513
  if (!n) return;
506
514
  e.preventDefault();
@@ -508,18 +516,18 @@ const at = "300px", ot = (o) => {
508
516
  e.currentTarget.setPointerCapture(e.pointerId);
509
517
  } catch {
510
518
  }
511
- const a = Jr(n), l = Vr(n), p = ((s = n.closest("table")) == null ? void 0 : s.getBoundingClientRect()) ?? n.getBoundingClientRect();
512
- Ue.current = { x: e.clientX, y: e.clientY }, V({
519
+ const s = Jr(n), l = Vr(n), p = ((a = n.closest("table")) == null ? void 0 : a.getBoundingClientRect()) ?? n.getBoundingClientRect();
520
+ je.current = { x: e.clientX, y: e.clientY }, Q({
513
521
  rowId: r,
514
522
  fromSourceIndex: t,
515
- item: i,
523
+ item: o,
516
524
  pointerId: e.pointerId,
517
525
  startX: e.clientX,
518
526
  startY: e.clientY,
519
527
  currentX: e.clientX,
520
528
  currentY: e.clientY,
521
529
  active: !1,
522
- preview: a,
530
+ preview: s,
523
531
  toSourceIndex: t,
524
532
  dropLineY: null,
525
533
  dropLineLeft: p.left,
@@ -527,93 +535,93 @@ const at = "300px", ot = (o) => {
527
535
  rowClone: l
528
536
  });
529
537
  },
530
- [je, V]
531
- ), Wt = f != null;
532
- $(() => {
533
- if (!Wt) return;
538
+ [Ae, Q]
539
+ ), Ct = f != null;
540
+ B(() => {
541
+ if (!Ct) return;
534
542
  const e = (n) => {
535
- var a;
536
- n.pointerId === ((a = F.current) == null ? void 0 : a.pointerId) && Le(n.clientX, n.clientY);
543
+ var s;
544
+ n.pointerId === ((s = G.current) == null ? void 0 : s.pointerId) && Pe(n.clientX, n.clientY);
537
545
  }, r = (n) => {
538
- var a;
539
- n.pointerId === ((a = F.current) == null ? void 0 : a.pointerId) && Ie(!0);
546
+ var s;
547
+ n.pointerId === ((s = G.current) == null ? void 0 : s.pointerId) && De(!0);
540
548
  }, t = (n) => {
541
- var a;
542
- n.pointerId === ((a = F.current) == null ? void 0 : a.pointerId) && Ie(!1);
543
- }, i = (n) => {
544
- n.key === "Escape" && (n.preventDefault(), Ie(!1));
549
+ var s;
550
+ n.pointerId === ((s = G.current) == null ? void 0 : s.pointerId) && De(!1);
551
+ }, o = (n) => {
552
+ n.key === "Escape" && (n.preventDefault(), De(!1));
545
553
  };
546
- return window.addEventListener("pointermove", e), window.addEventListener("pointerup", r), window.addEventListener("pointercancel", t), window.addEventListener("keydown", i), () => {
547
- window.removeEventListener("pointermove", e), window.removeEventListener("pointerup", r), window.removeEventListener("pointercancel", t), window.removeEventListener("keydown", i);
554
+ return window.addEventListener("pointermove", e), window.addEventListener("pointerup", r), window.addEventListener("pointercancel", t), window.addEventListener("keydown", o), () => {
555
+ window.removeEventListener("pointermove", e), window.removeEventListener("pointerup", r), window.removeEventListener("pointercancel", t), window.removeEventListener("keydown", o);
548
556
  };
549
- }, [Wt, Ie, Le]), $(() => {
557
+ }, [Ct, De, Pe]), B(() => {
550
558
  if (!(f != null && f.active)) return;
551
559
  const e = document.body.style.userSelect, r = document.body.style.cursor;
552
560
  return document.body.style.userSelect = "none", document.body.style.cursor = "grabbing", () => {
553
561
  document.body.style.userSelect = e, document.body.style.cursor = r;
554
562
  };
555
- }, [f == null ? void 0 : f.active]), $(() => {
563
+ }, [f == null ? void 0 : f.active]), B(() => {
556
564
  if (!(f != null && f.active)) return;
557
565
  let e = 0;
558
566
  const r = () => {
559
- const t = F.current, i = g.current;
560
- if (!(t != null && t.active) || !i) return;
561
- const { x: n, y: a } = Ue.current, l = en(i, a);
562
- l !== 0 && (i.scrollTop += l, Le(n, a)), e = requestAnimationFrame(r);
567
+ const t = G.current, o = x.current;
568
+ if (!(t != null && t.active) || !o) return;
569
+ const { x: n, y: s } = je.current, l = en(o, s);
570
+ l !== 0 && (o.scrollTop += l, Pe(n, s)), e = requestAnimationFrame(r);
563
571
  };
564
572
  return e = requestAnimationFrame(r), () => cancelAnimationFrame(e);
565
- }, [f == null ? void 0 : f.active, Le]);
566
- const Ne = v(
573
+ }, [f == null ? void 0 : f.active, Pe]);
574
+ const We = v(
567
575
  (e, r) => {
568
- const t = U.current, i = g.current;
569
- if (!t || !i) return;
570
- Xe.current = { x: e, y: r };
571
- const n = e - t.startX, a = r - t.startY, l = Math.hypot(n, a), p = t.active || l >= nn;
572
- if (p && !t.active && (t.active = !0, Rt(!0)), !p) return;
573
- const b = on(i, e, r), s = b ? Se(b) : null;
574
- s && (t.focus = s, T({
576
+ const t = $.current, o = x.current;
577
+ if (!t || !o) return;
578
+ Be.current = { x: e, y: r };
579
+ const n = e - t.startX, s = r - t.startY, l = Math.hypot(n, s), p = t.active || l >= sn;
580
+ if (p && !t.active && (t.active = !0, Et(!0)), !p) return;
581
+ const w = an(o, e, r), a = w ? Oe(w) : null;
582
+ a && (t.focus = a, M({
575
583
  anchor: t.anchor,
576
- focus: s
584
+ focus: a
577
585
  }));
578
586
  },
579
- [T]
580
- ), tt = v((e) => {
581
- const r = U.current;
582
- U.current = null, Rt(!1), r && requestAnimationFrame(
583
- () => Yt(
584
- g.current,
587
+ [M]
588
+ ), nt = v((e) => {
589
+ const r = $.current;
590
+ $.current = null, Et(!1), r && requestAnimationFrame(
591
+ () => Ut(
592
+ x.current,
585
593
  r.focus.rowId,
586
594
  r.focus.columnKey
587
595
  )
588
596
  );
589
- }, []), Ir = v(
597
+ }, []), Nr = v(
590
598
  (e) => {
591
- if (!y || !W || !J || We(e.target)) return;
592
- const r = Ut(
599
+ if (!h || !W || !V || Te(e.target)) return;
600
+ const r = $t(
593
601
  e.target,
594
- g.current
602
+ x.current
595
603
  );
596
604
  if (!r) return;
597
- const t = Se(r);
598
- t && (e.preventDefault(), e.stopPropagation(), T(_e(t)), J({
605
+ const t = Oe(r);
606
+ t && (e.preventDefault(), e.stopPropagation(), M(st(t)), V({
599
607
  rowId: t.rowId,
600
608
  columnKey: t.columnKey,
601
609
  sourceIndex: t.sourceIndex
602
610
  }));
603
611
  },
604
- [y, T, W, J]
605
- ), Lr = v(
612
+ [h, M, W, V]
613
+ ), Dr = v(
606
614
  (e) => {
607
- if (!y || !W || e.button !== 0 || F.current) return;
608
- const r = Ut(
615
+ if (!h || !W || e.button !== 0 || G.current) return;
616
+ const r = $t(
609
617
  e.target,
610
- g.current
618
+ x.current
611
619
  );
612
620
  if (!r) return;
613
- const t = Se(r);
621
+ const t = Oe(r);
614
622
  if (!t) return;
615
- const i = e.shiftKey && h != null, n = i ? h.anchor : t;
616
- Xe.current = { x: e.clientX, y: e.clientY }, U.current = {
623
+ const o = e.shiftKey && y != null, n = o ? y.anchor : t;
624
+ Be.current = { x: e.clientX, y: e.clientY }, $.current = {
617
625
  pointerId: e.pointerId,
618
626
  startX: e.clientX,
619
627
  startY: e.clientY,
@@ -621,129 +629,129 @@ const at = "300px", ot = (o) => {
621
629
  anchor: n,
622
630
  origin: t,
623
631
  focus: t,
624
- extend: i
625
- }, T(i ? { anchor: n, focus: t } : _e(t));
632
+ extend: o
633
+ }, M(o ? { anchor: n, focus: t } : st(t));
626
634
  },
627
- [y, h, T, W]
635
+ [h, y, M, W]
628
636
  );
629
- $(() => {
630
- if (!y) return;
631
- const e = (i) => {
632
- const n = U.current;
633
- !n || i.pointerId !== n.pointerId || (i.preventDefault(), Ne(i.clientX, i.clientY));
634
- }, r = (i) => {
635
- const n = U.current;
636
- !n || i.pointerId !== n.pointerId || tt(!0);
637
- }, t = (i) => {
638
- const n = U.current;
639
- !n || i.pointerId !== n.pointerId || tt(!1);
637
+ B(() => {
638
+ if (!h) return;
639
+ const e = (o) => {
640
+ const n = $.current;
641
+ !n || o.pointerId !== n.pointerId || (o.preventDefault(), We(o.clientX, o.clientY));
642
+ }, r = (o) => {
643
+ const n = $.current;
644
+ !n || o.pointerId !== n.pointerId || nt(!0);
645
+ }, t = (o) => {
646
+ const n = $.current;
647
+ !n || o.pointerId !== n.pointerId || nt(!1);
640
648
  };
641
649
  return window.addEventListener("pointermove", e), window.addEventListener("pointerup", r), window.addEventListener("pointercancel", t), () => {
642
650
  window.removeEventListener("pointermove", e), window.removeEventListener("pointerup", r), window.removeEventListener("pointercancel", t);
643
651
  };
644
- }, [y, tt, Ne]), $(() => {
645
- if (!be) return;
652
+ }, [h, nt, We]), B(() => {
653
+ if (!ke) return;
646
654
  const e = document.body.style.userSelect;
647
655
  return document.body.style.userSelect = "none", () => {
648
656
  document.body.style.userSelect = e;
649
657
  };
650
- }, [be]), $(() => {
651
- if (!be) return;
658
+ }, [ke]), B(() => {
659
+ if (!ke) return;
652
660
  let e = 0;
653
661
  const r = () => {
654
- const t = U.current, i = g.current;
655
- if (!(t != null && t.active) || !i) return;
656
- const { x: n, y: a } = Xe.current, { dx: l, dy: p } = sn(i, n, a);
657
- (l !== 0 || p !== 0) && (l !== 0 && (i.scrollLeft += l), p !== 0 && (i.scrollTop += p), Ne(n, a)), e = requestAnimationFrame(r);
662
+ const t = $.current, o = x.current;
663
+ if (!(t != null && t.active) || !o) return;
664
+ const { x: n, y: s } = Be.current, { dx: l, dy: p } = cn(o, n, s);
665
+ (l !== 0 || p !== 0) && (l !== 0 && (o.scrollLeft += l), p !== 0 && (o.scrollTop += p), We(n, s)), e = requestAnimationFrame(r);
658
666
  };
659
667
  return e = requestAnimationFrame(r), () => cancelAnimationFrame(e);
660
- }, [be, Ne]), $(() => {
661
- if (!y || !h) return;
668
+ }, [ke, We]), B(() => {
669
+ if (!h || !y) return;
662
670
  const e = (t) => {
663
- if (We(t.target)) return;
664
- const i = g.current;
665
- if (!i) return;
671
+ if (Te(t.target)) return;
672
+ const o = x.current;
673
+ if (!o) return;
666
674
  const n = document.activeElement;
667
- if (n && !i.contains(n) && t.target instanceof Node && !i.contains(t.target))
675
+ if (n && !o.contains(n) && t.target instanceof Node && !o.contains(t.target))
668
676
  return;
669
- const a = it(
670
- h,
671
- x,
672
- z
677
+ const s = at(
678
+ y,
679
+ b,
680
+ Y
673
681
  );
674
- !a || !ze || (t.preventDefault(), ze({ selection: h, rect: a, event: t }));
682
+ !s || !Ue || (t.preventDefault(), Ue({ selection: y, rect: s, event: t }));
675
683
  }, r = (t) => {
676
684
  var p;
677
- if (We(t.target)) return;
678
- const i = g.current;
679
- if (!i) return;
685
+ if (Te(t.target)) return;
686
+ const o = x.current;
687
+ if (!o) return;
680
688
  const n = document.activeElement;
681
- if (n && !i.contains(n) && t.target instanceof Node && !i.contains(t.target))
689
+ if (n && !o.contains(n) && t.target instanceof Node && !o.contains(t.target))
682
690
  return;
683
- const a = it(
684
- h,
685
- x,
686
- z
691
+ const s = at(
692
+ y,
693
+ b,
694
+ Y
687
695
  );
688
- if (!a || !Ye) return;
696
+ if (!s || !Xe) return;
689
697
  const l = ((p = t.clipboardData) == null ? void 0 : p.getData("text/plain")) ?? "";
690
- t.preventDefault(), Ye({ selection: h, rect: a, text: l, event: t });
698
+ t.preventDefault(), Xe({ selection: y, rect: s, text: l, event: t });
691
699
  };
692
700
  return document.addEventListener("copy", e), document.addEventListener("paste", r), () => {
693
701
  document.removeEventListener("copy", e), document.removeEventListener("paste", r);
694
702
  };
695
703
  }, [
696
- x,
697
- y,
704
+ b,
698
705
  h,
699
- z,
700
- ze,
701
- Ye
706
+ y,
707
+ Y,
708
+ Ue,
709
+ Xe
702
710
  ]);
703
- const rt = Re && Rn(C, x), Nr = Re && vn(C, x), Dr = () => {
711
+ const ot = Ee && kn(C, b), Pr = Ee && En(C, b), Wr = () => {
704
712
  if (D) {
705
- if (rt) {
713
+ if (ot) {
706
714
  D(/* @__PURE__ */ new Set());
707
715
  return;
708
716
  }
709
717
  D("all");
710
718
  }
711
- }, Pr = (e, r) => {
719
+ }, _r = (e, r) => {
712
720
  if (!D) return;
713
- if (Z === "single") {
721
+ if (te === "single") {
714
722
  D(r ? /* @__PURE__ */ new Set([e]) : /* @__PURE__ */ new Set());
715
723
  return;
716
724
  }
717
- const t = C === "all" ? new Set(x) : new Set(jt(C, x));
725
+ const t = C === "all" ? new Set(b) : new Set(qt(C, b));
718
726
  r ? t.add(e) : t.delete(e), D(t);
719
- }, Wr = (e) => {
720
- const r = xe.has(e.key);
721
- return gt ? /* @__PURE__ */ c(
722
- w.Row,
727
+ }, Sr = (e) => {
728
+ const r = ve.has(e.key);
729
+ return Rt ? /* @__PURE__ */ c(
730
+ g.Row,
723
731
  {
724
732
  id: `group-${e.key}`,
725
733
  highlightSelectedRow: !1,
726
734
  className: "bg-secondary_subtle hover:bg-secondary_subtle",
727
- children: /* @__PURE__ */ c(w.Cell, { colSpan: ie, className: m(I), children: gt(e) })
735
+ children: /* @__PURE__ */ c(g.Cell, { colSpan: ae, className: m(I), children: Rt(e) })
728
736
  },
729
737
  `group-${e.key}`
730
738
  ) : /* @__PURE__ */ c(
731
- w.Row,
739
+ g.Row,
732
740
  {
733
741
  id: `group-${e.key}`,
734
742
  highlightSelectedRow: !1,
735
743
  className: "bg-secondary_subtle hover:bg-secondary_subtle",
736
744
  children: /* @__PURE__ */ c(
737
- w.Cell,
745
+ g.Cell,
738
746
  {
739
- colSpan: ie,
747
+ colSpan: ae,
740
748
  className: m("py-1.5", I),
741
749
  children: /* @__PURE__ */ _(
742
750
  "button",
743
751
  {
744
752
  type: "button",
745
753
  className: "flex w-full items-center gap-2 px-2 text-left text-xs font-medium text-secondary",
746
- onClick: () => hr(e.key),
754
+ onClick: () => wr(e.key),
747
755
  "aria-expanded": !r,
748
756
  children: [
749
757
  /* @__PURE__ */ c(
@@ -769,40 +777,40 @@ const at = "300px", ot = (o) => {
769
777
  },
770
778
  `group-${e.key}`
771
779
  );
772
- }, _t = (e, r, t = 0) => {
773
- const i = ut ? ut(e) : !1, n = ce(e), a = kr(e, t), l = xn(C, n, x), p = lr === n, b = (f == null ? void 0 : f.active) === !0 && f.rowId === n;
780
+ }, Tt = (e, r, t = 0) => {
781
+ const o = ht ? ht(e) : !1, n = ue(e), s = Ir(e, t), l = Rn(C, n, b), p = fr === n, w = (f == null ? void 0 : f.active) === !0 && f.rowId === n;
774
782
  return /* @__PURE__ */ _(
775
- w.Row,
783
+ g.Row,
776
784
  {
777
785
  onAction: () => {
778
- var s;
779
- (s = F.current) != null && s.active || le == null || le(e);
786
+ var a;
787
+ (a = G.current) != null && a.active || pe == null || pe(e);
780
788
  },
781
- onMouseEnter: () => A == null ? void 0 : A(e, !0),
782
- onMouseLeave: () => A == null ? void 0 : A(e, !1),
789
+ onMouseEnter: () => K == null ? void 0 : K(e, !0),
790
+ onMouseLeave: () => K == null ? void 0 : K(e, !1),
783
791
  id: n,
784
792
  value: e,
785
793
  columns: u,
786
- expandedColSpan: ie,
787
- isExpandable: i,
788
- highlightSelectedRow: ue,
789
- renderExpandedContent: i ? Zt : void 0,
790
- [Mt]: n,
791
- [rn]: String(a),
794
+ expandedColSpan: ae,
795
+ isExpandable: o,
796
+ highlightSelectedRow: he,
797
+ renderExpandedContent: o ? tr : void 0,
798
+ [Xt]: n,
799
+ [rn]: String(s),
792
800
  className: m(
793
- le && "cursor-pointer",
794
- Kt ? "prose" : "",
795
- lt && "[&>td]:after:hidden",
796
- $e && "group/rowactions",
801
+ pe && "cursor-pointer",
802
+ Vt ? "prose" : "",
803
+ pt && "[&>td]:after:hidden",
804
+ qe && "group/rowactions",
797
805
  p && "bg-utility-brand-25 hover:bg-utility-brand-25",
798
- G && l && "bg-secondary",
799
- mt,
800
- Te == null ? void 0 : Te(e)
806
+ z && l && "bg-secondary",
807
+ bt,
808
+ Ge == null ? void 0 : Ge(e)
801
809
  ),
802
- style: b ? tn : void 0,
810
+ style: w ? tn : void 0,
803
811
  children: [
804
- G && /* @__PURE__ */ c(
805
- w.Cell,
812
+ z && /* @__PURE__ */ c(
813
+ g.Cell,
806
814
  {
807
815
  "data-grid-no-range": "",
808
816
  className: m("relative w-10 text-center", I),
@@ -811,13 +819,13 @@ const at = "300px", ot = (o) => {
811
819
  "div",
812
820
  {
813
821
  className: "flex items-center justify-center",
814
- onClick: (s) => s.stopPropagation(),
815
- onKeyDown: (s) => s.stopPropagation(),
822
+ onClick: (a) => a.stopPropagation(),
823
+ onKeyDown: (a) => a.stopPropagation(),
816
824
  children: /* @__PURE__ */ c(
817
- Xt,
825
+ jt,
818
826
  {
819
827
  checked: l,
820
- onCheckedChange: (s) => Pr(n, s === !0),
828
+ onCheckedChange: (a) => _r(n, a === !0),
821
829
  "aria-label": `Select row ${n}`,
822
830
  className: "items-center justify-center"
823
831
  }
@@ -826,95 +834,95 @@ const at = "300px", ot = (o) => {
826
834
  )
827
835
  }
828
836
  ),
829
- u.map((s, De) => {
830
- const Pe = vt.get(s.key), Cr = Bt(
831
- s.key,
832
- K,
833
- Pe
834
- ), Ot = (Q == null ? void 0 : Q.rowId) === n && (Q == null ? void 0 : Q.columnKey) === s.key, B = y ? an(
835
- h,
837
+ u.map((a, it) => {
838
+ const _e = It.get(a.key), Se = At(
839
+ a.key,
840
+ J,
841
+ _e
842
+ ), de = (Z == null ? void 0 : Z.rowId) === n && (Z == null ? void 0 : Z.columnKey) === a.key, T = h ? dn(
843
+ y,
836
844
  n,
837
- s.key,
838
- x,
839
- z
840
- ) : null, Tr = !y && W && !Ot && (j == null ? void 0 : j.rowId) === n && (j == null ? void 0 : j.columnKey) === s.key, nt = !!(B != null && B.inRange) && W && !Ot, Ft = nt && B ? cn(B.edges) : void 0, Or = et(s);
845
+ a.key,
846
+ b,
847
+ Y
848
+ ) : null, Ce = !h && W && !de && (q == null ? void 0 : q.rowId) === n && (q == null ? void 0 : q.columnKey) === a.key, O = !!(T != null && T.inRange) && W && !de, zt = O && T ? ln(T.edges) : void 0, Or = rt(a);
841
849
  return /* @__PURE__ */ c(
842
- w.Cell,
850
+ g.Cell,
843
851
  {
844
- sticky: s.sticky,
845
- stickyOffset: s.stickyOffset,
852
+ sticky: a.sticky,
853
+ stickyOffset: a.stickyOffset,
846
854
  style: {
847
855
  ...Or,
848
- ...Ft ? { boxShadow: Ft } : null
856
+ ...zt ? { boxShadow: zt } : null
849
857
  },
850
858
  "data-grid-cell": "",
851
859
  "data-grid-row-id": n,
852
- "data-grid-col-key": s.key,
853
- "data-grid-source-index": a,
860
+ "data-grid-col-key": a.key,
861
+ "data-grid-source-index": s,
854
862
  className: m(
855
863
  "relative overflow-x-hidden",
856
864
  // Uncontrolled single-cell highlight (legacy).
857
- Tr && "z-1 outline-hidden ring-2 ring-inset ring-brand after:opacity-0",
865
+ Ce && "z-1 outline-hidden ring-2 ring-inset ring-brand after:opacity-0",
858
866
  // Controlled range: fill all selected cells except the anchor; perimeter via boxShadow.
859
- nt && "z-1 outline-hidden after:opacity-0",
860
- nt && B && !B.isAnchor && "bg-utility-brand-25",
861
- s.cellClassName,
862
- Xr(Cr),
867
+ O && "z-1 outline-hidden after:opacity-0",
868
+ O && T && !T.isAnchor && "bg-utility-brand-25",
869
+ a.cellClassName,
870
+ Xr(Se),
863
871
  I
864
872
  ),
865
873
  children: (() => {
866
- const Gt = De === 0 && (i || $e) ? /* @__PURE__ */ _("div", { className: "flex items-center", children: [
874
+ const Yt = it === 0 && (o || qe) ? /* @__PURE__ */ _("div", { className: "flex items-center", children: [
867
875
  E && /* @__PURE__ */ c(
868
876
  "div",
869
877
  {
870
878
  "data-grid-no-range": "",
871
879
  className: "flex items-center justify-center",
872
- onClick: (Y) => Y.stopPropagation(),
873
- onContextMenu: (Y) => Y.stopPropagation(),
874
- onKeyDown: (Y) => Y.stopPropagation(),
880
+ onClick: (U) => U.stopPropagation(),
881
+ onContextMenu: (U) => U.stopPropagation(),
882
+ onKeyDown: (U) => U.stopPropagation(),
875
883
  children: /* @__PURE__ */ c(
876
- hn,
884
+ wn,
877
885
  {
878
886
  config: E,
879
- sourceRowIndex: a,
887
+ sourceRowIndex: s,
880
888
  item: e,
881
- enableDrag: je,
882
- isDragging: b,
883
- onDragHandlePointerDown: (Y) => Er(
884
- Y,
889
+ enableDrag: Ae,
890
+ isDragging: w,
891
+ onDragHandlePointerDown: (U) => Lr(
892
+ U,
885
893
  n,
886
- a,
894
+ s,
887
895
  e
888
896
  ),
889
897
  triggerClassName: m(
890
898
  // Hover-reveal: hidden until row hover / focus / menu open / this row is the drag source.
891
899
  // Do not force all handles visible while another row is dragging.
892
900
  "transition-opacity group-hover/rowactions:opacity-100 focus-visible:opacity-100",
893
- p || b ? "opacity-100" : "opacity-0"
901
+ p || w ? "opacity-100" : "opacity-0"
894
902
  ),
895
- onOpenChange: (Y) => xt(Y ? n : null)
903
+ onOpenChange: (U) => vt(U ? n : null)
896
904
  }
897
905
  )
898
906
  }
899
907
  ),
900
- /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: ct(s.key, e[s.key], e) })
901
- ] }) : ct(s.key, e[s.key], e);
908
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: ut(a.key, e[a.key], e) })
909
+ ] }) : ut(a.key, e[a.key], e);
902
910
  return W ? /* @__PURE__ */ c(
903
911
  "div",
904
912
  {
905
913
  "data-grid-focus": !0,
906
914
  tabIndex: -1,
907
915
  className: "outline-hidden",
908
- children: Gt
916
+ children: Yt
909
917
  }
910
- ) : Gt;
918
+ ) : Yt;
911
919
  })()
912
920
  },
913
- s.key
921
+ a.key
914
922
  );
915
923
  }),
916
- S && O && /* @__PURE__ */ c(
917
- w.Cell,
924
+ S && F && /* @__PURE__ */ c(
925
+ g.Cell,
918
926
  {
919
927
  "data-grid-no-range": "",
920
928
  className: m("relative w-14 text-center", I),
@@ -926,10 +934,10 @@ const at = "300px", ot = (o) => {
926
934
  title: "Delete row",
927
935
  "aria-label": "Delete row",
928
936
  className: "inline-flex items-center justify-center rounded p-1 text-fg-quaternary hover:bg-secondary_subtle hover:text-fg-secondary",
929
- onClick: (s) => {
930
- s.stopPropagation(), O.onDeleteRow(a);
937
+ onClick: (a) => {
938
+ a.stopPropagation(), F.onDeleteRow(s);
931
939
  },
932
- children: /* @__PURE__ */ c(yn, { name: "Trash02", className: "size-3" })
940
+ children: /* @__PURE__ */ c(gn, { name: "Trash02", className: "size-3" })
933
941
  }
934
942
  )
935
943
  }
@@ -938,37 +946,37 @@ const at = "300px", ot = (o) => {
938
946
  },
939
947
  n
940
948
  );
941
- }, _r = (e) => /* @__PURE__ */ _(
942
- w.Row,
949
+ }, Cr = (e) => /* @__PURE__ */ _(
950
+ g.Row,
943
951
  {
944
952
  id: String(e.id),
945
953
  isExpandable: !1,
946
- className: m(lt && "[&>td]:after:hidden", mt),
954
+ className: m(pt && "[&>td]:after:hidden", bt),
947
955
  children: [
948
- G && /* @__PURE__ */ c(
949
- w.Cell,
956
+ z && /* @__PURE__ */ c(
957
+ g.Cell,
950
958
  {
951
959
  className: m("relative w-10", I),
952
960
  style: { minWidth: "40px", width: "40px" }
953
961
  }
954
962
  ),
955
963
  u.map((r) => /* @__PURE__ */ c(
956
- w.Cell,
964
+ g.Cell,
957
965
  {
958
966
  sticky: r.sticky,
959
967
  stickyOffset: r.stickyOffset,
960
- style: et(r),
968
+ style: rt(r),
961
969
  className: m(
962
970
  "overflow-x-hidden text-left",
963
971
  r.cellClassName,
964
972
  I
965
973
  ),
966
- children: /* @__PURE__ */ c(wn, { height: "14px", width: "75%", className: "rounded" })
974
+ children: /* @__PURE__ */ c(mn, { height: "14px", width: "75%", className: "rounded" })
967
975
  },
968
976
  r.key
969
977
  )),
970
978
  S && /* @__PURE__ */ c(
971
- w.Cell,
979
+ g.Cell,
972
980
  {
973
981
  className: m("w-14", I),
974
982
  style: { minWidth: "56px", width: "56px" }
@@ -977,53 +985,53 @@ const at = "300px", ot = (o) => {
977
985
  ]
978
986
  },
979
987
  String(e.id)
980
- ), Sr = () => M ? ke.map((e) => _r(e)) : ve && H ? H.flatMap((e) => {
981
- const r = xe.has(e.key);
988
+ ), Tr = () => X ? Le.map((e) => Cr(e)) : Ie && H ? H.flatMap((e) => {
989
+ const r = ve.has(e.key);
982
990
  return [
983
- Wr(e),
991
+ Sr(e),
984
992
  ...r ? [] : e.rows.map(
985
- (t, i) => _t(t, void 0, i)
993
+ (t, o) => Tt(t, void 0, o)
986
994
  )
987
995
  ];
988
- }) : ke.map(
989
- (e, r) => _t(e, void 0, r)
990
- ), St = /* @__PURE__ */ c(
996
+ }) : Le.map(
997
+ (e, r) => Tt(e, void 0, r)
998
+ ), Ot = /* @__PURE__ */ c(
991
999
  Yr.Root,
992
1000
  {
993
- ref: Rr,
994
- onKeyDownCapture: W ? xr : void 0,
995
- onPointerDownCapture: y ? Lr : void 0,
996
- onDoubleClickCapture: y ? Ir : void 0,
1001
+ ref: kr,
1002
+ onKeyDownCapture: W ? Rr : void 0,
1003
+ onPointerDownCapture: h ? Dr : void 0,
1004
+ onDoubleClickCapture: h ? Nr : void 0,
997
1005
  className: m(
998
1006
  "w-full",
999
- !L || Qe ? "overflow-x-auto" : "overflow-x-hidden",
1000
- fe && "border border-secondary rounded-xl",
1007
+ !L || et ? "overflow-x-auto" : "overflow-x-hidden",
1008
+ ye && "border border-secondary rounded-xl",
1001
1009
  "[&_tr:hover>td]:!bg-secondary_subtle",
1002
- Vt
1010
+ Zt
1003
1011
  ),
1004
- size: dt,
1012
+ size: ft,
1005
1013
  children: /* @__PURE__ */ _(
1006
- w,
1014
+ g,
1007
1015
  {
1008
- "aria-label": Ht,
1009
- size: dt,
1016
+ "aria-label": Jt,
1017
+ size: ft,
1010
1018
  isEditable: W,
1011
- inlineSelection: ue,
1012
- className: m(L && "min-w-full", er),
1013
- style: br,
1014
- ...vr,
1019
+ inlineSelection: he,
1020
+ className: m(L && "min-w-full", rr),
1021
+ style: vr,
1022
+ ...Er,
1015
1023
  children: [
1016
1024
  /* @__PURE__ */ _(
1017
- w.Header,
1025
+ g.Header,
1018
1026
  {
1019
1027
  className: m(
1020
1028
  "sticky top-0 z-20",
1021
- fe && "[&>tr>th:first-child]:rounded-bl-none [&>tr>th:last-child]:rounded-br-none",
1022
- Qt
1029
+ ye && "[&>tr>th:first-child]:rounded-bl-none [&>tr>th:last-child]:rounded-br-none",
1030
+ er
1023
1031
  ),
1024
1032
  children: [
1025
- G && /* @__PURE__ */ c(
1026
- w.Head,
1033
+ z && /* @__PURE__ */ c(
1034
+ g.Head,
1027
1035
  {
1028
1036
  label: "",
1029
1037
  allowsSorting: !1,
@@ -1031,11 +1039,11 @@ const at = "300px", ot = (o) => {
1031
1039
  style: { minWidth: "40px", width: "40px" },
1032
1040
  className: m(I),
1033
1041
  headerCellClass: "justify-center",
1034
- children: Z === "multiple" && D && /* @__PURE__ */ c("div", { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ c(
1035
- Xt,
1042
+ children: te === "multiple" && D && /* @__PURE__ */ c("div", { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ c(
1043
+ jt,
1036
1044
  {
1037
- checked: rt ? !0 : Nr && !rt ? "indeterminate" : !1,
1038
- onCheckedChange: () => Dr(),
1045
+ checked: ot ? !0 : Pr && !ot ? "indeterminate" : !1,
1046
+ onCheckedChange: () => Wr(),
1039
1047
  "aria-label": "Select all rows",
1040
1048
  className: "items-center justify-center"
1041
1049
  }
@@ -1044,13 +1052,13 @@ const at = "300px", ot = (o) => {
1044
1052
  "selection"
1045
1053
  ),
1046
1054
  u.map((e, r) => {
1047
- const t = or ? pr.get(e.key) : void 0, i = vt.get(e.key), n = Bt(
1055
+ const t = ar ? yr.get(e.key) : void 0, o = It.get(e.key), n = At(
1048
1056
  e.key,
1049
- K,
1050
- i
1051
- ), a = Jt.includes(e.key) || n === "center" ? "justify-center" : n === "right" ? "justify-end" : "";
1057
+ J,
1058
+ o
1059
+ ), s = Qt.includes(e.key) || n === "center" ? "justify-center" : n === "right" ? "justify-end" : "";
1052
1060
  return /* @__PURE__ */ c(
1053
- w.Head,
1061
+ g.Head,
1054
1062
  {
1055
1063
  sticky: e.sticky,
1056
1064
  stickyOffset: e.stickyOffset,
@@ -1058,36 +1066,36 @@ const at = "300px", ot = (o) => {
1058
1066
  label: e.label,
1059
1067
  isRowHeader: r === 0,
1060
1068
  allowsSorting: e.allowsSorting,
1061
- headerCellClass: `${e.headerCellClass} ${a}`,
1062
- style: et(e),
1069
+ headerCellClass: `${e.headerCellClass} ${s}`,
1070
+ style: rt(e),
1063
1071
  className: m(
1064
1072
  "overflow-hidden",
1065
1073
  e.headClassName,
1066
1074
  I
1067
1075
  ),
1068
- headerAction: t && ge ? /* @__PURE__ */ c(
1069
- un,
1076
+ headerAction: t && Re ? /* @__PURE__ */ c(
1077
+ pn,
1070
1078
  {
1071
1079
  column: t,
1072
- columnLabel: t.label ?? (i ? Ur(i, ar) : e.label),
1073
- currentAlignment: i ? At(
1074
- i,
1075
- K ?? /* @__PURE__ */ new Map()
1076
- ) : (K == null ? void 0 : K.get(e.key)) ?? "left",
1077
- capabilities: sr,
1080
+ columnLabel: t.label ?? (o ? Ur(o, dr) : e.label),
1081
+ currentAlignment: o ? Ht(
1082
+ o,
1083
+ J ?? /* @__PURE__ */ new Map()
1084
+ ) : (J == null ? void 0 : J.get(e.key)) ?? "left",
1085
+ capabilities: cr,
1078
1086
  hideDisabled: u.length <= 1,
1079
- onAction: gr.get(e.key),
1080
- renderExtraItems: cr,
1087
+ onAction: br.get(e.key),
1088
+ renderExtraItems: lr,
1081
1089
  showOnHeaderHover: !0
1082
1090
  }
1083
1091
  ) : void 0,
1084
- children: (Ce == null ? void 0 : Ce(e.key)) ?? null
1092
+ children: (Fe == null ? void 0 : Fe(e.key)) ?? null
1085
1093
  },
1086
1094
  e.key
1087
1095
  );
1088
1096
  }),
1089
1097
  S && /* @__PURE__ */ c(
1090
- w.Head,
1098
+ g.Head,
1091
1099
  {
1092
1100
  label: "",
1093
1101
  allowsSorting: !1,
@@ -1100,52 +1108,52 @@ const at = "300px", ot = (o) => {
1100
1108
  ]
1101
1109
  }
1102
1110
  ),
1103
- /* @__PURE__ */ _(w.Body, { children: [
1104
- !Nt && Sr(),
1105
- wr && /* @__PURE__ */ c(
1106
- w.Row,
1111
+ /* @__PURE__ */ _(g.Body, { children: [
1112
+ !Wt && Tr(),
1113
+ mr && /* @__PURE__ */ c(
1114
+ g.Row,
1107
1115
  {
1108
1116
  id: "empty-state",
1109
1117
  highlightSelectedRow: !1,
1110
1118
  children: /* @__PURE__ */ c(
1111
- w.Cell,
1119
+ g.Cell,
1112
1120
  {
1113
- colSpan: ie,
1121
+ colSpan: ae,
1114
1122
  className: m(
1115
1123
  "text-left text-placeholder_subtle border-b border-secondary py-3",
1116
1124
  I
1117
1125
  ),
1118
- children: yt
1126
+ children: mt
1119
1127
  }
1120
1128
  )
1121
1129
  },
1122
1130
  "empty-state"
1123
1131
  ),
1124
- He && O && /* @__PURE__ */ _(
1125
- w.Row,
1132
+ Je && F && /* @__PURE__ */ _(
1133
+ g.Row,
1126
1134
  {
1127
1135
  id: "add-row-footer",
1128
1136
  highlightSelectedRow: !1,
1129
1137
  children: [
1130
1138
  /* @__PURE__ */ c(
1131
- w.Cell,
1139
+ g.Cell,
1132
1140
  {
1133
- colSpan: ie - (S ? 1 : 0),
1141
+ colSpan: ae - (S ? 1 : 0),
1134
1142
  className: m(I),
1135
1143
  children: /* @__PURE__ */ c(
1136
- fn,
1144
+ hn,
1137
1145
  {
1138
1146
  color: "tertiary",
1139
1147
  className: "bg-secondary text-primary",
1140
1148
  size: "xs",
1141
- onClick: O.onAddRow,
1149
+ onClick: F.onAddRow,
1142
1150
  children: "+ Add Row"
1143
1151
  }
1144
1152
  )
1145
1153
  }
1146
1154
  ),
1147
1155
  S && /* @__PURE__ */ c(
1148
- w.Cell,
1156
+ g.Cell,
1149
1157
  {
1150
1158
  className: m("w-14", I),
1151
1159
  style: { minWidth: "56px", width: "56px" }
@@ -1155,13 +1163,13 @@ const at = "300px", ot = (o) => {
1155
1163
  },
1156
1164
  "add-row-footer"
1157
1165
  ),
1158
- mr && Ge && /* @__PURE__ */ c(
1159
- pn,
1166
+ xr && Me && /* @__PURE__ */ c(
1167
+ yn,
1160
1168
  {
1161
- ...Ge,
1169
+ ...Me,
1162
1170
  hasActionsColumn: S,
1163
- hasSelectionColumn: G,
1164
- showBorders: !!fe
1171
+ hasSelectionColumn: z,
1172
+ showBorders: !!ye
1165
1173
  }
1166
1174
  )
1167
1175
  ] })
@@ -1169,17 +1177,17 @@ const at = "300px", ot = (o) => {
1169
1177
  }
1170
1178
  )
1171
1179
  }
1172
- ), Ct = W ? /* @__PURE__ */ c(
1180
+ ), Ft = W ? /* @__PURE__ */ c(
1173
1181
  qr,
1174
1182
  {
1175
- rowIds: x,
1176
- columnKeys: z,
1177
- containerRef: g,
1178
- onSelectCell: Ke,
1179
- onEditingCellChange: fr,
1180
- children: St
1183
+ rowIds: b,
1184
+ columnKeys: Y,
1185
+ containerRef: x,
1186
+ onSelectCell: Ve,
1187
+ onEditingCellChange: hr,
1188
+ children: Ot
1181
1189
  }
1182
- ) : St, Tt = f != null && f.active ? /* @__PURE__ */ _(zt, { children: [
1190
+ ) : Ot, Gt = f != null && f.active ? /* @__PURE__ */ _(Mt, { children: [
1183
1191
  /* @__PURE__ */ c(Qr, { session: f }),
1184
1192
  f.dropLineY != null && /* @__PURE__ */ c(
1185
1193
  Zr,
@@ -1190,10 +1198,10 @@ const at = "300px", ot = (o) => {
1190
1198
  }
1191
1199
  )
1192
1200
  ] }) : null;
1193
- return yr ? /* @__PURE__ */ _("div", { className: "flex flex-col gap-3", children: [
1194
- It && Et,
1195
- Ct,
1196
- Lt && P && /* @__PURE__ */ c(
1201
+ return gr ? /* @__PURE__ */ _("div", { className: "flex flex-col gap-3", children: [
1202
+ Dt && Nt,
1203
+ Ft,
1204
+ Pt && P && /* @__PURE__ */ c(
1197
1205
  Mr,
1198
1206
  {
1199
1207
  currentPage: P.currentPage,
@@ -1205,13 +1213,13 @@ const at = "300px", ot = (o) => {
1205
1213
  showPagination: P.showPagination
1206
1214
  }
1207
1215
  ),
1208
- Tt
1209
- ] }) : /* @__PURE__ */ _(zt, { children: [
1210
- Ct,
1211
- Tt
1216
+ Gt
1217
+ ] }) : /* @__PURE__ */ _(Mt, { children: [
1218
+ Ft,
1219
+ Gt
1212
1220
  ] });
1213
1221
  }
1214
1222
  );
1215
1223
  export {
1216
- qn as TableWrapper
1224
+ Kn as TableWrapper
1217
1225
  };