@deepnoid/ui 0.1.20 → 0.1.22
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 +162 -172
- package/dist/{chunk-LNYMVBV5.mjs → chunk-6OMHIMIA.mjs} +8 -6
- package/dist/{chunk-3DPVPTHL.mjs → chunk-EAK5DVWA.mjs} +2 -2
- package/dist/{chunk-3BKCODIL.mjs → chunk-ICZTNO4V.mjs} +3 -3
- package/dist/{chunk-EGHTZLZJ.mjs → chunk-IVK24VIL.mjs} +1 -1
- package/dist/chunk-MSAULFDB.mjs +348 -0
- package/dist/{chunk-JOCMCOEK.mjs → chunk-P5PJTJLY.mjs} +13 -2
- package/dist/{chunk-63WXGSTV.mjs → chunk-XRC5OUYQ.mjs} +23 -13
- package/dist/components/input/index.js +13 -2
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/input/input.js +13 -2
- package/dist/components/input/input.mjs +1 -1
- package/dist/components/modal/index.mjs +1 -1
- package/dist/components/modal/modal.mjs +1 -1
- package/dist/components/pagination/index.js +13 -2
- package/dist/components/pagination/index.mjs +2 -2
- package/dist/components/pagination/pagination.js +13 -2
- package/dist/components/pagination/pagination.mjs +2 -2
- package/dist/components/select/index.d.mts +1 -1
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/index.js +301 -286
- package/dist/components/select/index.mjs +2 -3
- package/dist/components/select/select.d.mts +190 -177
- package/dist/components/select/select.d.ts +190 -177
- package/dist/components/select/select.js +301 -286
- package/dist/components/select/select.mjs +2 -3
- package/dist/components/table/form-table.js +3 -3
- package/dist/components/table/form-table.mjs +1 -1
- package/dist/components/table/index.js +46 -23
- package/dist/components/table/index.mjs +6 -6
- package/dist/components/table/table-body.d.mts +3 -2
- package/dist/components/table/table-body.d.ts +3 -2
- package/dist/components/table/table-body.js +23 -13
- package/dist/components/table/table-body.mjs +1 -1
- package/dist/components/table/table-head.d.mts +2 -2
- package/dist/components/table/table-head.d.ts +2 -2
- package/dist/components/table/table-head.js +2 -2
- package/dist/components/table/table-head.mjs +1 -1
- package/dist/components/table/table.d.mts +2 -1
- package/dist/components/table/table.d.ts +2 -1
- package/dist/components/table/table.js +43 -20
- package/dist/components/table/table.mjs +5 -5
- package/dist/index.js +493 -497
- package/dist/index.mjs +28 -30
- package/package.json +1 -1
- package/dist/chunk-BXXAMH3R.mjs +0 -255
- package/dist/chunk-OF3X4BXG.mjs +0 -76
- package/dist/chunk-S3QS5B7F.mjs +0 -61
- package/dist/components/select/option.d.mts +0 -17
- package/dist/components/select/option.d.ts +0 -17
- package/dist/components/select/option.js +0 -4359
- package/dist/components/select/option.mjs +0 -12
- package/dist/components/select/useSelect.d.mts +0 -31
- package/dist/components/select/useSelect.d.ts +0 -31
- package/dist/components/select/useSelect.js +0 -84
- package/dist/components/select/useSelect.mjs +0 -8
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
select_default
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-S3QS5B7F.mjs";
|
|
6
|
-
import "../../chunk-OF3X4BXG.mjs";
|
|
4
|
+
} from "../../chunk-MSAULFDB.mjs";
|
|
7
5
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
8
6
|
import "../../chunk-HWL7TPUN.mjs";
|
|
9
7
|
import "../../chunk-3IU2RPSM.mjs";
|
|
10
8
|
import "../../chunk-4ZJFD3L3.mjs";
|
|
9
|
+
import "../../chunk-27Y6K5NK.mjs";
|
|
11
10
|
import "../../chunk-E3G5QXSH.mjs";
|
|
12
11
|
import "../../chunk-AC6TWLRT.mjs";
|
|
13
12
|
export {
|
|
@@ -327,10 +327,10 @@ var tv = (0, import_tailwind_variants.createTV)({
|
|
|
327
327
|
// src/components/table/form-table.tsx
|
|
328
328
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
329
329
|
var DEFAULT_COLUMN_CLASSES = [
|
|
330
|
-
"w-[120px]
|
|
331
|
-
"px-[10px]"
|
|
330
|
+
"w-[120px] px-[10px] py-[9.5px] font-bold text-md text-body-foreground border-r border-neutral-light",
|
|
331
|
+
"px-[10px] py-[9.5px]"
|
|
332
332
|
];
|
|
333
|
-
var FormTableRow = ({ columns, columnClasses = [] }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { className: "border-neutral-light border-b", children: columns.map((col, index) => {
|
|
333
|
+
var FormTableRow = ({ columns, columnClasses = [] }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { className: "border-neutral-light min-h-[50px] border-b", children: columns.map((col, index) => {
|
|
334
334
|
var _a;
|
|
335
335
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: (_a = columnClasses[index]) != null ? _a : DEFAULT_COLUMN_CLASSES[index], children: col }, index);
|
|
336
336
|
}) });
|
|
@@ -599,7 +599,7 @@ var checkboxStyle = tv({
|
|
|
599
599
|
|
|
600
600
|
// src/components/table/table-head.tsx
|
|
601
601
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
602
|
-
var TableHead = ({ columns, slots, size,
|
|
602
|
+
var TableHead = ({ columns, slots, size, rowCheckbox, isCheckedAll, classNames, onCheckAll }) => {
|
|
603
603
|
const handleClickCheckAll = (e) => {
|
|
604
604
|
e.preventDefault();
|
|
605
605
|
onCheckAll(!isCheckedAll);
|
|
@@ -618,7 +618,7 @@ var TableHead = ({ columns, slots, size, selectableRows, isCheckedAll, className
|
|
|
618
618
|
},
|
|
619
619
|
`${column.field}${index}thead`
|
|
620
620
|
));
|
|
621
|
-
const renderSelectAllCheckbox = () =>
|
|
621
|
+
const renderSelectAllCheckbox = () => rowCheckbox && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { className: slots.th({ class: classNames == null ? void 0 : classNames.th }), onClick: handleClickCheckAll, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(checkbox_default, { size, checked: isCheckedAll }) }) });
|
|
622
622
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
623
623
|
renderColumnHeaders(),
|
|
624
624
|
renderSelectAllCheckbox()
|
|
@@ -635,9 +635,10 @@ var TableBody = ({
|
|
|
635
635
|
columns,
|
|
636
636
|
rows,
|
|
637
637
|
size,
|
|
638
|
-
|
|
638
|
+
rowCheckbox,
|
|
639
639
|
checkedRows,
|
|
640
640
|
onCheckRow,
|
|
641
|
+
onRowClick,
|
|
641
642
|
emptyContent,
|
|
642
643
|
isLoading,
|
|
643
644
|
classNames,
|
|
@@ -678,21 +679,30 @@ var TableBody = ({
|
|
|
678
679
|
[classNames == null ? void 0 : classNames.td, generateColumnStyles, slots]
|
|
679
680
|
);
|
|
680
681
|
const hasRows = rows.length > 0;
|
|
681
|
-
const colSpan = (columns.length || 1) + (
|
|
682
|
+
const colSpan = (columns.length || 1) + (rowCheckbox ? 1 : 0);
|
|
682
683
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("tbody", { className: clsx(slots.tbody({ class: classNames == null ? void 0 : classNames.tbody }), className), children: [
|
|
683
684
|
!isLoading && hasRows && rows.map((row, rowIndex) => {
|
|
684
685
|
const isRowChecked = checkedRows.has(rowIndex);
|
|
685
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
687
|
+
"tr",
|
|
688
|
+
{
|
|
689
|
+
className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }),
|
|
690
|
+
"aria-checked": isRowChecked,
|
|
691
|
+
onClick: () => onRowClick ? onRowClick(row) : void 0,
|
|
692
|
+
children: [
|
|
693
|
+
columns.map((column) => /* @__PURE__ */ (0, import_react3.createElement)("td", { ...getCellProps(column, row), key: column.field })),
|
|
694
|
+
rowCheckbox && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
695
|
+
checkbox_default,
|
|
696
|
+
{
|
|
697
|
+
size,
|
|
698
|
+
checked: isRowChecked,
|
|
699
|
+
onChange: (e) => onCheckRow(rowIndex, e.target.checked)
|
|
700
|
+
}
|
|
701
|
+
) }) })
|
|
702
|
+
]
|
|
703
|
+
},
|
|
704
|
+
rowIndex
|
|
705
|
+
);
|
|
696
706
|
}),
|
|
697
707
|
!isLoading && !hasRows && emptyContent && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("tr", { className: clsx(slots.tr({ class: classNames == null ? void 0 : classNames.tr }), "border-none"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { colSpan, className: slots.empty({ class: classNames == null ? void 0 : classNames.empty }), children: emptyContent }) })
|
|
698
708
|
] });
|
|
@@ -4785,7 +4795,18 @@ var Input = (0, import_react5.forwardRef)((originalProps, ref) => {
|
|
|
4785
4795
|
),
|
|
4786
4796
|
children: [
|
|
4787
4797
|
startContent && renderStartContent(),
|
|
4788
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4798
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4799
|
+
"input",
|
|
4800
|
+
{
|
|
4801
|
+
...inputProps,
|
|
4802
|
+
ref: ref || inputRef,
|
|
4803
|
+
className: clsx(
|
|
4804
|
+
slots.input({ class: classNames == null ? void 0 : classNames.input }),
|
|
4805
|
+
inputProps.readOnly ? "!text-body-foreground placeholder:text-body-foreground" : ""
|
|
4806
|
+
),
|
|
4807
|
+
size: 0
|
|
4808
|
+
}
|
|
4809
|
+
),
|
|
4789
4810
|
renderEndContent()
|
|
4790
4811
|
]
|
|
4791
4812
|
}
|
|
@@ -4833,7 +4854,7 @@ var inputStyle = tv(
|
|
|
4833
4854
|
],
|
|
4834
4855
|
helperText: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
|
|
4835
4856
|
errorText: ["text-danger-main"],
|
|
4836
|
-
readonly: ["pointer-events-none"]
|
|
4857
|
+
readonly: ["pointer-events-none", "!text-body-foreground"]
|
|
4837
4858
|
},
|
|
4838
4859
|
variants: {
|
|
4839
4860
|
variant: {
|
|
@@ -5327,7 +5348,8 @@ var Table = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
5327
5348
|
rows,
|
|
5328
5349
|
columns,
|
|
5329
5350
|
size,
|
|
5330
|
-
|
|
5351
|
+
rowCheckbox,
|
|
5352
|
+
onRowClick,
|
|
5331
5353
|
totalData,
|
|
5332
5354
|
pagination,
|
|
5333
5355
|
onPageChange,
|
|
@@ -5364,7 +5386,7 @@ var Table = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
5364
5386
|
{
|
|
5365
5387
|
columns,
|
|
5366
5388
|
size,
|
|
5367
|
-
|
|
5389
|
+
rowCheckbox,
|
|
5368
5390
|
isCheckedAll: checkedRows.size === rows.length && rows.length > 0,
|
|
5369
5391
|
onCheckAll: handleCheckAll,
|
|
5370
5392
|
classNames,
|
|
@@ -5378,8 +5400,9 @@ var Table = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
5378
5400
|
rows,
|
|
5379
5401
|
columns,
|
|
5380
5402
|
size,
|
|
5381
|
-
|
|
5403
|
+
rowCheckbox,
|
|
5382
5404
|
checkedRows,
|
|
5405
|
+
onRowClick,
|
|
5383
5406
|
onCheckRow: handleCheck,
|
|
5384
5407
|
emptyContent,
|
|
5385
5408
|
isLoading,
|
|
@@ -5625,10 +5648,10 @@ var tableStyle = (0, import_tailwind_variants6.tv)({
|
|
|
5625
5648
|
var import_react8 = require("react");
|
|
5626
5649
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
5627
5650
|
var DEFAULT_COLUMN_CLASSES = [
|
|
5628
|
-
"w-[120px]
|
|
5629
|
-
"px-[10px]"
|
|
5651
|
+
"w-[120px] px-[10px] py-[9.5px] font-bold text-md text-body-foreground border-r border-neutral-light",
|
|
5652
|
+
"px-[10px] py-[9.5px]"
|
|
5630
5653
|
];
|
|
5631
|
-
var FormTableRow = ({ columns, columnClasses = [] }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("tr", { className: "border-neutral-light border-b", children: columns.map((col, index) => {
|
|
5654
|
+
var FormTableRow = ({ columns, columnClasses = [] }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("tr", { className: "border-neutral-light min-h-[50px] border-b", children: columns.map((col, index) => {
|
|
5632
5655
|
var _a;
|
|
5633
5656
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { className: (_a = columnClasses[index]) != null ? _a : DEFAULT_COLUMN_CLASSES[index], children: col }, index);
|
|
5634
5657
|
}) });
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
import "../../chunk-DX3KXNP6.mjs";
|
|
3
3
|
import {
|
|
4
4
|
form_table_default
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-ICZTNO4V.mjs";
|
|
6
6
|
import {
|
|
7
7
|
table_default
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
8
|
+
} from "../../chunk-6OMHIMIA.mjs";
|
|
9
|
+
import "../../chunk-XRC5OUYQ.mjs";
|
|
10
|
+
import "../../chunk-EAK5DVWA.mjs";
|
|
11
11
|
import "../../chunk-DQRAFUDA.mjs";
|
|
12
12
|
import "../../chunk-M37VBNB3.mjs";
|
|
13
13
|
import "../../chunk-7B7LRG5J.mjs";
|
|
14
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-IVK24VIL.mjs";
|
|
15
15
|
import "../../chunk-F3HENRVM.mjs";
|
|
16
16
|
import "../../chunk-2GCSFWHD.mjs";
|
|
17
|
-
import "../../chunk-
|
|
17
|
+
import "../../chunk-P5PJTJLY.mjs";
|
|
18
18
|
import "../../chunk-QZ3LVYJW.mjs";
|
|
19
19
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
20
20
|
import "../../chunk-HWL7TPUN.mjs";
|
|
@@ -9,14 +9,15 @@ interface TableBodyProps {
|
|
|
9
9
|
rows: TableRow[];
|
|
10
10
|
columns: TableColumn[];
|
|
11
11
|
size?: "sm" | "md" | "lg" | "xl";
|
|
12
|
-
|
|
12
|
+
rowCheckbox?: boolean;
|
|
13
13
|
checkedRows: Set<number>;
|
|
14
14
|
onCheckRow: (index: number, isChecked: boolean) => void;
|
|
15
|
+
onRowClick?: (row: TableRow) => void;
|
|
15
16
|
emptyContent?: ReactNode;
|
|
16
17
|
isLoading?: boolean;
|
|
17
18
|
classNames?: SlotsToClasses<TableSlots>;
|
|
18
19
|
className?: string;
|
|
19
20
|
}
|
|
20
|
-
declare const TableBody: ({ slots, columns, rows, size,
|
|
21
|
+
declare const TableBody: ({ slots, columns, rows, size, rowCheckbox, checkedRows, onCheckRow, onRowClick, emptyContent, isLoading, classNames, className, }: TableBodyProps) => react_jsx_runtime.JSX.Element;
|
|
21
22
|
|
|
22
23
|
export { TableBody as default };
|
|
@@ -9,14 +9,15 @@ interface TableBodyProps {
|
|
|
9
9
|
rows: TableRow[];
|
|
10
10
|
columns: TableColumn[];
|
|
11
11
|
size?: "sm" | "md" | "lg" | "xl";
|
|
12
|
-
|
|
12
|
+
rowCheckbox?: boolean;
|
|
13
13
|
checkedRows: Set<number>;
|
|
14
14
|
onCheckRow: (index: number, isChecked: boolean) => void;
|
|
15
|
+
onRowClick?: (row: TableRow) => void;
|
|
15
16
|
emptyContent?: ReactNode;
|
|
16
17
|
isLoading?: boolean;
|
|
17
18
|
classNames?: SlotsToClasses<TableSlots>;
|
|
18
19
|
className?: string;
|
|
19
20
|
}
|
|
20
|
-
declare const TableBody: ({ slots, columns, rows, size,
|
|
21
|
+
declare const TableBody: ({ slots, columns, rows, size, rowCheckbox, checkedRows, onCheckRow, onRowClick, emptyContent, isLoading, classNames, className, }: TableBodyProps) => react_jsx_runtime.JSX.Element;
|
|
21
22
|
|
|
22
23
|
export { TableBody as default };
|
|
@@ -601,9 +601,10 @@ var TableBody = ({
|
|
|
601
601
|
columns,
|
|
602
602
|
rows,
|
|
603
603
|
size,
|
|
604
|
-
|
|
604
|
+
rowCheckbox,
|
|
605
605
|
checkedRows,
|
|
606
606
|
onCheckRow,
|
|
607
|
+
onRowClick,
|
|
607
608
|
emptyContent,
|
|
608
609
|
isLoading,
|
|
609
610
|
classNames,
|
|
@@ -644,21 +645,30 @@ var TableBody = ({
|
|
|
644
645
|
[classNames == null ? void 0 : classNames.td, generateColumnStyles, slots]
|
|
645
646
|
);
|
|
646
647
|
const hasRows = rows.length > 0;
|
|
647
|
-
const colSpan = (columns.length || 1) + (
|
|
648
|
+
const colSpan = (columns.length || 1) + (rowCheckbox ? 1 : 0);
|
|
648
649
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("tbody", { className: clsx(slots.tbody({ class: classNames == null ? void 0 : classNames.tbody }), className), children: [
|
|
649
650
|
!isLoading && hasRows && rows.map((row, rowIndex) => {
|
|
650
651
|
const isRowChecked = checkedRows.has(rowIndex);
|
|
651
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
653
|
+
"tr",
|
|
654
|
+
{
|
|
655
|
+
className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }),
|
|
656
|
+
"aria-checked": isRowChecked,
|
|
657
|
+
onClick: () => onRowClick ? onRowClick(row) : void 0,
|
|
658
|
+
children: [
|
|
659
|
+
columns.map((column) => /* @__PURE__ */ (0, import_react3.createElement)("td", { ...getCellProps(column, row), key: column.field })),
|
|
660
|
+
rowCheckbox && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
661
|
+
checkbox_default,
|
|
662
|
+
{
|
|
663
|
+
size,
|
|
664
|
+
checked: isRowChecked,
|
|
665
|
+
onChange: (e) => onCheckRow(rowIndex, e.target.checked)
|
|
666
|
+
}
|
|
667
|
+
) }) })
|
|
668
|
+
]
|
|
669
|
+
},
|
|
670
|
+
rowIndex
|
|
671
|
+
);
|
|
662
672
|
}),
|
|
663
673
|
!isLoading && !hasRows && emptyContent && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { className: clsx(slots.tr({ class: classNames == null ? void 0 : classNames.tr }), "border-none"), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { colSpan, className: slots.empty({ class: classNames == null ? void 0 : classNames.empty }), children: emptyContent }) })
|
|
664
674
|
] });
|
|
@@ -8,11 +8,11 @@ type TableHeadProps = {
|
|
|
8
8
|
slots: TableReturnType;
|
|
9
9
|
columns: TableColumn[];
|
|
10
10
|
size?: Size;
|
|
11
|
-
|
|
11
|
+
rowCheckbox?: boolean;
|
|
12
12
|
isCheckedAll: boolean;
|
|
13
13
|
classNames?: SlotsToClasses<TableSlots>;
|
|
14
14
|
onCheckAll: (isChecked: boolean) => void;
|
|
15
15
|
};
|
|
16
|
-
declare const TableHead: ({ columns, slots, size,
|
|
16
|
+
declare const TableHead: ({ columns, slots, size, rowCheckbox, isCheckedAll, classNames, onCheckAll }: TableHeadProps) => react_jsx_runtime.JSX.Element;
|
|
17
17
|
|
|
18
18
|
export { TableHead as default };
|
|
@@ -8,11 +8,11 @@ type TableHeadProps = {
|
|
|
8
8
|
slots: TableReturnType;
|
|
9
9
|
columns: TableColumn[];
|
|
10
10
|
size?: Size;
|
|
11
|
-
|
|
11
|
+
rowCheckbox?: boolean;
|
|
12
12
|
isCheckedAll: boolean;
|
|
13
13
|
classNames?: SlotsToClasses<TableSlots>;
|
|
14
14
|
onCheckAll: (isChecked: boolean) => void;
|
|
15
15
|
};
|
|
16
|
-
declare const TableHead: ({ columns, slots, size,
|
|
16
|
+
declare const TableHead: ({ columns, slots, size, rowCheckbox, isCheckedAll, classNames, onCheckAll }: TableHeadProps) => react_jsx_runtime.JSX.Element;
|
|
17
17
|
|
|
18
18
|
export { TableHead as default };
|
|
@@ -594,7 +594,7 @@ var checkboxStyle = tv({
|
|
|
594
594
|
|
|
595
595
|
// src/components/table/table-head.tsx
|
|
596
596
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
597
|
-
var TableHead = ({ columns, slots, size,
|
|
597
|
+
var TableHead = ({ columns, slots, size, rowCheckbox, isCheckedAll, classNames, onCheckAll }) => {
|
|
598
598
|
const handleClickCheckAll = (e) => {
|
|
599
599
|
e.preventDefault();
|
|
600
600
|
onCheckAll(!isCheckedAll);
|
|
@@ -613,7 +613,7 @@ var TableHead = ({ columns, slots, size, selectableRows, isCheckedAll, className
|
|
|
613
613
|
},
|
|
614
614
|
`${column.field}${index}thead`
|
|
615
615
|
));
|
|
616
|
-
const renderSelectAllCheckbox = () =>
|
|
616
|
+
const renderSelectAllCheckbox = () => rowCheckbox && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { className: slots.th({ class: classNames == null ? void 0 : classNames.th }), onClick: handleClickCheckAll, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(checkbox_default, { size, checked: isCheckedAll }) }) });
|
|
617
617
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
618
618
|
renderColumnHeaders(),
|
|
619
619
|
renderSelectAllCheckbox()
|
|
@@ -7,7 +7,8 @@ import { SlotsToClasses } from '../../utils/types.mjs';
|
|
|
7
7
|
interface TableBaseProps extends Omit<ComponentPropsWithRef<"table">, "ref" | "color" | "slot" | "size" | "height" | "defaultChecked" | "defaultValue"> {
|
|
8
8
|
rows: TableRow[];
|
|
9
9
|
columns: TableColumn[];
|
|
10
|
-
|
|
10
|
+
rowCheckbox?: boolean;
|
|
11
|
+
onRowClick?: (row: TableRow) => void;
|
|
11
12
|
totalData?: number;
|
|
12
13
|
pagination?: {
|
|
13
14
|
page: number;
|
|
@@ -7,7 +7,8 @@ import { SlotsToClasses } from '../../utils/types.js';
|
|
|
7
7
|
interface TableBaseProps extends Omit<ComponentPropsWithRef<"table">, "ref" | "color" | "slot" | "size" | "height" | "defaultChecked" | "defaultValue"> {
|
|
8
8
|
rows: TableRow[];
|
|
9
9
|
columns: TableColumn[];
|
|
10
|
-
|
|
10
|
+
rowCheckbox?: boolean;
|
|
11
|
+
onRowClick?: (row: TableRow) => void;
|
|
11
12
|
totalData?: number;
|
|
12
13
|
pagination?: {
|
|
13
14
|
page: number;
|
|
@@ -596,7 +596,7 @@ var checkboxStyle = tv({
|
|
|
596
596
|
|
|
597
597
|
// src/components/table/table-head.tsx
|
|
598
598
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
599
|
-
var TableHead = ({ columns, slots, size,
|
|
599
|
+
var TableHead = ({ columns, slots, size, rowCheckbox, isCheckedAll, classNames, onCheckAll }) => {
|
|
600
600
|
const handleClickCheckAll = (e) => {
|
|
601
601
|
e.preventDefault();
|
|
602
602
|
onCheckAll(!isCheckedAll);
|
|
@@ -615,7 +615,7 @@ var TableHead = ({ columns, slots, size, selectableRows, isCheckedAll, className
|
|
|
615
615
|
},
|
|
616
616
|
`${column.field}${index}thead`
|
|
617
617
|
));
|
|
618
|
-
const renderSelectAllCheckbox = () =>
|
|
618
|
+
const renderSelectAllCheckbox = () => rowCheckbox && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { className: slots.th({ class: classNames == null ? void 0 : classNames.th }), onClick: handleClickCheckAll, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(checkbox_default, { size, checked: isCheckedAll }) }) });
|
|
619
619
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
620
620
|
renderColumnHeaders(),
|
|
621
621
|
renderSelectAllCheckbox()
|
|
@@ -632,9 +632,10 @@ var TableBody = ({
|
|
|
632
632
|
columns,
|
|
633
633
|
rows,
|
|
634
634
|
size,
|
|
635
|
-
|
|
635
|
+
rowCheckbox,
|
|
636
636
|
checkedRows,
|
|
637
637
|
onCheckRow,
|
|
638
|
+
onRowClick,
|
|
638
639
|
emptyContent,
|
|
639
640
|
isLoading,
|
|
640
641
|
classNames,
|
|
@@ -675,21 +676,30 @@ var TableBody = ({
|
|
|
675
676
|
[classNames == null ? void 0 : classNames.td, generateColumnStyles, slots]
|
|
676
677
|
);
|
|
677
678
|
const hasRows = rows.length > 0;
|
|
678
|
-
const colSpan = (columns.length || 1) + (
|
|
679
|
+
const colSpan = (columns.length || 1) + (rowCheckbox ? 1 : 0);
|
|
679
680
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("tbody", { className: clsx(slots.tbody({ class: classNames == null ? void 0 : classNames.tbody }), className), children: [
|
|
680
681
|
!isLoading && hasRows && rows.map((row, rowIndex) => {
|
|
681
682
|
const isRowChecked = checkedRows.has(rowIndex);
|
|
682
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
684
|
+
"tr",
|
|
685
|
+
{
|
|
686
|
+
className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }),
|
|
687
|
+
"aria-checked": isRowChecked,
|
|
688
|
+
onClick: () => onRowClick ? onRowClick(row) : void 0,
|
|
689
|
+
children: [
|
|
690
|
+
columns.map((column) => /* @__PURE__ */ (0, import_react3.createElement)("td", { ...getCellProps(column, row), key: column.field })),
|
|
691
|
+
rowCheckbox && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
692
|
+
checkbox_default,
|
|
693
|
+
{
|
|
694
|
+
size,
|
|
695
|
+
checked: isRowChecked,
|
|
696
|
+
onChange: (e) => onCheckRow(rowIndex, e.target.checked)
|
|
697
|
+
}
|
|
698
|
+
) }) })
|
|
699
|
+
]
|
|
700
|
+
},
|
|
701
|
+
rowIndex
|
|
702
|
+
);
|
|
693
703
|
}),
|
|
694
704
|
!isLoading && !hasRows && emptyContent && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("tr", { className: clsx(slots.tr({ class: classNames == null ? void 0 : classNames.tr }), "border-none"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { colSpan, className: slots.empty({ class: classNames == null ? void 0 : classNames.empty }), children: emptyContent }) })
|
|
695
705
|
] });
|
|
@@ -4782,7 +4792,18 @@ var Input = (0, import_react5.forwardRef)((originalProps, ref) => {
|
|
|
4782
4792
|
),
|
|
4783
4793
|
children: [
|
|
4784
4794
|
startContent && renderStartContent(),
|
|
4785
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4795
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4796
|
+
"input",
|
|
4797
|
+
{
|
|
4798
|
+
...inputProps,
|
|
4799
|
+
ref: ref || inputRef,
|
|
4800
|
+
className: clsx(
|
|
4801
|
+
slots.input({ class: classNames == null ? void 0 : classNames.input }),
|
|
4802
|
+
inputProps.readOnly ? "!text-body-foreground placeholder:text-body-foreground" : ""
|
|
4803
|
+
),
|
|
4804
|
+
size: 0
|
|
4805
|
+
}
|
|
4806
|
+
),
|
|
4786
4807
|
renderEndContent()
|
|
4787
4808
|
]
|
|
4788
4809
|
}
|
|
@@ -4830,7 +4851,7 @@ var inputStyle = tv(
|
|
|
4830
4851
|
],
|
|
4831
4852
|
helperText: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
|
|
4832
4853
|
errorText: ["text-danger-main"],
|
|
4833
|
-
readonly: ["pointer-events-none"]
|
|
4854
|
+
readonly: ["pointer-events-none", "!text-body-foreground"]
|
|
4834
4855
|
},
|
|
4835
4856
|
variants: {
|
|
4836
4857
|
variant: {
|
|
@@ -5324,7 +5345,8 @@ var Table = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
5324
5345
|
rows,
|
|
5325
5346
|
columns,
|
|
5326
5347
|
size,
|
|
5327
|
-
|
|
5348
|
+
rowCheckbox,
|
|
5349
|
+
onRowClick,
|
|
5328
5350
|
totalData,
|
|
5329
5351
|
pagination,
|
|
5330
5352
|
onPageChange,
|
|
@@ -5361,7 +5383,7 @@ var Table = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
5361
5383
|
{
|
|
5362
5384
|
columns,
|
|
5363
5385
|
size,
|
|
5364
|
-
|
|
5386
|
+
rowCheckbox,
|
|
5365
5387
|
isCheckedAll: checkedRows.size === rows.length && rows.length > 0,
|
|
5366
5388
|
onCheckAll: handleCheckAll,
|
|
5367
5389
|
classNames,
|
|
@@ -5375,8 +5397,9 @@ var Table = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
5375
5397
|
rows,
|
|
5376
5398
|
columns,
|
|
5377
5399
|
size,
|
|
5378
|
-
|
|
5400
|
+
rowCheckbox,
|
|
5379
5401
|
checkedRows,
|
|
5402
|
+
onRowClick,
|
|
5380
5403
|
onCheckRow: handleCheck,
|
|
5381
5404
|
emptyContent,
|
|
5382
5405
|
isLoading,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
table_default
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-6OMHIMIA.mjs";
|
|
5
|
+
import "../../chunk-XRC5OUYQ.mjs";
|
|
6
|
+
import "../../chunk-EAK5DVWA.mjs";
|
|
7
7
|
import "../../chunk-DQRAFUDA.mjs";
|
|
8
8
|
import "../../chunk-M37VBNB3.mjs";
|
|
9
9
|
import "../../chunk-7B7LRG5J.mjs";
|
|
10
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-IVK24VIL.mjs";
|
|
11
11
|
import "../../chunk-F3HENRVM.mjs";
|
|
12
12
|
import "../../chunk-2GCSFWHD.mjs";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-P5PJTJLY.mjs";
|
|
14
14
|
import "../../chunk-QZ3LVYJW.mjs";
|
|
15
15
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
16
16
|
import "../../chunk-HWL7TPUN.mjs";
|