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

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