@dmsi/wedgekit-react 2.1.1 → 2.1.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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/index.tsx"],"names":[],"mappings":"AAsDA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAgBxC,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC1D,EAAE,EACF,aAAa,EACb,MAAM,EACN,IAAI,EACJ,OAAO,EACP,MAAM,EACN,aAAqB,EACrB,UAAU,EACV,UAAU,EACV,aAAqB,EACrB,OAAe,EACf,OAAO,EAAE,eAAe,EACxB,eAAe,EACf,aAAa,EAAE,qBAAqB,EACpC,qBAAqB,EACrB,YAAY,EAAE,oBAAoB,EAClC,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,qBAA0B,EAC1B,sBAA2B,EAC3B,sBAAsB,EACtB,WAAW,EACX,mBAAmB,EACnB,SAAiB,EACjB,cAAkC,EAClC,kBAAkB,EAClB,SAAS,EACT,UAAkB,EAClB,eAAuB,EACvB,aAAa,EACb,UAAU,EACV,OAAO,EACP,YAAyB,EACzB,kBAA2B,EAC3B,iBAAiB,EACjB,kBAA0B,EAC1B,kBAAkB,EAClB,QAAQ,EAAE,gBAAgB,EAC1B,gBAAgB,EAChB,QAAQ,EAAE,gBAAgB,EAC1B,gBAAgB,EAChB,GAAG,GACJ,EAAE,aAAa,CAAC,CAAC,CAAC,2CAi7BlB;AAeD,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/index.tsx"],"names":[],"mappings":"AAsDA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAgBxC,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC1D,EAAE,EACF,aAAa,EACb,MAAM,EACN,IAAI,EACJ,OAAO,EACP,MAAM,EACN,aAAqB,EACrB,UAAU,EACV,UAAU,EACV,aAAqB,EACrB,OAAe,EACf,OAAO,EAAE,eAAe,EACxB,eAAe,EACf,aAAa,EAAE,qBAAqB,EACpC,qBAAqB,EACrB,YAAY,EAAE,oBAAoB,EAClC,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,qBAA0B,EAC1B,sBAA2B,EAC3B,sBAAsB,EACtB,WAAW,EACX,mBAAmB,EACnB,SAAiB,EACjB,cAAkC,EAClC,kBAAkB,EAClB,SAAS,EACT,UAAkB,EAClB,eAAuB,EACvB,aAAa,EACb,UAAU,EACV,OAAO,EACP,YAAyB,EACzB,kBAA2B,EAC3B,iBAAiB,EACjB,kBAA0B,EAC1B,kBAAkB,EAClB,QAAQ,EAAE,gBAAgB,EAC1B,gBAAgB,EAChB,QAAQ,EAAE,gBAAgB,EAC1B,gBAAgB,EAChB,GAAG,GACJ,EAAE,aAAa,CAAC,CAAC,CAAC,2CAy7BlB;AAeD,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,eAAe,QAAQ,CAAC"}
@@ -1,158 +1,158 @@
1
1
  "use client";
2
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";
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
4
  import { useInfiniteScroll as Lt } from "../../hooks/useInfiniteScroll.js";
5
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";
6
+ import { componentGap as Ee, componentPadding as Me } from "../../classNames.js";
7
+ import { Button as Te } from "../Button.js";
8
8
  import { Checkbox as Mt } from "../Checkbox.js";
9
9
  import { DraggableCellHeader as Tt, DataGridCell as jt } from "../DataGridCell.js";
10
- import { Icon as Te } from "../Icon.js";
10
+ import { Icon as je } from "../Icon.js";
11
11
  import { Label as Wt } from "../Label.js";
12
12
  import { Menu as _t } from "../Menu.js";
13
13
  import { MenuOption as At } from "../MenuOption.js";
14
- import { Paragraph as w } from "../Paragraph.js";
14
+ import { Paragraph as y } from "../Paragraph.js";
15
15
  import { Select as Ft } from "../Select.js";
