@pibit.ai/cure-design-system 0.3.43 → 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 +538 -564
  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, 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,200 +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(() => {
520
- const e = M ? { zoom: pe } : void 0;
521
- return !P || !te ? M ? { ...e, width: "max-content", minWidth: "100%" } : void 0 : {
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 : {
522
494
  ...e,
523
495
  // The zoom-independent base, so the painted width tracks the zoom and overflows by
524
496
  // more as you zoom in — matching the widths `getColumnStyle` hands the columns.
525
- width: `${Ge ?? te.minTableWidth}px`,
497
+ width: `${Me ?? te.minTableWidth}px`,
526
498
  tableLayout: "fixed"
527
499
  };
528
500
  }, [
529
- P,
501
+ _,
530
502
  te,
531
- $t,
532
- Ge,
533
- M,
534
- pe
535
- ]), Mr = I(
503
+ Xt,
504
+ Me,
505
+ G,
506
+ ue,
507
+ Se
508
+ ]), Zr = I(
536
509
  (e) => {
537
- 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);
538
511
  },
539
- [ue]
540
- ), Ar = Ce && Ee ? {
512
+ [le]
513
+ ), Ur = Ce && Ee ? {
541
514
  selectionMode: ae,
542
515
  selectedKeys: F === "all" ? "all" : F,
543
- onSelectionChange: Vn(S)
544
- } : {}, Ur = (e, r = 0) => {
545
- const t = e.__sourceIndex;
546
- return typeof t == "number" ? t : r;
547
- }, 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(
548
521
  (e) => {
549
- const r = A.current;
550
- if (!r) return;
551
- const { fromSourceIndex: t, toSourceIndex: i, item: n, active: c } = r;
552
- re(null), e && c && t !== i && (L != null && L.onReorderRows) && L.onReorderRows(t, i, n);
553
- },
554
- [L, re]
555
- ), Ae = I(
556
- (e, r) => {
557
- const t = A.current;
522
+ const t = U.current;
558
523
  if (!t) return;
559
- Qe.current = { x: e, y: r };
560
- 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;
561
534
  let h = {
562
- ...t,
535
+ ...r,
563
536
  currentX: e,
564
- currentY: r,
537
+ currentY: t,
565
538
  active: l
566
539
  };
567
540
  if (l) {
568
- t.active || Tt(null);
541
+ r.active || Tt(null);
569
542
  const k = g.current;
570
543
  if (k) {
571
544
  const o = Rn(
572
545
  k,
573
- r,
574
- t.fromSourceIndex,
575
- t.rowId
546
+ t,
547
+ r.fromSourceIndex,
548
+ r.rowId
576
549
  );
577
550
  o && (h = {
578
551
  ...h,
@@ -591,11 +564,11 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
591
564
  },
592
565
  [re]
593
566
  ), Yr = I(
594
- (e, r, t, i) => {
567
+ (e, t, r, i) => {
595
568
  var k, o;
596
- if (!nt || e.button !== 0) return;
569
+ if (!rt || e.button !== 0) return;
597
570
  const n = (k = g.current) == null ? void 0 : k.querySelector(
598
- `tr[${nr}="${CSS.escape(r)}"]`
571
+ `tr[${nr}="${CSS.escape(t)}"]`
599
572
  );
600
573
  if (!n) return;
601
574
  e.preventDefault();
@@ -603,10 +576,10 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
603
576
  e.currentTarget.setPointerCapture(e.pointerId);
604
577
  } catch {
605
578
  }
606
- const c = bn(n), l = kn(n), h = ((o = n.closest("table")) == null ? void 0 : o.getBoundingClientRect()) ?? n.getBoundingClientRect();
607
- Qe.current = { x: e.clientX, y: e.clientY }, re({
608
- rowId: r,
609
- 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,
610
583
  item: i,
611
584
  pointerId: e.pointerId,
612
585
  startX: e.clientX,
@@ -614,244 +587,244 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
614
587
  currentX: e.clientX,
615
588
  currentY: e.clientY,
616
589
  active: !1,
617
- preview: c,
618
- toSourceIndex: t,
590
+ preview: a,
591
+ toSourceIndex: r,
619
592
  dropLineY: null,
620
593
  dropLineLeft: h.left,
621
594
  dropLineWidth: h.width,
622
595
  rowClone: l
623
596
  });
624
597
  },
625
- [nt, re]
626
- ), Xt = p != null;
627
- X(() => {
628
- if (!Xt) return;
598
+ [rt, re]
599
+ ), $t = p != null;
600
+ $(() => {
601
+ if (!$t) return;
629
602
  const e = (n) => {
630
- var c;
631
- n.pointerId === ((c = A.current) == null ? void 0 : c.pointerId) && Ae(n.clientX, n.clientY);
632
- }, r = (n) => {
633
- var c;
634
- 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);
635
605
  }, t = (n) => {
636
- var c;
637
- 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);
638
611
  }, i = (n) => {
639
- n.key === "Escape" && (n.preventDefault(), Me(!1));
612
+ n.key === "Escape" && (n.preventDefault(), Ze(!1));
640
613
  };
641
- return window.addEventListener("pointermove", e), window.addEventListener("pointerup", r), window.addEventListener("pointercancel", t), window.addEventListener("keydown", i), () => {
642
- 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);
643
616
  };
644
- }, [Xt, Me, Ae]), X(() => {
617
+ }, [$t, Ze, Ue]), $(() => {
645
618
  if (!(p != null && p.active)) return;
646
- const e = document.body.style.userSelect, r = document.body.style.cursor;
619
+ const e = document.body.style.userSelect, t = document.body.style.cursor;
647
620
  return document.body.style.userSelect = "none", document.body.style.cursor = "grabbing", () => {
648
- document.body.style.userSelect = e, document.body.style.cursor = r;
621
+ document.body.style.userSelect = e, document.body.style.cursor = t;
649
622
  };
650
- }, [p == null ? void 0 : p.active]), X(() => {
623
+ }, [p == null ? void 0 : p.active]), $(() => {
651
624
  if (!(p != null && p.active)) return;
652
625
  let e = 0;
653
- const r = () => {
654
- const t = A.current, i = g.current;
655
- if (!(t != null && t.active) || !i) return;
656
- const { x: n, y: c } = Qe.current, l = Nn(i, c);
657
- 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);
658
631
  };
659
- return e = requestAnimationFrame(r), () => cancelAnimationFrame(e);
660
- }, [p == null ? void 0 : p.active, Ae]);
661
- const Ue = I(
662
- (e, r) => {
663
- const t = q.current, i = g.current;
664
- if (!t || !i) return;
665
- et.current = { x: e, y: r };
666
- const n = e - t.startX, c = r - t.startY, l = Math.hypot(n, c), h = t.active || l >= Pn;
667
- if (h && !t.active && (t.active = !0, Ot(!0)), !h) return;
668
- const k = Sn(i, e, r), o = k ? $e(k) : null;
669
- o && (t.focus = o, B({
670
- 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,
671
644
  focus: o
672
645
  }));
673
646
  },
674
647
  [B]
675
- ), pt = I((e) => {
676
- const r = q.current;
677
- q.current = null, Ot(!1), r && requestAnimationFrame(
648
+ ), ft = I((e) => {
649
+ const t = q.current;
650
+ q.current = null, Ot(!1), t && requestAnimationFrame(
678
651
  () => rr(
679
652
  g.current,
680
- r.focus.rowId,
681
- r.focus.columnKey
653
+ t.focus.rowId,
654
+ t.focus.columnKey
682
655
  )
683
656
  );
684
657
  }, []), Br = I(
685
658
  (e) => {
686
- if (!y || !W || !ee || Be(e.target)) return;
687
- const r = ir(
659
+ if (!y || !N || !ee || Be(e.target)) return;
660
+ const t = ir(
688
661
  e.target,
689
662
  g.current
690
663
  );
691
- if (!r) return;
692
- const t = $e(r);
693
- t && (e.preventDefault(), e.stopPropagation(), B(gt(t)), ee({
694
- rowId: t.rowId,
695
- columnKey: t.columnKey,
696
- 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
697
670
  }));
698
671
  },
699
- [y, B, W, ee]
700
- ), $r = I(
672
+ [y, B, N, ee]
673
+ ), Xr = I(
701
674
  (e) => {
702
- if (!y || !W || e.button !== 0 || A.current) return;
703
- const r = ir(
675
+ if (!y || !N || e.button !== 0 || U.current) return;
676
+ const t = ir(
704
677
  e.target,
705
678
  g.current
706
679
  );
707
- if (!r) return;
708
- const t = $e(r);
709
680
  if (!t) return;
710
- const i = e.shiftKey && w != null, n = i ? w.anchor : t;
711
- 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 = {
712
685
  pointerId: e.pointerId,
713
686
  startX: e.clientX,
714
687
  startY: e.clientY,
715
688
  active: !1,
716
689
  anchor: n,
717
- origin: t,
718
- focus: t,
690
+ origin: r,
691
+ focus: r,
719
692
  extend: i
720
- }, B(i ? { anchor: n, focus: t } : gt(t));
693
+ }, B(i ? { anchor: n, focus: r } : wt(r));
721
694
  },
722
- [y, w, B, W]
695
+ [y, w, B, N]
723
696
  );
724
- X(() => {
697
+ $(() => {
725
698
  if (!y) return;
726
699
  const e = (i) => {
727
700
  const n = q.current;
728
- !n || i.pointerId !== n.pointerId || (i.preventDefault(), Ue(i.clientX, i.clientY));
729
- }, r = (i) => {
730
- const n = q.current;
731
- !n || i.pointerId !== n.pointerId || pt(!0);
701
+ !n || i.pointerId !== n.pointerId || (i.preventDefault(), Ae(i.clientX, i.clientY));
732
702
  }, t = (i) => {
733
703
  const n = q.current;
734
- !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);
735
708
  };
736
- return window.addEventListener("pointermove", e), window.addEventListener("pointerup", r), window.addEventListener("pointercancel", t), () => {
737
- 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);
738
711
  };
739
- }, [y, pt, Ue]), X(() => {
712
+ }, [y, ft, Ae]), $(() => {
740
713
  if (!ie) return;
741
714
  const e = document.body.style.userSelect;
742
715
  return document.body.style.userSelect = "none", () => {
743
716
  document.body.style.userSelect = e;
744
717
  };
745
- }, [ie]), X(() => {
718
+ }, [ie]), $(() => {
746
719
  if (!ie) return;
747
720
  let e = 0;
748
- const r = () => {
749
- const t = q.current, i = g.current;
750
- if (!(t != null && t.active) || !i) return;
751
- const { x: n, y: c } = et.current, { dx: l, dy: h } = Tn(i, n, c);
752
- (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);
753
726
  };
754
- return e = requestAnimationFrame(r), () => cancelAnimationFrame(e);
755
- }, [ie, Ue]), X(() => {
727
+ return e = requestAnimationFrame(t), () => cancelAnimationFrame(e);
728
+ }, [ie, Ae]), $(() => {
756
729
  if (!y || !w) return;
757
- const e = (t) => {
758
- if (Be(t.target)) return;
730
+ const e = (r) => {
731
+ if (Be(r.target)) return;
759
732
  const i = g.current;
760
733
  if (!i) return;
761
734
  const n = document.activeElement;
762
- 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))
763
736
  return;
764
- const c = xt(
737
+ const a = mt(
765
738
  w,
766
- v,
739
+ R,
767
740
  Y
768
741
  );
769
- !c || !He || (t.preventDefault(), He({ selection: w, rect: c, event: t }));
770
- }, r = (t) => {
742
+ !a || !He || (r.preventDefault(), He({ selection: w, rect: a, event: r }));
743
+ }, t = (r) => {
771
744
  var h;
772
- if (Be(t.target)) return;
745
+ if (Be(r.target)) return;
773
746
  const i = g.current;
774
747
  if (!i) return;
775
748
  const n = document.activeElement;
776
- 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))
777
750
  return;
778
- const c = xt(
751
+ const a = mt(
779
752
  w,
780
- v,
753
+ R,
781
754
  Y
782
755
  );
783
- if (!c || !ze) return;
784
- const l = ((h = t.clipboardData) == null ? void 0 : h.getData("text/plain")) ?? "";
785
- 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 });
786
759
  };
787
- return document.addEventListener("copy", e), document.addEventListener("paste", r), () => {
788
- 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);
789
762
  };
790
763
  }, [
791
- v,
764
+ R,
792
765
  y,
793
766
  w,
794
767
  Y,
795
768
  He,
796
769
  ze
797
770
  ]);
