@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.mjs
CHANGED
|
@@ -244,6 +244,7 @@ var Button = forwardRef8(
|
|
|
244
244
|
iconOnly,
|
|
245
245
|
startContent,
|
|
246
246
|
endContent,
|
|
247
|
+
block,
|
|
247
248
|
loading,
|
|
248
249
|
disabled
|
|
249
250
|
} = _b, rest = __objRest(_b, [
|
|
@@ -257,6 +258,7 @@ var Button = forwardRef8(
|
|
|
257
258
|
"iconOnly",
|
|
258
259
|
"startContent",
|
|
259
260
|
"endContent",
|
|
261
|
+
"block",
|
|
260
262
|
"loading",
|
|
261
263
|
"disabled"
|
|
262
264
|
]);
|
|
@@ -270,6 +272,7 @@ var Button = forwardRef8(
|
|
|
270
272
|
[`${PREFIX_CLS}button--${variant}`]: variant,
|
|
271
273
|
[`${PREFIX_CLS}button--${color}`]: color,
|
|
272
274
|
[`${PREFIX_CLS}button--${size}`]: size,
|
|
275
|
+
[`${PREFIX_CLS}button--block`]: block,
|
|
273
276
|
[`${PREFIX_CLS}button--icon-only`]: iconOnly,
|
|
274
277
|
[`${PREFIX_CLS}button--disabled`]: disabled
|
|
275
278
|
},
|
|
@@ -290,18 +293,114 @@ var Button = forwardRef8(
|
|
|
290
293
|
}
|
|
291
294
|
);
|
|
292
295
|
|
|
293
|
-
// src/components/
|
|
294
|
-
import clsx6 from "clsx";
|
|
296
|
+
// src/components/Card/Card.tsx
|
|
295
297
|
import { forwardRef as forwardRef9 } from "react";
|
|
296
|
-
|
|
297
|
-
|
|
298
|
+
|
|
299
|
+
// src/utils/clsx.ts
|
|
300
|
+
function toVal(mix) {
|
|
301
|
+
let k, y, str = "";
|
|
302
|
+
if (typeof mix === "string" || typeof mix === "number") {
|
|
303
|
+
str += mix;
|
|
304
|
+
} else if (typeof mix === "object") {
|
|
305
|
+
if (Array.isArray(mix)) {
|
|
306
|
+
for (k = 0; k < mix.length; k++) {
|
|
307
|
+
if (mix[k]) {
|
|
308
|
+
if (y = toVal(mix[k])) {
|
|
309
|
+
str && (str += " ");
|
|
310
|
+
str += y;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
} else {
|
|
315
|
+
for (k in mix) {
|
|
316
|
+
if (mix[k]) {
|
|
317
|
+
str && (str += " ");
|
|
318
|
+
str += k;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return str;
|
|
324
|
+
}
|
|
325
|
+
function clsx6(...inputs) {
|
|
326
|
+
let i = 0, tmp, x, str = "";
|
|
327
|
+
while (i < inputs.length) {
|
|
328
|
+
if (tmp = inputs[i++]) {
|
|
329
|
+
if (x = toVal(tmp)) {
|
|
330
|
+
str && (str += " ");
|
|
331
|
+
str += x;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return str;
|
|
336
|
+
}
|
|
337
|
+
var clsx_default = clsx6;
|
|
338
|
+
|
|
339
|
+
// src/utils/scroll.ts
|
|
340
|
+
var scrollToItem = (parentElement, currentElement) => {
|
|
341
|
+
const parentRect = parentElement.getBoundingClientRect();
|
|
342
|
+
const currentRect = currentElement.getBoundingClientRect();
|
|
343
|
+
const behavior = "smooth";
|
|
344
|
+
const previousElement = currentElement.previousSibling;
|
|
345
|
+
const previousRect = (previousElement == null ? void 0 : previousElement.getBoundingClientRect()) || currentRect;
|
|
346
|
+
if (parentRect.left > previousRect.left) {
|
|
347
|
+
let offset = 0;
|
|
348
|
+
if (previousElement) {
|
|
349
|
+
offset = previousRect.left - parentRect.left + parentElement.scrollLeft + previousRect.width / 4;
|
|
350
|
+
}
|
|
351
|
+
parentElement.scrollTo({ behavior, left: offset });
|
|
352
|
+
}
|
|
353
|
+
const nextElement = currentElement.nextSibling;
|
|
354
|
+
const nextRect = (nextElement == null ? void 0 : nextElement.getBoundingClientRect()) || currentRect;
|
|
355
|
+
if (parentRect.right < nextRect.right) {
|
|
356
|
+
let offset = parentElement.scrollWidth;
|
|
357
|
+
if (nextElement) {
|
|
358
|
+
offset = nextRect.right - parentRect.right + parentElement.scrollLeft - nextRect.width / 4;
|
|
359
|
+
}
|
|
360
|
+
parentElement.scrollTo({ behavior, left: offset });
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
// src/components/Card/Card.tsx
|
|
365
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
366
|
+
var Card = forwardRef9((_a, ref) => {
|
|
367
|
+
var _b = _a, { as: Component = "div", children, className } = _b, rest = __objRest(_b, ["as", "children", "className"]);
|
|
368
|
+
const prefixCls = PREFIX_CLS;
|
|
369
|
+
return /* @__PURE__ */ jsx9(Component, __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}card`, className) }, rest), { children }));
|
|
370
|
+
});
|
|
371
|
+
var Card_default = Card;
|
|
372
|
+
|
|
373
|
+
// src/components/Card/CardHeader.tsx
|
|
374
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
375
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
376
|
+
var CardHeader = forwardRef10(
|
|
377
|
+
(_a, ref) => {
|
|
378
|
+
var _b = _a, { as: Component = "div", className, title, subtitle, startContent, endContent } = _b, rest = __objRest(_b, ["as", "className", "title", "subtitle", "startContent", "endContent"]);
|
|
379
|
+
const prefixCls = PREFIX_CLS;
|
|
380
|
+
return /* @__PURE__ */ jsxs7(Component, __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}card-header`, className) }, rest), { children: [
|
|
381
|
+
startContent && /* @__PURE__ */ jsx10("div", { className: `${prefixCls}card-header__start-content`, children: startContent }),
|
|
382
|
+
/* @__PURE__ */ jsxs7("div", { className: `${prefixCls}card-header__content`, children: [
|
|
383
|
+
/* @__PURE__ */ jsx10("div", { className: `${prefixCls}card-header__title`, children: title }),
|
|
384
|
+
subtitle && /* @__PURE__ */ jsx10("div", { className: `${prefixCls}card-header__subtitle`, children: subtitle })
|
|
385
|
+
] }),
|
|
386
|
+
endContent && /* @__PURE__ */ jsx10("div", { className: `${prefixCls}card-header__end-content`, children: endContent })
|
|
387
|
+
] }));
|
|
388
|
+
}
|
|
389
|
+
);
|
|
390
|
+
var CardHeader_default = CardHeader;
|
|
391
|
+
|
|
392
|
+
// src/components/Chip/Chip.tsx
|
|
393
|
+
import clsx7 from "clsx";
|
|
394
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
395
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
396
|
+
var Chip = forwardRef11(
|
|
298
397
|
(_a, ref) => {
|
|
299
398
|
var _b = _a, { as: Component = "div", children, className, variant, color, size } = _b, rest = __objRest(_b, ["as", "children", "className", "variant", "color", "size"]);
|
|
300
|
-
return /* @__PURE__ */
|
|
399
|
+
return /* @__PURE__ */ jsxs8(
|
|
301
400
|
Component,
|
|
302
401
|
__spreadProps(__spreadValues({
|
|
303
402
|
ref,
|
|
304
|
-
className:
|
|
403
|
+
className: clsx7(
|
|
305
404
|
`${PREFIX_CLS}chip`,
|
|
306
405
|
{
|
|
307
406
|
[`${PREFIX_CLS}chip--${variant}`]: variant,
|
|
@@ -312,8 +411,8 @@ var Chip = forwardRef9(
|
|
|
312
411
|
)
|
|
313
412
|
}, rest), {
|
|
314
413
|
children: [
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ jsx11("div", { className: clsx7(`${PREFIX_CLS}overlay`) }),
|
|
415
|
+
/* @__PURE__ */ jsx11("div", { className: `${PREFIX_CLS}outline` }),
|
|
317
416
|
children
|
|
318
417
|
]
|
|
319
418
|
})
|
|
@@ -338,7 +437,7 @@ var useCollapse = () => {
|
|
|
338
437
|
var CollapseContext_default = CollapseContext;
|
|
339
438
|
|
|
340
439
|
// src/components/Collapse/Collapse.tsx
|
|
341
|
-
import { jsxs as
|
|
440
|
+
import { jsxs as jsxs9 } from "react/jsx-runtime";
|
|
342
441
|
var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
343
442
|
const collapseRef = useRef3(null);
|
|
344
443
|
const [selfIsOpen, setSelfIsOpen] = useState(isOpen != null ? isOpen : false);
|
|
@@ -368,7 +467,7 @@ var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
|
368
467
|
}
|
|
369
468
|
}, 100);
|
|
370
469
|
}, [isOpen]);
|
|
371
|
-
return /* @__PURE__ */
|
|
470
|
+
return /* @__PURE__ */ jsxs9(
|
|
372
471
|
CollapseContext_default.Provider,
|
|
373
472
|
{
|
|
374
473
|
value: {
|
|
@@ -389,9 +488,9 @@ var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
|
389
488
|
var Collapse_default = Collapse;
|
|
390
489
|
|
|
391
490
|
// src/components/Collapse/CollapseContent.tsx
|
|
392
|
-
import
|
|
393
|
-
import { Children as Children3, cloneElement as cloneElement2, forwardRef as
|
|
394
|
-
var CollapseContent =
|
|
491
|
+
import clsx8 from "clsx";
|
|
492
|
+
import { Children as Children3, cloneElement as cloneElement2, forwardRef as forwardRef12 } from "react";
|
|
493
|
+
var CollapseContent = forwardRef12(({ children }, ref) => {
|
|
395
494
|
var _a, _b;
|
|
396
495
|
const { collapseRef, isOpen, heightAuto } = useCollapse();
|
|
397
496
|
const child = Children3.only(children);
|
|
@@ -405,46 +504,46 @@ var CollapseContent = forwardRef10(({ children }, ref) => {
|
|
|
405
504
|
style: __spreadProps(__spreadValues({}, child.props.style), {
|
|
406
505
|
height: isOpen && heightAuto ? "auto" : isOpen ? (_a = collapseRef.current) == null ? void 0 : _a.scrollHeight : !isOpen && heightAuto ? (_b = collapseRef.current) == null ? void 0 : _b.scrollHeight : 0
|
|
407
506
|
}),
|
|
408
|
-
className:
|
|
507
|
+
className: clsx8(`${PREFIX_CLS}collapse`, child.props.className)
|
|
409
508
|
}));
|
|
410
509
|
});
|
|
411
510
|
var CollapseContent_default = CollapseContent;
|
|
412
511
|
|
|
413
512
|
// src/components/Collapse/CollapseTrigger.tsx
|
|
414
|
-
import { Children as Children4, cloneElement as cloneElement3, forwardRef as
|
|
415
|
-
var CollapseTrigger =
|
|
513
|
+
import { Children as Children4, cloneElement as cloneElement3, forwardRef as forwardRef13 } from "react";
|
|
514
|
+
var CollapseTrigger = forwardRef13(({ children }, ref) => {
|
|
416
515
|
const { collapseRef, onToggle } = useCollapse();
|
|
417
516
|
const child = Children4.only(children);
|
|
517
|
+
const _a = child.props, { onClick } = _a, rest = __objRest(_a, ["onClick"]);
|
|
418
518
|
return cloneElement3(child, __spreadValues({
|
|
419
519
|
ref,
|
|
420
520
|
onClick: (event) => {
|
|
421
|
-
var _a, _b;
|
|
422
521
|
if (!collapseRef.current) {
|
|
423
522
|
return;
|
|
424
523
|
}
|
|
425
524
|
onToggle();
|
|
426
|
-
|
|
525
|
+
onClick == null ? void 0 : onClick(event);
|
|
427
526
|
}
|
|
428
|
-
},
|
|
527
|
+
}, rest));
|
|
429
528
|
});
|
|
430
529
|
var CollapseTrigger_default = CollapseTrigger;
|
|
431
530
|
|
|
432
531
|
// src/components/Drawer/Drawer.tsx
|
|
433
|
-
import
|
|
434
|
-
import { forwardRef as
|
|
532
|
+
import clsx9 from "clsx";
|
|
533
|
+
import { forwardRef as forwardRef14, useRef as useRef4 } from "react";
|
|
435
534
|
import { mergeRefs as mergeRefs2 } from "react-merge-refs";
|
|
436
|
-
import { jsx as
|
|
437
|
-
var Drawer =
|
|
535
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
536
|
+
var Drawer = forwardRef14((props, ref) => {
|
|
438
537
|
const { children, className, isOpen, size = "md", position = "left", onClose } = props;
|
|
439
538
|
const nodeRef = useRef4(null);
|
|
440
539
|
const handleClose = () => {
|
|
441
540
|
onClose();
|
|
442
541
|
};
|
|
443
|
-
return /* @__PURE__ */
|
|
542
|
+
return /* @__PURE__ */ jsx12(Backdrop_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsx12(Transition_default, { nodeRef, isOpen, name: `${PREFIX_CLS}drawer`, enter: 600, leave: 300, unmountOnExit: true, children: /* @__PURE__ */ jsxs10(
|
|
444
543
|
"div",
|
|
445
544
|
{
|
|
446
545
|
ref: mergeRefs2([ref, nodeRef]),
|
|
447
|
-
className:
|
|
546
|
+
className: clsx9(
|
|
448
547
|
`${PREFIX_CLS}drawer`,
|
|
449
548
|
{
|
|
450
549
|
[`${PREFIX_CLS}drawer--${size}`]: size,
|
|
@@ -453,7 +552,7 @@ var Drawer = forwardRef12((props, ref) => {
|
|
|
453
552
|
className
|
|
454
553
|
),
|
|
455
554
|
children: [
|
|
456
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ jsx12("div", { className: `${PREFIX_CLS}drawer__overlay` }),
|
|
457
556
|
children
|
|
458
557
|
]
|
|
459
558
|
}
|
|
@@ -462,7 +561,7 @@ var Drawer = forwardRef12((props, ref) => {
|
|
|
462
561
|
var Drawer_default = Drawer;
|
|
463
562
|
|
|
464
563
|
// src/components/Menu/Menu.tsx
|
|
465
|
-
import
|
|
564
|
+
import clsx13 from "clsx";
|
|
466
565
|
import { useEffect as useEffect3, useMemo as useMemo3, useState as useState2 } from "react";
|
|
467
566
|
|
|
468
567
|
// src/components/Menu/MenuContext.tsx
|
|
@@ -478,12 +577,12 @@ var useMenu = () => {
|
|
|
478
577
|
var MenuContext_default = MenuContext;
|
|
479
578
|
|
|
480
579
|
// src/components/Menu/MenuGroup.tsx
|
|
481
|
-
import
|
|
580
|
+
import clsx12 from "clsx";
|
|
482
581
|
import { useMemo as useMemo2 } from "react";
|
|
483
582
|
|
|
484
583
|
// src/components/Menu/MenuItem.tsx
|
|
485
|
-
import
|
|
486
|
-
import { forwardRef as
|
|
584
|
+
import clsx10 from "clsx";
|
|
585
|
+
import { forwardRef as forwardRef15, useContext as useContext4, useEffect as useEffect2 } from "react";
|
|
487
586
|
|
|
488
587
|
// src/components/Menu/MenuValueContext.tsx
|
|
489
588
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
@@ -498,8 +597,8 @@ var useMenuItemValue = () => {
|
|
|
498
597
|
var MenuValueContext_default = MenuValueContext;
|
|
499
598
|
|
|
500
599
|
// src/components/Menu/MenuItem.tsx
|
|
501
|
-
import { jsx as
|
|
502
|
-
var MenuItem =
|
|
600
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
601
|
+
var MenuItem = forwardRef15((props, ref) => {
|
|
503
602
|
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"]);
|
|
504
603
|
const { value: menuValue, originalValue, navMode, onChange, onOpen, onItemSelect } = useMenu();
|
|
505
604
|
const values = useContext4(MenuValueContext_default);
|
|
@@ -517,11 +616,11 @@ var MenuItem = forwardRef13((props, ref) => {
|
|
|
517
616
|
onChange(mergedValues);
|
|
518
617
|
}
|
|
519
618
|
}, [value, originalValue, navMode]);
|
|
520
|
-
return /* @__PURE__ */
|
|
619
|
+
return /* @__PURE__ */ jsxs11(
|
|
521
620
|
Component,
|
|
522
621
|
__spreadProps(__spreadValues({
|
|
523
622
|
ref,
|
|
524
|
-
className:
|
|
623
|
+
className: clsx10(
|
|
525
624
|
`${PREFIX_CLS}menu-item`,
|
|
526
625
|
{
|
|
527
626
|
[`${PREFIX_CLS}menu-item--selected`]: menuValue.includes(value),
|
|
@@ -535,9 +634,9 @@ var MenuItem = forwardRef13((props, ref) => {
|
|
|
535
634
|
onClick: handleClick
|
|
536
635
|
}, rest), {
|
|
537
636
|
children: [
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
-
icon && /* @__PURE__ */
|
|
540
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ jsx13("div", { className: `${PREFIX_CLS}overlay`, children: /* @__PURE__ */ jsx13("div", { className: `${PREFIX_CLS}overlay__surface` }) }),
|
|
638
|
+
icon && /* @__PURE__ */ jsx13("div", { className: `${PREFIX_CLS}menu-item__icon`, children: icon }),
|
|
639
|
+
/* @__PURE__ */ jsx13("div", { className: `${PREFIX_CLS}menu-item__content`, children: /* @__PURE__ */ jsx13("span", { className: `${PREFIX_CLS}menu-item__title`, children: title }) })
|
|
541
640
|
]
|
|
542
641
|
})
|
|
543
642
|
);
|
|
@@ -546,7 +645,7 @@ MenuItem.displayName = "MenuItem";
|
|
|
546
645
|
var MenuItem_default = MenuItem;
|
|
547
646
|
|
|
548
647
|
// src/components/Menu/MenuSubmenu.tsx
|
|
549
|
-
import
|
|
648
|
+
import clsx11 from "clsx";
|
|
550
649
|
import { useContext as useContext5, useMemo } from "react";
|
|
551
650
|
|
|
552
651
|
// src/components/Menu/utils.ts
|
|
@@ -573,7 +672,7 @@ var addOrRemoveValueInArray = (array, value) => {
|
|
|
573
672
|
};
|
|
574
673
|
|
|
575
674
|
// src/components/Menu/MenuSubmenu.tsx
|
|
576
|
-
import { jsx as
|
|
675
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
577
676
|
var MenuSubmenu = (_a) => {
|
|
578
677
|
var _b = _a, {
|
|
579
678
|
children,
|
|
@@ -603,7 +702,7 @@ var MenuSubmenu = (_a) => {
|
|
|
603
702
|
const content = useMemo(() => {
|
|
604
703
|
return items == null ? void 0 : items.map((_a2, index) => {
|
|
605
704
|
var _b2 = _a2, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
606
|
-
return type === "item" ? /* @__PURE__ */
|
|
705
|
+
return type === "item" ? /* @__PURE__ */ jsx14(MenuItem_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : type === "submenu" ? /* @__PURE__ */ jsx14(MenuSubmenu, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : type === "group" ? /* @__PURE__ */ jsx14(MenuGroup_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : /* @__PURE__ */ jsx14(MenuItem_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index);
|
|
607
706
|
});
|
|
608
707
|
}, [items]);
|
|
609
708
|
const handleClick = (event) => {
|
|
@@ -621,11 +720,11 @@ var MenuSubmenu = (_a) => {
|
|
|
621
720
|
}
|
|
622
721
|
onClick == null ? void 0 : onClick(event);
|
|
623
722
|
};
|
|
624
|
-
return /* @__PURE__ */
|
|
625
|
-
/* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ jsx14(MenuValueContext_default.Provider, { value: mergedValues, children: /* @__PURE__ */ jsx14("div", { className: clsx11(`${PREFIX_CLS}menu-submenu`), children: /* @__PURE__ */ jsxs12(Collapse_default, { isOpen, children: [
|
|
724
|
+
/* @__PURE__ */ jsx14(CollapseTrigger_default, { children: /* @__PURE__ */ jsxs12(
|
|
626
725
|
"div",
|
|
627
726
|
__spreadProps(__spreadValues({
|
|
628
|
-
className:
|
|
727
|
+
className: clsx11(
|
|
629
728
|
`${PREFIX_CLS}menu-item`,
|
|
630
729
|
{
|
|
631
730
|
[`${PREFIX_CLS}menu-item--selected`]: menuValue.includes(value) || items && mergedValues.includes(menuValue)
|
|
@@ -638,17 +737,17 @@ var MenuSubmenu = (_a) => {
|
|
|
638
737
|
onClick: handleClick
|
|
639
738
|
}, rest), {
|
|
640
739
|
children: [
|
|
641
|
-
/* @__PURE__ */
|
|
642
|
-
icon && /* @__PURE__ */
|
|
643
|
-
/* @__PURE__ */
|
|
644
|
-
/* @__PURE__ */
|
|
740
|
+
/* @__PURE__ */ jsx14("div", { className: `${PREFIX_CLS}overlay`, children: /* @__PURE__ */ jsx14("div", { className: `${PREFIX_CLS}overlay__surface` }) }),
|
|
741
|
+
icon && /* @__PURE__ */ jsx14("div", { className: `${PREFIX_CLS}menu-item__icon`, children: icon }),
|
|
742
|
+
/* @__PURE__ */ jsx14("div", { className: `${PREFIX_CLS}menu-item__content`, children: /* @__PURE__ */ jsx14("span", { className: `${PREFIX_CLS}menu-item__title`, children: title }) }),
|
|
743
|
+
/* @__PURE__ */ jsx14("div", { className: `${PREFIX_CLS}menu-item__icon`, children: isOpen ? /* @__PURE__ */ jsx14(ChevronUpIcon_default, { className: `${PREFIX_CLS}icon` }) : /* @__PURE__ */ jsx14(ChevronDownIcon_default, { className: `${PREFIX_CLS}icon` }) })
|
|
645
744
|
]
|
|
646
745
|
})
|
|
647
746
|
) }),
|
|
648
|
-
/* @__PURE__ */
|
|
747
|
+
/* @__PURE__ */ jsx14(CollapseContent_default, { children: /* @__PURE__ */ jsx14(
|
|
649
748
|
"ul",
|
|
650
749
|
{
|
|
651
|
-
className:
|
|
750
|
+
className: clsx11(`${PREFIX_CLS}menu`, {
|
|
652
751
|
[`${PREFIX_CLS}menu-open`]: !isOpen
|
|
653
752
|
}),
|
|
654
753
|
children: content || children
|
|
@@ -659,7 +758,7 @@ var MenuSubmenu = (_a) => {
|
|
|
659
758
|
var MenuSubmenu_default = MenuSubmenu;
|
|
660
759
|
|
|
661
760
|
// src/components/Menu/MenuGroup.tsx
|
|
662
|
-
import { Fragment, jsx as
|
|
761
|
+
import { Fragment, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
663
762
|
var MenuGroup = (_a) => {
|
|
664
763
|
var _b = _a, {
|
|
665
764
|
children,
|
|
@@ -681,21 +780,21 @@ var MenuGroup = (_a) => {
|
|
|
681
780
|
const content = useMemo2(() => {
|
|
682
781
|
return items == null ? void 0 : items.map((_a2, index) => {
|
|
683
782
|
var _b2 = _a2, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
684
|
-
return type === "item" ? /* @__PURE__ */
|
|
783
|
+
return type === "item" ? /* @__PURE__ */ jsx15(MenuItem_default, __spreadValues({}, item), index) : type === "submenu" ? /* @__PURE__ */ jsx15(MenuSubmenu_default, __spreadValues({}, item), index) : /* @__PURE__ */ jsx15(MenuItem_default, __spreadValues({}, item), index);
|
|
685
784
|
});
|
|
686
785
|
}, [items]);
|
|
687
|
-
return /* @__PURE__ */
|
|
688
|
-
/* @__PURE__ */
|
|
786
|
+
return /* @__PURE__ */ jsxs13(Fragment, { children: [
|
|
787
|
+
/* @__PURE__ */ jsxs13(
|
|
689
788
|
"div",
|
|
690
789
|
__spreadProps(__spreadValues({
|
|
691
|
-
className:
|
|
790
|
+
className: clsx12(`${PREFIX_CLS}menu-group`, className),
|
|
692
791
|
style: __spreadValues({
|
|
693
792
|
paddingLeft: level <= 1 ? `var(--${PREFIX_CLS}menu-group-padding-x)` : `calc(${level} * var(--${PREFIX_CLS}menu-group-padding-level))`
|
|
694
793
|
}, style)
|
|
695
794
|
}, rest), {
|
|
696
795
|
children: [
|
|
697
|
-
icon && /* @__PURE__ */
|
|
698
|
-
/* @__PURE__ */
|
|
796
|
+
icon && /* @__PURE__ */ jsx15("div", { className: `${PREFIX_CLS}menu-group__icon`, children: icon }),
|
|
797
|
+
/* @__PURE__ */ jsx15("div", { className: `${PREFIX_CLS}menu-group__content`, children: /* @__PURE__ */ jsx15("span", { className: `${PREFIX_CLS}menu-group__title`, children: title }) })
|
|
699
798
|
]
|
|
700
799
|
})
|
|
701
800
|
),
|
|
@@ -705,7 +804,7 @@ var MenuGroup = (_a) => {
|
|
|
705
804
|
var MenuGroup_default = MenuGroup;
|
|
706
805
|
|
|
707
806
|
// src/components/Menu/Menu.tsx
|
|
708
|
-
import { jsx as
|
|
807
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
709
808
|
var Menu = (_a) => {
|
|
710
809
|
var _b = _a, {
|
|
711
810
|
children,
|
|
@@ -736,7 +835,7 @@ var Menu = (_a) => {
|
|
|
736
835
|
const content = useMemo3(() => {
|
|
737
836
|
return items == null ? void 0 : items.map((_a3, index) => {
|
|
738
837
|
var _b2 = _a3, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
739
|
-
return type === "item" ? /* @__PURE__ */
|
|
838
|
+
return type === "item" ? /* @__PURE__ */ jsx16(MenuItem_default, __spreadValues({}, item), index) : type === "submenu" ? /* @__PURE__ */ jsx16(MenuSubmenu_default, __spreadValues({}, item), index) : type === "group" ? /* @__PURE__ */ jsx16(MenuGroup_default, __spreadValues({}, item), index) : /* @__PURE__ */ jsx16(MenuItem_default, __spreadValues({}, item), index);
|
|
740
839
|
});
|
|
741
840
|
}, [items]);
|
|
742
841
|
const handleChange = (value) => {
|
|
@@ -766,7 +865,7 @@ var Menu = (_a) => {
|
|
|
766
865
|
setSelfOpenValues(openValuesProp);
|
|
767
866
|
}
|
|
768
867
|
}, [openValuesProp]);
|
|
769
|
-
return /* @__PURE__ */
|
|
868
|
+
return /* @__PURE__ */ jsx16(
|
|
770
869
|
MenuContext_default.Provider,
|
|
771
870
|
{
|
|
772
871
|
value: {
|
|
@@ -779,17 +878,235 @@ var Menu = (_a) => {
|
|
|
779
878
|
onChange: handleChange,
|
|
780
879
|
onItemSelect: handleItemSelect
|
|
781
880
|
},
|
|
782
|
-
children: /* @__PURE__ */
|
|
881
|
+
children: /* @__PURE__ */ jsx16("div", __spreadProps(__spreadValues({ className: clsx13(`${PREFIX_CLS}menu`) }, rest), { children: content || children }))
|
|
783
882
|
}
|
|
784
883
|
);
|
|
785
884
|
};
|
|
786
885
|
Menu.displayName = "Menu";
|
|
787
886
|
var Menu_default = Menu;
|
|
788
887
|
|
|
888
|
+
// src/components/Accordion/Accordion.tsx
|
|
889
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
890
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
891
|
+
var Accordion = forwardRef16((props, ref) => {
|
|
892
|
+
const _a = props, { children, className } = _a, rest = __objRest(_a, ["children", "className"]);
|
|
893
|
+
const prefixCls = PREFIX_CLS;
|
|
894
|
+
return /* @__PURE__ */ jsx17("div", __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}accordion`, className) }, rest), { children }));
|
|
895
|
+
});
|
|
896
|
+
var Accordion_default = Accordion;
|
|
897
|
+
|
|
898
|
+
// src/components/Accordion/AccordionItem.tsx
|
|
899
|
+
import { createContext as createContext4, forwardRef as forwardRef17, useContext as useContext6, useId } from "react";
|
|
900
|
+
|
|
901
|
+
// src/hooks/useLocalStorage.tsx
|
|
902
|
+
import { useCallback, useEffect as useEffect5, useState as useState3 } from "react";
|
|
903
|
+
|
|
904
|
+
// src/hooks/useEventListener.tsx
|
|
905
|
+
import { useRef as useRef5 } from "react";
|
|
906
|
+
|
|
907
|
+
// src/hooks/useIsomorphicLayoutEffect.tsx
|
|
908
|
+
import { useEffect as useEffect4, useLayoutEffect } from "react";
|
|
909
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect4;
|
|
910
|
+
var useIsomorphicLayoutEffect_default = useIsomorphicLayoutEffect;
|
|
911
|
+
|
|
912
|
+
// src/hooks/useEventListener.tsx
|
|
913
|
+
function useEventListener(handler) {
|
|
914
|
+
const savedHandler = useRef5(handler);
|
|
915
|
+
useIsomorphicLayoutEffect_default(() => {
|
|
916
|
+
savedHandler.current = handler;
|
|
917
|
+
}, [handler]);
|
|
918
|
+
}
|
|
919
|
+
var useEventListener_default = useEventListener;
|
|
920
|
+
|
|
921
|
+
// src/hooks/useLocalStorage.tsx
|
|
922
|
+
function useLocalStorage(key, initialValue) {
|
|
923
|
+
const readValue = useCallback(() => {
|
|
924
|
+
if (typeof window === "undefined") {
|
|
925
|
+
return initialValue;
|
|
926
|
+
}
|
|
927
|
+
try {
|
|
928
|
+
const item = window.localStorage.getItem(key);
|
|
929
|
+
return item ? parseJSON(item) : initialValue;
|
|
930
|
+
} catch (error) {
|
|
931
|
+
console.warn(`Error reading localStorage key \u201C${key}\u201D:`, error);
|
|
932
|
+
return initialValue;
|
|
933
|
+
}
|
|
934
|
+
}, [initialValue, key]);
|
|
935
|
+
const [storedValue, setStoredValue] = useState3(readValue);
|
|
936
|
+
const setValue = useCallback(
|
|
937
|
+
(value) => {
|
|
938
|
+
if (typeof window == "undefined") {
|
|
939
|
+
console.warn(`Tried setting localStorage key \u201C${key}\u201D even though environment is not a client`);
|
|
940
|
+
}
|
|
941
|
+
try {
|
|
942
|
+
const newValue = value instanceof Function ? value(storedValue) : value;
|
|
943
|
+
window.localStorage.setItem(key, JSON.stringify(newValue));
|
|
944
|
+
setStoredValue(newValue);
|
|
945
|
+
window.dispatchEvent(new Event("local-storage"));
|
|
946
|
+
} catch (error) {
|
|
947
|
+
console.warn(`Error setting localStorage key \u201C${key}\u201D:`, error);
|
|
948
|
+
}
|
|
949
|
+
},
|
|
950
|
+
[key, storedValue]
|
|
951
|
+
);
|
|
952
|
+
useEffect5(() => {
|
|
953
|
+
setStoredValue(readValue());
|
|
954
|
+
}, []);
|
|
955
|
+
const handleStorageChange = useCallback(() => {
|
|
956
|
+
setStoredValue(readValue());
|
|
957
|
+
}, [readValue]);
|
|
958
|
+
useEventListener_default("storage", handleStorageChange);
|
|
959
|
+
useEventListener_default("local-storage", handleStorageChange);
|
|
960
|
+
return [storedValue, setValue];
|
|
961
|
+
}
|
|
962
|
+
function parseJSON(value) {
|
|
963
|
+
try {
|
|
964
|
+
return value === "undefined" ? void 0 : JSON.parse(value != null ? value : "");
|
|
965
|
+
} catch (e) {
|
|
966
|
+
return void 0;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
// src/hooks/usePrevious.tsx
|
|
971
|
+
import { useEffect as useEffect6, useRef as useRef6 } from "react";
|
|
972
|
+
var usePrevious = (value) => {
|
|
973
|
+
const ref = useRef6();
|
|
974
|
+
useEffect6(() => {
|
|
975
|
+
ref.current = value;
|
|
976
|
+
});
|
|
977
|
+
return ref.current;
|
|
978
|
+
};
|
|
979
|
+
|
|
980
|
+
// src/hooks/useDisclosure.ts
|
|
981
|
+
import { useState as useState4 } from "react";
|
|
982
|
+
var useDisclosure = ({ defaultValue } = {}) => {
|
|
983
|
+
const [isOpen, setIsOpen] = useState4(defaultValue || false);
|
|
984
|
+
const onOpen = () => {
|
|
985
|
+
setIsOpen(true);
|
|
986
|
+
};
|
|
987
|
+
const onClose = () => {
|
|
988
|
+
setIsOpen(false);
|
|
989
|
+
};
|
|
990
|
+
const onToggle = () => {
|
|
991
|
+
setIsOpen((prevState) => !prevState);
|
|
992
|
+
};
|
|
993
|
+
return {
|
|
994
|
+
isOpen,
|
|
995
|
+
onOpen,
|
|
996
|
+
onClose,
|
|
997
|
+
onToggle
|
|
998
|
+
};
|
|
999
|
+
};
|
|
1000
|
+
var useDisclosure_default = useDisclosure;
|
|
1001
|
+
|
|
1002
|
+
// src/hooks/useStep.tsx
|
|
1003
|
+
import { useCallback as useCallback2, useMemo as useMemo4, useState as useState5 } from "react";
|
|
1004
|
+
var useStep = (maxStep) => {
|
|
1005
|
+
const [currentStep, setCurrentStep] = useState5(1);
|
|
1006
|
+
const canGoToNextStep = useMemo4(() => currentStep + 1 <= maxStep, [currentStep, maxStep]);
|
|
1007
|
+
const canGoToPrevStep = useMemo4(() => currentStep - 1 >= 1, [currentStep]);
|
|
1008
|
+
const setStep = useCallback2(
|
|
1009
|
+
(step) => {
|
|
1010
|
+
const newStep = step instanceof Function ? step(currentStep) : step;
|
|
1011
|
+
if (newStep >= 1 && newStep <= maxStep) {
|
|
1012
|
+
setCurrentStep(newStep);
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
1015
|
+
throw new Error("Step not valid");
|
|
1016
|
+
},
|
|
1017
|
+
[maxStep, currentStep]
|
|
1018
|
+
);
|
|
1019
|
+
const goToNextStep = useCallback2(() => {
|
|
1020
|
+
if (canGoToNextStep) {
|
|
1021
|
+
setCurrentStep((step) => step + 1);
|
|
1022
|
+
}
|
|
1023
|
+
}, [canGoToNextStep]);
|
|
1024
|
+
const goToPrevStep = useCallback2(() => {
|
|
1025
|
+
if (canGoToPrevStep) {
|
|
1026
|
+
setCurrentStep((step) => step - 1);
|
|
1027
|
+
}
|
|
1028
|
+
}, [canGoToPrevStep]);
|
|
1029
|
+
const reset = useCallback2(() => {
|
|
1030
|
+
setCurrentStep(1);
|
|
1031
|
+
}, []);
|
|
1032
|
+
return [
|
|
1033
|
+
currentStep,
|
|
1034
|
+
{
|
|
1035
|
+
goToNextStep,
|
|
1036
|
+
goToPrevStep,
|
|
1037
|
+
canGoToNextStep,
|
|
1038
|
+
canGoToPrevStep,
|
|
1039
|
+
setStep,
|
|
1040
|
+
reset
|
|
1041
|
+
}
|
|
1042
|
+
];
|
|
1043
|
+
};
|
|
1044
|
+
|
|
1045
|
+
// src/components/Accordion/AccordionItem.tsx
|
|
1046
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1047
|
+
var AccordionItemContext = createContext4(null);
|
|
1048
|
+
var useAccordionItem = () => {
|
|
1049
|
+
const context = useContext6(AccordionItemContext);
|
|
1050
|
+
if (!context) {
|
|
1051
|
+
throw new Error("`useAccordionItem` must be used within a `<AccordionItem />`");
|
|
1052
|
+
}
|
|
1053
|
+
return context;
|
|
1054
|
+
};
|
|
1055
|
+
var AccordionItem = forwardRef17((props, ref) => {
|
|
1056
|
+
const _a = props, { children, className, value: valueProp } = _a, rest = __objRest(_a, ["children", "className", "value"]);
|
|
1057
|
+
const prefixCls = PREFIX_CLS;
|
|
1058
|
+
const { isOpen, onOpen, onClose, onToggle } = useDisclosure_default({ defaultValue: true });
|
|
1059
|
+
const id = useId();
|
|
1060
|
+
const value = valueProp != null ? valueProp : id;
|
|
1061
|
+
return /* @__PURE__ */ jsx18(AccordionItemContext.Provider, { value: { value }, children: /* @__PURE__ */ jsx18("div", __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}accordion-item`, className) }, rest), { children: /* @__PURE__ */ jsx18(Collapse_default, { isOpen, onOpen, onClose, onToggle, children }) })) });
|
|
1062
|
+
});
|
|
1063
|
+
var AccordionItem_default = AccordionItem;
|
|
1064
|
+
|
|
1065
|
+
// src/components/Accordion/AccordionHeader.tsx
|
|
1066
|
+
import { forwardRef as forwardRef18 } from "react";
|
|
1067
|
+
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1068
|
+
var AccordionHeader = forwardRef18((props, ref) => {
|
|
1069
|
+
const _a = props, { className, title, subtitle, startContent, endContent } = _a, rest = __objRest(_a, ["className", "title", "subtitle", "startContent", "endContent"]);
|
|
1070
|
+
const prefixCls = PREFIX_CLS;
|
|
1071
|
+
const { isOpen } = useCollapse();
|
|
1072
|
+
return /* @__PURE__ */ jsx19(CollapseTrigger_default, { children: /* @__PURE__ */ jsxs14("div", __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}accordion-header`, className) }, rest), { children: [
|
|
1073
|
+
startContent && /* @__PURE__ */ jsx19("div", { className: `${prefixCls}accordion-header__start-content`, children: startContent }),
|
|
1074
|
+
/* @__PURE__ */ jsxs14("div", { className: `${prefixCls}accordion-header__content`, children: [
|
|
1075
|
+
/* @__PURE__ */ jsx19("div", { className: `${prefixCls}accordion-header__title`, children: title }),
|
|
1076
|
+
subtitle && /* @__PURE__ */ jsx19("div", { className: `${prefixCls}accordion-header__subtitle`, children: subtitle })
|
|
1077
|
+
] }),
|
|
1078
|
+
/* @__PURE__ */ jsx19("div", { className: `${prefixCls}accordion-header__end-content`, children: /* @__PURE__ */ jsxs14("div", { className: "us-d-flex us-items-center us-gap-1", children: [
|
|
1079
|
+
endContent,
|
|
1080
|
+
/* @__PURE__ */ jsx19(Button, { type: "button", variant: "text", color: "secondary", size: "sm", iconOnly: true, children: /* @__PURE__ */ jsx19(Icon_default, { children: isOpen ? /* @__PURE__ */ jsx19(ChevronUpIcon_default, {}) : /* @__PURE__ */ jsx19(ChevronDownIcon_default, {}) }) })
|
|
1081
|
+
] }) })
|
|
1082
|
+
] })) });
|
|
1083
|
+
});
|
|
1084
|
+
var AccordionHeader_default = AccordionHeader;
|
|
1085
|
+
|
|
1086
|
+
// src/components/Accordion/AccordionPanel.tsx
|
|
1087
|
+
import { forwardRef as forwardRef19 } from "react";
|
|
1088
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1089
|
+
var AccordionPanel = forwardRef19((_a, ref) => {
|
|
1090
|
+
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
1091
|
+
const prefixCls = PREFIX_CLS;
|
|
1092
|
+
return /* @__PURE__ */ jsx20(CollapseContent_default, { children: /* @__PURE__ */ jsx20("div", { ref, children: /* @__PURE__ */ jsx20("div", __spreadProps(__spreadValues({ className: clsx_default(`${prefixCls}accordion-panel`, className) }, rest), { children })) }) });
|
|
1093
|
+
});
|
|
1094
|
+
var AccordionPanel_default = AccordionPanel;
|
|
1095
|
+
|
|
1096
|
+
// src/components/Accordion/AccordionContent.tsx
|
|
1097
|
+
import { forwardRef as forwardRef20 } from "react";
|
|
1098
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1099
|
+
var AccordionContent = forwardRef20((_a, ref) => {
|
|
1100
|
+
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
1101
|
+
const prefixCls = PREFIX_CLS;
|
|
1102
|
+
return /* @__PURE__ */ jsx21(CollapseContent_default, { children: /* @__PURE__ */ jsx21("div", { ref, children: /* @__PURE__ */ jsx21("div", __spreadProps(__spreadValues({ className: clsx_default(`${prefixCls}accordion-content`, className) }, rest), { children })) }) });
|
|
1103
|
+
});
|
|
1104
|
+
var AccordionContent_default = AccordionContent;
|
|
1105
|
+
|
|
789
1106
|
// src/components/Tabs/Tab.tsx
|
|
790
|
-
import
|
|
1107
|
+
import clsx14 from "clsx";
|
|
791
1108
|
import mergeRefs3 from "merge-refs";
|
|
792
|
-
import { forwardRef as
|
|
1109
|
+
import { forwardRef as forwardRef21, useEffect as useEffect7, useId as useId2, useRef as useRef7 } from "react";
|
|
793
1110
|
|
|
794
1111
|
// ../../../node_modules/react-icons/lib/esm/iconBase.js
|
|
795
1112
|
import React3 from "react";
|
|
@@ -878,10 +1195,10 @@ function TbX(props) {
|
|
|
878
1195
|
}
|
|
879
1196
|
|
|
880
1197
|
// src/components/Tabs/TabsContext.ts
|
|
881
|
-
import { createContext as
|
|
882
|
-
var TabsContext =
|
|
1198
|
+
import { createContext as createContext5, useContext as useContext7 } from "react";
|
|
1199
|
+
var TabsContext = createContext5(null);
|
|
883
1200
|
var useTabs = () => {
|
|
884
|
-
const context =
|
|
1201
|
+
const context = useContext7(TabsContext);
|
|
885
1202
|
if (!context) {
|
|
886
1203
|
throw new Error("`useTabs` must be used within a `<Tabs />`");
|
|
887
1204
|
}
|
|
@@ -889,8 +1206,8 @@ var useTabs = () => {
|
|
|
889
1206
|
};
|
|
890
1207
|
|
|
891
1208
|
// src/components/Tabs/Tab.tsx
|
|
892
|
-
import { jsx as
|
|
893
|
-
var Tab =
|
|
1209
|
+
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1210
|
+
var Tab = forwardRef21(
|
|
894
1211
|
(_a, ref) => {
|
|
895
1212
|
var _b = _a, {
|
|
896
1213
|
as: Component = "div",
|
|
@@ -911,8 +1228,8 @@ var Tab = forwardRef14(
|
|
|
911
1228
|
"disabled",
|
|
912
1229
|
"onClick"
|
|
913
1230
|
]);
|
|
914
|
-
const tabRef =
|
|
915
|
-
const id =
|
|
1231
|
+
const tabRef = useRef7(null);
|
|
1232
|
+
const id = useId2();
|
|
916
1233
|
const value = valueProp != null ? valueProp : id;
|
|
917
1234
|
const _a2 = useTabs(), { onClose, registerItem } = _a2, tabs = __objRest(_a2, ["onClose", "registerItem"]);
|
|
918
1235
|
const handleClick = (event) => {
|
|
@@ -953,17 +1270,17 @@ var Tab = forwardRef14(
|
|
|
953
1270
|
event.stopPropagation();
|
|
954
1271
|
onClose(value);
|
|
955
1272
|
};
|
|
956
|
-
|
|
1273
|
+
useEffect7(() => {
|
|
957
1274
|
registerItem({ value, disabled });
|
|
958
1275
|
if (value === tabs.value) {
|
|
959
1276
|
tabs.previousTabRef.current = tabRef.current;
|
|
960
1277
|
}
|
|
961
1278
|
}, [value, tabs.value]);
|
|
962
|
-
return /* @__PURE__ */
|
|
1279
|
+
return /* @__PURE__ */ jsxs15(
|
|
963
1280
|
Component,
|
|
964
1281
|
__spreadProps(__spreadValues({
|
|
965
1282
|
ref: mergeRefs3(tabRef, ref, (el) => tabs.tabRefs.current[value] = el),
|
|
966
|
-
className:
|
|
1283
|
+
className: clsx14(
|
|
967
1284
|
`${PREFIX_CLS}tab`,
|
|
968
1285
|
{ [`${PREFIX_CLS}tab--selected`]: value === tabs.value, [`${PREFIX_CLS}tab--disabled`]: disabled },
|
|
969
1286
|
className
|
|
@@ -972,12 +1289,12 @@ var Tab = forwardRef14(
|
|
|
972
1289
|
onClick: handleClick
|
|
973
1290
|
}, rest), {
|
|
974
1291
|
children: [
|
|
975
|
-
/* @__PURE__ */
|
|
976
|
-
/* @__PURE__ */
|
|
1292
|
+
/* @__PURE__ */ jsx22("div", { className: `${PREFIX_CLS}overlay`, children: /* @__PURE__ */ jsx22("div", { className: `${PREFIX_CLS}overlay__surface` }) }),
|
|
1293
|
+
/* @__PURE__ */ jsxs15("div", { className: `${PREFIX_CLS}tab__content`, children: [
|
|
977
1294
|
children,
|
|
978
|
-
closable && /* @__PURE__ */
|
|
1295
|
+
closable && /* @__PURE__ */ jsx22(Button, { variant: "text", color: "secondary", iconOnly: true, size: "xs", onClick: handleClose, children: /* @__PURE__ */ jsx22(Icon_default, { children: /* @__PURE__ */ jsx22(TbX, {}) }) })
|
|
979
1296
|
] }),
|
|
980
|
-
/* @__PURE__ */
|
|
1297
|
+
/* @__PURE__ */ jsx22("div", { className: `${PREFIX_CLS}tab__indicator` })
|
|
981
1298
|
]
|
|
982
1299
|
})
|
|
983
1300
|
);
|
|
@@ -985,36 +1302,9 @@ var Tab = forwardRef14(
|
|
|
985
1302
|
);
|
|
986
1303
|
|
|
987
1304
|
// src/components/Tabs/Tabs.tsx
|
|
988
|
-
import
|
|
989
|
-
import { useEffect as
|
|
990
|
-
|
|
991
|
-
// src/utils/scroll.ts
|
|
992
|
-
var scrollToItem = (parentElement, currentElement) => {
|
|
993
|
-
const parentRect = parentElement.getBoundingClientRect();
|
|
994
|
-
const currentRect = currentElement.getBoundingClientRect();
|
|
995
|
-
const behavior = "smooth";
|
|
996
|
-
const previousElement = currentElement.previousSibling;
|
|
997
|
-
const previousRect = (previousElement == null ? void 0 : previousElement.getBoundingClientRect()) || currentRect;
|
|
998
|
-
if (parentRect.left > previousRect.left) {
|
|
999
|
-
let offset = 0;
|
|
1000
|
-
if (previousElement) {
|
|
1001
|
-
offset = previousRect.left - parentRect.left + parentElement.scrollLeft + previousRect.width / 4;
|
|
1002
|
-
}
|
|
1003
|
-
parentElement.scrollTo({ behavior, left: offset });
|
|
1004
|
-
}
|
|
1005
|
-
const nextElement = currentElement.nextSibling;
|
|
1006
|
-
const nextRect = (nextElement == null ? void 0 : nextElement.getBoundingClientRect()) || currentRect;
|
|
1007
|
-
if (parentRect.right < nextRect.right) {
|
|
1008
|
-
let offset = parentElement.scrollWidth;
|
|
1009
|
-
if (nextElement) {
|
|
1010
|
-
offset = nextRect.right - parentRect.right + parentElement.scrollLeft - nextRect.width / 4;
|
|
1011
|
-
}
|
|
1012
|
-
parentElement.scrollTo({ behavior, left: offset });
|
|
1013
|
-
}
|
|
1014
|
-
};
|
|
1015
|
-
|
|
1016
|
-
// src/components/Tabs/Tabs.tsx
|
|
1017
|
-
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1305
|
+
import clsx15 from "clsx";
|
|
1306
|
+
import { useEffect as useEffect8, useRef as useRef8, useState as useState6 } from "react";
|
|
1307
|
+
import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1018
1308
|
var Tabs = (_a) => {
|
|
1019
1309
|
var _b = _a, {
|
|
1020
1310
|
children,
|
|
@@ -1033,11 +1323,11 @@ var Tabs = (_a) => {
|
|
|
1033
1323
|
"onChange",
|
|
1034
1324
|
"onClose"
|
|
1035
1325
|
]);
|
|
1036
|
-
const tabsRef =
|
|
1037
|
-
const tabRefs =
|
|
1038
|
-
const previousTabRef =
|
|
1039
|
-
const [selfValue, setSelfValue] =
|
|
1040
|
-
const [items, setItems] =
|
|
1326
|
+
const tabsRef = useRef8(null);
|
|
1327
|
+
const tabRefs = useRef8({});
|
|
1328
|
+
const previousTabRef = useRef8(null);
|
|
1329
|
+
const [selfValue, setSelfValue] = useState6(value != null ? value : defaultValue);
|
|
1330
|
+
const [items, setItems] = useState6([]);
|
|
1041
1331
|
const registerItem = (item) => {
|
|
1042
1332
|
setItems((prevItems) => {
|
|
1043
1333
|
const index = prevItems.findIndex((item2) => item2.value);
|
|
@@ -1064,64 +1354,81 @@ var Tabs = (_a) => {
|
|
|
1064
1354
|
const handleClose = (value2) => {
|
|
1065
1355
|
onClose == null ? void 0 : onClose(value2);
|
|
1066
1356
|
};
|
|
1067
|
-
|
|
1357
|
+
useEffect8(() => {
|
|
1068
1358
|
if (value !== void 0) {
|
|
1069
1359
|
setSelfValue(value);
|
|
1070
1360
|
scrollToTab(value);
|
|
1071
1361
|
}
|
|
1072
1362
|
}, [value]);
|
|
1073
|
-
|
|
1363
|
+
useEffect8(() => {
|
|
1074
1364
|
if (value === void 0) {
|
|
1075
1365
|
const item = items.find((tab) => !tab.disabled);
|
|
1076
1366
|
setSelfValue(item == null ? void 0 : item.value);
|
|
1077
1367
|
}
|
|
1078
1368
|
}, [value, items]);
|
|
1079
|
-
return /* @__PURE__ */
|
|
1369
|
+
return /* @__PURE__ */ jsxs16(
|
|
1080
1370
|
TabsContext.Provider,
|
|
1081
1371
|
{
|
|
1082
1372
|
value: { previousTabRef, tabRefs, value: selfValue, onChange: handleChange, onClose: handleClose, registerItem },
|
|
1083
1373
|
children: [
|
|
1084
|
-
/* @__PURE__ */
|
|
1374
|
+
/* @__PURE__ */ jsx23(
|
|
1085
1375
|
"div",
|
|
1086
1376
|
__spreadProps(__spreadValues({
|
|
1087
1377
|
ref: tabsRef,
|
|
1088
|
-
className:
|
|
1378
|
+
className: clsx15(`${PREFIX_CLS}tabs`, { [`${PREFIX_CLS}tabs--${alignment}`]: alignment }, className)
|
|
1089
1379
|
}, rest), {
|
|
1090
1380
|
children
|
|
1091
1381
|
})
|
|
1092
1382
|
),
|
|
1093
|
-
/* @__PURE__ */
|
|
1383
|
+
/* @__PURE__ */ jsx23("div", { className: `${PREFIX_CLS}divider` })
|
|
1094
1384
|
]
|
|
1095
1385
|
}
|
|
1096
1386
|
);
|
|
1097
1387
|
};
|
|
1098
1388
|
|
|
1099
1389
|
// src/components/Toolbar/Toolbar.tsx
|
|
1100
|
-
import
|
|
1101
|
-
import { Fragment as Fragment2, jsx as
|
|
1390
|
+
import clsx16 from "clsx";
|
|
1391
|
+
import { Fragment as Fragment2, jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1102
1392
|
var Toolbar = (props) => {
|
|
1103
1393
|
const _a = props, { children, className, size = "md", startAction, endAction, title, subtitle } = _a, rest = __objRest(_a, ["children", "className", "size", "startAction", "endAction", "title", "subtitle"]);
|
|
1104
|
-
return /* @__PURE__ */
|
|
1105
|
-
/* @__PURE__ */
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
startAction && /* @__PURE__ */
|
|
1108
|
-
/* @__PURE__ */
|
|
1109
|
-
title && /* @__PURE__ */
|
|
1110
|
-
subtitle && /* @__PURE__ */
|
|
1394
|
+
return /* @__PURE__ */ jsxs17("div", __spreadProps(__spreadValues({ className: clsx16(`${PREFIX_CLS}toolbar`, { [`${PREFIX_CLS}toolbar--${size}`]: size }, className) }, rest), { children: [
|
|
1395
|
+
/* @__PURE__ */ jsx24("div", { className: `${PREFIX_CLS}outline-b` }),
|
|
1396
|
+
/* @__PURE__ */ jsxs17("div", { className: clsx16(`${PREFIX_CLS}toolbar__container`), children: [
|
|
1397
|
+
startAction && /* @__PURE__ */ jsx24("div", { className: clsx16(`${PREFIX_CLS}toolbar__start-action`), children: startAction }),
|
|
1398
|
+
/* @__PURE__ */ jsx24("div", { className: clsx16(`${PREFIX_CLS}toolbar__content`), children: title || subtitle ? /* @__PURE__ */ jsxs17(Fragment2, { children: [
|
|
1399
|
+
title && /* @__PURE__ */ jsx24("div", { className: clsx16(`${PREFIX_CLS}toolbar__title`), children: title }),
|
|
1400
|
+
subtitle && /* @__PURE__ */ jsx24("div", { className: clsx16(`${PREFIX_CLS}toolbar__subtitle`), children: subtitle })
|
|
1111
1401
|
] }) : children }),
|
|
1112
|
-
endAction && /* @__PURE__ */
|
|
1402
|
+
endAction && /* @__PURE__ */ jsx24("div", { className: clsx16(`${PREFIX_CLS}toolbar__trailing`), children: endAction })
|
|
1113
1403
|
] })
|
|
1114
1404
|
] }));
|
|
1115
1405
|
};
|
|
1116
1406
|
var Toolbar_default = Toolbar;
|
|
1117
1407
|
|
|
1408
|
+
// src/components/ScrollArea/ScrollArea.tsx
|
|
1409
|
+
import { Children as Children5, cloneElement as cloneElement4, forwardRef as forwardRef22 } from "react";
|
|
1410
|
+
var ScrollArea = forwardRef22(({ children, direction = "vertical" }, ref) => {
|
|
1411
|
+
const child = Children5.only(children);
|
|
1412
|
+
const prefixCls = PREFIX_CLS;
|
|
1413
|
+
return cloneElement4(child, __spreadProps(__spreadValues({
|
|
1414
|
+
ref
|
|
1415
|
+
}, child.props), {
|
|
1416
|
+
className: clsx_default(
|
|
1417
|
+
`${prefixCls}scroll-area`,
|
|
1418
|
+
{ [`${prefixCls}scroll-area--${direction}`]: direction },
|
|
1419
|
+
child.props.className
|
|
1420
|
+
)
|
|
1421
|
+
}));
|
|
1422
|
+
});
|
|
1423
|
+
var ScrollArea_default = ScrollArea;
|
|
1424
|
+
|
|
1118
1425
|
// src/components/Select/SelectClient.tsx
|
|
1119
1426
|
import { filterBy } from "@progress/kendo-data-query";
|
|
1120
1427
|
import {
|
|
1121
1428
|
ComboBox
|
|
1122
1429
|
} from "@progress/kendo-react-dropdowns";
|
|
1123
|
-
import { useEffect as
|
|
1124
|
-
import { jsx as
|
|
1430
|
+
import { useEffect as useEffect9, useRef as useRef9, useState as useState7 } from "react";
|
|
1431
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1125
1432
|
var SelectClient = ({
|
|
1126
1433
|
value: valueProp,
|
|
1127
1434
|
data: propData,
|
|
@@ -1137,8 +1444,8 @@ var SelectClient = ({
|
|
|
1137
1444
|
onChange,
|
|
1138
1445
|
onFilterChange
|
|
1139
1446
|
}) => {
|
|
1140
|
-
const [value, setValue] =
|
|
1141
|
-
const [filter, setFilter] =
|
|
1447
|
+
const [value, setValue] = useState7(valueProp);
|
|
1448
|
+
const [filter, setFilter] = useState7(filterProp);
|
|
1142
1449
|
const handleChange = (event) => {
|
|
1143
1450
|
const value2 = event.target.value || null;
|
|
1144
1451
|
if (valueProp !== void 0) {
|
|
@@ -1148,8 +1455,8 @@ var SelectClient = ({
|
|
|
1148
1455
|
}
|
|
1149
1456
|
};
|
|
1150
1457
|
const pageSize3 = virtual == null ? void 0 : virtual.pageSize;
|
|
1151
|
-
const filteredData =
|
|
1152
|
-
const [state, setState] =
|
|
1458
|
+
const filteredData = useRef9([]);
|
|
1459
|
+
const [state, setState] = useState7({
|
|
1153
1460
|
skip: 0,
|
|
1154
1461
|
total: propData.total,
|
|
1155
1462
|
subsetData: propData.items.slice(0, pageSize3)
|
|
@@ -1179,20 +1486,20 @@ var SelectClient = ({
|
|
|
1179
1486
|
setState(__spreadProps(__spreadValues({}, state), { subsetData: newSubsetData, skip }));
|
|
1180
1487
|
}
|
|
1181
1488
|
};
|
|
1182
|
-
|
|
1489
|
+
useEffect9(() => {
|
|
1183
1490
|
if (valueProp !== void 0) {
|
|
1184
1491
|
setValue(valueProp);
|
|
1185
1492
|
}
|
|
1186
1493
|
}, [valueProp]);
|
|
1187
|
-
|
|
1494
|
+
useEffect9(() => {
|
|
1188
1495
|
setFilter(filterProp);
|
|
1189
1496
|
}, [filterProp]);
|
|
1190
|
-
|
|
1497
|
+
useEffect9(() => {
|
|
1191
1498
|
if (pageSize3) {
|
|
1192
1499
|
filteredData.current = propData.items.slice();
|
|
1193
1500
|
}
|
|
1194
1501
|
}, [propData]);
|
|
1195
|
-
return /* @__PURE__ */
|
|
1502
|
+
return /* @__PURE__ */ jsx25(
|
|
1196
1503
|
ComboBox,
|
|
1197
1504
|
{
|
|
1198
1505
|
value,
|
|
@@ -1222,8 +1529,8 @@ var SelectClient_default = SelectClient;
|
|
|
1222
1529
|
import {
|
|
1223
1530
|
ComboBox as ComboBox2
|
|
1224
1531
|
} from "@progress/kendo-react-dropdowns";
|
|
1225
|
-
import { cloneElement as
|
|
1226
|
-
import { jsx as
|
|
1532
|
+
import { cloneElement as cloneElement5, useCallback as useCallback3, useEffect as useEffect10, useRef as useRef10, useState as useState8 } from "react";
|
|
1533
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1227
1534
|
var textField = "ContactName";
|
|
1228
1535
|
var emptyItem = { [textField]: "loading ...", CustomerID: 0 };
|
|
1229
1536
|
var pageSize = 10;
|
|
@@ -1250,45 +1557,48 @@ var SelectServer = ({
|
|
|
1250
1557
|
renderItem
|
|
1251
1558
|
}) => {
|
|
1252
1559
|
var _a;
|
|
1253
|
-
const dataCaching =
|
|
1254
|
-
const pendingRequest =
|
|
1255
|
-
const requestStarted =
|
|
1560
|
+
const dataCaching = useRef10([]);
|
|
1561
|
+
const pendingRequest = useRef10();
|
|
1562
|
+
const requestStarted = useRef10(false);
|
|
1256
1563
|
const emptyItem3 = { [keyField2]: 0, [textField3]: "loading ..." };
|
|
1257
|
-
const [loadingData3, setLoadingData] =
|
|
1258
|
-
const [data, setData] =
|
|
1259
|
-
const [total, setTotal] =
|
|
1260
|
-
const [value, setValue] =
|
|
1261
|
-
const [filter, setFilter] =
|
|
1564
|
+
const [loadingData3, setLoadingData] = useState8([]);
|
|
1565
|
+
const [data, setData] = useState8(dataProp.items);
|
|
1566
|
+
const [total, setTotal] = useState8(0);
|
|
1567
|
+
const [value, setValue] = useState8(valueProp);
|
|
1568
|
+
const [filter, setFilter] = useState8(filterProp);
|
|
1262
1569
|
const pageSize3 = (_a = virtual == null ? void 0 : virtual.pageSize) != null ? _a : 10;
|
|
1263
|
-
const skipRef =
|
|
1570
|
+
const skipRef = useRef10(0);
|
|
1264
1571
|
const resetCach = () => {
|
|
1265
1572
|
dataCaching.current.length = 0;
|
|
1266
1573
|
};
|
|
1267
|
-
const requestData =
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
requestStarted.current = true;
|
|
1277
|
-
getData(state).then(({ items, total: total2 }) => {
|
|
1278
|
-
items.forEach((item, index) => {
|
|
1279
|
-
dataCaching.current[index + skip] = item;
|
|
1280
|
-
});
|
|
1281
|
-
if (skip === skipRef.current) {
|
|
1282
|
-
setData(items);
|
|
1283
|
-
setTotal(total2);
|
|
1284
|
-
onDataChange == null ? void 0 : onDataChange({ items, total: total2 });
|
|
1574
|
+
const requestData = useCallback3(
|
|
1575
|
+
(state) => {
|
|
1576
|
+
const { skip } = state;
|
|
1577
|
+
if (requestStarted.current) {
|
|
1578
|
+
clearTimeout(pendingRequest.current);
|
|
1579
|
+
pendingRequest.current = setTimeout(() => {
|
|
1580
|
+
requestData(state);
|
|
1581
|
+
}, 50);
|
|
1582
|
+
return;
|
|
1285
1583
|
}
|
|
1286
|
-
requestStarted.current =
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1584
|
+
requestStarted.current = true;
|
|
1585
|
+
getData(state).then(({ items, total: total2 }) => {
|
|
1586
|
+
items.forEach((item, index) => {
|
|
1587
|
+
dataCaching.current[index + skip] = item;
|
|
1588
|
+
});
|
|
1589
|
+
if (skip === skipRef.current) {
|
|
1590
|
+
setData(items);
|
|
1591
|
+
setTotal(total2);
|
|
1592
|
+
onDataChange == null ? void 0 : onDataChange({ items, total: total2 });
|
|
1593
|
+
}
|
|
1594
|
+
requestStarted.current = false;
|
|
1595
|
+
}).catch(() => {
|
|
1596
|
+
requestStarted.current = false;
|
|
1597
|
+
});
|
|
1598
|
+
},
|
|
1599
|
+
[getData]
|
|
1600
|
+
);
|
|
1601
|
+
const handleFilterChange = useCallback3((event) => {
|
|
1292
1602
|
const filter2 = event.filter.value;
|
|
1293
1603
|
if (filterProp !== void 0) {
|
|
1294
1604
|
onFilterChange == null ? void 0 : onFilterChange(filter2);
|
|
@@ -1300,7 +1610,7 @@ var SelectServer = ({
|
|
|
1300
1610
|
setData(loadingData3);
|
|
1301
1611
|
skipRef.current = 0;
|
|
1302
1612
|
}, []);
|
|
1303
|
-
const shouldRequestData =
|
|
1613
|
+
const shouldRequestData = useCallback3((skip) => {
|
|
1304
1614
|
for (let i = 0; i < pageSize3; i++) {
|
|
1305
1615
|
if (!dataCaching.current[skip + i]) {
|
|
1306
1616
|
return true;
|
|
@@ -1308,14 +1618,14 @@ var SelectServer = ({
|
|
|
1308
1618
|
}
|
|
1309
1619
|
return false;
|
|
1310
1620
|
}, []);
|
|
1311
|
-
const getCachedData =
|
|
1621
|
+
const getCachedData = useCallback3((skip) => {
|
|
1312
1622
|
const data2 = [];
|
|
1313
1623
|
for (let i = 0; i < pageSize3; i++) {
|
|
1314
1624
|
data2.push(dataCaching.current[i + skip] || emptyItem3);
|
|
1315
1625
|
}
|
|
1316
1626
|
return data2;
|
|
1317
1627
|
}, []);
|
|
1318
|
-
const pageChange =
|
|
1628
|
+
const pageChange = useCallback3(
|
|
1319
1629
|
(event) => {
|
|
1320
1630
|
if (filter !== void 0) {
|
|
1321
1631
|
const newSkip = event.page.skip;
|
|
@@ -1329,7 +1639,7 @@ var SelectServer = ({
|
|
|
1329
1639
|
},
|
|
1330
1640
|
[getCachedData, requestData, shouldRequestData, filter]
|
|
1331
1641
|
);
|
|
1332
|
-
const handleChange =
|
|
1642
|
+
const handleChange = useCallback3((event) => {
|
|
1333
1643
|
const value2 = event.target.value;
|
|
1334
1644
|
if (value2 && value2[textField3] === emptyItem3[textField3]) {
|
|
1335
1645
|
return;
|
|
@@ -1343,10 +1653,10 @@ var SelectServer = ({
|
|
|
1343
1653
|
const handleItemRender = (li, itemProps) => {
|
|
1344
1654
|
const itemChildren = renderItem == null ? void 0 : renderItem(itemProps.dataItem);
|
|
1345
1655
|
if (!itemChildren)
|
|
1346
|
-
return
|
|
1347
|
-
return
|
|
1656
|
+
return cloneElement5(li, li.props);
|
|
1657
|
+
return cloneElement5(li, li.props, itemChildren);
|
|
1348
1658
|
};
|
|
1349
|
-
|
|
1659
|
+
useEffect10(() => {
|
|
1350
1660
|
const pageSize4 = 10;
|
|
1351
1661
|
const loadingData4 = [];
|
|
1352
1662
|
while (loadingData4.length < pageSize4) {
|
|
@@ -1354,26 +1664,26 @@ var SelectServer = ({
|
|
|
1354
1664
|
}
|
|
1355
1665
|
setLoadingData(loadingData4);
|
|
1356
1666
|
}, []);
|
|
1357
|
-
|
|
1667
|
+
useEffect10(() => {
|
|
1358
1668
|
if (valueProp !== void 0) {
|
|
1359
1669
|
setValue(valueProp);
|
|
1360
1670
|
}
|
|
1361
1671
|
}, [valueProp]);
|
|
1362
|
-
|
|
1672
|
+
useEffect10(() => {
|
|
1363
1673
|
if (filterProp !== void 0) {
|
|
1364
1674
|
setFilter(filterProp);
|
|
1365
1675
|
}
|
|
1366
1676
|
}, [filterProp]);
|
|
1367
|
-
|
|
1677
|
+
useEffect10(() => {
|
|
1368
1678
|
requestData({ skip: 0, filter });
|
|
1369
1679
|
return () => {
|
|
1370
1680
|
resetCach();
|
|
1371
1681
|
};
|
|
1372
1682
|
}, [filter, requestData]);
|
|
1373
|
-
|
|
1683
|
+
useEffect10(() => {
|
|
1374
1684
|
setData(dataProp.items);
|
|
1375
1685
|
}, [dataProp]);
|
|
1376
|
-
return /* @__PURE__ */
|
|
1686
|
+
return /* @__PURE__ */ jsx26(
|
|
1377
1687
|
ComboBox2,
|
|
1378
1688
|
{
|
|
1379
1689
|
data,
|
|
@@ -1400,19 +1710,68 @@ var SelectServer = ({
|
|
|
1400
1710
|
var SelectServer_default = SelectServer;
|
|
1401
1711
|
|
|
1402
1712
|
// src/components/Select/Select.tsx
|
|
1403
|
-
import { jsx as
|
|
1713
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1404
1714
|
var Select = (props) => {
|
|
1405
|
-
return props.filterMode === "client" ? /* @__PURE__ */
|
|
1715
|
+
return props.filterMode === "client" ? /* @__PURE__ */ jsx27(SelectClient_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx27(SelectServer_default, __spreadValues({}, props));
|
|
1406
1716
|
};
|
|
1407
1717
|
var Select_default = Select;
|
|
1408
1718
|
|
|
1719
|
+
// src/components/Switch/Switch.tsx
|
|
1720
|
+
import clsx17 from "clsx";
|
|
1721
|
+
import { forwardRef as forwardRef23, useEffect as useEffect11, useState as useState9 } from "react";
|
|
1722
|
+
import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1723
|
+
var Switch = forwardRef23(
|
|
1724
|
+
(_a, ref) => {
|
|
1725
|
+
var _b = _a, { name, value: valueProp, defaultValue, onChange: onChangeProp, disabled } = _b, rest = __objRest(_b, ["name", "value", "defaultValue", "onChange", "disabled"]);
|
|
1726
|
+
var _a2;
|
|
1727
|
+
const [selftValue, setSelfValue] = useState9((_a2 = valueProp != null ? valueProp : defaultValue) != null ? _a2 : false);
|
|
1728
|
+
const handleChange = () => {
|
|
1729
|
+
if (disabled) {
|
|
1730
|
+
return;
|
|
1731
|
+
}
|
|
1732
|
+
onChangeProp == null ? void 0 : onChangeProp(!selftValue);
|
|
1733
|
+
setSelfValue(!selftValue);
|
|
1734
|
+
};
|
|
1735
|
+
useEffect11(() => {
|
|
1736
|
+
if (valueProp !== void 0) {
|
|
1737
|
+
setSelfValue(valueProp);
|
|
1738
|
+
}
|
|
1739
|
+
}, [valueProp]);
|
|
1740
|
+
return /* @__PURE__ */ jsxs18(
|
|
1741
|
+
"label",
|
|
1742
|
+
{
|
|
1743
|
+
htmlFor: name,
|
|
1744
|
+
className: clsx17(`${PREFIX_CLS}switch`, {
|
|
1745
|
+
[`${PREFIX_CLS}switch--checked`]: !!selftValue
|
|
1746
|
+
}),
|
|
1747
|
+
children: [
|
|
1748
|
+
/* @__PURE__ */ jsx28(
|
|
1749
|
+
"input",
|
|
1750
|
+
__spreadValues({
|
|
1751
|
+
type: "checkbox",
|
|
1752
|
+
ref,
|
|
1753
|
+
name,
|
|
1754
|
+
id: name,
|
|
1755
|
+
checked: selftValue,
|
|
1756
|
+
disabled,
|
|
1757
|
+
onChange: handleChange
|
|
1758
|
+
}, rest)
|
|
1759
|
+
),
|
|
1760
|
+
/* @__PURE__ */ jsx28("div", { className: `${PREFIX_CLS}switch__thumb` })
|
|
1761
|
+
]
|
|
1762
|
+
}
|
|
1763
|
+
);
|
|
1764
|
+
}
|
|
1765
|
+
);
|
|
1766
|
+
var Switch_default = Switch;
|
|
1767
|
+
|
|
1409
1768
|
// src/components/MultiSelect/MultiSelectClient.tsx
|
|
1410
1769
|
import { filterBy as filterBy2 } from "@progress/kendo-data-query";
|
|
1411
1770
|
import {
|
|
1412
1771
|
MultiSelect
|
|
1413
1772
|
} from "@progress/kendo-react-dropdowns";
|
|
1414
|
-
import { useEffect as
|
|
1415
|
-
import { jsx as
|
|
1773
|
+
import { useEffect as useEffect12, useRef as useRef11, useState as useState10 } from "react";
|
|
1774
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1416
1775
|
var textField2 = "text";
|
|
1417
1776
|
var keyField = "key";
|
|
1418
1777
|
var emptyItem2 = { [textField2]: "loading ...", [keyField]: 0 };
|
|
@@ -1436,14 +1795,14 @@ var SelectClient2 = ({
|
|
|
1436
1795
|
onChange,
|
|
1437
1796
|
onFilterChange
|
|
1438
1797
|
}) => {
|
|
1439
|
-
const [value, setValue] =
|
|
1440
|
-
const [filter, setFilter] =
|
|
1798
|
+
const [value, setValue] = useState10(valueProp);
|
|
1799
|
+
const [filter, setFilter] = useState10(filterProp);
|
|
1441
1800
|
const handleChange = (event) => {
|
|
1442
1801
|
onChange(event.target.value);
|
|
1443
1802
|
};
|
|
1444
1803
|
const pageSize3 = virtual == null ? void 0 : virtual.pageSize;
|
|
1445
|
-
const filteredData =
|
|
1446
|
-
const [state, setState] =
|
|
1804
|
+
const filteredData = useRef11([]);
|
|
1805
|
+
const [state, setState] = useState10({
|
|
1447
1806
|
skip: 0,
|
|
1448
1807
|
total: dataProp.total,
|
|
1449
1808
|
subsetData: dataProp.items.slice(0, pageSize3)
|
|
@@ -1468,18 +1827,18 @@ var SelectClient2 = ({
|
|
|
1468
1827
|
setState(__spreadProps(__spreadValues({}, state), { subsetData: newSubsetData, skip }));
|
|
1469
1828
|
}
|
|
1470
1829
|
};
|
|
1471
|
-
|
|
1830
|
+
useEffect12(() => {
|
|
1472
1831
|
setValue(valueProp);
|
|
1473
1832
|
}, [valueProp]);
|
|
1474
|
-
|
|
1833
|
+
useEffect12(() => {
|
|
1475
1834
|
setFilter(filterProp);
|
|
1476
1835
|
}, [filterProp]);
|
|
1477
|
-
|
|
1836
|
+
useEffect12(() => {
|
|
1478
1837
|
if (pageSize3) {
|
|
1479
1838
|
filteredData.current = dataProp.items.slice();
|
|
1480
1839
|
}
|
|
1481
1840
|
}, [dataProp]);
|
|
1482
|
-
return /* @__PURE__ */
|
|
1841
|
+
return /* @__PURE__ */ jsx29(
|
|
1483
1842
|
MultiSelect,
|
|
1484
1843
|
{
|
|
1485
1844
|
value,
|
|
@@ -1509,8 +1868,8 @@ var MultiSelectClient_default = SelectClient2;
|
|
|
1509
1868
|
import {
|
|
1510
1869
|
MultiSelect as MultiSelect2
|
|
1511
1870
|
} from "@progress/kendo-react-dropdowns";
|
|
1512
|
-
import { useCallback as
|
|
1513
|
-
import { jsx as
|
|
1871
|
+
import { useCallback as useCallback4, useEffect as useEffect13, useRef as useRef12, useState as useState11 } from "react";
|
|
1872
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1514
1873
|
var MultiSelectServer = ({
|
|
1515
1874
|
data: dataProp,
|
|
1516
1875
|
value: valueProp,
|
|
@@ -1529,45 +1888,48 @@ var MultiSelectServer = ({
|
|
|
1529
1888
|
getData
|
|
1530
1889
|
}) => {
|
|
1531
1890
|
var _a;
|
|
1532
|
-
const dataCaching =
|
|
1533
|
-
const pendingRequest =
|
|
1534
|
-
const requestStarted =
|
|
1891
|
+
const dataCaching = useRef12([]);
|
|
1892
|
+
const pendingRequest = useRef12();
|
|
1893
|
+
const requestStarted = useRef12(false);
|
|
1535
1894
|
const emptyItem3 = { [keyField2]: 0, [textField3]: "loading ..." };
|
|
1536
|
-
const [loadingData3, setLoadingData] =
|
|
1537
|
-
const [data, setData] =
|
|
1538
|
-
const [total, setTotal] =
|
|
1539
|
-
const [value, setValue] =
|
|
1540
|
-
const [filter, setFilter] =
|
|
1895
|
+
const [loadingData3, setLoadingData] = useState11([]);
|
|
1896
|
+
const [data, setData] = useState11(dataProp.items);
|
|
1897
|
+
const [total, setTotal] = useState11(0);
|
|
1898
|
+
const [value, setValue] = useState11(valueProp);
|
|
1899
|
+
const [filter, setFilter] = useState11(filterProp);
|
|
1541
1900
|
const pageSize3 = (_a = virtual == null ? void 0 : virtual.pageSize) != null ? _a : 10;
|
|
1542
|
-
const skipRef =
|
|
1901
|
+
const skipRef = useRef12(0);
|
|
1543
1902
|
const resetCach = () => {
|
|
1544
1903
|
dataCaching.current.length = 0;
|
|
1545
1904
|
};
|
|
1546
|
-
const requestData =
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
requestStarted.current = true;
|
|
1555
|
-
getData(state).then(({ items, total: total2 }) => {
|
|
1556
|
-
const { skip } = state;
|
|
1557
|
-
items.forEach((item, index) => {
|
|
1558
|
-
dataCaching.current[index + skip] = item;
|
|
1559
|
-
});
|
|
1560
|
-
if (skip === skipRef.current) {
|
|
1561
|
-
setData(items);
|
|
1562
|
-
setTotal(total2);
|
|
1563
|
-
onDataChange == null ? void 0 : onDataChange({ items, total: total2 });
|
|
1905
|
+
const requestData = useCallback4(
|
|
1906
|
+
(state) => {
|
|
1907
|
+
if (requestStarted.current) {
|
|
1908
|
+
clearTimeout(pendingRequest.current);
|
|
1909
|
+
pendingRequest.current = setTimeout(() => {
|
|
1910
|
+
requestData(state);
|
|
1911
|
+
}, 50);
|
|
1912
|
+
return;
|
|
1564
1913
|
}
|
|
1565
|
-
requestStarted.current =
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1914
|
+
requestStarted.current = true;
|
|
1915
|
+
getData(state).then(({ items, total: total2 }) => {
|
|
1916
|
+
const { skip } = state;
|
|
1917
|
+
items.forEach((item, index) => {
|
|
1918
|
+
dataCaching.current[index + skip] = item;
|
|
1919
|
+
});
|
|
1920
|
+
if (skip === skipRef.current) {
|
|
1921
|
+
setData(items);
|
|
1922
|
+
setTotal(total2);
|
|
1923
|
+
onDataChange == null ? void 0 : onDataChange({ items, total: total2 });
|
|
1924
|
+
}
|
|
1925
|
+
requestStarted.current = false;
|
|
1926
|
+
}).catch(() => {
|
|
1927
|
+
requestStarted.current = false;
|
|
1928
|
+
});
|
|
1929
|
+
},
|
|
1930
|
+
[getData]
|
|
1931
|
+
);
|
|
1932
|
+
const handleFilterChange = useCallback4((event) => {
|
|
1571
1933
|
const filter2 = event.filter.value;
|
|
1572
1934
|
resetCach();
|
|
1573
1935
|
requestData({ skip: 0, filter: filter2 });
|
|
@@ -1576,7 +1938,7 @@ var MultiSelectServer = ({
|
|
|
1576
1938
|
setFilter(filter2);
|
|
1577
1939
|
onFilterChange == null ? void 0 : onFilterChange(filter2);
|
|
1578
1940
|
}, []);
|
|
1579
|
-
const shouldRequestData =
|
|
1941
|
+
const shouldRequestData = useCallback4((skip) => {
|
|
1580
1942
|
for (let i = 0; i < pageSize3; i++) {
|
|
1581
1943
|
if (!dataCaching.current[skip + i]) {
|
|
1582
1944
|
return true;
|
|
@@ -1584,14 +1946,14 @@ var MultiSelectServer = ({
|
|
|
1584
1946
|
}
|
|
1585
1947
|
return false;
|
|
1586
1948
|
}, []);
|
|
1587
|
-
const getCachedData =
|
|
1949
|
+
const getCachedData = useCallback4((skip) => {
|
|
1588
1950
|
const data2 = [];
|
|
1589
1951
|
for (let i = 0; i < pageSize3; i++) {
|
|
1590
1952
|
data2.push(dataCaching.current[i + skip] || emptyItem3);
|
|
1591
1953
|
}
|
|
1592
1954
|
return data2;
|
|
1593
1955
|
}, []);
|
|
1594
|
-
const pageChange =
|
|
1956
|
+
const pageChange = useCallback4(
|
|
1595
1957
|
(event) => {
|
|
1596
1958
|
const newSkip = event.page.skip;
|
|
1597
1959
|
if (shouldRequestData(newSkip)) {
|
|
@@ -1603,7 +1965,7 @@ var MultiSelectServer = ({
|
|
|
1603
1965
|
},
|
|
1604
1966
|
[getCachedData, requestData, shouldRequestData, filter]
|
|
1605
1967
|
);
|
|
1606
|
-
const handleChange =
|
|
1968
|
+
const handleChange = useCallback4((event) => {
|
|
1607
1969
|
const value2 = event.target.value;
|
|
1608
1970
|
if (value2 && value2[textField3] === emptyItem3[textField3]) {
|
|
1609
1971
|
return;
|
|
@@ -1611,7 +1973,7 @@ var MultiSelectServer = ({
|
|
|
1611
1973
|
setValue(value2);
|
|
1612
1974
|
onChange(value2);
|
|
1613
1975
|
}, []);
|
|
1614
|
-
|
|
1976
|
+
useEffect13(() => {
|
|
1615
1977
|
const pageSize4 = 10;
|
|
1616
1978
|
const loadingData4 = [];
|
|
1617
1979
|
while (loadingData4.length < pageSize4) {
|
|
@@ -1619,22 +1981,22 @@ var MultiSelectServer = ({
|
|
|
1619
1981
|
}
|
|
1620
1982
|
setLoadingData(loadingData4);
|
|
1621
1983
|
}, []);
|
|
1622
|
-
|
|
1984
|
+
useEffect13(() => {
|
|
1623
1985
|
setData(dataProp.items);
|
|
1624
1986
|
}, [dataProp]);
|
|
1625
|
-
|
|
1987
|
+
useEffect13(() => {
|
|
1626
1988
|
setValue(valueProp);
|
|
1627
1989
|
}, [valueProp]);
|
|
1628
|
-
|
|
1990
|
+
useEffect13(() => {
|
|
1629
1991
|
setFilter(filterProp);
|
|
1630
1992
|
}, [filterProp]);
|
|
1631
|
-
|
|
1993
|
+
useEffect13(() => {
|
|
1632
1994
|
requestData({ skip: 0, filter });
|
|
1633
1995
|
return () => {
|
|
1634
1996
|
resetCach();
|
|
1635
1997
|
};
|
|
1636
1998
|
}, [filter, requestData]);
|
|
1637
|
-
return /* @__PURE__ */
|
|
1999
|
+
return /* @__PURE__ */ jsx30(
|
|
1638
2000
|
MultiSelect2,
|
|
1639
2001
|
{
|
|
1640
2002
|
data,
|
|
@@ -1660,144 +2022,170 @@ var MultiSelectServer = ({
|
|
|
1660
2022
|
var MultiSelectServer_default = MultiSelectServer;
|
|
1661
2023
|
|
|
1662
2024
|
// src/components/MultiSelect/MultiSelect.tsx
|
|
1663
|
-
import { jsx as
|
|
2025
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1664
2026
|
var MultiSelect3 = (props) => {
|
|
1665
|
-
return props.filterMode === "client" ? /* @__PURE__ */
|
|
2027
|
+
return props.filterMode === "client" ? /* @__PURE__ */ jsx31(MultiSelectClient_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx31(MultiSelectServer_default, __spreadValues({}, props));
|
|
1666
2028
|
};
|
|
1667
2029
|
var MultiSelect_default = MultiSelect3;
|
|
1668
2030
|
|
|
1669
|
-
// src/
|
|
1670
|
-
import {
|
|
2031
|
+
// src/components/Field/Field.tsx
|
|
2032
|
+
import { forwardRef as forwardRef24 } from "react";
|
|
2033
|
+
import { jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2034
|
+
var Field = forwardRef24(({ children, label }, ref) => {
|
|
2035
|
+
{
|
|
2036
|
+
const prefixCls = PREFIX_CLS;
|
|
2037
|
+
return /* @__PURE__ */ jsxs19("div", { ref, className: clsx_default(`${prefixCls}field`), children: [
|
|
2038
|
+
/* @__PURE__ */ jsx32("div", { className: `${prefixCls}field__label`, children: label }),
|
|
2039
|
+
/* @__PURE__ */ jsx32("div", { className: `${prefixCls}field__content`, children })
|
|
2040
|
+
] });
|
|
2041
|
+
}
|
|
2042
|
+
});
|
|
2043
|
+
var Field_default = Field;
|
|
1671
2044
|
|
|
1672
|
-
// src/
|
|
1673
|
-
import {
|
|
2045
|
+
// src/components/List/List.tsx
|
|
2046
|
+
import { forwardRef as forwardRef25 } from "react";
|
|
2047
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2048
|
+
var List = forwardRef25((_a, ref) => {
|
|
2049
|
+
var _b = _a, { as: Component = "div", children } = _b, rest = __objRest(_b, ["as", "children"]);
|
|
2050
|
+
return /* @__PURE__ */ jsx33(Component, __spreadProps(__spreadValues({ ref, className: "us-list" }, rest), { children }));
|
|
2051
|
+
});
|
|
2052
|
+
var List_default = List;
|
|
1674
2053
|
|
|
1675
|
-
// src/
|
|
1676
|
-
import {
|
|
1677
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect10;
|
|
1678
|
-
var useIsomorphicLayoutEffect_default = useIsomorphicLayoutEffect;
|
|
2054
|
+
// src/components/List/ListGroup.tsx
|
|
2055
|
+
import { forwardRef as forwardRef27 } from "react";
|
|
1679
2056
|
|
|
1680
|
-
// src/
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
2057
|
+
// src/components/List/ListItem.tsx
|
|
2058
|
+
import { forwardRef as forwardRef26 } from "react";
|
|
2059
|
+
import { jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2060
|
+
var ListItem = forwardRef26(
|
|
2061
|
+
(_a, ref) => {
|
|
2062
|
+
var _b = _a, {
|
|
2063
|
+
as: Component = "div",
|
|
2064
|
+
className,
|
|
2065
|
+
title,
|
|
2066
|
+
startContent,
|
|
2067
|
+
endContent,
|
|
2068
|
+
level = 1,
|
|
2069
|
+
hoverable,
|
|
2070
|
+
selected,
|
|
2071
|
+
disabled,
|
|
2072
|
+
style,
|
|
2073
|
+
onClick
|
|
2074
|
+
} = _b, rest = __objRest(_b, [
|
|
2075
|
+
"as",
|
|
2076
|
+
"className",
|
|
2077
|
+
"title",
|
|
2078
|
+
"startContent",
|
|
2079
|
+
"endContent",
|
|
2080
|
+
"level",
|
|
2081
|
+
"hoverable",
|
|
2082
|
+
"selected",
|
|
2083
|
+
"disabled",
|
|
2084
|
+
"style",
|
|
2085
|
+
"onClick"
|
|
2086
|
+
]);
|
|
2087
|
+
const prefixCls = PREFIX_CLS;
|
|
2088
|
+
const handleClick = (event) => {
|
|
2089
|
+
onClick == null ? void 0 : onClick(event);
|
|
2090
|
+
};
|
|
2091
|
+
return /* @__PURE__ */ jsxs20(
|
|
2092
|
+
Component,
|
|
2093
|
+
__spreadProps(__spreadValues({
|
|
2094
|
+
ref,
|
|
2095
|
+
className: clsx_default(
|
|
2096
|
+
`${prefixCls}list-item`,
|
|
2097
|
+
{
|
|
2098
|
+
[`${prefixCls}list-item--selected`]: selected,
|
|
2099
|
+
[`${prefixCls}list-item--hoverable`]: hoverable,
|
|
2100
|
+
[`${prefixCls}list-item--disabled`]: disabled
|
|
2101
|
+
},
|
|
2102
|
+
className
|
|
2103
|
+
),
|
|
2104
|
+
style: __spreadValues({
|
|
2105
|
+
paddingLeft: level <= 1 ? `var(--${prefixCls}list-item-padding-x)` : `calc(${level} * var(--${prefixCls}list-item-padding-level))`
|
|
2106
|
+
}, style),
|
|
2107
|
+
onClick: handleClick
|
|
2108
|
+
}, rest), {
|
|
2109
|
+
children: [
|
|
2110
|
+
hoverable && /* @__PURE__ */ jsx34("div", { className: `${prefixCls}overlay` }),
|
|
2111
|
+
startContent && /* @__PURE__ */ jsx34("div", { className: `${prefixCls}list-item__start-content`, children: startContent }),
|
|
2112
|
+
/* @__PURE__ */ jsx34("div", { className: `${prefixCls}list-item__content`, children: /* @__PURE__ */ jsx34("span", { className: `${prefixCls}list-item__title`, children: title }) }),
|
|
2113
|
+
endContent && /* @__PURE__ */ jsx34("div", { className: `${prefixCls}list-item__end-content`, children: endContent })
|
|
2114
|
+
]
|
|
2115
|
+
})
|
|
2116
|
+
);
|
|
1735
2117
|
}
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
// src/hooks/usePrevious.tsx
|
|
1739
|
-
import { useEffect as useEffect12, useRef as useRef12 } from "react";
|
|
1740
|
-
var usePrevious = (value) => {
|
|
1741
|
-
const ref = useRef12();
|
|
1742
|
-
useEffect12(() => {
|
|
1743
|
-
ref.current = value;
|
|
1744
|
-
});
|
|
1745
|
-
return ref.current;
|
|
1746
|
-
};
|
|
2118
|
+
);
|
|
2119
|
+
var ListItem_default = ListItem;
|
|
1747
2120
|
|
|
1748
|
-
// src/
|
|
1749
|
-
import {
|
|
1750
|
-
var
|
|
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
|
-
|
|
1789
|
-
}
|
|
2121
|
+
// src/components/List/ListGroup.tsx
|
|
2122
|
+
import { Fragment as Fragment3, jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2123
|
+
var ListGroup = forwardRef27(
|
|
2124
|
+
(_a, ref) => {
|
|
2125
|
+
var _b = _a, {
|
|
2126
|
+
children,
|
|
2127
|
+
startContent,
|
|
2128
|
+
endContent,
|
|
2129
|
+
expandVisible = true,
|
|
2130
|
+
expandPosition = "end",
|
|
2131
|
+
isOpen,
|
|
2132
|
+
onOpen,
|
|
2133
|
+
onClose,
|
|
2134
|
+
onToggle
|
|
2135
|
+
} = _b, rest = __objRest(_b, [
|
|
2136
|
+
"children",
|
|
2137
|
+
"startContent",
|
|
2138
|
+
"endContent",
|
|
2139
|
+
"expandVisible",
|
|
2140
|
+
"expandPosition",
|
|
2141
|
+
"isOpen",
|
|
2142
|
+
"onOpen",
|
|
2143
|
+
"onClose",
|
|
2144
|
+
"onToggle"
|
|
2145
|
+
]);
|
|
2146
|
+
const disclosure = isOpen !== void 0 ? { isOpen, onOpen, onClose, onToggle } : useDisclosure_default();
|
|
2147
|
+
return /* @__PURE__ */ jsx35("div", { className: "us-list-group", children: /* @__PURE__ */ jsxs21(Collapse_default, __spreadProps(__spreadValues({}, disclosure), { children: [
|
|
2148
|
+
/* @__PURE__ */ jsx35(CollapseTrigger_default, { children: /* @__PURE__ */ jsx35(
|
|
2149
|
+
ListItem_default,
|
|
2150
|
+
__spreadValues({
|
|
2151
|
+
ref,
|
|
2152
|
+
startContent: /* @__PURE__ */ jsxs21(Fragment3, { children: [
|
|
2153
|
+
expandVisible && expandPosition === "start" && /* @__PURE__ */ jsx35(Icon_default, { children: disclosure.isOpen ? /* @__PURE__ */ jsx35(ChevronUpIcon_default, {}) : /* @__PURE__ */ jsx35(ChevronDownIcon_default, {}) }),
|
|
2154
|
+
startContent
|
|
2155
|
+
] }),
|
|
2156
|
+
endContent: /* @__PURE__ */ jsxs21(Fragment3, { children: [
|
|
2157
|
+
endContent,
|
|
2158
|
+
expandVisible && expandPosition === "end" && /* @__PURE__ */ jsx35(Icon_default, { children: disclosure.isOpen ? /* @__PURE__ */ jsx35(ChevronUpIcon_default, {}) : /* @__PURE__ */ jsx35(ChevronDownIcon_default, {}) })
|
|
2159
|
+
] })
|
|
2160
|
+
}, rest)
|
|
2161
|
+
) }),
|
|
2162
|
+
/* @__PURE__ */ jsx35(CollapseContent_default, { children: /* @__PURE__ */ jsx35("div", { children: /* @__PURE__ */ jsx35(List_default, { children }) }) })
|
|
2163
|
+
] })) });
|
|
2164
|
+
}
|
|
2165
|
+
);
|
|
2166
|
+
var ListGroup_default = ListGroup;
|
|
1790
2167
|
export {
|
|
2168
|
+
Accordion_default as Accordion,
|
|
2169
|
+
AccordionContent_default as AccordionContent,
|
|
2170
|
+
AccordionHeader_default as AccordionHeader,
|
|
2171
|
+
AccordionItem_default as AccordionItem,
|
|
2172
|
+
AccordionPanel_default as AccordionPanel,
|
|
1791
2173
|
Backdrop_default as Backdrop,
|
|
1792
2174
|
Badge_default as Badge,
|
|
1793
2175
|
Button,
|
|
2176
|
+
Card_default as Card,
|
|
2177
|
+
CardHeader_default as CardHeader,
|
|
1794
2178
|
Chip_default as Chip,
|
|
1795
2179
|
Collapse_default as Collapse,
|
|
1796
2180
|
CollapseContent_default as CollapseContent,
|
|
1797
2181
|
CollapseContext_default as CollapseContext,
|
|
1798
2182
|
CollapseTrigger_default as CollapseTrigger,
|
|
1799
2183
|
Drawer_default as Drawer,
|
|
2184
|
+
Field_default as Field,
|
|
1800
2185
|
Icon_default as Icon,
|
|
2186
|
+
List_default as List,
|
|
2187
|
+
ListGroup_default as ListGroup,
|
|
2188
|
+
ListItem_default as ListItem,
|
|
1801
2189
|
Menu_default as Menu,
|
|
1802
2190
|
MenuContext_default as MenuContext,
|
|
1803
2191
|
MenuGroup_default as MenuGroup,
|
|
@@ -1806,13 +2194,19 @@ export {
|
|
|
1806
2194
|
MenuValueContext_default as MenuValueContext,
|
|
1807
2195
|
MultiSelect_default as MultiSelect,
|
|
1808
2196
|
Portal_default as Portal,
|
|
2197
|
+
ScrollArea_default as ScrollArea,
|
|
1809
2198
|
Select_default as Select,
|
|
2199
|
+
Switch_default as Switch,
|
|
1810
2200
|
Tab,
|
|
1811
2201
|
Tabs,
|
|
1812
2202
|
Toolbar_default as Toolbar,
|
|
1813
2203
|
Transition_default as Transition,
|
|
2204
|
+
clsx_default as clsx,
|
|
1814
2205
|
getOpenValuesByPathname,
|
|
2206
|
+
scrollToItem,
|
|
2207
|
+
useAccordionItem,
|
|
1815
2208
|
useCollapse,
|
|
2209
|
+
useDisclosure_default as useDisclosure,
|
|
1816
2210
|
useLocalStorage,
|
|
1817
2211
|
useMenu,
|
|
1818
2212
|
useMenuItemValue,
|