@dmsi/wedgekit-react 3.0.0 → 3.0.2

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