798
- const ht = Ce && Hn(F, v), Xr = Ce && zn(F, v), jr = () => {
799
- if (S) {
800
- if (ht) {
801
- 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());
802
775
  return;
803
776
  }
804
- S("all");
777
+ P("all");
805
778
  }
806
- }, qr = (e, r) => {
807
- if (!S) return;
779
+ }, qr = (e, t) => {
780
+ if (!P) return;
808
781
  if (ae === "single") {
809
- S(r ? /* @__PURE__ */ new Set([e]) : /* @__PURE__ */ new Set());
782
+ P(t ? /* @__PURE__ */ new Set([e]) : /* @__PURE__ */ new Set());
810
783
  return;
811
784
  }
812
- const t = F === "all" ? new Set(v) : new Set(ar(F, v));
813
- 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);
814
787
  }, Kr = (e) => {
815
- const r = Te.has(e.key);
816
- return Pt ? /* @__PURE__ */ a(
788
+ const t = Te.has(e.key);
789
+ return Dt ? /* @__PURE__ */ c(
817
790
  m.Row,
818
791
  {
819
792
  id: `group-${e.key}`,
820
793
  highlightSelectedRow: !1,
821
794
  className: "bg-secondary_subtle hover:bg-secondary_subtle",
822
- 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) })
823
796
  },
