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