@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
|
@@ -844,22 +844,61 @@ var template = {
|
|
|
844
844
|
}
|
|
845
845
|
);
|
|
846
846
|
},
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
847
|
+
plus: ({ className }) => {
|
|
848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
849
|
+
"svg",
|
|
850
|
+
{
|
|
851
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
852
|
+
width: "18",
|
|
853
|
+
height: "18",
|
|
854
|
+
viewBox: "0 0 18 18",
|
|
855
|
+
fill: "none",
|
|
856
|
+
className,
|
|
857
|
+
children: [
|
|
858
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4.5 9H13.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
859
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 13.5V4.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
860
|
+
]
|
|
861
|
+
}
|
|
862
|
+
);
|
|
863
|
+
},
|
|
864
|
+
minus: ({ className }) => {
|
|
850
865
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
851
866
|
"svg",
|
|
852
867
|
{
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
868
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
869
|
+
width: "18",
|
|
870
|
+
height: "18",
|
|
871
|
+
viewBox: "0 0 18 18",
|
|
856
872
|
fill: "none",
|
|
873
|
+
className,
|
|
874
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4.5 9H13.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
875
|
+
}
|
|
876
|
+
);
|
|
877
|
+
},
|
|
878
|
+
pencil: ({ className }) => {
|
|
879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
880
|
+
"svg",
|
|
881
|
+
{
|
|
857
882
|
xmlns: "http://www.w3.org/2000/svg",
|
|
883
|
+
width: "18",
|
|
884
|
+
height: "18",
|
|
885
|
+
viewBox: "0 0 18 18",
|
|
886
|
+
fill: "none",
|
|
858
887
|
className,
|
|
859
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
888
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
889
|
+
"path",
|
|
890
|
+
{
|
|
891
|
+
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",
|
|
892
|
+
stroke: "currentColor",
|
|
893
|
+
strokeLinecap: "round",
|
|
894
|
+
strokeLinejoin: "round"
|
|
895
|
+
}
|
|
896
|
+
)
|
|
860
897
|
}
|
|
861
898
|
);
|
|
862
899
|
},
|
|
900
|
+
// ----------------------------------- old ---------------------------------
|
|
901
|
+
// ** Status **
|
|
863
902
|
check: ({ className, fill }) => {
|
|
864
903
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
865
904
|
"svg",
|
|
@@ -2506,34 +2545,6 @@ var template = {
|
|
|
2506
2545
|
}
|
|
2507
2546
|
);
|
|
2508
2547
|
},
|
|
2509
|
-
pencil: ({ className, fill }) => {
|
|
2510
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2511
|
-
"svg",
|
|
2512
|
-
{
|
|
2513
|
-
width: "24",
|
|
2514
|
-
height: "24",
|
|
2515
|
-
viewBox: "0 0 24 24",
|
|
2516
|
-
fill: "none",
|
|
2517
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2518
|
-
className,
|
|
2519
|
-
children: fill ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2520
|
-
"path",
|
|
2521
|
-
{
|
|
2522
|
-
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",
|
|
2523
|
-
fill: "currentColor"
|
|
2524
|
-
}
|
|
2525
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2526
|
-
"path",
|
|
2527
|
-
{
|
|
2528
|
-
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",
|
|
2529
|
-
stroke: "currentColor",
|
|
2530
|
-
strokeLinecap: "round",
|
|
2531
|
-
strokeLinejoin: "round"
|
|
2532
|
-
}
|
|
2533
|
-
)
|
|
2534
|
-
}
|
|
2535
|
-
);
|
|
2536
|
-
},
|
|
2537
2548
|
"pencil-square": ({ className, fill }) => {
|
|
2538
2549
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2539
2550
|
"svg",
|
|
@@ -4339,76 +4350,151 @@ function toVal(mix) {
|
|
|
4339
4350
|
// src/components/tree/tree.tsx
|
|
4340
4351
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
4341
4352
|
var TreeNodeItem = (0, import_react.forwardRef)(
|
|
4342
|
-
({ node, depth, fileIcon, isLoading, classNames }, ref) => {
|
|
4343
|
-
var _a;
|
|
4353
|
+
({ node, depth, fileIcon, isLoading, classNames, onExpand }, ref) => {
|
|
4344
4354
|
const [isOpen, setIsOpen] = (0, import_react.useState)(false);
|
|
4355
|
+
const [children, setChildren] = (0, import_react.useState)(node.children);
|
|
4356
|
+
const [isLoadingChildren, setIsLoadingChildren] = (0, import_react.useState)(false);
|
|
4345
4357
|
const slots = (0, import_react.useMemo)(() => treeStyle(), []);
|
|
4346
|
-
const
|
|
4358
|
+
const hasMore = (0, import_react.useMemo)(() => {
|
|
4359
|
+
if (node.isLeaf) return false;
|
|
4360
|
+
if (Array.isArray(children)) return children.length > 0;
|
|
4361
|
+
return typeof onExpand === "function";
|
|
4362
|
+
}, [node.isLeaf, children, onExpand]);
|
|
4363
|
+
const toggleOpen = (0, import_react.useCallback)(async () => {
|
|
4364
|
+
if (!isOpen && !children && onExpand && !node.isLeaf) {
|
|
4365
|
+
setIsLoadingChildren(true);
|
|
4366
|
+
try {
|
|
4367
|
+
const result = await onExpand(node);
|
|
4368
|
+
setChildren(result);
|
|
4369
|
+
} catch (e) {
|
|
4370
|
+
console.error("Failed to load child nodes ", e);
|
|
4371
|
+
} finally {
|
|
4372
|
+
setIsLoadingChildren(false);
|
|
4373
|
+
}
|
|
4374
|
+
}
|
|
4347
4375
|
setIsOpen((prev) => !prev);
|
|
4348
|
-
}, []);
|
|
4376
|
+
}, [isOpen, children, onExpand, node]);
|
|
4377
|
+
const handleClick = () => {
|
|
4378
|
+
var _a;
|
|
4379
|
+
toggleOpen();
|
|
4380
|
+
(_a = node.onClick) == null ? void 0 : _a.call(node);
|
|
4381
|
+
};
|
|
4382
|
+
const handleRightClick = (e) => {
|
|
4383
|
+
var _a;
|
|
4384
|
+
e.preventDefault();
|
|
4385
|
+
(_a = node.onRightClick) == null ? void 0 : _a.call(node, e);
|
|
4386
|
+
};
|
|
4387
|
+
const marginClass = depth > 1 ? hasMore ? "ml-[30px]" : "ml-[55px]" : hasMore ? "" : "ml-[25px]";
|
|
4349
4388
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4350
4389
|
"div",
|
|
4351
4390
|
{
|
|
4352
4391
|
ref,
|
|
4353
4392
|
className: clsx(
|
|
4354
|
-
|
|
4393
|
+
marginClass,
|
|
4355
4394
|
"transition-all duration-150 ease-out",
|
|
4356
4395
|
isLoading ? "-translate-y-2 opacity-0" : "translate-y-0 opacity-100"
|
|
4357
4396
|
),
|
|
4358
4397
|
children: [
|
|
4359
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4360
|
-
|
|
4361
|
-
|
|
4398
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4399
|
+
"div",
|
|
4400
|
+
{
|
|
4401
|
+
className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
|
|
4402
|
+
onClick: handleClick,
|
|
4403
|
+
onContextMenu: handleRightClick,
|
|
4404
|
+
children: [
|
|
4405
|
+
hasMore && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4406
|
+
Icon_default,
|
|
4407
|
+
{
|
|
4408
|
+
name: "right-chevron",
|
|
4409
|
+
className: clsx(
|
|
4410
|
+
"text-neutral-main cursor-pointer transition-transform duration-150",
|
|
4411
|
+
isOpen ? "rotate-90" : "rotate-0"
|
|
4412
|
+
)
|
|
4413
|
+
}
|
|
4414
|
+
),
|
|
4415
|
+
fileIcon,
|
|
4416
|
+
node.label
|
|
4417
|
+
]
|
|
4418
|
+
}
|
|
4419
|
+
),
|
|
4420
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
|
|
4421
|
+
isLoadingChildren && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "text-neutral py-1 text-sm", children: "loading..." }),
|
|
4422
|
+
children == null ? void 0 : children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4423
|
+
TreeNodeItem,
|
|
4362
4424
|
{
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
] }),
|
|
4373
|
-
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)))
|
|
4425
|
+
node: child,
|
|
4426
|
+
depth: depth + 1,
|
|
4427
|
+
classNames,
|
|
4428
|
+
fileIcon,
|
|
4429
|
+
onExpand
|
|
4430
|
+
},
|
|
4431
|
+
child.id
|
|
4432
|
+
))
|
|
4433
|
+
] })
|
|
4374
4434
|
]
|
|
4375
4435
|
}
|
|
4376
4436
|
);
|
|
4377
4437
|
}
|
|
4378
4438
|
);
|
|
4379
|
-
var Tree = (0, import_react.forwardRef)(
|
|
4380
|
-
({ headerContent, group, groupIcon, fileIcon, isLoading, classNames }, ref) => {
|
|
4381
|
-
const { label, data, onClick } = group;
|
|
4382
|
-
const slots = (0, import_react.useMemo)(() => treeStyle(), []);
|
|
4383
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
4384
|
-
headerContent && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: headerContent }),
|
|
4385
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
|
|
4386
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
4387
|
-
groupIcon,
|
|
4388
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), onClick, children: label })
|
|
4389
|
-
] }),
|
|
4390
|
-
data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4391
|
-
TreeNodeItem,
|
|
4392
|
-
{
|
|
4393
|
-
node,
|
|
4394
|
-
depth: 1,
|
|
4395
|
-
classNames,
|
|
4396
|
-
fileIcon,
|
|
4397
|
-
isLoading
|
|
4398
|
-
},
|
|
4399
|
-
node.id
|
|
4400
|
-
))
|
|
4401
|
-
] })
|
|
4402
|
-
] });
|
|
4403
|
-
}
|
|
4404
|
-
);
|
|
4405
4439
|
TreeNodeItem.displayName = "TreeNodeItem";
|
|
4440
|
+
var Tree = ({
|
|
4441
|
+
headerContent,
|
|
4442
|
+
group,
|
|
4443
|
+
groupIcon,
|
|
4444
|
+
fileIcon,
|
|
4445
|
+
isLoading = false,
|
|
4446
|
+
classNames,
|
|
4447
|
+
onExpand
|
|
4448
|
+
}) => {
|
|
4449
|
+
const slots = (0, import_react.useMemo)(() => treeStyle(), []);
|
|
4450
|
+
const [isOpen, setIsOpen] = (0, import_react.useState)(true);
|
|
4451
|
+
const handleToggle = () => {
|
|
4452
|
+
var _a;
|
|
4453
|
+
setIsOpen((prev) => !prev);
|
|
4454
|
+
(_a = group.onClick) == null ? void 0 : _a.call(group);
|
|
4455
|
+
};
|
|
4456
|
+
const handleRightClick = (e) => {
|
|
4457
|
+
var _a;
|
|
4458
|
+
e.preventDefault();
|
|
4459
|
+
(_a = group.onRightClick) == null ? void 0 : _a.call(group, e);
|
|
4460
|
+
};
|
|
4461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
4462
|
+
headerContent && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: headerContent }),
|
|
4463
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
4464
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4465
|
+
"div",
|
|
4466
|
+
{
|
|
4467
|
+
className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
|
|
4468
|
+
onClick: handleToggle,
|
|
4469
|
+
onContextMenu: handleRightClick,
|
|
4470
|
+
children: [
|
|
4471
|
+
groupIcon,
|
|
4472
|
+
group.label
|
|
4473
|
+
]
|
|
4474
|
+
}
|
|
4475
|
+
),
|
|
4476
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: group.data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4477
|
+
TreeNodeItem,
|
|
4478
|
+
{
|
|
4479
|
+
node,
|
|
4480
|
+
depth: 1,
|
|
4481
|
+
classNames,
|
|
4482
|
+
fileIcon,
|
|
4483
|
+
isLoading,
|
|
4484
|
+
onExpand
|
|
4485
|
+
},
|
|
4486
|
+
node.id
|
|
4487
|
+
)) })
|
|
4488
|
+
] })
|
|
4489
|
+
] });
|
|
4490
|
+
};
|
|
4406
4491
|
Tree.displayName = "Tree";
|
|
4407
4492
|
var tree_default = Tree;
|
|
4408
4493
|
var treeStyle = tv({
|
|
4409
4494
|
slots: {
|
|
4410
4495
|
base: ["border", "border-neutral-light", "rounded-xl", "p-[20px]", "flex", "flex-col", "gap-[20px]", "select-none"],
|
|
4411
|
-
wrapper: [
|
|
4496
|
+
wrapper: ["flex", "flex-col", "gap-[5px]"],
|
|
4497
|
+
group: [
|
|
4412
4498
|
"flex",
|
|
4413
4499
|
"items-center",
|
|
4414
4500
|
"gap-[5px]",
|
|
@@ -4417,9 +4503,9 @@ var treeStyle = tv({
|
|
|
4417
4503
|
"text-body-foreground",
|
|
4418
4504
|
"hover:bg-neutral-soft",
|
|
4419
4505
|
"p-[5px]",
|
|
4420
|
-
"rounded-[5px]"
|
|
4421
|
-
|
|
4422
|
-
|
|
4506
|
+
"rounded-[5px]",
|
|
4507
|
+
"cursor-pointer"
|
|
4508
|
+
]
|
|
4423
4509
|
}
|
|
4424
4510
|
});
|
|
4425
4511
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import "../../chunk-MBLZYQCN.mjs";
|
|
3
3
|
import {
|
|
4
4
|
tree_default
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-4OSN2OE2.mjs";
|
|
6
6
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-2TKEWFGH.mjs";
|
|
8
|
+
import "../../chunk-2SDYFOZL.mjs";
|
|
9
9
|
import "../../chunk-4ZJFD3L3.mjs";
|
|
10
10
|
import "../../chunk-27Y6K5NK.mjs";
|
|
11
11
|
import "../../chunk-AC6TWLRT.mjs";
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as tailwind_variants from 'tailwind-variants';
|
|
2
2
|
import * as tailwind_merge from 'tailwind-merge';
|
|
3
|
-
import * as
|
|
4
|
-
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { ReactNode, MouseEvent } from 'react';
|
|
5
5
|
import { SlotsToClasses } from '../../utils/types.mjs';
|
|
6
6
|
|
|
7
7
|
type TreeNode = {
|
|
8
8
|
id: number;
|
|
9
9
|
label: string;
|
|
10
|
+
isLeaf?: boolean;
|
|
10
11
|
children?: TreeNode[];
|
|
11
12
|
onClick?: () => void;
|
|
13
|
+
onRightClick?: (event: MouseEvent<HTMLSpanElement>) => void;
|
|
12
14
|
};
|
|
13
15
|
interface TreeProps {
|
|
14
16
|
headerContent?: ReactNode;
|
|
@@ -16,19 +18,24 @@ interface TreeProps {
|
|
|
16
18
|
label: string;
|
|
17
19
|
data: TreeNode[];
|
|
18
20
|
onClick?: () => void;
|
|
21
|
+
onRightClick?: (event: MouseEvent<HTMLSpanElement>) => void;
|
|
19
22
|
};
|
|
20
23
|
groupIcon?: ReactNode;
|
|
21
24
|
fileIcon?: ReactNode;
|
|
22
25
|
isLoading?: boolean;
|
|
23
26
|
classNames?: SlotsToClasses<TreeSlots>;
|
|
27
|
+
onExpand?: (node: TreeNode) => Promise<TreeNode[]>;
|
|
24
28
|
}
|
|
25
|
-
declare const Tree:
|
|
29
|
+
declare const Tree: {
|
|
30
|
+
({ headerContent, group, groupIcon, fileIcon, isLoading, classNames, onExpand, }: TreeProps): react_jsx_runtime.JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
26
33
|
|
|
27
34
|
declare const treeStyle: tailwind_variants.TVReturnType<{
|
|
28
35
|
[key: string]: {
|
|
29
36
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
30
37
|
base?: tailwind_merge.ClassNameValue;
|
|
31
|
-
|
|
38
|
+
group?: tailwind_merge.ClassNameValue;
|
|
32
39
|
wrapper?: tailwind_merge.ClassNameValue;
|
|
33
40
|
};
|
|
34
41
|
};
|
|
@@ -36,31 +43,31 @@ declare const treeStyle: tailwind_variants.TVReturnType<{
|
|
|
36
43
|
[x: string]: {
|
|
37
44
|
[x: string]: tailwind_merge.ClassNameValue | {
|
|
38
45
|
base?: tailwind_merge.ClassNameValue;
|
|
39
|
-
|
|
46
|
+
group?: tailwind_merge.ClassNameValue;
|
|
40
47
|
wrapper?: tailwind_merge.ClassNameValue;
|
|
41
48
|
};
|
|
42
49
|
};
|
|
43
50
|
} | {}, {
|
|
44
51
|
base: string[];
|
|
45
52
|
wrapper: string[];
|
|
46
|
-
|
|
53
|
+
group: string[];
|
|
47
54
|
}, undefined, {
|
|
48
55
|
[key: string]: {
|
|
49
56
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
50
57
|
base?: tailwind_merge.ClassNameValue;
|
|
51
|
-
|
|
58
|
+
group?: tailwind_merge.ClassNameValue;
|
|
52
59
|
wrapper?: tailwind_merge.ClassNameValue;
|
|
53
60
|
};
|
|
54
61
|
};
|
|
55
62
|
} | {}, {
|
|
56
63
|
base: string[];
|
|
57
64
|
wrapper: string[];
|
|
58
|
-
|
|
65
|
+
group: string[];
|
|
59
66
|
}, tailwind_variants.TVReturnType<unknown, {
|
|
60
67
|
base: string[];
|
|
61
68
|
wrapper: string[];
|
|
62
|
-
|
|
69
|
+
group: string[];
|
|
63
70
|
}, undefined, unknown, unknown, undefined>>;
|
|
64
71
|
type TreeSlots = keyof ReturnType<typeof treeStyle>;
|
|
65
72
|
|
|
66
|
-
export { type TreeNode, Tree as default };
|
|
73
|
+
export { Tree, type TreeNode, type TreeProps, Tree as default };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as tailwind_variants from 'tailwind-variants';
|
|
2
2
|
import * as tailwind_merge from 'tailwind-merge';
|
|
3
|
-
import * as
|
|
4
|
-
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { ReactNode, MouseEvent } from 'react';
|
|
5
5
|
import { SlotsToClasses } from '../../utils/types.js';
|
|
6
6
|
|
|
7
7
|
type TreeNode = {
|
|
8
8
|
id: number;
|
|
9
9
|
label: string;
|
|
10
|
+
isLeaf?: boolean;
|
|
10
11
|
children?: TreeNode[];
|
|
11
12
|
onClick?: () => void;
|
|
13
|
+
onRightClick?: (event: MouseEvent<HTMLSpanElement>) => void;
|
|
12
14
|
};
|
|
13
15
|
interface TreeProps {
|
|
14
16
|
headerContent?: ReactNode;
|
|
@@ -16,19 +18,24 @@ interface TreeProps {
|
|
|
16
18
|
label: string;
|
|
17
19
|
data: TreeNode[];
|
|
18
20
|
onClick?: () => void;
|
|
21
|
+
onRightClick?: (event: MouseEvent<HTMLSpanElement>) => void;
|
|
19
22
|
};
|
|
20
23
|
groupIcon?: ReactNode;
|
|
21
24
|
fileIcon?: ReactNode;
|
|
22
25
|
isLoading?: boolean;
|
|
23
26
|
classNames?: SlotsToClasses<TreeSlots>;
|
|
27
|
+
onExpand?: (node: TreeNode) => Promise<TreeNode[]>;
|
|
24
28
|
}
|
|
25
|
-
declare const Tree:
|
|
29
|
+
declare const Tree: {
|
|
30
|
+
({ headerContent, group, groupIcon, fileIcon, isLoading, classNames, onExpand, }: TreeProps): react_jsx_runtime.JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
26
33
|
|
|
27
34
|
declare const treeStyle: tailwind_variants.TVReturnType<{
|
|
28
35
|
[key: string]: {
|
|
29
36
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
30
37
|
base?: tailwind_merge.ClassNameValue;
|
|
31
|
-
|
|
38
|
+
group?: tailwind_merge.ClassNameValue;
|
|
32
39
|
wrapper?: tailwind_merge.ClassNameValue;
|
|
33
40
|
};
|
|
34
41
|
};
|
|
@@ -36,31 +43,31 @@ declare const treeStyle: tailwind_variants.TVReturnType<{
|
|
|
36
43
|
[x: string]: {
|
|
37
44
|
[x: string]: tailwind_merge.ClassNameValue | {
|
|
38
45
|
base?: tailwind_merge.ClassNameValue;
|
|
39
|
-
|
|
46
|
+
group?: tailwind_merge.ClassNameValue;
|
|
40
47
|
wrapper?: tailwind_merge.ClassNameValue;
|
|
41
48
|
};
|
|
42
49
|
};
|
|
43
50
|
} | {}, {
|
|
44
51
|
base: string[];
|
|
45
52
|
wrapper: string[];
|
|
46
|
-
|
|
53
|
+
group: string[];
|
|
47
54
|
}, undefined, {
|
|
48
55
|
[key: string]: {
|
|
49
56
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
50
57
|
base?: tailwind_merge.ClassNameValue;
|
|
51
|
-
|
|
58
|
+
group?: tailwind_merge.ClassNameValue;
|
|
52
59
|
wrapper?: tailwind_merge.ClassNameValue;
|
|
53
60
|
};
|
|
54
61
|
};
|
|
55
62
|
} | {}, {
|
|
56
63
|
base: string[];
|
|
57
64
|
wrapper: string[];
|
|
58
|
-
|
|
65
|
+
group: string[];
|
|
59
66
|
}, tailwind_variants.TVReturnType<unknown, {
|
|
60
67
|
base: string[];
|
|
61
68
|
wrapper: string[];
|
|
62
|
-
|
|
69
|
+
group: string[];
|
|
63
70
|
}, undefined, unknown, unknown, undefined>>;
|
|
64
71
|
type TreeSlots = keyof ReturnType<typeof treeStyle>;
|
|
65
72
|
|
|
66
|
-
export { type TreeNode, Tree as default };
|
|
73
|
+
export { Tree, type TreeNode, type TreeProps, Tree as default };
|