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

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 (52) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +157 -140
  4. package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
  5. package/dist/patterns/table/TableWrapper.js +376 -369
  6. package/dist/patterns/table/index.d.ts +4 -1
  7. package/dist/patterns/table/index.d.ts.map +1 -1
  8. package/dist/patterns/table/integrateTableUndoRedo.d.ts +41 -0
  9. package/dist/patterns/table/integrateTableUndoRedo.d.ts.map +1 -0
  10. package/dist/patterns/table/integrateTableUndoRedo.js +63 -0
  11. package/dist/patterns/table/storyHelpers/useMockTableState.d.ts +3 -1
  12. package/dist/patterns/table/storyHelpers/useMockTableState.d.ts.map +1 -1
  13. package/dist/patterns/table/table.d.ts +2 -1
  14. package/dist/patterns/table/table.d.ts.map +1 -1
  15. package/dist/patterns/table/table.js +181 -155
  16. package/dist/patterns/table/tableUndoRedo.d.ts +38 -0
  17. package/dist/patterns/table/tableUndoRedo.d.ts.map +1 -0
  18. package/dist/patterns/table/tableUndoRedo.js +147 -0
  19. package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts +4 -0
  20. package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts.map +1 -1
  21. package/dist/patterns/table/toolbar/ColumnHeaderMenu.js +81 -77
  22. package/dist/patterns/table/toolbar/TableToolbar.d.ts +11 -2
  23. package/dist/patterns/table/toolbar/TableToolbar.d.ts.map +1 -1
  24. package/dist/patterns/table/toolbar/TableToolbar.js +163 -114
  25. package/dist/patterns/table/toolbar/index.d.ts +1 -1
  26. package/dist/patterns/table/toolbar/index.d.ts.map +1 -1
  27. package/dist/patterns/table/toolbar/useUndoRedoShortcuts.d.ts +9 -0
  28. package/dist/patterns/table/toolbar/useUndoRedoShortcuts.d.ts.map +1 -0
  29. package/dist/patterns/table/toolbar/useUndoRedoShortcuts.js +21 -0
  30. package/dist/patterns/table/types.d.ts +5 -1
  31. package/dist/patterns/table/types.d.ts.map +1 -1
  32. package/dist/patterns/table/useTableUndoRedo.d.ts +41 -0
  33. package/dist/patterns/table/useTableUndoRedo.d.ts.map +1 -0
  34. package/dist/patterns/table/useTableUndoRedo.js +168 -0
  35. package/dist/primitives/badge/badge.js +5 -5
  36. package/dist/primitives/input/input.d.ts +1 -1
  37. package/dist/primitives/input/input.d.ts.map +1 -1
  38. package/dist/primitives/input/input.js +63 -62
  39. package/dist/primitives/select/ExpandableSearchInput.d.ts +1 -1
  40. package/dist/primitives/select/ExpandableSearchInput.d.ts.map +1 -1
  41. package/dist/primitives/select/SearchInput.d.ts +2 -2
  42. package/dist/primitives/select/SearchInput.d.ts.map +1 -1
  43. package/dist/primitives/select/SearchInput.js +38 -37
  44. package/dist/primitives/select/combobox.d.ts.map +1 -1
  45. package/dist/primitives/select/combobox.js +48 -47
  46. package/dist/primitives/select/multi-select.d.ts.map +1 -1
  47. package/dist/primitives/select/multi-select.js +50 -49
  48. package/dist/styles/components.css +1 -1
  49. package/dist/utils/keyboard-shortcut.d.ts +4 -0
  50. package/dist/utils/keyboard-shortcut.d.ts.map +1 -0
  51. package/dist/utils/keyboard-shortcut.js +29 -0
  52. package/package.json +1 -1
@@ -1,235 +1,243 @@
1
- import { jsx as i, jsxs as k } from "react/jsx-runtime";
2
- import { forwardRef as Bt, useState as J, useMemo as h, useCallback as V, useRef as Jt, useEffect as Vt, useLayoutEffect as Xt } from "react";
3
- import { ChevronRight as Yt } from "@untitledui/icons";
1
+ import { jsx as s, jsxs as S } from "react/jsx-runtime";
2
+ import { forwardRef as Jt, useState as B, useMemo as u, useCallback as J, useRef as Vt, useEffect as Xt, useLayoutEffect as Yt } from "react";
3
+ import { ChevronRight as Ht } from "@untitledui/icons";
4
4
  import { cx as c } from "../../utils/cn.js";
5
5
  import { TableCard as Qt, Table as d } from "./table.js";
6
6
  import { TablePagination as Zt } from "./TablePagination.js";
