@lax-wp/design-system 0.13.61 → 0.13.63

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,4 +1,4 @@
1
- import { jsx as s, jsxs as b, Fragment as Dr } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as b, Fragment as Nr } from "react/jsx-runtime";
2
2
  import { useCheckbox as Or } from "../../../hooks/useCheckbox.es.js";
3
3
  import { useTableConfig as Ar } from "../../../providers/design-system-provider/hooks.es.js";
4
4
  import { canEditTableView as Er, mergeViewColumnsWithTableColumns as Vt } from "../../../utils/table.es.js";
@@ -22,10 +22,14 @@ import { getRowSlotHeight as on, useRowHeight as an } from "./useRowHeight.es.js
22
22
  import { NoDataFoundWidgets as cn } from "../empty-state/NoDataFoundWidgets.es.js";
23
23
  import { NoDataFound as un } from "../empty-state/NoDataFound.es.js";
24
24
  import { Add2Icon as dn } from "../../icon/icons.generated.es.js";
25
- const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCase().trim().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, "") || N}`, Pn = Ir.memo(
25
+ const hn = jr, Wt = "Create Column", mn = (g, D) => `button-admin-${g.toLowerCase().trim().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, "") || D}`, Pn = Ir.memo(
26
26
  ({
27
27
  tableKey: g,
28
- searchConfig: N = { search: "", handleSearch: () => null, allowAStarSearch: !1 },
28
+ searchConfig: D = {
29
+ search: "",
30
+ handleSearch: () => null,
31
+ allowAStarSearch: !1
32
+ },
29
33
  filterConfig: n = {
30
34
  columnFilters: [],
31
35
  onFilter: () => null,
@@ -34,7 +38,11 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
34
38
  onResetFilter: () => Promise.resolve({}),
35
39
  asyncRowOptionsFilter: () => Promise.resolve({})
36
40
  },
37
- sortConfig: h = { onSort: () => null, columnSort: { field: "", order: "" }, onRemoveSort: () => null },
41
+ sortConfig: h = {
42
+ onSort: () => null,
43
+ columnSort: { field: "", order: "" },
44
+ onRemoveSort: () => null
45
+ },
38
46
  headerConfig: u = {
39
47
  showExportButton: null,
40
48
  showFilters: !0,
@@ -60,7 +68,7 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
60
68
  enumSuggestionsData: se,
61
69
  data: m = [],
62
70
  onRowClick: $t,
63
- showHeader: Ne,
71
+ showHeader: De,
64
72
  tableActions: Ge,
65
73
  rowOptions: U,
66
74
  hideRowOptionWidth: Xe,
@@ -68,8 +76,8 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
68
76
  isLoading: oe = !1,
69
77
  onScroll: zt,
70
78
  onScrolling: Ut,
71
- isColumnConfigurable: ie,
72
- onAddColumnClick: ae,
79
+ isColumnConfigurable: ae,
80
+ onAddColumnClick: ie,
73
81
  emptyMessage: Ye,
74
82
  noDataWidget: Ze,
75
83
  buttons: Ce,
@@ -90,7 +98,7 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
90
98
  paginationConfig: ue,
91
99
  dndSortableUtils: de,
92
100
  multipleContexts: et,
93
- withSortable: De,
101
+ withSortable: Ne,
94
102
  withDraggable: el,
95
103
  enableRootDrag: tl,
96
104
  pageSize: ll = Qr,
@@ -100,8 +108,8 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
100
108
  getInnerRowData: nl,
101
109
  maxLevel: sl,
102
110
  expandedRows: ol = {},
103
- setExpandedRows: il,
104
- showNewItem: al,
111
+ setExpandedRows: al,
112
+ showNewItem: il,
105
113
  rawData: lt,
106
114
  dragConfig: cl,
107
115
  isOverlayLoading: ul,
@@ -123,51 +131,85 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
123
131
  cellEditing: xl = null,
124
132
  cellEditingValue: Tl = null,
125
133
  allowInlineEdit: yl = !1,
126
- onFieldOperationFlow: Nl,
134
+ onFieldOperationFlow: Dl,
127
135
  fieldOperationLoading: P = null,
128
136
  onTableActionsReady: ke,
129
137
  onPendingEditsChange: rt,
130
138
  onCancelPendingEdits: B
131
139
  }) => {
132
- const i = Ar(), Dl = on(an()), Ol = !!N?.search, nt = n?.columnFilters?.length > 0, q = Ol || nt, Al = !!I, D = i?.getTableView?.(g) ?? null, [x, J] = p(D || null), M = !Er(x, i?.getUserId?.()), [Me, Le] = p(!1), [Ve, st] = p(!1), [El, ot] = p(null), [w, ge] = p(A), it = (m.length === 0 || !w.length) && !oe, [at, me] = p(null), [_l, Rl] = p(!1), [kl, Ml] = p(null), [Ll, Vl] = p(!1), [gl, pe] = p(null), [Il, ve] = p(null), [jl, ct] = p({}), [G, Ie] = p(null), [Pl, ut] = p(!1), [E, Bl] = p(0), je = O(null), Pe = O(null), [dt, Wl] = p({ width: 0, height: 0 }), [Hl, W] = p(null), [_, ht] = p(null), [$l, mt] = p(null), [pt, vt] = p(null), [Be, X] = p({}), We = O(!1), fe = O(!1), He = O(x);
140
+ const a = Ar(), Nl = on(an()), Ol = !!D?.search, nt = n?.columnFilters?.length > 0, q = Ol || nt, Al = !!I, N = a?.getTableView?.(g) ?? null, [x, J] = p(N || null), M = !Er(
141
+ x,
142
+ a?.getUserId?.()
143
+ ), [Me, Le] = p(!1), [Ve, st] = p(!1), [El, ot] = p(null), [w, ge] = p(A), at = (m.length === 0 || !w.length) && !oe, [it, me] = p(
144
+ null
145
+ ), [_l, Rl] = p(!1), [kl, Ml] = p(null), [Ll, Vl] = p(!1), [gl, pe] = p(
146
+ null
147
+ ), [Il, ve] = p(null), [jl, ct] = p({}), [G, Ie] = p(
148
+ null
149
+ ), [Pl, ut] = p(!1), [E, Bl] = p(0), je = O(null), Pe = O(null), [dt, Wl] = p({
150
+ width: 0,
151
+ height: 0
152
+ }), [Hl, W] = p(null), [_, ht] = p(null), [$l, mt] = p(null), [pt, vt] = p(null), [Be, X] = p({}), We = O(!1), fe = O(!1), He = O(x);
133
153
  He.current = x;
134
- const ft = O(i);
135
- ft.current = i;
154
+ const ft = O(a);
155
+ ft.current = a;
136
156
  const wt = O(A);
137
157
  wt.current = A;
138
158
  const we = O(n);
139
159
  we.current = n;
140
- const Ft = O(null), St = O(() => ({})), bt = O(() => ({})), [d, R] = p({}), $e = c(
160
+ const Ft = O(null), St = O(
161
+ () => ({})
162
+ ), bt = O(() => ({})), [d, R] = p({}), $e = c(
141
163
  (e, t, l) => {
142
164
  R((r) => {
143
165
  const o = r[e]?.[t];
144
- let a = l.validationError;
145
- if (a === void 0) {
166
+ let i = l.validationError;
167
+ if (i === void 0) {
146
168
  const F = w.find((v) => v.key === t);
147
169
  if (F) {
148
- const v = Pt(l.value, F);
149
- a = v.isValid ? null : v.error || "Invalid";
170
+ const v = Pt(
171
+ l.value,
172
+ F
173
+ );
174
+ i = v.isValid ? null : v.error || "Invalid";
150
175
  } else
151
- a = o?.validationError ?? null;
176
+ i = o?.validationError ?? null;
152
177
  }
153
- return { ...r, [e]: { ...r[e] || {}, [t]: { ...l, validationError: a ?? null } } };
178
+ return {
179
+ ...r,
180
+ [e]: {
181
+ ...r[e] || {},
182
+ [t]: {
183
+ ...l,
184
+ validationError: i ?? null
185
+ }
186
+ }
187
+ };
154
188
  });
155
189
  },
156
190
  [w]
157
- ), xt = c(() => Object.values(d).some((e) => Object.keys(e).length > 0), [d]);
191
+ ), xt = c(() => Object.values(d).some(
192
+ (e) => Object.keys(e).length > 0
193
+ ), [d]);
158
194
  y(() => {
159
- ke && ke({ addPendingEdit: $e, hasPendingEdits: xt });
160
- }, [ke, $e, xt]);
161
- const zl = c((e, t) => {
162
- R((l) => {
163
- const r = { ...l };
164
- if (r[e]) {
165
- const { [t]: o, ...a } = r[e];
166
- Object.keys(a).length === 0 ? delete r[e] : r[e] = a;
167
- }
168
- return r;
195
+ ke && ke({
196
+ addPendingEdit: $e,
197
+ hasPendingEdits: xt
169
198
  });
170
- }, []), Ul = c(
199
+ }, [ke, $e, xt]);
200
+ const zl = c(
201
+ (e, t) => {
202
+ R((l) => {
203
+ const r = { ...l };
204
+ if (r[e]) {
205
+ const { [t]: o, ...i } = r[e];
206
+ Object.keys(i).length === 0 ? delete r[e] : r[e] = i;
207
+ }
208
+ return r;
209
+ });
210
+ },
211
+ []
212
+ ), Ul = c(
171
213
  (e, t) => d[e]?.[t],
172
214
  [d]
173
215
  ), ql = c(
@@ -178,36 +220,59 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
178
220
  }, [P, B, d]), H = c(
179
221
  (e, t, l) => {
180
222
  setTimeout(() => {
181
- i?.dispatchEvent?.("SCROLL_TO_TABLE_ROW", { rowIndex: l });
182
- const r = w.findIndex((o) => o.key === t);
223
+ a?.dispatchEvent?.("SCROLL_TO_TABLE_ROW", { rowIndex: l });
224
+ const r = w.findIndex(
225
+ (o) => o.key === t
226
+ );
183
227
  setTimeout(() => {
184
- const o = document.querySelector(`[${Gr}="${e}"] [${Xr}="${t}"]`);
228
+ const o = document.querySelector(
229
+ `[${Gr}="${e}"] [${Xr}="${t}"]`
230
+ );
185
231
  if (o)
186
- o.scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
232
+ o.scrollIntoView({
233
+ behavior: "smooth",
234
+ block: "center",
235
+ inline: "center"
236
+ });
187
237
  else if (r > 0) {
188
- const a = document.querySelector(Yr);
189
- if (a) {
238
+ const i = document.querySelector(Yr);
239
+ if (i) {
190
240
  let F = 0;
191
241
  for (let v = 0; v < r; v++) {
192
242
  const T = w[v];
193
243
  T?.sticky || (F += T?.width || Zr);
194
244
  }
195
- F = Math.max(0, F - Cr), a.scrollTo({ left: F, behavior: "smooth" });
245
+ F = Math.max(
246
+ 0,
247
+ F - Cr
248
+ ), i.scrollTo({
249
+ left: F,
250
+ behavior: "smooth"
251
+ });
196
252
  }
197
253
  }
198
254
  W({ rowId: e, columnKey: t });
199
255
  }, 350);
200
256
  }, 100);
201
257
  },
202
- [w, i]
258
+ [w, a]
203
259
  ), Y = c(
204
260
  (e) => {
205
261
  let t = !1, l = null;
206
262
  const r = {}, o = /* @__PURE__ */ new Set();
207
- return Object.entries(e).forEach(([a, F]) => {
208
- r[a] = {}, Object.entries(F).forEach(([v, T]) => {
209
- const V = w.find((S) => S.key === v), f = Pt(T.value, V);
210
- f.isValid ? r[a][v] = { ...T, validationError: null } : (t = !0, f.error && o.add(f.error), l || (l = { rowId: a, columnKey: v }), r[a][v] = { ...T, validationError: f.error });
263
+ return Object.entries(e).forEach(([i, F]) => {
264
+ r[i] = {}, Object.entries(F).forEach(([v, T]) => {
265
+ const V = w.find((S) => S.key === v), f = Pt(
266
+ T.value,
267
+ V
268
+ );
269
+ f.isValid ? r[i][v] = {
270
+ ...T,
271
+ validationError: null
272
+ } : (t = !0, f.error && o.add(f.error), l || (l = { rowId: i, columnKey: v }), r[i][v] = {
273
+ ...T,
274
+ validationError: f.error
275
+ });
211
276
  });
212
277
  }), { hasErrors: t, updatedEdits: r, firstError: l, errorTypes: o };
213
278
  },
@@ -218,23 +283,42 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
218
283
  }, []), yt = c(() => {
219
284
  const { hasErrors: e, updatedEdits: t, firstError: l, errorTypes: r } = Y(d);
220
285
  if (e) {
221
- if (R(t), i?.showNotification?.("error", Fe(r)), l) {
222
- const a = m.findIndex((F) => F.id === l.rowId);
223
- H(l.rowId, l.columnKey, a);
286
+ if (R(t), a?.showNotification?.(
287
+ "error",
288
+ Fe(r)
289
+ ), l) {
290
+ const i = m.findIndex(
291
+ (F) => F.id === l.rowId
292
+ );
293
+ H(l.rowId, l.columnKey, i);
224
294
  }
225
295
  return;
226
296
  }
227
297
  const o = [];
228
- Object.entries(d).forEach(([a, F]) => {
229
- const v = m.find((T) => T.id === a);
298
+ Object.entries(d).forEach(([i, F]) => {
299
+ const v = m.find(
300
+ (T) => T.id === i
301
+ );
230
302
  if (v) {
231
303
  const T = { ...v }, V = {};
232
304
  Object.entries(F).forEach(([f, S]) => {
233
305
  T[f] = S.value, V[f] = { value: S.value, meta: S.meta };
234
306
  }), o.push({ ...T, __editedFields: V });
235
307
  }
236
- }), o.length > 0 && (j ? j(o) : k && k(null, null, null, null, null, { isBulk: !0, rows: o })), R({}), X({}), W(null);
237
- }, [d, m, k, j, Y, Fe, H, i]), Jl = c(
308
+ }), o.length > 0 && (j ? j(o) : k && k(null, null, null, null, null, {
309
+ isBulk: !0,
310
+ rows: o
311
+ })), R({}), X({}), W(null);
312
+ }, [
313
+ d,
314
+ m,
315
+ k,
316
+ j,
317
+ Y,
318
+ Fe,
319
+ H,
320
+ a
321
+ ]), Jl = c(
238
322
  (e) => {
239
323
  if (P) return;
240
324
  const t = d[e];
@@ -253,22 +337,35 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
253
337
  (e) => {
254
338
  const t = d[e];
255
339
  if (!t || Object.keys(t).length === 0) return;
256
- const { hasErrors: l, updatedEdits: r, firstError: o, errorTypes: a } = Y({ [e]: t });
340
+ const { hasErrors: l, updatedEdits: r, firstError: o, errorTypes: i } = Y({ [e]: t });
257
341
  if (l) {
258
- if (R((f) => ({ ...f, [e]: r[e] })), i?.showNotification?.("error", Fe(a)), o) {
259
- const f = m.findIndex((S) => S.id === o.rowId);
342
+ if (R((f) => ({
343
+ ...f,
344
+ [e]: r[e]
345
+ })), a?.showNotification?.(
346
+ "error",
347
+ Fe(i)
348
+ ), o) {
349
+ const f = m.findIndex(
350
+ (S) => S.id === o.rowId
351
+ );
260
352
  H(o.rowId, o.columnKey, f);
261
353
  }
262
354
  return;
263
355
  }
264
- const F = m.find((f) => f.id === e);
356
+ const F = m.find(
357
+ (f) => f.id === e
358
+ );
265
359
  if (!F) return;
266
360
  const v = { ...F }, T = {};
267
361
  Object.entries(t).forEach(([f, S]) => {
268
362
  v[f] = S.value, T[f] = { value: S.value, meta: S.meta };
269
363
  });
270
364
  const V = { ...v, __editedFields: T };
271
- j ? j([V]) : k && k(null, null, null, null, null, { isBulk: !0, rows: [V] }), R((f) => {
365
+ j ? j([V]) : k && k(null, null, null, null, null, {
366
+ isBulk: !0,
367
+ rows: [V]
368
+ }), R((f) => {
272
369
  const S = { ...f };
273
370
  return delete S[e], S;
274
371
  }), X((f) => {
@@ -278,63 +375,129 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
278
375
  }), S;
279
376
  }), W(null);
280
377
  },
281
- [d, m, k, j, Y, Fe, H, i]
282
- ), $ = z(() => Object.values(d).reduce((e, t) => e + Object.keys(t).length, 0), [d]);
378
+ [
379
+ d,
380
+ m,
381
+ k,
382
+ j,
383
+ Y,
384
+ Fe,
385
+ H,
386
+ a
387
+ ]
388
+ ), $ = z(() => Object.values(d).reduce(
389
+ (e, t) => e + Object.keys(t).length,
390
+ 0
391
+ ), [d]);
283
392
  y(() => {
284
393
  rt?.($ > 0, $);
285
394
  }, [$, rt]);
286
395
  const Xl = z(() => {
287
396
  const e = [];
288
397
  return Object.entries(d).forEach(([t, l]) => {
289
- const r = m.findIndex((o) => o.id === t);
290
- Object.entries(l).forEach(([o, a]) => {
398
+ const r = m.findIndex(
399
+ (o) => o.id === t
400
+ );
401
+ Object.entries(l).forEach(([o, i]) => {
291
402
  const F = w.find((v) => v.key === o);
292
- e.push({ rowId: t, columnKey: o, fieldName: F?.Header || F?.display_name || o, value: a.value, originalValue: a.originalValue, meta: a.meta, originalMeta: a.originalMeta, rowIndex: r });
403
+ e.push({
404
+ rowId: t,
405
+ columnKey: o,
406
+ fieldName: F?.Header || F?.display_name || o,
407
+ value: i.value,
408
+ originalValue: i.originalValue,
409
+ meta: i.meta,
410
+ originalMeta: i.originalMeta,
411
+ rowIndex: r
412
+ });
293
413
  });
294
414
  }), e;
295
415
  }, [d, w, m]), Yl = z(() => {
296
416
  const e = /* @__PURE__ */ new Map();
297
417
  return Object.entries(d).forEach(([t, l]) => {
298
- const r = m.findIndex((o) => o.id === t);
299
- e.set(t, { rowId: t, rowIndex: r, editCount: Object.keys(l).length });
300
- }), Array.from(e.values()).sort((t, l) => t.rowIndex - l.rowIndex);
301
- }, [d, m]), Zl = c((e) => ht(e), []), Se = c(() => ht(null), []), Cl = c(
418
+ const r = m.findIndex(
419
+ (o) => o.id === t
420
+ );
421
+ e.set(t, {
422
+ rowId: t,
423
+ rowIndex: r,
424
+ editCount: Object.keys(l).length
425
+ });
426
+ }), Array.from(e.values()).sort(
427
+ (t, l) => t.rowIndex - l.rowIndex
428
+ );
429
+ }, [d, m]), Zl = c(
430
+ (e) => ht(e),
431
+ []
432
+ ), Se = c(
433
+ () => ht(null),
434
+ []
435
+ ), Cl = c(
302
436
  (e, t) => {
303
437
  mt({ value: e, reference: t }), _?.onSelected && _.onSelected(e, t), Se();
304
438
  },
305
439
  [_, Se]
306
- ), Ql = c(() => mt(null), []), Kl = c((e) => vt(e), []), Nt = c(() => vt(null), []), er = c((e, t) => {
307
- X((l) => ({ ...l, [e]: t }));
308
- }, []), tr = c(
440
+ ), Ql = c(
441
+ () => mt(null),
442
+ []
443
+ ), Kl = c(
444
+ (e) => vt(e),
445
+ []
446
+ ), Dt = c(
447
+ () => vt(null),
448
+ []
449
+ ), er = c(
450
+ (e, t) => {
451
+ X((l) => ({ ...l, [e]: t }));
452
+ },
453
+ []
454
+ ), tr = c(
309
455
  (e) => Be[e],
310
456
  [Be]
311
457
  ), lr = z(() => {
312
458
  const e = ce.match(/h-\[(\d+px)\]/);
313
459
  if (e) return e[1];
314
460
  const t = ce.match(/h-\[(calc\(.+\))\]/);
315
- if (t) return t[1].replace(/([+-])/g, " $1 ").replace(/\s+/g, " ");
461
+ if (t)
462
+ return t[1].replace(/([+-])/g, " $1 ").replace(/\s+/g, " ");
316
463
  }, [ce]), rr = {
317
- isEmpty: it,
464
+ isEmpty: at,
318
465
  isFilters: q,
319
- isColumnConfigurable: ie,
320
- handleOnClick: ae,
466
+ isColumnConfigurable: ae,
467
+ handleOnClick: ie,
321
468
  emptyMessage: Ye,
322
469
  buttons: Ce,
323
470
  noDataWidget: Ze
324
- }, nr = i?.t?.(Wt) ?? Wt, be = q ? "No Results Found" : Ye || "No Data Found", sr = typeof be == "string" ? i?.t?.(be) ?? be : be, Dt = { __isLoading: !0 }, or = new Array(1).fill(Dt), ir = new Array(ll).fill(Dt), Z = z(() => w.filter((e) => !!e?.visible), [w]), ar = Br(
471
+ }, nr = a?.t?.(Wt) ?? Wt, be = q ? "No Results Found" : Ye || "No Data Found", sr = typeof be == "string" ? a?.t?.(be) ?? be : be, Nt = { __isLoading: !0 }, or = new Array(1).fill(Nt), ar = new Array(ll).fill(Nt), Z = z(
472
+ () => w.filter((e) => !!e?.visible),
473
+ [w]
474
+ ), ir = Br(
325
475
  {
326
476
  columns: vl ? Z : w,
327
- data: [...m, ...oe ? m?.length ? or : ir : []],
328
- defaultColumn: { minWidth: tn, width: en, maxWidth: Kr }
477
+ data: [
478
+ ...m,
479
+ ...oe ? m?.length ? or : ar : []
480
+ ],
481
+ defaultColumn: {
482
+ minWidth: tn,
483
+ width: en,
484
+ maxWidth: Kr
485
+ }
329
486
  },
330
487
  Wr
331
- ), { getTableProps: Ot, getTableBodyProps: At, headerGroups: xe, prepareRow: Et, rows: L } = ar;
488
+ ), { getTableProps: Ot, getTableBodyProps: At, headerGroups: xe, prepareRow: Et, rows: L } = ir;
332
489
  Ft.current = xe;
333
- const cr = JSON.stringify(xe[0]?.headers?.map((e) => e?.Header));
490
+ const cr = JSON.stringify(
491
+ xe[0]?.headers?.map(
492
+ (e) => e?.Header
493
+ )
494
+ );
334
495
  y(() => {
335
496
  if (Re) {
336
497
  const e = Ft.current;
337
- Re?.(e?.[0]?.headers?.map((t) => t?.Header) ?? []);
498
+ Re?.(
499
+ e?.[0]?.headers?.map((t) => t?.Header) ?? []
500
+ );
338
501
  }
339
502
  }, [cr, Re]);
340
503
  const { checkboxConfig: _t } = Or({
@@ -347,37 +510,61 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
347
510
  setCheckedIds: I?.setCheckedIds,
348
511
  checkboxMetadata: I?.checkboxMetadata
349
512
  }), ur = Rr(
350
- It(kr, { activationConstraint: { distance: Bt } }),
351
- It(Mr, { activationConstraint: { distance: Bt } })
352
- ), dr = { easing: sn, duration: nn };
513
+ It(kr, {
514
+ activationConstraint: { distance: Bt }
515
+ }),
516
+ It(Mr, {
517
+ activationConstraint: { distance: Bt }
518
+ })
519
+ ), dr = {
520
+ easing: sn,
521
+ duration: nn
522
+ };
353
523
  function hr() {
354
- return !et?.length || !De ? L : et.reduce((e, t) => (e[t] = L.filter((l) => l.original?.type === t), e), {});
524
+ return !et?.length || !Ne ? L : et.reduce(
525
+ (e, t) => (e[t] = L.filter(
526
+ (l) => l.original?.type === t
527
+ ), e),
528
+ {}
529
+ );
355
530
  }
356
531
  bt.current = hr;
357
532
  const mr = (e) => {
358
533
  const { active: t } = e;
359
- Ie(L.find((l) => l.original?.id === t?.id) ?? null);
534
+ Ie(
535
+ L.find(
536
+ (l) => l.original?.id === t?.id
537
+ ) ?? null
538
+ );
360
539
  }, pr = (e) => {
361
540
  const { active: t, over: l } = e;
362
- l && (de?.checkDndDragEnd && de.checkDndDragEnd(t, l, jl, (r) => {
363
- ct(r), ut(!0), de.onDragSuccess?.({
364
- draggedId: t.id,
365
- droppedId: l.id,
366
- draggedType: t.data.current?.type,
367
- droppedType: l.data.current?.type,
368
- updatedList: r,
369
- cb: () => ut(!1)
370
- });
371
- }), Ie(null));
541
+ l && (de?.checkDndDragEnd && de.checkDndDragEnd(
542
+ t,
543
+ l,
544
+ jl,
545
+ (r) => {
546
+ ct(r), ut(!0), de.onDragSuccess?.({
547
+ draggedId: t.id,
548
+ droppedId: l.id,
549
+ draggedType: t.data.current?.type,
550
+ droppedType: l.data.current?.type,
551
+ updatedList: r,
552
+ cb: () => ut(!1)
553
+ });
554
+ }
555
+ ), Ie(null));
372
556
  }, vr = () => Ie(null), fr = (e) => {
373
- !h?.onSort && !n?.onFilter || me(at === e ? null : e);
557
+ !h?.onSort && !n?.onFilter || me(it === e ? null : e);
374
558
  }, wr = (e) => {
375
559
  Ml(e), Rl(!_l), me(null);
376
560
  }, ze = c(() => {
377
561
  h?.onRemoveSort ? h.onRemoveSort() : h?.onSort && h.onSort("", "");
378
562
  }, [h]), Te = c((e = null) => {
379
563
  ot(e), Le((t) => e ? !0 : !t);
380
- }, []), Ue = c(() => st((e) => !e), []), Fr = () => {
564
+ }, []), Ue = c(
565
+ () => st((e) => !e),
566
+ []
567
+ ), Fr = () => {
381
568
  const e = xe[0]?.headers?.filter((t) => t?.visible !== !1);
382
569
  for (let t = 0; t < e.length; t++)
383
570
  if (e[t].sticky) return t - 1;
@@ -389,9 +576,15 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
389
576
  Z[l].visible !== !1 && (t += Z[l].width ?? 0);
390
577
  return he && (t += _e || ln), U && (t += Xe ? 0 : rn), t;
391
578
  },
392
- [Z, _e, Xe, he, U]
579
+ [
580
+ Z,
581
+ _e,
582
+ Xe,
583
+ he,
584
+ U
585
+ ]
393
586
  ), Rt = () => {
394
- const e = i?.getUserId?.();
587
+ const e = a?.getUserId?.();
395
588
  return {
396
589
  ...x || {},
397
590
  name: x?.name || "Untitled View",
@@ -417,7 +610,9 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
417
610
  const l = Rt();
418
611
  J({
419
612
  ...l,
420
- columns: l?.columns?.map((r) => r.name === e ? { ...r, width: t } : r),
613
+ columns: l?.columns?.map(
614
+ (r) => r.name === e ? { ...r, width: t } : r
615
+ ),
421
616
  unsaved: !0
422
617
  });
423
618
  };
@@ -428,7 +623,13 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
428
623
  const t = (e?.filters?.length ?? 0) > 0, l = n?.columnFilters?.length > 0;
429
624
  if (!(t && !l && !fe.current)) {
430
625
  const o = St.current();
431
- J({ ...o, filters: JSON.parse(JSON.stringify(n?.columnFilters || [])), unsaved: !0 });
626
+ J({
627
+ ...o,
628
+ filters: JSON.parse(
629
+ JSON.stringify(n?.columnFilters || [])
630
+ ),
631
+ unsaved: !0
632
+ });
432
633
  }
433
634
  fe.current = !1;
434
635
  }
@@ -444,18 +645,32 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
444
645
  y(() => {
445
646
  h?.columnSort?.field ? (st(!0), h.columnSort.order === "asc" ? (pe(h.columnSort.field), ve(null)) : h.columnSort.order === "desc" && (ve(h.columnSort.field), pe(null))) : (pe(null), ve(null));
446
647
  }, [h?.columnSort?.field, h?.columnSort?.order]), y(() => {
447
- ge(Vt(He.current?.columns || [], A));
648
+ ge(
649
+ Vt(
650
+ He.current?.columns || [],
651
+ A
652
+ )
653
+ );
448
654
  }, [A]), y(() => {
449
655
  x?.unsaved && ft.current?.persistTableView?.(x);
450
656
  }, [x]), y(() => {
451
- ct(bt.current());
657
+ ct(
658
+ bt.current()
659
+ );
452
660
  }, [L.length]), y(() => {
453
- J(D || null), D?.columns && ge(Vt(D?.columns || [], wt.current)), D?.filters && D.filters.length > 0 && !We.current ? (requestAnimationFrame(() => {
454
- we.current?.onFilter?.(D.filters);
455
- }), We.current = !0) : D?.filters && We.current && JSON.stringify(D.filters) !== JSON.stringify(we.current?.columnFilters) && we.current?.onFilter?.(D.filters);
456
- }, [D]), y(() => {
661
+ J(N || null), N?.columns && ge(
662
+ Vt(
663
+ N?.columns || [],
664
+ wt.current
665
+ )
666
+ ), N?.filters && N.filters.length > 0 && !We.current ? (requestAnimationFrame(() => {
667
+ we.current?.onFilter?.(N.filters);
668
+ }), We.current = !0) : N?.filters && We.current && JSON.stringify(N.filters) !== JSON.stringify(we.current?.columnFilters) && we.current?.onFilter?.(N.filters);
669
+ }, [N]), y(() => {
457
670
  if (je.current) {
458
- const e = new ResizeObserver((t) => Bl(t[0].contentRect.width));
671
+ const e = new ResizeObserver(
672
+ (t) => Bl(t[0].contentRect.width)
673
+ );
459
674
  return e.observe(je.current), () => e.disconnect();
460
675
  }
461
676
  }, []), y(() => {
@@ -474,7 +689,7 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
474
689
  isCheckbox: Al,
475
690
  checkboxConfig: _t,
476
691
  isAllChecked: Ll,
477
- showHeaderOptions: at ?? "",
692
+ showHeaderOptions: it ?? "",
478
693
  setShowHeaderOptions: me,
479
694
  isShowSortArrowAsc: gl,
480
695
  isShowSortArrowDesc: Il,
@@ -485,8 +700,8 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
485
700
  setIsShowSortArrowDesc: ve,
486
701
  toggleDataFilterModal: Te,
487
702
  rowOptions: Array.isArray(U) ? U : [],
488
- isColumnConfigurable: ie ?? !1,
489
- onAddColumnClick: ae,
703
+ isColumnConfigurable: ae ?? !1,
704
+ onAddColumnClick: ie,
490
705
  onEditColumnClick: Qe,
491
706
  onDeleteColumnClick: Ke,
492
707
  tableActions: Ge || null,
@@ -494,24 +709,24 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
494
709
  rowAdditionalActions: he ?? null,
495
710
  showPendingEditsColumn: $ > 0
496
711
  }
497
- ), Mt = /* @__PURE__ */ b(Dr, { children: [
712
+ ), Mt = /* @__PURE__ */ b(Nr, { children: [
498
713
  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,
499
714
  /* @__PURE__ */ s(
500
715
  "div",
501
716
  {
502
717
  ...Ot(),
503
718
  className: "w-full text-sm text-left text-neutral-500 dark:text-neutral-200 h-full bg-white dark:bg-black-800",
504
- children: it ? /* @__PURE__ */ b("div", { className: "z-10", children: [
719
+ children: at ? /* @__PURE__ */ b("div", { className: "z-10", children: [
505
720
  kt,
506
- /* @__PURE__ */ s("div", { className: "absolute w-full", children: i?.renderEmpty ? i.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: [
721
+ /* @__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: [
507
722
  Ze && !q ? /* @__PURE__ */ s(cn, { widgetType: "TABLE" }) : /* @__PURE__ */ s(un, { text: sr }),
508
- ie && !q ? /* @__PURE__ */ s("div", { className: "my-4", children: /* @__PURE__ */ b(
723
+ ae && !q ? /* @__PURE__ */ s("div", { className: "my-4", children: /* @__PURE__ */ b(
509
724
  gt,
510
725
  {
511
726
  id: "btn-table-shell-create-column",
512
727
  status: "primary",
513
728
  appearance: "ghost",
514
- onClick: ae,
729
+ onClick: ie,
515
730
  children: [
516
731
  /* @__PURE__ */ s(dn, { className: "text-white dark:text-white" }),
517
732
  " ",
@@ -519,7 +734,16 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
519
734
  ]
520
735
  }
521
736
  ) }) : null,
522
- !q && Ce?.map((e, t) => /* @__PURE__ */ s(gt, { status: "secondary", id: mn(e.label, t), onClick: e.onClick, children: i?.t?.(e.label) ?? e.label }, `${e.label}-${t}`))
737
+ !q && Ce?.map((e, t) => /* @__PURE__ */ s(
738
+ gt,
739
+ {
740
+ status: "secondary",
741
+ id: mn(e.label, t),
742
+ onClick: e.onClick,
743
+ children: a?.t?.(e.label) ?? e.label
744
+ },
745
+ `${e.label}-${t}`
746
+ ))
523
747
  ] }) })
524
748
  ] }) : /* @__PURE__ */ s(
525
749
  hn,
@@ -539,8 +763,8 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
539
763
  columns: A,
540
764
  width: l,
541
765
  height: r,
542
- withSortable: De,
543
- allowAstarSearch: N?.allowAStarSearch || !1
766
+ withSortable: Ne,
767
+ allowAstarSearch: D?.allowAStarSearch || !1
544
768
  }
545
769
  ) : null;
546
770
  }
@@ -551,10 +775,10 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
551
775
  ] }), yr = jt((e, t) => /* @__PURE__ */ b("div", { className: "h-full w-full", ...e, ref: t, children: [
552
776
  kt,
553
777
  /* @__PURE__ */ s("div", { className: "relative w-full h-full", children: e?.children })
554
- ] })), 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 = z(() => i?.renderTableHeader ? i.renderTableHeader({
778
+ ] })), Dr = 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 = z(() => a?.renderTableHeader ? a.renderTableHeader({
555
779
  tableKey: g,
556
- search: N?.search,
557
- handleSearch: N?.handleSearch,
780
+ search: D?.search,
781
+ handleSearch: D?.handleSearch,
558
782
  toggleShowFilters: Te,
559
783
  toggleShowSorts: Ue,
560
784
  filterCounts: n?.columnFilters?.length,
@@ -578,7 +802,7 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
578
802
  showSearch: u?.showSearch,
579
803
  isLoading: !!u?.isLoading,
580
804
  setTableHeaders: ge,
581
- allowAStarSearch: !!N?.allowAStarSearch,
805
+ allowAStarSearch: !!D?.allowAStarSearch,
582
806
  withContent: !!u?.content,
583
807
  setShowFilters: Le,
584
808
  sort: h?.columnSort,
@@ -592,8 +816,8 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
592
816
  lineItemRowId: ne
593
817
  }) : null, [
594
818
  g,
595
- N?.search,
596
- N?.handleSearch,
819
+ D?.search,
820
+ D?.handleSearch,
597
821
  Te,
598
822
  Ue,
599
823
  n?.columnFilters,
@@ -611,8 +835,8 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
611
835
  h?.columnSort,
612
836
  h?.onSort,
613
837
  ze,
614
- i,
615
- N?.allowAStarSearch,
838
+ a,
839
+ D?.allowAStarSearch,
616
840
  K,
617
841
  ee,
618
842
  te,
@@ -627,9 +851,9 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
627
851
  {
628
852
  value: {
629
853
  tableWrapper: yr,
630
- tableBodyWrapper: Nr,
854
+ tableBodyWrapper: Dr,
631
855
  lastNonStickyColumnIndex: Fr,
632
- search: N?.search,
856
+ search: D?.search,
633
857
  columnFilters: n?.columnFilters,
634
858
  onRowClick: $t,
635
859
  onSort: h?.onSort,
@@ -641,8 +865,8 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
641
865
  rowOptions: U,
642
866
  checkboxConfig: _t,
643
867
  onResetFilter: n?.onResetFilter,
644
- isColumnConfigurable: ie,
645
- onAddColumnClick: ae,
868
+ isColumnConfigurable: ae,
869
+ onAddColumnClick: ie,
646
870
  onEditColumnClick: Qe,
647
871
  onDeleteColumnClick: Ke,
648
872
  onRowTooltipClick: qt,
@@ -659,15 +883,15 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
659
883
  inlineEditColumns: Qt,
660
884
  tableActions: Ge,
661
885
  dndSortableUtils: de,
662
- withSortable: De,
886
+ withSortable: Ne,
663
887
  withDraggable: el,
664
888
  onCascadingRowExpand: rl,
665
889
  getInnerRowData: nl,
666
890
  tableHeaders: w,
667
891
  maxLevel: sl,
668
892
  expandedRows: ol,
669
- setExpandedRows: il,
670
- showNewItem: al,
893
+ setExpandedRows: al,
894
+ showNewItem: il,
671
895
  rawData: lt,
672
896
  dragConfig: cl,
673
897
  rowWrapper: hl,
@@ -693,7 +917,7 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
693
917
  clearSelectedMasterData: Ql,
694
918
  allowInlineEdit: yl,
695
919
  openCurrencyDropdown: Kl,
696
- closeCurrencyDropdown: Nt,
920
+ closeCurrencyDropdown: Dt,
697
921
  currencyDropdownConfig: pt,
698
922
  selectedCurrenciesMap: Be,
699
923
  setCurrencyForCell: er,
@@ -709,12 +933,12 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
709
933
  saveRowPendingEdits: Gl,
710
934
  pendingEditsCount: $,
711
935
  scrollToCell: H,
712
- onFieldOperationFlow: Nl,
936
+ onFieldOperationFlow: Dl,
713
937
  fieldOperationLoading: P,
714
938
  validateAllPendingEdits: Y
715
939
  },
716
940
  children: [
717
- Ne ? /* @__PURE__ */ b(
941
+ De ? /* @__PURE__ */ b(
718
942
  "div",
719
943
  {
720
944
  ref: je,
@@ -725,7 +949,13 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
725
949
  {
726
950
  className: `flex items-center gap-x-2 gap-y-1 ${E < C ? "w-full flex-wrap" : ""} ${u?.content ? "min-w-0 flex-1" : "shrink-0"}`,
727
951
  children: [
728
- u?.content ? /* @__PURE__ */ s("div", { className: `min-w-0 ${E < C ? "w-full" : "flex-1"}`, children: u.content }) : null,
952
+ u?.content ? /* @__PURE__ */ s(
953
+ "div",
954
+ {
955
+ className: `min-w-0 ${E < C ? "w-full" : "flex-1"}`,
956
+ children: u.content
957
+ }
958
+ ) : null,
729
959
  Oe ? /* @__PURE__ */ b("div", { className: "flex items-center gap-1.5 shrink-0", children: [
730
960
  /* @__PURE__ */ b(
731
961
  "svg",
@@ -749,8 +979,24 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
749
979
  ]
750
980
  }
751
981
  ),
752
- /* @__PURE__ */ s(ye, { size: "small", variant: "semibold", appearance: "title", children: (tt ?? m.length).toLocaleString() }),
753
- /* @__PURE__ */ s(ye, { size: "small", variant: "regular", appearance: "subtitle", children: "total records" })
982
+ /* @__PURE__ */ s(
983
+ ye,
984
+ {
985
+ size: "small",
986
+ variant: "semibold",
987
+ appearance: "title",
988
+ children: (tt ?? m.length).toLocaleString()
989
+ }
990
+ ),
991
+ /* @__PURE__ */ s(
992
+ ye,
993
+ {
994
+ size: "small",
995
+ variant: "regular",
996
+ appearance: "subtitle",
997
+ children: "total records"
998
+ }
999
+ )
754
1000
  ] }) : u?.preContent ? /* @__PURE__ */ s("div", { className: "flex min-w-0 shrink-0 justify-start items-center", children: u.preContent }) : null
755
1001
  ]
756
1002
  }
@@ -768,7 +1014,13 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
768
1014
  children: qe
769
1015
  }
770
1016
  ),
771
- u?.postContent ? /* @__PURE__ */ s("div", { className: `flex justify-end items-center ${E < Je ? "w-full" : ""}`, children: u.postContent }) : null
1017
+ u?.postContent ? /* @__PURE__ */ s(
1018
+ "div",
1019
+ {
1020
+ className: `flex justify-end items-center ${E < Je ? "w-full" : ""}`,
1021
+ children: u.postContent
1022
+ }
1023
+ ) : null
772
1024
  ]
773
1025
  }
774
1026
  )
@@ -777,10 +1029,17 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
777
1029
  ) : null,
778
1030
  u?.showDivider ? /* @__PURE__ */ s("div", { className: "border-b pb-2 w-full dark:bg-black-800" }) : null,
779
1031
  Me || Ve ? /* @__PURE__ */ s("div", { className: "flex justify-between items-center pb-4 dark:bg-black-800", children: /* @__PURE__ */ b("div", { className: "flex gap-2 items-center", children: [
780
- Ve && i?.renderSortItem ? i.renderSortItem({ sort: h?.columnSort, onRemoveSort: ze, onSort: h?.onSort, tableHeaders: w, data: m, disabled: M }) : null,
1032
+ Ve && a?.renderSortItem ? a.renderSortItem({
1033
+ sort: h?.columnSort,
1034
+ onRemoveSort: ze,
1035
+ onSort: h?.onSort,
1036
+ tableHeaders: w,
1037
+ data: m,
1038
+ disabled: M
1039
+ }) : null,
781
1040
  Me && Ve && h?.columnSort?.field !== "" ? /* @__PURE__ */ s("div", { className: "h-8 w-[1px] flex-shrink-0 bg-neutral-200" }) : null,
782
1041
  Me ? /* @__PURE__ */ b("div", { className: "flex gap-2 items-center", children: [
783
- (nt || n?.onResetFilter) && i?.renderActiveFilters && i.renderActiveFilters({
1042
+ (nt || n?.onResetFilter) && a?.renderActiveFilters && a.renderActiveFilters({
784
1043
  filters: n?.columnFilters,
785
1044
  onRemoveFilter: xr,
786
1045
  onClearFilter: Tr,
@@ -801,7 +1060,7 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
801
1060
  lineItemRowId: ne,
802
1061
  disabled: M
803
1062
  }),
804
- i?.renderFilterButtons && i.renderFilterButtons({
1063
+ a?.renderFilterButtons && a.renderFilterButtons({
805
1064
  onClearFilter: n?.onClearFilter,
806
1065
  onClose: wr,
807
1066
  modelName: Q,
@@ -825,7 +1084,7 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
825
1084
  ] }) : null
826
1085
  ] }) }) : null,
827
1086
  Ae && Object.keys(Ae).length ? /* @__PURE__ */ s(_r, { ...Ae }) : null,
828
- !Ne && Oe ? /* @__PURE__ */ b("div", { className: "flex items-center gap-1.5 mb-2", children: [
1087
+ !De && Oe ? /* @__PURE__ */ b("div", { className: "flex items-center gap-1.5 mb-2", children: [
829
1088
  /* @__PURE__ */ b(
830
1089
  "svg",
831
1090
  {
@@ -850,40 +1109,89 @@ const hn = jr, Wt = "Create Column", mn = (g, N) => `button-admin-${g.toLowerCas
850
1109
  ),