16
16
  import { Subheader as $ } from "../Subheader.js";
17
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";
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
19
  import { SortableContext as Jt, horizontalListSortingStrategy as Qt, arrayMove as Xt } from "../../node_modules/@dnd-kit/sortable/dist/sortable.esm.js";
20
20
  import { restrictToHorizontalAxis as Yt } from "../../node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js";
21
21
  import { Notification as Ut } from "../Notification.js";
22
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";
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
26
  import { TableBody as to } from "./TableBody/index.js";
27
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";
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
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]";
32
+ const co = [5, 10, 15, 20, 25, 30, 35], Ge = "h-[185px]";
33
33
  function Fo({
34
34
  id: s,
35
- rowIdAccessor: v,
35
+ rowIdAccessor: b,
36
36
  testid: l,
37
37
  data: k,
38
- columns: Ge,
38
+ columns: Oe,
39
39
  status: D,
40
40
  isLoadingMore: L = !1,
41
- onLoadMore: Oe,
41
+ onLoadMore: He,
42
42
  pagination: r,
43
43
  showFilterRow: K = !1,
44
44
  hasMore: V = !1,
45
- sorting: me,
46
- onSortingChange: He,
47
- columnFilters: ue,
45
+ sorting: ue,
46
+ onSortingChange: qe,
47
+ columnFilters: fe,
48
48
  onColumnFiltersChange: Ke,
49
49
  rowSelection: Z,
50
50
  onRowSelectionChange: E,
51
- filteredSortedData: fe,
51
+ filteredSortedData: ge,
52
52
  totalRowCount: M,
53
53
  hideStatusBar: Ve,
54
54
  centerHeader: Ze,
55
55
  enableColumnSelector: he,
56
- predeterminedLeftPins: qe = [],
57
- predeterminedRightPins: Be = [],
58
- useMenuDefaultMinWidth: Je,
59
- rowDisabled: Qe,
60
- rowDisabledAccessor: Xe,
56
+ predeterminedLeftPins: Be = [],
57
+ predeterminedRightPins: Je = [],
58
+ useMenuDefaultMinWidth: Qe,
59
+ rowDisabled: Xe,
60
+ rowDisabledAccessor: Ye,
61
61
  isLoading: h = !1,
62
- loadingMessage: Ye = "Loading Results",
63
- loadingDescription: ge,
62
+ loadingMessage: Ue = "Loading Results",
63
+ loadingDescription: pe,
64
64
  maxHeight: T,
65
- fillHeight: y = !1,
66
- manualFiltering: q = !1,
67
- notifications: B,
68
- summaryRow: pe,
65
+ fillHeight: C = !1,
66
+ manualFiltering: B = !1,
67
+ notifications: J,
68
+ summaryRow: Se,
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: ve = "none",
72
+ allowUserGrouping: X,
73
+ groupSelectionMode: Y = "row",
74
+ hideGroupedColumns: et,
75
+ grouping: R,
76
+ onGroupingChange: tt,
77
77
  expanded: W,
78
- onExpandedChange: tt,
79
- ref: ot
78
+ onExpandedChange: ot,
79
+ ref: nt
80
80
  }) {
81
- Pt(ot, () => ({
82
- getSavedLayout: () => rt()
81
+ Pt(nt, () => ({
82
+ getSavedLayout: () => lt()
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 [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(
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
+ ), Ne = q(
96
96
  (e) => {
97
- lt(
97
+ st(
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
+ ), it = q(() => {
105
+ Re();
106
+ }, [Re]);
107
+ ce(() => {
108
+ Ne(!0);
109
+ }, [Ne]);
110
+ const ct = r ? ue ?? be : be, at = r ? (e) => {
111
111
  const o = typeof e == "function" ? e(
112
- me ?? []
112
+ ue ?? []
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 ?? 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);
119
+ I.current = z;
120
+ const Pe = q(
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 ?? Ce)(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
+ Ce(e);
130
130
  },
131
131
  [Z, E, r]
132
- ), [mt, Pe] = f(
132
+ ), [ut, 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
+ ce(() => {
136
+ R === void 0 && j !== void 0 && ke(j);
137
+ }, [j, R]);
138
+ const ne = R ?? ut, ft = 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
+ tt?.(o);
143
+ } : ke, [gt, De] = g(
144
+ () => ve === "all" ? !0 : {}
145
+ ), ht = W ?? gt, pt = 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
+ 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(
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,14 +160,14 @@ function Fo({
160
160
  }
161
161
  } : a));
162
162
  },
163
- [ee]
163
+ [te]
164
164
  ), c = Gt({
165
- columns: b,
165
+ columns: x,
166
166
  data: k,
167
167
  defaultColumn: { minSize: 50 },
168
168
  getCoreRowModel: io(),
169
169
  getSortedRowModel: so(),
170
- getFilteredRowModel: q ? void 0 : lo(),
170
+ getFilteredRowModel: B ? void 0 : lo(),
171
171
  getGroupedRowModel: ro(),
172
172
  getExpandedRowModel: no(),
173
173
  // Grouping only ever happens client-side in this grid — there is no
@@ -182,31 +182,31 @@ 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,
189
+ columnOrder: ze,
190
+ sorting: ct,
191
+ columnFilters: dt,
192
+ rowSelection: z,
193
+ columnVisibility: St,
194
+ grouping: ne,
195
195
  expanded: ht
196
196
  },
197
197
  initialState: {
198
198
  columnPinning: {
199
- left: qe,
200
- right: Be
199
+ left: Be,
200
+ right: Je
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(at),
206
+ onColumnFiltersChange: P(mt),
207
+ onRowSelectionChange: P(Pe),
208
+ onGroupingChange: P(ft),
209
+ onExpandedChange: P(pt),
210
210
  filterFns: {
211
211
  startsWith: (e, o, t) => {
212
212
  const i = e?.getValue(o);
@@ -218,23 +218,23 @@ function Fo({
218
218
  }
219
219
  }
220
220
  });
221
- ie(() => {
222
- if (Se !== "first" || W !== void 0)
221
+ ce(() => {
222
+ if (ve !== "first" || W !== void 0)
223
223
  return;
224
224
  const e = {};
225
225
  let o = c.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(
228
+ Object.keys(e).length > 0 && De(e);
229
+ }, [ne]);
230
+ const _ = r ? ge?.map((e) => String(e.id)) ?? [] : Array.from(
231
231
  { length: M ?? k.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
+ ), xt = !re && _.some((e) => z[e]), wt = () => {
236
+ Pe((e) => {
237
+ if (!re) {
238
238
  const t = {};
239
239
  for (const i of _)
240
240
  t[i] = !0;
@@ -248,108 +248,111 @@ function Fo({
248
248
  });
249
249
  };
250
250
  Lt({
251
- containerRef: u,
252
- onLoadMore: Oe ?? (() => {
251
+ containerRef: f,
252
+ onLoadMore: He ?? (() => {
253
253
  }),
254
254
  isLoading: L,
255
255
  enabled: !r
256
256
  }), Dt(() => {
257
- if (De.current || !u.current) return;
258
- const e = u.current.offsetWidth;
257
+ if (Le.current || !f.current) return;
258
+ const e = f.current.offsetWidth;
259
259
  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();
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
261
  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;
262
+ const m = a.reduce(
263
+ (u, S) => u + S.getSize(),
264
+ 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;
266
269
  }, []);
267
- const wt = (e) => {
270
+ const yt = (e) => {
268
271
  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;
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;
272
275
  });
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)
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)
279
282
  ), A = eo({
280
- count: re.length,
281
- estimateSize: (e) => re[e].getSize(),
282
- getScrollElement: () => u.current,
283
+ count: le.length,
284
+ estimateSize: (e) => le[e].getSize(),
285
+ getScrollElement: () => f.current,
283
286
  horizontal: !0,
284
287
  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 : [];
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 : [];
289
292
  return /* @__PURE__ */ n(
290
- Kt,
293
+ qt,
291
294
  {
292
- id: St,
293
- collisionDetection: Vt,
295
+ id: vt,
296
+ collisionDetection: Kt,
294
297
  modifiers: [Yt],
295
- onDragEnd: wt,
296
- sensors: yt,
298
+ onDragEnd: yt,
299
+ sensors: Ct,
297
300
  children: /* @__PURE__ */ n(
298
301
  Jt,
299
302
  {
300
- items: Rt,
303
+ items: zt,
301
304
  strategy: Qt,
302
305
  children: /* @__PURE__ */ d(
303
306
  "div",
304
307
  {
305
- className: S(
308
+ className: v(
306
309
  "flex flex-col gap-2 w-full",
307
- y ? "grow min-h-0" : "grow-0 h-fit"
310
+ C ? "grow min-h-0" : "grow-0 h-fit"
308
311
  ),
309
312
  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)) }),
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)) }),
311
314
  /* @__PURE__ */ d(
312
315
  "div",
313
316
  {
314
317
  id: s,
315
318
  "data-testid": l,
316
- className: S(
319
+ className: v(
317
320
  "flex flex-col rounded border border-border-primary-normal overflow-hidden text-text-primary-normal",
318
- y ? "flex-1 min-h-0" : "grow-0 h-fit"
321
+ C ? "flex-1 min-h-0" : "grow-0 h-fit"
319
322
  ),
320
323
  children: [
321
324
  /* @__PURE__ */ d(
322
325
  "div",
323
326
  {
324
- className: S(
327
+ className: v(
325
328
  "flex overflow-auto scrollbar-thin relative contain-paint will-change-transform",
326
- G ? "overflow-y-hidden" : !y && "min-h-[120px]",
327
- y && "flex-1 min-h-0"
329
+ G ? "overflow-y-hidden" : !C && "min-h-[120px]",
330
+ C && "flex-1 min-h-0"
328
331
  ),
329
332
  style: T !== void 0 ? { maxHeight: typeof T == "number" ? `${T}px` : T } : void 0,
330
- ref: u,
333
+ ref: f,
331
334
  inert: h || void 0,
332
335
  "aria-busy": h || void 0,
333
336
  children: [
334
337
  /* @__PURE__ */ n(
335
- je,
338
+ We,
336
339
  {
337
340
  testid: l,
338
341
  pinDirection: "left",
339
342
  table: c,
340
- tableContainerRef: u,
343
+ tableContainerRef: f,
341
344
  pagination: r,
342
345
  isLoadingMore: L,
343
346
  hasMore: V,
344
347
  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,
348
+ groupRowMode: Q,
349
+ groupSelectionMode: Y,
350
+ allowUserGrouping: X,
351
+ hoveredRowId: U,
352
+ setHoveredRowId: ee,
353
+ summaryRow: w,
354
+ filteredRows: se,
355
+ allRows: ie,
353
356
  totalRowCount: M
354
357
  }
355
358
  ),
@@ -370,7 +373,7 @@ function Fo({
370
373
  }
371
374
  )
372
375
  ) : null,
373
- g.map((o) => {
376
+ p.map((o) => {
374
377
  const t = e.headers[o.index];
375
378
  if (t) {
376
379
  if (typeof t.column.columnDef.header == "string") {
@@ -384,9 +387,9 @@ function Fo({
384
387
  header: t,
385
388
  locked: t.column.columnDef.meta?.locked,
386
389
  center: Ze,
387
- allowUserGrouping: Q,
388
- isLast: !I && o.index === g[g.length - 1]?.index,
389
- className: S(
390
+ allowUserGrouping: X,
391
+ isLast: !N && o.index === p[p.length - 1]?.index,
392
+ className: v(
390
393
  t.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
391
394
  "group",
392
395
  {
@@ -394,10 +397,10 @@ function Fo({
394
397
  "justify-end": a === "right"
395
398
  }
396
399
  ),
397
- useMenuDefaultMinWidth: Je,
400
+ useMenuDefaultMinWidth: Qe,
398
401
  children: [
399
402
  a === "left" && /* @__PURE__ */ n(
400
- _e,
403
+ Ae,
401
404
  {
402
405
  showOnTruncation: !0,
403
406
  message: t.column.columnDef.header,
@@ -405,14 +408,14 @@ function Fo({
405
408
  children: /* @__PURE__ */ n($, { as: "p", addOverflow: !0, tall: !0, children: t.column.columnDef.header })
406
409
  }
407
410
  ),
408
- We(t.column.getIsSorted()),
409
- !t.column.getIsSorted() && t.column.getCanSort() && !c.getState().columnSizingInfo.isResizingColumn && We(
411
+ _e(t.column.getIsSorted()),
412
+ !t.column.getIsSorted() && t.column.getCanSort() && !c.getState().columnSizingInfo.isResizingColumn && _e(
410
413
  t.column.getNextSortingOrder(),
411
414
  !0
412
415
  ),
413
416
  t.column.getSortIndex() !== -1 && c.getState().sorting.length > 1 && /* @__PURE__ */ n($, { tall: !0, children: t.column.getSortIndex() + 1 }),
414
417
  a === "right" && /* @__PURE__ */ n(
415
- _e,
418
+ Ae,
416
419
  {
417
420
  showOnTruncation: !0,
418
421
  message: t.column.columnDef.header,
@@ -453,9 +456,9 @@ function Fo({
453
456
  {
454
457
  id: s ? `${s}-select-all-checkbox` : void 0,
455
458
  testid: l ? `${l}-select-all-checkbox` : void 0,
456
- checked: ne,
457
- indeterminate: bt,
458
- onChange: xt
459
+ checked: re,
460
+ indeterminate: xt,
461
+ onChange: wt
459
462
  }
460
463
  )
461
464
  }
@@ -465,12 +468,12 @@ function Fo({
465
468
  ) }, t.id);
466
469
  }
467
470
  }),
468
- I ? (
471
+ N ? (
469
472
  //fake empty column to the right for virtualization scroll padding
470
473
  /* @__PURE__ */ n(
471
474
  "th",
472
475
  {
473
- style: { display: "flex", width: I }
476
+ style: { display: "flex", width: N }
474
477
  }
475
478
  )
476
479
  ) : null
@@ -485,59 +488,59 @@ function Fo({
485
488
  testid: l,
486
489
  columnVirtualizer: A,
487
490
  table: c,
488
- tableContainerRef: u,
491
+ tableContainerRef: f,
489
492
  virtualPaddingLeft: F,
490
- virtualPaddingRight: I,
493
+ virtualPaddingRight: N,
491
494
  pagination: r,
492
495
  isLoadingMore: L,
493
496
  hasMore: V,
494
497
  showFilterRow: K,
495
498
  enableColumnSelector: he,
496
- groupRowMode: J,
497
- groupSelectionMode: X,
498
- rowDisabled: Qe,
499
- rowDisabledAccessor: Xe,
500
- hoveredRowId: Y,
501
- setHoveredRowId: U
499
+ groupRowMode: Q,
500
+ groupSelectionMode: Y,
501
+ rowDisabled: Xe,
502
+ rowDisabledAccessor: Ye,
503
+ hoveredRowId: U,
504
+ setHoveredRowId: ee
502
505
  }
503
506
  ),
504
- x && /* @__PURE__ */ n(
507
+ w && /* @__PURE__ */ n(
505
508
  oo,
506
509
  {
507
510
  id: s,
508
511
  testid: l,
509
512
  table: c,
510
- summaryConfig: x,
511
- filteredRows: le,
512
- allRows: se,
513
+ summaryConfig: w,
514
+ filteredRows: se,
515
+ allRows: ie,
513
516
  totalRowCount: M,
514
517
  locked: !1
515
518
  }
516
519
  )
517
520
  ] }),
518
521
  /* @__PURE__ */ n(
519
- je,
522
+ We,
520
523
  {
521
524
  id: s,
522
525
  enableColumnSelector: he,
523
- toggleColumnVisibility: vt,
524
- resetColumnVisibility: st,
526
+ toggleColumnVisibility: bt,
527
+ resetColumnVisibility: it,
525
528
  testid: l,
526
529
  pinDirection: "right",
527
530
  table: c,
528
- tableContainerRef: u,
531
+ tableContainerRef: f,
529
532
  pagination: r,
530
533
  isLoadingMore: L,
531
534
  hasMore: V,
532
535
  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,
536
+ groupRowMode: Q,
537
+ groupSelectionMode: Y,
538
+ allowUserGrouping: X,
539
+ hoveredRowId: U,
540
+ setHoveredRowId: ee,
541
+ summaryRow: w,
542
+ filteredRows: se,
543
+ allRows: ie,
541
544
  totalRowCount: M
542
545
  }
543
546
  )
@@ -547,34 +550,34 @@ function Fo({
547
550
  h && G && /* @__PURE__ */ d(
548
551
  "div",
549
552
  {
550
- className: S(
551
- Fe,
553
+ className: v(
554
+ Ge,
552
555
  "flex flex-col items-center justify-center",
553
- Le,
554
- Ee
556
+ Ee,
557
+ Me
555
558
  ),
556
559
  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 })
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 })
560
563
  ]
561
564
  }
562
565
  ),
563
566
  !h && G && /* @__PURE__ */ d(
564
567
  "div",
565
568
  {
566
- className: S(
567
- Fe,
569
+ className: v(
570
+ Ge,
568
571
  "flex flex-col items-center justify-center",
569
- Le,
570
- Ee
572
+ Ee,
573
+ Me
571
574
  ),
572
575
  "data-testid": l ? `${l}-no-results` : void 0,
573
576
  children: [
574
577
  /* @__PURE__ */ n(
575
578
  "img",
576
579
  {
577
- src: Ae?.src ?? Ae,
580
+ src: Fe?.src ?? Fe,
578
581
  alt: "No Results",
579
582
  className: "h-30 opacity-20",
580
583
  width: 120,
@@ -582,15 +585,15 @@ function Fo({
582
585
  }
583
586
  ),
584
587
  /* @__PURE__ */ n($, { color: "text-secondary-normal", children: "No Results" }),
585
- /* @__PURE__ */ n(w, { color: "text-secondary-normal", children: "To view results, enter or update your search criteria." })
588
+ /* @__PURE__ */ n(y, { color: "text-secondary-normal", children: "To view results, enter or update your search criteria." })
586
589
  ]
587
590
  }
588
591
  ),
589
- !Ve && /* @__PURE__ */ d("div", { className: S("p-2 pt-[7px] border-t border-border-primary-normal min-h-[34px]", !y && "h-full"), children: [
592
+ !Ve && /* @__PURE__ */ d("div", { className: v("p-2 pt-[7px] border-t border-border-primary-normal min-h-[34px]", !C && "h-full"), children: [
590
593
  r && /* @__PURE__ */ d("div", { className: "flex justify-between items-center", children: [
591
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: [
592
- /* @__PURE__ */ n(de, { size: "small" }),
593
- /* @__PURE__ */ n(w, { children: D || "Loading..." })
595
+ /* @__PURE__ */ n(me, { size: "small" }),
596
+ /* @__PURE__ */ n(y, { children: D || "Loading..." })
594
597
  ] }) : /* @__PURE__ */ d(Nt, { children: [
595
598
  /* @__PURE__ */ n(
596
599
  Ft,
@@ -624,18 +627,18 @@ function Fo({
624
627
  ] }) }),
625
628
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
626
629
  /* @__PURE__ */ n(
627
- Me,
630
+ Te,
628
631
  {
629
632
  id: s ? `${s}-prev-page-button` : void 0,
630
633
  testid: l ? `${l}-prev-page-button` : void 0,
631
634
  iconOnly: !0,
632
- leftIcon: /* @__PURE__ */ n(Te, { name: "chevron_left" }),
635
+ leftIcon: /* @__PURE__ */ n(je, { name: "chevron_left" }),
633
636
  onClick: () => r.onPageChange(r.pageIndex - 1),
634
637
  variant: "tertiary",
635
638
  disabled: r.pageIndex === 0
636
639
  }
637
640
  ),
638
- /* @__PURE__ */ d(w, { children: [
641
+ /* @__PURE__ */ d(y, { children: [
639
642
  r.pageIndex * r.pageSize + 1,
640
643
  " -",
641
644
  " ",
@@ -648,12 +651,12 @@ function Fo({
648
651
  r.total
649
652
  ] }),
650
653
  /* @__PURE__ */ n(
651
- Me,
654
+ Te,
652
655
  {
653
656
  id: s ? `${s}-next-page-button` : void 0,
654
657
  testid: l ? `${l}-next-page-button` : void 0,
655
658
  iconOnly: !0,
656
- leftIcon: /* @__PURE__ */ n(Te, { name: "chevron_right" }),
659
+ leftIcon: /* @__PURE__ */ n(je, { name: "chevron_right" }),
657
660
  onClick: () => r.onPageChange(r.pageIndex + 1),
658
661
  variant: "tertiary",
659
662
  disabled: (r.pageIndex + 1) * r.pageSize >= r.total
@@ -662,11 +665,11 @@ function Fo({
662
665
  ] })
663
666
  ] }),
664
667
  !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..." })
668
+ /* @__PURE__ */ n(me, { size: "small" }),
669
+ /* @__PURE__ */ n(y, { testid: l ? `${l}-status-text` : void 0, children: D || "Loading..." })
667
670
  ] }),
668
671
  !r && !h && D && /* @__PURE__ */ n(
669
- w,
672
+ y,
670
673
  {
671
674
  testid: l ? `${l}-status-text` : void 0,
672
675
  children: D
@@ -685,9 +688,9 @@ function Fo({
685
688
  );
686
689
  }
687
690
  function P(s) {
688
- return (v) => {
691
+ return (b) => {
689
692
  s(
690
- (l) => typeof v == "function" ? v(l) : v
693
+ (l) => typeof b == "function" ? b(l) : b
691
694
  );
692
695
  };
693
696
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MainBar.d.ts","sourceRoot":"","sources":["../../src/components/MainBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASlD,KAAK,YAAY,GAAG;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAE/B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oQAAoQ;IACpQ,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,EAAE,EACF,MAAM,EACN,WAAW,EAAE,IAAI,EACjB,YAAY,EAAE,KAAK,EACnB,iBAAiB,EAAE,UAAU,EAC7B,kBAAkB,EAAE,WAAW,EAC/B,MAAc,EACd,aAAqB,EACrB,IAAI,GACL,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,2CA6DtC"}
1
+ {"version":3,"file":"MainBar.d.ts","sourceRoot":"","sources":["../../src/components/MainBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASlD,KAAK,YAAY,GAAG;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAE/B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oQAAoQ;IACpQ,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,EAAE,EACF,MAAM,EACN,WAAW,EAAE,IAAI,EACjB,YAAY,EAAE,KAAK,EACnB,iBAAiB,EAAE,UAAU,EAC7B,kBAAkB,EAAE,WAAW,EAC/B,MAAc,EACd,aAAqB,EACrB,IAAI,GACL,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,2CAkEtC"}
@@ -1,45 +1,48 @@
1
- import { jsx as e, Fragment as f, jsxs as r } from "react/jsx-runtime";
1
+ import { jsx as e, Fragment as h, jsxs as c } from "react/jsx-runtime";
2
2
  import { clsx as n } from "../node_modules/clsx/dist/clsx.js";
3
- import { layoutGap as s, layoutGroupGap as x, containerPaddingX as g, containerPaddingY as u, componentPaddingTopUsingComponentGap2xMobile as b } from "../classNames.js";
4
- function w({
5
- id: c,
6
- testid: l,
7
- leftContent: a,
3
+ import { layoutGap as l, layoutGroupGap as k, containerPaddingX as u, containerPaddingY as g, componentPaddingTopUsingComponentGap2xMobile as b } from "../classNames.js";
4
+ function C({
5
+ id: r,
6
+ testid: m,
7
+ leftContent: s,
8
8
  rightContent: o,
9
9
  mobileLeftContent: i,
10
- mobileRightContent: d,
11
- footer: m = !1,
12
- centerContent: p = !1,
10
+ mobileRightContent: p,
11
+ footer: x = !1,
12
+ centerContent: f = !1,
13
13
  cart: t
14
14
  }) {
15
- return !a && !o ? /* @__PURE__ */ e(f, {}) : /* @__PURE__ */ r(
15
+ const a = !!(s || o || t), d = !!(i || p);
16
+ return !a && !d ? /* @__PURE__ */ e(h, {}) : /* @__PURE__ */ c(
16
17
  "div",
17
18
  {
18
- id: c,
19
- "data-testid": l,
19
+ id: r,
20
+ "data-testid": m,
20
21
  className: n(
21
22
  "min-h-mobile-container-padding",
22
23
  "bg-background-brand-normal items-center justify-between",
23
24
  "z-10 shadow-4",
24
- "flex",
25
- x,
26
- g,
27
- m ? u : p ? "py-[calc((var(--spacing-mobile-component-gap)_+_8px)_/_2)] desktop:py-desktop-component-gap compact:py-desktop-compact-component-gap" : b
25
+ a && d && "flex",
26
+ a && !d && "hidden desktop:flex",
27
+ !a && d && "flex desktop:hidden",
28
+ k,
29
+ u,
30
+ x ? g : f ? "py-[calc((var(--spacing-mobile-component-gap)_+_8px)_/_2)] desktop:py-desktop-component-gap compact:py-desktop-compact-component-gap" : b
28
31
  ),
29
32
  children: [
30
- a && /* @__PURE__ */ e(
33
+ s && /* @__PURE__ */ e(
31
34
  "div",
32
35
  {
33
- className: n("hidden desktop:flex items-center flex-1 min-w-0 overflow-x-auto no-scrollbar", s),
34
- children: a
36
+ className: n("hidden desktop:flex items-center flex-1 min-w-0 overflow-x-auto no-scrollbar", l),
37
+ children: s
35
38
  }
36
39
  ),
37
- (o || t) && /* @__PURE__ */ r(
40
+ (o || t) && /* @__PURE__ */ c(
38
41
  "div",
39
42
  {
40
43
  className: n(
41
44
  "hidden desktop:flex items-center ml-auto",
42
- s
45
+ l
43
46
  ),
44
47
  children: [
45
48
  o,
@@ -49,11 +52,11 @@ function w({
49
52
  }
50
53
  ),
51
54
  i && /* @__PURE__ */ e("div", { className: n("flex items-center desktop:hidden flex-1 min-w-0 overflow-x-auto no-scrollbar"), children: i }),
52
- d && /* @__PURE__ */ e("div", { className: n("flex items-center desktop:hidden"), children: d })
55
+ p && /* @__PURE__ */ e("div", { className: n("flex items-center desktop:hidden"), children: p })
53
56
  ]
54
57
  }
55
58
  );
56
59
  }
57
60
  export {
58
- w as MainBar
61
+ C as MainBar
59
62
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",