@deepnoid/ui 0.0.98 → 0.0.99
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/{chunk-PNFR2J4Q.mjs → chunk-JMXQYSKY.mjs} +71 -43
- package/dist/{chunk-B4KZBOGT.mjs → chunk-UGBBOYHB.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/pagination/pagination.test.js +1 -1
- package/dist/components/pagination/pagination.test.mjs +1 -1
- package/dist/components/table/index.js +71 -43
- package/dist/components/table/index.mjs +1 -1
- package/dist/components/table/table-body.d.mts +0 -1
- package/dist/components/table/table-body.d.ts +0 -1
- package/dist/components/table/table.d.mts +60 -3
- package/dist/components/table/table.d.ts +60 -3
- package/dist/components/table/table.js +71 -43
- package/dist/components/table/table.mjs +1 -1
- package/dist/components/table/table.test.js +71 -43
- package/dist/components/table/table.test.mjs +1 -1
- package/dist/index.js +72 -44
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ import { tv } from "tailwind-variants";
|
|
|
18
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
var Table = forwardRef((originalProps, ref) => {
|
|
20
20
|
const [props, variantProps] = mapPropsVariants(originalProps, table.variantKeys);
|
|
21
|
-
const { classNames, rows, columns,
|
|
21
|
+
const { classNames, rows, columns, className, emptyContent, loadingContent, onRowAction, ...tableComponentsProps } = props;
|
|
22
22
|
const [checkedRows, setCheckedRows] = useState(/* @__PURE__ */ new Set());
|
|
23
23
|
const [selectedRows, setSelectedRows] = useState(/* @__PURE__ */ new Set());
|
|
24
24
|
useEffect(() => {
|
|
@@ -38,10 +38,17 @@ var Table = forwardRef((originalProps, ref) => {
|
|
|
38
38
|
const getTableProps = useCallback(
|
|
39
39
|
(props2) => ({
|
|
40
40
|
...props2,
|
|
41
|
-
className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table
|
|
41
|
+
className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table) })
|
|
42
42
|
}),
|
|
43
43
|
[classNames == null ? void 0 : classNames.table, slots]
|
|
44
44
|
);
|
|
45
|
+
const getLoadingWrapperProps = useCallback(
|
|
46
|
+
(props2) => ({
|
|
47
|
+
...props2,
|
|
48
|
+
className: slots.loadingWrapper({ class: clsx(classNames == null ? void 0 : classNames.loadingWrapper) })
|
|
49
|
+
}),
|
|
50
|
+
[classNames == null ? void 0 : classNames.loadingWrapper, slots]
|
|
51
|
+
);
|
|
45
52
|
const handleCheckAll = (isChecked) => {
|
|
46
53
|
const newCheckedRows = isChecked ? new Set(rows.map((_, index) => index)) : /* @__PURE__ */ new Set();
|
|
47
54
|
setCheckedRows(newCheckedRows);
|
|
@@ -79,53 +86,55 @@ var Table = forwardRef((originalProps, ref) => {
|
|
|
79
86
|
setCheckedRows,
|
|
80
87
|
setSelectedRows
|
|
81
88
|
}));
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
89
|
+
return /* @__PURE__ */ jsxs("div", { ref, "data-table": "base", ...getBaseProps(), children: [
|
|
90
|
+
/* @__PURE__ */ jsxs("table", { ...getTableProps(tableComponentsProps), children: [
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
table_head_default,
|
|
93
|
+
{
|
|
94
|
+
classNames,
|
|
95
|
+
slots,
|
|
96
|
+
columns,
|
|
97
|
+
size: originalProps.size,
|
|
98
|
+
color: originalProps.color === "neutral" ? "primary" : originalProps.color,
|
|
99
|
+
isChecked: originalProps.isChecked,
|
|
100
|
+
isExpanded: originalProps.isExpanded,
|
|
101
|
+
onCheckAll: handleCheckAll,
|
|
102
|
+
isCheckedAll: checkedRows.size === rows.length
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ jsx(
|
|
106
|
+
table_body_default,
|
|
107
|
+
{
|
|
108
|
+
rows,
|
|
109
|
+
columns,
|
|
110
|
+
slots,
|
|
111
|
+
size: originalProps.size,
|
|
112
|
+
color: originalProps.color === "neutral" ? "primary" : originalProps.color,
|
|
113
|
+
isSelected: originalProps.isSelected,
|
|
114
|
+
isChecked: originalProps.isChecked,
|
|
115
|
+
isCheckedRow: originalProps.isCheckedRow,
|
|
116
|
+
isExpanded: originalProps.isExpanded,
|
|
117
|
+
classNames,
|
|
118
|
+
emptyContent,
|
|
119
|
+
selectedRows,
|
|
120
|
+
checkedRows,
|
|
121
|
+
onCheckedRow: handleCheckRow,
|
|
122
|
+
onSelectedRow: handleSelectRow,
|
|
123
|
+
onRowAction
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ jsx("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
|
|
128
|
+
] });
|
|
120
129
|
});
|
|
121
130
|
Table.displayName = "Table";
|
|
122
131
|
var table_default = Table;
|
|
123
132
|
var table = tv({
|
|
124
133
|
slots: {
|
|
125
|
-
base: "flex flex-col relative gap-4",
|
|
134
|
+
base: "flex flex-col relative gap-4 select-none",
|
|
126
135
|
table: "w-full h-auto",
|
|
127
136
|
thead: "[&>tr]:first:rounded-lg",
|
|
128
|
-
tbody: "
|
|
137
|
+
tbody: "",
|
|
129
138
|
tr: ["group", "outline-none", "w-full"],
|
|
130
139
|
th: [
|
|
131
140
|
"text-foreground",
|
|
@@ -164,7 +173,18 @@ var table = tv({
|
|
|
164
173
|
"data-[direction=ascending]:rotate-180"
|
|
165
174
|
],
|
|
166
175
|
emptyWrapper: "text-neutral-light align-middle text-center h-40",
|
|
167
|
-
loadingWrapper:
|
|
176
|
+
loadingWrapper: [
|
|
177
|
+
"absolute",
|
|
178
|
+
"inset-0",
|
|
179
|
+
"flex",
|
|
180
|
+
"items-center",
|
|
181
|
+
"justify-center",
|
|
182
|
+
"bg-black/40",
|
|
183
|
+
"text-white",
|
|
184
|
+
"transition-opacity",
|
|
185
|
+
"duration-300",
|
|
186
|
+
"ease-in-out"
|
|
187
|
+
]
|
|
168
188
|
},
|
|
169
189
|
variants: {
|
|
170
190
|
variant: {
|
|
@@ -210,6 +230,14 @@ var table = tv({
|
|
|
210
230
|
expandedTr: "border-trans-light"
|
|
211
231
|
}
|
|
212
232
|
},
|
|
233
|
+
isLoading: {
|
|
234
|
+
true: {
|
|
235
|
+
loadingWrapper: "visible opacity-100"
|
|
236
|
+
},
|
|
237
|
+
false: {
|
|
238
|
+
loadingWrapper: "invisible opacity-0"
|
|
239
|
+
}
|
|
240
|
+
},
|
|
213
241
|
isSelected: {
|
|
214
242
|
true: {}
|
|
215
243
|
},
|
|
@@ -12946,7 +12946,7 @@ var Pagination = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
12946
12946
|
currentPage,
|
|
12947
12947
|
groupSize,
|
|
12948
12948
|
totalPage,
|
|
12949
|
-
showPageNumber,
|
|
12949
|
+
showPageNumber = true,
|
|
12950
12950
|
showPageLabel,
|
|
12951
12951
|
showFirstLastButtons,
|
|
12952
12952
|
handleChangePage
|
|
@@ -4052,7 +4052,7 @@ var import_tailwind_variants3 = require("tailwind-variants");
|
|
|
4052
4052
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
4053
4053
|
var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
|
|
4054
4054
|
const [props, variantProps] = mapPropsVariants(originalProps, table.variantKeys);
|
|
4055
|
-
const { classNames, rows, columns,
|
|
4055
|
+
const { classNames, rows, columns, className, emptyContent, loadingContent, onRowAction, ...tableComponentsProps } = props;
|
|
4056
4056
|
const [checkedRows, setCheckedRows] = (0, import_react6.useState)(/* @__PURE__ */ new Set());
|
|
4057
4057
|
const [selectedRows, setSelectedRows] = (0, import_react6.useState)(/* @__PURE__ */ new Set());
|
|
4058
4058
|
(0, import_react6.useEffect)(() => {
|
|
@@ -4072,10 +4072,17 @@ var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
|
|
|
4072
4072
|
const getTableProps = (0, import_react6.useCallback)(
|
|
4073
4073
|
(props2) => ({
|
|
4074
4074
|
...props2,
|
|
4075
|
-
className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table
|
|
4075
|
+
className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table) })
|
|
4076
4076
|
}),
|
|
4077
4077
|
[classNames == null ? void 0 : classNames.table, slots]
|
|
4078
4078
|
);
|
|
4079
|
+
const getLoadingWrapperProps = (0, import_react6.useCallback)(
|
|
4080
|
+
(props2) => ({
|
|
4081
|
+
...props2,
|
|
4082
|
+
className: slots.loadingWrapper({ class: clsx(classNames == null ? void 0 : classNames.loadingWrapper) })
|
|
4083
|
+
}),
|
|
4084
|
+
[classNames == null ? void 0 : classNames.loadingWrapper, slots]
|
|
4085
|
+
);
|
|
4079
4086
|
const handleCheckAll = (isChecked) => {
|
|
4080
4087
|
const newCheckedRows = isChecked ? new Set(rows.map((_, index) => index)) : /* @__PURE__ */ new Set();
|
|
4081
4088
|
setCheckedRows(newCheckedRows);
|
|
@@ -4113,53 +4120,55 @@ var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
|
|
|
4113
4120
|
setCheckedRows,
|
|
4114
4121
|
setSelectedRows
|
|
4115
4122
|
}));
|
|
4116
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.
|
|
4117
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref, "data-table": "base", ...getBaseProps(), children: [
|
|
4124
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("table", { ...getTableProps(tableComponentsProps), children: [
|
|
4125
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4126
|
+
table_head_default,
|
|
4127
|
+
{
|
|
4128
|
+
classNames,
|
|
4129
|
+
slots,
|
|
4130
|
+
columns,
|
|
4131
|
+
size: originalProps.size,
|
|
4132
|
+
color: originalProps.color === "neutral" ? "primary" : originalProps.color,
|
|
4133
|
+
isChecked: originalProps.isChecked,
|
|
4134
|
+
isExpanded: originalProps.isExpanded,
|
|
4135
|
+
onCheckAll: handleCheckAll,
|
|
4136
|
+
isCheckedAll: checkedRows.size === rows.length
|
|
4137
|
+
}
|
|
4138
|
+
),
|
|
4139
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4140
|
+
table_body_default,
|
|
4141
|
+
{
|
|
4142
|
+
rows,
|
|
4143
|
+
columns,
|
|
4144
|
+
slots,
|
|
4145
|
+
size: originalProps.size,
|
|
4146
|
+
color: originalProps.color === "neutral" ? "primary" : originalProps.color,
|
|
4147
|
+
isSelected: originalProps.isSelected,
|
|
4148
|
+
isChecked: originalProps.isChecked,
|
|
4149
|
+
isCheckedRow: originalProps.isCheckedRow,
|
|
4150
|
+
isExpanded: originalProps.isExpanded,
|
|
4151
|
+
classNames,
|
|
4152
|
+
emptyContent,
|
|
4153
|
+
selectedRows,
|
|
4154
|
+
checkedRows,
|
|
4155
|
+
onCheckedRow: handleCheckRow,
|
|
4156
|
+
onSelectedRow: handleSelectRow,
|
|
4157
|
+
onRowAction
|
|
4158
|
+
}
|
|
4159
|
+
)
|
|
4160
|
+
] }),
|
|
4161
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
|
|
4162
|
+
] });
|
|
4154
4163
|
});
|
|
4155
4164
|
Table.displayName = "Table";
|
|
4156
4165
|
var table_default = Table;
|
|
4157
4166
|
var table = (0, import_tailwind_variants3.tv)({
|
|
4158
4167
|
slots: {
|
|
4159
|
-
base: "flex flex-col relative gap-4",
|
|
4168
|
+
base: "flex flex-col relative gap-4 select-none",
|
|
4160
4169
|
table: "w-full h-auto",
|
|
4161
4170
|
thead: "[&>tr]:first:rounded-lg",
|
|
4162
|
-
tbody: "
|
|
4171
|
+
tbody: "",
|
|
4163
4172
|
tr: ["group", "outline-none", "w-full"],
|
|
4164
4173
|
th: [
|
|
4165
4174
|
"text-foreground",
|
|
@@ -4198,7 +4207,18 @@ var table = (0, import_tailwind_variants3.tv)({
|
|
|
4198
4207
|
"data-[direction=ascending]:rotate-180"
|
|
4199
4208
|
],
|
|
4200
4209
|
emptyWrapper: "text-neutral-light align-middle text-center h-40",
|
|
4201
|
-
loadingWrapper:
|
|
4210
|
+
loadingWrapper: [
|
|
4211
|
+
"absolute",
|
|
4212
|
+
"inset-0",
|
|
4213
|
+
"flex",
|
|
4214
|
+
"items-center",
|
|
4215
|
+
"justify-center",
|
|
4216
|
+
"bg-black/40",
|
|
4217
|
+
"text-white",
|
|
4218
|
+
"transition-opacity",
|
|
4219
|
+
"duration-300",
|
|
4220
|
+
"ease-in-out"
|
|
4221
|
+
]
|
|
4202
4222
|
},
|
|
4203
4223
|
variants: {
|
|
4204
4224
|
variant: {
|
|
@@ -4244,6 +4264,14 @@ var table = (0, import_tailwind_variants3.tv)({
|
|
|
4244
4264
|
expandedTr: "border-trans-light"
|
|
4245
4265
|
}
|
|
4246
4266
|
},
|
|
4267
|
+
isLoading: {
|
|
4268
|
+
true: {
|
|
4269
|
+
loadingWrapper: "visible opacity-100"
|
|
4270
|
+
},
|
|
4271
|
+
false: {
|
|
4272
|
+
loadingWrapper: "invisible opacity-0"
|
|
4273
|
+
}
|
|
4274
|
+
},
|
|
4247
4275
|
isSelected: {
|
|
4248
4276
|
true: {}
|
|
4249
4277
|
},
|
|
@@ -9,6 +9,7 @@ interface Props extends Omit<React__default.ComponentPropsWithRef<"table">, "ref
|
|
|
9
9
|
columns: TableColumn[];
|
|
10
10
|
isLoading?: boolean;
|
|
11
11
|
emptyContent?: ReactElement;
|
|
12
|
+
loadingContent?: ReactElement;
|
|
12
13
|
classNames?: SlotsToClasses<TableSlots>;
|
|
13
14
|
onRowAction?: (e: React__default.MouseEvent, params: TableRow) => void;
|
|
14
15
|
}
|
|
@@ -64,6 +65,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
64
65
|
expandedTr: string;
|
|
65
66
|
};
|
|
66
67
|
};
|
|
68
|
+
isLoading: {
|
|
69
|
+
true: {
|
|
70
|
+
loadingWrapper: string;
|
|
71
|
+
};
|
|
72
|
+
false: {
|
|
73
|
+
loadingWrapper: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
67
76
|
isSelected: {
|
|
68
77
|
true: {};
|
|
69
78
|
};
|
|
@@ -111,7 +120,7 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
111
120
|
expandedTr: string;
|
|
112
121
|
sortIcon: string[];
|
|
113
122
|
emptyWrapper: string;
|
|
114
|
-
loadingWrapper: string;
|
|
123
|
+
loadingWrapper: string[];
|
|
115
124
|
}, undefined, tailwind_variants_dist_config.TVConfig<{
|
|
116
125
|
variant: {
|
|
117
126
|
solid: {
|
|
@@ -156,6 +165,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
156
165
|
expandedTr: string;
|
|
157
166
|
};
|
|
158
167
|
};
|
|
168
|
+
isLoading: {
|
|
169
|
+
true: {
|
|
170
|
+
loadingWrapper: string;
|
|
171
|
+
};
|
|
172
|
+
false: {
|
|
173
|
+
loadingWrapper: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
159
176
|
isSelected: {
|
|
160
177
|
true: {};
|
|
161
178
|
};
|
|
@@ -235,6 +252,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
235
252
|
expandedTr: string;
|
|
236
253
|
};
|
|
237
254
|
};
|
|
255
|
+
isLoading: {
|
|
256
|
+
true: {
|
|
257
|
+
loadingWrapper: string;
|
|
258
|
+
};
|
|
259
|
+
false: {
|
|
260
|
+
loadingWrapper: string;
|
|
261
|
+
};
|
|
262
|
+
};
|
|
238
263
|
isSelected: {
|
|
239
264
|
true: {};
|
|
240
265
|
};
|
|
@@ -314,6 +339,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
314
339
|
expandedTr: string;
|
|
315
340
|
};
|
|
316
341
|
};
|
|
342
|
+
isLoading: {
|
|
343
|
+
true: {
|
|
344
|
+
loadingWrapper: string;
|
|
345
|
+
};
|
|
346
|
+
false: {
|
|
347
|
+
loadingWrapper: string;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
317
350
|
isSelected: {
|
|
318
351
|
true: {};
|
|
319
352
|
};
|
|
@@ -361,7 +394,7 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
361
394
|
expandedTr: string;
|
|
362
395
|
sortIcon: string[];
|
|
363
396
|
emptyWrapper: string;
|
|
364
|
-
loadingWrapper: string;
|
|
397
|
+
loadingWrapper: string[];
|
|
365
398
|
}, tailwind_variants.TVReturnType<{
|
|
366
399
|
variant: {
|
|
367
400
|
solid: {
|
|
@@ -406,6 +439,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
406
439
|
expandedTr: string;
|
|
407
440
|
};
|
|
408
441
|
};
|
|
442
|
+
isLoading: {
|
|
443
|
+
true: {
|
|
444
|
+
loadingWrapper: string;
|
|
445
|
+
};
|
|
446
|
+
false: {
|
|
447
|
+
loadingWrapper: string;
|
|
448
|
+
};
|
|
449
|
+
};
|
|
409
450
|
isSelected: {
|
|
410
451
|
true: {};
|
|
411
452
|
};
|
|
@@ -453,7 +494,7 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
453
494
|
expandedTr: string;
|
|
454
495
|
sortIcon: string[];
|
|
455
496
|
emptyWrapper: string;
|
|
456
|
-
loadingWrapper: string;
|
|
497
|
+
loadingWrapper: string[];
|
|
457
498
|
}, undefined, tailwind_variants_dist_config.TVConfig<{
|
|
458
499
|
variant: {
|
|
459
500
|
solid: {
|
|
@@ -498,6 +539,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
498
539
|
expandedTr: string;
|
|
499
540
|
};
|
|
500
541
|
};
|
|
542
|
+
isLoading: {
|
|
543
|
+
true: {
|
|
544
|
+
loadingWrapper: string;
|
|
545
|
+
};
|
|
546
|
+
false: {
|
|
547
|
+
loadingWrapper: string;
|
|
548
|
+
};
|
|
549
|
+
};
|
|
501
550
|
isSelected: {
|
|
502
551
|
true: {};
|
|
503
552
|
};
|
|
@@ -577,6 +626,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
577
626
|
expandedTr: string;
|
|
578
627
|
};
|
|
579
628
|
};
|
|
629
|
+
isLoading: {
|
|
630
|
+
true: {
|
|
631
|
+
loadingWrapper: string;
|
|
632
|
+
};
|
|
633
|
+
false: {
|
|
634
|
+
loadingWrapper: string;
|
|
635
|
+
};
|
|
636
|
+
};
|
|
580
637
|
isSelected: {
|
|
581
638
|
true: {};
|
|
582
639
|
};
|
|
@@ -9,6 +9,7 @@ interface Props extends Omit<React__default.ComponentPropsWithRef<"table">, "ref
|
|
|
9
9
|
columns: TableColumn[];
|
|
10
10
|
isLoading?: boolean;
|
|
11
11
|
emptyContent?: ReactElement;
|
|
12
|
+
loadingContent?: ReactElement;
|
|
12
13
|
classNames?: SlotsToClasses<TableSlots>;
|
|
13
14
|
onRowAction?: (e: React__default.MouseEvent, params: TableRow) => void;
|
|
14
15
|
}
|
|
@@ -64,6 +65,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
64
65
|
expandedTr: string;
|
|
65
66
|
};
|
|
66
67
|
};
|
|
68
|
+
isLoading: {
|
|
69
|
+
true: {
|
|
70
|
+
loadingWrapper: string;
|
|
71
|
+
};
|
|
72
|
+
false: {
|
|
73
|
+
loadingWrapper: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
67
76
|
isSelected: {
|
|
68
77
|
true: {};
|
|
69
78
|
};
|
|
@@ -111,7 +120,7 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
111
120
|
expandedTr: string;
|
|
112
121
|
sortIcon: string[];
|
|
113
122
|
emptyWrapper: string;
|
|
114
|
-
loadingWrapper: string;
|
|
123
|
+
loadingWrapper: string[];
|
|
115
124
|
}, undefined, tailwind_variants_dist_config.TVConfig<{
|
|
116
125
|
variant: {
|
|
117
126
|
solid: {
|
|
@@ -156,6 +165,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
156
165
|
expandedTr: string;
|
|
157
166
|
};
|
|
158
167
|
};
|
|
168
|
+
isLoading: {
|
|
169
|
+
true: {
|
|
170
|
+
loadingWrapper: string;
|
|
171
|
+
};
|
|
172
|
+
false: {
|
|
173
|
+
loadingWrapper: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
159
176
|
isSelected: {
|
|
160
177
|
true: {};
|
|
161
178
|
};
|
|
@@ -235,6 +252,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
235
252
|
expandedTr: string;
|
|
236
253
|
};
|
|
237
254
|
};
|
|
255
|
+
isLoading: {
|
|
256
|
+
true: {
|
|
257
|
+
loadingWrapper: string;
|
|
258
|
+
};
|
|
259
|
+
false: {
|
|
260
|
+
loadingWrapper: string;
|
|
261
|
+
};
|
|
262
|
+
};
|
|
238
263
|
isSelected: {
|
|
239
264
|
true: {};
|
|
240
265
|
};
|
|
@@ -314,6 +339,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
314
339
|
expandedTr: string;
|
|
315
340
|
};
|
|
316
341
|
};
|
|
342
|
+
isLoading: {
|
|
343
|
+
true: {
|
|
344
|
+
loadingWrapper: string;
|
|
345
|
+
};
|
|
346
|
+
false: {
|
|
347
|
+
loadingWrapper: string;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
317
350
|
isSelected: {
|
|
318
351
|
true: {};
|
|
319
352
|
};
|
|
@@ -361,7 +394,7 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
361
394
|
expandedTr: string;
|
|
362
395
|
sortIcon: string[];
|
|
363
396
|
emptyWrapper: string;
|
|
364
|
-
loadingWrapper: string;
|
|
397
|
+
loadingWrapper: string[];
|
|
365
398
|
}, tailwind_variants.TVReturnType<{
|
|
366
399
|
variant: {
|
|
367
400
|
solid: {
|
|
@@ -406,6 +439,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
406
439
|
expandedTr: string;
|
|
407
440
|
};
|
|
408
441
|
};
|
|
442
|
+
isLoading: {
|
|
443
|
+
true: {
|
|
444
|
+
loadingWrapper: string;
|
|
445
|
+
};
|
|
446
|
+
false: {
|
|
447
|
+
loadingWrapper: string;
|
|
448
|
+
};
|
|
449
|
+
};
|
|
409
450
|
isSelected: {
|
|
410
451
|
true: {};
|
|
411
452
|
};
|
|
@@ -453,7 +494,7 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
453
494
|
expandedTr: string;
|
|
454
495
|
sortIcon: string[];
|
|
455
496
|
emptyWrapper: string;
|
|
456
|
-
loadingWrapper: string;
|
|
497
|
+
loadingWrapper: string[];
|
|
457
498
|
}, undefined, tailwind_variants_dist_config.TVConfig<{
|
|
458
499
|
variant: {
|
|
459
500
|
solid: {
|
|
@@ -498,6 +539,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
498
539
|
expandedTr: string;
|
|
499
540
|
};
|
|
500
541
|
};
|
|
542
|
+
isLoading: {
|
|
543
|
+
true: {
|
|
544
|
+
loadingWrapper: string;
|
|
545
|
+
};
|
|
546
|
+
false: {
|
|
547
|
+
loadingWrapper: string;
|
|
548
|
+
};
|
|
549
|
+
};
|
|
501
550
|
isSelected: {
|
|
502
551
|
true: {};
|
|
503
552
|
};
|
|
@@ -577,6 +626,14 @@ declare const table: tailwind_variants.TVReturnType<{
|
|
|
577
626
|
expandedTr: string;
|
|
578
627
|
};
|
|
579
628
|
};
|
|
629
|
+
isLoading: {
|
|
630
|
+
true: {
|
|
631
|
+
loadingWrapper: string;
|
|
632
|
+
};
|
|
633
|
+
false: {
|
|
634
|
+
loadingWrapper: string;
|
|
635
|
+
};
|
|
636
|
+
};
|
|
580
637
|
isSelected: {
|
|
581
638
|
true: {};
|
|
582
639
|
};
|
|
@@ -4050,7 +4050,7 @@ var import_tailwind_variants3 = require("tailwind-variants");
|
|
|
4050
4050
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
4051
4051
|
var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
|
|
4052
4052
|
const [props, variantProps] = mapPropsVariants(originalProps, table.variantKeys);
|
|
4053
|
-
const { classNames, rows, columns,
|
|
4053
|
+
const { classNames, rows, columns, className, emptyContent, loadingContent, onRowAction, ...tableComponentsProps } = props;
|
|
4054
4054
|
const [checkedRows, setCheckedRows] = (0, import_react6.useState)(/* @__PURE__ */ new Set());
|
|
4055
4055
|
const [selectedRows, setSelectedRows] = (0, import_react6.useState)(/* @__PURE__ */ new Set());
|
|
4056
4056
|
(0, import_react6.useEffect)(() => {
|
|
@@ -4070,10 +4070,17 @@ var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
|
|
|
4070
4070
|
const getTableProps = (0, import_react6.useCallback)(
|
|
4071
4071
|
(props2) => ({
|
|
4072
4072
|
...props2,
|
|
4073
|
-
className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table
|
|
4073
|
+
className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table) })
|
|
4074
4074
|
}),
|
|
4075
4075
|
[classNames == null ? void 0 : classNames.table, slots]
|
|
4076
4076
|
);
|
|
4077
|
+
const getLoadingWrapperProps = (0, import_react6.useCallback)(
|
|
4078
|
+
(props2) => ({
|
|
4079
|
+
...props2,
|
|
4080
|
+
className: slots.loadingWrapper({ class: clsx(classNames == null ? void 0 : classNames.loadingWrapper) })
|
|
4081
|
+
}),
|
|
4082
|
+
[classNames == null ? void 0 : classNames.loadingWrapper, slots]
|
|
4083
|
+
);
|
|
4077
4084
|
const handleCheckAll = (isChecked) => {
|
|
4078
4085
|
const newCheckedRows = isChecked ? new Set(rows.map((_, index) => index)) : /* @__PURE__ */ new Set();
|
|
4079
4086
|
setCheckedRows(newCheckedRows);
|
|
@@ -4111,53 +4118,55 @@ var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
|
|
|
4111
4118
|
setCheckedRows,
|
|
4112
4119
|
setSelectedRows
|
|
4113
4120
|
}));
|
|
4114
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.
|
|
4115
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref, "data-table": "base", ...getBaseProps(), children: [
|
|
4122
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("table", { ...getTableProps(tableComponentsProps), children: [
|
|
4123
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4124
|
+
table_head_default,
|
|
4125
|
+
{
|
|
4126
|
+
classNames,
|
|
4127
|
+
slots,
|
|
4128
|
+
columns,
|
|
4129
|
+
size: originalProps.size,
|
|
4130
|
+
color: originalProps.color === "neutral" ? "primary" : originalProps.color,
|
|
4131
|
+
isChecked: originalProps.isChecked,
|
|
4132
|
+
isExpanded: originalProps.isExpanded,
|
|
4133
|
+
onCheckAll: handleCheckAll,
|
|
4134
|
+
isCheckedAll: checkedRows.size === rows.length
|
|
4135
|
+
}
|
|
4136
|
+
),
|
|
4137
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4138
|
+
table_body_default,
|
|
4139
|
+
{
|
|
4140
|
+
rows,
|
|
4141
|
+
columns,
|
|
4142
|
+
slots,
|
|
4143
|
+
size: originalProps.size,
|
|
4144
|
+
color: originalProps.color === "neutral" ? "primary" : originalProps.color,
|
|
4145
|
+
isSelected: originalProps.isSelected,
|
|
4146
|
+
isChecked: originalProps.isChecked,
|
|
4147
|
+
isCheckedRow: originalProps.isCheckedRow,
|
|
4148
|
+
isExpanded: originalProps.isExpanded,
|
|
4149
|
+
classNames,
|
|
4150
|
+
emptyContent,
|
|
4151
|
+
selectedRows,
|
|
4152
|
+
checkedRows,
|
|
4153
|
+
onCheckedRow: handleCheckRow,
|
|
4154
|
+
onSelectedRow: handleSelectRow,
|
|
4155
|
+
onRowAction
|
|
4156
|
+
}
|
|
4157
|
+
)
|
|
4158
|
+
] }),
|
|
4159
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
|
|
4160
|
+
] });
|
|
4152
4161
|
});
|
|
4153
4162
|
Table.displayName = "Table";
|
|
4154
4163
|
var table_default = Table;
|
|
4155
4164
|
var table = (0, import_tailwind_variants3.tv)({
|
|
4156
4165
|
slots: {
|
|
4157
|
-
base: "flex flex-col relative gap-4",
|
|
4166
|
+
base: "flex flex-col relative gap-4 select-none",
|
|
4158
4167
|
table: "w-full h-auto",
|
|
4159
4168
|
thead: "[&>tr]:first:rounded-lg",
|
|
4160
|
-
tbody: "
|
|
4169
|
+
tbody: "",
|
|
4161
4170
|
tr: ["group", "outline-none", "w-full"],
|
|
4162
4171
|
th: [
|
|
4163
4172
|
"text-foreground",
|
|
@@ -4196,7 +4205,18 @@ var table = (0, import_tailwind_variants3.tv)({
|
|
|
4196
4205
|
"data-[direction=ascending]:rotate-180"
|
|
4197
4206
|
],
|
|
4198
4207
|
emptyWrapper: "text-neutral-light align-middle text-center h-40",
|
|
4199
|
-
loadingWrapper:
|
|
4208
|
+
loadingWrapper: [
|
|
4209
|
+
"absolute",
|
|
4210
|
+
"inset-0",
|
|
4211
|
+
"flex",
|
|
4212
|
+
"items-center",
|
|
4213
|
+
"justify-center",
|
|
4214
|
+
"bg-black/40",
|
|
4215
|
+
"text-white",
|
|
4216
|
+
"transition-opacity",
|
|
4217
|
+
"duration-300",
|
|
4218
|
+
"ease-in-out"
|
|
4219
|
+
]
|
|
4200
4220
|
},
|
|
4201
4221
|
variants: {
|
|
4202
4222
|
variant: {
|
|
@@ -4242,6 +4262,14 @@ var table = (0, import_tailwind_variants3.tv)({
|
|
|
4242
4262
|
expandedTr: "border-trans-light"
|
|
4243
4263
|
}
|
|
4244
4264
|
},
|
|
4265
|
+
isLoading: {
|
|
4266
|
+
true: {
|
|
4267
|
+
loadingWrapper: "visible opacity-100"
|
|
4268
|
+
},
|
|
4269
|
+
false: {
|
|
4270
|
+
loadingWrapper: "invisible opacity-0"
|
|
4271
|
+
}
|
|
4272
|
+
},
|
|
4245
4273
|
isSelected: {
|
|
4246
4274
|
true: {}
|
|
4247
4275
|
},
|
|
@@ -16887,7 +16887,7 @@ var import_tailwind_variants3 = require("tailwind-variants");
|
|
|
16887
16887
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
16888
16888
|
var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
|
|
16889
16889
|
const [props, variantProps] = mapPropsVariants(originalProps, table.variantKeys);
|
|
16890
|
-
const { classNames, rows: rows2, columns: columns2,
|
|
16890
|
+
const { classNames, rows: rows2, columns: columns2, className, emptyContent, loadingContent, onRowAction, ...tableComponentsProps } = props;
|
|
16891
16891
|
const [checkedRows, setCheckedRows] = (0, import_react6.useState)(/* @__PURE__ */ new Set());
|
|
16892
16892
|
const [selectedRows, setSelectedRows] = (0, import_react6.useState)(/* @__PURE__ */ new Set());
|
|
16893
16893
|
(0, import_react6.useEffect)(() => {
|
|
@@ -16907,10 +16907,17 @@ var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
|
|
|
16907
16907
|
const getTableProps = (0, import_react6.useCallback)(
|
|
16908
16908
|
(props2) => ({
|
|
16909
16909
|
...props2,
|
|
16910
|
-
className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table
|
|
16910
|
+
className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table) })
|
|
16911
16911
|
}),
|
|
16912
16912
|
[classNames == null ? void 0 : classNames.table, slots]
|
|
16913
16913
|
);
|
|
16914
|
+
const getLoadingWrapperProps = (0, import_react6.useCallback)(
|
|
16915
|
+
(props2) => ({
|
|
16916
|
+
...props2,
|
|
16917
|
+
className: slots.loadingWrapper({ class: clsx(classNames == null ? void 0 : classNames.loadingWrapper) })
|
|
16918
|
+
}),
|
|
16919
|
+
[classNames == null ? void 0 : classNames.loadingWrapper, slots]
|
|
16920
|
+
);
|
|
16914
16921
|
const handleCheckAll = (isChecked) => {
|
|
16915
16922
|
const newCheckedRows = isChecked ? new Set(rows2.map((_, index) => index)) : /* @__PURE__ */ new Set();
|
|
16916
16923
|
setCheckedRows(newCheckedRows);
|
|
@@ -16948,53 +16955,55 @@ var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
|
|
|
16948
16955
|
setCheckedRows,
|
|
16949
16956
|
setSelectedRows
|
|
16950
16957
|
}));
|
|
16951
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.
|
|
16952
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
16953
|
-
|
|
16954
|
-
|
|
16955
|
-
|
|
16956
|
-
|
|
16957
|
-
|
|
16958
|
-
|
|
16959
|
-
|
|
16960
|
-
|
|
16961
|
-
|
|
16962
|
-
|
|
16963
|
-
|
|
16964
|
-
|
|
16965
|
-
|
|
16966
|
-
|
|
16967
|
-
|
|
16968
|
-
|
|
16969
|
-
|
|
16970
|
-
|
|
16971
|
-
|
|
16972
|
-
|
|
16973
|
-
|
|
16974
|
-
|
|
16975
|
-
|
|
16976
|
-
|
|
16977
|
-
|
|
16978
|
-
|
|
16979
|
-
|
|
16980
|
-
|
|
16981
|
-
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
|
|
16958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref, "data-table": "base", ...getBaseProps(), children: [
|
|
16959
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("table", { ...getTableProps(tableComponentsProps), children: [
|
|
16960
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
16961
|
+
table_head_default,
|
|
16962
|
+
{
|
|
16963
|
+
classNames,
|
|
16964
|
+
slots,
|
|
16965
|
+
columns: columns2,
|
|
16966
|
+
size: originalProps.size,
|
|
16967
|
+
color: originalProps.color === "neutral" ? "primary" : originalProps.color,
|
|
16968
|
+
isChecked: originalProps.isChecked,
|
|
16969
|
+
isExpanded: originalProps.isExpanded,
|
|
16970
|
+
onCheckAll: handleCheckAll,
|
|
16971
|
+
isCheckedAll: checkedRows.size === rows2.length
|
|
16972
|
+
}
|
|
16973
|
+
),
|
|
16974
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
16975
|
+
table_body_default,
|
|
16976
|
+
{
|
|
16977
|
+
rows: rows2,
|
|
16978
|
+
columns: columns2,
|
|
16979
|
+
slots,
|
|
16980
|
+
size: originalProps.size,
|
|
16981
|
+
color: originalProps.color === "neutral" ? "primary" : originalProps.color,
|
|
16982
|
+
isSelected: originalProps.isSelected,
|
|
16983
|
+
isChecked: originalProps.isChecked,
|
|
16984
|
+
isCheckedRow: originalProps.isCheckedRow,
|
|
16985
|
+
isExpanded: originalProps.isExpanded,
|
|
16986
|
+
classNames,
|
|
16987
|
+
emptyContent,
|
|
16988
|
+
selectedRows,
|
|
16989
|
+
checkedRows,
|
|
16990
|
+
onCheckedRow: handleCheckRow,
|
|
16991
|
+
onSelectedRow: handleSelectRow,
|
|
16992
|
+
onRowAction
|
|
16993
|
+
}
|
|
16994
|
+
)
|
|
16995
|
+
] }),
|
|
16996
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
|
|
16997
|
+
] });
|
|
16989
16998
|
});
|
|
16990
16999
|
Table.displayName = "Table";
|
|
16991
17000
|
var table_default = Table;
|
|
16992
17001
|
var table = (0, import_tailwind_variants3.tv)({
|
|
16993
17002
|
slots: {
|
|
16994
|
-
base: "flex flex-col relative gap-4",
|
|
17003
|
+
base: "flex flex-col relative gap-4 select-none",
|
|
16995
17004
|
table: "w-full h-auto",
|
|
16996
17005
|
thead: "[&>tr]:first:rounded-lg",
|
|
16997
|
-
tbody: "
|
|
17006
|
+
tbody: "",
|
|
16998
17007
|
tr: ["group", "outline-none", "w-full"],
|
|
16999
17008
|
th: [
|
|
17000
17009
|
"text-foreground",
|
|
@@ -17033,7 +17042,18 @@ var table = (0, import_tailwind_variants3.tv)({
|
|
|
17033
17042
|
"data-[direction=ascending]:rotate-180"
|
|
17034
17043
|
],
|
|
17035
17044
|
emptyWrapper: "text-neutral-light align-middle text-center h-40",
|
|
17036
|
-
loadingWrapper:
|
|
17045
|
+
loadingWrapper: [
|
|
17046
|
+
"absolute",
|
|
17047
|
+
"inset-0",
|
|
17048
|
+
"flex",
|
|
17049
|
+
"items-center",
|
|
17050
|
+
"justify-center",
|
|
17051
|
+
"bg-black/40",
|
|
17052
|
+
"text-white",
|
|
17053
|
+
"transition-opacity",
|
|
17054
|
+
"duration-300",
|
|
17055
|
+
"ease-in-out"
|
|
17056
|
+
]
|
|
17037
17057
|
},
|
|
17038
17058
|
variants: {
|
|
17039
17059
|
variant: {
|
|
@@ -17079,6 +17099,14 @@ var table = (0, import_tailwind_variants3.tv)({
|
|
|
17079
17099
|
expandedTr: "border-trans-light"
|
|
17080
17100
|
}
|
|
17081
17101
|
},
|
|
17102
|
+
isLoading: {
|
|
17103
|
+
true: {
|
|
17104
|
+
loadingWrapper: "visible opacity-100"
|
|
17105
|
+
},
|
|
17106
|
+
false: {
|
|
17107
|
+
loadingWrapper: "invisible opacity-0"
|
|
17108
|
+
}
|
|
17109
|
+
},
|
|
17082
17110
|
isSelected: {
|
|
17083
17111
|
true: {}
|
|
17084
17112
|
},
|
package/dist/index.js
CHANGED
|
@@ -5466,7 +5466,7 @@ var import_tailwind_variants8 = require("tailwind-variants");
|
|
|
5466
5466
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
5467
5467
|
var Table = (0, import_react11.forwardRef)((originalProps, ref) => {
|
|
5468
5468
|
const [props, variantProps] = mapPropsVariants(originalProps, table.variantKeys);
|
|
5469
|
-
const { classNames, rows, columns,
|
|
5469
|
+
const { classNames, rows, columns, className, emptyContent, loadingContent, onRowAction, ...tableComponentsProps } = props;
|
|
5470
5470
|
const [checkedRows, setCheckedRows] = (0, import_react11.useState)(/* @__PURE__ */ new Set());
|
|
5471
5471
|
const [selectedRows, setSelectedRows] = (0, import_react11.useState)(/* @__PURE__ */ new Set());
|
|
5472
5472
|
(0, import_react11.useEffect)(() => {
|
|
@@ -5486,10 +5486,17 @@ var Table = (0, import_react11.forwardRef)((originalProps, ref) => {
|
|
|
5486
5486
|
const getTableProps = (0, import_react11.useCallback)(
|
|
5487
5487
|
(props2) => ({
|
|
5488
5488
|
...props2,
|
|
5489
|
-
className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table
|
|
5489
|
+
className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table) })
|
|
5490
5490
|
}),
|
|
5491
5491
|
[classNames == null ? void 0 : classNames.table, slots]
|
|
5492
5492
|
);
|
|
5493
|
+
const getLoadingWrapperProps = (0, import_react11.useCallback)(
|
|
5494
|
+
(props2) => ({
|
|
5495
|
+
...props2,
|
|
5496
|
+
className: slots.loadingWrapper({ class: clsx(classNames == null ? void 0 : classNames.loadingWrapper) })
|
|
5497
|
+
}),
|
|
5498
|
+
[classNames == null ? void 0 : classNames.loadingWrapper, slots]
|
|
5499
|
+
);
|
|
5493
5500
|
const handleCheckAll = (isChecked) => {
|
|
5494
5501
|
const newCheckedRows = isChecked ? new Set(rows.map((_, index) => index)) : /* @__PURE__ */ new Set();
|
|
5495
5502
|
setCheckedRows(newCheckedRows);
|
|
@@ -5527,53 +5534,55 @@ var Table = (0, import_react11.forwardRef)((originalProps, ref) => {
|
|
|
5527
5534
|
setCheckedRows,
|
|
5528
5535
|
setSelectedRows
|
|
5529
5536
|
}));
|
|
5530
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.
|
|
5531
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { ref, "data-table": "base", ...getBaseProps(), children: [
|
|
5538
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("table", { ...getTableProps(tableComponentsProps), children: [
|
|
5539
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
5540
|
+
table_head_default,
|
|
5541
|
+
{
|
|
5542
|
+
classNames,
|
|
5543
|
+
slots,
|
|
5544
|
+
columns,
|
|
5545
|
+
size: originalProps.size,
|
|
5546
|
+
color: originalProps.color === "neutral" ? "primary" : originalProps.color,
|
|
5547
|
+
isChecked: originalProps.isChecked,
|
|
5548
|
+
isExpanded: originalProps.isExpanded,
|
|
5549
|
+
onCheckAll: handleCheckAll,
|
|
5550
|
+
isCheckedAll: checkedRows.size === rows.length
|
|
5551
|
+
}
|
|
5552
|
+
),
|
|
5553
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
5554
|
+
table_body_default,
|
|
5555
|
+
{
|
|
5556
|
+
rows,
|
|
5557
|
+
columns,
|
|
5558
|
+
slots,
|
|
5559
|
+
size: originalProps.size,
|
|
5560
|
+
color: originalProps.color === "neutral" ? "primary" : originalProps.color,
|
|
5561
|
+
isSelected: originalProps.isSelected,
|
|
5562
|
+
isChecked: originalProps.isChecked,
|
|
5563
|
+
isCheckedRow: originalProps.isCheckedRow,
|
|
5564
|
+
isExpanded: originalProps.isExpanded,
|
|
5565
|
+
classNames,
|
|
5566
|
+
emptyContent,
|
|
5567
|
+
selectedRows,
|
|
5568
|
+
checkedRows,
|
|
5569
|
+
onCheckedRow: handleCheckRow,
|
|
5570
|
+
onSelectedRow: handleSelectRow,
|
|
5571
|
+
onRowAction
|
|
5572
|
+
}
|
|
5573
|
+
)
|
|
5574
|
+
] }),
|
|
5575
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
|
|
5576
|
+
] });
|
|
5568
5577
|
});
|
|
5569
5578
|
Table.displayName = "Table";
|
|
5570
5579
|
var table_default = Table;
|
|
5571
5580
|
var table = (0, import_tailwind_variants8.tv)({
|
|
5572
5581
|
slots: {
|
|
5573
|
-
base: "flex flex-col relative gap-4",
|
|
5582
|
+
base: "flex flex-col relative gap-4 select-none",
|
|
5574
5583
|
table: "w-full h-auto",
|
|
5575
5584
|
thead: "[&>tr]:first:rounded-lg",
|
|
5576
|
-
tbody: "
|
|
5585
|
+
tbody: "",
|
|
5577
5586
|
tr: ["group", "outline-none", "w-full"],
|
|
5578
5587
|
th: [
|
|
5579
5588
|
"text-foreground",
|
|
@@ -5612,7 +5621,18 @@ var table = (0, import_tailwind_variants8.tv)({
|
|
|
5612
5621
|
"data-[direction=ascending]:rotate-180"
|
|
5613
5622
|
],
|
|
5614
5623
|
emptyWrapper: "text-neutral-light align-middle text-center h-40",
|
|
5615
|
-
loadingWrapper:
|
|
5624
|
+
loadingWrapper: [
|
|
5625
|
+
"absolute",
|
|
5626
|
+
"inset-0",
|
|
5627
|
+
"flex",
|
|
5628
|
+
"items-center",
|
|
5629
|
+
"justify-center",
|
|
5630
|
+
"bg-black/40",
|
|
5631
|
+
"text-white",
|
|
5632
|
+
"transition-opacity",
|
|
5633
|
+
"duration-300",
|
|
5634
|
+
"ease-in-out"
|
|
5635
|
+
]
|
|
5616
5636
|
},
|
|
5617
5637
|
variants: {
|
|
5618
5638
|
variant: {
|
|
@@ -5658,6 +5678,14 @@ var table = (0, import_tailwind_variants8.tv)({
|
|
|
5658
5678
|
expandedTr: "border-trans-light"
|
|
5659
5679
|
}
|
|
5660
5680
|
},
|
|
5681
|
+
isLoading: {
|
|
5682
|
+
true: {
|
|
5683
|
+
loadingWrapper: "visible opacity-100"
|
|
5684
|
+
},
|
|
5685
|
+
false: {
|
|
5686
|
+
loadingWrapper: "invisible opacity-0"
|
|
5687
|
+
}
|
|
5688
|
+
},
|
|
5661
5689
|
isSelected: {
|
|
5662
5690
|
true: {}
|
|
5663
5691
|
},
|
|
@@ -6791,7 +6819,7 @@ var Pagination = (0, import_react19.forwardRef)((originalProps, ref) => {
|
|
|
6791
6819
|
currentPage,
|
|
6792
6820
|
groupSize,
|
|
6793
6821
|
totalPage,
|
|
6794
|
-
showPageNumber,
|
|
6822
|
+
showPageNumber = true,
|
|
6795
6823
|
showPageLabel,
|
|
6796
6824
|
showFirstLastButtons,
|
|
6797
6825
|
handleChangePage
|
package/dist/index.mjs
CHANGED
|
@@ -5,10 +5,6 @@ import {
|
|
|
5
5
|
} from "./chunk-FY5YCQL5.mjs";
|
|
6
6
|
import "./chunk-DSBSLSJW.mjs";
|
|
7
7
|
import "./chunk-ODMRJXLJ.mjs";
|
|
8
|
-
import "./chunk-3MY6LO7N.mjs";
|
|
9
|
-
import {
|
|
10
|
-
tabs_default
|
|
11
|
-
} from "./chunk-KRI5IALM.mjs";
|
|
12
8
|
import "./chunk-RRAZM5D3.mjs";
|
|
13
9
|
import {
|
|
14
10
|
textarea_default
|
|
@@ -26,10 +22,14 @@ import "./chunk-LVFI2NOH.mjs";
|
|
|
26
22
|
import {
|
|
27
23
|
switch_default
|
|
28
24
|
} from "./chunk-S3O52LLG.mjs";
|
|
25
|
+
import "./chunk-3MY6LO7N.mjs";
|
|
26
|
+
import {
|
|
27
|
+
tabs_default
|
|
28
|
+
} from "./chunk-KRI5IALM.mjs";
|
|
29
29
|
import "./chunk-2UUH2MBF.mjs";
|
|
30
30
|
import {
|
|
31
31
|
table_default
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-JMXQYSKY.mjs";
|
|
33
33
|
import "./chunk-QDDEQY63.mjs";
|
|
34
34
|
import "./chunk-PO3ADNA5.mjs";
|
|
35
35
|
import "./chunk-QCEKPS7U.mjs";
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
import "./chunk-7B7LRG5J.mjs";
|
|
58
58
|
import {
|
|
59
59
|
pagination_default
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-UGBBOYHB.mjs";
|
|
61
61
|
import "./chunk-F3HENRVM.mjs";
|
|
62
62
|
import "./chunk-2GCSFWHD.mjs";
|
|
63
63
|
import {
|