@dmsi/wedgekit-react 2.1.2 → 3.0.1

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