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.
- package/dist/components/table/body/table-body.d.ts.map +1 -1
- package/dist/components/table/header/table-header-row.d.ts.map +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/table/index.cjs.js +146 -135
- package/dist/table/index.cjs.js.map +1 -1
- package/dist/table/index.es.js +146 -135
- package/dist/table/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/table/index.es.js
CHANGED
|
@@ -204,7 +204,7 @@ const TableEmptyState = memo((t0) => {
|
|
|
204
204
|
});
|
|
205
205
|
TableEmptyState.displayName = "TableEmptyState";
|
|
206
206
|
function TableBodyComponent(t0) {
|
|
207
|
-
const $ = c(
|
|
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
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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
|
-
|
|
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
|
-
|
|
288
|
+
t8 = null;
|
|
277
289
|
break bb0;
|
|
278
290
|
}
|
|
279
291
|
if (typeof children === "function") {
|
|
280
|
-
let
|
|
281
|
-
if ($[
|
|
282
|
-
let
|
|
283
|
-
if ($[
|
|
284
|
-
|
|
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
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
306
|
+
$[19] = children;
|
|
307
|
+
$[20] = rowKey;
|
|
308
|
+
$[21] = t10;
|
|
297
309
|
} else {
|
|
298
|
-
|
|
310
|
+
t10 = $[21];
|
|
299
311
|
}
|
|
300
|
-
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
312
|
+
t92 = data.map(t10);
|
|
313
|
+
$[15] = children;
|
|
314
|
+
$[16] = data;
|
|
315
|
+
$[17] = rowKey;
|
|
316
|
+
$[18] = t92;
|
|
305
317
|
} else {
|
|
306
|
-
|
|
318
|
+
t92 = $[18];
|
|
307
319
|
}
|
|
308
|
-
|
|
320
|
+
t8 = t92;
|
|
309
321
|
} else {
|
|
310
|
-
let
|
|
311
|
-
if ($[
|
|
312
|
-
let
|
|
313
|
-
if ($[
|
|
314
|
-
|
|
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
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
329
|
+
$[26] = data;
|
|
330
|
+
$[27] = rowKey;
|
|
331
|
+
$[28] = t10;
|
|
320
332
|
} else {
|
|
321
|
-
|
|
333
|
+
t10 = $[28];
|
|
322
334
|
}
|
|
323
|
-
|
|
324
|
-
$[
|
|
325
|
-
$[
|
|
326
|
-
$[
|
|
327
|
-
$[
|
|
335
|
+
t92 = React__default.Children.map(children, t10);
|
|
336
|
+
$[22] = children;
|
|
337
|
+
$[23] = data;
|
|
338
|
+
$[24] = rowKey;
|
|
339
|
+
$[25] = t92;
|
|
328
340
|
} else {
|
|
329
|
-
|
|
341
|
+
t92 = $[25];
|
|
330
342
|
}
|
|
331
|
-
|
|
343
|
+
t8 = t92;
|
|
332
344
|
}
|
|
333
345
|
}
|
|
334
|
-
const renderedRows =
|
|
346
|
+
const renderedRows = t8;
|
|
335
347
|
let fallbackContent = null;
|
|
336
348
|
if (isLoading) {
|
|
337
|
-
let
|
|
338
|
-
if ($[
|
|
339
|
-
|
|
340
|
-
$[
|
|
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
|
-
|
|
354
|
+
t92 = $[29];
|
|
343
355
|
}
|
|
344
|
-
let
|
|
345
|
-
if ($[
|
|
346
|
-
|
|
347
|
-
|
|
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
|
-
$[
|
|
351
|
-
$[
|
|
362
|
+
$[30] = loadingLabel;
|
|
363
|
+
$[31] = t10;
|
|
352
364
|
} else {
|
|
353
|
-
|
|
365
|
+
t10 = $[31];
|
|
354
366
|
}
|
|
355
|
-
let
|
|
356
|
-
if ($[
|
|
357
|
-
|
|
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
|
-
|
|
374
|
+
t11 = $[34];
|
|
363
375
|
}
|
|
364
|
-
fallbackContent =
|
|
376
|
+
fallbackContent = t11;
|
|
365
377
|
} else {
|
|
366
378
|
if (data.length === 0) {
|
|
367
|
-
let
|
|
368
|
-
if ($[
|
|
369
|
-
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
379
|
+
let t92;
|
|
380
|
+
if ($[35] !== emptyText) {
|
|
381
|
+
t92 = /* @__PURE__ */ jsx(TableEmptyState, { text: emptyText });
|
|
382
|
+
$[35] = emptyText;
|
|
383
|
+
$[36] = t92;
|
|
372
384
|
} else {
|
|
373
|
-
|
|
385
|
+
t92 = $[36];
|
|
374
386
|
}
|
|
375
|
-
let
|
|
376
|
-
if ($[
|
|
377
|
-
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
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
|
-
|
|
394
|
+
t10 = $[39];
|
|
383
395
|
}
|
|
384
|
-
fallbackContent =
|
|
396
|
+
fallbackContent = t10;
|
|
385
397
|
}
|
|
386
398
|
}
|
|
387
|
-
let
|
|
388
|
-
if ($[
|
|
389
|
-
|
|
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
|
-
$[
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
405
|
+
$[40] = domProps;
|
|
406
|
+
$[41] = fallbackContent;
|
|
407
|
+
$[42] = mergedClass;
|
|
408
|
+
$[43] = renderedRows;
|
|
409
|
+
$[44] = t9;
|
|
398
410
|
} else {
|
|
399
|
-
|
|
411
|
+
t9 = $[44];
|
|
400
412
|
}
|
|
401
|
-
return
|
|
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(
|
|
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
|
|
653
|
+
if ($[13] !== children || $[14] !== dataHeader) {
|
|
642
654
|
let t72;
|
|
643
|
-
if ($[
|
|
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
|
-
$[
|
|
655
|
-
$[
|
|
656
|
-
$[19] = t72;
|
|
665
|
+
$[16] = children;
|
|
666
|
+
$[17] = t72;
|
|
657
667
|
} else {
|
|
658
|
-
t72 = $[
|
|
668
|
+
t72 = $[17];
|
|
659
669
|
}
|
|
660
670
|
t62 = dataHeader.map(t72);
|
|
661
671
|
$[13] = children;
|
|
662
672
|
$[14] = dataHeader;
|
|
663
|
-
$[15] =
|
|
664
|
-
$[16] = t62;
|
|
673
|
+
$[15] = t62;
|
|
665
674
|
} else {
|
|
666
|
-
t62 = $[
|
|
675
|
+
t62 = $[15];
|
|
667
676
|
}
|
|
668
677
|
t5 = t62;
|
|
669
678
|
} else {
|
|
670
679
|
let t62;
|
|
671
|
-
if ($[
|
|
680
|
+
if ($[18] !== children || $[19] !== dataHeader || $[20] !== props) {
|
|
672
681
|
let t72;
|
|
673
|
-
if ($[
|
|
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
|
-
$[
|
|
679
|
-
$[
|
|
680
|
-
$[
|
|
687
|
+
$[22] = dataHeader;
|
|
688
|
+
$[23] = props;
|
|
689
|
+
$[24] = t72;
|
|
681
690
|
} else {
|
|
682
|
-
t72 = $[
|
|
691
|
+
t72 = $[24];
|
|
683
692
|
}
|
|
684
693
|
t62 = React__default.Children.map(children, t72);
|
|
685
|
-
$[
|
|
686
|
-
$[
|
|
687
|
-
$[
|
|
688
|
-
$[
|
|
694
|
+
$[18] = children;
|
|
695
|
+
$[19] = dataHeader;
|
|
696
|
+
$[20] = props;
|
|
697
|
+
$[21] = t62;
|
|
689
698
|
} else {
|
|
690
|
-
t62 = $[
|
|
699
|
+
t62 = $[21];
|
|
691
700
|
}
|
|
692
701
|
t5 = t62;
|
|
693
702
|
}
|
|
694
703
|
const headerChildren = t5;
|
|
695
704
|
let t6;
|
|
696
|
-
if ($[
|
|
705
|
+
if ($[25] !== className) {
|
|
697
706
|
t6 = twMerge("bg-default-100 h-[45px]", className);
|
|
698
|
-
$[
|
|
699
|
-
$[
|
|
707
|
+
$[25] = className;
|
|
708
|
+
$[26] = t6;
|
|
700
709
|
} else {
|
|
701
|
-
t6 = $[
|
|
710
|
+
t6 = $[26];
|
|
702
711
|
}
|
|
703
712
|
let t7;
|
|
704
|
-
if ($[
|
|
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
|
-
$[
|
|
707
|
-
$[
|
|
708
|
-
$[
|
|
709
|
-
$[
|
|
710
|
-
$[
|
|
711
|
-
$[
|
|
715
|
+
$[27] = color;
|
|
716
|
+
$[28] = handleChange;
|
|
717
|
+
$[29] = isChecks;
|
|
718
|
+
$[30] = uui;
|
|
719
|
+
$[31] = valueCheck;
|
|
720
|
+
$[32] = t7;
|
|
712
721
|
} else {
|
|
713
|
-
t7 = $[
|
|
722
|
+
t7 = $[32];
|
|
714
723
|
}
|
|
715
724
|
let t8;
|
|
716
|
-
if ($[
|
|
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
|
-
$[
|
|
722
|
-
$[
|
|
723
|
-
$[
|
|
724
|
-
$[
|
|
730
|
+
$[33] = color;
|
|
731
|
+
$[34] = isActions;
|
|
732
|
+
$[35] = widthAction;
|
|
733
|
+
$[36] = t8;
|
|
725
734
|
} else {
|
|
726
|
-
t8 = $[
|
|
735
|
+
t8 = $[36];
|
|
727
736
|
}
|
|
728
737
|
let t9;
|
|
729
|
-
if ($[
|
|
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
|
-
$[
|
|
736
|
-
$[
|
|
737
|
-
$[
|
|
738
|
-
$[
|
|
739
|
-
$[
|
|
744
|
+
$[37] = headerChildren;
|
|
745
|
+
$[38] = t6;
|
|
746
|
+
$[39] = t7;
|
|
747
|
+
$[40] = t8;
|
|
748
|
+
$[41] = t9;
|
|
740
749
|
} else {
|
|
741
|
-
t9 = $[
|
|
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
|
-
|
|
961
|
+
dataHeader,
|
|
962
|
+
...otherProps
|
|
952
963
|
}) : child) }) }) }) }) });
|
|
953
964
|
};
|
|
954
965
|
const Table = Object.assign(TableHOC, {
|