@ceed/cds 1.34.0 → 1.35.0
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/Accordions/Accordions.d.ts +1 -0
- package/dist/components/Alert/Alert.d.ts +5 -5
- package/dist/components/Autocomplete/Autocomplete.d.ts +2 -2
- package/dist/components/Avatar/Avatar.d.ts +7 -17
- package/dist/components/Box/Box.d.ts +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +6 -5
- package/dist/components/Button/Button.d.ts +3 -2
- package/dist/components/Calendar/Calendar.d.ts +1 -0
- package/dist/components/Card/Card.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Chip/Chip.d.ts +1 -0
- package/dist/components/Container/Container.d.ts +6 -1
- package/dist/components/CurrencyInput/CurrencyInput.d.ts +1 -1
- package/dist/components/DialogActions/DialogActions.d.ts +1 -0
- package/dist/components/DialogContent/DialogContent.d.ts +1 -0
- package/dist/components/DialogFrame/DialogFrame.d.ts +1 -1
- package/dist/components/DialogTitle/DialogTitle.d.ts +1 -0
- package/dist/components/Divider/Divider.d.ts +1 -0
- package/dist/components/Drawer/Drawer.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +28 -1
- package/dist/components/FormControl/FormControl.d.ts +1 -0
- package/dist/components/FormHelperText/FormHelperText.d.ts +1 -0
- package/dist/components/FormLabel/FormLabel.d.ts +1 -0
- package/dist/components/Grid/Grid.d.ts +1 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -2
- package/dist/components/IconMenuButton/IconMenuButton.d.ts +7 -6
- package/dist/components/InfoSign/InfoSign.d.ts +3 -2
- package/dist/components/Input/Input.d.ts +8 -22
- package/dist/components/InsetDrawer/InsetDrawer.d.ts +1 -0
- package/dist/components/Markdown/Markdown.d.ts +9 -24
- package/dist/components/Menu/Menu.d.ts +2 -1
- package/dist/components/MenuButton/MenuButton.d.ts +10 -8
- package/dist/components/Modal/Modal.d.ts +4 -2
- package/dist/components/NavigationGroup/NavigationGroup.d.ts +3 -2
- package/dist/components/NavigationItem/NavigationItem.d.ts +3 -2
- package/dist/components/Navigator/Navigator.d.ts +5 -4
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/Radio/Radio.d.ts +1 -0
- package/dist/components/RadioList/RadioList.d.ts +3 -2
- package/dist/components/SearchBar/SearchBar.d.ts +6 -5
- package/dist/components/SearchBar/index.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +12 -10
- package/dist/components/Sheet/Sheet.d.ts +1 -0
- package/dist/components/Stack/Stack.d.ts +1 -0
- package/dist/components/Stepper/Stepper.d.ts +2 -1
- package/dist/components/Switch/Switch.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +7 -5
- package/dist/components/Tabs/Tabs.d.ts +1 -0
- package/dist/components/Textarea/Textarea.d.ts +8 -20
- package/dist/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +1 -0
- package/dist/components/Uploader/Uploader.d.ts +18 -17
- package/dist/components/data-display/Avatar.md +60 -72
- package/dist/components/data-display/Badge.md +197 -181
- package/dist/components/data-display/Chip.md +164 -142
- package/dist/components/data-display/DataTable.md +843 -338
- package/dist/components/data-display/InfoSign.md +1 -3
- package/dist/components/data-display/Markdown.md +93 -125
- package/dist/components/data-display/Table.md +1453 -1007
- package/dist/components/data-display/Typography.md +113 -116
- package/dist/components/feedback/Alert.md +80 -86
- package/dist/components/feedback/CircularProgress.md +32 -36
- package/dist/components/feedback/Dialog.md +25 -17
- package/dist/components/feedback/Modal.md +296 -264
- package/dist/components/feedback/Skeleton.md +125 -89
- package/dist/components/index.d.ts +63 -4
- package/dist/components/inputs/Autocomplete.md +191 -95
- package/dist/components/inputs/Button.md +83 -83
- package/dist/components/inputs/ButtonGroup.md +195 -185
- package/dist/components/inputs/Calendar.md +25 -28
- package/dist/components/inputs/Checkbox.md +11 -29
- package/dist/components/inputs/CurrencyInput.md +4 -4
- package/dist/components/inputs/DatePicker.md +229 -110
- package/dist/components/inputs/DateRangePicker.md +248 -137
- package/dist/components/inputs/FilterableCheckboxGroup.md +115 -55
- package/dist/components/inputs/FormControl.md +75 -69
- package/dist/components/inputs/IconButton.md +229 -205
- package/dist/components/inputs/Input.md +131 -98
- package/dist/components/inputs/MonthPicker.md +186 -84
- package/dist/components/inputs/MonthRangePicker.md +73 -49
- package/dist/components/inputs/PercentageInput.md +15 -31
- package/dist/components/inputs/RadioButton.md +320 -256
- package/dist/components/inputs/RadioList.md +66 -50
- package/dist/components/inputs/RadioTileGroup.md +287 -170
- package/dist/components/inputs/SearchBar.md +154 -55
- package/dist/components/inputs/Select.md +106 -95
- package/dist/components/inputs/Slider.md +153 -102
- package/dist/components/inputs/Switch.md +193 -138
- package/dist/components/inputs/Textarea.md +15 -20
- package/dist/components/inputs/Uploader/Uploader.md +68 -39
- package/dist/components/layout/Box.md +841 -662
- package/dist/components/layout/Container.md +3 -11
- package/dist/components/layout/Grid.md +480 -394
- package/dist/components/layout/Stack.md +739 -566
- package/dist/components/navigation/Breadcrumbs.md +4 -4
- package/dist/components/navigation/Drawer.md +34 -25
- package/dist/components/navigation/Dropdown.md +745 -408
- package/dist/components/navigation/IconMenuButton.md +14 -6
- package/dist/components/navigation/InsetDrawer.md +8 -13
- package/dist/components/navigation/Link.md +1 -2
- package/dist/components/navigation/Menu.md +623 -502
- package/dist/components/navigation/MenuButton.md +18 -10
- package/dist/components/navigation/NavigationGroup.md +19 -50
- package/dist/components/navigation/NavigationItem.md +6 -6
- package/dist/components/navigation/Navigator.md +26 -28
- package/dist/components/navigation/Pagination.md +86 -75
- package/dist/components/navigation/Stepper.md +2 -12
- package/dist/components/navigation/Tabs.md +48 -36
- package/dist/components/surfaces/Accordions.md +89 -172
- package/dist/components/surfaces/Card.md +1094 -709
- package/dist/components/surfaces/Divider.md +562 -412
- package/dist/components/surfaces/Sheet.md +700 -518
- package/dist/guides/ThemeProvider.md +8 -8
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +1079 -1052
- package/dist/index.d.ts +2 -1
- package/dist/index.js +725 -690
- package/framer/index.js +1 -1
- package/package.json +32 -35
package/dist/index.js
CHANGED
|
@@ -630,7 +630,7 @@ Box.displayName = "Box";
|
|
|
630
630
|
var Box_default = Box;
|
|
631
631
|
|
|
632
632
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
633
|
-
import
|
|
633
|
+
import React9 from "react";
|
|
634
634
|
import {
|
|
635
635
|
Breadcrumbs as JoyBreadcrumbs,
|
|
636
636
|
Link as JoyLink,
|
|
@@ -652,7 +652,34 @@ var MenuItem = JoyMenuItem;
|
|
|
652
652
|
var Menu_default = Menu;
|
|
653
653
|
|
|
654
654
|
// src/components/Dropdown/Dropdown.tsx
|
|
655
|
-
import {
|
|
655
|
+
import React8, { createContext, useCallback as useCallback3, useMemo as useMemo3, useState as useState2 } from "react";
|
|
656
|
+
import { Dropdown as JoyDropdown } from "@mui/joy";
|
|
657
|
+
import { MenuButton } from "@mui/joy";
|
|
658
|
+
import { useMenuButton } from "@mui/base/useMenuButton";
|
|
659
|
+
var DropdownNestedRegistryContext = createContext(null);
|
|
660
|
+
function Dropdown({ open: openProp, defaultOpen = false, onOpenChange, ...rest }) {
|
|
661
|
+
const [nestedCount, setNestedCount] = useState2(0);
|
|
662
|
+
const [open, setOpen] = useControlledState(openProp, defaultOpen);
|
|
663
|
+
const registry = useMemo3(
|
|
664
|
+
() => ({
|
|
665
|
+
register: () => setNestedCount((c) => c + 1),
|
|
666
|
+
unregister: () => setNestedCount((c) => Math.max(0, c - 1))
|
|
667
|
+
}),
|
|
668
|
+
[]
|
|
669
|
+
);
|
|
670
|
+
const handleOpenChange = useCallback3(
|
|
671
|
+
(event, isOpen) => {
|
|
672
|
+
if (nestedCount > 0 && !isOpen && event?.type === "blur") {
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
setOpen(isOpen);
|
|
676
|
+
onOpenChange?.(event, isOpen);
|
|
677
|
+
},
|
|
678
|
+
[nestedCount, setOpen, onOpenChange]
|
|
679
|
+
);
|
|
680
|
+
return /* @__PURE__ */ React8.createElement(DropdownNestedRegistryContext.Provider, { value: registry }, /* @__PURE__ */ React8.createElement(JoyDropdown, { open, onOpenChange: handleOpenChange, ...rest }));
|
|
681
|
+
}
|
|
682
|
+
Dropdown.displayName = "Dropdown";
|
|
656
683
|
|
|
657
684
|
// src/components/Dropdown/index.ts
|
|
658
685
|
var Dropdown_default = Dropdown;
|
|
@@ -673,29 +700,29 @@ function Breadcrumbs(props) {
|
|
|
673
700
|
} = props;
|
|
674
701
|
const Crumb = (props2) => {
|
|
675
702
|
if (props2.type === "link" && Link4) {
|
|
676
|
-
return /* @__PURE__ */
|
|
703
|
+
return /* @__PURE__ */ React9.createElement(Link4, { to: props2.linkHref, href: props2.linkHref, ...linkProps }, props2.label);
|
|
677
704
|
} else {
|
|
678
|
-
return /* @__PURE__ */
|
|
705
|
+
return /* @__PURE__ */ React9.createElement(Typography_default, null, props2.label);
|
|
679
706
|
}
|
|
680
707
|
};
|
|
681
708
|
if (!collapsed) {
|
|
682
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ React9.createElement(JoyBreadcrumbs, { size, slots: restSlots, slotProps: restSlotProps, ...innerProps }, crumbs.map((crumb, index) => /* @__PURE__ */ React9.createElement(Crumb, { key: `breadcrumb-${index}`, ...crumb })));
|
|
683
710
|
}
|
|
684
711
|
const _endCrumbCount = Math.max(1, endCrumbCount);
|
|
685
|
-
const frontCrumbs = crumbs.slice(0, startCrumbCount).map((crumb) => /* @__PURE__ */
|
|
686
|
-
const backCrumbs = (startCrumbCount + _endCrumbCount > crumbs.length ? crumbs.slice(startCrumbCount) : crumbs.slice(-_endCrumbCount)).map((crumb) => /* @__PURE__ */
|
|
687
|
-
const collapsedCrumbs = crumbs.slice(startCrumbCount, -_endCrumbCount).map((crumb) => /* @__PURE__ */
|
|
688
|
-
return /* @__PURE__ */
|
|
712
|
+
const frontCrumbs = crumbs.slice(0, startCrumbCount).map((crumb) => /* @__PURE__ */ React9.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
|
|
713
|
+
const backCrumbs = (startCrumbCount + _endCrumbCount > crumbs.length ? crumbs.slice(startCrumbCount) : crumbs.slice(-_endCrumbCount)).map((crumb) => /* @__PURE__ */ React9.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
|
|
714
|
+
const collapsedCrumbs = crumbs.slice(startCrumbCount, -_endCrumbCount).map((crumb) => /* @__PURE__ */ React9.createElement(MenuItem, { key: `breadcrumb-${crumb.label}` }, /* @__PURE__ */ React9.createElement(Crumb, { ...crumb })));
|
|
715
|
+
return /* @__PURE__ */ React9.createElement(JoyBreadcrumbs, { size, slots: restSlots, slotProps: restSlotProps, ...innerProps }, frontCrumbs, collapsedCrumbs.length && /* @__PURE__ */ React9.createElement(Dropdown_default, null, /* @__PURE__ */ React9.createElement(JoyMenuButton, { size, variant: "plain" }, "..."), /* @__PURE__ */ React9.createElement(Menu_default, { size }, collapsedCrumbs)), backCrumbs);
|
|
689
716
|
}
|
|
690
717
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
691
718
|
|
|
692
719
|
// src/components/Button/Button.tsx
|
|
693
|
-
import
|
|
720
|
+
import React10, { forwardRef as forwardRef3 } from "react";
|
|
694
721
|
import { Button as JoyButton } from "@mui/joy";
|
|
695
722
|
import { motion as motion11 } from "framer-motion";
|
|
696
723
|
var MotionButton = motion11(JoyButton);
|
|
697
724
|
var Button = forwardRef3(({ ...props }, ref) => {
|
|
698
|
-
return /* @__PURE__ */
|
|
725
|
+
return /* @__PURE__ */ React10.createElement(MotionButton, { ref, ...props });
|
|
699
726
|
});
|
|
700
727
|
Button.displayName = "Button";
|
|
701
728
|
|
|
@@ -703,19 +730,19 @@ Button.displayName = "Button";
|
|
|
703
730
|
var Button_default = Button;
|
|
704
731
|
|
|
705
732
|
// src/components/Calendar/Calendar.tsx
|
|
706
|
-
import
|
|
733
|
+
import React13, { Fragment, forwardRef as forwardRef4, useCallback as useCallback6, useEffect as useEffect3, useMemo as useMemo5, useRef as useRef3, useState as useState5 } from "react";
|
|
707
734
|
import { styled as styled5 } from "@mui/joy";
|
|
708
735
|
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
|
709
736
|
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
|
710
737
|
import { AnimatePresence, motion as motion13 } from "framer-motion";
|
|
711
738
|
|
|
712
739
|
// src/components/Tooltip/Tooltip.tsx
|
|
713
|
-
import
|
|
740
|
+
import React11 from "react";
|
|
714
741
|
import { Tooltip as JoyTooltip } from "@mui/joy";
|
|
715
742
|
import { motion as motion12 } from "framer-motion";
|
|
716
743
|
var MotionTooltip = motion12(JoyTooltip);
|
|
717
744
|
var Tooltip = (props) => {
|
|
718
|
-
return /* @__PURE__ */
|
|
745
|
+
return /* @__PURE__ */ React11.createElement(MotionTooltip, { ...props });
|
|
719
746
|
};
|
|
720
747
|
Tooltip.displayName = "Tooltip";
|
|
721
748
|
|
|
@@ -797,43 +824,43 @@ var isSameMonth = (date1, date2) => {
|
|
|
797
824
|
};
|
|
798
825
|
|
|
799
826
|
// src/components/Calendar/hooks/use-calendar-props.ts
|
|
800
|
-
import { useCallback as
|
|
827
|
+
import { useCallback as useCallback4, useMemo as useMemo4, useState as useState3 } from "react";
|
|
801
828
|
import { useThemeProps as useThemeProps2 } from "@mui/joy";
|
|
802
829
|
var resolveView = (view, views) => {
|
|
803
830
|
return views.includes(view) ? view : views[0];
|
|
804
831
|
};
|
|
805
832
|
var useCalendarProps = (inProps) => {
|
|
806
|
-
const [uncontrolledView, setUncontrolledView] =
|
|
833
|
+
const [uncontrolledView, setUncontrolledView] = useState3(
|
|
807
834
|
() => resolveView(inProps.view || "day", inProps.views || ["day", "month"])
|
|
808
835
|
);
|
|
809
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
836
|
+
const [uncontrolledValue, setUncontrolledValue] = useState3(
|
|
810
837
|
inProps.defaultValue
|
|
811
838
|
);
|
|
812
|
-
const [viewMonth, setViewMonth] =
|
|
839
|
+
const [viewMonth, setViewMonth] = useState3(() => {
|
|
813
840
|
const today = /* @__PURE__ */ new Date();
|
|
814
841
|
today.setDate(1);
|
|
815
842
|
today.setHours(0, 0, 0, 0);
|
|
816
843
|
return inProps.value?.[0] || inProps.defaultValue?.[0] || today;
|
|
817
844
|
});
|
|
818
|
-
const [[page, direction], setPage] =
|
|
845
|
+
const [[page, direction], setPage] = useState3([0, 0]);
|
|
819
846
|
const resolvedView = inProps.view ?? uncontrolledView;
|
|
820
|
-
const resolvedMinDate =
|
|
847
|
+
const resolvedMinDate = useMemo4(() => {
|
|
821
848
|
const minDate = inProps.minDate || /* @__PURE__ */ new Date(0);
|
|
822
849
|
minDate.setHours(0, 0, 0, 0);
|
|
823
850
|
return minDate;
|
|
824
851
|
}, [inProps.minDate]);
|
|
825
|
-
const resolvedMaxDate =
|
|
852
|
+
const resolvedMaxDate = useMemo4(() => {
|
|
826
853
|
const maxDate = inProps.maxDate || /* @__PURE__ */ new Date(864e13);
|
|
827
854
|
maxDate.setHours(0, 0, 0, 0);
|
|
828
855
|
return maxDate;
|
|
829
856
|
}, [inProps.maxDate]);
|
|
830
|
-
const paginate =
|
|
857
|
+
const paginate = useCallback4(
|
|
831
858
|
(newDirection) => {
|
|
832
859
|
setPage([page + newDirection, newDirection]);
|
|
833
860
|
},
|
|
834
861
|
[page]
|
|
835
862
|
);
|
|
836
|
-
const handleViewMonthChange =
|
|
863
|
+
const handleViewMonthChange = useCallback4(
|
|
837
864
|
(newMonth) => {
|
|
838
865
|
setViewMonth(newMonth);
|
|
839
866
|
if (resolvedView === "month") {
|
|
@@ -881,22 +908,22 @@ var useCalendarProps = (inProps) => {
|
|
|
881
908
|
},
|
|
882
909
|
name: "Calendar"
|
|
883
910
|
});
|
|
884
|
-
const ownerState =
|
|
911
|
+
const ownerState = useMemo4(() => ({ ...props, viewMonth, direction }), [props, viewMonth, direction]);
|
|
885
912
|
return [props, ownerState];
|
|
886
913
|
};
|
|
887
914
|
|
|
888
915
|
// src/components/Calendar/hooks/use-calendar.ts
|
|
889
|
-
import { useCallback as
|
|
916
|
+
import { useCallback as useCallback5, useState as useState4 } from "react";
|
|
890
917
|
var useCalendar = (ownerState) => {
|
|
891
|
-
const [localHoverDay, setLocalHoverDay] =
|
|
892
|
-
const [localHoverMonth, setLocalHoverMonth] =
|
|
918
|
+
const [localHoverDay, setLocalHoverDay] = useState4(null);
|
|
919
|
+
const [localHoverMonth, setLocalHoverMonth] = useState4(null);
|
|
893
920
|
const hoverDay = ownerState.hoverDay !== void 0 ? ownerState.hoverDay : localHoverDay;
|
|
894
921
|
const setHoverDay = ownerState.onHoverDayChange ?? setLocalHoverDay;
|
|
895
922
|
const hoverMonth = ownerState.hoverMonth !== void 0 ? ownerState.hoverMonth : localHoverMonth;
|
|
896
923
|
const setHoverMonth = ownerState.onHoverMonthChange ?? setLocalHoverMonth;
|
|
897
924
|
return {
|
|
898
925
|
calendarTitle: ownerState.view === "month" ? getYearName(ownerState.viewMonth, ownerState.locale || "default") : getMonthName(ownerState.viewMonth, ownerState.locale || "default"),
|
|
899
|
-
onPrev:
|
|
926
|
+
onPrev: useCallback5(() => {
|
|
900
927
|
if (ownerState.view === "day") {
|
|
901
928
|
const currentDate = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
902
929
|
const currentYear = currentDate.getFullYear();
|
|
@@ -913,7 +940,7 @@ var useCalendar = (ownerState) => {
|
|
|
913
940
|
ownerState.onMonthChange?.(prevYear);
|
|
914
941
|
}
|
|
915
942
|
}, [ownerState.onMonthChange, ownerState.viewMonth, ownerState.view]),
|
|
916
|
-
onNext:
|
|
943
|
+
onNext: useCallback5(() => {
|
|
917
944
|
if (ownerState.view === "day") {
|
|
918
945
|
const currentDate = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
919
946
|
const currentYear = currentDate.getFullYear();
|
|
@@ -930,7 +957,7 @@ var useCalendar = (ownerState) => {
|
|
|
930
957
|
ownerState.onMonthChange?.(nextYear);
|
|
931
958
|
}
|
|
932
959
|
}, [ownerState.onMonthChange, ownerState.viewMonth, ownerState.view]),
|
|
933
|
-
getDayCellProps:
|
|
960
|
+
getDayCellProps: useCallback5(
|
|
934
961
|
(day) => {
|
|
935
962
|
const thisDay = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
936
963
|
thisDay.setHours(0, 0, 0, 0);
|
|
@@ -945,7 +972,7 @@ var useCalendar = (ownerState) => {
|
|
|
945
972
|
},
|
|
946
973
|
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverDay]
|
|
947
974
|
),
|
|
948
|
-
getMonthCellProps:
|
|
975
|
+
getMonthCellProps: useCallback5(
|
|
949
976
|
(monthIndex) => {
|
|
950
977
|
const thisMonth = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
951
978
|
thisMonth.setDate(1);
|
|
@@ -962,7 +989,7 @@ var useCalendar = (ownerState) => {
|
|
|
962
989
|
},
|
|
963
990
|
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverMonth]
|
|
964
991
|
),
|
|
965
|
-
getPickerDayProps:
|
|
992
|
+
getPickerDayProps: useCallback5(
|
|
966
993
|
(day) => {
|
|
967
994
|
const thisDay = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
968
995
|
thisDay.setHours(0, 0, 0, 0);
|
|
@@ -1016,7 +1043,7 @@ var useCalendar = (ownerState) => {
|
|
|
1016
1043
|
hoverDay
|
|
1017
1044
|
]
|
|
1018
1045
|
),
|
|
1019
|
-
getPickerMonthProps:
|
|
1046
|
+
getPickerMonthProps: useCallback5(
|
|
1020
1047
|
(monthIndex) => {
|
|
1021
1048
|
const thisMonth = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1022
1049
|
thisMonth.setDate(1);
|
|
@@ -1313,9 +1340,9 @@ var swipePower = (offset, velocity) => {
|
|
|
1313
1340
|
var PickerDays = (props) => {
|
|
1314
1341
|
const { ownerState } = props;
|
|
1315
1342
|
const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
|
|
1316
|
-
const calendarDates =
|
|
1317
|
-
const weekdayNames =
|
|
1318
|
-
return /* @__PURE__ */
|
|
1343
|
+
const calendarDates = useMemo5(() => getCalendarDates(ownerState.viewMonth), [ownerState.viewMonth]);
|
|
1344
|
+
const weekdayNames = useMemo5(() => getWeekdayNames(ownerState.locale || "default"), [ownerState.locale]);
|
|
1345
|
+
return /* @__PURE__ */ React13.createElement(CalendarViewContainer, { calendarType: "datePicker" }, /* @__PURE__ */ React13.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React13.createElement(
|
|
1319
1346
|
CalendarViewTable,
|
|
1320
1347
|
{
|
|
1321
1348
|
key: `${ownerState.viewMonth.toString()}_${ownerState.direction}`,
|
|
@@ -1344,10 +1371,10 @@ var PickerDays = (props) => {
|
|
|
1344
1371
|
}
|
|
1345
1372
|
}
|
|
1346
1373
|
},
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
/* @__PURE__ */
|
|
1349
|
-
(date, i) => date ? /* @__PURE__ */
|
|
1350
|
-
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */
|
|
1374
|
+
/* @__PURE__ */ React13.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ React13.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ React13.createElement(Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ React13.createElement("th", null, /* @__PURE__ */ React13.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ React13.createElement("th", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" }))))),
|
|
1375
|
+
/* @__PURE__ */ React13.createElement(CalendarDayPickerContainer, null, calendarDates.map((weekDates, rowIndex) => /* @__PURE__ */ React13.createElement(Fragment, { key: `${ownerState.viewMonth}_${rowIndex}` }, /* @__PURE__ */ React13.createElement("tr", null, weekDates.map(
|
|
1376
|
+
(date, i) => date ? /* @__PURE__ */ React13.createElement(Fragment, { key: `${ownerState.viewMonth}_${date}_${i}` }, /* @__PURE__ */ React13.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ React13.createElement(CalendarDay, { size: "sm", variant: "plain", color: "neutral", ...getPickerDayProps(date) }, date)), i < 6 && /* @__PURE__ */ React13.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ React13.createElement(Fragment, { key: `${ownerState.viewMonth}_${i}` }, /* @__PURE__ */ React13.createElement("td", null), i < 6 && /* @__PURE__ */ React13.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
|
|
1377
|
+
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */ React13.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ React13.createElement("td", { colSpan: 13, style: { height: 4 } })))))
|
|
1351
1378
|
)));
|
|
1352
1379
|
};
|
|
1353
1380
|
var PickerMonths = (props) => {
|
|
@@ -1364,7 +1391,7 @@ var PickerMonths = (props) => {
|
|
|
1364
1391
|
[[]]
|
|
1365
1392
|
);
|
|
1366
1393
|
const isMonthPicker = !ownerState.views?.find((view) => view === "day");
|
|
1367
|
-
return /* @__PURE__ */
|
|
1394
|
+
return /* @__PURE__ */ React13.createElement(CalendarViewContainer, { calendarType: isMonthPicker ? "monthPicker" : "datePicker" }, /* @__PURE__ */ React13.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React13.createElement(
|
|
1368
1395
|
CalendarViewTable,
|
|
1369
1396
|
{
|
|
1370
1397
|
key: `${ownerState.viewMonth.getFullYear()}_${ownerState.direction}`,
|
|
@@ -1393,16 +1420,16 @@ var PickerMonths = (props) => {
|
|
|
1393
1420
|
}
|
|
1394
1421
|
}
|
|
1395
1422
|
},
|
|
1396
|
-
/* @__PURE__ */
|
|
1423
|
+
/* @__PURE__ */ React13.createElement("tbody", null, chunkedMonths.map((months, i) => /* @__PURE__ */ React13.createElement(Fragment, { key: months.join("_") }, /* @__PURE__ */ React13.createElement("tr", null, months.map((monthIndex, j) => /* @__PURE__ */ React13.createElement(Fragment, { key: monthIndex }, /* @__PURE__ */ React13.createElement(CalendarMonthCell, { ...getMonthCellProps(monthIndex) }, /* @__PURE__ */ React13.createElement(CalendarMonth, { size: "sm", variant: "plain", color: "neutral", ...getPickerMonthProps(monthIndex) }, getMonthNameFromIndex(monthIndex, ownerState.locale))), j < 3 && /* @__PURE__ */ React13.createElement("td", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" })))), i < chunkedMonths.length - 1 && /* @__PURE__ */ React13.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ React13.createElement("td", { colSpan: 7, style: { height: 4 } })))))
|
|
1397
1424
|
)));
|
|
1398
1425
|
};
|
|
1399
1426
|
var PlainPickerDays = ({ ownerState }) => {
|
|
1400
1427
|
const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
|
|
1401
|
-
const calendarDates =
|
|
1402
|
-
const weekdayNames =
|
|
1403
|
-
return /* @__PURE__ */
|
|
1404
|
-
(date, i) => date ? /* @__PURE__ */
|
|
1405
|
-
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */
|
|
1428
|
+
const calendarDates = useMemo5(() => getCalendarDates(ownerState.viewMonth), [ownerState.viewMonth]);
|
|
1429
|
+
const weekdayNames = useMemo5(() => getWeekdayNames(ownerState.locale || "default"), [ownerState.locale]);
|
|
1430
|
+
return /* @__PURE__ */ React13.createElement(StaticCalendarViewTable, null, /* @__PURE__ */ React13.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ React13.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ React13.createElement(Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ React13.createElement("th", null, /* @__PURE__ */ React13.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ React13.createElement("th", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" }))))), /* @__PURE__ */ React13.createElement(CalendarDayPickerContainer, null, calendarDates.map((weekDates, rowIndex) => /* @__PURE__ */ React13.createElement(Fragment, { key: `${ownerState.viewMonth}_${rowIndex}` }, /* @__PURE__ */ React13.createElement("tr", null, weekDates.map(
|
|
1431
|
+
(date, i) => date ? /* @__PURE__ */ React13.createElement(Fragment, { key: `${ownerState.viewMonth}_${date}_${i}` }, /* @__PURE__ */ React13.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ React13.createElement(CalendarDay, { size: "sm", variant: "plain", color: "neutral", ...getPickerDayProps(date) }, date)), i < 6 && /* @__PURE__ */ React13.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ React13.createElement(Fragment, { key: `${ownerState.viewMonth}_${i}` }, /* @__PURE__ */ React13.createElement("td", null), i < 6 && /* @__PURE__ */ React13.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
|
|
1432
|
+
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */ React13.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ React13.createElement("td", { colSpan: 13, style: { height: 4 } }))))));
|
|
1406
1433
|
};
|
|
1407
1434
|
var MultiMonthPickerDays = ({
|
|
1408
1435
|
panels,
|
|
@@ -1421,7 +1448,7 @@ var MultiMonthPickerDays = ({
|
|
|
1421
1448
|
})
|
|
1422
1449
|
};
|
|
1423
1450
|
const key = `${panels[0].viewMonth.toISOString()}_${direction}`;
|
|
1424
|
-
return /* @__PURE__ */
|
|
1451
|
+
return /* @__PURE__ */ React13.createElement("div", { style: { position: "relative", overflow: "hidden", minHeight: "250px" } }, /* @__PURE__ */ React13.createElement(AnimatePresence, { initial: false, custom: direction }, /* @__PURE__ */ React13.createElement(
|
|
1425
1452
|
motion13.div,
|
|
1426
1453
|
{
|
|
1427
1454
|
key,
|
|
@@ -1451,7 +1478,7 @@ var MultiMonthPickerDays = ({
|
|
|
1451
1478
|
},
|
|
1452
1479
|
style: { display: "flex", gap: `${CALENDAR_PANEL_GAP}px`, top: 0, left: 0, width: "100%" }
|
|
1453
1480
|
},
|
|
1454
|
-
panels.map((panelOwnerState) => /* @__PURE__ */
|
|
1481
|
+
panels.map((panelOwnerState) => /* @__PURE__ */ React13.createElement(
|
|
1455
1482
|
"div",
|
|
1456
1483
|
{
|
|
1457
1484
|
key: panelOwnerState.viewMonth.toISOString(),
|
|
@@ -1463,7 +1490,7 @@ var MultiMonthPickerDays = ({
|
|
|
1463
1490
|
boxSizing: "border-box"
|
|
1464
1491
|
}
|
|
1465
1492
|
},
|
|
1466
|
-
/* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ React13.createElement(PlainPickerDays, { ownerState: panelOwnerState })
|
|
1467
1494
|
))
|
|
1468
1495
|
)));
|
|
1469
1496
|
};
|
|
@@ -1480,7 +1507,7 @@ var CalendarPanel = ({
|
|
|
1480
1507
|
const showPrev = panelIndex === 0;
|
|
1481
1508
|
const showNext = panelIndex === totalPanels - 1;
|
|
1482
1509
|
const title = ownerState.view === "month" ? getYearName(ownerState.viewMonth, ownerState.locale || "default") : getMonthName(ownerState.viewMonth, ownerState.locale || "default");
|
|
1483
|
-
return /* @__PURE__ */
|
|
1510
|
+
return /* @__PURE__ */ React13.createElement("div", { style: { flex: 1, maxWidth: `${CALENDAR_PANEL_WIDTH}px` } }, /* @__PURE__ */ React13.createElement(CalendarHeader, null, /* @__PURE__ */ React13.createElement(
|
|
1484
1511
|
IconButton_default,
|
|
1485
1512
|
{
|
|
1486
1513
|
size: "sm",
|
|
@@ -1488,8 +1515,8 @@ var CalendarPanel = ({
|
|
|
1488
1515
|
"aria-label": `Previous ${ownerState.view === "day" ? "Month" : "Year"}`,
|
|
1489
1516
|
style: { visibility: showPrev ? "visible" : "hidden" }
|
|
1490
1517
|
},
|
|
1491
|
-
/* @__PURE__ */
|
|
1492
|
-
), /* @__PURE__ */
|
|
1518
|
+
/* @__PURE__ */ React13.createElement(ChevronLeftIcon, null)
|
|
1519
|
+
), /* @__PURE__ */ React13.createElement(
|
|
1493
1520
|
Tooltip_default,
|
|
1494
1521
|
{
|
|
1495
1522
|
title: monthViewHintMessage,
|
|
@@ -1501,7 +1528,7 @@ var CalendarPanel = ({
|
|
|
1501
1528
|
disableTouchListener: true,
|
|
1502
1529
|
variant: "solid"
|
|
1503
1530
|
},
|
|
1504
|
-
/* @__PURE__ */
|
|
1531
|
+
/* @__PURE__ */ React13.createElement(
|
|
1505
1532
|
CalendarSwitchViewButton,
|
|
1506
1533
|
{
|
|
1507
1534
|
ownerState,
|
|
@@ -1512,7 +1539,7 @@ var CalendarPanel = ({
|
|
|
1512
1539
|
},
|
|
1513
1540
|
title
|
|
1514
1541
|
)
|
|
1515
|
-
), /* @__PURE__ */
|
|
1542
|
+
), /* @__PURE__ */ React13.createElement(
|
|
1516
1543
|
IconButton_default,
|
|
1517
1544
|
{
|
|
1518
1545
|
size: "sm",
|
|
@@ -1520,7 +1547,7 @@ var CalendarPanel = ({
|
|
|
1520
1547
|
"aria-label": `Next ${ownerState.view === "day" ? "Month" : "Year"}`,
|
|
1521
1548
|
style: { visibility: showNext ? "visible" : "hidden" }
|
|
1522
1549
|
},
|
|
1523
|
-
/* @__PURE__ */
|
|
1550
|
+
/* @__PURE__ */ React13.createElement(ChevronRightIcon, null)
|
|
1524
1551
|
)));
|
|
1525
1552
|
};
|
|
1526
1553
|
var Calendar = forwardRef4((inProps, ref) => {
|
|
@@ -1543,12 +1570,12 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1543
1570
|
...others
|
|
1544
1571
|
} = props;
|
|
1545
1572
|
const { calendarTitle, onPrev, onNext } = useCalendar(ownerState);
|
|
1546
|
-
const [isMonthViewAssistHintOpen, setIsMonthViewAssistHintOpen] =
|
|
1573
|
+
const [isMonthViewAssistHintOpen, setIsMonthViewAssistHintOpen] = useState5(false);
|
|
1547
1574
|
const monthNavClickTimestampsRef = useRef3([]);
|
|
1548
1575
|
const monthViewAssistHintShownInSessionRef = useRef3(false);
|
|
1549
1576
|
const monthViewAssistHintTimeoutRef = useRef3(null);
|
|
1550
|
-
const [hoverDay, setHoverDay] =
|
|
1551
|
-
const [hoverMonth, setHoverMonth] =
|
|
1577
|
+
const [hoverDay, setHoverDay] = useState5(null);
|
|
1578
|
+
const [hoverMonth, setHoverMonth] = useState5(null);
|
|
1552
1579
|
const resolvedNumberOfMonths = numberOfMonths ?? 1;
|
|
1553
1580
|
const hasEndDate = Boolean(value?.[1]);
|
|
1554
1581
|
const isRangeHintEligible = Boolean(rangeSelection && !hasEndDate);
|
|
@@ -1567,14 +1594,14 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1567
1594
|
}
|
|
1568
1595
|
};
|
|
1569
1596
|
}, []);
|
|
1570
|
-
const closeMonthViewAssistHint =
|
|
1597
|
+
const closeMonthViewAssistHint = useCallback6(() => {
|
|
1571
1598
|
if (monthViewAssistHintTimeoutRef.current) {
|
|
1572
1599
|
clearTimeout(monthViewAssistHintTimeoutRef.current);
|
|
1573
1600
|
monthViewAssistHintTimeoutRef.current = null;
|
|
1574
1601
|
}
|
|
1575
1602
|
setIsMonthViewAssistHintOpen(false);
|
|
1576
1603
|
}, []);
|
|
1577
|
-
const showMonthViewAssistHint =
|
|
1604
|
+
const showMonthViewAssistHint = useCallback6(() => {
|
|
1578
1605
|
const now = Date.now();
|
|
1579
1606
|
if (monthViewAssistHintShownInSessionRef.current) return;
|
|
1580
1607
|
if (now - lastMonthViewAssistHintShownAt < MONTH_VIEW_HINT_COOLDOWN_MS) return;
|
|
@@ -1589,7 +1616,7 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1589
1616
|
monthViewAssistHintTimeoutRef.current = null;
|
|
1590
1617
|
}, MONTH_VIEW_HINT_DURATION_MS);
|
|
1591
1618
|
}, []);
|
|
1592
|
-
const trackFastMonthNavigation =
|
|
1619
|
+
const trackFastMonthNavigation = useCallback6(() => {
|
|
1593
1620
|
if (!isHintEligible) return;
|
|
1594
1621
|
const now = Date.now();
|
|
1595
1622
|
monthNavClickTimestampsRef.current = [
|
|
@@ -1600,15 +1627,15 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1600
1627
|
showMonthViewAssistHint();
|
|
1601
1628
|
}
|
|
1602
1629
|
}, [isHintEligible, showMonthViewAssistHint]);
|
|
1603
|
-
const handlePrevClick =
|
|
1630
|
+
const handlePrevClick = useCallback6(() => {
|
|
1604
1631
|
onPrev();
|
|
1605
1632
|
trackFastMonthNavigation();
|
|
1606
1633
|
}, [onPrev, trackFastMonthNavigation]);
|
|
1607
|
-
const handleNextClick =
|
|
1634
|
+
const handleNextClick = useCallback6(() => {
|
|
1608
1635
|
onNext();
|
|
1609
1636
|
trackFastMonthNavigation();
|
|
1610
1637
|
}, [onNext, trackFastMonthNavigation]);
|
|
1611
|
-
const handleSwitchViewClick =
|
|
1638
|
+
const handleSwitchViewClick = useCallback6(() => {
|
|
1612
1639
|
closeMonthViewAssistHint();
|
|
1613
1640
|
onViewChange?.();
|
|
1614
1641
|
}, [closeMonthViewAssistHint, onViewChange]);
|
|
@@ -1628,9 +1655,9 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1628
1655
|
onHoverMonthChange: setHoverMonth
|
|
1629
1656
|
};
|
|
1630
1657
|
});
|
|
1631
|
-
return /* @__PURE__ */
|
|
1658
|
+
return /* @__PURE__ */ React13.createElement(CalendarRoot, { ref, ...others, style: { maxWidth: `${maxWidth}px` } }, view === "month" ? (
|
|
1632
1659
|
// Month view: single header + single month grid (consistent with single-month path)
|
|
1633
|
-
/* @__PURE__ */
|
|
1660
|
+
/* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(CalendarHeader, null, /* @__PURE__ */ React13.createElement(IconButton_default, { size: "sm", onClick: handlePrevClick, "aria-label": "Previous Year" }, /* @__PURE__ */ React13.createElement(ChevronLeftIcon, null)), /* @__PURE__ */ React13.createElement(
|
|
1634
1661
|
Tooltip_default,
|
|
1635
1662
|
{
|
|
1636
1663
|
title: monthViewHintMessage,
|
|
@@ -1642,7 +1669,7 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1642
1669
|
disableTouchListener: true,
|
|
1643
1670
|
variant: "solid"
|
|
1644
1671
|
},
|
|
1645
|
-
/* @__PURE__ */
|
|
1672
|
+
/* @__PURE__ */ React13.createElement(
|
|
1646
1673
|
CalendarSwitchViewButton,
|
|
1647
1674
|
{
|
|
1648
1675
|
ownerState,
|
|
@@ -1653,8 +1680,8 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1653
1680
|
},
|
|
1654
1681
|
calendarTitle
|
|
1655
1682
|
)
|
|
1656
|
-
), /* @__PURE__ */
|
|
1657
|
-
) : /* @__PURE__ */
|
|
1683
|
+
), /* @__PURE__ */ React13.createElement(IconButton_default, { size: "sm", onClick: handleNextClick, "aria-label": "Next Year" }, /* @__PURE__ */ React13.createElement(ChevronRightIcon, null))), /* @__PURE__ */ React13.createElement(PickerMonths, { ownerState }))
|
|
1684
|
+
) : /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(CalendarMultiContainer, null, panels.map((panelOwnerState, i) => /* @__PURE__ */ React13.createElement(
|
|
1658
1685
|
CalendarPanel,
|
|
1659
1686
|
{
|
|
1660
1687
|
key: panelOwnerState.viewMonth.toISOString(),
|
|
@@ -1667,7 +1694,7 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1667
1694
|
isMonthViewAssistHintOpen,
|
|
1668
1695
|
monthViewHintMessage
|
|
1669
1696
|
}
|
|
1670
|
-
))), /* @__PURE__ */
|
|
1697
|
+
))), /* @__PURE__ */ React13.createElement(
|
|
1671
1698
|
MultiMonthPickerDays,
|
|
1672
1699
|
{
|
|
1673
1700
|
panels,
|
|
@@ -1676,7 +1703,7 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1676
1703
|
}
|
|
1677
1704
|
)));
|
|
1678
1705
|
}
|
|
1679
|
-
return /* @__PURE__ */
|
|
1706
|
+
return /* @__PURE__ */ React13.createElement(CalendarRoot, { ref, ...others, style: { maxWidth: `${maxWidth}px` } }, /* @__PURE__ */ React13.createElement(CalendarHeader, null, /* @__PURE__ */ React13.createElement(IconButton_default, { size: "sm", onClick: handlePrevClick, "aria-label": `Previous ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ React13.createElement(ChevronLeftIcon, null)), /* @__PURE__ */ React13.createElement(
|
|
1680
1707
|
Tooltip_default,
|
|
1681
1708
|
{
|
|
1682
1709
|
title: monthViewHintMessage,
|
|
@@ -1688,7 +1715,7 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1688
1715
|
disableTouchListener: true,
|
|
1689
1716
|
variant: "solid"
|
|
1690
1717
|
},
|
|
1691
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ React13.createElement(
|
|
1692
1719
|
CalendarSwitchViewButton,
|
|
1693
1720
|
{
|
|
1694
1721
|
ownerState,
|
|
@@ -1699,7 +1726,7 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1699
1726
|
},
|
|
1700
1727
|
calendarTitle
|
|
1701
1728
|
)
|
|
1702
|
-
), /* @__PURE__ */
|
|
1729
|
+
), /* @__PURE__ */ React13.createElement(IconButton_default, { size: "sm", onClick: handleNextClick, "aria-label": `Next ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ React13.createElement(ChevronRightIcon, null))), view === "day" && /* @__PURE__ */ React13.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ React13.createElement(PickerMonths, { ownerState }));
|
|
1703
1730
|
});
|
|
1704
1731
|
Calendar.displayName = "Calendar";
|
|
1705
1732
|
|
|
@@ -1732,12 +1759,12 @@ var CardOverflow = MotionCardOverflow;
|
|
|
1732
1759
|
CardOverflow.displayName = "CardOverflow";
|
|
1733
1760
|
|
|
1734
1761
|
// src/components/Checkbox/Checkbox.tsx
|
|
1735
|
-
import
|
|
1762
|
+
import React14 from "react";
|
|
1736
1763
|
import { Checkbox as JoyCheckbox } from "@mui/joy";
|
|
1737
1764
|
import { motion as motion15 } from "framer-motion";
|
|
1738
1765
|
var MotionCheckbox = motion15(JoyCheckbox);
|
|
1739
1766
|
var Checkbox = (props) => {
|
|
1740
|
-
return /* @__PURE__ */
|
|
1767
|
+
return /* @__PURE__ */ React14.createElement(MotionCheckbox, { ...props });
|
|
1741
1768
|
};
|
|
1742
1769
|
Checkbox.displayName = "Checkbox";
|
|
1743
1770
|
|
|
@@ -1746,7 +1773,7 @@ var Checkbox_default = Checkbox;
|
|
|
1746
1773
|
|
|
1747
1774
|
// src/components/Container/Container.tsx
|
|
1748
1775
|
import { styled as styled6 } from "@mui/joy";
|
|
1749
|
-
import
|
|
1776
|
+
import React15, { forwardRef as forwardRef5 } from "react";
|
|
1750
1777
|
var ContainerRoot = styled6("div", {
|
|
1751
1778
|
name: "Container",
|
|
1752
1779
|
slot: "root",
|
|
@@ -1773,23 +1800,23 @@ var ContainerRoot = styled6("div", {
|
|
|
1773
1800
|
} : null
|
|
1774
1801
|
]);
|
|
1775
1802
|
var Container = forwardRef5(function Container2(props, ref) {
|
|
1776
|
-
return /* @__PURE__ */
|
|
1803
|
+
return /* @__PURE__ */ React15.createElement(ContainerRoot, { ref, ...props });
|
|
1777
1804
|
});
|
|
1778
1805
|
Container.displayName = "Container";
|
|
1779
1806
|
|
|
1780
1807
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1781
|
-
import
|
|
1808
|
+
import React17, { useCallback as useCallback8, useMemo as useMemo6, useState as useState7 } from "react";
|
|
1782
1809
|
import { NumericFormat } from "react-number-format";
|
|
1783
1810
|
|
|
1784
1811
|
// src/components/Input/Input.tsx
|
|
1785
|
-
import
|
|
1812
|
+
import React16, { useCallback as useCallback7, useState as useState6 } from "react";
|
|
1786
1813
|
import { Input as JoyInput } from "@mui/joy";
|
|
1787
1814
|
import { motion as motion16 } from "framer-motion";
|
|
1788
1815
|
import ClearIcon from "@mui/icons-material/Close";
|
|
1789
1816
|
import VisibilityIcon from "@mui/icons-material/Visibility";
|
|
1790
1817
|
import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";
|
|
1791
1818
|
var MotionInput = motion16(JoyInput);
|
|
1792
|
-
var Input =
|
|
1819
|
+
var Input = React16.forwardRef((props, ref) => {
|
|
1793
1820
|
const {
|
|
1794
1821
|
label,
|
|
1795
1822
|
helperText,
|
|
@@ -1812,11 +1839,11 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1812
1839
|
if (type === "password" && innerProps.endDecorator) {
|
|
1813
1840
|
console.warn('Input: endDecorator is not supported when type="password"');
|
|
1814
1841
|
}
|
|
1815
|
-
const [passwordVisible, setPasswordVisible] =
|
|
1842
|
+
const [passwordVisible, setPasswordVisible] = useState6(false);
|
|
1816
1843
|
const [value, setValue] = useControlledState(
|
|
1817
1844
|
props.value,
|
|
1818
1845
|
props.defaultValue,
|
|
1819
|
-
|
|
1846
|
+
useCallback7(
|
|
1820
1847
|
(value2) => {
|
|
1821
1848
|
onChange?.({
|
|
1822
1849
|
/**
|
|
@@ -1842,7 +1869,7 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1842
1869
|
const actualType = type === "password" && passwordVisible ? "text" : type;
|
|
1843
1870
|
const isPasswordType = type === "password";
|
|
1844
1871
|
const showPasswordToggle = isPasswordType && !disableTogglePasswordButton;
|
|
1845
|
-
const input = /* @__PURE__ */
|
|
1872
|
+
const input = /* @__PURE__ */ React16.createElement(
|
|
1846
1873
|
MotionInput,
|
|
1847
1874
|
{
|
|
1848
1875
|
value,
|
|
@@ -1857,7 +1884,7 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1857
1884
|
...innerProps.slotProps
|
|
1858
1885
|
},
|
|
1859
1886
|
...innerProps,
|
|
1860
|
-
endDecorator: isPasswordType ? showPasswordToggle ? /* @__PURE__ */
|
|
1887
|
+
endDecorator: isPasswordType ? showPasswordToggle ? /* @__PURE__ */ React16.createElement(Stack_default, { gap: 1, direction: "row" }, /* @__PURE__ */ React16.createElement(
|
|
1861
1888
|
IconButton_default,
|
|
1862
1889
|
{
|
|
1863
1890
|
onMouseDown: (e) => e.preventDefault(),
|
|
@@ -1865,19 +1892,19 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1865
1892
|
disabled,
|
|
1866
1893
|
"aria-label": passwordVisible ? "Hide password" : "Show password"
|
|
1867
1894
|
},
|
|
1868
|
-
passwordVisible ? /* @__PURE__ */
|
|
1869
|
-
)) : null : enableClearable ? /* @__PURE__ */
|
|
1895
|
+
passwordVisible ? /* @__PURE__ */ React16.createElement(VisibilityOffIcon, null) : /* @__PURE__ */ React16.createElement(VisibilityIcon, null)
|
|
1896
|
+
)) : null : enableClearable ? /* @__PURE__ */ React16.createElement(Stack_default, { gap: 1, direction: "row" }, innerProps.endDecorator, value && /* @__PURE__ */ React16.createElement(
|
|
1870
1897
|
IconButton_default,
|
|
1871
1898
|
{
|
|
1872
1899
|
onMouseDown: (e) => e.preventDefault(),
|
|
1873
1900
|
onClick: handleClear,
|
|
1874
1901
|
"aria-label": "Clear"
|
|
1875
1902
|
},
|
|
1876
|
-
/* @__PURE__ */
|
|
1903
|
+
/* @__PURE__ */ React16.createElement(ClearIcon, null)
|
|
1877
1904
|
)) : innerProps.endDecorator
|
|
1878
1905
|
}
|
|
1879
1906
|
);
|
|
1880
|
-
return /* @__PURE__ */
|
|
1907
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1881
1908
|
FormControl_default,
|
|
1882
1909
|
{
|
|
1883
1910
|
required,
|
|
@@ -1888,9 +1915,9 @@ var Input = React15.forwardRef((props, ref) => {
|
|
|
1888
1915
|
sx,
|
|
1889
1916
|
className
|
|
1890
1917
|
},
|
|
1891
|
-
label && /* @__PURE__ */
|
|
1918
|
+
label && /* @__PURE__ */ React16.createElement(FormLabel_default, null, label),
|
|
1892
1919
|
input,
|
|
1893
|
-
helperText && /* @__PURE__ */
|
|
1920
|
+
helperText && /* @__PURE__ */ React16.createElement(FormHelperText_default, null, helperText)
|
|
1894
1921
|
);
|
|
1895
1922
|
});
|
|
1896
1923
|
Input.displayName = "Input";
|
|
@@ -2062,9 +2089,9 @@ var useCurrencySetting = (props) => {
|
|
|
2062
2089
|
};
|
|
2063
2090
|
|
|
2064
2091
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
2065
|
-
var TextMaskAdapter =
|
|
2092
|
+
var TextMaskAdapter = React17.forwardRef(function TextMaskAdapter2(props, ref) {
|
|
2066
2093
|
const { onChange, ...innerProps } = props;
|
|
2067
|
-
return /* @__PURE__ */
|
|
2094
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2068
2095
|
NumericFormat,
|
|
2069
2096
|
{
|
|
2070
2097
|
...innerProps,
|
|
@@ -2084,7 +2111,7 @@ var CurrencyInputRoot = styled7(Input_default, {
|
|
|
2084
2111
|
slot: "root",
|
|
2085
2112
|
overridesResolver: (props, styles) => styles.root
|
|
2086
2113
|
})({});
|
|
2087
|
-
var CurrencyInput =
|
|
2114
|
+
var CurrencyInput = React17.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
2088
2115
|
const props = useThemeProps3({ props: inProps, name: "CurrencyInput" });
|
|
2089
2116
|
const {
|
|
2090
2117
|
currency = "USD",
|
|
@@ -2105,22 +2132,22 @@ var CurrencyInput = React16.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
2105
2132
|
const [_value, setValue] = useControlledState(
|
|
2106
2133
|
props.value,
|
|
2107
2134
|
props.defaultValue,
|
|
2108
|
-
|
|
2135
|
+
useCallback8((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
2109
2136
|
);
|
|
2110
|
-
const value =
|
|
2137
|
+
const value = useMemo6(() => {
|
|
2111
2138
|
if (_value && useMinorUnit) {
|
|
2112
2139
|
return _value / Math.pow(10, decimalScale);
|
|
2113
2140
|
}
|
|
2114
2141
|
return _value;
|
|
2115
2142
|
}, [_value, useMinorUnit, decimalScale]);
|
|
2116
|
-
const max =
|
|
2143
|
+
const max = useMemo6(() => {
|
|
2117
2144
|
if (props.max && useMinorUnit) {
|
|
2118
2145
|
return props.max / Math.pow(10, decimalScale);
|
|
2119
2146
|
}
|
|
2120
2147
|
return props.max;
|
|
2121
2148
|
}, [props.max, useMinorUnit, decimalScale]);
|
|
2122
|
-
const [isOverLimit, setIsOverLimit] =
|
|
2123
|
-
const handleChange =
|
|
2149
|
+
const [isOverLimit, setIsOverLimit] = useState7(!!max && !!value && value > max);
|
|
2150
|
+
const handleChange = useCallback8(
|
|
2124
2151
|
(event) => {
|
|
2125
2152
|
if (event.target.value === "") {
|
|
2126
2153
|
setValue(void 0);
|
|
@@ -2136,7 +2163,7 @@ var CurrencyInput = React16.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
2136
2163
|
},
|
|
2137
2164
|
[decimalSeparator, max, useMinorUnit, setValue]
|
|
2138
2165
|
);
|
|
2139
|
-
return /* @__PURE__ */
|
|
2166
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2140
2167
|
CurrencyInputRoot,
|
|
2141
2168
|
{
|
|
2142
2169
|
...innerProps,
|
|
@@ -2173,9 +2200,9 @@ var CurrencyInput = React16.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
2173
2200
|
var CurrencyInput_default = CurrencyInput;
|
|
2174
2201
|
|
|
2175
2202
|
// src/components/DataTable/DataTable.tsx
|
|
2176
|
-
import
|
|
2177
|
-
useCallback as
|
|
2178
|
-
useMemo as
|
|
2203
|
+
import React26, {
|
|
2204
|
+
useCallback as useCallback13,
|
|
2205
|
+
useMemo as useMemo11,
|
|
2179
2206
|
useRef as useRef7,
|
|
2180
2207
|
useId,
|
|
2181
2208
|
forwardRef as forwardRef7,
|
|
@@ -2411,7 +2438,7 @@ function computeAutoFitWidth(params) {
|
|
|
2411
2438
|
}
|
|
2412
2439
|
|
|
2413
2440
|
// src/components/DataTable/styled.tsx
|
|
2414
|
-
import
|
|
2441
|
+
import React18 from "react";
|
|
2415
2442
|
import { styled as styled8, LinearProgress, buttonClasses, iconButtonClasses, Typography as Typography3 } from "@mui/joy";
|
|
2416
2443
|
import { motion as motion17 } from "framer-motion";
|
|
2417
2444
|
import SortIcon from "@mui/icons-material/ArrowUpwardRounded";
|
|
@@ -2517,9 +2544,9 @@ var StyledTd = styled8("td")(({ theme }) => ({
|
|
|
2517
2544
|
}
|
|
2518
2545
|
}));
|
|
2519
2546
|
var MotionSortIcon = motion17(SortIcon);
|
|
2520
|
-
var DefaultLoadingOverlay = () => /* @__PURE__ */
|
|
2521
|
-
var DefaultNoRowsOverlay = () => /* @__PURE__ */
|
|
2522
|
-
var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PURE__ */
|
|
2547
|
+
var DefaultLoadingOverlay = () => /* @__PURE__ */ React18.createElement(LinearProgress, { value: 8, variant: "plain" });
|
|
2548
|
+
var DefaultNoRowsOverlay = () => /* @__PURE__ */ React18.createElement(Typography3, { level: "body-sm", textColor: "text.tertiary" }, "No rows");
|
|
2549
|
+
var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PURE__ */ React18.createElement(
|
|
2523
2550
|
Box_default,
|
|
2524
2551
|
{
|
|
2525
2552
|
sx: {
|
|
@@ -2596,12 +2623,12 @@ var Resizer = (ref, targetRef = ref, onResizeStateChange, onAutoFit) => /* @__PU
|
|
|
2596
2623
|
);
|
|
2597
2624
|
|
|
2598
2625
|
// src/components/DataTable/components.tsx
|
|
2599
|
-
import
|
|
2626
|
+
import React23, {
|
|
2600
2627
|
useRef as useRef5,
|
|
2601
|
-
useState as
|
|
2628
|
+
useState as useState9,
|
|
2602
2629
|
useLayoutEffect,
|
|
2603
|
-
useMemo as
|
|
2604
|
-
useCallback as
|
|
2630
|
+
useMemo as useMemo9,
|
|
2631
|
+
useCallback as useCallback10,
|
|
2605
2632
|
useEffect as useEffect5,
|
|
2606
2633
|
memo,
|
|
2607
2634
|
createElement
|
|
@@ -2610,7 +2637,7 @@ import { styled as styled12, useTheme } from "@mui/joy";
|
|
|
2610
2637
|
import { AnimatePresence as AnimatePresence2 } from "framer-motion";
|
|
2611
2638
|
|
|
2612
2639
|
// src/components/DatePicker/DatePicker.tsx
|
|
2613
|
-
import
|
|
2640
|
+
import React19, { forwardRef as forwardRef6, useCallback as useCallback9, useEffect as useEffect4, useImperativeHandle, useRef as useRef4, useState as useState8 } from "react";
|
|
2614
2641
|
import { IMaskInput, IMask } from "react-imask";
|
|
2615
2642
|
import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
|
|
2616
2643
|
import { styled as styled10, useThemeProps as useThemeProps4 } from "@mui/joy";
|
|
@@ -2763,9 +2790,9 @@ function parseDate(dateString, format) {
|
|
|
2763
2790
|
var formatToPattern = (format) => {
|
|
2764
2791
|
return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
2765
2792
|
};
|
|
2766
|
-
var TextMaskAdapter3 =
|
|
2793
|
+
var TextMaskAdapter3 = React19.forwardRef(function TextMaskAdapter4(props, ref) {
|
|
2767
2794
|
const { onChange, format, ...other } = props;
|
|
2768
|
-
return /* @__PURE__ */
|
|
2795
|
+
return /* @__PURE__ */ React19.createElement(
|
|
2769
2796
|
IMaskInput,
|
|
2770
2797
|
{
|
|
2771
2798
|
...other,
|
|
@@ -2832,13 +2859,13 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2832
2859
|
const [value, setValue] = useControlledState(
|
|
2833
2860
|
props.value,
|
|
2834
2861
|
props.defaultValue || "",
|
|
2835
|
-
|
|
2862
|
+
useCallback9((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
2836
2863
|
);
|
|
2837
2864
|
const isAlphabeticDisplay = hasAlphabeticMonth(displayFormat);
|
|
2838
|
-
const [displayValue, setDisplayValue] =
|
|
2865
|
+
const [displayValue, setDisplayValue] = useState8(
|
|
2839
2866
|
() => value ? formatValueString(parseDate(value, format), displayFormat, locale) : ""
|
|
2840
2867
|
);
|
|
2841
|
-
const [anchorEl, setAnchorEl] =
|
|
2868
|
+
const [anchorEl, setAnchorEl] = useState8(null);
|
|
2842
2869
|
const open = Boolean(anchorEl);
|
|
2843
2870
|
useEffect4(() => {
|
|
2844
2871
|
if (!anchorEl) {
|
|
@@ -2856,7 +2883,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2856
2883
|
}
|
|
2857
2884
|
}, [displayFormat, displayValue, format, locale, value]);
|
|
2858
2885
|
useImperativeHandle(ref, () => innerRef.current, [innerRef]);
|
|
2859
|
-
const handleChange =
|
|
2886
|
+
const handleChange = useCallback9(
|
|
2860
2887
|
(event) => {
|
|
2861
2888
|
const value2 = event.target.value;
|
|
2862
2889
|
setDisplayValue(value2 ? formatValueString(parseDate(value2, format), displayFormat, locale) : value2);
|
|
@@ -2864,7 +2891,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2864
2891
|
},
|
|
2865
2892
|
[displayFormat, format, locale, setValue]
|
|
2866
2893
|
);
|
|
2867
|
-
const handleDisplayInputChange =
|
|
2894
|
+
const handleDisplayInputChange = useCallback9(
|
|
2868
2895
|
(event) => {
|
|
2869
2896
|
if (event.target.value === "") {
|
|
2870
2897
|
handleChange({
|
|
@@ -2889,7 +2916,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2889
2916
|
},
|
|
2890
2917
|
[displayFormat, format, handleChange, props.name]
|
|
2891
2918
|
);
|
|
2892
|
-
const handleCalendarToggle =
|
|
2919
|
+
const handleCalendarToggle = useCallback9(
|
|
2893
2920
|
(event) => {
|
|
2894
2921
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2895
2922
|
setTimeout(() => {
|
|
@@ -2898,7 +2925,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2898
2925
|
},
|
|
2899
2926
|
[anchorEl, setAnchorEl, innerRef]
|
|
2900
2927
|
);
|
|
2901
|
-
const handleInputMouseDown =
|
|
2928
|
+
const handleInputMouseDown = useCallback9(
|
|
2902
2929
|
(event) => {
|
|
2903
2930
|
if (inputReadOnly || isAlphabeticDisplay) {
|
|
2904
2931
|
event.preventDefault();
|
|
@@ -2907,7 +2934,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2907
2934
|
},
|
|
2908
2935
|
[inputReadOnly, isAlphabeticDisplay, buttonRef]
|
|
2909
2936
|
);
|
|
2910
|
-
const handlePresetClick =
|
|
2937
|
+
const handlePresetClick = useCallback9(
|
|
2911
2938
|
(presetValue) => {
|
|
2912
2939
|
handleChange({
|
|
2913
2940
|
target: {
|
|
@@ -2919,7 +2946,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2919
2946
|
},
|
|
2920
2947
|
[handleChange, props.name]
|
|
2921
2948
|
);
|
|
2922
|
-
const isPresetDisabled =
|
|
2949
|
+
const isPresetDisabled = useCallback9(
|
|
2923
2950
|
(presetValue) => {
|
|
2924
2951
|
try {
|
|
2925
2952
|
const date = parseDate(presetValue, format);
|
|
@@ -2936,7 +2963,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2936
2963
|
},
|
|
2937
2964
|
[format, minDate, maxDate, disableFuture, disablePast, shouldDisableDate]
|
|
2938
2965
|
);
|
|
2939
|
-
return /* @__PURE__ */
|
|
2966
|
+
return /* @__PURE__ */ React19.createElement(DatePickerRoot, null, /* @__PURE__ */ React19.createElement(FocusTrap, { open: true }, /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
|
|
2940
2967
|
Input_default,
|
|
2941
2968
|
{
|
|
2942
2969
|
...innerProps,
|
|
@@ -2963,7 +2990,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2963
2990
|
},
|
|
2964
2991
|
className,
|
|
2965
2992
|
sx,
|
|
2966
|
-
endDecorator: /* @__PURE__ */
|
|
2993
|
+
endDecorator: /* @__PURE__ */ React19.createElement(
|
|
2967
2994
|
CalendarButton,
|
|
2968
2995
|
{
|
|
2969
2996
|
ref: buttonRef,
|
|
@@ -2975,13 +3002,13 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
2975
3002
|
"aria-expanded": open,
|
|
2976
3003
|
disabled
|
|
2977
3004
|
},
|
|
2978
|
-
/* @__PURE__ */
|
|
3005
|
+
/* @__PURE__ */ React19.createElement(CalendarTodayIcon, null)
|
|
2979
3006
|
),
|
|
2980
3007
|
label,
|
|
2981
3008
|
helperText,
|
|
2982
3009
|
readOnly: readOnly || inputReadOnly || isAlphabeticDisplay
|
|
2983
3010
|
}
|
|
2984
|
-
), open && /* @__PURE__ */
|
|
3011
|
+
), open && /* @__PURE__ */ React19.createElement(ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React19.createElement(
|
|
2985
3012
|
StyledPopper,
|
|
2986
3013
|
{
|
|
2987
3014
|
id: "date-picker-popper",
|
|
@@ -3000,7 +3027,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
3000
3027
|
"aria-label": "Calendar Tooltip",
|
|
3001
3028
|
"aria-expanded": open
|
|
3002
3029
|
},
|
|
3003
|
-
/* @__PURE__ */
|
|
3030
|
+
/* @__PURE__ */ React19.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React19.createElement(CalendarSheetContent, null, /* @__PURE__ */ React19.createElement(CalendarSection, null, /* @__PURE__ */ React19.createElement(
|
|
3004
3031
|
Calendar_default,
|
|
3005
3032
|
{
|
|
3006
3033
|
value: value && !Number.isNaN(parseDate(value, format).getTime()) ? [parseDate(value, format), void 0] : void 0,
|
|
@@ -3020,14 +3047,14 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
3020
3047
|
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0,
|
|
3021
3048
|
locale
|
|
3022
3049
|
}
|
|
3023
|
-
), !hideClearButton && /* @__PURE__ */
|
|
3050
|
+
), !hideClearButton && /* @__PURE__ */ React19.createElement(
|
|
3024
3051
|
DialogActions_default,
|
|
3025
3052
|
{
|
|
3026
3053
|
sx: {
|
|
3027
3054
|
p: 1
|
|
3028
3055
|
}
|
|
3029
3056
|
},
|
|
3030
|
-
/* @__PURE__ */
|
|
3057
|
+
/* @__PURE__ */ React19.createElement(
|
|
3031
3058
|
Button_default,
|
|
3032
3059
|
{
|
|
3033
3060
|
size,
|
|
@@ -3045,9 +3072,9 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
3045
3072
|
},
|
|
3046
3073
|
"Clear"
|
|
3047
3074
|
)
|
|
3048
|
-
)), presets && presets.length > 0 && /* @__PURE__ */
|
|
3075
|
+
)), presets && presets.length > 0 && /* @__PURE__ */ React19.createElement(PresetPanel, null, presets.map((preset) => {
|
|
3049
3076
|
const disabled2 = isPresetDisabled(preset.value);
|
|
3050
|
-
return /* @__PURE__ */
|
|
3077
|
+
return /* @__PURE__ */ React19.createElement(
|
|
3051
3078
|
PresetItem,
|
|
3052
3079
|
{
|
|
3053
3080
|
key: preset.label,
|
|
@@ -3068,7 +3095,7 @@ var DatePicker = forwardRef6((inProps, ref) => {
|
|
|
3068
3095
|
var DatePicker_default = DatePicker;
|
|
3069
3096
|
|
|
3070
3097
|
// src/components/Textarea/Textarea.tsx
|
|
3071
|
-
import
|
|
3098
|
+
import React20 from "react";
|
|
3072
3099
|
import { Textarea as JoyTextarea } from "@mui/joy";
|
|
3073
3100
|
import { motion as motion19 } from "framer-motion";
|
|
3074
3101
|
var MotionTextarea = motion19(JoyTextarea);
|
|
@@ -3088,7 +3115,7 @@ var Textarea = (props) => {
|
|
|
3088
3115
|
className,
|
|
3089
3116
|
...innerProps
|
|
3090
3117
|
} = props;
|
|
3091
|
-
const textarea = /* @__PURE__ */
|
|
3118
|
+
const textarea = /* @__PURE__ */ React20.createElement(
|
|
3092
3119
|
MotionTextarea,
|
|
3093
3120
|
{
|
|
3094
3121
|
required,
|
|
@@ -3100,7 +3127,7 @@ var Textarea = (props) => {
|
|
|
3100
3127
|
...innerProps
|
|
3101
3128
|
}
|
|
3102
3129
|
);
|
|
3103
|
-
return /* @__PURE__ */
|
|
3130
|
+
return /* @__PURE__ */ React20.createElement(
|
|
3104
3131
|
FormControl_default,
|
|
3105
3132
|
{
|
|
3106
3133
|
required,
|
|
@@ -3111,9 +3138,9 @@ var Textarea = (props) => {
|
|
|
3111
3138
|
sx,
|
|
3112
3139
|
className
|
|
3113
3140
|
},
|
|
3114
|
-
label && /* @__PURE__ */
|
|
3141
|
+
label && /* @__PURE__ */ React20.createElement(FormLabel_default, null, label),
|
|
3115
3142
|
textarea,
|
|
3116
|
-
helperText && /* @__PURE__ */
|
|
3143
|
+
helperText && /* @__PURE__ */ React20.createElement(FormHelperText_default, null, helperText)
|
|
3117
3144
|
);
|
|
3118
3145
|
};
|
|
3119
3146
|
Textarea.displayName = "Textarea";
|
|
@@ -3122,8 +3149,13 @@ Textarea.displayName = "Textarea";
|
|
|
3122
3149
|
var Textarea_default = Textarea;
|
|
3123
3150
|
|
|
3124
3151
|
// src/components/Select/Select.tsx
|
|
3125
|
-
import
|
|
3126
|
-
import {
|
|
3152
|
+
import React21, { useMemo as useMemo8 } from "react";
|
|
3153
|
+
import {
|
|
3154
|
+
Select as JoySelect,
|
|
3155
|
+
Option as JoyOption,
|
|
3156
|
+
ListItemContent as ListItemContent2,
|
|
3157
|
+
Typography as Typography4
|
|
3158
|
+
} from "@mui/joy";
|
|
3127
3159
|
import { motion as motion20 } from "framer-motion";
|
|
3128
3160
|
var MotionOption = motion20(JoyOption);
|
|
3129
3161
|
var Option = MotionOption;
|
|
@@ -3148,7 +3180,7 @@ function Select(props) {
|
|
|
3148
3180
|
className,
|
|
3149
3181
|
...innerProps
|
|
3150
3182
|
} = props;
|
|
3151
|
-
const options =
|
|
3183
|
+
const options = useMemo8(
|
|
3152
3184
|
() => props.options.map((option) => {
|
|
3153
3185
|
if (option.hasOwnProperty("value") && option.hasOwnProperty("label")) {
|
|
3154
3186
|
return option;
|
|
@@ -3173,14 +3205,14 @@ function Select(props) {
|
|
|
3173
3205
|
};
|
|
3174
3206
|
onChange?.(newEvent, newValue);
|
|
3175
3207
|
};
|
|
3176
|
-
const optionMap =
|
|
3208
|
+
const optionMap = useMemo8(() => {
|
|
3177
3209
|
const map = /* @__PURE__ */ new Map();
|
|
3178
3210
|
options.forEach((option) => {
|
|
3179
3211
|
map.set(option.value, option);
|
|
3180
3212
|
});
|
|
3181
3213
|
return map;
|
|
3182
3214
|
}, [options]);
|
|
3183
|
-
const select = /* @__PURE__ */
|
|
3215
|
+
const select = /* @__PURE__ */ React21.createElement(
|
|
3184
3216
|
JoySelect,
|
|
3185
3217
|
{
|
|
3186
3218
|
...innerProps,
|
|
@@ -3197,9 +3229,9 @@ function Select(props) {
|
|
|
3197
3229
|
return optionMap.get(selected.value)?.label;
|
|
3198
3230
|
}
|
|
3199
3231
|
},
|
|
3200
|
-
options.map((option) => /* @__PURE__ */
|
|
3232
|
+
options.map((option) => /* @__PURE__ */ React21.createElement(Option, { key: option.value, value: option.value, disabled: option.disabled }, option.secondaryText ? /* @__PURE__ */ React21.createElement(ListItemContent2, { sx: { gap: 0.5 } }, /* @__PURE__ */ React21.createElement(Typography4, { level: "inherit" }, option.label), /* @__PURE__ */ React21.createElement(Typography4, { level: secondaryTextLevelMap2[size ?? "md"], textColor: "text.tertiary" }, option.secondaryText)) : option.label))
|
|
3201
3233
|
);
|
|
3202
|
-
return /* @__PURE__ */
|
|
3234
|
+
return /* @__PURE__ */ React21.createElement(
|
|
3203
3235
|
FormControl_default,
|
|
3204
3236
|
{
|
|
3205
3237
|
required,
|
|
@@ -3210,9 +3242,9 @@ function Select(props) {
|
|
|
3210
3242
|
sx,
|
|
3211
3243
|
className
|
|
3212
3244
|
},
|
|
3213
|
-
label && /* @__PURE__ */
|
|
3245
|
+
label && /* @__PURE__ */ React21.createElement(FormLabel_default, null, label),
|
|
3214
3246
|
select,
|
|
3215
|
-
helperText && /* @__PURE__ */
|
|
3247
|
+
helperText && /* @__PURE__ */ React21.createElement(FormHelperText_default, null, helperText)
|
|
3216
3248
|
);
|
|
3217
3249
|
}
|
|
3218
3250
|
Select.displayName = "Select";
|
|
@@ -3224,7 +3256,7 @@ var Select_default = Select;
|
|
|
3224
3256
|
import { Link } from "@mui/joy";
|
|
3225
3257
|
|
|
3226
3258
|
// src/components/InfoSign/InfoSign.tsx
|
|
3227
|
-
import
|
|
3259
|
+
import React22 from "react";
|
|
3228
3260
|
import { styled as styled11, tooltipClasses } from "@mui/joy";
|
|
3229
3261
|
import MuiInfoIcon from "@mui/icons-material/Info";
|
|
3230
3262
|
var InfoIcon = styled11(MuiInfoIcon, {
|
|
@@ -3237,7 +3269,7 @@ var InfoIcon = styled11(MuiInfoIcon, {
|
|
|
3237
3269
|
}));
|
|
3238
3270
|
function InfoSign(props) {
|
|
3239
3271
|
const { message, placement } = props;
|
|
3240
|
-
return /* @__PURE__ */
|
|
3272
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3241
3273
|
Tooltip_default,
|
|
3242
3274
|
{
|
|
3243
3275
|
arrow: true,
|
|
@@ -3247,9 +3279,9 @@ function InfoSign(props) {
|
|
|
3247
3279
|
maxWidth: "320px"
|
|
3248
3280
|
}
|
|
3249
3281
|
},
|
|
3250
|
-
title: message?.split("\n").map((line, i) => /* @__PURE__ */
|
|
3282
|
+
title: message?.split("\n").map((line, i) => /* @__PURE__ */ React22.createElement("div", { key: `info-sign-${i}` }, line))
|
|
3251
3283
|
},
|
|
3252
|
-
/* @__PURE__ */
|
|
3284
|
+
/* @__PURE__ */ React22.createElement(InfoIcon, null)
|
|
3253
3285
|
);
|
|
3254
3286
|
}
|
|
3255
3287
|
|
|
@@ -3263,7 +3295,7 @@ var TextEllipsis = ({
|
|
|
3263
3295
|
...rest
|
|
3264
3296
|
}) => {
|
|
3265
3297
|
const textRef = useRef5(null);
|
|
3266
|
-
const [showTooltip, setShowTooltip] =
|
|
3298
|
+
const [showTooltip, setShowTooltip] = useState9(false);
|
|
3267
3299
|
useLayoutEffect(() => {
|
|
3268
3300
|
const element = textRef.current;
|
|
3269
3301
|
if (!element) return;
|
|
@@ -3276,11 +3308,11 @@ var TextEllipsis = ({
|
|
|
3276
3308
|
ro.observe(element);
|
|
3277
3309
|
return () => ro.disconnect();
|
|
3278
3310
|
}, [children, lineClamp]);
|
|
3279
|
-
return /* @__PURE__ */
|
|
3311
|
+
return /* @__PURE__ */ React23.createElement(Tooltip_default, { title: showTooltip ? children : "", placement: "top" }, /* @__PURE__ */ React23.createElement(EllipsisDiv, { ref: textRef, lineClamp, ...rest }, children));
|
|
3280
3312
|
};
|
|
3281
3313
|
var CellTextEllipsis = ({ children }) => {
|
|
3282
3314
|
const textRef = useRef5(null);
|
|
3283
|
-
const [showTooltip, setShowTooltip] =
|
|
3315
|
+
const [showTooltip, setShowTooltip] = useState9(false);
|
|
3284
3316
|
useLayoutEffect(() => {
|
|
3285
3317
|
const element = textRef.current;
|
|
3286
3318
|
if (element) {
|
|
@@ -3288,9 +3320,9 @@ var CellTextEllipsis = ({ children }) => {
|
|
|
3288
3320
|
setShowTooltip(isTextTruncated);
|
|
3289
3321
|
}
|
|
3290
3322
|
}, [children]);
|
|
3291
|
-
const content = /* @__PURE__ */
|
|
3323
|
+
const content = /* @__PURE__ */ React23.createElement(EllipsisDiv, { ref: textRef }, children);
|
|
3292
3324
|
if (showTooltip) {
|
|
3293
|
-
return /* @__PURE__ */
|
|
3325
|
+
return /* @__PURE__ */ React23.createElement(
|
|
3294
3326
|
Tooltip_default,
|
|
3295
3327
|
{
|
|
3296
3328
|
title: children,
|
|
@@ -3338,14 +3370,14 @@ var HeadCell = (props) => {
|
|
|
3338
3370
|
useLayoutEffect(() => {
|
|
3339
3371
|
ref.current = localRef.current;
|
|
3340
3372
|
}, [ref]);
|
|
3341
|
-
const [isHovered, setIsHovered] =
|
|
3373
|
+
const [isHovered, setIsHovered] = useState9(false);
|
|
3342
3374
|
const sortable = type === "actions" ? false : _sortable;
|
|
3343
|
-
const headId =
|
|
3375
|
+
const headId = useMemo9(
|
|
3344
3376
|
() => `${tableId}_header_${headerName ?? field}`.trim(),
|
|
3345
3377
|
[tableId, headerName, field]
|
|
3346
3378
|
);
|
|
3347
3379
|
const isResizingRef = useRef5(false);
|
|
3348
|
-
const resizer =
|
|
3380
|
+
const resizer = useMemo9(
|
|
3349
3381
|
() => resizable ?? true ? Resizer(
|
|
3350
3382
|
ref,
|
|
3351
3383
|
colRef,
|
|
@@ -3356,7 +3388,7 @@ var HeadCell = (props) => {
|
|
|
3356
3388
|
) : null,
|
|
3357
3389
|
[resizable, ref, colRef, onAutoFit, field]
|
|
3358
3390
|
);
|
|
3359
|
-
const style =
|
|
3391
|
+
const style = useMemo9(
|
|
3360
3392
|
() => ({
|
|
3361
3393
|
width,
|
|
3362
3394
|
minWidth: minWidth ?? "50px",
|
|
@@ -3374,10 +3406,10 @@ var HeadCell = (props) => {
|
|
|
3374
3406
|
);
|
|
3375
3407
|
const textAlign = getTextAlign(props);
|
|
3376
3408
|
const initialSort = sortOrder[0];
|
|
3377
|
-
const sortIcon =
|
|
3409
|
+
const sortIcon = useMemo9(() => {
|
|
3378
3410
|
const isSorted = !!sort;
|
|
3379
3411
|
const isVisible = sortable && (isSorted || isHovered);
|
|
3380
|
-
return /* @__PURE__ */
|
|
3412
|
+
return /* @__PURE__ */ React23.createElement(AnimatePresence2, { mode: "wait" }, isVisible && /* @__PURE__ */ React23.createElement(
|
|
3381
3413
|
MotionSortIcon,
|
|
3382
3414
|
{
|
|
3383
3415
|
key: "sort-icon",
|
|
@@ -3405,21 +3437,21 @@ var HeadCell = (props) => {
|
|
|
3405
3437
|
}
|
|
3406
3438
|
));
|
|
3407
3439
|
}, [headId, initialSort, sort, sortable, isHovered]);
|
|
3408
|
-
const infoSign =
|
|
3409
|
-
() => description ? /* @__PURE__ */
|
|
3440
|
+
const infoSign = useMemo9(
|
|
3441
|
+
() => description ? /* @__PURE__ */ React23.createElement(InfoSign_default, { message: description, placement: "bottom" }) : null,
|
|
3410
3442
|
[description]
|
|
3411
3443
|
);
|
|
3412
|
-
const params =
|
|
3444
|
+
const params = useMemo9(
|
|
3413
3445
|
() => ({
|
|
3414
3446
|
field
|
|
3415
3447
|
}),
|
|
3416
3448
|
[field]
|
|
3417
3449
|
);
|
|
3418
|
-
const computedHeaderClassName =
|
|
3450
|
+
const computedHeaderClassName = useMemo9(
|
|
3419
3451
|
() => (typeof headerClassName === "function" ? headerClassName(params) : headerClassName) || void 0,
|
|
3420
3452
|
[headerClassName, params]
|
|
3421
3453
|
);
|
|
3422
|
-
return /* @__PURE__ */
|
|
3454
|
+
return /* @__PURE__ */ React23.createElement(
|
|
3423
3455
|
StyledTh,
|
|
3424
3456
|
{
|
|
3425
3457
|
id: headId,
|
|
@@ -3428,7 +3460,7 @@ var HeadCell = (props) => {
|
|
|
3428
3460
|
ref: localRef,
|
|
3429
3461
|
key: field,
|
|
3430
3462
|
style,
|
|
3431
|
-
onClick:
|
|
3463
|
+
onClick: useCallback10(
|
|
3432
3464
|
(e) => {
|
|
3433
3465
|
if (isResizingRef.current) return;
|
|
3434
3466
|
if (!(e.target instanceof Element) || !e.currentTarget.contains(e.target)) return;
|
|
@@ -3442,7 +3474,7 @@ var HeadCell = (props) => {
|
|
|
3442
3474
|
initial: "initial",
|
|
3443
3475
|
className: computedHeaderClassName
|
|
3444
3476
|
},
|
|
3445
|
-
/* @__PURE__ */
|
|
3477
|
+
/* @__PURE__ */ React23.createElement(Stack_default, { gap: 1, direction: "row", justifyContent: textAlign, alignItems: "center", sx: { minWidth: 0 } }, textAlign === "end" && sortIcon, textAlign === "end" && infoSign, /* @__PURE__ */ React23.createElement(TextEllipsis, { lineClamp: headerLineClamp, "data-slot": "header-text" }, headerName ?? field, editMode && required && /* @__PURE__ */ React23.createElement(Asterisk, null, "*")), textAlign === "start" && infoSign, textAlign === "start" && sortIcon),
|
|
3446
3478
|
resizer
|
|
3447
3479
|
);
|
|
3448
3480
|
};
|
|
@@ -3467,9 +3499,9 @@ var BodyCell = (props) => {
|
|
|
3467
3499
|
onCellEditStop
|
|
3468
3500
|
} = props;
|
|
3469
3501
|
const theme = useTheme();
|
|
3470
|
-
const [value, setValue] =
|
|
3502
|
+
const [value, setValue] = useState9(row[field]);
|
|
3471
3503
|
const cellRef = useRef5(null);
|
|
3472
|
-
const params =
|
|
3504
|
+
const params = useMemo9(
|
|
3473
3505
|
() => ({
|
|
3474
3506
|
row,
|
|
3475
3507
|
value,
|
|
@@ -3478,20 +3510,20 @@ var BodyCell = (props) => {
|
|
|
3478
3510
|
}),
|
|
3479
3511
|
[row, rowId, value, field]
|
|
3480
3512
|
);
|
|
3481
|
-
const editMode =
|
|
3513
|
+
const editMode = useMemo9(
|
|
3482
3514
|
() => !!(props.editMode && (typeof isCellEditable === "function" ? isCellEditable(params) : isCellEditable ?? true)),
|
|
3483
3515
|
[props.editMode, isCellEditable, params]
|
|
3484
3516
|
);
|
|
3485
3517
|
const propsComponentProps = "componentProps" in props ? props.componentProps : null;
|
|
3486
3518
|
const hasComponentProps = "componentProps" in props;
|
|
3487
|
-
const componentProps =
|
|
3519
|
+
const componentProps = useMemo9(
|
|
3488
3520
|
() => ({
|
|
3489
3521
|
...hasComponentProps && (typeof propsComponentProps === "function" ? propsComponentProps(params) : propsComponentProps || {}),
|
|
3490
3522
|
size: "sm"
|
|
3491
3523
|
}),
|
|
3492
3524
|
[hasComponentProps, propsComponentProps, params]
|
|
3493
3525
|
);
|
|
3494
|
-
const editModeComponentProps =
|
|
3526
|
+
const editModeComponentProps = useMemo9(
|
|
3495
3527
|
() => ({
|
|
3496
3528
|
...componentProps,
|
|
3497
3529
|
onChange: (e) => {
|
|
@@ -3553,25 +3585,25 @@ var BodyCell = (props) => {
|
|
|
3553
3585
|
}),
|
|
3554
3586
|
[params, row, field, value, componentProps, type, onCellEditStop, onCellEditStart]
|
|
3555
3587
|
);
|
|
3556
|
-
const MemoizedRenderEditCell =
|
|
3557
|
-
const MemoizedRenderCell =
|
|
3558
|
-
const EditModeComponent =
|
|
3588
|
+
const MemoizedRenderEditCell = useMemo9(() => renderEditCell ? memo(renderEditCell) : null, [renderEditCell]);
|
|
3589
|
+
const MemoizedRenderCell = useMemo9(() => renderCell ? memo(renderCell) : null, [renderCell]);
|
|
3590
|
+
const EditModeComponent = useMemo9(() => {
|
|
3559
3591
|
if (MemoizedRenderEditCell) {
|
|
3560
3592
|
return createElement(MemoizedRenderEditCell, params);
|
|
3561
3593
|
}
|
|
3562
3594
|
return {
|
|
3563
|
-
date: /* @__PURE__ */
|
|
3564
|
-
currency: /* @__PURE__ */
|
|
3595
|
+
date: /* @__PURE__ */ React23.createElement(DatePicker_default, { value, ...editModeComponentProps }),
|
|
3596
|
+
currency: /* @__PURE__ */ React23.createElement(
|
|
3565
3597
|
CurrencyInput_default,
|
|
3566
3598
|
{
|
|
3567
3599
|
value,
|
|
3568
3600
|
...editModeComponentProps
|
|
3569
3601
|
}
|
|
3570
3602
|
),
|
|
3571
|
-
number: /* @__PURE__ */
|
|
3572
|
-
text: /* @__PURE__ */
|
|
3573
|
-
longText: /* @__PURE__ */
|
|
3574
|
-
autocomplete: /* @__PURE__ */
|
|
3603
|
+
number: /* @__PURE__ */ React23.createElement(Input_default, { value, type: "number", ...editModeComponentProps }),
|
|
3604
|
+
text: /* @__PURE__ */ React23.createElement(Input_default, { value, type: "text", ...editModeComponentProps }),
|
|
3605
|
+
longText: /* @__PURE__ */ React23.createElement(Textarea_default, { value, ...editModeComponentProps }),
|
|
3606
|
+
autocomplete: /* @__PURE__ */ React23.createElement(
|
|
3575
3607
|
Autocomplete_default,
|
|
3576
3608
|
{
|
|
3577
3609
|
value,
|
|
@@ -3579,7 +3611,7 @@ var BodyCell = (props) => {
|
|
|
3579
3611
|
...editModeComponentProps
|
|
3580
3612
|
}
|
|
3581
3613
|
),
|
|
3582
|
-
select: /* @__PURE__ */
|
|
3614
|
+
select: /* @__PURE__ */ React23.createElement(
|
|
3583
3615
|
Select_default,
|
|
3584
3616
|
{
|
|
3585
3617
|
value,
|
|
@@ -3590,13 +3622,13 @@ var BodyCell = (props) => {
|
|
|
3590
3622
|
}[type || "text"];
|
|
3591
3623
|
}, [value, editModeComponentProps, type, MemoizedRenderEditCell, params]);
|
|
3592
3624
|
const linkComponentFromProps = props.component;
|
|
3593
|
-
const ReadModeComponent =
|
|
3625
|
+
const ReadModeComponent = useMemo9(() => {
|
|
3594
3626
|
if (MemoizedRenderCell) {
|
|
3595
3627
|
return createElement(MemoizedRenderCell, params);
|
|
3596
3628
|
}
|
|
3597
3629
|
const innerText = value;
|
|
3598
3630
|
const typedComponent = {
|
|
3599
|
-
link:
|
|
3631
|
+
link: React23.createElement(linkComponentFromProps || Link, {
|
|
3600
3632
|
children: innerText,
|
|
3601
3633
|
...componentProps
|
|
3602
3634
|
})
|
|
@@ -3604,22 +3636,22 @@ var BodyCell = (props) => {
|
|
|
3604
3636
|
return typedComponent || innerText;
|
|
3605
3637
|
}, [value, MemoizedRenderCell, params, type, componentProps, linkComponentFromProps]);
|
|
3606
3638
|
const getActions = props.getActions;
|
|
3607
|
-
const CellComponent =
|
|
3639
|
+
const CellComponent = useMemo9(() => {
|
|
3608
3640
|
if (type === "actions") {
|
|
3609
|
-
return /* @__PURE__ */
|
|
3641
|
+
return /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", gap: 1, justifyContent: "center", alignItems: "center" }, getActions?.(params));
|
|
3610
3642
|
}
|
|
3611
3643
|
return editMode && EditModeComponent ? EditModeComponent : ReadModeComponent;
|
|
3612
3644
|
}, [type, getActions, params, editMode, EditModeComponent, ReadModeComponent]);
|
|
3613
|
-
const showTooltip =
|
|
3645
|
+
const showTooltip = useMemo9(() => noWrap && type === "longText", [noWrap, type]);
|
|
3614
3646
|
const isBoundary = props.isLastStartPinnedColumn || props.isLastEndPinnedColumn;
|
|
3615
|
-
const computedCellClassName =
|
|
3647
|
+
const computedCellClassName = useMemo9(
|
|
3616
3648
|
() => (typeof cellClassName === "function" ? cellClassName(params) : cellClassName) || "",
|
|
3617
3649
|
[cellClassName, params]
|
|
3618
3650
|
);
|
|
3619
3651
|
useEffect5(() => {
|
|
3620
3652
|
setValue(row[field]);
|
|
3621
3653
|
}, [row, field]);
|
|
3622
|
-
return /* @__PURE__ */
|
|
3654
|
+
return /* @__PURE__ */ React23.createElement(
|
|
3623
3655
|
StyledTd,
|
|
3624
3656
|
{
|
|
3625
3657
|
ref: cellRef,
|
|
@@ -3636,8 +3668,8 @@ var BodyCell = (props) => {
|
|
|
3636
3668
|
},
|
|
3637
3669
|
className: [isLastStartPinnedColumn && "is-last-left", isLastEndPinnedColumn && "is-last-right", computedCellClassName].filter(Boolean).join(" ") || ""
|
|
3638
3670
|
},
|
|
3639
|
-
|
|
3640
|
-
() => showTooltip ? /* @__PURE__ */
|
|
3671
|
+
useMemo9(
|
|
3672
|
+
() => showTooltip ? /* @__PURE__ */ React23.createElement(CellTextEllipsis, null, CellComponent) : CellComponent,
|
|
3641
3673
|
[CellComponent, showTooltip]
|
|
3642
3674
|
)
|
|
3643
3675
|
);
|
|
@@ -3645,7 +3677,7 @@ var BodyCell = (props) => {
|
|
|
3645
3677
|
var BodyRow = memo(
|
|
3646
3678
|
(props) => {
|
|
3647
3679
|
const { tableId, columns, rowId, editMode, noWrap, row } = props;
|
|
3648
|
-
return /* @__PURE__ */
|
|
3680
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, columns.map((column, i) => /* @__PURE__ */ React23.createElement(
|
|
3649
3681
|
BodyCell,
|
|
3650
3682
|
{
|
|
3651
3683
|
key: `${rowId}_${column.field.toString()}_${i}`,
|
|
@@ -3689,9 +3721,9 @@ var VirtualizedTableRow = memo(StyledTableRow2, (prevProps, nextProps) => {
|
|
|
3689
3721
|
});
|
|
3690
3722
|
|
|
3691
3723
|
// src/components/DataTable/hooks.ts
|
|
3692
|
-
import { useState as
|
|
3724
|
+
import { useState as useState10, useLayoutEffect as useLayoutEffect2, useRef as useRef6, useMemo as useMemo10, useCallback as useCallback11, useEffect as useEffect6, createRef } from "react";
|
|
3693
3725
|
function useColumnWidths(columnsByField) {
|
|
3694
|
-
const [widths, setWidths] =
|
|
3726
|
+
const [widths, setWidths] = useState10({});
|
|
3695
3727
|
const roRef = useRef6();
|
|
3696
3728
|
useLayoutEffect2(() => {
|
|
3697
3729
|
if (roRef.current) roRef.current.disconnect();
|
|
@@ -3752,31 +3784,31 @@ function useDataTableRenderer({
|
|
|
3752
3784
|
}
|
|
3753
3785
|
const onSelectionModelChangeRef = useRef6(onSelectionModelChange);
|
|
3754
3786
|
onSelectionModelChangeRef.current = onSelectionModelChange;
|
|
3755
|
-
const [focusedRowId, setFocusedRowId] =
|
|
3756
|
-
const [selectionAnchor, setSelectionAnchor] =
|
|
3787
|
+
const [focusedRowId, setFocusedRowId] = useState10(null);
|
|
3788
|
+
const [selectionAnchor, setSelectionAnchor] = useState10(null);
|
|
3757
3789
|
const [sortModel, setSortModel] = useControlledState(
|
|
3758
3790
|
controlledSortModel,
|
|
3759
3791
|
initialState?.sorting?.sortModel ?? [],
|
|
3760
|
-
|
|
3792
|
+
useCallback11((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3761
3793
|
);
|
|
3762
3794
|
const [visibilityModel] = useControlledState(
|
|
3763
3795
|
columnVisibilityModel,
|
|
3764
3796
|
initialState?.columns?.columnVisibilityModel ?? {},
|
|
3765
|
-
|
|
3797
|
+
useCallback11(
|
|
3766
3798
|
(model) => onColumnVisibilityModelChange?.(model),
|
|
3767
3799
|
[onColumnVisibilityModelChange]
|
|
3768
3800
|
)
|
|
3769
3801
|
);
|
|
3770
|
-
const reorderedColumns =
|
|
3802
|
+
const reorderedColumns = useMemo10(() => {
|
|
3771
3803
|
if (!columnGroupingModel) return columnsProp;
|
|
3772
3804
|
return reorderColumnsByGroupingModel(columnsProp, columnGroupingModel);
|
|
3773
3805
|
}, [columnsProp, columnGroupingModel]);
|
|
3774
|
-
const visibleColumns =
|
|
3806
|
+
const visibleColumns = useMemo10(
|
|
3775
3807
|
() => reorderedColumns.filter((col) => visibilityModel[col.field] !== false),
|
|
3776
3808
|
[reorderedColumns, visibilityModel]
|
|
3777
3809
|
);
|
|
3778
|
-
const visibleFieldSet =
|
|
3779
|
-
const tableMinWidth =
|
|
3810
|
+
const visibleFieldSet = useMemo10(() => new Set(visibleColumns.map((c) => c.field)), [visibleColumns]);
|
|
3811
|
+
const tableMinWidth = useMemo10(() => {
|
|
3780
3812
|
const DEFAULT_MIN = 50;
|
|
3781
3813
|
let total = checkboxSelection ? 40 : 0;
|
|
3782
3814
|
for (const col of visibleColumns) {
|
|
@@ -3784,7 +3816,7 @@ function useDataTableRenderer({
|
|
|
3784
3816
|
}
|
|
3785
3817
|
return total;
|
|
3786
3818
|
}, [visibleColumns, checkboxSelection]);
|
|
3787
|
-
const allColumnsByField =
|
|
3819
|
+
const allColumnsByField = useMemo10(
|
|
3788
3820
|
() => reorderedColumns.reduce(
|
|
3789
3821
|
(acc, curr) => ({
|
|
3790
3822
|
...acc,
|
|
@@ -3794,7 +3826,7 @@ function useDataTableRenderer({
|
|
|
3794
3826
|
),
|
|
3795
3827
|
[reorderedColumns]
|
|
3796
3828
|
);
|
|
3797
|
-
const visibleColumnsByField =
|
|
3829
|
+
const visibleColumnsByField = useMemo10(
|
|
3798
3830
|
() => visibleColumns.reduce(
|
|
3799
3831
|
(acc, curr) => ({
|
|
3800
3832
|
...acc,
|
|
@@ -3808,7 +3840,7 @@ function useDataTableRenderer({
|
|
|
3808
3840
|
),
|
|
3809
3841
|
[visibleColumns]
|
|
3810
3842
|
);
|
|
3811
|
-
const sortComparator =
|
|
3843
|
+
const sortComparator = useCallback11(
|
|
3812
3844
|
(rowA, rowB) => {
|
|
3813
3845
|
for (const sort of sortModel) {
|
|
3814
3846
|
const { field, sort: direction } = sort;
|
|
@@ -3837,33 +3869,33 @@ function useDataTableRenderer({
|
|
|
3837
3869
|
},
|
|
3838
3870
|
[sortModel, allColumnsByField]
|
|
3839
3871
|
);
|
|
3840
|
-
const rows =
|
|
3872
|
+
const rows = useMemo10(
|
|
3841
3873
|
() => sortModel.length ? [..._rows].sort(sortComparator) : _rows,
|
|
3842
3874
|
[_rows, sortModel, sortComparator]
|
|
3843
3875
|
);
|
|
3844
|
-
const sortOrder =
|
|
3876
|
+
const sortOrder = useMemo10(
|
|
3845
3877
|
() => Array.from(new Set(_sortOrder || ["asc", "desc", null])),
|
|
3846
3878
|
[_sortOrder]
|
|
3847
3879
|
);
|
|
3848
|
-
const [page, setPage] =
|
|
3880
|
+
const [page, setPage] = useState10(paginationModel?.page || 1);
|
|
3849
3881
|
const pageSize = paginationModel?.pageSize || 20;
|
|
3850
|
-
const getId =
|
|
3882
|
+
const getId = useCallback11(
|
|
3851
3883
|
(row, index) => _getId?.(row) ?? row.id ?? `${(index || 0) + (page - 1) * pageSize}`,
|
|
3852
3884
|
[_getId, page, pageSize]
|
|
3853
3885
|
);
|
|
3854
|
-
const selectedModelSet =
|
|
3855
|
-
const dataInPage =
|
|
3886
|
+
const selectedModelSet = useMemo10(() => new Set(selectionModel || []), [selectionModel]);
|
|
3887
|
+
const dataInPage = useMemo10(
|
|
3856
3888
|
() => !pagination || paginationMode === "server" ? rows : rows.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize),
|
|
3857
3889
|
[rows, page, pageSize, paginationMode, pagination]
|
|
3858
3890
|
);
|
|
3859
|
-
const selectableDataInPage =
|
|
3891
|
+
const selectableDataInPage = useMemo10(
|
|
3860
3892
|
() => dataInPage.filter((row, i) => {
|
|
3861
3893
|
if (!isRowSelectable) return true;
|
|
3862
3894
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
3863
3895
|
}),
|
|
3864
3896
|
[dataInPage, isRowSelectable, getId]
|
|
3865
3897
|
);
|
|
3866
|
-
const handleRangeSelection =
|
|
3898
|
+
const handleRangeSelection = useCallback11(
|
|
3867
3899
|
(anchor, targetIndex) => {
|
|
3868
3900
|
const startIndex = Math.min(anchor.rowIndex, targetIndex);
|
|
3869
3901
|
const endIndex = Math.max(anchor.rowIndex, targetIndex);
|
|
@@ -3886,38 +3918,38 @@ function useDataTableRenderer({
|
|
|
3886
3918
|
},
|
|
3887
3919
|
[dataInPage, getId, isRowSelectable, selectionModel, onSelectionModelChange]
|
|
3888
3920
|
);
|
|
3889
|
-
const isAllSelected =
|
|
3921
|
+
const isAllSelected = useMemo10(
|
|
3890
3922
|
() => selectableDataInPage.length > 0 && selectableDataInPage.every((row, i) => selectedModelSet.has(getId(row, i))),
|
|
3891
3923
|
[selectableDataInPage, selectedModelSet, getId]
|
|
3892
3924
|
);
|
|
3893
3925
|
const rowCount = totalRowsProp || rows.length;
|
|
3894
|
-
const selectableRowCount =
|
|
3926
|
+
const selectableRowCount = useMemo10(() => {
|
|
3895
3927
|
if (!isRowSelectable) return rowCount;
|
|
3896
3928
|
return rows.filter((row, i) => isRowSelectable({ row, id: getId(row, i) })).length;
|
|
3897
3929
|
}, [rows, isRowSelectable, getId, rowCount]);
|
|
3898
|
-
const isTotalSelected =
|
|
3930
|
+
const isTotalSelected = useMemo10(
|
|
3899
3931
|
() => _isTotalSelected ?? (selectableRowCount > 0 && (selectionModel?.length || 0) === selectableRowCount),
|
|
3900
3932
|
[_isTotalSelected, selectionModel, selectableRowCount]
|
|
3901
3933
|
);
|
|
3902
3934
|
const columnWidths = useColumnWidths(visibleColumnsByField);
|
|
3903
|
-
const getWidth =
|
|
3935
|
+
const getWidth = useCallback11(
|
|
3904
3936
|
(f) => columnWidths[f] ?? allColumnsByField[f]?.width ?? // Column prop 으로 지정된 width
|
|
3905
3937
|
allColumnsByField[f]?.minWidth ?? 0,
|
|
3906
3938
|
[columnWidths, allColumnsByField]
|
|
3907
3939
|
);
|
|
3908
|
-
const processedColumnGroups =
|
|
3940
|
+
const processedColumnGroups = useMemo10(() => {
|
|
3909
3941
|
if (!columnGroupingModel) return null;
|
|
3910
3942
|
return calculateColumnGroups(columnGroupingModel, visibleColumns, visibleFieldSet);
|
|
3911
3943
|
}, [columnGroupingModel, visibleColumns, visibleFieldSet]);
|
|
3912
|
-
const effectivePinnedLeft =
|
|
3944
|
+
const effectivePinnedLeft = useMemo10(
|
|
3913
3945
|
() => pinnedColumns?.left?.filter((f) => visibleFieldSet.has(f)),
|
|
3914
3946
|
[pinnedColumns?.left, visibleFieldSet]
|
|
3915
3947
|
);
|
|
3916
|
-
const effectivePinnedRight =
|
|
3948
|
+
const effectivePinnedRight = useMemo10(
|
|
3917
3949
|
() => pinnedColumns?.right?.filter((f) => visibleFieldSet.has(f)),
|
|
3918
3950
|
[pinnedColumns?.right, visibleFieldSet]
|
|
3919
3951
|
);
|
|
3920
|
-
const columns =
|
|
3952
|
+
const columns = useMemo10(() => {
|
|
3921
3953
|
const baseColumns = visibleColumns.length > 0 ? visibleColumns : reorderedColumns.length > 0 ? [] : Object.keys(rows[0] || {}).map((key) => ({
|
|
3922
3954
|
field: key
|
|
3923
3955
|
}));
|
|
@@ -3952,14 +3984,14 @@ function useDataTableRenderer({
|
|
|
3952
3984
|
sortOrder,
|
|
3953
3985
|
getWidth
|
|
3954
3986
|
]);
|
|
3955
|
-
const handlePageChange =
|
|
3987
|
+
const handlePageChange = useCallback11(
|
|
3956
3988
|
(newPage) => {
|
|
3957
3989
|
setPage(newPage);
|
|
3958
3990
|
onPaginationModelChange?.({ page: newPage, pageSize });
|
|
3959
3991
|
},
|
|
3960
3992
|
[onPaginationModelChange, pageSize]
|
|
3961
3993
|
);
|
|
3962
|
-
const handleSortChange =
|
|
3994
|
+
const handleSortChange = useCallback11(
|
|
3963
3995
|
(props) => {
|
|
3964
3996
|
const { field, currentSort, multiple } = props;
|
|
3965
3997
|
const column = allColumnsByField[field];
|
|
@@ -4004,7 +4036,7 @@ function useDataTableRenderer({
|
|
|
4004
4036
|
prevRowsRef.current = _rows;
|
|
4005
4037
|
}
|
|
4006
4038
|
}, [_rows]);
|
|
4007
|
-
const handleAutoFit =
|
|
4039
|
+
const handleAutoFit = useCallback11(
|
|
4008
4040
|
(field) => {
|
|
4009
4041
|
const colDef = visibleColumnsByField[field];
|
|
4010
4042
|
if (!colDef?.headerRef.current) return;
|
|
@@ -4037,8 +4069,8 @@ function useDataTableRenderer({
|
|
|
4037
4069
|
handleAutoFit,
|
|
4038
4070
|
isAllSelected,
|
|
4039
4071
|
isTotalSelected,
|
|
4040
|
-
isSelectedRow:
|
|
4041
|
-
isRowSelectable:
|
|
4072
|
+
isSelectedRow: useCallback11((model) => selectedModelSet.has(model), [selectedModelSet]),
|
|
4073
|
+
isRowSelectable: useCallback11(
|
|
4042
4074
|
(rowId, row) => {
|
|
4043
4075
|
if (!isRowSelectable) return true;
|
|
4044
4076
|
return isRowSelectable({ row, id: rowId });
|
|
@@ -4046,13 +4078,13 @@ function useDataTableRenderer({
|
|
|
4046
4078
|
[isRowSelectable]
|
|
4047
4079
|
),
|
|
4048
4080
|
focusedRowId,
|
|
4049
|
-
onRowFocus:
|
|
4081
|
+
onRowFocus: useCallback11((rowId) => {
|
|
4050
4082
|
setFocusedRowId(rowId);
|
|
4051
4083
|
}, []),
|
|
4052
|
-
onAllCheckboxChange:
|
|
4084
|
+
onAllCheckboxChange: useCallback11(() => {
|
|
4053
4085
|
onSelectionModelChange?.(isAllSelected ? [] : selectableDataInPage.map(getId));
|
|
4054
4086
|
}, [isAllSelected, selectableDataInPage, onSelectionModelChange, getId]),
|
|
4055
|
-
onCheckboxChange:
|
|
4087
|
+
onCheckboxChange: useCallback11(
|
|
4056
4088
|
(event, selectedModel) => {
|
|
4057
4089
|
const isShiftClick = "shiftKey" in event && event.shiftKey;
|
|
4058
4090
|
const rowIndex = dataInPage.findIndex((row, i) => getId(row, i) === selectedModel);
|
|
@@ -4086,7 +4118,7 @@ function useDataTableRenderer({
|
|
|
4086
4118
|
columns,
|
|
4087
4119
|
tableMinWidth,
|
|
4088
4120
|
processedColumnGroups,
|
|
4089
|
-
onTotalSelect:
|
|
4121
|
+
onTotalSelect: useCallback11(() => {
|
|
4090
4122
|
const selectableRows = rows.filter((row, i) => {
|
|
4091
4123
|
if (!isRowSelectable) return true;
|
|
4092
4124
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
@@ -4100,11 +4132,11 @@ function useDataTableRenderer({
|
|
|
4100
4132
|
}
|
|
4101
4133
|
|
|
4102
4134
|
// src/components/Table/Table.tsx
|
|
4103
|
-
import
|
|
4135
|
+
import React24 from "react";
|
|
4104
4136
|
import { Table as JoyTable } from "@mui/joy";
|
|
4105
4137
|
var Table = (props) => {
|
|
4106
4138
|
const { children, ...inheritProps } = props;
|
|
4107
|
-
return /* @__PURE__ */
|
|
4139
|
+
return /* @__PURE__ */ React24.createElement(JoyTable, { ...inheritProps }, children);
|
|
4108
4140
|
};
|
|
4109
4141
|
Table.displayName = "Table";
|
|
4110
4142
|
function TableHead(props) {
|
|
@@ -4115,7 +4147,7 @@ function TableHead(props) {
|
|
|
4115
4147
|
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
4116
4148
|
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
4117
4149
|
} = props;
|
|
4118
|
-
return /* @__PURE__ */
|
|
4150
|
+
return /* @__PURE__ */ React24.createElement("thead", null, /* @__PURE__ */ React24.createElement("tr", null, showCheckbox && /* @__PURE__ */ React24.createElement(
|
|
4119
4151
|
"th",
|
|
4120
4152
|
{
|
|
4121
4153
|
style: {
|
|
@@ -4123,8 +4155,8 @@ function TableHead(props) {
|
|
|
4123
4155
|
textAlign: "center"
|
|
4124
4156
|
}
|
|
4125
4157
|
},
|
|
4126
|
-
/* @__PURE__ */
|
|
4127
|
-
), headCells.map((headCell) => /* @__PURE__ */
|
|
4158
|
+
/* @__PURE__ */ React24.createElement(RenderCheckbox, { onChange: onCheckboxChange, ...checkboxProps })
|
|
4159
|
+
), headCells.map((headCell) => /* @__PURE__ */ React24.createElement(
|
|
4128
4160
|
"th",
|
|
4129
4161
|
{
|
|
4130
4162
|
key: headCell.label,
|
|
@@ -4149,15 +4181,15 @@ function TableBody(props) {
|
|
|
4149
4181
|
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
4150
4182
|
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
4151
4183
|
} = props;
|
|
4152
|
-
return /* @__PURE__ */
|
|
4184
|
+
return /* @__PURE__ */ React24.createElement("tbody", null, rows.map((row, rowIndex) => /* @__PURE__ */ React24.createElement("tr", { key: `table-row-${rowIndex}` }, showCheckbox && /* @__PURE__ */ React24.createElement(
|
|
4153
4185
|
"td",
|
|
4154
4186
|
{
|
|
4155
4187
|
style: {
|
|
4156
4188
|
textAlign: "center"
|
|
4157
4189
|
}
|
|
4158
4190
|
},
|
|
4159
|
-
/* @__PURE__ */
|
|
4160
|
-
), cellOrder.map((cellKey) => /* @__PURE__ */
|
|
4191
|
+
/* @__PURE__ */ React24.createElement(RenderCheckbox, { onChange: (event) => onCheckboxChange?.(event, rowIndex), ...checkboxProps })
|
|
4192
|
+
), cellOrder.map((cellKey) => /* @__PURE__ */ React24.createElement(
|
|
4161
4193
|
"td",
|
|
4162
4194
|
{
|
|
4163
4195
|
key: cellKey,
|
|
@@ -4171,7 +4203,7 @@ function TableBody(props) {
|
|
|
4171
4203
|
TableBody.displayName = "TableBody";
|
|
4172
4204
|
|
|
4173
4205
|
// src/components/Pagination/Pagination.tsx
|
|
4174
|
-
import
|
|
4206
|
+
import React25, { useCallback as useCallback12, useEffect as useEffect7 } from "react";
|
|
4175
4207
|
import PreviousIcon from "@mui/icons-material/ChevronLeftRounded";
|
|
4176
4208
|
import NextIcon from "@mui/icons-material/ChevronRightRounded";
|
|
4177
4209
|
import FirstPageIcon from "@mui/icons-material/FirstPageRounded";
|
|
@@ -4240,7 +4272,7 @@ function Pagination(props) {
|
|
|
4240
4272
|
const [paginationModel, setPaginationModel] = useControlledState(
|
|
4241
4273
|
_paginationModel,
|
|
4242
4274
|
defaultPaginationModel,
|
|
4243
|
-
|
|
4275
|
+
useCallback12(
|
|
4244
4276
|
(newPage) => {
|
|
4245
4277
|
onPageChange(newPage.page);
|
|
4246
4278
|
},
|
|
@@ -4266,7 +4298,7 @@ function Pagination(props) {
|
|
|
4266
4298
|
value: `${i + 1}`
|
|
4267
4299
|
}));
|
|
4268
4300
|
if (variant === "compact") {
|
|
4269
|
-
return /* @__PURE__ */
|
|
4301
|
+
return /* @__PURE__ */ React25.createElement(PaginationRoot, { ...innerProps }, /* @__PURE__ */ React25.createElement(PaginationContainer, { direction: "row", size, alignItems: "center" }, /* @__PURE__ */ React25.createElement(Stack_default, { direction: "row" }, /* @__PURE__ */ React25.createElement(
|
|
4270
4302
|
PaginationIconButton,
|
|
4271
4303
|
{
|
|
4272
4304
|
size,
|
|
@@ -4276,8 +4308,8 @@ function Pagination(props) {
|
|
|
4276
4308
|
disabled: paginationModel.page === firstPage,
|
|
4277
4309
|
"aria-label": "First page"
|
|
4278
4310
|
},
|
|
4279
|
-
/* @__PURE__ */
|
|
4280
|
-
), /* @__PURE__ */
|
|
4311
|
+
/* @__PURE__ */ React25.createElement(FirstPageIcon, null)
|
|
4312
|
+
), /* @__PURE__ */ React25.createElement(
|
|
4281
4313
|
PaginationIconButton,
|
|
4282
4314
|
{
|
|
4283
4315
|
size,
|
|
@@ -4287,8 +4319,8 @@ function Pagination(props) {
|
|
|
4287
4319
|
disabled: paginationModel.page === firstPage,
|
|
4288
4320
|
"aria-label": "Previous page"
|
|
4289
4321
|
},
|
|
4290
|
-
/* @__PURE__ */
|
|
4291
|
-
)), /* @__PURE__ */
|
|
4322
|
+
/* @__PURE__ */ React25.createElement(PreviousIcon, null)
|
|
4323
|
+
)), /* @__PURE__ */ React25.createElement(
|
|
4292
4324
|
Autocomplete_default,
|
|
4293
4325
|
{
|
|
4294
4326
|
size,
|
|
@@ -4307,7 +4339,7 @@ function Pagination(props) {
|
|
|
4307
4339
|
}[size]
|
|
4308
4340
|
}
|
|
4309
4341
|
}
|
|
4310
|
-
), /* @__PURE__ */
|
|
4342
|
+
), /* @__PURE__ */ React25.createElement(
|
|
4311
4343
|
Typography_default,
|
|
4312
4344
|
{
|
|
4313
4345
|
level: `body-${size}`,
|
|
@@ -4318,7 +4350,7 @@ function Pagination(props) {
|
|
|
4318
4350
|
},
|
|
4319
4351
|
"/ ",
|
|
4320
4352
|
lastPage
|
|
4321
|
-
), /* @__PURE__ */
|
|
4353
|
+
), /* @__PURE__ */ React25.createElement(Stack_default, { direction: "row" }, /* @__PURE__ */ React25.createElement(
|
|
4322
4354
|
PaginationIconButton,
|
|
4323
4355
|
{
|
|
4324
4356
|
size,
|
|
@@ -4328,8 +4360,8 @@ function Pagination(props) {
|
|
|
4328
4360
|
disabled: paginationModel.page === lastPage,
|
|
4329
4361
|
"aria-label": "Next page"
|
|
4330
4362
|
},
|
|
4331
|
-
/* @__PURE__ */
|
|
4332
|
-
), /* @__PURE__ */
|
|
4363
|
+
/* @__PURE__ */ React25.createElement(NextIcon, null)
|
|
4364
|
+
), /* @__PURE__ */ React25.createElement(
|
|
4333
4365
|
PaginationIconButton,
|
|
4334
4366
|
{
|
|
4335
4367
|
size,
|
|
@@ -4339,10 +4371,10 @@ function Pagination(props) {
|
|
|
4339
4371
|
disabled: paginationModel.page === lastPage,
|
|
4340
4372
|
"aria-label": "Last page"
|
|
4341
4373
|
},
|
|
4342
|
-
/* @__PURE__ */
|
|
4374
|
+
/* @__PURE__ */ React25.createElement(LastPageIcon, null)
|
|
4343
4375
|
))));
|
|
4344
4376
|
}
|
|
4345
|
-
return /* @__PURE__ */
|
|
4377
|
+
return /* @__PURE__ */ React25.createElement(PaginationRoot, { ...innerProps }, /* @__PURE__ */ React25.createElement(PaginationContainer, { direction: "row", size, alignItems: "center" }, /* @__PURE__ */ React25.createElement(
|
|
4346
4378
|
PaginationIconButton,
|
|
4347
4379
|
{
|
|
4348
4380
|
size,
|
|
@@ -4352,8 +4384,8 @@ function Pagination(props) {
|
|
|
4352
4384
|
disabled: paginationModel.page === firstPage,
|
|
4353
4385
|
"aria-label": "Previous page"
|
|
4354
4386
|
},
|
|
4355
|
-
/* @__PURE__ */
|
|
4356
|
-
), paginationModel.page !== firstPage && /* @__PURE__ */
|
|
4387
|
+
/* @__PURE__ */ React25.createElement(PreviousIcon, null)
|
|
4388
|
+
), paginationModel.page !== firstPage && /* @__PURE__ */ React25.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(firstPage) }, firstPage), isMoreBeforePages && /* @__PURE__ */ React25.createElement(
|
|
4357
4389
|
PaginationButton,
|
|
4358
4390
|
{
|
|
4359
4391
|
size,
|
|
@@ -4363,7 +4395,7 @@ function Pagination(props) {
|
|
|
4363
4395
|
"aria-label": "More previous pages"
|
|
4364
4396
|
},
|
|
4365
4397
|
"..."
|
|
4366
|
-
), beforePages.map((p) => /* @__PURE__ */
|
|
4398
|
+
), beforePages.map((p) => /* @__PURE__ */ React25.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), /* @__PURE__ */ React25.createElement(PaginationButton, { active: "active", size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ React25.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), isMoreAfterPages && /* @__PURE__ */ React25.createElement(
|
|
4367
4399
|
PaginationButton,
|
|
4368
4400
|
{
|
|
4369
4401
|
size,
|
|
@@ -4373,7 +4405,7 @@ function Pagination(props) {
|
|
|
4373
4405
|
onClick: () => handlePageChange(paginationModel.page + 3)
|
|
4374
4406
|
},
|
|
4375
4407
|
"..."
|
|
4376
|
-
), paginationModel.page !== lastPage && /* @__PURE__ */
|
|
4408
|
+
), paginationModel.page !== lastPage && /* @__PURE__ */ React25.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(lastPage) }, lastPage), /* @__PURE__ */ React25.createElement(
|
|
4377
4409
|
PaginationIconButton,
|
|
4378
4410
|
{
|
|
4379
4411
|
size,
|
|
@@ -4383,7 +4415,7 @@ function Pagination(props) {
|
|
|
4383
4415
|
disabled: paginationModel.page === lastPage,
|
|
4384
4416
|
"aria-label": "Next page"
|
|
4385
4417
|
},
|
|
4386
|
-
/* @__PURE__ */
|
|
4418
|
+
/* @__PURE__ */ React25.createElement(NextIcon, null)
|
|
4387
4419
|
)));
|
|
4388
4420
|
}
|
|
4389
4421
|
Pagination.displayName = "Pagination";
|
|
@@ -4495,10 +4527,10 @@ function Component(props, apiRef) {
|
|
|
4495
4527
|
measureElement: (element) => element.clientHeight,
|
|
4496
4528
|
overscan: 10
|
|
4497
4529
|
});
|
|
4498
|
-
const paginationModel =
|
|
4530
|
+
const paginationModel = useMemo11(() => ({ page, pageSize }), [page, pageSize]);
|
|
4499
4531
|
const columnsKey = getObjectVersion(columns);
|
|
4500
|
-
const headerCheckboxElement =
|
|
4501
|
-
() => /* @__PURE__ */
|
|
4532
|
+
const headerCheckboxElement = useMemo11(
|
|
4533
|
+
() => /* @__PURE__ */ React26.createElement(
|
|
4502
4534
|
RenderCheckbox,
|
|
4503
4535
|
{
|
|
4504
4536
|
onChange: onAllCheckboxChange,
|
|
@@ -4522,20 +4554,20 @@ function Component(props, apiRef) {
|
|
|
4522
4554
|
const virtualizedItems = virtualizer.getVirtualItems();
|
|
4523
4555
|
const showNoRowsOverlay = !loading && rowCount === 0;
|
|
4524
4556
|
const totalColCount = Math.max(1, columns.length + (checkboxSelection ? 1 : 0));
|
|
4525
|
-
const getRowClickHandler =
|
|
4557
|
+
const getRowClickHandler = useCallback13(
|
|
4526
4558
|
(row, rowId) => (e) => {
|
|
4527
4559
|
onRowClick?.({ row, rowId }, e);
|
|
4528
4560
|
checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
|
|
4529
4561
|
},
|
|
4530
4562
|
[onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
|
|
4531
4563
|
);
|
|
4532
|
-
const getRowFocusHandler =
|
|
4564
|
+
const getRowFocusHandler = useCallback13(
|
|
4533
4565
|
(rowId) => () => {
|
|
4534
4566
|
onRowFocus(rowId);
|
|
4535
4567
|
},
|
|
4536
4568
|
[onRowFocus]
|
|
4537
4569
|
);
|
|
4538
|
-
const getCheckboxClickHandler =
|
|
4570
|
+
const getCheckboxClickHandler = useCallback13(
|
|
4539
4571
|
(rowId, row) => (e) => {
|
|
4540
4572
|
e.stopPropagation();
|
|
4541
4573
|
if (isRowSelectableCheck(rowId, row)) {
|
|
@@ -4545,7 +4577,7 @@ function Component(props, apiRef) {
|
|
|
4545
4577
|
},
|
|
4546
4578
|
[onCheckboxChange, isRowSelectableCheck, onRowFocus]
|
|
4547
4579
|
);
|
|
4548
|
-
const handleTableKeyDown =
|
|
4580
|
+
const handleTableKeyDown = useCallback13(
|
|
4549
4581
|
(e) => {
|
|
4550
4582
|
const supportedKeys = ["ArrowUp", "ArrowDown", " ", "Home", "End", "PageUp", "PageDown"];
|
|
4551
4583
|
if (!supportedKeys.includes(e.key)) return;
|
|
@@ -4651,7 +4683,7 @@ function Component(props, apiRef) {
|
|
|
4651
4683
|
});
|
|
4652
4684
|
}
|
|
4653
4685
|
}));
|
|
4654
|
-
return /* @__PURE__ */
|
|
4686
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4655
4687
|
Box_default,
|
|
4656
4688
|
{
|
|
4657
4689
|
sx: {
|
|
@@ -4661,7 +4693,7 @@ function Component(props, apiRef) {
|
|
|
4661
4693
|
flexDirection: "column"
|
|
4662
4694
|
}
|
|
4663
4695
|
},
|
|
4664
|
-
(!!checkboxSelection || !!Toolbar) && /* @__PURE__ */
|
|
4696
|
+
(!!checkboxSelection || !!Toolbar) && /* @__PURE__ */ React26.createElement(
|
|
4665
4697
|
Stack_default,
|
|
4666
4698
|
{
|
|
4667
4699
|
direction: "row",
|
|
@@ -4671,10 +4703,10 @@ function Component(props, apiRef) {
|
|
|
4671
4703
|
justifyContent: "space-between",
|
|
4672
4704
|
alignItems: "center"
|
|
4673
4705
|
},
|
|
4674
|
-
!!checkboxSelection && /* @__PURE__ */
|
|
4675
|
-
Toolbar && /* @__PURE__ */
|
|
4706
|
+
!!checkboxSelection && /* @__PURE__ */ React26.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ React26.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ React26.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React26.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ React26.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(selectableRowCount), " items")), isTotalSelected && /* @__PURE__ */ React26.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React26.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectableRowCount), " items are selected."), /* @__PURE__ */ React26.createElement(Button_default, { size: "sm", variant: "plain", color: "danger", onClick: onTotalSelect }, "Cancel"))),
|
|
4707
|
+
Toolbar && /* @__PURE__ */ React26.createElement(Toolbar, { ...toolbarProps || {} })
|
|
4676
4708
|
),
|
|
4677
|
-
/* @__PURE__ */
|
|
4709
|
+
/* @__PURE__ */ React26.createElement(
|
|
4678
4710
|
Sheet_default,
|
|
4679
4711
|
{
|
|
4680
4712
|
variant: "outlined",
|
|
@@ -4695,14 +4727,14 @@ function Component(props, apiRef) {
|
|
|
4695
4727
|
ref: parentRef,
|
|
4696
4728
|
...backgroundProps
|
|
4697
4729
|
},
|
|
4698
|
-
/* @__PURE__ */
|
|
4730
|
+
/* @__PURE__ */ React26.createElement(Table, { ...innerProps, sx: { ...innerProps.sx, minWidth: tableMinWidth } }, /* @__PURE__ */ React26.createElement("colgroup", null, checkboxSelection && /* @__PURE__ */ React26.createElement(
|
|
4699
4731
|
"col",
|
|
4700
4732
|
{
|
|
4701
4733
|
style: {
|
|
4702
4734
|
width: "40px"
|
|
4703
4735
|
}
|
|
4704
4736
|
}
|
|
4705
|
-
), columns.map((c) => /* @__PURE__ */
|
|
4737
|
+
), columns.map((c) => /* @__PURE__ */ React26.createElement(
|
|
4706
4738
|
"col",
|
|
4707
4739
|
{
|
|
4708
4740
|
ref: c.tableColRef,
|
|
@@ -4712,7 +4744,7 @@ function Component(props, apiRef) {
|
|
|
4712
4744
|
minWidth: c.minWidth ?? "50px"
|
|
4713
4745
|
}
|
|
4714
4746
|
}
|
|
4715
|
-
))), /* @__PURE__ */
|
|
4747
|
+
))), /* @__PURE__ */ React26.createElement("thead", null, processedColumnGroups && processedColumnGroups.groups.length > 0 && processedColumnGroups.groups.map((levelGroups, level) => /* @__PURE__ */ React26.createElement("tr", { key: `group-level-${level}` }, checkboxSelection && level === 0 && /* @__PURE__ */ React26.createElement(
|
|
4716
4748
|
"th",
|
|
4717
4749
|
{
|
|
4718
4750
|
rowSpan: processedColumnGroups.maxLevel + 2,
|
|
@@ -4723,12 +4755,12 @@ function Component(props, apiRef) {
|
|
|
4723
4755
|
}
|
|
4724
4756
|
},
|
|
4725
4757
|
headerCheckboxElement
|
|
4726
|
-
), level > 0 && Array.from({ length: levelGroups[0]?.startIndex || 0 }).map((_2, i) => /* @__PURE__ */
|
|
4758
|
+
), level > 0 && Array.from({ length: levelGroups[0]?.startIndex || 0 }).map((_2, i) => /* @__PURE__ */ React26.createElement("th", { key: `empty-${level}-${i}` })), levelGroups.filter((g) => g.colspan > 0).map((group, groupIndex) => {
|
|
4727
4759
|
const nextGroup = levelGroups[groupIndex + 1];
|
|
4728
4760
|
const emptyCells = nextGroup ? nextGroup.startIndex - (group.startIndex + group.colspan) : columns.length - (group.startIndex + group.colspan);
|
|
4729
4761
|
const params = { groupId: group.groupId };
|
|
4730
4762
|
const computedHeaderClassName = group.headerClassName ? typeof group.headerClassName === "function" ? group.headerClassName(params) : group.headerClassName : void 0;
|
|
4731
|
-
return /* @__PURE__ */
|
|
4763
|
+
return /* @__PURE__ */ React26.createElement(Fragment2, { key: group.groupId }, /* @__PURE__ */ React26.createElement(
|
|
4732
4764
|
"th",
|
|
4733
4765
|
{
|
|
4734
4766
|
colSpan: group.colspan,
|
|
@@ -4740,8 +4772,8 @@ function Component(props, apiRef) {
|
|
|
4740
4772
|
className: computedHeaderClassName
|
|
4741
4773
|
},
|
|
4742
4774
|
group.headerName ?? group.groupId
|
|
4743
|
-
), emptyCells > 0 && Array.from({ length: emptyCells }).map((_2, i) => /* @__PURE__ */
|
|
4744
|
-
}))), /* @__PURE__ */
|
|
4775
|
+
), emptyCells > 0 && Array.from({ length: emptyCells }).map((_2, i) => /* @__PURE__ */ React26.createElement("th", { key: `empty-between-${level}-${groupIndex}-${i}`, colSpan: 1 })));
|
|
4776
|
+
}))), /* @__PURE__ */ React26.createElement("tr", null, (!processedColumnGroups || processedColumnGroups.groups.length === 0) && checkboxSelection && /* @__PURE__ */ React26.createElement(
|
|
4745
4777
|
"th",
|
|
4746
4778
|
{
|
|
4747
4779
|
style: {
|
|
@@ -4752,7 +4784,7 @@ function Component(props, apiRef) {
|
|
|
4752
4784
|
headerCheckboxElement
|
|
4753
4785
|
), columns.map((c, i) => (
|
|
4754
4786
|
// @ts-ignore
|
|
4755
|
-
/* @__PURE__ */
|
|
4787
|
+
/* @__PURE__ */ React26.createElement(
|
|
4756
4788
|
HeadCell2,
|
|
4757
4789
|
{
|
|
4758
4790
|
tableId,
|
|
@@ -4764,7 +4796,7 @@ function Component(props, apiRef) {
|
|
|
4764
4796
|
...c
|
|
4765
4797
|
}
|
|
4766
4798
|
)
|
|
4767
|
-
)))), /* @__PURE__ */
|
|
4799
|
+
)))), /* @__PURE__ */ React26.createElement(
|
|
4768
4800
|
VirtualizedTableBody,
|
|
4769
4801
|
{
|
|
4770
4802
|
ref: tableBodyRef,
|
|
@@ -4775,7 +4807,7 @@ function Component(props, apiRef) {
|
|
|
4775
4807
|
role: "rowgroup",
|
|
4776
4808
|
"aria-label": "DataTableBody"
|
|
4777
4809
|
},
|
|
4778
|
-
!!loading && /* @__PURE__ */
|
|
4810
|
+
!!loading && /* @__PURE__ */ React26.createElement(OverlayWrapper, null, /* @__PURE__ */ React26.createElement(
|
|
4779
4811
|
"td",
|
|
4780
4812
|
{
|
|
4781
4813
|
style: {
|
|
@@ -4784,7 +4816,7 @@ function Component(props, apiRef) {
|
|
|
4784
4816
|
overflow: "visible"
|
|
4785
4817
|
}
|
|
4786
4818
|
},
|
|
4787
|
-
/* @__PURE__ */
|
|
4819
|
+
/* @__PURE__ */ React26.createElement(
|
|
4788
4820
|
Box_default,
|
|
4789
4821
|
{
|
|
4790
4822
|
sx: {
|
|
@@ -4794,10 +4826,10 @@ function Component(props, apiRef) {
|
|
|
4794
4826
|
right: 0
|
|
4795
4827
|
}
|
|
4796
4828
|
},
|
|
4797
|
-
/* @__PURE__ */
|
|
4829
|
+
/* @__PURE__ */ React26.createElement(LoadingOverlay, null)
|
|
4798
4830
|
)
|
|
4799
4831
|
)),
|
|
4800
|
-
showNoRowsOverlay && /* @__PURE__ */
|
|
4832
|
+
showNoRowsOverlay && /* @__PURE__ */ React26.createElement("tr", null, /* @__PURE__ */ React26.createElement("td", { colSpan: totalColCount, style: { border: "none" } }, /* @__PURE__ */ React26.createElement(
|
|
4801
4833
|
Box_default,
|
|
4802
4834
|
{
|
|
4803
4835
|
sx: {
|
|
@@ -4807,14 +4839,14 @@ function Component(props, apiRef) {
|
|
|
4807
4839
|
minHeight: "150px"
|
|
4808
4840
|
}
|
|
4809
4841
|
},
|
|
4810
|
-
/* @__PURE__ */
|
|
4842
|
+
/* @__PURE__ */ React26.createElement(NoRowsOverlay, { ...noRowsOverlayProps })
|
|
4811
4843
|
))),
|
|
4812
4844
|
virtualizedItems.map((virtualizedRow, index) => {
|
|
4813
4845
|
const rowIndex = virtualizedRow.index;
|
|
4814
4846
|
const row = dataInPage[rowIndex];
|
|
4815
4847
|
const rowId = getId(row, rowIndex);
|
|
4816
4848
|
const striped = stripe && (stripe === "even" && (rowIndex + 1) % 2 === 0 || stripe === "odd" && (rowIndex + 1) % 2 === 1);
|
|
4817
|
-
return /* @__PURE__ */
|
|
4849
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4818
4850
|
VirtualizedTableRow,
|
|
4819
4851
|
{
|
|
4820
4852
|
key: virtualizedRow.key,
|
|
@@ -4834,7 +4866,7 @@ function Component(props, apiRef) {
|
|
|
4834
4866
|
transform: `translateY(${virtualizedRow.start - index * virtualizedRow.size}px)`
|
|
4835
4867
|
}
|
|
4836
4868
|
},
|
|
4837
|
-
checkboxSelection && /* @__PURE__ */
|
|
4869
|
+
checkboxSelection && /* @__PURE__ */ React26.createElement(
|
|
4838
4870
|
"th",
|
|
4839
4871
|
{
|
|
4840
4872
|
scope: "row",
|
|
@@ -4842,7 +4874,7 @@ function Component(props, apiRef) {
|
|
|
4842
4874
|
textAlign: "center"
|
|
4843
4875
|
}
|
|
4844
4876
|
},
|
|
4845
|
-
/* @__PURE__ */
|
|
4877
|
+
/* @__PURE__ */ React26.createElement(
|
|
4846
4878
|
RenderCheckbox,
|
|
4847
4879
|
{
|
|
4848
4880
|
onClick: getCheckboxClickHandler(rowId, row),
|
|
@@ -4853,7 +4885,7 @@ function Component(props, apiRef) {
|
|
|
4853
4885
|
}
|
|
4854
4886
|
)
|
|
4855
4887
|
),
|
|
4856
|
-
/* @__PURE__ */
|
|
4888
|
+
/* @__PURE__ */ React26.createElement(
|
|
4857
4889
|
BodyRow2,
|
|
4858
4890
|
{
|
|
4859
4891
|
tableId,
|
|
@@ -4866,9 +4898,9 @@ function Component(props, apiRef) {
|
|
|
4866
4898
|
)
|
|
4867
4899
|
);
|
|
4868
4900
|
})
|
|
4869
|
-
), Footer && /* @__PURE__ */
|
|
4901
|
+
), Footer && /* @__PURE__ */ React26.createElement(Footer, null))
|
|
4870
4902
|
),
|
|
4871
|
-
pagination && /* @__PURE__ */
|
|
4903
|
+
pagination && /* @__PURE__ */ React26.createElement(
|
|
4872
4904
|
Pagination_default,
|
|
4873
4905
|
{
|
|
4874
4906
|
pt: 2,
|
|
@@ -4885,7 +4917,7 @@ var DataTable = forwardRef7(Component);
|
|
|
4885
4917
|
DataTable.displayName = "DataTable";
|
|
4886
4918
|
|
|
4887
4919
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
4888
|
-
import
|
|
4920
|
+
import React27, { forwardRef as forwardRef8, useCallback as useCallback14, useEffect as useEffect8, useImperativeHandle as useImperativeHandle3, useMemo as useMemo12, useRef as useRef8, useState as useState11 } from "react";
|
|
4889
4921
|
import { IMaskInput as IMaskInput2, IMask as IMask2 } from "react-imask";
|
|
4890
4922
|
import CalendarTodayIcon2 from "@mui/icons-material/CalendarToday";
|
|
4891
4923
|
import { styled as styled14, useThemeProps as useThemeProps5 } from "@mui/joy";
|
|
@@ -5027,9 +5059,9 @@ var parseDates = (str, format) => {
|
|
|
5027
5059
|
var formatToPattern2 = (format) => {
|
|
5028
5060
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
5029
5061
|
};
|
|
5030
|
-
var TextMaskAdapter5 =
|
|
5062
|
+
var TextMaskAdapter5 = React27.forwardRef(function TextMaskAdapter6(props, ref) {
|
|
5031
5063
|
const { onChange, format, ...other } = props;
|
|
5032
|
-
return /* @__PURE__ */
|
|
5064
|
+
return /* @__PURE__ */ React27.createElement(
|
|
5033
5065
|
IMaskInput2,
|
|
5034
5066
|
{
|
|
5035
5067
|
...other,
|
|
@@ -5095,15 +5127,15 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5095
5127
|
const [value, setValue] = useControlledState(
|
|
5096
5128
|
props.value,
|
|
5097
5129
|
props.defaultValue || "",
|
|
5098
|
-
|
|
5130
|
+
useCallback14((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
5099
5131
|
);
|
|
5100
5132
|
const isAlphabeticDisplay = hasAlphabeticMonth2(displayFormat);
|
|
5101
|
-
const [displayValue, setDisplayValue] =
|
|
5133
|
+
const [displayValue, setDisplayValue] = useState11(
|
|
5102
5134
|
() => value ? formatValueString2(parseDates(value, format), displayFormat, locale) : ""
|
|
5103
5135
|
);
|
|
5104
|
-
const [anchorEl, setAnchorEl] =
|
|
5136
|
+
const [anchorEl, setAnchorEl] = useState11(null);
|
|
5105
5137
|
const open = Boolean(anchorEl);
|
|
5106
|
-
const calendarValue =
|
|
5138
|
+
const calendarValue = useMemo12(
|
|
5107
5139
|
() => value ? parseDates(value, format) : void 0,
|
|
5108
5140
|
[value, format]
|
|
5109
5141
|
);
|
|
@@ -5125,7 +5157,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5125
5157
|
}
|
|
5126
5158
|
}, [anchorEl, innerRef]);
|
|
5127
5159
|
useImperativeHandle3(ref, () => innerRef.current, [innerRef]);
|
|
5128
|
-
const handleChange =
|
|
5160
|
+
const handleChange = useCallback14(
|
|
5129
5161
|
(event) => {
|
|
5130
5162
|
const value2 = event.target.value;
|
|
5131
5163
|
setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat, locale) : value2);
|
|
@@ -5133,7 +5165,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5133
5165
|
},
|
|
5134
5166
|
[displayFormat, format, locale, setValue]
|
|
5135
5167
|
);
|
|
5136
|
-
const handleDisplayInputChange =
|
|
5168
|
+
const handleDisplayInputChange = useCallback14(
|
|
5137
5169
|
(event) => {
|
|
5138
5170
|
if (event.target.value === "") {
|
|
5139
5171
|
handleChange({
|
|
@@ -5158,14 +5190,14 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5158
5190
|
},
|
|
5159
5191
|
[displayFormat, format, handleChange, props.name]
|
|
5160
5192
|
);
|
|
5161
|
-
const handleCalendarToggle =
|
|
5193
|
+
const handleCalendarToggle = useCallback14(
|
|
5162
5194
|
(event) => {
|
|
5163
5195
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5164
5196
|
innerRef.current?.focus();
|
|
5165
5197
|
},
|
|
5166
5198
|
[anchorEl, setAnchorEl, innerRef]
|
|
5167
5199
|
);
|
|
5168
|
-
const handleCalendarChange =
|
|
5200
|
+
const handleCalendarChange = useCallback14(
|
|
5169
5201
|
([date1, date2]) => {
|
|
5170
5202
|
if (!date1 || !date2) return;
|
|
5171
5203
|
const formattedValue = formatValueString2([date1, date2], format);
|
|
@@ -5179,7 +5211,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5179
5211
|
},
|
|
5180
5212
|
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat, locale]
|
|
5181
5213
|
);
|
|
5182
|
-
const handleInputMouseDown =
|
|
5214
|
+
const handleInputMouseDown = useCallback14(
|
|
5183
5215
|
(event) => {
|
|
5184
5216
|
if (inputReadOnly || isAlphabeticDisplay) {
|
|
5185
5217
|
event.preventDefault();
|
|
@@ -5188,7 +5220,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5188
5220
|
},
|
|
5189
5221
|
[inputReadOnly, isAlphabeticDisplay, buttonRef]
|
|
5190
5222
|
);
|
|
5191
|
-
const handlePresetClick =
|
|
5223
|
+
const handlePresetClick = useCallback14(
|
|
5192
5224
|
(presetValue) => {
|
|
5193
5225
|
if (props.value !== void 0) {
|
|
5194
5226
|
onChange?.({ target: { name: props.name, value: presetValue } });
|
|
@@ -5201,7 +5233,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5201
5233
|
},
|
|
5202
5234
|
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat, locale]
|
|
5203
5235
|
);
|
|
5204
|
-
const isPresetDisabled =
|
|
5236
|
+
const isPresetDisabled = useCallback14(
|
|
5205
5237
|
(presetValue) => {
|
|
5206
5238
|
try {
|
|
5207
5239
|
const dates = parseDates(presetValue, format);
|
|
@@ -5220,7 +5252,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5220
5252
|
},
|
|
5221
5253
|
[format, minDate, maxDate, disableFuture, disablePast]
|
|
5222
5254
|
);
|
|
5223
|
-
return /* @__PURE__ */
|
|
5255
|
+
return /* @__PURE__ */ React27.createElement(DateRangePickerRoot, null, /* @__PURE__ */ React27.createElement(FocusTrap2, { open: true }, /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(
|
|
5224
5256
|
Input_default,
|
|
5225
5257
|
{
|
|
5226
5258
|
...innerProps,
|
|
@@ -5247,7 +5279,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5247
5279
|
error,
|
|
5248
5280
|
className,
|
|
5249
5281
|
sx,
|
|
5250
|
-
endDecorator: /* @__PURE__ */
|
|
5282
|
+
endDecorator: /* @__PURE__ */ React27.createElement(
|
|
5251
5283
|
CalendarButton2,
|
|
5252
5284
|
{
|
|
5253
5285
|
ref: buttonRef,
|
|
@@ -5259,13 +5291,13 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5259
5291
|
"aria-expanded": open,
|
|
5260
5292
|
disabled
|
|
5261
5293
|
},
|
|
5262
|
-
/* @__PURE__ */
|
|
5294
|
+
/* @__PURE__ */ React27.createElement(CalendarTodayIcon2, null)
|
|
5263
5295
|
),
|
|
5264
5296
|
label,
|
|
5265
5297
|
helperText,
|
|
5266
5298
|
readOnly: readOnly || inputReadOnly || isAlphabeticDisplay
|
|
5267
5299
|
}
|
|
5268
|
-
), open && /* @__PURE__ */
|
|
5300
|
+
), open && /* @__PURE__ */ React27.createElement(ClickAwayListener2, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React27.createElement(
|
|
5269
5301
|
StyledPopper2,
|
|
5270
5302
|
{
|
|
5271
5303
|
id: "date-range-picker-popper",
|
|
@@ -5284,7 +5316,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5284
5316
|
"aria-label": "Calendar Tooltip",
|
|
5285
5317
|
"aria-expanded": open
|
|
5286
5318
|
},
|
|
5287
|
-
/* @__PURE__ */
|
|
5319
|
+
/* @__PURE__ */ React27.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React27.createElement(CalendarSheetContent2, null, /* @__PURE__ */ React27.createElement(CalendarSection2, { style: { width: "auto" } }, /* @__PURE__ */ React27.createElement(
|
|
5288
5320
|
Calendar_default,
|
|
5289
5321
|
{
|
|
5290
5322
|
rangeSelection: true,
|
|
@@ -5297,14 +5329,14 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5297
5329
|
locale,
|
|
5298
5330
|
numberOfMonths
|
|
5299
5331
|
}
|
|
5300
|
-
), !hideClearButton && /* @__PURE__ */
|
|
5332
|
+
), !hideClearButton && /* @__PURE__ */ React27.createElement(
|
|
5301
5333
|
DialogActions_default,
|
|
5302
5334
|
{
|
|
5303
5335
|
sx: {
|
|
5304
5336
|
p: 1
|
|
5305
5337
|
}
|
|
5306
5338
|
},
|
|
5307
|
-
/* @__PURE__ */
|
|
5339
|
+
/* @__PURE__ */ React27.createElement(
|
|
5308
5340
|
Button_default,
|
|
5309
5341
|
{
|
|
5310
5342
|
size,
|
|
@@ -5318,9 +5350,9 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5318
5350
|
},
|
|
5319
5351
|
"Clear"
|
|
5320
5352
|
)
|
|
5321
|
-
)), presets && presets.length > 0 && /* @__PURE__ */
|
|
5353
|
+
)), presets && presets.length > 0 && /* @__PURE__ */ React27.createElement(PresetPanel2, null, presets.map((preset) => {
|
|
5322
5354
|
const disabled2 = isPresetDisabled(preset.value);
|
|
5323
|
-
return /* @__PURE__ */
|
|
5355
|
+
return /* @__PURE__ */ React27.createElement(
|
|
5324
5356
|
PresetItem2,
|
|
5325
5357
|
{
|
|
5326
5358
|
key: preset.label,
|
|
@@ -5339,7 +5371,7 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
|
5339
5371
|
DateRangePicker.displayName = "DateRangePicker";
|
|
5340
5372
|
|
|
5341
5373
|
// src/components/Drawer/Drawer.tsx
|
|
5342
|
-
import
|
|
5374
|
+
import React28 from "react";
|
|
5343
5375
|
import { Drawer as JoyDrawer, styled as styled15, drawerClasses } from "@mui/joy";
|
|
5344
5376
|
import { motion as motion21 } from "framer-motion";
|
|
5345
5377
|
var MotionDrawer = motion21(JoyDrawer);
|
|
@@ -5357,7 +5389,7 @@ var StyledDrawer = styled15(MotionDrawer)(({ theme, size = "md" }) => ({
|
|
|
5357
5389
|
}));
|
|
5358
5390
|
var Drawer = (props) => {
|
|
5359
5391
|
const { children, ...innerProps } = props;
|
|
5360
|
-
return /* @__PURE__ */
|
|
5392
|
+
return /* @__PURE__ */ React28.createElement(StyledDrawer, { ...innerProps }, children);
|
|
5361
5393
|
};
|
|
5362
5394
|
Drawer.displayName = "Drawer";
|
|
5363
5395
|
|
|
@@ -5388,10 +5420,10 @@ DialogTitle.displayName = "DialogTitle";
|
|
|
5388
5420
|
var DialogTitle_default = DialogTitle;
|
|
5389
5421
|
|
|
5390
5422
|
// src/components/DialogFrame/DialogFrame.tsx
|
|
5391
|
-
import
|
|
5423
|
+
import React30 from "react";
|
|
5392
5424
|
|
|
5393
5425
|
// src/components/Modal/Modal.tsx
|
|
5394
|
-
import
|
|
5426
|
+
import React29 from "react";
|
|
5395
5427
|
import {
|
|
5396
5428
|
Modal as JoyModal,
|
|
5397
5429
|
ModalDialog as JoyModalDialog,
|
|
@@ -5414,7 +5446,7 @@ var ModalOverflow = MotionModalOverflow;
|
|
|
5414
5446
|
ModalOverflow.displayName = "ModalOverflow";
|
|
5415
5447
|
function ModalFrame(props) {
|
|
5416
5448
|
const { title, children, titleStartDecorator, onClose, ...innerProps } = props;
|
|
5417
|
-
return /* @__PURE__ */
|
|
5449
|
+
return /* @__PURE__ */ React29.createElement(StyledModalDialog, { ...innerProps }, /* @__PURE__ */ React29.createElement(ModalClose, { onClick: onClose }), /* @__PURE__ */ React29.createElement(DialogTitle_default, null, titleStartDecorator, title), /* @__PURE__ */ React29.createElement(DialogContent_default, null, children));
|
|
5418
5450
|
}
|
|
5419
5451
|
ModalFrame.displayName = "ModalFrame";
|
|
5420
5452
|
|
|
@@ -5426,19 +5458,19 @@ var StyledDialogFrame = styled19(ModalDialog, {
|
|
|
5426
5458
|
})({
|
|
5427
5459
|
padding: 0
|
|
5428
5460
|
});
|
|
5429
|
-
var DialogFrame =
|
|
5461
|
+
var DialogFrame = React30.forwardRef((props, ref) => {
|
|
5430
5462
|
const { title, children, actions, fullscreen, ...innerProps } = props;
|
|
5431
|
-
return /* @__PURE__ */
|
|
5463
|
+
return /* @__PURE__ */ React30.createElement(StyledDialogFrame, { layout: fullscreen ? "fullscreen" : "center", ref, ...innerProps }, /* @__PURE__ */ React30.createElement(DialogTitle_default, null, title), /* @__PURE__ */ React30.createElement(DialogContent_default, null, children), /* @__PURE__ */ React30.createElement(DialogActions_default, null, actions));
|
|
5432
5464
|
});
|
|
5433
5465
|
DialogFrame.displayName = "DialogFrame";
|
|
5434
5466
|
|
|
5435
5467
|
// src/components/Divider/Divider.tsx
|
|
5436
|
-
import
|
|
5468
|
+
import React31 from "react";
|
|
5437
5469
|
import { Divider as JoyDivider } from "@mui/joy";
|
|
5438
5470
|
import { motion as motion25 } from "framer-motion";
|
|
5439
5471
|
var MotionDivider = motion25(JoyDivider);
|
|
5440
5472
|
var Divider = (props) => {
|
|
5441
|
-
return /* @__PURE__ */
|
|
5473
|
+
return /* @__PURE__ */ React31.createElement(MotionDivider, { ...props });
|
|
5442
5474
|
};
|
|
5443
5475
|
Divider.displayName = "Divider";
|
|
5444
5476
|
|
|
@@ -5459,14 +5491,14 @@ var InsetDrawer = styled20(JoyDrawer2)(({ theme }) => ({
|
|
|
5459
5491
|
}));
|
|
5460
5492
|
|
|
5461
5493
|
// src/components/FilterableCheckboxGroup/FilterableCheckboxGroup.tsx
|
|
5462
|
-
import
|
|
5494
|
+
import React32, { useCallback as useCallback15, useEffect as useEffect9, useMemo as useMemo13, useRef as useRef9, useState as useState12 } from "react";
|
|
5463
5495
|
import SearchIcon from "@mui/icons-material/Search";
|
|
5464
5496
|
import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
|
|
5465
5497
|
function LabelWithTooltip(props) {
|
|
5466
5498
|
const { label, size } = props;
|
|
5467
5499
|
const labelContentRef = useRef9(null);
|
|
5468
|
-
const [isOverflowing, setIsOverflowing] =
|
|
5469
|
-
const labelContent = /* @__PURE__ */
|
|
5500
|
+
const [isOverflowing, setIsOverflowing] = useState12(false);
|
|
5501
|
+
const labelContent = /* @__PURE__ */ React32.createElement(
|
|
5470
5502
|
"span",
|
|
5471
5503
|
{
|
|
5472
5504
|
ref: labelContentRef,
|
|
@@ -5489,7 +5521,7 @@ function LabelWithTooltip(props) {
|
|
|
5489
5521
|
}
|
|
5490
5522
|
}, [label]);
|
|
5491
5523
|
if (isOverflowing) {
|
|
5492
|
-
return /* @__PURE__ */
|
|
5524
|
+
return /* @__PURE__ */ React32.createElement(Tooltip_default, { variant: "solid", size, title: label, placement: "bottom-start" }, labelContent);
|
|
5493
5525
|
}
|
|
5494
5526
|
return labelContent;
|
|
5495
5527
|
}
|
|
@@ -5506,21 +5538,21 @@ function FilterableCheckboxGroup(props) {
|
|
|
5506
5538
|
maxHeight = 300,
|
|
5507
5539
|
disabled
|
|
5508
5540
|
} = props;
|
|
5509
|
-
const [searchTerm, setSearchTerm] =
|
|
5510
|
-
const [sortedOptions, setSortedOptions] =
|
|
5541
|
+
const [searchTerm, setSearchTerm] = useState12("");
|
|
5542
|
+
const [sortedOptions, setSortedOptions] = useState12(options);
|
|
5511
5543
|
const [internalValue, setInternalValue] = useControlledState(
|
|
5512
5544
|
value,
|
|
5513
5545
|
value ?? [],
|
|
5514
|
-
|
|
5546
|
+
useCallback15((newValue) => onChange?.(newValue), [onChange])
|
|
5515
5547
|
);
|
|
5516
5548
|
const parentRef = useRef9(null);
|
|
5517
5549
|
const isInitialSortRef = useRef9(false);
|
|
5518
5550
|
const prevOptionsRef = useRef9([...options]);
|
|
5519
|
-
const filteredOptions =
|
|
5551
|
+
const filteredOptions = useMemo13(() => {
|
|
5520
5552
|
if (!searchTerm) return sortedOptions;
|
|
5521
5553
|
return sortedOptions.filter((option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
5522
5554
|
}, [sortedOptions, searchTerm]);
|
|
5523
|
-
const itemSize =
|
|
5555
|
+
const itemSize = useMemo13(() => {
|
|
5524
5556
|
switch (size) {
|
|
5525
5557
|
case "sm":
|
|
5526
5558
|
return 28;
|
|
@@ -5567,10 +5599,10 @@ function FilterableCheckboxGroup(props) {
|
|
|
5567
5599
|
useEffect9(() => {
|
|
5568
5600
|
virtualizer.measure();
|
|
5569
5601
|
}, [virtualizer, filteredOptions, size]);
|
|
5570
|
-
const handleSearchChange =
|
|
5602
|
+
const handleSearchChange = useCallback15((event) => {
|
|
5571
5603
|
setSearchTerm(event.target.value);
|
|
5572
5604
|
}, []);
|
|
5573
|
-
const handleCheckboxChange =
|
|
5605
|
+
const handleCheckboxChange = useCallback15(
|
|
5574
5606
|
(optionValue) => (event) => {
|
|
5575
5607
|
const checked = event.target.checked;
|
|
5576
5608
|
const newValue = checked ? [...internalValue, optionValue] : internalValue.filter((v) => v !== optionValue);
|
|
@@ -5578,7 +5610,7 @@ function FilterableCheckboxGroup(props) {
|
|
|
5578
5610
|
},
|
|
5579
5611
|
[internalValue, setInternalValue]
|
|
5580
5612
|
);
|
|
5581
|
-
const handleSelectAll =
|
|
5613
|
+
const handleSelectAll = useCallback15(
|
|
5582
5614
|
(event) => {
|
|
5583
5615
|
const checked = event.target.checked;
|
|
5584
5616
|
const enabledOptions = filteredOptions.filter((option) => !option.disabled);
|
|
@@ -5594,10 +5626,10 @@ function FilterableCheckboxGroup(props) {
|
|
|
5594
5626
|
},
|
|
5595
5627
|
[filteredOptions, internalValue, setInternalValue]
|
|
5596
5628
|
);
|
|
5597
|
-
const enabledFilteredOptions =
|
|
5629
|
+
const enabledFilteredOptions = useMemo13(() => filteredOptions.filter((option) => !option.disabled), [filteredOptions]);
|
|
5598
5630
|
const isAllSelected = enabledFilteredOptions.length > 0 && enabledFilteredOptions.every((option) => internalValue.includes(option.value));
|
|
5599
5631
|
const isIndeterminate = !isAllSelected && enabledFilteredOptions.some((option) => internalValue.includes(option.value));
|
|
5600
|
-
return /* @__PURE__ */
|
|
5632
|
+
return /* @__PURE__ */ React32.createElement("div", { style: { width: "100%" } }, /* @__PURE__ */ React32.createElement(
|
|
5601
5633
|
Input_default,
|
|
5602
5634
|
{
|
|
5603
5635
|
label,
|
|
@@ -5610,9 +5642,9 @@ function FilterableCheckboxGroup(props) {
|
|
|
5610
5642
|
onChange: handleSearchChange,
|
|
5611
5643
|
size,
|
|
5612
5644
|
disabled,
|
|
5613
|
-
endDecorator: /* @__PURE__ */
|
|
5645
|
+
endDecorator: /* @__PURE__ */ React32.createElement(SearchIcon, null)
|
|
5614
5646
|
}
|
|
5615
|
-
), filteredOptions.length === 0 ? /* @__PURE__ */
|
|
5647
|
+
), filteredOptions.length === 0 ? /* @__PURE__ */ React32.createElement(Typography_default, { level: `body-${size}`, textColor: "neutral.softDisabledColor", padding: "20px 12px", textAlign: "center" }, "No options found.") : /* @__PURE__ */ React32.createElement(
|
|
5616
5648
|
"div",
|
|
5617
5649
|
{
|
|
5618
5650
|
ref: parentRef,
|
|
@@ -5623,7 +5655,7 @@ function FilterableCheckboxGroup(props) {
|
|
|
5623
5655
|
marginTop: "8px"
|
|
5624
5656
|
}
|
|
5625
5657
|
},
|
|
5626
|
-
!searchTerm && /* @__PURE__ */
|
|
5658
|
+
!searchTerm && /* @__PURE__ */ React32.createElement(
|
|
5627
5659
|
Checkbox_default,
|
|
5628
5660
|
{
|
|
5629
5661
|
label: "Select all",
|
|
@@ -5640,7 +5672,7 @@ function FilterableCheckboxGroup(props) {
|
|
|
5640
5672
|
sx: { width: "100%", height: itemSize }
|
|
5641
5673
|
}
|
|
5642
5674
|
),
|
|
5643
|
-
/* @__PURE__ */
|
|
5675
|
+
/* @__PURE__ */ React32.createElement(
|
|
5644
5676
|
Stack_default,
|
|
5645
5677
|
{
|
|
5646
5678
|
sx: {
|
|
@@ -5650,11 +5682,11 @@ function FilterableCheckboxGroup(props) {
|
|
|
5650
5682
|
},
|
|
5651
5683
|
items.map((virtualRow) => {
|
|
5652
5684
|
const option = filteredOptions[virtualRow.index];
|
|
5653
|
-
return /* @__PURE__ */
|
|
5685
|
+
return /* @__PURE__ */ React32.createElement(
|
|
5654
5686
|
Checkbox_default,
|
|
5655
5687
|
{
|
|
5656
5688
|
key: virtualRow.key,
|
|
5657
|
-
label: /* @__PURE__ */
|
|
5689
|
+
label: /* @__PURE__ */ React32.createElement(LabelWithTooltip, { label: option.label, size }),
|
|
5658
5690
|
checked: internalValue.includes(option.value),
|
|
5659
5691
|
onChange: handleCheckboxChange(option.value),
|
|
5660
5692
|
size,
|
|
@@ -5685,8 +5717,11 @@ FilterableCheckboxGroup.displayName = "FilterableCheckboxGroup";
|
|
|
5685
5717
|
import { Grid } from "@mui/joy";
|
|
5686
5718
|
|
|
5687
5719
|
// src/components/IconMenuButton/IconMenuButton.tsx
|
|
5688
|
-
import
|
|
5689
|
-
import {
|
|
5720
|
+
import React33 from "react";
|
|
5721
|
+
import {
|
|
5722
|
+
MenuButton as JoyMenuButton2,
|
|
5723
|
+
IconButton as JoyIconButton2
|
|
5724
|
+
} from "@mui/joy";
|
|
5690
5725
|
function IconMenuButton(props) {
|
|
5691
5726
|
const {
|
|
5692
5727
|
size,
|
|
@@ -5699,7 +5734,7 @@ function IconMenuButton(props) {
|
|
|
5699
5734
|
placement = "bottom"
|
|
5700
5735
|
} = props;
|
|
5701
5736
|
if (!items.length) {
|
|
5702
|
-
return /* @__PURE__ */
|
|
5737
|
+
return /* @__PURE__ */ React33.createElement(
|
|
5703
5738
|
JoyIconButton2,
|
|
5704
5739
|
{
|
|
5705
5740
|
component: props.buttonComponent ?? "button",
|
|
@@ -5713,7 +5748,7 @@ function IconMenuButton(props) {
|
|
|
5713
5748
|
icon
|
|
5714
5749
|
);
|
|
5715
5750
|
}
|
|
5716
|
-
return /* @__PURE__ */
|
|
5751
|
+
return /* @__PURE__ */ React33.createElement(Dropdown_default, null, /* @__PURE__ */ React33.createElement(
|
|
5717
5752
|
JoyMenuButton2,
|
|
5718
5753
|
{
|
|
5719
5754
|
slots: { root: JoyIconButton2 },
|
|
@@ -5730,18 +5765,18 @@ function IconMenuButton(props) {
|
|
|
5730
5765
|
}
|
|
5731
5766
|
},
|
|
5732
5767
|
icon
|
|
5733
|
-
), /* @__PURE__ */
|
|
5768
|
+
), /* @__PURE__ */ React33.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React33.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
5734
5769
|
}
|
|
5735
5770
|
IconMenuButton.displayName = "IconMenuButton";
|
|
5736
5771
|
|
|
5737
5772
|
// src/components/Markdown/Markdown.tsx
|
|
5738
|
-
import
|
|
5773
|
+
import React34, { lazy, Suspense, useEffect as useEffect10, useState as useState13 } from "react";
|
|
5739
5774
|
import { Skeleton } from "@mui/joy";
|
|
5740
5775
|
import { Link as Link2 } from "@mui/joy";
|
|
5741
5776
|
import remarkGfm from "remark-gfm";
|
|
5742
5777
|
var LazyReactMarkdown = lazy(() => import("react-markdown"));
|
|
5743
5778
|
var Markdown = (props) => {
|
|
5744
|
-
const [rehypeAccent, setRehypeAccent] =
|
|
5779
|
+
const [rehypeAccent, setRehypeAccent] = useState13(null);
|
|
5745
5780
|
useEffect10(() => {
|
|
5746
5781
|
const loadRehypeAccent = async () => {
|
|
5747
5782
|
const module = await import("./chunks/rehype-accent-FZRUD7VI.js");
|
|
@@ -5764,12 +5799,12 @@ var Markdown = (props) => {
|
|
|
5764
5799
|
if (!rehypeAccent) {
|
|
5765
5800
|
return null;
|
|
5766
5801
|
}
|
|
5767
|
-
return /* @__PURE__ */
|
|
5802
|
+
return /* @__PURE__ */ React34.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ React34.createElement(
|
|
5768
5803
|
Suspense,
|
|
5769
5804
|
{
|
|
5770
|
-
fallback: fallback || /* @__PURE__ */
|
|
5805
|
+
fallback: fallback || /* @__PURE__ */ React34.createElement(Typography, null, /* @__PURE__ */ React34.createElement(Skeleton, null, content || ""))
|
|
5771
5806
|
},
|
|
5772
|
-
/* @__PURE__ */
|
|
5807
|
+
/* @__PURE__ */ React34.createElement(
|
|
5773
5808
|
LazyReactMarkdown,
|
|
5774
5809
|
{
|
|
5775
5810
|
...markdownOptions,
|
|
@@ -5777,17 +5812,17 @@ var Markdown = (props) => {
|
|
|
5777
5812
|
rehypePlugins: [[rehypeAccent, { accentColor }]],
|
|
5778
5813
|
remarkPlugins: [remarkGfm],
|
|
5779
5814
|
components: {
|
|
5780
|
-
a: ({ children, href }) => /* @__PURE__ */
|
|
5781
|
-
hr: () => /* @__PURE__ */
|
|
5782
|
-
b: ({ children }) => /* @__PURE__ */
|
|
5783
|
-
strong: ({ children }) => /* @__PURE__ */
|
|
5815
|
+
a: ({ children, href }) => /* @__PURE__ */ React34.createElement(Link2, { href, target: defaultLinkAction }, children),
|
|
5816
|
+
hr: () => /* @__PURE__ */ React34.createElement(Divider, { sx: { display: "block" } }),
|
|
5817
|
+
b: ({ children }) => /* @__PURE__ */ React34.createElement(Typography, { component: "strong", fontWeight: boldFontWeight || "lg" }, children),
|
|
5818
|
+
strong: ({ children }) => /* @__PURE__ */ React34.createElement(Typography, { component: "strong", fontWeight: boldFontWeight || "lg" }, children),
|
|
5784
5819
|
// Table components
|
|
5785
|
-
table: ({ children }) => /* @__PURE__ */
|
|
5820
|
+
table: ({ children }) => /* @__PURE__ */ React34.createElement(Sheet, { variant: "outlined", sx: { display: "block", borderRadius: "sm", overflow: "auto" } }, /* @__PURE__ */ React34.createElement(Table, { size: "sm" }, children)),
|
|
5786
5821
|
// Code components
|
|
5787
5822
|
code: ({ children, className }) => {
|
|
5788
5823
|
const isBlock = className?.startsWith("language-");
|
|
5789
5824
|
if (isBlock) {
|
|
5790
|
-
return /* @__PURE__ */
|
|
5825
|
+
return /* @__PURE__ */ React34.createElement(
|
|
5791
5826
|
Typography,
|
|
5792
5827
|
{
|
|
5793
5828
|
component: "code",
|
|
@@ -5801,7 +5836,7 @@ var Markdown = (props) => {
|
|
|
5801
5836
|
children
|
|
5802
5837
|
);
|
|
5803
5838
|
}
|
|
5804
|
-
return /* @__PURE__ */
|
|
5839
|
+
return /* @__PURE__ */ React34.createElement(
|
|
5805
5840
|
Typography,
|
|
5806
5841
|
{
|
|
5807
5842
|
component: "code",
|
|
@@ -5816,7 +5851,7 @@ var Markdown = (props) => {
|
|
|
5816
5851
|
children
|
|
5817
5852
|
);
|
|
5818
5853
|
},
|
|
5819
|
-
pre: ({ children }) => /* @__PURE__ */
|
|
5854
|
+
pre: ({ children }) => /* @__PURE__ */ React34.createElement(
|
|
5820
5855
|
Sheet,
|
|
5821
5856
|
{
|
|
5822
5857
|
variant: "soft",
|
|
@@ -5834,12 +5869,12 @@ var Markdown = (props) => {
|
|
|
5834
5869
|
// Task list checkbox
|
|
5835
5870
|
input: ({ checked, type }) => {
|
|
5836
5871
|
if (type === "checkbox") {
|
|
5837
|
-
return /* @__PURE__ */
|
|
5872
|
+
return /* @__PURE__ */ React34.createElement(Checkbox, { checked, disabled: true, size: "sm", sx: { mr: 1 } });
|
|
5838
5873
|
}
|
|
5839
|
-
return /* @__PURE__ */
|
|
5874
|
+
return /* @__PURE__ */ React34.createElement("input", { checked, type });
|
|
5840
5875
|
},
|
|
5841
5876
|
// Blockquote
|
|
5842
|
-
blockquote: ({ children }) => /* @__PURE__ */
|
|
5877
|
+
blockquote: ({ children }) => /* @__PURE__ */ React34.createElement(
|
|
5843
5878
|
Sheet,
|
|
5844
5879
|
{
|
|
5845
5880
|
variant: "soft",
|
|
@@ -5848,12 +5883,12 @@ var Markdown = (props) => {
|
|
|
5848
5883
|
children
|
|
5849
5884
|
),
|
|
5850
5885
|
// Image
|
|
5851
|
-
img: ({ src, alt }) => /* @__PURE__ */
|
|
5886
|
+
img: ({ src, alt }) => /* @__PURE__ */ React34.createElement("img", { src, alt, style: { maxWidth: "100%", borderRadius: "4px" } }),
|
|
5852
5887
|
// Text style components
|
|
5853
|
-
em: ({ children }) => /* @__PURE__ */
|
|
5854
|
-
del: ({ children }) => /* @__PURE__ */
|
|
5888
|
+
em: ({ children }) => /* @__PURE__ */ React34.createElement(Typography, { component: "em", sx: { fontStyle: "italic" } }, children),
|
|
5889
|
+
del: ({ children }) => /* @__PURE__ */ React34.createElement(Typography, { component: "del", sx: { textDecoration: "line-through" } }, children),
|
|
5855
5890
|
// Span for accent color (from rehype-accent plugin)
|
|
5856
|
-
span: ({ children, node }) => /* @__PURE__ */
|
|
5891
|
+
span: ({ children, node }) => /* @__PURE__ */ React34.createElement(Typography, { component: "span", textColor: node?.properties?.textColor }, children),
|
|
5857
5892
|
...markdownOptions?.components
|
|
5858
5893
|
}
|
|
5859
5894
|
}
|
|
@@ -5863,10 +5898,10 @@ var Markdown = (props) => {
|
|
|
5863
5898
|
Markdown.displayName = "Markdown";
|
|
5864
5899
|
|
|
5865
5900
|
// src/components/MenuButton/MenuButton.tsx
|
|
5866
|
-
import
|
|
5901
|
+
import React35 from "react";
|
|
5867
5902
|
import { MenuButton as JoyMenuButton3, Button as JoyButton2 } from "@mui/joy";
|
|
5868
5903
|
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
5869
|
-
function
|
|
5904
|
+
function MenuButton2(props) {
|
|
5870
5905
|
const {
|
|
5871
5906
|
size,
|
|
5872
5907
|
buttonText,
|
|
@@ -5881,7 +5916,7 @@ function MenuButton(props) {
|
|
|
5881
5916
|
placement = "bottom"
|
|
5882
5917
|
} = props;
|
|
5883
5918
|
if (!items.length) {
|
|
5884
|
-
return /* @__PURE__ */
|
|
5919
|
+
return /* @__PURE__ */ React35.createElement(
|
|
5885
5920
|
JoyButton2,
|
|
5886
5921
|
{
|
|
5887
5922
|
component: props.buttonComponent ?? "button",
|
|
@@ -5892,12 +5927,12 @@ function MenuButton(props) {
|
|
|
5892
5927
|
loading,
|
|
5893
5928
|
startDecorator,
|
|
5894
5929
|
...props.buttonComponentProps ?? {},
|
|
5895
|
-
endDecorator: showIcon ? /* @__PURE__ */
|
|
5930
|
+
endDecorator: showIcon ? /* @__PURE__ */ React35.createElement(React35.Fragment, null, endDecorator, /* @__PURE__ */ React35.createElement(ExpandMoreIcon, null)) : /* @__PURE__ */ React35.createElement(React35.Fragment, null, endDecorator)
|
|
5896
5931
|
},
|
|
5897
5932
|
buttonText
|
|
5898
5933
|
);
|
|
5899
5934
|
}
|
|
5900
|
-
return /* @__PURE__ */
|
|
5935
|
+
return /* @__PURE__ */ React35.createElement(Dropdown_default, null, /* @__PURE__ */ React35.createElement(
|
|
5901
5936
|
JoyMenuButton3,
|
|
5902
5937
|
{
|
|
5903
5938
|
component: props.buttonComponent ?? "button",
|
|
@@ -5908,15 +5943,15 @@ function MenuButton(props) {
|
|
|
5908
5943
|
loading,
|
|
5909
5944
|
startDecorator,
|
|
5910
5945
|
...props.buttonComponentProps ?? {},
|
|
5911
|
-
endDecorator: showIcon ? /* @__PURE__ */
|
|
5946
|
+
endDecorator: showIcon ? /* @__PURE__ */ React35.createElement(React35.Fragment, null, endDecorator, /* @__PURE__ */ React35.createElement(ExpandMoreIcon, null)) : /* @__PURE__ */ React35.createElement(React35.Fragment, null, endDecorator)
|
|
5912
5947
|
},
|
|
5913
5948
|
buttonText
|
|
5914
|
-
), /* @__PURE__ */
|
|
5949
|
+
), /* @__PURE__ */ React35.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React35.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
5915
5950
|
}
|
|
5916
|
-
|
|
5951
|
+
MenuButton2.displayName = "MenuButton";
|
|
5917
5952
|
|
|
5918
5953
|
// src/components/MonthPicker/MonthPicker.tsx
|
|
5919
|
-
import
|
|
5954
|
+
import React36, { forwardRef as forwardRef9, useCallback as useCallback16, useEffect as useEffect11, useImperativeHandle as useImperativeHandle4, useRef as useRef10, useState as useState14 } from "react";
|
|
5920
5955
|
import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
|
|
5921
5956
|
import { styled as styled21, useThemeProps as useThemeProps6 } from "@mui/joy";
|
|
5922
5957
|
import { FocusTrap as FocusTrap3, ClickAwayListener as ClickAwayListener3, Popper as Popper4 } from "@mui/base";
|
|
@@ -6004,9 +6039,9 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
6004
6039
|
const [value, setValue, isControlled] = useControlledState(
|
|
6005
6040
|
props.value,
|
|
6006
6041
|
props.defaultValue || "",
|
|
6007
|
-
|
|
6042
|
+
useCallback16((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
6008
6043
|
);
|
|
6009
|
-
const getFormattedDisplayValue =
|
|
6044
|
+
const getFormattedDisplayValue = useCallback16(
|
|
6010
6045
|
(inputValue) => {
|
|
6011
6046
|
if (!inputValue) return "";
|
|
6012
6047
|
try {
|
|
@@ -6017,8 +6052,8 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
6017
6052
|
},
|
|
6018
6053
|
[format, displayFormat, locale]
|
|
6019
6054
|
);
|
|
6020
|
-
const [displayValue, setDisplayValue] =
|
|
6021
|
-
const [anchorEl, setAnchorEl] =
|
|
6055
|
+
const [displayValue, setDisplayValue] = useState14(() => getFormattedDisplayValue(value));
|
|
6056
|
+
const [anchorEl, setAnchorEl] = useState14(null);
|
|
6022
6057
|
const open = Boolean(anchorEl);
|
|
6023
6058
|
useEffect11(() => {
|
|
6024
6059
|
if (!anchorEl) {
|
|
@@ -6029,7 +6064,7 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
6029
6064
|
useEffect11(() => {
|
|
6030
6065
|
setDisplayValue(getFormattedDisplayValue(value));
|
|
6031
6066
|
}, [value, getFormattedDisplayValue]);
|
|
6032
|
-
const handleChange =
|
|
6067
|
+
const handleChange = useCallback16(
|
|
6033
6068
|
(event) => {
|
|
6034
6069
|
const newValue = event.target.value;
|
|
6035
6070
|
setValue(newValue);
|
|
@@ -6039,21 +6074,21 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
6039
6074
|
},
|
|
6040
6075
|
[setValue, getFormattedDisplayValue, isControlled]
|
|
6041
6076
|
);
|
|
6042
|
-
const handleCalendarToggle =
|
|
6077
|
+
const handleCalendarToggle = useCallback16(
|
|
6043
6078
|
(event) => {
|
|
6044
6079
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
6045
6080
|
innerRef.current?.focus();
|
|
6046
6081
|
},
|
|
6047
6082
|
[anchorEl, setAnchorEl, innerRef]
|
|
6048
6083
|
);
|
|
6049
|
-
const handleInputMouseDown =
|
|
6084
|
+
const handleInputMouseDown = useCallback16(
|
|
6050
6085
|
(event) => {
|
|
6051
6086
|
event.preventDefault();
|
|
6052
6087
|
buttonRef.current?.focus();
|
|
6053
6088
|
},
|
|
6054
6089
|
[buttonRef]
|
|
6055
6090
|
);
|
|
6056
|
-
return /* @__PURE__ */
|
|
6091
|
+
return /* @__PURE__ */ React36.createElement(MonthPickerRoot, null, /* @__PURE__ */ React36.createElement(FocusTrap3, { open: true }, /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(
|
|
6057
6092
|
Input_default,
|
|
6058
6093
|
{
|
|
6059
6094
|
...innerProps,
|
|
@@ -6083,7 +6118,7 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
6083
6118
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
6084
6119
|
fontFamily: "monospace"
|
|
6085
6120
|
},
|
|
6086
|
-
endDecorator: /* @__PURE__ */
|
|
6121
|
+
endDecorator: /* @__PURE__ */ React36.createElement(
|
|
6087
6122
|
IconButton_default,
|
|
6088
6123
|
{
|
|
6089
6124
|
ref: buttonRef,
|
|
@@ -6095,12 +6130,12 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
6095
6130
|
"aria-expanded": open,
|
|
6096
6131
|
disabled
|
|
6097
6132
|
},
|
|
6098
|
-
/* @__PURE__ */
|
|
6133
|
+
/* @__PURE__ */ React36.createElement(CalendarTodayIcon3, null)
|
|
6099
6134
|
),
|
|
6100
6135
|
label,
|
|
6101
6136
|
helperText
|
|
6102
6137
|
}
|
|
6103
|
-
), open && /* @__PURE__ */
|
|
6138
|
+
), open && /* @__PURE__ */ React36.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React36.createElement(
|
|
6104
6139
|
StyledPopper3,
|
|
6105
6140
|
{
|
|
6106
6141
|
id: "month-picker-popper",
|
|
@@ -6119,7 +6154,7 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
6119
6154
|
"aria-label": "Calendar Tooltip",
|
|
6120
6155
|
"aria-expanded": open
|
|
6121
6156
|
},
|
|
6122
|
-
/* @__PURE__ */
|
|
6157
|
+
/* @__PURE__ */ React36.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React36.createElement(
|
|
6123
6158
|
Calendar_default,
|
|
6124
6159
|
{
|
|
6125
6160
|
view: "month",
|
|
@@ -6140,14 +6175,14 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
6140
6175
|
disablePast,
|
|
6141
6176
|
locale
|
|
6142
6177
|
}
|
|
6143
|
-
), /* @__PURE__ */
|
|
6178
|
+
), /* @__PURE__ */ React36.createElement(
|
|
6144
6179
|
DialogActions_default,
|
|
6145
6180
|
{
|
|
6146
6181
|
sx: {
|
|
6147
6182
|
p: 1
|
|
6148
6183
|
}
|
|
6149
6184
|
},
|
|
6150
|
-
/* @__PURE__ */
|
|
6185
|
+
/* @__PURE__ */ React36.createElement(
|
|
6151
6186
|
Button_default,
|
|
6152
6187
|
{
|
|
6153
6188
|
size,
|
|
@@ -6170,7 +6205,7 @@ var MonthPicker = forwardRef9((inProps, ref) => {
|
|
|
6170
6205
|
});
|
|
6171
6206
|
|
|
6172
6207
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
6173
|
-
import
|
|
6208
|
+
import React37, { forwardRef as forwardRef10, useCallback as useCallback17, useEffect as useEffect12, useImperativeHandle as useImperativeHandle5, useMemo as useMemo14, useRef as useRef11, useState as useState15 } from "react";
|
|
6174
6209
|
import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
|
|
6175
6210
|
import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
|
|
6176
6211
|
import { styled as styled22, useThemeProps as useThemeProps7 } from "@mui/joy";
|
|
@@ -6231,9 +6266,9 @@ var parseDates2 = (str) => {
|
|
|
6231
6266
|
var formatToPattern3 = (format) => {
|
|
6232
6267
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
|
|
6233
6268
|
};
|
|
6234
|
-
var TextMaskAdapter7 =
|
|
6269
|
+
var TextMaskAdapter7 = React37.forwardRef(function TextMaskAdapter8(props, ref) {
|
|
6235
6270
|
const { onChange, format, ...other } = props;
|
|
6236
|
-
return /* @__PURE__ */
|
|
6271
|
+
return /* @__PURE__ */ React37.createElement(
|
|
6237
6272
|
IMaskInput3,
|
|
6238
6273
|
{
|
|
6239
6274
|
...other,
|
|
@@ -6290,14 +6325,14 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
6290
6325
|
const [value, setValue] = useControlledState(
|
|
6291
6326
|
props.value,
|
|
6292
6327
|
props.defaultValue || "",
|
|
6293
|
-
|
|
6328
|
+
useCallback17((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
6294
6329
|
);
|
|
6295
|
-
const [displayValue, setDisplayValue] =
|
|
6330
|
+
const [displayValue, setDisplayValue] = useState15(
|
|
6296
6331
|
() => value ? formatValueString4(parseDates2(value), displayFormat, locale) : ""
|
|
6297
6332
|
);
|
|
6298
|
-
const [anchorEl, setAnchorEl] =
|
|
6333
|
+
const [anchorEl, setAnchorEl] = useState15(null);
|
|
6299
6334
|
const open = Boolean(anchorEl);
|
|
6300
|
-
const calendarValue =
|
|
6335
|
+
const calendarValue = useMemo14(() => value ? parseDates2(value) : void 0, [value]);
|
|
6301
6336
|
useEffect12(() => {
|
|
6302
6337
|
if (value) {
|
|
6303
6338
|
try {
|
|
@@ -6316,7 +6351,7 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
6316
6351
|
}
|
|
6317
6352
|
}, [anchorEl, innerRef]);
|
|
6318
6353
|
useImperativeHandle5(ref, () => innerRef.current, [innerRef]);
|
|
6319
|
-
const handleChange =
|
|
6354
|
+
const handleChange = useCallback17(
|
|
6320
6355
|
(event) => {
|
|
6321
6356
|
setDisplayValue(
|
|
6322
6357
|
event.target.value ? formatValueString4(parseDates2(event.target.value), displayFormat, locale) : ""
|
|
@@ -6325,7 +6360,7 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
6325
6360
|
},
|
|
6326
6361
|
[displayFormat, locale, setValue]
|
|
6327
6362
|
);
|
|
6328
|
-
const handleInputMouseDown =
|
|
6363
|
+
const handleInputMouseDown = useCallback17(
|
|
6329
6364
|
(event) => {
|
|
6330
6365
|
if (isAlphabeticDisplay) {
|
|
6331
6366
|
event.preventDefault();
|
|
@@ -6334,14 +6369,14 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
6334
6369
|
},
|
|
6335
6370
|
[isAlphabeticDisplay, buttonRef]
|
|
6336
6371
|
);
|
|
6337
|
-
const handleCalendarToggle =
|
|
6372
|
+
const handleCalendarToggle = useCallback17(
|
|
6338
6373
|
(event) => {
|
|
6339
6374
|
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
6340
6375
|
innerRef.current?.focus();
|
|
6341
6376
|
},
|
|
6342
6377
|
[anchorEl, setAnchorEl, innerRef]
|
|
6343
6378
|
);
|
|
6344
|
-
const handleCalendarChange =
|
|
6379
|
+
const handleCalendarChange = useCallback17(
|
|
6345
6380
|
([date1, date2]) => {
|
|
6346
6381
|
if (!date1 || !date2) return;
|
|
6347
6382
|
const formattedValue = formatValueString4([date1, date2], format);
|
|
@@ -6351,7 +6386,7 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
6351
6386
|
},
|
|
6352
6387
|
[setValue, setAnchorEl, format, displayFormat, locale]
|
|
6353
6388
|
);
|
|
6354
|
-
return /* @__PURE__ */
|
|
6389
|
+
return /* @__PURE__ */ React37.createElement(MonthRangePickerRoot, null, /* @__PURE__ */ React37.createElement(FocusTrap4, { open: true }, /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(
|
|
6355
6390
|
Input_default,
|
|
6356
6391
|
{
|
|
6357
6392
|
...innerProps,
|
|
@@ -6381,7 +6416,7 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
6381
6416
|
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
6382
6417
|
fontFamily: "monospace"
|
|
6383
6418
|
},
|
|
6384
|
-
endDecorator: /* @__PURE__ */
|
|
6419
|
+
endDecorator: /* @__PURE__ */ React37.createElement(
|
|
6385
6420
|
IconButton_default,
|
|
6386
6421
|
{
|
|
6387
6422
|
ref: buttonRef,
|
|
@@ -6392,12 +6427,12 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
6392
6427
|
"aria-haspopup": "dialog",
|
|
6393
6428
|
"aria-expanded": open
|
|
6394
6429
|
},
|
|
6395
|
-
/* @__PURE__ */
|
|
6430
|
+
/* @__PURE__ */ React37.createElement(CalendarTodayIcon4, null)
|
|
6396
6431
|
),
|
|
6397
6432
|
label,
|
|
6398
6433
|
helperText
|
|
6399
6434
|
}
|
|
6400
|
-
), open && /* @__PURE__ */
|
|
6435
|
+
), open && /* @__PURE__ */ React37.createElement(ClickAwayListener4, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React37.createElement(
|
|
6401
6436
|
StyledPopper4,
|
|
6402
6437
|
{
|
|
6403
6438
|
id: "month-range-picker-popper",
|
|
@@ -6416,7 +6451,7 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
6416
6451
|
"aria-label": "Calendar Tooltip",
|
|
6417
6452
|
"aria-expanded": open
|
|
6418
6453
|
},
|
|
6419
|
-
/* @__PURE__ */
|
|
6454
|
+
/* @__PURE__ */ React37.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React37.createElement(
|
|
6420
6455
|
Calendar_default,
|
|
6421
6456
|
{
|
|
6422
6457
|
view: "month",
|
|
@@ -6430,14 +6465,14 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
6430
6465
|
disablePast,
|
|
6431
6466
|
locale
|
|
6432
6467
|
}
|
|
6433
|
-
), /* @__PURE__ */
|
|
6468
|
+
), /* @__PURE__ */ React37.createElement(
|
|
6434
6469
|
DialogActions_default,
|
|
6435
6470
|
{
|
|
6436
6471
|
sx: {
|
|
6437
6472
|
p: 1
|
|
6438
6473
|
}
|
|
6439
6474
|
},
|
|
6440
|
-
/* @__PURE__ */
|
|
6475
|
+
/* @__PURE__ */ React37.createElement(
|
|
6441
6476
|
Button_default,
|
|
6442
6477
|
{
|
|
6443
6478
|
size,
|
|
@@ -6456,7 +6491,7 @@ var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
|
6456
6491
|
MonthRangePicker.displayName = "MonthRangePicker";
|
|
6457
6492
|
|
|
6458
6493
|
// src/components/NavigationGroup/NavigationGroup.tsx
|
|
6459
|
-
import
|
|
6494
|
+
import React38 from "react";
|
|
6460
6495
|
import {
|
|
6461
6496
|
Accordion as JoyAccordion2,
|
|
6462
6497
|
AccordionSummary as JoyAccordionSummary2,
|
|
@@ -6487,11 +6522,11 @@ var AccordionDetails2 = styled23(JoyAccordionDetails2, {
|
|
|
6487
6522
|
}));
|
|
6488
6523
|
function NavigationGroup(props) {
|
|
6489
6524
|
const { title, children, startDecorator, level, ...rest } = props;
|
|
6490
|
-
return /* @__PURE__ */
|
|
6525
|
+
return /* @__PURE__ */ React38.createElement(JoyAccordion2, { ...rest }, /* @__PURE__ */ React38.createElement(AccordionSummary2, { useIcon: !!startDecorator, level }, /* @__PURE__ */ React38.createElement(Stack2, { direction: "row", gap: 4 }, startDecorator, title)), /* @__PURE__ */ React38.createElement(AccordionDetails2, null, children));
|
|
6491
6526
|
}
|
|
6492
6527
|
|
|
6493
6528
|
// src/components/NavigationItem/NavigationItem.tsx
|
|
6494
|
-
import
|
|
6529
|
+
import React39 from "react";
|
|
6495
6530
|
import {
|
|
6496
6531
|
ListItem as JoyListItem,
|
|
6497
6532
|
ListItemButton as JoyListItemButton,
|
|
@@ -6526,7 +6561,7 @@ function NavigationItem(props) {
|
|
|
6526
6561
|
const handleClick = () => {
|
|
6527
6562
|
onClick?.(id);
|
|
6528
6563
|
};
|
|
6529
|
-
return /* @__PURE__ */
|
|
6564
|
+
return /* @__PURE__ */ React39.createElement(JoyListItem, { ...rest }, /* @__PURE__ */ React39.createElement(
|
|
6530
6565
|
ListItemButton,
|
|
6531
6566
|
{
|
|
6532
6567
|
level,
|
|
@@ -6535,21 +6570,21 @@ function NavigationItem(props) {
|
|
|
6535
6570
|
"aria-current": selected,
|
|
6536
6571
|
onClick: handleClick
|
|
6537
6572
|
},
|
|
6538
|
-
startDecorator && /* @__PURE__ */
|
|
6573
|
+
startDecorator && /* @__PURE__ */ React39.createElement(JoyListItemDecorator, null, startDecorator),
|
|
6539
6574
|
children
|
|
6540
6575
|
));
|
|
6541
6576
|
}
|
|
6542
6577
|
|
|
6543
6578
|
// src/components/Navigator/Navigator.tsx
|
|
6544
|
-
import
|
|
6579
|
+
import React40 from "react";
|
|
6545
6580
|
function Navigator(props) {
|
|
6546
6581
|
const { items, level = 0, onSelect } = props;
|
|
6547
6582
|
const handleItemClick = (id) => {
|
|
6548
6583
|
onSelect?.(id);
|
|
6549
6584
|
};
|
|
6550
|
-
return /* @__PURE__ */
|
|
6585
|
+
return /* @__PURE__ */ React40.createElement("div", null, items.map((item, index) => {
|
|
6551
6586
|
if (item.type === "item") {
|
|
6552
|
-
return /* @__PURE__ */
|
|
6587
|
+
return /* @__PURE__ */ React40.createElement(
|
|
6553
6588
|
NavigationItem,
|
|
6554
6589
|
{
|
|
6555
6590
|
key: item.id,
|
|
@@ -6562,7 +6597,7 @@ function Navigator(props) {
|
|
|
6562
6597
|
item.title
|
|
6563
6598
|
);
|
|
6564
6599
|
} else if (item.type === "group") {
|
|
6565
|
-
return /* @__PURE__ */
|
|
6600
|
+
return /* @__PURE__ */ React40.createElement(
|
|
6566
6601
|
NavigationGroup,
|
|
6567
6602
|
{
|
|
6568
6603
|
key: `${item.title}-${index}`,
|
|
@@ -6580,16 +6615,16 @@ function Navigator(props) {
|
|
|
6580
6615
|
Navigator.displayName = "Navigator";
|
|
6581
6616
|
|
|
6582
6617
|
// src/components/PercentageInput/PercentageInput.tsx
|
|
6583
|
-
import
|
|
6618
|
+
import React41, { useCallback as useCallback18, useMemo as useMemo15, useState as useState16 } from "react";
|
|
6584
6619
|
import { NumericFormat as NumericFormat2 } from "react-number-format";
|
|
6585
6620
|
import { styled as styled25, useThemeProps as useThemeProps8 } from "@mui/joy";
|
|
6586
6621
|
var padDecimal = (value, decimalScale) => {
|
|
6587
6622
|
const [integer, decimal = ""] = `${value}`.split(".");
|
|
6588
6623
|
return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
|
|
6589
6624
|
};
|
|
6590
|
-
var TextMaskAdapter9 =
|
|
6625
|
+
var TextMaskAdapter9 = React41.forwardRef(function TextMaskAdapter10(props, ref) {
|
|
6591
6626
|
const { onChange, min, max, ...innerProps } = props;
|
|
6592
|
-
return /* @__PURE__ */
|
|
6627
|
+
return /* @__PURE__ */ React41.createElement(
|
|
6593
6628
|
NumericFormat2,
|
|
6594
6629
|
{
|
|
6595
6630
|
...innerProps,
|
|
@@ -6614,7 +6649,7 @@ var PercentageInputRoot = styled25(Input_default, {
|
|
|
6614
6649
|
slot: "Root",
|
|
6615
6650
|
overridesResolver: (props, styles) => styles.root
|
|
6616
6651
|
})({});
|
|
6617
|
-
var PercentageInput =
|
|
6652
|
+
var PercentageInput = React41.forwardRef(
|
|
6618
6653
|
function PercentageInput2(inProps, ref) {
|
|
6619
6654
|
const props = useThemeProps8({ props: inProps, name: "PercentageInput" });
|
|
6620
6655
|
const {
|
|
@@ -6637,18 +6672,18 @@ var PercentageInput = React40.forwardRef(
|
|
|
6637
6672
|
const [_value, setValue] = useControlledState(
|
|
6638
6673
|
props.value,
|
|
6639
6674
|
props.defaultValue,
|
|
6640
|
-
|
|
6675
|
+
useCallback18((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
6641
6676
|
);
|
|
6642
|
-
const [internalError, setInternalError] =
|
|
6677
|
+
const [internalError, setInternalError] = useState16(
|
|
6643
6678
|
max && _value && _value > max || min && _value && _value < min
|
|
6644
6679
|
);
|
|
6645
|
-
const value =
|
|
6680
|
+
const value = useMemo15(() => {
|
|
6646
6681
|
if (_value && useMinorUnit) {
|
|
6647
6682
|
return _value / Math.pow(10, maxDecimalScale);
|
|
6648
6683
|
}
|
|
6649
6684
|
return _value;
|
|
6650
6685
|
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
6651
|
-
const handleChange =
|
|
6686
|
+
const handleChange = useCallback18(
|
|
6652
6687
|
(event) => {
|
|
6653
6688
|
if (event.target.value === "") {
|
|
6654
6689
|
setValue(void 0);
|
|
@@ -6665,7 +6700,7 @@ var PercentageInput = React40.forwardRef(
|
|
|
6665
6700
|
},
|
|
6666
6701
|
[setValue, useMinorUnit, maxDecimalScale, min, max]
|
|
6667
6702
|
);
|
|
6668
|
-
return /* @__PURE__ */
|
|
6703
|
+
return /* @__PURE__ */ React41.createElement(
|
|
6669
6704
|
PercentageInputRoot,
|
|
6670
6705
|
{
|
|
6671
6706
|
...innerProps,
|
|
@@ -6706,7 +6741,7 @@ var RadioGroup = MotionRadioGroup;
|
|
|
6706
6741
|
RadioGroup.displayName = "RadioGroup";
|
|
6707
6742
|
|
|
6708
6743
|
// src/components/RadioTileGroup/RadioTileGroup.tsx
|
|
6709
|
-
import
|
|
6744
|
+
import React42 from "react";
|
|
6710
6745
|
import { styled as styled26, radioClasses, sheetClasses } from "@mui/joy";
|
|
6711
6746
|
var RadioTileGroupRoot = styled26(RadioGroup, {
|
|
6712
6747
|
name: "RadioTileGroup",
|
|
@@ -6794,7 +6829,7 @@ function RadioTileGroup(props) {
|
|
|
6794
6829
|
error,
|
|
6795
6830
|
required
|
|
6796
6831
|
} = props;
|
|
6797
|
-
const radioGroup = /* @__PURE__ */
|
|
6832
|
+
const radioGroup = /* @__PURE__ */ React42.createElement(
|
|
6798
6833
|
RadioTileGroupRoot,
|
|
6799
6834
|
{
|
|
6800
6835
|
overlay: true,
|
|
@@ -6805,7 +6840,7 @@ function RadioTileGroup(props) {
|
|
|
6805
6840
|
flex,
|
|
6806
6841
|
columns
|
|
6807
6842
|
},
|
|
6808
|
-
options.map((option) => /* @__PURE__ */
|
|
6843
|
+
options.map((option) => /* @__PURE__ */ React42.createElement(
|
|
6809
6844
|
RadioTileSheet,
|
|
6810
6845
|
{
|
|
6811
6846
|
key: option.value,
|
|
@@ -6815,7 +6850,7 @@ function RadioTileGroup(props) {
|
|
|
6815
6850
|
flex,
|
|
6816
6851
|
textAlign
|
|
6817
6852
|
},
|
|
6818
|
-
/* @__PURE__ */
|
|
6853
|
+
/* @__PURE__ */ React42.createElement(
|
|
6819
6854
|
Radio,
|
|
6820
6855
|
{
|
|
6821
6856
|
id: `${option.value}`,
|
|
@@ -6843,7 +6878,7 @@ function RadioTileGroup(props) {
|
|
|
6843
6878
|
}
|
|
6844
6879
|
}
|
|
6845
6880
|
),
|
|
6846
|
-
option.startDecorator && /* @__PURE__ */
|
|
6881
|
+
option.startDecorator && /* @__PURE__ */ React42.createElement(
|
|
6847
6882
|
Box_default,
|
|
6848
6883
|
{
|
|
6849
6884
|
sx: {
|
|
@@ -6864,49 +6899,49 @@ function RadioTileGroup(props) {
|
|
|
6864
6899
|
)
|
|
6865
6900
|
))
|
|
6866
6901
|
);
|
|
6867
|
-
return /* @__PURE__ */
|
|
6902
|
+
return /* @__PURE__ */ React42.createElement(FormControl_default, { required, disabled: allDisabled, error, size, sx, className }, label && /* @__PURE__ */ React42.createElement(FormLabel_default, null, label), radioGroup, helperText && /* @__PURE__ */ React42.createElement(FormHelperText_default, null, helperText));
|
|
6868
6903
|
}
|
|
6869
6904
|
RadioTileGroup.displayName = "RadioTileGroup";
|
|
6870
6905
|
|
|
6871
6906
|
// src/components/RadioList/RadioList.tsx
|
|
6872
|
-
import
|
|
6907
|
+
import React43 from "react";
|
|
6873
6908
|
function RadioList(props) {
|
|
6874
6909
|
const { items, ...innerProps } = props;
|
|
6875
|
-
return /* @__PURE__ */
|
|
6910
|
+
return /* @__PURE__ */ React43.createElement(RadioGroup, { ...innerProps }, items.map((item) => /* @__PURE__ */ React43.createElement(Radio, { key: `${item.value}`, value: item.value, label: item.label })));
|
|
6876
6911
|
}
|
|
6877
6912
|
RadioList.displayName = "RadioList";
|
|
6878
6913
|
|
|
6879
6914
|
// src/components/SearchBar/SearchBar.tsx
|
|
6880
|
-
import * as
|
|
6915
|
+
import * as React44 from "react";
|
|
6881
6916
|
import { styled as styled27, useThemeProps as useThemeProps9 } from "@mui/joy/styles";
|
|
6917
|
+
import Box2 from "@mui/joy/Box";
|
|
6882
6918
|
import SearchRoundedIcon from "@mui/icons-material/SearchRounded";
|
|
6883
6919
|
import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
|
|
6884
|
-
var SearchBarRoot = styled27(
|
|
6920
|
+
var SearchBarRoot = styled27(Box2, {
|
|
6885
6921
|
name: "SearchBar",
|
|
6886
|
-
slot: "root"
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
var SearchBar = React43.forwardRef(function SearchBar2(inProps, ref) {
|
|
6922
|
+
slot: "root",
|
|
6923
|
+
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
6924
|
+
})(({ theme, ownerState }) => ({
|
|
6925
|
+
display: "inline-flex",
|
|
6926
|
+
flexDirection: "row",
|
|
6927
|
+
minWidth: "220px",
|
|
6928
|
+
...ownerState.showSelect && { maxWidth: "330px" },
|
|
6929
|
+
backgroundColor: theme.vars.palette.background.surface,
|
|
6930
|
+
borderRadius: theme.vars.radius.sm,
|
|
6931
|
+
border: `1px solid ${theme.vars.palette.neutral.outlinedBorder}`,
|
|
6932
|
+
overflow: "hidden",
|
|
6933
|
+
flexShrink: 0
|
|
6934
|
+
}));
|
|
6935
|
+
var SearchBar = React44.forwardRef(function SearchBar2(inProps, ref) {
|
|
6901
6936
|
const props = useThemeProps9({ props: inProps, name: "SearchBar" });
|
|
6902
|
-
const {
|
|
6903
|
-
const [selectVal, setSelectVal] =
|
|
6904
|
-
const [isHovered, setIsHovered] =
|
|
6905
|
-
const ownerState = {
|
|
6937
|
+
const { showSelect = false, options, placeholder: placeholderProp, value, onChange, onSearch, ...other } = props;
|
|
6938
|
+
const [selectVal, setSelectVal] = React44.useState(options?.[0]?.value ?? "");
|
|
6939
|
+
const [isHovered, setIsHovered] = React44.useState(false);
|
|
6940
|
+
const ownerState = { showSelect };
|
|
6906
6941
|
const selectedOption = options?.find((o) => o.value === selectVal);
|
|
6907
|
-
const placeholder = selectedOption?.placeholder ?? "";
|
|
6942
|
+
const placeholder = placeholderProp ?? selectedOption?.placeholder ?? "";
|
|
6908
6943
|
const handleSearch = () => {
|
|
6909
|
-
onSearch?.({ selectValue:
|
|
6944
|
+
onSearch?.({ selectValue: showSelect ? selectVal : void 0, inputValue: value });
|
|
6910
6945
|
};
|
|
6911
6946
|
const handleClear = () => {
|
|
6912
6947
|
onChange("");
|
|
@@ -6916,7 +6951,7 @@ var SearchBar = React43.forwardRef(function SearchBar2(inProps, ref) {
|
|
|
6916
6951
|
handleSearch();
|
|
6917
6952
|
}
|
|
6918
6953
|
};
|
|
6919
|
-
return /* @__PURE__ */
|
|
6954
|
+
return /* @__PURE__ */ React44.createElement(SearchBarRoot, { ref, ownerState, ...other }, showSelect && options && /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement(
|
|
6920
6955
|
Select,
|
|
6921
6956
|
{
|
|
6922
6957
|
variant: "plain",
|
|
@@ -6925,14 +6960,14 @@ var SearchBar = React43.forwardRef(function SearchBar2(inProps, ref) {
|
|
|
6925
6960
|
value: selectVal,
|
|
6926
6961
|
options,
|
|
6927
6962
|
onChange: (_, newValue) => setSelectVal(newValue),
|
|
6928
|
-
sx: { flex: 1, maxWidth: "110px" },
|
|
6963
|
+
sx: { flex: 1, minWidth: "80px", maxWidth: "110px" },
|
|
6929
6964
|
slotProps: {
|
|
6930
6965
|
button: {
|
|
6931
6966
|
style: { display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
6932
6967
|
}
|
|
6933
6968
|
}
|
|
6934
6969
|
}
|
|
6935
|
-
), /* @__PURE__ */
|
|
6970
|
+
), /* @__PURE__ */ React44.createElement(Divider, { orientation: "vertical", sx: { height: (theme) => theme.spacing(4), alignSelf: "center" } })), /* @__PURE__ */ React44.createElement(
|
|
6936
6971
|
Input,
|
|
6937
6972
|
{
|
|
6938
6973
|
variant: "plain",
|
|
@@ -6945,7 +6980,7 @@ var SearchBar = React43.forwardRef(function SearchBar2(inProps, ref) {
|
|
|
6945
6980
|
sx: { flex: 1, minWidth: 0 },
|
|
6946
6981
|
onMouseEnter: () => setIsHovered(true),
|
|
6947
6982
|
onMouseLeave: () => setIsHovered(false),
|
|
6948
|
-
endDecorator: isHovered && value ? /* @__PURE__ */
|
|
6983
|
+
endDecorator: isHovered && value ? /* @__PURE__ */ React44.createElement(
|
|
6949
6984
|
IconButton,
|
|
6950
6985
|
{
|
|
6951
6986
|
variant: "plain",
|
|
@@ -6955,15 +6990,15 @@ var SearchBar = React43.forwardRef(function SearchBar2(inProps, ref) {
|
|
|
6955
6990
|
onClick: handleClear,
|
|
6956
6991
|
"aria-label": "Clear"
|
|
6957
6992
|
},
|
|
6958
|
-
/* @__PURE__ */
|
|
6993
|
+
/* @__PURE__ */ React44.createElement(CloseRoundedIcon, null)
|
|
6959
6994
|
) : void 0
|
|
6960
6995
|
}
|
|
6961
|
-
), /* @__PURE__ */
|
|
6996
|
+
), /* @__PURE__ */ React44.createElement(IconButton, { variant: "plain", size: "sm", color: "neutral", onClick: handleSearch, "aria-label": "Search" }, /* @__PURE__ */ React44.createElement(SearchRoundedIcon, null)));
|
|
6962
6997
|
});
|
|
6963
6998
|
SearchBar.displayName = "SearchBar";
|
|
6964
6999
|
|
|
6965
7000
|
// src/components/Stepper/Stepper.tsx
|
|
6966
|
-
import
|
|
7001
|
+
import React45 from "react";
|
|
6967
7002
|
import {
|
|
6968
7003
|
Stepper as JoyStepper,
|
|
6969
7004
|
Step as JoyStep,
|
|
@@ -6999,7 +7034,7 @@ function Stepper(props) {
|
|
|
6999
7034
|
stepOrientation = "horizontal"
|
|
7000
7035
|
} = props;
|
|
7001
7036
|
const effectiveStepOrientation = orientation === "vertical" ? "horizontal" : stepOrientation;
|
|
7002
|
-
return /* @__PURE__ */
|
|
7037
|
+
return /* @__PURE__ */ React45.createElement(
|
|
7003
7038
|
MotionStepper,
|
|
7004
7039
|
{
|
|
7005
7040
|
orientation,
|
|
@@ -7038,23 +7073,23 @@ function Stepper(props) {
|
|
|
7038
7073
|
const completed = activeStep > i + 1;
|
|
7039
7074
|
const disabled = activeStep < i + 1;
|
|
7040
7075
|
const hasContent = step.label || step.extraContent;
|
|
7041
|
-
return /* @__PURE__ */
|
|
7076
|
+
return /* @__PURE__ */ React45.createElement(
|
|
7042
7077
|
Step,
|
|
7043
7078
|
{
|
|
7044
7079
|
key: `step-${i}`,
|
|
7045
|
-
indicator: /* @__PURE__ */
|
|
7080
|
+
indicator: /* @__PURE__ */ React45.createElement(StepIndicator, { variant: disabled ? "outlined" : "solid", color: disabled ? "neutral" : "primary" }, completed ? /* @__PURE__ */ React45.createElement(CheckIcon, null) : step.indicatorContent),
|
|
7046
7081
|
active,
|
|
7047
7082
|
completed,
|
|
7048
7083
|
disabled,
|
|
7049
7084
|
orientation: effectiveStepOrientation
|
|
7050
7085
|
},
|
|
7051
|
-
hasContent && /* @__PURE__ */
|
|
7086
|
+
hasContent && /* @__PURE__ */ React45.createElement(
|
|
7052
7087
|
Stack_default,
|
|
7053
7088
|
{
|
|
7054
7089
|
sx: orientation === "horizontal" && effectiveStepOrientation === "vertical" ? { alignItems: "center" } : {}
|
|
7055
7090
|
},
|
|
7056
|
-
step.label && /* @__PURE__ */
|
|
7057
|
-
step.extraContent && /* @__PURE__ */
|
|
7091
|
+
step.label && /* @__PURE__ */ React45.createElement(Typography_default, { level: "title-sm" }, step.label),
|
|
7092
|
+
step.extraContent && /* @__PURE__ */ React45.createElement(Typography_default, { level: "body-xs" }, step.extraContent)
|
|
7058
7093
|
)
|
|
7059
7094
|
);
|
|
7060
7095
|
})
|
|
@@ -7063,7 +7098,7 @@ function Stepper(props) {
|
|
|
7063
7098
|
Stepper.displayName = "Stepper";
|
|
7064
7099
|
|
|
7065
7100
|
// src/components/Switch/Switch.tsx
|
|
7066
|
-
import
|
|
7101
|
+
import React46 from "react";
|
|
7067
7102
|
import { Switch as JoySwitch, styled as styled29, switchClasses } from "@mui/joy";
|
|
7068
7103
|
import { motion as motion28 } from "framer-motion";
|
|
7069
7104
|
var MotionSwitch = motion28(JoySwitch);
|
|
@@ -7085,14 +7120,14 @@ var StyledThumb = styled29(motion28.div)({
|
|
|
7085
7120
|
right: "var(--Switch-thumbOffset)"
|
|
7086
7121
|
}
|
|
7087
7122
|
});
|
|
7088
|
-
var Thumb = (props) => /* @__PURE__ */
|
|
7123
|
+
var Thumb = (props) => /* @__PURE__ */ React46.createElement(StyledThumb, { ...props, layout: true, transition: spring });
|
|
7089
7124
|
var spring = {
|
|
7090
7125
|
type: "spring",
|
|
7091
7126
|
stiffness: 700,
|
|
7092
7127
|
damping: 30
|
|
7093
7128
|
};
|
|
7094
7129
|
var Switch = (props) => {
|
|
7095
|
-
return /* @__PURE__ */
|
|
7130
|
+
return /* @__PURE__ */ React46.createElement(
|
|
7096
7131
|
MotionSwitch,
|
|
7097
7132
|
{
|
|
7098
7133
|
...props,
|
|
@@ -7106,7 +7141,7 @@ var Switch = (props) => {
|
|
|
7106
7141
|
Switch.displayName = "Switch";
|
|
7107
7142
|
|
|
7108
7143
|
// src/components/Tabs/Tabs.tsx
|
|
7109
|
-
import
|
|
7144
|
+
import React47, { forwardRef as forwardRef12 } from "react";
|
|
7110
7145
|
import {
|
|
7111
7146
|
Tabs as JoyTabs,
|
|
7112
7147
|
Tab as JoyTab,
|
|
@@ -7130,14 +7165,14 @@ var StyledTab = styled30(JoyTab)(({ theme }) => ({
|
|
|
7130
7165
|
}
|
|
7131
7166
|
}));
|
|
7132
7167
|
var Tab = forwardRef12(function Tab2({ startDecorator, endDecorator, children, ...props }, ref) {
|
|
7133
|
-
return /* @__PURE__ */
|
|
7168
|
+
return /* @__PURE__ */ React47.createElement(StyledTab, { ...props, ref }, startDecorator, children, endDecorator);
|
|
7134
7169
|
});
|
|
7135
7170
|
Tab.displayName = "Tab";
|
|
7136
7171
|
var TabList = JoyTabList;
|
|
7137
7172
|
var TabPanel = JoyTabPanel;
|
|
7138
7173
|
|
|
7139
7174
|
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
7140
|
-
import
|
|
7175
|
+
import React48 from "react";
|
|
7141
7176
|
import {
|
|
7142
7177
|
CssBaseline,
|
|
7143
7178
|
CssVarsProvider,
|
|
@@ -7394,12 +7429,12 @@ var defaultTheme = extendTheme({
|
|
|
7394
7429
|
});
|
|
7395
7430
|
function ThemeProvider(props) {
|
|
7396
7431
|
const theme = props.theme || defaultTheme;
|
|
7397
|
-
return /* @__PURE__ */
|
|
7432
|
+
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(CssVarsProvider, { theme }, /* @__PURE__ */ React48.createElement(CssBaseline, null), props.children));
|
|
7398
7433
|
}
|
|
7399
7434
|
ThemeProvider.displayName = "ThemeProvider";
|
|
7400
7435
|
|
|
7401
7436
|
// src/components/Uploader/Uploader.tsx
|
|
7402
|
-
import
|
|
7437
|
+
import React49, { useCallback as useCallback19, useEffect as useEffect13, useMemo as useMemo16, useRef as useRef12, useState as useState18 } from "react";
|
|
7403
7438
|
import { styled as styled31, Input as Input2 } from "@mui/joy";
|
|
7404
7439
|
import MuiFileUploadIcon from "@mui/icons-material/CloudUploadRounded";
|
|
7405
7440
|
import MuiUploadFileIcon from "@mui/icons-material/UploadFileRounded";
|
|
@@ -7476,7 +7511,7 @@ var getFileSize = (n) => {
|
|
|
7476
7511
|
};
|
|
7477
7512
|
var Preview = (props) => {
|
|
7478
7513
|
const { files, uploaded, onDelete } = props;
|
|
7479
|
-
return /* @__PURE__ */
|
|
7514
|
+
return /* @__PURE__ */ React49.createElement(PreviewRoot, { gap: 1 }, [...uploaded, ...files].map((file) => /* @__PURE__ */ React49.createElement(UploadCard, { key: file.name, size: "sm", color: "neutral" }, /* @__PURE__ */ React49.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2 }, /* @__PURE__ */ React49.createElement(UploadFileIcon, null), /* @__PURE__ */ React49.createElement(Stack_default, { flex: "1", sx: { overflow: "hidden" } }, /* @__PURE__ */ React49.createElement(
|
|
7480
7515
|
Typography_default,
|
|
7481
7516
|
{
|
|
7482
7517
|
level: "body-sm",
|
|
@@ -7488,7 +7523,7 @@ var Preview = (props) => {
|
|
|
7488
7523
|
}
|
|
7489
7524
|
},
|
|
7490
7525
|
file.name
|
|
7491
|
-
), !!file.size && /* @__PURE__ */
|
|
7526
|
+
), !!file.size && /* @__PURE__ */ React49.createElement(Typography_default, { level: "body-xs", fontWeight: "300", lineHeight: "1.33", textColor: "text.tertiary" }, getFileSize(file.size))), /* @__PURE__ */ React49.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ React49.createElement(ClearIcon2, null))))));
|
|
7492
7527
|
};
|
|
7493
7528
|
var UploaderRoot = styled31(Stack_default, {
|
|
7494
7529
|
name: "Uploader",
|
|
@@ -7531,232 +7566,230 @@ var UploaderIcon = styled31(MuiFileUploadIcon, {
|
|
|
7531
7566
|
}
|
|
7532
7567
|
})
|
|
7533
7568
|
);
|
|
7534
|
-
var Uploader =
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
(
|
|
7560
|
-
|
|
7561
|
-
return ALL_EXTENSIONS_BY_TYPE[type];
|
|
7562
|
-
}
|
|
7563
|
-
return type;
|
|
7564
|
-
}),
|
|
7565
|
-
[accepts]
|
|
7566
|
-
);
|
|
7567
|
-
const helperText = useMemo15(() => {
|
|
7568
|
-
if (helperTextProp) {
|
|
7569
|
-
return helperTextProp;
|
|
7569
|
+
var Uploader = React49.memo((props) => {
|
|
7570
|
+
const {
|
|
7571
|
+
accept,
|
|
7572
|
+
minCount,
|
|
7573
|
+
maxCount,
|
|
7574
|
+
name,
|
|
7575
|
+
size,
|
|
7576
|
+
maxFileSize,
|
|
7577
|
+
maxFileTotalSize,
|
|
7578
|
+
onChange,
|
|
7579
|
+
label,
|
|
7580
|
+
disabled,
|
|
7581
|
+
onDelete,
|
|
7582
|
+
error: errorProp,
|
|
7583
|
+
helperText: helperTextProp
|
|
7584
|
+
} = props;
|
|
7585
|
+
const dropZoneRef = useRef12(null);
|
|
7586
|
+
const inputRef = useRef12(null);
|
|
7587
|
+
const [errorText, setErrorText] = useState18();
|
|
7588
|
+
const [files, setFiles] = useState18([]);
|
|
7589
|
+
const [uploaded, setUploaded] = useState18(props.uploaded || []);
|
|
7590
|
+
const [previewState, setPreviewState] = useState18("idle");
|
|
7591
|
+
const accepts = useMemo16(() => accept.split(",").map((accept2) => accept2.trim()), [accept]);
|
|
7592
|
+
const parsedAccepts = useMemo16(
|
|
7593
|
+
() => accepts.flatMap((type) => {
|
|
7594
|
+
if (["image/*", "video/*", "audio/*"].includes(type)) {
|
|
7595
|
+
return ALL_EXTENSIONS_BY_TYPE[type];
|
|
7570
7596
|
}
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7597
|
+
return type;
|
|
7598
|
+
}),
|
|
7599
|
+
[accepts]
|
|
7600
|
+
);
|
|
7601
|
+
const helperText = useMemo16(() => {
|
|
7602
|
+
if (helperTextProp) {
|
|
7603
|
+
return helperTextProp;
|
|
7604
|
+
}
|
|
7605
|
+
const [allAcceptedTypes, acceptedTypes] = [
|
|
7606
|
+
accepts.filter((accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
|
|
7607
|
+
const [type] = accept2.split("/");
|
|
7608
|
+
return type.toLowerCase();
|
|
7609
|
+
}),
|
|
7610
|
+
accepts.filter((accept2) => !["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
|
|
7611
|
+
const [extensionOrType, subType] = accept2.split("/");
|
|
7612
|
+
if (!subType) {
|
|
7613
|
+
return extensionOrType.toUpperCase().replace(".", "");
|
|
7614
|
+
}
|
|
7615
|
+
return subType.toUpperCase();
|
|
7616
|
+
})
|
|
7617
|
+
];
|
|
7618
|
+
const helperTexts = [];
|
|
7619
|
+
if (allAcceptedTypes.length > 0) {
|
|
7620
|
+
helperTexts.push(`Any ${allAcceptedTypes.join(", ")} file`);
|
|
7621
|
+
}
|
|
7622
|
+
if (acceptedTypes.length > 0) {
|
|
7623
|
+
helperTexts.push(acceptedTypes.join(", "));
|
|
7624
|
+
}
|
|
7625
|
+
helperTexts.push(`Maximum ${getFileSize(maxFileTotalSize)}`);
|
|
7626
|
+
if (maxCount) {
|
|
7627
|
+
helperTexts.push(`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`);
|
|
7628
|
+
}
|
|
7629
|
+
return helperTexts.join(", ");
|
|
7630
|
+
}, [accepts, maxFileTotalSize, maxCount, helperTextProp]);
|
|
7631
|
+
const error = useMemo16(() => !!errorText || errorProp, [errorProp, errorText]);
|
|
7632
|
+
const showDropZone = useMemo16(
|
|
7633
|
+
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
7634
|
+
[files, maxCount, uploaded]
|
|
7635
|
+
);
|
|
7636
|
+
const addFiles = useCallback19(
|
|
7637
|
+
(uploads) => {
|
|
7638
|
+
try {
|
|
7639
|
+
const types = parsedAccepts.map((type) => type.replace(".", "")) || [];
|
|
7640
|
+
const fileExtension = new RegExp(`${types.join("|")}`);
|
|
7641
|
+
uploads.forEach((file) => {
|
|
7642
|
+
const ext = file.name.split(".").pop() || "";
|
|
7643
|
+
if (!fileExtension.test(ext)) {
|
|
7644
|
+
throw new Error("Please upload the correct file type.");
|
|
7580
7645
|
}
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
];
|
|
7584
|
-
const helperTexts = [];
|
|
7585
|
-
if (allAcceptedTypes.length > 0) {
|
|
7586
|
-
helperTexts.push(`Any ${allAcceptedTypes.join(", ")} file`);
|
|
7587
|
-
}
|
|
7588
|
-
if (acceptedTypes.length > 0) {
|
|
7589
|
-
helperTexts.push(acceptedTypes.join(", "));
|
|
7590
|
-
}
|
|
7591
|
-
helperTexts.push(`Maximum ${getFileSize(maxFileTotalSize)}`);
|
|
7592
|
-
if (maxCount) {
|
|
7593
|
-
helperTexts.push(`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`);
|
|
7594
|
-
}
|
|
7595
|
-
return helperTexts.join(", ");
|
|
7596
|
-
}, [accepts, maxFileTotalSize, maxCount, helperTextProp]);
|
|
7597
|
-
const error = useMemo15(() => !!errorText || errorProp, [errorProp, errorText]);
|
|
7598
|
-
const showDropZone = useMemo15(
|
|
7599
|
-
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
7600
|
-
[files, maxCount, uploaded]
|
|
7601
|
-
);
|
|
7602
|
-
const addFiles = useCallback18(
|
|
7603
|
-
(uploads) => {
|
|
7604
|
-
try {
|
|
7605
|
-
const types = parsedAccepts.map((type) => type.replace(".", "")) || [];
|
|
7606
|
-
const fileExtension = new RegExp(`${types.join("|")}`);
|
|
7646
|
+
});
|
|
7647
|
+
if (maxFileSize) {
|
|
7607
7648
|
uploads.forEach((file) => {
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7649
|
+
if (file.size > maxFileSize) {
|
|
7650
|
+
throw new Error(
|
|
7651
|
+
`One or more files exceeded the maximum file size. Each file size must be ${getFileSize(
|
|
7652
|
+
maxFileSize
|
|
7653
|
+
)} or less.`
|
|
7654
|
+
);
|
|
7611
7655
|
}
|
|
7612
7656
|
});
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
throw new Error(`The total file size exceeds the maximum limit.`);
|
|
7627
|
-
}
|
|
7628
|
-
const newFiles = [...files, ...uploads];
|
|
7629
|
-
if (maxCount && [...uploaded, ...newFiles].length > maxCount) {
|
|
7630
|
-
throw new Error(`Exceeded the maximum number of files.`);
|
|
7657
|
+
}
|
|
7658
|
+
const totalFileSize = [...files, ...uploads].reduce((acc, file) => acc + file.size, 0);
|
|
7659
|
+
if (totalFileSize > maxFileTotalSize) {
|
|
7660
|
+
throw new Error(`The total file size exceeds the maximum limit.`);
|
|
7661
|
+
}
|
|
7662
|
+
const newFiles = [...files, ...uploads];
|
|
7663
|
+
if (maxCount && [...uploaded, ...newFiles].length > maxCount) {
|
|
7664
|
+
throw new Error(`Exceeded the maximum number of files.`);
|
|
7665
|
+
}
|
|
7666
|
+
onChange?.({
|
|
7667
|
+
target: {
|
|
7668
|
+
name,
|
|
7669
|
+
value: newFiles
|
|
7631
7670
|
}
|
|
7671
|
+
});
|
|
7672
|
+
setFiles(newFiles);
|
|
7673
|
+
setErrorText(void 0);
|
|
7674
|
+
} catch (error2) {
|
|
7675
|
+
const err = error2;
|
|
7676
|
+
setErrorText(err.message);
|
|
7677
|
+
}
|
|
7678
|
+
},
|
|
7679
|
+
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
7680
|
+
);
|
|
7681
|
+
useEffect13(() => {
|
|
7682
|
+
if (!dropZoneRef.current || disabled) {
|
|
7683
|
+
return;
|
|
7684
|
+
}
|
|
7685
|
+
let cleanup;
|
|
7686
|
+
Promise.all([esmFiles.combine, esmFiles.adapter, esmFiles.file, esmFiles.preventUnhandled]).then(
|
|
7687
|
+
([combineModule, adapterModule, fileModule, preventUnhandledModule]) => {
|
|
7688
|
+
const { combine } = combineModule;
|
|
7689
|
+
const { dropTargetForExternal, monitorForExternal } = adapterModule;
|
|
7690
|
+
const { containsFiles, getFiles } = fileModule;
|
|
7691
|
+
const { preventUnhandled } = preventUnhandledModule;
|
|
7692
|
+
cleanup = combine(
|
|
7693
|
+
dropTargetForExternal({
|
|
7694
|
+
element: dropZoneRef.current,
|
|
7695
|
+
canDrop: containsFiles,
|
|
7696
|
+
onDragEnter: () => setPreviewState("over"),
|
|
7697
|
+
onDragLeave: () => setPreviewState("potential"),
|
|
7698
|
+
onDrop: async ({ source }) => {
|
|
7699
|
+
const files2 = await getFiles({ source });
|
|
7700
|
+
addFiles(files2);
|
|
7701
|
+
}
|
|
7702
|
+
}),
|
|
7703
|
+
monitorForExternal({
|
|
7704
|
+
canMonitor: containsFiles,
|
|
7705
|
+
onDragStart: () => {
|
|
7706
|
+
setPreviewState("potential");
|
|
7707
|
+
preventUnhandled.start();
|
|
7708
|
+
},
|
|
7709
|
+
onDrop: () => {
|
|
7710
|
+
setPreviewState("idle");
|
|
7711
|
+
preventUnhandled.stop();
|
|
7712
|
+
}
|
|
7713
|
+
})
|
|
7714
|
+
);
|
|
7715
|
+
}
|
|
7716
|
+
);
|
|
7717
|
+
return () => cleanup?.();
|
|
7718
|
+
}, [disabled, addFiles]);
|
|
7719
|
+
useEffect13(() => {
|
|
7720
|
+
if (inputRef.current && minCount) {
|
|
7721
|
+
if (files.length < minCount) {
|
|
7722
|
+
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
7723
|
+
} else {
|
|
7724
|
+
inputRef.current.setCustomValidity("");
|
|
7725
|
+
}
|
|
7726
|
+
}
|
|
7727
|
+
}, [inputRef, files, minCount]);
|
|
7728
|
+
const handleFileChanged = useCallback19(
|
|
7729
|
+
(event) => {
|
|
7730
|
+
const files2 = Array.from(event.target.files || []);
|
|
7731
|
+
addFiles(files2);
|
|
7732
|
+
},
|
|
7733
|
+
[addFiles]
|
|
7734
|
+
);
|
|
7735
|
+
const handleDeleteFile = useCallback19(
|
|
7736
|
+
(deletedFile) => {
|
|
7737
|
+
if (deletedFile instanceof File) {
|
|
7738
|
+
setFiles((current) => {
|
|
7632
7739
|
onChange?.({
|
|
7633
7740
|
target: {
|
|
7634
7741
|
name,
|
|
7635
|
-
value:
|
|
7742
|
+
value: current.filter((file) => file !== deletedFile)
|
|
7636
7743
|
}
|
|
7637
7744
|
});
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
}
|
|
7644
|
-
},
|
|
7645
|
-
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
7646
|
-
);
|
|
7647
|
-
useEffect13(() => {
|
|
7648
|
-
if (!dropZoneRef.current || disabled) {
|
|
7649
|
-
return;
|
|
7650
|
-
}
|
|
7651
|
-
let cleanup;
|
|
7652
|
-
Promise.all([esmFiles.combine, esmFiles.adapter, esmFiles.file, esmFiles.preventUnhandled]).then(
|
|
7653
|
-
([combineModule, adapterModule, fileModule, preventUnhandledModule]) => {
|
|
7654
|
-
const { combine } = combineModule;
|
|
7655
|
-
const { dropTargetForExternal, monitorForExternal } = adapterModule;
|
|
7656
|
-
const { containsFiles, getFiles } = fileModule;
|
|
7657
|
-
const { preventUnhandled } = preventUnhandledModule;
|
|
7658
|
-
cleanup = combine(
|
|
7659
|
-
dropTargetForExternal({
|
|
7660
|
-
element: dropZoneRef.current,
|
|
7661
|
-
canDrop: containsFiles,
|
|
7662
|
-
onDragEnter: () => setPreviewState("over"),
|
|
7663
|
-
onDragLeave: () => setPreviewState("potential"),
|
|
7664
|
-
onDrop: async ({ source }) => {
|
|
7665
|
-
const files2 = await getFiles({ source });
|
|
7666
|
-
addFiles(files2);
|
|
7667
|
-
}
|
|
7668
|
-
}),
|
|
7669
|
-
monitorForExternal({
|
|
7670
|
-
canMonitor: containsFiles,
|
|
7671
|
-
onDragStart: () => {
|
|
7672
|
-
setPreviewState("potential");
|
|
7673
|
-
preventUnhandled.start();
|
|
7674
|
-
},
|
|
7675
|
-
onDrop: () => {
|
|
7676
|
-
setPreviewState("idle");
|
|
7677
|
-
preventUnhandled.stop();
|
|
7678
|
-
}
|
|
7679
|
-
})
|
|
7680
|
-
);
|
|
7681
|
-
}
|
|
7682
|
-
);
|
|
7683
|
-
return () => cleanup?.();
|
|
7684
|
-
}, [disabled, addFiles]);
|
|
7685
|
-
useEffect13(() => {
|
|
7686
|
-
if (inputRef.current && minCount) {
|
|
7687
|
-
if (files.length < minCount) {
|
|
7688
|
-
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
7689
|
-
} else {
|
|
7690
|
-
inputRef.current.setCustomValidity("");
|
|
7691
|
-
}
|
|
7745
|
+
return current.filter((file) => file !== deletedFile);
|
|
7746
|
+
});
|
|
7747
|
+
} else {
|
|
7748
|
+
setUploaded((uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id));
|
|
7749
|
+
onDelete?.(deletedFile);
|
|
7692
7750
|
}
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
});
|
|
7713
|
-
} else {
|
|
7714
|
-
setUploaded((uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id));
|
|
7715
|
-
onDelete?.(deletedFile);
|
|
7716
|
-
}
|
|
7717
|
-
setErrorText(void 0);
|
|
7718
|
-
},
|
|
7719
|
-
[name, onChange, onDelete]
|
|
7720
|
-
);
|
|
7721
|
-
const handleUploaderButtonClick = useCallback18(() => {
|
|
7722
|
-
inputRef.current?.click();
|
|
7723
|
-
}, []);
|
|
7724
|
-
const uploader = /* @__PURE__ */ React48.createElement(
|
|
7725
|
-
FileDropZone,
|
|
7751
|
+
setErrorText(void 0);
|
|
7752
|
+
},
|
|
7753
|
+
[name, onChange, onDelete]
|
|
7754
|
+
);
|
|
7755
|
+
const handleUploaderButtonClick = useCallback19(() => {
|
|
7756
|
+
inputRef.current?.click();
|
|
7757
|
+
}, []);
|
|
7758
|
+
const uploader = /* @__PURE__ */ React49.createElement(
|
|
7759
|
+
FileDropZone,
|
|
7760
|
+
{
|
|
7761
|
+
state: previewState,
|
|
7762
|
+
error: !!(error || errorText),
|
|
7763
|
+
disabled,
|
|
7764
|
+
ref: dropZoneRef,
|
|
7765
|
+
onClick: handleUploaderButtonClick
|
|
7766
|
+
},
|
|
7767
|
+
/* @__PURE__ */ React49.createElement(Stack_default, { alignItems: "center", gap: 1 }, /* @__PURE__ */ React49.createElement(UploaderIcon, { state: previewState, error: !!(error || errorText), disabled })),
|
|
7768
|
+
/* @__PURE__ */ React49.createElement(
|
|
7769
|
+
VisuallyHiddenInput,
|
|
7726
7770
|
{
|
|
7727
|
-
state: previewState,
|
|
7728
|
-
error: !!(error || errorText),
|
|
7729
7771
|
disabled,
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
{
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
slotProps: {
|
|
7745
|
-
input: {
|
|
7746
|
-
multiple: true,
|
|
7747
|
-
accept: parsedAccepts.join(","),
|
|
7748
|
-
type: "file",
|
|
7749
|
-
ref: inputRef,
|
|
7750
|
-
role: "button",
|
|
7751
|
-
onChange: handleFileChanged
|
|
7752
|
-
}
|
|
7772
|
+
required: !!minCount,
|
|
7773
|
+
onInvalid: (e) => {
|
|
7774
|
+
if (minCount && files.length < minCount) {
|
|
7775
|
+
setErrorText(`Please choose ${minCount} ${minCount === 1 ? "file" : "files"} to upload.`);
|
|
7776
|
+
}
|
|
7777
|
+
},
|
|
7778
|
+
slotProps: {
|
|
7779
|
+
input: {
|
|
7780
|
+
multiple: true,
|
|
7781
|
+
accept: parsedAccepts.join(","),
|
|
7782
|
+
type: "file",
|
|
7783
|
+
ref: inputRef,
|
|
7784
|
+
role: "button",
|
|
7785
|
+
onChange: handleFileChanged
|
|
7753
7786
|
}
|
|
7754
7787
|
}
|
|
7755
|
-
|
|
7756
|
-
)
|
|
7757
|
-
|
|
7758
|
-
}
|
|
7759
|
-
);
|
|
7788
|
+
}
|
|
7789
|
+
)
|
|
7790
|
+
);
|
|
7791
|
+
return /* @__PURE__ */ React49.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ React49.createElement(FormControl_default, { size, error: !!(error || errorText), disabled, required: !!minCount }, label && /* @__PURE__ */ React49.createElement(FormLabel_default, null, label), uploader, /* @__PURE__ */ React49.createElement(FormHelperText_default, null, /* @__PURE__ */ React49.createElement(Stack_default, null, errorText && /* @__PURE__ */ React49.createElement("div", null, errorText), /* @__PURE__ */ React49.createElement("div", null, helperText)))), [...uploaded, ...files].length > 0 && /* @__PURE__ */ React49.createElement(Preview, { files, uploaded, onDelete: handleDeleteFile }));
|
|
7792
|
+
});
|
|
7760
7793
|
Uploader.displayName = "Uploader";
|
|
7761
7794
|
export {
|
|
7762
7795
|
Accordion,
|
|
@@ -7817,7 +7850,8 @@ export {
|
|
|
7817
7850
|
ListSubheader,
|
|
7818
7851
|
Markdown,
|
|
7819
7852
|
Menu,
|
|
7820
|
-
MenuButton,
|
|
7853
|
+
MenuButton2 as MenuButton,
|
|
7854
|
+
MenuButton as MenuButtonTrigger,
|
|
7821
7855
|
MenuItem,
|
|
7822
7856
|
Modal,
|
|
7823
7857
|
ModalClose,
|
|
@@ -7932,6 +7966,7 @@ export {
|
|
|
7932
7966
|
tooltipClasses2 as tooltipClasses,
|
|
7933
7967
|
typographyClasses,
|
|
7934
7968
|
useColorScheme,
|
|
7969
|
+
useMenuButton,
|
|
7935
7970
|
useTheme2 as useTheme,
|
|
7936
7971
|
useThemeProps10 as useThemeProps
|
|
7937
7972
|
};
|