@dmsi/wedgekit-react 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,175 +1,175 @@
1
1
  "use client";
2
- import { jsx as n, jsxs as d, Fragment as $t } from "react/jsx-runtime";
3
- import Pt, { useImperativeHandle as Lt, useState as g, useCallback as V, useEffect as ae, useRef as de, useId as kt, useLayoutEffect as Dt } from "react";
4
- import { useInfiniteScroll as Et } from "../../hooks/useInfiniteScroll.js";
5
- import { useTableLayout as Mt } from "../../hooks/useTableLayout/useTableLayout.js";
6
- import { componentGap as Me, componentPadding as Te } from "../../classNames.js";
7
- import { Button as je } from "../Button.js";
8
- import { Checkbox as Tt } from "../Checkbox.js";
9
- import { DraggableCellHeader as jt, DataGridCell as Wt } from "../DataGridCell.js";
10
- import { Icon as We } from "../Icon.js";
11
- import { Label as _t } from "../Label.js";
12
- import { Menu as At } from "../Menu.js";
13
- import { MenuOption as Ft } from "../MenuOption.js";
14
- import { Paragraph as w } from "../Paragraph.js";
15
- import { Select as Gt } from "../Select.js";
16
- import { Subheader as $ } from "../Subheader.js";
17
- import { useReactTable as Ot, flexRender as Ht } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
18
- import { useSensors as Vt, useSensor as me, DndContext as qt, closestCenter as Kt, KeyboardSensor as Zt, TouchSensor as Bt, MouseSensor as Jt } from "../../node_modules/@dnd-kit/core/dist/core.esm.js";
19
- import { SortableContext as Qt, horizontalListSortingStrategy as Xt, arrayMove as Yt } from "../../node_modules/@dnd-kit/sortable/dist/sortable.esm.js";
20
- import { restrictToHorizontalAxis as Ut } from "../../node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js";
21
- import { Notification as eo } from "../Notification.js";
22
- import { useVirtualizer as to } from "../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
2
+ import { jsx as n, jsxs as a, Fragment as Lt } from "react/jsx-runtime";
3
+ import kt, { useImperativeHandle as Dt, useState as h, useCallback as $, useEffect as K, useRef as Z, useId as Tt, useLayoutEffect as Et } from "react";
4
+ import { useInfiniteScroll as Mt } from "../../hooks/useInfiniteScroll.js";
5
+ import { useTableLayout as Wt } from "../../hooks/useTableLayout/useTableLayout.js";
6
+ import { componentGap as We, componentPadding as je } from "../../classNames.js";
7
+ import { Button as Fe } from "../Button.js";
8
+ import { Checkbox as jt } from "../Checkbox.js";
9
+ import { DraggableCellHeader as Ft, DataGridCell as _t } from "../DataGridCell.js";
10
+ import { Icon as _e } from "../Icon.js";
11
+ import { Label as At } from "../Label.js";
12
+ import { Menu as Gt } from "../Menu.js";
13
+ import { MenuOption as Ot } from "../MenuOption.js";
14
+ import { Paragraph as x } from "../Paragraph.js";
15
+ import { Select as Ht } from "../Select.js";
16
+ import { Subheader as P } from "../Subheader.js";
17
+ import { useReactTable as Vt, flexRender as qt } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
18
+ import { useSensors as Kt, useSensor as fe, DndContext as Zt, closestCenter as Bt, KeyboardSensor as Jt, TouchSensor as Qt, MouseSensor as Xt } from "../../node_modules/@dnd-kit/core/dist/core.esm.js";
19
+ import { SortableContext as Yt, horizontalListSortingStrategy as Ut, arrayMove as eo } from "../../node_modules/@dnd-kit/sortable/dist/sortable.esm.js";
20
+ import { restrictToHorizontalAxis as to } from "../../node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js";
21
+ import { Notification as oo } from "../Notification.js";
22
+ import { useVirtualizer as no } from "../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
23
23
  import { clsx as v } from "../../node_modules/clsx/dist/clsx.js";
