@deepnoid/ui 0.1.136 → 0.1.137
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 +155 -155
- package/dist/{chunk-IUNZZ77V.mjs → chunk-3YR6VGGQ.mjs} +19 -38
- package/dist/{chunk-4URRLVNR.mjs → chunk-4JOD47VZ.mjs} +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/pagination/index.mjs +1 -1
- package/dist/components/pagination/pagination.js +1 -1
- package/dist/components/pagination/pagination.mjs +1 -1
- package/dist/components/table/index.js +604 -689
- package/dist/components/table/index.mjs +2 -4
- package/dist/components/table/table-body.d.mts +1 -2
- package/dist/components/table/table-body.d.ts +1 -2
- package/dist/components/table/table-body.js +595 -680
- package/dist/components/table/table-body.mjs +2 -4
- package/dist/components/table/table-head.d.mts +1 -2
- package/dist/components/table/table-head.d.ts +1 -2
- package/dist/components/table/table-head.js +595 -680
- package/dist/components/table/table-head.mjs +2 -4
- package/dist/components/table/table.d.mts +3 -1
- package/dist/components/table/table.d.ts +3 -1
- package/dist/components/table/table.js +595 -680
- package/dist/components/table/table.mjs +2 -4
- package/dist/index.js +268 -284
- package/dist/index.mjs +13 -13
- package/package.json +1 -1
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
skeleton_default
|
|
4
|
-
} from "./chunk-6PN3DGOE.mjs";
|
|
5
2
|
import {
|
|
6
3
|
pagination_default
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4JOD47VZ.mjs";
|
|
8
5
|
import {
|
|
9
6
|
scrollArea_default
|
|
10
7
|
} from "./chunk-M37VBNB3.mjs";
|
|
@@ -29,7 +26,7 @@ import {
|
|
|
29
26
|
import { tv } from "tailwind-variants";
|
|
30
27
|
|
|
31
28
|
// src/components/table/table-body.tsx
|
|
32
|
-
import {
|
|
29
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
30
|
var TableBody = ({
|
|
34
31
|
slots,
|
|
35
32
|
rows,
|
|
@@ -42,13 +39,9 @@ var TableBody = ({
|
|
|
42
39
|
onRowClick,
|
|
43
40
|
isLoading = false,
|
|
44
41
|
emptyContent,
|
|
45
|
-
skeletonRow,
|
|
46
42
|
classNames,
|
|
47
43
|
className
|
|
48
44
|
}) => {
|
|
49
|
-
const renderTdSkeleton = (key, column) => {
|
|
50
|
-
return /* @__PURE__ */ jsx("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), style: column ? getCellStyle(column) : {}, children: /* @__PURE__ */ jsx(skeleton_default, { color, className: "h-full w-full", rounded: "lg", speed: "fast" }) }, key);
|
|
51
|
-
};
|
|
52
45
|
const renderCheckboxCell = (rowId, rowIndex) => /* @__PURE__ */ jsx(
|
|
53
46
|
"td",
|
|
54
47
|
{
|
|
@@ -58,10 +51,6 @@ var TableBody = ({
|
|
|
58
51
|
},
|
|
59
52
|
`checkbox-${rowId}-${rowIndex}`
|
|
60
53
|
);
|
|
61
|
-
const renderSkeletonRow = (rowIndex) => /* @__PURE__ */ jsxs("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
62
|
-
columns.map((column, colIdx) => renderTdSkeleton(`skeleton-${rowIndex}-${colIdx}`, column)),
|
|
63
|
-
rowCheckbox && renderTdSkeleton(`skeleton-checkbox-${rowIndex}`)
|
|
64
|
-
] }, `skeleton-${rowIndex}`);
|
|
65
54
|
const renderEmptyRow = () => /* @__PURE__ */ jsx("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: /* @__PURE__ */ jsx("td", { colSpan: columns.length + (rowCheckbox ? 1 : 0), className: slots.empty({ class: classNames == null ? void 0 : classNames.empty }), children: emptyContent }) });
|
|
66
55
|
const renderDataRow = (row, rowIndex) => /* @__PURE__ */ jsxs(
|
|
67
56
|
"tr",
|
|
@@ -89,12 +78,18 @@ var TableBody = ({
|
|
|
89
78
|
},
|
|
90
79
|
`${row.id}-${rowIndex}`
|
|
91
80
|
);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
81
|
+
return /* @__PURE__ */ jsx(
|
|
82
|
+
"tbody",
|
|
83
|
+
{
|
|
84
|
+
className: clsx(
|
|
85
|
+
slots.tbody({ class: classNames == null ? void 0 : classNames.tbody }),
|
|
86
|
+
className,
|
|
87
|
+
"transition-all duration-200 ease-in-out",
|
|
88
|
+
isLoading && slots.tbodyLoading({ class: classNames == null ? void 0 : classNames.tbodyLoading })
|
|
89
|
+
),
|
|
90
|
+
children: !rows.length && emptyContent ? renderEmptyRow() : rows.map((row, index) => renderDataRow(row, index))
|
|
91
|
+
}
|
|
92
|
+
);
|
|
98
93
|
};
|
|
99
94
|
var table_body_default = TableBody;
|
|
100
95
|
|
|
@@ -115,13 +110,12 @@ var Table = forwardRef((originalProps, ref) => {
|
|
|
115
110
|
variant,
|
|
116
111
|
color,
|
|
117
112
|
size,
|
|
118
|
-
skeletonRow,
|
|
119
113
|
checkedRows,
|
|
120
114
|
onCheckedRowsChange,
|
|
121
115
|
onRowClick
|
|
122
116
|
} = { ...props, ...variantProps };
|
|
123
117
|
const { page = 1, perPage = 15 } = pagination || {};
|
|
124
|
-
const showPagination = pagination && totalData > 0
|
|
118
|
+
const showPagination = pagination && totalData > 0;
|
|
125
119
|
const [checkedRowIds, setCheckedRowIds] = useState(new Set(checkedRows == null ? void 0 : checkedRows.map((row) => row.id)));
|
|
126
120
|
const tableMinWidth = useMemo(() => {
|
|
127
121
|
const columnsWidth = columns.reduce((total, column) => {
|
|
@@ -194,7 +188,6 @@ var Table = forwardRef((originalProps, ref) => {
|
|
|
194
188
|
rowCheckbox,
|
|
195
189
|
hasCheckedRows: rows.length > 0 && rows.every((row) => checkedRowIds.has(row.id)),
|
|
196
190
|
onCheckAll: handleAllRowCheck,
|
|
197
|
-
isLoading,
|
|
198
191
|
classNames,
|
|
199
192
|
slots
|
|
200
193
|
}
|
|
@@ -213,12 +206,7 @@ var Table = forwardRef((originalProps, ref) => {
|
|
|
213
206
|
onRowClick: handleRowClick,
|
|
214
207
|
isLoading,
|
|
215
208
|
emptyContent,
|
|
216
|
-
|
|
217
|
-
className: clsx(
|
|
218
|
-
"transition-all duration-150 ease-out",
|
|
219
|
-
isLoading ? "-translate-y-2 opacity-0" : "translate-y-0 opacity-100",
|
|
220
|
-
classNames
|
|
221
|
-
)
|
|
209
|
+
classNames
|
|
222
210
|
}
|
|
223
211
|
)
|
|
224
212
|
]
|
|
@@ -278,7 +266,8 @@ var tableStyle = tv({
|
|
|
278
266
|
"[&>*]:z-1",
|
|
279
267
|
"[&>*]:relative",
|
|
280
268
|
"align-middle"
|
|
281
|
-
]
|
|
269
|
+
],
|
|
270
|
+
tbodyLoading: []
|
|
282
271
|
},
|
|
283
272
|
variants: {
|
|
284
273
|
variant: {
|
|
@@ -486,7 +475,6 @@ var TableHead = ({
|
|
|
486
475
|
size,
|
|
487
476
|
rowCheckbox = false,
|
|
488
477
|
hasCheckedRows,
|
|
489
|
-
isLoading = false,
|
|
490
478
|
classNames,
|
|
491
479
|
onCheckAll
|
|
492
480
|
}) => {
|
|
@@ -506,13 +494,7 @@ var TableHead = ({
|
|
|
506
494
|
},
|
|
507
495
|
key
|
|
508
496
|
);
|
|
509
|
-
|
|
510
|
-
columns.map(
|
|
511
|
-
(column, idx) => renderTh(/* @__PURE__ */ jsx3(skeleton_default, { color, rounded: "lg", speed: "fast" }), `skeleton-${idx}`, column)
|
|
512
|
-
),
|
|
513
|
-
rowCheckbox && renderTh(/* @__PURE__ */ jsx3(skeleton_default, { color, rounded: "lg", speed: "fast" }), "checkbox-skeleton", void 0, true)
|
|
514
|
-
] }) });
|
|
515
|
-
const renderContentRow = () => /* @__PURE__ */ jsx3("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ jsxs3("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
497
|
+
return /* @__PURE__ */ jsx3("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ jsxs3("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
516
498
|
columns.map((column, idx) => renderTh(column.headerName, `${column.field}-${idx}`, column)),
|
|
517
499
|
rowCheckbox && renderTh(
|
|
518
500
|
/* @__PURE__ */ jsx3("div", { "data-checkbox": true, children: /* @__PURE__ */ jsx3(
|
|
@@ -528,7 +510,6 @@ var TableHead = ({
|
|
|
528
510
|
true
|
|
529
511
|
)
|
|
530
512
|
] }) });
|
|
531
|
-
return isLoading ? renderSkeletonRow() : renderContentRow();
|
|
532
513
|
};
|
|
533
514
|
var table_head_default = TableHead;
|
|
534
515
|
|
|
@@ -5535,7 +5535,7 @@ var Pagination = (0, import_react3.forwardRef)((originalProps, ref) => {
|
|
|
5535
5535
|
totalPage,
|
|
5536
5536
|
showPageNumber = true,
|
|
5537
5537
|
showPageLabel,
|
|
5538
|
-
showFirstLastButtons,
|
|
5538
|
+
showFirstLastButtons = true,
|
|
5539
5539
|
handleChangePage,
|
|
5540
5540
|
variant,
|
|
5541
5541
|
size
|
|
@@ -5533,7 +5533,7 @@ var Pagination = (0, import_react3.forwardRef)((originalProps, ref) => {
|
|
|
5533
5533
|
totalPage,
|
|
5534
5534
|
showPageNumber = true,
|
|
5535
5535
|
showPageLabel,
|
|
5536
|
-
showFirstLastButtons,
|
|
5536
|
+
showFirstLastButtons = true,
|
|
5537
5537
|
handleChangePage,
|
|
5538
5538
|
variant,
|
|
5539
5539
|
size
|