@lax-wp/design-system 0.13.37-beta.0 → 0.13.38

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,28 +1,28 @@
1
- import { jsx as s, jsxs as b, Fragment as Dr } from "react/jsx-runtime";
2
- import { useCheckbox as Ar } from "../../../hooks/useCheckbox.es.js";
3
- import { useTableConfig as Er } from "../../../providers/design-system-provider/hooks.es.js";
1
+ import { jsx as s, jsxs as b, Fragment as Nr } from "react/jsx-runtime";
2
+ import { useCheckbox as Dr } from "../../../hooks/useCheckbox.es.js";
3
+ import { useTableConfig as Ar } from "../../../providers/design-system-provider/hooks.es.js";
4
4
  import { mergeViewColumnsWithTableColumns as Lt } from "../../../utils/table.es.js";
5
5
  import gt from "../../button/Button.es.js";
6
- import { FloatingBar as Or } from "../../floating-bar/FloatingBar.es.js";
6
+ import { FloatingBar as Er } from "../../floating-bar/FloatingBar.es.js";
7
7
  import { Typography as Te } from "../typography/Typography.es.js";
8
- import { useSensors as _r, useSensor as Vt, MouseSensor as kr, TouchSensor as Rr, DndContext as Mr, closestCorners as Lr, DragOverlay as gr } from "@dnd-kit/core";
9
- import Vr, { useState as p, useRef as A, useCallback as c, useEffect as y, useMemo as $, forwardRef as jt } from "react";
10
- import { AutoSizer as jr } from "react-virtualized-auto-sizer";
11
- import { createPortal as Ir } from "react-dom";
12
- import { useTable as Pr, useResizeColumns as Br } from "react-table";
13
- import { Body as Wr } from "./body/index.es.js";
8
+ import { useSensors as Or, useSensor as Vt, MouseSensor as _r, TouchSensor as kr, DndContext as Rr, closestCorners as Mr, DragOverlay as Lr } from "@dnd-kit/core";
9
+ import gr, { useState as p, useRef as A, useCallback as c, useEffect as y, useMemo as $, forwardRef as jt } from "react";
10
+ import { AutoSizer as Vr } from "react-virtualized-auto-sizer";
11
+ import { createPortal as jr } from "react-dom";
12
+ import { useTable as Ir, useResizeColumns as Pr } from "react-table";
13
+ import { Body as Br } from "./body/index.es.js";
14
14
  import { validateCellValue as It } from "./validateCell.es.js";
