@deepnoid/ui 0.1.79 → 0.1.80
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 +123 -125
- package/dist/{chunk-YF2N2OBY.mjs → chunk-L65ETSUY.mjs} +1 -1
- package/dist/{chunk-AX3D6VFT.mjs → chunk-UWXCAR5C.mjs} +186 -14
- package/dist/components/dateTimePicker/dateTimePicker.mjs +3 -3
- package/dist/components/dateTimePicker/index.mjs +3 -3
- package/dist/components/dateTimePicker/timePicker.mjs +2 -2
- package/dist/components/list/index.mjs +3 -3
- package/dist/components/table/index.js +34 -27
- package/dist/components/table/index.mjs +1 -3
- package/dist/components/table/table-body.js +5783 -54
- package/dist/components/table/table-body.mjs +11 -1
- package/dist/components/table/table-head.js +5810 -45
- package/dist/components/table/table-head.mjs +11 -1
- package/dist/components/table/table.d.mts +3 -2
- package/dist/components/table/table.d.ts +3 -2
- package/dist/components/table/table.js +40 -28
- package/dist/components/table/table.mjs +4 -4
- package/dist/index.js +34 -27
- package/dist/index.mjs +6 -8
- package/package.json +1 -1
- package/dist/chunk-D5N7OBSO.mjs +0 -76
- package/dist/chunk-SIVCIIB6.mjs +0 -112
- package/dist/{chunk-WYHCK7XL.mjs → chunk-ZYS4NSXT.mjs} +3 -3
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
table_head_default
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-UWXCAR5C.mjs";
|
|
5
|
+
import "../../chunk-DQRAFUDA.mjs";
|
|
6
|
+
import "../../chunk-M37VBNB3.mjs";
|
|
5
7
|
import "../../chunk-MZ76AA76.mjs";
|
|
6
8
|
import "../../chunk-6PN3DGOE.mjs";
|
|
9
|
+
import "../../chunk-7B7LRG5J.mjs";
|
|
10
|
+
import "../../chunk-CC2F5HQX.mjs";
|
|
11
|
+
import "../../chunk-F3HENRVM.mjs";
|
|
12
|
+
import "../../chunk-2GCSFWHD.mjs";
|
|
13
|
+
import "../../chunk-5M7UDEMG.mjs";
|
|
7
14
|
import "../../chunk-QZ3LVYJW.mjs";
|
|
8
15
|
import "../../chunk-SKOCUCE5.mjs";
|
|
16
|
+
import "../../chunk-ZYIIXWVY.mjs";
|
|
17
|
+
import "../../chunk-JP4TEWP7.mjs";
|
|
18
|
+
import "../../chunk-RRONV7YA.mjs";
|
|
9
19
|
import "../../chunk-XOPCRI7Z.mjs";
|
|
10
20
|
import "../../chunk-27Y6K5NK.mjs";
|
|
11
21
|
import "../../chunk-E3G5QXSH.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as tailwind_variants from 'tailwind-variants';
|
|
2
2
|
import { VariantProps } from 'tailwind-variants';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
-
import { ComponentPropsWithRef, ReactElement, ReactNode } from 'react';
|
|
4
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode, CSSProperties } from 'react';
|
|
5
5
|
import { SlotsToClasses } from '../../utils/types.mjs';
|
|
6
6
|
|
|
7
7
|
interface TableBaseProps extends Omit<ComponentPropsWithRef<"table">, "ref" | "color" | "slot" | "size" | "height" | "defaultChecked" | "defaultValue"> {
|
|
@@ -189,6 +189,7 @@ declare const tableStyle: tailwind_variants.TVReturnType<{
|
|
|
189
189
|
td: string[];
|
|
190
190
|
empty: string[];
|
|
191
191
|
}, undefined, unknown, unknown, undefined>>;
|
|
192
|
+
declare const getCellStyle: (column: TableColumn) => CSSProperties;
|
|
192
193
|
type TableVariantProps = VariantProps<typeof tableStyle>;
|
|
193
194
|
type TableSlots = keyof ReturnType<typeof tableStyle>;
|
|
194
195
|
type TableReturnType = ReturnType<typeof tableStyle>;
|
|
@@ -220,4 +221,4 @@ type ValueFormatterParams<V = any> = {
|
|
|
220
221
|
value: V;
|
|
221
222
|
};
|
|
222
223
|
|
|
223
|
-
export { type TableColumn, type TableRef, type TableReturnType, type TableRow, type TableSlots, type TableVariantProps, Table as default };
|
|
224
|
+
export { type TableColumn, type TableRef, type TableReturnType, type TableRow, type TableSlots, type TableVariantProps, Table as default, getCellStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as tailwind_variants from 'tailwind-variants';
|
|
2
2
|
import { VariantProps } from 'tailwind-variants';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
-
import { ComponentPropsWithRef, ReactElement, ReactNode } from 'react';
|
|
4
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode, CSSProperties } from 'react';
|
|
5
5
|
import { SlotsToClasses } from '../../utils/types.js';
|
|
6
6
|
|
|
7
7
|
interface TableBaseProps extends Omit<ComponentPropsWithRef<"table">, "ref" | "color" | "slot" | "size" | "height" | "defaultChecked" | "defaultValue"> {
|
|
@@ -189,6 +189,7 @@ declare const tableStyle: tailwind_variants.TVReturnType<{
|
|
|
189
189
|
td: string[];
|
|
190
190
|
empty: string[];
|
|
191
191
|
}, undefined, unknown, unknown, undefined>>;
|
|
192
|
+
declare const getCellStyle: (column: TableColumn) => CSSProperties;
|
|
192
193
|
type TableVariantProps = VariantProps<typeof tableStyle>;
|
|
193
194
|
type TableSlots = keyof ReturnType<typeof tableStyle>;
|
|
194
195
|
type TableReturnType = ReturnType<typeof tableStyle>;
|
|
@@ -220,4 +221,4 @@ type ValueFormatterParams<V = any> = {
|
|
|
220
221
|
value: V;
|
|
221
222
|
};
|
|
222
223
|
|
|
223
|
-
export { type TableColumn, type TableRef, type TableReturnType, type TableRow, type TableSlots, type TableVariantProps, Table as default };
|
|
224
|
+
export { type TableColumn, type TableRef, type TableReturnType, type TableRow, type TableSlots, type TableVariantProps, Table as default, getCellStyle };
|
|
@@ -102,7 +102,8 @@ var require_plugin = __commonJS({
|
|
|
102
102
|
// src/components/table/table.tsx
|
|
103
103
|
var table_exports = {};
|
|
104
104
|
__export(table_exports, {
|
|
105
|
-
default: () => table_default
|
|
105
|
+
default: () => table_default,
|
|
106
|
+
getCellStyle: () => getCellStyle
|
|
106
107
|
});
|
|
107
108
|
module.exports = __toCommonJS(table_exports);
|
|
108
109
|
var import_react5 = require("react");
|
|
@@ -692,17 +693,14 @@ var TableHead = ({
|
|
|
692
693
|
"th",
|
|
693
694
|
{
|
|
694
695
|
className: clsx(slots.th({ class: classNames == null ? void 0 : classNames.th }), column == null ? void 0 : column.className),
|
|
695
|
-
style: {
|
|
696
|
-
width:
|
|
697
|
-
minWidth:
|
|
698
|
-
maxWidth:
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
boxSizing: "border-box"
|
|
704
|
-
} : {}
|
|
705
|
-
},
|
|
696
|
+
style: isCheckbox ? {
|
|
697
|
+
width: "40px",
|
|
698
|
+
minWidth: "40px",
|
|
699
|
+
maxWidth: "40px",
|
|
700
|
+
flexShrink: 0,
|
|
701
|
+
flexGrow: 0,
|
|
702
|
+
boxSizing: "border-box"
|
|
703
|
+
} : column ? getCellStyle(column) : void 0,
|
|
706
704
|
children: content
|
|
707
705
|
},
|
|
708
706
|
key
|
|
@@ -750,21 +748,6 @@ var TableBody = ({
|
|
|
750
748
|
classNames,
|
|
751
749
|
className
|
|
752
750
|
}) => {
|
|
753
|
-
const getCellStyle = (column) => ({
|
|
754
|
-
width: column.width ? `${column.width}px` : "auto",
|
|
755
|
-
minWidth: column.minWidth ? `${column.minWidth}px` : void 0,
|
|
756
|
-
maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
|
|
757
|
-
height: column.height ? `${column.height}px` : void 0,
|
|
758
|
-
textAlign: column.align || "center",
|
|
759
|
-
...column.width && {
|
|
760
|
-
flexShrink: 0,
|
|
761
|
-
flexGrow: 0,
|
|
762
|
-
boxSizing: "border-box",
|
|
763
|
-
overflow: "hidden",
|
|
764
|
-
textOverflow: "ellipsis",
|
|
765
|
-
whiteSpace: "nowrap"
|
|
766
|
-
}
|
|
767
|
-
});
|
|
768
751
|
const renderTdSkeleton = (key, column) => {
|
|
769
752
|
const isCheckbox = key.includes("checkbox");
|
|
770
753
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
@@ -6178,6 +6161,15 @@ var Table = (0, import_react5.forwardRef)((originalProps, ref) => {
|
|
|
6178
6161
|
const { page = 1, perPage = 15 } = pagination || {};
|
|
6179
6162
|
const showPagination = pagination && totalData > 0 && !isLoading;
|
|
6180
6163
|
const [checkedRows, setCheckedRows] = (0, import_react5.useState)(/* @__PURE__ */ new Set());
|
|
6164
|
+
const tableMinWidth = (0, import_react5.useMemo)(() => {
|
|
6165
|
+
const columnsWidth = columns.reduce((total, column) => {
|
|
6166
|
+
if (column.width) return total + column.width;
|
|
6167
|
+
if (column.minWidth) return total + column.minWidth;
|
|
6168
|
+
return total + 100;
|
|
6169
|
+
}, 0);
|
|
6170
|
+
const checkboxWidth = rowCheckbox ? 40 : 0;
|
|
6171
|
+
return columnsWidth + checkboxWidth;
|
|
6172
|
+
}, [columns, rowCheckbox]);
|
|
6181
6173
|
(0, import_react5.useEffect)(() => {
|
|
6182
6174
|
onCheckedRowsChange == null ? void 0 : onCheckedRowsChange(getCheckedRowData(checkedRows));
|
|
6183
6175
|
}, [checkedRows]);
|
|
@@ -6217,7 +6209,8 @@ var Table = (0, import_react5.forwardRef)((originalProps, ref) => {
|
|
|
6217
6209
|
className: slots.table({ class: classNames == null ? void 0 : classNames.table }),
|
|
6218
6210
|
style: {
|
|
6219
6211
|
tableLayout: "fixed",
|
|
6220
|
-
width: "100%"
|
|
6212
|
+
width: "100%",
|
|
6213
|
+
minWidth: `${tableMinWidth}px`
|
|
6221
6214
|
},
|
|
6222
6215
|
children: [
|
|
6223
6216
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
@@ -6487,3 +6480,22 @@ var tableStyle = (0, import_tailwind_variants7.tv)({
|
|
|
6487
6480
|
height: "narrow"
|
|
6488
6481
|
}
|
|
6489
6482
|
});
|
|
6483
|
+
var getCellStyle = (column) => {
|
|
6484
|
+
const hasFixedWidth = column.width;
|
|
6485
|
+
const hasMinWidth = column.minWidth;
|
|
6486
|
+
return {
|
|
6487
|
+
width: hasFixedWidth ? `${column.width}px` : "auto",
|
|
6488
|
+
minWidth: hasMinWidth ? `${column.minWidth}px` : hasFixedWidth ? `${column.width}px` : void 0,
|
|
6489
|
+
maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
|
|
6490
|
+
height: column.height ? `${column.height}px` : void 0,
|
|
6491
|
+
textAlign: column.align || "center",
|
|
6492
|
+
boxSizing: "border-box",
|
|
6493
|
+
overflow: "hidden",
|
|
6494
|
+
textOverflow: "ellipsis",
|
|
6495
|
+
whiteSpace: "nowrap"
|
|
6496
|
+
};
|
|
6497
|
+
};
|
|
6498
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
6499
|
+
0 && (module.exports = {
|
|
6500
|
+
getCellStyle
|
|
6501
|
+
});
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
+
getCellStyle,
|
|
3
4
|
table_default
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-SIVCIIB6.mjs";
|
|
6
|
-
import "../../chunk-D5N7OBSO.mjs";
|
|
5
|
+
} from "../../chunk-UWXCAR5C.mjs";
|
|
7
6
|
import "../../chunk-DQRAFUDA.mjs";
|
|
8
7
|
import "../../chunk-M37VBNB3.mjs";
|
|
9
8
|
import "../../chunk-MZ76AA76.mjs";
|
|
@@ -23,5 +22,6 @@ import "../../chunk-27Y6K5NK.mjs";
|
|
|
23
22
|
import "../../chunk-E3G5QXSH.mjs";
|
|
24
23
|
import "../../chunk-AC6TWLRT.mjs";
|
|
25
24
|
export {
|
|
26
|
-
table_default as default
|
|
25
|
+
table_default as default,
|
|
26
|
+
getCellStyle
|
|
27
27
|
};
|
package/dist/index.js
CHANGED
|
@@ -7718,17 +7718,14 @@ var TableHead = ({
|
|
|
7718
7718
|
"th",
|
|
7719
7719
|
{
|
|
7720
7720
|
className: clsx(slots.th({ class: classNames == null ? void 0 : classNames.th }), column == null ? void 0 : column.className),
|
|
7721
|
-
style: {
|
|
7722
|
-
width:
|
|
7723
|
-
minWidth:
|
|
7724
|
-
maxWidth:
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
boxSizing: "border-box"
|
|
7730
|
-
} : {}
|
|
7731
|
-
},
|
|
7721
|
+
style: isCheckbox ? {
|
|
7722
|
+
width: "40px",
|
|
7723
|
+
minWidth: "40px",
|
|
7724
|
+
maxWidth: "40px",
|
|
7725
|
+
flexShrink: 0,
|
|
7726
|
+
flexGrow: 0,
|
|
7727
|
+
boxSizing: "border-box"
|
|
7728
|
+
} : column ? getCellStyle(column) : void 0,
|
|
7732
7729
|
children: content
|
|
7733
7730
|
},
|
|
7734
7731
|
key
|
|
@@ -7776,21 +7773,6 @@ var TableBody = ({
|
|
|
7776
7773
|
classNames,
|
|
7777
7774
|
className
|
|
7778
7775
|
}) => {
|
|
7779
|
-
const getCellStyle = (column) => ({
|
|
7780
|
-
width: column.width ? `${column.width}px` : "auto",
|
|
7781
|
-
minWidth: column.minWidth ? `${column.minWidth}px` : void 0,
|
|
7782
|
-
maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
|
|
7783
|
-
height: column.height ? `${column.height}px` : void 0,
|
|
7784
|
-
textAlign: column.align || "center",
|
|
7785
|
-
...column.width && {
|
|
7786
|
-
flexShrink: 0,
|
|
7787
|
-
flexGrow: 0,
|
|
7788
|
-
boxSizing: "border-box",
|
|
7789
|
-
overflow: "hidden",
|
|
7790
|
-
textOverflow: "ellipsis",
|
|
7791
|
-
whiteSpace: "nowrap"
|
|
7792
|
-
}
|
|
7793
|
-
});
|
|
7794
7776
|
const renderTdSkeleton = (key, column) => {
|
|
7795
7777
|
const isCheckbox = key.includes("checkbox");
|
|
7796
7778
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
@@ -8201,6 +8183,15 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
|
8201
8183
|
const { page = 1, perPage = 15 } = pagination || {};
|
|
8202
8184
|
const showPagination = pagination && totalData > 0 && !isLoading;
|
|
8203
8185
|
const [checkedRows, setCheckedRows] = (0, import_react15.useState)(/* @__PURE__ */ new Set());
|
|
8186
|
+
const tableMinWidth = (0, import_react15.useMemo)(() => {
|
|
8187
|
+
const columnsWidth = columns.reduce((total, column) => {
|
|
8188
|
+
if (column.width) return total + column.width;
|
|
8189
|
+
if (column.minWidth) return total + column.minWidth;
|
|
8190
|
+
return total + 100;
|
|
8191
|
+
}, 0);
|
|
8192
|
+
const checkboxWidth = rowCheckbox ? 40 : 0;
|
|
8193
|
+
return columnsWidth + checkboxWidth;
|
|
8194
|
+
}, [columns, rowCheckbox]);
|
|
8204
8195
|
(0, import_react15.useEffect)(() => {
|
|
8205
8196
|
onCheckedRowsChange == null ? void 0 : onCheckedRowsChange(getCheckedRowData(checkedRows));
|
|
8206
8197
|
}, [checkedRows]);
|
|
@@ -8240,7 +8231,8 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
|
8240
8231
|
className: slots.table({ class: classNames == null ? void 0 : classNames.table }),
|
|
8241
8232
|
style: {
|
|
8242
8233
|
tableLayout: "fixed",
|
|
8243
|
-
width: "100%"
|
|
8234
|
+
width: "100%",
|
|
8235
|
+
minWidth: `${tableMinWidth}px`
|
|
8244
8236
|
},
|
|
8245
8237
|
children: [
|
|
8246
8238
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
@@ -8510,6 +8502,21 @@ var tableStyle = (0, import_tailwind_variants16.tv)({
|
|
|
8510
8502
|
height: "narrow"
|
|
8511
8503
|
}
|
|
8512
8504
|
});
|
|
8505
|
+
var getCellStyle = (column) => {
|
|
8506
|
+
const hasFixedWidth = column.width;
|
|
8507
|
+
const hasMinWidth = column.minWidth;
|
|
8508
|
+
return {
|
|
8509
|
+
width: hasFixedWidth ? `${column.width}px` : "auto",
|
|
8510
|
+
minWidth: hasMinWidth ? `${column.minWidth}px` : hasFixedWidth ? `${column.width}px` : void 0,
|
|
8511
|
+
maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
|
|
8512
|
+
height: column.height ? `${column.height}px` : void 0,
|
|
8513
|
+
textAlign: column.align || "center",
|
|
8514
|
+
boxSizing: "border-box",
|
|
8515
|
+
overflow: "hidden",
|
|
8516
|
+
textOverflow: "ellipsis",
|
|
8517
|
+
whiteSpace: "nowrap"
|
|
8518
|
+
};
|
|
8519
|
+
};
|
|
8513
8520
|
|
|
8514
8521
|
// src/components/table/definition-table.tsx
|
|
8515
8522
|
var import_react16 = require("react");
|
package/dist/index.mjs
CHANGED
|
@@ -28,9 +28,7 @@ import {
|
|
|
28
28
|
} from "./chunk-KCAGZUYM.mjs";
|
|
29
29
|
import {
|
|
30
30
|
table_default
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-SIVCIIB6.mjs";
|
|
33
|
-
import "./chunk-D5N7OBSO.mjs";
|
|
31
|
+
} from "./chunk-UWXCAR5C.mjs";
|
|
34
32
|
import "./chunk-3MY6LO7N.mjs";
|
|
35
33
|
import {
|
|
36
34
|
tabs_default
|
|
@@ -88,15 +86,15 @@ import {
|
|
|
88
86
|
import "./chunk-75HLCORR.mjs";
|
|
89
87
|
import {
|
|
90
88
|
dateTimePicker_default
|
|
91
|
-
} from "./chunk-
|
|
92
|
-
import "./chunk-
|
|
89
|
+
} from "./chunk-L65ETSUY.mjs";
|
|
90
|
+
import "./chunk-ZYS4NSXT.mjs";
|
|
93
91
|
import "./chunk-7MVEAQ7Z.mjs";
|
|
94
|
-
import {
|
|
95
|
-
list_default
|
|
96
|
-
} from "./chunk-B6XJNGQL.mjs";
|
|
97
92
|
import {
|
|
98
93
|
listItem_default
|
|
99
94
|
} from "./chunk-QFIS6N5R.mjs";
|
|
95
|
+
import {
|
|
96
|
+
list_default
|
|
97
|
+
} from "./chunk-B6XJNGQL.mjs";
|
|
100
98
|
import "./chunk-FWJ2ZKH6.mjs";
|
|
101
99
|
import "./chunk-TUXYVNTY.mjs";
|
|
102
100
|
import "./chunk-P732YGHO.mjs";
|
package/package.json
CHANGED
package/dist/chunk-D5N7OBSO.mjs
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
skeleton_default
|
|
4
|
-
} from "./chunk-6PN3DGOE.mjs";
|
|
5
|
-
import {
|
|
6
|
-
checkbox_default
|
|
7
|
-
} from "./chunk-SKOCUCE5.mjs";
|
|
8
|
-
import {
|
|
9
|
-
clsx
|
|
10
|
-
} from "./chunk-27Y6K5NK.mjs";
|
|
11
|
-
|
|
12
|
-
// src/components/table/table-head.tsx
|
|
13
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
var TableHead = ({
|
|
15
|
-
slots,
|
|
16
|
-
columns,
|
|
17
|
-
color,
|
|
18
|
-
size,
|
|
19
|
-
rowCheckbox = false,
|
|
20
|
-
isCheckedAll,
|
|
21
|
-
isLoading = false,
|
|
22
|
-
classNames,
|
|
23
|
-
onCheckAll
|
|
24
|
-
}) => {
|
|
25
|
-
const handleClickCheckAll = (e) => {
|
|
26
|
-
e.preventDefault();
|
|
27
|
-
onCheckAll(!isCheckedAll);
|
|
28
|
-
};
|
|
29
|
-
const renderTh = (content, key, column, isCheckbox) => /* @__PURE__ */ jsx(
|
|
30
|
-
"th",
|
|
31
|
-
{
|
|
32
|
-
className: clsx(slots.th({ class: classNames == null ? void 0 : classNames.th }), column == null ? void 0 : column.className),
|
|
33
|
-
style: {
|
|
34
|
-
width: isCheckbox ? "40px" : (column == null ? void 0 : column.width) ? `${column.width}px` : "auto",
|
|
35
|
-
minWidth: isCheckbox ? "40px" : (column == null ? void 0 : column.minWidth) ? `${column.minWidth}px` : void 0,
|
|
36
|
-
maxWidth: isCheckbox ? "40px" : (column == null ? void 0 : column.maxWidth) ? `${column.maxWidth}px` : void 0,
|
|
37
|
-
height: (column == null ? void 0 : column.height) ? `${column.height}px` : void 0,
|
|
38
|
-
...isCheckbox || (column == null ? void 0 : column.width) ? {
|
|
39
|
-
flexShrink: 0,
|
|
40
|
-
flexGrow: 0,
|
|
41
|
-
boxSizing: "border-box"
|
|
42
|
-
} : {}
|
|
43
|
-
},
|
|
44
|
-
children: content
|
|
45
|
-
},
|
|
46
|
-
key
|
|
47
|
-
);
|
|
48
|
-
const renderSkeletonRow = () => /* @__PURE__ */ jsx("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ jsxs("tr", { className: clsx(slots.tr({ class: classNames == null ? void 0 : classNames.tr }), "[&>th]:border-0"), children: [
|
|
49
|
-
columns.map(
|
|
50
|
-
(column, idx) => renderTh(/* @__PURE__ */ jsx(skeleton_default, { color, rounded: "lg", speed: "fast" }), `skeleton-${idx}`, column)
|
|
51
|
-
),
|
|
52
|
-
rowCheckbox && renderTh(/* @__PURE__ */ jsx(skeleton_default, { color, rounded: "lg", speed: "fast" }), "checkbox-skeleton", void 0, true)
|
|
53
|
-
] }) });
|
|
54
|
-
const renderContentRow = () => /* @__PURE__ */ jsx("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ jsxs("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
55
|
-
columns.map((column, idx) => renderTh(column.headerName, `${column.field}-${idx}`, column)),
|
|
56
|
-
rowCheckbox && renderTh(
|
|
57
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", onClick: handleClickCheckAll, children: /* @__PURE__ */ jsx(
|
|
58
|
-
checkbox_default,
|
|
59
|
-
{
|
|
60
|
-
size,
|
|
61
|
-
checked: isCheckedAll,
|
|
62
|
-
onChange: (e) => onCheckAll(e.target.checked)
|
|
63
|
-
}
|
|
64
|
-
) }),
|
|
65
|
-
"checkbox",
|
|
66
|
-
void 0,
|
|
67
|
-
true
|
|
68
|
-
)
|
|
69
|
-
] }) });
|
|
70
|
-
return isLoading ? renderSkeletonRow() : renderContentRow();
|
|
71
|
-
};
|
|
72
|
-
var table_head_default = TableHead;
|
|
73
|
-
|
|
74
|
-
export {
|
|
75
|
-
table_head_default
|
|
76
|
-
};
|
package/dist/chunk-SIVCIIB6.mjs
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
skeleton_default
|
|
4
|
-
} from "./chunk-6PN3DGOE.mjs";
|
|
5
|
-
import {
|
|
6
|
-
checkbox_default
|
|
7
|
-
} from "./chunk-SKOCUCE5.mjs";
|
|
8
|
-
import {
|
|
9
|
-
clsx
|
|
10
|
-
} from "./chunk-27Y6K5NK.mjs";
|
|
11
|
-
|
|
12
|
-
// src/components/table/table-body.tsx
|
|
13
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
var TableBody = ({
|
|
15
|
-
slots,
|
|
16
|
-
rows,
|
|
17
|
-
columns,
|
|
18
|
-
size,
|
|
19
|
-
color,
|
|
20
|
-
rowCheckbox = false,
|
|
21
|
-
checkedRows,
|
|
22
|
-
onCheckRow,
|
|
23
|
-
isLoading = false,
|
|
24
|
-
emptyContent,
|
|
25
|
-
skeletonRow,
|
|
26
|
-
classNames,
|
|
27
|
-
className
|
|
28
|
-
}) => {
|
|
29
|
-
const getCellStyle = (column) => ({
|
|
30
|
-
width: column.width ? `${column.width}px` : "auto",
|
|
31
|
-
minWidth: column.minWidth ? `${column.minWidth}px` : void 0,
|
|
32
|
-
maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
|
|
33
|
-
height: column.height ? `${column.height}px` : void 0,
|
|
34
|
-
textAlign: column.align || "center",
|
|
35
|
-
...column.width && {
|
|
36
|
-
flexShrink: 0,
|
|
37
|
-
flexGrow: 0,
|
|
38
|
-
boxSizing: "border-box",
|
|
39
|
-
overflow: "hidden",
|
|
40
|
-
textOverflow: "ellipsis",
|
|
41
|
-
whiteSpace: "nowrap"
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const renderTdSkeleton = (key, column) => {
|
|
45
|
-
const isCheckbox = key.includes("checkbox");
|
|
46
|
-
return /* @__PURE__ */ jsx(
|
|
47
|
-
"td",
|
|
48
|
-
{
|
|
49
|
-
className: slots.td({ class: classNames == null ? void 0 : classNames.td }),
|
|
50
|
-
style: isCheckbox ? {
|
|
51
|
-
width: "40px",
|
|
52
|
-
minWidth: "40px",
|
|
53
|
-
maxWidth: "40px",
|
|
54
|
-
flexShrink: 0,
|
|
55
|
-
flexGrow: 0,
|
|
56
|
-
boxSizing: "border-box"
|
|
57
|
-
} : column ? getCellStyle(column) : void 0,
|
|
58
|
-
children: /* @__PURE__ */ jsx(skeleton_default, { color, className: "h-full w-full", rounded: "lg", speed: "fast" })
|
|
59
|
-
},
|
|
60
|
-
key
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
const renderCheckboxCell = (rowId) => /* @__PURE__ */ jsx(
|
|
64
|
-
"td",
|
|
65
|
-
{
|
|
66
|
-
className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }), "text-center"),
|
|
67
|
-
style: {
|
|
68
|
-
width: "40px",
|
|
69
|
-
minWidth: "40px",
|
|
70
|
-
maxWidth: "40px",
|
|
71
|
-
flexShrink: 0,
|
|
72
|
-
flexGrow: 0,
|
|
73
|
-
boxSizing: "border-box"
|
|
74
|
-
},
|
|
75
|
-
children: /* @__PURE__ */ jsx(checkbox_default, { size, checked: checkedRows.has(rowId), onChange: (e) => onCheckRow(rowId, e.target.checked) })
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
const renderSkeletonRow = (rowIndex) => /* @__PURE__ */ jsxs("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
79
|
-
columns.map((column, colIdx) => renderTdSkeleton(`skeleton-${rowIndex}-${colIdx}`, column)),
|
|
80
|
-
rowCheckbox && renderTdSkeleton(`skeleton-checkbox-${rowIndex}`)
|
|
81
|
-
] }, `skeleton-${rowIndex}`);
|
|
82
|
-
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 }) });
|
|
83
|
-
const renderDataRow = (row, rowIndex) => /* @__PURE__ */ jsxs("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
84
|
-
columns.map((column, colIdx) => {
|
|
85
|
-
var _a;
|
|
86
|
-
const value = row[column.field];
|
|
87
|
-
const formattedValue = ((_a = column.valueFormatter) == null ? void 0 : _a.call(column, { value, field: column.field })) || value;
|
|
88
|
-
const content = column.renderCell ? column.renderCell({ id: row.id, field: column.field, value, formattedValue, row }) : formattedValue;
|
|
89
|
-
return /* @__PURE__ */ jsx(
|
|
90
|
-
"td",
|
|
91
|
-
{
|
|
92
|
-
className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }), column.className),
|
|
93
|
-
style: getCellStyle(column),
|
|
94
|
-
children: content
|
|
95
|
-
},
|
|
96
|
-
`${rowIndex}-${colIdx}`
|
|
97
|
-
);
|
|
98
|
-
}),
|
|
99
|
-
rowCheckbox && renderCheckboxCell(row.id)
|
|
100
|
-
] }, rowIndex);
|
|
101
|
-
const renderRows = () => {
|
|
102
|
-
if (isLoading) return skeletonRow ? Array.from({ length: skeletonRow }, (_, idx) => renderSkeletonRow(idx)) : /* @__PURE__ */ jsx(Fragment, {});
|
|
103
|
-
if (!rows.length && emptyContent) return renderEmptyRow();
|
|
104
|
-
return rows.map((row, index) => renderDataRow(row, index));
|
|
105
|
-
};
|
|
106
|
-
return /* @__PURE__ */ jsx("tbody", { className: `${slots.tbody({ class: classNames == null ? void 0 : classNames.tbody })} ${className || ""}`, children: renderRows() });
|
|
107
|
-
};
|
|
108
|
-
var table_body_default = TableBody;
|
|
109
|
-
|
|
110
|
-
export {
|
|
111
|
-
table_body_default
|
|
112
|
-
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
list_default
|
|
4
|
-
} from "./chunk-B6XJNGQL.mjs";
|
|
5
2
|
import {
|
|
6
3
|
listItem_default
|
|
7
4
|
} from "./chunk-QFIS6N5R.mjs";
|
|
5
|
+
import {
|
|
6
|
+
list_default
|
|
7
|
+
} from "./chunk-B6XJNGQL.mjs";
|
|
8
8
|
|
|
9
9
|
// src/components/dateTimePicker/timePicker.tsx
|
|
10
10
|
import { useState, useRef, useEffect } from "react";
|