7
- import { getEffectiveAlignment as ot, resolveColumnLabel as Ht, alignmentClass as Kt } from "./toolbar/tableToolbarHelpers.js";
8
- import { findGridCell as er, isWithinCellEditor as tr, getGridNeighbor as rr, getGridTabNeighbor as nr, focusGridCell as ir, GridNavProvider as sr } from "./useGridKeyboardNavigation.js";
9
- import { BulkActionBar as ar } from "./toolbar/BulkActionBar.js";
10
- import { TableToolbar as lr } from "./toolbar/TableToolbar.js";
11
- import { Checkbox as nt } from "../../primitives/checkbox/checkbox.js";
12
- import { ColumnHeaderMenu as or } from "./toolbar/ColumnHeaderMenu.js";
13
- import { Button as dr } from "../../primitives/button/button.js";
14
- import { SummaryFooterRow as cr } from "./toolbar/SummaryFooter.js";
15
- import { RowActionsMenu as fr } from "./toolbar/RowActionsMenu.js";
16
- import { Icon as hr } from "../../primitives/icon/icon.js";
17
- import { ShimmerLine as ur } from "../../primitives/shimmer/shimmer.js";
18
- const yr = 5, pr = "__all__", it = {
7
+ import { getEffectiveAlignment as dt, resolveColumnLabel as Kt, alignmentClass as er } from "./toolbar/tableToolbarHelpers.js";
8
+ import { findGridCell as tr, isWithinCellEditor as rr, getGridNeighbor as nr, getGridTabNeighbor as ir, focusGridCell as sr, GridNavProvider as ar } from "./useGridKeyboardNavigation.js";
9
+ import { BulkActionBar as lr } from "./toolbar/BulkActionBar.js";
10
+ import { TableToolbar as or } from "./toolbar/TableToolbar.js";
11
+ import { Checkbox as it } from "../../primitives/checkbox/checkbox.js";
12
+ import { ColumnHeaderMenu as dr } from "./toolbar/ColumnHeaderMenu.js";
13
+ import { Button as cr } from "../../primitives/button/button.js";
14
+ import { SummaryFooterRow as fr } from "./toolbar/SummaryFooter.js";
15
+ import { RowActionsMenu as hr } from "./toolbar/RowActionsMenu.js";
16
+ import { Icon as ur } from "../../primitives/icon/icon.js";
17
+ import { ShimmerLine as yr } from "../../primitives/shimmer/shimmer.js";
18
+ const wr = 5, pr = "__all__", st = {
19
19
  ArrowUp: "up",
20
20
  ArrowDown: "down",
21
21
  ArrowLeft: "left",
22
22
  ArrowRight: "right"
23
- }, X = (t) => t.__rowId ?? t.id ?? t.rule_id ?? String(t);
24
- function st(t, a) {
25
- return t === "all" ? new Set(a) : t ?? /* @__PURE__ */ new Set();
23
+ }, V = (t) => t.__rowId ?? t.id ?? t.rule_id ?? String(t);
24
+ function at(t, i) {
25
+ return t === "all" ? new Set(i) : t ?? /* @__PURE__ */ new Set();
26
26
  }
27
- function wr(t, a, l) {
28
- return t ? t === "all" ? l.includes(a) : t.has(a) : !1;
27
+ function xr(t, i, l) {
28
+ return t ? t === "all" ? l.includes(i) : t.has(i) : !1;
29
29
  }
30
- function xr(t, a) {
31
- return t ? t === "all" ? a.length : t.size : 0;
30
+ function gr(t, i) {
31
+ return t ? t === "all" ? i.length : t.size : 0;
32
32
  }
33
- function br(t, a) {
34
- return a.length === 0 ? !1 : t === "all" ? !0 : a.every((l) => (t == null ? void 0 : t.has(l)) ?? !1);
33
+ function br(t, i) {
34
+ return i.length === 0 ? !1 : t === "all" ? !0 : i.every((l) => (t == null ? void 0 : t.has(l)) ?? !1);
35
35
  }
36
- function gr(t, a) {
37
- return t === "all" ? a.length > 0 : a.some((l) => (t == null ? void 0 : t.has(l)) ?? !1);
36
+ function mr(t, i) {
37
+ return t === "all" ? i.length > 0 : i.some((l) => (t == null ? void 0 : t.has(l)) ?? !1);
38
38
  }
39
- function mr(t) {
39
+ function Nr(t) {
40
40
  if (t)
41
- return (a) => {
42
- t(a === "all" ? "all" : new Set([...a].map(String)));
41
+ return (i) => {
42
+ t(i === "all" ? "all" : new Set([...i].map(String)));
43
43
  };
44
44
  }
45
- function Nr(t) {
46
- var a;
47
- return t != null && t.length ? t.length > 1 ? !0 : ((a = t[0]) == null ? void 0 : a.key) !== pr : !1;
45
+ function kr(t) {
46
+ var i;
47
+ return t != null && t.length ? t.length > 1 ? !0 : ((i = t[0]) == null ? void 0 : i.key) !== pr : !1;
48
48
  }
49
- function at(t, a, l) {
50
- return l ? ot(l, a ?? /* @__PURE__ */ new Map()) : (a == null ? void 0 : a.get(t)) ?? "left";
49
+ function lt(t, i, l) {
50
+ return l ? dt(l, i ?? /* @__PURE__ */ new Map()) : (i == null ? void 0 : i.get(t)) ?? "left";
51
51
  }
52
- const Te = "300px", Pe = (t) => {
52
+ const Le = "300px", Te = (t) => {
53
53
  if (!t) return 0;
54
- const a = t.match(/^(\d+(?:\.\d+)?)px$/);
55
- return a ? Number(a[1]) : 0;
56
- }, A = (t) => !!(t.maxWidth && t.sticky === "right"), kr = (t) => ({
57
- maxWidth: t.maxWidth ?? Te,
58
- minWidth: t.minWidth
59
- }), lt = (t) => A(t) && t.maxWidth ? {
60
- minWidth: t.maxWidth,
61
- width: t.maxWidth,
62
- maxWidth: t.maxWidth
63
- } : {
64
- minWidth: t.minWidth,
65
- maxWidth: t.maxWidth ?? Te
66
- }, Mr = Bt(
54
+ const i = t.match(/^(\d+(?:\.\d+)?)px$/);
55
+ return i ? Number(i[1]) : 0;
56
+ }, X = (t) => !!t.width || !!(t.maxWidth && t.sticky === "right"), Oe = (t) => t.width ?? (t.maxWidth && t.sticky === "right" ? t.maxWidth : void 0), Cr = (t) => ({
57
+ width: t.width,
58
+ maxWidth: t.maxWidth ?? Le,
59
+ minWidth: t.minWidth ?? t.width
60
+ }), ot = (t) => {
61
+ const i = Oe(t);
62
+ return i ? {
63
+ minWidth: i,
64
+ width: i,
65
+ maxWidth: t.maxWidth ?? i
66
+ } : {
67
+ minWidth: t.minWidth,
68
+ maxWidth: t.maxWidth ?? Le
69
+ };
70
+ }, Dr = Jt(
67
71
  function({
68
- data: a,
72
+ data: i,
69
73
  columns: l,
70
- renderRowCell: Le,
74
+ renderRowCell: ze,
71
75
  onRowClick: Y,
72
- onRowHover: L,
73
- arialabel: dt,
74
- size: Oe = "sm",
75
- allowDefaultRowClass: ct = !1,
76
- centeredHeaders: ft = [],
77
- rootClassName: ht,
78
- removeBorders: ze,
79
- headerClassName: ut,
80
- isRowExpandable: Ge,
81
- renderExpandedContent: yt,
76
+ onRowHover: O,
77
+ arialabel: ct,
78
+ size: Ae = "sm",
79
+ allowDefaultRowClass: ft = !1,
80
+ centeredHeaders: ht = [],
81
+ rootClassName: ut,
82
+ removeBorders: Ge,
83
+ headerClassName: yt,
84
+ isRowExpandable: $e,
85
+ renderExpandedContent: wt,
82
86
  loading: P = !1,
83
- loadingRowCount: Ae = yr,
87
+ loadingRowCount: je = wr,
84
88
  renderHeaderCell: ce,
85
89
  tableClassName: pt,
86
90
  getRowClassName: fe,
87
- selectionMode: $ = "none",
88
- selectedKeys: C,
91
+ selectionMode: G = "none",
92
+ selectedKeys: k,
89
93
  onSelectionChange: p,
90
94
  inlineSelection: he = !1,
91
- toolbar: w,
92
- showToolbar: wt,
93
- toolbarTitle: $e,
94
- toolbarTrailing: je,
95
- disableExtendedTools: Fe,
95
+ toolbar: h,
96
+ showToolbar: xt,
97
+ toolbarTitle: Fe,
98
+ toolbarTrailing: Me,
99
+ disableExtendedTools: ue,
96
100
  pagination: x,
97
- showBorders: Q,
98
- emptyState: Me,
101
+ showBorders: H,
102
+ emptyState: De,
99
103
  editChrome: v,
100
- showEditActions: xt = !1,
104
+ showEditActions: gt = !1,
101
105
  searchCollapsible: Ue,
102
106
  isEditable: bt,
103
- toolbarSlot: ue,
104
- rowHeightClass: De,
105
- groupedData: O,
106
- showSummaryFooter: gt,
107
- summaryFooterProps: ye,
108
- bulkActionBar: Z,
109
- renderBulkActionBar: H,
107
+ toolbarSlot: ye,
108
+ rowHeightClass: qe,
109
+ groupedData: L,
110
+ showSummaryFooter: mt,
111
+ summaryFooterProps: we,
112
+ bulkActionBar: Q,
113
+ renderBulkActionBar: Z,
110
114
  onBulkDuplicate: K,
111
115
  onBulkDelete: ee,
112
116
  bulkActionBusy: te,
113
117
  columnAlignments: z,
114
118
  onColumnHeaderAction: re,
115
- showColumnHeaderMenu: mt,
116
- columnMenuCapabilities: Nt,
117
- renderGroupHeader: qe,
118
- columnMenuSchema: j,
119
- columnSchema: F,
120
- labelMeta: kt,
121
- renderColumnHeaderMenuExtraItems: Ct,
122
- fillWidth: y = !1,
119
+ showColumnHeaderMenu: Nt,
120
+ columnMenuCapabilities: kt,
121
+ renderGroupHeader: Be,
122
+ columnMenuSchema: $,
123
+ columnSchema: j,
124
+ labelMeta: Ct,
125
+ renderColumnHeaderMenuExtraItems: St,
126
+ fillWidth: w = !1,
123
127
  rowActions: pe,
124
- onCellActivate: we
125
- }, M) {
126
- const [ne, St] = J(
128
+ onCellActivate: xe
129
+ }, F) {
130
+ const [ne, vt] = B(
127
131
  () => /* @__PURE__ */ new Set()
128
- ), [vt, Wt] = J(
132
+ ), [Wt, Rt] = B(
129
133
  null
130
- ), [g, xe] = J(null), [G, Rt] = J(null), ie = $ === "single" || $ === "multiple", be = !!pe, W = ie && !he, ge = Nr(O), It = h(() => j != null && j.length ? new Map(j.map((e) => [e.key, e])) : /* @__PURE__ */ new Map(), [j]), Be = h(() => F != null && F.length ? new Map(F.map((e) => [e.value, e])) : /* @__PURE__ */ new Map(), [F]), se = h(
134
+ ), [b, ge] = B(null), [A, It] = B(null), ie = G === "single" || G === "multiple", be = !!pe, W = ie && !he, me = kr(L), _t = u(() => $ != null && $.length ? new Map($.map((e) => [e.key, e])) : /* @__PURE__ */ new Map(), [$]), Je = u(() => j != null && j.length ? new Map(j.map((e) => [e.value, e])) : /* @__PURE__ */ new Map(), [j]), se = u(
131
135
  () => l.map((e) => e.key),
132
136
  [l]
133
- ), Et = V((e) => {
134
- St((r) => {
137
+ ), Et = J((e) => {
138
+ vt((r) => {
135
139
  const n = new Set(r);
136
140
  return n.has(e) ? n.delete(e) : n.add(e), n;
137
141
  });
138
- }, []), ae = h(() => P ? Array.from({ length: Ae }, (e, r) => ({
142
+ }, []), ae = u(() => P ? Array.from({ length: je }, (e, r) => ({
139
143
  id: `loading-${r}`
140
- })) : a.map((e) => {
144
+ })) : i.map((e) => {
141
145
  const r = e;
142
146
  if (r.__rowId != null)
143
147
  return r;
144
- const n = X(r);
148
+ const n = V(r);
145
149
  return r.id != null && String(r.id) === n ? r : { ...r, id: n };
146
- }), [P, a, Ae]), b = h(() => P ? [] : ge && O ? O.flatMap(
147
- (e) => ne.has(e.key) ? [] : e.rows.map((r) => X(r))
148
- ) : ae.map((e) => X(e)), [P, ge, O, ne, ae]), me = h(
149
- () => st(C, b),
150
- [C, b]
151
- ), Ne = xr(C, b), ke = Ne > 0, Je = ke && !!(Z ?? H ?? K ?? ee), U = h(() => {
152
- if (!ke) return;
153
- const e = a.filter(
154
- (r) => me.has(X(r))
150
+ }), [P, i, je]), g = u(() => P ? [] : me && L ? L.flatMap(
151
+ (e) => ne.has(e.key) ? [] : e.rows.map((r) => V(r))
152
+ ) : ae.map((e) => V(e)), [P, me, L, ne, ae]), Ne = u(
153
+ () => at(k, g),
154
+ [k, g]
155
+ ), ke = gr(k, g), Ce = ke > 0, Ve = Ce && !!(Q ?? Z ?? K ?? ee), M = u(() => {
156
+ if (!Ce) return;
157
+ const e = i.filter(
158
+ (r) => Ne.has(V(r))
155
159
  );
156
160
  return {
157
- selectedKeys: me,
161
+ selectedKeys: Ne,
158
162
  selectedRows: e,
159
163
  clearSelection: () => p == null ? void 0 : p(/* @__PURE__ */ new Set()),
160
164
  busy: te
161
165
  };
162
166
  }, [
163
- ke,
164
- me,
165
- a,
167
+ Ce,
168
+ Ne,
169
+ i,
166
170
  p,
167
171
  te
168
- ]), Ve = h(() => {
169
- if (ue != null) return ue;
170
- if (Je) {
171
- if (Z != null) return Z;
172
- if (H && U)
173
- return H(U);
174
- if (U && (K || ee))
175
- return /* @__PURE__ */ i(
176
- ar,
172
+ ]), Xe = u(() => {
173
+ if (ye != null) return ye;
174
+ if (Ve) {
175
+ if (Q != null) return Q;
176
+ if (Z && M)
177
+ return Z(M);
178
+ if (M && (K || ee))
179
+ return /* @__PURE__ */ s(
180
+ lr,
177
181
  {
178
- count: Ne,
182
+ count: ke,
179
183
  onDuplicate: K,
180
184
  onDelete: ee,
181
- onClearSelection: U.clearSelection,
185
+ onClearSelection: M.clearSelection,
182
186
  busy: te
183
187
  }
184
188
  );
185
189
  }
186
- return w ? /* @__PURE__ */ i(
187
- lr,
190
+ return h ? /* @__PURE__ */ s(
191
+ or,
188
192
  {
189
- sort: w.sort,
190
- filter: w.filter,
191
- search: w.search,
192
- rowHeight: w.rowHeight,
193
- hideFields: w.hideFields,
194
- align: w.align,
195
- groupBy: w.groupBy,
196
- summary: w.summary,
197
- sortContent: w.sortContent,
198
- filterContent: w.filterContent,
199
- fallbackTitle: $e,
200
- trailing: je,
193
+ sort: h.sort,
194
+ filter: h.filter,
195
+ search: h.search,
196
+ rowHeight: h.rowHeight,
197
+ hideFields: h.hideFields,
198
+ align: h.align,
199
+ groupBy: h.groupBy,
200
+ summary: h.summary,
201
+ sortContent: h.sortContent,
202
+ filterContent: h.filterContent,
203
+ fallbackTitle: Fe,
204
+ trailing: Me,
201
205
  searchCollapsible: Ue,
202
- disableExtendedTools: Fe
206
+ disableExtendedTools: ue,
207
+ undoRedo: h.undoRedo ? {
208
+ ...h.undoRedo,
209
+ isDisabled: h.undoRedo.isDisabled ?? ue
210
+ } : void 0
203
211
  }
204
212
  ) : null;
205
213
  }, [
206
- ue,
207
- Je,
214
+ ye,
215
+ Ve,
216
+ Q,
208
217
  Z,
209
- H,
210
- U,
218
+ M,
211
219
  K,
212
220
  ee,
213
221
  te,
214
- Ne,
215
- w,
216
- $e,
217
- je,
222
+ ke,
223
+ h,
224
+ Fe,
225
+ Me,
218
226
  Ue,
219
- Fe
220
- ]), Xe = Ve != null && wt !== !1, Ye = !!x && (x == null ? void 0 : x.showPagination) !== !1, _t = Xe || Ye, Qe = !P && a.length === 0 && Me != null, m = !!(xt && v), Ce = !!(v != null && v.showFooterRow), T = bt ?? (m || Ce || be), Pt = Qe && !(Ce && v), D = l.length + (W ? 1 : 0) + (m ? 1 : 0), Tt = !!(gt && ye), u = Q ? "border-r border-secondary last:border-r-0" : void 0, I = h(() => {
221
- if (!y) return null;
227
+ ue
228
+ ]), Ye = Xe != null && xt !== !1, He = !!x && (x == null ? void 0 : x.showPagination) !== !1, Pt = Ye || He, Qe = !P && i.length === 0 && De != null, m = !!(gt && v), Se = !!(v != null && v.showFooterRow), T = bt ?? (m || Se || be), Tt = Qe && !(Se && v), D = l.length + (W ? 1 : 0) + (m ? 1 : 0), Ot = !!(mt && we), y = H ? "border-r border-secondary last:border-r-0" : void 0, I = u(() => {
229
+ if (!w) return null;
222
230
  const e = l.reduce(
223
- (s, f) => A(f) ? s + Pe(f.maxWidth) : s,
231
+ (a, f) => X(f) ? a + Te(Oe(f)) : a,
224
232
  0
225
233
  );
226
234
  return { minTableWidth: l.filter(
227
- (s) => !A(s)
235
+ (a) => !X(a)
228
236
  ).reduce(
229
- (s, f) => s + Pe(f.minWidth),
237
+ (a, f) => a + Te(f.minWidth),
230
238
  0
231
239
  ) + e };
232
- }, [l, y]), Lt = h(() => {
240
+ }, [l, w]), Lt = u(() => {
233
241
  const e = /* @__PURE__ */ new Map();
234
242
  return re && l.forEach((r) => {
235
243
  e.set(
@@ -237,114 +245,114 @@ const Te = "300px", Pe = (t) => {
237
245
  (n) => re(r.key, n)
238
246
  );
239
247
  }), e;
240
- }, [l, re]), R = Jt(null), [q, Ze] = J(null), Se = V(
248
+ }, [l, re]), R = Vt(null), [U, Ze] = B(null), ve = J(
241
249
  (e, r, n) => {
242
250
  var f;
243
- let s = n ?? null;
244
- if (s == null) {
245
- const N = (f = er(
251
+ let a = n ?? null;
252
+ if (a == null) {
253
+ const N = (f = tr(
246
254
  R.current,
247
255
  e,
248
256
  r
249
- )) == null ? void 0 : f.getAttribute("data-grid-source-index"), E = N != null && N !== "" ? Number(N) : NaN;
250
- s = Number.isNaN(E) ? null : E;
257
+ )) == null ? void 0 : f.getAttribute("data-grid-source-index"), _ = N != null && N !== "" ? Number(N) : NaN;
258
+ a = Number.isNaN(_) ? null : _;
251
259
  }
252
- xe({ rowId: e, columnKey: r, sourceIndex: s });
260
+ ge({ rowId: e, columnKey: r, sourceIndex: a });
253
261
  },
254
262
  []
255
- ), Ot = V(
263
+ ), zt = J(
256
264
  (e) => {
257
265
  var le, oe, de;
258
- const r = e.key in it;
259
- if (e.key !== "Enter" && e.key !== "Tab" && e.key !== "Escape" && !r || tr(e.target)) return;
266
+ const r = e.key in st;
267
+ if (e.key !== "Enter" && e.key !== "Tab" && e.key !== "Escape" && !r || rr(e.target)) return;
260
268
  if (e.key === "Escape") {
261
- if (!g) return;
262
- e.preventDefault(), e.stopPropagation(), xe(null), (le = R.current) != null && le.contains(document.activeElement) && document.activeElement.blur();
269
+ if (!b) return;
270
+ e.preventDefault(), e.stopPropagation(), ge(null), (le = R.current) != null && le.contains(document.activeElement) && document.activeElement.blur();
263
271
  return;
264
272
  }
265
273
  const n = (de = (oe = e.target).closest) == null ? void 0 : de.call(
266
274
  oe,
267
275
  "[data-grid-cell]"
268
- ), s = n == null ? void 0 : n.getAttribute("data-grid-row-id"), f = n == null ? void 0 : n.getAttribute("data-grid-col-key"), N = n == null ? void 0 : n.getAttribute(
276
+ ), a = n == null ? void 0 : n.getAttribute("data-grid-row-id"), f = n == null ? void 0 : n.getAttribute("data-grid-col-key"), N = n == null ? void 0 : n.getAttribute(
269
277
  "data-grid-source-index"
270
- ), E = N != null && N !== "" ? Number(N) : NaN, o = Number.isNaN(E) ? null : E, S = g ?? (s && f ? {
271
- rowId: s,
278
+ ), _ = N != null && N !== "" ? Number(N) : NaN, o = Number.isNaN(_) ? null : _, C = b ?? (a && f ? {
279
+ rowId: a,
272
280
  columnKey: f,
273
281
  sourceIndex: o
274
282
  } : null);
275
- if (!S) return;
283
+ if (!C) return;
276
284
  if (e.key === "Enter") {
277
- if (!we) return;
278
- e.preventDefault(), e.stopPropagation(), we({
279
- rowId: S.rowId,
280
- columnKey: S.columnKey,
281
- sourceIndex: S.sourceIndex
285
+ if (!xe) return;
286
+ e.preventDefault(), e.stopPropagation(), xe({
287
+ rowId: C.rowId,
288
+ columnKey: C.columnKey,
289
+ sourceIndex: C.sourceIndex
282
290
  });
283
291
  return;
284
292
  }
285
- const _ = r ? rr(
293
+ const E = r ? nr(
286
294
  R.current,
287
- b,
295
+ g,
288
296
  se,
289
- S.rowId,
290
- S.columnKey,
291
- it[e.key]
292
- ) : nr(
297
+ C.rowId,
298
+ C.columnKey,
299
+ st[e.key]
300
+ ) : ir(
293
301
  R.current,
294
- b,
302
+ g,
295
303
  se,
296
- S.rowId,
297
- S.columnKey,
304
+ C.rowId,
305
+ C.columnKey,
298
306
  !e.shiftKey
299
307
  );
300
- if (!_) {
308
+ if (!E) {
301
309
  r && (e.preventDefault(), e.stopPropagation());
302
310
  return;
303
311
  }
304
- e.preventDefault(), e.stopPropagation(), Se(_.rowId, _.columnKey, _.sourceIndex), requestAnimationFrame(
305
- () => ir(
312
+ e.preventDefault(), e.stopPropagation(), ve(E.rowId, E.columnKey, E.sourceIndex), requestAnimationFrame(
313
+ () => sr(
306
314
  R.current,
307
- _.rowId,
308
- _.columnKey
315
+ E.rowId,
316
+ E.columnKey
309
317
  )
310
318
  );
311
319
  },
312
- [g, b, se, we, Se]
320
+ [b, g, se, xe, ve]
313
321
  );
314
- Vt(() => {
315
- if (!T || !g) return;
322
+ Xt(() => {
323
+ if (!T || !b) return;
316
324
  const e = (r) => {
317
325
  const n = R.current;
318
- n && !n.contains(r.target) && xe(null);
326
+ n && !n.contains(r.target) && ge(null);
319
327
  };
320
328
  return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
321
- }, [T, g]);
322
- const He = h(() => {
329
+ }, [T, b]);
330
+ const Ke = u(() => {
323
331
  let e = 0;
324
332
  return W && (e += 40), m && (e += 56), l.forEach((r) => {
325
- A(r) && (e += Pe(r.maxWidth));
333
+ X(r) && (e += Te(Oe(r)));
326
334
  }), e;
327
- }, [l, m, W]), ve = h(
328
- () => l.filter((e) => !A(e)).length,
335
+ }, [l, m, W]), We = u(
336
+ () => l.filter((e) => !X(e)).length,
329
337
  [l]
330
- ), We = h(() => {
331
- if (!y || !I) return null;
338
+ ), Re = u(() => {
339
+ if (!w || !I) return null;
332
340
  const { minTableWidth: e } = I;
333
- return q ? Math.max(q, e) : e;
334
- }, [q, y, I]), Re = !!(y && I && q && q < I.minTableWidth), Ie = h(() => !We || ve === 0 ? null : Math.max(
341
+ return U ? Math.max(U, e) : e;
342
+ }, [U, w, I]), Ie = !!(w && I && U && U < I.minTableWidth), _e = u(() => !Re || We === 0 ? null : Math.max(
335
343
  0,
336
- (We - He) / ve
337
- ), [We, He, ve]);
338
- Xt(() => {
339
- if (!y) {
344
+ (Re - Ke) / We
345
+ ), [Re, Ke, We]);
346
+ Yt(() => {
347
+ if (!w) {
340
348
  Ze(null);
341
349
  return;
342
350
  }
343
351
  const e = R.current;
344
352
  if (!e) return;
345
353
  const r = () => {
346
- const s = e.clientWidth;
347
- s > 0 && Ze((f) => f === s ? f : s);
354
+ const a = e.clientWidth;
355
+ a > 0 && Ze((f) => f === a ? f : a);
348
356
  };
349
357
  r();
350
358
  const n = new ResizeObserver(r);
@@ -353,79 +361,79 @@ const Te = "300px", Pe = (t) => {
353
361
  };
354
362
  }, [
355
363
  l.length,
356
- a.length,
357
- y,
364
+ i.length,
365
+ w,
358
366
  P,
359
367
  m,
360
368
  W
361
369
  ]);
362
- const Ee = V(
363
- (e) => y ? A(e) && e.maxWidth ? lt(e) : Ie != null ? {
364
- width: `${Ie}px`,
370
+ const Ee = J(
371
+ (e) => w ? X(e) ? ot(e) : _e != null ? {
372
+ width: `${_e}px`,
365
373
  minWidth: e.minWidth,
366
- maxWidth: e.maxWidth ?? Te
367
- } : lt(e) : kr(e),
368
- [y, Ie]
369
- ), zt = h(() => {
370
- if (!(!y || !I))
371
- return Re ? {
374
+ maxWidth: e.maxWidth ?? Le
375
+ } : ot(e) : Cr(e),
376
+ [w, _e]
377
+ ), At = u(() => {
378
+ if (!(!w || !I))
379
+ return Ie ? {
372
380
  width: `${I.minTableWidth}px`,
373
381
  tableLayout: "fixed"
374
382
  } : {
375
383
  width: "100%",
376
384
  tableLayout: "fixed"
377
385
  };
378
- }, [y, I, Re]), Gt = V(
386
+ }, [w, I, Ie]), Gt = J(
379
387
  (e) => {
380
- R.current = e, typeof M == "function" ? M(e) : M && (M.current = e);
388
+ R.current = e, typeof F == "function" ? F(e) : F && (F.current = e);
381
389
  },
382
- [M]
383
- ), At = ie ? {
384
- selectionMode: $,
385
- selectedKeys: C === "all" ? "all" : C,
386
- onSelectionChange: mr(p)
387
- } : {}, $t = (e) => {
390
+ [F]
391
+ ), $t = ie ? {
392
+ selectionMode: G,
393
+ selectedKeys: k === "all" ? "all" : k,
394
+ onSelectionChange: Nr(p)
395
+ } : {}, jt = (e) => {
388
396
  const r = e.__sourceIndex;
389
397
  return typeof r == "number" ? r : 0;
390
- }, _e = ie && br(C, b), jt = ie && gr(C, b), Ft = () => {
398
+ }, Pe = ie && br(k, g), Ft = ie && mr(k, g), Mt = () => {
391
399
  if (p) {
392
- if (_e) {
400
+ if (Pe) {
393
401
  p(/* @__PURE__ */ new Set());
394
402
  return;
395
403
  }
396
404
  p("all");
397
405
  }
398
- }, Mt = (e, r) => {
406
+ }, Dt = (e, r) => {
399
407
  if (!p) return;
400
- if ($ === "single") {
408
+ if (G === "single") {
401
409
  p(r ? /* @__PURE__ */ new Set([e]) : /* @__PURE__ */ new Set());
402
410
  return;
403
411
  }
404
- const n = C === "all" ? new Set(b) : new Set(st(C, b));
412
+ const n = k === "all" ? new Set(g) : new Set(at(k, g));
405
413
  r ? n.add(e) : n.delete(e), p(n);
406
414
  }, Ut = (e) => {
407
415
  const r = ne.has(e.key);
408
- return qe ? /* @__PURE__ */ i(
416
+ return Be ? /* @__PURE__ */ s(
409
417
  d.Row,
410
418
  {
411
419
  id: `group-${e.key}`,
412
420
  highlightSelectedRow: !1,
413
421
  className: "bg-secondary_subtle hover:bg-secondary_subtle",
414
- children: /* @__PURE__ */ i(d.Cell, { colSpan: D, className: c(u), children: qe(e) })
422
+ children: /* @__PURE__ */ s(d.Cell, { colSpan: D, className: c(y), children: Be(e) })
415
423
  },
416
424
  `group-${e.key}`
417
- ) : /* @__PURE__ */ i(
425
+ ) : /* @__PURE__ */ s(
418
426
  d.Row,
419
427
  {
420
428
  id: `group-${e.key}`,
421
429
  highlightSelectedRow: !1,
422
430
  className: "bg-secondary_subtle hover:bg-secondary_subtle",
423
- children: /* @__PURE__ */ i(
431
+ children: /* @__PURE__ */ s(
424
432
  d.Cell,
425
433
  {
426
434
  colSpan: D,
427
- className: c("py-1.5", u),
428
- children: /* @__PURE__ */ k(
435
+ className: c("py-1.5", y),
436
+ children: /* @__PURE__ */ S(
429
437
  "button",
430
438
  {
431
439
  type: "button",
@@ -433,8 +441,8 @@ const Te = "300px", Pe = (t) => {
433
441
  onClick: () => Et(e.key),
434
442
  "aria-expanded": !r,
435
443
  children: [
436
- /* @__PURE__ */ i(
437
- Yt,
444
+ /* @__PURE__ */ s(
445
+ Ht,
438
446
  {
439
447
  className: c(
440
448
  "size-4 shrink-0 text-fg-quaternary transition-transform",
@@ -442,8 +450,8 @@ const Te = "300px", Pe = (t) => {
442
450
  )
443
451
  }
444
452
  ),
445
- /* @__PURE__ */ i("span", { className: "truncate", children: e.label || "(Empty)" }),
446
- /* @__PURE__ */ k("span", { className: "text-tertiary", children: [
453
+ /* @__PURE__ */ s("span", { className: "truncate", children: e.label || "(Empty)" }),
454
+ /* @__PURE__ */ S("span", { className: "text-tertiary", children: [
447
455
  "(",
448
456
  e.rows.length,
449
457
  ")"
@@ -456,48 +464,48 @@ const Te = "300px", Pe = (t) => {
456
464
  },
457
465
  `group-${e.key}`
458
466
  );
459
- }, Ke = (e, r) => {
460
- const n = Ge ? Ge(e) : !1, s = X(e), f = $t(e), N = wr(C, s, b), E = vt === s;
461
- return /* @__PURE__ */ k(
467
+ }, et = (e, r) => {
468
+ const n = $e ? $e(e) : !1, a = V(e), f = jt(e), N = xr(k, a, g), _ = Wt === a;
469
+ return /* @__PURE__ */ S(
462
470
  d.Row,
463
471
  {
464
472
  onAction: () => Y == null ? void 0 : Y(e),
465
- onMouseEnter: () => L == null ? void 0 : L(e, !0),
466
- onMouseLeave: () => L == null ? void 0 : L(e, !1),
467
- id: s,
473
+ onMouseEnter: () => O == null ? void 0 : O(e, !0),
474
+ onMouseLeave: () => O == null ? void 0 : O(e, !1),
475
+ id: a,
468
476
  value: e,
469
477
  columns: l,
470
478
  expandedColSpan: D,
471
479
  isExpandable: n,
472
480
  highlightSelectedRow: !he,
473
- renderExpandedContent: n ? yt : void 0,
481
+ renderExpandedContent: n ? wt : void 0,
474
482
  className: c(
475
483
  Y && "cursor-pointer",
476
- ct ? "prose" : "",
477
- ze && "[&>td]:after:hidden",
484
+ ft ? "prose" : "",
485
+ Ge && "[&>td]:after:hidden",
478
486
  be && "group/rowactions",
479
- E && "bg-utility-brand-25 hover:bg-utility-brand-25",
480
- De,
487
+ _ && "bg-utility-brand-25 hover:bg-utility-brand-25",
488
+ qe,
481
489
  fe == null ? void 0 : fe(e)
482
490
  ),
483
491
  children: [
484
- W && /* @__PURE__ */ i(
492
+ W && /* @__PURE__ */ s(
485
493
  d.Cell,
486
494
  {
487
- className: c("relative w-10 text-center", u),
495
+ className: c("relative w-10 text-center", y),
488
496
  style: { minWidth: "40px", width: "40px" },
489
- children: /* @__PURE__ */ i(
497
+ children: /* @__PURE__ */ s(
490
498
  "div",
491
499
  {
492
500
  className: "flex items-center justify-center",
493
501
  onClick: (o) => o.stopPropagation(),
494
502
  onKeyDown: (o) => o.stopPropagation(),
495
- children: /* @__PURE__ */ i(
496
- nt,
503
+ children: /* @__PURE__ */ s(
504
+ it,
497
505
  {
498
506
  checked: N,
499
- onCheckedChange: (o) => Mt(s, o === !0),
500
- "aria-label": `Select row ${s}`,
507
+ onCheckedChange: (o) => Dt(a, o === !0),
508
+ "aria-label": `Select row ${a}`,
501
509
  className: "items-center justify-center"
502
510
  }
503
511
  )
@@ -505,20 +513,20 @@ const Te = "300px", Pe = (t) => {
505
513
  )
506
514
  }
507
515
  ),
508
- l.map((o, S) => {
509
- const _ = Be.get(o.key), le = at(
516
+ l.map((o, C) => {
517
+ const E = Je.get(o.key), le = lt(
510
518
  o.key,
511
519
  z,
512
- _
513
- ), oe = (G == null ? void 0 : G.rowId) === s && (G == null ? void 0 : G.columnKey) === o.key, de = T && !oe && (g == null ? void 0 : g.rowId) === s && (g == null ? void 0 : g.columnKey) === o.key;
514
- return /* @__PURE__ */ i(
520
+ E
521
+ ), oe = (A == null ? void 0 : A.rowId) === a && (A == null ? void 0 : A.columnKey) === o.key, de = T && !oe && (b == null ? void 0 : b.rowId) === a && (b == null ? void 0 : b.columnKey) === o.key;
522
+ return /* @__PURE__ */ s(
515
523
  d.Cell,
516
524
  {
517
525
  sticky: o.sticky,
518
526
  stickyOffset: o.stickyOffset,
519
527
  style: Ee(o),
520
528
  "data-grid-cell": "",
521
- "data-grid-row-id": s,
529
+ "data-grid-row-id": a,
522
530
  "data-grid-col-key": o.key,
523
531
  "data-grid-source-index": f,
524
532
  className: c(
@@ -529,54 +537,54 @@ const Te = "300px", Pe = (t) => {
529
537
  // border pseudo-element so it doesn't overlap the ring's bottom edge.
530
538
  de && "z-1 outline-hidden ring-2 ring-inset ring-brand after:opacity-0",
531
539
  o.cellClassName,
532
- Kt(le),
533
- u
540
+ er(le),
541
+ y
534
542
  ),
535
543
  children: (() => {
536
- const rt = S === 0 && (n || be) ? /* @__PURE__ */ k("div", { className: "flex items-center", children: [
537
- pe && /* @__PURE__ */ i(
544
+ const nt = C === 0 && (n || be) ? /* @__PURE__ */ S("div", { className: "flex items-center", children: [
545
+ pe && /* @__PURE__ */ s(
538
546
  "div",
539
547
  {
540
548
  className: "flex items-center justify-center",
541
- onClick: (B) => B.stopPropagation(),
542
- onKeyDown: (B) => B.stopPropagation(),
543
- children: /* @__PURE__ */ i(
544
- fr,
549
+ onClick: (q) => q.stopPropagation(),
550
+ onKeyDown: (q) => q.stopPropagation(),
551
+ children: /* @__PURE__ */ s(
552
+ hr,
545
553
  {
546
554
  config: pe,
547
555
  sourceRowIndex: f,
548
556
  item: e,
549
557
  triggerClassName: c(
550
558
  "transition-opacity group-hover/rowactions:opacity-100 focus-visible:opacity-100",
551
- E ? "opacity-100" : "opacity-0"
559
+ _ ? "opacity-100" : "opacity-0"
552
560
  ),
553
- onOpenChange: (B) => Wt(B ? s : null)
561
+ onOpenChange: (q) => Rt(q ? a : null)
554
562
  }
555
563
  )
556
564
  }
557
565
  ),
558
- /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: Le(o.key, e[o.key], e) })
559
- ] }) : Le(o.key, e[o.key], e);
560
- return T ? /* @__PURE__ */ i(
566
+ /* @__PURE__ */ s("div", { className: "flex-1 min-w-0", children: ze(o.key, e[o.key], e) })
567
+ ] }) : ze(o.key, e[o.key], e);
568
+ return T ? /* @__PURE__ */ s(
561
569
  "div",
562
570
  {
563
571
  "data-grid-focus": !0,
564
572
  tabIndex: -1,
565
573
  className: "outline-hidden",
566
- children: rt
574
+ children: nt
567
575
  }
568
- ) : rt;
576
+ ) : nt;
569
577
  })()
570
578
  },
571
579
  o.key
572
580
  );
573
581
  }),
574
- m && v && /* @__PURE__ */ i(
582
+ m && v && /* @__PURE__ */ s(
575
583
  d.Cell,
576
584
  {
577
- className: c("relative w-14 text-center", u),
585
+ className: c("relative w-14 text-center", y),
578
586
  style: { minWidth: "56px", width: "56px" },
579
- children: /* @__PURE__ */ i(
587
+ children: /* @__PURE__ */ s(
580
588
  "button",
581
589
  {
582
590
  type: "button",
@@ -586,30 +594,30 @@ const Te = "300px", Pe = (t) => {
586
594
  onClick: (o) => {
587
595
  o.stopPropagation(), v.onDeleteRow(f);
588
596
  },
589
- children: /* @__PURE__ */ i(hr, { name: "Trash02", className: "size-3" })
597
+ children: /* @__PURE__ */ s(ur, { name: "Trash02", className: "size-3" })
590
598
  }
591
599
  )
592
600
  }
593
601
  )
594
602
  ]
595
603
  },
596
- s
604
+ a
597
605
  );
598
- }, Dt = (e) => /* @__PURE__ */ k(
606
+ }, qt = (e) => /* @__PURE__ */ S(
599
607
  d.Row,
600
608
  {
601
609
  id: String(e.id),
602
610
  isExpandable: !1,
603
- className: c(ze && "[&>td]:after:hidden", De),
611
+ className: c(Ge && "[&>td]:after:hidden", qe),
604
612
  children: [
605
- W && /* @__PURE__ */ i(
613
+ W && /* @__PURE__ */ s(
606
614
  d.Cell,
607
615
  {
608
- className: c("relative w-10", u),
616
+ className: c("relative w-10", y),
609
617
  style: { minWidth: "40px", width: "40px" }
610
618
  }
611
619
  ),
612
- l.map((r) => /* @__PURE__ */ i(
620
+ l.map((r) => /* @__PURE__ */ s(
613
621
  d.Cell,
614
622
  {
615
623
  sticky: r.sticky,
@@ -618,75 +626,75 @@ const Te = "300px", Pe = (t) => {
618
626
  className: c(
619
627
  "overflow-x-hidden text-left",
620
628
  r.cellClassName,
621
- u
629
+ y
622
630
  ),
623
- children: /* @__PURE__ */ i(ur, { height: "14px", width: "75%", className: "rounded" })
631
+ children: /* @__PURE__ */ s(yr, { height: "14px", width: "75%", className: "rounded" })
624
632
  },
625
633
  r.key
626
634
  )),
627
- m && /* @__PURE__ */ i(
635
+ m && /* @__PURE__ */ s(
628
636
  d.Cell,
629
637
  {
630
- className: c("w-14", u),
638
+ className: c("w-14", y),
631
639
  style: { minWidth: "56px", width: "56px" }
632
640
  }
633
641
  )
634
642
  ]
635
643
  },
636
644
  String(e.id)
637
- ), qt = () => P ? ae.map((e) => Dt(e)) : ge && O ? O.flatMap((e) => {
645
+ ), Bt = () => P ? ae.map((e) => qt(e)) : me && L ? L.flatMap((e) => {
638
646
  const r = ne.has(e.key);
639
647
  return [
640
648
  Ut(e),
641
- ...r ? [] : e.rows.map((n) => Ke(n))
649
+ ...r ? [] : e.rows.map((n) => et(n))
642
650
  ];
643
- }) : ae.map((e) => Ke(e)), et = /* @__PURE__ */ i(
651
+ }) : ae.map((e) => et(e)), tt = /* @__PURE__ */ s(
644
652
  Qt.Root,
645
653
  {
646
654
  ref: Gt,
647
- onKeyDownCapture: T ? Ot : void 0,
655
+ onKeyDownCapture: T ? zt : void 0,
648
656
  className: c(
649
657
  "w-full",
650
- !y || Re ? "overflow-x-auto" : "overflow-x-hidden",
651
- Q && "border border-secondary rounded-xl",
658
+ !w || Ie ? "overflow-x-auto" : "overflow-x-hidden",
659
+ H && "border border-secondary rounded-xl",
652
660
  "[&_tr:hover>td]:!bg-secondary_subtle",
653
- ht
661
+ ut
654
662
  ),
655
- size: Oe,
656
- children: /* @__PURE__ */ k(
663
+ size: Ae,
664
+ children: /* @__PURE__ */ S(
657
665
  d,
658
666
  {
659
- "aria-label": dt,
660
- size: Oe,
667
+ "aria-label": ct,
668
+ size: Ae,
661
669
  isEditable: T,
662
670
  inlineSelection: he,
663
- className: c(y && "min-w-full", pt),
664
- style: zt,
665
- ...At,
671
+ className: c(w && "min-w-full", pt),
672
+ style: At,
673
+ ...$t,
666
674
  children: [
667
- /* @__PURE__ */ k(
675
+ /* @__PURE__ */ S(
668
676
  d.Header,
669
677
  {
670
678
  className: c(
671
679
  "sticky top-0",
672
- Q && "[&>tr>th:first-child]:rounded-bl-none [&>tr>th:last-child]:rounded-br-none z-1",
673
- ut
680
+ H && "[&>tr>th:first-child]:rounded-bl-none [&>tr>th:last-child]:rounded-br-none z-1",
681
+ yt
674
682
  ),
675
683
  children: [
676
- W && /* @__PURE__ */ i(
684
+ W && /* @__PURE__ */ s(
677
685
  d.Head,
678
686
  {
679
687
  label: "",
680
688
  allowsSorting: !1,
681
689
  isRowHeader: !1,
682
690
  style: { minWidth: "40px", width: "40px" },
683
- className: c(u),
691
+ className: c(y),
684
692
  headerCellClass: "justify-center",
685
- children: $ === "multiple" && p && /* @__PURE__ */ i("div", { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ i(
686
- nt,
693
+ children: G === "multiple" && p && /* @__PURE__ */ s("div", { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ s(
694
+ it,
687
695
  {
688
- checked: _e ? !0 : jt && !_e ? "indeterminate" : !1,
689
- onCheckedChange: () => Ft(),
696
+ checked: Pe ? !0 : Ft && !Pe ? "indeterminate" : !1,
697
+ onCheckedChange: () => Mt(),
690
698
  "aria-label": "Select all rows",
691
699
  className: "items-center justify-center"
692
700
  }
@@ -695,12 +703,12 @@ const Te = "300px", Pe = (t) => {
695
703
  "selection"
696
704
  ),
697
705
  l.map((e, r) => {
698
- const n = mt ? It.get(e.key) : void 0, s = Be.get(e.key), f = at(
706
+ const n = Nt ? _t.get(e.key) : void 0, a = Je.get(e.key), f = lt(
699
707
  e.key,
700
708
  z,
701
- s
702
- ), N = ft.includes(e.key) || f === "center" ? "justify-center" : f === "right" ? "justify-end" : "";
703
- return /* @__PURE__ */ k(
709
+ a
710
+ ), N = ht.includes(e.key) || f === "center" ? "justify-center" : f === "right" ? "justify-end" : "";
711
+ return /* @__PURE__ */ s(
704
712
  d.Head,
705
713
  {
706
714
  sticky: e.sticky,
@@ -714,78 +722,77 @@ const Te = "300px", Pe = (t) => {
714
722
  className: c(
715
723
  "overflow-hidden",
716
724
  e.headClassName,
717
- u
725
+ y
718
726
  ),
719
- children: [
720
- n && re && /* @__PURE__ */ i(
721
- or,
722
- {
723
- column: n,
724
- columnLabel: n.label ?? (s ? Ht(s, kt) : e.label),
725
- currentAlignment: s ? ot(
726
- s,
727
- z ?? /* @__PURE__ */ new Map()
728
- ) : (z == null ? void 0 : z.get(e.key)) ?? "left",
729
- capabilities: Nt,
730
- hideDisabled: l.length <= 1,
731
- onAction: Lt.get(e.key),
732
- renderExtraItems: Ct
733
- }
734
- ),
735
- (ce == null ? void 0 : ce(e.key)) ?? null
736
- ]
727
+ headerAction: n && re ? /* @__PURE__ */ s(
728
+ dr,
729
+ {
730
+ column: n,
731
+ columnLabel: n.label ?? (a ? Kt(a, Ct) : e.label),
732
+ currentAlignment: a ? dt(
733
+ a,
734
+ z ?? /* @__PURE__ */ new Map()
735
+ ) : (z == null ? void 0 : z.get(e.key)) ?? "left",
736
+ capabilities: kt,
737
+ hideDisabled: l.length <= 1,
738
+ onAction: Lt.get(e.key),
739
+ renderExtraItems: St,
740
+ showOnHeaderHover: !0
741
+ }
742
+ ) : void 0,
743
+ children: (ce == null ? void 0 : ce(e.key)) ?? null
737
744
  },
738
745
  e.key
739
746
  );
740
747
  }),
741
- m && /* @__PURE__ */ i(
748
+ m && /* @__PURE__ */ s(
742
749
  d.Head,
743
750
  {
744
751
  label: "",
745
752
  allowsSorting: !1,
746
753
  isRowHeader: !1,
747
754
  style: { minWidth: "56px", width: "56px" },
748
- className: c(u)
755
+ className: c(y)
749
756
  },
750
757
  "actions"
751
758
  )
752
759
  ]
753
760
  }
754
761
  ),
755
- /* @__PURE__ */ k(d.Body, { children: [
756
- !Qe && qt(),
757
- Pt && /* @__PURE__ */ i(
762
+ /* @__PURE__ */ S(d.Body, { children: [
763
+ !Qe && Bt(),
764
+ Tt && /* @__PURE__ */ s(
758
765
  d.Row,
759
766
  {
760
767
  id: "empty-state",
761
768
  highlightSelectedRow: !1,
762
- children: /* @__PURE__ */ i(
769
+ children: /* @__PURE__ */ s(
763
770
  d.Cell,
764
771
  {
765
772
  colSpan: D,
766
773
  className: c(
767
774
  "text-left text-placeholder_subtle border-b border-secondary py-3",
768
- u
775
+ y
769
776
  ),
770
- children: Me
777
+ children: De
771
778
  }
772
779
  )
773
780
  },
774
781
  "empty-state"
775
782
  ),
776
- Ce && v && /* @__PURE__ */ k(
783
+ Se && v && /* @__PURE__ */ S(
777
784
  d.Row,
778
785
  {
779
786
  id: "add-row-footer",
780
787
  highlightSelectedRow: !1,
781
788
  children: [
782
- /* @__PURE__ */ i(
789
+ /* @__PURE__ */ s(
783
790
  d.Cell,
784
791
  {
785
792
  colSpan: D - (m ? 1 : 0),
786
- className: c(u),
787
- children: /* @__PURE__ */ i(
788
- dr,
793
+ className: c(y),
794
+ children: /* @__PURE__ */ s(
795
+ cr,
789
796
  {
790
797
  color: "tertiary",
791
798
  className: "bg-secondary text-primary",
@@ -796,10 +803,10 @@ const Te = "300px", Pe = (t) => {
796
803
  )
797
804
  }
798
805
  ),
799
- m && /* @__PURE__ */ i(
806
+ m && /* @__PURE__ */ s(
800
807
  d.Cell,
801
808
  {
802
- className: c("w-14", u),
809
+ className: c("w-14", y),
803
810
  style: { minWidth: "56px", width: "56px" }
804
811
  }
805
812
  )
@@ -807,13 +814,13 @@ const Te = "300px", Pe = (t) => {
807
814
  },
808
815
  "add-row-footer"
809
816
  ),
810
- Tt && ye && /* @__PURE__ */ i(
811
- cr,
817
+ Ot && we && /* @__PURE__ */ s(
818
+ fr,
812
819
  {
813
- ...ye,
820
+ ...we,
814
821
  hasActionsColumn: m,
815
822
  hasSelectionColumn: W,
816
- showBorders: !!Q
823
+ showBorders: !!H
817
824
  }
818
825
  )
819
826
  ] })
@@ -821,21 +828,21 @@ const Te = "300px", Pe = (t) => {
821
828
  }
822
829
  )
823
830
  }
824
- ), tt = T ? /* @__PURE__ */ i(
825
- sr,
831
+ ), rt = T ? /* @__PURE__ */ s(
832
+ ar,
826
833
  {
827
- rowIds: b,
834
+ rowIds: g,
828
835
  columnKeys: se,
829
836
  containerRef: R,
830
- onSelectCell: Se,
831
- onEditingCellChange: Rt,
832
- children: et
837
+ onSelectCell: ve,
838
+ onEditingCellChange: It,
839
+ children: tt
833
840
  }
834
- ) : et;
835
- return _t ? /* @__PURE__ */ k("div", { className: "flex flex-col gap-3", children: [
836
- Xe && Ve,
837
- tt,
838
- Ye && x && /* @__PURE__ */ i(
841
+ ) : tt;
842
+ return Pt ? /* @__PURE__ */ S("div", { className: "flex flex-col gap-3", children: [
843
+ Ye && Xe,
844
+ rt,
845
+ He && x && /* @__PURE__ */ s(
839
846
  Zt,
840
847
  {
841
848
  currentPage: x.currentPage,
@@ -847,9 +854,9 @@ const Te = "300px", Pe = (t) => {
847
854
  showPagination: x.showPagination
848
855
  }
849
856
  )
850
- ] }) : tt;
857
+ ] }) : rt;
851
858
  }
852
859
  );
853
860
  export {
854
- Mr as TableWrapper
861
+ Dr as TableWrapper
855
862
  };