@ceed/cds 1.40.3-next.1 → 1.40.3-next.2
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 +734 -649
- package/dist/index.js +247 -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,44 @@ 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 (next[
|
|
3886
|
-
next[
|
|
3929
|
+
if (next[columnId] !== w) {
|
|
3930
|
+
next[columnId] = w;
|
|
3887
3931
|
changed = true;
|
|
3888
3932
|
}
|
|
3889
3933
|
});
|
|
3890
3934
|
return changed ? next : prev;
|
|
3891
3935
|
});
|
|
3892
3936
|
});
|
|
3893
|
-
|
|
3937
|
+
const measured = {};
|
|
3938
|
+
Object.entries(columnsById).forEach(([columnId, def]) => {
|
|
3894
3939
|
const el = def.headerRef.current;
|
|
3895
3940
|
if (el) {
|
|
3896
|
-
el.dataset.
|
|
3941
|
+
el.dataset.hdsColumnId = columnId;
|
|
3942
|
+
el.dataset.field = String(def.field);
|
|
3943
|
+
measured[columnId] = Math.round(el.getBoundingClientRect().width);
|
|
3897
3944
|
roRef.current.observe(el);
|
|
3898
3945
|
}
|
|
3899
3946
|
});
|
|
3947
|
+
setWidths((prev) => {
|
|
3948
|
+
const keys = Object.keys(measured);
|
|
3949
|
+
const same = keys.length === Object.keys(prev).length && keys.every((key) => prev[key] === measured[key]);
|
|
3950
|
+
return same ? prev : measured;
|
|
3951
|
+
});
|
|
3900
3952
|
return () => roRef.current?.disconnect();
|
|
3901
|
-
}, [
|
|
3953
|
+
}, [columnsById]);
|
|
3902
3954
|
return widths;
|
|
3903
3955
|
}
|
|
3904
3956
|
function useDataTableRenderer({
|
|
@@ -3930,33 +3982,33 @@ function useDataTableRenderer({
|
|
|
3930
3982
|
"You cannot use both `pinnedColumns` and `columnGroupingModel` at the same time. Please choose one of them."
|
|
3931
3983
|
);
|
|
3932
3984
|
}
|
|
3933
|
-
const onSelectionModelChangeRef = (0,
|
|
3985
|
+
const onSelectionModelChangeRef = (0, import_react27.useRef)(onSelectionModelChange);
|
|
3934
3986
|
onSelectionModelChangeRef.current = onSelectionModelChange;
|
|
3935
|
-
const [focusedRowId, setFocusedRowId] = (0,
|
|
3936
|
-
const [selectionAnchor, setSelectionAnchor] = (0,
|
|
3987
|
+
const [focusedRowId, setFocusedRowId] = (0, import_react27.useState)(null);
|
|
3988
|
+
const [selectionAnchor, setSelectionAnchor] = (0, import_react27.useState)(null);
|
|
3937
3989
|
const [sortModel, setSortModel] = useControlledState(
|
|
3938
3990
|
controlledSortModel,
|
|
3939
3991
|
initialState?.sorting?.sortModel ?? [],
|
|
3940
|
-
(0,
|
|
3992
|
+
(0, import_react27.useCallback)((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3941
3993
|
);
|
|
3942
3994
|
const [visibilityModel] = useControlledState(
|
|
3943
3995
|
columnVisibilityModel,
|
|
3944
3996
|
initialState?.columns?.columnVisibilityModel ?? {},
|
|
3945
|
-
(0,
|
|
3997
|
+
(0, import_react27.useCallback)(
|
|
3946
3998
|
(model) => onColumnVisibilityModelChange?.(model),
|
|
3947
3999
|
[onColumnVisibilityModelChange]
|
|
3948
4000
|
)
|
|
3949
4001
|
);
|
|
3950
|
-
const reorderedColumns = (0,
|
|
4002
|
+
const reorderedColumns = (0, import_react27.useMemo)(() => {
|
|
3951
4003
|
if (!columnGroupingModel) return columnsProp;
|
|
3952
4004
|
return reorderColumnsByGroupingModel(columnsProp, columnGroupingModel);
|
|
3953
4005
|
}, [columnsProp, columnGroupingModel]);
|
|
3954
|
-
const visibleColumns = (0,
|
|
4006
|
+
const visibleColumns = (0, import_react27.useMemo)(
|
|
3955
4007
|
() => reorderedColumns.filter((col) => visibilityModel[col.field] !== false),
|
|
3956
4008
|
[reorderedColumns, visibilityModel]
|
|
3957
4009
|
);
|
|
3958
|
-
const visibleFieldSet = (0,
|
|
3959
|
-
const tableMinWidth = (0,
|
|
4010
|
+
const visibleFieldSet = (0, import_react27.useMemo)(() => new Set(visibleColumns.map((c) => c.field)), [visibleColumns]);
|
|
4011
|
+
const tableMinWidth = (0, import_react27.useMemo)(() => {
|
|
3960
4012
|
const DEFAULT_MIN = 50;
|
|
3961
4013
|
let total = checkboxSelection ? 40 : 0;
|
|
3962
4014
|
for (const col of visibleColumns) {
|
|
@@ -3964,7 +4016,7 @@ function useDataTableRenderer({
|
|
|
3964
4016
|
}
|
|
3965
4017
|
return total;
|
|
3966
4018
|
}, [visibleColumns, checkboxSelection]);
|
|
3967
|
-
const allColumnsByField = (0,
|
|
4019
|
+
const allColumnsByField = (0, import_react27.useMemo)(
|
|
3968
4020
|
() => reorderedColumns.reduce(
|
|
3969
4021
|
(acc, curr) => ({
|
|
3970
4022
|
...acc,
|
|
@@ -3974,21 +4026,36 @@ function useDataTableRenderer({
|
|
|
3974
4026
|
),
|
|
3975
4027
|
[reorderedColumns]
|
|
3976
4028
|
);
|
|
3977
|
-
const
|
|
3978
|
-
() =>
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
4029
|
+
const columnIds = (0, import_react27.useMemo)(() => {
|
|
4030
|
+
const taken = new Set(visibleColumns.map((column) => String(column.field)));
|
|
4031
|
+
const ids = [];
|
|
4032
|
+
visibleColumns.forEach((column) => {
|
|
4033
|
+
const field = String(column.field);
|
|
4034
|
+
if (!ids.includes(field)) {
|
|
4035
|
+
ids.push(field);
|
|
4036
|
+
return;
|
|
4037
|
+
}
|
|
4038
|
+
let n = 2;
|
|
4039
|
+
while (taken.has(`${field}__${n}`)) n += 1;
|
|
4040
|
+
taken.add(`${field}__${n}`);
|
|
4041
|
+
ids.push(`${field}__${n}`);
|
|
4042
|
+
});
|
|
4043
|
+
return ids;
|
|
4044
|
+
}, [visibleColumns]);
|
|
4045
|
+
const visibleColumnsById = (0, import_react27.useMemo)(
|
|
4046
|
+
() => Object.fromEntries(
|
|
4047
|
+
visibleColumns.map((column, index) => [
|
|
4048
|
+
columnIds[index],
|
|
4049
|
+
{
|
|
4050
|
+
...column,
|
|
4051
|
+
headerRef: (0, import_react27.createRef)(),
|
|
4052
|
+
tableColRef: (0, import_react27.createRef)()
|
|
3985
4053
|
}
|
|
3986
|
-
|
|
3987
|
-
{}
|
|
4054
|
+
])
|
|
3988
4055
|
),
|
|
3989
|
-
[visibleColumns]
|
|
4056
|
+
[visibleColumns, columnIds]
|
|
3990
4057
|
);
|
|
3991
|
-
const sortComparator = (0,
|
|
4058
|
+
const sortComparator = (0, import_react27.useCallback)(
|
|
3992
4059
|
(rowA, rowB) => {
|
|
3993
4060
|
for (const sort of sortModel) {
|
|
3994
4061
|
const { field, sort: direction } = sort;
|
|
@@ -4017,33 +4084,33 @@ function useDataTableRenderer({
|
|
|
4017
4084
|
},
|
|
4018
4085
|
[sortModel, allColumnsByField]
|
|
4019
4086
|
);
|
|
4020
|
-
const rows = (0,
|
|
4087
|
+
const rows = (0, import_react27.useMemo)(
|
|
4021
4088
|
() => sortModel.length ? [..._rows].sort(sortComparator) : _rows,
|
|
4022
4089
|
[_rows, sortModel, sortComparator]
|
|
4023
4090
|
);
|
|
4024
|
-
const sortOrder = (0,
|
|
4091
|
+
const sortOrder = (0, import_react27.useMemo)(
|
|
4025
4092
|
() => Array.from(new Set(_sortOrder || ["asc", "desc", null])),
|
|
4026
4093
|
[_sortOrder]
|
|
4027
4094
|
);
|
|
4028
|
-
const [page, setPage] = (0,
|
|
4095
|
+
const [page, setPage] = (0, import_react27.useState)(paginationModel?.page || 1);
|
|
4029
4096
|
const pageSize = paginationModel?.pageSize || 20;
|
|
4030
|
-
const getId = (0,
|
|
4097
|
+
const getId = (0, import_react27.useCallback)(
|
|
4031
4098
|
(row, index) => _getId?.(row) ?? row.id ?? `${(index || 0) + (page - 1) * pageSize}`,
|
|
4032
4099
|
[_getId, page, pageSize]
|
|
4033
4100
|
);
|
|
4034
|
-
const selectedModelSet = (0,
|
|
4035
|
-
const dataInPage = (0,
|
|
4101
|
+
const selectedModelSet = (0, import_react27.useMemo)(() => new Set(selectionModel || []), [selectionModel]);
|
|
4102
|
+
const dataInPage = (0, import_react27.useMemo)(
|
|
4036
4103
|
() => !pagination || paginationMode === "server" ? rows : rows.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize),
|
|
4037
4104
|
[rows, page, pageSize, paginationMode, pagination]
|
|
4038
4105
|
);
|
|
4039
|
-
const selectableDataInPage = (0,
|
|
4106
|
+
const selectableDataInPage = (0, import_react27.useMemo)(
|
|
4040
4107
|
() => dataInPage.filter((row, i) => {
|
|
4041
4108
|
if (!isRowSelectable) return true;
|
|
4042
4109
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
4043
4110
|
}),
|
|
4044
4111
|
[dataInPage, isRowSelectable, getId]
|
|
4045
4112
|
);
|
|
4046
|
-
const handleRangeSelection = (0,
|
|
4113
|
+
const handleRangeSelection = (0, import_react27.useCallback)(
|
|
4047
4114
|
(anchor, targetIndex) => {
|
|
4048
4115
|
const startIndex = Math.min(anchor.rowIndex, targetIndex);
|
|
4049
4116
|
const endIndex = Math.max(anchor.rowIndex, targetIndex);
|
|
@@ -4066,51 +4133,60 @@ function useDataTableRenderer({
|
|
|
4066
4133
|
},
|
|
4067
4134
|
[dataInPage, getId, isRowSelectable, selectionModel, onSelectionModelChange]
|
|
4068
4135
|
);
|
|
4069
|
-
const isAllSelected = (0,
|
|
4136
|
+
const isAllSelected = (0, import_react27.useMemo)(
|
|
4070
4137
|
() => selectableDataInPage.length > 0 && selectableDataInPage.every((row, i) => selectedModelSet.has(getId(row, i))),
|
|
4071
4138
|
[selectableDataInPage, selectedModelSet, getId]
|
|
4072
4139
|
);
|
|
4073
4140
|
const rowCount = totalRowsProp || rows.length;
|
|
4074
|
-
const selectableRowCount = (0,
|
|
4141
|
+
const selectableRowCount = (0, import_react27.useMemo)(() => {
|
|
4075
4142
|
if (!isRowSelectable) return rowCount;
|
|
4076
4143
|
return rows.filter((row, i) => isRowSelectable({ row, id: getId(row, i) })).length;
|
|
4077
4144
|
}, [rows, isRowSelectable, getId, rowCount]);
|
|
4078
|
-
const isTotalSelected = (0,
|
|
4145
|
+
const isTotalSelected = (0, import_react27.useMemo)(
|
|
4079
4146
|
() => _isTotalSelected ?? (selectableRowCount > 0 && (selectionModel?.length || 0) === selectableRowCount),
|
|
4080
4147
|
[_isTotalSelected, selectionModel, selectableRowCount]
|
|
4081
4148
|
);
|
|
4082
|
-
const columnWidths = useColumnWidths(
|
|
4083
|
-
const
|
|
4084
|
-
(
|
|
4085
|
-
|
|
4086
|
-
|
|
4149
|
+
const columnWidths = useColumnWidths(visibleColumnsById);
|
|
4150
|
+
const measuredWidthByField = (0, import_react27.useMemo)(
|
|
4151
|
+
() => Object.fromEntries(
|
|
4152
|
+
Object.entries(visibleColumnsById).map(([columnId, column]) => [column.field, columnWidths[columnId]])
|
|
4153
|
+
),
|
|
4154
|
+
[visibleColumnsById, columnWidths]
|
|
4087
4155
|
);
|
|
4088
|
-
const
|
|
4156
|
+
const getWidth = (0, import_react27.useCallback)(
|
|
4157
|
+
// 반환값은 pinned offset으로 더해지므로 반드시 숫자여야 한다. width/minWidth는 '500px' 같은 문자열.
|
|
4158
|
+
(f) => measuredWidthByField[f] ?? parsePxValue(allColumnsByField[f]?.width) ?? // Column prop 으로 지정된 width
|
|
4159
|
+
parsePxValue(allColumnsByField[f]?.minWidth) ?? 0,
|
|
4160
|
+
[measuredWidthByField, allColumnsByField]
|
|
4161
|
+
);
|
|
4162
|
+
const processedColumnGroups = (0, import_react27.useMemo)(() => {
|
|
4089
4163
|
if (!columnGroupingModel) return null;
|
|
4090
4164
|
return calculateColumnGroups(columnGroupingModel, visibleColumns, visibleFieldSet);
|
|
4091
4165
|
}, [columnGroupingModel, visibleColumns, visibleFieldSet]);
|
|
4092
|
-
const effectivePinnedLeft = (0,
|
|
4166
|
+
const effectivePinnedLeft = (0, import_react27.useMemo)(
|
|
4093
4167
|
() => pinnedColumns?.left?.filter((f) => visibleFieldSet.has(f)),
|
|
4094
4168
|
[pinnedColumns?.left, visibleFieldSet]
|
|
4095
4169
|
);
|
|
4096
|
-
const effectivePinnedRight = (0,
|
|
4170
|
+
const effectivePinnedRight = (0, import_react27.useMemo)(
|
|
4097
4171
|
() => pinnedColumns?.right?.filter((f) => visibleFieldSet.has(f)),
|
|
4098
4172
|
[pinnedColumns?.right, visibleFieldSet]
|
|
4099
4173
|
);
|
|
4100
4174
|
const inferredFieldsKey = JSON.stringify(Object.keys(rows[0] || {}));
|
|
4101
|
-
const inferredFields = (0,
|
|
4102
|
-
const columns = (0,
|
|
4175
|
+
const inferredFields = (0, import_react27.useMemo)(() => JSON.parse(inferredFieldsKey), [inferredFieldsKey]);
|
|
4176
|
+
const columns = (0, import_react27.useMemo)(() => {
|
|
4103
4177
|
const baseColumns = visibleColumns.length > 0 ? visibleColumns : reorderedColumns.length > 0 ? [] : inferredFields.map((key) => ({
|
|
4104
4178
|
field: key
|
|
4105
4179
|
}));
|
|
4106
|
-
return baseColumns.map((column) => {
|
|
4180
|
+
return baseColumns.map((column, index) => {
|
|
4181
|
+
const columnId = columnIds[index] ?? String(column.field);
|
|
4107
4182
|
const isLeftPinned = effectivePinnedLeft?.includes(column.field);
|
|
4108
4183
|
const isRightPinned = effectivePinnedRight?.includes(column.field);
|
|
4109
4184
|
const isPinned = isLeftPinned || isRightPinned;
|
|
4110
4185
|
return {
|
|
4111
4186
|
...column,
|
|
4112
|
-
|
|
4113
|
-
|
|
4187
|
+
columnId,
|
|
4188
|
+
headerRef: visibleColumnsById[columnId]?.headerRef,
|
|
4189
|
+
tableColRef: visibleColumnsById[columnId]?.tableColRef,
|
|
4114
4190
|
isCellEditable: editMode && (typeof column.isCellEditable === "function" ? column.isCellEditable : column.isCellEditable ?? true),
|
|
4115
4191
|
sort: sortModel.find((sort) => sort.field === column.field)?.sort,
|
|
4116
4192
|
sortOrder: allColumnsByField[column.field]?.sortOrder || sortOrder,
|
|
@@ -4127,21 +4203,22 @@ function useDataTableRenderer({
|
|
|
4127
4203
|
inferredFields,
|
|
4128
4204
|
effectivePinnedLeft,
|
|
4129
4205
|
effectivePinnedRight,
|
|
4130
|
-
|
|
4206
|
+
columnIds,
|
|
4207
|
+
visibleColumnsById,
|
|
4131
4208
|
allColumnsByField,
|
|
4132
4209
|
editMode,
|
|
4133
4210
|
sortModel,
|
|
4134
4211
|
sortOrder,
|
|
4135
4212
|
getWidth
|
|
4136
4213
|
]);
|
|
4137
|
-
const handlePageChange = (0,
|
|
4214
|
+
const handlePageChange = (0, import_react27.useCallback)(
|
|
4138
4215
|
(newPage) => {
|
|
4139
4216
|
setPage(newPage);
|
|
4140
4217
|
onPaginationModelChange?.({ page: newPage, pageSize });
|
|
4141
4218
|
},
|
|
4142
4219
|
[onPaginationModelChange, pageSize]
|
|
4143
4220
|
);
|
|
4144
|
-
const handleSortChange = (0,
|
|
4221
|
+
const handleSortChange = (0, import_react27.useCallback)(
|
|
4145
4222
|
(props) => {
|
|
4146
4223
|
const { field, currentSort, multiple } = props;
|
|
4147
4224
|
const column = allColumnsByField[field];
|
|
@@ -4164,38 +4241,37 @@ function useDataTableRenderer({
|
|
|
4164
4241
|
},
|
|
4165
4242
|
[sortOrder, allColumnsByField, sortModel, setSortModel]
|
|
4166
4243
|
);
|
|
4167
|
-
(0,
|
|
4244
|
+
(0, import_react27.useEffect)(() => {
|
|
4168
4245
|
if (!paginationModel) {
|
|
4169
4246
|
handlePageChange(1);
|
|
4170
4247
|
}
|
|
4171
4248
|
}, [rowCount, handlePageChange, paginationModel]);
|
|
4172
|
-
(0,
|
|
4249
|
+
(0, import_react27.useEffect)(() => {
|
|
4173
4250
|
const lastPage = Math.max(1, Math.ceil(rowCount / pageSize));
|
|
4174
4251
|
if (page > lastPage) {
|
|
4175
4252
|
handlePageChange(lastPage);
|
|
4176
4253
|
}
|
|
4177
4254
|
}, [page, rowCount, pageSize, handlePageChange]);
|
|
4178
|
-
(0,
|
|
4255
|
+
(0, import_react27.useEffect)(() => {
|
|
4179
4256
|
onSelectionModelChangeRef.current?.([]);
|
|
4180
4257
|
setSelectionAnchor(null);
|
|
4181
4258
|
}, [page]);
|
|
4182
|
-
const prevRowsRef = (0,
|
|
4183
|
-
(0,
|
|
4259
|
+
const prevRowsRef = (0, import_react27.useRef)(_rows);
|
|
4260
|
+
(0, import_react27.useEffect)(() => {
|
|
4184
4261
|
if (prevRowsRef.current !== _rows) {
|
|
4185
4262
|
setSelectionAnchor(null);
|
|
4186
4263
|
prevRowsRef.current = _rows;
|
|
4187
4264
|
}
|
|
4188
4265
|
}, [_rows]);
|
|
4189
|
-
const handleAutoFit = (0,
|
|
4190
|
-
(
|
|
4191
|
-
const colDef =
|
|
4266
|
+
const handleAutoFit = (0, import_react27.useCallback)(
|
|
4267
|
+
(columnId) => {
|
|
4268
|
+
const colDef = visibleColumnsById[columnId];
|
|
4192
4269
|
if (!colDef?.headerRef.current) return;
|
|
4193
|
-
const
|
|
4194
|
-
const columnType = column && "type" in column ? column.type : void 0;
|
|
4270
|
+
const columnType = "type" in colDef ? colDef.type : void 0;
|
|
4195
4271
|
if (columnType === "actions") return;
|
|
4196
4272
|
const optimalWidth = computeAutoFitWidth({
|
|
4197
4273
|
headerEl: colDef.headerRef.current,
|
|
4198
|
-
field,
|
|
4274
|
+
field: colDef.field,
|
|
4199
4275
|
dataInPage
|
|
4200
4276
|
});
|
|
4201
4277
|
if (optimalWidth == null) return;
|
|
@@ -4203,7 +4279,7 @@ function useDataTableRenderer({
|
|
|
4203
4279
|
colDef.headerRef.current.style.width = widthPx;
|
|
4204
4280
|
if (colDef.tableColRef.current) colDef.tableColRef.current.style.width = widthPx;
|
|
4205
4281
|
},
|
|
4206
|
-
[
|
|
4282
|
+
[visibleColumnsById, dataInPage]
|
|
4207
4283
|
);
|
|
4208
4284
|
return {
|
|
4209
4285
|
rowCount,
|
|
@@ -4219,8 +4295,8 @@ function useDataTableRenderer({
|
|
|
4219
4295
|
handleAutoFit,
|
|
4220
4296
|
isAllSelected,
|
|
4221
4297
|
isTotalSelected,
|
|
4222
|
-
isSelectedRow: (0,
|
|
4223
|
-
isRowSelectable: (0,
|
|
4298
|
+
isSelectedRow: (0, import_react27.useCallback)((model) => selectedModelSet.has(model), [selectedModelSet]),
|
|
4299
|
+
isRowSelectable: (0, import_react27.useCallback)(
|
|
4224
4300
|
(rowId, row) => {
|
|
4225
4301
|
if (!isRowSelectable) return true;
|
|
4226
4302
|
return isRowSelectable({ row, id: rowId });
|
|
@@ -4228,13 +4304,13 @@ function useDataTableRenderer({
|
|
|
4228
4304
|
[isRowSelectable]
|
|
4229
4305
|
),
|
|
4230
4306
|
focusedRowId,
|
|
4231
|
-
onRowFocus: (0,
|
|
4307
|
+
onRowFocus: (0, import_react27.useCallback)((rowId) => {
|
|
4232
4308
|
setFocusedRowId(rowId);
|
|
4233
4309
|
}, []),
|
|
4234
|
-
onAllCheckboxChange: (0,
|
|
4310
|
+
onAllCheckboxChange: (0, import_react27.useCallback)(() => {
|
|
4235
4311
|
onSelectionModelChange?.(isAllSelected ? [] : selectableDataInPage.map(getId));
|
|
4236
4312
|
}, [isAllSelected, selectableDataInPage, onSelectionModelChange, getId]),
|
|
4237
|
-
onCheckboxChange: (0,
|
|
4313
|
+
onCheckboxChange: (0, import_react27.useCallback)(
|
|
4238
4314
|
(event, selectedModel) => {
|
|
4239
4315
|
const isShiftClick = "shiftKey" in event && event.shiftKey;
|
|
4240
4316
|
const rowIndex = dataInPage.findIndex((row, i) => getId(row, i) === selectedModel);
|
|
@@ -4268,7 +4344,7 @@ function useDataTableRenderer({
|
|
|
4268
4344
|
columns,
|
|
4269
4345
|
tableMinWidth,
|
|
4270
4346
|
processedColumnGroups,
|
|
4271
|
-
onTotalSelect: (0,
|
|
4347
|
+
onTotalSelect: (0, import_react27.useCallback)(() => {
|
|
4272
4348
|
const selectableRows = rows.filter((row, i) => {
|
|
4273
4349
|
if (!isRowSelectable) return true;
|
|
4274
4350
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
@@ -4282,11 +4358,11 @@ function useDataTableRenderer({
|
|
|
4282
4358
|
}
|
|
4283
4359
|
|
|
4284
4360
|
// src/components/Table/Table.tsx
|
|
4285
|
-
var
|
|
4361
|
+
var import_react28 = __toESM(require("react"));
|
|
4286
4362
|
var import_joy35 = require("@mui/joy");
|
|
4287
4363
|
var Table = (props) => {
|
|
4288
4364
|
const { children, ...inheritProps } = props;
|
|
4289
|
-
return /* @__PURE__ */
|
|
4365
|
+
return /* @__PURE__ */ import_react28.default.createElement(import_joy35.Table, { ...inheritProps }, children);
|
|
4290
4366
|
};
|
|
4291
4367
|
Table.displayName = "Table";
|
|
4292
4368
|
function TableHead(props) {
|
|
@@ -4297,7 +4373,7 @@ function TableHead(props) {
|
|
|
4297
4373
|
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
4298
4374
|
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
4299
4375
|
} = props;
|
|
4300
|
-
return /* @__PURE__ */
|
|
4376
|
+
return /* @__PURE__ */ import_react28.default.createElement("thead", null, /* @__PURE__ */ import_react28.default.createElement("tr", null, showCheckbox && /* @__PURE__ */ import_react28.default.createElement(
|
|
4301
4377
|
"th",
|
|
4302
4378
|
{
|
|
4303
4379
|
style: {
|
|
@@ -4305,8 +4381,8 @@ function TableHead(props) {
|
|
|
4305
4381
|
textAlign: "center"
|
|
4306
4382
|
}
|
|
4307
4383
|
},
|
|
4308
|
-
/* @__PURE__ */
|
|
4309
|
-
), headCells.map((headCell) => /* @__PURE__ */
|
|
4384
|
+
/* @__PURE__ */ import_react28.default.createElement(RenderCheckbox, { onChange: onCheckboxChange, ...checkboxProps })
|
|
4385
|
+
), headCells.map((headCell) => /* @__PURE__ */ import_react28.default.createElement(
|
|
4310
4386
|
"th",
|
|
4311
4387
|
{
|
|
4312
4388
|
key: headCell.label,
|
|
@@ -4331,15 +4407,15 @@ function TableBody(props) {
|
|
|
4331
4407
|
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
4332
4408
|
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
4333
4409
|
} = props;
|
|
4334
|
-
return /* @__PURE__ */
|
|
4410
|
+
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
4411
|
"td",
|
|
4336
4412
|
{
|
|
4337
4413
|
style: {
|
|
4338
4414
|
textAlign: "center"
|
|
4339
4415
|
}
|
|
4340
4416
|
},
|
|
4341
|
-
/* @__PURE__ */
|
|
4342
|
-
), cellOrder.map((cellKey) => /* @__PURE__ */
|
|
4417
|
+
/* @__PURE__ */ import_react28.default.createElement(RenderCheckbox, { onChange: (event) => onCheckboxChange?.(event, rowIndex), ...checkboxProps })
|
|
4418
|
+
), cellOrder.map((cellKey) => /* @__PURE__ */ import_react28.default.createElement(
|
|
4343
4419
|
"td",
|
|
4344
4420
|
{
|
|
4345
4421
|
key: cellKey,
|
|
@@ -4353,7 +4429,7 @@ function TableBody(props) {
|
|
|
4353
4429
|
TableBody.displayName = "TableBody";
|
|
4354
4430
|
|
|
4355
4431
|
// src/components/Pagination/Pagination.tsx
|
|
4356
|
-
var
|
|
4432
|
+
var import_react29 = __toESM(require("react"));
|
|
4357
4433
|
var import_ChevronLeftRounded = __toESM(require("@mui/icons-material/ChevronLeftRounded"));
|
|
4358
4434
|
var import_ChevronRightRounded = __toESM(require("@mui/icons-material/ChevronRightRounded"));
|
|
4359
4435
|
var import_FirstPageRounded = __toESM(require("@mui/icons-material/FirstPageRounded"));
|
|
@@ -4423,7 +4499,7 @@ function Pagination(inProps) {
|
|
|
4423
4499
|
const [paginationModel, setPaginationModel] = useControlledState(
|
|
4424
4500
|
_paginationModel,
|
|
4425
4501
|
defaultPaginationModel,
|
|
4426
|
-
(0,
|
|
4502
|
+
(0, import_react29.useCallback)(
|
|
4427
4503
|
(newPage) => {
|
|
4428
4504
|
onPageChange(newPage.page);
|
|
4429
4505
|
},
|
|
@@ -4439,7 +4515,7 @@ function Pagination(inProps) {
|
|
|
4439
4515
|
const afterPages = [paginationModel.page + 1, paginationModel.page + 2].filter((p) => p <= lastPage - 1);
|
|
4440
4516
|
const isMoreAfterPages = lastPage > 1 && paginationModel.page < lastPage - 3;
|
|
4441
4517
|
const isMoreBeforePages = lastPage > 1 && paginationModel.page > 4;
|
|
4442
|
-
(0,
|
|
4518
|
+
(0, import_react29.useEffect)(() => {
|
|
4443
4519
|
if (paginationModel.page > lastPage) {
|
|
4444
4520
|
setPaginationModel({ ...paginationModel, page: lastPage });
|
|
4445
4521
|
}
|
|
@@ -4449,7 +4525,7 @@ function Pagination(inProps) {
|
|
|
4449
4525
|
value: `${i + 1}`
|
|
4450
4526
|
}));
|
|
4451
4527
|
if (variant === "compact") {
|
|
4452
|
-
return /* @__PURE__ */
|
|
4528
|
+
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
4529
|
PaginationIconButton,
|
|
4454
4530
|
{
|
|
4455
4531
|
size,
|
|
@@ -4459,8 +4535,8 @@ function Pagination(inProps) {
|
|
|
4459
4535
|
disabled: paginationModel.page === firstPage,
|
|
4460
4536
|
"aria-label": "First page"
|
|
4461
4537
|
},
|
|
4462
|
-
/* @__PURE__ */
|
|
4463
|
-
), /* @__PURE__ */
|
|
4538
|
+
/* @__PURE__ */ import_react29.default.createElement(import_FirstPageRounded.default, null)
|
|
4539
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
4464
4540
|
PaginationIconButton,
|
|
4465
4541
|
{
|
|
4466
4542
|
size,
|
|
@@ -4470,8 +4546,8 @@ function Pagination(inProps) {
|
|
|
4470
4546
|
disabled: paginationModel.page === firstPage,
|
|
4471
4547
|
"aria-label": "Previous page"
|
|
4472
4548
|
},
|
|
4473
|
-
/* @__PURE__ */
|
|
4474
|
-
)), /* @__PURE__ */
|
|
4549
|
+
/* @__PURE__ */ import_react29.default.createElement(import_ChevronLeftRounded.default, null)
|
|
4550
|
+
)), /* @__PURE__ */ import_react29.default.createElement(
|
|
4475
4551
|
Autocomplete_default,
|
|
4476
4552
|
{
|
|
4477
4553
|
size,
|
|
@@ -4490,7 +4566,7 @@ function Pagination(inProps) {
|
|
|
4490
4566
|
}[size]
|
|
4491
4567
|
}
|
|
4492
4568
|
}
|
|
4493
|
-
), /* @__PURE__ */
|
|
4569
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
4494
4570
|
Typography_default,
|
|
4495
4571
|
{
|
|
4496
4572
|
level: `body-${size}`,
|
|
@@ -4501,7 +4577,7 @@ function Pagination(inProps) {
|
|
|
4501
4577
|
},
|
|
4502
4578
|
"/ ",
|
|
4503
4579
|
lastPage
|
|
4504
|
-
), /* @__PURE__ */
|
|
4580
|
+
), /* @__PURE__ */ import_react29.default.createElement(Stack_default, { direction: "row" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
4505
4581
|
PaginationIconButton,
|
|
4506
4582
|
{
|
|
4507
4583
|
size,
|
|
@@ -4511,8 +4587,8 @@ function Pagination(inProps) {
|
|
|
4511
4587
|
disabled: paginationModel.page === lastPage,
|
|
4512
4588
|
"aria-label": "Next page"
|
|
4513
4589
|
},
|
|
4514
|
-
/* @__PURE__ */
|
|
4515
|
-
), /* @__PURE__ */
|
|
4590
|
+
/* @__PURE__ */ import_react29.default.createElement(import_ChevronRightRounded.default, null)
|
|
4591
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
4516
4592
|
PaginationIconButton,
|
|
4517
4593
|
{
|
|
4518
4594
|
size,
|
|
@@ -4522,10 +4598,10 @@ function Pagination(inProps) {
|
|
|
4522
4598
|
disabled: paginationModel.page === lastPage,
|
|
4523
4599
|
"aria-label": "Last page"
|
|
4524
4600
|
},
|
|
4525
|
-
/* @__PURE__ */
|
|
4601
|
+
/* @__PURE__ */ import_react29.default.createElement(import_LastPageRounded.default, null)
|
|
4526
4602
|
))));
|
|
4527
4603
|
}
|
|
4528
|
-
return /* @__PURE__ */
|
|
4604
|
+
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
4605
|
PaginationIconButton,
|
|
4530
4606
|
{
|
|
4531
4607
|
size,
|
|
@@ -4535,8 +4611,8 @@ function Pagination(inProps) {
|
|
|
4535
4611
|
disabled: paginationModel.page === firstPage,
|
|
4536
4612
|
"aria-label": "Previous page"
|
|
4537
4613
|
},
|
|
4538
|
-
/* @__PURE__ */
|
|
4539
|
-
), paginationModel.page !== firstPage && /* @__PURE__ */
|
|
4614
|
+
/* @__PURE__ */ import_react29.default.createElement(import_ChevronLeftRounded.default, null)
|
|
4615
|
+
), 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
4616
|
PaginationButton,
|
|
4541
4617
|
{
|
|
4542
4618
|
size,
|
|
@@ -4546,7 +4622,7 @@ function Pagination(inProps) {
|
|
|
4546
4622
|
"aria-label": "More previous pages"
|
|
4547
4623
|
},
|
|
4548
4624
|
"..."
|
|
4549
|
-
), beforePages.map((p) => /* @__PURE__ */
|
|
4625
|
+
), 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
4626
|
PaginationButton,
|
|
4551
4627
|
{
|
|
4552
4628
|
size,
|
|
@@ -4556,7 +4632,7 @@ function Pagination(inProps) {
|
|
|
4556
4632
|
onClick: () => handlePageChange(paginationModel.page + 3)
|
|
4557
4633
|
},
|
|
4558
4634
|
"..."
|
|
4559
|
-
), paginationModel.page !== lastPage && /* @__PURE__ */
|
|
4635
|
+
), paginationModel.page !== lastPage && /* @__PURE__ */ import_react29.default.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(lastPage) }, lastPage), /* @__PURE__ */ import_react29.default.createElement(
|
|
4560
4636
|
PaginationIconButton,
|
|
4561
4637
|
{
|
|
4562
4638
|
size,
|
|
@@ -4566,7 +4642,7 @@ function Pagination(inProps) {
|
|
|
4566
4642
|
disabled: paginationModel.page === lastPage,
|
|
4567
4643
|
"aria-label": "Next page"
|
|
4568
4644
|
},
|
|
4569
|
-
/* @__PURE__ */
|
|
4645
|
+
/* @__PURE__ */ import_react29.default.createElement(import_ChevronRightRounded.default, null)
|
|
4570
4646
|
)));
|
|
4571
4647
|
}
|
|
4572
4648
|
Pagination.displayName = "Pagination";
|
|
@@ -4640,9 +4716,9 @@ function Component(props, apiRef) {
|
|
|
4640
4716
|
isTotalSelected: ___________,
|
|
4641
4717
|
...innerProps
|
|
4642
4718
|
} = props;
|
|
4643
|
-
const tableId = (0,
|
|
4644
|
-
const parentRef = (0,
|
|
4645
|
-
const tableBodyRef = (0,
|
|
4719
|
+
const tableId = (0, import_react30.useId)();
|
|
4720
|
+
const parentRef = (0, import_react30.useRef)(null);
|
|
4721
|
+
const tableBodyRef = (0, import_react30.useRef)(null);
|
|
4646
4722
|
const {
|
|
4647
4723
|
columns,
|
|
4648
4724
|
processedColumnGroups,
|
|
@@ -4678,10 +4754,10 @@ function Component(props, apiRef) {
|
|
|
4678
4754
|
measureElement: (element) => element.clientHeight,
|
|
4679
4755
|
overscan: 10
|
|
4680
4756
|
});
|
|
4681
|
-
const paginationModel = (0,
|
|
4757
|
+
const paginationModel = (0, import_react30.useMemo)(() => ({ page, pageSize }), [page, pageSize]);
|
|
4682
4758
|
const columnsKey = getObjectVersion(columns);
|
|
4683
|
-
const headerCheckboxElement = (0,
|
|
4684
|
-
() => /* @__PURE__ */
|
|
4759
|
+
const headerCheckboxElement = (0, import_react30.useMemo)(
|
|
4760
|
+
() => /* @__PURE__ */ import_react30.default.createElement(
|
|
4685
4761
|
RenderCheckbox,
|
|
4686
4762
|
{
|
|
4687
4763
|
onChange: onAllCheckboxChange,
|
|
@@ -4706,20 +4782,20 @@ function Component(props, apiRef) {
|
|
|
4706
4782
|
const showNoRowsOverlay = !loading && rowCount === 0;
|
|
4707
4783
|
const showFillerColumn = columns.length > 0 && columns.every((c) => !!c.width);
|
|
4708
4784
|
const totalColCount = Math.max(1, columns.length + (checkboxSelection ? 1 : 0) + (showFillerColumn ? 1 : 0));
|
|
4709
|
-
const getRowClickHandler = (0,
|
|
4785
|
+
const getRowClickHandler = (0, import_react30.useCallback)(
|
|
4710
4786
|
(row, rowId) => (e) => {
|
|
4711
4787
|
onRowClick?.({ row, rowId }, e);
|
|
4712
4788
|
checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
|
|
4713
4789
|
},
|
|
4714
4790
|
[onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
|
|
4715
4791
|
);
|
|
4716
|
-
const getRowFocusHandler = (0,
|
|
4792
|
+
const getRowFocusHandler = (0, import_react30.useCallback)(
|
|
4717
4793
|
(rowId) => () => {
|
|
4718
4794
|
onRowFocus(rowId);
|
|
4719
4795
|
},
|
|
4720
4796
|
[onRowFocus]
|
|
4721
4797
|
);
|
|
4722
|
-
const getCheckboxClickHandler = (0,
|
|
4798
|
+
const getCheckboxClickHandler = (0, import_react30.useCallback)(
|
|
4723
4799
|
(rowId, row) => (e) => {
|
|
4724
4800
|
e.stopPropagation();
|
|
4725
4801
|
if (isRowSelectableCheck(rowId, row)) {
|
|
@@ -4729,7 +4805,7 @@ function Component(props, apiRef) {
|
|
|
4729
4805
|
},
|
|
4730
4806
|
[onCheckboxChange, isRowSelectableCheck, onRowFocus]
|
|
4731
4807
|
);
|
|
4732
|
-
const handleTableKeyDown = (0,
|
|
4808
|
+
const handleTableKeyDown = (0, import_react30.useCallback)(
|
|
4733
4809
|
(e) => {
|
|
4734
4810
|
const supportedKeys = ["ArrowUp", "ArrowDown", " ", "Home", "End", "PageUp", "PageDown"];
|
|
4735
4811
|
if (!supportedKeys.includes(e.key)) return;
|
|
@@ -4819,7 +4895,7 @@ function Component(props, apiRef) {
|
|
|
4819
4895
|
virtualizer
|
|
4820
4896
|
]
|
|
4821
4897
|
);
|
|
4822
|
-
(0,
|
|
4898
|
+
(0, import_react30.useImperativeHandle)(apiRef, () => ({
|
|
4823
4899
|
getRowIndexRelativeToVisibleRows(rowId) {
|
|
4824
4900
|
return dataInPage.findIndex((row) => String(getId(row)) === rowId);
|
|
4825
4901
|
},
|
|
@@ -4835,7 +4911,7 @@ function Component(props, apiRef) {
|
|
|
4835
4911
|
});
|
|
4836
4912
|
}
|
|
4837
4913
|
}));
|
|
4838
|
-
return /* @__PURE__ */
|
|
4914
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
4839
4915
|
Box_default,
|
|
4840
4916
|
{
|
|
4841
4917
|
sx: {
|
|
@@ -4845,7 +4921,7 @@ function Component(props, apiRef) {
|
|
|
4845
4921
|
flexDirection: "column"
|
|
4846
4922
|
}
|
|
4847
4923
|
},
|
|
4848
|
-
(!!checkboxSelection || !!Toolbar) && /* @__PURE__ */
|
|
4924
|
+
(!!checkboxSelection || !!Toolbar) && /* @__PURE__ */ import_react30.default.createElement(
|
|
4849
4925
|
Stack_default,
|
|
4850
4926
|
{
|
|
4851
4927
|
direction: "row",
|
|
@@ -4855,10 +4931,10 @@ function Component(props, apiRef) {
|
|
|
4855
4931
|
justifyContent: "space-between",
|
|
4856
4932
|
alignItems: "center"
|
|
4857
4933
|
},
|
|
4858
|
-
!!checkboxSelection && /* @__PURE__ */
|
|
4859
|
-
Toolbar && /* @__PURE__ */
|
|
4934
|
+
!!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"))),
|
|
4935
|
+
Toolbar && /* @__PURE__ */ import_react30.default.createElement(Toolbar, { ...toolbarProps || {} })
|
|
4860
4936
|
),
|
|
4861
|
-
/* @__PURE__ */
|
|
4937
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
4862
4938
|
Sheet_default,
|
|
4863
4939
|
{
|
|
4864
4940
|
variant: "outlined",
|
|
@@ -4879,24 +4955,24 @@ function Component(props, apiRef) {
|
|
|
4879
4955
|
ref: parentRef,
|
|
4880
4956
|
...backgroundProps
|
|
4881
4957
|
},
|
|
4882
|
-
/* @__PURE__ */
|
|
4958
|
+
/* @__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
4959
|
"col",
|
|
4884
4960
|
{
|
|
4885
4961
|
style: {
|
|
4886
4962
|
width: "40px"
|
|
4887
4963
|
}
|
|
4888
4964
|
}
|
|
4889
|
-
), columns.map((c) => /* @__PURE__ */
|
|
4965
|
+
), columns.map((c) => /* @__PURE__ */ import_react30.default.createElement(
|
|
4890
4966
|
"col",
|
|
4891
4967
|
{
|
|
4892
4968
|
ref: c.tableColRef,
|
|
4893
|
-
key:
|
|
4969
|
+
key: c.columnId,
|
|
4894
4970
|
style: {
|
|
4895
4971
|
width: c.width,
|
|
4896
4972
|
minWidth: c.minWidth ?? "50px"
|
|
4897
4973
|
}
|
|
4898
4974
|
}
|
|
4899
|
-
)), showFillerColumn && /* @__PURE__ */
|
|
4975
|
+
)), 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
4976
|
"th",
|
|
4901
4977
|
{
|
|
4902
4978
|
rowSpan: processedColumnGroups.maxLevel + 2,
|
|
@@ -4907,12 +4983,12 @@ function Component(props, apiRef) {
|
|
|
4907
4983
|
}
|
|
4908
4984
|
},
|
|
4909
4985
|
headerCheckboxElement
|
|
4910
|
-
), level > 0 && Array.from({ length: levelGroups[0]?.startIndex || 0 }).map((_2, i) => /* @__PURE__ */
|
|
4986
|
+
), 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
4987
|
const nextGroup = levelGroups[groupIndex + 1];
|
|
4912
4988
|
const emptyCells = nextGroup ? nextGroup.startIndex - (group.startIndex + group.colspan) : columns.length - (group.startIndex + group.colspan);
|
|
4913
4989
|
const params = { groupId: group.groupId };
|
|
4914
4990
|
const computedHeaderClassName = group.headerClassName ? typeof group.headerClassName === "function" ? group.headerClassName(params) : group.headerClassName : void 0;
|
|
4915
|
-
return /* @__PURE__ */
|
|
4991
|
+
return /* @__PURE__ */ import_react30.default.createElement(import_react30.Fragment, { key: group.groupId }, /* @__PURE__ */ import_react30.default.createElement(
|
|
4916
4992
|
"th",
|
|
4917
4993
|
{
|
|
4918
4994
|
colSpan: group.colspan,
|
|
@@ -4924,14 +5000,14 @@ function Component(props, apiRef) {
|
|
|
4924
5000
|
className: computedHeaderClassName
|
|
4925
5001
|
},
|
|
4926
5002
|
group.headerName ?? group.groupId
|
|
4927
|
-
), emptyCells > 0 && Array.from({ length: emptyCells }).map((_2, i) => /* @__PURE__ */
|
|
4928
|
-
}), showFillerColumn && level === 0 && /* @__PURE__ */
|
|
5003
|
+
), emptyCells > 0 && Array.from({ length: emptyCells }).map((_2, i) => /* @__PURE__ */ import_react30.default.createElement("th", { key: `empty-between-${level}-${groupIndex}-${i}`, colSpan: 1 })));
|
|
5004
|
+
}), showFillerColumn && level === 0 && /* @__PURE__ */ import_react30.default.createElement(
|
|
4929
5005
|
"th",
|
|
4930
5006
|
{
|
|
4931
5007
|
"aria-hidden": "true",
|
|
4932
5008
|
rowSpan: processedColumnGroups.maxLevel + 2
|
|
4933
5009
|
}
|
|
4934
|
-
))), /* @__PURE__ */
|
|
5010
|
+
))), /* @__PURE__ */ import_react30.default.createElement("tr", null, (!processedColumnGroups || processedColumnGroups.groups.length === 0) && checkboxSelection && /* @__PURE__ */ import_react30.default.createElement(
|
|
4935
5011
|
"th",
|
|
4936
5012
|
{
|
|
4937
5013
|
style: {
|
|
@@ -4942,7 +5018,7 @@ function Component(props, apiRef) {
|
|
|
4942
5018
|
headerCheckboxElement
|
|
4943
5019
|
), columns.map((c, i) => (
|
|
4944
5020
|
// @ts-ignore
|
|
4945
|
-
/* @__PURE__ */
|
|
5021
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
4946
5022
|
HeadCell2,
|
|
4947
5023
|
{
|
|
4948
5024
|
tableId,
|
|
@@ -4954,7 +5030,7 @@ function Component(props, apiRef) {
|
|
|
4954
5030
|
...c
|
|
4955
5031
|
}
|
|
4956
5032
|
)
|
|
4957
|
-
)), showFillerColumn && (!processedColumnGroups || processedColumnGroups.groups.length === 0) && /* @__PURE__ */
|
|
5033
|
+
)), showFillerColumn && (!processedColumnGroups || processedColumnGroups.groups.length === 0) && /* @__PURE__ */ import_react30.default.createElement("th", { "aria-hidden": "true" }))), /* @__PURE__ */ import_react30.default.createElement(
|
|
4958
5034
|
VirtualizedTableBody,
|
|
4959
5035
|
{
|
|
4960
5036
|
ref: tableBodyRef,
|
|
@@ -4965,7 +5041,7 @@ function Component(props, apiRef) {
|
|
|
4965
5041
|
role: "rowgroup",
|
|
4966
5042
|
"aria-label": "DataTableBody"
|
|
4967
5043
|
},
|
|
4968
|
-
!!loading && /* @__PURE__ */
|
|
5044
|
+
!!loading && /* @__PURE__ */ import_react30.default.createElement(OverlayWrapper, null, /* @__PURE__ */ import_react30.default.createElement(
|
|
4969
5045
|
"td",
|
|
4970
5046
|
{
|
|
4971
5047
|
style: {
|
|
@@ -4974,7 +5050,7 @@ function Component(props, apiRef) {
|
|
|
4974
5050
|
overflow: "visible"
|
|
4975
5051
|
}
|
|
4976
5052
|
},
|
|
4977
|
-
/* @__PURE__ */
|
|
5053
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
4978
5054
|
Box_default,
|
|
4979
5055
|
{
|
|
4980
5056
|
sx: {
|
|
@@ -4984,10 +5060,10 @@ function Component(props, apiRef) {
|
|
|
4984
5060
|
right: 0
|
|
4985
5061
|
}
|
|
4986
5062
|
},
|
|
4987
|
-
/* @__PURE__ */
|
|
5063
|
+
/* @__PURE__ */ import_react30.default.createElement(LoadingOverlay, null)
|
|
4988
5064
|
)
|
|
4989
5065
|
)),
|
|
4990
|
-
showNoRowsOverlay && /* @__PURE__ */
|
|
5066
|
+
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
5067
|
Box_default,
|
|
4992
5068
|
{
|
|
4993
5069
|
sx: {
|
|
@@ -4997,14 +5073,14 @@ function Component(props, apiRef) {
|
|
|
4997
5073
|
minHeight: "150px"
|
|
4998
5074
|
}
|
|
4999
5075
|
},
|
|
5000
|
-
/* @__PURE__ */
|
|
5076
|
+
/* @__PURE__ */ import_react30.default.createElement(NoRowsOverlay, { ...noRowsOverlayProps })
|
|
5001
5077
|
))),
|
|
5002
5078
|
virtualizedItems.map((virtualizedRow, index) => {
|
|
5003
5079
|
const rowIndex = virtualizedRow.index;
|
|
5004
5080
|
const row = dataInPage[rowIndex];
|
|
5005
5081
|
const rowId = getId(row, rowIndex);
|
|
5006
5082
|
const striped = stripe && (stripe === "even" && (rowIndex + 1) % 2 === 0 || stripe === "odd" && (rowIndex + 1) % 2 === 1);
|
|
5007
|
-
return /* @__PURE__ */
|
|
5083
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
5008
5084
|
VirtualizedTableRow,
|
|
5009
5085
|
{
|
|
5010
5086
|
key: virtualizedRow.key,
|
|
@@ -5024,7 +5100,7 @@ function Component(props, apiRef) {
|
|
|
5024
5100
|
transform: `translateY(${virtualizedRow.start - index * virtualizedRow.size}px)`
|
|
5025
5101
|
}
|
|
5026
5102
|
},
|
|
5027
|
-
checkboxSelection && /* @__PURE__ */
|
|
5103
|
+
checkboxSelection && /* @__PURE__ */ import_react30.default.createElement(
|
|
5028
5104
|
"th",
|
|
5029
5105
|
{
|
|
5030
5106
|
scope: "row",
|
|
@@ -5032,7 +5108,7 @@ function Component(props, apiRef) {
|
|
|
5032
5108
|
textAlign: "center"
|
|
5033
5109
|
}
|
|
5034
5110
|
},
|
|
5035
|
-
/* @__PURE__ */
|
|
5111
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
5036
5112
|
RenderCheckbox,
|
|
5037
5113
|
{
|
|
5038
5114
|
onClick: getCheckboxClickHandler(rowId, row),
|
|
@@ -5043,7 +5119,7 @@ function Component(props, apiRef) {
|
|
|
5043
5119
|
}
|
|
5044
5120
|
)
|
|
5045
5121
|
),
|
|
5046
|
-
/* @__PURE__ */
|
|
5122
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
5047
5123
|
BodyRow2,
|
|
5048
5124
|
{
|
|
5049
5125
|
tableId,
|
|
@@ -5054,12 +5130,12 @@ function Component(props, apiRef) {
|
|
|
5054
5130
|
noWrap: props.noWrap
|
|
5055
5131
|
}
|
|
5056
5132
|
),
|
|
5057
|
-
showFillerColumn && /* @__PURE__ */
|
|
5133
|
+
showFillerColumn && /* @__PURE__ */ import_react30.default.createElement("td", { "aria-hidden": "true" })
|
|
5058
5134
|
);
|
|
5059
5135
|
})
|
|
5060
|
-
), Footer && /* @__PURE__ */
|
|
5136
|
+
), Footer && /* @__PURE__ */ import_react30.default.createElement(Footer, null))
|
|
5061
5137
|
),
|
|
5062
|
-
pagination && /* @__PURE__ */
|
|
5138
|
+
pagination && /* @__PURE__ */ import_react30.default.createElement(
|
|
5063
5139
|
Pagination_default,
|
|
5064
5140
|
{
|
|
5065
5141
|
pt: 2,
|
|
@@ -5072,11 +5148,11 @@ function Component(props, apiRef) {
|
|
|
5072
5148
|
)
|
|
5073
5149
|
);
|
|
5074
5150
|
}
|
|
5075
|
-
var DataTable = (0,
|
|
5151
|
+
var DataTable = (0, import_react30.forwardRef)(Component);
|
|
5076
5152
|
DataTable.displayName = "DataTable";
|
|
5077
5153
|
|
|
5078
5154
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
5079
|
-
var
|
|
5155
|
+
var import_react31 = __toESM(require("react"));
|
|
5080
5156
|
var import_react_imask2 = require("react-imask");
|
|
5081
5157
|
var import_CalendarToday2 = __toESM(require("@mui/icons-material/CalendarToday"));
|
|
5082
5158
|
var import_joy37 = require("@mui/joy");
|
|
@@ -5218,9 +5294,9 @@ var parseDates = (str, format) => {
|
|
|
5218
5294
|
var formatToPattern2 = (format) => {
|
|
5219
5295
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
5220
5296
|
};
|
|
5221
|
-
var TextMaskAdapter5 =
|
|
5297
|
+
var TextMaskAdapter5 = import_react31.default.forwardRef(function TextMaskAdapter6(props, ref) {
|
|
5222
5298
|
const { onChange, format, ...other } = props;
|
|
5223
|
-
return /* @__PURE__ */
|
|
5299
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5224
5300
|
import_react_imask2.IMaskInput,
|
|
5225
5301
|
{
|
|
5226
5302
|
...other,
|
|
@@ -5254,7 +5330,7 @@ var TextMaskAdapter5 = import_react30.default.forwardRef(function TextMaskAdapte
|
|
|
5254
5330
|
}
|
|
5255
5331
|
);
|
|
5256
5332
|
});
|
|
5257
|
-
var DateRangePicker = (0,
|
|
5333
|
+
var DateRangePicker = (0, import_react31.forwardRef)((inProps, ref) => {
|
|
5258
5334
|
const props = (0, import_joy37.useThemeProps)({ props: inProps, name: "DateRangePicker" });
|
|
5259
5335
|
const {
|
|
5260
5336
|
onChange,
|
|
@@ -5281,28 +5357,28 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5281
5357
|
numberOfMonths,
|
|
5282
5358
|
...innerProps
|
|
5283
5359
|
} = props;
|
|
5284
|
-
const innerRef = (0,
|
|
5285
|
-
const buttonRef = (0,
|
|
5360
|
+
const innerRef = (0, import_react31.useRef)(null);
|
|
5361
|
+
const buttonRef = (0, import_react31.useRef)(null);
|
|
5286
5362
|
const [rawValue, setValue] = useControlledState(
|
|
5287
5363
|
props.value,
|
|
5288
5364
|
props.defaultValue ?? null,
|
|
5289
|
-
(0,
|
|
5365
|
+
(0, import_react31.useCallback)(
|
|
5290
5366
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
5291
5367
|
[props.name, onChange]
|
|
5292
5368
|
)
|
|
5293
5369
|
);
|
|
5294
5370
|
const value = rawValue ?? "";
|
|
5295
5371
|
const isAlphabeticDisplay = hasAlphabeticMonth2(displayFormat);
|
|
5296
|
-
const [displayValue, setDisplayValue] = (0,
|
|
5372
|
+
const [displayValue, setDisplayValue] = (0, import_react31.useState)(
|
|
5297
5373
|
() => value ? formatValueString2(parseDates(value, format), displayFormat, locale) : ""
|
|
5298
5374
|
);
|
|
5299
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
5375
|
+
const [anchorEl, setAnchorEl] = (0, import_react31.useState)(null);
|
|
5300
5376
|
const open = Boolean(anchorEl);
|
|
5301
|
-
const calendarValue = (0,
|
|
5377
|
+
const calendarValue = (0, import_react31.useMemo)(
|
|
5302
5378
|
() => value ? parseDates(value, format) : void 0,
|
|
5303
5379
|
[value, format]
|
|
5304
5380
|
);
|
|
5305
|
-
(0,
|
|
5381
|
+
(0, import_react31.useEffect)(() => {
|
|
5306
5382
|
if (value) {
|
|
5307
5383
|
try {
|
|
5308
5384
|
const dates = parseDates(value, format);
|
|
@@ -5314,13 +5390,13 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5314
5390
|
setDisplayValue("");
|
|
5315
5391
|
}
|
|
5316
5392
|
}, [displayFormat, locale, value, format]);
|
|
5317
|
-
(0,
|
|
5393
|
+
(0, import_react31.useEffect)(() => {
|
|
5318
5394
|
if (!anchorEl) {
|
|
5319
5395
|
innerRef.current?.blur();
|
|
5320
5396
|
}
|
|
5321
5397
|
}, [anchorEl, innerRef]);
|
|
5322
|
-
(0,
|
|
5323
|
-
const handleChange = (0,
|
|
5398
|
+
(0, import_react31.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
5399
|
+
const handleChange = (0, import_react31.useCallback)(
|
|
5324
5400
|
(event) => {
|
|
5325
5401
|
const value2 = event.target.value;
|
|
5326
5402
|
setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat, locale) : value2);
|
|
@@ -5328,7 +5404,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5328
5404
|
},
|
|
5329
5405
|
[displayFormat, format, locale, setValue]
|
|
5330
5406
|
);
|
|
5331
|
-
const handleDisplayInputChange = (0,
|
|
5407
|
+
const handleDisplayInputChange = (0, import_react31.useCallback)(
|
|
5332
5408
|
(event) => {
|
|
5333
5409
|
if (event.target.value === "") {
|
|
5334
5410
|
handleChange({
|
|
@@ -5353,14 +5429,14 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5353
5429
|
},
|
|
5354
5430
|
[displayFormat, format, handleChange, props.name]
|
|
5355
5431
|
);
|
|
5356
|
-
const handleCalendarToggle = (0,
|
|
5432
|
+
const handleCalendarToggle = (0, import_react31.useCallback)(
|
|
5357
5433
|
(event) => {
|
|
5358
5434
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5359
5435
|
innerRef.current?.focus();
|
|
5360
5436
|
},
|
|
5361
5437
|
[anchorEl, setAnchorEl, innerRef]
|
|
5362
5438
|
);
|
|
5363
|
-
const handleCalendarChange = (0,
|
|
5439
|
+
const handleCalendarChange = (0, import_react31.useCallback)(
|
|
5364
5440
|
([date1, date2]) => {
|
|
5365
5441
|
if (!date1 || !date2) return;
|
|
5366
5442
|
const formattedValue = formatValueString2([date1, date2], format);
|
|
@@ -5374,7 +5450,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5374
5450
|
},
|
|
5375
5451
|
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat, locale]
|
|
5376
5452
|
);
|
|
5377
|
-
const handleInputMouseDown = (0,
|
|
5453
|
+
const handleInputMouseDown = (0, import_react31.useCallback)(
|
|
5378
5454
|
(event) => {
|
|
5379
5455
|
if (inputReadOnly || isAlphabeticDisplay) {
|
|
5380
5456
|
event.preventDefault();
|
|
@@ -5383,7 +5459,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5383
5459
|
},
|
|
5384
5460
|
[inputReadOnly, isAlphabeticDisplay, buttonRef]
|
|
5385
5461
|
);
|
|
5386
|
-
const handleInputClick = (0,
|
|
5462
|
+
const handleInputClick = (0, import_react31.useCallback)(
|
|
5387
5463
|
(event) => {
|
|
5388
5464
|
if (inputReadOnly && !readOnly) {
|
|
5389
5465
|
handleCalendarToggle(event);
|
|
@@ -5391,7 +5467,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5391
5467
|
},
|
|
5392
5468
|
[inputReadOnly, readOnly, handleCalendarToggle]
|
|
5393
5469
|
);
|
|
5394
|
-
const handlePresetClick = (0,
|
|
5470
|
+
const handlePresetClick = (0, import_react31.useCallback)(
|
|
5395
5471
|
(presetValue) => {
|
|
5396
5472
|
if (props.value !== void 0) {
|
|
5397
5473
|
onChange?.({ target: { name: props.name, value: presetValue } });
|
|
@@ -5404,7 +5480,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5404
5480
|
},
|
|
5405
5481
|
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat, locale]
|
|
5406
5482
|
);
|
|
5407
|
-
const isPresetDisabled = (0,
|
|
5483
|
+
const isPresetDisabled = (0, import_react31.useCallback)(
|
|
5408
5484
|
(presetValue) => {
|
|
5409
5485
|
try {
|
|
5410
5486
|
const dates = parseDates(presetValue, format);
|
|
@@ -5423,7 +5499,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5423
5499
|
},
|
|
5424
5500
|
[format, minDate, maxDate, disableFuture, disablePast]
|
|
5425
5501
|
);
|
|
5426
|
-
return /* @__PURE__ */
|
|
5502
|
+
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
5503
|
Input_default,
|
|
5428
5504
|
{
|
|
5429
5505
|
...innerProps,
|
|
@@ -5450,7 +5526,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5450
5526
|
},
|
|
5451
5527
|
error,
|
|
5452
5528
|
sx: { width: "100%" },
|
|
5453
|
-
endDecorator: /* @__PURE__ */
|
|
5529
|
+
endDecorator: /* @__PURE__ */ import_react31.default.createElement(
|
|
5454
5530
|
CalendarButton2,
|
|
5455
5531
|
{
|
|
5456
5532
|
ref: buttonRef,
|
|
@@ -5462,13 +5538,13 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5462
5538
|
"aria-expanded": open,
|
|
5463
5539
|
disabled
|
|
5464
5540
|
},
|
|
5465
|
-
/* @__PURE__ */
|
|
5541
|
+
/* @__PURE__ */ import_react31.default.createElement(import_CalendarToday2.default, null)
|
|
5466
5542
|
),
|
|
5467
5543
|
label,
|
|
5468
5544
|
helperText,
|
|
5469
5545
|
readOnly: readOnly || inputReadOnly || isAlphabeticDisplay
|
|
5470
5546
|
}
|
|
5471
|
-
), open && /* @__PURE__ */
|
|
5547
|
+
), open && /* @__PURE__ */ import_react31.default.createElement(import_base4.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react31.default.createElement(
|
|
5472
5548
|
StyledPopper2,
|
|
5473
5549
|
{
|
|
5474
5550
|
id: "date-range-picker-popper",
|
|
@@ -5487,7 +5563,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5487
5563
|
"aria-label": "Calendar Tooltip",
|
|
5488
5564
|
"aria-expanded": open
|
|
5489
5565
|
},
|
|
5490
|
-
/* @__PURE__ */
|
|
5566
|
+
/* @__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
5567
|
Calendar_default,
|
|
5492
5568
|
{
|
|
5493
5569
|
rangeSelection: true,
|
|
@@ -5500,14 +5576,14 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5500
5576
|
locale,
|
|
5501
5577
|
numberOfMonths
|
|
5502
5578
|
}
|
|
5503
|
-
), !hideClearButton && /* @__PURE__ */
|
|
5579
|
+
), !hideClearButton && /* @__PURE__ */ import_react31.default.createElement(
|
|
5504
5580
|
DialogActions_default,
|
|
5505
5581
|
{
|
|
5506
5582
|
sx: {
|
|
5507
5583
|
p: 1
|
|
5508
5584
|
}
|
|
5509
5585
|
},
|
|
5510
|
-
/* @__PURE__ */
|
|
5586
|
+
/* @__PURE__ */ import_react31.default.createElement(
|
|
5511
5587
|
Button_default,
|
|
5512
5588
|
{
|
|
5513
5589
|
size,
|
|
@@ -5521,9 +5597,9 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5521
5597
|
},
|
|
5522
5598
|
"Clear"
|
|
5523
5599
|
)
|
|
5524
|
-
)), presets && presets.length > 0 && /* @__PURE__ */
|
|
5600
|
+
)), presets && presets.length > 0 && /* @__PURE__ */ import_react31.default.createElement(PresetPanel2, null, presets.map((preset) => {
|
|
5525
5601
|
const disabled2 = isPresetDisabled(preset.value);
|
|
5526
|
-
return /* @__PURE__ */
|
|
5602
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5527
5603
|
PresetItem2,
|
|
5528
5604
|
{
|
|
5529
5605
|
key: preset.label,
|
|
@@ -5542,7 +5618,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5542
5618
|
DateRangePicker.displayName = "DateRangePicker";
|
|
5543
5619
|
|
|
5544
5620
|
// src/components/Drawer/Drawer.tsx
|
|
5545
|
-
var
|
|
5621
|
+
var import_react32 = __toESM(require("react"));
|
|
5546
5622
|
var import_joy38 = require("@mui/joy");
|
|
5547
5623
|
var import_framer_motion22 = require("framer-motion");
|
|
5548
5624
|
var MotionDrawer = (0, import_framer_motion22.motion)(import_joy38.Drawer);
|
|
@@ -5560,7 +5636,7 @@ var StyledDrawer = (0, import_joy38.styled)(MotionDrawer)(({ theme, size = "md"
|
|
|
5560
5636
|
}));
|
|
5561
5637
|
var Drawer = (props) => {
|
|
5562
5638
|
const { children, ...innerProps } = props;
|
|
5563
|
-
return /* @__PURE__ */
|
|
5639
|
+
return /* @__PURE__ */ import_react32.default.createElement(StyledDrawer, { ...innerProps }, children);
|
|
5564
5640
|
};
|
|
5565
5641
|
Drawer.displayName = "Drawer";
|
|
5566
5642
|
|
|
@@ -5591,10 +5667,10 @@ DialogTitle.displayName = "DialogTitle";
|
|
|
5591
5667
|
var DialogTitle_default = DialogTitle;
|
|
5592
5668
|
|
|
5593
5669
|
// src/components/DialogFrame/DialogFrame.tsx
|
|
5594
|
-
var
|
|
5670
|
+
var import_react34 = __toESM(require("react"));
|
|
5595
5671
|
|
|
5596
5672
|
// src/components/Modal/Modal.tsx
|
|
5597
|
-
var
|
|
5673
|
+
var import_react33 = __toESM(require("react"));
|
|
5598
5674
|
var import_joy41 = require("@mui/joy");
|
|
5599
5675
|
var import_framer_motion25 = require("framer-motion");
|
|
5600
5676
|
var MotionModal = (0, import_framer_motion25.motion)(import_joy41.Modal);
|
|
@@ -5609,10 +5685,10 @@ var ModalClose = import_joy41.ModalClose;
|
|
|
5609
5685
|
var MotionModalOverflow = (0, import_framer_motion25.motion)(import_joy41.ModalOverflow);
|
|
5610
5686
|
var ModalOverflow = MotionModalOverflow;
|
|
5611
5687
|
ModalOverflow.displayName = "ModalOverflow";
|
|
5612
|
-
|
|
5688
|
+
var ModalFrame = import_react33.default.forwardRef((props, ref) => {
|
|
5613
5689
|
const { title, children, titleStartDecorator, onClose, ...innerProps } = props;
|
|
5614
|
-
return /* @__PURE__ */
|
|
5615
|
-
}
|
|
5690
|
+
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));
|
|
5691
|
+
});
|
|
5616
5692
|
ModalFrame.displayName = "ModalFrame";
|
|
5617
5693
|
|
|
5618
5694
|
// src/components/DialogFrame/DialogFrame.tsx
|
|
@@ -5623,20 +5699,20 @@ var StyledDialogFrame = (0, import_joy42.styled)(ModalDialog, {
|
|
|
5623
5699
|
})({
|
|
5624
5700
|
padding: 0
|
|
5625
5701
|
});
|
|
5626
|
-
var DialogFrame =
|
|
5702
|
+
var DialogFrame = import_react34.default.forwardRef((props, ref) => {
|
|
5627
5703
|
const { title, children, actions, fullscreen, onSubmit, ...innerProps } = props;
|
|
5628
5704
|
const formProps = onSubmit ? { component: "form", onSubmit } : void 0;
|
|
5629
|
-
return /* @__PURE__ */
|
|
5705
|
+
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
5706
|
});
|
|
5631
5707
|
DialogFrame.displayName = "DialogFrame";
|
|
5632
5708
|
|
|
5633
5709
|
// src/components/Divider/Divider.tsx
|
|
5634
|
-
var
|
|
5710
|
+
var import_react35 = __toESM(require("react"));
|
|
5635
5711
|
var import_joy43 = require("@mui/joy");
|
|
5636
5712
|
var import_framer_motion26 = require("framer-motion");
|
|
5637
5713
|
var MotionDivider = (0, import_framer_motion26.motion)(import_joy43.Divider);
|
|
5638
5714
|
var Divider = (props) => {
|
|
5639
|
-
return /* @__PURE__ */
|
|
5715
|
+
return /* @__PURE__ */ import_react35.default.createElement(MotionDivider, { ...props });
|
|
5640
5716
|
};
|
|
5641
5717
|
Divider.displayName = "Divider";
|
|
5642
5718
|
|
|
@@ -5657,16 +5733,16 @@ var InsetDrawer = (0, import_joy44.styled)(import_joy44.Drawer)(({ theme }) => (
|
|
|
5657
5733
|
}));
|
|
5658
5734
|
|
|
5659
5735
|
// src/components/FilterableCheckboxGroup/FilterableCheckboxGroup.tsx
|
|
5660
|
-
var
|
|
5736
|
+
var import_react36 = __toESM(require("react"));
|
|
5661
5737
|
var import_Search = __toESM(require("@mui/icons-material/Search"));
|
|
5662
5738
|
var import_joy45 = require("@mui/joy");
|
|
5663
5739
|
var import_react_virtual3 = require("@tanstack/react-virtual");
|
|
5664
5740
|
var EMPTY_VALUE = [];
|
|
5665
5741
|
function LabelWithTooltip(props) {
|
|
5666
5742
|
const { label, size } = props;
|
|
5667
|
-
const labelContentRef = (0,
|
|
5668
|
-
const [isOverflowing, setIsOverflowing] = (0,
|
|
5669
|
-
const labelContent = /* @__PURE__ */
|
|
5743
|
+
const labelContentRef = (0, import_react36.useRef)(null);
|
|
5744
|
+
const [isOverflowing, setIsOverflowing] = (0, import_react36.useState)(false);
|
|
5745
|
+
const labelContent = /* @__PURE__ */ import_react36.default.createElement(
|
|
5670
5746
|
"span",
|
|
5671
5747
|
{
|
|
5672
5748
|
ref: labelContentRef,
|
|
@@ -5682,14 +5758,14 @@ function LabelWithTooltip(props) {
|
|
|
5682
5758
|
},
|
|
5683
5759
|
label
|
|
5684
5760
|
);
|
|
5685
|
-
(0,
|
|
5761
|
+
(0, import_react36.useEffect)(() => {
|
|
5686
5762
|
const element = labelContentRef.current;
|
|
5687
5763
|
if (element) {
|
|
5688
5764
|
setIsOverflowing(element.scrollWidth > element.clientWidth);
|
|
5689
5765
|
}
|
|
5690
5766
|
}, [label]);
|
|
5691
5767
|
if (isOverflowing) {
|
|
5692
|
-
return /* @__PURE__ */
|
|
5768
|
+
return /* @__PURE__ */ import_react36.default.createElement(Tooltip_default, { variant: "solid", size, title: label, placement: "bottom-start" }, labelContent);
|
|
5693
5769
|
}
|
|
5694
5770
|
return labelContent;
|
|
5695
5771
|
}
|
|
@@ -5707,22 +5783,22 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5707
5783
|
maxHeight = 300,
|
|
5708
5784
|
disabled
|
|
5709
5785
|
} = props;
|
|
5710
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
5711
|
-
const [sortedOptions, setSortedOptions] = (0,
|
|
5786
|
+
const [searchTerm, setSearchTerm] = (0, import_react36.useState)("");
|
|
5787
|
+
const [sortedOptions, setSortedOptions] = (0, import_react36.useState)(options);
|
|
5712
5788
|
const [rawValue, setInternalValue] = useControlledState(
|
|
5713
5789
|
value,
|
|
5714
5790
|
value ?? EMPTY_VALUE,
|
|
5715
|
-
(0,
|
|
5791
|
+
(0, import_react36.useCallback)((newValue) => onChange?.(newValue ?? []), [onChange])
|
|
5716
5792
|
);
|
|
5717
5793
|
const internalValue = rawValue ?? EMPTY_VALUE;
|
|
5718
|
-
const parentRef = (0,
|
|
5719
|
-
const isInitialSortRef = (0,
|
|
5720
|
-
const prevOptionsRef = (0,
|
|
5721
|
-
const filteredOptions = (0,
|
|
5794
|
+
const parentRef = (0, import_react36.useRef)(null);
|
|
5795
|
+
const isInitialSortRef = (0, import_react36.useRef)(false);
|
|
5796
|
+
const prevOptionsRef = (0, import_react36.useRef)([...options]);
|
|
5797
|
+
const filteredOptions = (0, import_react36.useMemo)(() => {
|
|
5722
5798
|
if (!searchTerm) return sortedOptions;
|
|
5723
5799
|
return sortedOptions.filter((option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
5724
5800
|
}, [sortedOptions, searchTerm]);
|
|
5725
|
-
const itemSize = (0,
|
|
5801
|
+
const itemSize = (0, import_react36.useMemo)(() => {
|
|
5726
5802
|
switch (size) {
|
|
5727
5803
|
case "sm":
|
|
5728
5804
|
return 28;
|
|
@@ -5740,7 +5816,7 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5740
5816
|
overscan: 5
|
|
5741
5817
|
});
|
|
5742
5818
|
const items = virtualizer.getVirtualItems();
|
|
5743
|
-
(0,
|
|
5819
|
+
(0, import_react36.useEffect)(() => {
|
|
5744
5820
|
const optionsChanged = prevOptionsRef.current.length !== options.length || prevOptionsRef.current.some(
|
|
5745
5821
|
(prevOption, index) => prevOption.value !== options[index]?.value || prevOption.label !== options[index]?.label || prevOption.disabled !== options[index]?.disabled
|
|
5746
5822
|
);
|
|
@@ -5766,13 +5842,13 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5766
5842
|
}
|
|
5767
5843
|
}
|
|
5768
5844
|
}, [options, value]);
|
|
5769
|
-
(0,
|
|
5845
|
+
(0, import_react36.useEffect)(() => {
|
|
5770
5846
|
virtualizer.measure();
|
|
5771
5847
|
}, [virtualizer, filteredOptions, size]);
|
|
5772
|
-
const handleSearchChange = (0,
|
|
5848
|
+
const handleSearchChange = (0, import_react36.useCallback)((event) => {
|
|
5773
5849
|
setSearchTerm(event.target.value);
|
|
5774
5850
|
}, []);
|
|
5775
|
-
const handleCheckboxChange = (0,
|
|
5851
|
+
const handleCheckboxChange = (0, import_react36.useCallback)(
|
|
5776
5852
|
(optionValue) => (event) => {
|
|
5777
5853
|
const checked = event.target.checked;
|
|
5778
5854
|
const newValue = checked ? [...internalValue, optionValue] : internalValue.filter((v) => v !== optionValue);
|
|
@@ -5780,7 +5856,7 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5780
5856
|
},
|
|
5781
5857
|
[internalValue, setInternalValue]
|
|
5782
5858
|
);
|
|
5783
|
-
const handleSelectAll = (0,
|
|
5859
|
+
const handleSelectAll = (0, import_react36.useCallback)(
|
|
5784
5860
|
(event) => {
|
|
5785
5861
|
const checked = event.target.checked;
|
|
5786
5862
|
const enabledOptions = filteredOptions.filter((option) => !option.disabled);
|
|
@@ -5796,10 +5872,10 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5796
5872
|
},
|
|
5797
5873
|
[filteredOptions, internalValue, setInternalValue]
|
|
5798
5874
|
);
|
|
5799
|
-
const enabledFilteredOptions = (0,
|
|
5875
|
+
const enabledFilteredOptions = (0, import_react36.useMemo)(() => filteredOptions.filter((option) => !option.disabled), [filteredOptions]);
|
|
5800
5876
|
const isAllSelected = enabledFilteredOptions.length > 0 && enabledFilteredOptions.every((option) => internalValue.includes(option.value));
|
|
5801
5877
|
const isIndeterminate = !isAllSelected && enabledFilteredOptions.some((option) => internalValue.includes(option.value));
|
|
5802
|
-
return /* @__PURE__ */
|
|
5878
|
+
return /* @__PURE__ */ import_react36.default.createElement("div", { style: { width: "100%" } }, /* @__PURE__ */ import_react36.default.createElement(
|
|
5803
5879
|
Input_default,
|
|
5804
5880
|
{
|
|
5805
5881
|
label,
|
|
@@ -5812,9 +5888,9 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5812
5888
|
onChange: handleSearchChange,
|
|
5813
5889
|
size,
|
|
5814
5890
|
disabled,
|
|
5815
|
-
endDecorator: /* @__PURE__ */
|
|
5891
|
+
endDecorator: /* @__PURE__ */ import_react36.default.createElement(import_Search.default, null)
|
|
5816
5892
|
}
|
|
5817
|
-
), filteredOptions.length === 0 ? /* @__PURE__ */
|
|
5893
|
+
), 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
5894
|
"div",
|
|
5819
5895
|
{
|
|
5820
5896
|
ref: parentRef,
|
|
@@ -5825,7 +5901,7 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5825
5901
|
marginTop: "8px"
|
|
5826
5902
|
}
|
|
5827
5903
|
},
|
|
5828
|
-
!searchTerm && /* @__PURE__ */
|
|
5904
|
+
!searchTerm && /* @__PURE__ */ import_react36.default.createElement(
|
|
5829
5905
|
Checkbox_default,
|
|
5830
5906
|
{
|
|
5831
5907
|
label: "Select all",
|
|
@@ -5842,7 +5918,7 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5842
5918
|
sx: { width: "100%", height: itemSize }
|
|
5843
5919
|
}
|
|
5844
5920
|
),
|
|
5845
|
-
/* @__PURE__ */
|
|
5921
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
5846
5922
|
Stack_default,
|
|
5847
5923
|
{
|
|
5848
5924
|
sx: {
|
|
@@ -5852,11 +5928,11 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5852
5928
|
},
|
|
5853
5929
|
items.map((virtualRow) => {
|
|
5854
5930
|
const option = filteredOptions[virtualRow.index];
|
|
5855
|
-
return /* @__PURE__ */
|
|
5931
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
5856
5932
|
Checkbox_default,
|
|
5857
5933
|
{
|
|
5858
5934
|
key: virtualRow.key,
|
|
5859
|
-
label: /* @__PURE__ */
|
|
5935
|
+
label: /* @__PURE__ */ import_react36.default.createElement(LabelWithTooltip, { label: option.label, size }),
|
|
5860
5936
|
checked: internalValue.includes(option.value),
|
|
5861
5937
|
onChange: handleCheckboxChange(option.value),
|
|
5862
5938
|
size,
|
|
@@ -5887,9 +5963,12 @@ FilterableCheckboxGroup.displayName = "FilterableCheckboxGroup";
|
|
|
5887
5963
|
var import_joy46 = require("@mui/joy");
|
|
5888
5964
|
|
|
5889
5965
|
// src/components/IconMenuButton/IconMenuButton.tsx
|
|
5890
|
-
var
|
|
5966
|
+
var import_react37 = __toESM(require("react"));
|
|
5891
5967
|
var import_joy47 = require("@mui/joy");
|
|
5892
|
-
function
|
|
5968
|
+
var MenuButtonRootSlot = import_react37.default.forwardRef(function MenuButtonRootSlot2({ as, ...rest }, ref) {
|
|
5969
|
+
return /* @__PURE__ */ import_react37.default.createElement(import_joy47.IconButton, { ...rest, component: as ?? "button", ref });
|
|
5970
|
+
});
|
|
5971
|
+
function IconMenuButtonInner(props, ref) {
|
|
5893
5972
|
const {
|
|
5894
5973
|
size,
|
|
5895
5974
|
icon,
|
|
@@ -5900,8 +5979,10 @@ function IconMenuButton(props) {
|
|
|
5900
5979
|
variant = "plain",
|
|
5901
5980
|
placement = "bottom"
|
|
5902
5981
|
} = props;
|
|
5982
|
+
const { ref: buttonComponentRef, ...buttonComponentProps } = props.buttonComponentProps ?? {};
|
|
5983
|
+
const mergedButtonRef = useMergedRef(buttonComponentRef, ref);
|
|
5903
5984
|
if (!items.length) {
|
|
5904
|
-
return /* @__PURE__ */
|
|
5985
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
|
5905
5986
|
import_joy47.IconButton,
|
|
5906
5987
|
{
|
|
5907
5988
|
component: props.buttonComponent ?? "button",
|
|
@@ -5910,15 +5991,16 @@ function IconMenuButton(props) {
|
|
|
5910
5991
|
color,
|
|
5911
5992
|
disabled,
|
|
5912
5993
|
loading,
|
|
5913
|
-
...
|
|
5994
|
+
...buttonComponentProps,
|
|
5995
|
+
ref: mergedButtonRef
|
|
5914
5996
|
},
|
|
5915
5997
|
icon
|
|
5916
5998
|
);
|
|
5917
5999
|
}
|
|
5918
|
-
return /* @__PURE__ */
|
|
6000
|
+
return /* @__PURE__ */ import_react37.default.createElement(Dropdown_default, null, /* @__PURE__ */ import_react37.default.createElement(
|
|
5919
6001
|
import_joy47.MenuButton,
|
|
5920
6002
|
{
|
|
5921
|
-
slots: { root:
|
|
6003
|
+
slots: { root: MenuButtonRootSlot },
|
|
5922
6004
|
slotProps: {
|
|
5923
6005
|
root: {
|
|
5924
6006
|
component: props.buttonComponent ?? "button",
|
|
@@ -5927,24 +6009,27 @@ function IconMenuButton(props) {
|
|
|
5927
6009
|
color,
|
|
5928
6010
|
disabled,
|
|
5929
6011
|
loading,
|
|
5930
|
-
...
|
|
6012
|
+
...buttonComponentProps,
|
|
6013
|
+
// Joy의 useSlot이 내부 ref와 이 ref를 합쳐준다. 위 no-items 분기와 같은 경로로 ref를 넘긴다.
|
|
6014
|
+
ref: mergedButtonRef
|
|
5931
6015
|
}
|
|
5932
6016
|
}
|
|
5933
6017
|
},
|
|
5934
6018
|
icon
|
|
5935
|
-
), /* @__PURE__ */
|
|
6019
|
+
), /* @__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
6020
|
}
|
|
6021
|
+
var IconMenuButton = import_react37.default.forwardRef(IconMenuButtonInner);
|
|
5937
6022
|
IconMenuButton.displayName = "IconMenuButton";
|
|
5938
6023
|
|
|
5939
6024
|
// src/components/Markdown/Markdown.tsx
|
|
5940
|
-
var
|
|
6025
|
+
var import_react38 = __toESM(require("react"));
|
|
5941
6026
|
var import_joy48 = require("@mui/joy");
|
|
5942
6027
|
var import_joy49 = require("@mui/joy");
|
|
5943
6028
|
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
5944
|
-
var LazyReactMarkdown = (0,
|
|
6029
|
+
var LazyReactMarkdown = (0, import_react38.lazy)(() => import("react-markdown"));
|
|
5945
6030
|
var Markdown = (props) => {
|
|
5946
|
-
const [rehypeAccent2, setRehypeAccent] = (0,
|
|
5947
|
-
(0,
|
|
6031
|
+
const [rehypeAccent2, setRehypeAccent] = (0, import_react38.useState)(null);
|
|
6032
|
+
(0, import_react38.useEffect)(() => {
|
|
5948
6033
|
const loadRehypeAccent = async () => {
|
|
5949
6034
|
const module2 = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
|
|
5950
6035
|
setRehypeAccent(() => module2.rehypeAccent);
|
|
@@ -5966,8 +6051,8 @@ var Markdown = (props) => {
|
|
|
5966
6051
|
if (!rehypeAccent2) {
|
|
5967
6052
|
return null;
|
|
5968
6053
|
}
|
|
5969
|
-
return /* @__PURE__ */
|
|
5970
|
-
|
|
6054
|
+
return /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ import_react38.default.createElement(
|
|
6055
|
+
import_react38.Suspense,
|
|
5971
6056
|
{
|
|
5972
6057
|
fallback: (
|
|
5973
6058
|
// While in the fallback state, prevent browser auto-translation (e.g. Chrome/Google Translate)
|
|
@@ -5975,10 +6060,10 @@ var Markdown = (props) => {
|
|
|
5975
6060
|
// swaps the fallback for the real content via insertBefore; if the browser has mutated the DOM
|
|
5976
6061
|
// in the meantime, the reference node's parent changes and React throws a DOMException
|
|
5977
6062
|
// ("Failed to execute 'insertBefore' on 'Node'"), crashing the subtree. (cf. facebook/react#11538)
|
|
5978
|
-
fallback || /* @__PURE__ */
|
|
6063
|
+
fallback || /* @__PURE__ */ import_react38.default.createElement(Typography, { translate: "no", className: "notranslate" }, /* @__PURE__ */ import_react38.default.createElement(import_joy48.Skeleton, null, content || ""))
|
|
5979
6064
|
)
|
|
5980
6065
|
},
|
|
5981
|
-
/* @__PURE__ */
|
|
6066
|
+
/* @__PURE__ */ import_react38.default.createElement(
|
|
5982
6067
|
LazyReactMarkdown,
|
|
5983
6068
|
{
|
|
5984
6069
|
...markdownOptions,
|
|
@@ -5986,17 +6071,17 @@ var Markdown = (props) => {
|
|
|
5986
6071
|
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
5987
6072
|
remarkPlugins: [import_remark_gfm.default],
|
|
5988
6073
|
components: {
|
|
5989
|
-
a: ({ children, href }) => /* @__PURE__ */
|
|
5990
|
-
hr: () => /* @__PURE__ */
|
|
5991
|
-
b: ({ children }) => /* @__PURE__ */
|
|
5992
|
-
strong: ({ children }) => /* @__PURE__ */
|
|
6074
|
+
a: ({ children, href }) => /* @__PURE__ */ import_react38.default.createElement(import_joy49.Link, { href, target: defaultLinkAction }, children),
|
|
6075
|
+
hr: () => /* @__PURE__ */ import_react38.default.createElement(Divider, { sx: { display: "block" } }),
|
|
6076
|
+
b: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "strong", fontWeight: boldFontWeight || "lg" }, children),
|
|
6077
|
+
strong: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "strong", fontWeight: boldFontWeight || "lg" }, children),
|
|
5993
6078
|
// Table components
|
|
5994
|
-
table: ({ children }) => /* @__PURE__ */
|
|
6079
|
+
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
6080
|
// Code components
|
|
5996
6081
|
code: ({ children, className }) => {
|
|
5997
6082
|
const isBlock = className?.startsWith("language-");
|
|
5998
6083
|
if (isBlock) {
|
|
5999
|
-
return /* @__PURE__ */
|
|
6084
|
+
return /* @__PURE__ */ import_react38.default.createElement(
|
|
6000
6085
|
Typography,
|
|
6001
6086
|
{
|
|
6002
6087
|
component: "code",
|
|
@@ -6010,7 +6095,7 @@ var Markdown = (props) => {
|
|
|
6010
6095
|
children
|
|
6011
6096
|
);
|
|
6012
6097
|
}
|
|
6013
|
-
return /* @__PURE__ */
|
|
6098
|
+
return /* @__PURE__ */ import_react38.default.createElement(
|
|
6014
6099
|
Typography,
|
|
6015
6100
|
{
|
|
6016
6101
|
component: "code",
|
|
@@ -6025,7 +6110,7 @@ var Markdown = (props) => {
|
|
|
6025
6110
|
children
|
|
6026
6111
|
);
|
|
6027
6112
|
},
|
|
6028
|
-
pre: ({ children }) => /* @__PURE__ */
|
|
6113
|
+
pre: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(
|
|
6029
6114
|
Sheet,
|
|
6030
6115
|
{
|
|
6031
6116
|
variant: "soft",
|
|
@@ -6043,12 +6128,12 @@ var Markdown = (props) => {
|
|
|
6043
6128
|
// Task list checkbox
|
|
6044
6129
|
input: ({ checked, type }) => {
|
|
6045
6130
|
if (type === "checkbox") {
|
|
6046
|
-
return /* @__PURE__ */
|
|
6131
|
+
return /* @__PURE__ */ import_react38.default.createElement(Checkbox, { checked, disabled: true, size: "sm", sx: { mr: 1 } });
|
|
6047
6132
|
}
|
|
6048
|
-
return /* @__PURE__ */
|
|
6133
|
+
return /* @__PURE__ */ import_react38.default.createElement("input", { checked, type });
|
|
6049
6134
|
},
|
|
6050
6135
|
// Blockquote
|
|
6051
|
-
blockquote: ({ children }) => /* @__PURE__ */
|
|
6136
|
+
blockquote: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(
|
|
6052
6137
|
Sheet,
|
|
6053
6138
|
{
|
|
6054
6139
|
variant: "soft",
|
|
@@ -6057,12 +6142,12 @@ var Markdown = (props) => {
|
|
|
6057
6142
|
children
|
|
6058
6143
|
),
|
|
6059
6144
|
// Image
|
|
6060
|
-
img: ({ src, alt }) => /* @__PURE__ */
|
|
6145
|
+
img: ({ src, alt }) => /* @__PURE__ */ import_react38.default.createElement("img", { src, alt, style: { maxWidth: "100%", borderRadius: "4px" } }),
|
|
6061
6146
|
// Text style components
|
|
6062
|
-
em: ({ children }) => /* @__PURE__ */
|
|
6063
|
-
del: ({ children }) => /* @__PURE__ */
|
|
6147
|
+
em: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "em", sx: { fontStyle: "italic" } }, children),
|
|
6148
|
+
del: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "del", sx: { textDecoration: "line-through" } }, children),
|
|
6064
6149
|
// Span for accent color (from rehype-accent plugin)
|
|
6065
|
-
span: ({ children, node }) => /* @__PURE__ */
|
|
6150
|
+
span: ({ children, node }) => /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "span", textColor: node?.properties?.textColor }, children),
|
|
6066
6151
|
...markdownOptions?.components
|
|
6067
6152
|
}
|
|
6068
6153
|
}
|
|
@@ -6072,7 +6157,7 @@ var Markdown = (props) => {
|
|
|
6072
6157
|
Markdown.displayName = "Markdown";
|
|
6073
6158
|
|
|
6074
6159
|
// src/components/MenuButton/MenuButton.tsx
|
|
6075
|
-
var
|
|
6160
|
+
var import_react39 = __toESM(require("react"));
|
|
6076
6161
|
var import_joy50 = require("@mui/joy");
|
|
6077
6162
|
var import_ExpandMore = __toESM(require("@mui/icons-material/ExpandMore"));
|
|
6078
6163
|
function MenuButton2(props) {
|
|
@@ -6090,7 +6175,7 @@ function MenuButton2(props) {
|
|
|
6090
6175
|
placement = "bottom"
|
|
6091
6176
|
} = props;
|
|
6092
6177
|
if (!items.length) {
|
|
6093
|
-
return /* @__PURE__ */
|
|
6178
|
+
return /* @__PURE__ */ import_react39.default.createElement(
|
|
6094
6179
|
import_joy50.Button,
|
|
6095
6180
|
{
|
|
6096
6181
|
component: props.buttonComponent ?? "button",
|
|
@@ -6101,12 +6186,12 @@ function MenuButton2(props) {
|
|
|
6101
6186
|
loading,
|
|
6102
6187
|
startDecorator,
|
|
6103
6188
|
...props.buttonComponentProps ?? {},
|
|
6104
|
-
endDecorator: showIcon ? /* @__PURE__ */
|
|
6189
|
+
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
6190
|
},
|
|
6106
6191
|
buttonText
|
|
6107
6192
|
);
|
|
6108
6193
|
}
|
|
6109
|
-
return /* @__PURE__ */
|
|
6194
|
+
return /* @__PURE__ */ import_react39.default.createElement(Dropdown_default, null, /* @__PURE__ */ import_react39.default.createElement(
|
|
6110
6195
|
import_joy50.MenuButton,
|
|
6111
6196
|
{
|
|
6112
6197
|
component: props.buttonComponent ?? "button",
|
|
@@ -6117,15 +6202,15 @@ function MenuButton2(props) {
|
|
|
6117
6202
|
loading,
|
|
6118
6203
|
startDecorator,
|
|
6119
6204
|
...props.buttonComponentProps ?? {},
|
|
6120
|
-
endDecorator: showIcon ? /* @__PURE__ */
|
|
6205
|
+
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
6206
|
},
|
|
6122
6207
|
buttonText
|
|
6123
|
-
), /* @__PURE__ */
|
|
6208
|
+
), /* @__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
6209
|
}
|
|
6125
6210
|
MenuButton2.displayName = "MenuButton";
|
|
6126
6211
|
|
|
6127
6212
|
// src/components/MonthPicker/MonthPicker.tsx
|
|
6128
|
-
var
|
|
6213
|
+
var import_react40 = __toESM(require("react"));
|
|
6129
6214
|
var import_CalendarToday3 = __toESM(require("@mui/icons-material/CalendarToday"));
|
|
6130
6215
|
var import_joy51 = require("@mui/joy");
|
|
6131
6216
|
var import_base5 = require("@mui/base");
|
|
@@ -6181,7 +6266,7 @@ function parseDate3(dateString, format) {
|
|
|
6181
6266
|
const result = new Date(year, month, day);
|
|
6182
6267
|
return result;
|
|
6183
6268
|
}
|
|
6184
|
-
var MonthPicker = (0,
|
|
6269
|
+
var MonthPicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
6185
6270
|
const props = (0, import_joy51.useThemeProps)({ props: inProps, name: "MonthPicker" });
|
|
6186
6271
|
const {
|
|
6187
6272
|
onChange,
|
|
@@ -6208,18 +6293,18 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6208
6293
|
locale,
|
|
6209
6294
|
...innerProps
|
|
6210
6295
|
} = props;
|
|
6211
|
-
const innerRef = (0,
|
|
6212
|
-
const buttonRef = (0,
|
|
6296
|
+
const innerRef = (0, import_react40.useRef)(null);
|
|
6297
|
+
const buttonRef = (0, import_react40.useRef)(null);
|
|
6213
6298
|
const [rawValue, setValue, isControlled] = useControlledState(
|
|
6214
6299
|
props.value,
|
|
6215
6300
|
props.defaultValue ?? null,
|
|
6216
|
-
(0,
|
|
6301
|
+
(0, import_react40.useCallback)(
|
|
6217
6302
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
6218
6303
|
[props.name, onChange]
|
|
6219
6304
|
)
|
|
6220
6305
|
);
|
|
6221
6306
|
const value = rawValue ?? "";
|
|
6222
|
-
const getFormattedDisplayValue = (0,
|
|
6307
|
+
const getFormattedDisplayValue = (0, import_react40.useCallback)(
|
|
6223
6308
|
(inputValue) => {
|
|
6224
6309
|
if (!inputValue) return "";
|
|
6225
6310
|
try {
|
|
@@ -6230,19 +6315,19 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6230
6315
|
},
|
|
6231
6316
|
[format, displayFormat, locale]
|
|
6232
6317
|
);
|
|
6233
|
-
const [displayValue, setDisplayValue] = (0,
|
|
6234
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
6318
|
+
const [displayValue, setDisplayValue] = (0, import_react40.useState)(() => getFormattedDisplayValue(value));
|
|
6319
|
+
const [anchorEl, setAnchorEl] = (0, import_react40.useState)(null);
|
|
6235
6320
|
const open = Boolean(anchorEl);
|
|
6236
|
-
(0,
|
|
6321
|
+
(0, import_react40.useEffect)(() => {
|
|
6237
6322
|
if (!anchorEl) {
|
|
6238
6323
|
innerRef.current?.blur();
|
|
6239
6324
|
}
|
|
6240
6325
|
}, [anchorEl, innerRef]);
|
|
6241
|
-
(0,
|
|
6242
|
-
(0,
|
|
6326
|
+
(0, import_react40.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
6327
|
+
(0, import_react40.useEffect)(() => {
|
|
6243
6328
|
setDisplayValue(getFormattedDisplayValue(value));
|
|
6244
6329
|
}, [value, getFormattedDisplayValue]);
|
|
6245
|
-
const handleChange = (0,
|
|
6330
|
+
const handleChange = (0, import_react40.useCallback)(
|
|
6246
6331
|
(event) => {
|
|
6247
6332
|
const newValue = event.target.value;
|
|
6248
6333
|
setValue(newValue);
|
|
@@ -6252,21 +6337,21 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6252
6337
|
},
|
|
6253
6338
|
[setValue, getFormattedDisplayValue, isControlled]
|
|
6254
6339
|
);
|
|
6255
|
-
const handleCalendarToggle = (0,
|
|
6340
|
+
const handleCalendarToggle = (0, import_react40.useCallback)(
|
|
6256
6341
|
(event) => {
|
|
6257
6342
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
6258
6343
|
innerRef.current?.focus();
|
|
6259
6344
|
},
|
|
6260
6345
|
[anchorEl, setAnchorEl, innerRef]
|
|
6261
6346
|
);
|
|
6262
|
-
const handleInputMouseDown = (0,
|
|
6347
|
+
const handleInputMouseDown = (0, import_react40.useCallback)(
|
|
6263
6348
|
(event) => {
|
|
6264
6349
|
event.preventDefault();
|
|
6265
6350
|
buttonRef.current?.focus();
|
|
6266
6351
|
},
|
|
6267
6352
|
[buttonRef]
|
|
6268
6353
|
);
|
|
6269
|
-
return /* @__PURE__ */
|
|
6354
|
+
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
6355
|
Input_default,
|
|
6271
6356
|
{
|
|
6272
6357
|
...innerProps,
|
|
@@ -6296,7 +6381,7 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6296
6381
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
6297
6382
|
fontFamily: "monospace"
|
|
6298
6383
|
},
|
|
6299
|
-
endDecorator: /* @__PURE__ */
|
|
6384
|
+
endDecorator: /* @__PURE__ */ import_react40.default.createElement(
|
|
6300
6385
|
IconButton_default,
|
|
6301
6386
|
{
|
|
6302
6387
|
ref: buttonRef,
|
|
@@ -6308,12 +6393,12 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6308
6393
|
"aria-expanded": open,
|
|
6309
6394
|
disabled
|
|
6310
6395
|
},
|
|
6311
|
-
/* @__PURE__ */
|
|
6396
|
+
/* @__PURE__ */ import_react40.default.createElement(import_CalendarToday3.default, null)
|
|
6312
6397
|
),
|
|
6313
6398
|
label,
|
|
6314
6399
|
helperText
|
|
6315
6400
|
}
|
|
6316
|
-
), open && /* @__PURE__ */
|
|
6401
|
+
), open && /* @__PURE__ */ import_react40.default.createElement(import_base5.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react40.default.createElement(
|
|
6317
6402
|
StyledPopper3,
|
|
6318
6403
|
{
|
|
6319
6404
|
id: "month-picker-popper",
|
|
@@ -6332,7 +6417,7 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6332
6417
|
"aria-label": "Calendar Tooltip",
|
|
6333
6418
|
"aria-expanded": open
|
|
6334
6419
|
},
|
|
6335
|
-
/* @__PURE__ */
|
|
6420
|
+
/* @__PURE__ */ import_react40.default.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react40.default.createElement(
|
|
6336
6421
|
Calendar_default,
|
|
6337
6422
|
{
|
|
6338
6423
|
view: "month",
|
|
@@ -6353,14 +6438,14 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6353
6438
|
disablePast,
|
|
6354
6439
|
locale
|
|
6355
6440
|
}
|
|
6356
|
-
), /* @__PURE__ */
|
|
6441
|
+
), /* @__PURE__ */ import_react40.default.createElement(
|
|
6357
6442
|
DialogActions_default,
|
|
6358
6443
|
{
|
|
6359
6444
|
sx: {
|
|
6360
6445
|
p: 1
|
|
6361
6446
|
}
|
|
6362
6447
|
},
|
|
6363
|
-
/* @__PURE__ */
|
|
6448
|
+
/* @__PURE__ */ import_react40.default.createElement(
|
|
6364
6449
|
Button_default,
|
|
6365
6450
|
{
|
|
6366
6451
|
size,
|
|
@@ -6383,7 +6468,7 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6383
6468
|
});
|
|
6384
6469
|
|
|
6385
6470
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
6386
|
-
var
|
|
6471
|
+
var import_react41 = __toESM(require("react"));
|
|
6387
6472
|
var import_react_imask3 = require("react-imask");
|
|
6388
6473
|
var import_CalendarToday4 = __toESM(require("@mui/icons-material/CalendarToday"));
|
|
6389
6474
|
var import_joy52 = require("@mui/joy");
|
|
@@ -6444,9 +6529,9 @@ var parseDates2 = (str) => {
|
|
|
6444
6529
|
var formatToPattern3 = (format) => {
|
|
6445
6530
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
|
|
6446
6531
|
};
|
|
6447
|
-
var TextMaskAdapter7 =
|
|
6532
|
+
var TextMaskAdapter7 = import_react41.default.forwardRef(function TextMaskAdapter8(props, ref) {
|
|
6448
6533
|
const { onChange, format, ...other } = props;
|
|
6449
|
-
return /* @__PURE__ */
|
|
6534
|
+
return /* @__PURE__ */ import_react41.default.createElement(
|
|
6450
6535
|
import_react_imask3.IMaskInput,
|
|
6451
6536
|
{
|
|
6452
6537
|
...other,
|
|
@@ -6474,7 +6559,7 @@ var TextMaskAdapter7 = import_react40.default.forwardRef(function TextMaskAdapte
|
|
|
6474
6559
|
}
|
|
6475
6560
|
);
|
|
6476
6561
|
});
|
|
6477
|
-
var MonthRangePicker = (0,
|
|
6562
|
+
var MonthRangePicker = (0, import_react41.forwardRef)((inProps, ref) => {
|
|
6478
6563
|
const props = (0, import_joy52.useThemeProps)({ props: inProps, name: "MonthRangePicker" });
|
|
6479
6564
|
const {
|
|
6480
6565
|
onChange,
|
|
@@ -6498,24 +6583,24 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6498
6583
|
} = props;
|
|
6499
6584
|
const displayFormat = displayFormatProp ?? format;
|
|
6500
6585
|
const isAlphabeticDisplay = hasAlphabeticMonth3(displayFormat);
|
|
6501
|
-
const innerRef = (0,
|
|
6502
|
-
const buttonRef = (0,
|
|
6586
|
+
const innerRef = (0, import_react41.useRef)(null);
|
|
6587
|
+
const buttonRef = (0, import_react41.useRef)(null);
|
|
6503
6588
|
const [rawValue, setValue] = useControlledState(
|
|
6504
6589
|
props.value,
|
|
6505
6590
|
props.defaultValue ?? null,
|
|
6506
|
-
(0,
|
|
6591
|
+
(0, import_react41.useCallback)(
|
|
6507
6592
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
6508
6593
|
[props.name, onChange]
|
|
6509
6594
|
)
|
|
6510
6595
|
);
|
|
6511
6596
|
const value = rawValue ?? "";
|
|
6512
|
-
const [displayValue, setDisplayValue] = (0,
|
|
6597
|
+
const [displayValue, setDisplayValue] = (0, import_react41.useState)(
|
|
6513
6598
|
() => value ? formatValueString4(parseDates2(value), displayFormat, locale) : ""
|
|
6514
6599
|
);
|
|
6515
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
6600
|
+
const [anchorEl, setAnchorEl] = (0, import_react41.useState)(null);
|
|
6516
6601
|
const open = Boolean(anchorEl);
|
|
6517
|
-
const calendarValue = (0,
|
|
6518
|
-
(0,
|
|
6602
|
+
const calendarValue = (0, import_react41.useMemo)(() => value ? parseDates2(value) : void 0, [value]);
|
|
6603
|
+
(0, import_react41.useEffect)(() => {
|
|
6519
6604
|
if (value) {
|
|
6520
6605
|
try {
|
|
6521
6606
|
const dates = parseDates2(value);
|
|
@@ -6527,13 +6612,13 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6527
6612
|
setDisplayValue("");
|
|
6528
6613
|
}
|
|
6529
6614
|
}, [displayFormat, locale, value]);
|
|
6530
|
-
(0,
|
|
6615
|
+
(0, import_react41.useEffect)(() => {
|
|
6531
6616
|
if (!anchorEl) {
|
|
6532
6617
|
innerRef.current?.blur();
|
|
6533
6618
|
}
|
|
6534
6619
|
}, [anchorEl, innerRef]);
|
|
6535
|
-
(0,
|
|
6536
|
-
const handleChange = (0,
|
|
6620
|
+
(0, import_react41.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
6621
|
+
const handleChange = (0, import_react41.useCallback)(
|
|
6537
6622
|
(event) => {
|
|
6538
6623
|
setDisplayValue(
|
|
6539
6624
|
event.target.value ? formatValueString4(parseDates2(event.target.value), displayFormat, locale) : ""
|
|
@@ -6542,7 +6627,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6542
6627
|
},
|
|
6543
6628
|
[displayFormat, locale, setValue]
|
|
6544
6629
|
);
|
|
6545
|
-
const handleInputMouseDown = (0,
|
|
6630
|
+
const handleInputMouseDown = (0, import_react41.useCallback)(
|
|
6546
6631
|
(event) => {
|
|
6547
6632
|
if (isAlphabeticDisplay) {
|
|
6548
6633
|
event.preventDefault();
|
|
@@ -6551,14 +6636,14 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6551
6636
|
},
|
|
6552
6637
|
[isAlphabeticDisplay, buttonRef]
|
|
6553
6638
|
);
|
|
6554
|
-
const handleCalendarToggle = (0,
|
|
6639
|
+
const handleCalendarToggle = (0, import_react41.useCallback)(
|
|
6555
6640
|
(event) => {
|
|
6556
6641
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
6557
6642
|
innerRef.current?.focus();
|
|
6558
6643
|
},
|
|
6559
6644
|
[anchorEl, setAnchorEl, innerRef]
|
|
6560
6645
|
);
|
|
6561
|
-
const handleCalendarChange = (0,
|
|
6646
|
+
const handleCalendarChange = (0, import_react41.useCallback)(
|
|
6562
6647
|
([date1, date2]) => {
|
|
6563
6648
|
if (!date1 || !date2) return;
|
|
6564
6649
|
const formattedValue = formatValueString4([date1, date2], format);
|
|
@@ -6568,7 +6653,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6568
6653
|
},
|
|
6569
6654
|
[setValue, setAnchorEl, format, displayFormat, locale]
|
|
6570
6655
|
);
|
|
6571
|
-
return /* @__PURE__ */
|
|
6656
|
+
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
6657
|
Input_default,
|
|
6573
6658
|
{
|
|
6574
6659
|
...innerProps,
|
|
@@ -6598,7 +6683,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6598
6683
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
6599
6684
|
fontFamily: "monospace"
|
|
6600
6685
|
},
|
|
6601
|
-
endDecorator: /* @__PURE__ */
|
|
6686
|
+
endDecorator: /* @__PURE__ */ import_react41.default.createElement(
|
|
6602
6687
|
IconButton_default,
|
|
6603
6688
|
{
|
|
6604
6689
|
ref: buttonRef,
|
|
@@ -6609,12 +6694,12 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6609
6694
|
"aria-haspopup": "dialog",
|
|
6610
6695
|
"aria-expanded": open
|
|
6611
6696
|
},
|
|
6612
|
-
/* @__PURE__ */
|
|
6697
|
+
/* @__PURE__ */ import_react41.default.createElement(import_CalendarToday4.default, null)
|
|
6613
6698
|
),
|
|
6614
6699
|
label,
|
|
6615
6700
|
helperText
|
|
6616
6701
|
}
|
|
6617
|
-
), open && /* @__PURE__ */
|
|
6702
|
+
), open && /* @__PURE__ */ import_react41.default.createElement(import_base6.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react41.default.createElement(
|
|
6618
6703
|
StyledPopper4,
|
|
6619
6704
|
{
|
|
6620
6705
|
id: "month-range-picker-popper",
|
|
@@ -6633,7 +6718,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6633
6718
|
"aria-label": "Calendar Tooltip",
|
|
6634
6719
|
"aria-expanded": open
|
|
6635
6720
|
},
|
|
6636
|
-
/* @__PURE__ */
|
|
6721
|
+
/* @__PURE__ */ import_react41.default.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react41.default.createElement(
|
|
6637
6722
|
Calendar_default,
|
|
6638
6723
|
{
|
|
6639
6724
|
view: "month",
|
|
@@ -6647,14 +6732,14 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6647
6732
|
disablePast,
|
|
6648
6733
|
locale
|
|
6649
6734
|
}
|
|
6650
|
-
), /* @__PURE__ */
|
|
6735
|
+
), /* @__PURE__ */ import_react41.default.createElement(
|
|
6651
6736
|
DialogActions_default,
|
|
6652
6737
|
{
|
|
6653
6738
|
sx: {
|
|
6654
6739
|
p: 1
|
|
6655
6740
|
}
|
|
6656
6741
|
},
|
|
6657
|
-
/* @__PURE__ */
|
|
6742
|
+
/* @__PURE__ */ import_react41.default.createElement(
|
|
6658
6743
|
Button_default,
|
|
6659
6744
|
{
|
|
6660
6745
|
size,
|
|
@@ -6673,7 +6758,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6673
6758
|
MonthRangePicker.displayName = "MonthRangePicker";
|
|
6674
6759
|
|
|
6675
6760
|
// src/components/NavigationGroup/NavigationGroup.tsx
|
|
6676
|
-
var
|
|
6761
|
+
var import_react42 = __toESM(require("react"));
|
|
6677
6762
|
var import_joy53 = require("@mui/joy");
|
|
6678
6763
|
var AccordionSummary2 = (0, import_joy53.styled)(import_joy53.AccordionSummary, {
|
|
6679
6764
|
name: "NavigationGroup",
|
|
@@ -6697,11 +6782,11 @@ var AccordionDetails2 = (0, import_joy53.styled)(import_joy53.AccordionDetails,
|
|
|
6697
6782
|
}));
|
|
6698
6783
|
function NavigationGroup(props) {
|
|
6699
6784
|
const { title, children, startDecorator, level, ...rest } = props;
|
|
6700
|
-
return /* @__PURE__ */
|
|
6785
|
+
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
6786
|
}
|
|
6702
6787
|
|
|
6703
6788
|
// src/components/NavigationItem/NavigationItem.tsx
|
|
6704
|
-
var
|
|
6789
|
+
var import_react43 = __toESM(require("react"));
|
|
6705
6790
|
var import_joy54 = require("@mui/joy");
|
|
6706
6791
|
var ListItemButton = (0, import_joy54.styled)(import_joy54.ListItemButton, {
|
|
6707
6792
|
name: "NavigationItem",
|
|
@@ -6730,7 +6815,7 @@ function NavigationItem(props) {
|
|
|
6730
6815
|
const handleClick = () => {
|
|
6731
6816
|
onClick?.(id);
|
|
6732
6817
|
};
|
|
6733
|
-
return /* @__PURE__ */
|
|
6818
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_joy54.ListItem, { ...rest }, /* @__PURE__ */ import_react43.default.createElement(
|
|
6734
6819
|
ListItemButton,
|
|
6735
6820
|
{
|
|
6736
6821
|
level,
|
|
@@ -6739,21 +6824,21 @@ function NavigationItem(props) {
|
|
|
6739
6824
|
"aria-current": selected,
|
|
6740
6825
|
onClick: handleClick
|
|
6741
6826
|
},
|
|
6742
|
-
startDecorator && /* @__PURE__ */
|
|
6827
|
+
startDecorator && /* @__PURE__ */ import_react43.default.createElement(import_joy54.ListItemDecorator, null, startDecorator),
|
|
6743
6828
|
children
|
|
6744
6829
|
));
|
|
6745
6830
|
}
|
|
6746
6831
|
|
|
6747
6832
|
// src/components/Navigator/Navigator.tsx
|
|
6748
|
-
var
|
|
6833
|
+
var import_react44 = __toESM(require("react"));
|
|
6749
6834
|
function Navigator(props) {
|
|
6750
6835
|
const { items, level = 0, onSelect } = props;
|
|
6751
6836
|
const handleItemClick = (id) => {
|
|
6752
6837
|
onSelect?.(id);
|
|
6753
6838
|
};
|
|
6754
|
-
return /* @__PURE__ */
|
|
6839
|
+
return /* @__PURE__ */ import_react44.default.createElement("div", null, items.map((item, index) => {
|
|
6755
6840
|
if (item.type === "item") {
|
|
6756
|
-
return /* @__PURE__ */
|
|
6841
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
6757
6842
|
NavigationItem,
|
|
6758
6843
|
{
|
|
6759
6844
|
key: item.id,
|
|
@@ -6766,7 +6851,7 @@ function Navigator(props) {
|
|
|
6766
6851
|
item.title
|
|
6767
6852
|
);
|
|
6768
6853
|
} else if (item.type === "group") {
|
|
6769
|
-
return /* @__PURE__ */
|
|
6854
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
6770
6855
|
NavigationGroup,
|
|
6771
6856
|
{
|
|
6772
6857
|
key: `${item.title}-${index}`,
|
|
@@ -6784,16 +6869,16 @@ function Navigator(props) {
|
|
|
6784
6869
|
Navigator.displayName = "Navigator";
|
|
6785
6870
|
|
|
6786
6871
|
// src/components/PercentageInput/PercentageInput.tsx
|
|
6787
|
-
var
|
|
6872
|
+
var import_react45 = __toESM(require("react"));
|
|
6788
6873
|
var import_react_number_format2 = require("react-number-format");
|
|
6789
6874
|
var import_joy55 = require("@mui/joy");
|
|
6790
6875
|
var padDecimal = (value, decimalScale) => {
|
|
6791
6876
|
const [integer, decimal = ""] = `${value}`.split(".");
|
|
6792
6877
|
return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
|
|
6793
6878
|
};
|
|
6794
|
-
var TextMaskAdapter9 =
|
|
6879
|
+
var TextMaskAdapter9 = import_react45.default.forwardRef(function TextMaskAdapter10(props, ref) {
|
|
6795
6880
|
const { onChange, min, max, ...innerProps } = props;
|
|
6796
|
-
return /* @__PURE__ */
|
|
6881
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
6797
6882
|
import_react_number_format2.NumericFormat,
|
|
6798
6883
|
{
|
|
6799
6884
|
...innerProps,
|
|
@@ -6818,7 +6903,7 @@ var PercentageInputRoot = (0, import_joy55.styled)(Input_default, {
|
|
|
6818
6903
|
slot: "Root",
|
|
6819
6904
|
overridesResolver: (props, styles) => styles.root
|
|
6820
6905
|
})({});
|
|
6821
|
-
var PercentageInput =
|
|
6906
|
+
var PercentageInput = import_react45.default.forwardRef(
|
|
6822
6907
|
function PercentageInput2(inProps, ref) {
|
|
6823
6908
|
const props = (0, import_joy55.useThemeProps)({ props: inProps, name: "PercentageInput" });
|
|
6824
6909
|
const {
|
|
@@ -6841,19 +6926,19 @@ var PercentageInput = import_react44.default.forwardRef(
|
|
|
6841
6926
|
const [_value, setValue] = useControlledState(
|
|
6842
6927
|
props.value,
|
|
6843
6928
|
props.defaultValue ?? null,
|
|
6844
|
-
(0,
|
|
6929
|
+
(0, import_react45.useCallback)((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
6845
6930
|
);
|
|
6846
|
-
const value = (0,
|
|
6931
|
+
const value = (0, import_react45.useMemo)(() => {
|
|
6847
6932
|
if (_value && useMinorUnit) {
|
|
6848
6933
|
return _value / Math.pow(10, maxDecimalScale);
|
|
6849
6934
|
}
|
|
6850
6935
|
return _value;
|
|
6851
6936
|
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
6852
|
-
const internalError = (0,
|
|
6937
|
+
const internalError = (0, import_react45.useMemo)(
|
|
6853
6938
|
() => value != null && (max != null && value > max || min != null && value < min),
|
|
6854
6939
|
[max, min, value]
|
|
6855
6940
|
);
|
|
6856
|
-
const handleChange = (0,
|
|
6941
|
+
const handleChange = (0, import_react45.useCallback)(
|
|
6857
6942
|
(event) => {
|
|
6858
6943
|
if (event.target.value === "") {
|
|
6859
6944
|
setValue(null);
|
|
@@ -6865,7 +6950,7 @@ var PercentageInput = import_react44.default.forwardRef(
|
|
|
6865
6950
|
},
|
|
6866
6951
|
[setValue, useMinorUnit, maxDecimalScale]
|
|
6867
6952
|
);
|
|
6868
|
-
return /* @__PURE__ */
|
|
6953
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
6869
6954
|
PercentageInputRoot,
|
|
6870
6955
|
{
|
|
6871
6956
|
...innerProps,
|
|
@@ -6906,7 +6991,7 @@ var RadioGroup = MotionRadioGroup;
|
|
|
6906
6991
|
RadioGroup.displayName = "RadioGroup";
|
|
6907
6992
|
|
|
6908
6993
|
// src/components/RadioTileGroup/RadioTileGroup.tsx
|
|
6909
|
-
var
|
|
6994
|
+
var import_react46 = __toESM(require("react"));
|
|
6910
6995
|
var import_joy57 = require("@mui/joy");
|
|
6911
6996
|
var RadioTileGroupRoot = (0, import_joy57.styled)(RadioGroup, {
|
|
6912
6997
|
name: "RadioTileGroup",
|
|
@@ -6994,7 +7079,7 @@ function RadioTileGroup(props) {
|
|
|
6994
7079
|
error,
|
|
6995
7080
|
required
|
|
6996
7081
|
} = props;
|
|
6997
|
-
const radioGroup = /* @__PURE__ */
|
|
7082
|
+
const radioGroup = /* @__PURE__ */ import_react46.default.createElement(
|
|
6998
7083
|
RadioTileGroupRoot,
|
|
6999
7084
|
{
|
|
7000
7085
|
overlay: true,
|
|
@@ -7005,7 +7090,7 @@ function RadioTileGroup(props) {
|
|
|
7005
7090
|
flex,
|
|
7006
7091
|
columns
|
|
7007
7092
|
},
|
|
7008
|
-
options.map((option) => /* @__PURE__ */
|
|
7093
|
+
options.map((option) => /* @__PURE__ */ import_react46.default.createElement(
|
|
7009
7094
|
RadioTileSheet,
|
|
7010
7095
|
{
|
|
7011
7096
|
key: option.value,
|
|
@@ -7015,7 +7100,7 @@ function RadioTileGroup(props) {
|
|
|
7015
7100
|
flex,
|
|
7016
7101
|
textAlign
|
|
7017
7102
|
},
|
|
7018
|
-
/* @__PURE__ */
|
|
7103
|
+
/* @__PURE__ */ import_react46.default.createElement(
|
|
7019
7104
|
Radio,
|
|
7020
7105
|
{
|
|
7021
7106
|
id: `${option.value}`,
|
|
@@ -7044,7 +7129,7 @@ function RadioTileGroup(props) {
|
|
|
7044
7129
|
}
|
|
7045
7130
|
}
|
|
7046
7131
|
),
|
|
7047
|
-
option.startDecorator && /* @__PURE__ */
|
|
7132
|
+
option.startDecorator && /* @__PURE__ */ import_react46.default.createElement(
|
|
7048
7133
|
Box_default,
|
|
7049
7134
|
{
|
|
7050
7135
|
sx: {
|
|
@@ -7065,15 +7150,15 @@ function RadioTileGroup(props) {
|
|
|
7065
7150
|
)
|
|
7066
7151
|
))
|
|
7067
7152
|
);
|
|
7068
|
-
return /* @__PURE__ */
|
|
7153
|
+
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
7154
|
}
|
|
7070
7155
|
RadioTileGroup.displayName = "RadioTileGroup";
|
|
7071
7156
|
|
|
7072
7157
|
// src/components/RadioList/RadioList.tsx
|
|
7073
|
-
var
|
|
7158
|
+
var import_react47 = __toESM(require("react"));
|
|
7074
7159
|
function RadioList(props) {
|
|
7075
7160
|
const { items, ...innerProps } = props;
|
|
7076
|
-
return /* @__PURE__ */
|
|
7161
|
+
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
7162
|
}
|
|
7078
7163
|
RadioList.displayName = "RadioList";
|
|
7079
7164
|
|
|
@@ -7164,7 +7249,7 @@ var SearchBar = React44.forwardRef(function SearchBar2(inProps, ref) {
|
|
|
7164
7249
|
SearchBar.displayName = "SearchBar";
|
|
7165
7250
|
|
|
7166
7251
|
// src/components/Stepper/Stepper.tsx
|
|
7167
|
-
var
|
|
7252
|
+
var import_react48 = __toESM(require("react"));
|
|
7168
7253
|
var import_joy58 = require("@mui/joy");
|
|
7169
7254
|
var import_Check = __toESM(require("@mui/icons-material/Check"));
|
|
7170
7255
|
var import_framer_motion28 = require("framer-motion");
|
|
@@ -7193,7 +7278,7 @@ function Stepper(props) {
|
|
|
7193
7278
|
stepOrientation = "horizontal"
|
|
7194
7279
|
} = props;
|
|
7195
7280
|
const effectiveStepOrientation = orientation === "vertical" ? "horizontal" : stepOrientation;
|
|
7196
|
-
return /* @__PURE__ */
|
|
7281
|
+
return /* @__PURE__ */ import_react48.default.createElement(
|
|
7197
7282
|
MotionStepper,
|
|
7198
7283
|
{
|
|
7199
7284
|
orientation,
|
|
@@ -7232,23 +7317,23 @@ function Stepper(props) {
|
|
|
7232
7317
|
const completed = activeStep > i + 1;
|
|
7233
7318
|
const disabled = activeStep < i + 1;
|
|
7234
7319
|
const hasContent = step.label || step.extraContent;
|
|
7235
|
-
return /* @__PURE__ */
|
|
7320
|
+
return /* @__PURE__ */ import_react48.default.createElement(
|
|
7236
7321
|
Step,
|
|
7237
7322
|
{
|
|
7238
7323
|
key: `step-${i}`,
|
|
7239
|
-
indicator: /* @__PURE__ */
|
|
7324
|
+
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
7325
|
active,
|
|
7241
7326
|
completed,
|
|
7242
7327
|
disabled,
|
|
7243
7328
|
orientation: effectiveStepOrientation
|
|
7244
7329
|
},
|
|
7245
|
-
hasContent && /* @__PURE__ */
|
|
7330
|
+
hasContent && /* @__PURE__ */ import_react48.default.createElement(
|
|
7246
7331
|
Stack_default,
|
|
7247
7332
|
{
|
|
7248
7333
|
sx: orientation === "horizontal" && effectiveStepOrientation === "vertical" ? { alignItems: "center" } : {}
|
|
7249
7334
|
},
|
|
7250
|
-
step.label && /* @__PURE__ */
|
|
7251
|
-
step.extraContent && /* @__PURE__ */
|
|
7335
|
+
step.label && /* @__PURE__ */ import_react48.default.createElement(Typography_default, { level: "title-sm" }, step.label),
|
|
7336
|
+
step.extraContent && /* @__PURE__ */ import_react48.default.createElement(Typography_default, { level: "body-xs" }, step.extraContent)
|
|
7252
7337
|
)
|
|
7253
7338
|
);
|
|
7254
7339
|
})
|
|
@@ -7257,7 +7342,7 @@ function Stepper(props) {
|
|
|
7257
7342
|
Stepper.displayName = "Stepper";
|
|
7258
7343
|
|
|
7259
7344
|
// src/components/Switch/Switch.tsx
|
|
7260
|
-
var
|
|
7345
|
+
var import_react49 = __toESM(require("react"));
|
|
7261
7346
|
var import_joy59 = require("@mui/joy");
|
|
7262
7347
|
var import_framer_motion29 = require("framer-motion");
|
|
7263
7348
|
var MotionSwitch = (0, import_framer_motion29.motion)(import_joy59.Switch);
|
|
@@ -7279,14 +7364,14 @@ var StyledThumb = (0, import_joy59.styled)(import_framer_motion29.motion.div)({
|
|
|
7279
7364
|
right: "var(--Switch-thumbOffset)"
|
|
7280
7365
|
}
|
|
7281
7366
|
});
|
|
7282
|
-
var Thumb = (props) => /* @__PURE__ */
|
|
7367
|
+
var Thumb = (props) => /* @__PURE__ */ import_react49.default.createElement(StyledThumb, { ...props, layout: true, transition: spring });
|
|
7283
7368
|
var spring = {
|
|
7284
7369
|
type: "spring",
|
|
7285
7370
|
stiffness: 700,
|
|
7286
7371
|
damping: 30
|
|
7287
7372
|
};
|
|
7288
7373
|
var Switch = (props) => {
|
|
7289
|
-
return /* @__PURE__ */
|
|
7374
|
+
return /* @__PURE__ */ import_react49.default.createElement(
|
|
7290
7375
|
MotionSwitch,
|
|
7291
7376
|
{
|
|
7292
7377
|
...props,
|
|
@@ -7300,7 +7385,7 @@ var Switch = (props) => {
|
|
|
7300
7385
|
Switch.displayName = "Switch";
|
|
7301
7386
|
|
|
7302
7387
|
// src/components/Tabs/Tabs.tsx
|
|
7303
|
-
var
|
|
7388
|
+
var import_react50 = __toESM(require("react"));
|
|
7304
7389
|
var import_joy60 = require("@mui/joy");
|
|
7305
7390
|
var StyledTabs = (0, import_joy60.styled)(import_joy60.Tabs)(({ theme }) => ({
|
|
7306
7391
|
backgroundColor: theme.palette.background.body
|
|
@@ -7316,15 +7401,15 @@ var StyledTab = (0, import_joy60.styled)(import_joy60.Tab)(({ theme }) => ({
|
|
|
7316
7401
|
backgroundColor: theme.palette.background.body
|
|
7317
7402
|
}
|
|
7318
7403
|
}));
|
|
7319
|
-
var Tab = (0,
|
|
7320
|
-
return /* @__PURE__ */
|
|
7404
|
+
var Tab = (0, import_react50.forwardRef)(function Tab2({ startDecorator, endDecorator, children, ...props }, ref) {
|
|
7405
|
+
return /* @__PURE__ */ import_react50.default.createElement(StyledTab, { ...props, ref }, startDecorator, children, endDecorator);
|
|
7321
7406
|
});
|
|
7322
7407
|
Tab.displayName = "Tab";
|
|
7323
7408
|
var TabList = import_joy60.TabList;
|
|
7324
7409
|
var TabPanel = import_joy60.TabPanel;
|
|
7325
7410
|
|
|
7326
7411
|
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
7327
|
-
var
|
|
7412
|
+
var import_react51 = __toESM(require("react"));
|
|
7328
7413
|
var import_joy61 = require("@mui/joy");
|
|
7329
7414
|
var colorScheme = {
|
|
7330
7415
|
palette: {
|
|
@@ -7590,12 +7675,12 @@ var defaultTheme = (0, import_joy61.extendTheme)({
|
|
|
7590
7675
|
});
|
|
7591
7676
|
function ThemeProvider(props) {
|
|
7592
7677
|
const theme = props.theme || defaultTheme;
|
|
7593
|
-
return /* @__PURE__ */
|
|
7678
|
+
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
7679
|
}
|
|
7595
7680
|
ThemeProvider.displayName = "ThemeProvider";
|
|
7596
7681
|
|
|
7597
7682
|
// src/components/Uploader/Uploader.tsx
|
|
7598
|
-
var
|
|
7683
|
+
var import_react52 = __toESM(require("react"));
|
|
7599
7684
|
var import_joy62 = require("@mui/joy");
|
|
7600
7685
|
var import_CloudUploadRounded = __toESM(require("@mui/icons-material/CloudUploadRounded"));
|
|
7601
7686
|
var import_UploadFileRounded = __toESM(require("@mui/icons-material/UploadFileRounded"));
|
|
@@ -7658,7 +7743,7 @@ var getFileSize = (n) => {
|
|
|
7658
7743
|
};
|
|
7659
7744
|
var Preview = (props) => {
|
|
7660
7745
|
const { files, uploaded, onDelete } = props;
|
|
7661
|
-
return /* @__PURE__ */
|
|
7746
|
+
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
7747
|
Typography_default,
|
|
7663
7748
|
{
|
|
7664
7749
|
level: "body-sm",
|
|
@@ -7670,7 +7755,7 @@ var Preview = (props) => {
|
|
|
7670
7755
|
}
|
|
7671
7756
|
},
|
|
7672
7757
|
file.name
|
|
7673
|
-
), !!file.size && /* @__PURE__ */
|
|
7758
|
+
), !!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
7759
|
};
|
|
7675
7760
|
var UploaderRoot = (0, import_joy62.styled)(Stack_default, {
|
|
7676
7761
|
name: "Uploader",
|
|
@@ -7713,7 +7798,7 @@ var UploaderIcon = (0, import_joy62.styled)(import_CloudUploadRounded.default, {
|
|
|
7713
7798
|
}
|
|
7714
7799
|
})
|
|
7715
7800
|
);
|
|
7716
|
-
var Uploader =
|
|
7801
|
+
var Uploader = import_react52.default.memo((props) => {
|
|
7717
7802
|
const {
|
|
7718
7803
|
accept,
|
|
7719
7804
|
minCount,
|
|
@@ -7729,14 +7814,14 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7729
7814
|
error: errorProp,
|
|
7730
7815
|
helperText: helperTextProp
|
|
7731
7816
|
} = 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,
|
|
7817
|
+
const dropZoneRef = (0, import_react52.useRef)(null);
|
|
7818
|
+
const inputRef = (0, import_react52.useRef)(null);
|
|
7819
|
+
const [errorText, setErrorText] = (0, import_react52.useState)();
|
|
7820
|
+
const [files, setFiles] = (0, import_react52.useState)([]);
|
|
7821
|
+
const [uploaded, setUploaded] = (0, import_react52.useState)(props.uploaded || []);
|
|
7822
|
+
const [previewState, setPreviewState] = (0, import_react52.useState)("idle");
|
|
7823
|
+
const accepts = (0, import_react52.useMemo)(() => accept.split(",").map((accept2) => accept2.trim()), [accept]);
|
|
7824
|
+
const parsedAccepts = (0, import_react52.useMemo)(
|
|
7740
7825
|
() => accepts.flatMap((type) => {
|
|
7741
7826
|
if (["image/*", "video/*", "audio/*"].includes(type)) {
|
|
7742
7827
|
return ALL_EXTENSIONS_BY_TYPE[type];
|
|
@@ -7745,7 +7830,7 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7745
7830
|
}),
|
|
7746
7831
|
[accepts]
|
|
7747
7832
|
);
|
|
7748
|
-
const helperText = (0,
|
|
7833
|
+
const helperText = (0, import_react52.useMemo)(() => {
|
|
7749
7834
|
if (helperTextProp) {
|
|
7750
7835
|
return helperTextProp;
|
|
7751
7836
|
}
|
|
@@ -7775,12 +7860,12 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7775
7860
|
}
|
|
7776
7861
|
return helperTexts.join(", ");
|
|
7777
7862
|
}, [accepts, maxFileTotalSize, maxCount, helperTextProp]);
|
|
7778
|
-
const error = (0,
|
|
7779
|
-
const showDropZone = (0,
|
|
7863
|
+
const error = (0, import_react52.useMemo)(() => !!errorText || errorProp, [errorProp, errorText]);
|
|
7864
|
+
const showDropZone = (0, import_react52.useMemo)(
|
|
7780
7865
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
7781
7866
|
[files, maxCount, uploaded]
|
|
7782
7867
|
);
|
|
7783
|
-
const addFiles = (0,
|
|
7868
|
+
const addFiles = (0, import_react52.useCallback)(
|
|
7784
7869
|
(uploads) => {
|
|
7785
7870
|
try {
|
|
7786
7871
|
const types = parsedAccepts.map((type) => type.replace(".", "")) || [];
|
|
@@ -7825,7 +7910,7 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7825
7910
|
},
|
|
7826
7911
|
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
7827
7912
|
);
|
|
7828
|
-
(0,
|
|
7913
|
+
(0, import_react52.useEffect)(() => {
|
|
7829
7914
|
if (!dropZoneRef.current || disabled) {
|
|
7830
7915
|
return;
|
|
7831
7916
|
}
|
|
@@ -7853,7 +7938,7 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7853
7938
|
})
|
|
7854
7939
|
);
|
|
7855
7940
|
}, [disabled, addFiles]);
|
|
7856
|
-
(0,
|
|
7941
|
+
(0, import_react52.useEffect)(() => {
|
|
7857
7942
|
if (inputRef.current && minCount) {
|
|
7858
7943
|
if (files.length < minCount) {
|
|
7859
7944
|
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
@@ -7862,14 +7947,14 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7862
7947
|
}
|
|
7863
7948
|
}
|
|
7864
7949
|
}, [inputRef, files, minCount]);
|
|
7865
|
-
const handleFileChanged = (0,
|
|
7950
|
+
const handleFileChanged = (0, import_react52.useCallback)(
|
|
7866
7951
|
(event) => {
|
|
7867
7952
|
const files2 = Array.from(event.target.files || []);
|
|
7868
7953
|
addFiles(files2);
|
|
7869
7954
|
},
|
|
7870
7955
|
[addFiles]
|
|
7871
7956
|
);
|
|
7872
|
-
const handleDeleteFile = (0,
|
|
7957
|
+
const handleDeleteFile = (0, import_react52.useCallback)(
|
|
7873
7958
|
(deletedFile) => {
|
|
7874
7959
|
if (deletedFile instanceof File) {
|
|
7875
7960
|
setFiles((current) => {
|
|
@@ -7889,10 +7974,10 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7889
7974
|
},
|
|
7890
7975
|
[name, onChange, onDelete]
|
|
7891
7976
|
);
|
|
7892
|
-
const handleUploaderButtonClick = (0,
|
|
7977
|
+
const handleUploaderButtonClick = (0, import_react52.useCallback)(() => {
|
|
7893
7978
|
inputRef.current?.click();
|
|
7894
7979
|
}, []);
|
|
7895
|
-
const uploader = /* @__PURE__ */
|
|
7980
|
+
const uploader = /* @__PURE__ */ import_react52.default.createElement(
|
|
7896
7981
|
FileDropZone,
|
|
7897
7982
|
{
|
|
7898
7983
|
state: previewState,
|
|
@@ -7901,8 +7986,8 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7901
7986
|
ref: dropZoneRef,
|
|
7902
7987
|
onClick: handleUploaderButtonClick
|
|
7903
7988
|
},
|
|
7904
|
-
/* @__PURE__ */
|
|
7905
|
-
/* @__PURE__ */
|
|
7989
|
+
/* @__PURE__ */ import_react52.default.createElement(Stack_default, { alignItems: "center", gap: 1 }, /* @__PURE__ */ import_react52.default.createElement(UploaderIcon, { state: previewState, error: !!(error || errorText), disabled })),
|
|
7990
|
+
/* @__PURE__ */ import_react52.default.createElement(
|
|
7906
7991
|
VisuallyHiddenInput,
|
|
7907
7992
|
{
|
|
7908
7993
|
disabled,
|
|
@@ -7925,6 +8010,6 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7925
8010
|
}
|
|
7926
8011
|
)
|
|
7927
8012
|
);
|
|
7928
|
-
return /* @__PURE__ */
|
|
8013
|
+
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
8014
|
});
|
|
7930
8015
|
Uploader.displayName = "Uploader";
|