@pibit.ai/cure-design-system 0.3.40 → 0.3.45

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