@deepnoid/ui 0.0.98 → 0.0.100
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-B4KZBOGT.mjs → chunk-UZL66GNP.mjs} +9 -2
- package/dist/{chunk-PNFR2J4Q.mjs → chunk-YVBOTJAH.mjs} +71 -43
- package/dist/components/pagination/index.js +9 -2
- package/dist/components/pagination/index.mjs +1 -1
- package/dist/components/pagination/pagination.d.mts +18 -0
- package/dist/components/pagination/pagination.d.ts +18 -0
- package/dist/components/pagination/pagination.js +9 -2
- package/dist/components/pagination/pagination.mjs +1 -1
- package/dist/components/pagination/pagination.test.js +9 -2
- 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 +80 -45
- package/dist/index.mjs +21 -21
- package/package.json +1 -1
|
@@ -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-200",
|
|
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-200",
|
|
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
|
},
|