@dmsi/wedgekit-react 2.1.2 → 3.0.0

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