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