824
797
  `group-${e.key}`
825
- ) : /* @__PURE__ */ a(
798
+ ) : /* @__PURE__ */ c(
826
799
  m.Row,
827
800
  {
828
801
  id: `group-${e.key}`,
829
802
  highlightSelectedRow: !1,
830
803
  className: "bg-secondary_subtle hover:bg-secondary_subtle",
831
- children: /* @__PURE__ */ a(
804
+ children: /* @__PURE__ */ c(
832
805
  m.Cell,
833
806
  {
834
- colSpan: me,
835
- className: x("py-1.5", D),
836
- children: /* @__PURE__ */ E(
807
+ colSpan: ye,
808
+ className: x("py-1.5", W),
809
+ children: /* @__PURE__ */ C(
837
810
  "button",
838
811
  {
839
812
  type: "button",
840
813
  className: "flex w-full items-center gap-2 px-2 text-left text-xs font-medium text-secondary",
841
814
  onClick: () => Sr(e.key),
842
- "aria-expanded": !r,
815
+ "aria-expanded": !t,
843
816
  children: [
844
- /* @__PURE__ */ a(
845
- tn,
817
+ /* @__PURE__ */ c(
818
+ Jr,
846
819
  {
847
820
  className: x(
848
821
  "size-4 shrink-0 text-fg-quaternary transition-transform",
849
- !r && "rotate-90"
822
+ !t && "rotate-90"
850
823
  )
851
824
  }
852
825
  ),
853
- /* @__PURE__ */ a("span", { className: "truncate", children: e.label || "(Empty)" }),
854
- /* @__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: [
855
828
  "(",
856
829
  e.rows.length,
857
830
  ")"
@@ -864,51 +837,51 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
864
837
  },
865
838
  `group-${e.key}`
866
839
  );
867
- }, jt = (e, r, t = 0) => {
868
- 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;
869
- 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(
870
843
  m.Row,
871
844
  {
872
845
  onAction: () => {
873
846
  var o;
874
- (o = A.current) != null && o.active || ke == null || ke(e);
847
+ (o = U.current) != null && o.active || ve == null || ve(e);
875
848
  },
876
849
  onMouseEnter: () => V == null ? void 0 : V(e, !0),
877
850
  onMouseLeave: () => V == null ? void 0 : V(e, !1),
878
851
  id: n,
879
852
  value: e,
880
853
  columns: f,
881
- expandedColSpan: me,
854
+ expandedColSpan: ye,
882
855
  isExpandable: i,
883
856
  highlightSelectedRow: Ee,
884
857
  renderExpandedContent: i ? wr : void 0,
885
858
  [nr]: n,
886
- [Wn]: String(c),
859
+ [Wn]: String(a),
887
860
  className: x(
888
- ke && "cursor-pointer",
861
+ ve && "cursor-pointer",
889
862
  fr ? "prose" : "",
890
- kt && "[&>td]:after:hidden",
891
- rt && "group/rowactions",
863
+ vt && "[&>td]:after:hidden",
864
+ tt && "group/rowactions",
892
865
  h && "bg-utility-brand-25 hover:bg-utility-brand-25",
893
- U && l && "bg-secondary",
894
- _t,
866
+ A && l && "bg-secondary",
867
+ Wt,
895
868
  je == null ? void 0 : je(e)
896
869
  ),
897
- style: k ? Ln : void 0,
870
+ style: k ? Nn : void 0,
898
871
  children: [
899
- U && /* @__PURE__ */ a(
872
+ A && /* @__PURE__ */ c(
900
873
  m.Cell,
901
874
  {
902
875
  "data-grid-no-range": "",
903
- className: x("relative w-10 text-center", D),
876
+ className: x("relative w-10 text-center", W),
904
877
  style: { minWidth: "40px", width: "40px" },
905
- children: /* @__PURE__ */ a(
878
+ children: /* @__PURE__ */ c(
906
879
  "div",
907
880
  {
908
881
  className: "flex items-center justify-center",
909
882
  onClick: (o) => o.stopPropagation(),
910
883
  onKeyDown: (o) => o.stopPropagation(),
911
- children: /* @__PURE__ */ a(
884
+ children: /* @__PURE__ */ c(
912
885
  sr,
913
886
  {
914
887
  checked: l,
@@ -922,63 +895,63 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
922
895
  }
923
896
  ),
924
897
  f.map((o, zt) => {
925
- const yt = Ft.get(o.key), ge = cr(
898
+ const ht = Ft.get(o.key), we = cr(
926
899
  o.key,
927
900
  Q,
928
- yt
929
- ), 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(
930
903
  w,
931
904
  n,
932
905
  o.key,
933
- v,
906
+ R,
934
907
  Y
935
- ) : 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);
936
- 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(
937
910
  m.Cell,
938
911
  {
939
912
  sticky: o.sticky,
940
913
  stickyOffset: o.stickyOffset,
941
914
  style: {
942
915
  ...K,
943
- ...Re ? { boxShadow: Re } : null
916
+ ...ge ? { boxShadow: ge } : null
944
917
  },
945
918
  "data-grid-cell": "",
946
919
  "data-grid-row-id": n,
947
920
  "data-grid-col-key": o.key,
948
- "data-grid-source-index": c,
921
+ "data-grid-source-index": a,
949
922
  className: x(
950
923
  "relative overflow-x-hidden",
951
924
  // Uncontrolled single-cell highlight (legacy).
952
925
  Ye && "z-1 outline-hidden ring-2 ring-inset ring-brand after:opacity-0",
953
926
  // Controlled range: fill all selected cells except the anchor; perimeter via boxShadow.
954
927
  se && "z-1 outline-hidden after:opacity-0",
955
- se && Z && !Z.isAnchor && "bg-utility-brand-25",
928
+ se && M && !M.isAnchor && "bg-utility-brand-25",
956
929
  o.cellClassName,
957
- on(ge),
958
- D
930
+ nn(we),
931
+ W
959
932
  ),
960
933
  children: (() => {
961
- const Vt = zt === 0 && (i || rt) ? /* @__PURE__ */ E("div", { className: "flex items-center", children: [
962
- L && /* @__PURE__ */ a(
934
+ const Vt = zt === 0 && (i || tt) ? /* @__PURE__ */ C("div", { className: "flex items-center", children: [
935
+ b && /* @__PURE__ */ c(
963
936
  "div",
964
937
  {
965
938
  "data-grid-no-range": "",
966
939
  className: "flex items-center justify-center",
967
- onClick: ($) => $.stopPropagation(),
968
- onContextMenu: ($) => $.stopPropagation(),
969
- onKeyDown: ($) => $.stopPropagation(),
970
- children: /* @__PURE__ */ a(
971
- Un,
940
+ onClick: (X) => X.stopPropagation(),
941
+ onContextMenu: (X) => X.stopPropagation(),
942
+ onKeyDown: (X) => X.stopPropagation(),
943
+ children: /* @__PURE__ */ c(
944
+ An,
972
945
  {
973
- config: L,
974
- sourceRowIndex: c,
946
+ config: b,
947
+ sourceRowIndex: a,
975
948
  item: e,
976
- enableDrag: nt,
949
+ enableDrag: rt,
977
950
  isDragging: k,
978
- onDragHandlePointerDown: ($) => Yr(
979
- $,
951
+ onDragHandlePointerDown: (X) => Yr(
952
+ X,
980
953
  n,
981
- c,
954
+ a,
982
955
  e
983
956
  ),
984
957
  triggerClassName: x(
@@ -987,14 +960,14 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
987
960
  "transition-opacity group-hover/rowactions:opacity-100 focus-visible:opacity-100",
988
961
  h || k ? "opacity-100" : "opacity-0"
989
962
  ),
990
- onOpenChange: ($) => Tt($ ? n : null)
963
+ onOpenChange: (X) => Tt(X ? n : null)
991
964
  }
992
965
  )
993
966
  }
994
967
  ),
995
- /* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: vt(o.key, e[o.key], e) })
996
- ] }) : vt(o.key, e[o.key], e);
997
- 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(
998
971
  "div",
999
972
  {
1000
973
  "data-grid-focus": !0,
@@ -1008,13 +981,13 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
1008
981
  o.key
1009
982
  );
1010
983
  }),
1011
- O && G && /* @__PURE__ */ a(
984
+ O && Z && /* @__PURE__ */ c(
1012
985
  m.Cell,
1013
986
  {
1014
987
  "data-grid-no-range": "",
1015
- className: x("relative w-14 text-center", D),
988
+ className: x("relative w-14 text-center", W),
1016
989
  style: { minWidth: "56px", width: "56px" },
1017
- children: /* @__PURE__ */ a(
990
+ children: /* @__PURE__ */ c(
1018
991
  "button",
1019
992
  {
1020
993
  type: "button",
@@ -1022,9 +995,9 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
1022
995
  "aria-label": "Delete row",
1023
996
  className: "inline-flex items-center justify-center rounded p-1 text-fg-quaternary hover:bg-secondary_subtle hover:text-fg-secondary",
1024
997
  onClick: (o) => {
1025
- o.stopPropagation(), G.onDeleteRow(c);
998
+ o.stopPropagation(), Z.onDeleteRow(a);
1026
999
  },
1027
- children: /* @__PURE__ */ a(Yn, { name: "Trash02", className: "size-3" })
1000
+ children: /* @__PURE__ */ c(Yn, { name: "Trash02", className: "size-3" })
1028
1001
  }
1029
1002
  )
1030
1003
  }
@@ -1033,39 +1006,39 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
1033
1006
  },
1034
1007
  n
1035
1008
  );
1036
- }, Hr = (e) => /* @__PURE__ */ E(
1009
+ }, Hr = (e) => /* @__PURE__ */ C(
1037
1010
  m.Row,
1038
1011
  {
1039
1012
  id: String(e.id),
1040
1013
  isExpandable: !1,
1041
- className: x(kt && "[&>td]:after:hidden", _t),
1014
+ className: x(vt && "[&>td]:after:hidden", Wt),
1042
1015
  children: [
1043
- U && /* @__PURE__ */ a(
1016
+ A && /* @__PURE__ */ c(
1044
1017
  m.Cell,
1045
1018
  {
1046
- className: x("relative w-10", D),
1019
+ className: x("relative w-10", W),
1047
1020
  style: { minWidth: "40px", width: "40px" }
1048
1021
  }
1049
1022
  ),
1050
- f.map((r) => /* @__PURE__ */ a(
1023
+ f.map((t) => /* @__PURE__ */ c(
1051
1024
  m.Cell,
1052
1025
  {
1053
- sticky: r.sticky,
1054
- stickyOffset: r.stickyOffset,
1055
- style: ft(r),
1026
+ sticky: t.sticky,
1027
+ stickyOffset: t.stickyOffset,
1028
+ style: ut(t),
1056
1029
  className: x(
1057
1030
  "overflow-x-hidden text-left",
1058
- r.cellClassName,
1059
- D
1031
+ t.cellClassName,
1032
+ W
1060
1033
  ),
1061
- children: /* @__PURE__ */ a(Bn, { height: "14px", width: "75%", className: "rounded" })
1034
+ children: /* @__PURE__ */ c(Bn, { height: "14px", width: "75%", className: "rounded" })
1062
1035
  },
1063
- r.key
1036
+ t.key
1064
1037
  )),
1065
- O && /* @__PURE__ */ a(
1038
+ O && /* @__PURE__ */ c(
1066
1039
  m.Cell,
1067
1040
  {
1068
- className: x("w-14", D),
1041
+ className: x("w-14", W),
1069
1042
  style: { minWidth: "56px", width: "56px" }
1070
1043
  }
1071
1044
  )
@@ -1073,45 +1046,46 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
1073
1046
  },
1074
1047
  String(e.id)
1075
1048
  ), zr = () => j ? Fe.map((e) => Hr(e)) : Oe && J ? J.flatMap((e) => {
1076
- const r = Te.has(e.key);
1049
+ const t = Te.has(e.key);
1077
1050
  return [
1078
1051
  Kr(e),
1079
- ...r ? [] : e.rows.map(
1080
- (t, i) => jt(t, void 0, i)
1052
+ ...t ? [] : e.rows.map(
1053
+ (r, i) => jt(r, void 0, i)
1081
1054
  )
1082
1055
  ];
1083
1056
  }) : Fe.map(
1084
- (e, r) => jt(e, void 0, r)
1085
- ), qt = /* @__PURE__ */ a(
1086
- rn.Root,
1057
+ (e, t) => jt(e, void 0, t)
1058
+ ), qt = /* @__PURE__ */ c(
1059
+ Qr.Root,
1087
1060
  {
1088
- ref: Mr,
1089
- onKeyDownCapture: W ? Zr : void 0,
1090
- onPointerDownCapture: y ? $r : void 0,
1061
+ ref: Zr,
1062
+ onKeyDownCapture: N ? Gr : void 0,
1063
+ onPointerDownCapture: y ? Xr : void 0,
1091
1064
  onDoubleClickCapture: y ? Br : void 0,
1092
1065
  className: x(
1093
1066
  "w-full",
1094
- !P || $t ? "overflow-x-auto" : "overflow-x-hidden",
1067
+ !_ || Xt ? "overflow-x-auto" : "overflow-x-hidden",
1095
1068
  Ie && "border border-secondary rounded-xl",
1096
1069
  "[&_tr:hover>td]:!bg-secondary_subtle",
1097
1070
  hr
1098
1071
  ),
1099
- size: bt,
1100
- children: /* @__PURE__ */ E(
1072
+ size: Rt,
1073
+ children: /* @__PURE__ */ C(
1101
1074
  m,
1102
1075
  {
1076
+ "data-table-zoom-typography": Se !== void 0 ? "" : void 0,
1103
1077
  "aria-label": ur,
1104
- size: bt,
1105
- isEditable: W,
1078
+ size: Rt,
1079
+ isEditable: N,
1106
1080
  inlineSelection: Ee,
1107
1081
  className: x(
1108
- P && "min-w-full",
1082
+ _ && "min-w-full",
1109
1083
  mr
1110
1084
  ),
1111
- style: Gr,
1112
- ...Ar,
1085
+ style: Mr,
1086
+ ...Ur,
1113
1087
  children: [
1114
- /* @__PURE__ */ E(
1088
+ /* @__PURE__ */ C(
1115
1089
  m.Header,
1116
1090
  {
1117
1091
  className: x(
@@ -1120,19 +1094,19 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
1120
1094
  yr
1121
1095
  ),
1122
1096
  children: [
1123
- U && /* @__PURE__ */ a(
1097
+ A && /* @__PURE__ */ c(
1124
1098
  m.Head,
1125
1099
  {
1126
1100
  label: "",
1127
1101
  allowsSorting: !1,
1128
1102
  isRowHeader: !1,
1129
1103
  style: { minWidth: "40px", width: "40px" },
1130
- className: x(D),
1104
+ className: x(W),
1131
1105
  headerCellClass: "justify-center",
1132
- 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(
1133
1107
  sr,
1134
1108
  {
1135
- checked: ht ? !0 : Xr && !ht ? "indeterminate" : !1,
1109
+ checked: pt ? !0 : $r && !pt ? "indeterminate" : !1,
1136
1110
  onCheckedChange: () => jr(),
1137
1111
  "aria-label": "Select all rows",
1138
1112
  className: "items-center justify-center"
@@ -1141,33 +1115,33 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
1141
1115
  },
1142
1116
  "selection"
1143
1117
  ),
1144
- f.map((e, r) => {
1145
- 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(
1146
1120
  e.key,
1147
1121
  Q,
1148
1122
  i
1149
- ), c = pr.includes(e.key) || n === "center" ? "justify-center" : n === "right" ? "justify-end" : "";
1150
- return /* @__PURE__ */ a(
1123
+ ), a = pr.includes(e.key) || n === "center" ? "justify-center" : n === "right" ? "justify-end" : "";
1124
+ return /* @__PURE__ */ c(
1151
1125
  m.Head,
1152
1126
  {
1153
1127
  sticky: e.sticky,
1154
1128
  stickyOffset: e.stickyOffset,
1155
1129
  id: e.key,
1156
1130
  label: e.label,
1157
- isRowHeader: r === 0,
1131
+ isRowHeader: t === 0,
1158
1132
  allowsSorting: e.allowsSorting,
1159
- headerCellClass: `${e.headerCellClass} ${c}`,
1160
- style: ft(e),
1133
+ headerCellClass: `${e.headerCellClass} ${a}`,
1134
+ style: ut(e),
1161
1135
  className: x(
1162
1136
  "overflow-hidden",
1163
1137
  e.headClassName,
1164
- D
1138
+ W
1165
1139
  ),
1166
- headerAction: t && Pe ? /* @__PURE__ */ a(
1167
- Gn,
1140
+ headerAction: r && _e ? /* @__PURE__ */ c(
1141
+ Mn,
1168
1142
  {
1169
- column: t,
1170
- columnLabel: t.label ?? (i ? sn(i, Er) : e.label),
1143
+ column: r,
1144
+ columnLabel: r.label ?? (i ? rn(i, Ir) : e.label),
1171
1145
  currentAlignment: i ? dr(
1172
1146
  i,
1173
1147
  Q ?? /* @__PURE__ */ new Map()
@@ -1175,77 +1149,77 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
1175
1149
  capabilities: kr,
1176
1150
  hideDisabled: f.length <= 1,
1177
1151
  onAction: Fr.get(e.key),
1178
- renderExtraItems: Ir,
1152
+ renderExtraItems: Lr,
1179
1153
  showOnHeaderHover: !0
1180
1154
  }
1181
1155
  ) : void 0,
1182
- children: (Xe == null ? void 0 : Xe(e.key)) ?? null
1156
+ children: ($e == null ? void 0 : $e(e.key)) ?? null
1183
1157
  },
1184
1158
  e.key
1185
1159
  );
1186
1160
  }),
1187
- O && /* @__PURE__ */ a(
1161
+ O && /* @__PURE__ */ c(
1188
1162
  m.Head,
1189
1163
  {
1190
1164
  label: "",
1191
1165
  allowsSorting: !1,
1192
1166
  isRowHeader: !1,
1193
1167
  style: { minWidth: "56px", width: "56px" },
1194
- className: x(D)
1168
+ className: x(W)
1195
1169
  },
1196
1170
  "actions"
1197
1171
  )
1198
1172
  ]
1199
1173
  }
1200
1174
  ),
1201
- /* @__PURE__ */ E(m.Body, { children: [
1202
- !Ut && zr(),
1203
- Cr && /* @__PURE__ */ a(
1175
+ /* @__PURE__ */ C(m.Body, { children: [
1176
+ !At && zr(),
1177
+ Cr && /* @__PURE__ */ c(
1204
1178
  m.Row,
1205
1179
  {
1206
1180
  id: "empty-state",
1207
1181
  highlightSelectedRow: !1,
1208
- children: /* @__PURE__ */ a(
1182
+ children: /* @__PURE__ */ c(
1209
1183
  m.Cell,
1210
1184
  {
1211
- colSpan: me,
1185
+ colSpan: ye,
1212
1186
  className: x(
1213
1187
  "text-left text-placeholder_subtle border-b border-secondary py-3",
1214
- D
1188
+ W
1215
1189
  ),
1216
- children: Wt
1190
+ children: bt
1217
1191
  }
1218
1192
  )
1219
1193
  },
1220
1194
  "empty-state"
1221
1195
  ),
1222
- ot && G && /* @__PURE__ */ E(
1196
+ st && Z && /* @__PURE__ */ C(
1223
1197
  m.Row,
1224
1198
  {
1225
1199
  id: "add-row-footer",
1226
1200
  highlightSelectedRow: !1,
1227
1201
  children: [
1228
- /* @__PURE__ */ a(
1202
+ /* @__PURE__ */ c(
1229
1203
  m.Cell,
1230
1204
  {
1231
- colSpan: me - (O ? 1 : 0),
1232
- className: x(D),
1233
- children: /* @__PURE__ */ a(
1234
- Mn,
1205
+ colSpan: ye - (O ? 1 : 0),
1206
+ className: x(W),
1207
+ children: /* @__PURE__ */ c(
1208
+ Zn,
1235
1209
  {
1236
1210
  color: "tertiary",
1237
1211
  className: "bg-secondary text-primary",
1238
1212
  size: "xs",
1239
- onClick: G.onAddRow,
1213
+ onClick: Z.onAddRow,
1240
1214
  children: "+ Add Row"
1241
1215
  }
1242
1216
  )
1243
1217
  }
1244
1218
  ),
1245
- O && /* @__PURE__ */ a(
1219
+ O && /* @__PURE__ */ c(
1246
1220
  m.Cell,
1247
1221
  {
1248
- className: x("w-14", D),
1222
+ className: x("w-14", W),
1249
1223
  style: { minWidth: "56px", width: "56px" }
1250
1224
  }
1251
1225
  )
@@ -1253,12 +1227,12 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
1253
1227
  },
1254
1228
  "add-row-footer"
1255
1229
  ),
1256
- Or && Ke && /* @__PURE__ */ a(
1257
- An,
1230
+ Or && Ke && /* @__PURE__ */ c(
1231
+ Un,
1258
1232
  {
1259
1233
  ...Ke,
1260
1234
  hasActionsColumn: O,
1261
- hasSelectionColumn: U,
1235
+ hasSelectionColumn: A,
1262
1236
  showBorders: !!Ie
1263
1237
  }
1264
1238
  )
@@ -1267,20 +1241,20 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
1267
1241
  }
1268
1242
  )
1269
1243
  }
1270
- ), Kt = W ? /* @__PURE__ */ a(
1244
+ ), Kt = N ? /* @__PURE__ */ c(
1271
1245
  mn,
1272
1246
  {
1273
- rowIds: v,
1247
+ rowIds: R,
1274
1248
  columnKeys: Y,
1275
1249
  containerRef: g,
1276
- onSelectCell: at,
1250
+ onSelectCell: ot,
1277
1251
  onEditingCellChange: _r,
1278
1252
  children: qt
1279
1253
  }
1280
- ) : qt, Ht = p != null && p.active ? /* @__PURE__ */ E(wt, { children: [
1281
- /* @__PURE__ */ a(En, { session: p }),
1282
- p.dropLineY != null && /* @__PURE__ */ a(
1283
- 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,
1284
1258
  {
1285
1259
  y: p.dropLineY,
1286
1260
  left: p.dropLineLeft,
@@ -1288,23 +1262,23 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
1288
1262
  }
1289
1263
  )
1290
1264
  ] }) : null;
1291
- return Tr ? /* @__PURE__ */ E("div", { className: "flex flex-col gap-3", children: [
1292
- Mt && Gt,
1265
+ return Tr ? /* @__PURE__ */ C("div", { className: "flex flex-col gap-3", children: [
1266
+ Zt && Mt,
1293
1267
  Kt,
1294
- At && T && /* @__PURE__ */ a(
1295
- nn,
1268
+ Ut && S && /* @__PURE__ */ c(
1269
+ en,
1296
1270
  {
1297
- currentPage: T.currentPage,
1298
- pageSize: T.pageSize,
1299
- totalPages: T.totalPages,
1300
- totalItems: T.totalItems,
1301
- onPageChange: T.onPageChange,
1302
- onPageSizeChange: T.onPageSizeChange,
1303
- 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
1304
1278
  }
1305
1279
  ),
1306
1280
  Ht
1307
- ] }) : /* @__PURE__ */ E(wt, { children: [
1281
+ ] }) : /* @__PURE__ */ C(Jt, { children: [
1308
1282
  Kt,
1309
1283
  Ht
1310
1284
  ] });