@ceed/cds 1.40.3-next.1 → 1.40.3-next.3
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/components/Autocomplete/Autocomplete.d.ts +4 -4
- package/dist/components/Autocomplete/index.d.ts +2 -1
- package/dist/components/DataTable/components.d.ts +1 -1
- package/dist/components/DataTable/hooks.d.ts +6 -7
- package/dist/components/DataTable/types.d.ts +7 -0
- package/dist/components/DataTable/utils.d.ts +5 -0
- package/dist/components/IconMenuButton/IconMenuButton.d.ts +6 -5
- package/dist/components/IconMenuButton/index.d.ts +2 -1
- package/dist/components/Modal/Modal.d.ts +1 -4
- package/dist/components/Select/Select.d.ts +3 -4
- package/dist/components/Textarea/Textarea.d.ts +1 -4
- package/dist/components/Textarea/index.d.ts +2 -1
- package/dist/components/data-display/DataTable.md +4 -0
- package/dist/index.browser.js +6 -6
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +742 -649
- package/dist/index.js +255 -162
- package/dist/libs/slot-props.d.ts +22 -0
- package/framer/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -344,7 +344,7 @@ function Alert(inProps) {
|
|
|
344
344
|
Alert.displayName = "Alert";
|
|
345
345
|
|
|
346
346
|
// src/components/Autocomplete/Autocomplete.tsx
|
|
347
|
-
var
|
|
347
|
+
var import_react7 = __toESM(require("react"));
|
|
348
348
|
var import_joy10 = require("@mui/joy");
|
|
349
349
|
var import_base = require("@mui/base");
|
|
350
350
|
var import_Close = __toESM(require("@mui/icons-material/Close"));
|
|
@@ -441,6 +441,37 @@ function useControlledState(controlledValue, defaultValue, onChange) {
|
|
|
441
441
|
return [displayValue, handleChange, isControlled];
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
+
// src/libs/slot-props.ts
|
|
445
|
+
var import_react6 = require("react");
|
|
446
|
+
function assignRef(ref, value) {
|
|
447
|
+
if (typeof ref === "function") ref(value);
|
|
448
|
+
else if (ref) ref.current = value;
|
|
449
|
+
}
|
|
450
|
+
function mergeRefs(...refs) {
|
|
451
|
+
const live = refs.filter((r) => r != null);
|
|
452
|
+
if (live.length === 0) return void 0;
|
|
453
|
+
if (live.length === 1) return live[0];
|
|
454
|
+
return (value) => live.forEach((r) => assignRef(r, value));
|
|
455
|
+
}
|
|
456
|
+
function useMergedRef(a, b) {
|
|
457
|
+
return (0, import_react6.useMemo)(() => mergeRefs(a, b), [a, b]);
|
|
458
|
+
}
|
|
459
|
+
function useSlotRef(slotProp, ref) {
|
|
460
|
+
const isFunctionForm = typeof slotProp === "function";
|
|
461
|
+
const slotRef = isFunctionForm ? void 0 : slotProp?.ref;
|
|
462
|
+
const mergedRef = useMergedRef(slotRef, ref);
|
|
463
|
+
return (0, import_react6.useMemo)(() => {
|
|
464
|
+
if (isFunctionForm) {
|
|
465
|
+
return ((ownerState) => {
|
|
466
|
+
const resolved = slotProp(ownerState);
|
|
467
|
+
const merged = mergeRefs(resolved.ref, ref);
|
|
468
|
+
return merged ? { ...resolved, ref: merged } : { ...resolved };
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
return mergedRef ? { ...slotProp, ref: mergedRef } : { ...slotProp };
|
|
472
|
+
}, [isFunctionForm, slotProp, mergedRef, ref]);
|
|
473
|
+
}
|
|
474
|
+
|
|
444
475
|
// src/components/Autocomplete/Autocomplete.tsx
|
|
445
476
|
var AutocompletePopper = (0, import_joy10.styled)(import_base2.Popper, {
|
|
446
477
|
name: "Autocomplete",
|
|
@@ -453,7 +484,7 @@ var itemHeightMap = {
|
|
|
453
484
|
md: { default: 36, secondary: 55 },
|
|
454
485
|
lg: { default: 44, secondary: 65 }
|
|
455
486
|
};
|
|
456
|
-
var AutocompleteListBox =
|
|
487
|
+
var AutocompleteListBox = import_react7.default.forwardRef((props, ref) => {
|
|
457
488
|
const {
|
|
458
489
|
anchorEl,
|
|
459
490
|
open,
|
|
@@ -463,13 +494,13 @@ var AutocompleteListBox = import_react6.default.forwardRef((props, ref) => {
|
|
|
463
494
|
ownerState: { loading, size: fontSize = "md" },
|
|
464
495
|
...innerProps
|
|
465
496
|
} = props;
|
|
466
|
-
const parentRef = (0,
|
|
497
|
+
const parentRef = (0, import_react7.useRef)(null);
|
|
467
498
|
const isGrouped = children[0].every((child) => child.hasOwnProperty("group"));
|
|
468
|
-
const itemHeight = (0,
|
|
499
|
+
const itemHeight = (0, import_react7.useMemo)(() => {
|
|
469
500
|
const heights = itemHeightMap[fontSize ?? "md"];
|
|
470
501
|
return hasSecondaryText ? heights.secondary : heights.default;
|
|
471
502
|
}, [fontSize, hasSecondaryText]);
|
|
472
|
-
const renderTargets = (0,
|
|
503
|
+
const renderTargets = (0, import_react7.useMemo)(() => {
|
|
473
504
|
if (loading) {
|
|
474
505
|
return [children[1]];
|
|
475
506
|
}
|
|
@@ -478,7 +509,7 @@ var AutocompleteListBox = import_react6.default.forwardRef((props, ref) => {
|
|
|
478
509
|
}
|
|
479
510
|
if (isGrouped) {
|
|
480
511
|
return children[0].flatMap((child) => [
|
|
481
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ import_react7.default.createElement(import_joy10.ListSubheader, { key: child.key, component: "li" }, child.group),
|
|
482
513
|
...child.children
|
|
483
514
|
]);
|
|
484
515
|
}
|
|
@@ -492,12 +523,12 @@ var AutocompleteListBox = import_react6.default.forwardRef((props, ref) => {
|
|
|
492
523
|
overscan: 5
|
|
493
524
|
});
|
|
494
525
|
const items = virtualizer.getVirtualItems();
|
|
495
|
-
(0,
|
|
526
|
+
(0, import_react7.useEffect)(() => {
|
|
496
527
|
if (open) {
|
|
497
528
|
virtualizer.measure();
|
|
498
529
|
}
|
|
499
530
|
}, [open, virtualizer]);
|
|
500
|
-
return /* @__PURE__ */
|
|
531
|
+
return /* @__PURE__ */ import_react7.default.createElement(AutocompletePopper, { ref, anchorEl, open, modifiers }, /* @__PURE__ */ import_react7.default.createElement(import_joy10.AutocompleteListbox, { ...innerProps, size: fontSize }, /* @__PURE__ */ import_react7.default.createElement("div", { ref: parentRef, style: { overflow: "auto" } }, /* @__PURE__ */ import_react7.default.createElement(
|
|
501
532
|
"div",
|
|
502
533
|
{
|
|
503
534
|
style: {
|
|
@@ -506,7 +537,7 @@ var AutocompleteListBox = import_react6.default.forwardRef((props, ref) => {
|
|
|
506
537
|
}
|
|
507
538
|
},
|
|
508
539
|
items.map(
|
|
509
|
-
({ index, size, start, key }) =>
|
|
540
|
+
({ index, size, start, key }) => import_react7.default.cloneElement(renderTargets[index], {
|
|
510
541
|
key,
|
|
511
542
|
style: {
|
|
512
543
|
position: "absolute",
|
|
@@ -518,7 +549,7 @@ var AutocompleteListBox = import_react6.default.forwardRef((props, ref) => {
|
|
|
518
549
|
transform: `translateY(${start}px)`,
|
|
519
550
|
overflow: "visible"
|
|
520
551
|
},
|
|
521
|
-
children: /* @__PURE__ */
|
|
552
|
+
children: /* @__PURE__ */ import_react7.default.createElement(
|
|
522
553
|
"div",
|
|
523
554
|
{
|
|
524
555
|
style: {
|
|
@@ -561,7 +592,7 @@ var autocompleteFilterOptions = (0, import_base.createFilterOptions)({
|
|
|
561
592
|
}
|
|
562
593
|
});
|
|
563
594
|
var getOptionLabel = (option) => `${option.label ?? ""}`;
|
|
564
|
-
function
|
|
595
|
+
function AutocompleteInner(props, ref) {
|
|
565
596
|
const {
|
|
566
597
|
label,
|
|
567
598
|
error,
|
|
@@ -580,7 +611,7 @@ function Autocomplete(props) {
|
|
|
580
611
|
const [rawValue, setValue] = useControlledState(
|
|
581
612
|
props.value,
|
|
582
613
|
props.defaultValue ?? null,
|
|
583
|
-
(0,
|
|
614
|
+
(0, import_react7.useCallback)(
|
|
584
615
|
(value2) => onChange?.({
|
|
585
616
|
target: {
|
|
586
617
|
value: value2,
|
|
@@ -591,7 +622,7 @@ function Autocomplete(props) {
|
|
|
591
622
|
)
|
|
592
623
|
);
|
|
593
624
|
const _value = rawValue ?? (props.multiple ? EMPTY_MULTIPLE_VALUE : "");
|
|
594
|
-
const options = (0,
|
|
625
|
+
const options = (0, import_react7.useMemo)(
|
|
595
626
|
() => props.options.map((option) => {
|
|
596
627
|
if (typeof option !== "object") {
|
|
597
628
|
return {
|
|
@@ -603,19 +634,19 @@ function Autocomplete(props) {
|
|
|
603
634
|
}),
|
|
604
635
|
[props.options]
|
|
605
636
|
);
|
|
606
|
-
const optionMap = (0,
|
|
637
|
+
const optionMap = (0, import_react7.useMemo)(() => {
|
|
607
638
|
const map = /* @__PURE__ */ new Map();
|
|
608
639
|
options.forEach((option) => {
|
|
609
640
|
map.set(option.value, option);
|
|
610
641
|
});
|
|
611
642
|
return map;
|
|
612
643
|
}, [options]);
|
|
613
|
-
const value = (0,
|
|
644
|
+
const value = (0, import_react7.useMemo)(() => {
|
|
614
645
|
if (props.loading) {
|
|
615
646
|
return {
|
|
616
647
|
value: "",
|
|
617
648
|
label: "",
|
|
618
|
-
startDecorator: /* @__PURE__ */
|
|
649
|
+
startDecorator: /* @__PURE__ */ import_react7.default.createElement(import_joy10.CircularProgress, { size: "sm", color: "neutral", variant: "plain", thickness: 3 })
|
|
619
650
|
};
|
|
620
651
|
}
|
|
621
652
|
if (Array.isArray(_value)) {
|
|
@@ -623,31 +654,33 @@ function Autocomplete(props) {
|
|
|
623
654
|
}
|
|
624
655
|
return optionMap.get(_value);
|
|
625
656
|
}, [_value, optionMap, props.loading]);
|
|
626
|
-
const applySize = (0,
|
|
657
|
+
const applySize = (0, import_react7.useCallback)(
|
|
627
658
|
(node) => {
|
|
628
|
-
return
|
|
659
|
+
return import_react7.default.isValidElement(node) && !props.loading ? import_react7.default.cloneElement(node, { ...{ size } }) : node;
|
|
629
660
|
},
|
|
630
661
|
[size, props.loading]
|
|
631
662
|
);
|
|
632
|
-
const startDecorator = (0,
|
|
663
|
+
const startDecorator = (0, import_react7.useMemo)(
|
|
633
664
|
() => applySize(value?.startDecorator || props.startDecorator),
|
|
634
665
|
[value, applySize, props.startDecorator]
|
|
635
666
|
);
|
|
636
|
-
const endDecorator = (0,
|
|
667
|
+
const endDecorator = (0, import_react7.useMemo)(
|
|
637
668
|
() => applySize(value?.endDecorator || props.endDecorator),
|
|
638
669
|
[value, applySize, props.endDecorator]
|
|
639
670
|
);
|
|
640
|
-
const
|
|
671
|
+
const inputSlotProps = useSlotRef(props.slotProps?.input, ref);
|
|
672
|
+
const slotProps = (0, import_react7.useMemo)(
|
|
641
673
|
() => ({
|
|
642
674
|
...props.slotProps,
|
|
643
675
|
listbox: {
|
|
644
676
|
...props.slotProps?.listbox,
|
|
645
677
|
hasSecondaryText: options.some((opt) => opt.secondaryText)
|
|
646
|
-
}
|
|
678
|
+
},
|
|
679
|
+
input: inputSlotProps
|
|
647
680
|
}),
|
|
648
|
-
[options, props.slotProps]
|
|
681
|
+
[options, props.slotProps, inputSlotProps]
|
|
649
682
|
);
|
|
650
|
-
const handleChange = (0,
|
|
683
|
+
const handleChange = (0, import_react7.useCallback)(
|
|
651
684
|
(event, value2) => {
|
|
652
685
|
const newValue = value2;
|
|
653
686
|
const _value2 = Array.isArray(newValue) ? newValue.map((value3) => value3.value) : newValue?.value;
|
|
@@ -664,7 +697,7 @@ function Autocomplete(props) {
|
|
|
664
697
|
},
|
|
665
698
|
[onChangeComplete, setValue, optionMap]
|
|
666
699
|
);
|
|
667
|
-
const autocomplete = /* @__PURE__ */
|
|
700
|
+
const autocomplete = /* @__PURE__ */ import_react7.default.createElement(
|
|
668
701
|
import_joy10.Autocomplete,
|
|
669
702
|
{
|
|
670
703
|
...innerProps,
|
|
@@ -679,10 +712,10 @@ function Autocomplete(props) {
|
|
|
679
712
|
endDecorator,
|
|
680
713
|
getOptionLabel,
|
|
681
714
|
renderTags: (tags, getTagProps) => tags.map((tag, index) => {
|
|
682
|
-
const { onClick, ...rest } = getTagProps({ index });
|
|
715
|
+
const { onClick, key, ...rest } = getTagProps({ index });
|
|
683
716
|
return applySize(
|
|
684
|
-
/* @__PURE__ */
|
|
685
|
-
/* @__PURE__ */
|
|
717
|
+
/* @__PURE__ */ import_react7.default.createElement(Chip_default, { key, color: "primary", ...rest }, /* @__PURE__ */ import_react7.default.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2, py: 0.5 }, tag.value, applySize(
|
|
718
|
+
/* @__PURE__ */ import_react7.default.createElement(AutocompleteTagDelete, { color: "primary", variant: "soft", onClick }, /* @__PURE__ */ import_react7.default.createElement(import_Close.default, null))
|
|
686
719
|
)))
|
|
687
720
|
);
|
|
688
721
|
}),
|
|
@@ -691,30 +724,33 @@ function Autocomplete(props) {
|
|
|
691
724
|
},
|
|
692
725
|
slotProps,
|
|
693
726
|
filterOptions: autocompleteFilterOptions,
|
|
694
|
-
renderOption: (props2, option) =>
|
|
695
|
-
|
|
696
|
-
{
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
applySize(option.label)
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
727
|
+
renderOption: (props2, option) => {
|
|
728
|
+
const { key, ...optionProps } = props2;
|
|
729
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_joy10.AutocompleteOption, { key, ...optionProps }, option.startDecorator && /* @__PURE__ */ import_react7.default.createElement(
|
|
730
|
+
import_joy10.ListItemDecorator,
|
|
731
|
+
{
|
|
732
|
+
sx: (theme) => ({
|
|
733
|
+
marginInlineEnd: `var(--Input-gap, ${theme.spacing(1)})`
|
|
734
|
+
})
|
|
735
|
+
},
|
|
736
|
+
applySize(option.startDecorator)
|
|
737
|
+
), option.secondaryText ? /* @__PURE__ */ import_react7.default.createElement(import_joy10.ListItemContent, { sx: { gap: 0.5 } }, /* @__PURE__ */ import_react7.default.createElement(import_joy10.Typography, { level: "inherit" }, applySize(option.label)), /* @__PURE__ */ import_react7.default.createElement(import_joy10.Typography, { level: secondaryTextLevelMap[size ?? "md"], textColor: "text.tertiary" }, option.secondaryText)) : (
|
|
738
|
+
// TODO: haulla에서 사용할 때, label을 ReactNode로 넘기면 에러가 발생함....
|
|
739
|
+
applySize(option.label)
|
|
740
|
+
), option.endDecorator && /* @__PURE__ */ import_react7.default.createElement(
|
|
741
|
+
import_joy10.ListItemDecorator,
|
|
742
|
+
{
|
|
743
|
+
sx: (theme) => ({
|
|
744
|
+
marginInlineStart: `var(--Input-gap, ${theme.spacing(1)})`
|
|
745
|
+
})
|
|
746
|
+
},
|
|
747
|
+
applySize(option.endDecorator)
|
|
748
|
+
));
|
|
749
|
+
},
|
|
714
750
|
renderGroup: (params) => params
|
|
715
751
|
}
|
|
716
752
|
);
|
|
717
|
-
return /* @__PURE__ */
|
|
753
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
718
754
|
FormControl_default,
|
|
719
755
|
{
|
|
720
756
|
required,
|
|
@@ -725,18 +761,19 @@ function Autocomplete(props) {
|
|
|
725
761
|
sx,
|
|
726
762
|
className
|
|
727
763
|
},
|
|
728
|
-
label && /* @__PURE__ */
|
|
764
|
+
label && /* @__PURE__ */ import_react7.default.createElement(FormLabel_default, null, label),
|
|
729
765
|
autocomplete,
|
|
730
|
-
helperText && /* @__PURE__ */
|
|
766
|
+
helperText && /* @__PURE__ */ import_react7.default.createElement(FormHelperText_default, null, helperText)
|
|
731
767
|
);
|
|
732
768
|
}
|
|
769
|
+
var Autocomplete = import_react7.default.forwardRef(AutocompleteInner);
|
|
733
770
|
Autocomplete.displayName = "Autocomplete";
|
|
734
771
|
|
|
735
772
|
// src/components/Autocomplete/index.ts
|
|
736
773
|
var Autocomplete_default = Autocomplete;
|
|
737
774
|
|
|
738
775
|
// src/components/Avatar/Avatar.tsx
|
|
739
|
-
var
|
|
776
|
+
var import_react8 = __toESM(require("react"));
|
|
740
777
|
var import_joy11 = require("@mui/joy");
|
|
741
778
|
var StyledAvatar = (0, import_joy11.styled)(import_joy11.Avatar, {
|
|
742
779
|
name: "Avatar",
|
|
@@ -758,19 +795,19 @@ var defaultGetInitial = (name) => {
|
|
|
758
795
|
return (firstName.charAt(0) + lastName.charAt(0)).toUpperCase();
|
|
759
796
|
}
|
|
760
797
|
};
|
|
761
|
-
var Avatar = (0,
|
|
798
|
+
var Avatar = (0, import_react8.forwardRef)(function Avatar2(inProps, ref) {
|
|
762
799
|
const props = (0, import_joy11.useThemeProps)({
|
|
763
800
|
props: inProps,
|
|
764
801
|
name: "Avatar"
|
|
765
802
|
});
|
|
766
803
|
const { children, getInitial = defaultGetInitial, ...inheritProps } = props;
|
|
767
|
-
const calcChildren = (0,
|
|
804
|
+
const calcChildren = (0, import_react8.useMemo)(() => {
|
|
768
805
|
if (typeof children === "string") {
|
|
769
806
|
return getInitial?.(children) ?? "";
|
|
770
807
|
}
|
|
771
808
|
return children;
|
|
772
809
|
}, [children, getInitial]);
|
|
773
|
-
return /* @__PURE__ */
|
|
810
|
+
return /* @__PURE__ */ import_react8.default.createElement(StyledAvatar, { ...inheritProps, children: calcChildren, ref });
|
|
774
811
|
});
|
|
775
812
|
|
|
776
813
|
// src/components/Box/Box.tsx
|
|
@@ -784,16 +821,16 @@ Box.displayName = "Box";
|
|
|
784
821
|
var Box_default = Box;
|
|
785
822
|
|
|
786
823
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
787
|
-
var
|
|
824
|
+
var import_react11 = __toESM(require("react"));
|
|
788
825
|
var import_joy16 = require("@mui/joy");
|
|
789
826
|
|
|
790
827
|
// src/components/Menu/Menu.tsx
|
|
791
|
-
var
|
|
828
|
+
var import_react9 = __toESM(require("react"));
|
|
792
829
|
var import_joy13 = require("@mui/joy");
|
|
793
830
|
var import_framer_motion10 = require("framer-motion");
|
|
794
831
|
var MotionMenu = (0, import_framer_motion10.motion)(import_joy13.Menu);
|
|
795
832
|
var Menu = (props) => {
|
|
796
|
-
return /* @__PURE__ */
|
|
833
|
+
return /* @__PURE__ */ import_react9.default.createElement(MotionMenu, { ...props });
|
|
797
834
|
};
|
|
798
835
|
Menu.displayName = "Menu";
|
|
799
836
|
var MenuItem = import_joy13.MenuItem;
|
|
@@ -802,22 +839,22 @@ var MenuItem = import_joy13.MenuItem;
|
|
|
802
839
|
var Menu_default = Menu;
|
|
803
840
|
|
|
804
841
|
// src/components/Dropdown/Dropdown.tsx
|
|
805
|
-
var
|
|
842
|
+
var import_react10 = __toESM(require("react"));
|
|
806
843
|
var import_joy14 = require("@mui/joy");
|
|
807
844
|
var import_joy15 = require("@mui/joy");
|
|
808
845
|
var import_useMenuButton = require("@mui/base/useMenuButton");
|
|
809
|
-
var DropdownNestedRegistryContext = (0,
|
|
846
|
+
var DropdownNestedRegistryContext = (0, import_react10.createContext)(null);
|
|
810
847
|
function Dropdown({ open: openProp, defaultOpen = false, onOpenChange, ...rest }) {
|
|
811
|
-
const [nestedCount, setNestedCount] = (0,
|
|
848
|
+
const [nestedCount, setNestedCount] = (0, import_react10.useState)(0);
|
|
812
849
|
const [open, setOpen] = useControlledState(openProp, defaultOpen);
|
|
813
|
-
const registry = (0,
|
|
850
|
+
const registry = (0, import_react10.useMemo)(
|
|
814
851
|
() => ({
|
|
815
852
|
register: () => setNestedCount((c) => c + 1),
|
|
816
853
|
unregister: () => setNestedCount((c) => Math.max(0, c - 1))
|
|
817
854
|
}),
|
|
818
855
|
[]
|
|
819
856
|
);
|
|
820
|
-
const handleOpenChange = (0,
|
|
857
|
+
const handleOpenChange = (0, import_react10.useCallback)(
|
|
821
858
|
(event, isOpen) => {
|
|
822
859
|
if (nestedCount > 0 && !isOpen && event?.type === "blur") {
|
|
823
860
|
return;
|
|
@@ -827,7 +864,7 @@ function Dropdown({ open: openProp, defaultOpen = false, onOpenChange, ...rest }
|
|
|
827
864
|
},
|
|
828
865
|
[nestedCount, setOpen, onOpenChange]
|
|
829
866
|
);
|
|
830
|
-
return /* @__PURE__ */
|
|
867
|
+
return /* @__PURE__ */ import_react10.default.createElement(DropdownNestedRegistryContext.Provider, { value: registry }, /* @__PURE__ */ import_react10.default.createElement(import_joy14.Dropdown, { open, onOpenChange: handleOpenChange, ...rest }));
|
|
831
868
|
}
|
|
832
869
|
Dropdown.displayName = "Dropdown";
|
|
833
870
|
|
|
@@ -850,29 +887,29 @@ function Breadcrumbs(props) {
|
|
|
850
887
|
} = props;
|
|
851
888
|
const Crumb = (props2) => {
|
|
852
889
|
if (props2.type === "link" && Link4) {
|
|
853
|
-
return /* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ import_react11.default.createElement(Link4, { to: props2.linkHref, href: props2.linkHref, ...linkProps }, props2.label);
|
|
854
891
|
} else {
|
|
855
|
-
return /* @__PURE__ */
|
|
892
|
+
return /* @__PURE__ */ import_react11.default.createElement(Typography_default, null, props2.label);
|
|
856
893
|
}
|
|
857
894
|
};
|
|
858
895
|
if (!collapsed) {
|
|
859
|
-
return /* @__PURE__ */
|
|
896
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_joy16.Breadcrumbs, { size, slots: restSlots, slotProps: restSlotProps, ...innerProps }, crumbs.map((crumb, index) => /* @__PURE__ */ import_react11.default.createElement(Crumb, { key: `breadcrumb-${index}`, ...crumb })));
|
|
860
897
|
}
|
|
861
898
|
const _endCrumbCount = Math.max(1, endCrumbCount);
|
|
862
|
-
const frontCrumbs = crumbs.slice(0, startCrumbCount).map((crumb) => /* @__PURE__ */
|
|
863
|
-
const backCrumbs = (startCrumbCount + _endCrumbCount > crumbs.length ? crumbs.slice(startCrumbCount) : crumbs.slice(-_endCrumbCount)).map((crumb) => /* @__PURE__ */
|
|
864
|
-
const collapsedCrumbs = crumbs.slice(startCrumbCount, -_endCrumbCount).map((crumb) => /* @__PURE__ */
|
|
865
|
-
return /* @__PURE__ */
|
|
899
|
+
const frontCrumbs = crumbs.slice(0, startCrumbCount).map((crumb) => /* @__PURE__ */ import_react11.default.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
|
|
900
|
+
const backCrumbs = (startCrumbCount + _endCrumbCount > crumbs.length ? crumbs.slice(startCrumbCount) : crumbs.slice(-_endCrumbCount)).map((crumb) => /* @__PURE__ */ import_react11.default.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
|
|
901
|
+
const collapsedCrumbs = crumbs.slice(startCrumbCount, -_endCrumbCount).map((crumb) => /* @__PURE__ */ import_react11.default.createElement(MenuItem, { key: `breadcrumb-${crumb.label}` }, /* @__PURE__ */ import_react11.default.createElement(Crumb, { ...crumb })));
|
|
902
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_joy16.Breadcrumbs, { size, slots: restSlots, slotProps: restSlotProps, ...innerProps }, frontCrumbs, collapsedCrumbs.length && /* @__PURE__ */ import_react11.default.createElement(Dropdown_default, null, /* @__PURE__ */ import_react11.default.createElement(import_joy16.MenuButton, { size, variant: "plain" }, "..."), /* @__PURE__ */ import_react11.default.createElement(Menu_default, { size }, collapsedCrumbs)), backCrumbs);
|
|
866
903
|
}
|
|
867
904
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
868
905
|
|
|
869
906
|
// src/components/Button/Button.tsx
|
|
870
|
-
var
|
|
907
|
+
var import_react12 = __toESM(require("react"));
|
|
871
908
|
var import_joy17 = require("@mui/joy");
|
|
872
909
|
var import_framer_motion11 = require("framer-motion");
|
|
873
910
|
var MotionButton = (0, import_framer_motion11.motion)(import_joy17.Button);
|
|
874
|
-
var Button = (0,
|
|
875
|
-
return /* @__PURE__ */
|
|
911
|
+
var Button = (0, import_react12.forwardRef)(({ ...props }, ref) => {
|
|
912
|
+
return /* @__PURE__ */ import_react12.default.createElement(MotionButton, { ref, ...props });
|
|
876
913
|
});
|
|
877
914
|
Button.displayName = "Button";
|
|
878
915
|
|
|
@@ -880,19 +917,19 @@ Button.displayName = "Button";
|
|
|
880
917
|
var Button_default = Button;
|
|
881
918
|
|
|
882
919
|
// src/components/Calendar/Calendar.tsx
|
|
883
|
-
var
|
|
920
|
+
var import_react16 = __toESM(require("react"));
|
|
884
921
|
var import_joy20 = require("@mui/joy");
|
|
885
922
|
var import_ChevronLeft = __toESM(require("@mui/icons-material/ChevronLeft"));
|
|
886
923
|
var import_ChevronRight = __toESM(require("@mui/icons-material/ChevronRight"));
|
|
887
924
|
var import_framer_motion13 = require("framer-motion");
|
|
888
925
|
|
|
889
926
|
// src/components/Tooltip/Tooltip.tsx
|
|
890
|
-
var
|
|
927
|
+
var import_react13 = __toESM(require("react"));
|
|
891
928
|
var import_joy18 = require("@mui/joy");
|
|
892
929
|
var import_framer_motion12 = require("framer-motion");
|
|
893
930
|
var MotionTooltip = (0, import_framer_motion12.motion)(import_joy18.Tooltip);
|
|
894
931
|
var Tooltip = (props) => {
|
|
895
|
-
return /* @__PURE__ */
|
|
932
|
+
return /* @__PURE__ */ import_react13.default.createElement(MotionTooltip, { ...props });
|
|
896
933
|
};
|
|
897
934
|
Tooltip.displayName = "Tooltip";
|
|
898
935
|
|
|
@@ -974,43 +1011,43 @@ var isSameMonth = (date1, date2) => {
|
|
|
974
1011
|
};
|
|
975
1012
|
|
|
976
1013
|
// src/components/Calendar/hooks/use-calendar-props.ts
|
|
977
|
-
var
|
|
1014
|
+
var import_react14 = require("react");
|
|
978
1015
|
var import_joy19 = require("@mui/joy");
|
|
979
1016
|
var resolveView = (view, views) => {
|
|
980
1017
|
return views.includes(view) ? view : views[0];
|
|
981
1018
|
};
|
|
982
1019
|
var useCalendarProps = (inProps) => {
|
|
983
|
-
const [uncontrolledView, setUncontrolledView] = (0,
|
|
1020
|
+
const [uncontrolledView, setUncontrolledView] = (0, import_react14.useState)(
|
|
984
1021
|
() => resolveView(inProps.view || "day", inProps.views || ["day", "month"])
|
|
985
1022
|
);
|
|
986
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
1023
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react14.useState)(
|
|
987
1024
|
inProps.defaultValue
|
|
988
1025
|
);
|
|
989
|
-
const [viewMonth, setViewMonth] = (0,
|
|
1026
|
+
const [viewMonth, setViewMonth] = (0, import_react14.useState)(() => {
|
|
990
1027
|
const today = /* @__PURE__ */ new Date();
|
|
991
1028
|
today.setDate(1);
|
|
992
1029
|
today.setHours(0, 0, 0, 0);
|
|
993
1030
|
return inProps.value?.[0] || inProps.defaultValue?.[0] || today;
|
|
994
1031
|
});
|
|
995
|
-
const [[page, direction], setPage] = (0,
|
|
1032
|
+
const [[page, direction], setPage] = (0, import_react14.useState)([0, 0]);
|
|
996
1033
|
const resolvedView = inProps.view ?? uncontrolledView;
|
|
997
|
-
const resolvedMinDate = (0,
|
|
1034
|
+
const resolvedMinDate = (0, import_react14.useMemo)(() => {
|
|
998
1035
|
const minDate = inProps.minDate || /* @__PURE__ */ new Date(0);
|
|
999
1036
|
minDate.setHours(0, 0, 0, 0);
|
|
1000
1037
|
return minDate;
|
|
1001
1038
|
}, [inProps.minDate]);
|
|
1002
|
-
const resolvedMaxDate = (0,
|
|
1039
|
+
const resolvedMaxDate = (0, import_react14.useMemo)(() => {
|
|
1003
1040
|
const maxDate = inProps.maxDate || /* @__PURE__ */ new Date(864e13);
|
|
1004
1041
|
maxDate.setHours(0, 0, 0, 0);
|
|
1005
1042
|
return maxDate;
|
|
1006
1043
|
}, [inProps.maxDate]);
|
|
1007
|
-
const paginate = (0,
|
|
1044
|
+
const paginate = (0, import_react14.useCallback)(
|
|
1008
1045
|
(newDirection) => {
|
|
1009
1046
|
setPage([page + newDirection, newDirection]);
|
|
1010
1047
|
},
|
|
1011
1048
|
[page]
|
|
1012
1049
|
);
|
|
1013
|
-
const handleViewMonthChange = (0,
|
|
1050
|
+
const handleViewMonthChange = (0, import_react14.useCallback)(
|
|
1014
1051
|
(newMonth) => {
|
|
1015
1052
|
setViewMonth(newMonth);
|
|
1016
1053
|
if (resolvedView === "month") {
|
|
@@ -1058,22 +1095,22 @@ var useCalendarProps = (inProps) => {
|
|
|
1058
1095
|
},
|
|
1059
1096
|
name: "Calendar"
|
|
1060
1097
|
});
|
|
1061
|
-
const ownerState = (0,
|
|
1098
|
+
const ownerState = (0, import_react14.useMemo)(() => ({ ...props, viewMonth, direction }), [props, viewMonth, direction]);
|
|
1062
1099
|
return [props, ownerState];
|
|
1063
1100
|
};
|
|
1064
1101
|
|
|
1065
1102
|
// src/components/Calendar/hooks/use-calendar.ts
|
|
1066
|
-
var
|
|
1103
|
+
var import_react15 = require("react");
|
|
1067
1104
|
var useCalendar = (ownerState) => {
|
|
1068
|
-
const [localHoverDay, setLocalHoverDay] = (0,
|
|
1069
|
-
const [localHoverMonth, setLocalHoverMonth] = (0,
|
|
1105
|
+
const [localHoverDay, setLocalHoverDay] = (0, import_react15.useState)(null);
|
|
1106
|
+
const [localHoverMonth, setLocalHoverMonth] = (0, import_react15.useState)(null);
|
|
1070
1107
|
const hoverDay = ownerState.hoverDay !== void 0 ? ownerState.hoverDay : localHoverDay;
|
|
1071
1108
|
const setHoverDay = ownerState.onHoverDayChange ?? setLocalHoverDay;
|
|
1072
1109
|
const hoverMonth = ownerState.hoverMonth !== void 0 ? ownerState.hoverMonth : localHoverMonth;
|
|
1073
1110
|
const setHoverMonth = ownerState.onHoverMonthChange ?? setLocalHoverMonth;
|
|
1074
1111
|
return {
|
|
1075
1112
|
calendarTitle: ownerState.view === "month" ? getYearName(ownerState.viewMonth, ownerState.locale || "default") : getMonthName(ownerState.viewMonth, ownerState.locale || "default"),
|
|
1076
|
-
onPrev: (0,
|
|
1113
|
+
onPrev: (0, import_react15.useCallback)(() => {
|
|
1077
1114
|
if (ownerState.view === "day") {
|
|
1078
1115
|
const currentDate = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1079
1116
|
const currentYear = currentDate.getFullYear();
|
|
@@ -1090,7 +1127,7 @@ var useCalendar = (ownerState) => {
|
|
|
1090
1127
|
ownerState.onMonthChange?.(prevYear);
|
|
1091
1128
|
}
|
|
1092
1129
|
}, [ownerState.onMonthChange, ownerState.viewMonth, ownerState.view]),
|
|
1093
|
-
onNext: (0,
|
|
1130
|
+
onNext: (0, import_react15.useCallback)(() => {
|
|
1094
1131
|
if (ownerState.view === "day") {
|
|
1095
1132
|
const currentDate = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1096
1133
|
const currentYear = currentDate.getFullYear();
|
|
@@ -1107,7 +1144,7 @@ var useCalendar = (ownerState) => {
|
|
|
1107
1144
|
ownerState.onMonthChange?.(nextYear);
|
|
1108
1145
|
}
|
|
1109
1146
|
}, [ownerState.onMonthChange, ownerState.viewMonth, ownerState.view]),
|
|
1110
|
-
getDayCellProps: (0,
|
|
1147
|
+
getDayCellProps: (0, import_react15.useCallback)(
|
|
1111
1148
|
(day) => {
|
|
1112
1149
|
const thisDay = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1113
1150
|
thisDay.setHours(0, 0, 0, 0);
|
|
@@ -1122,7 +1159,7 @@ var useCalendar = (ownerState) => {
|
|
|
1122
1159
|
},
|
|
1123
1160
|
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverDay]
|
|
1124
1161
|
),
|
|
1125
|
-
getMonthCellProps: (0,
|
|
1162
|
+
getMonthCellProps: (0, import_react15.useCallback)(
|
|
1126
1163
|
(monthIndex) => {
|
|
1127
1164
|
const thisMonth = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1128
1165
|
thisMonth.setDate(1);
|
|
@@ -1139,7 +1176,7 @@ var useCalendar = (ownerState) => {
|
|
|
1139
1176
|
},
|
|
1140
1177
|
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverMonth]
|
|
1141
1178
|
),
|
|
1142
|
-
getPickerDayProps: (0,
|
|
1179
|
+
getPickerDayProps: (0, import_react15.useCallback)(
|
|
1143
1180
|
(day) => {
|
|
1144
1181
|
const thisDay = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1145
1182
|
thisDay.setHours(0, 0, 0, 0);
|
|
@@ -1193,7 +1230,7 @@ var useCalendar = (ownerState) => {
|
|
|
1193
1230
|
hoverDay
|
|
1194
1231
|
]
|
|
1195
1232
|
),
|
|
1196
|
-
getPickerMonthProps: (0,
|
|
1233
|
+
getPickerMonthProps: (0, import_react15.useCallback)(
|
|
1197
1234
|
(monthIndex) => {
|
|
1198
1235
|
const thisMonth = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1199
1236
|
thisMonth.setDate(1);
|
|
@@ -1490,9 +1527,9 @@ var swipePower = (offset, velocity) => {
|
|
|
1490
1527
|
var PickerDays = (props) => {
|
|
1491
1528
|
const { ownerState } = props;
|
|
1492
1529
|
const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
|
|
1493
|
-
const calendarDates = (0,
|
|
1494
|
-
const weekdayNames = (0,
|
|
1495
|
-
return /* @__PURE__ */
|
|
1530
|
+
const calendarDates = (0, import_react16.useMemo)(() => getCalendarDates(ownerState.viewMonth), [ownerState.viewMonth]);
|
|
1531
|
+
const weekdayNames = (0, import_react16.useMemo)(() => getWeekdayNames(ownerState.locale || "default"), [ownerState.locale]);
|
|
1532
|
+
return /* @__PURE__ */ import_react16.default.createElement(CalendarViewContainer, { calendarType: "datePicker" }, /* @__PURE__ */ import_react16.default.createElement(import_framer_motion13.AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ import_react16.default.createElement(
|
|
1496
1533
|
CalendarViewTable,
|
|
1497
1534
|
{
|
|
1498
1535
|
key: `${ownerState.viewMonth.toString()}_${ownerState.direction}`,
|
|
@@ -1521,10 +1558,10 @@ var PickerDays = (props) => {
|
|
|
1521
1558
|
}
|
|
1522
1559
|
}
|
|
1523
1560
|
},
|
|
1524
|
-
/* @__PURE__ */
|
|
1525
|
-
/* @__PURE__ */
|
|
1526
|
-
(date, i) => date ? /* @__PURE__ */
|
|
1527
|
-
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */
|
|
1561
|
+
/* @__PURE__ */ import_react16.default.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ import_react16.default.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ import_react16.default.createElement(import_react16.Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ import_react16.default.createElement("th", null, /* @__PURE__ */ import_react16.default.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ import_react16.default.createElement("th", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" }))))),
|
|
1562
|
+
/* @__PURE__ */ import_react16.default.createElement(CalendarDayPickerContainer, null, calendarDates.map((weekDates, rowIndex) => /* @__PURE__ */ import_react16.default.createElement(import_react16.Fragment, { key: `${ownerState.viewMonth}_${rowIndex}` }, /* @__PURE__ */ import_react16.default.createElement("tr", null, weekDates.map(
|
|
1563
|
+
(date, i) => date ? /* @__PURE__ */ import_react16.default.createElement(import_react16.Fragment, { key: `${ownerState.viewMonth}_${date}_${i}` }, /* @__PURE__ */ import_react16.default.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ import_react16.default.createElement(CalendarDay, { size: "sm", variant: "plain", color: "neutral", ...getPickerDayProps(date) }, date)), i < 6 && /* @__PURE__ */ import_react16.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ import_react16.default.createElement(import_react16.Fragment, { key: `${ownerState.viewMonth}_${i}` }, /* @__PURE__ */ import_react16.default.createElement("td", null), i < 6 && /* @__PURE__ */ import_react16.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
|
|
1564
|
+
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */ import_react16.default.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ import_react16.default.createElement("td", { colSpan: 13, style: { height: 4 } })))))
|
|
1528
1565
|
)));
|
|
1529
1566
|
};
|
|
1530
1567
|
var PickerMonths = (props) => {
|
|
@@ -1541,7 +1578,7 @@ var PickerMonths = (props) => {
|
|
|
1541
1578
|
[[]]
|
|
1542
1579
|
);
|
|
1543
1580
|
const isMonthPicker = !ownerState.views?.find((view) => view === "day");
|
|
1544
|
-
return /* @__PURE__ */
|
|
1581
|
+
return /* @__PURE__ */ import_react16.default.createElement(CalendarViewContainer, { calendarType: isMonthPicker ? "monthPicker" : "datePicker" }, /* @__PURE__ */ import_react16.default.createElement(import_framer_motion13.AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ import_react16.default.createElement(
|
|
1545
1582
|
CalendarViewTable,
|
|
1546
1583
|
{
|
|
1547
1584
|
key: `${ownerState.viewMonth.getFullYear()}_${ownerState.direction}`,
|
|
@@ -1570,16 +1607,16 @@ var PickerMonths = (props) => {
|
|
|
1570
1607
|
}
|
|
1571
1608
|
}
|
|
1572
1609
|
},
|
|
1573
|
-
/* @__PURE__ */
|
|
1610
|
+
/* @__PURE__ */ import_react16.default.createElement("tbody", null, chunkedMonths.map((months, i) => /* @__PURE__ */ import_react16.default.createElement(import_react16.Fragment, { key: months.join("_") }, /* @__PURE__ */ import_react16.default.createElement("tr", null, months.map((monthIndex, j) => /* @__PURE__ */ import_react16.default.createElement(import_react16.Fragment, { key: monthIndex }, /* @__PURE__ */ import_react16.default.createElement(CalendarMonthCell, { ...getMonthCellProps(monthIndex) }, /* @__PURE__ */ import_react16.default.createElement(CalendarMonth, { size: "sm", variant: "plain", color: "neutral", ...getPickerMonthProps(monthIndex) }, getMonthNameFromIndex(monthIndex, ownerState.locale))), j < 3 && /* @__PURE__ */ import_react16.default.createElement("td", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" })))), i < chunkedMonths.length - 1 && /* @__PURE__ */ import_react16.default.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ import_react16.default.createElement("td", { colSpan: 7, style: { height: 4 } })))))
|
|
1574
1611
|
)));
|
|
1575
1612
|
};
|
|
1576
1613
|
var PlainPickerDays = ({ ownerState }) => {
|
|
1577
1614
|
const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
|
|
1578
|
-
const calendarDates = (0,
|
|
1579
|
-
const weekdayNames = (0,
|
|
1580
|
-
return /* @__PURE__ */
|
|
1581
|
-
(date, i) => date ? /* @__PURE__ */
|
|
1582
|
-
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */
|
|
1615
|
+
const calendarDates = (0, import_react16.useMemo)(() => getCalendarDates(ownerState.viewMonth), [ownerState.viewMonth]);
|
|
1616
|
+
const weekdayNames = (0, import_react16.useMemo)(() => getWeekdayNames(ownerState.locale || "default"), [ownerState.locale]);
|
|
1617
|
+
return /* @__PURE__ */ import_react16.default.createElement(StaticCalendarViewTable, null, /* @__PURE__ */ import_react16.default.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ import_react16.default.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ import_react16.default.createElement(import_react16.Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ import_react16.default.createElement("th", null, /* @__PURE__ */ import_react16.default.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ import_react16.default.createElement("th", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" }))))), /* @__PURE__ */ import_react16.default.createElement(CalendarDayPickerContainer, null, calendarDates.map((weekDates, rowIndex) => /* @__PURE__ */ import_react16.default.createElement(import_react16.Fragment, { key: `${ownerState.viewMonth}_${rowIndex}` }, /* @__PURE__ */ import_react16.default.createElement("tr", null, weekDates.map(
|
|
1618
|
+
(date, i) => date ? /* @__PURE__ */ import_react16.default.createElement(import_react16.Fragment, { key: `${ownerState.viewMonth}_${date}_${i}` }, /* @__PURE__ */ import_react16.default.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ import_react16.default.createElement(CalendarDay, { size: "sm", variant: "plain", color: "neutral", ...getPickerDayProps(date) }, date)), i < 6 && /* @__PURE__ */ import_react16.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ import_react16.default.createElement(import_react16.Fragment, { key: `${ownerState.viewMonth}_${i}` }, /* @__PURE__ */ import_react16.default.createElement("td", null), i < 6 && /* @__PURE__ */ import_react16.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
|
|
1619
|
+
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */ import_react16.default.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ import_react16.default.createElement("td", { colSpan: 13, style: { height: 4 } }))))));
|
|
1583
1620
|
};
|
|
1584
1621
|
var MultiMonthPickerDays = ({
|
|
1585
1622
|
panels,
|
|
@@ -1598,7 +1635,7 @@ var MultiMonthPickerDays = ({
|
|
|
1598
1635
|
})
|
|
1599
1636
|
};
|
|
1600
1637
|
const key = `${panels[0].viewMonth.toISOString()}_${direction}`;
|
|
1601
|
-
return /* @__PURE__ */
|
|
1638
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { style: { position: "relative", overflow: "hidden", minHeight: "250px" } }, /* @__PURE__ */ import_react16.default.createElement(import_framer_motion13.AnimatePresence, { initial: false, custom: direction }, /* @__PURE__ */ import_react16.default.createElement(
|
|
1602
1639
|
import_framer_motion13.motion.div,
|
|
1603
1640
|
{
|
|
1604
1641
|
key,
|
|
@@ -1628,7 +1665,7 @@ var MultiMonthPickerDays = ({
|
|
|
1628
1665
|
},
|
|
1629
1666
|
style: { display: "flex", gap: `${CALENDAR_PANEL_GAP}px`, top: 0, left: 0, width: "100%" }
|
|
1630
1667
|
},
|
|
1631
|
-
panels.map((panelOwnerState) => /* @__PURE__ */
|
|
1668
|
+
panels.map((panelOwnerState) => /* @__PURE__ */ import_react16.default.createElement(
|
|
1632
1669
|
"div",
|
|
1633
1670
|
{
|
|
1634
1671
|
key: panelOwnerState.viewMonth.toISOString(),
|
|
@@ -1640,7 +1677,7 @@ var MultiMonthPickerDays = ({
|
|
|
1640
1677
|
boxSizing: "border-box"
|
|
1641
1678
|
}
|
|
1642
1679
|
},
|
|
1643
|
-
/* @__PURE__ */
|
|
1680
|
+
/* @__PURE__ */ import_react16.default.createElement(PlainPickerDays, { ownerState: panelOwnerState })
|
|
1644
1681
|
))
|
|
1645
1682
|
)));
|
|
1646
1683
|
};
|
|
@@ -1657,7 +1694,7 @@ var CalendarPanel = ({
|
|
|
1657
1694
|
const showPrev = panelIndex === 0;
|
|
1658
1695
|
const showNext = panelIndex === totalPanels - 1;
|
|
1659
1696
|
const title = ownerState.view === "month" ? getYearName(ownerState.viewMonth, ownerState.locale || "default") : getMonthName(ownerState.viewMonth, ownerState.locale || "default");
|
|
1660
|
-
return /* @__PURE__ */
|
|
1697
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { style: { flex: 1, maxWidth: `${CALENDAR_PANEL_WIDTH}px` } }, /* @__PURE__ */ import_react16.default.createElement(CalendarHeader, null, /* @__PURE__ */ import_react16.default.createElement(
|
|
1661
1698
|
IconButton_default,
|
|
1662
1699
|
{
|
|
1663
1700
|
size: "sm",
|
|
@@ -1665,8 +1702,8 @@ var CalendarPanel = ({
|
|
|
1665
1702
|
"aria-label": `Previous ${ownerState.view === "day" ? "Month" : "Year"}`,
|
|
1666
1703
|
style: { visibility: showPrev ? "visible" : "hidden" }
|
|
1667
1704
|
},
|
|
1668
|
-
/* @__PURE__ */
|
|
1669
|
-
), /* @__PURE__ */
|
|
1705
|
+
/* @__PURE__ */ import_react16.default.createElement(import_ChevronLeft.default, null)
|
|
1706
|
+
), /* @__PURE__ */ import_react16.default.createElement(
|
|
1670
1707
|
Tooltip_default,
|
|
1671
1708
|
{
|
|
1672
1709
|
title: monthViewHintMessage,
|
|
@@ -1678,7 +1715,7 @@ var CalendarPanel = ({
|
|
|
1678
1715
|
disableTouchListener: true,
|
|
1679
1716
|
variant: "solid"
|
|
1680
1717
|
},
|
|
1681
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
1682
1719
|
CalendarSwitchViewButton,
|
|
1683
1720
|
{
|
|
1684
1721
|
ownerState,
|
|
@@ -1689,7 +1726,7 @@ var CalendarPanel = ({
|
|
|
1689
1726
|
},
|
|
1690
1727
|
title
|
|
1691
1728
|
)
|
|
1692
|
-
), /* @__PURE__ */
|
|
1729
|
+
), /* @__PURE__ */ import_react16.default.createElement(
|
|
1693
1730
|
IconButton_default,
|
|
1694
1731
|
{
|
|
1695
1732
|
size: "sm",
|
|
@@ -1697,10 +1734,10 @@ var CalendarPanel = ({
|
|
|
1697
1734
|
"aria-label": `Next ${ownerState.view === "day" ? "Month" : "Year"}`,
|
|
1698
1735
|
style: { visibility: showNext ? "visible" : "hidden" }
|
|
1699
1736
|
},
|
|
1700
|
-
/* @__PURE__ */
|
|
1737
|
+
/* @__PURE__ */ import_react16.default.createElement(import_ChevronRight.default, null)
|
|
1701
1738
|
)));
|
|
1702
1739
|
};
|
|
1703
|
-
var Calendar = (0,
|
|
1740
|
+
var Calendar = (0, import_react16.forwardRef)((inProps, ref) => {
|
|
1704
1741
|
const [props, ownerState] = useCalendarProps(inProps);
|
|
1705
1742
|
const {
|
|
1706
1743
|
value,
|
|
@@ -1720,38 +1757,38 @@ var Calendar = (0, import_react15.forwardRef)((inProps, ref) => {
|
|
|
1720
1757
|
...others
|
|
1721
1758
|
} = props;
|
|
1722
1759
|
const { calendarTitle, onPrev, onNext } = useCalendar(ownerState);
|
|
1723
|
-
const [isMonthViewAssistHintOpen, setIsMonthViewAssistHintOpen] = (0,
|
|
1724
|
-
const monthNavClickTimestampsRef = (0,
|
|
1725
|
-
const monthViewAssistHintShownInSessionRef = (0,
|
|
1726
|
-
const monthViewAssistHintTimeoutRef = (0,
|
|
1727
|
-
const [hoverDay, setHoverDay] = (0,
|
|
1728
|
-
const [hoverMonth, setHoverMonth] = (0,
|
|
1760
|
+
const [isMonthViewAssistHintOpen, setIsMonthViewAssistHintOpen] = (0, import_react16.useState)(false);
|
|
1761
|
+
const monthNavClickTimestampsRef = (0, import_react16.useRef)([]);
|
|
1762
|
+
const monthViewAssistHintShownInSessionRef = (0, import_react16.useRef)(false);
|
|
1763
|
+
const monthViewAssistHintTimeoutRef = (0, import_react16.useRef)(null);
|
|
1764
|
+
const [hoverDay, setHoverDay] = (0, import_react16.useState)(null);
|
|
1765
|
+
const [hoverMonth, setHoverMonth] = (0, import_react16.useState)(null);
|
|
1729
1766
|
const resolvedNumberOfMonths = numberOfMonths ?? 1;
|
|
1730
1767
|
const hasEndDate = Boolean(value?.[1]);
|
|
1731
1768
|
const isRangeHintEligible = Boolean(rangeSelection && !hasEndDate);
|
|
1732
1769
|
const isHintEligible = Boolean(view === "day" && (!rangeSelection || isRangeHintEligible));
|
|
1733
1770
|
const monthViewHintMessage = MONTH_VIEW_HINT_MESSAGE;
|
|
1734
|
-
(0,
|
|
1771
|
+
(0, import_react16.useEffect)(() => {
|
|
1735
1772
|
if (!isHintEligible) {
|
|
1736
1773
|
monthNavClickTimestampsRef.current = [];
|
|
1737
1774
|
setIsMonthViewAssistHintOpen(false);
|
|
1738
1775
|
}
|
|
1739
1776
|
}, [isHintEligible]);
|
|
1740
|
-
(0,
|
|
1777
|
+
(0, import_react16.useEffect)(() => {
|
|
1741
1778
|
return () => {
|
|
1742
1779
|
if (monthViewAssistHintTimeoutRef.current) {
|
|
1743
1780
|
clearTimeout(monthViewAssistHintTimeoutRef.current);
|
|
1744
1781
|
}
|
|
1745
1782
|
};
|
|
1746
1783
|
}, []);
|
|
1747
|
-
const closeMonthViewAssistHint = (0,
|
|
1784
|
+
const closeMonthViewAssistHint = (0, import_react16.useCallback)(() => {
|
|
1748
1785
|
if (monthViewAssistHintTimeoutRef.current) {
|
|
1749
1786
|
clearTimeout(monthViewAssistHintTimeoutRef.current);
|
|
1750
1787
|
monthViewAssistHintTimeoutRef.current = null;
|
|
1751
1788
|
}
|
|
1752
1789
|
setIsMonthViewAssistHintOpen(false);
|
|
1753
1790
|
}, []);
|
|
1754
|
-
const showMonthViewAssistHint = (0,
|
|
1791
|
+
const showMonthViewAssistHint = (0, import_react16.useCallback)(() => {
|
|
1755
1792
|
const now = Date.now();
|
|
1756
1793
|
if (monthViewAssistHintShownInSessionRef.current) return;
|
|
1757
1794
|
if (now - lastMonthViewAssistHintShownAt < MONTH_VIEW_HINT_COOLDOWN_MS) return;
|
|
@@ -1766,7 +1803,7 @@ var Calendar = (0, import_react15.forwardRef)((inProps, ref) => {
|
|
|
1766
1803
|
monthViewAssistHintTimeoutRef.current = null;
|
|
1767
1804
|
}, MONTH_VIEW_HINT_DURATION_MS);
|
|
1768
1805
|
}, []);
|
|
1769
|
-
const trackFastMonthNavigation = (0,
|
|
1806
|
+
const trackFastMonthNavigation = (0, import_react16.useCallback)(() => {
|
|
1770
1807
|
if (!isHintEligible) return;
|
|
1771
1808
|
const now = Date.now();
|
|
1772
1809
|
monthNavClickTimestampsRef.current = [
|
|
@@ -1777,15 +1814,15 @@ var Calendar = (0, import_react15.forwardRef)((inProps, ref) => {
|
|
|
1777
1814
|
showMonthViewAssistHint();
|
|
1778
1815
|
}
|
|
1779
1816
|
}, [isHintEligible, showMonthViewAssistHint]);
|
|
1780
|
-
const handlePrevClick = (0,
|
|
1817
|
+
const handlePrevClick = (0, import_react16.useCallback)(() => {
|
|
1781
1818
|
onPrev();
|
|
1782
1819
|
trackFastMonthNavigation();
|
|
1783
1820
|
}, [onPrev, trackFastMonthNavigation]);
|
|
1784
|
-
const handleNextClick = (0,
|
|
1821
|
+
const handleNextClick = (0, import_react16.useCallback)(() => {
|
|
1785
1822
|
onNext();
|
|
1786
1823
|
trackFastMonthNavigation();
|
|
1787
1824
|
}, [onNext, trackFastMonthNavigation]);
|
|
1788
|
-
const handleSwitchViewClick = (0,
|
|
1825
|
+
const handleSwitchViewClick = (0, import_react16.useCallback)(() => {
|
|
1789
1826
|
closeMonthViewAssistHint();
|
|
1790
1827
|
onViewChange?.();
|
|
1791
1828
|
}, [closeMonthViewAssistHint, onViewChange]);
|
|
@@ -1805,9 +1842,9 @@ var Calendar = (0, import_react15.forwardRef)((inProps, ref) => {
|
|
|
1805
1842
|
onHoverMonthChange: setHoverMonth
|
|
1806
1843
|
};
|
|
1807
1844
|
});
|
|
1808
|
-
return /* @__PURE__ */
|
|
1845
|
+
return /* @__PURE__ */ import_react16.default.createElement(CalendarRoot, { ref, ...others, style: { maxWidth: `${maxWidth}px` } }, view === "month" ? (
|
|
1809
1846
|
// Month view: single header + single month grid (consistent with single-month path)
|
|
1810
|
-
/* @__PURE__ */
|
|
1847
|
+
/* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(CalendarHeader, null, /* @__PURE__ */ import_react16.default.createElement(IconButton_default, { size: "sm", onClick: handlePrevClick, "aria-label": "Previous Year" }, /* @__PURE__ */ import_react16.default.createElement(import_ChevronLeft.default, null)), /* @__PURE__ */ import_react16.default.createElement(
|
|
1811
1848
|
Tooltip_default,
|
|
1812
1849
|
{
|
|
1813
1850
|
title: monthViewHintMessage,
|
|
@@ -1819,7 +1856,7 @@ var Calendar = (0, import_react15.forwardRef)((inProps, ref) => {
|
|
|
1819
1856
|
disableTouchListener: true,
|
|
1820
1857
|
variant: "solid"
|
|
1821
1858
|
},
|
|
1822
|
-
/* @__PURE__ */
|
|
1859
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
1823
1860
|
CalendarSwitchViewButton,
|
|
1824
1861
|
{
|
|
1825
1862
|
ownerState,
|
|
@@ -1830,8 +1867,8 @@ var Calendar = (0, import_react15.forwardRef)((inProps, ref) => {
|
|
|
1830
1867
|
},
|
|
1831
1868
|
calendarTitle
|
|
1832
1869
|
)
|
|
1833
|
-
), /* @__PURE__ */
|
|
1834
|
-
) : /* @__PURE__ */
|
|
1870
|
+
), /* @__PURE__ */ import_react16.default.createElement(IconButton_default, { size: "sm", onClick: handleNextClick, "aria-label": "Next Year" }, /* @__PURE__ */ import_react16.default.createElement(import_ChevronRight.default, null))), /* @__PURE__ */ import_react16.default.createElement(PickerMonths, { ownerState }))
|
|
1871
|
+
) : /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(CalendarMultiContainer, null, panels.map((panelOwnerState, i) => /* @__PURE__ */ import_react16.default.createElement(
|
|
1835
1872
|
CalendarPanel,
|
|
1836
1873
|
{
|
|
1837
1874
|
key: panelOwnerState.viewMonth.toISOString(),
|
|
@@ -1844,7 +1881,7 @@ var Calendar = (0, import_react15.forwardRef)((inProps, ref) => {
|
|
|
1844
1881
|
isMonthViewAssistHintOpen,
|
|
1845
1882
|
monthViewHintMessage
|
|
1846
1883
|
}
|
|
1847
|
-
))), /* @__PURE__ */
|
|
1884
|
+
))), /* @__PURE__ */ import_react16.default.createElement(
|
|
1848
1885
|
MultiMonthPickerDays,
|
|
1849
1886
|
{
|
|
1850
1887
|
panels,
|
|
@@ -1853,7 +1890,7 @@ var Calendar = (0, import_react15.forwardRef)((inProps, ref) => {
|
|
|
1853
1890
|
}
|
|
1854
1891
|
)));
|
|
1855
1892
|
}
|
|
1856
|
-
return /* @__PURE__ */
|
|
1893
|
+
return /* @__PURE__ */ import_react16.default.createElement(CalendarRoot, { ref, ...others, style: { maxWidth: `${maxWidth}px` } }, /* @__PURE__ */ import_react16.default.createElement(CalendarHeader, null, /* @__PURE__ */ import_react16.default.createElement(IconButton_default, { size: "sm", onClick: handlePrevClick, "aria-label": `Previous ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ import_react16.default.createElement(import_ChevronLeft.default, null)), /* @__PURE__ */ import_react16.default.createElement(
|
|
1857
1894
|
Tooltip_default,
|
|
1858
1895
|
{
|
|
1859
1896
|
title: monthViewHintMessage,
|
|
@@ -1865,7 +1902,7 @@ var Calendar = (0, import_react15.forwardRef)((inProps, ref) => {
|
|
|
1865
1902
|
disableTouchListener: true,
|
|
1866
1903
|
variant: "solid"
|
|
1867
1904
|
},
|
|
1868
|
-
/* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
1869
1906
|
CalendarSwitchViewButton,
|
|
1870
1907
|
{
|
|
1871
1908
|
ownerState,
|
|
@@ -1876,7 +1913,7 @@ var Calendar = (0, import_react15.forwardRef)((inProps, ref) => {
|
|
|
1876
1913
|
},
|
|
1877
1914
|
calendarTitle
|
|
1878
1915
|
)
|
|
1879
|
-
), /* @__PURE__ */
|
|
1916
|
+
), /* @__PURE__ */ import_react16.default.createElement(IconButton_default, { size: "sm", onClick: handleNextClick, "aria-label": `Next ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ import_react16.default.createElement(import_ChevronRight.default, null))), view === "day" && /* @__PURE__ */ import_react16.default.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ import_react16.default.createElement(PickerMonths, { ownerState }));
|
|
1880
1917
|
});
|
|
1881
1918
|
Calendar.displayName = "Calendar";
|
|
1882
1919
|
|
|
@@ -1903,12 +1940,12 @@ var CardOverflow = MotionCardOverflow;
|
|
|
1903
1940
|
CardOverflow.displayName = "CardOverflow";
|
|
1904
1941
|
|
|
1905
1942
|
// src/components/Checkbox/Checkbox.tsx
|
|
1906
|
-
var
|
|
1943
|
+
var import_react17 = __toESM(require("react"));
|
|
1907
1944
|
var import_joy22 = require("@mui/joy");
|
|
1908
1945
|
var import_framer_motion15 = require("framer-motion");
|
|
1909
1946
|
var MotionCheckbox = (0, import_framer_motion15.motion)(import_joy22.Checkbox);
|
|
1910
1947
|
var Checkbox = (props) => {
|
|
1911
|
-
return /* @__PURE__ */
|
|
1948
|
+
return /* @__PURE__ */ import_react17.default.createElement(MotionCheckbox, { ...props });
|
|
1912
1949
|
};
|
|
1913
1950
|
Checkbox.displayName = "Checkbox";
|
|
1914
1951
|
|
|
@@ -1917,7 +1954,7 @@ var Checkbox_default = Checkbox;
|
|
|
1917
1954
|
|
|
1918
1955
|
// src/components/Container/Container.tsx
|
|
1919
1956
|
var import_joy23 = require("@mui/joy");
|
|
1920
|
-
var
|
|
1957
|
+
var import_react18 = __toESM(require("react"));
|
|
1921
1958
|
var ContainerRoot = (0, import_joy23.styled)("div", {
|
|
1922
1959
|
name: "Container",
|
|
1923
1960
|
slot: "root",
|
|
@@ -1943,24 +1980,24 @@ var ContainerRoot = (0, import_joy23.styled)("div", {
|
|
|
1943
1980
|
paddingRight: theme.breakpoints.values[overrideBreakpoint] >= theme.breakpoints.values.lg ? theme.spacing(8) : theme.spacing(4)
|
|
1944
1981
|
} : null
|
|
1945
1982
|
]);
|
|
1946
|
-
var Container = (0,
|
|
1947
|
-
return /* @__PURE__ */
|
|
1983
|
+
var Container = (0, import_react18.forwardRef)(function Container2(props, ref) {
|
|
1984
|
+
return /* @__PURE__ */ import_react18.default.createElement(ContainerRoot, { ref, ...props });
|
|
1948
1985
|
});
|
|
1949
1986
|
Container.displayName = "Container";
|
|
1950
1987
|
|
|
1951
1988
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1952
|
-
var
|
|
1989
|
+
var import_react20 = __toESM(require("react"));
|
|
1953
1990
|
var import_react_number_format = require("react-number-format");
|
|
1954
1991
|
|
|
1955
1992
|
// src/components/Input/Input.tsx
|
|
1956
|
-
var
|
|
1993
|
+
var import_react19 = __toESM(require("react"));
|
|
1957
1994
|
var import_joy24 = require("@mui/joy");
|
|
1958
1995
|
var import_framer_motion16 = require("framer-motion");
|
|
1959
1996
|
var import_Close2 = __toESM(require("@mui/icons-material/Close"));
|
|
1960
1997
|
var import_Visibility = __toESM(require("@mui/icons-material/Visibility"));
|
|
1961
1998
|
var import_VisibilityOff = __toESM(require("@mui/icons-material/VisibilityOff"));
|
|
1962
1999
|
var MotionInput = (0, import_framer_motion16.motion)(import_joy24.Input);
|
|
1963
|
-
var Input =
|
|
2000
|
+
var Input = import_react19.default.forwardRef((props, ref) => {
|
|
1964
2001
|
const {
|
|
1965
2002
|
label,
|
|
1966
2003
|
helperText,
|
|
@@ -1987,11 +2024,11 @@ var Input = import_react18.default.forwardRef((props, ref) => {
|
|
|
1987
2024
|
if (type === "password" && innerProps.endDecorator) {
|
|
1988
2025
|
console.warn('Input: endDecorator is not supported when type="password"');
|
|
1989
2026
|
}
|
|
1990
|
-
const [passwordVisible, setPasswordVisible] = (0,
|
|
2027
|
+
const [passwordVisible, setPasswordVisible] = (0, import_react19.useState)(false);
|
|
1991
2028
|
const [value, setValue] = useControlledState(
|
|
1992
2029
|
valueProp,
|
|
1993
2030
|
defaultValueProp ?? null,
|
|
1994
|
-
(0,
|
|
2031
|
+
(0, import_react19.useCallback)(
|
|
1995
2032
|
(value2) => {
|
|
1996
2033
|
onChange?.({
|
|
1997
2034
|
/**
|
|
@@ -2018,7 +2055,7 @@ var Input = import_react18.default.forwardRef((props, ref) => {
|
|
|
2018
2055
|
const actualType = type === "password" && passwordVisible ? "text" : type;
|
|
2019
2056
|
const isPasswordType = type === "password";
|
|
2020
2057
|
const showPasswordToggle = isPasswordType && !disableTogglePasswordButton;
|
|
2021
|
-
const input = /* @__PURE__ */
|
|
2058
|
+
const input = /* @__PURE__ */ import_react19.default.createElement(
|
|
2022
2059
|
MotionInput,
|
|
2023
2060
|
{
|
|
2024
2061
|
value: displayValue ?? "",
|
|
@@ -2033,7 +2070,7 @@ var Input = import_react18.default.forwardRef((props, ref) => {
|
|
|
2033
2070
|
...innerProps.slotProps
|
|
2034
2071
|
},
|
|
2035
2072
|
...innerProps,
|
|
2036
|
-
endDecorator: isPasswordType ? showPasswordToggle ? /* @__PURE__ */
|
|
2073
|
+
endDecorator: isPasswordType ? showPasswordToggle ? /* @__PURE__ */ import_react19.default.createElement(Stack_default, { gap: 1, direction: "row" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2037
2074
|
IconButton_default,
|
|
2038
2075
|
{
|
|
2039
2076
|
onMouseDown: (e) => e.preventDefault(),
|
|
@@ -2041,19 +2078,19 @@ var Input = import_react18.default.forwardRef((props, ref) => {
|
|
|
2041
2078
|
disabled,
|
|
2042
2079
|
"aria-label": passwordVisible ? "Hide password" : "Show password"
|
|
2043
2080
|
},
|
|
2044
|
-
passwordVisible ? /* @__PURE__ */
|
|
2045
|
-
)) : null : enableClearable ? /* @__PURE__ */
|
|
2081
|
+
passwordVisible ? /* @__PURE__ */ import_react19.default.createElement(import_VisibilityOff.default, null) : /* @__PURE__ */ import_react19.default.createElement(import_Visibility.default, null)
|
|
2082
|
+
)) : null : enableClearable ? /* @__PURE__ */ import_react19.default.createElement(Stack_default, { gap: 1, direction: "row" }, innerProps.endDecorator, displayValue && /* @__PURE__ */ import_react19.default.createElement(
|
|
2046
2083
|
IconButton_default,
|
|
2047
2084
|
{
|
|
2048
2085
|
onMouseDown: (e) => e.preventDefault(),
|
|
2049
2086
|
onClick: handleClear,
|
|
2050
2087
|
"aria-label": "Clear"
|
|
2051
2088
|
},
|
|
2052
|
-
/* @__PURE__ */
|
|
2089
|
+
/* @__PURE__ */ import_react19.default.createElement(import_Close2.default, null)
|
|
2053
2090
|
)) : innerProps.endDecorator
|
|
2054
2091
|
}
|
|
2055
2092
|
);
|
|
2056
|
-
return /* @__PURE__ */
|
|
2093
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
2057
2094
|
FormControl_default,
|
|
2058
2095
|
{
|
|
2059
2096
|
required,
|
|
@@ -2064,9 +2101,9 @@ var Input = import_react18.default.forwardRef((props, ref) => {
|
|
|
2064
2101
|
sx,
|
|
2065
2102
|
className
|
|
2066
2103
|
},
|
|
2067
|
-
label && /* @__PURE__ */
|
|
2104
|
+
label && /* @__PURE__ */ import_react19.default.createElement(FormLabel_default, null, label),
|
|
2068
2105
|
input,
|
|
2069
|
-
helperText && /* @__PURE__ */
|
|
2106
|
+
helperText && /* @__PURE__ */ import_react19.default.createElement(FormHelperText_default, null, helperText)
|
|
2070
2107
|
);
|
|
2071
2108
|
});
|
|
2072
2109
|
Input.displayName = "Input";
|
|
@@ -2238,9 +2275,9 @@ var useCurrencySetting = (props) => {
|
|
|
2238
2275
|
};
|
|
2239
2276
|
|
|
2240
2277
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
2241
|
-
var TextMaskAdapter =
|
|
2278
|
+
var TextMaskAdapter = import_react20.default.forwardRef(function TextMaskAdapter2(props, ref) {
|
|
2242
2279
|
const { onChange, ...innerProps } = props;
|
|
2243
|
-
return /* @__PURE__ */
|
|
2280
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
2244
2281
|
import_react_number_format.NumericFormat,
|
|
2245
2282
|
{
|
|
2246
2283
|
...innerProps,
|
|
@@ -2260,7 +2297,7 @@ var CurrencyInputRoot = (0, import_joy25.styled)(Input_default, {
|
|
|
2260
2297
|
slot: "root",
|
|
2261
2298
|
overridesResolver: (props, styles) => styles.root
|
|
2262
2299
|
})({});
|
|
2263
|
-
var CurrencyInput =
|
|
2300
|
+
var CurrencyInput = import_react20.default.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
2264
2301
|
const props = (0, import_joy25.useThemeProps)({ props: inProps, name: "CurrencyInput" });
|
|
2265
2302
|
const {
|
|
2266
2303
|
currency = "USD",
|
|
@@ -2281,22 +2318,22 @@ var CurrencyInput = import_react19.default.forwardRef(function CurrencyInput2(in
|
|
|
2281
2318
|
const [_value, setValue] = useControlledState(
|
|
2282
2319
|
props.value,
|
|
2283
2320
|
props.defaultValue ?? null,
|
|
2284
|
-
(0,
|
|
2321
|
+
(0, import_react20.useCallback)((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
2285
2322
|
);
|
|
2286
|
-
const value = (0,
|
|
2323
|
+
const value = (0, import_react20.useMemo)(() => {
|
|
2287
2324
|
if (_value && useMinorUnit) {
|
|
2288
2325
|
return _value / Math.pow(10, decimalScale);
|
|
2289
2326
|
}
|
|
2290
2327
|
return _value;
|
|
2291
2328
|
}, [_value, useMinorUnit, decimalScale]);
|
|
2292
|
-
const max = (0,
|
|
2329
|
+
const max = (0, import_react20.useMemo)(() => {
|
|
2293
2330
|
if (props.max && useMinorUnit) {
|
|
2294
2331
|
return props.max / Math.pow(10, decimalScale);
|
|
2295
2332
|
}
|
|
2296
2333
|
return props.max;
|
|
2297
2334
|
}, [props.max, useMinorUnit, decimalScale]);
|
|
2298
|
-
const isOverLimit = (0,
|
|
2299
|
-
const handleChange = (0,
|
|
2335
|
+
const isOverLimit = (0, import_react20.useMemo)(() => max != null && value != null && value > max, [max, value]);
|
|
2336
|
+
const handleChange = (0, import_react20.useCallback)(
|
|
2300
2337
|
(event) => {
|
|
2301
2338
|
if (event.target.value === "") {
|
|
2302
2339
|
setValue(null);
|
|
@@ -2307,7 +2344,7 @@ var CurrencyInput = import_react19.default.forwardRef(function CurrencyInput2(in
|
|
|
2307
2344
|
},
|
|
2308
2345
|
[decimalSeparator, useMinorUnit, setValue]
|
|
2309
2346
|
);
|
|
2310
|
-
return /* @__PURE__ */
|
|
2347
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
2311
2348
|
CurrencyInputRoot,
|
|
2312
2349
|
{
|
|
2313
2350
|
...innerProps,
|
|
@@ -2344,7 +2381,7 @@ var CurrencyInput = import_react19.default.forwardRef(function CurrencyInput2(in
|
|
|
2344
2381
|
var CurrencyInput_default = CurrencyInput;
|
|
2345
2382
|
|
|
2346
2383
|
// src/components/DataTable/DataTable.tsx
|
|
2347
|
-
var
|
|
2384
|
+
var import_react30 = __toESM(require("react"));
|
|
2348
2385
|
var import_react_virtual2 = require("@tanstack/react-virtual");
|
|
2349
2386
|
|
|
2350
2387
|
// src/libs/text-measurer.ts
|
|
@@ -2572,9 +2609,12 @@ function computeAutoFitWidth(params) {
|
|
|
2572
2609
|
if (!isNaN(maxPx) && maxPx > 0) finalWidth = Math.min(finalWidth, maxPx);
|
|
2573
2610
|
return finalWidth;
|
|
2574
2611
|
}
|
|
2612
|
+
function getHeaderCellId(tableId, columnId) {
|
|
2613
|
+
return `${tableId}_header_${columnId}`.trim();
|
|
2614
|
+
}
|
|
2575
2615
|
|
|
2576
2616
|
// src/components/DataTable/styled.tsx
|
|
2577
|
-
var
|
|
2617
|
+
var import_react21 = __toESM(require("react"));
|
|
2578
2618
|
var import_joy26 = require("@mui/joy");
|
|
2579
2619
|
var import_framer_motion17 = require("framer-motion");
|
|
2580
2620
|
var import_ArrowUpwardRounded = __toESM(require("@mui/icons-material/ArrowUpwardRounded"));
|
|
@@ -2680,9 +2720,9 @@ var StyledTd = (0, import_joy26.styled)("td")(({ theme }) => ({
|
|
|
2680
2720
|
}
|
|
2681
2721
|
}));
|
|
2682
2722
|
var MotionSortIcon = (0, import_framer_motion17.motion)(import_ArrowUpwardRounded.default);
|
|
2683
|
-
var DefaultLoadingOverlay = () => /* @__PURE__ */
|
|
2684
|
-
var DefaultNoRowsOverlay = () => /* @__PURE__ */
|
|
2685
|
-
var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PURE__ */
|
|
2723
|
+
var DefaultLoadingOverlay = () => /* @__PURE__ */ import_react21.default.createElement(import_joy26.LinearProgress, { value: 8, variant: "plain" });
|
|
2724
|
+
var DefaultNoRowsOverlay = () => /* @__PURE__ */ import_react21.default.createElement(import_joy26.Typography, { level: "body-sm", textColor: "text.tertiary" }, "No rows");
|
|
2725
|
+
var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PURE__ */ import_react21.default.createElement(
|
|
2686
2726
|
Box_default,
|
|
2687
2727
|
{
|
|
2688
2728
|
sx: {
|
|
@@ -2759,12 +2799,12 @@ var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PU
|
|
|
2759
2799
|
);
|
|
2760
2800
|
|
|
2761
2801
|
// src/components/DataTable/components.tsx
|
|
2762
|
-
var
|
|
2802
|
+
var import_react26 = __toESM(require("react"));
|
|
2763
2803
|
var import_joy33 = require("@mui/joy");
|
|
2764
2804
|
var import_framer_motion21 = require("framer-motion");
|
|
2765
2805
|
|
|
2766
2806
|
// src/components/DatePicker/DatePicker.tsx
|
|
2767
|
-
var
|
|
2807
|
+
var import_react22 = __toESM(require("react"));
|
|
2768
2808
|
var import_react_imask = require("react-imask");
|
|
2769
2809
|
var import_CalendarToday = __toESM(require("@mui/icons-material/CalendarToday"));
|
|
2770
2810
|
var import_joy29 = require("@mui/joy");
|
|
@@ -2917,9 +2957,9 @@ function parseDate(dateString, format) {
|
|
|
2917
2957
|
var formatToPattern = (format) => {
|
|
2918
2958
|
return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
2919
2959
|
};
|
|
2920
|
-
var TextMaskAdapter3 =
|
|
2960
|
+
var TextMaskAdapter3 = import_react22.default.forwardRef(function TextMaskAdapter4(props, ref) {
|
|
2921
2961
|
const { onChange, format, ...other } = props;
|
|
2922
|
-
return /* @__PURE__ */
|
|
2962
|
+
return /* @__PURE__ */ import_react22.default.createElement(
|
|
2923
2963
|
import_react_imask.IMaskInput,
|
|
2924
2964
|
{
|
|
2925
2965
|
...other,
|
|
@@ -2954,7 +2994,7 @@ var TextMaskAdapter3 = import_react21.default.forwardRef(function TextMaskAdapte
|
|
|
2954
2994
|
}
|
|
2955
2995
|
);
|
|
2956
2996
|
});
|
|
2957
|
-
var DatePicker = (0,
|
|
2997
|
+
var DatePicker = (0, import_react22.forwardRef)((inProps, ref) => {
|
|
2958
2998
|
const props = (0, import_joy29.useThemeProps)({ props: inProps, name: "DatePicker" });
|
|
2959
2999
|
const {
|
|
2960
3000
|
onChange,
|
|
@@ -2981,29 +3021,29 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
2981
3021
|
presets,
|
|
2982
3022
|
...innerProps
|
|
2983
3023
|
} = props;
|
|
2984
|
-
const innerRef = (0,
|
|
2985
|
-
const buttonRef = (0,
|
|
3024
|
+
const innerRef = (0, import_react22.useRef)(null);
|
|
3025
|
+
const buttonRef = (0, import_react22.useRef)(null);
|
|
2986
3026
|
const [rawValue, setValue] = useControlledState(
|
|
2987
3027
|
props.value,
|
|
2988
3028
|
props.defaultValue ?? null,
|
|
2989
|
-
(0,
|
|
3029
|
+
(0, import_react22.useCallback)(
|
|
2990
3030
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
2991
3031
|
[props.name, onChange]
|
|
2992
3032
|
)
|
|
2993
3033
|
);
|
|
2994
3034
|
const value = rawValue ?? "";
|
|
2995
3035
|
const isAlphabeticDisplay = hasAlphabeticMonth(displayFormat);
|
|
2996
|
-
const [displayValue, setDisplayValue] = (0,
|
|
3036
|
+
const [displayValue, setDisplayValue] = (0, import_react22.useState)(
|
|
2997
3037
|
() => value ? formatValueString(parseDate(value, format), displayFormat, locale) : ""
|
|
2998
3038
|
);
|
|
2999
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
3039
|
+
const [anchorEl, setAnchorEl] = (0, import_react22.useState)(null);
|
|
3000
3040
|
const open = Boolean(anchorEl);
|
|
3001
|
-
(0,
|
|
3041
|
+
(0, import_react22.useEffect)(() => {
|
|
3002
3042
|
if (!anchorEl) {
|
|
3003
3043
|
innerRef.current?.blur();
|
|
3004
3044
|
}
|
|
3005
3045
|
}, [anchorEl, innerRef]);
|
|
3006
|
-
(0,
|
|
3046
|
+
(0, import_react22.useEffect)(() => {
|
|
3007
3047
|
if (value === "") {
|
|
3008
3048
|
setDisplayValue("");
|
|
3009
3049
|
return;
|
|
@@ -3013,8 +3053,8 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3013
3053
|
setDisplayValue(formattedValue);
|
|
3014
3054
|
}
|
|
3015
3055
|
}, [displayFormat, displayValue, format, locale, value]);
|
|
3016
|
-
(0,
|
|
3017
|
-
const handleChange = (0,
|
|
3056
|
+
(0, import_react22.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
3057
|
+
const handleChange = (0, import_react22.useCallback)(
|
|
3018
3058
|
(event) => {
|
|
3019
3059
|
const value2 = event.target.value;
|
|
3020
3060
|
setDisplayValue(value2 ? formatValueString(parseDate(value2, format), displayFormat, locale) : value2);
|
|
@@ -3022,7 +3062,7 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3022
3062
|
},
|
|
3023
3063
|
[displayFormat, format, locale, setValue]
|
|
3024
3064
|
);
|
|
3025
|
-
const handleDisplayInputChange = (0,
|
|
3065
|
+
const handleDisplayInputChange = (0, import_react22.useCallback)(
|
|
3026
3066
|
(event) => {
|
|
3027
3067
|
if (event.target.value === "") {
|
|
3028
3068
|
handleChange({
|
|
@@ -3047,7 +3087,7 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3047
3087
|
},
|
|
3048
3088
|
[displayFormat, format, handleChange, props.name]
|
|
3049
3089
|
);
|
|
3050
|
-
const handleCalendarToggle = (0,
|
|
3090
|
+
const handleCalendarToggle = (0, import_react22.useCallback)(
|
|
3051
3091
|
(event) => {
|
|
3052
3092
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
3053
3093
|
setTimeout(() => {
|
|
@@ -3056,7 +3096,7 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3056
3096
|
},
|
|
3057
3097
|
[anchorEl, setAnchorEl, innerRef]
|
|
3058
3098
|
);
|
|
3059
|
-
const handleInputMouseDown = (0,
|
|
3099
|
+
const handleInputMouseDown = (0, import_react22.useCallback)(
|
|
3060
3100
|
(event) => {
|
|
3061
3101
|
if (inputReadOnly || isAlphabeticDisplay) {
|
|
3062
3102
|
event.preventDefault();
|
|
@@ -3065,7 +3105,7 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3065
3105
|
},
|
|
3066
3106
|
[inputReadOnly, isAlphabeticDisplay, buttonRef]
|
|
3067
3107
|
);
|
|
3068
|
-
const handleInputClick = (0,
|
|
3108
|
+
const handleInputClick = (0, import_react22.useCallback)(
|
|
3069
3109
|
(event) => {
|
|
3070
3110
|
if (inputReadOnly && !readOnly) {
|
|
3071
3111
|
handleCalendarToggle(event);
|
|
@@ -3073,7 +3113,7 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3073
3113
|
},
|
|
3074
3114
|
[inputReadOnly, readOnly, handleCalendarToggle]
|
|
3075
3115
|
);
|
|
3076
|
-
const handlePresetClick = (0,
|
|
3116
|
+
const handlePresetClick = (0, import_react22.useCallback)(
|
|
3077
3117
|
(presetValue) => {
|
|
3078
3118
|
handleChange({
|
|
3079
3119
|
target: {
|
|
@@ -3085,7 +3125,7 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3085
3125
|
},
|
|
3086
3126
|
[handleChange, props.name]
|
|
3087
3127
|
);
|
|
3088
|
-
const isPresetDisabled = (0,
|
|
3128
|
+
const isPresetDisabled = (0, import_react22.useCallback)(
|
|
3089
3129
|
(presetValue) => {
|
|
3090
3130
|
try {
|
|
3091
3131
|
const date = parseDate(presetValue, format);
|
|
@@ -3102,7 +3142,7 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3102
3142
|
},
|
|
3103
3143
|
[format, minDate, maxDate, disableFuture, disablePast, shouldDisableDate]
|
|
3104
3144
|
);
|
|
3105
|
-
return /* @__PURE__ */
|
|
3145
|
+
return /* @__PURE__ */ import_react22.default.createElement(DatePickerRoot, { sx, className }, /* @__PURE__ */ import_react22.default.createElement(import_base3.FocusTrap, { open: true }, /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement(
|
|
3106
3146
|
Input_default,
|
|
3107
3147
|
{
|
|
3108
3148
|
...innerProps,
|
|
@@ -3129,7 +3169,7 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3129
3169
|
}
|
|
3130
3170
|
},
|
|
3131
3171
|
sx: { width: "100%" },
|
|
3132
|
-
endDecorator: /* @__PURE__ */
|
|
3172
|
+
endDecorator: /* @__PURE__ */ import_react22.default.createElement(
|
|
3133
3173
|
CalendarButton,
|
|
3134
3174
|
{
|
|
3135
3175
|
ref: buttonRef,
|
|
@@ -3141,13 +3181,13 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3141
3181
|
"aria-expanded": open,
|
|
3142
3182
|
disabled
|
|
3143
3183
|
},
|
|
3144
|
-
/* @__PURE__ */
|
|
3184
|
+
/* @__PURE__ */ import_react22.default.createElement(import_CalendarToday.default, null)
|
|
3145
3185
|
),
|
|
3146
3186
|
label,
|
|
3147
3187
|
helperText,
|
|
3148
3188
|
readOnly: readOnly || inputReadOnly || isAlphabeticDisplay
|
|
3149
3189
|
}
|
|
3150
|
-
), open && /* @__PURE__ */
|
|
3190
|
+
), open && /* @__PURE__ */ import_react22.default.createElement(import_base3.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react22.default.createElement(
|
|
3151
3191
|
StyledPopper,
|
|
3152
3192
|
{
|
|
3153
3193
|
id: "date-picker-popper",
|
|
@@ -3166,7 +3206,7 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3166
3206
|
"aria-label": "Calendar Tooltip",
|
|
3167
3207
|
"aria-expanded": open
|
|
3168
3208
|
},
|
|
3169
|
-
/* @__PURE__ */
|
|
3209
|
+
/* @__PURE__ */ import_react22.default.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react22.default.createElement(CalendarSheetContent, null, /* @__PURE__ */ import_react22.default.createElement(CalendarSection, null, /* @__PURE__ */ import_react22.default.createElement(
|
|
3170
3210
|
Calendar_default,
|
|
3171
3211
|
{
|
|
3172
3212
|
value: value && !Number.isNaN(parseDate(value, format).getTime()) ? [parseDate(value, format), void 0] : void 0,
|
|
@@ -3186,14 +3226,14 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3186
3226
|
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0,
|
|
3187
3227
|
locale
|
|
3188
3228
|
}
|
|
3189
|
-
), !hideClearButton && /* @__PURE__ */
|
|
3229
|
+
), !hideClearButton && /* @__PURE__ */ import_react22.default.createElement(
|
|
3190
3230
|
DialogActions_default,
|
|
3191
3231
|
{
|
|
3192
3232
|
sx: {
|
|
3193
3233
|
p: 1
|
|
3194
3234
|
}
|
|
3195
3235
|
},
|
|
3196
|
-
/* @__PURE__ */
|
|
3236
|
+
/* @__PURE__ */ import_react22.default.createElement(
|
|
3197
3237
|
Button_default,
|
|
3198
3238
|
{
|
|
3199
3239
|
size,
|
|
@@ -3211,9 +3251,9 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3211
3251
|
},
|
|
3212
3252
|
"Clear"
|
|
3213
3253
|
)
|
|
3214
|
-
)), presets && presets.length > 0 && /* @__PURE__ */
|
|
3254
|
+
)), presets && presets.length > 0 && /* @__PURE__ */ import_react22.default.createElement(PresetPanel, null, presets.map((preset) => {
|
|
3215
3255
|
const disabled2 = isPresetDisabled(preset.value);
|
|
3216
|
-
return /* @__PURE__ */
|
|
3256
|
+
return /* @__PURE__ */ import_react22.default.createElement(
|
|
3217
3257
|
PresetItem,
|
|
3218
3258
|
{
|
|
3219
3259
|
key: preset.label,
|
|
@@ -3234,11 +3274,11 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3234
3274
|
var DatePicker_default = DatePicker;
|
|
3235
3275
|
|
|
3236
3276
|
// src/components/Textarea/Textarea.tsx
|
|
3237
|
-
var
|
|
3277
|
+
var import_react23 = __toESM(require("react"));
|
|
3238
3278
|
var import_joy30 = require("@mui/joy");
|
|
3239
3279
|
var import_framer_motion19 = require("framer-motion");
|
|
3240
3280
|
var MotionTextarea = (0, import_framer_motion19.motion)(import_joy30.Textarea);
|
|
3241
|
-
var
|
|
3281
|
+
var TextareaBase = (props) => {
|
|
3242
3282
|
const {
|
|
3243
3283
|
label,
|
|
3244
3284
|
error,
|
|
@@ -3254,7 +3294,7 @@ var Textarea = (props) => {
|
|
|
3254
3294
|
className,
|
|
3255
3295
|
...innerProps
|
|
3256
3296
|
} = props;
|
|
3257
|
-
const textarea = /* @__PURE__ */
|
|
3297
|
+
const textarea = /* @__PURE__ */ import_react23.default.createElement(
|
|
3258
3298
|
MotionTextarea,
|
|
3259
3299
|
{
|
|
3260
3300
|
required,
|
|
@@ -3266,7 +3306,7 @@ var Textarea = (props) => {
|
|
|
3266
3306
|
...innerProps
|
|
3267
3307
|
}
|
|
3268
3308
|
);
|
|
3269
|
-
return /* @__PURE__ */
|
|
3309
|
+
return /* @__PURE__ */ import_react23.default.createElement(
|
|
3270
3310
|
FormControl_default,
|
|
3271
3311
|
{
|
|
3272
3312
|
required,
|
|
@@ -3277,18 +3317,22 @@ var Textarea = (props) => {
|
|
|
3277
3317
|
sx,
|
|
3278
3318
|
className
|
|
3279
3319
|
},
|
|
3280
|
-
label && /* @__PURE__ */
|
|
3320
|
+
label && /* @__PURE__ */ import_react23.default.createElement(FormLabel_default, null, label),
|
|
3281
3321
|
textarea,
|
|
3282
|
-
helperText && /* @__PURE__ */
|
|
3322
|
+
helperText && /* @__PURE__ */ import_react23.default.createElement(FormHelperText_default, null, helperText)
|
|
3283
3323
|
);
|
|
3284
3324
|
};
|
|
3325
|
+
var Textarea = import_react23.default.forwardRef((props, ref) => {
|
|
3326
|
+
const textareaSlotProps = useSlotRef(props.slotProps?.textarea, ref);
|
|
3327
|
+
return /* @__PURE__ */ import_react23.default.createElement(TextareaBase, { ...props, slotProps: { ...props.slotProps, textarea: textareaSlotProps } });
|
|
3328
|
+
});
|
|
3285
3329
|
Textarea.displayName = "Textarea";
|
|
3286
3330
|
|
|
3287
3331
|
// src/components/Textarea/index.ts
|
|
3288
3332
|
var Textarea_default = Textarea;
|
|
3289
3333
|
|
|
3290
3334
|
// src/components/Select/Select.tsx
|
|
3291
|
-
var
|
|
3335
|
+
var import_react24 = __toESM(require("react"));
|
|
3292
3336
|
var import_joy31 = require("@mui/joy");
|
|
3293
3337
|
var import_framer_motion20 = require("framer-motion");
|
|
3294
3338
|
var MotionOption = (0, import_framer_motion20.motion)(import_joy31.Option);
|
|
@@ -3299,7 +3343,7 @@ var secondaryTextLevelMap2 = {
|
|
|
3299
3343
|
lg: "body-md"
|
|
3300
3344
|
};
|
|
3301
3345
|
Option.displayName = "Option";
|
|
3302
|
-
function
|
|
3346
|
+
function SelectInner(props, ref) {
|
|
3303
3347
|
const {
|
|
3304
3348
|
label,
|
|
3305
3349
|
helperText,
|
|
@@ -3325,7 +3369,7 @@ function Select(props) {
|
|
|
3325
3369
|
formHelperText: formHelperTextProps,
|
|
3326
3370
|
...joySlotProps
|
|
3327
3371
|
} = slotProps ?? {};
|
|
3328
|
-
const options = (0,
|
|
3372
|
+
const options = (0, import_react24.useMemo)(
|
|
3329
3373
|
() => props.options.map((option) => {
|
|
3330
3374
|
if (option.hasOwnProperty("value") && option.hasOwnProperty("label")) {
|
|
3331
3375
|
return option;
|
|
@@ -3350,14 +3394,15 @@ function Select(props) {
|
|
|
3350
3394
|
};
|
|
3351
3395
|
onChange?.(newEvent, newValue);
|
|
3352
3396
|
};
|
|
3353
|
-
const optionMap = (0,
|
|
3397
|
+
const optionMap = (0, import_react24.useMemo)(() => {
|
|
3354
3398
|
const map = /* @__PURE__ */ new Map();
|
|
3355
3399
|
options.forEach((option) => {
|
|
3356
3400
|
map.set(option.value, option);
|
|
3357
3401
|
});
|
|
3358
3402
|
return map;
|
|
3359
3403
|
}, [options]);
|
|
3360
|
-
const
|
|
3404
|
+
const buttonSlotProps = useSlotRef(joySlotProps.button, ref);
|
|
3405
|
+
const select = /* @__PURE__ */ import_react24.default.createElement(
|
|
3361
3406
|
import_joy31.Select,
|
|
3362
3407
|
{
|
|
3363
3408
|
...innerProps,
|
|
@@ -3365,7 +3410,7 @@ function Select(props) {
|
|
|
3365
3410
|
disabled,
|
|
3366
3411
|
size,
|
|
3367
3412
|
color: error ? "danger" : color,
|
|
3368
|
-
slotProps: joySlotProps,
|
|
3413
|
+
slotProps: { ...joySlotProps, button: buttonSlotProps },
|
|
3369
3414
|
onChange: handleChange,
|
|
3370
3415
|
renderValue: (selected) => {
|
|
3371
3416
|
if (!selected) return null;
|
|
@@ -3375,9 +3420,9 @@ function Select(props) {
|
|
|
3375
3420
|
return optionMap.get(selected.value)?.label;
|
|
3376
3421
|
}
|
|
3377
3422
|
},
|
|
3378
|
-
options.map((option) => /* @__PURE__ */
|
|
3423
|
+
options.map((option) => /* @__PURE__ */ import_react24.default.createElement(Option, { key: option.value, value: option.value, disabled: option.disabled }, option.secondaryText ? /* @__PURE__ */ import_react24.default.createElement(import_joy31.ListItemContent, { sx: { gap: 0.5 } }, /* @__PURE__ */ import_react24.default.createElement(import_joy31.Typography, { level: "inherit" }, option.label), /* @__PURE__ */ import_react24.default.createElement(import_joy31.Typography, { level: secondaryTextLevelMap2[size ?? "md"], textColor: "text.tertiary" }, option.secondaryText)) : option.label))
|
|
3379
3424
|
);
|
|
3380
|
-
return /* @__PURE__ */
|
|
3425
|
+
return /* @__PURE__ */ import_react24.default.createElement(
|
|
3381
3426
|
FormControl_default,
|
|
3382
3427
|
{
|
|
3383
3428
|
required,
|
|
@@ -3390,11 +3435,12 @@ function Select(props) {
|
|
|
3390
3435
|
className,
|
|
3391
3436
|
...formControlProps
|
|
3392
3437
|
},
|
|
3393
|
-
label && /* @__PURE__ */
|
|
3438
|
+
label && /* @__PURE__ */ import_react24.default.createElement(FormLabel_default, { ...formLabelProps }, label),
|
|
3394
3439
|
select,
|
|
3395
|
-
helperText && /* @__PURE__ */
|
|
3440
|
+
helperText && /* @__PURE__ */ import_react24.default.createElement(FormHelperText_default, { ...formHelperTextProps }, helperText)
|
|
3396
3441
|
);
|
|
3397
3442
|
}
|
|
3443
|
+
var Select = import_react24.default.forwardRef(SelectInner);
|
|
3398
3444
|
Select.displayName = "Select";
|
|
3399
3445
|
|
|
3400
3446
|
// src/components/Select/index.ts
|
|
@@ -3404,7 +3450,7 @@ var Select_default = Select;
|
|
|
3404
3450
|
var import_joy34 = require("@mui/joy");
|
|
3405
3451
|
|
|
3406
3452
|
// src/components/InfoSign/InfoSign.tsx
|
|
3407
|
-
var
|
|
3453
|
+
var import_react25 = __toESM(require("react"));
|
|
3408
3454
|
var import_joy32 = require("@mui/joy");
|
|
3409
3455
|
var import_Info = __toESM(require("@mui/icons-material/Info"));
|
|
3410
3456
|
var InfoIcon = (0, import_joy32.styled)(import_Info.default, {
|
|
@@ -3417,7 +3463,7 @@ var InfoIcon = (0, import_joy32.styled)(import_Info.default, {
|
|
|
3417
3463
|
}));
|
|
3418
3464
|
function InfoSign(props) {
|
|
3419
3465
|
const { message, placement } = props;
|
|
3420
|
-
return /* @__PURE__ */
|
|
3466
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
3421
3467
|
Tooltip_default,
|
|
3422
3468
|
{
|
|
3423
3469
|
arrow: true,
|
|
@@ -3427,9 +3473,9 @@ function InfoSign(props) {
|
|
|
3427
3473
|
maxWidth: "320px"
|
|
3428
3474
|
}
|
|
3429
3475
|
},
|
|
3430
|
-
title: message?.split("\n").map((line, i) => /* @__PURE__ */
|
|
3476
|
+
title: message?.split("\n").map((line, i) => /* @__PURE__ */ import_react25.default.createElement("div", { key: `info-sign-${i}` }, line))
|
|
3431
3477
|
},
|
|
3432
|
-
/* @__PURE__ */
|
|
3478
|
+
/* @__PURE__ */ import_react25.default.createElement(InfoIcon, null)
|
|
3433
3479
|
);
|
|
3434
3480
|
}
|
|
3435
3481
|
|
|
@@ -3442,9 +3488,9 @@ var TextEllipsis = ({
|
|
|
3442
3488
|
lineClamp,
|
|
3443
3489
|
...rest
|
|
3444
3490
|
}) => {
|
|
3445
|
-
const textRef = (0,
|
|
3446
|
-
const [showTooltip, setShowTooltip] = (0,
|
|
3447
|
-
(0,
|
|
3491
|
+
const textRef = (0, import_react26.useRef)(null);
|
|
3492
|
+
const [showTooltip, setShowTooltip] = (0, import_react26.useState)(false);
|
|
3493
|
+
(0, import_react26.useLayoutEffect)(() => {
|
|
3448
3494
|
const element = textRef.current;
|
|
3449
3495
|
if (!element) return;
|
|
3450
3496
|
const checkTruncation = () => {
|
|
@@ -3456,21 +3502,21 @@ var TextEllipsis = ({
|
|
|
3456
3502
|
ro.observe(element);
|
|
3457
3503
|
return () => ro.disconnect();
|
|
3458
3504
|
}, [children, lineClamp]);
|
|
3459
|
-
return /* @__PURE__ */
|
|
3505
|
+
return /* @__PURE__ */ import_react26.default.createElement(Tooltip_default, { title: showTooltip ? children : "", placement: "top" }, /* @__PURE__ */ import_react26.default.createElement(EllipsisDiv, { ref: textRef, lineClamp, ...rest }, children));
|
|
3460
3506
|
};
|
|
3461
3507
|
var CellTextEllipsis = ({ children }) => {
|
|
3462
|
-
const textRef = (0,
|
|
3463
|
-
const [showTooltip, setShowTooltip] = (0,
|
|
3464
|
-
(0,
|
|
3508
|
+
const textRef = (0, import_react26.useRef)(null);
|
|
3509
|
+
const [showTooltip, setShowTooltip] = (0, import_react26.useState)(false);
|
|
3510
|
+
(0, import_react26.useLayoutEffect)(() => {
|
|
3465
3511
|
const element = textRef.current;
|
|
3466
3512
|
if (element) {
|
|
3467
3513
|
const isTextTruncated = element.scrollWidth > element.clientWidth;
|
|
3468
3514
|
setShowTooltip(isTextTruncated);
|
|
3469
3515
|
}
|
|
3470
3516
|
}, [children]);
|
|
3471
|
-
const content = /* @__PURE__ */
|
|
3517
|
+
const content = /* @__PURE__ */ import_react26.default.createElement(EllipsisDiv, { ref: textRef }, children);
|
|
3472
3518
|
if (showTooltip) {
|
|
3473
|
-
return /* @__PURE__ */
|
|
3519
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
3474
3520
|
Tooltip_default,
|
|
3475
3521
|
{
|
|
3476
3522
|
title: children,
|
|
@@ -3509,34 +3555,32 @@ var HeadCell = (props) => {
|
|
|
3509
3555
|
tableColRef,
|
|
3510
3556
|
headerClassName,
|
|
3511
3557
|
headerLineClamp,
|
|
3512
|
-
onAutoFit
|
|
3558
|
+
onAutoFit,
|
|
3559
|
+
columnId
|
|
3513
3560
|
} = props;
|
|
3514
3561
|
const theme = (0, import_joy33.useTheme)();
|
|
3515
3562
|
const ref = headerRef;
|
|
3516
3563
|
const colRef = tableColRef;
|
|
3517
|
-
const localRef = (0,
|
|
3518
|
-
(0,
|
|
3564
|
+
const localRef = (0, import_react26.useRef)(null);
|
|
3565
|
+
(0, import_react26.useLayoutEffect)(() => {
|
|
3519
3566
|
ref.current = localRef.current;
|
|
3520
3567
|
}, [ref]);
|
|
3521
|
-
const [isHovered, setIsHovered] = (0,
|
|
3568
|
+
const [isHovered, setIsHovered] = (0, import_react26.useState)(false);
|
|
3522
3569
|
const sortable = type === "actions" ? false : _sortable;
|
|
3523
|
-
const headId = (0,
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
);
|
|
3527
|
-
const isResizingRef = (0, import_react25.useRef)(false);
|
|
3528
|
-
const resizer = (0, import_react25.useMemo)(
|
|
3570
|
+
const headId = (0, import_react26.useMemo)(() => getHeaderCellId(tableId, columnId ?? field), [tableId, columnId, field]);
|
|
3571
|
+
const isResizingRef = (0, import_react26.useRef)(false);
|
|
3572
|
+
const resizer = (0, import_react26.useMemo)(
|
|
3529
3573
|
() => resizable ?? true ? Resizer(
|
|
3530
3574
|
ref,
|
|
3531
3575
|
colRef,
|
|
3532
3576
|
(isResizing) => {
|
|
3533
3577
|
isResizingRef.current = isResizing;
|
|
3534
3578
|
},
|
|
3535
|
-
onAutoFit ? () => onAutoFit(field) : void 0
|
|
3579
|
+
onAutoFit ? () => onAutoFit(columnId ?? String(field)) : void 0
|
|
3536
3580
|
) : null,
|
|
3537
|
-
[resizable, ref, colRef, onAutoFit, field]
|
|
3581
|
+
[resizable, ref, colRef, onAutoFit, columnId, field]
|
|
3538
3582
|
);
|
|
3539
|
-
const style = (0,
|
|
3583
|
+
const style = (0, import_react26.useMemo)(
|
|
3540
3584
|
() => ({
|
|
3541
3585
|
width,
|
|
3542
3586
|
minWidth: minWidth ?? "50px",
|
|
@@ -3554,10 +3598,10 @@ var HeadCell = (props) => {
|
|
|
3554
3598
|
);
|
|
3555
3599
|
const textAlign = getTextAlign(props);
|
|
3556
3600
|
const initialSort = sortOrder[0];
|
|
3557
|
-
const sortIcon = (0,
|
|
3601
|
+
const sortIcon = (0, import_react26.useMemo)(() => {
|
|
3558
3602
|
const isSorted = !!sort;
|
|
3559
3603
|
const isVisible = sortable && (isSorted || isHovered);
|
|
3560
|
-
return /* @__PURE__ */
|
|
3604
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_framer_motion21.AnimatePresence, { mode: "wait" }, isVisible && /* @__PURE__ */ import_react26.default.createElement(
|
|
3561
3605
|
MotionSortIcon,
|
|
3562
3606
|
{
|
|
3563
3607
|
key: "sort-icon",
|
|
@@ -3585,21 +3629,21 @@ var HeadCell = (props) => {
|
|
|
3585
3629
|
}
|
|
3586
3630
|
));
|
|
3587
3631
|
}, [headId, initialSort, sort, sortable, isHovered]);
|
|
3588
|
-
const infoSign = (0,
|
|
3589
|
-
() => description ? /* @__PURE__ */
|
|
3632
|
+
const infoSign = (0, import_react26.useMemo)(
|
|
3633
|
+
() => description ? /* @__PURE__ */ import_react26.default.createElement(InfoSign_default, { message: description, placement: "bottom" }) : null,
|
|
3590
3634
|
[description]
|
|
3591
3635
|
);
|
|
3592
|
-
const params = (0,
|
|
3636
|
+
const params = (0, import_react26.useMemo)(
|
|
3593
3637
|
() => ({
|
|
3594
3638
|
field
|
|
3595
3639
|
}),
|
|
3596
3640
|
[field]
|
|
3597
3641
|
);
|
|
3598
|
-
const computedHeaderClassName = (0,
|
|
3642
|
+
const computedHeaderClassName = (0, import_react26.useMemo)(
|
|
3599
3643
|
() => (typeof headerClassName === "function" ? headerClassName(params) : headerClassName) || void 0,
|
|
3600
3644
|
[headerClassName, params]
|
|
3601
3645
|
);
|
|
3602
|
-
return /* @__PURE__ */
|
|
3646
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
3603
3647
|
StyledTh,
|
|
3604
3648
|
{
|
|
3605
3649
|
id: headId,
|
|
@@ -3608,7 +3652,7 @@ var HeadCell = (props) => {
|
|
|
3608
3652
|
ref: localRef,
|
|
3609
3653
|
key: field,
|
|
3610
3654
|
style,
|
|
3611
|
-
onClick: (0,
|
|
3655
|
+
onClick: (0, import_react26.useCallback)(
|
|
3612
3656
|
(e) => {
|
|
3613
3657
|
if (isResizingRef.current) return;
|
|
3614
3658
|
if (!(e.target instanceof Element) || !e.currentTarget.contains(e.target)) return;
|
|
@@ -3622,7 +3666,7 @@ var HeadCell = (props) => {
|
|
|
3622
3666
|
initial: "initial",
|
|
3623
3667
|
className: computedHeaderClassName
|
|
3624
3668
|
},
|
|
3625
|
-
/* @__PURE__ */
|
|
3669
|
+
/* @__PURE__ */ import_react26.default.createElement(Stack_default, { gap: 1, direction: "row", justifyContent: textAlign, alignItems: "center", sx: { minWidth: 0 } }, textAlign === "end" && sortIcon, textAlign === "end" && infoSign, /* @__PURE__ */ import_react26.default.createElement(TextEllipsis, { lineClamp: headerLineClamp, "data-slot": "header-text" }, headerName ?? field, editMode && required && /* @__PURE__ */ import_react26.default.createElement(Asterisk, null, "*")), textAlign === "start" && infoSign, textAlign === "start" && sortIcon),
|
|
3626
3670
|
resizer
|
|
3627
3671
|
);
|
|
3628
3672
|
};
|
|
@@ -3647,9 +3691,9 @@ var BodyCell = (props) => {
|
|
|
3647
3691
|
onCellEditStop
|
|
3648
3692
|
} = props;
|
|
3649
3693
|
const theme = (0, import_joy33.useTheme)();
|
|
3650
|
-
const [value, setValue] = (0,
|
|
3651
|
-
const cellRef = (0,
|
|
3652
|
-
const params = (0,
|
|
3694
|
+
const [value, setValue] = (0, import_react26.useState)(row[field]);
|
|
3695
|
+
const cellRef = (0, import_react26.useRef)(null);
|
|
3696
|
+
const params = (0, import_react26.useMemo)(
|
|
3653
3697
|
() => ({
|
|
3654
3698
|
row,
|
|
3655
3699
|
value,
|
|
@@ -3658,20 +3702,20 @@ var BodyCell = (props) => {
|
|
|
3658
3702
|
}),
|
|
3659
3703
|
[row, rowId, value, field]
|
|
3660
3704
|
);
|
|
3661
|
-
const editMode = (0,
|
|
3705
|
+
const editMode = (0, import_react26.useMemo)(
|
|
3662
3706
|
() => !!(props.editMode && (typeof isCellEditable === "function" ? isCellEditable(params) : isCellEditable ?? true)),
|
|
3663
3707
|
[props.editMode, isCellEditable, params]
|
|
3664
3708
|
);
|
|
3665
3709
|
const propsComponentProps = "componentProps" in props ? props.componentProps : null;
|
|
3666
3710
|
const hasComponentProps = "componentProps" in props;
|
|
3667
|
-
const componentProps = (0,
|
|
3711
|
+
const componentProps = (0, import_react26.useMemo)(
|
|
3668
3712
|
() => ({
|
|
3669
3713
|
...hasComponentProps && (typeof propsComponentProps === "function" ? propsComponentProps(params) : propsComponentProps || {}),
|
|
3670
3714
|
size: "sm"
|
|
3671
3715
|
}),
|
|
3672
3716
|
[hasComponentProps, propsComponentProps, params]
|
|
3673
3717
|
);
|
|
3674
|
-
const editModeComponentProps = (0,
|
|
3718
|
+
const editModeComponentProps = (0, import_react26.useMemo)(
|
|
3675
3719
|
() => ({
|
|
3676
3720
|
...componentProps,
|
|
3677
3721
|
onChange: (e) => {
|
|
@@ -3733,25 +3777,25 @@ var BodyCell = (props) => {
|
|
|
3733
3777
|
}),
|
|
3734
3778
|
[params, row, field, value, componentProps, type, onCellEditStop, onCellEditStart]
|
|
3735
3779
|
);
|
|
3736
|
-
const MemoizedRenderEditCell = (0,
|
|
3737
|
-
const MemoizedRenderCell = (0,
|
|
3738
|
-
const EditModeComponent = (0,
|
|
3780
|
+
const MemoizedRenderEditCell = (0, import_react26.useMemo)(() => renderEditCell ? (0, import_react26.memo)(renderEditCell) : null, [renderEditCell]);
|
|
3781
|
+
const MemoizedRenderCell = (0, import_react26.useMemo)(() => renderCell ? (0, import_react26.memo)(renderCell) : null, [renderCell]);
|
|
3782
|
+
const EditModeComponent = (0, import_react26.useMemo)(() => {
|
|
3739
3783
|
if (MemoizedRenderEditCell) {
|
|
3740
|
-
return (0,
|
|
3784
|
+
return (0, import_react26.createElement)(MemoizedRenderEditCell, params);
|
|
3741
3785
|
}
|
|
3742
3786
|
return {
|
|
3743
|
-
date: /* @__PURE__ */
|
|
3744
|
-
currency: /* @__PURE__ */
|
|
3787
|
+
date: /* @__PURE__ */ import_react26.default.createElement(DatePicker_default, { value, ...editModeComponentProps }),
|
|
3788
|
+
currency: /* @__PURE__ */ import_react26.default.createElement(
|
|
3745
3789
|
CurrencyInput_default,
|
|
3746
3790
|
{
|
|
3747
3791
|
value,
|
|
3748
3792
|
...editModeComponentProps
|
|
3749
3793
|
}
|
|
3750
3794
|
),
|
|
3751
|
-
number: /* @__PURE__ */
|
|
3752
|
-
text: /* @__PURE__ */
|
|
3753
|
-
longText: /* @__PURE__ */
|
|
3754
|
-
autocomplete: /* @__PURE__ */
|
|
3795
|
+
number: /* @__PURE__ */ import_react26.default.createElement(Input_default, { value, type: "number", ...editModeComponentProps }),
|
|
3796
|
+
text: /* @__PURE__ */ import_react26.default.createElement(Input_default, { value, type: "text", ...editModeComponentProps }),
|
|
3797
|
+
longText: /* @__PURE__ */ import_react26.default.createElement(Textarea_default, { value, ...editModeComponentProps }),
|
|
3798
|
+
autocomplete: /* @__PURE__ */ import_react26.default.createElement(
|
|
3755
3799
|
Autocomplete_default,
|
|
3756
3800
|
{
|
|
3757
3801
|
value,
|
|
@@ -3759,7 +3803,7 @@ var BodyCell = (props) => {
|
|
|
3759
3803
|
...editModeComponentProps
|
|
3760
3804
|
}
|
|
3761
3805
|
),
|
|
3762
|
-
select: /* @__PURE__ */
|
|
3806
|
+
select: /* @__PURE__ */ import_react26.default.createElement(
|
|
3763
3807
|
Select_default,
|
|
3764
3808
|
{
|
|
3765
3809
|
value,
|
|
@@ -3770,13 +3814,13 @@ var BodyCell = (props) => {
|
|
|
3770
3814
|
}[type || "text"];
|
|
3771
3815
|
}, [value, editModeComponentProps, type, MemoizedRenderEditCell, params]);
|
|
3772
3816
|
const linkComponentFromProps = props.component;
|
|
3773
|
-
const ReadModeComponent = (0,
|
|
3817
|
+
const ReadModeComponent = (0, import_react26.useMemo)(() => {
|
|
3774
3818
|
if (MemoizedRenderCell) {
|
|
3775
|
-
return (0,
|
|
3819
|
+
return (0, import_react26.createElement)(MemoizedRenderCell, params);
|
|
3776
3820
|
}
|
|
3777
3821
|
const innerText = value;
|
|
3778
3822
|
const typedComponent = {
|
|
3779
|
-
link:
|
|
3823
|
+
link: import_react26.default.createElement(linkComponentFromProps || import_joy34.Link, {
|
|
3780
3824
|
children: innerText,
|
|
3781
3825
|
...componentProps
|
|
3782
3826
|
})
|
|
@@ -3784,27 +3828,27 @@ var BodyCell = (props) => {
|
|
|
3784
3828
|
return typedComponent || innerText;
|
|
3785
3829
|
}, [value, MemoizedRenderCell, params, type, componentProps, linkComponentFromProps]);
|
|
3786
3830
|
const getActions = props.getActions;
|
|
3787
|
-
const CellComponent = (0,
|
|
3831
|
+
const CellComponent = (0, import_react26.useMemo)(() => {
|
|
3788
3832
|
if (type === "actions") {
|
|
3789
|
-
return /* @__PURE__ */
|
|
3833
|
+
return /* @__PURE__ */ import_react26.default.createElement(Stack_default, { direction: "row", gap: 1, justifyContent: "center", alignItems: "center" }, getActions?.(params));
|
|
3790
3834
|
}
|
|
3791
3835
|
return editMode && EditModeComponent ? EditModeComponent : ReadModeComponent;
|
|
3792
3836
|
}, [type, getActions, params, editMode, EditModeComponent, ReadModeComponent]);
|
|
3793
|
-
const showTooltip = (0,
|
|
3837
|
+
const showTooltip = (0, import_react26.useMemo)(() => noWrap && type === "longText", [noWrap, type]);
|
|
3794
3838
|
const isBoundary = props.isLastStartPinnedColumn || props.isLastEndPinnedColumn;
|
|
3795
|
-
const computedCellClassName = (0,
|
|
3839
|
+
const computedCellClassName = (0, import_react26.useMemo)(
|
|
3796
3840
|
() => (typeof cellClassName === "function" ? cellClassName(params) : cellClassName) || "",
|
|
3797
3841
|
[cellClassName, params]
|
|
3798
3842
|
);
|
|
3799
|
-
(0,
|
|
3843
|
+
(0, import_react26.useEffect)(() => {
|
|
3800
3844
|
setValue(row[field]);
|
|
3801
3845
|
}, [row, field]);
|
|
3802
|
-
return /* @__PURE__ */
|
|
3846
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
3803
3847
|
StyledTd,
|
|
3804
3848
|
{
|
|
3805
3849
|
ref: cellRef,
|
|
3806
3850
|
key: field,
|
|
3807
|
-
headers:
|
|
3851
|
+
headers: getHeaderCellId(tableId, props.columnId ?? field),
|
|
3808
3852
|
sx: {
|
|
3809
3853
|
textAlign: getTextAlign({ type }),
|
|
3810
3854
|
verticalAlign: editMode ? "top" : "middle",
|
|
@@ -3816,16 +3860,16 @@ var BodyCell = (props) => {
|
|
|
3816
3860
|
},
|
|
3817
3861
|
className: [isLastStartPinnedColumn && "is-last-left", isLastEndPinnedColumn && "is-last-right", computedCellClassName].filter(Boolean).join(" ") || ""
|
|
3818
3862
|
},
|
|
3819
|
-
(0,
|
|
3820
|
-
() => showTooltip ? /* @__PURE__ */
|
|
3863
|
+
(0, import_react26.useMemo)(
|
|
3864
|
+
() => showTooltip ? /* @__PURE__ */ import_react26.default.createElement(CellTextEllipsis, null, CellComponent) : CellComponent,
|
|
3821
3865
|
[CellComponent, showTooltip]
|
|
3822
3866
|
)
|
|
3823
3867
|
);
|
|
3824
3868
|
};
|
|
3825
|
-
var BodyRow = (0,
|
|
3869
|
+
var BodyRow = (0, import_react26.memo)(
|
|
3826
3870
|
(props) => {
|
|
3827
3871
|
const { tableId, columns, rowId, editMode, noWrap, row } = props;
|
|
3828
|
-
return /* @__PURE__ */
|
|
3872
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, columns.map((column, i) => /* @__PURE__ */ import_react26.default.createElement(
|
|
3829
3873
|
BodyCell,
|
|
3830
3874
|
{
|
|
3831
3875
|
key: `${rowId}_${column.field.toString()}_${i}`,
|
|
@@ -3858,7 +3902,7 @@ var StyledTableRow2 = (0, import_joy33.styled)("tr", {
|
|
|
3858
3902
|
}
|
|
3859
3903
|
}
|
|
3860
3904
|
}));
|
|
3861
|
-
var VirtualizedTableRow = (0,
|
|
3905
|
+
var VirtualizedTableRow = (0, import_react26.memo)(StyledTableRow2, (prevProps, nextProps) => {
|
|
3862
3906
|
return prevProps.striped === nextProps.striped && prevProps.style?.height === nextProps.style?.height && prevProps.style?.transform === nextProps.style?.transform && // @ts-ignore
|
|
3863
3907
|
prevProps["data-row-id"] === nextProps["data-row-id"] && // @ts-ignore
|
|
3864
3908
|
prevProps["data-index"] === nextProps["data-index"] && prevProps.tabIndex === nextProps.tabIndex && prevProps["aria-checked"] === nextProps["aria-checked"] && // Track column structure changes (e.g. isCellEditable toggled, columns added/removed)
|
|
@@ -3869,36 +3913,46 @@ var VirtualizedTableRow = (0, import_react25.memo)(StyledTableRow2, (prevProps,
|
|
|
3869
3913
|
});
|
|
3870
3914
|
|
|
3871
3915
|
// src/components/DataTable/hooks.ts
|
|
3872
|
-
var
|
|
3873
|
-
function useColumnWidths(
|
|
3874
|
-
const [widths, setWidths] = (0,
|
|
3875
|
-
const roRef = (0,
|
|
3876
|
-
(0,
|
|
3916
|
+
var import_react27 = require("react");
|
|
3917
|
+
function useColumnWidths(columnsById) {
|
|
3918
|
+
const [widths, setWidths] = (0, import_react27.useState)({});
|
|
3919
|
+
const roRef = (0, import_react27.useRef)();
|
|
3920
|
+
(0, import_react27.useLayoutEffect)(() => {
|
|
3877
3921
|
if (roRef.current) roRef.current.disconnect();
|
|
3878
3922
|
roRef.current = new ResizeObserver((entries) => {
|
|
3879
|
-
let changed = false;
|
|
3880
3923
|
setWidths((prev) => {
|
|
3924
|
+
let changed = false;
|
|
3881
3925
|
const next = { ...prev };
|
|
3882
3926
|
entries.forEach((entry) => {
|
|
3883
|
-
const
|
|
3927
|
+
const columnId = entry.target.dataset.hdsColumnId;
|
|
3884
3928
|
const w = Math.round(entry.target.getBoundingClientRect().width);
|
|
3885
|
-
if (
|
|
3886
|
-
|
|
3929
|
+
if (w === 0) return;
|
|
3930
|
+
if (next[columnId] !== w) {
|
|
3931
|
+
next[columnId] = w;
|
|
3887
3932
|
changed = true;
|
|
3888
3933
|
}
|
|
3889
3934
|
});
|
|
3890
3935
|
return changed ? next : prev;
|
|
3891
3936
|
});
|
|
3892
3937
|
});
|
|
3893
|
-
|
|
3938
|
+
const measured = {};
|
|
3939
|
+
Object.entries(columnsById).forEach(([columnId, def]) => {
|
|
3894
3940
|
const el = def.headerRef.current;
|
|
3895
3941
|
if (el) {
|
|
3896
|
-
el.dataset.
|
|
3942
|
+
el.dataset.hdsColumnId = columnId;
|
|
3943
|
+
el.dataset.field = String(def.field);
|
|
3944
|
+
const w = Math.round(el.getBoundingClientRect().width);
|
|
3945
|
+
if (w > 0) measured[columnId] = w;
|
|
3897
3946
|
roRef.current.observe(el);
|
|
3898
3947
|
}
|
|
3899
3948
|
});
|
|
3949
|
+
setWidths((prev) => {
|
|
3950
|
+
const keys = Object.keys(measured);
|
|
3951
|
+
const same = keys.length === Object.keys(prev).length && keys.every((key) => prev[key] === measured[key]);
|
|
3952
|
+
return same ? prev : measured;
|
|
3953
|
+
});
|
|
3900
3954
|
return () => roRef.current?.disconnect();
|
|
3901
|
-
}, [
|
|
3955
|
+
}, [columnsById]);
|
|
3902
3956
|
return widths;
|
|
3903
3957
|
}
|
|
3904
3958
|
function useDataTableRenderer({
|
|
@@ -3930,33 +3984,33 @@ function useDataTableRenderer({
|
|
|
3930
3984
|
"You cannot use both `pinnedColumns` and `columnGroupingModel` at the same time. Please choose one of them."
|
|
3931
3985
|
);
|
|
3932
3986
|
}
|
|
3933
|
-
const onSelectionModelChangeRef = (0,
|
|
3987
|
+
const onSelectionModelChangeRef = (0, import_react27.useRef)(onSelectionModelChange);
|
|
3934
3988
|
onSelectionModelChangeRef.current = onSelectionModelChange;
|
|
3935
|
-
const [focusedRowId, setFocusedRowId] = (0,
|
|
3936
|
-
const [selectionAnchor, setSelectionAnchor] = (0,
|
|
3989
|
+
const [focusedRowId, setFocusedRowId] = (0, import_react27.useState)(null);
|
|
3990
|
+
const [selectionAnchor, setSelectionAnchor] = (0, import_react27.useState)(null);
|
|
3937
3991
|
const [sortModel, setSortModel] = useControlledState(
|
|
3938
3992
|
controlledSortModel,
|
|
3939
3993
|
initialState?.sorting?.sortModel ?? [],
|
|
3940
|
-
(0,
|
|
3994
|
+
(0, import_react27.useCallback)((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3941
3995
|
);
|
|
3942
3996
|
const [visibilityModel] = useControlledState(
|
|
3943
3997
|
columnVisibilityModel,
|
|
3944
3998
|
initialState?.columns?.columnVisibilityModel ?? {},
|
|
3945
|
-
(0,
|
|
3999
|
+
(0, import_react27.useCallback)(
|
|
3946
4000
|
(model) => onColumnVisibilityModelChange?.(model),
|
|
3947
4001
|
[onColumnVisibilityModelChange]
|
|
3948
4002
|
)
|
|
3949
4003
|
);
|
|
3950
|
-
const reorderedColumns = (0,
|
|
4004
|
+
const reorderedColumns = (0, import_react27.useMemo)(() => {
|
|
3951
4005
|
if (!columnGroupingModel) return columnsProp;
|
|
3952
4006
|
return reorderColumnsByGroupingModel(columnsProp, columnGroupingModel);
|
|
3953
4007
|
}, [columnsProp, columnGroupingModel]);
|
|
3954
|
-
const visibleColumns = (0,
|
|
4008
|
+
const visibleColumns = (0, import_react27.useMemo)(
|
|
3955
4009
|
() => reorderedColumns.filter((col) => visibilityModel[col.field] !== false),
|
|
3956
4010
|
[reorderedColumns, visibilityModel]
|
|
3957
4011
|
);
|
|
3958
|
-
const visibleFieldSet = (0,
|
|
3959
|
-
const tableMinWidth = (0,
|
|
4012
|
+
const visibleFieldSet = (0, import_react27.useMemo)(() => new Set(visibleColumns.map((c) => c.field)), [visibleColumns]);
|
|
4013
|
+
const tableMinWidth = (0, import_react27.useMemo)(() => {
|
|
3960
4014
|
const DEFAULT_MIN = 50;
|
|
3961
4015
|
let total = checkboxSelection ? 40 : 0;
|
|
3962
4016
|
for (const col of visibleColumns) {
|
|
@@ -3964,7 +4018,7 @@ function useDataTableRenderer({
|
|
|
3964
4018
|
}
|
|
3965
4019
|
return total;
|
|
3966
4020
|
}, [visibleColumns, checkboxSelection]);
|
|
3967
|
-
const allColumnsByField = (0,
|
|
4021
|
+
const allColumnsByField = (0, import_react27.useMemo)(
|
|
3968
4022
|
() => reorderedColumns.reduce(
|
|
3969
4023
|
(acc, curr) => ({
|
|
3970
4024
|
...acc,
|
|
@@ -3974,21 +4028,42 @@ function useDataTableRenderer({
|
|
|
3974
4028
|
),
|
|
3975
4029
|
[reorderedColumns]
|
|
3976
4030
|
);
|
|
3977
|
-
const
|
|
3978
|
-
() =>
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
4031
|
+
const columnIdByColumn = (0, import_react27.useMemo)(() => {
|
|
4032
|
+
const taken = new Set(reorderedColumns.map((column) => String(column.field)));
|
|
4033
|
+
const assigned = /* @__PURE__ */ new Set();
|
|
4034
|
+
const ids = /* @__PURE__ */ new Map();
|
|
4035
|
+
reorderedColumns.forEach((column) => {
|
|
4036
|
+
const field = String(column.field);
|
|
4037
|
+
if (!assigned.has(field)) {
|
|
4038
|
+
assigned.add(field);
|
|
4039
|
+
ids.set(column, field);
|
|
4040
|
+
return;
|
|
4041
|
+
}
|
|
4042
|
+
let n = 2;
|
|
4043
|
+
while (taken.has(`${field}__${n}`)) n += 1;
|
|
4044
|
+
taken.add(`${field}__${n}`);
|
|
4045
|
+
ids.set(column, `${field}__${n}`);
|
|
4046
|
+
});
|
|
4047
|
+
return ids;
|
|
4048
|
+
}, [reorderedColumns]);
|
|
4049
|
+
const columnIds = (0, import_react27.useMemo)(
|
|
4050
|
+
() => visibleColumns.map((column) => columnIdByColumn.get(column) ?? String(column.field)),
|
|
4051
|
+
[visibleColumns, columnIdByColumn]
|
|
4052
|
+
);
|
|
4053
|
+
const visibleColumnsById = (0, import_react27.useMemo)(
|
|
4054
|
+
() => Object.fromEntries(
|
|
4055
|
+
visibleColumns.map((column, index) => [
|
|
4056
|
+
columnIds[index],
|
|
4057
|
+
{
|
|
4058
|
+
...column,
|
|
4059
|
+
headerRef: (0, import_react27.createRef)(),
|
|
4060
|
+
tableColRef: (0, import_react27.createRef)()
|
|
3985
4061
|
}
|
|
3986
|
-
|
|
3987
|
-
{}
|
|
4062
|
+
])
|
|
3988
4063
|
),
|
|
3989
|
-
[visibleColumns]
|
|
4064
|
+
[visibleColumns, columnIds]
|
|
3990
4065
|
);
|
|
3991
|
-
const sortComparator = (0,
|
|
4066
|
+
const sortComparator = (0, import_react27.useCallback)(
|
|
3992
4067
|
(rowA, rowB) => {
|
|
3993
4068
|
for (const sort of sortModel) {
|
|
3994
4069
|
const { field, sort: direction } = sort;
|
|
@@ -4017,33 +4092,33 @@ function useDataTableRenderer({
|
|
|
4017
4092
|
},
|
|
4018
4093
|
[sortModel, allColumnsByField]
|
|
4019
4094
|
);
|
|
4020
|
-
const rows = (0,
|
|
4095
|
+
const rows = (0, import_react27.useMemo)(
|
|
4021
4096
|
() => sortModel.length ? [..._rows].sort(sortComparator) : _rows,
|
|
4022
4097
|
[_rows, sortModel, sortComparator]
|
|
4023
4098
|
);
|
|
4024
|
-
const sortOrder = (0,
|
|
4099
|
+
const sortOrder = (0, import_react27.useMemo)(
|
|
4025
4100
|
() => Array.from(new Set(_sortOrder || ["asc", "desc", null])),
|
|
4026
4101
|
[_sortOrder]
|
|
4027
4102
|
);
|
|
4028
|
-
const [page, setPage] = (0,
|
|
4103
|
+
const [page, setPage] = (0, import_react27.useState)(paginationModel?.page || 1);
|
|
4029
4104
|
const pageSize = paginationModel?.pageSize || 20;
|
|
4030
|
-
const getId = (0,
|
|
4105
|
+
const getId = (0, import_react27.useCallback)(
|
|
4031
4106
|
(row, index) => _getId?.(row) ?? row.id ?? `${(index || 0) + (page - 1) * pageSize}`,
|
|
4032
4107
|
[_getId, page, pageSize]
|
|
4033
4108
|
);
|
|
4034
|
-
const selectedModelSet = (0,
|
|
4035
|
-
const dataInPage = (0,
|
|
4109
|
+
const selectedModelSet = (0, import_react27.useMemo)(() => new Set(selectionModel || []), [selectionModel]);
|
|
4110
|
+
const dataInPage = (0, import_react27.useMemo)(
|
|
4036
4111
|
() => !pagination || paginationMode === "server" ? rows : rows.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize),
|
|
4037
4112
|
[rows, page, pageSize, paginationMode, pagination]
|
|
4038
4113
|
);
|
|
4039
|
-
const selectableDataInPage = (0,
|
|
4114
|
+
const selectableDataInPage = (0, import_react27.useMemo)(
|
|
4040
4115
|
() => dataInPage.filter((row, i) => {
|
|
4041
4116
|
if (!isRowSelectable) return true;
|
|
4042
4117
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
4043
4118
|
}),
|
|
4044
4119
|
[dataInPage, isRowSelectable, getId]
|
|
4045
4120
|
);
|
|
4046
|
-
const handleRangeSelection = (0,
|
|
4121
|
+
const handleRangeSelection = (0, import_react27.useCallback)(
|
|
4047
4122
|
(anchor, targetIndex) => {
|
|
4048
4123
|
const startIndex = Math.min(anchor.rowIndex, targetIndex);
|
|
4049
4124
|
const endIndex = Math.max(anchor.rowIndex, targetIndex);
|
|
@@ -4066,51 +4141,60 @@ function useDataTableRenderer({
|
|
|
4066
4141
|
},
|
|
4067
4142
|
[dataInPage, getId, isRowSelectable, selectionModel, onSelectionModelChange]
|
|
4068
4143
|
);
|
|
4069
|
-
const isAllSelected = (0,
|
|
4144
|
+
const isAllSelected = (0, import_react27.useMemo)(
|
|
4070
4145
|
() => selectableDataInPage.length > 0 && selectableDataInPage.every((row, i) => selectedModelSet.has(getId(row, i))),
|
|
4071
4146
|
[selectableDataInPage, selectedModelSet, getId]
|
|
4072
4147
|
);
|
|
4073
4148
|
const rowCount = totalRowsProp || rows.length;
|
|
4074
|
-
const selectableRowCount = (0,
|
|
4149
|
+
const selectableRowCount = (0, import_react27.useMemo)(() => {
|
|
4075
4150
|
if (!isRowSelectable) return rowCount;
|
|
4076
4151
|
return rows.filter((row, i) => isRowSelectable({ row, id: getId(row, i) })).length;
|
|
4077
4152
|
}, [rows, isRowSelectable, getId, rowCount]);
|
|
4078
|
-
const isTotalSelected = (0,
|
|
4153
|
+
const isTotalSelected = (0, import_react27.useMemo)(
|
|
4079
4154
|
() => _isTotalSelected ?? (selectableRowCount > 0 && (selectionModel?.length || 0) === selectableRowCount),
|
|
4080
4155
|
[_isTotalSelected, selectionModel, selectableRowCount]
|
|
4081
4156
|
);
|
|
4082
|
-
const columnWidths = useColumnWidths(
|
|
4083
|
-
const
|
|
4084
|
-
(
|
|
4085
|
-
|
|
4086
|
-
|
|
4157
|
+
const columnWidths = useColumnWidths(visibleColumnsById);
|
|
4158
|
+
const measuredWidthByField = (0, import_react27.useMemo)(
|
|
4159
|
+
() => Object.fromEntries(
|
|
4160
|
+
Object.entries(visibleColumnsById).map(([columnId, column]) => [column.field, columnWidths[columnId]])
|
|
4161
|
+
),
|
|
4162
|
+
[visibleColumnsById, columnWidths]
|
|
4163
|
+
);
|
|
4164
|
+
const getWidth = (0, import_react27.useCallback)(
|
|
4165
|
+
// 반환값은 pinned offset으로 더해지므로 반드시 숫자여야 한다. width/minWidth는 '500px' 같은 문자열.
|
|
4166
|
+
(f) => measuredWidthByField[f] ?? parsePxValue(allColumnsByField[f]?.width) ?? // Column prop 으로 지정된 width
|
|
4167
|
+
parsePxValue(allColumnsByField[f]?.minWidth) ?? 0,
|
|
4168
|
+
[measuredWidthByField, allColumnsByField]
|
|
4087
4169
|
);
|
|
4088
|
-
const processedColumnGroups = (0,
|
|
4170
|
+
const processedColumnGroups = (0, import_react27.useMemo)(() => {
|
|
4089
4171
|
if (!columnGroupingModel) return null;
|
|
4090
4172
|
return calculateColumnGroups(columnGroupingModel, visibleColumns, visibleFieldSet);
|
|
4091
4173
|
}, [columnGroupingModel, visibleColumns, visibleFieldSet]);
|
|
4092
|
-
const effectivePinnedLeft = (0,
|
|
4174
|
+
const effectivePinnedLeft = (0, import_react27.useMemo)(
|
|
4093
4175
|
() => pinnedColumns?.left?.filter((f) => visibleFieldSet.has(f)),
|
|
4094
4176
|
[pinnedColumns?.left, visibleFieldSet]
|
|
4095
4177
|
);
|
|
4096
|
-
const effectivePinnedRight = (0,
|
|
4178
|
+
const effectivePinnedRight = (0, import_react27.useMemo)(
|
|
4097
4179
|
() => pinnedColumns?.right?.filter((f) => visibleFieldSet.has(f)),
|
|
4098
4180
|
[pinnedColumns?.right, visibleFieldSet]
|
|
4099
4181
|
);
|
|
4100
4182
|
const inferredFieldsKey = JSON.stringify(Object.keys(rows[0] || {}));
|
|
4101
|
-
const inferredFields = (0,
|
|
4102
|
-
const columns = (0,
|
|
4183
|
+
const inferredFields = (0, import_react27.useMemo)(() => JSON.parse(inferredFieldsKey), [inferredFieldsKey]);
|
|
4184
|
+
const columns = (0, import_react27.useMemo)(() => {
|
|
4103
4185
|
const baseColumns = visibleColumns.length > 0 ? visibleColumns : reorderedColumns.length > 0 ? [] : inferredFields.map((key) => ({
|
|
4104
4186
|
field: key
|
|
4105
4187
|
}));
|
|
4106
|
-
return baseColumns.map((column) => {
|
|
4188
|
+
return baseColumns.map((column, index) => {
|
|
4189
|
+
const columnId = columnIds[index] ?? String(column.field);
|
|
4107
4190
|
const isLeftPinned = effectivePinnedLeft?.includes(column.field);
|
|
4108
4191
|
const isRightPinned = effectivePinnedRight?.includes(column.field);
|
|
4109
4192
|
const isPinned = isLeftPinned || isRightPinned;
|
|
4110
4193
|
return {
|
|
4111
4194
|
...column,
|
|
4112
|
-
|
|
4113
|
-
|
|
4195
|
+
columnId,
|
|
4196
|
+
headerRef: visibleColumnsById[columnId]?.headerRef,
|
|
4197
|
+
tableColRef: visibleColumnsById[columnId]?.tableColRef,
|
|
4114
4198
|
isCellEditable: editMode && (typeof column.isCellEditable === "function" ? column.isCellEditable : column.isCellEditable ?? true),
|
|
4115
4199
|
sort: sortModel.find((sort) => sort.field === column.field)?.sort,
|
|
4116
4200
|
sortOrder: allColumnsByField[column.field]?.sortOrder || sortOrder,
|
|
@@ -4127,21 +4211,22 @@ function useDataTableRenderer({
|
|
|
4127
4211
|
inferredFields,
|
|
4128
4212
|
effectivePinnedLeft,
|
|
4129
4213
|
effectivePinnedRight,
|
|
4130
|
-
|
|
4214
|
+
columnIds,
|
|
4215
|
+
visibleColumnsById,
|
|
4131
4216
|
allColumnsByField,
|
|
4132
4217
|
editMode,
|
|
4133
4218
|
sortModel,
|
|
4134
4219
|
sortOrder,
|
|
4135
4220
|
getWidth
|
|
4136
4221
|
]);
|
|
4137
|
-
const handlePageChange = (0,
|
|
4222
|
+
const handlePageChange = (0, import_react27.useCallback)(
|
|
4138
4223
|
(newPage) => {
|
|
4139
4224
|
setPage(newPage);
|
|
4140
4225
|
onPaginationModelChange?.({ page: newPage, pageSize });
|
|
4141
4226
|
},
|
|
4142
4227
|
[onPaginationModelChange, pageSize]
|
|
4143
4228
|
);
|
|
4144
|
-
const handleSortChange = (0,
|
|
4229
|
+
const handleSortChange = (0, import_react27.useCallback)(
|
|
4145
4230
|
(props) => {
|
|
4146
4231
|
const { field, currentSort, multiple } = props;
|
|
4147
4232
|
const column = allColumnsByField[field];
|
|
@@ -4164,38 +4249,37 @@ function useDataTableRenderer({
|
|
|
4164
4249
|
},
|
|
4165
4250
|
[sortOrder, allColumnsByField, sortModel, setSortModel]
|
|
4166
4251
|
);
|
|
4167
|
-
(0,
|
|
4252
|
+
(0, import_react27.useEffect)(() => {
|
|
4168
4253
|
if (!paginationModel) {
|
|
4169
4254
|
handlePageChange(1);
|
|
4170
4255
|
}
|
|
4171
4256
|
}, [rowCount, handlePageChange, paginationModel]);
|
|
4172
|
-
(0,
|
|
4257
|
+
(0, import_react27.useEffect)(() => {
|
|
4173
4258
|
const lastPage = Math.max(1, Math.ceil(rowCount / pageSize));
|
|
4174
4259
|
if (page > lastPage) {
|
|
4175
4260
|
handlePageChange(lastPage);
|
|
4176
4261
|
}
|
|
4177
4262
|
}, [page, rowCount, pageSize, handlePageChange]);
|
|
4178
|
-
(0,
|
|
4263
|
+
(0, import_react27.useEffect)(() => {
|
|
4179
4264
|
onSelectionModelChangeRef.current?.([]);
|
|
4180
4265
|
setSelectionAnchor(null);
|
|
4181
4266
|
}, [page]);
|
|
4182
|
-
const prevRowsRef = (0,
|
|
4183
|
-
(0,
|
|
4267
|
+
const prevRowsRef = (0, import_react27.useRef)(_rows);
|
|
4268
|
+
(0, import_react27.useEffect)(() => {
|
|
4184
4269
|
if (prevRowsRef.current !== _rows) {
|
|
4185
4270
|
setSelectionAnchor(null);
|
|
4186
4271
|
prevRowsRef.current = _rows;
|
|
4187
4272
|
}
|
|
4188
4273
|
}, [_rows]);
|
|
4189
|
-
const handleAutoFit = (0,
|
|
4190
|
-
(
|
|
4191
|
-
const colDef =
|
|
4274
|
+
const handleAutoFit = (0, import_react27.useCallback)(
|
|
4275
|
+
(columnId) => {
|
|
4276
|
+
const colDef = visibleColumnsById[columnId];
|
|
4192
4277
|
if (!colDef?.headerRef.current) return;
|
|
4193
|
-
const
|
|
4194
|
-
const columnType = column && "type" in column ? column.type : void 0;
|
|
4278
|
+
const columnType = "type" in colDef ? colDef.type : void 0;
|
|
4195
4279
|
if (columnType === "actions") return;
|
|
4196
4280
|
const optimalWidth = computeAutoFitWidth({
|
|
4197
4281
|
headerEl: colDef.headerRef.current,
|
|
4198
|
-
field,
|
|
4282
|
+
field: colDef.field,
|
|
4199
4283
|
dataInPage
|
|
4200
4284
|
});
|
|
4201
4285
|
if (optimalWidth == null) return;
|
|
@@ -4203,7 +4287,7 @@ function useDataTableRenderer({
|
|
|
4203
4287
|
colDef.headerRef.current.style.width = widthPx;
|
|
4204
4288
|
if (colDef.tableColRef.current) colDef.tableColRef.current.style.width = widthPx;
|
|
4205
4289
|
},
|
|
4206
|
-
[
|
|
4290
|
+
[visibleColumnsById, dataInPage]
|
|
4207
4291
|
);
|
|
4208
4292
|
return {
|
|
4209
4293
|
rowCount,
|
|
@@ -4219,8 +4303,8 @@ function useDataTableRenderer({
|
|
|
4219
4303
|
handleAutoFit,
|
|
4220
4304
|
isAllSelected,
|
|
4221
4305
|
isTotalSelected,
|
|
4222
|
-
isSelectedRow: (0,
|
|
4223
|
-
isRowSelectable: (0,
|
|
4306
|
+
isSelectedRow: (0, import_react27.useCallback)((model) => selectedModelSet.has(model), [selectedModelSet]),
|
|
4307
|
+
isRowSelectable: (0, import_react27.useCallback)(
|
|
4224
4308
|
(rowId, row) => {
|
|
4225
4309
|
if (!isRowSelectable) return true;
|
|
4226
4310
|
return isRowSelectable({ row, id: rowId });
|
|
@@ -4228,13 +4312,13 @@ function useDataTableRenderer({
|
|
|
4228
4312
|
[isRowSelectable]
|
|
4229
4313
|
),
|
|
4230
4314
|
focusedRowId,
|
|
4231
|
-
onRowFocus: (0,
|
|
4315
|
+
onRowFocus: (0, import_react27.useCallback)((rowId) => {
|
|
4232
4316
|
setFocusedRowId(rowId);
|
|
4233
4317
|
}, []),
|
|
4234
|
-
onAllCheckboxChange: (0,
|
|
4318
|
+
onAllCheckboxChange: (0, import_react27.useCallback)(() => {
|
|
4235
4319
|
onSelectionModelChange?.(isAllSelected ? [] : selectableDataInPage.map(getId));
|
|
4236
4320
|
}, [isAllSelected, selectableDataInPage, onSelectionModelChange, getId]),
|
|
4237
|
-
onCheckboxChange: (0,
|
|
4321
|
+
onCheckboxChange: (0, import_react27.useCallback)(
|
|
4238
4322
|
(event, selectedModel) => {
|
|
4239
4323
|
const isShiftClick = "shiftKey" in event && event.shiftKey;
|
|
4240
4324
|
const rowIndex = dataInPage.findIndex((row, i) => getId(row, i) === selectedModel);
|
|
@@ -4268,7 +4352,7 @@ function useDataTableRenderer({
|
|
|
4268
4352
|
columns,
|
|
4269
4353
|
tableMinWidth,
|
|
4270
4354
|
processedColumnGroups,
|
|
4271
|
-
onTotalSelect: (0,
|
|
4355
|
+
onTotalSelect: (0, import_react27.useCallback)(() => {
|
|
4272
4356
|
const selectableRows = rows.filter((row, i) => {
|
|
4273
4357
|
if (!isRowSelectable) return true;
|
|
4274
4358
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
@@ -4282,11 +4366,11 @@ function useDataTableRenderer({
|
|
|
4282
4366
|
}
|
|
4283
4367
|
|
|
4284
4368
|
// src/components/Table/Table.tsx
|
|
4285
|
-
var
|
|
4369
|
+
var import_react28 = __toESM(require("react"));
|
|
4286
4370
|
var import_joy35 = require("@mui/joy");
|
|
4287
4371
|
var Table = (props) => {
|
|
4288
4372
|
const { children, ...inheritProps } = props;
|
|
4289
|
-
return /* @__PURE__ */
|
|
4373
|
+
return /* @__PURE__ */ import_react28.default.createElement(import_joy35.Table, { ...inheritProps }, children);
|
|
4290
4374
|
};
|
|
4291
4375
|
Table.displayName = "Table";
|
|
4292
4376
|
function TableHead(props) {
|
|
@@ -4297,7 +4381,7 @@ function TableHead(props) {
|
|
|
4297
4381
|
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
4298
4382
|
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
4299
4383
|
} = props;
|
|
4300
|
-
return /* @__PURE__ */
|
|
4384
|
+
return /* @__PURE__ */ import_react28.default.createElement("thead", null, /* @__PURE__ */ import_react28.default.createElement("tr", null, showCheckbox && /* @__PURE__ */ import_react28.default.createElement(
|
|
4301
4385
|
"th",
|
|
4302
4386
|
{
|
|
4303
4387
|
style: {
|
|
@@ -4305,8 +4389,8 @@ function TableHead(props) {
|
|
|
4305
4389
|
textAlign: "center"
|
|
4306
4390
|
}
|
|
4307
4391
|
},
|
|
4308
|
-
/* @__PURE__ */
|
|
4309
|
-
), headCells.map((headCell) => /* @__PURE__ */
|
|
4392
|
+
/* @__PURE__ */ import_react28.default.createElement(RenderCheckbox, { onChange: onCheckboxChange, ...checkboxProps })
|
|
4393
|
+
), headCells.map((headCell) => /* @__PURE__ */ import_react28.default.createElement(
|
|
4310
4394
|
"th",
|
|
4311
4395
|
{
|
|
4312
4396
|
key: headCell.label,
|
|
@@ -4331,15 +4415,15 @@ function TableBody(props) {
|
|
|
4331
4415
|
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
4332
4416
|
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
4333
4417
|
} = props;
|
|
4334
|
-
return /* @__PURE__ */
|
|
4418
|
+
return /* @__PURE__ */ import_react28.default.createElement("tbody", null, rows.map((row, rowIndex) => /* @__PURE__ */ import_react28.default.createElement("tr", { key: `table-row-${rowIndex}` }, showCheckbox && /* @__PURE__ */ import_react28.default.createElement(
|
|
4335
4419
|
"td",
|
|
4336
4420
|
{
|
|
4337
4421
|
style: {
|
|
4338
4422
|
textAlign: "center"
|
|
4339
4423
|
}
|
|
4340
4424
|
},
|
|
4341
|
-
/* @__PURE__ */
|
|
4342
|
-
), cellOrder.map((cellKey) => /* @__PURE__ */
|
|
4425
|
+
/* @__PURE__ */ import_react28.default.createElement(RenderCheckbox, { onChange: (event) => onCheckboxChange?.(event, rowIndex), ...checkboxProps })
|
|
4426
|
+
), cellOrder.map((cellKey) => /* @__PURE__ */ import_react28.default.createElement(
|
|
4343
4427
|
"td",
|
|
4344
4428
|
{
|
|
4345
4429
|
key: cellKey,
|
|
@@ -4353,7 +4437,7 @@ function TableBody(props) {
|
|
|
4353
4437
|
TableBody.displayName = "TableBody";
|
|
4354
4438
|
|
|
4355
4439
|
// src/components/Pagination/Pagination.tsx
|
|
4356
|
-
var
|
|
4440
|
+
var import_react29 = __toESM(require("react"));
|
|
4357
4441
|
var import_ChevronLeftRounded = __toESM(require("@mui/icons-material/ChevronLeftRounded"));
|
|
4358
4442
|
var import_ChevronRightRounded = __toESM(require("@mui/icons-material/ChevronRightRounded"));
|
|
4359
4443
|
var import_FirstPageRounded = __toESM(require("@mui/icons-material/FirstPageRounded"));
|
|
@@ -4423,7 +4507,7 @@ function Pagination(inProps) {
|
|
|
4423
4507
|
const [paginationModel, setPaginationModel] = useControlledState(
|
|
4424
4508
|
_paginationModel,
|
|
4425
4509
|
defaultPaginationModel,
|
|
4426
|
-
(0,
|
|
4510
|
+
(0, import_react29.useCallback)(
|
|
4427
4511
|
(newPage) => {
|
|
4428
4512
|
onPageChange(newPage.page);
|
|
4429
4513
|
},
|
|
@@ -4439,7 +4523,7 @@ function Pagination(inProps) {
|
|
|
4439
4523
|
const afterPages = [paginationModel.page + 1, paginationModel.page + 2].filter((p) => p <= lastPage - 1);
|
|
4440
4524
|
const isMoreAfterPages = lastPage > 1 && paginationModel.page < lastPage - 3;
|
|
4441
4525
|
const isMoreBeforePages = lastPage > 1 && paginationModel.page > 4;
|
|
4442
|
-
(0,
|
|
4526
|
+
(0, import_react29.useEffect)(() => {
|
|
4443
4527
|
if (paginationModel.page > lastPage) {
|
|
4444
4528
|
setPaginationModel({ ...paginationModel, page: lastPage });
|
|
4445
4529
|
}
|
|
@@ -4449,7 +4533,7 @@ function Pagination(inProps) {
|
|
|
4449
4533
|
value: `${i + 1}`
|
|
4450
4534
|
}));
|
|
4451
4535
|
if (variant === "compact") {
|
|
4452
|
-
return /* @__PURE__ */
|
|
4536
|
+
return /* @__PURE__ */ import_react29.default.createElement(PaginationRoot, { ...innerProps }, /* @__PURE__ */ import_react29.default.createElement(PaginationContainer, { direction: "row", size, alignItems: "center" }, /* @__PURE__ */ import_react29.default.createElement(Stack_default, { direction: "row" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
4453
4537
|
PaginationIconButton,
|
|
4454
4538
|
{
|
|
4455
4539
|
size,
|
|
@@ -4459,8 +4543,8 @@ function Pagination(inProps) {
|
|
|
4459
4543
|
disabled: paginationModel.page === firstPage,
|
|
4460
4544
|
"aria-label": "First page"
|
|
4461
4545
|
},
|
|
4462
|
-
/* @__PURE__ */
|
|
4463
|
-
), /* @__PURE__ */
|
|
4546
|
+
/* @__PURE__ */ import_react29.default.createElement(import_FirstPageRounded.default, null)
|
|
4547
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
4464
4548
|
PaginationIconButton,
|
|
4465
4549
|
{
|
|
4466
4550
|
size,
|
|
@@ -4470,8 +4554,8 @@ function Pagination(inProps) {
|
|
|
4470
4554
|
disabled: paginationModel.page === firstPage,
|
|
4471
4555
|
"aria-label": "Previous page"
|
|
4472
4556
|
},
|
|
4473
|
-
/* @__PURE__ */
|
|
4474
|
-
)), /* @__PURE__ */
|
|
4557
|
+
/* @__PURE__ */ import_react29.default.createElement(import_ChevronLeftRounded.default, null)
|
|
4558
|
+
)), /* @__PURE__ */ import_react29.default.createElement(
|
|
4475
4559
|
Autocomplete_default,
|
|
4476
4560
|
{
|
|
4477
4561
|
size,
|
|
@@ -4490,7 +4574,7 @@ function Pagination(inProps) {
|
|
|
4490
4574
|
}[size]
|
|
4491
4575
|
}
|
|
4492
4576
|
}
|
|
4493
|
-
), /* @__PURE__ */
|
|
4577
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
4494
4578
|
Typography_default,
|
|
4495
4579
|
{
|
|
4496
4580
|
level: `body-${size}`,
|
|
@@ -4501,7 +4585,7 @@ function Pagination(inProps) {
|
|
|
4501
4585
|
},
|
|
4502
4586
|
"/ ",
|
|
4503
4587
|
lastPage
|
|
4504
|
-
), /* @__PURE__ */
|
|
4588
|
+
), /* @__PURE__ */ import_react29.default.createElement(Stack_default, { direction: "row" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
4505
4589
|
PaginationIconButton,
|
|
4506
4590
|
{
|
|
4507
4591
|
size,
|
|
@@ -4511,8 +4595,8 @@ function Pagination(inProps) {
|
|
|
4511
4595
|
disabled: paginationModel.page === lastPage,
|
|
4512
4596
|
"aria-label": "Next page"
|
|
4513
4597
|
},
|
|
4514
|
-
/* @__PURE__ */
|
|
4515
|
-
), /* @__PURE__ */
|
|
4598
|
+
/* @__PURE__ */ import_react29.default.createElement(import_ChevronRightRounded.default, null)
|
|
4599
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
4516
4600
|
PaginationIconButton,
|
|
4517
4601
|
{
|
|
4518
4602
|
size,
|
|
@@ -4522,10 +4606,10 @@ function Pagination(inProps) {
|
|
|
4522
4606
|
disabled: paginationModel.page === lastPage,
|
|
4523
4607
|
"aria-label": "Last page"
|
|
4524
4608
|
},
|
|
4525
|
-
/* @__PURE__ */
|
|
4609
|
+
/* @__PURE__ */ import_react29.default.createElement(import_LastPageRounded.default, null)
|
|
4526
4610
|
))));
|
|
4527
4611
|
}
|
|
4528
|
-
return /* @__PURE__ */
|
|
4612
|
+
return /* @__PURE__ */ import_react29.default.createElement(PaginationRoot, { ...innerProps }, /* @__PURE__ */ import_react29.default.createElement(PaginationContainer, { direction: "row", size, alignItems: "center" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
4529
4613
|
PaginationIconButton,
|
|
4530
4614
|
{
|
|
4531
4615
|
size,
|
|
@@ -4535,8 +4619,8 @@ function Pagination(inProps) {
|
|
|
4535
4619
|
disabled: paginationModel.page === firstPage,
|
|
4536
4620
|
"aria-label": "Previous page"
|
|
4537
4621
|
},
|
|
4538
|
-
/* @__PURE__ */
|
|
4539
|
-
), paginationModel.page !== firstPage && /* @__PURE__ */
|
|
4622
|
+
/* @__PURE__ */ import_react29.default.createElement(import_ChevronLeftRounded.default, null)
|
|
4623
|
+
), paginationModel.page !== firstPage && /* @__PURE__ */ import_react29.default.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(firstPage) }, firstPage), isMoreBeforePages && /* @__PURE__ */ import_react29.default.createElement(
|
|
4540
4624
|
PaginationButton,
|
|
4541
4625
|
{
|
|
4542
4626
|
size,
|
|
@@ -4546,7 +4630,7 @@ function Pagination(inProps) {
|
|
|
4546
4630
|
"aria-label": "More previous pages"
|
|
4547
4631
|
},
|
|
4548
4632
|
"..."
|
|
4549
|
-
), beforePages.map((p) => /* @__PURE__ */
|
|
4633
|
+
), beforePages.map((p) => /* @__PURE__ */ import_react29.default.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), /* @__PURE__ */ import_react29.default.createElement(PaginationButton, { active: "active", size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ import_react29.default.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), isMoreAfterPages && /* @__PURE__ */ import_react29.default.createElement(
|
|
4550
4634
|
PaginationButton,
|
|
4551
4635
|
{
|
|
4552
4636
|
size,
|
|
@@ -4556,7 +4640,7 @@ function Pagination(inProps) {
|
|
|
4556
4640
|
onClick: () => handlePageChange(paginationModel.page + 3)
|
|
4557
4641
|
},
|
|
4558
4642
|
"..."
|
|
4559
|
-
), paginationModel.page !== lastPage && /* @__PURE__ */
|
|
4643
|
+
), paginationModel.page !== lastPage && /* @__PURE__ */ import_react29.default.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(lastPage) }, lastPage), /* @__PURE__ */ import_react29.default.createElement(
|
|
4560
4644
|
PaginationIconButton,
|
|
4561
4645
|
{
|
|
4562
4646
|
size,
|
|
@@ -4566,7 +4650,7 @@ function Pagination(inProps) {
|
|
|
4566
4650
|
disabled: paginationModel.page === lastPage,
|
|
4567
4651
|
"aria-label": "Next page"
|
|
4568
4652
|
},
|
|
4569
|
-
/* @__PURE__ */
|
|
4653
|
+
/* @__PURE__ */ import_react29.default.createElement(import_ChevronRightRounded.default, null)
|
|
4570
4654
|
)));
|
|
4571
4655
|
}
|
|
4572
4656
|
Pagination.displayName = "Pagination";
|
|
@@ -4640,9 +4724,9 @@ function Component(props, apiRef) {
|
|
|
4640
4724
|
isTotalSelected: ___________,
|
|
4641
4725
|
...innerProps
|
|
4642
4726
|
} = props;
|
|
4643
|
-
const tableId = (0,
|
|
4644
|
-
const parentRef = (0,
|
|
4645
|
-
const tableBodyRef = (0,
|
|
4727
|
+
const tableId = (0, import_react30.useId)();
|
|
4728
|
+
const parentRef = (0, import_react30.useRef)(null);
|
|
4729
|
+
const tableBodyRef = (0, import_react30.useRef)(null);
|
|
4646
4730
|
const {
|
|
4647
4731
|
columns,
|
|
4648
4732
|
processedColumnGroups,
|
|
@@ -4678,10 +4762,10 @@ function Component(props, apiRef) {
|
|
|
4678
4762
|
measureElement: (element) => element.clientHeight,
|
|
4679
4763
|
overscan: 10
|
|
4680
4764
|
});
|
|
4681
|
-
const paginationModel = (0,
|
|
4765
|
+
const paginationModel = (0, import_react30.useMemo)(() => ({ page, pageSize }), [page, pageSize]);
|
|
4682
4766
|
const columnsKey = getObjectVersion(columns);
|
|
4683
|
-
const headerCheckboxElement = (0,
|
|
4684
|
-
() => /* @__PURE__ */
|
|
4767
|
+
const headerCheckboxElement = (0, import_react30.useMemo)(
|
|
4768
|
+
() => /* @__PURE__ */ import_react30.default.createElement(
|
|
4685
4769
|
RenderCheckbox,
|
|
4686
4770
|
{
|
|
4687
4771
|
onChange: onAllCheckboxChange,
|
|
@@ -4706,20 +4790,20 @@ function Component(props, apiRef) {
|
|
|
4706
4790
|
const showNoRowsOverlay = !loading && rowCount === 0;
|
|
4707
4791
|
const showFillerColumn = columns.length > 0 && columns.every((c) => !!c.width);
|
|
4708
4792
|
const totalColCount = Math.max(1, columns.length + (checkboxSelection ? 1 : 0) + (showFillerColumn ? 1 : 0));
|
|
4709
|
-
const getRowClickHandler = (0,
|
|
4793
|
+
const getRowClickHandler = (0, import_react30.useCallback)(
|
|
4710
4794
|
(row, rowId) => (e) => {
|
|
4711
4795
|
onRowClick?.({ row, rowId }, e);
|
|
4712
4796
|
checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
|
|
4713
4797
|
},
|
|
4714
4798
|
[onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
|
|
4715
4799
|
);
|
|
4716
|
-
const getRowFocusHandler = (0,
|
|
4800
|
+
const getRowFocusHandler = (0, import_react30.useCallback)(
|
|
4717
4801
|
(rowId) => () => {
|
|
4718
4802
|
onRowFocus(rowId);
|
|
4719
4803
|
},
|
|
4720
4804
|
[onRowFocus]
|
|
4721
4805
|
);
|
|
4722
|
-
const getCheckboxClickHandler = (0,
|
|
4806
|
+
const getCheckboxClickHandler = (0, import_react30.useCallback)(
|
|
4723
4807
|
(rowId, row) => (e) => {
|
|
4724
4808
|
e.stopPropagation();
|
|
4725
4809
|
if (isRowSelectableCheck(rowId, row)) {
|
|
@@ -4729,7 +4813,7 @@ function Component(props, apiRef) {
|
|
|
4729
4813
|
},
|
|
4730
4814
|
[onCheckboxChange, isRowSelectableCheck, onRowFocus]
|
|
4731
4815
|
);
|
|
4732
|
-
const handleTableKeyDown = (0,
|
|
4816
|
+
const handleTableKeyDown = (0, import_react30.useCallback)(
|
|
4733
4817
|
(e) => {
|
|
4734
4818
|
const supportedKeys = ["ArrowUp", "ArrowDown", " ", "Home", "End", "PageUp", "PageDown"];
|
|
4735
4819
|
if (!supportedKeys.includes(e.key)) return;
|
|
@@ -4819,7 +4903,7 @@ function Component(props, apiRef) {
|
|
|
4819
4903
|
virtualizer
|
|
4820
4904
|
]
|
|
4821
4905
|
);
|
|
4822
|
-
(0,
|
|
4906
|
+
(0, import_react30.useImperativeHandle)(apiRef, () => ({
|
|
4823
4907
|
getRowIndexRelativeToVisibleRows(rowId) {
|
|
4824
4908
|
return dataInPage.findIndex((row) => String(getId(row)) === rowId);
|
|
4825
4909
|
},
|
|
@@ -4835,7 +4919,7 @@ function Component(props, apiRef) {
|
|
|
4835
4919
|
});
|
|
4836
4920
|
}
|
|
4837
4921
|
}));
|
|
4838
|
-
return /* @__PURE__ */
|
|
4922
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
4839
4923
|
Box_default,
|
|
4840
4924
|
{
|
|
4841
4925
|
sx: {
|
|
@@ -4845,7 +4929,7 @@ function Component(props, apiRef) {
|
|
|
4845
4929
|
flexDirection: "column"
|
|
4846
4930
|
}
|
|
4847
4931
|
},
|
|
4848
|
-
(!!checkboxSelection || !!Toolbar) && /* @__PURE__ */
|
|
4932
|
+
(!!checkboxSelection || !!Toolbar) && /* @__PURE__ */ import_react30.default.createElement(
|
|
4849
4933
|
Stack_default,
|
|
4850
4934
|
{
|
|
4851
4935
|
direction: "row",
|
|
@@ -4855,10 +4939,10 @@ function Component(props, apiRef) {
|
|
|
4855
4939
|
justifyContent: "space-between",
|
|
4856
4940
|
alignItems: "center"
|
|
4857
4941
|
},
|
|
4858
|
-
!!checkboxSelection && /* @__PURE__ */
|
|
4859
|
-
Toolbar && /* @__PURE__ */
|
|
4942
|
+
!!checkboxSelection && /* @__PURE__ */ import_react30.default.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ import_react30.default.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ import_react30.default.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ import_react30.default.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ import_react30.default.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(selectableRowCount), " items")), isTotalSelected && /* @__PURE__ */ import_react30.default.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ import_react30.default.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectableRowCount), " items are selected."), /* @__PURE__ */ import_react30.default.createElement(Button_default, { size: "sm", variant: "plain", color: "danger", onClick: onTotalSelect }, "Cancel"))),
|
|
4943
|
+
Toolbar && /* @__PURE__ */ import_react30.default.createElement(Toolbar, { ...toolbarProps || {} })
|
|
4860
4944
|
),
|
|
4861
|
-
/* @__PURE__ */
|
|
4945
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
4862
4946
|
Sheet_default,
|
|
4863
4947
|
{
|
|
4864
4948
|
variant: "outlined",
|
|
@@ -4879,24 +4963,24 @@ function Component(props, apiRef) {
|
|
|
4879
4963
|
ref: parentRef,
|
|
4880
4964
|
...backgroundProps
|
|
4881
4965
|
},
|
|
4882
|
-
/* @__PURE__ */
|
|
4966
|
+
/* @__PURE__ */ import_react30.default.createElement(Table, { ...innerProps, sx: { ...innerProps.sx, minWidth: tableMinWidth } }, /* @__PURE__ */ import_react30.default.createElement("colgroup", null, checkboxSelection && /* @__PURE__ */ import_react30.default.createElement(
|
|
4883
4967
|
"col",
|
|
4884
4968
|
{
|
|
4885
4969
|
style: {
|
|
4886
4970
|
width: "40px"
|
|
4887
4971
|
}
|
|
4888
4972
|
}
|
|
4889
|
-
), columns.map((c) => /* @__PURE__ */
|
|
4973
|
+
), columns.map((c) => /* @__PURE__ */ import_react30.default.createElement(
|
|
4890
4974
|
"col",
|
|
4891
4975
|
{
|
|
4892
4976
|
ref: c.tableColRef,
|
|
4893
|
-
key:
|
|
4977
|
+
key: c.columnId,
|
|
4894
4978
|
style: {
|
|
4895
4979
|
width: c.width,
|
|
4896
4980
|
minWidth: c.minWidth ?? "50px"
|
|
4897
4981
|
}
|
|
4898
4982
|
}
|
|
4899
|
-
)), showFillerColumn && /* @__PURE__ */
|
|
4983
|
+
)), showFillerColumn && /* @__PURE__ */ import_react30.default.createElement("col", { style: { minWidth: 0 } })), /* @__PURE__ */ import_react30.default.createElement("thead", null, processedColumnGroups && processedColumnGroups.groups.length > 0 && processedColumnGroups.groups.map((levelGroups, level) => /* @__PURE__ */ import_react30.default.createElement("tr", { key: `group-level-${level}` }, checkboxSelection && level === 0 && /* @__PURE__ */ import_react30.default.createElement(
|
|
4900
4984
|
"th",
|
|
4901
4985
|
{
|
|
4902
4986
|
rowSpan: processedColumnGroups.maxLevel + 2,
|
|
@@ -4907,12 +4991,12 @@ function Component(props, apiRef) {
|
|
|
4907
4991
|
}
|
|
4908
4992
|
},
|
|
4909
4993
|
headerCheckboxElement
|
|
4910
|
-
), level > 0 && Array.from({ length: levelGroups[0]?.startIndex || 0 }).map((_2, i) => /* @__PURE__ */
|
|
4994
|
+
), level > 0 && Array.from({ length: levelGroups[0]?.startIndex || 0 }).map((_2, i) => /* @__PURE__ */ import_react30.default.createElement("th", { key: `empty-${level}-${i}` })), levelGroups.filter((g) => g.colspan > 0).map((group, groupIndex) => {
|
|
4911
4995
|
const nextGroup = levelGroups[groupIndex + 1];
|
|
4912
4996
|
const emptyCells = nextGroup ? nextGroup.startIndex - (group.startIndex + group.colspan) : columns.length - (group.startIndex + group.colspan);
|
|
4913
4997
|
const params = { groupId: group.groupId };
|
|
4914
4998
|
const computedHeaderClassName = group.headerClassName ? typeof group.headerClassName === "function" ? group.headerClassName(params) : group.headerClassName : void 0;
|
|
4915
|
-
return /* @__PURE__ */
|
|
4999
|
+
return /* @__PURE__ */ import_react30.default.createElement(import_react30.Fragment, { key: group.groupId }, /* @__PURE__ */ import_react30.default.createElement(
|
|
4916
5000
|
"th",
|
|
4917
5001
|
{
|
|
4918
5002
|
colSpan: group.colspan,
|
|
@@ -4924,14 +5008,14 @@ function Component(props, apiRef) {
|
|
|
4924
5008
|
className: computedHeaderClassName
|
|
4925
5009
|
},
|
|
4926
5010
|
group.headerName ?? group.groupId
|
|
4927
|
-
), emptyCells > 0 && Array.from({ length: emptyCells }).map((_2, i) => /* @__PURE__ */
|
|
4928
|
-
}), showFillerColumn && level === 0 && /* @__PURE__ */
|
|
5011
|
+
), emptyCells > 0 && Array.from({ length: emptyCells }).map((_2, i) => /* @__PURE__ */ import_react30.default.createElement("th", { key: `empty-between-${level}-${groupIndex}-${i}`, colSpan: 1 })));
|
|
5012
|
+
}), showFillerColumn && level === 0 && /* @__PURE__ */ import_react30.default.createElement(
|
|
4929
5013
|
"th",
|
|
4930
5014
|
{
|
|
4931
5015
|
"aria-hidden": "true",
|
|
4932
5016
|
rowSpan: processedColumnGroups.maxLevel + 2
|
|
4933
5017
|
}
|
|
4934
|
-
))), /* @__PURE__ */
|
|
5018
|
+
))), /* @__PURE__ */ import_react30.default.createElement("tr", null, (!processedColumnGroups || processedColumnGroups.groups.length === 0) && checkboxSelection && /* @__PURE__ */ import_react30.default.createElement(
|
|
4935
5019
|
"th",
|
|
4936
5020
|
{
|
|
4937
5021
|
style: {
|
|
@@ -4942,7 +5026,7 @@ function Component(props, apiRef) {
|
|
|
4942
5026
|
headerCheckboxElement
|
|
4943
5027
|
), columns.map((c, i) => (
|
|
4944
5028
|
// @ts-ignore
|
|
4945
|
-
/* @__PURE__ */
|
|
5029
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
4946
5030
|
HeadCell2,
|
|
4947
5031
|
{
|
|
4948
5032
|
tableId,
|
|
@@ -4954,7 +5038,7 @@ function Component(props, apiRef) {
|
|
|
4954
5038
|
...c
|
|
4955
5039
|
}
|
|
4956
5040
|
)
|
|
4957
|
-
)), showFillerColumn && (!processedColumnGroups || processedColumnGroups.groups.length === 0) && /* @__PURE__ */
|
|
5041
|
+
)), showFillerColumn && (!processedColumnGroups || processedColumnGroups.groups.length === 0) && /* @__PURE__ */ import_react30.default.createElement("th", { "aria-hidden": "true" }))), /* @__PURE__ */ import_react30.default.createElement(
|
|
4958
5042
|
VirtualizedTableBody,
|
|
4959
5043
|
{
|
|
4960
5044
|
ref: tableBodyRef,
|
|
@@ -4965,7 +5049,7 @@ function Component(props, apiRef) {
|
|
|
4965
5049
|
role: "rowgroup",
|
|
4966
5050
|
"aria-label": "DataTableBody"
|
|
4967
5051
|
},
|
|
4968
|
-
!!loading && /* @__PURE__ */
|
|
5052
|
+
!!loading && /* @__PURE__ */ import_react30.default.createElement(OverlayWrapper, null, /* @__PURE__ */ import_react30.default.createElement(
|
|
4969
5053
|
"td",
|
|
4970
5054
|
{
|
|
4971
5055
|
style: {
|
|
@@ -4974,7 +5058,7 @@ function Component(props, apiRef) {
|
|
|
4974
5058
|
overflow: "visible"
|
|
4975
5059
|
}
|
|
4976
5060
|
},
|
|
4977
|
-
/* @__PURE__ */
|
|
5061
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
4978
5062
|
Box_default,
|
|
4979
5063
|
{
|
|
4980
5064
|
sx: {
|
|
@@ -4984,10 +5068,10 @@ function Component(props, apiRef) {
|
|
|
4984
5068
|
right: 0
|
|
4985
5069
|
}
|
|
4986
5070
|
},
|
|
4987
|
-
/* @__PURE__ */
|
|
5071
|
+
/* @__PURE__ */ import_react30.default.createElement(LoadingOverlay, null)
|
|
4988
5072
|
)
|
|
4989
5073
|
)),
|
|
4990
|
-
showNoRowsOverlay && /* @__PURE__ */
|
|
5074
|
+
showNoRowsOverlay && /* @__PURE__ */ import_react30.default.createElement("tr", null, /* @__PURE__ */ import_react30.default.createElement("td", { colSpan: totalColCount, style: { border: "none" } }, /* @__PURE__ */ import_react30.default.createElement(
|
|
4991
5075
|
Box_default,
|
|
4992
5076
|
{
|
|
4993
5077
|
sx: {
|
|
@@ -4997,14 +5081,14 @@ function Component(props, apiRef) {
|
|
|
4997
5081
|
minHeight: "150px"
|
|
4998
5082
|
}
|
|
4999
5083
|
},
|
|
5000
|
-
/* @__PURE__ */
|
|
5084
|
+
/* @__PURE__ */ import_react30.default.createElement(NoRowsOverlay, { ...noRowsOverlayProps })
|
|
5001
5085
|
))),
|
|
5002
5086
|
virtualizedItems.map((virtualizedRow, index) => {
|
|
5003
5087
|
const rowIndex = virtualizedRow.index;
|
|
5004
5088
|
const row = dataInPage[rowIndex];
|
|
5005
5089
|
const rowId = getId(row, rowIndex);
|
|
5006
5090
|
const striped = stripe && (stripe === "even" && (rowIndex + 1) % 2 === 0 || stripe === "odd" && (rowIndex + 1) % 2 === 1);
|
|
5007
|
-
return /* @__PURE__ */
|
|
5091
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
5008
5092
|
VirtualizedTableRow,
|
|
5009
5093
|
{
|
|
5010
5094
|
key: virtualizedRow.key,
|
|
@@ -5024,7 +5108,7 @@ function Component(props, apiRef) {
|
|
|
5024
5108
|
transform: `translateY(${virtualizedRow.start - index * virtualizedRow.size}px)`
|
|
5025
5109
|
}
|
|
5026
5110
|
},
|
|
5027
|
-
checkboxSelection && /* @__PURE__ */
|
|
5111
|
+
checkboxSelection && /* @__PURE__ */ import_react30.default.createElement(
|
|
5028
5112
|
"th",
|
|
5029
5113
|
{
|
|
5030
5114
|
scope: "row",
|
|
@@ -5032,7 +5116,7 @@ function Component(props, apiRef) {
|
|
|
5032
5116
|
textAlign: "center"
|
|
5033
5117
|
}
|
|
5034
5118
|
},
|
|
5035
|
-
/* @__PURE__ */
|
|
5119
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
5036
5120
|
RenderCheckbox,
|
|
5037
5121
|
{
|
|
5038
5122
|
onClick: getCheckboxClickHandler(rowId, row),
|
|
@@ -5043,7 +5127,7 @@ function Component(props, apiRef) {
|
|
|
5043
5127
|
}
|
|
5044
5128
|
)
|
|
5045
5129
|
),
|
|
5046
|
-
/* @__PURE__ */
|
|
5130
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
5047
5131
|
BodyRow2,
|
|
5048
5132
|
{
|
|
5049
5133
|
tableId,
|
|
@@ -5054,12 +5138,12 @@ function Component(props, apiRef) {
|
|
|
5054
5138
|
noWrap: props.noWrap
|
|
5055
5139
|
}
|
|
5056
5140
|
),
|
|
5057
|
-
showFillerColumn && /* @__PURE__ */
|
|
5141
|
+
showFillerColumn && /* @__PURE__ */ import_react30.default.createElement("td", { "aria-hidden": "true" })
|
|
5058
5142
|
);
|
|
5059
5143
|
})
|
|
5060
|
-
), Footer && /* @__PURE__ */
|
|
5144
|
+
), Footer && /* @__PURE__ */ import_react30.default.createElement(Footer, null))
|
|
5061
5145
|
),
|
|
5062
|
-
pagination && /* @__PURE__ */
|
|
5146
|
+
pagination && /* @__PURE__ */ import_react30.default.createElement(
|
|
5063
5147
|
Pagination_default,
|
|
5064
5148
|
{
|
|
5065
5149
|
pt: 2,
|
|
@@ -5072,11 +5156,11 @@ function Component(props, apiRef) {
|
|
|
5072
5156
|
)
|
|
5073
5157
|
);
|
|
5074
5158
|
}
|
|
5075
|
-
var DataTable = (0,
|
|
5159
|
+
var DataTable = (0, import_react30.forwardRef)(Component);
|
|
5076
5160
|
DataTable.displayName = "DataTable";
|
|
5077
5161
|
|
|
5078
5162
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
5079
|
-
var
|
|
5163
|
+
var import_react31 = __toESM(require("react"));
|
|
5080
5164
|
var import_react_imask2 = require("react-imask");
|
|
5081
5165
|
var import_CalendarToday2 = __toESM(require("@mui/icons-material/CalendarToday"));
|
|
5082
5166
|
var import_joy37 = require("@mui/joy");
|
|
@@ -5218,9 +5302,9 @@ var parseDates = (str, format) => {
|
|
|
5218
5302
|
var formatToPattern2 = (format) => {
|
|
5219
5303
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
5220
5304
|
};
|
|
5221
|
-
var TextMaskAdapter5 =
|
|
5305
|
+
var TextMaskAdapter5 = import_react31.default.forwardRef(function TextMaskAdapter6(props, ref) {
|
|
5222
5306
|
const { onChange, format, ...other } = props;
|
|
5223
|
-
return /* @__PURE__ */
|
|
5307
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5224
5308
|
import_react_imask2.IMaskInput,
|
|
5225
5309
|
{
|
|
5226
5310
|
...other,
|
|
@@ -5254,7 +5338,7 @@ var TextMaskAdapter5 = import_react30.default.forwardRef(function TextMaskAdapte
|
|
|
5254
5338
|
}
|
|
5255
5339
|
);
|
|
5256
5340
|
});
|
|
5257
|
-
var DateRangePicker = (0,
|
|
5341
|
+
var DateRangePicker = (0, import_react31.forwardRef)((inProps, ref) => {
|
|
5258
5342
|
const props = (0, import_joy37.useThemeProps)({ props: inProps, name: "DateRangePicker" });
|
|
5259
5343
|
const {
|
|
5260
5344
|
onChange,
|
|
@@ -5281,28 +5365,28 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5281
5365
|
numberOfMonths,
|
|
5282
5366
|
...innerProps
|
|
5283
5367
|
} = props;
|
|
5284
|
-
const innerRef = (0,
|
|
5285
|
-
const buttonRef = (0,
|
|
5368
|
+
const innerRef = (0, import_react31.useRef)(null);
|
|
5369
|
+
const buttonRef = (0, import_react31.useRef)(null);
|
|
5286
5370
|
const [rawValue, setValue] = useControlledState(
|
|
5287
5371
|
props.value,
|
|
5288
5372
|
props.defaultValue ?? null,
|
|
5289
|
-
(0,
|
|
5373
|
+
(0, import_react31.useCallback)(
|
|
5290
5374
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
5291
5375
|
[props.name, onChange]
|
|
5292
5376
|
)
|
|
5293
5377
|
);
|
|
5294
5378
|
const value = rawValue ?? "";
|
|
5295
5379
|
const isAlphabeticDisplay = hasAlphabeticMonth2(displayFormat);
|
|
5296
|
-
const [displayValue, setDisplayValue] = (0,
|
|
5380
|
+
const [displayValue, setDisplayValue] = (0, import_react31.useState)(
|
|
5297
5381
|
() => value ? formatValueString2(parseDates(value, format), displayFormat, locale) : ""
|
|
5298
5382
|
);
|
|
5299
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
5383
|
+
const [anchorEl, setAnchorEl] = (0, import_react31.useState)(null);
|
|
5300
5384
|
const open = Boolean(anchorEl);
|
|
5301
|
-
const calendarValue = (0,
|
|
5385
|
+
const calendarValue = (0, import_react31.useMemo)(
|
|
5302
5386
|
() => value ? parseDates(value, format) : void 0,
|
|
5303
5387
|
[value, format]
|
|
5304
5388
|
);
|
|
5305
|
-
(0,
|
|
5389
|
+
(0, import_react31.useEffect)(() => {
|
|
5306
5390
|
if (value) {
|
|
5307
5391
|
try {
|
|
5308
5392
|
const dates = parseDates(value, format);
|
|
@@ -5314,13 +5398,13 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5314
5398
|
setDisplayValue("");
|
|
5315
5399
|
}
|
|
5316
5400
|
}, [displayFormat, locale, value, format]);
|
|
5317
|
-
(0,
|
|
5401
|
+
(0, import_react31.useEffect)(() => {
|
|
5318
5402
|
if (!anchorEl) {
|
|
5319
5403
|
innerRef.current?.blur();
|
|
5320
5404
|
}
|
|
5321
5405
|
}, [anchorEl, innerRef]);
|
|
5322
|
-
(0,
|
|
5323
|
-
const handleChange = (0,
|
|
5406
|
+
(0, import_react31.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
5407
|
+
const handleChange = (0, import_react31.useCallback)(
|
|
5324
5408
|
(event) => {
|
|
5325
5409
|
const value2 = event.target.value;
|
|
5326
5410
|
setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat, locale) : value2);
|
|
@@ -5328,7 +5412,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5328
5412
|
},
|
|
5329
5413
|
[displayFormat, format, locale, setValue]
|
|
5330
5414
|
);
|
|
5331
|
-
const handleDisplayInputChange = (0,
|
|
5415
|
+
const handleDisplayInputChange = (0, import_react31.useCallback)(
|
|
5332
5416
|
(event) => {
|
|
5333
5417
|
if (event.target.value === "") {
|
|
5334
5418
|
handleChange({
|
|
@@ -5353,14 +5437,14 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5353
5437
|
},
|
|
5354
5438
|
[displayFormat, format, handleChange, props.name]
|
|
5355
5439
|
);
|
|
5356
|
-
const handleCalendarToggle = (0,
|
|
5440
|
+
const handleCalendarToggle = (0, import_react31.useCallback)(
|
|
5357
5441
|
(event) => {
|
|
5358
5442
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5359
5443
|
innerRef.current?.focus();
|
|
5360
5444
|
},
|
|
5361
5445
|
[anchorEl, setAnchorEl, innerRef]
|
|
5362
5446
|
);
|
|
5363
|
-
const handleCalendarChange = (0,
|
|
5447
|
+
const handleCalendarChange = (0, import_react31.useCallback)(
|
|
5364
5448
|
([date1, date2]) => {
|
|
5365
5449
|
if (!date1 || !date2) return;
|
|
5366
5450
|
const formattedValue = formatValueString2([date1, date2], format);
|
|
@@ -5374,7 +5458,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5374
5458
|
},
|
|
5375
5459
|
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat, locale]
|
|
5376
5460
|
);
|
|
5377
|
-
const handleInputMouseDown = (0,
|
|
5461
|
+
const handleInputMouseDown = (0, import_react31.useCallback)(
|
|
5378
5462
|
(event) => {
|
|
5379
5463
|
if (inputReadOnly || isAlphabeticDisplay) {
|
|
5380
5464
|
event.preventDefault();
|
|
@@ -5383,7 +5467,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5383
5467
|
},
|
|
5384
5468
|
[inputReadOnly, isAlphabeticDisplay, buttonRef]
|
|
5385
5469
|
);
|
|
5386
|
-
const handleInputClick = (0,
|
|
5470
|
+
const handleInputClick = (0, import_react31.useCallback)(
|
|
5387
5471
|
(event) => {
|
|
5388
5472
|
if (inputReadOnly && !readOnly) {
|
|
5389
5473
|
handleCalendarToggle(event);
|
|
@@ -5391,7 +5475,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5391
5475
|
},
|
|
5392
5476
|
[inputReadOnly, readOnly, handleCalendarToggle]
|
|
5393
5477
|
);
|
|
5394
|
-
const handlePresetClick = (0,
|
|
5478
|
+
const handlePresetClick = (0, import_react31.useCallback)(
|
|
5395
5479
|
(presetValue) => {
|
|
5396
5480
|
if (props.value !== void 0) {
|
|
5397
5481
|
onChange?.({ target: { name: props.name, value: presetValue } });
|
|
@@ -5404,7 +5488,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5404
5488
|
},
|
|
5405
5489
|
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat, locale]
|
|
5406
5490
|
);
|
|
5407
|
-
const isPresetDisabled = (0,
|
|
5491
|
+
const isPresetDisabled = (0, import_react31.useCallback)(
|
|
5408
5492
|
(presetValue) => {
|
|
5409
5493
|
try {
|
|
5410
5494
|
const dates = parseDates(presetValue, format);
|
|
@@ -5423,7 +5507,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5423
5507
|
},
|
|
5424
5508
|
[format, minDate, maxDate, disableFuture, disablePast]
|
|
5425
5509
|
);
|
|
5426
|
-
return /* @__PURE__ */
|
|
5510
|
+
return /* @__PURE__ */ import_react31.default.createElement(DateRangePickerRoot, { sx, className }, /* @__PURE__ */ import_react31.default.createElement(import_base4.FocusTrap, { open: true }, /* @__PURE__ */ import_react31.default.createElement(import_react31.default.Fragment, null, /* @__PURE__ */ import_react31.default.createElement(
|
|
5427
5511
|
Input_default,
|
|
5428
5512
|
{
|
|
5429
5513
|
...innerProps,
|
|
@@ -5450,7 +5534,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5450
5534
|
},
|
|
5451
5535
|
error,
|
|
5452
5536
|
sx: { width: "100%" },
|
|
5453
|
-
endDecorator: /* @__PURE__ */
|
|
5537
|
+
endDecorator: /* @__PURE__ */ import_react31.default.createElement(
|
|
5454
5538
|
CalendarButton2,
|
|
5455
5539
|
{
|
|
5456
5540
|
ref: buttonRef,
|
|
@@ -5462,13 +5546,13 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5462
5546
|
"aria-expanded": open,
|
|
5463
5547
|
disabled
|
|
5464
5548
|
},
|
|
5465
|
-
/* @__PURE__ */
|
|
5549
|
+
/* @__PURE__ */ import_react31.default.createElement(import_CalendarToday2.default, null)
|
|
5466
5550
|
),
|
|
5467
5551
|
label,
|
|
5468
5552
|
helperText,
|
|
5469
5553
|
readOnly: readOnly || inputReadOnly || isAlphabeticDisplay
|
|
5470
5554
|
}
|
|
5471
|
-
), open && /* @__PURE__ */
|
|
5555
|
+
), open && /* @__PURE__ */ import_react31.default.createElement(import_base4.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react31.default.createElement(
|
|
5472
5556
|
StyledPopper2,
|
|
5473
5557
|
{
|
|
5474
5558
|
id: "date-range-picker-popper",
|
|
@@ -5487,7 +5571,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5487
5571
|
"aria-label": "Calendar Tooltip",
|
|
5488
5572
|
"aria-expanded": open
|
|
5489
5573
|
},
|
|
5490
|
-
/* @__PURE__ */
|
|
5574
|
+
/* @__PURE__ */ import_react31.default.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react31.default.createElement(CalendarSheetContent2, null, /* @__PURE__ */ import_react31.default.createElement(CalendarSection2, { style: { width: "auto" } }, /* @__PURE__ */ import_react31.default.createElement(
|
|
5491
5575
|
Calendar_default,
|
|
5492
5576
|
{
|
|
5493
5577
|
rangeSelection: true,
|
|
@@ -5500,14 +5584,14 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5500
5584
|
locale,
|
|
5501
5585
|
numberOfMonths
|
|
5502
5586
|
}
|
|
5503
|
-
), !hideClearButton && /* @__PURE__ */
|
|
5587
|
+
), !hideClearButton && /* @__PURE__ */ import_react31.default.createElement(
|
|
5504
5588
|
DialogActions_default,
|
|
5505
5589
|
{
|
|
5506
5590
|
sx: {
|
|
5507
5591
|
p: 1
|
|
5508
5592
|
}
|
|
5509
5593
|
},
|
|
5510
|
-
/* @__PURE__ */
|
|
5594
|
+
/* @__PURE__ */ import_react31.default.createElement(
|
|
5511
5595
|
Button_default,
|
|
5512
5596
|
{
|
|
5513
5597
|
size,
|
|
@@ -5521,9 +5605,9 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5521
5605
|
},
|
|
5522
5606
|
"Clear"
|
|
5523
5607
|
)
|
|
5524
|
-
)), presets && presets.length > 0 && /* @__PURE__ */
|
|
5608
|
+
)), presets && presets.length > 0 && /* @__PURE__ */ import_react31.default.createElement(PresetPanel2, null, presets.map((preset) => {
|
|
5525
5609
|
const disabled2 = isPresetDisabled(preset.value);
|
|
5526
|
-
return /* @__PURE__ */
|
|
5610
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5527
5611
|
PresetItem2,
|
|
5528
5612
|
{
|
|
5529
5613
|
key: preset.label,
|
|
@@ -5542,7 +5626,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5542
5626
|
DateRangePicker.displayName = "DateRangePicker";
|
|
5543
5627
|
|
|
5544
5628
|
// src/components/Drawer/Drawer.tsx
|
|
5545
|
-
var
|
|
5629
|
+
var import_react32 = __toESM(require("react"));
|
|
5546
5630
|
var import_joy38 = require("@mui/joy");
|
|
5547
5631
|
var import_framer_motion22 = require("framer-motion");
|
|
5548
5632
|
var MotionDrawer = (0, import_framer_motion22.motion)(import_joy38.Drawer);
|
|
@@ -5560,7 +5644,7 @@ var StyledDrawer = (0, import_joy38.styled)(MotionDrawer)(({ theme, size = "md"
|
|
|
5560
5644
|
}));
|
|
5561
5645
|
var Drawer = (props) => {
|
|
5562
5646
|
const { children, ...innerProps } = props;
|
|
5563
|
-
return /* @__PURE__ */
|
|
5647
|
+
return /* @__PURE__ */ import_react32.default.createElement(StyledDrawer, { ...innerProps }, children);
|
|
5564
5648
|
};
|
|
5565
5649
|
Drawer.displayName = "Drawer";
|
|
5566
5650
|
|
|
@@ -5591,10 +5675,10 @@ DialogTitle.displayName = "DialogTitle";
|
|
|
5591
5675
|
var DialogTitle_default = DialogTitle;
|
|
5592
5676
|
|
|
5593
5677
|
// src/components/DialogFrame/DialogFrame.tsx
|
|
5594
|
-
var
|
|
5678
|
+
var import_react34 = __toESM(require("react"));
|
|
5595
5679
|
|
|
5596
5680
|
// src/components/Modal/Modal.tsx
|
|
5597
|
-
var
|
|
5681
|
+
var import_react33 = __toESM(require("react"));
|
|
5598
5682
|
var import_joy41 = require("@mui/joy");
|
|
5599
5683
|
var import_framer_motion25 = require("framer-motion");
|
|
5600
5684
|
var MotionModal = (0, import_framer_motion25.motion)(import_joy41.Modal);
|
|
@@ -5609,10 +5693,10 @@ var ModalClose = import_joy41.ModalClose;
|
|
|
5609
5693
|
var MotionModalOverflow = (0, import_framer_motion25.motion)(import_joy41.ModalOverflow);
|
|
5610
5694
|
var ModalOverflow = MotionModalOverflow;
|
|
5611
5695
|
ModalOverflow.displayName = "ModalOverflow";
|
|
5612
|
-
|
|
5696
|
+
var ModalFrame = import_react33.default.forwardRef((props, ref) => {
|
|
5613
5697
|
const { title, children, titleStartDecorator, onClose, ...innerProps } = props;
|
|
5614
|
-
return /* @__PURE__ */
|
|
5615
|
-
}
|
|
5698
|
+
return /* @__PURE__ */ import_react33.default.createElement(StyledModalDialog, { ref, ...innerProps }, /* @__PURE__ */ import_react33.default.createElement(ModalClose, { onClick: onClose }), /* @__PURE__ */ import_react33.default.createElement(DialogTitle_default, null, titleStartDecorator, title), /* @__PURE__ */ import_react33.default.createElement(DialogContent_default, null, children));
|
|
5699
|
+
});
|
|
5616
5700
|
ModalFrame.displayName = "ModalFrame";
|
|
5617
5701
|
|
|
5618
5702
|
// src/components/DialogFrame/DialogFrame.tsx
|
|
@@ -5623,20 +5707,20 @@ var StyledDialogFrame = (0, import_joy42.styled)(ModalDialog, {
|
|
|
5623
5707
|
})({
|
|
5624
5708
|
padding: 0
|
|
5625
5709
|
});
|
|
5626
|
-
var DialogFrame =
|
|
5710
|
+
var DialogFrame = import_react34.default.forwardRef((props, ref) => {
|
|
5627
5711
|
const { title, children, actions, fullscreen, onSubmit, ...innerProps } = props;
|
|
5628
5712
|
const formProps = onSubmit ? { component: "form", onSubmit } : void 0;
|
|
5629
|
-
return /* @__PURE__ */
|
|
5713
|
+
return /* @__PURE__ */ import_react34.default.createElement(StyledDialogFrame, { layout: fullscreen ? "fullscreen" : "center", ref, ...formProps, ...innerProps }, /* @__PURE__ */ import_react34.default.createElement(DialogTitle_default, null, title), /* @__PURE__ */ import_react34.default.createElement(DialogContent_default, null, children), /* @__PURE__ */ import_react34.default.createElement(DialogActions_default, null, actions));
|
|
5630
5714
|
});
|
|
5631
5715
|
DialogFrame.displayName = "DialogFrame";
|
|
5632
5716
|
|
|
5633
5717
|
// src/components/Divider/Divider.tsx
|
|
5634
|
-
var
|
|
5718
|
+
var import_react35 = __toESM(require("react"));
|
|
5635
5719
|
var import_joy43 = require("@mui/joy");
|
|
5636
5720
|
var import_framer_motion26 = require("framer-motion");
|
|
5637
5721
|
var MotionDivider = (0, import_framer_motion26.motion)(import_joy43.Divider);
|
|
5638
5722
|
var Divider = (props) => {
|
|
5639
|
-
return /* @__PURE__ */
|
|
5723
|
+
return /* @__PURE__ */ import_react35.default.createElement(MotionDivider, { ...props });
|
|
5640
5724
|
};
|
|
5641
5725
|
Divider.displayName = "Divider";
|
|
5642
5726
|
|
|
@@ -5657,16 +5741,16 @@ var InsetDrawer = (0, import_joy44.styled)(import_joy44.Drawer)(({ theme }) => (
|
|
|
5657
5741
|
}));
|
|
5658
5742
|
|
|
5659
5743
|
// src/components/FilterableCheckboxGroup/FilterableCheckboxGroup.tsx
|
|
5660
|
-
var
|
|
5744
|
+
var import_react36 = __toESM(require("react"));
|
|
5661
5745
|
var import_Search = __toESM(require("@mui/icons-material/Search"));
|
|
5662
5746
|
var import_joy45 = require("@mui/joy");
|
|
5663
5747
|
var import_react_virtual3 = require("@tanstack/react-virtual");
|
|
5664
5748
|
var EMPTY_VALUE = [];
|
|
5665
5749
|
function LabelWithTooltip(props) {
|
|
5666
5750
|
const { label, size } = props;
|
|
5667
|
-
const labelContentRef = (0,
|
|
5668
|
-
const [isOverflowing, setIsOverflowing] = (0,
|
|
5669
|
-
const labelContent = /* @__PURE__ */
|
|
5751
|
+
const labelContentRef = (0, import_react36.useRef)(null);
|
|
5752
|
+
const [isOverflowing, setIsOverflowing] = (0, import_react36.useState)(false);
|
|
5753
|
+
const labelContent = /* @__PURE__ */ import_react36.default.createElement(
|
|
5670
5754
|
"span",
|
|
5671
5755
|
{
|
|
5672
5756
|
ref: labelContentRef,
|
|
@@ -5682,14 +5766,14 @@ function LabelWithTooltip(props) {
|
|
|
5682
5766
|
},
|
|
5683
5767
|
label
|
|
5684
5768
|
);
|
|
5685
|
-
(0,
|
|
5769
|
+
(0, import_react36.useEffect)(() => {
|
|
5686
5770
|
const element = labelContentRef.current;
|
|
5687
5771
|
if (element) {
|
|
5688
5772
|
setIsOverflowing(element.scrollWidth > element.clientWidth);
|
|
5689
5773
|
}
|
|
5690
5774
|
}, [label]);
|
|
5691
5775
|
if (isOverflowing) {
|
|
5692
|
-
return /* @__PURE__ */
|
|
5776
|
+
return /* @__PURE__ */ import_react36.default.createElement(Tooltip_default, { variant: "solid", size, title: label, placement: "bottom-start" }, labelContent);
|
|
5693
5777
|
}
|
|
5694
5778
|
return labelContent;
|
|
5695
5779
|
}
|
|
@@ -5707,22 +5791,22 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5707
5791
|
maxHeight = 300,
|
|
5708
5792
|
disabled
|
|
5709
5793
|
} = props;
|
|
5710
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
5711
|
-
const [sortedOptions, setSortedOptions] = (0,
|
|
5794
|
+
const [searchTerm, setSearchTerm] = (0, import_react36.useState)("");
|
|
5795
|
+
const [sortedOptions, setSortedOptions] = (0, import_react36.useState)(options);
|
|
5712
5796
|
const [rawValue, setInternalValue] = useControlledState(
|
|
5713
5797
|
value,
|
|
5714
5798
|
value ?? EMPTY_VALUE,
|
|
5715
|
-
(0,
|
|
5799
|
+
(0, import_react36.useCallback)((newValue) => onChange?.(newValue ?? []), [onChange])
|
|
5716
5800
|
);
|
|
5717
5801
|
const internalValue = rawValue ?? EMPTY_VALUE;
|
|
5718
|
-
const parentRef = (0,
|
|
5719
|
-
const isInitialSortRef = (0,
|
|
5720
|
-
const prevOptionsRef = (0,
|
|
5721
|
-
const filteredOptions = (0,
|
|
5802
|
+
const parentRef = (0, import_react36.useRef)(null);
|
|
5803
|
+
const isInitialSortRef = (0, import_react36.useRef)(false);
|
|
5804
|
+
const prevOptionsRef = (0, import_react36.useRef)([...options]);
|
|
5805
|
+
const filteredOptions = (0, import_react36.useMemo)(() => {
|
|
5722
5806
|
if (!searchTerm) return sortedOptions;
|
|
5723
5807
|
return sortedOptions.filter((option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
5724
5808
|
}, [sortedOptions, searchTerm]);
|
|
5725
|
-
const itemSize = (0,
|
|
5809
|
+
const itemSize = (0, import_react36.useMemo)(() => {
|
|
5726
5810
|
switch (size) {
|
|
5727
5811
|
case "sm":
|
|
5728
5812
|
return 28;
|
|
@@ -5740,7 +5824,7 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5740
5824
|
overscan: 5
|
|
5741
5825
|
});
|
|
5742
5826
|
const items = virtualizer.getVirtualItems();
|
|
5743
|
-
(0,
|
|
5827
|
+
(0, import_react36.useEffect)(() => {
|
|
5744
5828
|
const optionsChanged = prevOptionsRef.current.length !== options.length || prevOptionsRef.current.some(
|
|
5745
5829
|
(prevOption, index) => prevOption.value !== options[index]?.value || prevOption.label !== options[index]?.label || prevOption.disabled !== options[index]?.disabled
|
|
5746
5830
|
);
|
|
@@ -5766,13 +5850,13 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5766
5850
|
}
|
|
5767
5851
|
}
|
|
5768
5852
|
}, [options, value]);
|
|
5769
|
-
(0,
|
|
5853
|
+
(0, import_react36.useEffect)(() => {
|
|
5770
5854
|
virtualizer.measure();
|
|
5771
5855
|
}, [virtualizer, filteredOptions, size]);
|
|
5772
|
-
const handleSearchChange = (0,
|
|
5856
|
+
const handleSearchChange = (0, import_react36.useCallback)((event) => {
|
|
5773
5857
|
setSearchTerm(event.target.value);
|
|
5774
5858
|
}, []);
|
|
5775
|
-
const handleCheckboxChange = (0,
|
|
5859
|
+
const handleCheckboxChange = (0, import_react36.useCallback)(
|
|
5776
5860
|
(optionValue) => (event) => {
|
|
5777
5861
|
const checked = event.target.checked;
|
|
5778
5862
|
const newValue = checked ? [...internalValue, optionValue] : internalValue.filter((v) => v !== optionValue);
|
|
@@ -5780,7 +5864,7 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5780
5864
|
},
|
|
5781
5865
|
[internalValue, setInternalValue]
|
|
5782
5866
|
);
|
|
5783
|
-
const handleSelectAll = (0,
|
|
5867
|
+
const handleSelectAll = (0, import_react36.useCallback)(
|
|
5784
5868
|
(event) => {
|
|
5785
5869
|
const checked = event.target.checked;
|
|
5786
5870
|
const enabledOptions = filteredOptions.filter((option) => !option.disabled);
|
|
@@ -5796,10 +5880,10 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5796
5880
|
},
|
|
5797
5881
|
[filteredOptions, internalValue, setInternalValue]
|
|
5798
5882
|
);
|
|
5799
|
-
const enabledFilteredOptions = (0,
|
|
5883
|
+
const enabledFilteredOptions = (0, import_react36.useMemo)(() => filteredOptions.filter((option) => !option.disabled), [filteredOptions]);
|
|
5800
5884
|
const isAllSelected = enabledFilteredOptions.length > 0 && enabledFilteredOptions.every((option) => internalValue.includes(option.value));
|
|
5801
5885
|
const isIndeterminate = !isAllSelected && enabledFilteredOptions.some((option) => internalValue.includes(option.value));
|
|
5802
|
-
return /* @__PURE__ */
|
|
5886
|
+
return /* @__PURE__ */ import_react36.default.createElement("div", { style: { width: "100%" } }, /* @__PURE__ */ import_react36.default.createElement(
|
|
5803
5887
|
Input_default,
|
|
5804
5888
|
{
|
|
5805
5889
|
label,
|
|
@@ -5812,9 +5896,9 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5812
5896
|
onChange: handleSearchChange,
|
|
5813
5897
|
size,
|
|
5814
5898
|
disabled,
|
|
5815
|
-
endDecorator: /* @__PURE__ */
|
|
5899
|
+
endDecorator: /* @__PURE__ */ import_react36.default.createElement(import_Search.default, null)
|
|
5816
5900
|
}
|
|
5817
|
-
), filteredOptions.length === 0 ? /* @__PURE__ */
|
|
5901
|
+
), filteredOptions.length === 0 ? /* @__PURE__ */ import_react36.default.createElement(Typography_default, { level: `body-${size}`, textColor: "neutral.softDisabledColor", padding: "20px 12px", textAlign: "center" }, "No options found.") : /* @__PURE__ */ import_react36.default.createElement(
|
|
5818
5902
|
"div",
|
|
5819
5903
|
{
|
|
5820
5904
|
ref: parentRef,
|
|
@@ -5825,7 +5909,7 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5825
5909
|
marginTop: "8px"
|
|
5826
5910
|
}
|
|
5827
5911
|
},
|
|
5828
|
-
!searchTerm && /* @__PURE__ */
|
|
5912
|
+
!searchTerm && /* @__PURE__ */ import_react36.default.createElement(
|
|
5829
5913
|
Checkbox_default,
|
|
5830
5914
|
{
|
|
5831
5915
|
label: "Select all",
|
|
@@ -5842,7 +5926,7 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5842
5926
|
sx: { width: "100%", height: itemSize }
|
|
5843
5927
|
}
|
|
5844
5928
|
),
|
|
5845
|
-
/* @__PURE__ */
|
|
5929
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
5846
5930
|
Stack_default,
|
|
5847
5931
|
{
|
|
5848
5932
|
sx: {
|
|
@@ -5852,11 +5936,11 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5852
5936
|
},
|
|
5853
5937
|
items.map((virtualRow) => {
|
|
5854
5938
|
const option = filteredOptions[virtualRow.index];
|
|
5855
|
-
return /* @__PURE__ */
|
|
5939
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
5856
5940
|
Checkbox_default,
|
|
5857
5941
|
{
|
|
5858
5942
|
key: virtualRow.key,
|
|
5859
|
-
label: /* @__PURE__ */
|
|
5943
|
+
label: /* @__PURE__ */ import_react36.default.createElement(LabelWithTooltip, { label: option.label, size }),
|
|
5860
5944
|
checked: internalValue.includes(option.value),
|
|
5861
5945
|
onChange: handleCheckboxChange(option.value),
|
|
5862
5946
|
size,
|
|
@@ -5887,9 +5971,12 @@ FilterableCheckboxGroup.displayName = "FilterableCheckboxGroup";
|
|
|
5887
5971
|
var import_joy46 = require("@mui/joy");
|
|
5888
5972
|
|
|
5889
5973
|
// src/components/IconMenuButton/IconMenuButton.tsx
|
|
5890
|
-
var
|
|
5974
|
+
var import_react37 = __toESM(require("react"));
|
|
5891
5975
|
var import_joy47 = require("@mui/joy");
|
|
5892
|
-
function
|
|
5976
|
+
var MenuButtonRootSlot = import_react37.default.forwardRef(function MenuButtonRootSlot2({ as, ...rest }, ref) {
|
|
5977
|
+
return /* @__PURE__ */ import_react37.default.createElement(import_joy47.IconButton, { ...rest, component: as ?? "button", ref });
|
|
5978
|
+
});
|
|
5979
|
+
function IconMenuButtonInner(props, ref) {
|
|
5893
5980
|
const {
|
|
5894
5981
|
size,
|
|
5895
5982
|
icon,
|
|
@@ -5900,8 +5987,10 @@ function IconMenuButton(props) {
|
|
|
5900
5987
|
variant = "plain",
|
|
5901
5988
|
placement = "bottom"
|
|
5902
5989
|
} = props;
|
|
5990
|
+
const { ref: buttonComponentRef, ...buttonComponentProps } = props.buttonComponentProps ?? {};
|
|
5991
|
+
const mergedButtonRef = useMergedRef(buttonComponentRef, ref);
|
|
5903
5992
|
if (!items.length) {
|
|
5904
|
-
return /* @__PURE__ */
|
|
5993
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
|
5905
5994
|
import_joy47.IconButton,
|
|
5906
5995
|
{
|
|
5907
5996
|
component: props.buttonComponent ?? "button",
|
|
@@ -5910,15 +5999,16 @@ function IconMenuButton(props) {
|
|
|
5910
5999
|
color,
|
|
5911
6000
|
disabled,
|
|
5912
6001
|
loading,
|
|
5913
|
-
...
|
|
6002
|
+
...buttonComponentProps,
|
|
6003
|
+
ref: mergedButtonRef
|
|
5914
6004
|
},
|
|
5915
6005
|
icon
|
|
5916
6006
|
);
|
|
5917
6007
|
}
|
|
5918
|
-
return /* @__PURE__ */
|
|
6008
|
+
return /* @__PURE__ */ import_react37.default.createElement(Dropdown_default, null, /* @__PURE__ */ import_react37.default.createElement(
|
|
5919
6009
|
import_joy47.MenuButton,
|
|
5920
6010
|
{
|
|
5921
|
-
slots: { root:
|
|
6011
|
+
slots: { root: MenuButtonRootSlot },
|
|
5922
6012
|
slotProps: {
|
|
5923
6013
|
root: {
|
|
5924
6014
|
component: props.buttonComponent ?? "button",
|
|
@@ -5927,24 +6017,27 @@ function IconMenuButton(props) {
|
|
|
5927
6017
|
color,
|
|
5928
6018
|
disabled,
|
|
5929
6019
|
loading,
|
|
5930
|
-
...
|
|
6020
|
+
...buttonComponentProps,
|
|
6021
|
+
// Joy의 useSlot이 내부 ref와 이 ref를 합쳐준다. 위 no-items 분기와 같은 경로로 ref를 넘긴다.
|
|
6022
|
+
ref: mergedButtonRef
|
|
5931
6023
|
}
|
|
5932
6024
|
}
|
|
5933
6025
|
},
|
|
5934
6026
|
icon
|
|
5935
|
-
), /* @__PURE__ */
|
|
6027
|
+
), /* @__PURE__ */ import_react37.default.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ import_react37.default.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
5936
6028
|
}
|
|
6029
|
+
var IconMenuButton = import_react37.default.forwardRef(IconMenuButtonInner);
|
|
5937
6030
|
IconMenuButton.displayName = "IconMenuButton";
|
|
5938
6031
|
|
|
5939
6032
|
// src/components/Markdown/Markdown.tsx
|
|
5940
|
-
var
|
|
6033
|
+
var import_react38 = __toESM(require("react"));
|
|
5941
6034
|
var import_joy48 = require("@mui/joy");
|
|
5942
6035
|
var import_joy49 = require("@mui/joy");
|
|
5943
6036
|
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
5944
|
-
var LazyReactMarkdown = (0,
|
|
6037
|
+
var LazyReactMarkdown = (0, import_react38.lazy)(() => import("react-markdown"));
|
|
5945
6038
|
var Markdown = (props) => {
|
|
5946
|
-
const [rehypeAccent2, setRehypeAccent] = (0,
|
|
5947
|
-
(0,
|
|
6039
|
+
const [rehypeAccent2, setRehypeAccent] = (0, import_react38.useState)(null);
|
|
6040
|
+
(0, import_react38.useEffect)(() => {
|
|
5948
6041
|
const loadRehypeAccent = async () => {
|
|
5949
6042
|
const module2 = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
|
|
5950
6043
|
setRehypeAccent(() => module2.rehypeAccent);
|
|
@@ -5966,8 +6059,8 @@ var Markdown = (props) => {
|
|
|
5966
6059
|
if (!rehypeAccent2) {
|
|
5967
6060
|
return null;
|
|
5968
6061
|
}
|
|
5969
|
-
return /* @__PURE__ */
|
|
5970
|
-
|
|
6062
|
+
return /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ import_react38.default.createElement(
|
|
6063
|
+
import_react38.Suspense,
|
|
5971
6064
|
{
|
|
5972
6065
|
fallback: (
|
|
5973
6066
|
// While in the fallback state, prevent browser auto-translation (e.g. Chrome/Google Translate)
|
|
@@ -5975,10 +6068,10 @@ var Markdown = (props) => {
|
|
|
5975
6068
|
// swaps the fallback for the real content via insertBefore; if the browser has mutated the DOM
|
|
5976
6069
|
// in the meantime, the reference node's parent changes and React throws a DOMException
|
|
5977
6070
|
// ("Failed to execute 'insertBefore' on 'Node'"), crashing the subtree. (cf. facebook/react#11538)
|
|
5978
|
-
fallback || /* @__PURE__ */
|
|
6071
|
+
fallback || /* @__PURE__ */ import_react38.default.createElement(Typography, { translate: "no", className: "notranslate" }, /* @__PURE__ */ import_react38.default.createElement(import_joy48.Skeleton, null, content || ""))
|
|
5979
6072
|
)
|
|
5980
6073
|
},
|
|
5981
|
-
/* @__PURE__ */
|
|
6074
|
+
/* @__PURE__ */ import_react38.default.createElement(
|
|
5982
6075
|
LazyReactMarkdown,
|
|
5983
6076
|
{
|
|
5984
6077
|
...markdownOptions,
|
|
@@ -5986,17 +6079,17 @@ var Markdown = (props) => {
|
|
|
5986
6079
|
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
5987
6080
|
remarkPlugins: [import_remark_gfm.default],
|
|
5988
6081
|
components: {
|
|
5989
|
-
a: ({ children, href }) => /* @__PURE__ */
|
|
5990
|
-
hr: () => /* @__PURE__ */
|
|
5991
|
-
b: ({ children }) => /* @__PURE__ */
|
|
5992
|
-
strong: ({ children }) => /* @__PURE__ */
|
|
6082
|
+
a: ({ children, href }) => /* @__PURE__ */ import_react38.default.createElement(import_joy49.Link, { href, target: defaultLinkAction }, children),
|
|
6083
|
+
hr: () => /* @__PURE__ */ import_react38.default.createElement(Divider, { sx: { display: "block" } }),
|
|
6084
|
+
b: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "strong", fontWeight: boldFontWeight || "lg" }, children),
|
|
6085
|
+
strong: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "strong", fontWeight: boldFontWeight || "lg" }, children),
|
|
5993
6086
|
// Table components
|
|
5994
|
-
table: ({ children }) => /* @__PURE__ */
|
|
6087
|
+
table: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(Sheet, { variant: "outlined", sx: { display: "block", borderRadius: "sm", overflow: "auto" } }, /* @__PURE__ */ import_react38.default.createElement(Table, { size: "sm" }, children)),
|
|
5995
6088
|
// Code components
|
|
5996
6089
|
code: ({ children, className }) => {
|
|
5997
6090
|
const isBlock = className?.startsWith("language-");
|
|
5998
6091
|
if (isBlock) {
|
|
5999
|
-
return /* @__PURE__ */
|
|
6092
|
+
return /* @__PURE__ */ import_react38.default.createElement(
|
|
6000
6093
|
Typography,
|
|
6001
6094
|
{
|
|
6002
6095
|
component: "code",
|
|
@@ -6010,7 +6103,7 @@ var Markdown = (props) => {
|
|
|
6010
6103
|
children
|
|
6011
6104
|
);
|
|
6012
6105
|
}
|
|
6013
|
-
return /* @__PURE__ */
|
|
6106
|
+
return /* @__PURE__ */ import_react38.default.createElement(
|
|
6014
6107
|
Typography,
|
|
6015
6108
|
{
|
|
6016
6109
|
component: "code",
|
|
@@ -6025,7 +6118,7 @@ var Markdown = (props) => {
|
|
|
6025
6118
|
children
|
|
6026
6119
|
);
|
|
6027
6120
|
},
|
|
6028
|
-
pre: ({ children }) => /* @__PURE__ */
|
|
6121
|
+
pre: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(
|
|
6029
6122
|
Sheet,
|
|
6030
6123
|
{
|
|
6031
6124
|
variant: "soft",
|
|
@@ -6043,12 +6136,12 @@ var Markdown = (props) => {
|
|
|
6043
6136
|
// Task list checkbox
|
|
6044
6137
|
input: ({ checked, type }) => {
|
|
6045
6138
|
if (type === "checkbox") {
|
|
6046
|
-
return /* @__PURE__ */
|
|
6139
|
+
return /* @__PURE__ */ import_react38.default.createElement(Checkbox, { checked, disabled: true, size: "sm", sx: { mr: 1 } });
|
|
6047
6140
|
}
|
|
6048
|
-
return /* @__PURE__ */
|
|
6141
|
+
return /* @__PURE__ */ import_react38.default.createElement("input", { checked, type });
|
|
6049
6142
|
},
|
|
6050
6143
|
// Blockquote
|
|
6051
|
-
blockquote: ({ children }) => /* @__PURE__ */
|
|
6144
|
+
blockquote: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(
|
|
6052
6145
|
Sheet,
|
|
6053
6146
|
{
|
|
6054
6147
|
variant: "soft",
|
|
@@ -6057,12 +6150,12 @@ var Markdown = (props) => {
|
|
|
6057
6150
|
children
|
|
6058
6151
|
),
|
|
6059
6152
|
// Image
|
|
6060
|
-
img: ({ src, alt }) => /* @__PURE__ */
|
|
6153
|
+
img: ({ src, alt }) => /* @__PURE__ */ import_react38.default.createElement("img", { src, alt, style: { maxWidth: "100%", borderRadius: "4px" } }),
|
|
6061
6154
|
// Text style components
|
|
6062
|
-
em: ({ children }) => /* @__PURE__ */
|
|
6063
|
-
del: ({ children }) => /* @__PURE__ */
|
|
6155
|
+
em: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "em", sx: { fontStyle: "italic" } }, children),
|
|
6156
|
+
del: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "del", sx: { textDecoration: "line-through" } }, children),
|
|
6064
6157
|
// Span for accent color (from rehype-accent plugin)
|
|
6065
|
-
span: ({ children, node }) => /* @__PURE__ */
|
|
6158
|
+
span: ({ children, node }) => /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "span", textColor: node?.properties?.textColor }, children),
|
|
6066
6159
|
...markdownOptions?.components
|
|
6067
6160
|
}
|
|
6068
6161
|
}
|
|
@@ -6072,7 +6165,7 @@ var Markdown = (props) => {
|
|
|
6072
6165
|
Markdown.displayName = "Markdown";
|
|
6073
6166
|
|
|
6074
6167
|
// src/components/MenuButton/MenuButton.tsx
|
|
6075
|
-
var
|
|
6168
|
+
var import_react39 = __toESM(require("react"));
|
|
6076
6169
|
var import_joy50 = require("@mui/joy");
|
|
6077
6170
|
var import_ExpandMore = __toESM(require("@mui/icons-material/ExpandMore"));
|
|
6078
6171
|
function MenuButton2(props) {
|
|
@@ -6090,7 +6183,7 @@ function MenuButton2(props) {
|
|
|
6090
6183
|
placement = "bottom"
|
|
6091
6184
|
} = props;
|
|
6092
6185
|
if (!items.length) {
|
|
6093
|
-
return /* @__PURE__ */
|
|
6186
|
+
return /* @__PURE__ */ import_react39.default.createElement(
|
|
6094
6187
|
import_joy50.Button,
|
|
6095
6188
|
{
|
|
6096
6189
|
component: props.buttonComponent ?? "button",
|
|
@@ -6101,12 +6194,12 @@ function MenuButton2(props) {
|
|
|
6101
6194
|
loading,
|
|
6102
6195
|
startDecorator,
|
|
6103
6196
|
...props.buttonComponentProps ?? {},
|
|
6104
|
-
endDecorator: showIcon ? /* @__PURE__ */
|
|
6197
|
+
endDecorator: showIcon ? /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, endDecorator, /* @__PURE__ */ import_react39.default.createElement(import_ExpandMore.default, null)) : /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, endDecorator)
|
|
6105
6198
|
},
|
|
6106
6199
|
buttonText
|
|
6107
6200
|
);
|
|
6108
6201
|
}
|
|
6109
|
-
return /* @__PURE__ */
|
|
6202
|
+
return /* @__PURE__ */ import_react39.default.createElement(Dropdown_default, null, /* @__PURE__ */ import_react39.default.createElement(
|
|
6110
6203
|
import_joy50.MenuButton,
|
|
6111
6204
|
{
|
|
6112
6205
|
component: props.buttonComponent ?? "button",
|
|
@@ -6117,15 +6210,15 @@ function MenuButton2(props) {
|
|
|
6117
6210
|
loading,
|
|
6118
6211
|
startDecorator,
|
|
6119
6212
|
...props.buttonComponentProps ?? {},
|
|
6120
|
-
endDecorator: showIcon ? /* @__PURE__ */
|
|
6213
|
+
endDecorator: showIcon ? /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, endDecorator, /* @__PURE__ */ import_react39.default.createElement(import_ExpandMore.default, null)) : /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, endDecorator)
|
|
6121
6214
|
},
|
|
6122
6215
|
buttonText
|
|
6123
|
-
), /* @__PURE__ */
|
|
6216
|
+
), /* @__PURE__ */ import_react39.default.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ import_react39.default.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
6124
6217
|
}
|
|
6125
6218
|
MenuButton2.displayName = "MenuButton";
|
|
6126
6219
|
|
|
6127
6220
|
// src/components/MonthPicker/MonthPicker.tsx
|
|
6128
|
-
var
|
|
6221
|
+
var import_react40 = __toESM(require("react"));
|
|
6129
6222
|
var import_CalendarToday3 = __toESM(require("@mui/icons-material/CalendarToday"));
|
|
6130
6223
|
var import_joy51 = require("@mui/joy");
|
|
6131
6224
|
var import_base5 = require("@mui/base");
|
|
@@ -6181,7 +6274,7 @@ function parseDate3(dateString, format) {
|
|
|
6181
6274
|
const result = new Date(year, month, day);
|
|
6182
6275
|
return result;
|
|
6183
6276
|
}
|
|
6184
|
-
var MonthPicker = (0,
|
|
6277
|
+
var MonthPicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
6185
6278
|
const props = (0, import_joy51.useThemeProps)({ props: inProps, name: "MonthPicker" });
|
|
6186
6279
|
const {
|
|
6187
6280
|
onChange,
|
|
@@ -6208,18 +6301,18 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6208
6301
|
locale,
|
|
6209
6302
|
...innerProps
|
|
6210
6303
|
} = props;
|
|
6211
|
-
const innerRef = (0,
|
|
6212
|
-
const buttonRef = (0,
|
|
6304
|
+
const innerRef = (0, import_react40.useRef)(null);
|
|
6305
|
+
const buttonRef = (0, import_react40.useRef)(null);
|
|
6213
6306
|
const [rawValue, setValue, isControlled] = useControlledState(
|
|
6214
6307
|
props.value,
|
|
6215
6308
|
props.defaultValue ?? null,
|
|
6216
|
-
(0,
|
|
6309
|
+
(0, import_react40.useCallback)(
|
|
6217
6310
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
6218
6311
|
[props.name, onChange]
|
|
6219
6312
|
)
|
|
6220
6313
|
);
|
|
6221
6314
|
const value = rawValue ?? "";
|
|
6222
|
-
const getFormattedDisplayValue = (0,
|
|
6315
|
+
const getFormattedDisplayValue = (0, import_react40.useCallback)(
|
|
6223
6316
|
(inputValue) => {
|
|
6224
6317
|
if (!inputValue) return "";
|
|
6225
6318
|
try {
|
|
@@ -6230,19 +6323,19 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6230
6323
|
},
|
|
6231
6324
|
[format, displayFormat, locale]
|
|
6232
6325
|
);
|
|
6233
|
-
const [displayValue, setDisplayValue] = (0,
|
|
6234
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
6326
|
+
const [displayValue, setDisplayValue] = (0, import_react40.useState)(() => getFormattedDisplayValue(value));
|
|
6327
|
+
const [anchorEl, setAnchorEl] = (0, import_react40.useState)(null);
|
|
6235
6328
|
const open = Boolean(anchorEl);
|
|
6236
|
-
(0,
|
|
6329
|
+
(0, import_react40.useEffect)(() => {
|
|
6237
6330
|
if (!anchorEl) {
|
|
6238
6331
|
innerRef.current?.blur();
|
|
6239
6332
|
}
|
|
6240
6333
|
}, [anchorEl, innerRef]);
|
|
6241
|
-
(0,
|
|
6242
|
-
(0,
|
|
6334
|
+
(0, import_react40.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
6335
|
+
(0, import_react40.useEffect)(() => {
|
|
6243
6336
|
setDisplayValue(getFormattedDisplayValue(value));
|
|
6244
6337
|
}, [value, getFormattedDisplayValue]);
|
|
6245
|
-
const handleChange = (0,
|
|
6338
|
+
const handleChange = (0, import_react40.useCallback)(
|
|
6246
6339
|
(event) => {
|
|
6247
6340
|
const newValue = event.target.value;
|
|
6248
6341
|
setValue(newValue);
|
|
@@ -6252,21 +6345,21 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6252
6345
|
},
|
|
6253
6346
|
[setValue, getFormattedDisplayValue, isControlled]
|
|
6254
6347
|
);
|
|
6255
|
-
const handleCalendarToggle = (0,
|
|
6348
|
+
const handleCalendarToggle = (0, import_react40.useCallback)(
|
|
6256
6349
|
(event) => {
|
|
6257
6350
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
6258
6351
|
innerRef.current?.focus();
|
|
6259
6352
|
},
|
|
6260
6353
|
[anchorEl, setAnchorEl, innerRef]
|
|
6261
6354
|
);
|
|
6262
|
-
const handleInputMouseDown = (0,
|
|
6355
|
+
const handleInputMouseDown = (0, import_react40.useCallback)(
|
|
6263
6356
|
(event) => {
|
|
6264
6357
|
event.preventDefault();
|
|
6265
6358
|
buttonRef.current?.focus();
|
|
6266
6359
|
},
|
|
6267
6360
|
[buttonRef]
|
|
6268
6361
|
);
|
|
6269
|
-
return /* @__PURE__ */
|
|
6362
|
+
return /* @__PURE__ */ import_react40.default.createElement(MonthPickerRoot, null, /* @__PURE__ */ import_react40.default.createElement(import_base5.FocusTrap, { open: true }, /* @__PURE__ */ import_react40.default.createElement(import_react40.default.Fragment, null, /* @__PURE__ */ import_react40.default.createElement(
|
|
6270
6363
|
Input_default,
|
|
6271
6364
|
{
|
|
6272
6365
|
...innerProps,
|
|
@@ -6296,7 +6389,7 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6296
6389
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
6297
6390
|
fontFamily: "monospace"
|
|
6298
6391
|
},
|
|
6299
|
-
endDecorator: /* @__PURE__ */
|
|
6392
|
+
endDecorator: /* @__PURE__ */ import_react40.default.createElement(
|
|
6300
6393
|
IconButton_default,
|
|
6301
6394
|
{
|
|
6302
6395
|
ref: buttonRef,
|
|
@@ -6308,12 +6401,12 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6308
6401
|
"aria-expanded": open,
|
|
6309
6402
|
disabled
|
|
6310
6403
|
},
|
|
6311
|
-
/* @__PURE__ */
|
|
6404
|
+
/* @__PURE__ */ import_react40.default.createElement(import_CalendarToday3.default, null)
|
|
6312
6405
|
),
|
|
6313
6406
|
label,
|
|
6314
6407
|
helperText
|
|
6315
6408
|
}
|
|
6316
|
-
), open && /* @__PURE__ */
|
|
6409
|
+
), open && /* @__PURE__ */ import_react40.default.createElement(import_base5.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react40.default.createElement(
|
|
6317
6410
|
StyledPopper3,
|
|
6318
6411
|
{
|
|
6319
6412
|
id: "month-picker-popper",
|
|
@@ -6332,7 +6425,7 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6332
6425
|
"aria-label": "Calendar Tooltip",
|
|
6333
6426
|
"aria-expanded": open
|
|
6334
6427
|
},
|
|
6335
|
-
/* @__PURE__ */
|
|
6428
|
+
/* @__PURE__ */ import_react40.default.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react40.default.createElement(
|
|
6336
6429
|
Calendar_default,
|
|
6337
6430
|
{
|
|
6338
6431
|
view: "month",
|
|
@@ -6353,14 +6446,14 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6353
6446
|
disablePast,
|
|
6354
6447
|
locale
|
|
6355
6448
|
}
|
|
6356
|
-
), /* @__PURE__ */
|
|
6449
|
+
), /* @__PURE__ */ import_react40.default.createElement(
|
|
6357
6450
|
DialogActions_default,
|
|
6358
6451
|
{
|
|
6359
6452
|
sx: {
|
|
6360
6453
|
p: 1
|
|
6361
6454
|
}
|
|
6362
6455
|
},
|
|
6363
|
-
/* @__PURE__ */
|
|
6456
|
+
/* @__PURE__ */ import_react40.default.createElement(
|
|
6364
6457
|
Button_default,
|
|
6365
6458
|
{
|
|
6366
6459
|
size,
|
|
@@ -6383,7 +6476,7 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6383
6476
|
});
|
|
6384
6477
|
|
|
6385
6478
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
6386
|
-
var
|
|
6479
|
+
var import_react41 = __toESM(require("react"));
|
|
6387
6480
|
var import_react_imask3 = require("react-imask");
|
|
6388
6481
|
var import_CalendarToday4 = __toESM(require("@mui/icons-material/CalendarToday"));
|
|
6389
6482
|
var import_joy52 = require("@mui/joy");
|
|
@@ -6444,9 +6537,9 @@ var parseDates2 = (str) => {
|
|
|
6444
6537
|
var formatToPattern3 = (format) => {
|
|
6445
6538
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
|
|
6446
6539
|
};
|
|
6447
|
-
var TextMaskAdapter7 =
|
|
6540
|
+
var TextMaskAdapter7 = import_react41.default.forwardRef(function TextMaskAdapter8(props, ref) {
|
|
6448
6541
|
const { onChange, format, ...other } = props;
|
|
6449
|
-
return /* @__PURE__ */
|
|
6542
|
+
return /* @__PURE__ */ import_react41.default.createElement(
|
|
6450
6543
|
import_react_imask3.IMaskInput,
|
|
6451
6544
|
{
|
|
6452
6545
|
...other,
|
|
@@ -6474,7 +6567,7 @@ var TextMaskAdapter7 = import_react40.default.forwardRef(function TextMaskAdapte
|
|
|
6474
6567
|
}
|
|
6475
6568
|
);
|
|
6476
6569
|
});
|
|
6477
|
-
var MonthRangePicker = (0,
|
|
6570
|
+
var MonthRangePicker = (0, import_react41.forwardRef)((inProps, ref) => {
|
|
6478
6571
|
const props = (0, import_joy52.useThemeProps)({ props: inProps, name: "MonthRangePicker" });
|
|
6479
6572
|
const {
|
|
6480
6573
|
onChange,
|
|
@@ -6498,24 +6591,24 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6498
6591
|
} = props;
|
|
6499
6592
|
const displayFormat = displayFormatProp ?? format;
|
|
6500
6593
|
const isAlphabeticDisplay = hasAlphabeticMonth3(displayFormat);
|
|
6501
|
-
const innerRef = (0,
|
|
6502
|
-
const buttonRef = (0,
|
|
6594
|
+
const innerRef = (0, import_react41.useRef)(null);
|
|
6595
|
+
const buttonRef = (0, import_react41.useRef)(null);
|
|
6503
6596
|
const [rawValue, setValue] = useControlledState(
|
|
6504
6597
|
props.value,
|
|
6505
6598
|
props.defaultValue ?? null,
|
|
6506
|
-
(0,
|
|
6599
|
+
(0, import_react41.useCallback)(
|
|
6507
6600
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
6508
6601
|
[props.name, onChange]
|
|
6509
6602
|
)
|
|
6510
6603
|
);
|
|
6511
6604
|
const value = rawValue ?? "";
|
|
6512
|
-
const [displayValue, setDisplayValue] = (0,
|
|
6605
|
+
const [displayValue, setDisplayValue] = (0, import_react41.useState)(
|
|
6513
6606
|
() => value ? formatValueString4(parseDates2(value), displayFormat, locale) : ""
|
|
6514
6607
|
);
|
|
6515
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
6608
|
+
const [anchorEl, setAnchorEl] = (0, import_react41.useState)(null);
|
|
6516
6609
|
const open = Boolean(anchorEl);
|
|
6517
|
-
const calendarValue = (0,
|
|
6518
|
-
(0,
|
|
6610
|
+
const calendarValue = (0, import_react41.useMemo)(() => value ? parseDates2(value) : void 0, [value]);
|
|
6611
|
+
(0, import_react41.useEffect)(() => {
|
|
6519
6612
|
if (value) {
|
|
6520
6613
|
try {
|
|
6521
6614
|
const dates = parseDates2(value);
|
|
@@ -6527,13 +6620,13 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6527
6620
|
setDisplayValue("");
|
|
6528
6621
|
}
|
|
6529
6622
|
}, [displayFormat, locale, value]);
|
|
6530
|
-
(0,
|
|
6623
|
+
(0, import_react41.useEffect)(() => {
|
|
6531
6624
|
if (!anchorEl) {
|
|
6532
6625
|
innerRef.current?.blur();
|
|
6533
6626
|
}
|
|
6534
6627
|
}, [anchorEl, innerRef]);
|
|
6535
|
-
(0,
|
|
6536
|
-
const handleChange = (0,
|
|
6628
|
+
(0, import_react41.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
6629
|
+
const handleChange = (0, import_react41.useCallback)(
|
|
6537
6630
|
(event) => {
|
|
6538
6631
|
setDisplayValue(
|
|
6539
6632
|
event.target.value ? formatValueString4(parseDates2(event.target.value), displayFormat, locale) : ""
|
|
@@ -6542,7 +6635,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6542
6635
|
},
|
|
6543
6636
|
[displayFormat, locale, setValue]
|
|
6544
6637
|
);
|
|
6545
|
-
const handleInputMouseDown = (0,
|
|
6638
|
+
const handleInputMouseDown = (0, import_react41.useCallback)(
|
|
6546
6639
|
(event) => {
|
|
6547
6640
|
if (isAlphabeticDisplay) {
|
|
6548
6641
|
event.preventDefault();
|
|
@@ -6551,14 +6644,14 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6551
6644
|
},
|
|
6552
6645
|
[isAlphabeticDisplay, buttonRef]
|
|
6553
6646
|
);
|
|
6554
|
-
const handleCalendarToggle = (0,
|
|
6647
|
+
const handleCalendarToggle = (0, import_react41.useCallback)(
|
|
6555
6648
|
(event) => {
|
|
6556
6649
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
6557
6650
|
innerRef.current?.focus();
|
|
6558
6651
|
},
|
|
6559
6652
|
[anchorEl, setAnchorEl, innerRef]
|
|
6560
6653
|
);
|
|
6561
|
-
const handleCalendarChange = (0,
|
|
6654
|
+
const handleCalendarChange = (0, import_react41.useCallback)(
|
|
6562
6655
|
([date1, date2]) => {
|
|
6563
6656
|
if (!date1 || !date2) return;
|
|
6564
6657
|
const formattedValue = formatValueString4([date1, date2], format);
|
|
@@ -6568,7 +6661,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6568
6661
|
},
|
|
6569
6662
|
[setValue, setAnchorEl, format, displayFormat, locale]
|
|
6570
6663
|
);
|
|
6571
|
-
return /* @__PURE__ */
|
|
6664
|
+
return /* @__PURE__ */ import_react41.default.createElement(MonthRangePickerRoot, null, /* @__PURE__ */ import_react41.default.createElement(import_base6.FocusTrap, { open: true }, /* @__PURE__ */ import_react41.default.createElement(import_react41.default.Fragment, null, /* @__PURE__ */ import_react41.default.createElement(
|
|
6572
6665
|
Input_default,
|
|
6573
6666
|
{
|
|
6574
6667
|
...innerProps,
|
|
@@ -6598,7 +6691,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6598
6691
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
6599
6692
|
fontFamily: "monospace"
|
|
6600
6693
|
},
|
|
6601
|
-
endDecorator: /* @__PURE__ */
|
|
6694
|
+
endDecorator: /* @__PURE__ */ import_react41.default.createElement(
|
|
6602
6695
|
IconButton_default,
|
|
6603
6696
|
{
|
|
6604
6697
|
ref: buttonRef,
|
|
@@ -6609,12 +6702,12 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6609
6702
|
"aria-haspopup": "dialog",
|
|
6610
6703
|
"aria-expanded": open
|
|
6611
6704
|
},
|
|
6612
|
-
/* @__PURE__ */
|
|
6705
|
+
/* @__PURE__ */ import_react41.default.createElement(import_CalendarToday4.default, null)
|
|
6613
6706
|
),
|
|
6614
6707
|
label,
|
|
6615
6708
|
helperText
|
|
6616
6709
|
}
|
|
6617
|
-
), open && /* @__PURE__ */
|
|
6710
|
+
), open && /* @__PURE__ */ import_react41.default.createElement(import_base6.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react41.default.createElement(
|
|
6618
6711
|
StyledPopper4,
|
|
6619
6712
|
{
|
|
6620
6713
|
id: "month-range-picker-popper",
|
|
@@ -6633,7 +6726,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6633
6726
|
"aria-label": "Calendar Tooltip",
|
|
6634
6727
|
"aria-expanded": open
|
|
6635
6728
|
},
|
|
6636
|
-
/* @__PURE__ */
|
|
6729
|
+
/* @__PURE__ */ import_react41.default.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react41.default.createElement(
|
|
6637
6730
|
Calendar_default,
|
|
6638
6731
|
{
|
|
6639
6732
|
view: "month",
|
|
@@ -6647,14 +6740,14 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6647
6740
|
disablePast,
|
|
6648
6741
|
locale
|
|
6649
6742
|
}
|
|
6650
|
-
), /* @__PURE__ */
|
|
6743
|
+
), /* @__PURE__ */ import_react41.default.createElement(
|
|
6651
6744
|
DialogActions_default,
|
|
6652
6745
|
{
|
|
6653
6746
|
sx: {
|
|
6654
6747
|
p: 1
|
|
6655
6748
|
}
|
|
6656
6749
|
},
|
|
6657
|
-
/* @__PURE__ */
|
|
6750
|
+
/* @__PURE__ */ import_react41.default.createElement(
|
|
6658
6751
|
Button_default,
|
|
6659
6752
|
{
|
|
6660
6753
|
size,
|
|
@@ -6673,7 +6766,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6673
6766
|
MonthRangePicker.displayName = "MonthRangePicker";
|
|
6674
6767
|
|
|
6675
6768
|
// src/components/NavigationGroup/NavigationGroup.tsx
|
|
6676
|
-
var
|
|
6769
|
+
var import_react42 = __toESM(require("react"));
|
|
6677
6770
|
var import_joy53 = require("@mui/joy");
|
|
6678
6771
|
var AccordionSummary2 = (0, import_joy53.styled)(import_joy53.AccordionSummary, {
|
|
6679
6772
|
name: "NavigationGroup",
|
|
@@ -6697,11 +6790,11 @@ var AccordionDetails2 = (0, import_joy53.styled)(import_joy53.AccordionDetails,
|
|
|
6697
6790
|
}));
|
|
6698
6791
|
function NavigationGroup(props) {
|
|
6699
6792
|
const { title, children, startDecorator, level, ...rest } = props;
|
|
6700
|
-
return /* @__PURE__ */
|
|
6793
|
+
return /* @__PURE__ */ import_react42.default.createElement(import_joy53.Accordion, { ...rest }, /* @__PURE__ */ import_react42.default.createElement(AccordionSummary2, { useIcon: !!startDecorator, level }, /* @__PURE__ */ import_react42.default.createElement(import_joy53.Stack, { direction: "row", gap: 4 }, startDecorator, title)), /* @__PURE__ */ import_react42.default.createElement(AccordionDetails2, null, children));
|
|
6701
6794
|
}
|
|
6702
6795
|
|
|
6703
6796
|
// src/components/NavigationItem/NavigationItem.tsx
|
|
6704
|
-
var
|
|
6797
|
+
var import_react43 = __toESM(require("react"));
|
|
6705
6798
|
var import_joy54 = require("@mui/joy");
|
|
6706
6799
|
var ListItemButton = (0, import_joy54.styled)(import_joy54.ListItemButton, {
|
|
6707
6800
|
name: "NavigationItem",
|
|
@@ -6730,7 +6823,7 @@ function NavigationItem(props) {
|
|
|
6730
6823
|
const handleClick = () => {
|
|
6731
6824
|
onClick?.(id);
|
|
6732
6825
|
};
|
|
6733
|
-
return /* @__PURE__ */
|
|
6826
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_joy54.ListItem, { ...rest }, /* @__PURE__ */ import_react43.default.createElement(
|
|
6734
6827
|
ListItemButton,
|
|
6735
6828
|
{
|
|
6736
6829
|
level,
|
|
@@ -6739,21 +6832,21 @@ function NavigationItem(props) {
|
|
|
6739
6832
|
"aria-current": selected,
|
|
6740
6833
|
onClick: handleClick
|
|
6741
6834
|
},
|
|
6742
|
-
startDecorator && /* @__PURE__ */
|
|
6835
|
+
startDecorator && /* @__PURE__ */ import_react43.default.createElement(import_joy54.ListItemDecorator, null, startDecorator),
|
|
6743
6836
|
children
|
|
6744
6837
|
));
|
|
6745
6838
|
}
|
|
6746
6839
|
|
|
6747
6840
|
// src/components/Navigator/Navigator.tsx
|
|
6748
|
-
var
|
|
6841
|
+
var import_react44 = __toESM(require("react"));
|
|
6749
6842
|
function Navigator(props) {
|
|
6750
6843
|
const { items, level = 0, onSelect } = props;
|
|
6751
6844
|
const handleItemClick = (id) => {
|
|
6752
6845
|
onSelect?.(id);
|
|
6753
6846
|
};
|
|
6754
|
-
return /* @__PURE__ */
|
|
6847
|
+
return /* @__PURE__ */ import_react44.default.createElement("div", null, items.map((item, index) => {
|
|
6755
6848
|
if (item.type === "item") {
|
|
6756
|
-
return /* @__PURE__ */
|
|
6849
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
6757
6850
|
NavigationItem,
|
|
6758
6851
|
{
|
|
6759
6852
|
key: item.id,
|
|
@@ -6766,7 +6859,7 @@ function Navigator(props) {
|
|
|
6766
6859
|
item.title
|
|
6767
6860
|
);
|
|
6768
6861
|
} else if (item.type === "group") {
|
|
6769
|
-
return /* @__PURE__ */
|
|
6862
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
6770
6863
|
NavigationGroup,
|
|
6771
6864
|
{
|
|
6772
6865
|
key: `${item.title}-${index}`,
|
|
@@ -6784,16 +6877,16 @@ function Navigator(props) {
|
|
|
6784
6877
|
Navigator.displayName = "Navigator";
|
|
6785
6878
|
|
|
6786
6879
|
// src/components/PercentageInput/PercentageInput.tsx
|
|
6787
|
-
var
|
|
6880
|
+
var import_react45 = __toESM(require("react"));
|
|
6788
6881
|
var import_react_number_format2 = require("react-number-format");
|
|
6789
6882
|
var import_joy55 = require("@mui/joy");
|
|
6790
6883
|
var padDecimal = (value, decimalScale) => {
|
|
6791
6884
|
const [integer, decimal = ""] = `${value}`.split(".");
|
|
6792
6885
|
return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
|
|
6793
6886
|
};
|
|
6794
|
-
var TextMaskAdapter9 =
|
|
6887
|
+
var TextMaskAdapter9 = import_react45.default.forwardRef(function TextMaskAdapter10(props, ref) {
|
|
6795
6888
|
const { onChange, min, max, ...innerProps } = props;
|
|
6796
|
-
return /* @__PURE__ */
|
|
6889
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
6797
6890
|
import_react_number_format2.NumericFormat,
|
|
6798
6891
|
{
|
|
6799
6892
|
...innerProps,
|
|
@@ -6818,7 +6911,7 @@ var PercentageInputRoot = (0, import_joy55.styled)(Input_default, {
|
|
|
6818
6911
|
slot: "Root",
|
|
6819
6912
|
overridesResolver: (props, styles) => styles.root
|
|
6820
6913
|
})({});
|
|
6821
|
-
var PercentageInput =
|
|
6914
|
+
var PercentageInput = import_react45.default.forwardRef(
|
|
6822
6915
|
function PercentageInput2(inProps, ref) {
|
|
6823
6916
|
const props = (0, import_joy55.useThemeProps)({ props: inProps, name: "PercentageInput" });
|
|
6824
6917
|
const {
|
|
@@ -6841,19 +6934,19 @@ var PercentageInput = import_react44.default.forwardRef(
|
|
|
6841
6934
|
const [_value, setValue] = useControlledState(
|
|
6842
6935
|
props.value,
|
|
6843
6936
|
props.defaultValue ?? null,
|
|
6844
|
-
(0,
|
|
6937
|
+
(0, import_react45.useCallback)((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
6845
6938
|
);
|
|
6846
|
-
const value = (0,
|
|
6939
|
+
const value = (0, import_react45.useMemo)(() => {
|
|
6847
6940
|
if (_value && useMinorUnit) {
|
|
6848
6941
|
return _value / Math.pow(10, maxDecimalScale);
|
|
6849
6942
|
}
|
|
6850
6943
|
return _value;
|
|
6851
6944
|
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
6852
|
-
const internalError = (0,
|
|
6945
|
+
const internalError = (0, import_react45.useMemo)(
|
|
6853
6946
|
() => value != null && (max != null && value > max || min != null && value < min),
|
|
6854
6947
|
[max, min, value]
|
|
6855
6948
|
);
|
|
6856
|
-
const handleChange = (0,
|
|
6949
|
+
const handleChange = (0, import_react45.useCallback)(
|
|
6857
6950
|
(event) => {
|
|
6858
6951
|
if (event.target.value === "") {
|
|
6859
6952
|
setValue(null);
|
|
@@ -6865,7 +6958,7 @@ var PercentageInput = import_react44.default.forwardRef(
|
|
|
6865
6958
|
},
|
|
6866
6959
|
[setValue, useMinorUnit, maxDecimalScale]
|
|
6867
6960
|
);
|
|
6868
|
-
return /* @__PURE__ */
|
|
6961
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
6869
6962
|
PercentageInputRoot,
|
|
6870
6963
|
{
|
|
6871
6964
|
...innerProps,
|
|
@@ -6906,7 +6999,7 @@ var RadioGroup = MotionRadioGroup;
|
|
|
6906
6999
|
RadioGroup.displayName = "RadioGroup";
|
|
6907
7000
|
|
|
6908
7001
|
// src/components/RadioTileGroup/RadioTileGroup.tsx
|
|
6909
|
-
var
|
|
7002
|
+
var import_react46 = __toESM(require("react"));
|
|
6910
7003
|
var import_joy57 = require("@mui/joy");
|
|
6911
7004
|
var RadioTileGroupRoot = (0, import_joy57.styled)(RadioGroup, {
|
|
6912
7005
|
name: "RadioTileGroup",
|
|
@@ -6994,7 +7087,7 @@ function RadioTileGroup(props) {
|
|
|
6994
7087
|
error,
|
|
6995
7088
|
required
|
|
6996
7089
|
} = props;
|
|
6997
|
-
const radioGroup = /* @__PURE__ */
|
|
7090
|
+
const radioGroup = /* @__PURE__ */ import_react46.default.createElement(
|
|
6998
7091
|
RadioTileGroupRoot,
|
|
6999
7092
|
{
|
|
7000
7093
|
overlay: true,
|
|
@@ -7005,7 +7098,7 @@ function RadioTileGroup(props) {
|
|
|
7005
7098
|
flex,
|
|
7006
7099
|
columns
|
|
7007
7100
|
},
|
|
7008
|
-
options.map((option) => /* @__PURE__ */
|
|
7101
|
+
options.map((option) => /* @__PURE__ */ import_react46.default.createElement(
|
|
7009
7102
|
RadioTileSheet,
|
|
7010
7103
|
{
|
|
7011
7104
|
key: option.value,
|
|
@@ -7015,7 +7108,7 @@ function RadioTileGroup(props) {
|
|
|
7015
7108
|
flex,
|
|
7016
7109
|
textAlign
|
|
7017
7110
|
},
|
|
7018
|
-
/* @__PURE__ */
|
|
7111
|
+
/* @__PURE__ */ import_react46.default.createElement(
|
|
7019
7112
|
Radio,
|
|
7020
7113
|
{
|
|
7021
7114
|
id: `${option.value}`,
|
|
@@ -7044,7 +7137,7 @@ function RadioTileGroup(props) {
|
|
|
7044
7137
|
}
|
|
7045
7138
|
}
|
|
7046
7139
|
),
|
|
7047
|
-
option.startDecorator && /* @__PURE__ */
|
|
7140
|
+
option.startDecorator && /* @__PURE__ */ import_react46.default.createElement(
|
|
7048
7141
|
Box_default,
|
|
7049
7142
|
{
|
|
7050
7143
|
sx: {
|
|
@@ -7065,15 +7158,15 @@ function RadioTileGroup(props) {
|
|
|
7065
7158
|
)
|
|
7066
7159
|
))
|
|
7067
7160
|
);
|
|
7068
|
-
return /* @__PURE__ */
|
|
7161
|
+
return /* @__PURE__ */ import_react46.default.createElement(FormControl_default, { required, disabled: allDisabled, error, size, sx, className }, label && /* @__PURE__ */ import_react46.default.createElement(FormLabel_default, null, label), radioGroup, helperText && /* @__PURE__ */ import_react46.default.createElement(FormHelperText_default, null, helperText));
|
|
7069
7162
|
}
|
|
7070
7163
|
RadioTileGroup.displayName = "RadioTileGroup";
|
|
7071
7164
|
|
|
7072
7165
|
// src/components/RadioList/RadioList.tsx
|
|
7073
|
-
var
|
|
7166
|
+
var import_react47 = __toESM(require("react"));
|
|
7074
7167
|
function RadioList(props) {
|
|
7075
7168
|
const { items, ...innerProps } = props;
|
|
7076
|
-
return /* @__PURE__ */
|
|
7169
|
+
return /* @__PURE__ */ import_react47.default.createElement(RadioGroup, { ...innerProps }, items.map((item) => /* @__PURE__ */ import_react47.default.createElement(Radio, { key: `${item.value}`, value: item.value, label: item.label })));
|
|
7077
7170
|
}
|
|
7078
7171
|
RadioList.displayName = "RadioList";
|
|
7079
7172
|
|
|
@@ -7164,7 +7257,7 @@ var SearchBar = React44.forwardRef(function SearchBar2(inProps, ref) {
|
|
|
7164
7257
|
SearchBar.displayName = "SearchBar";
|
|
7165
7258
|
|
|
7166
7259
|
// src/components/Stepper/Stepper.tsx
|
|
7167
|
-
var
|
|
7260
|
+
var import_react48 = __toESM(require("react"));
|
|
7168
7261
|
var import_joy58 = require("@mui/joy");
|
|
7169
7262
|
var import_Check = __toESM(require("@mui/icons-material/Check"));
|
|
7170
7263
|
var import_framer_motion28 = require("framer-motion");
|
|
@@ -7193,7 +7286,7 @@ function Stepper(props) {
|
|
|
7193
7286
|
stepOrientation = "horizontal"
|
|
7194
7287
|
} = props;
|
|
7195
7288
|
const effectiveStepOrientation = orientation === "vertical" ? "horizontal" : stepOrientation;
|
|
7196
|
-
return /* @__PURE__ */
|
|
7289
|
+
return /* @__PURE__ */ import_react48.default.createElement(
|
|
7197
7290
|
MotionStepper,
|
|
7198
7291
|
{
|
|
7199
7292
|
orientation,
|
|
@@ -7232,23 +7325,23 @@ function Stepper(props) {
|
|
|
7232
7325
|
const completed = activeStep > i + 1;
|
|
7233
7326
|
const disabled = activeStep < i + 1;
|
|
7234
7327
|
const hasContent = step.label || step.extraContent;
|
|
7235
|
-
return /* @__PURE__ */
|
|
7328
|
+
return /* @__PURE__ */ import_react48.default.createElement(
|
|
7236
7329
|
Step,
|
|
7237
7330
|
{
|
|
7238
7331
|
key: `step-${i}`,
|
|
7239
|
-
indicator: /* @__PURE__ */
|
|
7332
|
+
indicator: /* @__PURE__ */ import_react48.default.createElement(StepIndicator, { variant: disabled ? "outlined" : "solid", color: disabled ? "neutral" : "primary" }, completed ? /* @__PURE__ */ import_react48.default.createElement(import_Check.default, null) : step.indicatorContent),
|
|
7240
7333
|
active,
|
|
7241
7334
|
completed,
|
|
7242
7335
|
disabled,
|
|
7243
7336
|
orientation: effectiveStepOrientation
|
|
7244
7337
|
},
|
|
7245
|
-
hasContent && /* @__PURE__ */
|
|
7338
|
+
hasContent && /* @__PURE__ */ import_react48.default.createElement(
|
|
7246
7339
|
Stack_default,
|
|
7247
7340
|
{
|
|
7248
7341
|
sx: orientation === "horizontal" && effectiveStepOrientation === "vertical" ? { alignItems: "center" } : {}
|
|
7249
7342
|
},
|
|
7250
|
-
step.label && /* @__PURE__ */
|
|
7251
|
-
step.extraContent && /* @__PURE__ */
|
|
7343
|
+
step.label && /* @__PURE__ */ import_react48.default.createElement(Typography_default, { level: "title-sm" }, step.label),
|
|
7344
|
+
step.extraContent && /* @__PURE__ */ import_react48.default.createElement(Typography_default, { level: "body-xs" }, step.extraContent)
|
|
7252
7345
|
)
|
|
7253
7346
|
);
|
|
7254
7347
|
})
|
|
@@ -7257,7 +7350,7 @@ function Stepper(props) {
|
|
|
7257
7350
|
Stepper.displayName = "Stepper";
|
|
7258
7351
|
|
|
7259
7352
|
// src/components/Switch/Switch.tsx
|
|
7260
|
-
var
|
|
7353
|
+
var import_react49 = __toESM(require("react"));
|
|
7261
7354
|
var import_joy59 = require("@mui/joy");
|
|
7262
7355
|
var import_framer_motion29 = require("framer-motion");
|
|
7263
7356
|
var MotionSwitch = (0, import_framer_motion29.motion)(import_joy59.Switch);
|
|
@@ -7279,14 +7372,14 @@ var StyledThumb = (0, import_joy59.styled)(import_framer_motion29.motion.div)({
|
|
|
7279
7372
|
right: "var(--Switch-thumbOffset)"
|
|
7280
7373
|
}
|
|
7281
7374
|
});
|
|
7282
|
-
var Thumb = (props) => /* @__PURE__ */
|
|
7375
|
+
var Thumb = (props) => /* @__PURE__ */ import_react49.default.createElement(StyledThumb, { ...props, layout: true, transition: spring });
|
|
7283
7376
|
var spring = {
|
|
7284
7377
|
type: "spring",
|
|
7285
7378
|
stiffness: 700,
|
|
7286
7379
|
damping: 30
|
|
7287
7380
|
};
|
|
7288
7381
|
var Switch = (props) => {
|
|
7289
|
-
return /* @__PURE__ */
|
|
7382
|
+
return /* @__PURE__ */ import_react49.default.createElement(
|
|
7290
7383
|
MotionSwitch,
|
|
7291
7384
|
{
|
|
7292
7385
|
...props,
|
|
@@ -7300,7 +7393,7 @@ var Switch = (props) => {
|
|
|
7300
7393
|
Switch.displayName = "Switch";
|
|
7301
7394
|
|
|
7302
7395
|
// src/components/Tabs/Tabs.tsx
|
|
7303
|
-
var
|
|
7396
|
+
var import_react50 = __toESM(require("react"));
|
|
7304
7397
|
var import_joy60 = require("@mui/joy");
|
|
7305
7398
|
var StyledTabs = (0, import_joy60.styled)(import_joy60.Tabs)(({ theme }) => ({
|
|
7306
7399
|
backgroundColor: theme.palette.background.body
|
|
@@ -7316,15 +7409,15 @@ var StyledTab = (0, import_joy60.styled)(import_joy60.Tab)(({ theme }) => ({
|
|
|
7316
7409
|
backgroundColor: theme.palette.background.body
|
|
7317
7410
|
}
|
|
7318
7411
|
}));
|
|
7319
|
-
var Tab = (0,
|
|
7320
|
-
return /* @__PURE__ */
|
|
7412
|
+
var Tab = (0, import_react50.forwardRef)(function Tab2({ startDecorator, endDecorator, children, ...props }, ref) {
|
|
7413
|
+
return /* @__PURE__ */ import_react50.default.createElement(StyledTab, { ...props, ref }, startDecorator, children, endDecorator);
|
|
7321
7414
|
});
|
|
7322
7415
|
Tab.displayName = "Tab";
|
|
7323
7416
|
var TabList = import_joy60.TabList;
|
|
7324
7417
|
var TabPanel = import_joy60.TabPanel;
|
|
7325
7418
|
|
|
7326
7419
|
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
7327
|
-
var
|
|
7420
|
+
var import_react51 = __toESM(require("react"));
|
|
7328
7421
|
var import_joy61 = require("@mui/joy");
|
|
7329
7422
|
var colorScheme = {
|
|
7330
7423
|
palette: {
|
|
@@ -7590,12 +7683,12 @@ var defaultTheme = (0, import_joy61.extendTheme)({
|
|
|
7590
7683
|
});
|
|
7591
7684
|
function ThemeProvider(props) {
|
|
7592
7685
|
const theme = props.theme || defaultTheme;
|
|
7593
|
-
return /* @__PURE__ */
|
|
7686
|
+
return /* @__PURE__ */ import_react51.default.createElement(import_react51.default.Fragment, null, /* @__PURE__ */ import_react51.default.createElement(import_joy61.CssVarsProvider, { theme }, /* @__PURE__ */ import_react51.default.createElement(import_joy61.CssBaseline, null), props.children));
|
|
7594
7687
|
}
|
|
7595
7688
|
ThemeProvider.displayName = "ThemeProvider";
|
|
7596
7689
|
|
|
7597
7690
|
// src/components/Uploader/Uploader.tsx
|
|
7598
|
-
var
|
|
7691
|
+
var import_react52 = __toESM(require("react"));
|
|
7599
7692
|
var import_joy62 = require("@mui/joy");
|
|
7600
7693
|
var import_CloudUploadRounded = __toESM(require("@mui/icons-material/CloudUploadRounded"));
|
|
7601
7694
|
var import_UploadFileRounded = __toESM(require("@mui/icons-material/UploadFileRounded"));
|
|
@@ -7658,7 +7751,7 @@ var getFileSize = (n) => {
|
|
|
7658
7751
|
};
|
|
7659
7752
|
var Preview = (props) => {
|
|
7660
7753
|
const { files, uploaded, onDelete } = props;
|
|
7661
|
-
return /* @__PURE__ */
|
|
7754
|
+
return /* @__PURE__ */ import_react52.default.createElement(PreviewRoot, { gap: 1 }, [...uploaded, ...files].map((file) => /* @__PURE__ */ import_react52.default.createElement(UploadCard, { key: file.name, size: "sm", color: "neutral" }, /* @__PURE__ */ import_react52.default.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2 }, /* @__PURE__ */ import_react52.default.createElement(UploadFileIcon, null), /* @__PURE__ */ import_react52.default.createElement(Stack_default, { flex: "1", sx: { overflow: "hidden" } }, /* @__PURE__ */ import_react52.default.createElement(
|
|
7662
7755
|
Typography_default,
|
|
7663
7756
|
{
|
|
7664
7757
|
level: "body-sm",
|
|
@@ -7670,7 +7763,7 @@ var Preview = (props) => {
|
|
|
7670
7763
|
}
|
|
7671
7764
|
},
|
|
7672
7765
|
file.name
|
|
7673
|
-
), !!file.size && /* @__PURE__ */
|
|
7766
|
+
), !!file.size && /* @__PURE__ */ import_react52.default.createElement(Typography_default, { level: "body-xs", fontWeight: "300", lineHeight: "1.33", textColor: "text.tertiary" }, getFileSize(file.size))), /* @__PURE__ */ import_react52.default.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ import_react52.default.createElement(ClearIcon2, null))))));
|
|
7674
7767
|
};
|
|
7675
7768
|
var UploaderRoot = (0, import_joy62.styled)(Stack_default, {
|
|
7676
7769
|
name: "Uploader",
|
|
@@ -7713,7 +7806,7 @@ var UploaderIcon = (0, import_joy62.styled)(import_CloudUploadRounded.default, {
|
|
|
7713
7806
|
}
|
|
7714
7807
|
})
|
|
7715
7808
|
);
|
|
7716
|
-
var Uploader =
|
|
7809
|
+
var Uploader = import_react52.default.memo((props) => {
|
|
7717
7810
|
const {
|
|
7718
7811
|
accept,
|
|
7719
7812
|
minCount,
|
|
@@ -7729,14 +7822,14 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7729
7822
|
error: errorProp,
|
|
7730
7823
|
helperText: helperTextProp
|
|
7731
7824
|
} = props;
|
|
7732
|
-
const dropZoneRef = (0,
|
|
7733
|
-
const inputRef = (0,
|
|
7734
|
-
const [errorText, setErrorText] = (0,
|
|
7735
|
-
const [files, setFiles] = (0,
|
|
7736
|
-
const [uploaded, setUploaded] = (0,
|
|
7737
|
-
const [previewState, setPreviewState] = (0,
|
|
7738
|
-
const accepts = (0,
|
|
7739
|
-
const parsedAccepts = (0,
|
|
7825
|
+
const dropZoneRef = (0, import_react52.useRef)(null);
|
|
7826
|
+
const inputRef = (0, import_react52.useRef)(null);
|
|
7827
|
+
const [errorText, setErrorText] = (0, import_react52.useState)();
|
|
7828
|
+
const [files, setFiles] = (0, import_react52.useState)([]);
|
|
7829
|
+
const [uploaded, setUploaded] = (0, import_react52.useState)(props.uploaded || []);
|
|
7830
|
+
const [previewState, setPreviewState] = (0, import_react52.useState)("idle");
|
|
7831
|
+
const accepts = (0, import_react52.useMemo)(() => accept.split(",").map((accept2) => accept2.trim()), [accept]);
|
|
7832
|
+
const parsedAccepts = (0, import_react52.useMemo)(
|
|
7740
7833
|
() => accepts.flatMap((type) => {
|
|
7741
7834
|
if (["image/*", "video/*", "audio/*"].includes(type)) {
|
|
7742
7835
|
return ALL_EXTENSIONS_BY_TYPE[type];
|
|
@@ -7745,7 +7838,7 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7745
7838
|
}),
|
|
7746
7839
|
[accepts]
|
|
7747
7840
|
);
|
|
7748
|
-
const helperText = (0,
|
|
7841
|
+
const helperText = (0, import_react52.useMemo)(() => {
|
|
7749
7842
|
if (helperTextProp) {
|
|
7750
7843
|
return helperTextProp;
|
|
7751
7844
|
}
|
|
@@ -7775,12 +7868,12 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7775
7868
|
}
|
|
7776
7869
|
return helperTexts.join(", ");
|
|
7777
7870
|
}, [accepts, maxFileTotalSize, maxCount, helperTextProp]);
|
|
7778
|
-
const error = (0,
|
|
7779
|
-
const showDropZone = (0,
|
|
7871
|
+
const error = (0, import_react52.useMemo)(() => !!errorText || errorProp, [errorProp, errorText]);
|
|
7872
|
+
const showDropZone = (0, import_react52.useMemo)(
|
|
7780
7873
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
7781
7874
|
[files, maxCount, uploaded]
|
|
7782
7875
|
);
|
|
7783
|
-
const addFiles = (0,
|
|
7876
|
+
const addFiles = (0, import_react52.useCallback)(
|
|
7784
7877
|
(uploads) => {
|
|
7785
7878
|
try {
|
|
7786
7879
|
const types = parsedAccepts.map((type) => type.replace(".", "")) || [];
|
|
@@ -7825,7 +7918,7 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7825
7918
|
},
|
|
7826
7919
|
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
7827
7920
|
);
|
|
7828
|
-
(0,
|
|
7921
|
+
(0, import_react52.useEffect)(() => {
|
|
7829
7922
|
if (!dropZoneRef.current || disabled) {
|
|
7830
7923
|
return;
|
|
7831
7924
|
}
|
|
@@ -7853,7 +7946,7 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7853
7946
|
})
|
|
7854
7947
|
);
|
|
7855
7948
|
}, [disabled, addFiles]);
|
|
7856
|
-
(0,
|
|
7949
|
+
(0, import_react52.useEffect)(() => {
|
|
7857
7950
|
if (inputRef.current && minCount) {
|
|
7858
7951
|
if (files.length < minCount) {
|
|
7859
7952
|
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
@@ -7862,14 +7955,14 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7862
7955
|
}
|
|
7863
7956
|
}
|
|
7864
7957
|
}, [inputRef, files, minCount]);
|
|
7865
|
-
const handleFileChanged = (0,
|
|
7958
|
+
const handleFileChanged = (0, import_react52.useCallback)(
|
|
7866
7959
|
(event) => {
|
|
7867
7960
|
const files2 = Array.from(event.target.files || []);
|
|
7868
7961
|
addFiles(files2);
|
|
7869
7962
|
},
|
|
7870
7963
|
[addFiles]
|
|
7871
7964
|
);
|
|
7872
|
-
const handleDeleteFile = (0,
|
|
7965
|
+
const handleDeleteFile = (0, import_react52.useCallback)(
|
|
7873
7966
|
(deletedFile) => {
|
|
7874
7967
|
if (deletedFile instanceof File) {
|
|
7875
7968
|
setFiles((current) => {
|
|
@@ -7889,10 +7982,10 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7889
7982
|
},
|
|
7890
7983
|
[name, onChange, onDelete]
|
|
7891
7984
|
);
|
|
7892
|
-
const handleUploaderButtonClick = (0,
|
|
7985
|
+
const handleUploaderButtonClick = (0, import_react52.useCallback)(() => {
|
|
7893
7986
|
inputRef.current?.click();
|
|
7894
7987
|
}, []);
|
|
7895
|
-
const uploader = /* @__PURE__ */
|
|
7988
|
+
const uploader = /* @__PURE__ */ import_react52.default.createElement(
|
|
7896
7989
|
FileDropZone,
|
|
7897
7990
|
{
|
|
7898
7991
|
state: previewState,
|
|
@@ -7901,8 +7994,8 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7901
7994
|
ref: dropZoneRef,
|
|
7902
7995
|
onClick: handleUploaderButtonClick
|
|
7903
7996
|
},
|
|
7904
|
-
/* @__PURE__ */
|
|
7905
|
-
/* @__PURE__ */
|
|
7997
|
+
/* @__PURE__ */ import_react52.default.createElement(Stack_default, { alignItems: "center", gap: 1 }, /* @__PURE__ */ import_react52.default.createElement(UploaderIcon, { state: previewState, error: !!(error || errorText), disabled })),
|
|
7998
|
+
/* @__PURE__ */ import_react52.default.createElement(
|
|
7906
7999
|
VisuallyHiddenInput,
|
|
7907
8000
|
{
|
|
7908
8001
|
disabled,
|
|
@@ -7925,6 +8018,6 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7925
8018
|
}
|
|
7926
8019
|
)
|
|
7927
8020
|
);
|
|
7928
|
-
return /* @__PURE__ */
|
|
8021
|
+
return /* @__PURE__ */ import_react52.default.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ import_react52.default.createElement(FormControl_default, { size, error: !!(error || errorText), disabled, required: !!minCount }, label && /* @__PURE__ */ import_react52.default.createElement(FormLabel_default, null, label), uploader, /* @__PURE__ */ import_react52.default.createElement(FormHelperText_default, null, /* @__PURE__ */ import_react52.default.createElement(Stack_default, null, errorText && /* @__PURE__ */ import_react52.default.createElement("div", null, errorText), /* @__PURE__ */ import_react52.default.createElement("div", null, helperText)))), [...uploaded, ...files].length > 0 && /* @__PURE__ */ import_react52.default.createElement(Preview, { files, uploaded, onDelete: handleDeleteFile }));
|
|
7929
8022
|
});
|
|
7930
8023
|
Uploader.displayName = "Uploader";
|