@deepnoid/ui 0.1.67 → 0.1.69
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 +178 -178
- package/dist/{chunk-XX2LIHAI.mjs → chunk-337VFHYV.mjs} +1 -1
- package/dist/{chunk-UE7QOB6Y.mjs → chunk-3YXCBM7H.mjs} +1 -1
- package/dist/{chunk-VQ7DLJ57.mjs → chunk-45XDSBRF.mjs} +2 -2
- package/dist/{chunk-25EK5DQ6.mjs → chunk-4IKNOB5Y.mjs} +1 -1
- package/dist/{chunk-KLKTY6FQ.mjs → chunk-5GBAUDP4.mjs} +19 -30
- package/dist/{chunk-5TVBNB3E.mjs → chunk-CD6HJQKL.mjs} +4 -4
- package/dist/{chunk-LCHZ36TM.mjs → chunk-CFB4JWDA.mjs} +1 -1
- package/dist/{chunk-2YUYQCUG.mjs → chunk-F5XBEFX5.mjs} +1 -1
- package/dist/{chunk-ZD67BBJ3.mjs → chunk-HLLRDA4A.mjs} +2 -2
- package/dist/{chunk-3HXQY566.mjs → chunk-IFO3TSDM.mjs} +4 -4
- package/dist/{chunk-NVRS6IWV.mjs → chunk-LA34MKK7.mjs} +3 -3
- package/dist/{chunk-D6C74C5O.mjs → chunk-LHO66CGE.mjs} +16 -21
- package/dist/{chunk-KP2ENWC6.mjs → chunk-LIP5CNY3.mjs} +2 -2
- package/dist/{chunk-FTLP7OLQ.mjs → chunk-MNGULMJI.mjs} +1 -1
- package/dist/{chunk-22ZPZFM2.mjs → chunk-NP6OELBR.mjs} +3 -3
- package/dist/{chunk-FZ3GVVL6.mjs → chunk-NQYWOEB3.mjs} +1 -1
- package/dist/{chunk-GV5UKAZV.mjs → chunk-SJTGJ6NC.mjs} +1 -1
- package/dist/{chunk-TVIVXGEN.mjs → chunk-UTWY7OBW.mjs} +1 -1
- package/dist/{chunk-SQF2SUJZ.mjs → chunk-YZ7HQHTL.mjs} +584 -3
- package/dist/{chunk-UANIXET6.mjs → chunk-ZMYJ5OW3.mjs} +3 -3
- package/dist/{chunk-YBSGSRHO.mjs → chunk-ZY7MY7KH.mjs} +1 -1
- package/dist/components/avatar/avatar.js +584 -3
- package/dist/components/avatar/avatar.mjs +2 -2
- package/dist/components/avatar/index.js +584 -3
- package/dist/components/avatar/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +584 -3
- package/dist/components/breadcrumb/breadcrumb.mjs +6 -6
- package/dist/components/breadcrumb/index.js +584 -3
- package/dist/components/breadcrumb/index.mjs +6 -6
- package/dist/components/button/button.js +584 -3
- package/dist/components/button/button.mjs +4 -4
- package/dist/components/button/icon-button.js +584 -3
- package/dist/components/button/icon-button.mjs +4 -4
- package/dist/components/button/index.js +584 -3
- package/dist/components/button/index.mjs +5 -5
- package/dist/components/chip/chip.js +584 -3
- package/dist/components/chip/chip.mjs +3 -3
- package/dist/components/chip/index.js +584 -3
- package/dist/components/chip/index.mjs +3 -3
- package/dist/components/dateTimePicker/calendar.js +584 -3
- package/dist/components/dateTimePicker/calendar.mjs +3 -3
- package/dist/components/dateTimePicker/dateTimePicker.js +584 -3
- package/dist/components/dateTimePicker/dateTimePicker.mjs +7 -7
- package/dist/components/dateTimePicker/index.js +584 -3
- package/dist/components/dateTimePicker/index.mjs +7 -7
- package/dist/components/dateTimePicker/timePicker.js +584 -3
- package/dist/components/dateTimePicker/timePicker.mjs +5 -5
- package/dist/components/fileUpload/fileUpload.js +584 -3
- package/dist/components/fileUpload/fileUpload.mjs +7 -7
- package/dist/components/fileUpload/index.js +584 -3
- package/dist/components/fileUpload/index.mjs +7 -7
- package/dist/components/icon/Icon.d.mts +71 -3
- package/dist/components/icon/Icon.d.ts +71 -3
- package/dist/components/icon/Icon.js +584 -3
- package/dist/components/icon/Icon.mjs +2 -2
- package/dist/components/icon/index.js +584 -3
- package/dist/components/icon/index.mjs +2 -2
- package/dist/components/icon/template.d.mts +20 -3
- package/dist/components/icon/template.d.ts +20 -3
- package/dist/components/icon/template.js +584 -3
- package/dist/components/icon/template.mjs +1 -1
- package/dist/components/input/index.js +584 -3
- package/dist/components/input/index.mjs +3 -3
- package/dist/components/input/input.js +584 -3
- package/dist/components/input/input.mjs +3 -3
- package/dist/components/list/index.js +584 -3
- package/dist/components/list/index.mjs +6 -6
- package/dist/components/list/listItem.js +584 -3
- package/dist/components/list/listItem.mjs +4 -4
- package/dist/components/modal/index.js +584 -3
- package/dist/components/modal/index.mjs +6 -6
- package/dist/components/modal/modal.js +584 -3
- package/dist/components/modal/modal.mjs +6 -6
- package/dist/components/pagination/index.js +584 -3
- package/dist/components/pagination/index.mjs +4 -4
- package/dist/components/pagination/pagination.js +584 -3
- package/dist/components/pagination/pagination.mjs +4 -4
- package/dist/components/ripple/index.mjs +3 -3
- package/dist/components/select/index.js +584 -3
- package/dist/components/select/index.mjs +3 -3
- package/dist/components/select/select.js +584 -3
- package/dist/components/select/select.mjs +3 -3
- package/dist/components/table/index.js +615 -49
- package/dist/components/table/index.mjs +13 -13
- package/dist/components/table/table-body.js +19 -30
- package/dist/components/table/table-body.mjs +1 -1
- package/dist/components/table/table.d.mts +12 -12
- package/dist/components/table/table.d.ts +12 -12
- package/dist/components/table/table.js +615 -49
- package/dist/components/table/table.mjs +10 -10
- package/dist/components/toast/index.js +584 -3
- package/dist/components/toast/index.mjs +4 -4
- package/dist/components/toast/toast.js +584 -3
- package/dist/components/toast/toast.mjs +3 -3
- package/dist/components/toast/use-toast.js +584 -3
- package/dist/components/toast/use-toast.mjs +4 -4
- package/dist/components/tree/index.js +584 -3
- package/dist/components/tree/index.mjs +3 -3
- package/dist/components/tree/tree.js +584 -3
- package/dist/components/tree/tree.mjs +3 -3
- package/dist/index.js +615 -49
- package/dist/index.mjs +44 -44
- package/package.json +1 -1
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./chunk-FZJ5PLRU.mjs";
|
|
5
5
|
import {
|
|
6
6
|
button_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CD6HJQKL.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Icon_default
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UTWY7OBW.mjs";
|
|
11
11
|
import {
|
|
12
12
|
tv
|
|
13
13
|
} from "./chunk-XOPCRI7Z.mjs";
|
|
@@ -20,7 +20,6 @@ var TableBody = ({
|
|
|
20
20
|
rowCheckbox = false,
|
|
21
21
|
checkedRows,
|
|
22
22
|
onCheckRow,
|
|
23
|
-
// onRowClick,
|
|
24
23
|
isLoading = false,
|
|
25
24
|
emptyContent,
|
|
26
25
|
skeletonRow,
|
|
@@ -35,40 +34,30 @@ var TableBody = ({
|
|
|
35
34
|
textAlign: column.align || "center"
|
|
36
35
|
});
|
|
37
36
|
const renderTdSkeleton = (key) => /* @__PURE__ */ jsx("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: /* @__PURE__ */ jsx(skeleton_default, { color, className: "h-full w-full", rounded: "lg", speed: "fast" }) }, key);
|
|
38
|
-
const renderCheckboxCell = (
|
|
39
|
-
checkbox_default,
|
|
40
|
-
{
|
|
41
|
-
size,
|
|
42
|
-
checked: checkedRows.has(rowIndex),
|
|
43
|
-
onChange: (e) => onCheckRow(rowIndex, e.target.checked)
|
|
44
|
-
}
|
|
45
|
-
) });
|
|
37
|
+
const renderCheckboxCell = (rowId) => /* @__PURE__ */ jsx("td", { className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }), "text-center"), children: /* @__PURE__ */ jsx(checkbox_default, { size, checked: checkedRows.has(rowId), onChange: (e) => onCheckRow(rowId, e.target.checked) }) });
|
|
46
38
|
const renderSkeletonRow = (rowIndex) => /* @__PURE__ */ jsxs("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
47
39
|
columns.map((_, colIdx) => renderTdSkeleton(`skeleton-${rowIndex}-${colIdx}`)),
|
|
48
40
|
rowCheckbox && renderTdSkeleton(`skeleton-checkbox-${rowIndex}`)
|
|
49
41
|
] }, `skeleton-${rowIndex}`);
|
|
50
42
|
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 }) });
|
|
51
|
-
const renderDataRow = (row, rowIndex) => (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
rowCheckbox && renderCheckboxCell(rowIndex)
|
|
70
|
-
] }, rowIndex)
|
|
71
|
-
);
|
|
43
|
+
const renderDataRow = (row, rowIndex) => /* @__PURE__ */ jsxs("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
44
|
+
columns.map((column, colIdx) => {
|
|
45
|
+
var _a;
|
|
46
|
+
const value = row[column.field];
|
|
47
|
+
const formattedValue = ((_a = column.valueFormatter) == null ? void 0 : _a.call(column, { value, field: column.field })) || value;
|
|
48
|
+
const content = column.renderCell ? column.renderCell({ id: row.id, field: column.field, value, formattedValue, row }) : formattedValue;
|
|
49
|
+
return /* @__PURE__ */ jsx(
|
|
50
|
+
"td",
|
|
51
|
+
{
|
|
52
|
+
className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }), column.className),
|
|
53
|
+
style: getCellStyle(column),
|
|
54
|
+
children: content
|
|
55
|
+
},
|
|
56
|
+
`${rowIndex}-${colIdx}`
|
|
57
|
+
);
|
|
58
|
+
}),
|
|
59
|
+
rowCheckbox && renderCheckboxCell(row.id)
|
|
60
|
+
] }, rowIndex);
|
|
72
61
|
const renderRows = () => {
|
|
73
62
|
if (isLoading) return skeletonRow ? Array.from({ length: skeletonRow }, (_, idx) => renderSkeletonRow(idx)) : /* @__PURE__ */ jsx(Fragment, {});
|
|
74
63
|
if (!rows.length && emptyContent) return renderEmptyRow();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useRipple
|
|
4
|
-
} from "./chunk-6PNKRBUT.mjs";
|
|
5
2
|
import {
|
|
6
3
|
ripple_default
|
|
7
4
|
} from "./chunk-LXHUO6VM.mjs";
|
|
5
|
+
import {
|
|
6
|
+
useRipple
|
|
7
|
+
} from "./chunk-6PNKRBUT.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Icon_default
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UTWY7OBW.mjs";
|
|
11
11
|
import {
|
|
12
12
|
tv
|
|
13
13
|
} from "./chunk-XOPCRI7Z.mjs";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./chunk-F3HENRVM.mjs";
|
|
5
5
|
import {
|
|
6
6
|
input_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MNGULMJI.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Icon_default
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UTWY7OBW.mjs";
|
|
11
11
|
import {
|
|
12
12
|
tv
|
|
13
13
|
} from "./chunk-XOPCRI7Z.mjs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useRipple
|
|
4
|
-
} from "./chunk-6PNKRBUT.mjs";
|
|
5
2
|
import {
|
|
6
3
|
ripple_default
|
|
7
4
|
} from "./chunk-LXHUO6VM.mjs";
|
|
5
|
+
import {
|
|
6
|
+
useRipple
|
|
7
|
+
} from "./chunk-6PNKRBUT.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Icon_default
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UTWY7OBW.mjs";
|
|
11
11
|
import {
|
|
12
12
|
tv
|
|
13
13
|
} from "./chunk-XOPCRI7Z.mjs";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
timePicker_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NP6OELBR.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useDatePicker
|
|
7
7
|
} from "./chunk-FWJ2ZKH6.mjs";
|
|
8
8
|
import {
|
|
9
9
|
calendar_default
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CFB4JWDA.mjs";
|
|
11
11
|
import {
|
|
12
12
|
Icon_default
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UTWY7OBW.mjs";
|
|
14
14
|
import {
|
|
15
15
|
tv
|
|
16
16
|
} from "./chunk-XOPCRI7Z.mjs";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
pagination_default
|
|
4
|
+
} from "./chunk-HLLRDA4A.mjs";
|
|
2
5
|
import {
|
|
3
6
|
table_body_default
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5GBAUDP4.mjs";
|
|
5
8
|
import {
|
|
6
9
|
table_head_default
|
|
7
10
|
} from "./chunk-TKB2JL2E.mjs";
|
|
8
11
|
import {
|
|
9
12
|
scrollArea_default
|
|
10
13
|
} from "./chunk-M37VBNB3.mjs";
|
|
11
|
-
import {
|
|
12
|
-
pagination_default
|
|
13
|
-
} from "./chunk-ZD67BBJ3.mjs";
|
|
14
14
|
import {
|
|
15
15
|
clsx
|
|
16
16
|
} from "./chunk-27Y6K5NK.mjs";
|
|
@@ -24,7 +24,6 @@ import {
|
|
|
24
24
|
useEffect,
|
|
25
25
|
useImperativeHandle,
|
|
26
26
|
useMemo,
|
|
27
|
-
useRef,
|
|
28
27
|
useState
|
|
29
28
|
} from "react";
|
|
30
29
|
import { tv } from "tailwind-variants";
|
|
@@ -35,7 +34,6 @@ var Table = forwardRef((originalProps, ref) => {
|
|
|
35
34
|
rows,
|
|
36
35
|
columns,
|
|
37
36
|
rowCheckbox = false,
|
|
38
|
-
// onRowClick,
|
|
39
37
|
totalData = 0,
|
|
40
38
|
pagination,
|
|
41
39
|
onPageChange,
|
|
@@ -50,37 +48,34 @@ var Table = forwardRef((originalProps, ref) => {
|
|
|
50
48
|
const { page = 1, perPage = 15 } = pagination || {};
|
|
51
49
|
const showPagination = pagination && totalData > 0 && !isLoading;
|
|
52
50
|
const [checkedRows, setCheckedRows] = useState(/* @__PURE__ */ new Set());
|
|
53
|
-
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
onCheckedRowsChange == null ? void 0 : onCheckedRowsChange(getCheckedRowData(checkedRows));
|
|
53
|
+
}, [checkedRows]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
setCheckedRows(/* @__PURE__ */ new Set());
|
|
56
|
+
}, [rows]);
|
|
54
57
|
useImperativeHandle(
|
|
55
58
|
ref,
|
|
56
59
|
() => ({
|
|
57
60
|
checkedRows,
|
|
58
|
-
setCheckedRows
|
|
59
|
-
setCheckedRows(rowsSet);
|
|
60
|
-
onCheckedRowsChange == null ? void 0 : onCheckedRowsChange(getCheckedRowData(rowsSet));
|
|
61
|
-
}
|
|
61
|
+
setCheckedRows
|
|
62
62
|
}),
|
|
63
63
|
[checkedRows]
|
|
64
64
|
);
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
setCheckedRows(/* @__PURE__ */ new Set());
|
|
67
|
-
}, [rows]);
|
|
68
65
|
const handleAllRowCheck = (checked) => {
|
|
69
|
-
const updated = checked ? new Set(rows.map((
|
|
66
|
+
const updated = checked ? new Set(rows.map((row) => row.id)) : /* @__PURE__ */ new Set();
|
|
70
67
|
setCheckedRows(updated);
|
|
71
|
-
onCheckedRowsChange == null ? void 0 : onCheckedRowsChange(getCheckedRowData(updated));
|
|
72
68
|
};
|
|
73
|
-
const handleRowCheck = (
|
|
69
|
+
const handleRowCheck = (id, checked) => {
|
|
74
70
|
setCheckedRows((prev) => {
|
|
75
71
|
const updated = new Set(prev);
|
|
76
|
-
checked ? updated.add(
|
|
77
|
-
onCheckedRowsChange == null ? void 0 : onCheckedRowsChange(getCheckedRowData(updated));
|
|
72
|
+
checked ? updated.add(id) : updated.delete(id);
|
|
78
73
|
return updated;
|
|
79
74
|
});
|
|
80
75
|
};
|
|
81
|
-
const getCheckedRowData = (checked) =>
|
|
76
|
+
const getCheckedRowData = (checked) => rows.filter((row) => checked.has(row.id));
|
|
82
77
|
const slots = useMemo(() => tableStyle(variantProps), [variantProps]);
|
|
83
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
78
|
+
return /* @__PURE__ */ jsxs("div", { "data-table": "base", className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
84
79
|
/* @__PURE__ */ jsx(scrollArea_default, { direction: "x", size: size === "xl" ? "lg" : size, children: /* @__PURE__ */ jsxs("table", { className: slots.table({ class: classNames == null ? void 0 : classNames.table }), children: [
|
|
85
80
|
/* @__PURE__ */ jsx(
|
|
86
81
|
table_head_default,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
listItem_default
|
|
4
|
+
} from "./chunk-LIP5CNY3.mjs";
|
|
2
5
|
import {
|
|
3
6
|
list_default
|
|
4
7
|
} from "./chunk-B6XJNGQL.mjs";
|
|
5
|
-
import {
|
|
6
|
-
listItem_default
|
|
7
|
-
} from "./chunk-KP2ENWC6.mjs";
|
|
8
8
|
|
|
9
9
|
// src/components/dateTimePicker/timePicker.tsx
|
|
10
10
|
import { useState, useRef, useEffect } from "react";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-ZOTHPHXA.mjs";
|
|
5
5
|
import {
|
|
6
6
|
toast_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3YXCBM7H.mjs";
|
|
8
8
|
|
|
9
9
|
// src/components/toast/use-toast.tsx
|
|
10
10
|
import { createContext, useContext, useState, useCallback, useEffect, useRef } from "react";
|