851
1110
  /* @__PURE__ */ s(ye, { size: "small", variant: "semibold", appearance: "title", children: (tt ?? m.length).toLocaleString() }),
852
1111
  /* @__PURE__ */ s(ye, { size: "small", variant: "regular", appearance: "subtitle", children: "total records" })
853
- ] }) : !Ne && u?.preContent ? /* @__PURE__ */ s("div", { className: "flex items-center mb-2", children: u.preContent }) : null,
1112
+ ] }) : !De && u?.preContent ? /* @__PURE__ */ s("div", { className: "flex items-center mb-2", children: u.preContent }) : null,
854
1113
  /* @__PURE__ */ s(
855
1114
  "div",
856
1115
  {
857
1116
  ref: Pe,
858
1117
  className: `w-full ${ue ? "h-auto" : ce} rounded-lg relative border overflow-x-hidden`,
859
1118
  style: {
860
- ...ue ? { height: m?.length > 0 ? `${(m?.length + 1) * Dl + 4}px` : "350px" } : { height: lr },
1119
+ ...ue ? {
1120
+ height: m?.length > 0 ? `${(m?.length + 1) * Nl + 4}px` : "350px"
1121
+ } : { height: lr },
861
1122
  ...dl
862
1123
  },
863
- children: tl ? Mt : /* @__PURE__ */ b(Lr, { sensors: ur, onDragEnd: pr, onDragStart: mr, onDragCancel: vr, collisionDetection: Vr, children: [
864
- Mt,
865
- G ? Pr(
866
- /* @__PURE__ */ s(gr, { adjustScale: !0, dropAnimation: dr, children: /* @__PURE__ */ s("table", { ...Ot(), 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: [
867
- void Et(G),
868
- /* @__PURE__ */ s($r, { row: G, index: L?.findIndex((e) => e.id === G.original.id) }, G.original.id)
869
- ] }) }) }),
870
- document.getElementById("full-screen-container") || document.body
871
- ) : null
872
- ] })
1124
+ children: tl ? Mt : /* @__PURE__ */ b(
1125
+ Lr,
1126
+ {
1127
+ sensors: ur,
1128
+ onDragEnd: pr,
1129
+ onDragStart: mr,
1130
+ onDragCancel: vr,
1131
+ collisionDetection: Vr,
1132
+ children: [
1133
+ Mt,
1134
+ G ? Pr(
1135
+ /* @__PURE__ */ s(
1136
+ gr,
1137
+ {
1138
+ adjustScale: !0,
1139
+ dropAnimation: dr,
1140
+ children: /* @__PURE__ */ s(
1141
+ "table",
1142
+ {
1143
+ ...Ot(),
1144
+ className: "w-full text-sm text-left text-neutral-500 dark:text-neutral-200 bg-white dark:bg-black-700 table-auto border-collapse",
1145
+ children: /* @__PURE__ */ b(
1146
+ "tbody",
1147
+ {
1148
+ ...At(),
1149
+ className: "bg-transparent divide-y divide-neutral-200",
1150
+ children: [
1151
+ void Et(G),
1152
+ /* @__PURE__ */ s(
1153
+ $r,
1154
+ {
1155
+ row: G,
1156
+ index: L?.findIndex(
1157
+ (e) => e.id === G.original.id
1158
+ )
1159
+ },
1160
+ G.original.id
1161
+ )
1162
+ ]
1163
+ }
1164
+ )
1165
+ }
1166
+ )
1167
+ }
1168
+ ),
1169
+ document.getElementById("full-screen-container") || document.body
1170
+ ) : null
1171
+ ]
1172
+ }
1173
+ )
873
1174
  }
874
1175
  ),
875
- ue && i?.renderPagination ? i.renderPagination(ue) : null,
876
- i?.renderMasterDataModal && i.renderMasterDataModal({
1176
+ ue && a?.renderPagination ? a.renderPagination(ue) : null,
1177
+ a?.renderMasterDataModal && a.renderMasterDataModal({
877
1178
  isVisible: !!_,
878
1179
  onSelected: Cl,
879
1180
  onClose: Se,
880
1181
  masterDataColumnName: _?.masterDataColumnName,
1182
+ masterDataFormula: _?.masterDataFormula,
881
1183
  masterDataFilters: _?.masterDataFilters,
882
1184
  masterDataName: _?.masterDataName,
883
1185
  masterDataId: _?.masterDataName,
884
1186
  showFilters: !0
885
1187
  }),
886
- /* @__PURE__ */ s(Ur, { config: pt, onClose: Nt }),
1188
+ /* @__PURE__ */ s(
1189
+ Ur,
1190
+ {
1191
+ config: pt,
1192
+ onClose: Dt
1193
+ }
1194
+ ),
887
1195
  /* @__PURE__ */ s(
888
1196
  Jr,
889
1197
  {