@deepnoid/ui 0.1.26 → 0.1.28
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 +170 -166
- package/dist/{chunk-MSAULFDB.mjs → chunk-272FMLIL.mjs} +17 -17
- package/dist/{chunk-3IU2RPSM.mjs → chunk-2SDYFOZL.mjs} +46 -35
- package/dist/{chunk-HWL7TPUN.mjs → chunk-2TKEWFGH.mjs} +1 -1
- package/dist/chunk-4OSN2OE2.mjs +178 -0
- package/dist/chunk-6TIIBU7J.mjs +35 -0
- package/dist/{chunk-Q72LZAPG.mjs → chunk-A7RU3FU5.mjs} +1 -1
- package/dist/{chunk-P5PJTJLY.mjs → chunk-BEQ3KZGS.mjs} +19 -19
- package/dist/{chunk-IRAHS4WS.mjs → chunk-G67WUZO3.mjs} +1 -1
- package/dist/{chunk-YBDA3WQP.mjs → chunk-IBI3OVQI.mjs} +1 -1
- package/dist/{chunk-BQUZRVYW.mjs → chunk-JTZUXVOU.mjs} +1 -1
- package/dist/{chunk-6OMHIMIA.mjs → chunk-JV7VLO2L.mjs} +2 -2
- package/dist/{chunk-B3DFSXGC.mjs → chunk-K7VUN5BS.mjs} +2 -2
- package/dist/{chunk-DLQFMOBN.mjs → chunk-KYJTZPXY.mjs} +1 -1
- package/dist/{chunk-OUAKGMDW.mjs → chunk-MEY4IL7D.mjs} +1 -1
- package/dist/{chunk-SCFTSNCK.mjs → chunk-NHVIKP4H.mjs} +6 -6
- package/dist/{chunk-PMMTMYRI.mjs → chunk-QIEKOGY7.mjs} +1 -1
- package/dist/{chunk-QY7LYAXT.mjs → chunk-RT3S3VVJ.mjs} +2 -2
- package/dist/{chunk-IVK24VIL.mjs → chunk-SO7BGWM7.mjs} +2 -2
- package/dist/{chunk-XQGD4ZIX.mjs → chunk-SP3JVQY3.mjs} +1 -1
- package/dist/{chunk-EAK5DVWA.mjs → chunk-UNH3BCGN.mjs} +8 -1
- package/dist/{chunk-6HX3PPL6.mjs → chunk-WLNLVX7Q.mjs} +1 -1
- package/dist/components/avatar/avatar.js +46 -35
- package/dist/components/avatar/avatar.mjs +2 -2
- package/dist/components/avatar/index.js +46 -35
- package/dist/components/avatar/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +46 -35
- package/dist/components/breadcrumb/breadcrumb.mjs +5 -5
- package/dist/components/breadcrumb/index.js +46 -35
- package/dist/components/breadcrumb/index.mjs +5 -5
- package/dist/components/button/button.js +46 -35
- package/dist/components/button/button.mjs +3 -3
- package/dist/components/button/icon-button.js +46 -35
- package/dist/components/button/icon-button.mjs +3 -3
- package/dist/components/button/index.js +46 -35
- package/dist/components/button/index.mjs +4 -4
- package/dist/components/chip/chip.js +46 -35
- package/dist/components/chip/chip.mjs +3 -3
- package/dist/components/chip/index.js +46 -35
- package/dist/components/chip/index.mjs +3 -3
- package/dist/components/dateTimePicker/calendar.js +46 -35
- package/dist/components/dateTimePicker/calendar.mjs +3 -3
- package/dist/components/dateTimePicker/dateTimePicker.js +46 -35
- package/dist/components/dateTimePicker/dateTimePicker.mjs +9 -9
- package/dist/components/dateTimePicker/index.js +46 -35
- package/dist/components/dateTimePicker/index.mjs +9 -9
- package/dist/components/dateTimePicker/timePicker.js +46 -35
- package/dist/components/dateTimePicker/timePicker.mjs +5 -5
- package/dist/components/icon/Icon.d.mts +9 -5
- package/dist/components/icon/Icon.d.ts +9 -5
- package/dist/components/icon/Icon.js +46 -35
- package/dist/components/icon/Icon.mjs +2 -2
- package/dist/components/icon/index.js +46 -35
- package/dist/components/icon/index.mjs +2 -2
- package/dist/components/icon/template.d.mts +3 -2
- package/dist/components/icon/template.d.ts +3 -2
- package/dist/components/icon/template.js +46 -35
- package/dist/components/icon/template.mjs +1 -1
- package/dist/components/input/index.js +64 -53
- package/dist/components/input/index.mjs +3 -3
- package/dist/components/input/input.d.mts +44 -44
- package/dist/components/input/input.d.ts +44 -44
- package/dist/components/input/input.js +64 -53
- package/dist/components/input/input.mjs +3 -3
- package/dist/components/list/index.js +46 -35
- package/dist/components/list/index.mjs +4 -4
- package/dist/components/list/listItem.js +46 -35
- package/dist/components/list/listItem.mjs +4 -4
- package/dist/components/modal/index.js +46 -35
- package/dist/components/modal/index.mjs +5 -5
- package/dist/components/modal/modal.js +46 -35
- package/dist/components/modal/modal.mjs +5 -5
- package/dist/components/pagination/index.js +64 -53
- package/dist/components/pagination/index.mjs +4 -4
- package/dist/components/pagination/pagination.js +64 -53
- package/dist/components/pagination/pagination.mjs +4 -4
- package/dist/components/select/index.js +62 -51
- package/dist/components/select/index.mjs +3 -3
- package/dist/components/select/select.d.mts +38 -38
- package/dist/components/select/select.d.ts +38 -38
- package/dist/components/select/select.js +62 -51
- package/dist/components/select/select.mjs +3 -3
- package/dist/components/table/definition-table.d.mts +51 -0
- package/dist/components/table/definition-table.d.ts +51 -0
- package/dist/components/table/definition-table.js +351 -0
- package/dist/components/table/definition-table.mjs +9 -0
- package/dist/components/table/form-table.d.mts +1 -1
- package/dist/components/table/form-table.d.ts +1 -1
- package/dist/components/table/form-table.mjs +43 -3
- package/dist/components/table/index.d.mts +1 -1
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/table/index.js +86 -82
- package/dist/components/table/index.mjs +9 -9
- package/dist/components/table/table-head.js +8 -1
- package/dist/components/table/table-head.mjs +1 -1
- package/dist/components/table/table.js +72 -54
- package/dist/components/table/table.mjs +6 -6
- package/dist/components/toast/index.js +46 -35
- package/dist/components/toast/index.mjs +4 -4
- package/dist/components/toast/toast.js +46 -35
- package/dist/components/toast/toast.mjs +3 -3
- package/dist/components/toast/use-toast.js +46 -35
- package/dist/components/toast/use-toast.mjs +4 -4
- package/dist/components/tree/index.d.mts +1 -0
- package/dist/components/tree/index.d.ts +1 -0
- package/dist/components/tree/index.js +170 -84
- package/dist/components/tree/index.mjs +3 -3
- package/dist/components/tree/tree.d.mts +17 -10
- package/dist/components/tree/tree.d.ts +17 -10
- package/dist/components/tree/tree.js +175 -84
- package/dist/components/tree/tree.mjs +5 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +226 -147
- package/dist/index.mjs +31 -31
- package/package.json +1 -1
- package/dist/chunk-ICZTNO4V.mjs +0 -49
- package/dist/chunk-TEQ723QO.mjs +0 -102
|
@@ -102,6 +102,7 @@ var require_plugin = __commonJS({
|
|
|
102
102
|
// src/components/tree/tree.tsx
|
|
103
103
|
var tree_exports = {};
|
|
104
104
|
__export(tree_exports, {
|
|
105
|
+
Tree: () => Tree,
|
|
105
106
|
default: () => tree_default
|
|
106
107
|
});
|
|
107
108
|
module.exports = __toCommonJS(tree_exports);
|
|
@@ -842,22 +843,61 @@ var template = {
|
|
|
842
843
|
}
|
|
843
844
|
);
|
|
844
845
|
},
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
846
|
+
plus: ({ className }) => {
|
|
847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
848
|
+
"svg",
|
|
849
|
+
{
|
|
850
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
851
|
+
width: "18",
|
|
852
|
+
height: "18",
|
|
853
|
+
viewBox: "0 0 18 18",
|
|
854
|
+
fill: "none",
|
|
855
|
+
className,
|
|
856
|
+
children: [
|
|
857
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4.5 9H13.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
858
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 13.5V4.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
859
|
+
]
|
|
860
|
+
}
|
|
861
|
+
);
|
|
862
|
+
},
|
|
863
|
+
minus: ({ className }) => {
|
|
848
864
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
849
865
|
"svg",
|
|
850
866
|
{
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
867
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
868
|
+
width: "18",
|
|
869
|
+
height: "18",
|
|
870
|
+
viewBox: "0 0 18 18",
|
|
854
871
|
fill: "none",
|
|
872
|
+
className,
|
|
873
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4.5 9H13.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
874
|
+
}
|
|
875
|
+
);
|
|
876
|
+
},
|
|
877
|
+
pencil: ({ className }) => {
|
|
878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
879
|
+
"svg",
|
|
880
|
+
{
|
|
855
881
|
xmlns: "http://www.w3.org/2000/svg",
|
|
882
|
+
width: "18",
|
|
883
|
+
height: "18",
|
|
884
|
+
viewBox: "0 0 18 18",
|
|
885
|
+
fill: "none",
|
|
856
886
|
className,
|
|
857
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
887
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
888
|
+
"path",
|
|
889
|
+
{
|
|
890
|
+
d: "M12.6465 3.36525L13.9117 2.09925C14.1755 1.83549 14.5332 1.68732 14.9062 1.68732C15.2793 1.68732 15.637 1.83549 15.9008 2.09925C16.1645 2.36301 16.3127 2.72074 16.3127 3.09375C16.3127 3.46676 16.1645 3.82449 15.9008 4.08825L7.9365 12.0525C7.53999 12.4488 7.05102 12.74 6.51375 12.9L4.5 13.5L5.1 11.4863C5.25996 10.949 5.55123 10.46 5.9475 10.0635L12.6465 3.36525ZM12.6465 3.36525L14.625 5.34375M13.5 10.5V14.0625C13.5 14.5101 13.3222 14.9393 13.0057 15.2557C12.6893 15.5722 12.2601 15.75 11.8125 15.75H3.9375C3.48995 15.75 3.06072 15.5722 2.74426 15.2557C2.42779 14.9393 2.25 14.5101 2.25 14.0625V6.1875C2.25 5.73995 2.42779 5.31073 2.74426 4.99426C3.06072 4.67779 3.48995 4.5 3.9375 4.5H7.5",
|
|
891
|
+
stroke: "currentColor",
|
|
892
|
+
strokeLinecap: "round",
|
|
893
|
+
strokeLinejoin: "round"
|
|
894
|
+
}
|
|
895
|
+
)
|
|
858
896
|
}
|
|
859
897
|
);
|
|
860
898
|
},
|
|
899
|
+
// ----------------------------------- old ---------------------------------
|
|
900
|
+
// ** Status **
|
|
861
901
|
check: ({ className, fill }) => {
|
|
862
902
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
863
903
|
"svg",
|
|
@@ -2504,34 +2544,6 @@ var template = {
|
|
|
2504
2544
|
}
|
|
2505
2545
|
);
|
|
2506
2546
|
},
|
|
2507
|
-
pencil: ({ className, fill }) => {
|
|
2508
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2509
|
-
"svg",
|
|
2510
|
-
{
|
|
2511
|
-
width: "24",
|
|
2512
|
-
height: "24",
|
|
2513
|
-
viewBox: "0 0 24 24",
|
|
2514
|
-
fill: "none",
|
|
2515
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2516
|
-
className,
|
|
2517
|
-
children: fill ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2518
|
-
"path",
|
|
2519
|
-
{
|
|
2520
|
-
d: "M21.7313 2.26918C21.239 1.77699 20.5714 1.50049 19.8753 1.50049C19.1791 1.50049 18.5115 1.77699 18.0193 2.26918L16.8623 3.42618L20.5743 7.13818L21.7313 5.98118C22.2234 5.48891 22.4999 4.8213 22.4999 4.12518C22.4999 3.42906 22.2234 2.76145 21.7313 2.26918ZM19.5133 8.19918L15.8013 4.48718L3.65125 16.6372C3.03411 17.254 2.58043 18.015 2.33125 18.8512L1.53125 21.5362C1.49263 21.6657 1.48975 21.8033 1.52292 21.9344C1.55608 22.0655 1.62407 22.1852 1.71967 22.2808C1.81527 22.3764 1.93494 22.4443 2.06601 22.4775C2.19709 22.5107 2.33469 22.5078 2.46425 22.4692L5.14925 21.6692C5.98548 21.42 6.74642 20.9663 7.36325 20.3492L19.5133 8.19918Z",
|
|
2521
|
-
fill: "currentColor"
|
|
2522
|
-
}
|
|
2523
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2524
|
-
"path",
|
|
2525
|
-
{
|
|
2526
|
-
d: "M16.862 4.487L18.549 2.799C18.9007 2.44733 19.3777 2.24976 19.875 2.24976C20.3723 2.24976 20.8493 2.44733 21.201 2.799C21.5527 3.15068 21.7502 3.62766 21.7502 4.125C21.7502 4.62235 21.5527 5.09933 21.201 5.451L6.832 19.82C6.30332 20.3484 5.65137 20.7367 4.935 20.95L2.25 21.75L3.05 19.065C3.26328 18.3486 3.65163 17.6967 4.18 17.168L16.863 4.487H16.862ZM16.862 4.487L19.5 7.125",
|
|
2527
|
-
stroke: "currentColor",
|
|
2528
|
-
strokeLinecap: "round",
|
|
2529
|
-
strokeLinejoin: "round"
|
|
2530
|
-
}
|
|
2531
|
-
)
|
|
2532
|
-
}
|
|
2533
|
-
);
|
|
2534
|
-
},
|
|
2535
2547
|
"pencil-square": ({ className, fill }) => {
|
|
2536
2548
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2537
2549
|
"svg",
|
|
@@ -4337,76 +4349,151 @@ function toVal(mix) {
|
|
|
4337
4349
|
// src/components/tree/tree.tsx
|
|
4338
4350
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
4339
4351
|
var TreeNodeItem = (0, import_react.forwardRef)(
|
|
4340
|
-
({ node, depth, fileIcon, isLoading, classNames }, ref) => {
|
|
4341
|
-
var _a;
|
|
4352
|
+
({ node, depth, fileIcon, isLoading, classNames, onExpand }, ref) => {
|
|
4342
4353
|
const [isOpen, setIsOpen] = (0, import_react.useState)(false);
|
|
4354
|
+
const [children, setChildren] = (0, import_react.useState)(node.children);
|
|
4355
|
+
const [isLoadingChildren, setIsLoadingChildren] = (0, import_react.useState)(false);
|
|
4343
4356
|
const slots = (0, import_react.useMemo)(() => treeStyle(), []);
|
|
4344
|
-
const
|
|
4357
|
+
const hasMore = (0, import_react.useMemo)(() => {
|
|
4358
|
+
if (node.isLeaf) return false;
|
|
4359
|
+
if (Array.isArray(children)) return children.length > 0;
|
|
4360
|
+
return typeof onExpand === "function";
|
|
4361
|
+
}, [node.isLeaf, children, onExpand]);
|
|
4362
|
+
const toggleOpen = (0, import_react.useCallback)(async () => {
|
|
4363
|
+
if (!isOpen && !children && onExpand && !node.isLeaf) {
|
|
4364
|
+
setIsLoadingChildren(true);
|
|
4365
|
+
try {
|
|
4366
|
+
const result = await onExpand(node);
|
|
4367
|
+
setChildren(result);
|
|
4368
|
+
} catch (e) {
|
|
4369
|
+
console.error("Failed to load child nodes ", e);
|
|
4370
|
+
} finally {
|
|
4371
|
+
setIsLoadingChildren(false);
|
|
4372
|
+
}
|
|
4373
|
+
}
|
|
4345
4374
|
setIsOpen((prev) => !prev);
|
|
4346
|
-
}, []);
|
|
4375
|
+
}, [isOpen, children, onExpand, node]);
|
|
4376
|
+
const handleClick = () => {
|
|
4377
|
+
var _a;
|
|
4378
|
+
toggleOpen();
|
|
4379
|
+
(_a = node.onClick) == null ? void 0 : _a.call(node);
|
|
4380
|
+
};
|
|
4381
|
+
const handleRightClick = (e) => {
|
|
4382
|
+
var _a;
|
|
4383
|
+
e.preventDefault();
|
|
4384
|
+
(_a = node.onRightClick) == null ? void 0 : _a.call(node, e);
|
|
4385
|
+
};
|
|
4386
|
+
const marginClass = depth > 1 ? hasMore ? "ml-[30px]" : "ml-[55px]" : hasMore ? "" : "ml-[25px]";
|
|
4347
4387
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4348
4388
|
"div",
|
|
4349
4389
|
{
|
|
4350
4390
|
ref,
|
|
4351
4391
|
className: clsx(
|
|
4352
|
-
|
|
4392
|
+
marginClass,
|
|
4353
4393
|
"transition-all duration-150 ease-out",
|
|
4354
4394
|
isLoading ? "-translate-y-2 opacity-0" : "translate-y-0 opacity-100"
|
|
4355
4395
|
),
|
|
4356
4396
|
children: [
|
|
4357
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4358
|
-
|
|
4359
|
-
|
|
4397
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4398
|
+
"div",
|
|
4399
|
+
{
|
|
4400
|
+
className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
|
|
4401
|
+
onClick: handleClick,
|
|
4402
|
+
onContextMenu: handleRightClick,
|
|
4403
|
+
children: [
|
|
4404
|
+
hasMore && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4405
|
+
Icon_default,
|
|
4406
|
+
{
|
|
4407
|
+
name: "right-chevron",
|
|
4408
|
+
className: clsx(
|
|
4409
|
+
"text-neutral-main cursor-pointer transition-transform duration-150",
|
|
4410
|
+
isOpen ? "rotate-90" : "rotate-0"
|
|
4411
|
+
)
|
|
4412
|
+
}
|
|
4413
|
+
),
|
|
4414
|
+
fileIcon,
|
|
4415
|
+
node.label
|
|
4416
|
+
]
|
|
4417
|
+
}
|
|
4418
|
+
),
|
|
4419
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
|
|
4420
|
+
isLoadingChildren && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "text-neutral py-1 text-sm", children: "loading..." }),
|
|
4421
|
+
children == null ? void 0 : children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4422
|
+
TreeNodeItem,
|
|
4360
4423
|
{
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
] }),
|
|
4371
|
-
isOpen && ((_a = node.children) == null ? void 0 : _a.map((child) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TreeNodeItem, { node: child, depth: depth + 1, classNames, fileIcon }, child.id)))
|
|
4424
|
+
node: child,
|
|
4425
|
+
depth: depth + 1,
|
|
4426
|
+
classNames,
|
|
4427
|
+
fileIcon,
|
|
4428
|
+
onExpand
|
|
4429
|
+
},
|
|
4430
|
+
child.id
|
|
4431
|
+
))
|
|
4432
|
+
] })
|
|
4372
4433
|
]
|
|
4373
4434
|
}
|
|
4374
4435
|
);
|
|
4375
4436
|
}
|
|
4376
4437
|
);
|
|
4377
|
-
var Tree = (0, import_react.forwardRef)(
|
|
4378
|
-
({ headerContent, group, groupIcon, fileIcon, isLoading, classNames }, ref) => {
|
|
4379
|
-
const { label, data, onClick } = group;
|
|
4380
|
-
const slots = (0, import_react.useMemo)(() => treeStyle(), []);
|
|
4381
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
4382
|
-
headerContent && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: headerContent }),
|
|
4383
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
|
|
4384
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
4385
|
-
groupIcon,
|
|
4386
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), onClick, children: label })
|
|
4387
|
-
] }),
|
|
4388
|
-
data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4389
|
-
TreeNodeItem,
|
|
4390
|
-
{
|
|
4391
|
-
node,
|
|
4392
|
-
depth: 1,
|
|
4393
|
-
classNames,
|
|
4394
|
-
fileIcon,
|
|
4395
|
-
isLoading
|
|
4396
|
-
},
|
|
4397
|
-
node.id
|
|
4398
|
-
))
|
|
4399
|
-
] })
|
|
4400
|
-
] });
|
|
4401
|
-
}
|
|
4402
|
-
);
|
|
4403
4438
|
TreeNodeItem.displayName = "TreeNodeItem";
|
|
4439
|
+
var Tree = ({
|
|
4440
|
+
headerContent,
|
|
4441
|
+
group,
|
|
4442
|
+
groupIcon,
|
|
4443
|
+
fileIcon,
|
|
4444
|
+
isLoading = false,
|
|
4445
|
+
classNames,
|
|
4446
|
+
onExpand
|
|
4447
|
+
}) => {
|
|
4448
|
+
const slots = (0, import_react.useMemo)(() => treeStyle(), []);
|
|
4449
|
+
const [isOpen, setIsOpen] = (0, import_react.useState)(true);
|
|
4450
|
+
const handleToggle = () => {
|
|
4451
|
+
var _a;
|
|
4452
|
+
setIsOpen((prev) => !prev);
|
|
4453
|
+
(_a = group.onClick) == null ? void 0 : _a.call(group);
|
|
4454
|
+
};
|
|
4455
|
+
const handleRightClick = (e) => {
|
|
4456
|
+
var _a;
|
|
4457
|
+
e.preventDefault();
|
|
4458
|
+
(_a = group.onRightClick) == null ? void 0 : _a.call(group, e);
|
|
4459
|
+
};
|
|
4460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
4461
|
+
headerContent && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: headerContent }),
|
|
4462
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
4463
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4464
|
+
"div",
|
|
4465
|
+
{
|
|
4466
|
+
className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
|
|
4467
|
+
onClick: handleToggle,
|
|
4468
|
+
onContextMenu: handleRightClick,
|
|
4469
|
+
children: [
|
|
4470
|
+
groupIcon,
|
|
4471
|
+
group.label
|
|
4472
|
+
]
|
|
4473
|
+
}
|
|
4474
|
+
),
|
|
4475
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: group.data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4476
|
+
TreeNodeItem,
|
|
4477
|
+
{
|
|
4478
|
+
node,
|
|
4479
|
+
depth: 1,
|
|
4480
|
+
classNames,
|
|
4481
|
+
fileIcon,
|
|
4482
|
+
isLoading,
|
|
4483
|
+
onExpand
|
|
4484
|
+
},
|
|
4485
|
+
node.id
|
|
4486
|
+
)) })
|
|
4487
|
+
] })
|
|
4488
|
+
] });
|
|
4489
|
+
};
|
|
4404
4490
|
Tree.displayName = "Tree";
|
|
4405
4491
|
var tree_default = Tree;
|
|
4406
4492
|
var treeStyle = tv({
|
|
4407
4493
|
slots: {
|
|
4408
4494
|
base: ["border", "border-neutral-light", "rounded-xl", "p-[20px]", "flex", "flex-col", "gap-[20px]", "select-none"],
|
|
4409
|
-
wrapper: [
|
|
4495
|
+
wrapper: ["flex", "flex-col", "gap-[5px]"],
|
|
4496
|
+
group: [
|
|
4410
4497
|
"flex",
|
|
4411
4498
|
"items-center",
|
|
4412
4499
|
"gap-[5px]",
|
|
@@ -4415,8 +4502,12 @@ var treeStyle = tv({
|
|
|
4415
4502
|
"text-body-foreground",
|
|
4416
4503
|
"hover:bg-neutral-soft",
|
|
4417
4504
|
"p-[5px]",
|
|
4418
|
-
"rounded-[5px]"
|
|
4419
|
-
|
|
4420
|
-
|
|
4505
|
+
"rounded-[5px]",
|
|
4506
|
+
"cursor-pointer"
|
|
4507
|
+
]
|
|
4421
4508
|
}
|
|
4422
4509
|
});
|
|
4510
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
4511
|
+
0 && (module.exports = {
|
|
4512
|
+
Tree
|
|
4513
|
+
});
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
+
Tree,
|
|
3
4
|
tree_default
|
|
4
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-4OSN2OE2.mjs";
|
|
5
6
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-2TKEWFGH.mjs";
|
|
8
|
+
import "../../chunk-2SDYFOZL.mjs";
|
|
8
9
|
import "../../chunk-4ZJFD3L3.mjs";
|
|
9
10
|
import "../../chunk-27Y6K5NK.mjs";
|
|
10
11
|
import "../../chunk-AC6TWLRT.mjs";
|
|
11
12
|
export {
|
|
13
|
+
Tree,
|
|
12
14
|
tree_default as default
|
|
13
15
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -9,7 +9,7 @@ export { default as Input } from './components/input/input.mjs';
|
|
|
9
9
|
export { default as Tabs, TabsDataType } from './components/tabs/tabs.mjs';
|
|
10
10
|
export { default as Textarea } from './components/textarea/textarea.mjs';
|
|
11
11
|
export { default as Table, TableColumn, TableRow } from './components/table/table.mjs';
|
|
12
|
-
export { default as
|
|
12
|
+
export { default as DefinitionTable } from './components/table/definition-table.mjs';
|
|
13
13
|
export { default as Select } from './components/select/select.mjs';
|
|
14
14
|
export { default as CheckBox } from './components/checkbox/checkbox.mjs';
|
|
15
15
|
export { default as Chip } from './components/chip/chip.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { default as Input } from './components/input/input.js';
|
|
|
9
9
|
export { default as Tabs, TabsDataType } from './components/tabs/tabs.js';
|
|
10
10
|
export { default as Textarea } from './components/textarea/textarea.js';
|
|
11
11
|
export { default as Table, TableColumn, TableRow } from './components/table/table.js';
|
|
12
|
-
export { default as
|
|
12
|
+
export { default as DefinitionTable } from './components/table/definition-table.js';
|
|
13
13
|
export { default as Select } from './components/select/select.js';
|
|
14
14
|
export { default as CheckBox } from './components/checkbox/checkbox.js';
|
|
15
15
|
export { default as Chip } from './components/chip/chip.js';
|