@unifiedsoftware/react-ui 1.0.16 → 1.0.18
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/index.d.mts +121 -7
- package/dist/index.d.ts +121 -7
- package/dist/index.js +810 -399
- package/dist/index.mjs +753 -359
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -59,16 +59,27 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
59
59
|
// src/index.ts
|
|
60
60
|
var src_exports = {};
|
|
61
61
|
__export(src_exports, {
|
|
62
|
+
Accordion: () => Accordion_default,
|
|
63
|
+
AccordionContent: () => AccordionContent_default,
|
|
64
|
+
AccordionHeader: () => AccordionHeader_default,
|
|
65
|
+
AccordionItem: () => AccordionItem_default,
|
|
66
|
+
AccordionPanel: () => AccordionPanel_default,
|
|
62
67
|
Backdrop: () => Backdrop_default,
|
|
63
68
|
Badge: () => Badge_default,
|
|
64
69
|
Button: () => Button,
|
|
70
|
+
Card: () => Card_default,
|
|
71
|
+
CardHeader: () => CardHeader_default,
|
|
65
72
|
Chip: () => Chip_default,
|
|
66
73
|
Collapse: () => Collapse_default,
|
|
67
74
|
CollapseContent: () => CollapseContent_default,
|
|
68
75
|
CollapseContext: () => CollapseContext_default,
|
|
69
76
|
CollapseTrigger: () => CollapseTrigger_default,
|
|
70
77
|
Drawer: () => Drawer_default,
|
|
78
|
+
Field: () => Field_default,
|
|
71
79
|
Icon: () => Icon_default,
|
|
80
|
+
List: () => List_default,
|
|
81
|
+
ListGroup: () => ListGroup_default,
|
|
82
|
+
ListItem: () => ListItem_default,
|
|
72
83
|
Menu: () => Menu_default,
|
|
73
84
|
MenuContext: () => MenuContext_default,
|
|
74
85
|
MenuGroup: () => MenuGroup_default,
|
|
@@ -77,13 +88,19 @@ __export(src_exports, {
|
|
|
77
88
|
MenuValueContext: () => MenuValueContext_default,
|
|
78
89
|
MultiSelect: () => MultiSelect_default,
|
|
79
90
|
Portal: () => Portal_default,
|
|
91
|
+
ScrollArea: () => ScrollArea_default,
|
|
80
92
|
Select: () => Select_default,
|
|
93
|
+
Switch: () => Switch_default,
|
|
81
94
|
Tab: () => Tab,
|
|
82
95
|
Tabs: () => Tabs,
|
|
83
96
|
Toolbar: () => Toolbar_default,
|
|
84
97
|
Transition: () => Transition_default,
|
|
98
|
+
clsx: () => clsx_default,
|
|
85
99
|
getOpenValuesByPathname: () => getOpenValuesByPathname,
|
|
100
|
+
scrollToItem: () => scrollToItem,
|
|
101
|
+
useAccordionItem: () => useAccordionItem,
|
|
86
102
|
useCollapse: () => useCollapse,
|
|
103
|
+
useDisclosure: () => useDisclosure_default,
|
|
87
104
|
useLocalStorage: () => useLocalStorage,
|
|
88
105
|
useMenu: () => useMenu,
|
|
89
106
|
useMenuItemValue: () => useMenuItemValue,
|
|
@@ -306,6 +323,7 @@ var Button = (0, import_react8.forwardRef)(
|
|
|
306
323
|
iconOnly,
|
|
307
324
|
startContent,
|
|
308
325
|
endContent,
|
|
326
|
+
block,
|
|
309
327
|
loading,
|
|
310
328
|
disabled
|
|
311
329
|
} = _b, rest = __objRest(_b, [
|
|
@@ -319,6 +337,7 @@ var Button = (0, import_react8.forwardRef)(
|
|
|
319
337
|
"iconOnly",
|
|
320
338
|
"startContent",
|
|
321
339
|
"endContent",
|
|
340
|
+
"block",
|
|
322
341
|
"loading",
|
|
323
342
|
"disabled"
|
|
324
343
|
]);
|
|
@@ -332,6 +351,7 @@ var Button = (0, import_react8.forwardRef)(
|
|
|
332
351
|
[`${PREFIX_CLS}button--${variant}`]: variant,
|
|
333
352
|
[`${PREFIX_CLS}button--${color}`]: color,
|
|
334
353
|
[`${PREFIX_CLS}button--${size}`]: size,
|
|
354
|
+
[`${PREFIX_CLS}button--block`]: block,
|
|
335
355
|
[`${PREFIX_CLS}button--icon-only`]: iconOnly,
|
|
336
356
|
[`${PREFIX_CLS}button--disabled`]: disabled
|
|
337
357
|
},
|
|
@@ -352,18 +372,114 @@ var Button = (0, import_react8.forwardRef)(
|
|
|
352
372
|
}
|
|
353
373
|
);
|
|
354
374
|
|
|
355
|
-
// src/components/
|
|
356
|
-
var import_clsx6 = __toESM(require("clsx"));
|
|
375
|
+
// src/components/Card/Card.tsx
|
|
357
376
|
var import_react9 = require("react");
|
|
377
|
+
|
|
378
|
+
// src/utils/clsx.ts
|
|
379
|
+
function toVal(mix) {
|
|
380
|
+
let k, y, str = "";
|
|
381
|
+
if (typeof mix === "string" || typeof mix === "number") {
|
|
382
|
+
str += mix;
|
|
383
|
+
} else if (typeof mix === "object") {
|
|
384
|
+
if (Array.isArray(mix)) {
|
|
385
|
+
for (k = 0; k < mix.length; k++) {
|
|
386
|
+
if (mix[k]) {
|
|
387
|
+
if (y = toVal(mix[k])) {
|
|
388
|
+
str && (str += " ");
|
|
389
|
+
str += y;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
} else {
|
|
394
|
+
for (k in mix) {
|
|
395
|
+
if (mix[k]) {
|
|
396
|
+
str && (str += " ");
|
|
397
|
+
str += k;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
return str;
|
|
403
|
+
}
|
|
404
|
+
function clsx6(...inputs) {
|
|
405
|
+
let i = 0, tmp, x, str = "";
|
|
406
|
+
while (i < inputs.length) {
|
|
407
|
+
if (tmp = inputs[i++]) {
|
|
408
|
+
if (x = toVal(tmp)) {
|
|
409
|
+
str && (str += " ");
|
|
410
|
+
str += x;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return str;
|
|
415
|
+
}
|
|
416
|
+
var clsx_default = clsx6;
|
|
417
|
+
|
|
418
|
+
// src/utils/scroll.ts
|
|
419
|
+
var scrollToItem = (parentElement, currentElement) => {
|
|
420
|
+
const parentRect = parentElement.getBoundingClientRect();
|
|
421
|
+
const currentRect = currentElement.getBoundingClientRect();
|
|
422
|
+
const behavior = "smooth";
|
|
423
|
+
const previousElement = currentElement.previousSibling;
|
|
424
|
+
const previousRect = (previousElement == null ? void 0 : previousElement.getBoundingClientRect()) || currentRect;
|
|
425
|
+
if (parentRect.left > previousRect.left) {
|
|
426
|
+
let offset = 0;
|
|
427
|
+
if (previousElement) {
|
|
428
|
+
offset = previousRect.left - parentRect.left + parentElement.scrollLeft + previousRect.width / 4;
|
|
429
|
+
}
|
|
430
|
+
parentElement.scrollTo({ behavior, left: offset });
|
|
431
|
+
}
|
|
432
|
+
const nextElement = currentElement.nextSibling;
|
|
433
|
+
const nextRect = (nextElement == null ? void 0 : nextElement.getBoundingClientRect()) || currentRect;
|
|
434
|
+
if (parentRect.right < nextRect.right) {
|
|
435
|
+
let offset = parentElement.scrollWidth;
|
|
436
|
+
if (nextElement) {
|
|
437
|
+
offset = nextRect.right - parentRect.right + parentElement.scrollLeft - nextRect.width / 4;
|
|
438
|
+
}
|
|
439
|
+
parentElement.scrollTo({ behavior, left: offset });
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
// src/components/Card/Card.tsx
|
|
358
444
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
359
|
-
var
|
|
445
|
+
var Card = (0, import_react9.forwardRef)((_a, ref) => {
|
|
446
|
+
var _b = _a, { as: Component = "div", children, className } = _b, rest = __objRest(_b, ["as", "children", "className"]);
|
|
447
|
+
const prefixCls = PREFIX_CLS;
|
|
448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Component, __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}card`, className) }, rest), { children }));
|
|
449
|
+
});
|
|
450
|
+
var Card_default = Card;
|
|
451
|
+
|
|
452
|
+
// src/components/Card/CardHeader.tsx
|
|
453
|
+
var import_react10 = require("react");
|
|
454
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
455
|
+
var CardHeader = (0, import_react10.forwardRef)(
|
|
456
|
+
(_a, ref) => {
|
|
457
|
+
var _b = _a, { as: Component = "div", className, title, subtitle, startContent, endContent } = _b, rest = __objRest(_b, ["as", "className", "title", "subtitle", "startContent", "endContent"]);
|
|
458
|
+
const prefixCls = PREFIX_CLS;
|
|
459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Component, __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}card-header`, className) }, rest), { children: [
|
|
460
|
+
startContent && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${prefixCls}card-header__start-content`, children: startContent }),
|
|
461
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `${prefixCls}card-header__content`, children: [
|
|
462
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${prefixCls}card-header__title`, children: title }),
|
|
463
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${prefixCls}card-header__subtitle`, children: subtitle })
|
|
464
|
+
] }),
|
|
465
|
+
endContent && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${prefixCls}card-header__end-content`, children: endContent })
|
|
466
|
+
] }));
|
|
467
|
+
}
|
|
468
|
+
);
|
|
469
|
+
var CardHeader_default = CardHeader;
|
|
470
|
+
|
|
471
|
+
// src/components/Chip/Chip.tsx
|
|
472
|
+
var import_clsx7 = __toESM(require("clsx"));
|
|
473
|
+
var import_react11 = require("react");
|
|
474
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
475
|
+
var Chip = (0, import_react11.forwardRef)(
|
|
360
476
|
(_a, ref) => {
|
|
361
477
|
var _b = _a, { as: Component = "div", children, className, variant, color, size } = _b, rest = __objRest(_b, ["as", "children", "className", "variant", "color", "size"]);
|
|
362
|
-
return /* @__PURE__ */ (0,
|
|
478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
363
479
|
Component,
|
|
364
480
|
__spreadProps(__spreadValues({
|
|
365
481
|
ref,
|
|
366
|
-
className: (0,
|
|
482
|
+
className: (0, import_clsx7.default)(
|
|
367
483
|
`${PREFIX_CLS}chip`,
|
|
368
484
|
{
|
|
369
485
|
[`${PREFIX_CLS}chip--${variant}`]: variant,
|
|
@@ -374,8 +490,8 @@ var Chip = (0, import_react9.forwardRef)(
|
|
|
374
490
|
)
|
|
375
491
|
}, rest), {
|
|
376
492
|
children: [
|
|
377
|
-
/* @__PURE__ */ (0,
|
|
378
|
-
/* @__PURE__ */ (0,
|
|
493
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: (0, import_clsx7.default)(`${PREFIX_CLS}overlay`) }),
|
|
494
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: `${PREFIX_CLS}outline` }),
|
|
379
495
|
children
|
|
380
496
|
]
|
|
381
497
|
})
|
|
@@ -385,13 +501,13 @@ var Chip = (0, import_react9.forwardRef)(
|
|
|
385
501
|
var Chip_default = Chip;
|
|
386
502
|
|
|
387
503
|
// src/components/Collapse/Collapse.tsx
|
|
388
|
-
var
|
|
504
|
+
var import_react13 = require("react");
|
|
389
505
|
|
|
390
506
|
// src/components/Collapse/CollapseContext.tsx
|
|
391
|
-
var
|
|
392
|
-
var CollapseContext = (0,
|
|
507
|
+
var import_react12 = require("react");
|
|
508
|
+
var CollapseContext = (0, import_react12.createContext)(null);
|
|
393
509
|
var useCollapse = () => {
|
|
394
|
-
const context = (0,
|
|
510
|
+
const context = (0, import_react12.useContext)(CollapseContext);
|
|
395
511
|
if (!context) {
|
|
396
512
|
throw new Error("`useCollapse` must be used within a `<Collapse />`");
|
|
397
513
|
}
|
|
@@ -400,12 +516,12 @@ var useCollapse = () => {
|
|
|
400
516
|
var CollapseContext_default = CollapseContext;
|
|
401
517
|
|
|
402
518
|
// src/components/Collapse/Collapse.tsx
|
|
403
|
-
var
|
|
519
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
404
520
|
var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
405
|
-
const collapseRef = (0,
|
|
406
|
-
const [selfIsOpen, setSelfIsOpen] = (0,
|
|
407
|
-
const [heightAuto, setHeightAuto] = (0,
|
|
408
|
-
const [trigger, content] =
|
|
521
|
+
const collapseRef = (0, import_react13.useRef)(null);
|
|
522
|
+
const [selfIsOpen, setSelfIsOpen] = (0, import_react13.useState)(isOpen != null ? isOpen : false);
|
|
523
|
+
const [heightAuto, setHeightAuto] = (0, import_react13.useState)(false);
|
|
524
|
+
const [trigger, content] = import_react13.Children.toArray(children);
|
|
409
525
|
const handleOpen = () => {
|
|
410
526
|
setSelfIsOpen(true);
|
|
411
527
|
onOpen == null ? void 0 : onOpen();
|
|
@@ -418,7 +534,7 @@ var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
|
418
534
|
setSelfIsOpen((prevState) => !prevState);
|
|
419
535
|
onToggle == null ? void 0 : onToggle();
|
|
420
536
|
};
|
|
421
|
-
(0,
|
|
537
|
+
(0, import_react13.useEffect)(() => {
|
|
422
538
|
if (isOpen !== void 0) {
|
|
423
539
|
setSelfIsOpen(isOpen);
|
|
424
540
|
}
|
|
@@ -430,7 +546,7 @@ var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
|
430
546
|
}
|
|
431
547
|
}, 100);
|
|
432
548
|
}, [isOpen]);
|
|
433
|
-
return /* @__PURE__ */ (0,
|
|
549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
434
550
|
CollapseContext_default.Provider,
|
|
435
551
|
{
|
|
436
552
|
value: {
|
|
@@ -451,13 +567,13 @@ var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
|
451
567
|
var Collapse_default = Collapse;
|
|
452
568
|
|
|
453
569
|
// src/components/Collapse/CollapseContent.tsx
|
|
454
|
-
var
|
|
455
|
-
var
|
|
456
|
-
var CollapseContent = (0,
|
|
570
|
+
var import_clsx8 = __toESM(require("clsx"));
|
|
571
|
+
var import_react14 = require("react");
|
|
572
|
+
var CollapseContent = (0, import_react14.forwardRef)(({ children }, ref) => {
|
|
457
573
|
var _a, _b;
|
|
458
574
|
const { collapseRef, isOpen, heightAuto } = useCollapse();
|
|
459
|
-
const child =
|
|
460
|
-
return (0,
|
|
575
|
+
const child = import_react14.Children.only(children);
|
|
576
|
+
return (0, import_react14.cloneElement)(child, __spreadProps(__spreadValues({}, child.props), {
|
|
461
577
|
ref: (node) => {
|
|
462
578
|
collapseRef.current = node;
|
|
463
579
|
if (ref !== null) {
|
|
@@ -467,46 +583,46 @@ var CollapseContent = (0, import_react12.forwardRef)(({ children }, ref) => {
|
|
|
467
583
|
style: __spreadProps(__spreadValues({}, child.props.style), {
|
|
468
584
|
height: isOpen && heightAuto ? "auto" : isOpen ? (_a = collapseRef.current) == null ? void 0 : _a.scrollHeight : !isOpen && heightAuto ? (_b = collapseRef.current) == null ? void 0 : _b.scrollHeight : 0
|
|
469
585
|
}),
|
|
470
|
-
className: (0,
|
|
586
|
+
className: (0, import_clsx8.default)(`${PREFIX_CLS}collapse`, child.props.className)
|
|
471
587
|
}));
|
|
472
588
|
});
|
|
473
589
|
var CollapseContent_default = CollapseContent;
|
|
474
590
|
|
|
475
591
|
// src/components/Collapse/CollapseTrigger.tsx
|
|
476
|
-
var
|
|
477
|
-
var CollapseTrigger = (0,
|
|
592
|
+
var import_react15 = require("react");
|
|
593
|
+
var CollapseTrigger = (0, import_react15.forwardRef)(({ children }, ref) => {
|
|
478
594
|
const { collapseRef, onToggle } = useCollapse();
|
|
479
|
-
const child =
|
|
480
|
-
|
|
595
|
+
const child = import_react15.Children.only(children);
|
|
596
|
+
const _a = child.props, { onClick } = _a, rest = __objRest(_a, ["onClick"]);
|
|
597
|
+
return (0, import_react15.cloneElement)(child, __spreadValues({
|
|
481
598
|
ref,
|
|
482
599
|
onClick: (event) => {
|
|
483
|
-
var _a, _b;
|
|
484
600
|
if (!collapseRef.current) {
|
|
485
601
|
return;
|
|
486
602
|
}
|
|
487
603
|
onToggle();
|
|
488
|
-
|
|
604
|
+
onClick == null ? void 0 : onClick(event);
|
|
489
605
|
}
|
|
490
|
-
},
|
|
606
|
+
}, rest));
|
|
491
607
|
});
|
|
492
608
|
var CollapseTrigger_default = CollapseTrigger;
|
|
493
609
|
|
|
494
610
|
// src/components/Drawer/Drawer.tsx
|
|
495
|
-
var
|
|
496
|
-
var
|
|
611
|
+
var import_clsx9 = __toESM(require("clsx"));
|
|
612
|
+
var import_react16 = require("react");
|
|
497
613
|
var import_react_merge_refs2 = require("react-merge-refs");
|
|
498
|
-
var
|
|
499
|
-
var Drawer = (0,
|
|
614
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
615
|
+
var Drawer = (0, import_react16.forwardRef)((props, ref) => {
|
|
500
616
|
const { children, className, isOpen, size = "md", position = "left", onClose } = props;
|
|
501
|
-
const nodeRef = (0,
|
|
617
|
+
const nodeRef = (0, import_react16.useRef)(null);
|
|
502
618
|
const handleClose = () => {
|
|
503
619
|
onClose();
|
|
504
620
|
};
|
|
505
|
-
return /* @__PURE__ */ (0,
|
|
621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Backdrop_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Transition_default, { nodeRef, isOpen, name: `${PREFIX_CLS}drawer`, enter: 600, leave: 300, unmountOnExit: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
506
622
|
"div",
|
|
507
623
|
{
|
|
508
624
|
ref: (0, import_react_merge_refs2.mergeRefs)([ref, nodeRef]),
|
|
509
|
-
className: (0,
|
|
625
|
+
className: (0, import_clsx9.default)(
|
|
510
626
|
`${PREFIX_CLS}drawer`,
|
|
511
627
|
{
|
|
512
628
|
[`${PREFIX_CLS}drawer--${size}`]: size,
|
|
@@ -515,7 +631,7 @@ var Drawer = (0, import_react14.forwardRef)((props, ref) => {
|
|
|
515
631
|
className
|
|
516
632
|
),
|
|
517
633
|
children: [
|
|
518
|
-
/* @__PURE__ */ (0,
|
|
634
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `${PREFIX_CLS}drawer__overlay` }),
|
|
519
635
|
children
|
|
520
636
|
]
|
|
521
637
|
}
|
|
@@ -524,14 +640,14 @@ var Drawer = (0, import_react14.forwardRef)((props, ref) => {
|
|
|
524
640
|
var Drawer_default = Drawer;
|
|
525
641
|
|
|
526
642
|
// src/components/Menu/Menu.tsx
|
|
527
|
-
var
|
|
528
|
-
var
|
|
643
|
+
var import_clsx13 = __toESM(require("clsx"));
|
|
644
|
+
var import_react22 = require("react");
|
|
529
645
|
|
|
530
646
|
// src/components/Menu/MenuContext.tsx
|
|
531
|
-
var
|
|
532
|
-
var MenuContext = (0,
|
|
647
|
+
var import_react17 = require("react");
|
|
648
|
+
var MenuContext = (0, import_react17.createContext)(null);
|
|
533
649
|
var useMenu = () => {
|
|
534
|
-
const context = (0,
|
|
650
|
+
const context = (0, import_react17.useContext)(MenuContext);
|
|
535
651
|
if (!context) {
|
|
536
652
|
throw new Error("`useMenu` must be used within a `<Menu />`");
|
|
537
653
|
}
|
|
@@ -540,18 +656,18 @@ var useMenu = () => {
|
|
|
540
656
|
var MenuContext_default = MenuContext;
|
|
541
657
|
|
|
542
658
|
// src/components/Menu/MenuGroup.tsx
|
|
543
|
-
var
|
|
544
|
-
var
|
|
659
|
+
var import_clsx12 = __toESM(require("clsx"));
|
|
660
|
+
var import_react21 = require("react");
|
|
545
661
|
|
|
546
662
|
// src/components/Menu/MenuItem.tsx
|
|
547
|
-
var
|
|
548
|
-
var
|
|
663
|
+
var import_clsx10 = __toESM(require("clsx"));
|
|
664
|
+
var import_react19 = require("react");
|
|
549
665
|
|
|
550
666
|
// src/components/Menu/MenuValueContext.tsx
|
|
551
|
-
var
|
|
552
|
-
var MenuValueContext = (0,
|
|
667
|
+
var import_react18 = require("react");
|
|
668
|
+
var MenuValueContext = (0, import_react18.createContext)([]);
|
|
553
669
|
var useMenuItemValue = () => {
|
|
554
|
-
const context = (0,
|
|
670
|
+
const context = (0, import_react18.useContext)(MenuValueContext);
|
|
555
671
|
if (!context) {
|
|
556
672
|
throw new Error("`useMenuValue` must be used within a `<MenuValueContext.Provider />`");
|
|
557
673
|
}
|
|
@@ -560,11 +676,11 @@ var useMenuItemValue = () => {
|
|
|
560
676
|
var MenuValueContext_default = MenuValueContext;
|
|
561
677
|
|
|
562
678
|
// src/components/Menu/MenuItem.tsx
|
|
563
|
-
var
|
|
564
|
-
var MenuItem = (0,
|
|
679
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
680
|
+
var MenuItem = (0, import_react19.forwardRef)((props, ref) => {
|
|
565
681
|
const _a = props, { as: Component = "div", className, style, value, title, icon, level = 1, disabled, onClick } = _a, rest = __objRest(_a, ["as", "className", "style", "value", "title", "icon", "level", "disabled", "onClick"]);
|
|
566
682
|
const { value: menuValue, originalValue, navMode, onChange, onOpen, onItemSelect } = useMenu();
|
|
567
|
-
const values = (0,
|
|
683
|
+
const values = (0, import_react19.useContext)(MenuValueContext_default);
|
|
568
684
|
const mergedValues = [...values, value];
|
|
569
685
|
const handleClick = (event) => {
|
|
570
686
|
if (value !== void 0) {
|
|
@@ -573,17 +689,17 @@ var MenuItem = (0, import_react17.forwardRef)((props, ref) => {
|
|
|
573
689
|
onClick == null ? void 0 : onClick(event);
|
|
574
690
|
onItemSelect == null ? void 0 : onItemSelect(props);
|
|
575
691
|
};
|
|
576
|
-
(0,
|
|
692
|
+
(0, import_react19.useEffect)(() => {
|
|
577
693
|
if (navMode === "automatic" && originalValue.length > 0 && originalValue[originalValue.length - 1] === value) {
|
|
578
694
|
onOpen(values);
|
|
579
695
|
onChange(mergedValues);
|
|
580
696
|
}
|
|
581
697
|
}, [value, originalValue, navMode]);
|
|
582
|
-
return /* @__PURE__ */ (0,
|
|
698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
583
699
|
Component,
|
|
584
700
|
__spreadProps(__spreadValues({
|
|
585
701
|
ref,
|
|
586
|
-
className: (0,
|
|
702
|
+
className: (0, import_clsx10.default)(
|
|
587
703
|
`${PREFIX_CLS}menu-item`,
|
|
588
704
|
{
|
|
589
705
|
[`${PREFIX_CLS}menu-item--selected`]: menuValue.includes(value),
|
|
@@ -597,9 +713,9 @@ var MenuItem = (0, import_react17.forwardRef)((props, ref) => {
|
|
|
597
713
|
onClick: handleClick
|
|
598
714
|
}, rest), {
|
|
599
715
|
children: [
|
|
600
|
-
/* @__PURE__ */ (0,
|
|
601
|
-
icon && /* @__PURE__ */ (0,
|
|
602
|
-
/* @__PURE__ */ (0,
|
|
716
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `${PREFIX_CLS}overlay`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `${PREFIX_CLS}overlay__surface` }) }),
|
|
717
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `${PREFIX_CLS}menu-item__icon`, children: icon }),
|
|
718
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `${PREFIX_CLS}menu-item__content`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: `${PREFIX_CLS}menu-item__title`, children: title }) })
|
|
603
719
|
]
|
|
604
720
|
})
|
|
605
721
|
);
|
|
@@ -608,8 +724,8 @@ MenuItem.displayName = "MenuItem";
|
|
|
608
724
|
var MenuItem_default = MenuItem;
|
|
609
725
|
|
|
610
726
|
// src/components/Menu/MenuSubmenu.tsx
|
|
611
|
-
var
|
|
612
|
-
var
|
|
727
|
+
var import_clsx11 = __toESM(require("clsx"));
|
|
728
|
+
var import_react20 = require("react");
|
|
613
729
|
|
|
614
730
|
// src/components/Menu/utils.ts
|
|
615
731
|
var getOpenValuesByPathname = (pathname) => {
|
|
@@ -635,7 +751,7 @@ var addOrRemoveValueInArray = (array, value) => {
|
|
|
635
751
|
};
|
|
636
752
|
|
|
637
753
|
// src/components/Menu/MenuSubmenu.tsx
|
|
638
|
-
var
|
|
754
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
639
755
|
var MenuSubmenu = (_a) => {
|
|
640
756
|
var _b = _a, {
|
|
641
757
|
children,
|
|
@@ -659,13 +775,13 @@ var MenuSubmenu = (_a) => {
|
|
|
659
775
|
"onClick"
|
|
660
776
|
]);
|
|
661
777
|
const { value: menuValue, openValues, expandMode, onOpen } = useMenu();
|
|
662
|
-
const values = (0,
|
|
778
|
+
const values = (0, import_react20.useContext)(MenuValueContext_default);
|
|
663
779
|
const isOpen = openValues.includes(value);
|
|
664
780
|
const mergedValues = [...values, value];
|
|
665
|
-
const content = (0,
|
|
781
|
+
const content = (0, import_react20.useMemo)(() => {
|
|
666
782
|
return items == null ? void 0 : items.map((_a2, index) => {
|
|
667
783
|
var _b2 = _a2, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
668
|
-
return type === "item" ? /* @__PURE__ */ (0,
|
|
784
|
+
return type === "item" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MenuItem_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : type === "submenu" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MenuSubmenu, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : type === "group" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MenuGroup_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MenuItem_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index);
|
|
669
785
|
});
|
|
670
786
|
}, [items]);
|
|
671
787
|
const handleClick = (event) => {
|
|
@@ -683,11 +799,11 @@ var MenuSubmenu = (_a) => {
|
|
|
683
799
|
}
|
|
684
800
|
onClick == null ? void 0 : onClick(event);
|
|
685
801
|
};
|
|
686
|
-
return /* @__PURE__ */ (0,
|
|
687
|
-
/* @__PURE__ */ (0,
|
|
802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MenuValueContext_default.Provider, { value: mergedValues, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_clsx11.default)(`${PREFIX_CLS}menu-submenu`), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Collapse_default, { isOpen, children: [
|
|
803
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CollapseTrigger_default, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
688
804
|
"div",
|
|
689
805
|
__spreadProps(__spreadValues({
|
|
690
|
-
className: (0,
|
|
806
|
+
className: (0, import_clsx11.default)(
|
|
691
807
|
`${PREFIX_CLS}menu-item`,
|
|
692
808
|
{
|
|
693
809
|
[`${PREFIX_CLS}menu-item--selected`]: menuValue.includes(value) || items && mergedValues.includes(menuValue)
|
|
@@ -700,17 +816,17 @@ var MenuSubmenu = (_a) => {
|
|
|
700
816
|
onClick: handleClick
|
|
701
817
|
}, rest), {
|
|
702
818
|
children: [
|
|
703
|
-
/* @__PURE__ */ (0,
|
|
704
|
-
icon && /* @__PURE__ */ (0,
|
|
705
|
-
/* @__PURE__ */ (0,
|
|
706
|
-
/* @__PURE__ */ (0,
|
|
819
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `${PREFIX_CLS}overlay`, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `${PREFIX_CLS}overlay__surface` }) }),
|
|
820
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `${PREFIX_CLS}menu-item__icon`, children: icon }),
|
|
821
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `${PREFIX_CLS}menu-item__content`, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `${PREFIX_CLS}menu-item__title`, children: title }) }),
|
|
822
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `${PREFIX_CLS}menu-item__icon`, children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronUpIcon_default, { className: `${PREFIX_CLS}icon` }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronDownIcon_default, { className: `${PREFIX_CLS}icon` }) })
|
|
707
823
|
]
|
|
708
824
|
})
|
|
709
825
|
) }),
|
|
710
|
-
/* @__PURE__ */ (0,
|
|
826
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CollapseContent_default, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
711
827
|
"ul",
|
|
712
828
|
{
|
|
713
|
-
className: (0,
|
|
829
|
+
className: (0, import_clsx11.default)(`${PREFIX_CLS}menu`, {
|
|
714
830
|
[`${PREFIX_CLS}menu-open`]: !isOpen
|
|
715
831
|
}),
|
|
716
832
|
children: content || children
|
|
@@ -721,7 +837,7 @@ var MenuSubmenu = (_a) => {
|
|
|
721
837
|
var MenuSubmenu_default = MenuSubmenu;
|
|
722
838
|
|
|
723
839
|
// src/components/Menu/MenuGroup.tsx
|
|
724
|
-
var
|
|
840
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
725
841
|
var MenuGroup = (_a) => {
|
|
726
842
|
var _b = _a, {
|
|
727
843
|
children,
|
|
@@ -740,24 +856,24 @@ var MenuGroup = (_a) => {
|
|
|
740
856
|
"level",
|
|
741
857
|
"items"
|
|
742
858
|
]);
|
|
743
|
-
const content = (0,
|
|
859
|
+
const content = (0, import_react21.useMemo)(() => {
|
|
744
860
|
return items == null ? void 0 : items.map((_a2, index) => {
|
|
745
861
|
var _b2 = _a2, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
746
|
-
return type === "item" ? /* @__PURE__ */ (0,
|
|
862
|
+
return type === "item" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MenuItem_default, __spreadValues({}, item), index) : type === "submenu" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MenuSubmenu_default, __spreadValues({}, item), index) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MenuItem_default, __spreadValues({}, item), index);
|
|
747
863
|
});
|
|
748
864
|
}, [items]);
|
|
749
|
-
return /* @__PURE__ */ (0,
|
|
750
|
-
/* @__PURE__ */ (0,
|
|
865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
866
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
751
867
|
"div",
|
|
752
868
|
__spreadProps(__spreadValues({
|
|
753
|
-
className: (0,
|
|
869
|
+
className: (0, import_clsx12.default)(`${PREFIX_CLS}menu-group`, className),
|
|
754
870
|
style: __spreadValues({
|
|
755
871
|
paddingLeft: level <= 1 ? `var(--${PREFIX_CLS}menu-group-padding-x)` : `calc(${level} * var(--${PREFIX_CLS}menu-group-padding-level))`
|
|
756
872
|
}, style)
|
|
757
873
|
}, rest), {
|
|
758
874
|
children: [
|
|
759
|
-
icon && /* @__PURE__ */ (0,
|
|
760
|
-
/* @__PURE__ */ (0,
|
|
875
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: `${PREFIX_CLS}menu-group__icon`, children: icon }),
|
|
876
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: `${PREFIX_CLS}menu-group__content`, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: `${PREFIX_CLS}menu-group__title`, children: title }) })
|
|
761
877
|
]
|
|
762
878
|
})
|
|
763
879
|
),
|
|
@@ -767,7 +883,7 @@ var MenuGroup = (_a) => {
|
|
|
767
883
|
var MenuGroup_default = MenuGroup;
|
|
768
884
|
|
|
769
885
|
// src/components/Menu/Menu.tsx
|
|
770
|
-
var
|
|
886
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
771
887
|
var Menu = (_a) => {
|
|
772
888
|
var _b = _a, {
|
|
773
889
|
children,
|
|
@@ -793,12 +909,12 @@ var Menu = (_a) => {
|
|
|
793
909
|
"onItemSelect"
|
|
794
910
|
]);
|
|
795
911
|
var _a2;
|
|
796
|
-
const [selfValue, setSelfValue] = (0,
|
|
797
|
-
const [selfOpenValues, setSelfOpenValues] = (0,
|
|
798
|
-
const content = (0,
|
|
912
|
+
const [selfValue, setSelfValue] = (0, import_react22.useState)((_a2 = valueProp != null ? valueProp : defaultValue) != null ? _a2 : []);
|
|
913
|
+
const [selfOpenValues, setSelfOpenValues] = (0, import_react22.useState)(openValuesProp != null ? openValuesProp : []);
|
|
914
|
+
const content = (0, import_react22.useMemo)(() => {
|
|
799
915
|
return items == null ? void 0 : items.map((_a3, index) => {
|
|
800
916
|
var _b2 = _a3, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
801
|
-
return type === "item" ? /* @__PURE__ */ (0,
|
|
917
|
+
return type === "item" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MenuItem_default, __spreadValues({}, item), index) : type === "submenu" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MenuSubmenu_default, __spreadValues({}, item), index) : type === "group" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MenuGroup_default, __spreadValues({}, item), index) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MenuItem_default, __spreadValues({}, item), index);
|
|
802
918
|
});
|
|
803
919
|
}, [items]);
|
|
804
920
|
const handleChange = (value) => {
|
|
@@ -818,17 +934,17 @@ var Menu = (_a) => {
|
|
|
818
934
|
const handleItemSelect = (props) => {
|
|
819
935
|
onItemSelect == null ? void 0 : onItemSelect(props);
|
|
820
936
|
};
|
|
821
|
-
(0,
|
|
937
|
+
(0, import_react22.useEffect)(() => {
|
|
822
938
|
if (valueProp !== void 0 && navMode !== "automatic") {
|
|
823
939
|
setSelfValue(valueProp);
|
|
824
940
|
}
|
|
825
941
|
}, [valueProp]);
|
|
826
|
-
(0,
|
|
942
|
+
(0, import_react22.useEffect)(() => {
|
|
827
943
|
if (openValuesProp !== void 0) {
|
|
828
944
|
setSelfOpenValues(openValuesProp);
|
|
829
945
|
}
|
|
830
946
|
}, [openValuesProp]);
|
|
831
|
-
return /* @__PURE__ */ (0,
|
|
947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
832
948
|
MenuContext_default.Provider,
|
|
833
949
|
{
|
|
834
950
|
value: {
|
|
@@ -841,23 +957,241 @@ var Menu = (_a) => {
|
|
|
841
957
|
onChange: handleChange,
|
|
842
958
|
onItemSelect: handleItemSelect
|
|
843
959
|
},
|
|
844
|
-
children: /* @__PURE__ */ (0,
|
|
960
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", __spreadProps(__spreadValues({ className: (0, import_clsx13.default)(`${PREFIX_CLS}menu`) }, rest), { children: content || children }))
|
|
845
961
|
}
|
|
846
962
|
);
|
|
847
963
|
};
|
|
848
964
|
Menu.displayName = "Menu";
|
|
849
965
|
var Menu_default = Menu;
|
|
850
966
|
|
|
967
|
+
// src/components/Accordion/Accordion.tsx
|
|
968
|
+
var import_react23 = require("react");
|
|
969
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
970
|
+
var Accordion = (0, import_react23.forwardRef)((props, ref) => {
|
|
971
|
+
const _a = props, { children, className } = _a, rest = __objRest(_a, ["children", "className"]);
|
|
972
|
+
const prefixCls = PREFIX_CLS;
|
|
973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}accordion`, className) }, rest), { children }));
|
|
974
|
+
});
|
|
975
|
+
var Accordion_default = Accordion;
|
|
976
|
+
|
|
977
|
+
// src/components/Accordion/AccordionItem.tsx
|
|
978
|
+
var import_react30 = require("react");
|
|
979
|
+
|
|
980
|
+
// src/hooks/useLocalStorage.tsx
|
|
981
|
+
var import_react26 = require("react");
|
|
982
|
+
|
|
983
|
+
// src/hooks/useEventListener.tsx
|
|
984
|
+
var import_react25 = require("react");
|
|
985
|
+
|
|
986
|
+
// src/hooks/useIsomorphicLayoutEffect.tsx
|
|
987
|
+
var import_react24 = require("react");
|
|
988
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react24.useLayoutEffect : import_react24.useEffect;
|
|
989
|
+
var useIsomorphicLayoutEffect_default = useIsomorphicLayoutEffect;
|
|
990
|
+
|
|
991
|
+
// src/hooks/useEventListener.tsx
|
|
992
|
+
function useEventListener(handler) {
|
|
993
|
+
const savedHandler = (0, import_react25.useRef)(handler);
|
|
994
|
+
useIsomorphicLayoutEffect_default(() => {
|
|
995
|
+
savedHandler.current = handler;
|
|
996
|
+
}, [handler]);
|
|
997
|
+
}
|
|
998
|
+
var useEventListener_default = useEventListener;
|
|
999
|
+
|
|
1000
|
+
// src/hooks/useLocalStorage.tsx
|
|
1001
|
+
function useLocalStorage(key, initialValue) {
|
|
1002
|
+
const readValue = (0, import_react26.useCallback)(() => {
|
|
1003
|
+
if (typeof window === "undefined") {
|
|
1004
|
+
return initialValue;
|
|
1005
|
+
}
|
|
1006
|
+
try {
|
|
1007
|
+
const item = window.localStorage.getItem(key);
|
|
1008
|
+
return item ? parseJSON(item) : initialValue;
|
|
1009
|
+
} catch (error) {
|
|
1010
|
+
console.warn(`Error reading localStorage key \u201C${key}\u201D:`, error);
|
|
1011
|
+
return initialValue;
|
|
1012
|
+
}
|
|
1013
|
+
}, [initialValue, key]);
|
|
1014
|
+
const [storedValue, setStoredValue] = (0, import_react26.useState)(readValue);
|
|
1015
|
+
const setValue = (0, import_react26.useCallback)(
|
|
1016
|
+
(value) => {
|
|
1017
|
+
if (typeof window == "undefined") {
|
|
1018
|
+
console.warn(`Tried setting localStorage key \u201C${key}\u201D even though environment is not a client`);
|
|
1019
|
+
}
|
|
1020
|
+
try {
|
|
1021
|
+
const newValue = value instanceof Function ? value(storedValue) : value;
|
|
1022
|
+
window.localStorage.setItem(key, JSON.stringify(newValue));
|
|
1023
|
+
setStoredValue(newValue);
|
|
1024
|
+
window.dispatchEvent(new Event("local-storage"));
|
|
1025
|
+
} catch (error) {
|
|
1026
|
+
console.warn(`Error setting localStorage key \u201C${key}\u201D:`, error);
|
|
1027
|
+
}
|
|
1028
|
+
},
|
|
1029
|
+
[key, storedValue]
|
|
1030
|
+
);
|
|
1031
|
+
(0, import_react26.useEffect)(() => {
|
|
1032
|
+
setStoredValue(readValue());
|
|
1033
|
+
}, []);
|
|
1034
|
+
const handleStorageChange = (0, import_react26.useCallback)(() => {
|
|
1035
|
+
setStoredValue(readValue());
|
|
1036
|
+
}, [readValue]);
|
|
1037
|
+
useEventListener_default("storage", handleStorageChange);
|
|
1038
|
+
useEventListener_default("local-storage", handleStorageChange);
|
|
1039
|
+
return [storedValue, setValue];
|
|
1040
|
+
}
|
|
1041
|
+
function parseJSON(value) {
|
|
1042
|
+
try {
|
|
1043
|
+
return value === "undefined" ? void 0 : JSON.parse(value != null ? value : "");
|
|
1044
|
+
} catch (e) {
|
|
1045
|
+
return void 0;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
// src/hooks/usePrevious.tsx
|
|
1050
|
+
var import_react27 = require("react");
|
|
1051
|
+
var usePrevious = (value) => {
|
|
1052
|
+
const ref = (0, import_react27.useRef)();
|
|
1053
|
+
(0, import_react27.useEffect)(() => {
|
|
1054
|
+
ref.current = value;
|
|
1055
|
+
});
|
|
1056
|
+
return ref.current;
|
|
1057
|
+
};
|
|
1058
|
+
|
|
1059
|
+
// src/hooks/useDisclosure.ts
|
|
1060
|
+
var import_react28 = require("react");
|
|
1061
|
+
var useDisclosure = ({ defaultValue } = {}) => {
|
|
1062
|
+
const [isOpen, setIsOpen] = (0, import_react28.useState)(defaultValue || false);
|
|
1063
|
+
const onOpen = () => {
|
|
1064
|
+
setIsOpen(true);
|
|
1065
|
+
};
|
|
1066
|
+
const onClose = () => {
|
|
1067
|
+
setIsOpen(false);
|
|
1068
|
+
};
|
|
1069
|
+
const onToggle = () => {
|
|
1070
|
+
setIsOpen((prevState) => !prevState);
|
|
1071
|
+
};
|
|
1072
|
+
return {
|
|
1073
|
+
isOpen,
|
|
1074
|
+
onOpen,
|
|
1075
|
+
onClose,
|
|
1076
|
+
onToggle
|
|
1077
|
+
};
|
|
1078
|
+
};
|
|
1079
|
+
var useDisclosure_default = useDisclosure;
|
|
1080
|
+
|
|
1081
|
+
// src/hooks/useStep.tsx
|
|
1082
|
+
var import_react29 = require("react");
|
|
1083
|
+
var useStep = (maxStep) => {
|
|
1084
|
+
const [currentStep, setCurrentStep] = (0, import_react29.useState)(1);
|
|
1085
|
+
const canGoToNextStep = (0, import_react29.useMemo)(() => currentStep + 1 <= maxStep, [currentStep, maxStep]);
|
|
1086
|
+
const canGoToPrevStep = (0, import_react29.useMemo)(() => currentStep - 1 >= 1, [currentStep]);
|
|
1087
|
+
const setStep = (0, import_react29.useCallback)(
|
|
1088
|
+
(step) => {
|
|
1089
|
+
const newStep = step instanceof Function ? step(currentStep) : step;
|
|
1090
|
+
if (newStep >= 1 && newStep <= maxStep) {
|
|
1091
|
+
setCurrentStep(newStep);
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
throw new Error("Step not valid");
|
|
1095
|
+
},
|
|
1096
|
+
[maxStep, currentStep]
|
|
1097
|
+
);
|
|
1098
|
+
const goToNextStep = (0, import_react29.useCallback)(() => {
|
|
1099
|
+
if (canGoToNextStep) {
|
|
1100
|
+
setCurrentStep((step) => step + 1);
|
|
1101
|
+
}
|
|
1102
|
+
}, [canGoToNextStep]);
|
|
1103
|
+
const goToPrevStep = (0, import_react29.useCallback)(() => {
|
|
1104
|
+
if (canGoToPrevStep) {
|
|
1105
|
+
setCurrentStep((step) => step - 1);
|
|
1106
|
+
}
|
|
1107
|
+
}, [canGoToPrevStep]);
|
|
1108
|
+
const reset = (0, import_react29.useCallback)(() => {
|
|
1109
|
+
setCurrentStep(1);
|
|
1110
|
+
}, []);
|
|
1111
|
+
return [
|
|
1112
|
+
currentStep,
|
|
1113
|
+
{
|
|
1114
|
+
goToNextStep,
|
|
1115
|
+
goToPrevStep,
|
|
1116
|
+
canGoToNextStep,
|
|
1117
|
+
canGoToPrevStep,
|
|
1118
|
+
setStep,
|
|
1119
|
+
reset
|
|
1120
|
+
}
|
|
1121
|
+
];
|
|
1122
|
+
};
|
|
1123
|
+
|
|
1124
|
+
// src/components/Accordion/AccordionItem.tsx
|
|
1125
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1126
|
+
var AccordionItemContext = (0, import_react30.createContext)(null);
|
|
1127
|
+
var useAccordionItem = () => {
|
|
1128
|
+
const context = (0, import_react30.useContext)(AccordionItemContext);
|
|
1129
|
+
if (!context) {
|
|
1130
|
+
throw new Error("`useAccordionItem` must be used within a `<AccordionItem />`");
|
|
1131
|
+
}
|
|
1132
|
+
return context;
|
|
1133
|
+
};
|
|
1134
|
+
var AccordionItem = (0, import_react30.forwardRef)((props, ref) => {
|
|
1135
|
+
const _a = props, { children, className, value: valueProp } = _a, rest = __objRest(_a, ["children", "className", "value"]);
|
|
1136
|
+
const prefixCls = PREFIX_CLS;
|
|
1137
|
+
const { isOpen, onOpen, onClose, onToggle } = useDisclosure_default({ defaultValue: true });
|
|
1138
|
+
const id = (0, import_react30.useId)();
|
|
1139
|
+
const value = valueProp != null ? valueProp : id;
|
|
1140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AccordionItemContext.Provider, { value: { value }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}accordion-item`, className) }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Collapse_default, { isOpen, onOpen, onClose, onToggle, children }) })) });
|
|
1141
|
+
});
|
|
1142
|
+
var AccordionItem_default = AccordionItem;
|
|
1143
|
+
|
|
1144
|
+
// src/components/Accordion/AccordionHeader.tsx
|
|
1145
|
+
var import_react31 = require("react");
|
|
1146
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1147
|
+
var AccordionHeader = (0, import_react31.forwardRef)((props, ref) => {
|
|
1148
|
+
const _a = props, { className, title, subtitle, startContent, endContent } = _a, rest = __objRest(_a, ["className", "title", "subtitle", "startContent", "endContent"]);
|
|
1149
|
+
const prefixCls = PREFIX_CLS;
|
|
1150
|
+
const { isOpen } = useCollapse();
|
|
1151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CollapseTrigger_default, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}accordion-header`, className) }, rest), { children: [
|
|
1152
|
+
startContent && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: `${prefixCls}accordion-header__start-content`, children: startContent }),
|
|
1153
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: `${prefixCls}accordion-header__content`, children: [
|
|
1154
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: `${prefixCls}accordion-header__title`, children: title }),
|
|
1155
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: `${prefixCls}accordion-header__subtitle`, children: subtitle })
|
|
1156
|
+
] }),
|
|
1157
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: `${prefixCls}accordion-header__end-content`, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "us-d-flex us-items-center us-gap-1", children: [
|
|
1158
|
+
endContent,
|
|
1159
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { type: "button", variant: "text", color: "secondary", size: "sm", iconOnly: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon_default, { children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ChevronUpIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ChevronDownIcon_default, {}) }) })
|
|
1160
|
+
] }) })
|
|
1161
|
+
] })) });
|
|
1162
|
+
});
|
|
1163
|
+
var AccordionHeader_default = AccordionHeader;
|
|
1164
|
+
|
|
1165
|
+
// src/components/Accordion/AccordionPanel.tsx
|
|
1166
|
+
var import_react32 = require("react");
|
|
1167
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1168
|
+
var AccordionPanel = (0, import_react32.forwardRef)((_a, ref) => {
|
|
1169
|
+
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
1170
|
+
const prefixCls = PREFIX_CLS;
|
|
1171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CollapseContent_default, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", __spreadProps(__spreadValues({ className: clsx_default(`${prefixCls}accordion-panel`, className) }, rest), { children })) }) });
|
|
1172
|
+
});
|
|
1173
|
+
var AccordionPanel_default = AccordionPanel;
|
|
1174
|
+
|
|
1175
|
+
// src/components/Accordion/AccordionContent.tsx
|
|
1176
|
+
var import_react33 = require("react");
|
|
1177
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1178
|
+
var AccordionContent = (0, import_react33.forwardRef)((_a, ref) => {
|
|
1179
|
+
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
1180
|
+
const prefixCls = PREFIX_CLS;
|
|
1181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CollapseContent_default, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", __spreadProps(__spreadValues({ className: clsx_default(`${prefixCls}accordion-content`, className) }, rest), { children })) }) });
|
|
1182
|
+
});
|
|
1183
|
+
var AccordionContent_default = AccordionContent;
|
|
1184
|
+
|
|
851
1185
|
// src/components/Tabs/Tab.tsx
|
|
852
|
-
var
|
|
1186
|
+
var import_clsx15 = __toESM(require("clsx"));
|
|
853
1187
|
var import_merge_refs = __toESM(require("merge-refs"));
|
|
854
|
-
var
|
|
1188
|
+
var import_react37 = require("react");
|
|
855
1189
|
|
|
856
1190
|
// ../../../node_modules/react-icons/lib/esm/iconBase.js
|
|
857
|
-
var
|
|
1191
|
+
var import_react35 = __toESM(require("react"));
|
|
858
1192
|
|
|
859
1193
|
// ../../../node_modules/react-icons/lib/esm/iconContext.js
|
|
860
|
-
var
|
|
1194
|
+
var import_react34 = __toESM(require("react"));
|
|
861
1195
|
var DefaultContext = {
|
|
862
1196
|
color: void 0,
|
|
863
1197
|
size: void 0,
|
|
@@ -865,7 +1199,7 @@ var DefaultContext = {
|
|
|
865
1199
|
style: void 0,
|
|
866
1200
|
attr: void 0
|
|
867
1201
|
};
|
|
868
|
-
var IconContext =
|
|
1202
|
+
var IconContext = import_react34.default.createContext && import_react34.default.createContext(DefaultContext);
|
|
869
1203
|
|
|
870
1204
|
// ../../../node_modules/react-icons/lib/esm/iconBase.js
|
|
871
1205
|
var __assign = function() {
|
|
@@ -894,14 +1228,14 @@ var __rest = function(s, e) {
|
|
|
894
1228
|
};
|
|
895
1229
|
function Tree2Element(tree) {
|
|
896
1230
|
return tree && tree.map(function(node, i) {
|
|
897
|
-
return
|
|
1231
|
+
return import_react35.default.createElement(node.tag, __assign({
|
|
898
1232
|
key: i
|
|
899
1233
|
}, node.attr), Tree2Element(node.child));
|
|
900
1234
|
});
|
|
901
1235
|
}
|
|
902
1236
|
function GenIcon(data) {
|
|
903
1237
|
return function(props) {
|
|
904
|
-
return
|
|
1238
|
+
return import_react35.default.createElement(IconBase, __assign({
|
|
905
1239
|
attr: __assign({}, data.attr)
|
|
906
1240
|
}, props), Tree2Element(data.child));
|
|
907
1241
|
};
|
|
@@ -915,7 +1249,7 @@ function IconBase(props) {
|
|
|
915
1249
|
className = conf.className;
|
|
916
1250
|
if (props.className)
|
|
917
1251
|
className = (className ? className + " " : "") + props.className;
|
|
918
|
-
return
|
|
1252
|
+
return import_react35.default.createElement("svg", __assign({
|
|
919
1253
|
stroke: "currentColor",
|
|
920
1254
|
fill: "currentColor",
|
|
921
1255
|
strokeWidth: "0"
|
|
@@ -927,9 +1261,9 @@ function IconBase(props) {
|
|
|
927
1261
|
height: computedSize,
|
|
928
1262
|
width: computedSize,
|
|
929
1263
|
xmlns: "http://www.w3.org/2000/svg"
|
|
930
|
-
}), title &&
|
|
1264
|
+
}), title && import_react35.default.createElement("title", null, title), props.children);
|
|
931
1265
|
};
|
|
932
|
-
return IconContext !== void 0 ?
|
|
1266
|
+
return IconContext !== void 0 ? import_react35.default.createElement(IconContext.Consumer, null, function(conf) {
|
|
933
1267
|
return elem(conf);
|
|
934
1268
|
}) : elem(DefaultContext);
|
|
935
1269
|
}
|
|
@@ -940,10 +1274,10 @@ function TbX(props) {
|
|
|
940
1274
|
}
|
|
941
1275
|
|
|
942
1276
|
// src/components/Tabs/TabsContext.ts
|
|
943
|
-
var
|
|
944
|
-
var TabsContext = (0,
|
|
1277
|
+
var import_react36 = require("react");
|
|
1278
|
+
var TabsContext = (0, import_react36.createContext)(null);
|
|
945
1279
|
var useTabs = () => {
|
|
946
|
-
const context = (0,
|
|
1280
|
+
const context = (0, import_react36.useContext)(TabsContext);
|
|
947
1281
|
if (!context) {
|
|
948
1282
|
throw new Error("`useTabs` must be used within a `<Tabs />`");
|
|
949
1283
|
}
|
|
@@ -951,8 +1285,8 @@ var useTabs = () => {
|
|
|
951
1285
|
};
|
|
952
1286
|
|
|
953
1287
|
// src/components/Tabs/Tab.tsx
|
|
954
|
-
var
|
|
955
|
-
var Tab = (0,
|
|
1288
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1289
|
+
var Tab = (0, import_react37.forwardRef)(
|
|
956
1290
|
(_a, ref) => {
|
|
957
1291
|
var _b = _a, {
|
|
958
1292
|
as: Component = "div",
|
|
@@ -973,8 +1307,8 @@ var Tab = (0, import_react24.forwardRef)(
|
|
|
973
1307
|
"disabled",
|
|
974
1308
|
"onClick"
|
|
975
1309
|
]);
|
|
976
|
-
const tabRef = (0,
|
|
977
|
-
const id = (0,
|
|
1310
|
+
const tabRef = (0, import_react37.useRef)(null);
|
|
1311
|
+
const id = (0, import_react37.useId)();
|
|
978
1312
|
const value = valueProp != null ? valueProp : id;
|
|
979
1313
|
const _a2 = useTabs(), { onClose, registerItem } = _a2, tabs = __objRest(_a2, ["onClose", "registerItem"]);
|
|
980
1314
|
const handleClick = (event) => {
|
|
@@ -1015,17 +1349,17 @@ var Tab = (0, import_react24.forwardRef)(
|
|
|
1015
1349
|
event.stopPropagation();
|
|
1016
1350
|
onClose(value);
|
|
1017
1351
|
};
|
|
1018
|
-
(0,
|
|
1352
|
+
(0, import_react37.useEffect)(() => {
|
|
1019
1353
|
registerItem({ value, disabled });
|
|
1020
1354
|
if (value === tabs.value) {
|
|
1021
1355
|
tabs.previousTabRef.current = tabRef.current;
|
|
1022
1356
|
}
|
|
1023
1357
|
}, [value, tabs.value]);
|
|
1024
|
-
return /* @__PURE__ */ (0,
|
|
1358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1025
1359
|
Component,
|
|
1026
1360
|
__spreadProps(__spreadValues({
|
|
1027
1361
|
ref: (0, import_merge_refs.default)(tabRef, ref, (el) => tabs.tabRefs.current[value] = el),
|
|
1028
|
-
className: (0,
|
|
1362
|
+
className: (0, import_clsx15.default)(
|
|
1029
1363
|
`${PREFIX_CLS}tab`,
|
|
1030
1364
|
{ [`${PREFIX_CLS}tab--selected`]: value === tabs.value, [`${PREFIX_CLS}tab--disabled`]: disabled },
|
|
1031
1365
|
className
|
|
@@ -1034,12 +1368,12 @@ var Tab = (0, import_react24.forwardRef)(
|
|
|
1034
1368
|
onClick: handleClick
|
|
1035
1369
|
}, rest), {
|
|
1036
1370
|
children: [
|
|
1037
|
-
/* @__PURE__ */ (0,
|
|
1038
|
-
/* @__PURE__ */ (0,
|
|
1371
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `${PREFIX_CLS}overlay`, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `${PREFIX_CLS}overlay__surface` }) }),
|
|
1372
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: `${PREFIX_CLS}tab__content`, children: [
|
|
1039
1373
|
children,
|
|
1040
|
-
closable && /* @__PURE__ */ (0,
|
|
1374
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { variant: "text", color: "secondary", iconOnly: true, size: "xs", onClick: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon_default, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TbX, {}) }) })
|
|
1041
1375
|
] }),
|
|
1042
|
-
/* @__PURE__ */ (0,
|
|
1376
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `${PREFIX_CLS}tab__indicator` })
|
|
1043
1377
|
]
|
|
1044
1378
|
})
|
|
1045
1379
|
);
|
|
@@ -1047,36 +1381,9 @@ var Tab = (0, import_react24.forwardRef)(
|
|
|
1047
1381
|
);
|
|
1048
1382
|
|
|
1049
1383
|
// src/components/Tabs/Tabs.tsx
|
|
1050
|
-
var
|
|
1051
|
-
var
|
|
1052
|
-
|
|
1053
|
-
// src/utils/scroll.ts
|
|
1054
|
-
var scrollToItem = (parentElement, currentElement) => {
|
|
1055
|
-
const parentRect = parentElement.getBoundingClientRect();
|
|
1056
|
-
const currentRect = currentElement.getBoundingClientRect();
|
|
1057
|
-
const behavior = "smooth";
|
|
1058
|
-
const previousElement = currentElement.previousSibling;
|
|
1059
|
-
const previousRect = (previousElement == null ? void 0 : previousElement.getBoundingClientRect()) || currentRect;
|
|
1060
|
-
if (parentRect.left > previousRect.left) {
|
|
1061
|
-
let offset = 0;
|
|
1062
|
-
if (previousElement) {
|
|
1063
|
-
offset = previousRect.left - parentRect.left + parentElement.scrollLeft + previousRect.width / 4;
|
|
1064
|
-
}
|
|
1065
|
-
parentElement.scrollTo({ behavior, left: offset });
|
|
1066
|
-
}
|
|
1067
|
-
const nextElement = currentElement.nextSibling;
|
|
1068
|
-
const nextRect = (nextElement == null ? void 0 : nextElement.getBoundingClientRect()) || currentRect;
|
|
1069
|
-
if (parentRect.right < nextRect.right) {
|
|
1070
|
-
let offset = parentElement.scrollWidth;
|
|
1071
|
-
if (nextElement) {
|
|
1072
|
-
offset = nextRect.right - parentRect.right + parentElement.scrollLeft - nextRect.width / 4;
|
|
1073
|
-
}
|
|
1074
|
-
parentElement.scrollTo({ behavior, left: offset });
|
|
1075
|
-
}
|
|
1076
|
-
};
|
|
1077
|
-
|
|
1078
|
-
// src/components/Tabs/Tabs.tsx
|
|
1079
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1384
|
+
var import_clsx16 = __toESM(require("clsx"));
|
|
1385
|
+
var import_react38 = require("react");
|
|
1386
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1080
1387
|
var Tabs = (_a) => {
|
|
1081
1388
|
var _b = _a, {
|
|
1082
1389
|
children,
|
|
@@ -1095,11 +1402,11 @@ var Tabs = (_a) => {
|
|
|
1095
1402
|
"onChange",
|
|
1096
1403
|
"onClose"
|
|
1097
1404
|
]);
|
|
1098
|
-
const tabsRef = (0,
|
|
1099
|
-
const tabRefs = (0,
|
|
1100
|
-
const previousTabRef = (0,
|
|
1101
|
-
const [selfValue, setSelfValue] = (0,
|
|
1102
|
-
const [items, setItems] = (0,
|
|
1405
|
+
const tabsRef = (0, import_react38.useRef)(null);
|
|
1406
|
+
const tabRefs = (0, import_react38.useRef)({});
|
|
1407
|
+
const previousTabRef = (0, import_react38.useRef)(null);
|
|
1408
|
+
const [selfValue, setSelfValue] = (0, import_react38.useState)(value != null ? value : defaultValue);
|
|
1409
|
+
const [items, setItems] = (0, import_react38.useState)([]);
|
|
1103
1410
|
const registerItem = (item) => {
|
|
1104
1411
|
setItems((prevItems) => {
|
|
1105
1412
|
const index = prevItems.findIndex((item2) => item2.value);
|
|
@@ -1126,62 +1433,79 @@ var Tabs = (_a) => {
|
|
|
1126
1433
|
const handleClose = (value2) => {
|
|
1127
1434
|
onClose == null ? void 0 : onClose(value2);
|
|
1128
1435
|
};
|
|
1129
|
-
(0,
|
|
1436
|
+
(0, import_react38.useEffect)(() => {
|
|
1130
1437
|
if (value !== void 0) {
|
|
1131
1438
|
setSelfValue(value);
|
|
1132
1439
|
scrollToTab(value);
|
|
1133
1440
|
}
|
|
1134
1441
|
}, [value]);
|
|
1135
|
-
(0,
|
|
1442
|
+
(0, import_react38.useEffect)(() => {
|
|
1136
1443
|
if (value === void 0) {
|
|
1137
1444
|
const item = items.find((tab) => !tab.disabled);
|
|
1138
1445
|
setSelfValue(item == null ? void 0 : item.value);
|
|
1139
1446
|
}
|
|
1140
1447
|
}, [value, items]);
|
|
1141
|
-
return /* @__PURE__ */ (0,
|
|
1448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1142
1449
|
TabsContext.Provider,
|
|
1143
1450
|
{
|
|
1144
1451
|
value: { previousTabRef, tabRefs, value: selfValue, onChange: handleChange, onClose: handleClose, registerItem },
|
|
1145
1452
|
children: [
|
|
1146
|
-
/* @__PURE__ */ (0,
|
|
1453
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1147
1454
|
"div",
|
|
1148
1455
|
__spreadProps(__spreadValues({
|
|
1149
1456
|
ref: tabsRef,
|
|
1150
|
-
className: (0,
|
|
1457
|
+
className: (0, import_clsx16.default)(`${PREFIX_CLS}tabs`, { [`${PREFIX_CLS}tabs--${alignment}`]: alignment }, className)
|
|
1151
1458
|
}, rest), {
|
|
1152
1459
|
children
|
|
1153
1460
|
})
|
|
1154
1461
|
),
|
|
1155
|
-
/* @__PURE__ */ (0,
|
|
1462
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: `${PREFIX_CLS}divider` })
|
|
1156
1463
|
]
|
|
1157
1464
|
}
|
|
1158
1465
|
);
|
|
1159
1466
|
};
|
|
1160
1467
|
|
|
1161
1468
|
// src/components/Toolbar/Toolbar.tsx
|
|
1162
|
-
var
|
|
1163
|
-
var
|
|
1469
|
+
var import_clsx17 = __toESM(require("clsx"));
|
|
1470
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1164
1471
|
var Toolbar = (props) => {
|
|
1165
1472
|
const _a = props, { children, className, size = "md", startAction, endAction, title, subtitle } = _a, rest = __objRest(_a, ["children", "className", "size", "startAction", "endAction", "title", "subtitle"]);
|
|
1166
|
-
return /* @__PURE__ */ (0,
|
|
1167
|
-
/* @__PURE__ */ (0,
|
|
1168
|
-
/* @__PURE__ */ (0,
|
|
1169
|
-
startAction && /* @__PURE__ */ (0,
|
|
1170
|
-
/* @__PURE__ */ (0,
|
|
1171
|
-
title && /* @__PURE__ */ (0,
|
|
1172
|
-
subtitle && /* @__PURE__ */ (0,
|
|
1473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", __spreadProps(__spreadValues({ className: (0, import_clsx17.default)(`${PREFIX_CLS}toolbar`, { [`${PREFIX_CLS}toolbar--${size}`]: size }, className) }, rest), { children: [
|
|
1474
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `${PREFIX_CLS}outline-b` }),
|
|
1475
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: (0, import_clsx17.default)(`${PREFIX_CLS}toolbar__container`), children: [
|
|
1476
|
+
startAction && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: (0, import_clsx17.default)(`${PREFIX_CLS}toolbar__start-action`), children: startAction }),
|
|
1477
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: (0, import_clsx17.default)(`${PREFIX_CLS}toolbar__content`), children: title || subtitle ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
1478
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: (0, import_clsx17.default)(`${PREFIX_CLS}toolbar__title`), children: title }),
|
|
1479
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: (0, import_clsx17.default)(`${PREFIX_CLS}toolbar__subtitle`), children: subtitle })
|
|
1173
1480
|
] }) : children }),
|
|
1174
|
-
endAction && /* @__PURE__ */ (0,
|
|
1481
|
+
endAction && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: (0, import_clsx17.default)(`${PREFIX_CLS}toolbar__trailing`), children: endAction })
|
|
1175
1482
|
] })
|
|
1176
1483
|
] }));
|
|
1177
1484
|
};
|
|
1178
1485
|
var Toolbar_default = Toolbar;
|
|
1179
1486
|
|
|
1487
|
+
// src/components/ScrollArea/ScrollArea.tsx
|
|
1488
|
+
var import_react39 = require("react");
|
|
1489
|
+
var ScrollArea = (0, import_react39.forwardRef)(({ children, direction = "vertical" }, ref) => {
|
|
1490
|
+
const child = import_react39.Children.only(children);
|
|
1491
|
+
const prefixCls = PREFIX_CLS;
|
|
1492
|
+
return (0, import_react39.cloneElement)(child, __spreadProps(__spreadValues({
|
|
1493
|
+
ref
|
|
1494
|
+
}, child.props), {
|
|
1495
|
+
className: clsx_default(
|
|
1496
|
+
`${prefixCls}scroll-area`,
|
|
1497
|
+
{ [`${prefixCls}scroll-area--${direction}`]: direction },
|
|
1498
|
+
child.props.className
|
|
1499
|
+
)
|
|
1500
|
+
}));
|
|
1501
|
+
});
|
|
1502
|
+
var ScrollArea_default = ScrollArea;
|
|
1503
|
+
|
|
1180
1504
|
// src/components/Select/SelectClient.tsx
|
|
1181
1505
|
var import_kendo_data_query = require("@progress/kendo-data-query");
|
|
1182
1506
|
var import_kendo_react_dropdowns = require("@progress/kendo-react-dropdowns");
|
|
1183
|
-
var
|
|
1184
|
-
var
|
|
1507
|
+
var import_react40 = require("react");
|
|
1508
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1185
1509
|
var SelectClient = ({
|
|
1186
1510
|
value: valueProp,
|
|
1187
1511
|
data: propData,
|
|
@@ -1197,8 +1521,8 @@ var SelectClient = ({
|
|
|
1197
1521
|
onChange,
|
|
1198
1522
|
onFilterChange
|
|
1199
1523
|
}) => {
|
|
1200
|
-
const [value, setValue] = (0,
|
|
1201
|
-
const [filter, setFilter] = (0,
|
|
1524
|
+
const [value, setValue] = (0, import_react40.useState)(valueProp);
|
|
1525
|
+
const [filter, setFilter] = (0, import_react40.useState)(filterProp);
|
|
1202
1526
|
const handleChange = (event) => {
|
|
1203
1527
|
const value2 = event.target.value || null;
|
|
1204
1528
|
if (valueProp !== void 0) {
|
|
@@ -1208,8 +1532,8 @@ var SelectClient = ({
|
|
|
1208
1532
|
}
|
|
1209
1533
|
};
|
|
1210
1534
|
const pageSize3 = virtual == null ? void 0 : virtual.pageSize;
|
|
1211
|
-
const filteredData = (0,
|
|
1212
|
-
const [state, setState] = (0,
|
|
1535
|
+
const filteredData = (0, import_react40.useRef)([]);
|
|
1536
|
+
const [state, setState] = (0, import_react40.useState)({
|
|
1213
1537
|
skip: 0,
|
|
1214
1538
|
total: propData.total,
|
|
1215
1539
|
subsetData: propData.items.slice(0, pageSize3)
|
|
@@ -1239,20 +1563,20 @@ var SelectClient = ({
|
|
|
1239
1563
|
setState(__spreadProps(__spreadValues({}, state), { subsetData: newSubsetData, skip }));
|
|
1240
1564
|
}
|
|
1241
1565
|
};
|
|
1242
|
-
(0,
|
|
1566
|
+
(0, import_react40.useEffect)(() => {
|
|
1243
1567
|
if (valueProp !== void 0) {
|
|
1244
1568
|
setValue(valueProp);
|
|
1245
1569
|
}
|
|
1246
1570
|
}, [valueProp]);
|
|
1247
|
-
(0,
|
|
1571
|
+
(0, import_react40.useEffect)(() => {
|
|
1248
1572
|
setFilter(filterProp);
|
|
1249
1573
|
}, [filterProp]);
|
|
1250
|
-
(0,
|
|
1574
|
+
(0, import_react40.useEffect)(() => {
|
|
1251
1575
|
if (pageSize3) {
|
|
1252
1576
|
filteredData.current = propData.items.slice();
|
|
1253
1577
|
}
|
|
1254
1578
|
}, [propData]);
|
|
1255
|
-
return /* @__PURE__ */ (0,
|
|
1579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1256
1580
|
import_kendo_react_dropdowns.ComboBox,
|
|
1257
1581
|
{
|
|
1258
1582
|
value,
|
|
@@ -1280,8 +1604,8 @@ var SelectClient_default = SelectClient;
|
|
|
1280
1604
|
|
|
1281
1605
|
// src/components/Select/SelectServer.tsx
|
|
1282
1606
|
var import_kendo_react_dropdowns2 = require("@progress/kendo-react-dropdowns");
|
|
1283
|
-
var
|
|
1284
|
-
var
|
|
1607
|
+
var import_react41 = require("react");
|
|
1608
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1285
1609
|
var textField = "ContactName";
|
|
1286
1610
|
var emptyItem = { [textField]: "loading ...", CustomerID: 0 };
|
|
1287
1611
|
var pageSize = 10;
|
|
@@ -1308,45 +1632,48 @@ var SelectServer = ({
|
|
|
1308
1632
|
renderItem
|
|
1309
1633
|
}) => {
|
|
1310
1634
|
var _a;
|
|
1311
|
-
const dataCaching = (0,
|
|
1312
|
-
const pendingRequest = (0,
|
|
1313
|
-
const requestStarted = (0,
|
|
1635
|
+
const dataCaching = (0, import_react41.useRef)([]);
|
|
1636
|
+
const pendingRequest = (0, import_react41.useRef)();
|
|
1637
|
+
const requestStarted = (0, import_react41.useRef)(false);
|
|
1314
1638
|
const emptyItem3 = { [keyField2]: 0, [textField3]: "loading ..." };
|
|
1315
|
-
const [loadingData3, setLoadingData] = (0,
|
|
1316
|
-
const [data, setData] = (0,
|
|
1317
|
-
const [total, setTotal] = (0,
|
|
1318
|
-
const [value, setValue] = (0,
|
|
1319
|
-
const [filter, setFilter] = (0,
|
|
1639
|
+
const [loadingData3, setLoadingData] = (0, import_react41.useState)([]);
|
|
1640
|
+
const [data, setData] = (0, import_react41.useState)(dataProp.items);
|
|
1641
|
+
const [total, setTotal] = (0, import_react41.useState)(0);
|
|
1642
|
+
const [value, setValue] = (0, import_react41.useState)(valueProp);
|
|
1643
|
+
const [filter, setFilter] = (0, import_react41.useState)(filterProp);
|
|
1320
1644
|
const pageSize3 = (_a = virtual == null ? void 0 : virtual.pageSize) != null ? _a : 10;
|
|
1321
|
-
const skipRef = (0,
|
|
1645
|
+
const skipRef = (0, import_react41.useRef)(0);
|
|
1322
1646
|
const resetCach = () => {
|
|
1323
1647
|
dataCaching.current.length = 0;
|
|
1324
1648
|
};
|
|
1325
|
-
const requestData = (0,
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
requestStarted.current = true;
|
|
1335
|
-
getData(state).then(({ items, total: total2 }) => {
|
|
1336
|
-
items.forEach((item, index) => {
|
|
1337
|
-
dataCaching.current[index + skip] = item;
|
|
1338
|
-
});
|
|
1339
|
-
if (skip === skipRef.current) {
|
|
1340
|
-
setData(items);
|
|
1341
|
-
setTotal(total2);
|
|
1342
|
-
onDataChange == null ? void 0 : onDataChange({ items, total: total2 });
|
|
1649
|
+
const requestData = (0, import_react41.useCallback)(
|
|
1650
|
+
(state) => {
|
|
1651
|
+
const { skip } = state;
|
|
1652
|
+
if (requestStarted.current) {
|
|
1653
|
+
clearTimeout(pendingRequest.current);
|
|
1654
|
+
pendingRequest.current = setTimeout(() => {
|
|
1655
|
+
requestData(state);
|
|
1656
|
+
}, 50);
|
|
1657
|
+
return;
|
|
1343
1658
|
}
|
|
1344
|
-
requestStarted.current =
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1659
|
+
requestStarted.current = true;
|
|
1660
|
+
getData(state).then(({ items, total: total2 }) => {
|
|
1661
|
+
items.forEach((item, index) => {
|
|
1662
|
+
dataCaching.current[index + skip] = item;
|
|
1663
|
+
});
|
|
1664
|
+
if (skip === skipRef.current) {
|
|
1665
|
+
setData(items);
|
|
1666
|
+
setTotal(total2);
|
|
1667
|
+
onDataChange == null ? void 0 : onDataChange({ items, total: total2 });
|
|
1668
|
+
}
|
|
1669
|
+
requestStarted.current = false;
|
|
1670
|
+
}).catch(() => {
|
|
1671
|
+
requestStarted.current = false;
|
|
1672
|
+
});
|
|
1673
|
+
},
|
|
1674
|
+
[getData]
|
|
1675
|
+
);
|
|
1676
|
+
const handleFilterChange = (0, import_react41.useCallback)((event) => {
|
|
1350
1677
|
const filter2 = event.filter.value;
|
|
1351
1678
|
if (filterProp !== void 0) {
|
|
1352
1679
|
onFilterChange == null ? void 0 : onFilterChange(filter2);
|
|
@@ -1358,7 +1685,7 @@ var SelectServer = ({
|
|
|
1358
1685
|
setData(loadingData3);
|
|
1359
1686
|
skipRef.current = 0;
|
|
1360
1687
|
}, []);
|
|
1361
|
-
const shouldRequestData = (0,
|
|
1688
|
+
const shouldRequestData = (0, import_react41.useCallback)((skip) => {
|
|
1362
1689
|
for (let i = 0; i < pageSize3; i++) {
|
|
1363
1690
|
if (!dataCaching.current[skip + i]) {
|
|
1364
1691
|
return true;
|
|
@@ -1366,14 +1693,14 @@ var SelectServer = ({
|
|
|
1366
1693
|
}
|
|
1367
1694
|
return false;
|
|
1368
1695
|
}, []);
|
|
1369
|
-
const getCachedData = (0,
|
|
1696
|
+
const getCachedData = (0, import_react41.useCallback)((skip) => {
|
|
1370
1697
|
const data2 = [];
|
|
1371
1698
|
for (let i = 0; i < pageSize3; i++) {
|
|
1372
1699
|
data2.push(dataCaching.current[i + skip] || emptyItem3);
|
|
1373
1700
|
}
|
|
1374
1701
|
return data2;
|
|
1375
1702
|
}, []);
|
|
1376
|
-
const pageChange = (0,
|
|
1703
|
+
const pageChange = (0, import_react41.useCallback)(
|
|
1377
1704
|
(event) => {
|
|
1378
1705
|
if (filter !== void 0) {
|
|
1379
1706
|
const newSkip = event.page.skip;
|
|
@@ -1387,7 +1714,7 @@ var SelectServer = ({
|
|
|
1387
1714
|
},
|
|
1388
1715
|
[getCachedData, requestData, shouldRequestData, filter]
|
|
1389
1716
|
);
|
|
1390
|
-
const handleChange = (0,
|
|
1717
|
+
const handleChange = (0, import_react41.useCallback)((event) => {
|
|
1391
1718
|
const value2 = event.target.value;
|
|
1392
1719
|
if (value2 && value2[textField3] === emptyItem3[textField3]) {
|
|
1393
1720
|
return;
|
|
@@ -1401,10 +1728,10 @@ var SelectServer = ({
|
|
|
1401
1728
|
const handleItemRender = (li, itemProps) => {
|
|
1402
1729
|
const itemChildren = renderItem == null ? void 0 : renderItem(itemProps.dataItem);
|
|
1403
1730
|
if (!itemChildren)
|
|
1404
|
-
return (0,
|
|
1405
|
-
return (0,
|
|
1731
|
+
return (0, import_react41.cloneElement)(li, li.props);
|
|
1732
|
+
return (0, import_react41.cloneElement)(li, li.props, itemChildren);
|
|
1406
1733
|
};
|
|
1407
|
-
(0,
|
|
1734
|
+
(0, import_react41.useEffect)(() => {
|
|
1408
1735
|
const pageSize4 = 10;
|
|
1409
1736
|
const loadingData4 = [];
|
|
1410
1737
|
while (loadingData4.length < pageSize4) {
|
|
@@ -1412,26 +1739,26 @@ var SelectServer = ({
|
|
|
1412
1739
|
}
|
|
1413
1740
|
setLoadingData(loadingData4);
|
|
1414
1741
|
}, []);
|
|
1415
|
-
(0,
|
|
1742
|
+
(0, import_react41.useEffect)(() => {
|
|
1416
1743
|
if (valueProp !== void 0) {
|
|
1417
1744
|
setValue(valueProp);
|
|
1418
1745
|
}
|
|
1419
1746
|
}, [valueProp]);
|
|
1420
|
-
(0,
|
|
1747
|
+
(0, import_react41.useEffect)(() => {
|
|
1421
1748
|
if (filterProp !== void 0) {
|
|
1422
1749
|
setFilter(filterProp);
|
|
1423
1750
|
}
|
|
1424
1751
|
}, [filterProp]);
|
|
1425
|
-
(0,
|
|
1752
|
+
(0, import_react41.useEffect)(() => {
|
|
1426
1753
|
requestData({ skip: 0, filter });
|
|
1427
1754
|
return () => {
|
|
1428
1755
|
resetCach();
|
|
1429
1756
|
};
|
|
1430
1757
|
}, [filter, requestData]);
|
|
1431
|
-
(0,
|
|
1758
|
+
(0, import_react41.useEffect)(() => {
|
|
1432
1759
|
setData(dataProp.items);
|
|
1433
1760
|
}, [dataProp]);
|
|
1434
|
-
return /* @__PURE__ */ (0,
|
|
1761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1435
1762
|
import_kendo_react_dropdowns2.ComboBox,
|
|
1436
1763
|
{
|
|
1437
1764
|
data,
|
|
@@ -1458,17 +1785,66 @@ var SelectServer = ({
|
|
|
1458
1785
|
var SelectServer_default = SelectServer;
|
|
1459
1786
|
|
|
1460
1787
|
// src/components/Select/Select.tsx
|
|
1461
|
-
var
|
|
1788
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1462
1789
|
var Select = (props) => {
|
|
1463
|
-
return props.filterMode === "client" ? /* @__PURE__ */ (0,
|
|
1790
|
+
return props.filterMode === "client" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectClient_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectServer_default, __spreadValues({}, props));
|
|
1464
1791
|
};
|
|
1465
1792
|
var Select_default = Select;
|
|
1466
1793
|
|
|
1794
|
+
// src/components/Switch/Switch.tsx
|
|
1795
|
+
var import_clsx18 = __toESM(require("clsx"));
|
|
1796
|
+
var import_react42 = require("react");
|
|
1797
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1798
|
+
var Switch = (0, import_react42.forwardRef)(
|
|
1799
|
+
(_a, ref) => {
|
|
1800
|
+
var _b = _a, { name, value: valueProp, defaultValue, onChange: onChangeProp, disabled } = _b, rest = __objRest(_b, ["name", "value", "defaultValue", "onChange", "disabled"]);
|
|
1801
|
+
var _a2;
|
|
1802
|
+
const [selftValue, setSelfValue] = (0, import_react42.useState)((_a2 = valueProp != null ? valueProp : defaultValue) != null ? _a2 : false);
|
|
1803
|
+
const handleChange = () => {
|
|
1804
|
+
if (disabled) {
|
|
1805
|
+
return;
|
|
1806
|
+
}
|
|
1807
|
+
onChangeProp == null ? void 0 : onChangeProp(!selftValue);
|
|
1808
|
+
setSelfValue(!selftValue);
|
|
1809
|
+
};
|
|
1810
|
+
(0, import_react42.useEffect)(() => {
|
|
1811
|
+
if (valueProp !== void 0) {
|
|
1812
|
+
setSelfValue(valueProp);
|
|
1813
|
+
}
|
|
1814
|
+
}, [valueProp]);
|
|
1815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1816
|
+
"label",
|
|
1817
|
+
{
|
|
1818
|
+
htmlFor: name,
|
|
1819
|
+
className: (0, import_clsx18.default)(`${PREFIX_CLS}switch`, {
|
|
1820
|
+
[`${PREFIX_CLS}switch--checked`]: !!selftValue
|
|
1821
|
+
}),
|
|
1822
|
+
children: [
|
|
1823
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1824
|
+
"input",
|
|
1825
|
+
__spreadValues({
|
|
1826
|
+
type: "checkbox",
|
|
1827
|
+
ref,
|
|
1828
|
+
name,
|
|
1829
|
+
id: name,
|
|
1830
|
+
checked: selftValue,
|
|
1831
|
+
disabled,
|
|
1832
|
+
onChange: handleChange
|
|
1833
|
+
}, rest)
|
|
1834
|
+
),
|
|
1835
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: `${PREFIX_CLS}switch__thumb` })
|
|
1836
|
+
]
|
|
1837
|
+
}
|
|
1838
|
+
);
|
|
1839
|
+
}
|
|
1840
|
+
);
|
|
1841
|
+
var Switch_default = Switch;
|
|
1842
|
+
|
|
1467
1843
|
// src/components/MultiSelect/MultiSelectClient.tsx
|
|
1468
1844
|
var import_kendo_data_query2 = require("@progress/kendo-data-query");
|
|
1469
1845
|
var import_kendo_react_dropdowns3 = require("@progress/kendo-react-dropdowns");
|
|
1470
|
-
var
|
|
1471
|
-
var
|
|
1846
|
+
var import_react43 = require("react");
|
|
1847
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1472
1848
|
var textField2 = "text";
|
|
1473
1849
|
var keyField = "key";
|
|
1474
1850
|
var emptyItem2 = { [textField2]: "loading ...", [keyField]: 0 };
|
|
@@ -1492,14 +1868,14 @@ var SelectClient2 = ({
|
|
|
1492
1868
|
onChange,
|
|
1493
1869
|
onFilterChange
|
|
1494
1870
|
}) => {
|
|
1495
|
-
const [value, setValue] = (0,
|
|
1496
|
-
const [filter, setFilter] = (0,
|
|
1871
|
+
const [value, setValue] = (0, import_react43.useState)(valueProp);
|
|
1872
|
+
const [filter, setFilter] = (0, import_react43.useState)(filterProp);
|
|
1497
1873
|
const handleChange = (event) => {
|
|
1498
1874
|
onChange(event.target.value);
|
|
1499
1875
|
};
|
|
1500
1876
|
const pageSize3 = virtual == null ? void 0 : virtual.pageSize;
|
|
1501
|
-
const filteredData = (0,
|
|
1502
|
-
const [state, setState] = (0,
|
|
1877
|
+
const filteredData = (0, import_react43.useRef)([]);
|
|
1878
|
+
const [state, setState] = (0, import_react43.useState)({
|
|
1503
1879
|
skip: 0,
|
|
1504
1880
|
total: dataProp.total,
|
|
1505
1881
|
subsetData: dataProp.items.slice(0, pageSize3)
|
|
@@ -1524,18 +1900,18 @@ var SelectClient2 = ({
|
|
|
1524
1900
|
setState(__spreadProps(__spreadValues({}, state), { subsetData: newSubsetData, skip }));
|
|
1525
1901
|
}
|
|
1526
1902
|
};
|
|
1527
|
-
(0,
|
|
1903
|
+
(0, import_react43.useEffect)(() => {
|
|
1528
1904
|
setValue(valueProp);
|
|
1529
1905
|
}, [valueProp]);
|
|
1530
|
-
(0,
|
|
1906
|
+
(0, import_react43.useEffect)(() => {
|
|
1531
1907
|
setFilter(filterProp);
|
|
1532
1908
|
}, [filterProp]);
|
|
1533
|
-
(0,
|
|
1909
|
+
(0, import_react43.useEffect)(() => {
|
|
1534
1910
|
if (pageSize3) {
|
|
1535
1911
|
filteredData.current = dataProp.items.slice();
|
|
1536
1912
|
}
|
|
1537
1913
|
}, [dataProp]);
|
|
1538
|
-
return /* @__PURE__ */ (0,
|
|
1914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1539
1915
|
import_kendo_react_dropdowns3.MultiSelect,
|
|
1540
1916
|
{
|
|
1541
1917
|
value,
|
|
@@ -1563,8 +1939,8 @@ var MultiSelectClient_default = SelectClient2;
|
|
|
1563
1939
|
|
|
1564
1940
|
// src/components/MultiSelect/MultiSelectServer.tsx
|
|
1565
1941
|
var import_kendo_react_dropdowns4 = require("@progress/kendo-react-dropdowns");
|
|
1566
|
-
var
|
|
1567
|
-
var
|
|
1942
|
+
var import_react44 = require("react");
|
|
1943
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1568
1944
|
var MultiSelectServer = ({
|
|
1569
1945
|
data: dataProp,
|
|
1570
1946
|
value: valueProp,
|
|
@@ -1583,45 +1959,48 @@ var MultiSelectServer = ({
|
|
|
1583
1959
|
getData
|
|
1584
1960
|
}) => {
|
|
1585
1961
|
var _a;
|
|
1586
|
-
const dataCaching = (0,
|
|
1587
|
-
const pendingRequest = (0,
|
|
1588
|
-
const requestStarted = (0,
|
|
1962
|
+
const dataCaching = (0, import_react44.useRef)([]);
|
|
1963
|
+
const pendingRequest = (0, import_react44.useRef)();
|
|
1964
|
+
const requestStarted = (0, import_react44.useRef)(false);
|
|
1589
1965
|
const emptyItem3 = { [keyField2]: 0, [textField3]: "loading ..." };
|
|
1590
|
-
const [loadingData3, setLoadingData] = (0,
|
|
1591
|
-
const [data, setData] = (0,
|
|
1592
|
-
const [total, setTotal] = (0,
|
|
1593
|
-
const [value, setValue] = (0,
|
|
1594
|
-
const [filter, setFilter] = (0,
|
|
1966
|
+
const [loadingData3, setLoadingData] = (0, import_react44.useState)([]);
|
|
1967
|
+
const [data, setData] = (0, import_react44.useState)(dataProp.items);
|
|
1968
|
+
const [total, setTotal] = (0, import_react44.useState)(0);
|
|
1969
|
+
const [value, setValue] = (0, import_react44.useState)(valueProp);
|
|
1970
|
+
const [filter, setFilter] = (0, import_react44.useState)(filterProp);
|
|
1595
1971
|
const pageSize3 = (_a = virtual == null ? void 0 : virtual.pageSize) != null ? _a : 10;
|
|
1596
|
-
const skipRef = (0,
|
|
1972
|
+
const skipRef = (0, import_react44.useRef)(0);
|
|
1597
1973
|
const resetCach = () => {
|
|
1598
1974
|
dataCaching.current.length = 0;
|
|
1599
1975
|
};
|
|
1600
|
-
const requestData = (0,
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
requestStarted.current = true;
|
|
1609
|
-
getData(state).then(({ items, total: total2 }) => {
|
|
1610
|
-
const { skip } = state;
|
|
1611
|
-
items.forEach((item, index) => {
|
|
1612
|
-
dataCaching.current[index + skip] = item;
|
|
1613
|
-
});
|
|
1614
|
-
if (skip === skipRef.current) {
|
|
1615
|
-
setData(items);
|
|
1616
|
-
setTotal(total2);
|
|
1617
|
-
onDataChange == null ? void 0 : onDataChange({ items, total: total2 });
|
|
1976
|
+
const requestData = (0, import_react44.useCallback)(
|
|
1977
|
+
(state) => {
|
|
1978
|
+
if (requestStarted.current) {
|
|
1979
|
+
clearTimeout(pendingRequest.current);
|
|
1980
|
+
pendingRequest.current = setTimeout(() => {
|
|
1981
|
+
requestData(state);
|
|
1982
|
+
}, 50);
|
|
1983
|
+
return;
|
|
1618
1984
|
}
|
|
1619
|
-
requestStarted.current =
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1985
|
+
requestStarted.current = true;
|
|
1986
|
+
getData(state).then(({ items, total: total2 }) => {
|
|
1987
|
+
const { skip } = state;
|
|
1988
|
+
items.forEach((item, index) => {
|
|
1989
|
+
dataCaching.current[index + skip] = item;
|
|
1990
|
+
});
|
|
1991
|
+
if (skip === skipRef.current) {
|
|
1992
|
+
setData(items);
|
|
1993
|
+
setTotal(total2);
|
|
1994
|
+
onDataChange == null ? void 0 : onDataChange({ items, total: total2 });
|
|
1995
|
+
}
|
|
1996
|
+
requestStarted.current = false;
|
|
1997
|
+
}).catch(() => {
|
|
1998
|
+
requestStarted.current = false;
|
|
1999
|
+
});
|
|
2000
|
+
},
|
|
2001
|
+
[getData]
|
|
2002
|
+
);
|
|
2003
|
+
const handleFilterChange = (0, import_react44.useCallback)((event) => {
|
|
1625
2004
|
const filter2 = event.filter.value;
|
|
1626
2005
|
resetCach();
|
|
1627
2006
|
requestData({ skip: 0, filter: filter2 });
|
|
@@ -1630,7 +2009,7 @@ var MultiSelectServer = ({
|
|
|
1630
2009
|
setFilter(filter2);
|
|
1631
2010
|
onFilterChange == null ? void 0 : onFilterChange(filter2);
|
|
1632
2011
|
}, []);
|
|
1633
|
-
const shouldRequestData = (0,
|
|
2012
|
+
const shouldRequestData = (0, import_react44.useCallback)((skip) => {
|
|
1634
2013
|
for (let i = 0; i < pageSize3; i++) {
|
|
1635
2014
|
if (!dataCaching.current[skip + i]) {
|
|
1636
2015
|
return true;
|
|
@@ -1638,14 +2017,14 @@ var MultiSelectServer = ({
|
|
|
1638
2017
|
}
|
|
1639
2018
|
return false;
|
|
1640
2019
|
}, []);
|
|
1641
|
-
const getCachedData = (0,
|
|
2020
|
+
const getCachedData = (0, import_react44.useCallback)((skip) => {
|
|
1642
2021
|
const data2 = [];
|
|
1643
2022
|
for (let i = 0; i < pageSize3; i++) {
|
|
1644
2023
|
data2.push(dataCaching.current[i + skip] || emptyItem3);
|
|
1645
2024
|
}
|
|
1646
2025
|
return data2;
|
|
1647
2026
|
}, []);
|
|
1648
|
-
const pageChange = (0,
|
|
2027
|
+
const pageChange = (0, import_react44.useCallback)(
|
|
1649
2028
|
(event) => {
|
|
1650
2029
|
const newSkip = event.page.skip;
|
|
1651
2030
|
if (shouldRequestData(newSkip)) {
|
|
@@ -1657,7 +2036,7 @@ var MultiSelectServer = ({
|
|
|
1657
2036
|
},
|
|
1658
2037
|
[getCachedData, requestData, shouldRequestData, filter]
|
|
1659
2038
|
);
|
|
1660
|
-
const handleChange = (0,
|
|
2039
|
+
const handleChange = (0, import_react44.useCallback)((event) => {
|
|
1661
2040
|
const value2 = event.target.value;
|
|
1662
2041
|
if (value2 && value2[textField3] === emptyItem3[textField3]) {
|
|
1663
2042
|
return;
|
|
@@ -1665,7 +2044,7 @@ var MultiSelectServer = ({
|
|
|
1665
2044
|
setValue(value2);
|
|
1666
2045
|
onChange(value2);
|
|
1667
2046
|
}, []);
|
|
1668
|
-
(0,
|
|
2047
|
+
(0, import_react44.useEffect)(() => {
|
|
1669
2048
|
const pageSize4 = 10;
|
|
1670
2049
|
const loadingData4 = [];
|
|
1671
2050
|
while (loadingData4.length < pageSize4) {
|
|
@@ -1673,22 +2052,22 @@ var MultiSelectServer = ({
|
|
|
1673
2052
|
}
|
|
1674
2053
|
setLoadingData(loadingData4);
|
|
1675
2054
|
}, []);
|
|
1676
|
-
(0,
|
|
2055
|
+
(0, import_react44.useEffect)(() => {
|
|
1677
2056
|
setData(dataProp.items);
|
|
1678
2057
|
}, [dataProp]);
|
|
1679
|
-
(0,
|
|
2058
|
+
(0, import_react44.useEffect)(() => {
|
|
1680
2059
|
setValue(valueProp);
|
|
1681
2060
|
}, [valueProp]);
|
|
1682
|
-
(0,
|
|
2061
|
+
(0, import_react44.useEffect)(() => {
|
|
1683
2062
|
setFilter(filterProp);
|
|
1684
2063
|
}, [filterProp]);
|
|
1685
|
-
(0,
|
|
2064
|
+
(0, import_react44.useEffect)(() => {
|
|
1686
2065
|
requestData({ skip: 0, filter });
|
|
1687
2066
|
return () => {
|
|
1688
2067
|
resetCach();
|
|
1689
2068
|
};
|
|
1690
2069
|
}, [filter, requestData]);
|
|
1691
|
-
return /* @__PURE__ */ (0,
|
|
2070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1692
2071
|
import_kendo_react_dropdowns4.MultiSelect,
|
|
1693
2072
|
{
|
|
1694
2073
|
data,
|
|
@@ -1714,145 +2093,171 @@ var MultiSelectServer = ({
|
|
|
1714
2093
|
var MultiSelectServer_default = MultiSelectServer;
|
|
1715
2094
|
|
|
1716
2095
|
// src/components/MultiSelect/MultiSelect.tsx
|
|
1717
|
-
var
|
|
2096
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1718
2097
|
var MultiSelect3 = (props) => {
|
|
1719
|
-
return props.filterMode === "client" ? /* @__PURE__ */ (0,
|
|
2098
|
+
return props.filterMode === "client" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MultiSelectClient_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MultiSelectServer_default, __spreadValues({}, props));
|
|
1720
2099
|
};
|
|
1721
2100
|
var MultiSelect_default = MultiSelect3;
|
|
1722
2101
|
|
|
1723
|
-
// src/
|
|
1724
|
-
var
|
|
2102
|
+
// src/components/Field/Field.tsx
|
|
2103
|
+
var import_react45 = require("react");
|
|
2104
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2105
|
+
var Field = (0, import_react45.forwardRef)(({ children, label }, ref) => {
|
|
2106
|
+
{
|
|
2107
|
+
const prefixCls = PREFIX_CLS;
|
|
2108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { ref, className: clsx_default(`${prefixCls}field`), children: [
|
|
2109
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `${prefixCls}field__label`, children: label }),
|
|
2110
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `${prefixCls}field__content`, children })
|
|
2111
|
+
] });
|
|
2112
|
+
}
|
|
2113
|
+
});
|
|
2114
|
+
var Field_default = Field;
|
|
1725
2115
|
|
|
1726
|
-
// src/
|
|
1727
|
-
var
|
|
2116
|
+
// src/components/List/List.tsx
|
|
2117
|
+
var import_react46 = require("react");
|
|
2118
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2119
|
+
var List = (0, import_react46.forwardRef)((_a, ref) => {
|
|
2120
|
+
var _b = _a, { as: Component = "div", children } = _b, rest = __objRest(_b, ["as", "children"]);
|
|
2121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Component, __spreadProps(__spreadValues({ ref, className: "us-list" }, rest), { children }));
|
|
2122
|
+
});
|
|
2123
|
+
var List_default = List;
|
|
1728
2124
|
|
|
1729
|
-
// src/
|
|
1730
|
-
var
|
|
1731
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react30.useLayoutEffect : import_react30.useEffect;
|
|
1732
|
-
var useIsomorphicLayoutEffect_default = useIsomorphicLayoutEffect;
|
|
2125
|
+
// src/components/List/ListGroup.tsx
|
|
2126
|
+
var import_react48 = require("react");
|
|
1733
2127
|
|
|
1734
|
-
// src/
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
}
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
2128
|
+
// src/components/List/ListItem.tsx
|
|
2129
|
+
var import_react47 = require("react");
|
|
2130
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2131
|
+
var ListItem = (0, import_react47.forwardRef)(
|
|
2132
|
+
(_a, ref) => {
|
|
2133
|
+
var _b = _a, {
|
|
2134
|
+
as: Component = "div",
|
|
2135
|
+
className,
|
|
2136
|
+
title,
|
|
2137
|
+
startContent,
|
|
2138
|
+
endContent,
|
|
2139
|
+
level = 1,
|
|
2140
|
+
hoverable,
|
|
2141
|
+
selected,
|
|
2142
|
+
disabled,
|
|
2143
|
+
style,
|
|
2144
|
+
onClick
|
|
2145
|
+
} = _b, rest = __objRest(_b, [
|
|
2146
|
+
"as",
|
|
2147
|
+
"className",
|
|
2148
|
+
"title",
|
|
2149
|
+
"startContent",
|
|
2150
|
+
"endContent",
|
|
2151
|
+
"level",
|
|
2152
|
+
"hoverable",
|
|
2153
|
+
"selected",
|
|
2154
|
+
"disabled",
|
|
2155
|
+
"style",
|
|
2156
|
+
"onClick"
|
|
2157
|
+
]);
|
|
2158
|
+
const prefixCls = PREFIX_CLS;
|
|
2159
|
+
const handleClick = (event) => {
|
|
2160
|
+
onClick == null ? void 0 : onClick(event);
|
|
2161
|
+
};
|
|
2162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2163
|
+
Component,
|
|
2164
|
+
__spreadProps(__spreadValues({
|
|
2165
|
+
ref,
|
|
2166
|
+
className: clsx_default(
|
|
2167
|
+
`${prefixCls}list-item`,
|
|
2168
|
+
{
|
|
2169
|
+
[`${prefixCls}list-item--selected`]: selected,
|
|
2170
|
+
[`${prefixCls}list-item--hoverable`]: hoverable,
|
|
2171
|
+
[`${prefixCls}list-item--disabled`]: disabled
|
|
2172
|
+
},
|
|
2173
|
+
className
|
|
2174
|
+
),
|
|
2175
|
+
style: __spreadValues({
|
|
2176
|
+
paddingLeft: level <= 1 ? `var(--${prefixCls}list-item-padding-x)` : `calc(${level} * var(--${prefixCls}list-item-padding-level))`
|
|
2177
|
+
}, style),
|
|
2178
|
+
onClick: handleClick
|
|
2179
|
+
}, rest), {
|
|
2180
|
+
children: [
|
|
2181
|
+
hoverable && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `${prefixCls}overlay` }),
|
|
2182
|
+
startContent && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `${prefixCls}list-item__start-content`, children: startContent }),
|
|
2183
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `${prefixCls}list-item__content`, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: `${prefixCls}list-item__title`, children: title }) }),
|
|
2184
|
+
endContent && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `${prefixCls}list-item__end-content`, children: endContent })
|
|
2185
|
+
]
|
|
2186
|
+
})
|
|
2187
|
+
);
|
|
1789
2188
|
}
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
// src/hooks/usePrevious.tsx
|
|
1793
|
-
var import_react33 = require("react");
|
|
1794
|
-
var usePrevious = (value) => {
|
|
1795
|
-
const ref = (0, import_react33.useRef)();
|
|
1796
|
-
(0, import_react33.useEffect)(() => {
|
|
1797
|
-
ref.current = value;
|
|
1798
|
-
});
|
|
1799
|
-
return ref.current;
|
|
1800
|
-
};
|
|
2189
|
+
);
|
|
2190
|
+
var ListItem_default = ListItem;
|
|
1801
2191
|
|
|
1802
|
-
// src/
|
|
1803
|
-
var
|
|
1804
|
-
var
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
},
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
}
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
}
|
|
2192
|
+
// src/components/List/ListGroup.tsx
|
|
2193
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2194
|
+
var ListGroup = (0, import_react48.forwardRef)(
|
|
2195
|
+
(_a, ref) => {
|
|
2196
|
+
var _b = _a, {
|
|
2197
|
+
children,
|
|
2198
|
+
startContent,
|
|
2199
|
+
endContent,
|
|
2200
|
+
expandVisible = true,
|
|
2201
|
+
expandPosition = "end",
|
|
2202
|
+
isOpen,
|
|
2203
|
+
onOpen,
|
|
2204
|
+
onClose,
|
|
2205
|
+
onToggle
|
|
2206
|
+
} = _b, rest = __objRest(_b, [
|
|
2207
|
+
"children",
|
|
2208
|
+
"startContent",
|
|
2209
|
+
"endContent",
|
|
2210
|
+
"expandVisible",
|
|
2211
|
+
"expandPosition",
|
|
2212
|
+
"isOpen",
|
|
2213
|
+
"onOpen",
|
|
2214
|
+
"onClose",
|
|
2215
|
+
"onToggle"
|
|
2216
|
+
]);
|
|
2217
|
+
const disclosure = isOpen !== void 0 ? { isOpen, onOpen, onClose, onToggle } : useDisclosure_default();
|
|
2218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "us-list-group", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Collapse_default, __spreadProps(__spreadValues({}, disclosure), { children: [
|
|
2219
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CollapseTrigger_default, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2220
|
+
ListItem_default,
|
|
2221
|
+
__spreadValues({
|
|
2222
|
+
ref,
|
|
2223
|
+
startContent: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
2224
|
+
expandVisible && expandPosition === "start" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Icon_default, { children: disclosure.isOpen ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronUpIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronDownIcon_default, {}) }),
|
|
2225
|
+
startContent
|
|
2226
|
+
] }),
|
|
2227
|
+
endContent: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
2228
|
+
endContent,
|
|
2229
|
+
expandVisible && expandPosition === "end" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Icon_default, { children: disclosure.isOpen ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronUpIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronDownIcon_default, {}) })
|
|
2230
|
+
] })
|
|
2231
|
+
}, rest)
|
|
2232
|
+
) }),
|
|
2233
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CollapseContent_default, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(List_default, { children }) }) })
|
|
2234
|
+
] })) });
|
|
2235
|
+
}
|
|
2236
|
+
);
|
|
2237
|
+
var ListGroup_default = ListGroup;
|
|
1844
2238
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1845
2239
|
0 && (module.exports = {
|
|
2240
|
+
Accordion,
|
|
2241
|
+
AccordionContent,
|
|
2242
|
+
AccordionHeader,
|
|
2243
|
+
AccordionItem,
|
|
2244
|
+
AccordionPanel,
|
|
1846
2245
|
Backdrop,
|
|
1847
2246
|
Badge,
|
|
1848
2247
|
Button,
|
|
2248
|
+
Card,
|
|
2249
|
+
CardHeader,
|
|
1849
2250
|
Chip,
|
|
1850
2251
|
Collapse,
|
|
1851
2252
|
CollapseContent,
|
|
1852
2253
|
CollapseContext,
|
|
1853
2254
|
CollapseTrigger,
|
|
1854
2255
|
Drawer,
|
|
2256
|
+
Field,
|
|
1855
2257
|
Icon,
|
|
2258
|
+
List,
|
|
2259
|
+
ListGroup,
|
|
2260
|
+
ListItem,
|
|
1856
2261
|
Menu,
|
|
1857
2262
|
MenuContext,
|
|
1858
2263
|
MenuGroup,
|
|
@@ -1861,13 +2266,19 @@ var useStep = (maxStep) => {
|
|
|
1861
2266
|
MenuValueContext,
|
|
1862
2267
|
MultiSelect,
|
|
1863
2268
|
Portal,
|
|
2269
|
+
ScrollArea,
|
|
1864
2270
|
Select,
|
|
2271
|
+
Switch,
|
|
1865
2272
|
Tab,
|
|
1866
2273
|
Tabs,
|
|
1867
2274
|
Toolbar,
|
|
1868
2275
|
Transition,
|
|
2276
|
+
clsx,
|
|
1869
2277
|
getOpenValuesByPathname,
|
|
2278
|
+
scrollToItem,
|
|
2279
|
+
useAccordionItem,
|
|
1870
2280
|
useCollapse,
|
|
2281
|
+
useDisclosure,
|
|
1871
2282
|
useLocalStorage,
|
|
1872
2283
|
useMenu,
|
|
1873
2284
|
useMenuItemValue,
|