@deepnoid/ui 0.1.29 → 0.1.31
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/.turbo/turbo-build.log +183 -173
- package/dist/chunk-62X5AX5B.mjs +297 -0
- package/dist/chunk-6PN3DGOE.mjs +77 -0
- package/dist/{chunk-EHRFXDSN.mjs → chunk-AIIMJZ7L.mjs} +72 -42
- package/dist/{chunk-3KVZDFMV.mjs → chunk-BCMVEGJG.mjs} +3 -3
- package/dist/{chunk-QJJKJYNR.mjs → chunk-BFOK4HVC.mjs} +2 -2
- package/dist/{chunk-KXA73VTJ.mjs → chunk-CVQM3T2X.mjs} +4 -4
- package/dist/{chunk-RCJOJPRS.mjs → chunk-EBRCE7XY.mjs} +40 -30
- package/dist/{chunk-III2QUWF.mjs → chunk-G67WUZO3.mjs} +1 -1
- package/dist/{chunk-BB7MFKNQ.mjs → chunk-IBI3OVQI.mjs} +1 -1
- package/dist/{chunk-LR3SWRB4.mjs → chunk-IC25OKBJ.mjs} +5 -5
- package/dist/{chunk-KLUC2BV6.mjs → chunk-IEJRE6LT.mjs} +10 -7
- package/dist/{chunk-ECMBAKSJ.mjs → chunk-K7V4VE7R.mjs} +5 -5
- package/dist/chunk-LWRK5TPZ.mjs +80 -0
- package/dist/chunk-MZ76AA76.mjs +1 -0
- package/dist/{chunk-X4F7JYBA.mjs → chunk-NFQMXW4Z.mjs} +36 -14
- package/dist/chunk-P7YYNA6L.mjs +67 -0
- package/dist/components/backdrop/backdrop.mjs +2 -2
- package/dist/components/backdrop/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.mjs +5 -5
- package/dist/components/breadcrumb/index.mjs +5 -5
- package/dist/components/button/button.mjs +2 -2
- package/dist/components/button/icon-button.mjs +2 -2
- package/dist/components/button/index.mjs +4 -4
- package/dist/components/button/text-button.mjs +2 -2
- package/dist/components/checkbox/checkbox.mjs +2 -2
- package/dist/components/checkbox/index.mjs +2 -2
- package/dist/components/chip/chip.mjs +2 -2
- package/dist/components/chip/index.mjs +2 -2
- package/dist/components/dateTimePicker/calendar.mjs +2 -2
- package/dist/components/dateTimePicker/dateTimePicker.mjs +6 -6
- package/dist/components/dateTimePicker/index.mjs +6 -6
- package/dist/components/dateTimePicker/timePicker.mjs +4 -4
- package/dist/components/fileUpload/fileUpload.js +62 -39
- package/dist/components/fileUpload/fileUpload.mjs +6 -6
- package/dist/components/fileUpload/index.js +62 -39
- package/dist/components/fileUpload/index.mjs +6 -6
- package/dist/components/input/index.js +62 -39
- package/dist/components/input/index.mjs +2 -2
- package/dist/components/input/input.d.mts +21 -14
- package/dist/components/input/input.d.ts +21 -14
- package/dist/components/input/input.js +62 -39
- package/dist/components/input/input.mjs +2 -2
- package/dist/components/list/index.mjs +3 -3
- package/dist/components/list/list.mjs +2 -2
- package/dist/components/list/listItem.mjs +2 -2
- package/dist/components/modal/index.mjs +6 -6
- package/dist/components/modal/modal.mjs +6 -6
- package/dist/components/pagination/index.js +62 -39
- package/dist/components/pagination/index.mjs +3 -3
- package/dist/components/pagination/pagination.js +62 -39
- package/dist/components/pagination/pagination.mjs +3 -3
- package/dist/components/radio/index.mjs +2 -2
- package/dist/components/radio/radio.mjs +2 -2
- package/dist/components/select/index.js +7 -4
- package/dist/components/select/index.mjs +2 -2
- package/dist/components/select/select.d.mts +9 -0
- package/dist/components/select/select.d.ts +9 -0
- package/dist/components/select/select.js +7 -4
- package/dist/components/select/select.mjs +2 -2
- package/dist/components/skeleton/index.d.mts +2 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +141 -0
- package/dist/components/skeleton/index.mjs +10 -0
- package/dist/components/skeleton/skeleton.d.mts +14 -0
- package/dist/components/skeleton/skeleton.d.ts +14 -0
- package/dist/components/skeleton/skeleton.js +135 -0
- package/dist/components/skeleton/skeleton.mjs +9 -0
- package/dist/components/table/index.js +748 -646
- package/dist/components/table/index.mjs +11 -9
- package/dist/components/table/table-body.d.mts +6 -4
- package/dist/components/table/table-body.d.ts +6 -4
- package/dist/components/table/table-body.js +115 -63
- package/dist/components/table/table-body.mjs +5 -3
- package/dist/components/table/table-head.d.mts +3 -1
- package/dist/components/table/table-head.d.ts +3 -1
- package/dist/components/table/table-head.js +107 -21
- package/dist/components/table/table-head.mjs +5 -3
- package/dist/components/table/table.d.mts +3 -1
- package/dist/components/table/table.d.ts +3 -1
- package/dist/components/table/table.js +739 -637
- package/dist/components/table/table.mjs +9 -7
- package/dist/components/tabs/index.mjs +2 -2
- package/dist/components/tabs/tabs.mjs +2 -2
- package/dist/components/textarea/index.js +255 -138
- package/dist/components/textarea/index.mjs +2 -1
- package/dist/components/textarea/textarea.d.mts +157 -150
- package/dist/components/textarea/textarea.d.ts +157 -150
- package/dist/components/textarea/textarea.js +255 -138
- package/dist/components/textarea/textarea.mjs +2 -1
- package/dist/components/toast/index.mjs +3 -3
- package/dist/components/toast/toast.mjs +2 -2
- package/dist/components/toast/use-toast.mjs +3 -3
- package/dist/components/tooltip/index.mjs +2 -2
- package/dist/components/tooltip/tooltip.mjs +2 -2
- package/dist/components/tree/index.js +33 -11
- package/dist/components/tree/index.mjs +2 -2
- package/dist/components/tree/tree.d.mts +10 -8
- package/dist/components/tree/tree.d.ts +10 -8
- package/dist/components/tree/tree.js +33 -11
- package/dist/components/tree/tree.mjs +2 -2
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +799 -593
- package/dist/index.mjs +52 -47
- package/package.json +1 -1
- package/dist/chunk-26MNALVL.mjs +0 -47
- package/dist/chunk-A5KQHWS3.mjs +0 -94
- package/dist/chunk-BKE6QF6W.mjs +0 -209
- package/dist/{chunk-SSMMWMQC.mjs → chunk-2YMAKIZ6.mjs} +3 -3
- package/dist/{chunk-6K3E5BVO.mjs → chunk-7TAGGLNY.mjs} +3 -3
- package/dist/{chunk-X6D7C7QZ.mjs → chunk-A7RU3FU5.mjs} +3 -3
- package/dist/{chunk-YLRYHUTW.mjs → chunk-D6QI3DJG.mjs} +3 -3
- package/dist/{chunk-UFVQPPPW.mjs → chunk-HIVPDIEP.mjs} +3 -3
- package/dist/{chunk-P5QCU457.mjs → chunk-LL6F3WDX.mjs} +3 -3
- package/dist/{chunk-7W2ZI2DD.mjs → chunk-MEY4IL7D.mjs} +3 -3
- package/dist/{chunk-33LANVZV.mjs → chunk-QIRL6HY6.mjs} +3 -3
- package/dist/{chunk-W45H2ZMW.mjs → chunk-RT3S3VVJ.mjs} +3 -3
- package/dist/{chunk-7J3KVOTS.mjs → chunk-UB4YBFOT.mjs} +3 -3
- package/dist/{chunk-2PKM7SLZ.mjs → chunk-WFMFC7R6.mjs} +3 -3
- package/dist/{chunk-Y6XQTWB5.mjs → chunk-WLNLVX7Q.mjs} +3 -3
- package/dist/{chunk-IL5ENWCR.mjs → chunk-Z2537DF6.mjs} +3 -3
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../../chunk-DX3KXNP6.mjs";
|
|
3
|
+
import {
|
|
4
|
+
table_default
|
|
5
|
+
} from "../../chunk-EBRCE7XY.mjs";
|
|
3
6
|
import {
|
|
4
7
|
definition_table_default
|
|
5
8
|
} from "../../chunk-6TIIBU7J.mjs";
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
} from "../../chunk-RCJOJPRS.mjs";
|
|
9
|
+
import "../../chunk-LWRK5TPZ.mjs";
|
|
10
|
+
import "../../chunk-P7YYNA6L.mjs";
|
|
9
11
|
import "../../chunk-DQRAFUDA.mjs";
|
|
10
12
|
import "../../chunk-M37VBNB3.mjs";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-MZ76AA76.mjs";
|
|
14
|
+
import "../../chunk-6PN3DGOE.mjs";
|
|
13
15
|
import "../../chunk-7B7LRG5J.mjs";
|
|
14
|
-
import "../../chunk-
|
|
16
|
+
import "../../chunk-CVQM3T2X.mjs";
|
|
15
17
|
import "../../chunk-F3HENRVM.mjs";
|
|
16
18
|
import "../../chunk-2GCSFWHD.mjs";
|
|
17
|
-
import "../../chunk-
|
|
19
|
+
import "../../chunk-AIIMJZ7L.mjs";
|
|
18
20
|
import "../../chunk-QZ3LVYJW.mjs";
|
|
19
|
-
import "../../chunk-
|
|
21
|
+
import "../../chunk-D6QI3DJG.mjs";
|
|
20
22
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
21
23
|
import "../../chunk-2TKEWFGH.mjs";
|
|
22
24
|
import "../../chunk-2SDYFOZL.mjs";
|
|
25
|
+
import "../../chunk-4ZJFD3L3.mjs";
|
|
23
26
|
import "../../chunk-27Y6K5NK.mjs";
|
|
24
27
|
import "../../chunk-E3G5QXSH.mjs";
|
|
25
|
-
import "../../chunk-4ZJFD3L3.mjs";
|
|
26
28
|
import "../../chunk-AC6TWLRT.mjs";
|
|
27
29
|
export {
|
|
28
30
|
definition_table_default as DefinitionTable,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { SlotsToClasses } from '../../utils/types.mjs';
|
|
3
|
+
import { Size, SlotsToClasses } from '../../utils/types.mjs';
|
|
4
4
|
import { TableReturnType, TableRow, TableColumn, TableSlots } from './table.mjs';
|
|
5
5
|
import 'tailwind-variants';
|
|
6
6
|
|
|
@@ -8,16 +8,18 @@ interface TableBodyProps {
|
|
|
8
8
|
slots: TableReturnType;
|
|
9
9
|
rows: TableRow[];
|
|
10
10
|
columns: TableColumn[];
|
|
11
|
-
size?:
|
|
11
|
+
size?: Size;
|
|
12
|
+
color?: "primary" | "secondary" | "neutral";
|
|
12
13
|
rowCheckbox?: boolean;
|
|
13
14
|
checkedRows: Set<number>;
|
|
14
15
|
onCheckRow: (index: number, isChecked: boolean) => void;
|
|
15
16
|
onRowClick?: (row: TableRow) => void;
|
|
16
|
-
emptyContent?: ReactNode;
|
|
17
17
|
isLoading?: boolean;
|
|
18
|
+
emptyContent?: ReactNode;
|
|
19
|
+
skeletonRow?: number;
|
|
18
20
|
classNames?: SlotsToClasses<TableSlots>;
|
|
19
21
|
className?: string;
|
|
20
22
|
}
|
|
21
|
-
declare const TableBody: ({ slots,
|
|
23
|
+
declare const TableBody: ({ slots, rows, columns, size, color, rowCheckbox, checkedRows, onCheckRow, onRowClick, isLoading, emptyContent, skeletonRow, classNames, className, }: TableBodyProps) => react_jsx_runtime.JSX.Element;
|
|
22
24
|
|
|
23
25
|
export { TableBody as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { SlotsToClasses } from '../../utils/types.js';
|
|
3
|
+
import { Size, SlotsToClasses } from '../../utils/types.js';
|
|
4
4
|
import { TableReturnType, TableRow, TableColumn, TableSlots } from './table.js';
|
|
5
5
|
import 'tailwind-variants';
|
|
6
6
|
|
|
@@ -8,16 +8,18 @@ interface TableBodyProps {
|
|
|
8
8
|
slots: TableReturnType;
|
|
9
9
|
rows: TableRow[];
|
|
10
10
|
columns: TableColumn[];
|
|
11
|
-
size?:
|
|
11
|
+
size?: Size;
|
|
12
|
+
color?: "primary" | "secondary" | "neutral";
|
|
12
13
|
rowCheckbox?: boolean;
|
|
13
14
|
checkedRows: Set<number>;
|
|
14
15
|
onCheckRow: (index: number, isChecked: boolean) => void;
|
|
15
16
|
onRowClick?: (row: TableRow) => void;
|
|
16
|
-
emptyContent?: ReactNode;
|
|
17
17
|
isLoading?: boolean;
|
|
18
|
+
emptyContent?: ReactNode;
|
|
19
|
+
skeletonRow?: number;
|
|
18
20
|
classNames?: SlotsToClasses<TableSlots>;
|
|
19
21
|
className?: string;
|
|
20
22
|
}
|
|
21
|
-
declare const TableBody: ({ slots,
|
|
23
|
+
declare const TableBody: ({ slots, rows, columns, size, color, rowCheckbox, checkedRows, onCheckRow, onRowClick, isLoading, emptyContent, skeletonRow, classNames, className, }: TableBodyProps) => react_jsx_runtime.JSX.Element;
|
|
22
24
|
|
|
23
25
|
export { TableBody as default };
|
|
@@ -105,7 +105,6 @@ __export(table_body_exports, {
|
|
|
105
105
|
default: () => table_body_default
|
|
106
106
|
});
|
|
107
107
|
module.exports = __toCommonJS(table_body_exports);
|
|
108
|
-
var import_react2 = require("react");
|
|
109
108
|
|
|
110
109
|
// src/utils/clsx.ts
|
|
111
110
|
function clsx(...args) {
|
|
@@ -593,84 +592,137 @@ var checkboxStyle = tv({
|
|
|
593
592
|
}
|
|
594
593
|
});
|
|
595
594
|
|
|
596
|
-
// src/components/
|
|
595
|
+
// src/components/skeleton/skeleton.tsx
|
|
596
|
+
var import_tailwind_variants3 = require("tailwind-variants");
|
|
597
597
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
598
|
-
var
|
|
598
|
+
var Skeleton = ({ color = "primary", className, speed = "normal", rounded = "md" }) => {
|
|
599
|
+
const speedMap = {
|
|
600
|
+
fast: "0.7s",
|
|
601
|
+
normal: "1.2s",
|
|
602
|
+
slow: "2s"
|
|
603
|
+
};
|
|
604
|
+
const slots = skeletonStyle();
|
|
605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
606
|
+
"div",
|
|
607
|
+
{
|
|
608
|
+
className: clsx(slots.base({ color, rounded }), className),
|
|
609
|
+
style: {
|
|
610
|
+
"--shimmer-duration": speedMap[speed]
|
|
611
|
+
},
|
|
612
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("style", { children: `@keyframes shimmer {
|
|
613
|
+
100% {
|
|
614
|
+
transform: translateX(100%);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
.skeleton-shimmer::before {
|
|
618
|
+
animation: shimmer var(--shimmer-duration) infinite linear;
|
|
619
|
+
}
|
|
620
|
+
` })
|
|
621
|
+
}
|
|
622
|
+
);
|
|
623
|
+
};
|
|
624
|
+
Skeleton.displayName = "Skeleton";
|
|
625
|
+
var skeleton_default = Skeleton;
|
|
626
|
+
var skeletonStyle = (0, import_tailwind_variants3.tv)({
|
|
627
|
+
slots: {
|
|
628
|
+
base: [
|
|
629
|
+
"relative",
|
|
630
|
+
"overflow-hidden",
|
|
631
|
+
"w-full",
|
|
632
|
+
"h-[18px]",
|
|
633
|
+
"skeleton-shimmer",
|
|
634
|
+
"before:absolute",
|
|
635
|
+
"before:inset-0",
|
|
636
|
+
"before:-translate-x-full",
|
|
637
|
+
"before:bg-gradient-to-r",
|
|
638
|
+
"before:from-transparent",
|
|
639
|
+
"before:via-white/40",
|
|
640
|
+
"before:to-transparent",
|
|
641
|
+
"before:content-['']"
|
|
642
|
+
]
|
|
643
|
+
},
|
|
644
|
+
variants: {
|
|
645
|
+
color: {
|
|
646
|
+
primary: { base: "bg-primary-soft" },
|
|
647
|
+
secondary: { base: "bg-secondary-soft" },
|
|
648
|
+
neutral: { base: "bg-neutral-soft" }
|
|
649
|
+
},
|
|
650
|
+
rounded: {
|
|
651
|
+
sm: { base: "rounded-sm" },
|
|
652
|
+
md: { base: "rounded-md" },
|
|
653
|
+
lg: { base: "rounded-lg" },
|
|
654
|
+
xl: { base: "rounded-xl" },
|
|
655
|
+
full: { base: "rounded-full" }
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
defaultVariants: {
|
|
659
|
+
color: "primary",
|
|
660
|
+
rounded: "md"
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
// src/components/table/table-body.tsx
|
|
665
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
599
666
|
var TableBody = ({
|
|
600
667
|
slots,
|
|
601
|
-
columns,
|
|
602
668
|
rows,
|
|
669
|
+
columns,
|
|
603
670
|
size,
|
|
604
|
-
|
|
671
|
+
color,
|
|
672
|
+
rowCheckbox = false,
|
|
605
673
|
checkedRows,
|
|
606
674
|
onCheckRow,
|
|
607
675
|
onRowClick,
|
|
676
|
+
isLoading = false,
|
|
608
677
|
emptyContent,
|
|
609
|
-
|
|
678
|
+
skeletonRow,
|
|
610
679
|
classNames,
|
|
611
680
|
className
|
|
612
681
|
}) => {
|
|
613
|
-
const
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
682
|
+
const getCellStyle = (column) => ({
|
|
683
|
+
width: column.width ? `${column.width}px` : void 0,
|
|
684
|
+
minWidth: column.minWidth ? `${column.minWidth}px` : void 0,
|
|
685
|
+
maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
|
|
686
|
+
height: column.height ? `${column.height}px` : void 0,
|
|
687
|
+
textAlign: column.align || "center"
|
|
688
|
+
});
|
|
689
|
+
const renderTdSkeleton = (key) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(skeleton_default, { color, className: "h-full w-full", rounded: "lg", speed: "fast" }) }, key);
|
|
690
|
+
const renderCheckboxCell = (rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }), "text-center"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
691
|
+
checkbox_default,
|
|
692
|
+
{
|
|
693
|
+
size,
|
|
694
|
+
checked: checkedRows.has(rowIndex),
|
|
695
|
+
onChange: (e) => onCheckRow(rowIndex, e.target.checked)
|
|
696
|
+
}
|
|
697
|
+
) });
|
|
698
|
+
const renderSkeletonRow = (rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
699
|
+
columns.map((_, colIdx) => renderTdSkeleton(`skeleton-${rowIndex}-${colIdx}`)),
|
|
700
|
+
rowCheckbox && renderTdSkeleton(`skeleton-checkbox-${rowIndex}`)
|
|
701
|
+
] }, `skeleton-${rowIndex}`);
|
|
702
|
+
const renderEmptyRow = () => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { colSpan: columns.length + (rowCheckbox ? 1 : 0), className: slots.empty({ class: classNames == null ? void 0 : classNames.empty }), children: emptyContent }) });
|
|
703
|
+
const renderDataRow = (row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), onClick: () => onRowClick == null ? void 0 : onRowClick(row), children: [
|
|
704
|
+
columns.map((column, colIdx) => {
|
|
705
|
+
var _a;
|
|
624
706
|
const value = row[column.field];
|
|
625
|
-
const formattedValue = column.valueFormatter ?
|
|
626
|
-
const
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
value,
|
|
630
|
-
formattedValue,
|
|
631
|
-
row
|
|
632
|
-
}) : formattedValue;
|
|
633
|
-
const columnStyles = generateColumnStyles(column);
|
|
634
|
-
return {
|
|
635
|
-
children,
|
|
636
|
-
className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }), columnStyles),
|
|
637
|
-
style: {
|
|
638
|
-
width: column.width ? `${column.width}px` : void 0,
|
|
639
|
-
minWidth: column.minWidth ? `${column.minWidth}px` : void 0,
|
|
640
|
-
maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
|
|
641
|
-
height: column.height ? `${column.height}px` : void 0
|
|
642
|
-
}
|
|
643
|
-
};
|
|
644
|
-
},
|
|
645
|
-
[classNames == null ? void 0 : classNames.td, generateColumnStyles, slots]
|
|
646
|
-
);
|
|
647
|
-
const hasRows = rows.length > 0;
|
|
648
|
-
const colSpan = (columns.length || 1) + (rowCheckbox ? 1 : 0);
|
|
649
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("tbody", { className: clsx(slots.tbody({ class: classNames == null ? void 0 : classNames.tbody }), className), children: [
|
|
650
|
-
!isLoading && hasRows && rows.map((row, rowIndex) => {
|
|
651
|
-
const isRowChecked = checkedRows.has(rowIndex);
|
|
652
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
653
|
-
"tr",
|
|
707
|
+
const formattedValue = ((_a = column.valueFormatter) == null ? void 0 : _a.call(column, { value, field: column.field })) || value;
|
|
708
|
+
const content = column.renderCell ? column.renderCell({ id: row.id, field: column.field, value, formattedValue, row }) : formattedValue;
|
|
709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
710
|
+
"td",
|
|
654
711
|
{
|
|
655
|
-
className: slots.
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
children: [
|
|
659
|
-
columns.map((column) => /* @__PURE__ */ (0, import_react3.createElement)("td", { ...getCellProps(column, row), key: column.field })),
|
|
660
|
-
rowCheckbox && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
661
|
-
checkbox_default,
|
|
662
|
-
{
|
|
663
|
-
size,
|
|
664
|
-
checked: isRowChecked,
|
|
665
|
-
onChange: (e) => onCheckRow(rowIndex, e.target.checked)
|
|
666
|
-
}
|
|
667
|
-
) }) })
|
|
668
|
-
]
|
|
712
|
+
className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }), column.className),
|
|
713
|
+
style: getCellStyle(column),
|
|
714
|
+
children: content
|
|
669
715
|
},
|
|
670
|
-
rowIndex
|
|
716
|
+
`${rowIndex}-${colIdx}`
|
|
671
717
|
);
|
|
672
718
|
}),
|
|
673
|
-
|
|
674
|
-
] });
|
|
719
|
+
rowCheckbox && renderCheckboxCell(rowIndex)
|
|
720
|
+
] }, rowIndex);
|
|
721
|
+
const renderRows = () => {
|
|
722
|
+
if (isLoading) return skeletonRow ? Array.from({ length: skeletonRow }, (_, idx) => renderSkeletonRow(idx)) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {});
|
|
723
|
+
if (!rows.length && emptyContent) return renderEmptyRow();
|
|
724
|
+
return rows.map((row, index) => renderDataRow(row, index));
|
|
725
|
+
};
|
|
726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("tbody", { className: `${slots.tbody({ class: classNames == null ? void 0 : classNames.tbody })} ${className || ""}`, children: renderRows() });
|
|
675
727
|
};
|
|
676
728
|
var table_body_default = TableBody;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
table_body_default
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-LWRK5TPZ.mjs";
|
|
5
|
+
import "../../chunk-MZ76AA76.mjs";
|
|
6
|
+
import "../../chunk-6PN3DGOE.mjs";
|
|
5
7
|
import "../../chunk-QZ3LVYJW.mjs";
|
|
6
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-D6QI3DJG.mjs";
|
|
9
|
+
import "../../chunk-4ZJFD3L3.mjs";
|
|
7
10
|
import "../../chunk-27Y6K5NK.mjs";
|
|
8
11
|
import "../../chunk-E3G5QXSH.mjs";
|
|
9
|
-
import "../../chunk-4ZJFD3L3.mjs";
|
|
10
12
|
import "../../chunk-AC6TWLRT.mjs";
|
|
11
13
|
export {
|
|
12
14
|
table_body_default as default
|
|
@@ -7,12 +7,14 @@ import 'react';
|
|
|
7
7
|
type TableHeadProps = {
|
|
8
8
|
slots: TableReturnType;
|
|
9
9
|
columns: TableColumn[];
|
|
10
|
+
color?: "primary" | "secondary" | "neutral";
|
|
10
11
|
size?: Size;
|
|
11
12
|
rowCheckbox?: boolean;
|
|
12
13
|
isCheckedAll: boolean;
|
|
14
|
+
isLoading?: boolean;
|
|
13
15
|
classNames?: SlotsToClasses<TableSlots>;
|
|
14
16
|
onCheckAll: (isChecked: boolean) => void;
|
|
15
17
|
};
|
|
16
|
-
declare const TableHead: ({ columns,
|
|
18
|
+
declare const TableHead: ({ slots, columns, color, size, rowCheckbox, isCheckedAll, isLoading, classNames, onCheckAll, }: TableHeadProps) => react_jsx_runtime.JSX.Element;
|
|
17
19
|
|
|
18
20
|
export { TableHead as default };
|
|
@@ -7,12 +7,14 @@ import 'react';
|
|
|
7
7
|
type TableHeadProps = {
|
|
8
8
|
slots: TableReturnType;
|
|
9
9
|
columns: TableColumn[];
|
|
10
|
+
color?: "primary" | "secondary" | "neutral";
|
|
10
11
|
size?: Size;
|
|
11
12
|
rowCheckbox?: boolean;
|
|
12
13
|
isCheckedAll: boolean;
|
|
14
|
+
isLoading?: boolean;
|
|
13
15
|
classNames?: SlotsToClasses<TableSlots>;
|
|
14
16
|
onCheckAll: (isChecked: boolean) => void;
|
|
15
17
|
};
|
|
16
|
-
declare const TableHead: ({ columns,
|
|
18
|
+
declare const TableHead: ({ slots, columns, color, size, rowCheckbox, isCheckedAll, isLoading, classNames, onCheckAll, }: TableHeadProps) => react_jsx_runtime.JSX.Element;
|
|
17
19
|
|
|
18
20
|
export { TableHead as default };
|
|
@@ -592,38 +592,124 @@ var checkboxStyle = tv({
|
|
|
592
592
|
}
|
|
593
593
|
});
|
|
594
594
|
|
|
595
|
-
// src/components/
|
|
595
|
+
// src/components/skeleton/skeleton.tsx
|
|
596
|
+
var import_tailwind_variants3 = require("tailwind-variants");
|
|
596
597
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
597
|
-
var
|
|
598
|
+
var Skeleton = ({ color = "primary", className, speed = "normal", rounded = "md" }) => {
|
|
599
|
+
const speedMap = {
|
|
600
|
+
fast: "0.7s",
|
|
601
|
+
normal: "1.2s",
|
|
602
|
+
slow: "2s"
|
|
603
|
+
};
|
|
604
|
+
const slots = skeletonStyle();
|
|
605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
606
|
+
"div",
|
|
607
|
+
{
|
|
608
|
+
className: clsx(slots.base({ color, rounded }), className),
|
|
609
|
+
style: {
|
|
610
|
+
"--shimmer-duration": speedMap[speed]
|
|
611
|
+
},
|
|
612
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("style", { children: `@keyframes shimmer {
|
|
613
|
+
100% {
|
|
614
|
+
transform: translateX(100%);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
.skeleton-shimmer::before {
|
|
618
|
+
animation: shimmer var(--shimmer-duration) infinite linear;
|
|
619
|
+
}
|
|
620
|
+
` })
|
|
621
|
+
}
|
|
622
|
+
);
|
|
623
|
+
};
|
|
624
|
+
Skeleton.displayName = "Skeleton";
|
|
625
|
+
var skeleton_default = Skeleton;
|
|
626
|
+
var skeletonStyle = (0, import_tailwind_variants3.tv)({
|
|
627
|
+
slots: {
|
|
628
|
+
base: [
|
|
629
|
+
"relative",
|
|
630
|
+
"overflow-hidden",
|
|
631
|
+
"w-full",
|
|
632
|
+
"h-[18px]",
|
|
633
|
+
"skeleton-shimmer",
|
|
634
|
+
"before:absolute",
|
|
635
|
+
"before:inset-0",
|
|
636
|
+
"before:-translate-x-full",
|
|
637
|
+
"before:bg-gradient-to-r",
|
|
638
|
+
"before:from-transparent",
|
|
639
|
+
"before:via-white/40",
|
|
640
|
+
"before:to-transparent",
|
|
641
|
+
"before:content-['']"
|
|
642
|
+
]
|
|
643
|
+
},
|
|
644
|
+
variants: {
|
|
645
|
+
color: {
|
|
646
|
+
primary: { base: "bg-primary-soft" },
|
|
647
|
+
secondary: { base: "bg-secondary-soft" },
|
|
648
|
+
neutral: { base: "bg-neutral-soft" }
|
|
649
|
+
},
|
|
650
|
+
rounded: {
|
|
651
|
+
sm: { base: "rounded-sm" },
|
|
652
|
+
md: { base: "rounded-md" },
|
|
653
|
+
lg: { base: "rounded-lg" },
|
|
654
|
+
xl: { base: "rounded-xl" },
|
|
655
|
+
full: { base: "rounded-full" }
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
defaultVariants: {
|
|
659
|
+
color: "primary",
|
|
660
|
+
rounded: "md"
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
// src/components/table/table-head.tsx
|
|
665
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
666
|
+
var TableHead = ({
|
|
667
|
+
slots,
|
|
668
|
+
columns,
|
|
669
|
+
color,
|
|
670
|
+
size,
|
|
671
|
+
rowCheckbox = false,
|
|
672
|
+
isCheckedAll,
|
|
673
|
+
isLoading = false,
|
|
674
|
+
classNames,
|
|
675
|
+
onCheckAll
|
|
676
|
+
}) => {
|
|
598
677
|
const handleClickCheckAll = (e) => {
|
|
599
678
|
e.preventDefault();
|
|
600
679
|
onCheckAll(!isCheckedAll);
|
|
601
680
|
};
|
|
602
|
-
const
|
|
681
|
+
const renderTh = (content, key, column) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
603
682
|
"th",
|
|
604
683
|
{
|
|
605
684
|
className: clsx(slots.th({ class: classNames == null ? void 0 : classNames.th }), column),
|
|
606
685
|
style: {
|
|
607
|
-
width: column.width ? `${column.width}px` : void 0,
|
|
608
|
-
minWidth: column.minWidth ? `${column.minWidth}px` : void 0,
|
|
609
|
-
maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
|
|
610
|
-
height: column.height ? `${column.height}px` : void 0
|
|
686
|
+
width: (column == null ? void 0 : column.width) ? `${column.width}px` : void 0,
|
|
687
|
+
minWidth: (column == null ? void 0 : column.minWidth) ? `${column.minWidth}px` : void 0,
|
|
688
|
+
maxWidth: (column == null ? void 0 : column.maxWidth) ? `${column.maxWidth}px` : void 0,
|
|
689
|
+
height: (column == null ? void 0 : column.height) ? `${column.height}px` : void 0
|
|
611
690
|
},
|
|
612
|
-
children:
|
|
691
|
+
children: content
|
|
613
692
|
},
|
|
614
|
-
|
|
615
|
-
)
|
|
616
|
-
const
|
|
617
|
-
|
|
618
|
-
{
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
693
|
+
key
|
|
694
|
+
);
|
|
695
|
+
const renderSkeletonRow = () => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("tr", { className: clsx(slots.tr({ class: classNames == null ? void 0 : classNames.tr }), "[&>th]:border-0"), children: [
|
|
696
|
+
columns.map((_, idx) => renderTh(/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(skeleton_default, { color, rounded: "lg", speed: "fast" }), `skeleton-${idx}`)),
|
|
697
|
+
rowCheckbox && renderTh(/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(skeleton_default, { color, rounded: "lg", speed: "fast" }), "checkbox-skeleton")
|
|
698
|
+
] }) });
|
|
699
|
+
const renderContentRow = () => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
700
|
+
columns.map((column, idx) => renderTh(column.headerName, `${column.field}-${idx}`, column)),
|
|
701
|
+
rowCheckbox && renderTh(
|
|
702
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex items-center justify-center", onClick: handleClickCheckAll, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
703
|
+
checkbox_default,
|
|
704
|
+
{
|
|
705
|
+
size,
|
|
706
|
+
checked: isCheckedAll,
|
|
707
|
+
onChange: (e) => onCheckAll(e.target.checked)
|
|
708
|
+
}
|
|
709
|
+
) }),
|
|
710
|
+
"checkbox"
|
|
711
|
+
)
|
|
627
712
|
] }) });
|
|
713
|
+
return isLoading ? renderSkeletonRow() : renderContentRow();
|
|
628
714
|
};
|
|
629
715
|
var table_head_default = TableHead;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
table_head_default
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-P7YYNA6L.mjs";
|
|
5
|
+
import "../../chunk-MZ76AA76.mjs";
|
|
6
|
+
import "../../chunk-6PN3DGOE.mjs";
|
|
5
7
|
import "../../chunk-QZ3LVYJW.mjs";
|
|
6
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-D6QI3DJG.mjs";
|
|
9
|
+
import "../../chunk-4ZJFD3L3.mjs";
|
|
7
10
|
import "../../chunk-27Y6K5NK.mjs";
|
|
8
11
|
import "../../chunk-E3G5QXSH.mjs";
|
|
9
|
-
import "../../chunk-4ZJFD3L3.mjs";
|
|
10
12
|
import "../../chunk-AC6TWLRT.mjs";
|
|
11
13
|
export {
|
|
12
14
|
table_head_default as default
|
|
@@ -20,6 +20,7 @@ interface TableBaseProps extends Omit<ComponentPropsWithRef<"table">, "ref" | "c
|
|
|
20
20
|
}) => void;
|
|
21
21
|
emptyContent?: ReactNode;
|
|
22
22
|
isLoading?: boolean;
|
|
23
|
+
skeletonRow?: number;
|
|
23
24
|
classNames?: SlotsToClasses<TableSlots>;
|
|
24
25
|
}
|
|
25
26
|
interface TableRef {
|
|
@@ -205,10 +206,11 @@ type ValueFormatterParams<V = any> = {
|
|
|
205
206
|
value: V;
|
|
206
207
|
};
|
|
207
208
|
type TableRow<R extends RowValue = RowValue> = R;
|
|
209
|
+
type Align = "center" | "left" | "right";
|
|
208
210
|
type TableColumn<R extends RowValue = RowValue, V = any, F = V> = {
|
|
209
211
|
field: string;
|
|
210
212
|
headerName?: string | ReactElement;
|
|
211
|
-
align?:
|
|
213
|
+
align?: Align;
|
|
212
214
|
width?: number;
|
|
213
215
|
minWidth?: number;
|
|
214
216
|
maxWidth?: number;
|
|
@@ -20,6 +20,7 @@ interface TableBaseProps extends Omit<ComponentPropsWithRef<"table">, "ref" | "c
|
|
|
20
20
|
}) => void;
|
|
21
21
|
emptyContent?: ReactNode;
|
|
22
22
|
isLoading?: boolean;
|
|
23
|
+
skeletonRow?: number;
|
|
23
24
|
classNames?: SlotsToClasses<TableSlots>;
|
|
24
25
|
}
|
|
25
26
|
interface TableRef {
|
|
@@ -205,10 +206,11 @@ type ValueFormatterParams<V = any> = {
|
|
|
205
206
|
value: V;
|
|
206
207
|
};
|
|
207
208
|
type TableRow<R extends RowValue = RowValue> = R;
|
|
209
|
+
type Align = "center" | "left" | "right";
|
|
208
210
|
type TableColumn<R extends RowValue = RowValue, V = any, F = V> = {
|
|
209
211
|
field: string;
|
|
210
212
|
headerName?: string | ReactElement;
|
|
211
|
-
align?:
|
|
213
|
+
align?: Align;
|
|
212
214
|
width?: number;
|
|
213
215
|
minWidth?: number;
|
|
214
216
|
maxWidth?: number;
|