lizaui 9.0.51 → 9.0.53

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.
@@ -204,7 +204,7 @@ const TableEmptyState = memo((t0) => {
204
204
  });
205
205
  TableEmptyState.displayName = "TableEmptyState";
206
206
  function TableBodyComponent(t0) {
207
- const $ = c(43);
207
+ const $ = c(45);
208
208
  let children;
209
209
  let className;
210
210
  let props;
@@ -261,27 +261,39 @@ function TableBodyComponent(t0) {
261
261
  isChecks
262
262
  } = useTableContext();
263
263
  const total = Number(totalColumn) + Number(isActions) + Number(isChecks);
264
- let t6;
265
- if ($[11] !== className) {
266
- t6 = twMerge(className);
267
- $[11] = className;
268
- $[12] = t6;
264
+ const t6 = props;
265
+ let domProps;
266
+ if ($[11] !== t6) {
267
+ domProps = {
268
+ ...t6
269
+ };
270
+ delete domProps.dataHeader;
271
+ $[11] = t6;
272
+ $[12] = domProps;
269
273
  } else {
270
- t6 = $[12];
274
+ domProps = $[12];
271
275
  }
272
- const mergedClass = t6;
273
276
  let t7;
277
+ if ($[13] !== className) {
278
+ t7 = twMerge(className);
279
+ $[13] = className;
280
+ $[14] = t7;
281
+ } else {
282
+ t7 = $[14];
283
+ }
284
+ const mergedClass = t7;
285
+ let t8;
274
286
  bb0: {
275
287
  if (!data || data.length === 0) {
276
- t7 = null;
288
+ t8 = null;
277
289
  break bb0;
278
290
  }
279
291
  if (typeof children === "function") {
280
- let t82;
281
- if ($[13] !== children || $[14] !== data || $[15] !== rowKey) {
282
- let t9;
283
- if ($[17] !== children || $[18] !== rowKey) {
284
- t9 = (el, index) => {
292
+ let t92;
293
+ if ($[15] !== children || $[16] !== data || $[17] !== rowKey) {
294
+ let t10;
295
+ if ($[19] !== children || $[20] !== rowKey) {
296
+ t10 = (el, index) => {
285
297
  const child = children({
286
298
  item: el,
287
299
  index
@@ -291,114 +303,114 @@ function TableBodyComponent(t0) {
291
303
  key: keyValue
292
304
  }) : null;
293
305
  };
294
- $[17] = children;
295
- $[18] = rowKey;
296
- $[19] = t9;
306
+ $[19] = children;
307
+ $[20] = rowKey;
308
+ $[21] = t10;
297
309
  } else {
298
- t9 = $[19];
310
+ t10 = $[21];
299
311
  }
300
- t82 = data.map(t9);
301
- $[13] = children;
302
- $[14] = data;
303
- $[15] = rowKey;
304
- $[16] = t82;
312
+ t92 = data.map(t10);
313
+ $[15] = children;
314
+ $[16] = data;
315
+ $[17] = rowKey;
316
+ $[18] = t92;
305
317
  } else {
306
- t82 = $[16];
318
+ t92 = $[18];
307
319
  }
308
- t7 = t82;
320
+ t8 = t92;
309
321
  } else {
310
- let t82;
311
- if ($[20] !== children || $[21] !== data || $[22] !== rowKey) {
312
- let t9;
313
- if ($[24] !== data || $[25] !== rowKey) {
314
- t9 = (child_0, index_0) => isValidElement(child_0) ? React__default.cloneElement(child_0, {
322
+ let t92;
323
+ if ($[22] !== children || $[23] !== data || $[24] !== rowKey) {
324
+ let t10;
325
+ if ($[26] !== data || $[27] !== rowKey) {
326
+ t10 = (child_0, index_0) => isValidElement(child_0) ? React__default.cloneElement(child_0, {
315
327
  key: rowKey ? rowKey(data[index_0], index_0) : index_0
316
328
  }) : child_0;
317
- $[24] = data;
318
- $[25] = rowKey;
319
- $[26] = t9;
329
+ $[26] = data;
330
+ $[27] = rowKey;
331
+ $[28] = t10;
320
332
  } else {
321
- t9 = $[26];
333
+ t10 = $[28];
322
334
  }
323
- t82 = React__default.Children.map(children, t9);
324
- $[20] = children;
325
- $[21] = data;
326
- $[22] = rowKey;
327
- $[23] = t82;
335
+ t92 = React__default.Children.map(children, t10);
336
+ $[22] = children;
337
+ $[23] = data;
338
+ $[24] = rowKey;
339
+ $[25] = t92;
328
340
  } else {
329
- t82 = $[23];
341
+ t92 = $[25];
330
342
  }
331
- t7 = t82;
343
+ t8 = t92;
332
344
  }
333
345
  }
334
- const renderedRows = t7;
346
+ const renderedRows = t8;
335
347
  let fallbackContent = null;
336
348
  if (isLoading) {
337
- let t82;
338
- if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
339
- t82 = /* @__PURE__ */ jsx("div", { className: "mt-3.5", children: /* @__PURE__ */ jsx(LoaderCircle, { size: 45 }) });
340
- $[27] = t82;
349
+ let t92;
350
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
351
+ t92 = /* @__PURE__ */ jsx("div", { className: "mt-3.5", children: /* @__PURE__ */ jsx(LoaderCircle, { size: 45 }) });
352
+ $[29] = t92;
341
353
  } else {
342
- t82 = $[27];
354
+ t92 = $[29];
343
355
  }
344
- let t9;
345
- if ($[28] !== loadingLabel) {
346
- t9 = /* @__PURE__ */ jsx("div", { className: "flex justify-center relative", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-center items-center gap-2", children: [
347
- t82,
356
+ let t10;
357
+ if ($[30] !== loadingLabel) {
358
+ t10 = /* @__PURE__ */ jsx("div", { className: "flex justify-center relative", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-center items-center gap-2", children: [
359
+ t92,
348
360
  /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("p", { className: "line-clamp-1 text-sm text-default-800", children: loadingLabel }) })
349
361
  ] }) });
350
- $[28] = loadingLabel;
351
- $[29] = t9;
362
+ $[30] = loadingLabel;
363
+ $[31] = t10;
352
364
  } else {
353
- t9 = $[29];
365
+ t10 = $[31];
354
366
  }
355
- let t10;
356
- if ($[30] !== t9 || $[31] !== total) {
357
- t10 = /* @__PURE__ */ jsx("tr", { className: "border-b border-divider", children: /* @__PURE__ */ jsx("td", { className: "px-2 py-2.5 w-full", colSpan: total, children: t9 }) });
358
- $[30] = t9;
359
- $[31] = total;
367
+ let t11;
368
+ if ($[32] !== t10 || $[33] !== total) {
369
+ t11 = /* @__PURE__ */ jsx("tr", { className: "border-b border-divider", children: /* @__PURE__ */ jsx("td", { className: "px-2 py-2.5 w-full", colSpan: total, children: t10 }) });
360
370
  $[32] = t10;
371
+ $[33] = total;
372
+ $[34] = t11;
361
373
  } else {
362
- t10 = $[32];
374
+ t11 = $[34];
363
375
  }
364
- fallbackContent = t10;
376
+ fallbackContent = t11;
365
377
  } else {
366
378
  if (data.length === 0) {
367
- let t82;
368
- if ($[33] !== emptyText) {
369
- t82 = /* @__PURE__ */ jsx(TableEmptyState, { text: emptyText });
370
- $[33] = emptyText;
371
- $[34] = t82;
379
+ let t92;
380
+ if ($[35] !== emptyText) {
381
+ t92 = /* @__PURE__ */ jsx(TableEmptyState, { text: emptyText });
382
+ $[35] = emptyText;
383
+ $[36] = t92;
372
384
  } else {
373
- t82 = $[34];
385
+ t92 = $[36];
374
386
  }
375
- let t9;
376
- if ($[35] !== t82 || $[36] !== total) {
377
- t9 = /* @__PURE__ */ jsx("tr", { className: "border-b border-divider", children: /* @__PURE__ */ jsx("td", { className: "px-2 py-10 w-full", colSpan: total, children: t82 }) });
378
- $[35] = t82;
379
- $[36] = total;
380
- $[37] = t9;
387
+ let t10;
388
+ if ($[37] !== t92 || $[38] !== total) {
389
+ t10 = /* @__PURE__ */ jsx("tr", { className: "border-b border-divider", children: /* @__PURE__ */ jsx("td", { className: "px-2 py-10 w-full", colSpan: total, children: t92 }) });
390
+ $[37] = t92;
391
+ $[38] = total;
392
+ $[39] = t10;
381
393
  } else {
382
- t9 = $[37];
394
+ t10 = $[39];
383
395
  }
384
- fallbackContent = t9;
396
+ fallbackContent = t10;
385
397
  }
386
398
  }
387
- let t8;
388
- if ($[38] !== fallbackContent || $[39] !== mergedClass || $[40] !== props || $[41] !== renderedRows) {
389
- t8 = /* @__PURE__ */ jsxs("tbody", { className: mergedClass, ...props, children: [
399
+ let t9;
400
+ if ($[40] !== domProps || $[41] !== fallbackContent || $[42] !== mergedClass || $[43] !== renderedRows) {
401
+ t9 = /* @__PURE__ */ jsxs("tbody", { className: mergedClass, ...domProps, children: [
390
402
  renderedRows,
391
403
  fallbackContent
392
404
  ] });
393
- $[38] = fallbackContent;
394
- $[39] = mergedClass;
395
- $[40] = props;
396
- $[41] = renderedRows;
397
- $[42] = t8;
405
+ $[40] = domProps;
406
+ $[41] = fallbackContent;
407
+ $[42] = mergedClass;
408
+ $[43] = renderedRows;
409
+ $[44] = t9;
398
410
  } else {
399
- t8 = $[42];
411
+ t9 = $[44];
400
412
  }
401
- return t8;
413
+ return t9;
402
414
  }
403
415
  const TableBody = memo((props) => {
404
416
  const $ = c(2);
@@ -568,7 +580,7 @@ const TableBodyColumn = memo(forwardRef((t0, ref) => {
568
580
  }));
569
581
  TableBodyColumn.displayName = "TableBodyColumn";
570
582
  const TableHeaderRow = React__default.memo((t0) => {
571
- const $ = c(44);
583
+ const $ = c(42);
572
584
  let children;
573
585
  let className;
574
586
  let disabledCheck;
@@ -638,107 +650,104 @@ const TableHeaderRow = React__default.memo((t0) => {
638
650
  let t5;
639
651
  if (typeof children === "function") {
640
652
  let t62;
641
- if ($[13] !== children || $[14] !== dataHeader || $[15] !== props) {
653
+ if ($[13] !== children || $[14] !== dataHeader) {
642
654
  let t72;
643
- if ($[17] !== children || $[18] !== props) {
655
+ if ($[16] !== children) {
644
656
  t72 = (el, index) => {
645
657
  const child = children({
646
658
  item: el
647
659
  });
648
660
  const keyValue = el.id ?? el.header ?? index;
649
661
  return isValidElement(child) ? React__default.cloneElement(child, {
650
- key: keyValue,
651
- ...props
662
+ key: keyValue
652
663
  }) : null;
653
664
  };
654
- $[17] = children;
655
- $[18] = props;
656
- $[19] = t72;
665
+ $[16] = children;
666
+ $[17] = t72;
657
667
  } else {
658
- t72 = $[19];
668
+ t72 = $[17];
659
669
  }
660
670
  t62 = dataHeader.map(t72);
661
671
  $[13] = children;
662
672
  $[14] = dataHeader;
663
- $[15] = props;
664
- $[16] = t62;
673
+ $[15] = t62;
665
674
  } else {
666
- t62 = $[16];
675
+ t62 = $[15];
667
676
  }
668
677
  t5 = t62;
669
678
  } else {
670
679
  let t62;
671
- if ($[20] !== children || $[21] !== dataHeader || $[22] !== props) {
680
+ if ($[18] !== children || $[19] !== dataHeader || $[20] !== props) {
672
681
  let t72;
673
- if ($[24] !== dataHeader || $[25] !== props) {
682
+ if ($[22] !== dataHeader || $[23] !== props) {
674
683
  t72 = (child_0, index_0) => isValidElement(child_0) ? React__default.cloneElement(child_0, {
675
684
  key: dataHeader[index_0]?.id ?? dataHeader[index_0]?.header ?? index_0,
676
685
  ...props
677
686
  }) : child_0;
678
- $[24] = dataHeader;
679
- $[25] = props;
680
- $[26] = t72;
687
+ $[22] = dataHeader;
688
+ $[23] = props;
689
+ $[24] = t72;
681
690
  } else {
682
- t72 = $[26];
691
+ t72 = $[24];
683
692
  }
684
693
  t62 = React__default.Children.map(children, t72);
685
- $[20] = children;
686
- $[21] = dataHeader;
687
- $[22] = props;
688
- $[23] = t62;
694
+ $[18] = children;
695
+ $[19] = dataHeader;
696
+ $[20] = props;
697
+ $[21] = t62;
689
698
  } else {
690
- t62 = $[23];
699
+ t62 = $[21];
691
700
  }
692
701
  t5 = t62;
693
702
  }
694
703
  const headerChildren = t5;
695
704
  let t6;
696
- if ($[27] !== className) {
705
+ if ($[25] !== className) {
697
706
  t6 = twMerge("bg-default-100 h-[45px]", className);
698
- $[27] = className;
699
- $[28] = t6;
707
+ $[25] = className;
708
+ $[26] = t6;
700
709
  } else {
701
- t6 = $[28];
710
+ t6 = $[26];
702
711
  }
703
712
  let t7;
704
- if ($[29] !== color || $[30] !== handleChange || $[31] !== isChecks || $[32] !== uui || $[33] !== valueCheck) {
713
+ if ($[27] !== color || $[28] !== handleChange || $[29] !== isChecks || $[30] !== uui || $[31] !== valueCheck) {
705
714
  t7 = isChecks && /* @__PURE__ */ jsx(TableHeaderColumn, { className: "min-w-10 w-10", children: /* @__PURE__ */ jsx(Checkbox, { id: uui, onChange: (e) => handleChange(e.target.checked), checked: valueCheck, className: "flex justify-center", color }) });
706
- $[29] = color;
707
- $[30] = handleChange;
708
- $[31] = isChecks;
709
- $[32] = uui;
710
- $[33] = valueCheck;
711
- $[34] = t7;
715
+ $[27] = color;
716
+ $[28] = handleChange;
717
+ $[29] = isChecks;
718
+ $[30] = uui;
719
+ $[31] = valueCheck;
720
+ $[32] = t7;
712
721
  } else {
713
- t7 = $[34];
722
+ t7 = $[32];
714
723
  }
715
724
  let t8;
716
- if ($[35] !== color || $[36] !== isActions || $[37] !== widthAction) {
725
+ if ($[33] !== color || $[34] !== isActions || $[35] !== widthAction) {
717
726
  t8 = isActions && /* @__PURE__ */ jsx(TableHeaderColumn, { color, style: {
718
727
  minWidth: `${widthAction}px`,
719
728
  width: `${widthAction}px`
720
729
  } });
721
- $[35] = color;
722
- $[36] = isActions;
723
- $[37] = widthAction;
724
- $[38] = t8;
730
+ $[33] = color;
731
+ $[34] = isActions;
732
+ $[35] = widthAction;
733
+ $[36] = t8;
725
734
  } else {
726
- t8 = $[38];
735
+ t8 = $[36];
727
736
  }
728
737
  let t9;
729
- if ($[39] !== headerChildren || $[40] !== t6 || $[41] !== t7 || $[42] !== t8) {
738
+ if ($[37] !== headerChildren || $[38] !== t6 || $[39] !== t7 || $[40] !== t8) {
730
739
  t9 = /* @__PURE__ */ jsxs("tr", { className: t6, children: [
731
740
  t7,
732
741
  headerChildren,
733
742
  t8
734
743
  ] });
735
- $[39] = headerChildren;
736
- $[40] = t6;
737
- $[41] = t7;
738
- $[42] = t8;
739
- $[43] = t9;
744
+ $[37] = headerChildren;
745
+ $[38] = t6;
746
+ $[39] = t7;
747
+ $[40] = t8;
748
+ $[41] = t9;
740
749
  } else {
741
- t9 = $[43];
750
+ t9 = $[41];
742
751
  }
743
752
  return t9;
744
753
  });
@@ -935,7 +944,8 @@ const TableHOC = ({
935
944
  selectKeys = [],
936
945
  isActions = true,
937
946
  widthAction = 100,
938
- dataHeader
947
+ dataHeader,
948
+ ...otherProps
939
949
  } = props;
940
950
  const tableClass = useMemo(() => twMerge("table-main-container w-full border-collapse table-auto", className), [className]);
941
951
  const containerClass = useMemo(() => twMerge("max-w-full overflow-x-auto overflow-y-auto bg-content1", classNameContainer), [classNameContainer]);
@@ -948,7 +958,8 @@ const TableHOC = ({
948
958
  widthAction,
949
959
  totalColumn: dataHeader?.length || 0
950
960
  }, children: /* @__PURE__ */ jsx("div", { className: containerClass, children: /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(LazyMotion, { features: () => import("framer-motion").then((res) => res.domAnimation), children: /* @__PURE__ */ jsx("table", { className: tableClass, children: React__default.Children.map(children, (child) => isValidElement(child) ? React__default.cloneElement(child, {
951
- ...props
961
+ dataHeader,
962
+ ...otherProps
952
963
  }) : child) }) }) }) }) });
953
964
  };
954
965
  const Table = Object.assign(TableHOC, {