15
- import { Row as Hr } from "./body/rows/row.es.js";
16
- import { TableContext as $r } from "./context.es.js";
17
- import { CurrencyDropdownPortal as zr } from "./CurrencyDropdownPortal.es.js";
18
- import { Head as qr } from "./head/index.es.js";
19
- import { PendingEditsFloatingBar as Ur } from "./PendingEditsFloatingBar.es.js";
20
- import { DATA_ROW_ID_ATTR as Jr, DATA_COLUMN_KEY_ATTR as Gr, OS_VIEWPORT_SELECTOR as Xr, SCROLL_TO_CELL_COLUMN_WIDTH_FALLBACK as Yr, SCROLL_TO_CELL_LEFT_OFFSET as Zr, DEFAULT_PAGE_SIZE as Cr, DEFAULT_COLUMN_MAX_WIDTH as Qr, DEFAULT_COLUMN_WIDTH as Kr, DEFAULT_COLUMN_MIN_WIDTH as en, DND_ACTIVATION_DISTANCE as Pt, ROW_ADDITIONAL_ACTIONS_DEFAULT_WIDTH as tn, ROW_OPTIONS_COLUMN_WIDTH as ln, TOOLBAR_FIRST_BREAKPOINT as Z, TOOLBAR_SECOND_BREAKPOINT as Ue, DROP_ANIMATION_DURATION as rn, DROP_ANIMATION_EASING as nn } from "./constants.es.js";
21
- import { getRowSlotHeight as sn, useRowHeight as on } from "./useRowHeight.es.js";
22
- import { NoDataFoundWidgets as an } from "../empty-state/NoDataFoundWidgets.es.js";
23
- import { NoDataFound as cn } from "../empty-state/NoDataFound.es.js";
24
- import { Add2Icon as un } from "../../icon/icons.generated.es.js";
25
- const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCase().trim().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, "") || N}`, In = Vr.memo(
15
+ import { Row as Wr } from "./body/rows/row.es.js";
16
+ import { TableContext as Hr } from "./context.es.js";
17
+ import { CurrencyDropdownPortal as $r } from "./CurrencyDropdownPortal.es.js";
18
+ import { Head as zr } from "./head/index.es.js";
19
+ import { PendingEditsFloatingBar as qr } from "./PendingEditsFloatingBar.es.js";
20
+ import { DATA_ROW_ID_ATTR as Ur, DATA_COLUMN_KEY_ATTR as Jr, OS_VIEWPORT_SELECTOR as Gr, SCROLL_TO_CELL_COLUMN_WIDTH_FALLBACK as Xr, SCROLL_TO_CELL_LEFT_OFFSET as Yr, DEFAULT_PAGE_SIZE as Zr, DEFAULT_COLUMN_MAX_WIDTH as Cr, DEFAULT_COLUMN_WIDTH as Qr, DEFAULT_COLUMN_MIN_WIDTH as Kr, DND_ACTIVATION_DISTANCE as Pt, ROW_ADDITIONAL_ACTIONS_DEFAULT_WIDTH as en, ROW_OPTIONS_COLUMN_WIDTH as tn, TOOLBAR_FIRST_BREAKPOINT as Z, TOOLBAR_SECOND_BREAKPOINT as Ue, DROP_ANIMATION_DURATION as ln, DROP_ANIMATION_EASING as rn } from "./constants.es.js";
21
+ import { getRowSlotHeight as nn, useRowHeight as sn } from "./useRowHeight.es.js";
22
+ import { NoDataFoundWidgets as on } from "../empty-state/NoDataFoundWidgets.es.js";
23
+ import { NoDataFound as an } from "../empty-state/NoDataFound.es.js";
24
+ import { Add2Icon as cn } from "../../icon/icons.generated.es.js";
25
+ const un = Vr, Bt = "Create Column", dn = (g, N) => `button-admin-${g.toLowerCase().trim().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, "") || N}`, jn = gr.memo(
26
26
  ({
27
27
  tableKey: g,
28
28
  searchConfig: N = { search: "", handleSearch: () => null, allowAStarSearch: !1 },
@@ -66,9 +66,8 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
66
66
  hideRowOptionWidth: Ge,
67
67
  checkboxUtilities: V,
68
68
  isLoading: se = !1,
69
- headerLoading: $t = !1,
70
- onScroll: zt,
71
- onScrolling: qt,
69
+ onScroll: $t,
70
+ onScrolling: zt,
72
71
  isColumnConfigurable: oe,
73
72
  onAddColumnClick: ae,
74
73
  emptyMessage: Xe,
@@ -76,61 +75,61 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
76
75
  buttons: Ze,
77
76
  onEditColumnClick: Ce,
78
77
  onDeleteColumnClick: Qe,
79
- onRowTooltipClick: Ut,
80
- tooltiptext: Jt,
81
- cascadingTableConfig: Gt,
82
- originalsOnly: Xt,
83
- disableOptionsForRowIndex: Yt,
78
+ onRowTooltipClick: qt,
79
+ tooltiptext: Ut,
80
+ cascadingTableConfig: Jt,
81
+ originalsOnly: Gt,
82
+ disableOptionsForRowIndex: Xt,
84
83
  tableHeightClass: ie = "h-[calc(100vh-220px)]",
85
- getFullRowDataOnClick: Zt,
86
- selectedRowId: Ct = null,
84
+ getFullRowDataOnClick: Yt,
85
+ selectedRowId: Zt = null,
87
86
  onRowEdit: R,
88
87
  onBulkRowEdit: j,
89
- inlineEditColumns: Qt,
90
- isResizable: Kt = !0,
88
+ inlineEditColumns: Ct,
89
+ isResizable: Qt = !0,
91
90
  paginationConfig: ce,
92
91
  dndSortableUtils: ue,
93
92
  multipleContexts: Ke,
94
93
  withSortable: Ne,
95
- withDraggable: el,
96
- enableRootDrag: tl,
97
- pageSize: ll = Cr,
98
- onCascadingRowExpand: rl,
94
+ withDraggable: Kt,
95
+ enableRootDrag: el,
96
+ pageSize: tl = Zr,
97
+ onCascadingRowExpand: ll,
99
98
  totalItems: et,
100
99
  showRecordCount: De = !1,
101
- getInnerRowData: nl,
102
- maxLevel: sl,
103
- expandedRows: ol = {},
104
- setExpandedRows: al,
105
- showNewItem: il,
100
+ getInnerRowData: rl,
101
+ maxLevel: nl,
102
+ expandedRows: sl = {},
103
+ setExpandedRows: ol,
104
+ showNewItem: al,
106
105
  rawData: tt,
107
- dragConfig: cl,
108
- isOverlayLoading: ul,
109
- style: dl = {},
106
+ dragConfig: il,
107
+ isOverlayLoading: cl,
108
+ style: ul = {},
110
109
  floatingBarConfig: Ae,
111
- rowWrapper: hl,
112
- rowLinkConfig: ml,
113
- isCellClickDisabled: pl,
110
+ rowWrapper: dl,
111
+ rowLinkConfig: hl,
112
+ isCellClickDisabled: ml,
114
113
  setHeaderOnParent: Ee,
115
- optimizeTable: vl = !1,
116
- multiSelectConfig: fl,
117
- headerContextOptions: wl,
118
- showHeaderContextOptions: Fl,
119
- setShowHeaderContextOptions: Sl,
120
- showDataTypeIcon: bl = !1,
114
+ optimizeTable: pl = !1,
115
+ multiSelectConfig: vl,
116
+ headerContextOptions: fl,
117
+ showHeaderContextOptions: wl,
118
+ setShowHeaderContextOptions: Fl,
119
+ showDataTypeIcon: Sl = !1,
121
120
  rowAdditionalActions: de,
122
121
  rowAdditionalActionsWidth: Oe,
123
122
  setVisibleHeaders: _e,
124
- cellEditing: xl = null,
125
- cellEditingValue: Tl = null,
126
- allowInlineEdit: yl = !1,
127
- onFieldOperationFlow: Nl,
123
+ cellEditing: bl = null,
124
+ cellEditingValue: xl = null,
125
+ allowInlineEdit: Tl = !1,
126
+ onFieldOperationFlow: yl,
128
127
  fieldOperationLoading: I = null,
129
128
  onTableActionsReady: ke,
130
129
  onPendingEditsChange: lt,
131
130
  onCancelPendingEdits: P
132
131
  }) => {
133
- const a = Er(), Dl = sn(on()), Al = !!N?.search, rt = n?.columnFilters?.length > 0, q = Al || rt, El = !!V, D = a?.getTableView?.(g) ?? null, [x, U] = p(D || null), [Re, Me] = p(!1), [Le, nt] = p(!1), [Ol, st] = p(null), [w, ge] = p(E), ot = (m.length === 0 || !w.length) && !se, [at, he] = p(null), [_l, kl] = p(!1), [Rl, Ml] = p(null), [Ll, gl] = p(!1), [Vl, me] = p(null), [jl, pe] = p(null), [Il, it] = p({}), [J, Ve] = p(null), [Pl, ct] = p(!1), [O, Bl] = p(0), je = A(null), Ie = A(null), [ut, Wl] = p({ width: 0, height: 0 }), [Hl, B] = p(null), [_, dt] = p(null), [$l, ht] = p(null), [mt, pt] = p(null), [Pe, G] = p({}), Be = A(!1), ve = A(!1), We = A(x);
132
+ const a = Ar(), Nl = nn(sn()), Dl = !!N?.search, rt = n?.columnFilters?.length > 0, q = Dl || rt, Al = !!V, D = a?.getTableView?.(g) ?? null, [x, U] = p(D || null), [Re, Me] = p(!1), [Le, nt] = p(!1), [El, st] = p(null), [w, ge] = p(E), ot = (m.length === 0 || !w.length) && !se, [at, he] = p(null), [Ol, _l] = p(!1), [kl, Rl] = p(null), [Ml, Ll] = p(!1), [gl, me] = p(null), [Vl, pe] = p(null), [jl, it] = p({}), [J, Ve] = p(null), [Il, ct] = p(!1), [O, Pl] = p(0), je = A(null), Ie = A(null), [ut, Bl] = p({ width: 0, height: 0 }), [Wl, B] = p(null), [_, dt] = p(null), [Hl, ht] = p(null), [mt, pt] = p(null), [Pe, G] = p({}), Be = A(!1), ve = A(!1), We = A(x);
134
133
  We.current = x;
135
134
  const vt = A(a);
136
135
  vt.current = a;
@@ -159,7 +158,7 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
159
158
  y(() => {
160
159
  ke && ke({ addPendingEdit: He, hasPendingEdits: bt });
161
160
  }, [ke, He, bt]);
162
- const zl = c((e, t) => {
161
+ const $l = c((e, t) => {
163
162
  k((l) => {
164
163
  const r = { ...l };
165
164
  if (r[e]) {
@@ -168,10 +167,10 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
168
167
  }
169
168
  return r;
170
169
  });
171
- }, []), ql = c(
170
+ }, []), zl = c(
172
171
  (e, t) => d[e]?.[t],
173
172
  [d]
174
- ), Ul = c(
173
+ ), ql = c(
175
174
  (e, t) => !!d[e]?.[t],
176
175
  [d]
177
176
  ), xt = c(() => {
@@ -182,18 +181,18 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
182
181
  a?.dispatchEvent?.("SCROLL_TO_TABLE_ROW", { rowIndex: l });
183
182
  const r = w.findIndex((o) => o.key === t);
184
183
  setTimeout(() => {
185
- const o = document.querySelector(`[${Jr}="${e}"] [${Gr}="${t}"]`);
184
+ const o = document.querySelector(`[${Ur}="${e}"] [${Jr}="${t}"]`);
186
185
  if (o)
187
186
  o.scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
188
187
  else if (r > 0) {
189
- const i = document.querySelector(Xr);
188
+ const i = document.querySelector(Gr);
190
189
  if (i) {
191
190
  let F = 0;
192
191
  for (let v = 0; v < r; v++) {
193
192
  const T = w[v];
194
- T?.sticky || (F += T?.width || Yr);
193
+ T?.sticky || (F += T?.width || Xr);
195
194
  }
196
- F = Math.max(0, F - Zr), i.scrollTo({ left: F, behavior: "smooth" });
195
+ F = Math.max(0, F - Yr), i.scrollTo({ left: F, behavior: "smooth" });
197
196
  }
198
197
  }
199
198
  B({ rowId: e, columnKey: t });
@@ -235,7 +234,7 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
235
234
  }), o.push({ ...T, __editedFields: L });
236
235
  }
237
236
  }), o.length > 0 && (j ? j(o) : R && R(null, null, null, null, null, { isBulk: !0, rows: o })), k({}), G({}), B(null);
238
- }, [d, m, R, j, X, we, W, a]), Jl = c(
237
+ }, [d, m, R, j, X, we, W, a]), Ul = c(
239
238
  (e) => {
240
239
  if (I) return;
241
240
  const t = d[e];
@@ -250,7 +249,7 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
250
249
  }), B(null);
251
250
  },
252
251
  [I, P, d]
253
- ), Gl = c(
252
+ ), Jl = c(
254
253
  (e) => {
255
254
  const t = d[e];
256
255
  if (!t || Object.keys(t).length === 0) return;
@@ -284,7 +283,7 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
284
283
  y(() => {
285
284
  lt?.(H > 0, H);
286
285
  }, [H, lt]);
287
- const Xl = $(() => {
286
+ const Gl = $(() => {
288
287
  const e = [];
289
288
  return Object.entries(d).forEach(([t, l]) => {
290
289
  const r = m.findIndex((o) => o.id === t);
@@ -293,28 +292,28 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
293
292
  e.push({ rowId: t, columnKey: o, fieldName: F?.Header || F?.display_name || o, value: i.value, originalValue: i.originalValue, meta: i.meta, originalMeta: i.originalMeta, rowIndex: r });
294
293
  });
295
294
  }), e;
296
- }, [d, w, m]), Yl = $(() => {
295
+ }, [d, w, m]), Xl = $(() => {
297
296
  const e = /* @__PURE__ */ new Map();
298
297
  return Object.entries(d).forEach(([t, l]) => {
299
298
  const r = m.findIndex((o) => o.id === t);
300
299
  e.set(t, { rowId: t, rowIndex: r, editCount: Object.keys(l).length });
301
300
  }), Array.from(e.values()).sort((t, l) => t.rowIndex - l.rowIndex);
302
- }, [d, m]), Zl = c((e) => dt(e), []), Fe = c(() => dt(null), []), Cl = c(
301
+ }, [d, m]), Yl = c((e) => dt(e), []), Fe = c(() => dt(null), []), Zl = c(
303
302
  (e, t) => {
304
303
  ht({ value: e, reference: t }), _?.onSelected && _.onSelected(e, t), Fe();
305
304
  },
306
305
  [_, Fe]
307
- ), Ql = c(() => ht(null), []), Kl = c((e) => pt(e), []), yt = c(() => pt(null), []), er = c((e, t) => {
306
+ ), Cl = c(() => ht(null), []), Ql = c((e) => pt(e), []), yt = c(() => pt(null), []), Kl = c((e, t) => {
308
307
  G((l) => ({ ...l, [e]: t }));
309
- }, []), tr = c(
308
+ }, []), er = c(
310
309
  (e) => Pe[e],
311
310
  [Pe]
312
- ), lr = $(() => {
311
+ ), tr = $(() => {
313
312
  const e = ie.match(/h-\[(\d+px)\]/);
314
313
  if (e) return e[1];
315
314
  const t = ie.match(/h-\[(calc\(.+\))\]/);
316
315
  if (t) return t[1].replace(/([+-])/g, " $1 ").replace(/\s+/g, " ");
317
- }, [ie]), rr = {
316
+ }, [ie]), lr = {
318
317
  isEmpty: ot,
319
318
  isFilters: q,
320
319
  isColumnConfigurable: oe,
@@ -322,45 +321,45 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
322
321
  emptyMessage: Xe,
323
322
  buttons: Ze,
324
323
  noDataWidget: Ye
325
- }, nr = a?.t?.(Bt) ?? Bt, Se = q ? "No Results Found" : Xe || "No Data Found", sr = typeof Se == "string" ? a?.t?.(Se) ?? Se : Se, Nt = { __isLoading: !0 }, or = new Array(1).fill(Nt), ar = new Array(ll).fill(Nt), Y = $(() => w.filter((e) => !!e?.visible), [w]), ir = Pr(
324
+ }, rr = a?.t?.(Bt) ?? Bt, Se = q ? "No Results Found" : Xe || "No Data Found", nr = typeof Se == "string" ? a?.t?.(Se) ?? Se : Se, Nt = { __isLoading: !0 }, sr = new Array(1).fill(Nt), or = new Array(tl).fill(Nt), Y = $(() => w.filter((e) => !!e?.visible), [w]), ar = Ir(
326
325
  {
327
- columns: vl ? Y : w,
328
- data: [...m, ...se ? m?.length ? or : ar : []],
329
- defaultColumn: { minWidth: en, width: Kr, maxWidth: Qr }
326
+ columns: pl ? Y : w,
327
+ data: [...m, ...se ? m?.length ? sr : or : []],
328
+ defaultColumn: { minWidth: Kr, width: Qr, maxWidth: Cr }
330
329
  },
331
- Br
332
- ), { getTableProps: Dt, getTableBodyProps: At, headerGroups: be, prepareRow: Et, rows: M } = ir;
330
+ Pr
331
+ ), { getTableProps: Dt, getTableBodyProps: At, headerGroups: be, prepareRow: Et, rows: M } = ar;
333
332
  wt.current = be;
334
- const cr = JSON.stringify(be[0]?.headers?.map((e) => e?.Header));
333
+ const ir = JSON.stringify(be[0]?.headers?.map((e) => e?.Header));
335
334
  y(() => {
336
335
  if (_e) {
337
336
  const e = wt.current;
338
337
  _e?.(e?.[0]?.headers?.map((t) => t?.Header) ?? []);
339
338
  }
340
- }, [cr, _e]);
341
- const { checkboxConfig: Ot } = Ar({
339
+ }, [ir, _e]);
340
+ const { checkboxConfig: Ot } = Dr({
342
341
  rows: M,
343
342
  checkedIds: V?.checkedIds,
344
343
  isCheckAllDisabled: V?.isCheckAllDisabled,
345
344
  selectionDisabledRowIds: V?.selectionDisabledRowIds,
346
345
  rawData: tt,
347
- onAllChecked: gl,
346
+ onAllChecked: Ll,
348
347
  setCheckedIds: V?.setCheckedIds,
349
348
  checkboxMetadata: V?.checkboxMetadata
350
- }), ur = _r(
351
- Vt(kr, { activationConstraint: { distance: Pt } }),
352
- Vt(Rr, { activationConstraint: { distance: Pt } })
353
- ), dr = { easing: nn, duration: rn };
354
- function hr() {
349
+ }), cr = Or(
350
+ Vt(_r, { activationConstraint: { distance: Pt } }),
351
+ Vt(kr, { activationConstraint: { distance: Pt } })
352
+ ), ur = { easing: rn, duration: ln };
353
+ function dr() {
355
354
  return !Ke?.length || !Ne ? M : Ke.reduce((e, t) => (e[t] = M.filter((l) => l.original?.type === t), e), {});
356
355
  }
357
- St.current = hr;
358
- const mr = (e) => {
356
+ St.current = dr;
357
+ const hr = (e) => {
359
358
  const { active: t } = e;
360
359
  Ve(M.find((l) => l.original?.id === t?.id) ?? null);
361
- }, pr = (e) => {
360
+ }, mr = (e) => {
362
361
  const { active: t, over: l } = e;
363
- l && (ue?.checkDndDragEnd && ue.checkDndDragEnd(t, l, Il, (r) => {
362
+ l && (ue?.checkDndDragEnd && ue.checkDndDragEnd(t, l, jl, (r) => {
364
363
  it(r), ct(!0), ue.onDragSuccess?.({
365
364
  draggedId: t.id,
366
365
  droppedId: l.id,
@@ -370,25 +369,25 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
370
369
  cb: () => ct(!1)
371
370
  });
372
371
  }), Ve(null));
373
- }, vr = () => Ve(null), fr = (e) => {
372
+ }, pr = () => Ve(null), vr = (e) => {
374
373
  !h?.onSort && !n?.onFilter || he(at === e ? null : e);
375
- }, wr = (e) => {
376
- Ml(e), kl(!_l), he(null);
374
+ }, fr = (e) => {
375
+ Rl(e), _l(!Ol), he(null);
377
376
  }, $e = c(() => {
378
377
  h?.onRemoveSort ? h.onRemoveSort() : h?.onSort && h.onSort("", "");
379
378
  }, [h]), xe = c((e = null) => {
380
379
  st(e), Me((t) => e ? !0 : !t);
381
- }, []), ze = c(() => nt((e) => !e), []), Fr = () => {
380
+ }, []), ze = c(() => nt((e) => !e), []), wr = () => {
382
381
  const e = be[0]?.headers?.filter((t) => t?.visible !== !1);
383
382
  for (let t = 0; t < e.length; t++)
384
383
  if (e[t].sticky) return t - 1;
385
384
  return e.length - 1;
386
- }, Sr = c(
385
+ }, Fr = c(
387
386
  (e) => {
388
387
  let t = 0;
389
388
  for (let l = e + 1; l < Y.length; l++)
390
389
  Y[l].visible !== !1 && (t += Y[l].width ?? 0);
391
- return de && (t += Oe || tn), z && (t += Ge ? 0 : ln), t;
390
+ return de && (t += Oe || en), z && (t += Ge ? 0 : tn), t;
392
391
  },
393
392
  [Y, Oe, Ge, de, z]
394
393
  ), _t = () => {
@@ -413,7 +412,7 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
413
412
  };
414
413
  };
415
414
  Ft.current = _t;
416
- const br = (e, t) => {
415
+ const Sr = (e, t) => {
417
416
  const l = _t();
418
417
  U({
419
418
  ...l,
@@ -433,12 +432,12 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
433
432
  ve.current = !1;
434
433
  }
435
434
  }, [n?.columnFilters]);
436
- const xr = c(
435
+ const br = c(
437
436
  (e) => {
438
437
  ve.current = !0, n?.onRemoveFilter?.(e);
439
438
  },
440
439
  [n?.onRemoveFilter]
441
- ), Tr = c(() => {
440
+ ), xr = c(() => {
442
441
  ve.current = !0, n?.onClearFilter?.();
443
442
  }, [n?.onClearFilter]);
444
443
  y(() => {
@@ -455,32 +454,32 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
455
454
  }), Be.current = !0) : D?.filters && Be.current && JSON.stringify(D.filters) !== JSON.stringify(fe.current?.columnFilters) && fe.current?.onFilter?.(D.filters);
456
455
  }, [D]), y(() => {
457
456
  if (je.current) {
458
- const e = new ResizeObserver((t) => Bl(t[0].contentRect.width));
457
+ const e = new ResizeObserver((t) => Pl(t[0].contentRect.width));
459
458
  return e.observe(je.current), () => e.disconnect();
460
459
  }
461
460
  }, []), y(() => {
462
461
  if (!Ie.current) return;
463
462
  const e = new ResizeObserver((t) => {
464
463
  const { width: l, height: r } = t[0].contentRect;
465
- Wl({ width: l, height: r });
464
+ Bl({ width: l, height: r });
466
465
  });
467
466
  return e.observe(Ie.current), () => e.disconnect();
468
467
  }, []);
469
468
  const kt = /* @__PURE__ */ s(
470
- qr,
469
+ zr,
471
470
  {
472
- isResizable: Kt,
471
+ isResizable: Qt,
473
472
  headerGroups: be,
474
- isCheckbox: El,
473
+ isCheckbox: Al,
475
474
  checkboxConfig: Ot,
476
- isAllChecked: Ll,
475
+ isAllChecked: Ml,
477
476
  showHeaderOptions: at ?? "",
478
477
  setShowHeaderOptions: he,
479
- isShowSortArrowAsc: Vl,
480
- isShowSortArrowDesc: jl,
478
+ isShowSortArrowAsc: gl,
479
+ isShowSortArrowDesc: Vl,
481
480
  onSort: h?.onSort,
482
481
  onFilter: n?.onFilter,
483
- toggleHeaderOption: fr,
482
+ toggleHeaderOption: vr,
484
483
  setIsShowSortArrowAsc: me,
485
484
  setIsShowSortArrowDesc: pe,
486
485
  toggleDataFilterModal: xe,
@@ -491,12 +490,11 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
491
490
  onDeleteColumnClick: Qe,
492
491
  tableActions: Je || null,
493
492
  isLoading: se,
494
- headerLoading: $t,
495
493
  rowAdditionalActions: de ?? null,
496
494
  showPendingEditsColumn: H > 0
497
495
  }
498
- ), Rt = /* @__PURE__ */ b(Dr, { children: [
499
- Pl || ul ? /* @__PURE__ */ s("div", { className: "absolute left-0 top-0 w-full h-full z-40 flex items-center justify-center bg-neutral-100 dark:bg-black-700" }) : null,
496
+ ), Rt = /* @__PURE__ */ b(Nr, { children: [
497
+ Il || cl ? /* @__PURE__ */ s("div", { className: "absolute left-0 top-0 w-full h-full z-40 flex items-center justify-center bg-neutral-100 dark:bg-black-700" }) : null,
500
498
  /* @__PURE__ */ s(
501
499
  "div",
502
500
  {
@@ -504,8 +502,8 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
504
502
  className: "w-full text-sm text-left text-neutral-500 dark:text-neutral-200 h-full bg-white dark:bg-black-800",
505
503
  children: ot ? /* @__PURE__ */ b("div", { className: "z-10", children: [
506
504
  kt,
507
- /* @__PURE__ */ s("div", { className: "absolute w-full", children: a?.renderEmpty ? a.renderEmpty(rr) : /* @__PURE__ */ b("div", { className: "flex flex-col items-center justify-center w-full h-[12rem] text-neutral-900 dark:text-neutral-200 mt-8", children: [
508
- Ye && !q ? /* @__PURE__ */ s(an, { widgetType: "TABLE" }) : /* @__PURE__ */ s(cn, { text: sr }),
505
+ /* @__PURE__ */ s("div", { className: "absolute w-full", children: a?.renderEmpty ? a.renderEmpty(lr) : /* @__PURE__ */ b("div", { className: "flex flex-col items-center justify-center w-full h-[12rem] text-neutral-900 dark:text-neutral-200 mt-8", children: [
506
+ Ye && !q ? /* @__PURE__ */ s(on, { widgetType: "TABLE" }) : /* @__PURE__ */ s(an, { text: nr }),
509
507
  oe && !q ? /* @__PURE__ */ s("div", { className: "my-4", children: /* @__PURE__ */ b(
510
508
  gt,
511
509
  {
@@ -514,29 +512,29 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
514
512
  appearance: "ghost",
515
513
  onClick: ae,
516
514
  children: [
517
- /* @__PURE__ */ s(un, { className: "text-white dark:text-white" }),
515
+ /* @__PURE__ */ s(cn, { className: "text-white dark:text-white" }),
518
516
  " ",
519
- nr
517
+ rr
520
518
  ]
521
519
  }
522
520
  ) }) : null,
523
- !q && Ze?.map((e, t) => /* @__PURE__ */ s(gt, { status: "secondary", id: hn(e.label, t), onClick: e.onClick, children: a?.t?.(e.label) ?? e.label }, `${e.label}-${t}`))
521
+ !q && Ze?.map((e, t) => /* @__PURE__ */ s(gt, { status: "secondary", id: dn(e.label, t), onClick: e.onClick, children: a?.t?.(e.label) ?? e.label }, `${e.label}-${t}`))
524
522
  ] }) })
525
523
  ] }) : /* @__PURE__ */ s(
526
- dn,
524
+ un,
527
525
  {
528
526
  style: { width: "100%", height: "100%" },
529
527
  renderProp: ({ width: e, height: t }) => {
530
528
  const l = e > 0 ? e : ut.width, r = t > 0 ? t : ut.height;
531
529
  return l > 0 && r > 0 ? /* @__PURE__ */ s(
532
- Wr,
530
+ Br,
533
531
  {
534
532
  getTableBodyProps: At,
535
533
  rows: M,
536
534
  prepareRow: Et,
537
535
  isLoading: se,
538
- onScroll: zt,
539
- onScrolling: qt,
536
+ onScroll: $t,
537
+ onScrolling: zt,
540
538
  columns: E,
541
539
  width: l,
542
540
  height: r,
@@ -549,10 +547,10 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
549
547
  )
550
548
  }
551
549
  )
552
- ] }), yr = jt((e, t) => /* @__PURE__ */ b("div", { className: "h-full w-full", ...e, ref: t, children: [
550
+ ] }), Tr = jt((e, t) => /* @__PURE__ */ b("div", { className: "h-full w-full", ...e, ref: t, children: [
553
551
  kt,
554
552
  /* @__PURE__ */ s("div", { className: "relative w-full h-full", children: e?.children })
555
- ] })), Nr = jt((e, t) => /* @__PURE__ */ s("div", { className: "h-full w-full", ...e, ref: t, children: /* @__PURE__ */ s("div", { className: "relative w-full h-full", children: e?.children }) })), qe = $(() => a?.renderTableHeader ? a.renderTableHeader({
553
+ ] })), yr = jt((e, t) => /* @__PURE__ */ s("div", { className: "h-full w-full", ...e, ref: t, children: /* @__PURE__ */ s("div", { className: "relative w-full h-full", children: e?.children }) })), qe = $(() => a?.renderTableHeader ? a.renderTableHeader({
556
554
  tableKey: g,
557
555
  search: N?.search,
558
556
  handleSearch: N?.handleSearch,
@@ -624,12 +622,12 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
624
622
  return y(() => {
625
623
  Ee && Ee(qe);
626
624
  }, [qe, Ee]), /* @__PURE__ */ b(
627
- $r.Provider,
625
+ Hr.Provider,
628
626
  {
629
627
  value: {
630
- tableWrapper: yr,
631
- tableBodyWrapper: Nr,
632
- lastNonStickyColumnIndex: Fr,
628
+ tableWrapper: Tr,
629
+ tableBodyWrapper: yr,
630
+ lastNonStickyColumnIndex: wr,
633
631
  search: N?.search,
634
632
  columnFilters: n?.columnFilters,
635
633
  onRowClick: Ht,
@@ -646,70 +644,70 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
646
644
  onAddColumnClick: ae,
647
645
  onEditColumnClick: Ce,
648
646
  onDeleteColumnClick: Qe,
649
- onRowTooltipClick: Ut,
650
- tooltiptext: Jt,
651
- cascadingTableConfig: Gt,
652
- activeInlineEdit: Hl,
647
+ onRowTooltipClick: qt,
648
+ tooltiptext: Ut,
649
+ cascadingTableConfig: Jt,
650
+ activeInlineEdit: Wl,
653
651
  setActiveInlineEdit: B,
654
- originalsOnly: Xt,
655
- disableOptionsForRowIndex: Yt,
656
- getFullRowDataOnClick: Zt,
657
- selectedRowId: Ct,
658
- getSumOfNextVisibleColumnWidth: Sr,
652
+ originalsOnly: Gt,
653
+ disableOptionsForRowIndex: Xt,
654
+ getFullRowDataOnClick: Yt,
655
+ selectedRowId: Zt,
656
+ getSumOfNextVisibleColumnWidth: Fr,
659
657
  onRowEdit: R,
660
- inlineEditColumns: Qt,
658
+ inlineEditColumns: Ct,
661
659
  tableActions: Je,
662
660
  dndSortableUtils: ue,
663
661
  withSortable: Ne,
664
- withDraggable: el,
665
- onCascadingRowExpand: rl,
666
- getInnerRowData: nl,
662
+ withDraggable: Kt,
663
+ onCascadingRowExpand: ll,
664
+ getInnerRowData: rl,
667
665
  tableHeaders: w,
668
- maxLevel: sl,
669
- expandedRows: ol,
670
- setExpandedRows: al,
671
- showNewItem: il,
666
+ maxLevel: nl,
667
+ expandedRows: sl,
668
+ setExpandedRows: ol,
669
+ showNewItem: al,
672
670
  rawData: tt,
673
- dragConfig: cl,
674
- rowWrapper: hl,
675
- rowLinkConfig: ml,
676
- isCellClickDisabled: pl,
671
+ dragConfig: il,
672
+ rowWrapper: dl,
673
+ rowLinkConfig: hl,
674
+ isCellClickDisabled: ml,
677
675
  asyncRowOptionsFilter: n?.asyncRowOptionsFilter,
678
- handleUpdateColumnWidth: br,
679
- multiSelectConfig: fl,
680
- headerContextOptions: wl,
681
- showHeaderContextOptions: Fl,
682
- setShowHeaderContextOptions: Sl,
676
+ handleUpdateColumnWidth: Sr,
677
+ multiSelectConfig: vl,
678
+ headerContextOptions: fl,
679
+ showHeaderContextOptions: wl,
680
+ setShowHeaderContextOptions: Fl,
683
681
  headerDivWidth: O,
684
- showDataTypeIcon: bl,
682
+ showDataTypeIcon: Sl,
685
683
  rowAdditionalActions: de,
686
684
  hoverConfig: Wt,
687
685
  rowAdditionalActionsWidth: Oe,
688
- cellEditing: xl,
689
- cellEditingValue: Tl,
690
- openMasterDataModal: Zl,
686
+ cellEditing: bl,
687
+ cellEditingValue: xl,
688
+ openMasterDataModal: Yl,
691
689
  closeMasterDataModal: Fe,
692
- selectedMasterData: $l,
693
- clearSelectedMasterData: Ql,
694
- allowInlineEdit: yl,
695
- openCurrencyDropdown: Kl,
690
+ selectedMasterData: Hl,
691
+ clearSelectedMasterData: Cl,
692
+ allowInlineEdit: Tl,
693
+ openCurrencyDropdown: Ql,
696
694
  closeCurrencyDropdown: yt,
697
695
  currencyDropdownConfig: mt,
698
696
  selectedCurrenciesMap: Pe,
699
- setCurrencyForCell: er,
700
- getCurrencyForCell: tr,
697
+ setCurrencyForCell: Kl,
698
+ getCurrencyForCell: er,
701
699
  pendingEdits: d,
702
700
  addPendingEdit: He,
703
- removePendingEdit: zl,
704
- getPendingEdit: ql,
705
- hasPendingEdit: Ul,
701
+ removePendingEdit: $l,
702
+ getPendingEdit: zl,
703
+ hasPendingEdit: ql,
706
704
  clearAllPendingEdits: xt,
707
705
  saveAllPendingEdits: Tt,
708
- clearRowPendingEdits: Jl,
709
- saveRowPendingEdits: Gl,
706
+ clearRowPendingEdits: Ul,
707
+ saveRowPendingEdits: Jl,
710
708
  pendingEditsCount: H,
711
709
  scrollToCell: W,
712
- onFieldOperationFlow: Nl,
710
+ onFieldOperationFlow: yl,
713
711
  fieldOperationLoading: I,
714
712
  validateAllPendingEdits: X
715
713
  },
@@ -782,8 +780,8 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
782
780
  Re ? /* @__PURE__ */ b("div", { className: "flex gap-2 items-center", children: [
783
781
  (rt || n?.onResetFilter) && a?.renderActiveFilters && a.renderActiveFilters({
784
782
  filters: n?.columnFilters,
785
- onRemoveFilter: xr,
786
- onClearFilter: Tr,
783
+ onRemoveFilter: br,
784
+ onClearFilter: xr,
787
785
  onResetFilter: n?.onResetFilter,
788
786
  onFilter: n?.onFilter,
789
787
  tableHeaders: w,
@@ -802,12 +800,12 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
802
800
  }),
803
801
  a?.renderFilterButtons && a.renderFilterButtons({
804
802
  onClearFilter: n?.onClearFilter,
805
- onClose: wr,
803
+ onClose: fr,
806
804
  modelName: C,
807
805
  enableMasterDataEnumSuggestions: Q,
808
- defaultFilterColumn: Ol,
806
+ defaultFilterColumn: El,
809
807
  resetDefaultFilterColumn: () => st(null),
810
- column: Rl,
808
+ column: kl,
811
809
  onFilter: n?.onFilter,
812
810
  tableHeaders: w,
813
811
  columnFilters: n?.columnFilters,
@@ -822,7 +820,7 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
822
820
  })
823
821
  ] }) : null
824
822
  ] }) }) : null,
825
- Ae && Object.keys(Ae).length ? /* @__PURE__ */ s(Or, { ...Ae }) : null,
823
+ Ae && Object.keys(Ae).length ? /* @__PURE__ */ s(Er, { ...Ae }) : null,
826
824
  !ye && De ? /* @__PURE__ */ b("div", { className: "flex items-center gap-1.5 mb-2", children: [
827
825
  /* @__PURE__ */ b(
828
826
  "svg",
@@ -855,15 +853,15 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
855
853
  ref: Ie,
856
854
  className: `w-full ${ce ? "h-auto" : ie} rounded-lg relative border overflow-x-hidden`,
857
855
  style: {
858
- ...ce ? { height: m?.length > 0 ? `${(m?.length + 1) * Dl + 4}px` : "350px" } : { height: lr },
859
- ...dl
856
+ ...ce ? { height: m?.length > 0 ? `${(m?.length + 1) * Nl + 4}px` : "350px" } : { height: tr },
857
+ ...ul
860
858
  },
861
- children: tl ? Rt : /* @__PURE__ */ b(Mr, { sensors: ur, onDragEnd: pr, onDragStart: mr, onDragCancel: vr, collisionDetection: Lr, children: [
859
+ children: el ? Rt : /* @__PURE__ */ b(Rr, { sensors: cr, onDragEnd: mr, onDragStart: hr, onDragCancel: pr, collisionDetection: Mr, children: [
862
860
  Rt,
863
- J ? Ir(
864
- /* @__PURE__ */ s(gr, { adjustScale: !0, dropAnimation: dr, children: /* @__PURE__ */ s("table", { ...Dt(), className: "w-full text-sm text-left text-neutral-500 dark:text-neutral-200 bg-white dark:bg-black-700 table-auto border-collapse", children: /* @__PURE__ */ b("tbody", { ...At(), className: "bg-transparent divide-y divide-neutral-200", children: [
861
+ J ? jr(
862
+ /* @__PURE__ */ s(Lr, { adjustScale: !0, dropAnimation: ur, children: /* @__PURE__ */ s("table", { ...Dt(), className: "w-full text-sm text-left text-neutral-500 dark:text-neutral-200 bg-white dark:bg-black-700 table-auto border-collapse", children: /* @__PURE__ */ b("tbody", { ...At(), className: "bg-transparent divide-y divide-neutral-200", children: [
865
863
  void Et(J),
866
- /* @__PURE__ */ s(Hr, { row: J, index: M?.findIndex((e) => e.id === J.original.id) }, J.original.id)
864
+ /* @__PURE__ */ s(Wr, { row: J, index: M?.findIndex((e) => e.id === J.original.id) }, J.original.id)
867
865
  ] }) }) }),
868
866
  document.getElementById("full-screen-container") || document.body
869
867
  ) : null
@@ -873,7 +871,7 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
873
871
  ce && a?.renderPagination ? a.renderPagination(ce) : null,
874
872
  a?.renderMasterDataModal && a.renderMasterDataModal({
875
873
  isVisible: !!_,
876
- onSelected: Cl,
874
+ onSelected: Zl,
877
875
  onClose: Fe,
878
876
  masterDataColumnName: _?.masterDataColumnName,
879
877
  masterDataFilters: _?.masterDataFilters,
@@ -881,13 +879,13 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
881
879
  masterDataId: _?.masterDataName,
882
880
  showFilters: !0
883
881
  }),
884
- /* @__PURE__ */ s(zr, { config: mt, onClose: yt }),
882
+ /* @__PURE__ */ s($r, { config: mt, onClose: yt }),
885
883
  /* @__PURE__ */ s(
886
- Ur,
884
+ qr,
887
885
  {
888
886
  pendingEditsCount: H,
889
- pendingEditsList: Xl,
890
- rowsWithPendingEdits: Yl,
887
+ pendingEditsList: Gl,
888
+ rowsWithPendingEdits: Xl,
891
889
  fieldOperationLoading: I,
892
890
  onClearAll: xt,
893
891
  onSaveAll: Tt,
@@ -900,6 +898,6 @@ const dn = jr, Bt = "Create Column", hn = (g, N) => `button-admin-${g.toLowerCas
900
898
  }
901
899
  );
902
900
  export {
903
- In as InfiniteTable
901
+ jn as InfiniteTable
904
902
  };
905
903
  //# sourceMappingURL=index.es.js.map