@ceed/cds 1.40.2 → 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/components/inputs/DatePicker.md +1 -1
- package/dist/components/inputs/DateRangePicker.md +1 -1
- package/dist/index.browser.js +6 -6
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +736 -653
- package/dist/index.js +251 -168
- package/dist/libs/slot-props.d.ts +22 -0
- package/framer/index.js +1 -1
- package/package.json +7 -4
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,
|
|
@@ -3128,9 +3168,8 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3128
3168
|
onClick: handleInputClick
|
|
3129
3169
|
}
|
|
3130
3170
|
},
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
endDecorator: /* @__PURE__ */ import_react21.default.createElement(
|
|
3171
|
+
sx: { width: "100%" },
|
|
3172
|
+
endDecorator: /* @__PURE__ */ import_react22.default.createElement(
|
|
3134
3173
|
CalendarButton,
|
|
3135
3174
|
{
|
|
3136
3175
|
ref: buttonRef,
|
|
@@ -3142,13 +3181,13 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3142
3181
|
"aria-expanded": open,
|
|
3143
3182
|
disabled
|
|
3144
3183
|
},
|
|
3145
|
-
/* @__PURE__ */
|
|
3184
|
+
/* @__PURE__ */ import_react22.default.createElement(import_CalendarToday.default, null)
|
|
3146
3185
|
),
|
|
3147
3186
|
label,
|
|
3148
3187
|
helperText,
|
|
3149
3188
|
readOnly: readOnly || inputReadOnly || isAlphabeticDisplay
|
|
3150
3189
|
}
|
|
3151
|
-
), open && /* @__PURE__ */
|
|
3190
|
+
), open && /* @__PURE__ */ import_react22.default.createElement(import_base3.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react22.default.createElement(
|
|
3152
3191
|
StyledPopper,
|
|
3153
3192
|
{
|
|
3154
3193
|
id: "date-picker-popper",
|
|
@@ -3167,7 +3206,7 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3167
3206
|
"aria-label": "Calendar Tooltip",
|
|
3168
3207
|
"aria-expanded": open
|
|
3169
3208
|
},
|
|
3170
|
-
/* @__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(
|
|
3171
3210
|
Calendar_default,
|
|
3172
3211
|
{
|
|
3173
3212
|
value: value && !Number.isNaN(parseDate(value, format).getTime()) ? [parseDate(value, format), void 0] : void 0,
|
|
@@ -3187,14 +3226,14 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3187
3226
|
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0,
|
|
3188
3227
|
locale
|
|
3189
3228
|
}
|
|
3190
|
-
), !hideClearButton && /* @__PURE__ */
|
|
3229
|
+
), !hideClearButton && /* @__PURE__ */ import_react22.default.createElement(
|
|
3191
3230
|
DialogActions_default,
|
|
3192
3231
|
{
|
|
3193
3232
|
sx: {
|
|
3194
3233
|
p: 1
|
|
3195
3234
|
}
|
|
3196
3235
|
},
|
|
3197
|
-
/* @__PURE__ */
|
|
3236
|
+
/* @__PURE__ */ import_react22.default.createElement(
|
|
3198
3237
|
Button_default,
|
|
3199
3238
|
{
|
|
3200
3239
|
size,
|
|
@@ -3212,9 +3251,9 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3212
3251
|
},
|
|
3213
3252
|
"Clear"
|
|
3214
3253
|
)
|
|
3215
|
-
)), presets && presets.length > 0 && /* @__PURE__ */
|
|
3254
|
+
)), presets && presets.length > 0 && /* @__PURE__ */ import_react22.default.createElement(PresetPanel, null, presets.map((preset) => {
|
|
3216
3255
|
const disabled2 = isPresetDisabled(preset.value);
|
|
3217
|
-
return /* @__PURE__ */
|
|
3256
|
+
return /* @__PURE__ */ import_react22.default.createElement(
|
|
3218
3257
|
PresetItem,
|
|
3219
3258
|
{
|
|
3220
3259
|
key: preset.label,
|
|
@@ -3235,11 +3274,11 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
|
|
|
3235
3274
|
var DatePicker_default = DatePicker;
|
|
3236
3275
|
|
|
3237
3276
|
// src/components/Textarea/Textarea.tsx
|
|
3238
|
-
var
|
|
3277
|
+
var import_react23 = __toESM(require("react"));
|
|
3239
3278
|
var import_joy30 = require("@mui/joy");
|
|
3240
3279
|
var import_framer_motion19 = require("framer-motion");
|
|
3241
3280
|
var MotionTextarea = (0, import_framer_motion19.motion)(import_joy30.Textarea);
|
|
3242
|
-
var
|
|
3281
|
+
var TextareaBase = (props) => {
|
|
3243
3282
|
const {
|
|
3244
3283
|
label,
|
|
3245
3284
|
error,
|
|
@@ -3255,7 +3294,7 @@ var Textarea = (props) => {
|
|
|
3255
3294
|
className,
|
|
3256
3295
|
...innerProps
|
|
3257
3296
|
} = props;
|
|
3258
|
-
const textarea = /* @__PURE__ */
|
|
3297
|
+
const textarea = /* @__PURE__ */ import_react23.default.createElement(
|
|
3259
3298
|
MotionTextarea,
|
|
3260
3299
|
{
|
|
3261
3300
|
required,
|
|
@@ -3267,7 +3306,7 @@ var Textarea = (props) => {
|
|
|
3267
3306
|
...innerProps
|
|
3268
3307
|
}
|
|
3269
3308
|
);
|
|
3270
|
-
return /* @__PURE__ */
|
|
3309
|
+
return /* @__PURE__ */ import_react23.default.createElement(
|
|
3271
3310
|
FormControl_default,
|
|
3272
3311
|
{
|
|
3273
3312
|
required,
|
|
@@ -3278,18 +3317,22 @@ var Textarea = (props) => {
|
|
|
3278
3317
|
sx,
|
|
3279
3318
|
className
|
|
3280
3319
|
},
|
|
3281
|
-
label && /* @__PURE__ */
|
|
3320
|
+
label && /* @__PURE__ */ import_react23.default.createElement(FormLabel_default, null, label),
|
|
3282
3321
|
textarea,
|
|
3283
|
-
helperText && /* @__PURE__ */
|
|
3322
|
+
helperText && /* @__PURE__ */ import_react23.default.createElement(FormHelperText_default, null, helperText)
|
|
3284
3323
|
);
|
|
3285
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
|
+
});
|
|
3286
3329
|
Textarea.displayName = "Textarea";
|
|
3287
3330
|
|
|
3288
3331
|
// src/components/Textarea/index.ts
|
|
3289
3332
|
var Textarea_default = Textarea;
|
|
3290
3333
|
|
|
3291
3334
|
// src/components/Select/Select.tsx
|
|
3292
|
-
var
|
|
3335
|
+
var import_react24 = __toESM(require("react"));
|
|
3293
3336
|
var import_joy31 = require("@mui/joy");
|
|
3294
3337
|
var import_framer_motion20 = require("framer-motion");
|
|
3295
3338
|
var MotionOption = (0, import_framer_motion20.motion)(import_joy31.Option);
|
|
@@ -3300,7 +3343,7 @@ var secondaryTextLevelMap2 = {
|
|
|
3300
3343
|
lg: "body-md"
|
|
3301
3344
|
};
|
|
3302
3345
|
Option.displayName = "Option";
|
|
3303
|
-
function
|
|
3346
|
+
function SelectInner(props, ref) {
|
|
3304
3347
|
const {
|
|
3305
3348
|
label,
|
|
3306
3349
|
helperText,
|
|
@@ -3326,7 +3369,7 @@ function Select(props) {
|
|
|
3326
3369
|
formHelperText: formHelperTextProps,
|
|
3327
3370
|
...joySlotProps
|
|
3328
3371
|
} = slotProps ?? {};
|
|
3329
|
-
const options = (0,
|
|
3372
|
+
const options = (0, import_react24.useMemo)(
|
|
3330
3373
|
() => props.options.map((option) => {
|
|
3331
3374
|
if (option.hasOwnProperty("value") && option.hasOwnProperty("label")) {
|
|
3332
3375
|
return option;
|
|
@@ -3351,14 +3394,15 @@ function Select(props) {
|
|
|
3351
3394
|
};
|
|
3352
3395
|
onChange?.(newEvent, newValue);
|
|
3353
3396
|
};
|
|
3354
|
-
const optionMap = (0,
|
|
3397
|
+
const optionMap = (0, import_react24.useMemo)(() => {
|
|
3355
3398
|
const map = /* @__PURE__ */ new Map();
|
|
3356
3399
|
options.forEach((option) => {
|
|
3357
3400
|
map.set(option.value, option);
|
|
3358
3401
|
});
|
|
3359
3402
|
return map;
|
|
3360
3403
|
}, [options]);
|
|
3361
|
-
const
|
|
3404
|
+
const buttonSlotProps = useSlotRef(joySlotProps.button, ref);
|
|
3405
|
+
const select = /* @__PURE__ */ import_react24.default.createElement(
|
|
3362
3406
|
import_joy31.Select,
|
|
3363
3407
|
{
|
|
3364
3408
|
...innerProps,
|
|
@@ -3366,7 +3410,7 @@ function Select(props) {
|
|
|
3366
3410
|
disabled,
|
|
3367
3411
|
size,
|
|
3368
3412
|
color: error ? "danger" : color,
|
|
3369
|
-
slotProps: joySlotProps,
|
|
3413
|
+
slotProps: { ...joySlotProps, button: buttonSlotProps },
|
|
3370
3414
|
onChange: handleChange,
|
|
3371
3415
|
renderValue: (selected) => {
|
|
3372
3416
|
if (!selected) return null;
|
|
@@ -3376,9 +3420,9 @@ function Select(props) {
|
|
|
3376
3420
|
return optionMap.get(selected.value)?.label;
|
|
3377
3421
|
}
|
|
3378
3422
|
},
|
|
3379
|
-
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))
|
|
3380
3424
|
);
|
|
3381
|
-
return /* @__PURE__ */
|
|
3425
|
+
return /* @__PURE__ */ import_react24.default.createElement(
|
|
3382
3426
|
FormControl_default,
|
|
3383
3427
|
{
|
|
3384
3428
|
required,
|
|
@@ -3391,11 +3435,12 @@ function Select(props) {
|
|
|
3391
3435
|
className,
|
|
3392
3436
|
...formControlProps
|
|
3393
3437
|
},
|
|
3394
|
-
label && /* @__PURE__ */
|
|
3438
|
+
label && /* @__PURE__ */ import_react24.default.createElement(FormLabel_default, { ...formLabelProps }, label),
|
|
3395
3439
|
select,
|
|
3396
|
-
helperText && /* @__PURE__ */
|
|
3440
|
+
helperText && /* @__PURE__ */ import_react24.default.createElement(FormHelperText_default, { ...formHelperTextProps }, helperText)
|
|
3397
3441
|
);
|
|
3398
3442
|
}
|
|
3443
|
+
var Select = import_react24.default.forwardRef(SelectInner);
|
|
3399
3444
|
Select.displayName = "Select";
|
|
3400
3445
|
|
|
3401
3446
|
// src/components/Select/index.ts
|
|
@@ -3405,7 +3450,7 @@ var Select_default = Select;
|
|
|
3405
3450
|
var import_joy34 = require("@mui/joy");
|
|
3406
3451
|
|
|
3407
3452
|
// src/components/InfoSign/InfoSign.tsx
|
|
3408
|
-
var
|
|
3453
|
+
var import_react25 = __toESM(require("react"));
|
|
3409
3454
|
var import_joy32 = require("@mui/joy");
|
|
3410
3455
|
var import_Info = __toESM(require("@mui/icons-material/Info"));
|
|
3411
3456
|
var InfoIcon = (0, import_joy32.styled)(import_Info.default, {
|
|
@@ -3418,7 +3463,7 @@ var InfoIcon = (0, import_joy32.styled)(import_Info.default, {
|
|
|
3418
3463
|
}));
|
|
3419
3464
|
function InfoSign(props) {
|
|
3420
3465
|
const { message, placement } = props;
|
|
3421
|
-
return /* @__PURE__ */
|
|
3466
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
3422
3467
|
Tooltip_default,
|
|
3423
3468
|
{
|
|
3424
3469
|
arrow: true,
|
|
@@ -3428,9 +3473,9 @@ function InfoSign(props) {
|
|
|
3428
3473
|
maxWidth: "320px"
|
|
3429
3474
|
}
|
|
3430
3475
|
},
|
|
3431
|
-
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))
|
|
3432
3477
|
},
|
|
3433
|
-
/* @__PURE__ */
|
|
3478
|
+
/* @__PURE__ */ import_react25.default.createElement(InfoIcon, null)
|
|
3434
3479
|
);
|
|
3435
3480
|
}
|
|
3436
3481
|
|
|
@@ -3443,9 +3488,9 @@ var TextEllipsis = ({
|
|
|
3443
3488
|
lineClamp,
|
|
3444
3489
|
...rest
|
|
3445
3490
|
}) => {
|
|
3446
|
-
const textRef = (0,
|
|
3447
|
-
const [showTooltip, setShowTooltip] = (0,
|
|
3448
|
-
(0,
|
|
3491
|
+
const textRef = (0, import_react26.useRef)(null);
|
|
3492
|
+
const [showTooltip, setShowTooltip] = (0, import_react26.useState)(false);
|
|
3493
|
+
(0, import_react26.useLayoutEffect)(() => {
|
|
3449
3494
|
const element = textRef.current;
|
|
3450
3495
|
if (!element) return;
|
|
3451
3496
|
const checkTruncation = () => {
|
|
@@ -3457,21 +3502,21 @@ var TextEllipsis = ({
|
|
|
3457
3502
|
ro.observe(element);
|
|
3458
3503
|
return () => ro.disconnect();
|
|
3459
3504
|
}, [children, lineClamp]);
|
|
3460
|
-
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));
|
|
3461
3506
|
};
|
|
3462
3507
|
var CellTextEllipsis = ({ children }) => {
|
|
3463
|
-
const textRef = (0,
|
|
3464
|
-
const [showTooltip, setShowTooltip] = (0,
|
|
3465
|
-
(0,
|
|
3508
|
+
const textRef = (0, import_react26.useRef)(null);
|
|
3509
|
+
const [showTooltip, setShowTooltip] = (0, import_react26.useState)(false);
|
|
3510
|
+
(0, import_react26.useLayoutEffect)(() => {
|
|
3466
3511
|
const element = textRef.current;
|
|
3467
3512
|
if (element) {
|
|
3468
3513
|
const isTextTruncated = element.scrollWidth > element.clientWidth;
|
|
3469
3514
|
setShowTooltip(isTextTruncated);
|
|
3470
3515
|
}
|
|
3471
3516
|
}, [children]);
|
|
3472
|
-
const content = /* @__PURE__ */
|
|
3517
|
+
const content = /* @__PURE__ */ import_react26.default.createElement(EllipsisDiv, { ref: textRef }, children);
|
|
3473
3518
|
if (showTooltip) {
|
|
3474
|
-
return /* @__PURE__ */
|
|
3519
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
3475
3520
|
Tooltip_default,
|
|
3476
3521
|
{
|
|
3477
3522
|
title: children,
|
|
@@ -3510,34 +3555,32 @@ var HeadCell = (props) => {
|
|
|
3510
3555
|
tableColRef,
|
|
3511
3556
|
headerClassName,
|
|
3512
3557
|
headerLineClamp,
|
|
3513
|
-
onAutoFit
|
|
3558
|
+
onAutoFit,
|
|
3559
|
+
columnId
|
|
3514
3560
|
} = props;
|
|
3515
3561
|
const theme = (0, import_joy33.useTheme)();
|
|
3516
3562
|
const ref = headerRef;
|
|
3517
3563
|
const colRef = tableColRef;
|
|
3518
|
-
const localRef = (0,
|
|
3519
|
-
(0,
|
|
3564
|
+
const localRef = (0, import_react26.useRef)(null);
|
|
3565
|
+
(0, import_react26.useLayoutEffect)(() => {
|
|
3520
3566
|
ref.current = localRef.current;
|
|
3521
3567
|
}, [ref]);
|
|
3522
|
-
const [isHovered, setIsHovered] = (0,
|
|
3568
|
+
const [isHovered, setIsHovered] = (0, import_react26.useState)(false);
|
|
3523
3569
|
const sortable = type === "actions" ? false : _sortable;
|
|
3524
|
-
const headId = (0,
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
);
|
|
3528
|
-
const isResizingRef = (0, import_react25.useRef)(false);
|
|
3529
|
-
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)(
|
|
3530
3573
|
() => resizable ?? true ? Resizer(
|
|
3531
3574
|
ref,
|
|
3532
3575
|
colRef,
|
|
3533
3576
|
(isResizing) => {
|
|
3534
3577
|
isResizingRef.current = isResizing;
|
|
3535
3578
|
},
|
|
3536
|
-
onAutoFit ? () => onAutoFit(field) : void 0
|
|
3579
|
+
onAutoFit ? () => onAutoFit(columnId ?? String(field)) : void 0
|
|
3537
3580
|
) : null,
|
|
3538
|
-
[resizable, ref, colRef, onAutoFit, field]
|
|
3581
|
+
[resizable, ref, colRef, onAutoFit, columnId, field]
|
|
3539
3582
|
);
|
|
3540
|
-
const style = (0,
|
|
3583
|
+
const style = (0, import_react26.useMemo)(
|
|
3541
3584
|
() => ({
|
|
3542
3585
|
width,
|
|
3543
3586
|
minWidth: minWidth ?? "50px",
|
|
@@ -3555,10 +3598,10 @@ var HeadCell = (props) => {
|
|
|
3555
3598
|
);
|
|
3556
3599
|
const textAlign = getTextAlign(props);
|
|
3557
3600
|
const initialSort = sortOrder[0];
|
|
3558
|
-
const sortIcon = (0,
|
|
3601
|
+
const sortIcon = (0, import_react26.useMemo)(() => {
|
|
3559
3602
|
const isSorted = !!sort;
|
|
3560
3603
|
const isVisible = sortable && (isSorted || isHovered);
|
|
3561
|
-
return /* @__PURE__ */
|
|
3604
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_framer_motion21.AnimatePresence, { mode: "wait" }, isVisible && /* @__PURE__ */ import_react26.default.createElement(
|
|
3562
3605
|
MotionSortIcon,
|
|
3563
3606
|
{
|
|
3564
3607
|
key: "sort-icon",
|
|
@@ -3586,21 +3629,21 @@ var HeadCell = (props) => {
|
|
|
3586
3629
|
}
|
|
3587
3630
|
));
|
|
3588
3631
|
}, [headId, initialSort, sort, sortable, isHovered]);
|
|
3589
|
-
const infoSign = (0,
|
|
3590
|
-
() => description ? /* @__PURE__ */
|
|
3632
|
+
const infoSign = (0, import_react26.useMemo)(
|
|
3633
|
+
() => description ? /* @__PURE__ */ import_react26.default.createElement(InfoSign_default, { message: description, placement: "bottom" }) : null,
|
|
3591
3634
|
[description]
|
|
3592
3635
|
);
|
|
3593
|
-
const params = (0,
|
|
3636
|
+
const params = (0, import_react26.useMemo)(
|
|
3594
3637
|
() => ({
|
|
3595
3638
|
field
|
|
3596
3639
|
}),
|
|
3597
3640
|
[field]
|
|
3598
3641
|
);
|
|
3599
|
-
const computedHeaderClassName = (0,
|
|
3642
|
+
const computedHeaderClassName = (0, import_react26.useMemo)(
|
|
3600
3643
|
() => (typeof headerClassName === "function" ? headerClassName(params) : headerClassName) || void 0,
|
|
3601
3644
|
[headerClassName, params]
|
|
3602
3645
|
);
|
|
3603
|
-
return /* @__PURE__ */
|
|
3646
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
3604
3647
|
StyledTh,
|
|
3605
3648
|
{
|
|
3606
3649
|
id: headId,
|
|
@@ -3609,7 +3652,7 @@ var HeadCell = (props) => {
|
|
|
3609
3652
|
ref: localRef,
|
|
3610
3653
|
key: field,
|
|
3611
3654
|
style,
|
|
3612
|
-
onClick: (0,
|
|
3655
|
+
onClick: (0, import_react26.useCallback)(
|
|
3613
3656
|
(e) => {
|
|
3614
3657
|
if (isResizingRef.current) return;
|
|
3615
3658
|
if (!(e.target instanceof Element) || !e.currentTarget.contains(e.target)) return;
|
|
@@ -3623,7 +3666,7 @@ var HeadCell = (props) => {
|
|
|
3623
3666
|
initial: "initial",
|
|
3624
3667
|
className: computedHeaderClassName
|
|
3625
3668
|
},
|
|
3626
|
-
/* @__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),
|
|
3627
3670
|
resizer
|
|
3628
3671
|
);
|
|
3629
3672
|
};
|
|
@@ -3648,9 +3691,9 @@ var BodyCell = (props) => {
|
|
|
3648
3691
|
onCellEditStop
|
|
3649
3692
|
} = props;
|
|
3650
3693
|
const theme = (0, import_joy33.useTheme)();
|
|
3651
|
-
const [value, setValue] = (0,
|
|
3652
|
-
const cellRef = (0,
|
|
3653
|
-
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)(
|
|
3654
3697
|
() => ({
|
|
3655
3698
|
row,
|
|
3656
3699
|
value,
|
|
@@ -3659,20 +3702,20 @@ var BodyCell = (props) => {
|
|
|
3659
3702
|
}),
|
|
3660
3703
|
[row, rowId, value, field]
|
|
3661
3704
|
);
|
|
3662
|
-
const editMode = (0,
|
|
3705
|
+
const editMode = (0, import_react26.useMemo)(
|
|
3663
3706
|
() => !!(props.editMode && (typeof isCellEditable === "function" ? isCellEditable(params) : isCellEditable ?? true)),
|
|
3664
3707
|
[props.editMode, isCellEditable, params]
|
|
3665
3708
|
);
|
|
3666
3709
|
const propsComponentProps = "componentProps" in props ? props.componentProps : null;
|
|
3667
3710
|
const hasComponentProps = "componentProps" in props;
|
|
3668
|
-
const componentProps = (0,
|
|
3711
|
+
const componentProps = (0, import_react26.useMemo)(
|
|
3669
3712
|
() => ({
|
|
3670
3713
|
...hasComponentProps && (typeof propsComponentProps === "function" ? propsComponentProps(params) : propsComponentProps || {}),
|
|
3671
3714
|
size: "sm"
|
|
3672
3715
|
}),
|
|
3673
3716
|
[hasComponentProps, propsComponentProps, params]
|
|
3674
3717
|
);
|
|
3675
|
-
const editModeComponentProps = (0,
|
|
3718
|
+
const editModeComponentProps = (0, import_react26.useMemo)(
|
|
3676
3719
|
() => ({
|
|
3677
3720
|
...componentProps,
|
|
3678
3721
|
onChange: (e) => {
|
|
@@ -3734,25 +3777,25 @@ var BodyCell = (props) => {
|
|
|
3734
3777
|
}),
|
|
3735
3778
|
[params, row, field, value, componentProps, type, onCellEditStop, onCellEditStart]
|
|
3736
3779
|
);
|
|
3737
|
-
const MemoizedRenderEditCell = (0,
|
|
3738
|
-
const MemoizedRenderCell = (0,
|
|
3739
|
-
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)(() => {
|
|
3740
3783
|
if (MemoizedRenderEditCell) {
|
|
3741
|
-
return (0,
|
|
3784
|
+
return (0, import_react26.createElement)(MemoizedRenderEditCell, params);
|
|
3742
3785
|
}
|
|
3743
3786
|
return {
|
|
3744
|
-
date: /* @__PURE__ */
|
|
3745
|
-
currency: /* @__PURE__ */
|
|
3787
|
+
date: /* @__PURE__ */ import_react26.default.createElement(DatePicker_default, { value, ...editModeComponentProps }),
|
|
3788
|
+
currency: /* @__PURE__ */ import_react26.default.createElement(
|
|
3746
3789
|
CurrencyInput_default,
|
|
3747
3790
|
{
|
|
3748
3791
|
value,
|
|
3749
3792
|
...editModeComponentProps
|
|
3750
3793
|
}
|
|
3751
3794
|
),
|
|
3752
|
-
number: /* @__PURE__ */
|
|
3753
|
-
text: /* @__PURE__ */
|
|
3754
|
-
longText: /* @__PURE__ */
|
|
3755
|
-
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(
|
|
3756
3799
|
Autocomplete_default,
|
|
3757
3800
|
{
|
|
3758
3801
|
value,
|
|
@@ -3760,7 +3803,7 @@ var BodyCell = (props) => {
|
|
|
3760
3803
|
...editModeComponentProps
|
|
3761
3804
|
}
|
|
3762
3805
|
),
|
|
3763
|
-
select: /* @__PURE__ */
|
|
3806
|
+
select: /* @__PURE__ */ import_react26.default.createElement(
|
|
3764
3807
|
Select_default,
|
|
3765
3808
|
{
|
|
3766
3809
|
value,
|
|
@@ -3771,13 +3814,13 @@ var BodyCell = (props) => {
|
|
|
3771
3814
|
}[type || "text"];
|
|
3772
3815
|
}, [value, editModeComponentProps, type, MemoizedRenderEditCell, params]);
|
|
3773
3816
|
const linkComponentFromProps = props.component;
|
|
3774
|
-
const ReadModeComponent = (0,
|
|
3817
|
+
const ReadModeComponent = (0, import_react26.useMemo)(() => {
|
|
3775
3818
|
if (MemoizedRenderCell) {
|
|
3776
|
-
return (0,
|
|
3819
|
+
return (0, import_react26.createElement)(MemoizedRenderCell, params);
|
|
3777
3820
|
}
|
|
3778
3821
|
const innerText = value;
|
|
3779
3822
|
const typedComponent = {
|
|
3780
|
-
link:
|
|
3823
|
+
link: import_react26.default.createElement(linkComponentFromProps || import_joy34.Link, {
|
|
3781
3824
|
children: innerText,
|
|
3782
3825
|
...componentProps
|
|
3783
3826
|
})
|
|
@@ -3785,27 +3828,27 @@ var BodyCell = (props) => {
|
|
|
3785
3828
|
return typedComponent || innerText;
|
|
3786
3829
|
}, [value, MemoizedRenderCell, params, type, componentProps, linkComponentFromProps]);
|
|
3787
3830
|
const getActions = props.getActions;
|
|
3788
|
-
const CellComponent = (0,
|
|
3831
|
+
const CellComponent = (0, import_react26.useMemo)(() => {
|
|
3789
3832
|
if (type === "actions") {
|
|
3790
|
-
return /* @__PURE__ */
|
|
3833
|
+
return /* @__PURE__ */ import_react26.default.createElement(Stack_default, { direction: "row", gap: 1, justifyContent: "center", alignItems: "center" }, getActions?.(params));
|
|
3791
3834
|
}
|
|
3792
3835
|
return editMode && EditModeComponent ? EditModeComponent : ReadModeComponent;
|
|
3793
3836
|
}, [type, getActions, params, editMode, EditModeComponent, ReadModeComponent]);
|
|
3794
|
-
const showTooltip = (0,
|
|
3837
|
+
const showTooltip = (0, import_react26.useMemo)(() => noWrap && type === "longText", [noWrap, type]);
|
|
3795
3838
|
const isBoundary = props.isLastStartPinnedColumn || props.isLastEndPinnedColumn;
|
|
3796
|
-
const computedCellClassName = (0,
|
|
3839
|
+
const computedCellClassName = (0, import_react26.useMemo)(
|
|
3797
3840
|
() => (typeof cellClassName === "function" ? cellClassName(params) : cellClassName) || "",
|
|
3798
3841
|
[cellClassName, params]
|
|
3799
3842
|
);
|
|
3800
|
-
(0,
|
|
3843
|
+
(0, import_react26.useEffect)(() => {
|
|
3801
3844
|
setValue(row[field]);
|
|
3802
3845
|
}, [row, field]);
|
|
3803
|
-
return /* @__PURE__ */
|
|
3846
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
3804
3847
|
StyledTd,
|
|
3805
3848
|
{
|
|
3806
3849
|
ref: cellRef,
|
|
3807
3850
|
key: field,
|
|
3808
|
-
headers:
|
|
3851
|
+
headers: getHeaderCellId(tableId, props.columnId ?? field),
|
|
3809
3852
|
sx: {
|
|
3810
3853
|
textAlign: getTextAlign({ type }),
|
|
3811
3854
|
verticalAlign: editMode ? "top" : "middle",
|
|
@@ -3817,16 +3860,16 @@ var BodyCell = (props) => {
|
|
|
3817
3860
|
},
|
|
3818
3861
|
className: [isLastStartPinnedColumn && "is-last-left", isLastEndPinnedColumn && "is-last-right", computedCellClassName].filter(Boolean).join(" ") || ""
|
|
3819
3862
|
},
|
|
3820
|
-
(0,
|
|
3821
|
-
() => showTooltip ? /* @__PURE__ */
|
|
3863
|
+
(0, import_react26.useMemo)(
|
|
3864
|
+
() => showTooltip ? /* @__PURE__ */ import_react26.default.createElement(CellTextEllipsis, null, CellComponent) : CellComponent,
|
|
3822
3865
|
[CellComponent, showTooltip]
|
|
3823
3866
|
)
|
|
3824
3867
|
);
|
|
3825
3868
|
};
|
|
3826
|
-
var BodyRow = (0,
|
|
3869
|
+
var BodyRow = (0, import_react26.memo)(
|
|
3827
3870
|
(props) => {
|
|
3828
3871
|
const { tableId, columns, rowId, editMode, noWrap, row } = props;
|
|
3829
|
-
return /* @__PURE__ */
|
|
3872
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, columns.map((column, i) => /* @__PURE__ */ import_react26.default.createElement(
|
|
3830
3873
|
BodyCell,
|
|
3831
3874
|
{
|
|
3832
3875
|
key: `${rowId}_${column.field.toString()}_${i}`,
|
|
@@ -3859,7 +3902,7 @@ var StyledTableRow2 = (0, import_joy33.styled)("tr", {
|
|
|
3859
3902
|
}
|
|
3860
3903
|
}
|
|
3861
3904
|
}));
|
|
3862
|
-
var VirtualizedTableRow = (0,
|
|
3905
|
+
var VirtualizedTableRow = (0, import_react26.memo)(StyledTableRow2, (prevProps, nextProps) => {
|
|
3863
3906
|
return prevProps.striped === nextProps.striped && prevProps.style?.height === nextProps.style?.height && prevProps.style?.transform === nextProps.style?.transform && // @ts-ignore
|
|
3864
3907
|
prevProps["data-row-id"] === nextProps["data-row-id"] && // @ts-ignore
|
|
3865
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)
|
|
@@ -3870,36 +3913,44 @@ var VirtualizedTableRow = (0, import_react25.memo)(StyledTableRow2, (prevProps,
|
|
|
3870
3913
|
});
|
|
3871
3914
|
|
|
3872
3915
|
// src/components/DataTable/hooks.ts
|
|
3873
|
-
var
|
|
3874
|
-
function useColumnWidths(
|
|
3875
|
-
const [widths, setWidths] = (0,
|
|
3876
|
-
const roRef = (0,
|
|
3877
|
-
(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)(() => {
|
|
3878
3921
|
if (roRef.current) roRef.current.disconnect();
|
|
3879
3922
|
roRef.current = new ResizeObserver((entries) => {
|
|
3880
|
-
let changed = false;
|
|
3881
3923
|
setWidths((prev) => {
|
|
3924
|
+
let changed = false;
|
|
3882
3925
|
const next = { ...prev };
|
|
3883
3926
|
entries.forEach((entry) => {
|
|
3884
|
-
const
|
|
3927
|
+
const columnId = entry.target.dataset.hdsColumnId;
|
|
3885
3928
|
const w = Math.round(entry.target.getBoundingClientRect().width);
|
|
3886
|
-
if (next[
|
|
3887
|
-
next[
|
|
3929
|
+
if (next[columnId] !== w) {
|
|
3930
|
+
next[columnId] = w;
|
|
3888
3931
|
changed = true;
|
|
3889
3932
|
}
|
|
3890
3933
|
});
|
|
3891
3934
|
return changed ? next : prev;
|
|
3892
3935
|
});
|
|
3893
3936
|
});
|
|
3894
|
-
|
|
3937
|
+
const measured = {};
|
|
3938
|
+
Object.entries(columnsById).forEach(([columnId, def]) => {
|
|
3895
3939
|
const el = def.headerRef.current;
|
|
3896
3940
|
if (el) {
|
|
3897
|
-
el.dataset.
|
|
3941
|
+
el.dataset.hdsColumnId = columnId;
|
|
3942
|
+
el.dataset.field = String(def.field);
|
|
3943
|
+
measured[columnId] = Math.round(el.getBoundingClientRect().width);
|
|
3898
3944
|
roRef.current.observe(el);
|
|
3899
3945
|
}
|
|
3900
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
|
+
});
|
|
3901
3952
|
return () => roRef.current?.disconnect();
|
|
3902
|
-
}, [
|
|
3953
|
+
}, [columnsById]);
|
|
3903
3954
|
return widths;
|
|
3904
3955
|
}
|
|
3905
3956
|
function useDataTableRenderer({
|
|
@@ -3931,33 +3982,33 @@ function useDataTableRenderer({
|
|
|
3931
3982
|
"You cannot use both `pinnedColumns` and `columnGroupingModel` at the same time. Please choose one of them."
|
|
3932
3983
|
);
|
|
3933
3984
|
}
|
|
3934
|
-
const onSelectionModelChangeRef = (0,
|
|
3985
|
+
const onSelectionModelChangeRef = (0, import_react27.useRef)(onSelectionModelChange);
|
|
3935
3986
|
onSelectionModelChangeRef.current = onSelectionModelChange;
|
|
3936
|
-
const [focusedRowId, setFocusedRowId] = (0,
|
|
3937
|
-
const [selectionAnchor, setSelectionAnchor] = (0,
|
|
3987
|
+
const [focusedRowId, setFocusedRowId] = (0, import_react27.useState)(null);
|
|
3988
|
+
const [selectionAnchor, setSelectionAnchor] = (0, import_react27.useState)(null);
|
|
3938
3989
|
const [sortModel, setSortModel] = useControlledState(
|
|
3939
3990
|
controlledSortModel,
|
|
3940
3991
|
initialState?.sorting?.sortModel ?? [],
|
|
3941
|
-
(0,
|
|
3992
|
+
(0, import_react27.useCallback)((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3942
3993
|
);
|
|
3943
3994
|
const [visibilityModel] = useControlledState(
|
|
3944
3995
|
columnVisibilityModel,
|
|
3945
3996
|
initialState?.columns?.columnVisibilityModel ?? {},
|
|
3946
|
-
(0,
|
|
3997
|
+
(0, import_react27.useCallback)(
|
|
3947
3998
|
(model) => onColumnVisibilityModelChange?.(model),
|
|
3948
3999
|
[onColumnVisibilityModelChange]
|
|
3949
4000
|
)
|
|
3950
4001
|
);
|
|
3951
|
-
const reorderedColumns = (0,
|
|
4002
|
+
const reorderedColumns = (0, import_react27.useMemo)(() => {
|
|
3952
4003
|
if (!columnGroupingModel) return columnsProp;
|
|
3953
4004
|
return reorderColumnsByGroupingModel(columnsProp, columnGroupingModel);
|
|
3954
4005
|
}, [columnsProp, columnGroupingModel]);
|
|
3955
|
-
const visibleColumns = (0,
|
|
4006
|
+
const visibleColumns = (0, import_react27.useMemo)(
|
|
3956
4007
|
() => reorderedColumns.filter((col) => visibilityModel[col.field] !== false),
|
|
3957
4008
|
[reorderedColumns, visibilityModel]
|
|
3958
4009
|
);
|
|
3959
|
-
const visibleFieldSet = (0,
|
|
3960
|
-
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)(() => {
|
|
3961
4012
|
const DEFAULT_MIN = 50;
|
|
3962
4013
|
let total = checkboxSelection ? 40 : 0;
|
|
3963
4014
|
for (const col of visibleColumns) {
|
|
@@ -3965,7 +4016,7 @@ function useDataTableRenderer({
|
|
|
3965
4016
|
}
|
|
3966
4017
|
return total;
|
|
3967
4018
|
}, [visibleColumns, checkboxSelection]);
|
|
3968
|
-
const allColumnsByField = (0,
|
|
4019
|
+
const allColumnsByField = (0, import_react27.useMemo)(
|
|
3969
4020
|
() => reorderedColumns.reduce(
|
|
3970
4021
|
(acc, curr) => ({
|
|
3971
4022
|
...acc,
|
|
@@ -3975,21 +4026,36 @@ function useDataTableRenderer({
|
|
|
3975
4026
|
),
|
|
3976
4027
|
[reorderedColumns]
|
|
3977
4028
|
);
|
|
3978
|
-
const
|
|
3979
|
-
() =>
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
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)()
|
|
3986
4053
|
}
|
|
3987
|
-
|
|
3988
|
-
{}
|
|
4054
|
+
])
|
|
3989
4055
|
),
|
|
3990
|
-
[visibleColumns]
|
|
4056
|
+
[visibleColumns, columnIds]
|
|
3991
4057
|
);
|
|
3992
|
-
const sortComparator = (0,
|
|
4058
|
+
const sortComparator = (0, import_react27.useCallback)(
|
|
3993
4059
|
(rowA, rowB) => {
|
|
3994
4060
|
for (const sort of sortModel) {
|
|
3995
4061
|
const { field, sort: direction } = sort;
|
|
@@ -4018,33 +4084,33 @@ function useDataTableRenderer({
|
|
|
4018
4084
|
},
|
|
4019
4085
|
[sortModel, allColumnsByField]
|
|
4020
4086
|
);
|
|
4021
|
-
const rows = (0,
|
|
4087
|
+
const rows = (0, import_react27.useMemo)(
|
|
4022
4088
|
() => sortModel.length ? [..._rows].sort(sortComparator) : _rows,
|
|
4023
4089
|
[_rows, sortModel, sortComparator]
|
|
4024
4090
|
);
|
|
4025
|
-
const sortOrder = (0,
|
|
4091
|
+
const sortOrder = (0, import_react27.useMemo)(
|
|
4026
4092
|
() => Array.from(new Set(_sortOrder || ["asc", "desc", null])),
|
|
4027
4093
|
[_sortOrder]
|
|
4028
4094
|
);
|
|
4029
|
-
const [page, setPage] = (0,
|
|
4095
|
+
const [page, setPage] = (0, import_react27.useState)(paginationModel?.page || 1);
|
|
4030
4096
|
const pageSize = paginationModel?.pageSize || 20;
|
|
4031
|
-
const getId = (0,
|
|
4097
|
+
const getId = (0, import_react27.useCallback)(
|
|
4032
4098
|
(row, index) => _getId?.(row) ?? row.id ?? `${(index || 0) + (page - 1) * pageSize}`,
|
|
4033
4099
|
[_getId, page, pageSize]
|
|
4034
4100
|
);
|
|
4035
|
-
const selectedModelSet = (0,
|
|
4036
|
-
const dataInPage = (0,
|
|
4101
|
+
const selectedModelSet = (0, import_react27.useMemo)(() => new Set(selectionModel || []), [selectionModel]);
|
|
4102
|
+
const dataInPage = (0, import_react27.useMemo)(
|
|
4037
4103
|
() => !pagination || paginationMode === "server" ? rows : rows.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize),
|
|
4038
4104
|
[rows, page, pageSize, paginationMode, pagination]
|
|
4039
4105
|
);
|
|
4040
|
-
const selectableDataInPage = (0,
|
|
4106
|
+
const selectableDataInPage = (0, import_react27.useMemo)(
|
|
4041
4107
|
() => dataInPage.filter((row, i) => {
|
|
4042
4108
|
if (!isRowSelectable) return true;
|
|
4043
4109
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
4044
4110
|
}),
|
|
4045
4111
|
[dataInPage, isRowSelectable, getId]
|
|
4046
4112
|
);
|
|
4047
|
-
const handleRangeSelection = (0,
|
|
4113
|
+
const handleRangeSelection = (0, import_react27.useCallback)(
|
|
4048
4114
|
(anchor, targetIndex) => {
|
|
4049
4115
|
const startIndex = Math.min(anchor.rowIndex, targetIndex);
|
|
4050
4116
|
const endIndex = Math.max(anchor.rowIndex, targetIndex);
|
|
@@ -4067,51 +4133,60 @@ function useDataTableRenderer({
|
|
|
4067
4133
|
},
|
|
4068
4134
|
[dataInPage, getId, isRowSelectable, selectionModel, onSelectionModelChange]
|
|
4069
4135
|
);
|
|
4070
|
-
const isAllSelected = (0,
|
|
4136
|
+
const isAllSelected = (0, import_react27.useMemo)(
|
|
4071
4137
|
() => selectableDataInPage.length > 0 && selectableDataInPage.every((row, i) => selectedModelSet.has(getId(row, i))),
|
|
4072
4138
|
[selectableDataInPage, selectedModelSet, getId]
|
|
4073
4139
|
);
|
|
4074
4140
|
const rowCount = totalRowsProp || rows.length;
|
|
4075
|
-
const selectableRowCount = (0,
|
|
4141
|
+
const selectableRowCount = (0, import_react27.useMemo)(() => {
|
|
4076
4142
|
if (!isRowSelectable) return rowCount;
|
|
4077
4143
|
return rows.filter((row, i) => isRowSelectable({ row, id: getId(row, i) })).length;
|
|
4078
4144
|
}, [rows, isRowSelectable, getId, rowCount]);
|
|
4079
|
-
const isTotalSelected = (0,
|
|
4145
|
+
const isTotalSelected = (0, import_react27.useMemo)(
|
|
4080
4146
|
() => _isTotalSelected ?? (selectableRowCount > 0 && (selectionModel?.length || 0) === selectableRowCount),
|
|
4081
4147
|
[_isTotalSelected, selectionModel, selectableRowCount]
|
|
4082
4148
|
);
|
|
4083
|
-
const columnWidths = useColumnWidths(
|
|
4084
|
-
const
|
|
4085
|
-
(
|
|
4086
|
-
|
|
4087
|
-
|
|
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]
|
|
4088
4155
|
);
|
|
4089
|
-
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)(() => {
|
|
4090
4163
|
if (!columnGroupingModel) return null;
|
|
4091
4164
|
return calculateColumnGroups(columnGroupingModel, visibleColumns, visibleFieldSet);
|
|
4092
4165
|
}, [columnGroupingModel, visibleColumns, visibleFieldSet]);
|
|
4093
|
-
const effectivePinnedLeft = (0,
|
|
4166
|
+
const effectivePinnedLeft = (0, import_react27.useMemo)(
|
|
4094
4167
|
() => pinnedColumns?.left?.filter((f) => visibleFieldSet.has(f)),
|
|
4095
4168
|
[pinnedColumns?.left, visibleFieldSet]
|
|
4096
4169
|
);
|
|
4097
|
-
const effectivePinnedRight = (0,
|
|
4170
|
+
const effectivePinnedRight = (0, import_react27.useMemo)(
|
|
4098
4171
|
() => pinnedColumns?.right?.filter((f) => visibleFieldSet.has(f)),
|
|
4099
4172
|
[pinnedColumns?.right, visibleFieldSet]
|
|
4100
4173
|
);
|
|
4101
4174
|
const inferredFieldsKey = JSON.stringify(Object.keys(rows[0] || {}));
|
|
4102
|
-
const inferredFields = (0,
|
|
4103
|
-
const columns = (0,
|
|
4175
|
+
const inferredFields = (0, import_react27.useMemo)(() => JSON.parse(inferredFieldsKey), [inferredFieldsKey]);
|
|
4176
|
+
const columns = (0, import_react27.useMemo)(() => {
|
|
4104
4177
|
const baseColumns = visibleColumns.length > 0 ? visibleColumns : reorderedColumns.length > 0 ? [] : inferredFields.map((key) => ({
|
|
4105
4178
|
field: key
|
|
4106
4179
|
}));
|
|
4107
|
-
return baseColumns.map((column) => {
|
|
4180
|
+
return baseColumns.map((column, index) => {
|
|
4181
|
+
const columnId = columnIds[index] ?? String(column.field);
|
|
4108
4182
|
const isLeftPinned = effectivePinnedLeft?.includes(column.field);
|
|
4109
4183
|
const isRightPinned = effectivePinnedRight?.includes(column.field);
|
|
4110
4184
|
const isPinned = isLeftPinned || isRightPinned;
|
|
4111
4185
|
return {
|
|
4112
4186
|
...column,
|
|
4113
|
-
|
|
4114
|
-
|
|
4187
|
+
columnId,
|
|
4188
|
+
headerRef: visibleColumnsById[columnId]?.headerRef,
|
|
4189
|
+
tableColRef: visibleColumnsById[columnId]?.tableColRef,
|
|
4115
4190
|
isCellEditable: editMode && (typeof column.isCellEditable === "function" ? column.isCellEditable : column.isCellEditable ?? true),
|
|
4116
4191
|
sort: sortModel.find((sort) => sort.field === column.field)?.sort,
|
|
4117
4192
|
sortOrder: allColumnsByField[column.field]?.sortOrder || sortOrder,
|
|
@@ -4128,21 +4203,22 @@ function useDataTableRenderer({
|
|
|
4128
4203
|
inferredFields,
|
|
4129
4204
|
effectivePinnedLeft,
|
|
4130
4205
|
effectivePinnedRight,
|
|
4131
|
-
|
|
4206
|
+
columnIds,
|
|
4207
|
+
visibleColumnsById,
|
|
4132
4208
|
allColumnsByField,
|
|
4133
4209
|
editMode,
|
|
4134
4210
|
sortModel,
|
|
4135
4211
|
sortOrder,
|
|
4136
4212
|
getWidth
|
|
4137
4213
|
]);
|
|
4138
|
-
const handlePageChange = (0,
|
|
4214
|
+
const handlePageChange = (0, import_react27.useCallback)(
|
|
4139
4215
|
(newPage) => {
|
|
4140
4216
|
setPage(newPage);
|
|
4141
4217
|
onPaginationModelChange?.({ page: newPage, pageSize });
|
|
4142
4218
|
},
|
|
4143
4219
|
[onPaginationModelChange, pageSize]
|
|
4144
4220
|
);
|
|
4145
|
-
const handleSortChange = (0,
|
|
4221
|
+
const handleSortChange = (0, import_react27.useCallback)(
|
|
4146
4222
|
(props) => {
|
|
4147
4223
|
const { field, currentSort, multiple } = props;
|
|
4148
4224
|
const column = allColumnsByField[field];
|
|
@@ -4165,38 +4241,37 @@ function useDataTableRenderer({
|
|
|
4165
4241
|
},
|
|
4166
4242
|
[sortOrder, allColumnsByField, sortModel, setSortModel]
|
|
4167
4243
|
);
|
|
4168
|
-
(0,
|
|
4244
|
+
(0, import_react27.useEffect)(() => {
|
|
4169
4245
|
if (!paginationModel) {
|
|
4170
4246
|
handlePageChange(1);
|
|
4171
4247
|
}
|
|
4172
4248
|
}, [rowCount, handlePageChange, paginationModel]);
|
|
4173
|
-
(0,
|
|
4249
|
+
(0, import_react27.useEffect)(() => {
|
|
4174
4250
|
const lastPage = Math.max(1, Math.ceil(rowCount / pageSize));
|
|
4175
4251
|
if (page > lastPage) {
|
|
4176
4252
|
handlePageChange(lastPage);
|
|
4177
4253
|
}
|
|
4178
4254
|
}, [page, rowCount, pageSize, handlePageChange]);
|
|
4179
|
-
(0,
|
|
4255
|
+
(0, import_react27.useEffect)(() => {
|
|
4180
4256
|
onSelectionModelChangeRef.current?.([]);
|
|
4181
4257
|
setSelectionAnchor(null);
|
|
4182
4258
|
}, [page]);
|
|
4183
|
-
const prevRowsRef = (0,
|
|
4184
|
-
(0,
|
|
4259
|
+
const prevRowsRef = (0, import_react27.useRef)(_rows);
|
|
4260
|
+
(0, import_react27.useEffect)(() => {
|
|
4185
4261
|
if (prevRowsRef.current !== _rows) {
|
|
4186
4262
|
setSelectionAnchor(null);
|
|
4187
4263
|
prevRowsRef.current = _rows;
|
|
4188
4264
|
}
|
|
4189
4265
|
}, [_rows]);
|
|
4190
|
-
const handleAutoFit = (0,
|
|
4191
|
-
(
|
|
4192
|
-
const colDef =
|
|
4266
|
+
const handleAutoFit = (0, import_react27.useCallback)(
|
|
4267
|
+
(columnId) => {
|
|
4268
|
+
const colDef = visibleColumnsById[columnId];
|
|
4193
4269
|
if (!colDef?.headerRef.current) return;
|
|
4194
|
-
const
|
|
4195
|
-
const columnType = column && "type" in column ? column.type : void 0;
|
|
4270
|
+
const columnType = "type" in colDef ? colDef.type : void 0;
|
|
4196
4271
|
if (columnType === "actions") return;
|
|
4197
4272
|
const optimalWidth = computeAutoFitWidth({
|
|
4198
4273
|
headerEl: colDef.headerRef.current,
|
|
4199
|
-
field,
|
|
4274
|
+
field: colDef.field,
|
|
4200
4275
|
dataInPage
|
|
4201
4276
|
});
|
|
4202
4277
|
if (optimalWidth == null) return;
|
|
@@ -4204,7 +4279,7 @@ function useDataTableRenderer({
|
|
|
4204
4279
|
colDef.headerRef.current.style.width = widthPx;
|
|
4205
4280
|
if (colDef.tableColRef.current) colDef.tableColRef.current.style.width = widthPx;
|
|
4206
4281
|
},
|
|
4207
|
-
[
|
|
4282
|
+
[visibleColumnsById, dataInPage]
|
|
4208
4283
|
);
|
|
4209
4284
|
return {
|
|
4210
4285
|
rowCount,
|
|
@@ -4220,8 +4295,8 @@ function useDataTableRenderer({
|
|
|
4220
4295
|
handleAutoFit,
|
|
4221
4296
|
isAllSelected,
|
|
4222
4297
|
isTotalSelected,
|
|
4223
|
-
isSelectedRow: (0,
|
|
4224
|
-
isRowSelectable: (0,
|
|
4298
|
+
isSelectedRow: (0, import_react27.useCallback)((model) => selectedModelSet.has(model), [selectedModelSet]),
|
|
4299
|
+
isRowSelectable: (0, import_react27.useCallback)(
|
|
4225
4300
|
(rowId, row) => {
|
|
4226
4301
|
if (!isRowSelectable) return true;
|
|
4227
4302
|
return isRowSelectable({ row, id: rowId });
|
|
@@ -4229,13 +4304,13 @@ function useDataTableRenderer({
|
|
|
4229
4304
|
[isRowSelectable]
|
|
4230
4305
|
),
|
|
4231
4306
|
focusedRowId,
|
|
4232
|
-
onRowFocus: (0,
|
|
4307
|
+
onRowFocus: (0, import_react27.useCallback)((rowId) => {
|
|
4233
4308
|
setFocusedRowId(rowId);
|
|
4234
4309
|
}, []),
|
|
4235
|
-
onAllCheckboxChange: (0,
|
|
4310
|
+
onAllCheckboxChange: (0, import_react27.useCallback)(() => {
|
|
4236
4311
|
onSelectionModelChange?.(isAllSelected ? [] : selectableDataInPage.map(getId));
|
|
4237
4312
|
}, [isAllSelected, selectableDataInPage, onSelectionModelChange, getId]),
|
|
4238
|
-
onCheckboxChange: (0,
|
|
4313
|
+
onCheckboxChange: (0, import_react27.useCallback)(
|
|
4239
4314
|
(event, selectedModel) => {
|
|
4240
4315
|
const isShiftClick = "shiftKey" in event && event.shiftKey;
|
|
4241
4316
|
const rowIndex = dataInPage.findIndex((row, i) => getId(row, i) === selectedModel);
|
|
@@ -4269,7 +4344,7 @@ function useDataTableRenderer({
|
|
|
4269
4344
|
columns,
|
|
4270
4345
|
tableMinWidth,
|
|
4271
4346
|
processedColumnGroups,
|
|
4272
|
-
onTotalSelect: (0,
|
|
4347
|
+
onTotalSelect: (0, import_react27.useCallback)(() => {
|
|
4273
4348
|
const selectableRows = rows.filter((row, i) => {
|
|
4274
4349
|
if (!isRowSelectable) return true;
|
|
4275
4350
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
@@ -4283,11 +4358,11 @@ function useDataTableRenderer({
|
|
|
4283
4358
|
}
|
|
4284
4359
|
|
|
4285
4360
|
// src/components/Table/Table.tsx
|
|
4286
|
-
var
|
|
4361
|
+
var import_react28 = __toESM(require("react"));
|
|
4287
4362
|
var import_joy35 = require("@mui/joy");
|
|
4288
4363
|
var Table = (props) => {
|
|
4289
4364
|
const { children, ...inheritProps } = props;
|
|
4290
|
-
return /* @__PURE__ */
|
|
4365
|
+
return /* @__PURE__ */ import_react28.default.createElement(import_joy35.Table, { ...inheritProps }, children);
|
|
4291
4366
|
};
|
|
4292
4367
|
Table.displayName = "Table";
|
|
4293
4368
|
function TableHead(props) {
|
|
@@ -4298,7 +4373,7 @@ function TableHead(props) {
|
|
|
4298
4373
|
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
4299
4374
|
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
4300
4375
|
} = props;
|
|
4301
|
-
return /* @__PURE__ */
|
|
4376
|
+
return /* @__PURE__ */ import_react28.default.createElement("thead", null, /* @__PURE__ */ import_react28.default.createElement("tr", null, showCheckbox && /* @__PURE__ */ import_react28.default.createElement(
|
|
4302
4377
|
"th",
|
|
4303
4378
|
{
|
|
4304
4379
|
style: {
|
|
@@ -4306,8 +4381,8 @@ function TableHead(props) {
|
|
|
4306
4381
|
textAlign: "center"
|
|
4307
4382
|
}
|
|
4308
4383
|
},
|
|
4309
|
-
/* @__PURE__ */
|
|
4310
|
-
), headCells.map((headCell) => /* @__PURE__ */
|
|
4384
|
+
/* @__PURE__ */ import_react28.default.createElement(RenderCheckbox, { onChange: onCheckboxChange, ...checkboxProps })
|
|
4385
|
+
), headCells.map((headCell) => /* @__PURE__ */ import_react28.default.createElement(
|
|
4311
4386
|
"th",
|
|
4312
4387
|
{
|
|
4313
4388
|
key: headCell.label,
|
|
@@ -4332,15 +4407,15 @@ function TableBody(props) {
|
|
|
4332
4407
|
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
4333
4408
|
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
4334
4409
|
} = props;
|
|
4335
|
-
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(
|
|
4336
4411
|
"td",
|
|
4337
4412
|
{
|
|
4338
4413
|
style: {
|
|
4339
4414
|
textAlign: "center"
|
|
4340
4415
|
}
|
|
4341
4416
|
},
|
|
4342
|
-
/* @__PURE__ */
|
|
4343
|
-
), 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(
|
|
4344
4419
|
"td",
|
|
4345
4420
|
{
|
|
4346
4421
|
key: cellKey,
|
|
@@ -4354,7 +4429,7 @@ function TableBody(props) {
|
|
|
4354
4429
|
TableBody.displayName = "TableBody";
|
|
4355
4430
|
|
|
4356
4431
|
// src/components/Pagination/Pagination.tsx
|
|
4357
|
-
var
|
|
4432
|
+
var import_react29 = __toESM(require("react"));
|
|
4358
4433
|
var import_ChevronLeftRounded = __toESM(require("@mui/icons-material/ChevronLeftRounded"));
|
|
4359
4434
|
var import_ChevronRightRounded = __toESM(require("@mui/icons-material/ChevronRightRounded"));
|
|
4360
4435
|
var import_FirstPageRounded = __toESM(require("@mui/icons-material/FirstPageRounded"));
|
|
@@ -4424,7 +4499,7 @@ function Pagination(inProps) {
|
|
|
4424
4499
|
const [paginationModel, setPaginationModel] = useControlledState(
|
|
4425
4500
|
_paginationModel,
|
|
4426
4501
|
defaultPaginationModel,
|
|
4427
|
-
(0,
|
|
4502
|
+
(0, import_react29.useCallback)(
|
|
4428
4503
|
(newPage) => {
|
|
4429
4504
|
onPageChange(newPage.page);
|
|
4430
4505
|
},
|
|
@@ -4440,7 +4515,7 @@ function Pagination(inProps) {
|
|
|
4440
4515
|
const afterPages = [paginationModel.page + 1, paginationModel.page + 2].filter((p) => p <= lastPage - 1);
|
|
4441
4516
|
const isMoreAfterPages = lastPage > 1 && paginationModel.page < lastPage - 3;
|
|
4442
4517
|
const isMoreBeforePages = lastPage > 1 && paginationModel.page > 4;
|
|
4443
|
-
(0,
|
|
4518
|
+
(0, import_react29.useEffect)(() => {
|
|
4444
4519
|
if (paginationModel.page > lastPage) {
|
|
4445
4520
|
setPaginationModel({ ...paginationModel, page: lastPage });
|
|
4446
4521
|
}
|
|
@@ -4450,7 +4525,7 @@ function Pagination(inProps) {
|
|
|
4450
4525
|
value: `${i + 1}`
|
|
4451
4526
|
}));
|
|
4452
4527
|
if (variant === "compact") {
|
|
4453
|
-
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(
|
|
4454
4529
|
PaginationIconButton,
|
|
4455
4530
|
{
|
|
4456
4531
|
size,
|
|
@@ -4460,8 +4535,8 @@ function Pagination(inProps) {
|
|
|
4460
4535
|
disabled: paginationModel.page === firstPage,
|
|
4461
4536
|
"aria-label": "First page"
|
|
4462
4537
|
},
|
|
4463
|
-
/* @__PURE__ */
|
|
4464
|
-
), /* @__PURE__ */
|
|
4538
|
+
/* @__PURE__ */ import_react29.default.createElement(import_FirstPageRounded.default, null)
|
|
4539
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
4465
4540
|
PaginationIconButton,
|
|
4466
4541
|
{
|
|
4467
4542
|
size,
|
|
@@ -4471,8 +4546,8 @@ function Pagination(inProps) {
|
|
|
4471
4546
|
disabled: paginationModel.page === firstPage,
|
|
4472
4547
|
"aria-label": "Previous page"
|
|
4473
4548
|
},
|
|
4474
|
-
/* @__PURE__ */
|
|
4475
|
-
)), /* @__PURE__ */
|
|
4549
|
+
/* @__PURE__ */ import_react29.default.createElement(import_ChevronLeftRounded.default, null)
|
|
4550
|
+
)), /* @__PURE__ */ import_react29.default.createElement(
|
|
4476
4551
|
Autocomplete_default,
|
|
4477
4552
|
{
|
|
4478
4553
|
size,
|
|
@@ -4491,7 +4566,7 @@ function Pagination(inProps) {
|
|
|
4491
4566
|
}[size]
|
|
4492
4567
|
}
|
|
4493
4568
|
}
|
|
4494
|
-
), /* @__PURE__ */
|
|
4569
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
4495
4570
|
Typography_default,
|
|
4496
4571
|
{
|
|
4497
4572
|
level: `body-${size}`,
|
|
@@ -4502,7 +4577,7 @@ function Pagination(inProps) {
|
|
|
4502
4577
|
},
|
|
4503
4578
|
"/ ",
|
|
4504
4579
|
lastPage
|
|
4505
|
-
), /* @__PURE__ */
|
|
4580
|
+
), /* @__PURE__ */ import_react29.default.createElement(Stack_default, { direction: "row" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
4506
4581
|
PaginationIconButton,
|
|
4507
4582
|
{
|
|
4508
4583
|
size,
|
|
@@ -4512,8 +4587,8 @@ function Pagination(inProps) {
|
|
|
4512
4587
|
disabled: paginationModel.page === lastPage,
|
|
4513
4588
|
"aria-label": "Next page"
|
|
4514
4589
|
},
|
|
4515
|
-
/* @__PURE__ */
|
|
4516
|
-
), /* @__PURE__ */
|
|
4590
|
+
/* @__PURE__ */ import_react29.default.createElement(import_ChevronRightRounded.default, null)
|
|
4591
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
4517
4592
|
PaginationIconButton,
|
|
4518
4593
|
{
|
|
4519
4594
|
size,
|
|
@@ -4523,10 +4598,10 @@ function Pagination(inProps) {
|
|
|
4523
4598
|
disabled: paginationModel.page === lastPage,
|
|
4524
4599
|
"aria-label": "Last page"
|
|
4525
4600
|
},
|
|
4526
|
-
/* @__PURE__ */
|
|
4601
|
+
/* @__PURE__ */ import_react29.default.createElement(import_LastPageRounded.default, null)
|
|
4527
4602
|
))));
|
|
4528
4603
|
}
|
|
4529
|
-
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(
|
|
4530
4605
|
PaginationIconButton,
|
|
4531
4606
|
{
|
|
4532
4607
|
size,
|
|
@@ -4536,8 +4611,8 @@ function Pagination(inProps) {
|
|
|
4536
4611
|
disabled: paginationModel.page === firstPage,
|
|
4537
4612
|
"aria-label": "Previous page"
|
|
4538
4613
|
},
|
|
4539
|
-
/* @__PURE__ */
|
|
4540
|
-
), 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(
|
|
4541
4616
|
PaginationButton,
|
|
4542
4617
|
{
|
|
4543
4618
|
size,
|
|
@@ -4547,7 +4622,7 @@ function Pagination(inProps) {
|
|
|
4547
4622
|
"aria-label": "More previous pages"
|
|
4548
4623
|
},
|
|
4549
4624
|
"..."
|
|
4550
|
-
), 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(
|
|
4551
4626
|
PaginationButton,
|
|
4552
4627
|
{
|
|
4553
4628
|
size,
|
|
@@ -4557,7 +4632,7 @@ function Pagination(inProps) {
|
|
|
4557
4632
|
onClick: () => handlePageChange(paginationModel.page + 3)
|
|
4558
4633
|
},
|
|
4559
4634
|
"..."
|
|
4560
|
-
), 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(
|
|
4561
4636
|
PaginationIconButton,
|
|
4562
4637
|
{
|
|
4563
4638
|
size,
|
|
@@ -4567,7 +4642,7 @@ function Pagination(inProps) {
|
|
|
4567
4642
|
disabled: paginationModel.page === lastPage,
|
|
4568
4643
|
"aria-label": "Next page"
|
|
4569
4644
|
},
|
|
4570
|
-
/* @__PURE__ */
|
|
4645
|
+
/* @__PURE__ */ import_react29.default.createElement(import_ChevronRightRounded.default, null)
|
|
4571
4646
|
)));
|
|
4572
4647
|
}
|
|
4573
4648
|
Pagination.displayName = "Pagination";
|
|
@@ -4641,9 +4716,9 @@ function Component(props, apiRef) {
|
|
|
4641
4716
|
isTotalSelected: ___________,
|
|
4642
4717
|
...innerProps
|
|
4643
4718
|
} = props;
|
|
4644
|
-
const tableId = (0,
|
|
4645
|
-
const parentRef = (0,
|
|
4646
|
-
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);
|
|
4647
4722
|
const {
|
|
4648
4723
|
columns,
|
|
4649
4724
|
processedColumnGroups,
|
|
@@ -4679,10 +4754,10 @@ function Component(props, apiRef) {
|
|
|
4679
4754
|
measureElement: (element) => element.clientHeight,
|
|
4680
4755
|
overscan: 10
|
|
4681
4756
|
});
|
|
4682
|
-
const paginationModel = (0,
|
|
4757
|
+
const paginationModel = (0, import_react30.useMemo)(() => ({ page, pageSize }), [page, pageSize]);
|
|
4683
4758
|
const columnsKey = getObjectVersion(columns);
|
|
4684
|
-
const headerCheckboxElement = (0,
|
|
4685
|
-
() => /* @__PURE__ */
|
|
4759
|
+
const headerCheckboxElement = (0, import_react30.useMemo)(
|
|
4760
|
+
() => /* @__PURE__ */ import_react30.default.createElement(
|
|
4686
4761
|
RenderCheckbox,
|
|
4687
4762
|
{
|
|
4688
4763
|
onChange: onAllCheckboxChange,
|
|
@@ -4707,20 +4782,20 @@ function Component(props, apiRef) {
|
|
|
4707
4782
|
const showNoRowsOverlay = !loading && rowCount === 0;
|
|
4708
4783
|
const showFillerColumn = columns.length > 0 && columns.every((c) => !!c.width);
|
|
4709
4784
|
const totalColCount = Math.max(1, columns.length + (checkboxSelection ? 1 : 0) + (showFillerColumn ? 1 : 0));
|
|
4710
|
-
const getRowClickHandler = (0,
|
|
4785
|
+
const getRowClickHandler = (0, import_react30.useCallback)(
|
|
4711
4786
|
(row, rowId) => (e) => {
|
|
4712
4787
|
onRowClick?.({ row, rowId }, e);
|
|
4713
4788
|
checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
|
|
4714
4789
|
},
|
|
4715
4790
|
[onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
|
|
4716
4791
|
);
|
|
4717
|
-
const getRowFocusHandler = (0,
|
|
4792
|
+
const getRowFocusHandler = (0, import_react30.useCallback)(
|
|
4718
4793
|
(rowId) => () => {
|
|
4719
4794
|
onRowFocus(rowId);
|
|
4720
4795
|
},
|
|
4721
4796
|
[onRowFocus]
|
|
4722
4797
|
);
|
|
4723
|
-
const getCheckboxClickHandler = (0,
|
|
4798
|
+
const getCheckboxClickHandler = (0, import_react30.useCallback)(
|
|
4724
4799
|
(rowId, row) => (e) => {
|
|
4725
4800
|
e.stopPropagation();
|
|
4726
4801
|
if (isRowSelectableCheck(rowId, row)) {
|
|
@@ -4730,7 +4805,7 @@ function Component(props, apiRef) {
|
|
|
4730
4805
|
},
|
|
4731
4806
|
[onCheckboxChange, isRowSelectableCheck, onRowFocus]
|
|
4732
4807
|
);
|
|
4733
|
-
const handleTableKeyDown = (0,
|
|
4808
|
+
const handleTableKeyDown = (0, import_react30.useCallback)(
|
|
4734
4809
|
(e) => {
|
|
4735
4810
|
const supportedKeys = ["ArrowUp", "ArrowDown", " ", "Home", "End", "PageUp", "PageDown"];
|
|
4736
4811
|
if (!supportedKeys.includes(e.key)) return;
|
|
@@ -4820,7 +4895,7 @@ function Component(props, apiRef) {
|
|
|
4820
4895
|
virtualizer
|
|
4821
4896
|
]
|
|
4822
4897
|
);
|
|
4823
|
-
(0,
|
|
4898
|
+
(0, import_react30.useImperativeHandle)(apiRef, () => ({
|
|
4824
4899
|
getRowIndexRelativeToVisibleRows(rowId) {
|
|
4825
4900
|
return dataInPage.findIndex((row) => String(getId(row)) === rowId);
|
|
4826
4901
|
},
|
|
@@ -4836,7 +4911,7 @@ function Component(props, apiRef) {
|
|
|
4836
4911
|
});
|
|
4837
4912
|
}
|
|
4838
4913
|
}));
|
|
4839
|
-
return /* @__PURE__ */
|
|
4914
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
4840
4915
|
Box_default,
|
|
4841
4916
|
{
|
|
4842
4917
|
sx: {
|
|
@@ -4846,7 +4921,7 @@ function Component(props, apiRef) {
|
|
|
4846
4921
|
flexDirection: "column"
|
|
4847
4922
|
}
|
|
4848
4923
|
},
|
|
4849
|
-
(!!checkboxSelection || !!Toolbar) && /* @__PURE__ */
|
|
4924
|
+
(!!checkboxSelection || !!Toolbar) && /* @__PURE__ */ import_react30.default.createElement(
|
|
4850
4925
|
Stack_default,
|
|
4851
4926
|
{
|
|
4852
4927
|
direction: "row",
|
|
@@ -4856,10 +4931,10 @@ function Component(props, apiRef) {
|
|
|
4856
4931
|
justifyContent: "space-between",
|
|
4857
4932
|
alignItems: "center"
|
|
4858
4933
|
},
|
|
4859
|
-
!!checkboxSelection && /* @__PURE__ */
|
|
4860
|
-
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 || {} })
|
|
4861
4936
|
),
|
|
4862
|
-
/* @__PURE__ */
|
|
4937
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
4863
4938
|
Sheet_default,
|
|
4864
4939
|
{
|
|
4865
4940
|
variant: "outlined",
|
|
@@ -4880,24 +4955,24 @@ function Component(props, apiRef) {
|
|
|
4880
4955
|
ref: parentRef,
|
|
4881
4956
|
...backgroundProps
|
|
4882
4957
|
},
|
|
4883
|
-
/* @__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(
|
|
4884
4959
|
"col",
|
|
4885
4960
|
{
|
|
4886
4961
|
style: {
|
|
4887
4962
|
width: "40px"
|
|
4888
4963
|
}
|
|
4889
4964
|
}
|
|
4890
|
-
), columns.map((c) => /* @__PURE__ */
|
|
4965
|
+
), columns.map((c) => /* @__PURE__ */ import_react30.default.createElement(
|
|
4891
4966
|
"col",
|
|
4892
4967
|
{
|
|
4893
4968
|
ref: c.tableColRef,
|
|
4894
|
-
key:
|
|
4969
|
+
key: c.columnId,
|
|
4895
4970
|
style: {
|
|
4896
4971
|
width: c.width,
|
|
4897
4972
|
minWidth: c.minWidth ?? "50px"
|
|
4898
4973
|
}
|
|
4899
4974
|
}
|
|
4900
|
-
)), 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(
|
|
4901
4976
|
"th",
|
|
4902
4977
|
{
|
|
4903
4978
|
rowSpan: processedColumnGroups.maxLevel + 2,
|
|
@@ -4908,12 +4983,12 @@ function Component(props, apiRef) {
|
|
|
4908
4983
|
}
|
|
4909
4984
|
},
|
|
4910
4985
|
headerCheckboxElement
|
|
4911
|
-
), 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) => {
|
|
4912
4987
|
const nextGroup = levelGroups[groupIndex + 1];
|
|
4913
4988
|
const emptyCells = nextGroup ? nextGroup.startIndex - (group.startIndex + group.colspan) : columns.length - (group.startIndex + group.colspan);
|
|
4914
4989
|
const params = { groupId: group.groupId };
|
|
4915
4990
|
const computedHeaderClassName = group.headerClassName ? typeof group.headerClassName === "function" ? group.headerClassName(params) : group.headerClassName : void 0;
|
|
4916
|
-
return /* @__PURE__ */
|
|
4991
|
+
return /* @__PURE__ */ import_react30.default.createElement(import_react30.Fragment, { key: group.groupId }, /* @__PURE__ */ import_react30.default.createElement(
|
|
4917
4992
|
"th",
|
|
4918
4993
|
{
|
|
4919
4994
|
colSpan: group.colspan,
|
|
@@ -4925,14 +5000,14 @@ function Component(props, apiRef) {
|
|
|
4925
5000
|
className: computedHeaderClassName
|
|
4926
5001
|
},
|
|
4927
5002
|
group.headerName ?? group.groupId
|
|
4928
|
-
), emptyCells > 0 && Array.from({ length: emptyCells }).map((_2, i) => /* @__PURE__ */
|
|
4929
|
-
}), 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(
|
|
4930
5005
|
"th",
|
|
4931
5006
|
{
|
|
4932
5007
|
"aria-hidden": "true",
|
|
4933
5008
|
rowSpan: processedColumnGroups.maxLevel + 2
|
|
4934
5009
|
}
|
|
4935
|
-
))), /* @__PURE__ */
|
|
5010
|
+
))), /* @__PURE__ */ import_react30.default.createElement("tr", null, (!processedColumnGroups || processedColumnGroups.groups.length === 0) && checkboxSelection && /* @__PURE__ */ import_react30.default.createElement(
|
|
4936
5011
|
"th",
|
|
4937
5012
|
{
|
|
4938
5013
|
style: {
|
|
@@ -4943,7 +5018,7 @@ function Component(props, apiRef) {
|
|
|
4943
5018
|
headerCheckboxElement
|
|
4944
5019
|
), columns.map((c, i) => (
|
|
4945
5020
|
// @ts-ignore
|
|
4946
|
-
/* @__PURE__ */
|
|
5021
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
4947
5022
|
HeadCell2,
|
|
4948
5023
|
{
|
|
4949
5024
|
tableId,
|
|
@@ -4955,7 +5030,7 @@ function Component(props, apiRef) {
|
|
|
4955
5030
|
...c
|
|
4956
5031
|
}
|
|
4957
5032
|
)
|
|
4958
|
-
)), 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(
|
|
4959
5034
|
VirtualizedTableBody,
|
|
4960
5035
|
{
|
|
4961
5036
|
ref: tableBodyRef,
|
|
@@ -4966,7 +5041,7 @@ function Component(props, apiRef) {
|
|
|
4966
5041
|
role: "rowgroup",
|
|
4967
5042
|
"aria-label": "DataTableBody"
|
|
4968
5043
|
},
|
|
4969
|
-
!!loading && /* @__PURE__ */
|
|
5044
|
+
!!loading && /* @__PURE__ */ import_react30.default.createElement(OverlayWrapper, null, /* @__PURE__ */ import_react30.default.createElement(
|
|
4970
5045
|
"td",
|
|
4971
5046
|
{
|
|
4972
5047
|
style: {
|
|
@@ -4975,7 +5050,7 @@ function Component(props, apiRef) {
|
|
|
4975
5050
|
overflow: "visible"
|
|
4976
5051
|
}
|
|
4977
5052
|
},
|
|
4978
|
-
/* @__PURE__ */
|
|
5053
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
4979
5054
|
Box_default,
|
|
4980
5055
|
{
|
|
4981
5056
|
sx: {
|
|
@@ -4985,10 +5060,10 @@ function Component(props, apiRef) {
|
|
|
4985
5060
|
right: 0
|
|
4986
5061
|
}
|
|
4987
5062
|
},
|
|
4988
|
-
/* @__PURE__ */
|
|
5063
|
+
/* @__PURE__ */ import_react30.default.createElement(LoadingOverlay, null)
|
|
4989
5064
|
)
|
|
4990
5065
|
)),
|
|
4991
|
-
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(
|
|
4992
5067
|
Box_default,
|
|
4993
5068
|
{
|
|
4994
5069
|
sx: {
|
|
@@ -4998,14 +5073,14 @@ function Component(props, apiRef) {
|
|
|
4998
5073
|
minHeight: "150px"
|
|
4999
5074
|
}
|
|
5000
5075
|
},
|
|
5001
|
-
/* @__PURE__ */
|
|
5076
|
+
/* @__PURE__ */ import_react30.default.createElement(NoRowsOverlay, { ...noRowsOverlayProps })
|
|
5002
5077
|
))),
|
|
5003
5078
|
virtualizedItems.map((virtualizedRow, index) => {
|
|
5004
5079
|
const rowIndex = virtualizedRow.index;
|
|
5005
5080
|
const row = dataInPage[rowIndex];
|
|
5006
5081
|
const rowId = getId(row, rowIndex);
|
|
5007
5082
|
const striped = stripe && (stripe === "even" && (rowIndex + 1) % 2 === 0 || stripe === "odd" && (rowIndex + 1) % 2 === 1);
|
|
5008
|
-
return /* @__PURE__ */
|
|
5083
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
5009
5084
|
VirtualizedTableRow,
|
|
5010
5085
|
{
|
|
5011
5086
|
key: virtualizedRow.key,
|
|
@@ -5025,7 +5100,7 @@ function Component(props, apiRef) {
|
|
|
5025
5100
|
transform: `translateY(${virtualizedRow.start - index * virtualizedRow.size}px)`
|
|
5026
5101
|
}
|
|
5027
5102
|
},
|
|
5028
|
-
checkboxSelection && /* @__PURE__ */
|
|
5103
|
+
checkboxSelection && /* @__PURE__ */ import_react30.default.createElement(
|
|
5029
5104
|
"th",
|
|
5030
5105
|
{
|
|
5031
5106
|
scope: "row",
|
|
@@ -5033,7 +5108,7 @@ function Component(props, apiRef) {
|
|
|
5033
5108
|
textAlign: "center"
|
|
5034
5109
|
}
|
|
5035
5110
|
},
|
|
5036
|
-
/* @__PURE__ */
|
|
5111
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
5037
5112
|
RenderCheckbox,
|
|
5038
5113
|
{
|
|
5039
5114
|
onClick: getCheckboxClickHandler(rowId, row),
|
|
@@ -5044,7 +5119,7 @@ function Component(props, apiRef) {
|
|
|
5044
5119
|
}
|
|
5045
5120
|
)
|
|
5046
5121
|
),
|
|
5047
|
-
/* @__PURE__ */
|
|
5122
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
5048
5123
|
BodyRow2,
|
|
5049
5124
|
{
|
|
5050
5125
|
tableId,
|
|
@@ -5055,12 +5130,12 @@ function Component(props, apiRef) {
|
|
|
5055
5130
|
noWrap: props.noWrap
|
|
5056
5131
|
}
|
|
5057
5132
|
),
|
|
5058
|
-
showFillerColumn && /* @__PURE__ */
|
|
5133
|
+
showFillerColumn && /* @__PURE__ */ import_react30.default.createElement("td", { "aria-hidden": "true" })
|
|
5059
5134
|
);
|
|
5060
5135
|
})
|
|
5061
|
-
), Footer && /* @__PURE__ */
|
|
5136
|
+
), Footer && /* @__PURE__ */ import_react30.default.createElement(Footer, null))
|
|
5062
5137
|
),
|
|
5063
|
-
pagination && /* @__PURE__ */
|
|
5138
|
+
pagination && /* @__PURE__ */ import_react30.default.createElement(
|
|
5064
5139
|
Pagination_default,
|
|
5065
5140
|
{
|
|
5066
5141
|
pt: 2,
|
|
@@ -5073,11 +5148,11 @@ function Component(props, apiRef) {
|
|
|
5073
5148
|
)
|
|
5074
5149
|
);
|
|
5075
5150
|
}
|
|
5076
|
-
var DataTable = (0,
|
|
5151
|
+
var DataTable = (0, import_react30.forwardRef)(Component);
|
|
5077
5152
|
DataTable.displayName = "DataTable";
|
|
5078
5153
|
|
|
5079
5154
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
5080
|
-
var
|
|
5155
|
+
var import_react31 = __toESM(require("react"));
|
|
5081
5156
|
var import_react_imask2 = require("react-imask");
|
|
5082
5157
|
var import_CalendarToday2 = __toESM(require("@mui/icons-material/CalendarToday"));
|
|
5083
5158
|
var import_joy37 = require("@mui/joy");
|
|
@@ -5219,9 +5294,9 @@ var parseDates = (str, format) => {
|
|
|
5219
5294
|
var formatToPattern2 = (format) => {
|
|
5220
5295
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
5221
5296
|
};
|
|
5222
|
-
var TextMaskAdapter5 =
|
|
5297
|
+
var TextMaskAdapter5 = import_react31.default.forwardRef(function TextMaskAdapter6(props, ref) {
|
|
5223
5298
|
const { onChange, format, ...other } = props;
|
|
5224
|
-
return /* @__PURE__ */
|
|
5299
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5225
5300
|
import_react_imask2.IMaskInput,
|
|
5226
5301
|
{
|
|
5227
5302
|
...other,
|
|
@@ -5255,7 +5330,7 @@ var TextMaskAdapter5 = import_react30.default.forwardRef(function TextMaskAdapte
|
|
|
5255
5330
|
}
|
|
5256
5331
|
);
|
|
5257
5332
|
});
|
|
5258
|
-
var DateRangePicker = (0,
|
|
5333
|
+
var DateRangePicker = (0, import_react31.forwardRef)((inProps, ref) => {
|
|
5259
5334
|
const props = (0, import_joy37.useThemeProps)({ props: inProps, name: "DateRangePicker" });
|
|
5260
5335
|
const {
|
|
5261
5336
|
onChange,
|
|
@@ -5282,28 +5357,28 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5282
5357
|
numberOfMonths,
|
|
5283
5358
|
...innerProps
|
|
5284
5359
|
} = props;
|
|
5285
|
-
const innerRef = (0,
|
|
5286
|
-
const buttonRef = (0,
|
|
5360
|
+
const innerRef = (0, import_react31.useRef)(null);
|
|
5361
|
+
const buttonRef = (0, import_react31.useRef)(null);
|
|
5287
5362
|
const [rawValue, setValue] = useControlledState(
|
|
5288
5363
|
props.value,
|
|
5289
5364
|
props.defaultValue ?? null,
|
|
5290
|
-
(0,
|
|
5365
|
+
(0, import_react31.useCallback)(
|
|
5291
5366
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
5292
5367
|
[props.name, onChange]
|
|
5293
5368
|
)
|
|
5294
5369
|
);
|
|
5295
5370
|
const value = rawValue ?? "";
|
|
5296
5371
|
const isAlphabeticDisplay = hasAlphabeticMonth2(displayFormat);
|
|
5297
|
-
const [displayValue, setDisplayValue] = (0,
|
|
5372
|
+
const [displayValue, setDisplayValue] = (0, import_react31.useState)(
|
|
5298
5373
|
() => value ? formatValueString2(parseDates(value, format), displayFormat, locale) : ""
|
|
5299
5374
|
);
|
|
5300
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
5375
|
+
const [anchorEl, setAnchorEl] = (0, import_react31.useState)(null);
|
|
5301
5376
|
const open = Boolean(anchorEl);
|
|
5302
|
-
const calendarValue = (0,
|
|
5377
|
+
const calendarValue = (0, import_react31.useMemo)(
|
|
5303
5378
|
() => value ? parseDates(value, format) : void 0,
|
|
5304
5379
|
[value, format]
|
|
5305
5380
|
);
|
|
5306
|
-
(0,
|
|
5381
|
+
(0, import_react31.useEffect)(() => {
|
|
5307
5382
|
if (value) {
|
|
5308
5383
|
try {
|
|
5309
5384
|
const dates = parseDates(value, format);
|
|
@@ -5315,13 +5390,13 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5315
5390
|
setDisplayValue("");
|
|
5316
5391
|
}
|
|
5317
5392
|
}, [displayFormat, locale, value, format]);
|
|
5318
|
-
(0,
|
|
5393
|
+
(0, import_react31.useEffect)(() => {
|
|
5319
5394
|
if (!anchorEl) {
|
|
5320
5395
|
innerRef.current?.blur();
|
|
5321
5396
|
}
|
|
5322
5397
|
}, [anchorEl, innerRef]);
|
|
5323
|
-
(0,
|
|
5324
|
-
const handleChange = (0,
|
|
5398
|
+
(0, import_react31.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
5399
|
+
const handleChange = (0, import_react31.useCallback)(
|
|
5325
5400
|
(event) => {
|
|
5326
5401
|
const value2 = event.target.value;
|
|
5327
5402
|
setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat, locale) : value2);
|
|
@@ -5329,7 +5404,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5329
5404
|
},
|
|
5330
5405
|
[displayFormat, format, locale, setValue]
|
|
5331
5406
|
);
|
|
5332
|
-
const handleDisplayInputChange = (0,
|
|
5407
|
+
const handleDisplayInputChange = (0, import_react31.useCallback)(
|
|
5333
5408
|
(event) => {
|
|
5334
5409
|
if (event.target.value === "") {
|
|
5335
5410
|
handleChange({
|
|
@@ -5354,14 +5429,14 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5354
5429
|
},
|
|
5355
5430
|
[displayFormat, format, handleChange, props.name]
|
|
5356
5431
|
);
|
|
5357
|
-
const handleCalendarToggle = (0,
|
|
5432
|
+
const handleCalendarToggle = (0, import_react31.useCallback)(
|
|
5358
5433
|
(event) => {
|
|
5359
5434
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5360
5435
|
innerRef.current?.focus();
|
|
5361
5436
|
},
|
|
5362
5437
|
[anchorEl, setAnchorEl, innerRef]
|
|
5363
5438
|
);
|
|
5364
|
-
const handleCalendarChange = (0,
|
|
5439
|
+
const handleCalendarChange = (0, import_react31.useCallback)(
|
|
5365
5440
|
([date1, date2]) => {
|
|
5366
5441
|
if (!date1 || !date2) return;
|
|
5367
5442
|
const formattedValue = formatValueString2([date1, date2], format);
|
|
@@ -5375,7 +5450,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5375
5450
|
},
|
|
5376
5451
|
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat, locale]
|
|
5377
5452
|
);
|
|
5378
|
-
const handleInputMouseDown = (0,
|
|
5453
|
+
const handleInputMouseDown = (0, import_react31.useCallback)(
|
|
5379
5454
|
(event) => {
|
|
5380
5455
|
if (inputReadOnly || isAlphabeticDisplay) {
|
|
5381
5456
|
event.preventDefault();
|
|
@@ -5384,7 +5459,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5384
5459
|
},
|
|
5385
5460
|
[inputReadOnly, isAlphabeticDisplay, buttonRef]
|
|
5386
5461
|
);
|
|
5387
|
-
const handleInputClick = (0,
|
|
5462
|
+
const handleInputClick = (0, import_react31.useCallback)(
|
|
5388
5463
|
(event) => {
|
|
5389
5464
|
if (inputReadOnly && !readOnly) {
|
|
5390
5465
|
handleCalendarToggle(event);
|
|
@@ -5392,7 +5467,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5392
5467
|
},
|
|
5393
5468
|
[inputReadOnly, readOnly, handleCalendarToggle]
|
|
5394
5469
|
);
|
|
5395
|
-
const handlePresetClick = (0,
|
|
5470
|
+
const handlePresetClick = (0, import_react31.useCallback)(
|
|
5396
5471
|
(presetValue) => {
|
|
5397
5472
|
if (props.value !== void 0) {
|
|
5398
5473
|
onChange?.({ target: { name: props.name, value: presetValue } });
|
|
@@ -5405,7 +5480,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5405
5480
|
},
|
|
5406
5481
|
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat, locale]
|
|
5407
5482
|
);
|
|
5408
|
-
const isPresetDisabled = (0,
|
|
5483
|
+
const isPresetDisabled = (0, import_react31.useCallback)(
|
|
5409
5484
|
(presetValue) => {
|
|
5410
5485
|
try {
|
|
5411
5486
|
const dates = parseDates(presetValue, format);
|
|
@@ -5424,7 +5499,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5424
5499
|
},
|
|
5425
5500
|
[format, minDate, maxDate, disableFuture, disablePast]
|
|
5426
5501
|
);
|
|
5427
|
-
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(
|
|
5428
5503
|
Input_default,
|
|
5429
5504
|
{
|
|
5430
5505
|
...innerProps,
|
|
@@ -5450,9 +5525,8 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5450
5525
|
}
|
|
5451
5526
|
},
|
|
5452
5527
|
error,
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
endDecorator: /* @__PURE__ */ import_react30.default.createElement(
|
|
5528
|
+
sx: { width: "100%" },
|
|
5529
|
+
endDecorator: /* @__PURE__ */ import_react31.default.createElement(
|
|
5456
5530
|
CalendarButton2,
|
|
5457
5531
|
{
|
|
5458
5532
|
ref: buttonRef,
|
|
@@ -5464,13 +5538,13 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5464
5538
|
"aria-expanded": open,
|
|
5465
5539
|
disabled
|
|
5466
5540
|
},
|
|
5467
|
-
/* @__PURE__ */
|
|
5541
|
+
/* @__PURE__ */ import_react31.default.createElement(import_CalendarToday2.default, null)
|
|
5468
5542
|
),
|
|
5469
5543
|
label,
|
|
5470
5544
|
helperText,
|
|
5471
5545
|
readOnly: readOnly || inputReadOnly || isAlphabeticDisplay
|
|
5472
5546
|
}
|
|
5473
|
-
), open && /* @__PURE__ */
|
|
5547
|
+
), open && /* @__PURE__ */ import_react31.default.createElement(import_base4.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react31.default.createElement(
|
|
5474
5548
|
StyledPopper2,
|
|
5475
5549
|
{
|
|
5476
5550
|
id: "date-range-picker-popper",
|
|
@@ -5489,7 +5563,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5489
5563
|
"aria-label": "Calendar Tooltip",
|
|
5490
5564
|
"aria-expanded": open
|
|
5491
5565
|
},
|
|
5492
|
-
/* @__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(
|
|
5493
5567
|
Calendar_default,
|
|
5494
5568
|
{
|
|
5495
5569
|
rangeSelection: true,
|
|
@@ -5502,14 +5576,14 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5502
5576
|
locale,
|
|
5503
5577
|
numberOfMonths
|
|
5504
5578
|
}
|
|
5505
|
-
), !hideClearButton && /* @__PURE__ */
|
|
5579
|
+
), !hideClearButton && /* @__PURE__ */ import_react31.default.createElement(
|
|
5506
5580
|
DialogActions_default,
|
|
5507
5581
|
{
|
|
5508
5582
|
sx: {
|
|
5509
5583
|
p: 1
|
|
5510
5584
|
}
|
|
5511
5585
|
},
|
|
5512
|
-
/* @__PURE__ */
|
|
5586
|
+
/* @__PURE__ */ import_react31.default.createElement(
|
|
5513
5587
|
Button_default,
|
|
5514
5588
|
{
|
|
5515
5589
|
size,
|
|
@@ -5523,9 +5597,9 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5523
5597
|
},
|
|
5524
5598
|
"Clear"
|
|
5525
5599
|
)
|
|
5526
|
-
)), presets && presets.length > 0 && /* @__PURE__ */
|
|
5600
|
+
)), presets && presets.length > 0 && /* @__PURE__ */ import_react31.default.createElement(PresetPanel2, null, presets.map((preset) => {
|
|
5527
5601
|
const disabled2 = isPresetDisabled(preset.value);
|
|
5528
|
-
return /* @__PURE__ */
|
|
5602
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5529
5603
|
PresetItem2,
|
|
5530
5604
|
{
|
|
5531
5605
|
key: preset.label,
|
|
@@ -5544,7 +5618,7 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
|
|
|
5544
5618
|
DateRangePicker.displayName = "DateRangePicker";
|
|
5545
5619
|
|
|
5546
5620
|
// src/components/Drawer/Drawer.tsx
|
|
5547
|
-
var
|
|
5621
|
+
var import_react32 = __toESM(require("react"));
|
|
5548
5622
|
var import_joy38 = require("@mui/joy");
|
|
5549
5623
|
var import_framer_motion22 = require("framer-motion");
|
|
5550
5624
|
var MotionDrawer = (0, import_framer_motion22.motion)(import_joy38.Drawer);
|
|
@@ -5562,7 +5636,7 @@ var StyledDrawer = (0, import_joy38.styled)(MotionDrawer)(({ theme, size = "md"
|
|
|
5562
5636
|
}));
|
|
5563
5637
|
var Drawer = (props) => {
|
|
5564
5638
|
const { children, ...innerProps } = props;
|
|
5565
|
-
return /* @__PURE__ */
|
|
5639
|
+
return /* @__PURE__ */ import_react32.default.createElement(StyledDrawer, { ...innerProps }, children);
|
|
5566
5640
|
};
|
|
5567
5641
|
Drawer.displayName = "Drawer";
|
|
5568
5642
|
|
|
@@ -5593,10 +5667,10 @@ DialogTitle.displayName = "DialogTitle";
|
|
|
5593
5667
|
var DialogTitle_default = DialogTitle;
|
|
5594
5668
|
|
|
5595
5669
|
// src/components/DialogFrame/DialogFrame.tsx
|
|
5596
|
-
var
|
|
5670
|
+
var import_react34 = __toESM(require("react"));
|
|
5597
5671
|
|
|
5598
5672
|
// src/components/Modal/Modal.tsx
|
|
5599
|
-
var
|
|
5673
|
+
var import_react33 = __toESM(require("react"));
|
|
5600
5674
|
var import_joy41 = require("@mui/joy");
|
|
5601
5675
|
var import_framer_motion25 = require("framer-motion");
|
|
5602
5676
|
var MotionModal = (0, import_framer_motion25.motion)(import_joy41.Modal);
|
|
@@ -5611,10 +5685,10 @@ var ModalClose = import_joy41.ModalClose;
|
|
|
5611
5685
|
var MotionModalOverflow = (0, import_framer_motion25.motion)(import_joy41.ModalOverflow);
|
|
5612
5686
|
var ModalOverflow = MotionModalOverflow;
|
|
5613
5687
|
ModalOverflow.displayName = "ModalOverflow";
|
|
5614
|
-
|
|
5688
|
+
var ModalFrame = import_react33.default.forwardRef((props, ref) => {
|
|
5615
5689
|
const { title, children, titleStartDecorator, onClose, ...innerProps } = props;
|
|
5616
|
-
return /* @__PURE__ */
|
|
5617
|
-
}
|
|
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
|
+
});
|
|
5618
5692
|
ModalFrame.displayName = "ModalFrame";
|
|
5619
5693
|
|
|
5620
5694
|
// src/components/DialogFrame/DialogFrame.tsx
|
|
@@ -5625,20 +5699,20 @@ var StyledDialogFrame = (0, import_joy42.styled)(ModalDialog, {
|
|
|
5625
5699
|
})({
|
|
5626
5700
|
padding: 0
|
|
5627
5701
|
});
|
|
5628
|
-
var DialogFrame =
|
|
5702
|
+
var DialogFrame = import_react34.default.forwardRef((props, ref) => {
|
|
5629
5703
|
const { title, children, actions, fullscreen, onSubmit, ...innerProps } = props;
|
|
5630
5704
|
const formProps = onSubmit ? { component: "form", onSubmit } : void 0;
|
|
5631
|
-
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));
|
|
5632
5706
|
});
|
|
5633
5707
|
DialogFrame.displayName = "DialogFrame";
|
|
5634
5708
|
|
|
5635
5709
|
// src/components/Divider/Divider.tsx
|
|
5636
|
-
var
|
|
5710
|
+
var import_react35 = __toESM(require("react"));
|
|
5637
5711
|
var import_joy43 = require("@mui/joy");
|
|
5638
5712
|
var import_framer_motion26 = require("framer-motion");
|
|
5639
5713
|
var MotionDivider = (0, import_framer_motion26.motion)(import_joy43.Divider);
|
|
5640
5714
|
var Divider = (props) => {
|
|
5641
|
-
return /* @__PURE__ */
|
|
5715
|
+
return /* @__PURE__ */ import_react35.default.createElement(MotionDivider, { ...props });
|
|
5642
5716
|
};
|
|
5643
5717
|
Divider.displayName = "Divider";
|
|
5644
5718
|
|
|
@@ -5659,16 +5733,16 @@ var InsetDrawer = (0, import_joy44.styled)(import_joy44.Drawer)(({ theme }) => (
|
|
|
5659
5733
|
}));
|
|
5660
5734
|
|
|
5661
5735
|
// src/components/FilterableCheckboxGroup/FilterableCheckboxGroup.tsx
|
|
5662
|
-
var
|
|
5736
|
+
var import_react36 = __toESM(require("react"));
|
|
5663
5737
|
var import_Search = __toESM(require("@mui/icons-material/Search"));
|
|
5664
5738
|
var import_joy45 = require("@mui/joy");
|
|
5665
5739
|
var import_react_virtual3 = require("@tanstack/react-virtual");
|
|
5666
5740
|
var EMPTY_VALUE = [];
|
|
5667
5741
|
function LabelWithTooltip(props) {
|
|
5668
5742
|
const { label, size } = props;
|
|
5669
|
-
const labelContentRef = (0,
|
|
5670
|
-
const [isOverflowing, setIsOverflowing] = (0,
|
|
5671
|
-
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(
|
|
5672
5746
|
"span",
|
|
5673
5747
|
{
|
|
5674
5748
|
ref: labelContentRef,
|
|
@@ -5684,14 +5758,14 @@ function LabelWithTooltip(props) {
|
|
|
5684
5758
|
},
|
|
5685
5759
|
label
|
|
5686
5760
|
);
|
|
5687
|
-
(0,
|
|
5761
|
+
(0, import_react36.useEffect)(() => {
|
|
5688
5762
|
const element = labelContentRef.current;
|
|
5689
5763
|
if (element) {
|
|
5690
5764
|
setIsOverflowing(element.scrollWidth > element.clientWidth);
|
|
5691
5765
|
}
|
|
5692
5766
|
}, [label]);
|
|
5693
5767
|
if (isOverflowing) {
|
|
5694
|
-
return /* @__PURE__ */
|
|
5768
|
+
return /* @__PURE__ */ import_react36.default.createElement(Tooltip_default, { variant: "solid", size, title: label, placement: "bottom-start" }, labelContent);
|
|
5695
5769
|
}
|
|
5696
5770
|
return labelContent;
|
|
5697
5771
|
}
|
|
@@ -5709,22 +5783,22 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5709
5783
|
maxHeight = 300,
|
|
5710
5784
|
disabled
|
|
5711
5785
|
} = props;
|
|
5712
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
5713
|
-
const [sortedOptions, setSortedOptions] = (0,
|
|
5786
|
+
const [searchTerm, setSearchTerm] = (0, import_react36.useState)("");
|
|
5787
|
+
const [sortedOptions, setSortedOptions] = (0, import_react36.useState)(options);
|
|
5714
5788
|
const [rawValue, setInternalValue] = useControlledState(
|
|
5715
5789
|
value,
|
|
5716
5790
|
value ?? EMPTY_VALUE,
|
|
5717
|
-
(0,
|
|
5791
|
+
(0, import_react36.useCallback)((newValue) => onChange?.(newValue ?? []), [onChange])
|
|
5718
5792
|
);
|
|
5719
5793
|
const internalValue = rawValue ?? EMPTY_VALUE;
|
|
5720
|
-
const parentRef = (0,
|
|
5721
|
-
const isInitialSortRef = (0,
|
|
5722
|
-
const prevOptionsRef = (0,
|
|
5723
|
-
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)(() => {
|
|
5724
5798
|
if (!searchTerm) return sortedOptions;
|
|
5725
5799
|
return sortedOptions.filter((option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
5726
5800
|
}, [sortedOptions, searchTerm]);
|
|
5727
|
-
const itemSize = (0,
|
|
5801
|
+
const itemSize = (0, import_react36.useMemo)(() => {
|
|
5728
5802
|
switch (size) {
|
|
5729
5803
|
case "sm":
|
|
5730
5804
|
return 28;
|
|
@@ -5742,7 +5816,7 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5742
5816
|
overscan: 5
|
|
5743
5817
|
});
|
|
5744
5818
|
const items = virtualizer.getVirtualItems();
|
|
5745
|
-
(0,
|
|
5819
|
+
(0, import_react36.useEffect)(() => {
|
|
5746
5820
|
const optionsChanged = prevOptionsRef.current.length !== options.length || prevOptionsRef.current.some(
|
|
5747
5821
|
(prevOption, index) => prevOption.value !== options[index]?.value || prevOption.label !== options[index]?.label || prevOption.disabled !== options[index]?.disabled
|
|
5748
5822
|
);
|
|
@@ -5768,13 +5842,13 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5768
5842
|
}
|
|
5769
5843
|
}
|
|
5770
5844
|
}, [options, value]);
|
|
5771
|
-
(0,
|
|
5845
|
+
(0, import_react36.useEffect)(() => {
|
|
5772
5846
|
virtualizer.measure();
|
|
5773
5847
|
}, [virtualizer, filteredOptions, size]);
|
|
5774
|
-
const handleSearchChange = (0,
|
|
5848
|
+
const handleSearchChange = (0, import_react36.useCallback)((event) => {
|
|
5775
5849
|
setSearchTerm(event.target.value);
|
|
5776
5850
|
}, []);
|
|
5777
|
-
const handleCheckboxChange = (0,
|
|
5851
|
+
const handleCheckboxChange = (0, import_react36.useCallback)(
|
|
5778
5852
|
(optionValue) => (event) => {
|
|
5779
5853
|
const checked = event.target.checked;
|
|
5780
5854
|
const newValue = checked ? [...internalValue, optionValue] : internalValue.filter((v) => v !== optionValue);
|
|
@@ -5782,7 +5856,7 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5782
5856
|
},
|
|
5783
5857
|
[internalValue, setInternalValue]
|
|
5784
5858
|
);
|
|
5785
|
-
const handleSelectAll = (0,
|
|
5859
|
+
const handleSelectAll = (0, import_react36.useCallback)(
|
|
5786
5860
|
(event) => {
|
|
5787
5861
|
const checked = event.target.checked;
|
|
5788
5862
|
const enabledOptions = filteredOptions.filter((option) => !option.disabled);
|
|
@@ -5798,10 +5872,10 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5798
5872
|
},
|
|
5799
5873
|
[filteredOptions, internalValue, setInternalValue]
|
|
5800
5874
|
);
|
|
5801
|
-
const enabledFilteredOptions = (0,
|
|
5875
|
+
const enabledFilteredOptions = (0, import_react36.useMemo)(() => filteredOptions.filter((option) => !option.disabled), [filteredOptions]);
|
|
5802
5876
|
const isAllSelected = enabledFilteredOptions.length > 0 && enabledFilteredOptions.every((option) => internalValue.includes(option.value));
|
|
5803
5877
|
const isIndeterminate = !isAllSelected && enabledFilteredOptions.some((option) => internalValue.includes(option.value));
|
|
5804
|
-
return /* @__PURE__ */
|
|
5878
|
+
return /* @__PURE__ */ import_react36.default.createElement("div", { style: { width: "100%" } }, /* @__PURE__ */ import_react36.default.createElement(
|
|
5805
5879
|
Input_default,
|
|
5806
5880
|
{
|
|
5807
5881
|
label,
|
|
@@ -5814,9 +5888,9 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5814
5888
|
onChange: handleSearchChange,
|
|
5815
5889
|
size,
|
|
5816
5890
|
disabled,
|
|
5817
|
-
endDecorator: /* @__PURE__ */
|
|
5891
|
+
endDecorator: /* @__PURE__ */ import_react36.default.createElement(import_Search.default, null)
|
|
5818
5892
|
}
|
|
5819
|
-
), 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(
|
|
5820
5894
|
"div",
|
|
5821
5895
|
{
|
|
5822
5896
|
ref: parentRef,
|
|
@@ -5827,7 +5901,7 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5827
5901
|
marginTop: "8px"
|
|
5828
5902
|
}
|
|
5829
5903
|
},
|
|
5830
|
-
!searchTerm && /* @__PURE__ */
|
|
5904
|
+
!searchTerm && /* @__PURE__ */ import_react36.default.createElement(
|
|
5831
5905
|
Checkbox_default,
|
|
5832
5906
|
{
|
|
5833
5907
|
label: "Select all",
|
|
@@ -5844,7 +5918,7 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5844
5918
|
sx: { width: "100%", height: itemSize }
|
|
5845
5919
|
}
|
|
5846
5920
|
),
|
|
5847
|
-
/* @__PURE__ */
|
|
5921
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
5848
5922
|
Stack_default,
|
|
5849
5923
|
{
|
|
5850
5924
|
sx: {
|
|
@@ -5854,11 +5928,11 @@ function FilterableCheckboxGroup(inProps) {
|
|
|
5854
5928
|
},
|
|
5855
5929
|
items.map((virtualRow) => {
|
|
5856
5930
|
const option = filteredOptions[virtualRow.index];
|
|
5857
|
-
return /* @__PURE__ */
|
|
5931
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
5858
5932
|
Checkbox_default,
|
|
5859
5933
|
{
|
|
5860
5934
|
key: virtualRow.key,
|
|
5861
|
-
label: /* @__PURE__ */
|
|
5935
|
+
label: /* @__PURE__ */ import_react36.default.createElement(LabelWithTooltip, { label: option.label, size }),
|
|
5862
5936
|
checked: internalValue.includes(option.value),
|
|
5863
5937
|
onChange: handleCheckboxChange(option.value),
|
|
5864
5938
|
size,
|
|
@@ -5889,9 +5963,12 @@ FilterableCheckboxGroup.displayName = "FilterableCheckboxGroup";
|
|
|
5889
5963
|
var import_joy46 = require("@mui/joy");
|
|
5890
5964
|
|
|
5891
5965
|
// src/components/IconMenuButton/IconMenuButton.tsx
|
|
5892
|
-
var
|
|
5966
|
+
var import_react37 = __toESM(require("react"));
|
|
5893
5967
|
var import_joy47 = require("@mui/joy");
|
|
5894
|
-
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) {
|
|
5895
5972
|
const {
|
|
5896
5973
|
size,
|
|
5897
5974
|
icon,
|
|
@@ -5902,8 +5979,10 @@ function IconMenuButton(props) {
|
|
|
5902
5979
|
variant = "plain",
|
|
5903
5980
|
placement = "bottom"
|
|
5904
5981
|
} = props;
|
|
5982
|
+
const { ref: buttonComponentRef, ...buttonComponentProps } = props.buttonComponentProps ?? {};
|
|
5983
|
+
const mergedButtonRef = useMergedRef(buttonComponentRef, ref);
|
|
5905
5984
|
if (!items.length) {
|
|
5906
|
-
return /* @__PURE__ */
|
|
5985
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
|
5907
5986
|
import_joy47.IconButton,
|
|
5908
5987
|
{
|
|
5909
5988
|
component: props.buttonComponent ?? "button",
|
|
@@ -5912,15 +5991,16 @@ function IconMenuButton(props) {
|
|
|
5912
5991
|
color,
|
|
5913
5992
|
disabled,
|
|
5914
5993
|
loading,
|
|
5915
|
-
...
|
|
5994
|
+
...buttonComponentProps,
|
|
5995
|
+
ref: mergedButtonRef
|
|
5916
5996
|
},
|
|
5917
5997
|
icon
|
|
5918
5998
|
);
|
|
5919
5999
|
}
|
|
5920
|
-
return /* @__PURE__ */
|
|
6000
|
+
return /* @__PURE__ */ import_react37.default.createElement(Dropdown_default, null, /* @__PURE__ */ import_react37.default.createElement(
|
|
5921
6001
|
import_joy47.MenuButton,
|
|
5922
6002
|
{
|
|
5923
|
-
slots: { root:
|
|
6003
|
+
slots: { root: MenuButtonRootSlot },
|
|
5924
6004
|
slotProps: {
|
|
5925
6005
|
root: {
|
|
5926
6006
|
component: props.buttonComponent ?? "button",
|
|
@@ -5929,24 +6009,27 @@ function IconMenuButton(props) {
|
|
|
5929
6009
|
color,
|
|
5930
6010
|
disabled,
|
|
5931
6011
|
loading,
|
|
5932
|
-
...
|
|
6012
|
+
...buttonComponentProps,
|
|
6013
|
+
// Joy의 useSlot이 내부 ref와 이 ref를 합쳐준다. 위 no-items 분기와 같은 경로로 ref를 넘긴다.
|
|
6014
|
+
ref: mergedButtonRef
|
|
5933
6015
|
}
|
|
5934
6016
|
}
|
|
5935
6017
|
},
|
|
5936
6018
|
icon
|
|
5937
|
-
), /* @__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))));
|
|
5938
6020
|
}
|
|
6021
|
+
var IconMenuButton = import_react37.default.forwardRef(IconMenuButtonInner);
|
|
5939
6022
|
IconMenuButton.displayName = "IconMenuButton";
|
|
5940
6023
|
|
|
5941
6024
|
// src/components/Markdown/Markdown.tsx
|
|
5942
|
-
var
|
|
6025
|
+
var import_react38 = __toESM(require("react"));
|
|
5943
6026
|
var import_joy48 = require("@mui/joy");
|
|
5944
6027
|
var import_joy49 = require("@mui/joy");
|
|
5945
6028
|
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
5946
|
-
var LazyReactMarkdown = (0,
|
|
6029
|
+
var LazyReactMarkdown = (0, import_react38.lazy)(() => import("react-markdown"));
|
|
5947
6030
|
var Markdown = (props) => {
|
|
5948
|
-
const [rehypeAccent2, setRehypeAccent] = (0,
|
|
5949
|
-
(0,
|
|
6031
|
+
const [rehypeAccent2, setRehypeAccent] = (0, import_react38.useState)(null);
|
|
6032
|
+
(0, import_react38.useEffect)(() => {
|
|
5950
6033
|
const loadRehypeAccent = async () => {
|
|
5951
6034
|
const module2 = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
|
|
5952
6035
|
setRehypeAccent(() => module2.rehypeAccent);
|
|
@@ -5968,8 +6051,8 @@ var Markdown = (props) => {
|
|
|
5968
6051
|
if (!rehypeAccent2) {
|
|
5969
6052
|
return null;
|
|
5970
6053
|
}
|
|
5971
|
-
return /* @__PURE__ */
|
|
5972
|
-
|
|
6054
|
+
return /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ import_react38.default.createElement(
|
|
6055
|
+
import_react38.Suspense,
|
|
5973
6056
|
{
|
|
5974
6057
|
fallback: (
|
|
5975
6058
|
// While in the fallback state, prevent browser auto-translation (e.g. Chrome/Google Translate)
|
|
@@ -5977,10 +6060,10 @@ var Markdown = (props) => {
|
|
|
5977
6060
|
// swaps the fallback for the real content via insertBefore; if the browser has mutated the DOM
|
|
5978
6061
|
// in the meantime, the reference node's parent changes and React throws a DOMException
|
|
5979
6062
|
// ("Failed to execute 'insertBefore' on 'Node'"), crashing the subtree. (cf. facebook/react#11538)
|
|
5980
|
-
fallback || /* @__PURE__ */
|
|
6063
|
+
fallback || /* @__PURE__ */ import_react38.default.createElement(Typography, { translate: "no", className: "notranslate" }, /* @__PURE__ */ import_react38.default.createElement(import_joy48.Skeleton, null, content || ""))
|
|
5981
6064
|
)
|
|
5982
6065
|
},
|
|
5983
|
-
/* @__PURE__ */
|
|
6066
|
+
/* @__PURE__ */ import_react38.default.createElement(
|
|
5984
6067
|
LazyReactMarkdown,
|
|
5985
6068
|
{
|
|
5986
6069
|
...markdownOptions,
|
|
@@ -5988,17 +6071,17 @@ var Markdown = (props) => {
|
|
|
5988
6071
|
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
5989
6072
|
remarkPlugins: [import_remark_gfm.default],
|
|
5990
6073
|
components: {
|
|
5991
|
-
a: ({ children, href }) => /* @__PURE__ */
|
|
5992
|
-
hr: () => /* @__PURE__ */
|
|
5993
|
-
b: ({ children }) => /* @__PURE__ */
|
|
5994
|
-
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),
|
|
5995
6078
|
// Table components
|
|
5996
|
-
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)),
|
|
5997
6080
|
// Code components
|
|
5998
6081
|
code: ({ children, className }) => {
|
|
5999
6082
|
const isBlock = className?.startsWith("language-");
|
|
6000
6083
|
if (isBlock) {
|
|
6001
|
-
return /* @__PURE__ */
|
|
6084
|
+
return /* @__PURE__ */ import_react38.default.createElement(
|
|
6002
6085
|
Typography,
|
|
6003
6086
|
{
|
|
6004
6087
|
component: "code",
|
|
@@ -6012,7 +6095,7 @@ var Markdown = (props) => {
|
|
|
6012
6095
|
children
|
|
6013
6096
|
);
|
|
6014
6097
|
}
|
|
6015
|
-
return /* @__PURE__ */
|
|
6098
|
+
return /* @__PURE__ */ import_react38.default.createElement(
|
|
6016
6099
|
Typography,
|
|
6017
6100
|
{
|
|
6018
6101
|
component: "code",
|
|
@@ -6027,7 +6110,7 @@ var Markdown = (props) => {
|
|
|
6027
6110
|
children
|
|
6028
6111
|
);
|
|
6029
6112
|
},
|
|
6030
|
-
pre: ({ children }) => /* @__PURE__ */
|
|
6113
|
+
pre: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(
|
|
6031
6114
|
Sheet,
|
|
6032
6115
|
{
|
|
6033
6116
|
variant: "soft",
|
|
@@ -6045,12 +6128,12 @@ var Markdown = (props) => {
|
|
|
6045
6128
|
// Task list checkbox
|
|
6046
6129
|
input: ({ checked, type }) => {
|
|
6047
6130
|
if (type === "checkbox") {
|
|
6048
|
-
return /* @__PURE__ */
|
|
6131
|
+
return /* @__PURE__ */ import_react38.default.createElement(Checkbox, { checked, disabled: true, size: "sm", sx: { mr: 1 } });
|
|
6049
6132
|
}
|
|
6050
|
-
return /* @__PURE__ */
|
|
6133
|
+
return /* @__PURE__ */ import_react38.default.createElement("input", { checked, type });
|
|
6051
6134
|
},
|
|
6052
6135
|
// Blockquote
|
|
6053
|
-
blockquote: ({ children }) => /* @__PURE__ */
|
|
6136
|
+
blockquote: ({ children }) => /* @__PURE__ */ import_react38.default.createElement(
|
|
6054
6137
|
Sheet,
|
|
6055
6138
|
{
|
|
6056
6139
|
variant: "soft",
|
|
@@ -6059,12 +6142,12 @@ var Markdown = (props) => {
|
|
|
6059
6142
|
children
|
|
6060
6143
|
),
|
|
6061
6144
|
// Image
|
|
6062
|
-
img: ({ src, alt }) => /* @__PURE__ */
|
|
6145
|
+
img: ({ src, alt }) => /* @__PURE__ */ import_react38.default.createElement("img", { src, alt, style: { maxWidth: "100%", borderRadius: "4px" } }),
|
|
6063
6146
|
// Text style components
|
|
6064
|
-
em: ({ children }) => /* @__PURE__ */
|
|
6065
|
-
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),
|
|
6066
6149
|
// Span for accent color (from rehype-accent plugin)
|
|
6067
|
-
span: ({ children, node }) => /* @__PURE__ */
|
|
6150
|
+
span: ({ children, node }) => /* @__PURE__ */ import_react38.default.createElement(Typography, { component: "span", textColor: node?.properties?.textColor }, children),
|
|
6068
6151
|
...markdownOptions?.components
|
|
6069
6152
|
}
|
|
6070
6153
|
}
|
|
@@ -6074,7 +6157,7 @@ var Markdown = (props) => {
|
|
|
6074
6157
|
Markdown.displayName = "Markdown";
|
|
6075
6158
|
|
|
6076
6159
|
// src/components/MenuButton/MenuButton.tsx
|
|
6077
|
-
var
|
|
6160
|
+
var import_react39 = __toESM(require("react"));
|
|
6078
6161
|
var import_joy50 = require("@mui/joy");
|
|
6079
6162
|
var import_ExpandMore = __toESM(require("@mui/icons-material/ExpandMore"));
|
|
6080
6163
|
function MenuButton2(props) {
|
|
@@ -6092,7 +6175,7 @@ function MenuButton2(props) {
|
|
|
6092
6175
|
placement = "bottom"
|
|
6093
6176
|
} = props;
|
|
6094
6177
|
if (!items.length) {
|
|
6095
|
-
return /* @__PURE__ */
|
|
6178
|
+
return /* @__PURE__ */ import_react39.default.createElement(
|
|
6096
6179
|
import_joy50.Button,
|
|
6097
6180
|
{
|
|
6098
6181
|
component: props.buttonComponent ?? "button",
|
|
@@ -6103,12 +6186,12 @@ function MenuButton2(props) {
|
|
|
6103
6186
|
loading,
|
|
6104
6187
|
startDecorator,
|
|
6105
6188
|
...props.buttonComponentProps ?? {},
|
|
6106
|
-
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)
|
|
6107
6190
|
},
|
|
6108
6191
|
buttonText
|
|
6109
6192
|
);
|
|
6110
6193
|
}
|
|
6111
|
-
return /* @__PURE__ */
|
|
6194
|
+
return /* @__PURE__ */ import_react39.default.createElement(Dropdown_default, null, /* @__PURE__ */ import_react39.default.createElement(
|
|
6112
6195
|
import_joy50.MenuButton,
|
|
6113
6196
|
{
|
|
6114
6197
|
component: props.buttonComponent ?? "button",
|
|
@@ -6119,15 +6202,15 @@ function MenuButton2(props) {
|
|
|
6119
6202
|
loading,
|
|
6120
6203
|
startDecorator,
|
|
6121
6204
|
...props.buttonComponentProps ?? {},
|
|
6122
|
-
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)
|
|
6123
6206
|
},
|
|
6124
6207
|
buttonText
|
|
6125
|
-
), /* @__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))));
|
|
6126
6209
|
}
|
|
6127
6210
|
MenuButton2.displayName = "MenuButton";
|
|
6128
6211
|
|
|
6129
6212
|
// src/components/MonthPicker/MonthPicker.tsx
|
|
6130
|
-
var
|
|
6213
|
+
var import_react40 = __toESM(require("react"));
|
|
6131
6214
|
var import_CalendarToday3 = __toESM(require("@mui/icons-material/CalendarToday"));
|
|
6132
6215
|
var import_joy51 = require("@mui/joy");
|
|
6133
6216
|
var import_base5 = require("@mui/base");
|
|
@@ -6183,7 +6266,7 @@ function parseDate3(dateString, format) {
|
|
|
6183
6266
|
const result = new Date(year, month, day);
|
|
6184
6267
|
return result;
|
|
6185
6268
|
}
|
|
6186
|
-
var MonthPicker = (0,
|
|
6269
|
+
var MonthPicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
6187
6270
|
const props = (0, import_joy51.useThemeProps)({ props: inProps, name: "MonthPicker" });
|
|
6188
6271
|
const {
|
|
6189
6272
|
onChange,
|
|
@@ -6210,18 +6293,18 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6210
6293
|
locale,
|
|
6211
6294
|
...innerProps
|
|
6212
6295
|
} = props;
|
|
6213
|
-
const innerRef = (0,
|
|
6214
|
-
const buttonRef = (0,
|
|
6296
|
+
const innerRef = (0, import_react40.useRef)(null);
|
|
6297
|
+
const buttonRef = (0, import_react40.useRef)(null);
|
|
6215
6298
|
const [rawValue, setValue, isControlled] = useControlledState(
|
|
6216
6299
|
props.value,
|
|
6217
6300
|
props.defaultValue ?? null,
|
|
6218
|
-
(0,
|
|
6301
|
+
(0, import_react40.useCallback)(
|
|
6219
6302
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
6220
6303
|
[props.name, onChange]
|
|
6221
6304
|
)
|
|
6222
6305
|
);
|
|
6223
6306
|
const value = rawValue ?? "";
|
|
6224
|
-
const getFormattedDisplayValue = (0,
|
|
6307
|
+
const getFormattedDisplayValue = (0, import_react40.useCallback)(
|
|
6225
6308
|
(inputValue) => {
|
|
6226
6309
|
if (!inputValue) return "";
|
|
6227
6310
|
try {
|
|
@@ -6232,19 +6315,19 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6232
6315
|
},
|
|
6233
6316
|
[format, displayFormat, locale]
|
|
6234
6317
|
);
|
|
6235
|
-
const [displayValue, setDisplayValue] = (0,
|
|
6236
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
6318
|
+
const [displayValue, setDisplayValue] = (0, import_react40.useState)(() => getFormattedDisplayValue(value));
|
|
6319
|
+
const [anchorEl, setAnchorEl] = (0, import_react40.useState)(null);
|
|
6237
6320
|
const open = Boolean(anchorEl);
|
|
6238
|
-
(0,
|
|
6321
|
+
(0, import_react40.useEffect)(() => {
|
|
6239
6322
|
if (!anchorEl) {
|
|
6240
6323
|
innerRef.current?.blur();
|
|
6241
6324
|
}
|
|
6242
6325
|
}, [anchorEl, innerRef]);
|
|
6243
|
-
(0,
|
|
6244
|
-
(0,
|
|
6326
|
+
(0, import_react40.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
6327
|
+
(0, import_react40.useEffect)(() => {
|
|
6245
6328
|
setDisplayValue(getFormattedDisplayValue(value));
|
|
6246
6329
|
}, [value, getFormattedDisplayValue]);
|
|
6247
|
-
const handleChange = (0,
|
|
6330
|
+
const handleChange = (0, import_react40.useCallback)(
|
|
6248
6331
|
(event) => {
|
|
6249
6332
|
const newValue = event.target.value;
|
|
6250
6333
|
setValue(newValue);
|
|
@@ -6254,21 +6337,21 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6254
6337
|
},
|
|
6255
6338
|
[setValue, getFormattedDisplayValue, isControlled]
|
|
6256
6339
|
);
|
|
6257
|
-
const handleCalendarToggle = (0,
|
|
6340
|
+
const handleCalendarToggle = (0, import_react40.useCallback)(
|
|
6258
6341
|
(event) => {
|
|
6259
6342
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
6260
6343
|
innerRef.current?.focus();
|
|
6261
6344
|
},
|
|
6262
6345
|
[anchorEl, setAnchorEl, innerRef]
|
|
6263
6346
|
);
|
|
6264
|
-
const handleInputMouseDown = (0,
|
|
6347
|
+
const handleInputMouseDown = (0, import_react40.useCallback)(
|
|
6265
6348
|
(event) => {
|
|
6266
6349
|
event.preventDefault();
|
|
6267
6350
|
buttonRef.current?.focus();
|
|
6268
6351
|
},
|
|
6269
6352
|
[buttonRef]
|
|
6270
6353
|
);
|
|
6271
|
-
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(
|
|
6272
6355
|
Input_default,
|
|
6273
6356
|
{
|
|
6274
6357
|
...innerProps,
|
|
@@ -6298,7 +6381,7 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6298
6381
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
6299
6382
|
fontFamily: "monospace"
|
|
6300
6383
|
},
|
|
6301
|
-
endDecorator: /* @__PURE__ */
|
|
6384
|
+
endDecorator: /* @__PURE__ */ import_react40.default.createElement(
|
|
6302
6385
|
IconButton_default,
|
|
6303
6386
|
{
|
|
6304
6387
|
ref: buttonRef,
|
|
@@ -6310,12 +6393,12 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6310
6393
|
"aria-expanded": open,
|
|
6311
6394
|
disabled
|
|
6312
6395
|
},
|
|
6313
|
-
/* @__PURE__ */
|
|
6396
|
+
/* @__PURE__ */ import_react40.default.createElement(import_CalendarToday3.default, null)
|
|
6314
6397
|
),
|
|
6315
6398
|
label,
|
|
6316
6399
|
helperText
|
|
6317
6400
|
}
|
|
6318
|
-
), open && /* @__PURE__ */
|
|
6401
|
+
), open && /* @__PURE__ */ import_react40.default.createElement(import_base5.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react40.default.createElement(
|
|
6319
6402
|
StyledPopper3,
|
|
6320
6403
|
{
|
|
6321
6404
|
id: "month-picker-popper",
|
|
@@ -6334,7 +6417,7 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6334
6417
|
"aria-label": "Calendar Tooltip",
|
|
6335
6418
|
"aria-expanded": open
|
|
6336
6419
|
},
|
|
6337
|
-
/* @__PURE__ */
|
|
6420
|
+
/* @__PURE__ */ import_react40.default.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react40.default.createElement(
|
|
6338
6421
|
Calendar_default,
|
|
6339
6422
|
{
|
|
6340
6423
|
view: "month",
|
|
@@ -6355,14 +6438,14 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6355
6438
|
disablePast,
|
|
6356
6439
|
locale
|
|
6357
6440
|
}
|
|
6358
|
-
), /* @__PURE__ */
|
|
6441
|
+
), /* @__PURE__ */ import_react40.default.createElement(
|
|
6359
6442
|
DialogActions_default,
|
|
6360
6443
|
{
|
|
6361
6444
|
sx: {
|
|
6362
6445
|
p: 1
|
|
6363
6446
|
}
|
|
6364
6447
|
},
|
|
6365
|
-
/* @__PURE__ */
|
|
6448
|
+
/* @__PURE__ */ import_react40.default.createElement(
|
|
6366
6449
|
Button_default,
|
|
6367
6450
|
{
|
|
6368
6451
|
size,
|
|
@@ -6385,7 +6468,7 @@ var MonthPicker = (0, import_react39.forwardRef)((inProps, ref) => {
|
|
|
6385
6468
|
});
|
|
6386
6469
|
|
|
6387
6470
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
6388
|
-
var
|
|
6471
|
+
var import_react41 = __toESM(require("react"));
|
|
6389
6472
|
var import_react_imask3 = require("react-imask");
|
|
6390
6473
|
var import_CalendarToday4 = __toESM(require("@mui/icons-material/CalendarToday"));
|
|
6391
6474
|
var import_joy52 = require("@mui/joy");
|
|
@@ -6446,9 +6529,9 @@ var parseDates2 = (str) => {
|
|
|
6446
6529
|
var formatToPattern3 = (format) => {
|
|
6447
6530
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
|
|
6448
6531
|
};
|
|
6449
|
-
var TextMaskAdapter7 =
|
|
6532
|
+
var TextMaskAdapter7 = import_react41.default.forwardRef(function TextMaskAdapter8(props, ref) {
|
|
6450
6533
|
const { onChange, format, ...other } = props;
|
|
6451
|
-
return /* @__PURE__ */
|
|
6534
|
+
return /* @__PURE__ */ import_react41.default.createElement(
|
|
6452
6535
|
import_react_imask3.IMaskInput,
|
|
6453
6536
|
{
|
|
6454
6537
|
...other,
|
|
@@ -6476,7 +6559,7 @@ var TextMaskAdapter7 = import_react40.default.forwardRef(function TextMaskAdapte
|
|
|
6476
6559
|
}
|
|
6477
6560
|
);
|
|
6478
6561
|
});
|
|
6479
|
-
var MonthRangePicker = (0,
|
|
6562
|
+
var MonthRangePicker = (0, import_react41.forwardRef)((inProps, ref) => {
|
|
6480
6563
|
const props = (0, import_joy52.useThemeProps)({ props: inProps, name: "MonthRangePicker" });
|
|
6481
6564
|
const {
|
|
6482
6565
|
onChange,
|
|
@@ -6500,24 +6583,24 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6500
6583
|
} = props;
|
|
6501
6584
|
const displayFormat = displayFormatProp ?? format;
|
|
6502
6585
|
const isAlphabeticDisplay = hasAlphabeticMonth3(displayFormat);
|
|
6503
|
-
const innerRef = (0,
|
|
6504
|
-
const buttonRef = (0,
|
|
6586
|
+
const innerRef = (0, import_react41.useRef)(null);
|
|
6587
|
+
const buttonRef = (0, import_react41.useRef)(null);
|
|
6505
6588
|
const [rawValue, setValue] = useControlledState(
|
|
6506
6589
|
props.value,
|
|
6507
6590
|
props.defaultValue ?? null,
|
|
6508
|
-
(0,
|
|
6591
|
+
(0, import_react41.useCallback)(
|
|
6509
6592
|
(value2) => onChange?.({ target: { name: props.name, value: value2 ?? "" } }),
|
|
6510
6593
|
[props.name, onChange]
|
|
6511
6594
|
)
|
|
6512
6595
|
);
|
|
6513
6596
|
const value = rawValue ?? "";
|
|
6514
|
-
const [displayValue, setDisplayValue] = (0,
|
|
6597
|
+
const [displayValue, setDisplayValue] = (0, import_react41.useState)(
|
|
6515
6598
|
() => value ? formatValueString4(parseDates2(value), displayFormat, locale) : ""
|
|
6516
6599
|
);
|
|
6517
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
6600
|
+
const [anchorEl, setAnchorEl] = (0, import_react41.useState)(null);
|
|
6518
6601
|
const open = Boolean(anchorEl);
|
|
6519
|
-
const calendarValue = (0,
|
|
6520
|
-
(0,
|
|
6602
|
+
const calendarValue = (0, import_react41.useMemo)(() => value ? parseDates2(value) : void 0, [value]);
|
|
6603
|
+
(0, import_react41.useEffect)(() => {
|
|
6521
6604
|
if (value) {
|
|
6522
6605
|
try {
|
|
6523
6606
|
const dates = parseDates2(value);
|
|
@@ -6529,13 +6612,13 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6529
6612
|
setDisplayValue("");
|
|
6530
6613
|
}
|
|
6531
6614
|
}, [displayFormat, locale, value]);
|
|
6532
|
-
(0,
|
|
6615
|
+
(0, import_react41.useEffect)(() => {
|
|
6533
6616
|
if (!anchorEl) {
|
|
6534
6617
|
innerRef.current?.blur();
|
|
6535
6618
|
}
|
|
6536
6619
|
}, [anchorEl, innerRef]);
|
|
6537
|
-
(0,
|
|
6538
|
-
const handleChange = (0,
|
|
6620
|
+
(0, import_react41.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
6621
|
+
const handleChange = (0, import_react41.useCallback)(
|
|
6539
6622
|
(event) => {
|
|
6540
6623
|
setDisplayValue(
|
|
6541
6624
|
event.target.value ? formatValueString4(parseDates2(event.target.value), displayFormat, locale) : ""
|
|
@@ -6544,7 +6627,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6544
6627
|
},
|
|
6545
6628
|
[displayFormat, locale, setValue]
|
|
6546
6629
|
);
|
|
6547
|
-
const handleInputMouseDown = (0,
|
|
6630
|
+
const handleInputMouseDown = (0, import_react41.useCallback)(
|
|
6548
6631
|
(event) => {
|
|
6549
6632
|
if (isAlphabeticDisplay) {
|
|
6550
6633
|
event.preventDefault();
|
|
@@ -6553,14 +6636,14 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6553
6636
|
},
|
|
6554
6637
|
[isAlphabeticDisplay, buttonRef]
|
|
6555
6638
|
);
|
|
6556
|
-
const handleCalendarToggle = (0,
|
|
6639
|
+
const handleCalendarToggle = (0, import_react41.useCallback)(
|
|
6557
6640
|
(event) => {
|
|
6558
6641
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
6559
6642
|
innerRef.current?.focus();
|
|
6560
6643
|
},
|
|
6561
6644
|
[anchorEl, setAnchorEl, innerRef]
|
|
6562
6645
|
);
|
|
6563
|
-
const handleCalendarChange = (0,
|
|
6646
|
+
const handleCalendarChange = (0, import_react41.useCallback)(
|
|
6564
6647
|
([date1, date2]) => {
|
|
6565
6648
|
if (!date1 || !date2) return;
|
|
6566
6649
|
const formattedValue = formatValueString4([date1, date2], format);
|
|
@@ -6570,7 +6653,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6570
6653
|
},
|
|
6571
6654
|
[setValue, setAnchorEl, format, displayFormat, locale]
|
|
6572
6655
|
);
|
|
6573
|
-
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(
|
|
6574
6657
|
Input_default,
|
|
6575
6658
|
{
|
|
6576
6659
|
...innerProps,
|
|
@@ -6600,7 +6683,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6600
6683
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
6601
6684
|
fontFamily: "monospace"
|
|
6602
6685
|
},
|
|
6603
|
-
endDecorator: /* @__PURE__ */
|
|
6686
|
+
endDecorator: /* @__PURE__ */ import_react41.default.createElement(
|
|
6604
6687
|
IconButton_default,
|
|
6605
6688
|
{
|
|
6606
6689
|
ref: buttonRef,
|
|
@@ -6611,12 +6694,12 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6611
6694
|
"aria-haspopup": "dialog",
|
|
6612
6695
|
"aria-expanded": open
|
|
6613
6696
|
},
|
|
6614
|
-
/* @__PURE__ */
|
|
6697
|
+
/* @__PURE__ */ import_react41.default.createElement(import_CalendarToday4.default, null)
|
|
6615
6698
|
),
|
|
6616
6699
|
label,
|
|
6617
6700
|
helperText
|
|
6618
6701
|
}
|
|
6619
|
-
), open && /* @__PURE__ */
|
|
6702
|
+
), open && /* @__PURE__ */ import_react41.default.createElement(import_base6.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react41.default.createElement(
|
|
6620
6703
|
StyledPopper4,
|
|
6621
6704
|
{
|
|
6622
6705
|
id: "month-range-picker-popper",
|
|
@@ -6635,7 +6718,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6635
6718
|
"aria-label": "Calendar Tooltip",
|
|
6636
6719
|
"aria-expanded": open
|
|
6637
6720
|
},
|
|
6638
|
-
/* @__PURE__ */
|
|
6721
|
+
/* @__PURE__ */ import_react41.default.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react41.default.createElement(
|
|
6639
6722
|
Calendar_default,
|
|
6640
6723
|
{
|
|
6641
6724
|
view: "month",
|
|
@@ -6649,14 +6732,14 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6649
6732
|
disablePast,
|
|
6650
6733
|
locale
|
|
6651
6734
|
}
|
|
6652
|
-
), /* @__PURE__ */
|
|
6735
|
+
), /* @__PURE__ */ import_react41.default.createElement(
|
|
6653
6736
|
DialogActions_default,
|
|
6654
6737
|
{
|
|
6655
6738
|
sx: {
|
|
6656
6739
|
p: 1
|
|
6657
6740
|
}
|
|
6658
6741
|
},
|
|
6659
|
-
/* @__PURE__ */
|
|
6742
|
+
/* @__PURE__ */ import_react41.default.createElement(
|
|
6660
6743
|
Button_default,
|
|
6661
6744
|
{
|
|
6662
6745
|
size,
|
|
@@ -6675,7 +6758,7 @@ var MonthRangePicker = (0, import_react40.forwardRef)((inProps, ref) => {
|
|
|
6675
6758
|
MonthRangePicker.displayName = "MonthRangePicker";
|
|
6676
6759
|
|
|
6677
6760
|
// src/components/NavigationGroup/NavigationGroup.tsx
|
|
6678
|
-
var
|
|
6761
|
+
var import_react42 = __toESM(require("react"));
|
|
6679
6762
|
var import_joy53 = require("@mui/joy");
|
|
6680
6763
|
var AccordionSummary2 = (0, import_joy53.styled)(import_joy53.AccordionSummary, {
|
|
6681
6764
|
name: "NavigationGroup",
|
|
@@ -6699,11 +6782,11 @@ var AccordionDetails2 = (0, import_joy53.styled)(import_joy53.AccordionDetails,
|
|
|
6699
6782
|
}));
|
|
6700
6783
|
function NavigationGroup(props) {
|
|
6701
6784
|
const { title, children, startDecorator, level, ...rest } = props;
|
|
6702
|
-
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));
|
|
6703
6786
|
}
|
|
6704
6787
|
|
|
6705
6788
|
// src/components/NavigationItem/NavigationItem.tsx
|
|
6706
|
-
var
|
|
6789
|
+
var import_react43 = __toESM(require("react"));
|
|
6707
6790
|
var import_joy54 = require("@mui/joy");
|
|
6708
6791
|
var ListItemButton = (0, import_joy54.styled)(import_joy54.ListItemButton, {
|
|
6709
6792
|
name: "NavigationItem",
|
|
@@ -6732,7 +6815,7 @@ function NavigationItem(props) {
|
|
|
6732
6815
|
const handleClick = () => {
|
|
6733
6816
|
onClick?.(id);
|
|
6734
6817
|
};
|
|
6735
|
-
return /* @__PURE__ */
|
|
6818
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_joy54.ListItem, { ...rest }, /* @__PURE__ */ import_react43.default.createElement(
|
|
6736
6819
|
ListItemButton,
|
|
6737
6820
|
{
|
|
6738
6821
|
level,
|
|
@@ -6741,21 +6824,21 @@ function NavigationItem(props) {
|
|
|
6741
6824
|
"aria-current": selected,
|
|
6742
6825
|
onClick: handleClick
|
|
6743
6826
|
},
|
|
6744
|
-
startDecorator && /* @__PURE__ */
|
|
6827
|
+
startDecorator && /* @__PURE__ */ import_react43.default.createElement(import_joy54.ListItemDecorator, null, startDecorator),
|
|
6745
6828
|
children
|
|
6746
6829
|
));
|
|
6747
6830
|
}
|
|
6748
6831
|
|
|
6749
6832
|
// src/components/Navigator/Navigator.tsx
|
|
6750
|
-
var
|
|
6833
|
+
var import_react44 = __toESM(require("react"));
|
|
6751
6834
|
function Navigator(props) {
|
|
6752
6835
|
const { items, level = 0, onSelect } = props;
|
|
6753
6836
|
const handleItemClick = (id) => {
|
|
6754
6837
|
onSelect?.(id);
|
|
6755
6838
|
};
|
|
6756
|
-
return /* @__PURE__ */
|
|
6839
|
+
return /* @__PURE__ */ import_react44.default.createElement("div", null, items.map((item, index) => {
|
|
6757
6840
|
if (item.type === "item") {
|
|
6758
|
-
return /* @__PURE__ */
|
|
6841
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
6759
6842
|
NavigationItem,
|
|
6760
6843
|
{
|
|
6761
6844
|
key: item.id,
|
|
@@ -6768,7 +6851,7 @@ function Navigator(props) {
|
|
|
6768
6851
|
item.title
|
|
6769
6852
|
);
|
|
6770
6853
|
} else if (item.type === "group") {
|
|
6771
|
-
return /* @__PURE__ */
|
|
6854
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
6772
6855
|
NavigationGroup,
|
|
6773
6856
|
{
|
|
6774
6857
|
key: `${item.title}-${index}`,
|
|
@@ -6786,16 +6869,16 @@ function Navigator(props) {
|
|
|
6786
6869
|
Navigator.displayName = "Navigator";
|
|
6787
6870
|
|
|
6788
6871
|
// src/components/PercentageInput/PercentageInput.tsx
|
|
6789
|
-
var
|
|
6872
|
+
var import_react45 = __toESM(require("react"));
|
|
6790
6873
|
var import_react_number_format2 = require("react-number-format");
|
|
6791
6874
|
var import_joy55 = require("@mui/joy");
|
|
6792
6875
|
var padDecimal = (value, decimalScale) => {
|
|
6793
6876
|
const [integer, decimal = ""] = `${value}`.split(".");
|
|
6794
6877
|
return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
|
|
6795
6878
|
};
|
|
6796
|
-
var TextMaskAdapter9 =
|
|
6879
|
+
var TextMaskAdapter9 = import_react45.default.forwardRef(function TextMaskAdapter10(props, ref) {
|
|
6797
6880
|
const { onChange, min, max, ...innerProps } = props;
|
|
6798
|
-
return /* @__PURE__ */
|
|
6881
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
6799
6882
|
import_react_number_format2.NumericFormat,
|
|
6800
6883
|
{
|
|
6801
6884
|
...innerProps,
|
|
@@ -6820,7 +6903,7 @@ var PercentageInputRoot = (0, import_joy55.styled)(Input_default, {
|
|
|
6820
6903
|
slot: "Root",
|
|
6821
6904
|
overridesResolver: (props, styles) => styles.root
|
|
6822
6905
|
})({});
|
|
6823
|
-
var PercentageInput =
|
|
6906
|
+
var PercentageInput = import_react45.default.forwardRef(
|
|
6824
6907
|
function PercentageInput2(inProps, ref) {
|
|
6825
6908
|
const props = (0, import_joy55.useThemeProps)({ props: inProps, name: "PercentageInput" });
|
|
6826
6909
|
const {
|
|
@@ -6843,19 +6926,19 @@ var PercentageInput = import_react44.default.forwardRef(
|
|
|
6843
6926
|
const [_value, setValue] = useControlledState(
|
|
6844
6927
|
props.value,
|
|
6845
6928
|
props.defaultValue ?? null,
|
|
6846
|
-
(0,
|
|
6929
|
+
(0, import_react45.useCallback)((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
6847
6930
|
);
|
|
6848
|
-
const value = (0,
|
|
6931
|
+
const value = (0, import_react45.useMemo)(() => {
|
|
6849
6932
|
if (_value && useMinorUnit) {
|
|
6850
6933
|
return _value / Math.pow(10, maxDecimalScale);
|
|
6851
6934
|
}
|
|
6852
6935
|
return _value;
|
|
6853
6936
|
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
6854
|
-
const internalError = (0,
|
|
6937
|
+
const internalError = (0, import_react45.useMemo)(
|
|
6855
6938
|
() => value != null && (max != null && value > max || min != null && value < min),
|
|
6856
6939
|
[max, min, value]
|
|
6857
6940
|
);
|
|
6858
|
-
const handleChange = (0,
|
|
6941
|
+
const handleChange = (0, import_react45.useCallback)(
|
|
6859
6942
|
(event) => {
|
|
6860
6943
|
if (event.target.value === "") {
|
|
6861
6944
|
setValue(null);
|
|
@@ -6867,7 +6950,7 @@ var PercentageInput = import_react44.default.forwardRef(
|
|
|
6867
6950
|
},
|
|
6868
6951
|
[setValue, useMinorUnit, maxDecimalScale]
|
|
6869
6952
|
);
|
|
6870
|
-
return /* @__PURE__ */
|
|
6953
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
6871
6954
|
PercentageInputRoot,
|
|
6872
6955
|
{
|
|
6873
6956
|
...innerProps,
|
|
@@ -6908,7 +6991,7 @@ var RadioGroup = MotionRadioGroup;
|
|
|
6908
6991
|
RadioGroup.displayName = "RadioGroup";
|
|
6909
6992
|
|
|
6910
6993
|
// src/components/RadioTileGroup/RadioTileGroup.tsx
|
|
6911
|
-
var
|
|
6994
|
+
var import_react46 = __toESM(require("react"));
|
|
6912
6995
|
var import_joy57 = require("@mui/joy");
|
|
6913
6996
|
var RadioTileGroupRoot = (0, import_joy57.styled)(RadioGroup, {
|
|
6914
6997
|
name: "RadioTileGroup",
|
|
@@ -6996,7 +7079,7 @@ function RadioTileGroup(props) {
|
|
|
6996
7079
|
error,
|
|
6997
7080
|
required
|
|
6998
7081
|
} = props;
|
|
6999
|
-
const radioGroup = /* @__PURE__ */
|
|
7082
|
+
const radioGroup = /* @__PURE__ */ import_react46.default.createElement(
|
|
7000
7083
|
RadioTileGroupRoot,
|
|
7001
7084
|
{
|
|
7002
7085
|
overlay: true,
|
|
@@ -7007,7 +7090,7 @@ function RadioTileGroup(props) {
|
|
|
7007
7090
|
flex,
|
|
7008
7091
|
columns
|
|
7009
7092
|
},
|
|
7010
|
-
options.map((option) => /* @__PURE__ */
|
|
7093
|
+
options.map((option) => /* @__PURE__ */ import_react46.default.createElement(
|
|
7011
7094
|
RadioTileSheet,
|
|
7012
7095
|
{
|
|
7013
7096
|
key: option.value,
|
|
@@ -7017,7 +7100,7 @@ function RadioTileGroup(props) {
|
|
|
7017
7100
|
flex,
|
|
7018
7101
|
textAlign
|
|
7019
7102
|
},
|
|
7020
|
-
/* @__PURE__ */
|
|
7103
|
+
/* @__PURE__ */ import_react46.default.createElement(
|
|
7021
7104
|
Radio,
|
|
7022
7105
|
{
|
|
7023
7106
|
id: `${option.value}`,
|
|
@@ -7046,7 +7129,7 @@ function RadioTileGroup(props) {
|
|
|
7046
7129
|
}
|
|
7047
7130
|
}
|
|
7048
7131
|
),
|
|
7049
|
-
option.startDecorator && /* @__PURE__ */
|
|
7132
|
+
option.startDecorator && /* @__PURE__ */ import_react46.default.createElement(
|
|
7050
7133
|
Box_default,
|
|
7051
7134
|
{
|
|
7052
7135
|
sx: {
|
|
@@ -7067,15 +7150,15 @@ function RadioTileGroup(props) {
|
|
|
7067
7150
|
)
|
|
7068
7151
|
))
|
|
7069
7152
|
);
|
|
7070
|
-
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));
|
|
7071
7154
|
}
|
|
7072
7155
|
RadioTileGroup.displayName = "RadioTileGroup";
|
|
7073
7156
|
|
|
7074
7157
|
// src/components/RadioList/RadioList.tsx
|
|
7075
|
-
var
|
|
7158
|
+
var import_react47 = __toESM(require("react"));
|
|
7076
7159
|
function RadioList(props) {
|
|
7077
7160
|
const { items, ...innerProps } = props;
|
|
7078
|
-
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 })));
|
|
7079
7162
|
}
|
|
7080
7163
|
RadioList.displayName = "RadioList";
|
|
7081
7164
|
|
|
@@ -7166,7 +7249,7 @@ var SearchBar = React44.forwardRef(function SearchBar2(inProps, ref) {
|
|
|
7166
7249
|
SearchBar.displayName = "SearchBar";
|
|
7167
7250
|
|
|
7168
7251
|
// src/components/Stepper/Stepper.tsx
|
|
7169
|
-
var
|
|
7252
|
+
var import_react48 = __toESM(require("react"));
|
|
7170
7253
|
var import_joy58 = require("@mui/joy");
|
|
7171
7254
|
var import_Check = __toESM(require("@mui/icons-material/Check"));
|
|
7172
7255
|
var import_framer_motion28 = require("framer-motion");
|
|
@@ -7195,7 +7278,7 @@ function Stepper(props) {
|
|
|
7195
7278
|
stepOrientation = "horizontal"
|
|
7196
7279
|
} = props;
|
|
7197
7280
|
const effectiveStepOrientation = orientation === "vertical" ? "horizontal" : stepOrientation;
|
|
7198
|
-
return /* @__PURE__ */
|
|
7281
|
+
return /* @__PURE__ */ import_react48.default.createElement(
|
|
7199
7282
|
MotionStepper,
|
|
7200
7283
|
{
|
|
7201
7284
|
orientation,
|
|
@@ -7234,23 +7317,23 @@ function Stepper(props) {
|
|
|
7234
7317
|
const completed = activeStep > i + 1;
|
|
7235
7318
|
const disabled = activeStep < i + 1;
|
|
7236
7319
|
const hasContent = step.label || step.extraContent;
|
|
7237
|
-
return /* @__PURE__ */
|
|
7320
|
+
return /* @__PURE__ */ import_react48.default.createElement(
|
|
7238
7321
|
Step,
|
|
7239
7322
|
{
|
|
7240
7323
|
key: `step-${i}`,
|
|
7241
|
-
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),
|
|
7242
7325
|
active,
|
|
7243
7326
|
completed,
|
|
7244
7327
|
disabled,
|
|
7245
7328
|
orientation: effectiveStepOrientation
|
|
7246
7329
|
},
|
|
7247
|
-
hasContent && /* @__PURE__ */
|
|
7330
|
+
hasContent && /* @__PURE__ */ import_react48.default.createElement(
|
|
7248
7331
|
Stack_default,
|
|
7249
7332
|
{
|
|
7250
7333
|
sx: orientation === "horizontal" && effectiveStepOrientation === "vertical" ? { alignItems: "center" } : {}
|
|
7251
7334
|
},
|
|
7252
|
-
step.label && /* @__PURE__ */
|
|
7253
|
-
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)
|
|
7254
7337
|
)
|
|
7255
7338
|
);
|
|
7256
7339
|
})
|
|
@@ -7259,7 +7342,7 @@ function Stepper(props) {
|
|
|
7259
7342
|
Stepper.displayName = "Stepper";
|
|
7260
7343
|
|
|
7261
7344
|
// src/components/Switch/Switch.tsx
|
|
7262
|
-
var
|
|
7345
|
+
var import_react49 = __toESM(require("react"));
|
|
7263
7346
|
var import_joy59 = require("@mui/joy");
|
|
7264
7347
|
var import_framer_motion29 = require("framer-motion");
|
|
7265
7348
|
var MotionSwitch = (0, import_framer_motion29.motion)(import_joy59.Switch);
|
|
@@ -7281,14 +7364,14 @@ var StyledThumb = (0, import_joy59.styled)(import_framer_motion29.motion.div)({
|
|
|
7281
7364
|
right: "var(--Switch-thumbOffset)"
|
|
7282
7365
|
}
|
|
7283
7366
|
});
|
|
7284
|
-
var Thumb = (props) => /* @__PURE__ */
|
|
7367
|
+
var Thumb = (props) => /* @__PURE__ */ import_react49.default.createElement(StyledThumb, { ...props, layout: true, transition: spring });
|
|
7285
7368
|
var spring = {
|
|
7286
7369
|
type: "spring",
|
|
7287
7370
|
stiffness: 700,
|
|
7288
7371
|
damping: 30
|
|
7289
7372
|
};
|
|
7290
7373
|
var Switch = (props) => {
|
|
7291
|
-
return /* @__PURE__ */
|
|
7374
|
+
return /* @__PURE__ */ import_react49.default.createElement(
|
|
7292
7375
|
MotionSwitch,
|
|
7293
7376
|
{
|
|
7294
7377
|
...props,
|
|
@@ -7302,7 +7385,7 @@ var Switch = (props) => {
|
|
|
7302
7385
|
Switch.displayName = "Switch";
|
|
7303
7386
|
|
|
7304
7387
|
// src/components/Tabs/Tabs.tsx
|
|
7305
|
-
var
|
|
7388
|
+
var import_react50 = __toESM(require("react"));
|
|
7306
7389
|
var import_joy60 = require("@mui/joy");
|
|
7307
7390
|
var StyledTabs = (0, import_joy60.styled)(import_joy60.Tabs)(({ theme }) => ({
|
|
7308
7391
|
backgroundColor: theme.palette.background.body
|
|
@@ -7318,15 +7401,15 @@ var StyledTab = (0, import_joy60.styled)(import_joy60.Tab)(({ theme }) => ({
|
|
|
7318
7401
|
backgroundColor: theme.palette.background.body
|
|
7319
7402
|
}
|
|
7320
7403
|
}));
|
|
7321
|
-
var Tab = (0,
|
|
7322
|
-
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);
|
|
7323
7406
|
});
|
|
7324
7407
|
Tab.displayName = "Tab";
|
|
7325
7408
|
var TabList = import_joy60.TabList;
|
|
7326
7409
|
var TabPanel = import_joy60.TabPanel;
|
|
7327
7410
|
|
|
7328
7411
|
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
7329
|
-
var
|
|
7412
|
+
var import_react51 = __toESM(require("react"));
|
|
7330
7413
|
var import_joy61 = require("@mui/joy");
|
|
7331
7414
|
var colorScheme = {
|
|
7332
7415
|
palette: {
|
|
@@ -7592,12 +7675,12 @@ var defaultTheme = (0, import_joy61.extendTheme)({
|
|
|
7592
7675
|
});
|
|
7593
7676
|
function ThemeProvider(props) {
|
|
7594
7677
|
const theme = props.theme || defaultTheme;
|
|
7595
|
-
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));
|
|
7596
7679
|
}
|
|
7597
7680
|
ThemeProvider.displayName = "ThemeProvider";
|
|
7598
7681
|
|
|
7599
7682
|
// src/components/Uploader/Uploader.tsx
|
|
7600
|
-
var
|
|
7683
|
+
var import_react52 = __toESM(require("react"));
|
|
7601
7684
|
var import_joy62 = require("@mui/joy");
|
|
7602
7685
|
var import_CloudUploadRounded = __toESM(require("@mui/icons-material/CloudUploadRounded"));
|
|
7603
7686
|
var import_UploadFileRounded = __toESM(require("@mui/icons-material/UploadFileRounded"));
|
|
@@ -7660,7 +7743,7 @@ var getFileSize = (n) => {
|
|
|
7660
7743
|
};
|
|
7661
7744
|
var Preview = (props) => {
|
|
7662
7745
|
const { files, uploaded, onDelete } = props;
|
|
7663
|
-
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(
|
|
7664
7747
|
Typography_default,
|
|
7665
7748
|
{
|
|
7666
7749
|
level: "body-sm",
|
|
@@ -7672,7 +7755,7 @@ var Preview = (props) => {
|
|
|
7672
7755
|
}
|
|
7673
7756
|
},
|
|
7674
7757
|
file.name
|
|
7675
|
-
), !!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))))));
|
|
7676
7759
|
};
|
|
7677
7760
|
var UploaderRoot = (0, import_joy62.styled)(Stack_default, {
|
|
7678
7761
|
name: "Uploader",
|
|
@@ -7715,7 +7798,7 @@ var UploaderIcon = (0, import_joy62.styled)(import_CloudUploadRounded.default, {
|
|
|
7715
7798
|
}
|
|
7716
7799
|
})
|
|
7717
7800
|
);
|
|
7718
|
-
var Uploader =
|
|
7801
|
+
var Uploader = import_react52.default.memo((props) => {
|
|
7719
7802
|
const {
|
|
7720
7803
|
accept,
|
|
7721
7804
|
minCount,
|
|
@@ -7731,14 +7814,14 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7731
7814
|
error: errorProp,
|
|
7732
7815
|
helperText: helperTextProp
|
|
7733
7816
|
} = props;
|
|
7734
|
-
const dropZoneRef = (0,
|
|
7735
|
-
const inputRef = (0,
|
|
7736
|
-
const [errorText, setErrorText] = (0,
|
|
7737
|
-
const [files, setFiles] = (0,
|
|
7738
|
-
const [uploaded, setUploaded] = (0,
|
|
7739
|
-
const [previewState, setPreviewState] = (0,
|
|
7740
|
-
const accepts = (0,
|
|
7741
|
-
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)(
|
|
7742
7825
|
() => accepts.flatMap((type) => {
|
|
7743
7826
|
if (["image/*", "video/*", "audio/*"].includes(type)) {
|
|
7744
7827
|
return ALL_EXTENSIONS_BY_TYPE[type];
|
|
@@ -7747,7 +7830,7 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7747
7830
|
}),
|
|
7748
7831
|
[accepts]
|
|
7749
7832
|
);
|
|
7750
|
-
const helperText = (0,
|
|
7833
|
+
const helperText = (0, import_react52.useMemo)(() => {
|
|
7751
7834
|
if (helperTextProp) {
|
|
7752
7835
|
return helperTextProp;
|
|
7753
7836
|
}
|
|
@@ -7777,12 +7860,12 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7777
7860
|
}
|
|
7778
7861
|
return helperTexts.join(", ");
|
|
7779
7862
|
}, [accepts, maxFileTotalSize, maxCount, helperTextProp]);
|
|
7780
|
-
const error = (0,
|
|
7781
|
-
const showDropZone = (0,
|
|
7863
|
+
const error = (0, import_react52.useMemo)(() => !!errorText || errorProp, [errorProp, errorText]);
|
|
7864
|
+
const showDropZone = (0, import_react52.useMemo)(
|
|
7782
7865
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
7783
7866
|
[files, maxCount, uploaded]
|
|
7784
7867
|
);
|
|
7785
|
-
const addFiles = (0,
|
|
7868
|
+
const addFiles = (0, import_react52.useCallback)(
|
|
7786
7869
|
(uploads) => {
|
|
7787
7870
|
try {
|
|
7788
7871
|
const types = parsedAccepts.map((type) => type.replace(".", "")) || [];
|
|
@@ -7827,7 +7910,7 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7827
7910
|
},
|
|
7828
7911
|
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
7829
7912
|
);
|
|
7830
|
-
(0,
|
|
7913
|
+
(0, import_react52.useEffect)(() => {
|
|
7831
7914
|
if (!dropZoneRef.current || disabled) {
|
|
7832
7915
|
return;
|
|
7833
7916
|
}
|
|
@@ -7855,7 +7938,7 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7855
7938
|
})
|
|
7856
7939
|
);
|
|
7857
7940
|
}, [disabled, addFiles]);
|
|
7858
|
-
(0,
|
|
7941
|
+
(0, import_react52.useEffect)(() => {
|
|
7859
7942
|
if (inputRef.current && minCount) {
|
|
7860
7943
|
if (files.length < minCount) {
|
|
7861
7944
|
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
@@ -7864,14 +7947,14 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7864
7947
|
}
|
|
7865
7948
|
}
|
|
7866
7949
|
}, [inputRef, files, minCount]);
|
|
7867
|
-
const handleFileChanged = (0,
|
|
7950
|
+
const handleFileChanged = (0, import_react52.useCallback)(
|
|
7868
7951
|
(event) => {
|
|
7869
7952
|
const files2 = Array.from(event.target.files || []);
|
|
7870
7953
|
addFiles(files2);
|
|
7871
7954
|
},
|
|
7872
7955
|
[addFiles]
|
|
7873
7956
|
);
|
|
7874
|
-
const handleDeleteFile = (0,
|
|
7957
|
+
const handleDeleteFile = (0, import_react52.useCallback)(
|
|
7875
7958
|
(deletedFile) => {
|
|
7876
7959
|
if (deletedFile instanceof File) {
|
|
7877
7960
|
setFiles((current) => {
|
|
@@ -7891,10 +7974,10 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7891
7974
|
},
|
|
7892
7975
|
[name, onChange, onDelete]
|
|
7893
7976
|
);
|
|
7894
|
-
const handleUploaderButtonClick = (0,
|
|
7977
|
+
const handleUploaderButtonClick = (0, import_react52.useCallback)(() => {
|
|
7895
7978
|
inputRef.current?.click();
|
|
7896
7979
|
}, []);
|
|
7897
|
-
const uploader = /* @__PURE__ */
|
|
7980
|
+
const uploader = /* @__PURE__ */ import_react52.default.createElement(
|
|
7898
7981
|
FileDropZone,
|
|
7899
7982
|
{
|
|
7900
7983
|
state: previewState,
|
|
@@ -7903,8 +7986,8 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7903
7986
|
ref: dropZoneRef,
|
|
7904
7987
|
onClick: handleUploaderButtonClick
|
|
7905
7988
|
},
|
|
7906
|
-
/* @__PURE__ */
|
|
7907
|
-
/* @__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(
|
|
7908
7991
|
VisuallyHiddenInput,
|
|
7909
7992
|
{
|
|
7910
7993
|
disabled,
|
|
@@ -7927,6 +8010,6 @@ var Uploader = import_react51.default.memo((props) => {
|
|
|
7927
8010
|
}
|
|
7928
8011
|
)
|
|
7929
8012
|
);
|
|
7930
|
-
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 }));
|
|
7931
8014
|
});
|
|
7932
8015
|
Uploader.displayName = "Uploader";
|