24
- import { PinnedColumns as _e } from "./PinnedColumns.js";
25
- import { getSortIcon as Ae } from "./utils.js";
26
- import { TableBody as oo } from "./TableBody/index.js";
27
- import { SummaryRow as no } from "./SummaryRow/index.js";
28
- import { Spinner as ue } from "../Spinner.js";
29
- import { Tooltip as Fe } from "../Tooltip.js";
30
- import Ge from "../../static/no-results-image.png.js";
31
- import { getExpandedRowModel as ro, getGroupedRowModel as lo, getFilteredRowModel as so, getSortedRowModel as io, getCoreRowModel as co } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
32
- const ao = [5, 10, 15, 20, 25, 30, 35], Oe = "h-[185px]";
33
- function Go({
24
+ import { PinnedColumns as Ae } from "./PinnedColumns.js";
25
+ import { getSortIcon as Ge } from "./utils.js";
26
+ import { TableBody as ro } from "./TableBody/index.js";
27
+ import { SummaryRow as lo } from "./SummaryRow/index.js";
28
+ import { Spinner as he } from "../Spinner.js";
29
+ import { Tooltip as Oe } from "../Tooltip.js";
30
+ import He from "../../static/no-results-image.png.js";
31
+ import { getExpandedRowModel as so, getGroupedRowModel as io, getFilteredRowModel as co, getSortedRowModel as ao, getCoreRowModel as mo } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
32
+ const uo = [5, 10, 15, 20, 25, 30, 35], Ve = "h-[185px]";
33
+ function Ho({
34
34
  id: s,
35
35
  rowIdAccessor: b,
36
36
  testid: l,
37
- data: L,
38
- columns: He,
39
- status: k,
40
- isLoadingMore: D = !1,
41
- onLoadMore: Ve,
37
+ data: k,
38
+ columns: qe,
39
+ status: D,
40
+ isLoadingMore: T = !1,
41
+ onLoadMore: Ke,
42
42
  pagination: r,
43
- showFilterRow: q = !1,
44
- hasMore: K = !1,
45
- sorting: fe,
46
- onSortingChange: qe,
47
- columnFilters: ge,
48
- onColumnFiltersChange: Ke,
49
- rowSelection: Z,
43
+ showFilterRow: B = !1,
44
+ hasMore: J = !1,
45
+ sorting: ge,
46
+ onSortingChange: Ze,
47
+ columnFilters: pe,
48
+ onColumnFiltersChange: Be,
49
+ rowSelection: Q,
50
50
  onRowSelectionChange: E,
51
- filteredSortedData: he,
51
+ filteredSortedData: Se,
52
52
  totalRowCount: M,
53
- hideStatusBar: Ze,
54
- centerHeader: Be,
55
- enableColumnSelector: pe,
56
- predeterminedLeftPins: Je = [],
57
- predeterminedRightPins: Qe = [],
58
- useMenuDefaultMinWidth: Xe,
59
- rowDisabled: Ye,
60
- rowDisabledAccessor: Ue,
61
- isLoading: h = !1,
62
- loadingMessage: et = "Loading Results",
63
- loadingDescription: Se,
64
- maxHeight: T,
53
+ hideStatusBar: Je,
54
+ centerHeader: Qe,
55
+ enableColumnSelector: ve,
56
+ predeterminedLeftPins: Xe = [],
57
+ predeterminedRightPins: Ye = [],
58
+ useMenuDefaultMinWidth: Ue,
59
+ rowDisabled: et,
60
+ rowDisabledAccessor: tt,
61
+ isLoading: g = !1,
62
+ loadingMessage: ot = "Loading Results",
63
+ loadingDescription: be,
64
+ maxHeight: W,
65
65
  fillHeight: y = !1,
66
- manualFiltering: B = !1,
67
- notifications: J,
68
- summaryRow: ve,
66
+ manualFiltering: X = !1,
67
+ notifications: Y,
68
+ summaryRow: we,
69
69
  groupBy: j,
70
- groupRowMode: Q = "spanning",
71
- groupDefaultExpand: be = "none",
72
- allowUserGrouping: X,
73
- groupSelectionMode: Y = "row",
74
- hideGroupedColumns: tt,
70
+ groupRowMode: U = "spanning",
71
+ groupDefaultExpand: Ce = "none",
72
+ allowUserGrouping: ee,
73
+ groupSelectionMode: te = "row",
74
+ hideGroupedColumns: nt,
75
75
  grouping: R,
76
- onGroupingChange: ot,
77
- expanded: W,
78
- onExpandedChange: nt,
79
- ref: rt
76
+ onGroupingChange: rt,
77
+ expanded: F,
78
+ onExpandedChange: lt,
79
+ ref: st
80
80
  }) {
81
- Lt(rt, () => ({
82
- getSavedLayout: () => st()
81
+ Dt(st, () => ({
82
+ getSavedLayout: () => ct()
83
83
  }));
84
- const [xe, Ce] = g([]), [we, ye] = g([]), [lt, Re] = g({}), [U, ee] = g(null), {
85
- columns: x,
86
- setColumns: te,
87
- getSavedLayout: st,
88
- resetToDefaults: ze
89
- } = Mt(He, s ?? l), [Ie, oe] = g(
90
- x.map((e) => e.id)
91
- ), [Ne, it] = g(
84
+ const [xe, ye] = h([]), [Re, ze] = h([]), [it, Ie] = h({}), [oe, ne] = h(null), {
85
+ columns: w,
86
+ setColumns: re,
87
+ getSavedLayout: ct,
88
+ resetToDefaults: Ne
89
+ } = Wt(qe, s ?? l), [$e, le] = h(
90
+ w.map((e) => e.id)
91
+ ), [Pe, dt] = h(
92
92
  Object.fromEntries(
93
- x.filter((e) => !!e.id).map((e) => [e.id, e.meta?.visible ?? !0])
93
+ w.filter((e) => !!e.id).map((e) => [e.id, e.meta?.visible ?? !0])
94
94
  )
95
- ), $e = V(
95
+ ), Le = $(
96
96
  (e) => {
97
- it(
97
+ dt(
98
98
  Object.fromEntries(
99
- x.filter((o) => !!o.id).map((o) => [o.id, o.meta?.visible ?? !0])
99
+ w.filter((o) => !!o.id).map((o) => [o.id, o.meta?.visible ?? !0])
100
100
  )
101
- ), e && oe(x.map((o) => o.id));
101
+ ), e && le(w.map((o) => o.id));
102
102
  },
103
- [x]
104
- ), ct = V(() => {
105
- ze();
106
- }, [ze]);
107
- ae(() => {
108
- $e(!0);
109
- }, [$e]);
110
- const at = r ? fe ?? xe : xe, dt = r ? (e) => {
103
+ [w]
104
+ ), at = $(() => {
105
+ Ne();
106
+ }, [Ne]);
107
+ K(() => {
108
+ Le(!0);
109
+ }, [Le]);
110
+ const mt = r ? ge ?? xe : xe, ut = r ? (e) => {
111
111
  const o = typeof e == "function" ? e(
112
- fe ?? []
112
+ ge ?? []
113
113
  ) : e;
114
- (qe ?? Ce)(o);
115
- } : Ce, Pe = r != null || B, mt = Pe ? ge ?? we : we, ut = Pe ? (e) => {
116
- const o = typeof e == "function" ? e(ge ?? []) : e;
117
- (Ke ?? ye)(o);
118
- } : ye, z = Z ?? lt, I = de(z);
114
+ (Ze ?? ye)(o);
115
+ } : ye, ke = r != null || X, ft = ke ? pe ?? Re : Re, ht = ke ? (e) => {
116
+ const o = typeof e == "function" ? e(pe ?? []) : e;
117
+ (Be ?? ze)(o);
118
+ } : ze, z = Q ?? it, I = Z(z);
119
119
  I.current = z;
120
- const Le = V(
120
+ const De = $(
121
121
  (e) => {
122
122
  if (r) {
123
123
  const o = typeof e == "function" ? e(I.current) : e;
124
- I.current = o, (E ?? Re)(o);
125
- } else if (Z && E) {
124
+ I.current = o, (E ?? Ie)(o);
125
+ } else if (Q && E) {
126
126
  const o = typeof e == "function" ? e(I.current) : e;
127
127
  I.current = o, E(o);
128
128
  } else
129
- Re(e);
129
+ Ie(e);
130
130
  },
131
- [Z, E, r]
132
- ), [ft, ke] = g(
131
+ [Q, E, r]
132
+ ), [gt, Te] = h(
133
133
  j ?? []
134
134
  );
135
- ae(() => {
136
- R === void 0 && j !== void 0 && ke(j);
135
+ K(() => {
136
+ R === void 0 && j !== void 0 && Te(j);
137
137
  }, [j, R]);
138
- const ne = R ?? ft, gt = R !== void 0 ? (e) => {
138
+ const se = R ?? gt, pt = R !== void 0 ? (e) => {
139
139
  const o = typeof e == "function" ? e(
140
140
  R
141
141
  ) : e;
142
- ot?.(o);
143
- } : ke, [ht, De] = g(
144
- () => be === "all" ? !0 : {}
145
- ), pt = W ?? ht, St = W !== void 0 ? (e) => {
142
+ rt?.(o);
143
+ } : Te, [St, Ee] = h(
144
+ () => Ce === "all" ? !0 : {}
145
+ ), vt = F ?? St, bt = F !== void 0 ? (e) => {
146
146
  const o = typeof e == "function" ? e(
147
- W
147
+ F
148
148
  ) : e;
149
- nt?.(o);
150
- } : De, vt = tt ? {
151
- ...Ne,
152
- ...Object.fromEntries(ne.map((e) => [e, !1]))
153
- } : Ne, bt = kt(), f = de(null), Ee = de(null), xt = V(
149
+ lt?.(o);
150
+ } : Ee, wt = nt ? {
151
+ ...Pe,
152
+ ...Object.fromEntries(se.map((e) => [e, !1]))
153
+ } : Pe, Ct = Tt(), f = Z(null), Me = Z(null), ie = Z(null), xt = $(
154
154
  (e, o) => {
155
- te((t) => t.map((a) => a.id === e ? {
156
- ...a,
155
+ re((t) => t.map((d) => d.id === e ? {
156
+ ...d,
157
157
  meta: {
158
- ...a.meta,
158
+ ...d.meta,
159
159
  visible: o
160
160
  }
161
- } : a));
161
+ } : d));
162
162
  },
163
- [te]
164
- ), i = Ot({
165
- columns: x,
166
- data: L,
163
+ [re]
164
+ ), i = Vt({
165
+ columns: w,
166
+ data: k,
167
167
  defaultColumn: { minSize: 50 },
168
- getCoreRowModel: co(),
169
- getSortedRowModel: io(),
170
- getFilteredRowModel: B ? void 0 : so(),
171
- getGroupedRowModel: lo(),
172
- getExpandedRowModel: ro(),
168
+ getCoreRowModel: mo(),
169
+ getSortedRowModel: ao(),
170
+ getFilteredRowModel: X ? void 0 : co(),
171
+ getGroupedRowModel: io(),
172
+ getExpandedRowModel: so(),
173
173
  // Grouping only ever happens client-side in this grid — there is no
174
174
  // server-side/manual grouping mode, unlike filtering.
175
175
  groupedColumnMode: !1,
@@ -182,31 +182,31 @@ function Go({
182
182
  // internal state update on every grouping change.
183
183
  autoResetPageIndex: !1,
184
184
  autoResetExpanded: !1,
185
- manualFiltering: B,
185
+ manualFiltering: X,
186
186
  columnResizeMode: "onChange",
187
187
  getRowId: b ? (e) => String(e[b]) : (e, o) => String(e.id ?? o + 1),
188
188
  state: {
189
- columnOrder: Ie,
190
- sorting: at,
191
- columnFilters: mt,
189
+ columnOrder: $e,
190
+ sorting: mt,
191
+ columnFilters: ft,
192
192
  rowSelection: z,
193
- columnVisibility: vt,
194
- grouping: ne,
195
- expanded: pt
193
+ columnVisibility: wt,
194
+ grouping: se,
195
+ expanded: vt
196
196
  },
197
197
  initialState: {
198
198
  columnPinning: {
199
- left: Je,
200
- right: Qe
199
+ left: Xe,
200
+ right: Ye
201
201
  }
202
202
  },
203
203
  enableColumnPinning: !0,
204
- onColumnOrderChange: oe,
205
- onSortingChange: P(dt),
206
- onColumnFiltersChange: P(ut),
207
- onRowSelectionChange: P(Le),
208
- onGroupingChange: P(gt),
209
- onExpandedChange: P(St),
204
+ onColumnOrderChange: le,
205
+ onSortingChange: L(ut),
206
+ onColumnFiltersChange: L(ht),
207
+ onRowSelectionChange: L(De),
208
+ onGroupingChange: L(pt),
209
+ onExpandedChange: L(bt),
210
210
  filterFns: {
211
211
  startsWith: (e, o, t) => {
212
212
  const c = e?.getValue(o);
@@ -218,23 +218,23 @@ function Go({
218
218
  }
219
219
  }
220
220
  });
221
- ae(() => {
222
- if (be !== "first" || W !== void 0)
221
+ K(() => {
222
+ if (Ce !== "first" || F !== void 0)
223
223
  return;
224
224
  const e = {};
225
225
  let o = i.getGroupedRowModel().rows.find((t) => t.depth === 0 && t.getIsGrouped());
226
226
  for (; o; )
227
227
  e[o.id] = !0, o = o.subRows.find((t) => t.getIsGrouped());
228
- Object.keys(e).length > 0 && De(e);
229
- }, [ne]);
230
- const _ = r ? he?.map((e) => String(e.id)) ?? [] : Array.from(
231
- { length: M ?? L.length },
228
+ Object.keys(e).length > 0 && Ee(e);
229
+ }, [se]);
230
+ const _ = r ? Se?.map((e) => String(e.id)) ?? [] : Array.from(
231
+ { length: M ?? k.length },
232
232
  (e, o) => String(o + 1)
233
- ), re = _.every(
233
+ ), ce = _.every(
234
234
  (e) => z[e]
235
- ), Ct = !re && _.some((e) => z[e]), wt = () => {
236
- Le((e) => {
237
- if (!re) {
235
+ ), yt = !ce && _.some((e) => z[e]), Rt = () => {
236
+ De((e) => {
237
+ if (!ce) {
238
238
  const t = {};
239
239
  for (const c of _)
240
240
  t[c] = !0;
@@ -247,64 +247,77 @@ function Go({
247
247
  }
248
248
  });
249
249
  };
250
- Et({
250
+ Mt({
251
251
  containerRef: f,
252
- onLoadMore: Ve ?? (() => {
252
+ onLoadMore: Ke ?? (() => {
253
253
  }),
254
- isLoading: D,
254
+ isLoading: T,
255
255
  enabled: !r
256
256
  });
257
- const le = i.getCenterVisibleLeafColumns().map((e) => e.id).join(",");
258
- Dt(() => {
259
- if (!f.current || Ee.current === le) return;
257
+ const de = i.getCenterVisibleLeafColumns().map((e) => e.id).join(","), A = $(() => {
258
+ if (!f.current) return null;
260
259
  const e = f.current.offsetWidth;
261
- if (e === 0) return;
262
- const o = i.getLeftLeafColumns().reduce((u, S) => u + S.getSize(), 0), t = i.getRightLeafColumns().reduce((u, S) => u + S.getSize(), 0), c = e - o - t, a = i.getCenterVisibleLeafColumns();
263
- if (a.length === 0) return;
264
- const m = a.reduce(
260
+ if (e === 0) return null;
261
+ const o = i.getLeftLeafColumns().reduce((u, S) => u + S.getSize(), 0), t = i.getRightLeafColumns().reduce((u, S) => u + S.getSize(), 0), c = e - o - t, d = i.getCenterVisibleLeafColumns();
262
+ if (d.length === 0) return null;
263
+ const m = d.reduce(
265
264
  (u, S) => u + S.getSize(),
266
265
  0
267
- ), O = m > 0 ? c / m : 1, H = {};
268
- a.forEach((u) => {
269
- H[u.id] = Math.max(Math.floor(u.getSize() * O), 50);
270
- }), i.setColumnSizing((u) => ({ ...u, ...H })), Ee.current = le;
271
- }, [le, i]);
272
- const yt = (e) => {
266
+ ), V = m > 0 ? c / m : 1, q = {};
267
+ return d.forEach((u) => {
268
+ q[u.id] = Math.max(Math.floor(u.getSize() * V), 50);
269
+ }), i.setColumnSizing((u) => ({ ...u, ...q })), e;
270
+ }, [i]);
271
+ Et(() => {
272
+ if (!f.current || Me.current === de) return;
273
+ const e = A();
274
+ e !== null && (Me.current = de, ie.current = e);
275
+ }, [de, A]), K(() => {
276
+ const e = f.current;
277
+ if (!e) return;
278
+ const o = new ResizeObserver(() => {
279
+ if (e.offsetWidth === ie.current) return;
280
+ const t = A();
281
+ t !== null && (ie.current = t);
282
+ });
283
+ return o.observe(e), () => o.disconnect();
284
+ }, [A]);
285
+ const zt = (e) => {
273
286
  const { active: o, over: t } = e;
274
- o && t && o.id !== t.id && oe((c) => {
275
- const a = c.indexOf(o.id), m = c.indexOf(t.id), O = Yt(c, a, m);
276
- return te((H) => O.map((S) => H.find((Nt) => Nt.id === S)).filter(Boolean)), O;
287
+ o && t && o.id !== t.id && le((c) => {
288
+ const d = c.indexOf(o.id), m = c.indexOf(t.id), V = eo(c, d, m);
289
+ return re((q) => V.map((S) => q.find((Pt) => Pt.id === S)).filter(Boolean)), V;
277
290
  });
278
- }, Rt = Vt(
279
- me(Jt),
280
- me(Bt),
281
- me(Zt)
282
- ), se = i.getCenterLeafColumns(), zt = se.map((e) => e.id), It = Ie.filter(
283
- (e) => zt.includes(e)
284
- ), A = to({
285
- count: se.length,
286
- estimateSize: (e) => se[e].getSize(),
291
+ }, It = Kt(
292
+ fe(Xt),
293
+ fe(Qt),
294
+ fe(Jt)
295
+ ), ae = i.getCenterLeafColumns(), Nt = ae.map((e) => e.id), $t = $e.filter(
296
+ (e) => Nt.includes(e)
297
+ ), G = no({
298
+ count: ae.length,
299
+ estimateSize: (e) => ae[e].getSize(),
287
300
  getScrollElement: () => f.current,
288
301
  horizontal: !0,
289
302
  overscan: 8
290
- }), p = A.getVirtualItems();
291
- let F, N;
292
- A && p?.length && (F = p[0]?.start ?? 0, N = A.getTotalSize() - (p[p.length - 1]?.end ?? 0));
293
- const G = i.getRowModel().rows.length === 0, C = ve && !G ? ve : void 0, ie = C ? i.getFilteredRowModel().rows.map((e) => e.original) : [], ce = C ? r ? he ?? L : L : [];
303
+ }), p = G.getVirtualItems();
304
+ let O, N;
305
+ G && p?.length && (O = p[0]?.start ?? 0, N = G.getTotalSize() - (p[p.length - 1]?.end ?? 0));
306
+ const H = i.getRowModel().rows.length === 0, C = we && !H ? we : void 0, me = C ? i.getFilteredRowModel().rows.map((e) => e.original) : [], ue = C ? r ? Se ?? k : k : [];
294
307
  return /* @__PURE__ */ n(
295
- qt,
308
+ Zt,
296
309
  {
297
- id: bt,
298
- collisionDetection: Kt,
299
- modifiers: [Ut],
300
- onDragEnd: yt,
301
- sensors: Rt,
310
+ id: Ct,
311
+ collisionDetection: Bt,
312
+ modifiers: [to],
313
+ onDragEnd: zt,
314
+ sensors: It,
302
315
  children: /* @__PURE__ */ n(
303
- Qt,
316
+ Yt,
304
317
  {
305
- items: It,
306
- strategy: Xt,
307
- children: /* @__PURE__ */ d(
318
+ items: $t,
319
+ strategy: Ut,
320
+ children: /* @__PURE__ */ a(
308
321
  "div",
309
322
  {
310
323
  className: v(
@@ -312,8 +325,8 @@ function Go({
312
325
  y ? "grow min-h-0" : "grow-0 h-fit"
313
326
  ),
314
327
  children: [
315
- J && J.length > 0 && /* @__PURE__ */ n("div", { className: "flex flex-col gap-2 shrink-0 [color:initial]", children: J.map((e, o) => /* @__PURE__ */ n(eo, { ...e }, e.id ?? o)) }),
316
- /* @__PURE__ */ d(
328
+ Y && Y.length > 0 && /* @__PURE__ */ n("div", { className: "flex flex-col gap-2 shrink-0 [color:initial]", children: Y.map((e, o) => /* @__PURE__ */ n(oo, { ...e }, e.id ?? o)) }),
329
+ /* @__PURE__ */ a(
317
330
  "div",
318
331
  {
319
332
  id: s,
@@ -323,55 +336,55 @@ function Go({
323
336
  y ? "flex-1 min-h-0" : "grow-0 h-fit"
324
337
  ),
325
338
  children: [
326
- /* @__PURE__ */ d(
339
+ /* @__PURE__ */ a(
327
340
  "div",
328
341
  {
329
342
  className: v(
330
343
  "flex overflow-auto scrollbar-thin relative contain-paint will-change-transform",
331
- G ? "overflow-y-hidden" : !y && "min-h-[120px]",
344
+ H ? "overflow-y-hidden" : !y && "min-h-[120px]",
332
345
  y && "flex-1 min-h-0"
333
346
  ),
334
- style: T !== void 0 ? { maxHeight: typeof T == "number" ? `${T}px` : T } : void 0,
347
+ style: W !== void 0 ? { maxHeight: typeof W == "number" ? `${W}px` : W } : void 0,
335
348
  ref: f,
336
- inert: h || void 0,
337
- "aria-busy": h || void 0,
349
+ inert: g || void 0,
350
+ "aria-busy": g || void 0,
338
351
  children: [
339
352
  /* @__PURE__ */ n(
340
- _e,
353
+ Ae,
341
354
  {
342
355
  testid: l,
343
356
  pinDirection: "left",
344
357
  table: i,
345
358
  tableContainerRef: f,
346
359
  pagination: r,
347
- isLoadingMore: D,
348
- hasMore: K,
349
- showFilterRow: q,
350
- groupRowMode: Q,
351
- groupSelectionMode: Y,
352
- allowUserGrouping: X,
353
- hoveredRowId: U,
354
- setHoveredRowId: ee,
360
+ isLoadingMore: T,
361
+ hasMore: J,
362
+ showFilterRow: B,
363
+ groupRowMode: U,
364
+ groupSelectionMode: te,
365
+ allowUserGrouping: ee,
366
+ hoveredRowId: oe,
367
+ setHoveredRowId: ne,
355
368
  summaryRow: C,
356
- filteredRows: ie,
357
- allRows: ce,
369
+ filteredRows: me,
370
+ allRows: ue,
358
371
  totalRowCount: M
359
372
  }
360
373
  ),
361
- /* @__PURE__ */ d("table", { className: "flex-1 flex flex-col min-h-min", children: [
362
- /* @__PURE__ */ n("thead", { className: "sticky top-0 z-10 grid", children: i.getCenterHeaderGroups().map((e) => /* @__PURE__ */ d(
374
+ /* @__PURE__ */ a("table", { className: "flex-1 flex flex-col min-h-min", children: [
375
+ /* @__PURE__ */ n("thead", { className: "sticky top-0 z-10 grid", children: i.getCenterHeaderGroups().map((e) => /* @__PURE__ */ a(
363
376
  "tr",
364
377
  {
365
378
  "data-testid": l ? `${l}-header-row-${e.id}` : void 0,
366
379
  className: "flex w-full bg-background-primary-normal",
367
380
  "data-theme": "brand",
368
381
  children: [
369
- F ? (
382
+ O ? (
370
383
  // fake empty column to the left for virtualization scroll padding
371
384
  /* @__PURE__ */ n(
372
385
  "th",
373
386
  {
374
- style: { display: "flex", width: F }
387
+ style: { display: "flex", width: O }
375
388
  }
376
389
  )
377
390
  ) : null,
@@ -379,50 +392,50 @@ function Go({
379
392
  const t = e.headers[o.index];
380
393
  if (t) {
381
394
  if (typeof t.column.columnDef.header == "string") {
382
- const c = i.getRowModel().rows[0]?.getValue(t.column.id), a = t.column.columnDef.meta?.align ?? (typeof c == "number" ? "right" : "left");
383
- return /* @__PURE__ */ d(
384
- jt,
395
+ const c = i.getRowModel().rows[0]?.getValue(t.column.id), d = t.column.columnDef.meta?.align ?? (typeof c == "number" ? "right" : "left");
396
+ return /* @__PURE__ */ a(
397
+ Ft,
385
398
  {
386
399
  width: `${t.column.getSize()}px`,
387
400
  id: s ? `${s}-header-${t.id}` : void 0,
388
401
  testid: l ? `${l}-header-${t.id}` : void 0,
389
402
  header: t,
390
403
  locked: t.column.columnDef.meta?.locked,
391
- center: Be,
392
- allowUserGrouping: X,
404
+ center: Qe,
405
+ allowUserGrouping: ee,
393
406
  isLast: !N && o.index === p[p.length - 1]?.index,
394
407
  className: v(
395
408
  t.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
396
409
  "group",
397
410
  {
398
- "justify-start": a === "left",
399
- "justify-end": a === "right"
411
+ "justify-start": d === "left",
412
+ "justify-end": d === "right"
400
413
  }
401
414
  ),
402
- useMenuDefaultMinWidth: Xe,
415
+ useMenuDefaultMinWidth: Ue,
403
416
  children: [
404
- a === "left" && /* @__PURE__ */ n(
405
- Fe,
417
+ d === "left" && /* @__PURE__ */ n(
418
+ Oe,
406
419
  {
407
420
  showOnTruncation: !0,
408
421
  message: t.column.columnDef.header,
409
422
  position: "bottom",
410
- children: /* @__PURE__ */ n($, { as: "p", addOverflow: !0, tall: !0, children: t.column.columnDef.header })
423
+ children: /* @__PURE__ */ n(P, { as: "p", addOverflow: !0, tall: !0, children: t.column.columnDef.header })
411
424
  }
412
425
  ),
413
- Ae(t.column.getIsSorted()),
414
- !t.column.getIsSorted() && t.column.getCanSort() && !i.getState().columnSizingInfo.isResizingColumn && Ae(
426
+ Ge(t.column.getIsSorted()),
427
+ !t.column.getIsSorted() && t.column.getCanSort() && !i.getState().columnSizingInfo.isResizingColumn && Ge(
415
428
  t.column.getNextSortingOrder(),
416
429
  !0
417
430
  ),
418
- t.column.getSortIndex() !== -1 && i.getState().sorting.length > 1 && /* @__PURE__ */ n($, { tall: !0, children: t.column.getSortIndex() + 1 }),
419
- a === "right" && /* @__PURE__ */ n(
420
- Fe,
431
+ t.column.getSortIndex() !== -1 && i.getState().sorting.length > 1 && /* @__PURE__ */ n(P, { tall: !0, children: t.column.getSortIndex() + 1 }),
432
+ d === "right" && /* @__PURE__ */ n(
433
+ Oe,
421
434
  {
422
435
  showOnTruncation: !0,
423
436
  message: t.column.columnDef.header,
424
437
  position: "bottom",
425
- children: /* @__PURE__ */ n($, { as: "p", addOverflow: !0, tall: !0, children: t.column.columnDef.header })
438
+ children: /* @__PURE__ */ n(P, { as: "p", addOverflow: !0, tall: !0, children: t.column.columnDef.header })
426
439
  }
427
440
  ),
428
441
  /* @__PURE__ */ n(
@@ -446,25 +459,25 @@ function Go({
446
459
  t.id
447
460
  );
448
461
  }
449
- return /* @__PURE__ */ n(Pt.Fragment, { children: t.column.columnDef.meta?.checkbox ? /* @__PURE__ */ n(
450
- Wt,
462
+ return /* @__PURE__ */ n(kt.Fragment, { children: t.column.columnDef.meta?.checkbox ? /* @__PURE__ */ n(
463
+ _t,
451
464
  {
452
465
  id: s ? `${s}-header-${t.id}` : void 0,
453
466
  testid: l ? `${l}-header-${t.id}` : void 0,
454
467
  type: "header",
455
468
  component: "checkbox",
456
469
  children: /* @__PURE__ */ n(
457
- Tt,
470
+ jt,
458
471
  {
459
472
  id: s ? `${s}-select-all-checkbox` : void 0,
460
473
  testid: l ? `${l}-select-all-checkbox` : void 0,
461
- checked: re,
462
- indeterminate: Ct,
463
- onChange: wt
474
+ checked: ce,
475
+ indeterminate: yt,
476
+ onChange: Rt
464
477
  }
465
478
  )
466
479
  }
467
- ) : Ht(
480
+ ) : qt(
468
481
  t.column.columnDef.header,
469
482
  t.getContext()
470
483
  ) }, t.id);
@@ -484,121 +497,121 @@ function Go({
484
497
  e.id
485
498
  )) }),
486
499
  /* @__PURE__ */ n(
487
- oo,
500
+ ro,
488
501
  {
489
502
  id: s,
490
503
  testid: l,
491
- columnVirtualizer: A,
504
+ columnVirtualizer: G,
492
505
  table: i,
493
506
  tableContainerRef: f,
494
- virtualPaddingLeft: F,
507
+ virtualPaddingLeft: O,
495
508
  virtualPaddingRight: N,
496
509
  pagination: r,
497
- isLoadingMore: D,
498
- hasMore: K,
499
- showFilterRow: q,
500
- enableColumnSelector: pe,
501
- groupRowMode: Q,
502
- groupSelectionMode: Y,
503
- rowDisabled: Ye,
504
- rowDisabledAccessor: Ue,
505
- hoveredRowId: U,
506
- setHoveredRowId: ee
510
+ isLoadingMore: T,
511
+ hasMore: J,
512
+ showFilterRow: B,
513
+ enableColumnSelector: ve,
514
+ groupRowMode: U,
515
+ groupSelectionMode: te,
516
+ rowDisabled: et,
517
+ rowDisabledAccessor: tt,
518
+ hoveredRowId: oe,
519
+ setHoveredRowId: ne
507
520
  }
508
521
  ),
509
522
  C && /* @__PURE__ */ n(
510
- no,
523
+ lo,
511
524
  {
512
525
  id: s,
513
526
  testid: l,
514
527
  table: i,
515
528
  summaryConfig: C,
516
- filteredRows: ie,
517
- allRows: ce,
529
+ filteredRows: me,
530
+ allRows: ue,
518
531
  totalRowCount: M,
519
532
  locked: !1
520
533
  }
521
534
  )
522
535
  ] }),
523
536
  /* @__PURE__ */ n(
524
- _e,
537
+ Ae,
525
538
  {
526
539
  id: s,
527
- enableColumnSelector: pe,
540
+ enableColumnSelector: ve,
528
541
  toggleColumnVisibility: xt,
529
- resetColumnVisibility: ct,
542
+ resetColumnVisibility: at,
530
543
  testid: l,
531
544
  pinDirection: "right",
532
545
  table: i,
533
546
  tableContainerRef: f,
534
547
  pagination: r,
535
- isLoadingMore: D,
536
- hasMore: K,
537
- showFilterRow: q,
538
- groupRowMode: Q,
539
- groupSelectionMode: Y,
540
- allowUserGrouping: X,
541
- hoveredRowId: U,
542
- setHoveredRowId: ee,
548
+ isLoadingMore: T,
549
+ hasMore: J,
550
+ showFilterRow: B,
551
+ groupRowMode: U,
552
+ groupSelectionMode: te,
553
+ allowUserGrouping: ee,
554
+ hoveredRowId: oe,
555
+ setHoveredRowId: ne,
543
556
  summaryRow: C,
544
- filteredRows: ie,
545
- allRows: ce,
557
+ filteredRows: me,
558
+ allRows: ue,
546
559
  totalRowCount: M
547
560
  }
548
561
  )
549
562
  ]
550
563
  }
551
564
  ),
552
- h && G && /* @__PURE__ */ d(
565
+ g && H && /* @__PURE__ */ a(
553
566
  "div",
554
567
  {
555
568
  className: v(
556
- Oe,
569
+ Ve,
557
570
  "flex flex-col items-center justify-center",
558
- Me,
559
- Te
571
+ We,
572
+ je
560
573
  ),
561
574
  children: [
562
- /* @__PURE__ */ n(ue, { size: "large" }),
563
- /* @__PURE__ */ n($, { color: "text-secondary-normal", children: et }),
564
- Se && /* @__PURE__ */ n(w, { color: "text-secondary-normal", children: Se })
575
+ /* @__PURE__ */ n(he, { size: "large" }),
576
+ /* @__PURE__ */ n(P, { color: "text-secondary-normal", children: ot }),
577
+ be && /* @__PURE__ */ n(x, { color: "text-secondary-normal", children: be })
565
578
  ]
566
579
  }
567
580
  ),
568
- !h && G && /* @__PURE__ */ d(
581
+ !g && H && /* @__PURE__ */ a(
569
582
  "div",
570
583
  {
571
584
  className: v(
572
- Oe,
585
+ Ve,
573
586
  "flex flex-col items-center justify-center",
574
- Me,
575
- Te
587
+ We,
588
+ je
576
589
  ),
577
590
  "data-testid": l ? `${l}-no-results` : void 0,
578
591
  children: [
579
592
  /* @__PURE__ */ n(
580
593
  "img",
581
594
  {
582
- src: Ge?.src ?? Ge,
595
+ src: He?.src ?? He,
583
596
  alt: "No Results",
584
597
  className: "h-30 opacity-20",
585
598
  width: 120,
586
599
  height: 120
587
600
  }
588
601
  ),
589
- /* @__PURE__ */ n($, { color: "text-secondary-normal", children: "No Results" }),
590
- /* @__PURE__ */ n(w, { color: "text-secondary-normal", children: "To view results, enter or update your search criteria." })
602
+ /* @__PURE__ */ n(P, { color: "text-secondary-normal", children: "No Results" }),
603
+ /* @__PURE__ */ n(x, { color: "text-secondary-normal", children: "To view results, enter or update your search criteria." })
591
604
  ]
592
605
  }
593
606
  ),
594
- !Ze && /* @__PURE__ */ d("div", { className: v("p-2 pt-[7px] border-t border-border-primary-normal min-h-[34px]", !y && "h-full"), children: [
595
- r && /* @__PURE__ */ d("div", { className: "flex justify-between items-center", children: [
596
- /* @__PURE__ */ n("div", { className: "flex items-center gap-1 w-min", children: h ? /* @__PURE__ */ d("div", { className: "flex items-center gap-2 whitespace-nowrap", children: [
597
- /* @__PURE__ */ n(ue, { size: "small" }),
598
- /* @__PURE__ */ n(w, { children: k || "Loading..." })
599
- ] }) : /* @__PURE__ */ d($t, { children: [
607
+ !Je && /* @__PURE__ */ a("div", { className: v("p-2 pt-[7px] border-t border-border-primary-normal min-h-[34px]", !y && "h-full"), children: [
608
+ r && /* @__PURE__ */ a("div", { className: "flex justify-between items-center", children: [
609
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-1 w-min", children: g ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2 whitespace-nowrap", children: [
610
+ /* @__PURE__ */ n(he, { size: "small" }),
611
+ /* @__PURE__ */ n(x, { children: D || "Loading..." })
612
+ ] }) : /* @__PURE__ */ a(Lt, { children: [
600
613
  /* @__PURE__ */ n(
601
- Gt,
614
+ Ht,
602
615
  {
603
616
  id: s ? `${s}-pagesize-select` : void 0,
604
617
  testid: l ? `${l}-pagesize-select` : void 0,
@@ -606,13 +619,13 @@ function Go({
606
619
  value: r.pageSize.toString(),
607
620
  onChange: (e) => r.onPageSizeChange?.(Number(e.target.value)),
608
621
  renderMenu: (e) => /* @__PURE__ */ n(
609
- At,
622
+ Gt,
610
623
  {
611
624
  ...e,
612
625
  id: s ? `${s}-pagesize-menu` : void 0,
613
626
  testid: l ? `${l}-pagesize-menu` : void 0,
614
- children: ao.map((o) => /* @__PURE__ */ n(
615
- Ft,
627
+ children: uo.map((o) => /* @__PURE__ */ n(
628
+ Ot,
616
629
  {
617
630
  id: s ? `${s}-pagesize-option-${o}` : void 0,
618
631
  selected: r.pageSize === o,
@@ -625,22 +638,22 @@ function Go({
625
638
  )
626
639
  }
627
640
  ),
628
- /* @__PURE__ */ n(_t, { children: "Per Page" })
641
+ /* @__PURE__ */ n(At, { children: "Per Page" })
629
642
  ] }) }),
630
- /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
643
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
631
644
  /* @__PURE__ */ n(
632
- je,
645
+ Fe,
633
646
  {
634
647
  id: s ? `${s}-prev-page-button` : void 0,
635
648
  testid: l ? `${l}-prev-page-button` : void 0,
636
649
  iconOnly: !0,
637
- leftIcon: /* @__PURE__ */ n(We, { name: "chevron_left" }),
650
+ leftIcon: /* @__PURE__ */ n(_e, { name: "chevron_left" }),
638
651
  onClick: () => r.onPageChange(r.pageIndex - 1),
639
652
  variant: "tertiary",
640
653
  disabled: r.pageIndex === 0
641
654
  }
642
655
  ),
643
- /* @__PURE__ */ d(w, { children: [
656
+ /* @__PURE__ */ a(x, { children: [
644
657
  r.pageIndex * r.pageSize + 1,
645
658
  " -",
646
659
  " ",
@@ -653,12 +666,12 @@ function Go({
653
666
  r.total
654
667
  ] }),
655
668
  /* @__PURE__ */ n(
656
- je,
669
+ Fe,
657
670
  {
658
671
  id: s ? `${s}-next-page-button` : void 0,
659
672
  testid: l ? `${l}-next-page-button` : void 0,
660
673
  iconOnly: !0,
661
- leftIcon: /* @__PURE__ */ n(We, { name: "chevron_right" }),
674
+ leftIcon: /* @__PURE__ */ n(_e, { name: "chevron_right" }),
662
675
  onClick: () => r.onPageChange(r.pageIndex + 1),
663
676
  variant: "tertiary",
664
677
  disabled: (r.pageIndex + 1) * r.pageSize >= r.total
@@ -666,15 +679,15 @@ function Go({
666
679
  )
667
680
  ] })
668
681
  ] }),
669
- !r && h && /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
670
- /* @__PURE__ */ n(ue, { size: "small" }),
671
- /* @__PURE__ */ n(w, { testid: l ? `${l}-status-text` : void 0, children: k || "Loading..." })
682
+ !r && g && /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
683
+ /* @__PURE__ */ n(he, { size: "small" }),
684
+ /* @__PURE__ */ n(x, { testid: l ? `${l}-status-text` : void 0, children: D || "Loading..." })
672
685
  ] }),
673
- !r && !h && k && /* @__PURE__ */ n(
674
- w,
686
+ !r && !g && D && /* @__PURE__ */ n(
687
+ x,
675
688
  {
676
689
  testid: l ? `${l}-status-text` : void 0,
677
- children: k
690
+ children: D
678
691
  }
679
692
  )
680
693
  ] })
@@ -689,7 +702,7 @@ function Go({
689
702
  }
690
703
  );
691
704
  }
692
- function P(s) {
705
+ function L(s) {
693
706
  return (b) => {
694
707
  s(
695
708
  (l) => typeof b == "function" ? b(l) : b
@@ -697,5 +710,5 @@ function P(s) {
697
710
  };
698
711
  }
699
712
  export {
700
- Go as DataGrid
713
+ Ho as DataGrid
701
714
  };