@ceed/cds 1.8.5 → 1.8.7
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 -1
- package/dist/components/Accordions/index.d.ts +2 -2
- package/dist/components/Alert/Alert.d.ts +3 -3
- package/dist/components/Autocomplete/Autocomplete.d.ts +3 -3
- package/dist/components/Autocomplete/index.d.ts +2 -2
- package/dist/components/Avatar/Avatar.d.ts +2 -2
- package/dist/components/Box/Box.d.ts +1 -1
- package/dist/components/Box/index.d.ts +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +6 -5
- package/dist/components/Breadcrumbs/index.d.ts +2 -2
- package/dist/components/Button/Button.d.ts +4 -4
- package/dist/components/Button/index.d.ts +2 -2
- package/dist/components/Calendar/Calendar.d.ts +2 -2
- package/dist/components/Calendar/hooks/use-calendar-props.d.ts +2 -2
- package/dist/components/Calendar/hooks/use-calendar.d.ts +11 -11
- package/dist/components/Calendar/index.d.ts +2 -2
- package/dist/components/Calendar/types.d.ts +2 -2
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/index.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/Checkbox/index.d.ts +2 -2
- package/dist/components/Container/Container.d.ts +1 -1
- package/dist/components/Container/index.d.ts +2 -2
- package/dist/components/CurrencyInput/CurrencyInput.d.ts +4 -4
- package/dist/components/DataTable/DataTable.d.ts +3 -3
- package/dist/components/DataTable/index.d.ts +3 -3
- package/dist/components/DataTable/types.d.ts +27 -20
- package/dist/components/DatePicker/DatePicker.d.ts +3 -3
- package/dist/components/DatePicker/index.d.ts +2 -2
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/dist/components/DateRangePicker/index.d.ts +2 -2
- package/dist/components/DialogActions/DialogActions.d.ts +1 -1
- package/dist/components/DialogActions/index.d.ts +2 -2
- package/dist/components/DialogContent/DialogContent.d.ts +1 -1
- package/dist/components/DialogContent/index.d.ts +2 -2
- package/dist/components/DialogFrame/DialogFrame.d.ts +1 -1
- package/dist/components/DialogFrame/index.d.ts +2 -2
- package/dist/components/DialogTitle/DialogTitle.d.ts +1 -1
- package/dist/components/DialogTitle/index.d.ts +2 -2
- package/dist/components/Divider/Divider.d.ts +3 -3
- package/dist/components/Divider/index.d.ts +2 -2
- package/dist/components/Drawer/Drawer.d.ts +3 -3
- package/dist/components/Drawer/index.d.ts +2 -2
- package/dist/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Dropdown/index.d.ts +2 -2
- package/dist/components/FormControl/FormControl.d.ts +1 -1
- package/dist/components/FormControl/index.d.ts +2 -2
- package/dist/components/FormHelperText/FormHelperText.d.ts +1 -1
- package/dist/components/FormHelperText/index.d.ts +2 -2
- package/dist/components/FormLabel/FormLabel.d.ts +1 -1
- package/dist/components/FormLabel/index.d.ts +2 -2
- package/dist/components/Grid/Grid.d.ts +1 -1
- package/dist/components/Grid/index.d.ts +2 -2
- package/dist/components/IconButton/IconButton.d.ts +4 -4
- package/dist/components/IconButton/index.d.ts +2 -2
- package/dist/components/IconMenuButton/IconMenuButton.d.ts +6 -6
- package/dist/components/IconMenuButton/index.d.ts +2 -2
- package/dist/components/InfoSign/InfoSign.d.ts +4 -4
- package/dist/components/InfoSign/index.d.ts +2 -2
- package/dist/components/Input/Input.d.ts +2 -2
- package/dist/components/Input/index.d.ts +2 -2
- package/dist/components/InsetDrawer/index.d.ts +2 -2
- package/dist/components/Markdown/Markdown.d.ts +6 -6
- package/dist/components/Markdown/index.d.ts +2 -2
- package/dist/components/Menu/Menu.d.ts +3 -3
- package/dist/components/Menu/index.d.ts +2 -2
- package/dist/components/MenuButton/MenuButton.d.ts +8 -8
- package/dist/components/MenuButton/index.d.ts +2 -2
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/index.d.ts +2 -2
- package/dist/components/MonthPicker/MonthPicker.d.ts +3 -3
- package/dist/components/MonthPicker/index.d.ts +2 -2
- package/dist/components/MonthRangePicker/MonthRangePicker.d.ts +3 -3
- package/dist/components/MonthRangePicker/index.d.ts +2 -2
- package/dist/components/NavigationGroup/NavigationGroup.d.ts +3 -3
- package/dist/components/NavigationGroup/index.d.ts +2 -2
- package/dist/components/NavigationItem/NavigationItem.d.ts +3 -3
- package/dist/components/NavigationItem/index.d.ts +2 -2
- package/dist/components/Navigator/Navigator.d.ts +3 -3
- package/dist/components/Pagination/Pagination.d.ts +2 -2
- package/dist/components/Pagination/index.d.ts +2 -2
- package/dist/components/PercentageInput/PercentageInput.d.ts +4 -4
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Radio/index.d.ts +2 -2
- package/dist/components/RadioList/RadioList.d.ts +2 -2
- package/dist/components/RadioList/index.d.ts +2 -2
- package/dist/components/Select/Select.d.ts +5 -5
- package/dist/components/Select/index.d.ts +2 -2
- package/dist/components/Sheet/Sheet.d.ts +1 -1
- package/dist/components/Sheet/index.d.ts +2 -2
- package/dist/components/Stack/Stack.d.ts +1 -1
- package/dist/components/Stack/index.d.ts +2 -2
- package/dist/components/Stepper/Stepper.d.ts +2 -2
- package/dist/components/Switch/Switch.d.ts +3 -3
- package/dist/components/Switch/index.d.ts +2 -2
- package/dist/components/Table/Table.d.ts +2 -2
- package/dist/components/Table/index.d.ts +2 -2
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/index.d.ts +2 -2
- package/dist/components/Textarea/Textarea.d.ts +3 -3
- package/dist/components/Textarea/index.d.ts +2 -2
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +20 -20
- package/dist/components/ThemeProvider/index.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.d.ts +3 -3
- package/dist/components/Tooltip/index.d.ts +2 -2
- package/dist/components/Typography/Typography.d.ts +3 -3
- package/dist/components/Typography/index.d.ts +2 -2
- package/dist/components/Uploader/Uploader.d.ts +1 -1
- package/dist/components/index.d.ts +57 -57
- package/dist/index.cjs +1191 -1757
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1159 -1802
- package/dist/libs/rehype-accent/index.d.ts +2 -2
- package/framer/index.js +37 -37
- package/package.json +9 -2
package/dist/index.cjs
CHANGED
|
@@ -279,7 +279,7 @@ function Accordions(props) {
|
|
|
279
279
|
return /* @__PURE__ */ import_react.default.createElement(MotionAccordions, { variant, color, ...innerProps }, items.map((item, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
280
280
|
Accordion,
|
|
281
281
|
{
|
|
282
|
-
key: index
|
|
282
|
+
key: `accordion-${index}`,
|
|
283
283
|
summary: item.summary,
|
|
284
284
|
details: item.details,
|
|
285
285
|
index,
|
|
@@ -323,16 +323,7 @@ var MotionAlert = (0, import_joy4.styled)((0, import_framer_motion3.motion)(impo
|
|
|
323
323
|
function Alert(props) {
|
|
324
324
|
const { title, content, actions, color = "primary", ...innerProps } = props;
|
|
325
325
|
const invertedColors = props.invertedColors || props.variant === "solid";
|
|
326
|
-
return /* @__PURE__ */ import_react3.default.createElement(
|
|
327
|
-
MotionAlert,
|
|
328
|
-
{
|
|
329
|
-
...innerProps,
|
|
330
|
-
color,
|
|
331
|
-
endDecorator: actions,
|
|
332
|
-
invertedColors
|
|
333
|
-
},
|
|
334
|
-
/* @__PURE__ */ import_react3.default.createElement(Stack_default, null, title && /* @__PURE__ */ import_react3.default.createElement(Typography_default, { level: "title-md", fontWeight: "bold", color }, title), /* @__PURE__ */ import_react3.default.createElement(Typography_default, { level: "body-sm", fontWeight: 500, color }, content))
|
|
335
|
-
);
|
|
326
|
+
return /* @__PURE__ */ import_react3.default.createElement(MotionAlert, { ...innerProps, color, endDecorator: actions, invertedColors }, /* @__PURE__ */ import_react3.default.createElement(Stack_default, null, title && /* @__PURE__ */ import_react3.default.createElement(Typography_default, { level: "title-md", fontWeight: "bold", color }, title), /* @__PURE__ */ import_react3.default.createElement(Typography_default, { level: "body-sm", fontWeight: 500, color }, content)));
|
|
336
327
|
}
|
|
337
328
|
Alert.displayName = "Alert";
|
|
338
329
|
|
|
@@ -409,9 +400,7 @@ var IconButton_default = IconButton;
|
|
|
409
400
|
var import_react5 = require("react");
|
|
410
401
|
function useControlledState(controlledValue, defaultValue, onChange) {
|
|
411
402
|
const { current: isControlled } = (0, import_react5.useRef)(controlledValue !== void 0);
|
|
412
|
-
const [internalValue, setInternalValue] = (0, import_react5.useState)(
|
|
413
|
-
controlledValue ?? defaultValue
|
|
414
|
-
);
|
|
403
|
+
const [internalValue, setInternalValue] = (0, import_react5.useState)(controlledValue ?? defaultValue);
|
|
415
404
|
const displayValue = isControlled ? controlledValue : internalValue;
|
|
416
405
|
(0, import_react5.useEffect)(() => {
|
|
417
406
|
if (isControlled) {
|
|
@@ -774,9 +763,9 @@ function Breadcrumbs(props) {
|
|
|
774
763
|
slotProps: { link: linkProps, ...restSlotProps } = {
|
|
775
764
|
link: { color: "neutral" }
|
|
776
765
|
},
|
|
766
|
+
collapsed = true,
|
|
777
767
|
...innerProps
|
|
778
768
|
} = props;
|
|
779
|
-
const _endCrumbCount = Math.max(1, endCrumbCount);
|
|
780
769
|
const Crumb = (props2) => {
|
|
781
770
|
if (props2.type === "link" && Link4) {
|
|
782
771
|
return /* @__PURE__ */ import_react9.default.createElement(Link4, { to: props2.linkHref, href: props2.linkHref, ...linkProps }, props2.label);
|
|
@@ -784,21 +773,14 @@ function Breadcrumbs(props) {
|
|
|
784
773
|
return /* @__PURE__ */ import_react9.default.createElement(Typography_default, null, props2.label);
|
|
785
774
|
}
|
|
786
775
|
};
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
slotProps: restSlotProps,
|
|
796
|
-
...innerProps
|
|
797
|
-
},
|
|
798
|
-
frontCrumbs,
|
|
799
|
-
collapsedCrumbs.length && /* @__PURE__ */ import_react9.default.createElement(Dropdown_default, null, /* @__PURE__ */ import_react9.default.createElement(import_joy15.MenuButton, { size, variant: "plain" }, "..."), /* @__PURE__ */ import_react9.default.createElement(Menu_default, { size }, collapsedCrumbs)),
|
|
800
|
-
backCrumbs
|
|
801
|
-
);
|
|
776
|
+
if (!collapsed) {
|
|
777
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_joy15.Breadcrumbs, { size, slots: restSlots, slotProps: restSlotProps, ...innerProps }, crumbs.map((crumb, index) => /* @__PURE__ */ import_react9.default.createElement(Crumb, { key: `breadcrumb-${index}`, ...crumb })));
|
|
778
|
+
}
|
|
779
|
+
const _endCrumbCount = Math.max(1, endCrumbCount);
|
|
780
|
+
const frontCrumbs = crumbs.slice(0, startCrumbCount).map((crumb) => /* @__PURE__ */ import_react9.default.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
|
|
781
|
+
const backCrumbs = (startCrumbCount + _endCrumbCount > crumbs.length ? crumbs.slice(startCrumbCount) : crumbs.slice(-_endCrumbCount)).map((crumb) => /* @__PURE__ */ import_react9.default.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
|
|
782
|
+
const collapsedCrumbs = crumbs.slice(startCrumbCount, -_endCrumbCount).map((crumb) => /* @__PURE__ */ import_react9.default.createElement(MenuItem, { key: `breadcrumb-${crumb.label}` }, /* @__PURE__ */ import_react9.default.createElement(Crumb, { ...crumb })));
|
|
783
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_joy15.Breadcrumbs, { size, slots: restSlots, slotProps: restSlotProps, ...innerProps }, frontCrumbs, collapsedCrumbs.length && /* @__PURE__ */ import_react9.default.createElement(Dropdown_default, null, /* @__PURE__ */ import_react9.default.createElement(import_joy15.MenuButton, { size, variant: "plain" }, "..."), /* @__PURE__ */ import_react9.default.createElement(Menu_default, { size }, collapsedCrumbs)), backCrumbs);
|
|
802
784
|
}
|
|
803
785
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
804
786
|
|
|
@@ -807,11 +789,9 @@ var import_react10 = __toESM(require("react"));
|
|
|
807
789
|
var import_joy16 = require("@mui/joy");
|
|
808
790
|
var import_framer_motion11 = require("framer-motion");
|
|
809
791
|
var MotionButton = (0, import_framer_motion11.motion)(import_joy16.Button);
|
|
810
|
-
var Button = (0, import_react10.forwardRef)(
|
|
811
|
-
({ ...props }
|
|
812
|
-
|
|
813
|
-
}
|
|
814
|
-
);
|
|
792
|
+
var Button = (0, import_react10.forwardRef)(({ ...props }, ref) => {
|
|
793
|
+
return /* @__PURE__ */ import_react10.default.createElement(MotionButton, { ref, ...props });
|
|
794
|
+
});
|
|
815
795
|
Button.displayName = "Button";
|
|
816
796
|
|
|
817
797
|
// src/components/Button/index.ts
|
|
@@ -830,9 +810,7 @@ var getCalendarDates = (date) => {
|
|
|
830
810
|
const firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
831
811
|
const lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
832
812
|
const firstWeekInThisMonth = Math.ceil((firstDay.getDay() + 1) / 7);
|
|
833
|
-
const lastWeekInThisMonth = Math.ceil(
|
|
834
|
-
(lastDay.getDate() + firstDay.getDay()) / 7
|
|
835
|
-
);
|
|
813
|
+
const lastWeekInThisMonth = Math.ceil((lastDay.getDate() + firstDay.getDay()) / 7);
|
|
836
814
|
let day = 1;
|
|
837
815
|
for (let i = 1; i <= lastWeekInThisMonth; i++) {
|
|
838
816
|
const week = [];
|
|
@@ -907,7 +885,9 @@ var useCalendarProps = (inProps) => {
|
|
|
907
885
|
const [uncontrolledView, setUncontrolledView] = (0, import_react11.useState)(
|
|
908
886
|
() => resolveView(inProps.view || "day", inProps.views || ["day", "month"])
|
|
909
887
|
);
|
|
910
|
-
const [uncontrolledValue, setUncontrolledValue] = (0, import_react11.useState)(
|
|
888
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react11.useState)(
|
|
889
|
+
inProps.defaultValue
|
|
890
|
+
);
|
|
911
891
|
const [viewMonth, setViewMonth] = (0, import_react11.useState)(() => {
|
|
912
892
|
const today = /* @__PURE__ */ new Date();
|
|
913
893
|
today.setDate(1);
|
|
@@ -980,10 +960,7 @@ var useCalendarProps = (inProps) => {
|
|
|
980
960
|
},
|
|
981
961
|
name: "Calendar"
|
|
982
962
|
});
|
|
983
|
-
const ownerState = (0, import_react11.useMemo)(
|
|
984
|
-
() => ({ ...props, viewMonth, direction }),
|
|
985
|
-
[props, viewMonth, direction]
|
|
986
|
-
);
|
|
963
|
+
const ownerState = (0, import_react11.useMemo)(() => ({ ...props, viewMonth, direction }), [props, viewMonth, direction]);
|
|
987
964
|
return [props, ownerState];
|
|
988
965
|
};
|
|
989
966
|
|
|
@@ -1001,11 +978,7 @@ var useCalendar = (ownerState) => {
|
|
|
1001
978
|
const currentMonth = currentDate.getMonth();
|
|
1002
979
|
const currentDay = currentDate.getDate();
|
|
1003
980
|
const prevMonth = new Date(currentYear, currentMonth - 1, 1);
|
|
1004
|
-
const lastDayOfPrevMonth = new Date(
|
|
1005
|
-
currentYear,
|
|
1006
|
-
currentMonth,
|
|
1007
|
-
0
|
|
1008
|
-
).getDate();
|
|
981
|
+
const lastDayOfPrevMonth = new Date(currentYear, currentMonth, 0).getDate();
|
|
1009
982
|
const prevMonthDay = Math.min(currentDay, lastDayOfPrevMonth);
|
|
1010
983
|
prevMonth.setDate(prevMonthDay);
|
|
1011
984
|
ownerState.onMonthChange?.(prevMonth);
|
|
@@ -1022,11 +995,7 @@ var useCalendar = (ownerState) => {
|
|
|
1022
995
|
const currentMonth = currentDate.getMonth();
|
|
1023
996
|
const currentDay = currentDate.getDate();
|
|
1024
997
|
const nextMonth = new Date(currentYear, currentMonth + 1, 1);
|
|
1025
|
-
const lastDayOfNextMonth = new Date(
|
|
1026
|
-
currentYear,
|
|
1027
|
-
currentMonth + 2,
|
|
1028
|
-
0
|
|
1029
|
-
).getDate();
|
|
998
|
+
const lastDayOfNextMonth = new Date(currentYear, currentMonth + 2, 0).getDate();
|
|
1030
999
|
const nextMonthDay = Math.min(currentDay, lastDayOfNextMonth);
|
|
1031
1000
|
nextMonth.setDate(nextMonthDay);
|
|
1032
1001
|
ownerState.onMonthChange?.(nextMonth);
|
|
@@ -1043,22 +1012,13 @@ var useCalendar = (ownerState) => {
|
|
|
1043
1012
|
thisDay.setDate(day);
|
|
1044
1013
|
const inRange = ownerState.rangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1045
1014
|
(hoverDay && isWithinRange(ownerState.value[0], hoverDay, thisDay) || // NOTE: Selected range is included in the range
|
|
1046
|
-
ownerState.value[1] && isWithinRange(
|
|
1047
|
-
ownerState.value[0],
|
|
1048
|
-
ownerState.value[1],
|
|
1049
|
-
thisDay
|
|
1050
|
-
));
|
|
1015
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisDay));
|
|
1051
1016
|
return {
|
|
1052
1017
|
"aria-label": thisDay.toLocaleDateString(),
|
|
1053
1018
|
"aria-current": inRange ? "date" : void 0
|
|
1054
1019
|
};
|
|
1055
1020
|
},
|
|
1056
|
-
[
|
|
1057
|
-
ownerState.rangeSelection,
|
|
1058
|
-
ownerState.value,
|
|
1059
|
-
ownerState.viewMonth,
|
|
1060
|
-
hoverDay
|
|
1061
|
-
]
|
|
1021
|
+
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverDay]
|
|
1062
1022
|
),
|
|
1063
1023
|
getMonthCellProps: (0, import_react12.useCallback)(
|
|
1064
1024
|
(monthIndex) => {
|
|
@@ -1069,22 +1029,13 @@ var useCalendar = (ownerState) => {
|
|
|
1069
1029
|
const isMonthRangeSelection = !ownerState.views?.find((view) => view === "day") && ownerState.rangeSelection;
|
|
1070
1030
|
const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1071
1031
|
(hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
|
|
1072
|
-
ownerState.value[1] && isWithinRange(
|
|
1073
|
-
ownerState.value[0],
|
|
1074
|
-
ownerState.value[1],
|
|
1075
|
-
thisMonth
|
|
1076
|
-
));
|
|
1032
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisMonth));
|
|
1077
1033
|
return {
|
|
1078
1034
|
"aria-label": thisMonth.toLocaleDateString(),
|
|
1079
1035
|
"aria-current": inRange ? "date" : void 0
|
|
1080
1036
|
};
|
|
1081
1037
|
},
|
|
1082
|
-
[
|
|
1083
|
-
ownerState.rangeSelection,
|
|
1084
|
-
ownerState.value,
|
|
1085
|
-
ownerState.viewMonth,
|
|
1086
|
-
hoverMonth
|
|
1087
|
-
]
|
|
1038
|
+
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverMonth]
|
|
1088
1039
|
),
|
|
1089
1040
|
getPickerDayProps: (0, import_react12.useCallback)(
|
|
1090
1041
|
(day) => {
|
|
@@ -1094,23 +1045,15 @@ var useCalendar = (ownerState) => {
|
|
|
1094
1045
|
const isSelected = !!ownerState.value && (isSameDay(thisDay, ownerState.value[0]) || ownerState.value[1] && isSameDay(thisDay, ownerState.value[1]));
|
|
1095
1046
|
const inRange = ownerState.rangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1096
1047
|
(hoverDay && isWithinRange(ownerState.value[0], hoverDay, thisDay) || // NOTE: Selected range is included in the range
|
|
1097
|
-
ownerState.value[1] && isWithinRange(
|
|
1098
|
-
ownerState.value[0],
|
|
1099
|
-
ownerState.value[1],
|
|
1100
|
-
thisDay
|
|
1101
|
-
));
|
|
1048
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisDay));
|
|
1102
1049
|
const handleDayClick = () => {
|
|
1103
1050
|
if (ownerState.rangeSelection) {
|
|
1104
1051
|
if (!ownerState.value) {
|
|
1105
1052
|
ownerState.onChange?.([thisDay, void 0]);
|
|
1106
1053
|
} else if (ownerState.value[0] && !ownerState.value[1]) {
|
|
1107
1054
|
ownerState.onChange?.([
|
|
1108
|
-
new Date(
|
|
1109
|
-
|
|
1110
|
-
),
|
|
1111
|
-
new Date(
|
|
1112
|
-
Math.max(ownerState.value[0].getTime(), thisDay.getTime())
|
|
1113
|
-
)
|
|
1055
|
+
new Date(Math.min(ownerState.value[0].getTime(), thisDay.getTime())),
|
|
1056
|
+
new Date(Math.max(ownerState.value[0].getTime(), thisDay.getTime()))
|
|
1114
1057
|
]);
|
|
1115
1058
|
} else {
|
|
1116
1059
|
ownerState.onChange?.([thisDay, void 0]);
|
|
@@ -1159,23 +1102,15 @@ var useCalendar = (ownerState) => {
|
|
|
1159
1102
|
const isSelected = !!ownerState.value && (isSameMonth(thisMonth, ownerState.value[0]) || ownerState.value[1] && isSameMonth(thisMonth, ownerState.value[1]));
|
|
1160
1103
|
const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1161
1104
|
(hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
|
|
1162
|
-
ownerState.value[1] && isWithinRange(
|
|
1163
|
-
ownerState.value[0],
|
|
1164
|
-
ownerState.value[1],
|
|
1165
|
-
thisMonth
|
|
1166
|
-
));
|
|
1105
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisMonth));
|
|
1167
1106
|
const handleMonthClick = () => {
|
|
1168
1107
|
if (isMonthRangeSelection) {
|
|
1169
1108
|
if (!ownerState.value) {
|
|
1170
1109
|
ownerState.onChange?.([thisMonth, void 0]);
|
|
1171
1110
|
} else if (ownerState.value[0] && !ownerState.value[1]) {
|
|
1172
1111
|
ownerState.onChange?.([
|
|
1173
|
-
new Date(
|
|
1174
|
-
|
|
1175
|
-
),
|
|
1176
|
-
new Date(
|
|
1177
|
-
Math.max(ownerState.value[0].getTime(), thisMonth.getTime())
|
|
1178
|
-
)
|
|
1112
|
+
new Date(Math.min(ownerState.value[0].getTime(), thisMonth.getTime())),
|
|
1113
|
+
new Date(Math.max(ownerState.value[0].getTime(), thisMonth.getTime()))
|
|
1179
1114
|
]);
|
|
1180
1115
|
} else {
|
|
1181
1116
|
ownerState.onChange?.([thisMonth, void 0]);
|
|
@@ -1245,15 +1180,13 @@ var CalendarViewContainer = (0, import_joy18.styled)("div", {
|
|
|
1245
1180
|
name: "Calendar",
|
|
1246
1181
|
slot: "viewContainer",
|
|
1247
1182
|
shouldForwardProp: (prop) => prop !== "calendarType"
|
|
1248
|
-
})(
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
})
|
|
1256
|
-
);
|
|
1183
|
+
})(({ theme, calendarType }) => ({
|
|
1184
|
+
paddingLeft: theme.spacing(2),
|
|
1185
|
+
paddingRight: theme.spacing(2),
|
|
1186
|
+
position: "relative",
|
|
1187
|
+
overflow: "hidden",
|
|
1188
|
+
minHeight: calendarType === "datePicker" ? "250px" : "unset"
|
|
1189
|
+
}));
|
|
1257
1190
|
var CalendarViewTable = (0, import_joy18.styled)(import_framer_motion12.motion.table, {
|
|
1258
1191
|
name: "Calendar",
|
|
1259
1192
|
slot: "viewTable"
|
|
@@ -1432,14 +1365,8 @@ var swipePower = (offset, velocity) => {
|
|
|
1432
1365
|
var PickerDays = (props) => {
|
|
1433
1366
|
const { ownerState } = props;
|
|
1434
1367
|
const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
|
|
1435
|
-
const calendarDates = (0, import_react13.useMemo)(
|
|
1436
|
-
|
|
1437
|
-
[ownerState.viewMonth]
|
|
1438
|
-
);
|
|
1439
|
-
const weekdayNames = (0, import_react13.useMemo)(
|
|
1440
|
-
() => getWeekdayNames(ownerState.locale || "default"),
|
|
1441
|
-
[ownerState.locale]
|
|
1442
|
-
);
|
|
1368
|
+
const calendarDates = (0, import_react13.useMemo)(() => getCalendarDates(ownerState.viewMonth), [ownerState.viewMonth]);
|
|
1369
|
+
const weekdayNames = (0, import_react13.useMemo)(() => getWeekdayNames(ownerState.locale || "default"), [ownerState.locale]);
|
|
1443
1370
|
return /* @__PURE__ */ import_react13.default.createElement(CalendarViewContainer, { calendarType: "datePicker" }, /* @__PURE__ */ import_react13.default.createElement(import_framer_motion12.AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ import_react13.default.createElement(
|
|
1444
1371
|
CalendarViewTable,
|
|
1445
1372
|
{
|
|
@@ -1469,25 +1396,9 @@ var PickerDays = (props) => {
|
|
|
1469
1396
|
}
|
|
1470
1397
|
}
|
|
1471
1398
|
},
|
|
1472
|
-
/* @__PURE__ */ import_react13.default.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ import_react13.default.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ import_react13.default.createElement("th", null, /* @__PURE__ */ import_react13.default.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ import_react13.default.createElement(
|
|
1473
|
-
"th",
|
|
1474
|
-
{
|
|
1475
|
-
style: { width: 4 },
|
|
1476
|
-
"aria-hidden": "true",
|
|
1477
|
-
"aria-description": "cell-gap"
|
|
1478
|
-
}
|
|
1479
|
-
))))),
|
|
1399
|
+
/* @__PURE__ */ import_react13.default.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ import_react13.default.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ import_react13.default.createElement("th", null, /* @__PURE__ */ import_react13.default.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ import_react13.default.createElement("th", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" }))))),
|
|
1480
1400
|
/* @__PURE__ */ import_react13.default.createElement(CalendarDayPickerContainer, null, calendarDates.map((weekDates, rowIndex) => /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: `${ownerState.viewMonth}_${rowIndex}` }, /* @__PURE__ */ import_react13.default.createElement("tr", null, weekDates.map(
|
|
1481
|
-
(date, i) => date ? /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: i }, /* @__PURE__ */ import_react13.default.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ import_react13.default.createElement(
|
|
1482
|
-
CalendarDay,
|
|
1483
|
-
{
|
|
1484
|
-
size: "sm",
|
|
1485
|
-
variant: "plain",
|
|
1486
|
-
color: "neutral",
|
|
1487
|
-
...getPickerDayProps(date)
|
|
1488
|
-
},
|
|
1489
|
-
date
|
|
1490
|
-
)), i < 6 && /* @__PURE__ */ import_react13.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: i }, /* @__PURE__ */ import_react13.default.createElement("td", null), i < 6 && /* @__PURE__ */ import_react13.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
|
|
1401
|
+
(date, i) => date ? /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: `${ownerState.viewMonth}_${date}_${i}` }, /* @__PURE__ */ import_react13.default.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ import_react13.default.createElement(CalendarDay, { size: "sm", variant: "plain", color: "neutral", ...getPickerDayProps(date) }, date)), i < 6 && /* @__PURE__ */ import_react13.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: `${ownerState.viewMonth}_${i}` }, /* @__PURE__ */ import_react13.default.createElement("td", null), i < 6 && /* @__PURE__ */ import_react13.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
|
|
1491
1402
|
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */ import_react13.default.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ import_react13.default.createElement("td", { colSpan: 13, style: { height: 4 } })))))
|
|
1492
1403
|
)));
|
|
1493
1404
|
};
|
|
@@ -1505,62 +1416,37 @@ var PickerMonths = (props) => {
|
|
|
1505
1416
|
[[]]
|
|
1506
1417
|
);
|
|
1507
1418
|
const isMonthPicker = !ownerState.views?.find((view) => view === "day");
|
|
1508
|
-
return /* @__PURE__ */ import_react13.default.createElement(
|
|
1509
|
-
|
|
1419
|
+
return /* @__PURE__ */ import_react13.default.createElement(CalendarViewContainer, { calendarType: isMonthPicker ? "monthPicker" : "datePicker" }, /* @__PURE__ */ import_react13.default.createElement(import_framer_motion12.AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ import_react13.default.createElement(
|
|
1420
|
+
CalendarViewTable,
|
|
1510
1421
|
{
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
animate: "center",
|
|
1521
|
-
exit: "exit",
|
|
1522
|
-
transition: {
|
|
1523
|
-
x: { type: "spring", stiffness: 300, damping: 30 },
|
|
1524
|
-
opacity: { duration: 0.2 }
|
|
1525
|
-
},
|
|
1526
|
-
drag: "x",
|
|
1527
|
-
dragConstraints: { left: 0, right: 0 },
|
|
1528
|
-
dragElastic: 1,
|
|
1529
|
-
onDragEnd: (e, { offset, velocity }) => {
|
|
1530
|
-
const swipe = swipePower(offset.x, velocity.x);
|
|
1531
|
-
if (swipe < -swipeConfidenceThreshold) {
|
|
1532
|
-
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1533
|
-
date.setMonth(date.getMonth() + 1);
|
|
1534
|
-
ownerState.onMonthChange?.(date);
|
|
1535
|
-
} else if (swipe > swipeConfidenceThreshold) {
|
|
1536
|
-
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1537
|
-
date.setMonth(date.getMonth() - 1);
|
|
1538
|
-
ownerState.onMonthChange?.(date);
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1422
|
+
key: `${ownerState.viewMonth.getFullYear()}_${ownerState.direction}`,
|
|
1423
|
+
custom: ownerState.direction,
|
|
1424
|
+
variants,
|
|
1425
|
+
initial: "enter",
|
|
1426
|
+
animate: "center",
|
|
1427
|
+
exit: "exit",
|
|
1428
|
+
transition: {
|
|
1429
|
+
x: { type: "spring", stiffness: 300, damping: 30 },
|
|
1430
|
+
opacity: { duration: 0.2 }
|
|
1541
1431
|
},
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
ownerState.
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
"td",
|
|
1556
|
-
{
|
|
1557
|
-
style: { width: 4 },
|
|
1558
|
-
"aria-hidden": "true",
|
|
1559
|
-
"aria-description": "cell-gap"
|
|
1432
|
+
drag: "x",
|
|
1433
|
+
dragConstraints: { left: 0, right: 0 },
|
|
1434
|
+
dragElastic: 1,
|
|
1435
|
+
onDragEnd: (e, { offset, velocity }) => {
|
|
1436
|
+
const swipe = swipePower(offset.x, velocity.x);
|
|
1437
|
+
if (swipe < -swipeConfidenceThreshold) {
|
|
1438
|
+
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1439
|
+
date.setMonth(date.getMonth() + 1);
|
|
1440
|
+
ownerState.onMonthChange?.(date);
|
|
1441
|
+
} else if (swipe > swipeConfidenceThreshold) {
|
|
1442
|
+
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1443
|
+
date.setMonth(date.getMonth() - 1);
|
|
1444
|
+
ownerState.onMonthChange?.(date);
|
|
1560
1445
|
}
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1446
|
+
}
|
|
1447
|
+
},
|
|
1448
|
+
/* @__PURE__ */ import_react13.default.createElement("tbody", null, chunkedMonths.map((months, i) => /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: months.join("_") }, /* @__PURE__ */ import_react13.default.createElement("tr", null, months.map((monthIndex, j) => /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: monthIndex }, /* @__PURE__ */ import_react13.default.createElement(CalendarMonthCell, { ...getMonthCellProps(monthIndex) }, /* @__PURE__ */ import_react13.default.createElement(CalendarMonth, { size: "sm", variant: "plain", color: "neutral", ...getPickerMonthProps(monthIndex) }, getMonthNameFromIndex(monthIndex, ownerState.locale))), j < 3 && /* @__PURE__ */ import_react13.default.createElement("td", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" })))), i < chunkedMonths.length - 1 && /* @__PURE__ */ import_react13.default.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ import_react13.default.createElement("td", { colSpan: 7, style: { height: 4 } })))))
|
|
1449
|
+
)));
|
|
1564
1450
|
};
|
|
1565
1451
|
var Calendar = (0, import_react13.forwardRef)((inProps, ref) => {
|
|
1566
1452
|
const [props, ownerState] = useCalendarProps(inProps);
|
|
@@ -1581,15 +1467,7 @@ var Calendar = (0, import_react13.forwardRef)((inProps, ref) => {
|
|
|
1581
1467
|
...others
|
|
1582
1468
|
} = props;
|
|
1583
1469
|
const { calendarTitle, onPrev, onNext } = useCalendar(ownerState);
|
|
1584
|
-
return /* @__PURE__ */ import_react13.default.createElement(CalendarRoot, { ref, ...others }, /* @__PURE__ */ import_react13.default.createElement(CalendarHeader, null, /* @__PURE__ */ import_react13.default.createElement(
|
|
1585
|
-
IconButton_default,
|
|
1586
|
-
{
|
|
1587
|
-
size: "sm",
|
|
1588
|
-
onClick: onPrev,
|
|
1589
|
-
"aria-label": `Previous ${view === "day" ? "Month" : "Year"}`
|
|
1590
|
-
},
|
|
1591
|
-
/* @__PURE__ */ import_react13.default.createElement(import_ChevronLeft.default, null)
|
|
1592
|
-
), /* @__PURE__ */ import_react13.default.createElement(
|
|
1470
|
+
return /* @__PURE__ */ import_react13.default.createElement(CalendarRoot, { ref, ...others }, /* @__PURE__ */ import_react13.default.createElement(CalendarHeader, null, /* @__PURE__ */ import_react13.default.createElement(IconButton_default, { size: "sm", onClick: onPrev, "aria-label": `Previous ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ import_react13.default.createElement(import_ChevronLeft.default, null)), /* @__PURE__ */ import_react13.default.createElement(
|
|
1593
1471
|
CalendarSwitchViewButton,
|
|
1594
1472
|
{
|
|
1595
1473
|
ownerState,
|
|
@@ -1599,15 +1477,7 @@ var Calendar = (0, import_react13.forwardRef)((inProps, ref) => {
|
|
|
1599
1477
|
"aria-label": "Switch Calendar View"
|
|
1600
1478
|
},
|
|
1601
1479
|
calendarTitle
|
|
1602
|
-
), /* @__PURE__ */ import_react13.default.createElement(
|
|
1603
|
-
IconButton_default,
|
|
1604
|
-
{
|
|
1605
|
-
size: "sm",
|
|
1606
|
-
onClick: onNext,
|
|
1607
|
-
"aria-label": `Next ${view === "day" ? "Month" : "Year"}`
|
|
1608
|
-
},
|
|
1609
|
-
/* @__PURE__ */ import_react13.default.createElement(import_ChevronRight.default, null)
|
|
1610
|
-
)), view === "day" && /* @__PURE__ */ import_react13.default.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ import_react13.default.createElement(PickerMonths, { ownerState }));
|
|
1480
|
+
), /* @__PURE__ */ import_react13.default.createElement(IconButton_default, { size: "sm", onClick: onNext, "aria-label": `Next ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ import_react13.default.createElement(import_ChevronRight.default, null))), view === "day" && /* @__PURE__ */ import_react13.default.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ import_react13.default.createElement(PickerMonths, { ownerState }));
|
|
1611
1481
|
});
|
|
1612
1482
|
Calendar.displayName = "Calendar";
|
|
1613
1483
|
|
|
@@ -1745,23 +1615,15 @@ var Input = import_react16.default.forwardRef((props, ref) => {
|
|
|
1745
1615
|
...innerProps.slotProps
|
|
1746
1616
|
},
|
|
1747
1617
|
...innerProps,
|
|
1748
|
-
endDecorator: enableClearable ? /* @__PURE__ */ import_react16.default.createElement(
|
|
1749
|
-
|
|
1618
|
+
endDecorator: enableClearable ? /* @__PURE__ */ import_react16.default.createElement(Stack_default, { gap: 1, direction: "row" }, innerProps.endDecorator, value && /* @__PURE__ */ import_react16.default.createElement(
|
|
1619
|
+
IconButton_default,
|
|
1750
1620
|
{
|
|
1751
|
-
|
|
1752
|
-
|
|
1621
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1622
|
+
onClick: handleClear,
|
|
1623
|
+
"aria-label": "Clear"
|
|
1753
1624
|
},
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
IconButton_default,
|
|
1757
|
-
{
|
|
1758
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
1759
|
-
onClick: handleClear,
|
|
1760
|
-
"aria-label": "Clear"
|
|
1761
|
-
},
|
|
1762
|
-
/* @__PURE__ */ import_react16.default.createElement(import_Close2.default, null)
|
|
1763
|
-
)
|
|
1764
|
-
) : innerProps.endDecorator
|
|
1625
|
+
/* @__PURE__ */ import_react16.default.createElement(import_Close2.default, null)
|
|
1626
|
+
)) : innerProps.endDecorator
|
|
1765
1627
|
}
|
|
1766
1628
|
);
|
|
1767
1629
|
return /* @__PURE__ */ import_react16.default.createElement(
|
|
@@ -1949,25 +1811,23 @@ var useCurrencySetting = (props) => {
|
|
|
1949
1811
|
};
|
|
1950
1812
|
|
|
1951
1813
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1952
|
-
var TextMaskAdapter = import_react17.default.forwardRef(
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
}
|
|
1970
|
-
);
|
|
1814
|
+
var TextMaskAdapter = import_react17.default.forwardRef(function TextMaskAdapter2(props, ref) {
|
|
1815
|
+
const { onChange, ...innerProps } = props;
|
|
1816
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
1817
|
+
import_react_number_format.NumericFormat,
|
|
1818
|
+
{
|
|
1819
|
+
...innerProps,
|
|
1820
|
+
onValueChange: ({ value }) => {
|
|
1821
|
+
onChange?.({
|
|
1822
|
+
target: { name: props.name, value }
|
|
1823
|
+
});
|
|
1824
|
+
},
|
|
1825
|
+
valueIsNumericString: true,
|
|
1826
|
+
getInputRef: ref,
|
|
1827
|
+
allowNegative: true
|
|
1828
|
+
}
|
|
1829
|
+
);
|
|
1830
|
+
});
|
|
1971
1831
|
var CurrencyInputRoot = (0, import_joy23.styled)(Input_default, {
|
|
1972
1832
|
name: "CurrencyInput",
|
|
1973
1833
|
slot: "root",
|
|
@@ -1990,21 +1850,11 @@ var CurrencyInput = import_react17.default.forwardRef(function CurrencyInput2(in
|
|
|
1990
1850
|
className,
|
|
1991
1851
|
...innerProps
|
|
1992
1852
|
} = props;
|
|
1993
|
-
const {
|
|
1994
|
-
symbol,
|
|
1995
|
-
thousandSeparator,
|
|
1996
|
-
decimalSeparator,
|
|
1997
|
-
placeholder,
|
|
1998
|
-
fixedDecimalScale,
|
|
1999
|
-
decimalScale
|
|
2000
|
-
} = useCurrencySetting(props);
|
|
1853
|
+
const { symbol, thousandSeparator, decimalSeparator, placeholder, fixedDecimalScale, decimalScale } = useCurrencySetting(props);
|
|
2001
1854
|
const [_value, setValue] = useControlledState(
|
|
2002
1855
|
props.value,
|
|
2003
1856
|
props.defaultValue,
|
|
2004
|
-
(0, import_react17.useCallback)(
|
|
2005
|
-
(value2) => onChange?.({ target: { name, value: value2 } }),
|
|
2006
|
-
[onChange, name]
|
|
2007
|
-
)
|
|
1857
|
+
(0, import_react17.useCallback)((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
2008
1858
|
);
|
|
2009
1859
|
const value = (0, import_react17.useMemo)(() => {
|
|
2010
1860
|
if (_value && useMinorUnit) {
|
|
@@ -2018,9 +1868,7 @@ var CurrencyInput = import_react17.default.forwardRef(function CurrencyInput2(in
|
|
|
2018
1868
|
}
|
|
2019
1869
|
return props.max;
|
|
2020
1870
|
}, [props.max, useMinorUnit, decimalScale]);
|
|
2021
|
-
const [isOverLimit, setIsOverLimit] = (0, import_react17.useState)(
|
|
2022
|
-
!!max && !!value && value > max
|
|
2023
|
-
);
|
|
1871
|
+
const [isOverLimit, setIsOverLimit] = (0, import_react17.useState)(!!max && !!value && value > max);
|
|
2024
1872
|
const handleChange = (0, import_react17.useCallback)(
|
|
2025
1873
|
(event) => {
|
|
2026
1874
|
if (event.target.value === "") {
|
|
@@ -2050,9 +1898,9 @@ var CurrencyInput = import_react17.default.forwardRef(function CurrencyInput2(in
|
|
|
2050
1898
|
required,
|
|
2051
1899
|
color: error || isOverLimit ? "danger" : props.color,
|
|
2052
1900
|
label,
|
|
2053
|
-
helperText: isOverLimit ? new import_intl_messageformat2.IntlMessageFormat(
|
|
2054
|
-
|
|
2055
|
-
|
|
1901
|
+
helperText: isOverLimit ? new import_intl_messageformat2.IntlMessageFormat(`limit: {amount, number, ::currency/${currency} unit-width-narrow}`).format({
|
|
1902
|
+
amount: max
|
|
1903
|
+
}) : helperText,
|
|
2056
1904
|
slotProps: {
|
|
2057
1905
|
input: {
|
|
2058
1906
|
component: TextMaskAdapter,
|
|
@@ -2141,20 +1989,14 @@ function TableBody(props) {
|
|
|
2141
1989
|
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
2142
1990
|
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
2143
1991
|
} = props;
|
|
2144
|
-
return /* @__PURE__ */ import_react18.default.createElement("tbody", null, rows.map((row, rowIndex) => /* @__PURE__ */ import_react18.default.createElement("tr", { key: rowIndex }, showCheckbox && /* @__PURE__ */ import_react18.default.createElement(
|
|
1992
|
+
return /* @__PURE__ */ import_react18.default.createElement("tbody", null, rows.map((row, rowIndex) => /* @__PURE__ */ import_react18.default.createElement("tr", { key: `table-row-${rowIndex}` }, showCheckbox && /* @__PURE__ */ import_react18.default.createElement(
|
|
2145
1993
|
"td",
|
|
2146
1994
|
{
|
|
2147
1995
|
style: {
|
|
2148
1996
|
textAlign: "center"
|
|
2149
1997
|
}
|
|
2150
1998
|
},
|
|
2151
|
-
/* @__PURE__ */ import_react18.default.createElement(
|
|
2152
|
-
RenderCheckbox,
|
|
2153
|
-
{
|
|
2154
|
-
onChange: (event) => onCheckboxChange?.(event, rowIndex),
|
|
2155
|
-
...checkboxProps
|
|
2156
|
-
}
|
|
2157
|
-
)
|
|
1999
|
+
/* @__PURE__ */ import_react18.default.createElement(RenderCheckbox, { onChange: (event) => onCheckboxChange?.(event, rowIndex), ...checkboxProps })
|
|
2158
2000
|
), cellOrder.map((cellKey) => /* @__PURE__ */ import_react18.default.createElement(
|
|
2159
2001
|
"td",
|
|
2160
2002
|
{
|
|
@@ -2199,9 +2041,7 @@ var CalendarButton = (0, import_joy27.styled)(IconButton_default, {
|
|
|
2199
2041
|
"&:focus": {
|
|
2200
2042
|
"--Icon-color": "currentColor",
|
|
2201
2043
|
outlineOffset: `${theme.getCssVar("focus-thickness")}`,
|
|
2202
|
-
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar(
|
|
2203
|
-
"palette-focusVisible"
|
|
2204
|
-
)}`
|
|
2044
|
+
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
2205
2045
|
}
|
|
2206
2046
|
}));
|
|
2207
2047
|
var StyledPopper = (0, import_joy27.styled)(import_base2.Popper, {
|
|
@@ -2235,9 +2075,7 @@ var validValueFormat = (value, format) => {
|
|
|
2235
2075
|
if (value !== formatValueString(parsedValue, format)) {
|
|
2236
2076
|
return false;
|
|
2237
2077
|
}
|
|
2238
|
-
const regex = new RegExp(
|
|
2239
|
-
`^${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")}$`
|
|
2240
|
-
);
|
|
2078
|
+
const regex = new RegExp(`^${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")}$`);
|
|
2241
2079
|
return regex.test(value);
|
|
2242
2080
|
} catch (e) {
|
|
2243
2081
|
return false;
|
|
@@ -2278,311 +2116,294 @@ function parseDate(dateString, format) {
|
|
|
2278
2116
|
var formatToPattern = (format) => {
|
|
2279
2117
|
return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
2280
2118
|
};
|
|
2281
|
-
var TextMaskAdapter3 = import_react19.default.forwardRef(
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
maxLength: 2
|
|
2298
|
-
},
|
|
2299
|
-
M: {
|
|
2300
|
-
mask: import_react_imask.IMask.MaskedRange,
|
|
2301
|
-
from: 1,
|
|
2302
|
-
to: 12,
|
|
2303
|
-
maxLength: 2
|
|
2304
|
-
},
|
|
2305
|
-
Y: {
|
|
2306
|
-
mask: import_react_imask.IMask.MaskedRange,
|
|
2307
|
-
from: 1900,
|
|
2308
|
-
to: 9999,
|
|
2309
|
-
maxLength: 4
|
|
2310
|
-
}
|
|
2119
|
+
var TextMaskAdapter3 = import_react19.default.forwardRef(function TextMaskAdapter4(props, ref) {
|
|
2120
|
+
const { onChange, format, ...other } = props;
|
|
2121
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
2122
|
+
import_react_imask.IMaskInput,
|
|
2123
|
+
{
|
|
2124
|
+
...other,
|
|
2125
|
+
inputRef: ref,
|
|
2126
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
2127
|
+
mask: Date,
|
|
2128
|
+
pattern: formatToPattern(format),
|
|
2129
|
+
blocks: {
|
|
2130
|
+
D: {
|
|
2131
|
+
mask: import_react_imask.IMask.MaskedRange,
|
|
2132
|
+
from: 1,
|
|
2133
|
+
to: 31,
|
|
2134
|
+
maxLength: 2
|
|
2311
2135
|
},
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
);
|
|
2318
|
-
}
|
|
2319
|
-
);
|
|
2320
|
-
var DatePicker = (0, import_react19.forwardRef)(
|
|
2321
|
-
(inProps, ref) => {
|
|
2322
|
-
const props = (0, import_joy27.useThemeProps)({ props: inProps, name: "DatePicker" });
|
|
2323
|
-
const {
|
|
2324
|
-
onChange,
|
|
2325
|
-
disabled,
|
|
2326
|
-
label,
|
|
2327
|
-
error,
|
|
2328
|
-
helperText,
|
|
2329
|
-
minDate,
|
|
2330
|
-
maxDate,
|
|
2331
|
-
disableFuture,
|
|
2332
|
-
disablePast,
|
|
2333
|
-
required,
|
|
2334
|
-
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
2335
|
-
sx,
|
|
2336
|
-
className,
|
|
2337
|
-
format = "YYYY/MM/DD",
|
|
2338
|
-
displayFormat = "YYYY/MM/DD",
|
|
2339
|
-
size,
|
|
2340
|
-
inputReadOnly,
|
|
2341
|
-
hideClearButton,
|
|
2342
|
-
readOnly,
|
|
2343
|
-
shouldDisableDate,
|
|
2344
|
-
...innerProps
|
|
2345
|
-
} = props;
|
|
2346
|
-
const innerRef = (0, import_react19.useRef)(null);
|
|
2347
|
-
const buttonRef = (0, import_react19.useRef)(null);
|
|
2348
|
-
const [value, setValue] = useControlledState(
|
|
2349
|
-
props.value,
|
|
2350
|
-
props.defaultValue || "",
|
|
2351
|
-
(0, import_react19.useCallback)(
|
|
2352
|
-
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
2353
|
-
[props.name, onChange]
|
|
2354
|
-
)
|
|
2355
|
-
);
|
|
2356
|
-
const [displayValue, setDisplayValue] = (0, import_react19.useState)(
|
|
2357
|
-
() => value ? formatValueString(parseDate(value, format), displayFormat) : ""
|
|
2358
|
-
);
|
|
2359
|
-
const [anchorEl, setAnchorEl] = (0, import_react19.useState)(null);
|
|
2360
|
-
const open = Boolean(anchorEl);
|
|
2361
|
-
(0, import_react19.useEffect)(() => {
|
|
2362
|
-
if (!anchorEl) {
|
|
2363
|
-
innerRef.current?.blur();
|
|
2364
|
-
}
|
|
2365
|
-
}, [anchorEl, innerRef]);
|
|
2366
|
-
(0, import_react19.useEffect)(() => {
|
|
2367
|
-
if (value === "") {
|
|
2368
|
-
setDisplayValue("");
|
|
2369
|
-
return;
|
|
2370
|
-
}
|
|
2371
|
-
const formattedValue = formatValueString(
|
|
2372
|
-
parseDate(value, format),
|
|
2373
|
-
displayFormat
|
|
2374
|
-
);
|
|
2375
|
-
if (validValueFormat(formattedValue, displayFormat) && formattedValue !== displayValue) {
|
|
2376
|
-
setDisplayValue(formattedValue);
|
|
2377
|
-
}
|
|
2378
|
-
}, [displayFormat, displayValue, format, value]);
|
|
2379
|
-
(0, import_react19.useImperativeHandle)(ref, () => innerRef.current, [
|
|
2380
|
-
innerRef
|
|
2381
|
-
]);
|
|
2382
|
-
const handleChange = (0, import_react19.useCallback)(
|
|
2383
|
-
(event) => {
|
|
2384
|
-
const value2 = event.target.value;
|
|
2385
|
-
setDisplayValue(
|
|
2386
|
-
value2 ? formatValueString(parseDate(value2, format), displayFormat) : value2
|
|
2387
|
-
);
|
|
2388
|
-
setValue(value2);
|
|
2389
|
-
},
|
|
2390
|
-
[displayFormat, format, setValue]
|
|
2391
|
-
);
|
|
2392
|
-
const handleDisplayInputChange = (0, import_react19.useCallback)(
|
|
2393
|
-
(event) => {
|
|
2394
|
-
if (event.target.value === "") {
|
|
2395
|
-
handleChange({
|
|
2396
|
-
target: {
|
|
2397
|
-
name: props.name,
|
|
2398
|
-
value: ""
|
|
2399
|
-
}
|
|
2400
|
-
});
|
|
2401
|
-
return;
|
|
2402
|
-
}
|
|
2403
|
-
const isValidDisplayValue = validValueFormat(
|
|
2404
|
-
event.target.value,
|
|
2405
|
-
displayFormat
|
|
2406
|
-
);
|
|
2407
|
-
if (isValidDisplayValue) {
|
|
2408
|
-
const parsedDate = parseDate(event.target.value, displayFormat);
|
|
2409
|
-
const formattedValue = formatValueString(parsedDate, format);
|
|
2410
|
-
handleChange({
|
|
2411
|
-
target: {
|
|
2412
|
-
name: props.name,
|
|
2413
|
-
value: formattedValue
|
|
2414
|
-
}
|
|
2415
|
-
});
|
|
2416
|
-
}
|
|
2417
|
-
},
|
|
2418
|
-
[displayFormat, format, handleChange, props.name]
|
|
2419
|
-
);
|
|
2420
|
-
const handleCalendarToggle = (0, import_react19.useCallback)(
|
|
2421
|
-
(event) => {
|
|
2422
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2423
|
-
setTimeout(() => {
|
|
2424
|
-
innerRef.current?.focus();
|
|
2425
|
-
}, 0);
|
|
2426
|
-
},
|
|
2427
|
-
[anchorEl, setAnchorEl, innerRef]
|
|
2428
|
-
);
|
|
2429
|
-
const handleInputMouseDown = (0, import_react19.useCallback)(
|
|
2430
|
-
(event) => {
|
|
2431
|
-
if (inputReadOnly) {
|
|
2432
|
-
event.preventDefault();
|
|
2433
|
-
buttonRef.current?.focus();
|
|
2434
|
-
}
|
|
2435
|
-
},
|
|
2436
|
-
[inputReadOnly, buttonRef]
|
|
2437
|
-
);
|
|
2438
|
-
return /* @__PURE__ */ import_react19.default.createElement(DatePickerRoot, null, /* @__PURE__ */ import_react19.default.createElement(import_base2.FocusTrap, { open: true }, /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement(
|
|
2439
|
-
Input_default,
|
|
2440
|
-
{
|
|
2441
|
-
...innerProps,
|
|
2442
|
-
color: error ? "danger" : innerProps.color,
|
|
2443
|
-
ref: innerRef,
|
|
2444
|
-
size,
|
|
2445
|
-
value: displayValue,
|
|
2446
|
-
onChange: handleDisplayInputChange,
|
|
2447
|
-
placeholder: displayFormat,
|
|
2448
|
-
disabled,
|
|
2449
|
-
required,
|
|
2450
|
-
error,
|
|
2451
|
-
slotProps: {
|
|
2452
|
-
input: {
|
|
2453
|
-
component: TextMaskAdapter3,
|
|
2454
|
-
ref: innerRef,
|
|
2455
|
-
format: displayFormat,
|
|
2456
|
-
sx: {
|
|
2457
|
-
"&:hover": {
|
|
2458
|
-
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
2459
|
-
}
|
|
2460
|
-
},
|
|
2461
|
-
onMouseDown: handleInputMouseDown
|
|
2462
|
-
}
|
|
2136
|
+
M: {
|
|
2137
|
+
mask: import_react_imask.IMask.MaskedRange,
|
|
2138
|
+
from: 1,
|
|
2139
|
+
to: 12,
|
|
2140
|
+
maxLength: 2
|
|
2463
2141
|
},
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
ref: buttonRef,
|
|
2470
|
-
variant: "plain",
|
|
2471
|
-
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
2472
|
-
"aria-label": "Toggle Calendar",
|
|
2473
|
-
"aria-controls": "date-picker-popper",
|
|
2474
|
-
"aria-haspopup": "dialog",
|
|
2475
|
-
"aria-expanded": open,
|
|
2476
|
-
disabled
|
|
2477
|
-
},
|
|
2478
|
-
/* @__PURE__ */ import_react19.default.createElement(import_CalendarToday.default, null)
|
|
2479
|
-
),
|
|
2480
|
-
label,
|
|
2481
|
-
helperText,
|
|
2482
|
-
readOnly: readOnly || inputReadOnly
|
|
2483
|
-
}
|
|
2484
|
-
), open && /* @__PURE__ */ import_react19.default.createElement(import_base2.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2485
|
-
StyledPopper,
|
|
2486
|
-
{
|
|
2487
|
-
id: "date-picker-popper",
|
|
2488
|
-
open: true,
|
|
2489
|
-
anchorEl,
|
|
2490
|
-
placement: "bottom-end",
|
|
2491
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
2492
|
-
modifiers: [
|
|
2493
|
-
{
|
|
2494
|
-
name: "offset",
|
|
2495
|
-
options: {
|
|
2496
|
-
offset: [4, 4]
|
|
2497
|
-
}
|
|
2498
|
-
}
|
|
2499
|
-
],
|
|
2500
|
-
"aria-label": "Calendar Tooltip",
|
|
2501
|
-
"aria-expanded": open
|
|
2502
|
-
},
|
|
2503
|
-
/* @__PURE__ */ import_react19.default.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2504
|
-
Calendar_default,
|
|
2505
|
-
{
|
|
2506
|
-
value: value && !Number.isNaN(parseDate(value, format).getTime()) ? [parseDate(value, format), void 0] : void 0,
|
|
2507
|
-
onChange: ([date]) => {
|
|
2508
|
-
handleChange({
|
|
2509
|
-
target: {
|
|
2510
|
-
name: props.name,
|
|
2511
|
-
value: formatValueString(date, format)
|
|
2512
|
-
}
|
|
2513
|
-
});
|
|
2514
|
-
setAnchorEl(null);
|
|
2515
|
-
},
|
|
2516
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
2517
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
2518
|
-
disableFuture,
|
|
2519
|
-
disablePast,
|
|
2520
|
-
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0
|
|
2142
|
+
Y: {
|
|
2143
|
+
mask: import_react_imask.IMask.MaskedRange,
|
|
2144
|
+
from: 1900,
|
|
2145
|
+
to: 9999,
|
|
2146
|
+
maxLength: 4
|
|
2521
2147
|
}
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
size,
|
|
2533
|
-
variant: "plain",
|
|
2534
|
-
color: "neutral",
|
|
2535
|
-
onClick: () => {
|
|
2536
|
-
handleChange({
|
|
2537
|
-
target: {
|
|
2538
|
-
name: props.name,
|
|
2539
|
-
value: ""
|
|
2540
|
-
}
|
|
2541
|
-
});
|
|
2542
|
-
setAnchorEl(null);
|
|
2543
|
-
}
|
|
2544
|
-
},
|
|
2545
|
-
"Clear"
|
|
2546
|
-
)
|
|
2547
|
-
))
|
|
2548
|
-
)))));
|
|
2549
|
-
}
|
|
2550
|
-
);
|
|
2551
|
-
|
|
2552
|
-
// src/components/DatePicker/index.ts
|
|
2553
|
-
var DatePicker_default = DatePicker;
|
|
2554
|
-
|
|
2555
|
-
// src/components/Textarea/Textarea.tsx
|
|
2556
|
-
var import_react20 = __toESM(require("react"));
|
|
2557
|
-
var import_joy28 = require("@mui/joy");
|
|
2558
|
-
var import_framer_motion18 = require("framer-motion");
|
|
2559
|
-
var MotionTextarea = (0, import_framer_motion18.motion)(import_joy28.Textarea);
|
|
2560
|
-
var Textarea = (props) => {
|
|
2148
|
+
},
|
|
2149
|
+
format: (date) => formatValueString(date, format),
|
|
2150
|
+
parse: (str) => parseDate(str, format),
|
|
2151
|
+
autofix: "pad",
|
|
2152
|
+
overwrite: true
|
|
2153
|
+
}
|
|
2154
|
+
);
|
|
2155
|
+
});
|
|
2156
|
+
var DatePicker = (0, import_react19.forwardRef)((inProps, ref) => {
|
|
2157
|
+
const props = (0, import_joy27.useThemeProps)({ props: inProps, name: "DatePicker" });
|
|
2561
2158
|
const {
|
|
2159
|
+
onChange,
|
|
2160
|
+
disabled,
|
|
2562
2161
|
label,
|
|
2563
2162
|
error,
|
|
2564
2163
|
helperText,
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2164
|
+
minDate,
|
|
2165
|
+
maxDate,
|
|
2166
|
+
disableFuture,
|
|
2167
|
+
disablePast,
|
|
2568
2168
|
required,
|
|
2569
|
-
minRows = 2,
|
|
2570
|
-
maxRows = 4,
|
|
2571
2169
|
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
2572
2170
|
sx,
|
|
2573
2171
|
className,
|
|
2172
|
+
format = "YYYY/MM/DD",
|
|
2173
|
+
displayFormat = "YYYY/MM/DD",
|
|
2174
|
+
size,
|
|
2175
|
+
inputReadOnly,
|
|
2176
|
+
hideClearButton,
|
|
2177
|
+
readOnly,
|
|
2178
|
+
shouldDisableDate,
|
|
2574
2179
|
...innerProps
|
|
2575
2180
|
} = props;
|
|
2576
|
-
const
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2181
|
+
const innerRef = (0, import_react19.useRef)(null);
|
|
2182
|
+
const buttonRef = (0, import_react19.useRef)(null);
|
|
2183
|
+
const [value, setValue] = useControlledState(
|
|
2184
|
+
props.value,
|
|
2185
|
+
props.defaultValue || "",
|
|
2186
|
+
(0, import_react19.useCallback)((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
2187
|
+
);
|
|
2188
|
+
const [displayValue, setDisplayValue] = (0, import_react19.useState)(
|
|
2189
|
+
() => value ? formatValueString(parseDate(value, format), displayFormat) : ""
|
|
2190
|
+
);
|
|
2191
|
+
const [anchorEl, setAnchorEl] = (0, import_react19.useState)(null);
|
|
2192
|
+
const open = Boolean(anchorEl);
|
|
2193
|
+
(0, import_react19.useEffect)(() => {
|
|
2194
|
+
if (!anchorEl) {
|
|
2195
|
+
innerRef.current?.blur();
|
|
2196
|
+
}
|
|
2197
|
+
}, [anchorEl, innerRef]);
|
|
2198
|
+
(0, import_react19.useEffect)(() => {
|
|
2199
|
+
if (value === "") {
|
|
2200
|
+
setDisplayValue("");
|
|
2201
|
+
return;
|
|
2202
|
+
}
|
|
2203
|
+
const formattedValue = formatValueString(parseDate(value, format), displayFormat);
|
|
2204
|
+
if (validValueFormat(formattedValue, displayFormat) && formattedValue !== displayValue) {
|
|
2205
|
+
setDisplayValue(formattedValue);
|
|
2206
|
+
}
|
|
2207
|
+
}, [displayFormat, displayValue, format, value]);
|
|
2208
|
+
(0, import_react19.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
2209
|
+
const handleChange = (0, import_react19.useCallback)(
|
|
2210
|
+
(event) => {
|
|
2211
|
+
const value2 = event.target.value;
|
|
2212
|
+
setDisplayValue(value2 ? formatValueString(parseDate(value2, format), displayFormat) : value2);
|
|
2213
|
+
setValue(value2);
|
|
2214
|
+
},
|
|
2215
|
+
[displayFormat, format, setValue]
|
|
2216
|
+
);
|
|
2217
|
+
const handleDisplayInputChange = (0, import_react19.useCallback)(
|
|
2218
|
+
(event) => {
|
|
2219
|
+
if (event.target.value === "") {
|
|
2220
|
+
handleChange({
|
|
2221
|
+
target: {
|
|
2222
|
+
name: props.name,
|
|
2223
|
+
value: ""
|
|
2224
|
+
}
|
|
2225
|
+
});
|
|
2226
|
+
return;
|
|
2227
|
+
}
|
|
2228
|
+
const isValidDisplayValue = validValueFormat(event.target.value, displayFormat);
|
|
2229
|
+
if (isValidDisplayValue) {
|
|
2230
|
+
const parsedDate = parseDate(event.target.value, displayFormat);
|
|
2231
|
+
const formattedValue = formatValueString(parsedDate, format);
|
|
2232
|
+
handleChange({
|
|
2233
|
+
target: {
|
|
2234
|
+
name: props.name,
|
|
2235
|
+
value: formattedValue
|
|
2236
|
+
}
|
|
2237
|
+
});
|
|
2238
|
+
}
|
|
2239
|
+
},
|
|
2240
|
+
[displayFormat, format, handleChange, props.name]
|
|
2241
|
+
);
|
|
2242
|
+
const handleCalendarToggle = (0, import_react19.useCallback)(
|
|
2243
|
+
(event) => {
|
|
2244
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2245
|
+
setTimeout(() => {
|
|
2246
|
+
innerRef.current?.focus();
|
|
2247
|
+
}, 0);
|
|
2248
|
+
},
|
|
2249
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
2250
|
+
);
|
|
2251
|
+
const handleInputMouseDown = (0, import_react19.useCallback)(
|
|
2252
|
+
(event) => {
|
|
2253
|
+
if (inputReadOnly) {
|
|
2254
|
+
event.preventDefault();
|
|
2255
|
+
buttonRef.current?.focus();
|
|
2256
|
+
}
|
|
2257
|
+
},
|
|
2258
|
+
[inputReadOnly, buttonRef]
|
|
2259
|
+
);
|
|
2260
|
+
return /* @__PURE__ */ import_react19.default.createElement(DatePickerRoot, null, /* @__PURE__ */ import_react19.default.createElement(import_base2.FocusTrap, { open: true }, /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement(
|
|
2261
|
+
Input_default,
|
|
2262
|
+
{
|
|
2263
|
+
...innerProps,
|
|
2264
|
+
color: error ? "danger" : innerProps.color,
|
|
2265
|
+
ref: innerRef,
|
|
2266
|
+
size,
|
|
2267
|
+
value: displayValue,
|
|
2268
|
+
onChange: handleDisplayInputChange,
|
|
2269
|
+
placeholder: displayFormat,
|
|
2270
|
+
disabled,
|
|
2271
|
+
required,
|
|
2272
|
+
error,
|
|
2273
|
+
slotProps: {
|
|
2274
|
+
input: {
|
|
2275
|
+
component: TextMaskAdapter3,
|
|
2276
|
+
ref: innerRef,
|
|
2277
|
+
format: displayFormat,
|
|
2278
|
+
sx: {
|
|
2279
|
+
"&:hover": {
|
|
2280
|
+
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
2281
|
+
}
|
|
2282
|
+
},
|
|
2283
|
+
onMouseDown: handleInputMouseDown
|
|
2284
|
+
}
|
|
2285
|
+
},
|
|
2286
|
+
className,
|
|
2287
|
+
sx,
|
|
2288
|
+
endDecorator: /* @__PURE__ */ import_react19.default.createElement(
|
|
2289
|
+
CalendarButton,
|
|
2290
|
+
{
|
|
2291
|
+
ref: buttonRef,
|
|
2292
|
+
variant: "plain",
|
|
2293
|
+
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
2294
|
+
"aria-label": "Toggle Calendar",
|
|
2295
|
+
"aria-controls": "date-picker-popper",
|
|
2296
|
+
"aria-haspopup": "dialog",
|
|
2297
|
+
"aria-expanded": open,
|
|
2298
|
+
disabled
|
|
2299
|
+
},
|
|
2300
|
+
/* @__PURE__ */ import_react19.default.createElement(import_CalendarToday.default, null)
|
|
2301
|
+
),
|
|
2302
|
+
label,
|
|
2303
|
+
helperText,
|
|
2304
|
+
readOnly: readOnly || inputReadOnly
|
|
2305
|
+
}
|
|
2306
|
+
), open && /* @__PURE__ */ import_react19.default.createElement(import_base2.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2307
|
+
StyledPopper,
|
|
2308
|
+
{
|
|
2309
|
+
id: "date-picker-popper",
|
|
2310
|
+
open: true,
|
|
2311
|
+
anchorEl,
|
|
2312
|
+
placement: "bottom-end",
|
|
2313
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
2314
|
+
modifiers: [
|
|
2315
|
+
{
|
|
2316
|
+
name: "offset",
|
|
2317
|
+
options: {
|
|
2318
|
+
offset: [4, 4]
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
],
|
|
2322
|
+
"aria-label": "Calendar Tooltip",
|
|
2323
|
+
"aria-expanded": open
|
|
2324
|
+
},
|
|
2325
|
+
/* @__PURE__ */ import_react19.default.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2326
|
+
Calendar_default,
|
|
2327
|
+
{
|
|
2328
|
+
value: value && !Number.isNaN(parseDate(value, format).getTime()) ? [parseDate(value, format), void 0] : void 0,
|
|
2329
|
+
onChange: ([date]) => {
|
|
2330
|
+
handleChange({
|
|
2331
|
+
target: {
|
|
2332
|
+
name: props.name,
|
|
2333
|
+
value: formatValueString(date, format)
|
|
2334
|
+
}
|
|
2335
|
+
});
|
|
2336
|
+
setAnchorEl(null);
|
|
2337
|
+
},
|
|
2338
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
2339
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
2340
|
+
disableFuture,
|
|
2341
|
+
disablePast,
|
|
2342
|
+
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0
|
|
2343
|
+
}
|
|
2344
|
+
), !hideClearButton && /* @__PURE__ */ import_react19.default.createElement(
|
|
2345
|
+
DialogActions_default,
|
|
2346
|
+
{
|
|
2347
|
+
sx: {
|
|
2348
|
+
p: 1
|
|
2349
|
+
}
|
|
2350
|
+
},
|
|
2351
|
+
/* @__PURE__ */ import_react19.default.createElement(
|
|
2352
|
+
Button_default,
|
|
2353
|
+
{
|
|
2354
|
+
size,
|
|
2355
|
+
variant: "plain",
|
|
2356
|
+
color: "neutral",
|
|
2357
|
+
onClick: () => {
|
|
2358
|
+
handleChange({
|
|
2359
|
+
target: {
|
|
2360
|
+
name: props.name,
|
|
2361
|
+
value: ""
|
|
2362
|
+
}
|
|
2363
|
+
});
|
|
2364
|
+
setAnchorEl(null);
|
|
2365
|
+
}
|
|
2366
|
+
},
|
|
2367
|
+
"Clear"
|
|
2368
|
+
)
|
|
2369
|
+
))
|
|
2370
|
+
)))));
|
|
2371
|
+
});
|
|
2372
|
+
|
|
2373
|
+
// src/components/DatePicker/index.ts
|
|
2374
|
+
var DatePicker_default = DatePicker;
|
|
2375
|
+
|
|
2376
|
+
// src/components/Textarea/Textarea.tsx
|
|
2377
|
+
var import_react20 = __toESM(require("react"));
|
|
2378
|
+
var import_joy28 = require("@mui/joy");
|
|
2379
|
+
var import_framer_motion18 = require("framer-motion");
|
|
2380
|
+
var MotionTextarea = (0, import_framer_motion18.motion)(import_joy28.Textarea);
|
|
2381
|
+
var Textarea = (props) => {
|
|
2382
|
+
const {
|
|
2383
|
+
label,
|
|
2384
|
+
error,
|
|
2385
|
+
helperText,
|
|
2386
|
+
color,
|
|
2387
|
+
size,
|
|
2388
|
+
disabled,
|
|
2389
|
+
required,
|
|
2390
|
+
minRows = 2,
|
|
2391
|
+
maxRows = 4,
|
|
2392
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
2393
|
+
sx,
|
|
2394
|
+
className,
|
|
2395
|
+
...innerProps
|
|
2396
|
+
} = props;
|
|
2397
|
+
const textarea = /* @__PURE__ */ import_react20.default.createElement(
|
|
2398
|
+
MotionTextarea,
|
|
2399
|
+
{
|
|
2400
|
+
required,
|
|
2401
|
+
disabled,
|
|
2402
|
+
color: error ? "danger" : color,
|
|
2403
|
+
size,
|
|
2404
|
+
minRows,
|
|
2405
|
+
maxRows,
|
|
2406
|
+
...innerProps
|
|
2586
2407
|
}
|
|
2587
2408
|
);
|
|
2588
2409
|
return /* @__PURE__ */ import_react20.default.createElement(
|
|
@@ -2780,18 +2601,9 @@ function Pagination(props) {
|
|
|
2780
2601
|
setPaginationModel({ ...paginationModel, page: newPage });
|
|
2781
2602
|
};
|
|
2782
2603
|
const firstPage = 1;
|
|
2783
|
-
const lastPage = Math.max(
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
);
|
|
2787
|
-
const beforePages = [
|
|
2788
|
-
paginationModel.page - 2,
|
|
2789
|
-
paginationModel.page - 1
|
|
2790
|
-
].filter((p) => p > 1);
|
|
2791
|
-
const afterPages = [
|
|
2792
|
-
paginationModel.page + 1,
|
|
2793
|
-
paginationModel.page + 2
|
|
2794
|
-
].filter((p) => p <= lastPage - 1);
|
|
2604
|
+
const lastPage = Math.max(firstPage, Math.ceil(rowCount / paginationModel.pageSize));
|
|
2605
|
+
const beforePages = [paginationModel.page - 2, paginationModel.page - 1].filter((p) => p > 1);
|
|
2606
|
+
const afterPages = [paginationModel.page + 1, paginationModel.page + 2].filter((p) => p <= lastPage - 1);
|
|
2795
2607
|
const isMoreAfterPages = lastPage > 1 && paginationModel.page < lastPage - 3;
|
|
2796
2608
|
const isMoreBeforePages = lastPage > 1 && paginationModel.page > 4;
|
|
2797
2609
|
(0, import_react23.useEffect)(() => {
|
|
@@ -2810,16 +2622,7 @@ function Pagination(props) {
|
|
|
2810
2622
|
"aria-label": "Previous page"
|
|
2811
2623
|
},
|
|
2812
2624
|
/* @__PURE__ */ import_react23.default.createElement(import_ChevronLeft2.default, null)
|
|
2813
|
-
), paginationModel.page !== firstPage && /* @__PURE__ */ import_react23.default.createElement(
|
|
2814
|
-
PaginationButton,
|
|
2815
|
-
{
|
|
2816
|
-
size,
|
|
2817
|
-
variant: "plain",
|
|
2818
|
-
color: "neutral",
|
|
2819
|
-
onClick: () => handlePageChange(firstPage)
|
|
2820
|
-
},
|
|
2821
|
-
firstPage
|
|
2822
|
-
), isMoreBeforePages && /* @__PURE__ */ import_react23.default.createElement(
|
|
2625
|
+
), paginationModel.page !== firstPage && /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(firstPage) }, firstPage), isMoreBeforePages && /* @__PURE__ */ import_react23.default.createElement(
|
|
2823
2626
|
PaginationButton,
|
|
2824
2627
|
{
|
|
2825
2628
|
size,
|
|
@@ -2829,27 +2632,7 @@ function Pagination(props) {
|
|
|
2829
2632
|
"aria-label": "More previous pages"
|
|
2830
2633
|
},
|
|
2831
2634
|
"..."
|
|
2832
|
-
), beforePages.map((p) => /* @__PURE__ */ import_react23.default.createElement(
|
|
2833
|
-
PaginationButton,
|
|
2834
|
-
{
|
|
2835
|
-
key: p,
|
|
2836
|
-
size,
|
|
2837
|
-
variant: "plain",
|
|
2838
|
-
color: "neutral",
|
|
2839
|
-
onClick: () => handlePageChange(p)
|
|
2840
|
-
},
|
|
2841
|
-
p
|
|
2842
|
-
)), /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { active: "active", size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ import_react23.default.createElement(
|
|
2843
|
-
PaginationButton,
|
|
2844
|
-
{
|
|
2845
|
-
key: p,
|
|
2846
|
-
size,
|
|
2847
|
-
variant: "plain",
|
|
2848
|
-
color: "neutral",
|
|
2849
|
-
onClick: () => handlePageChange(p)
|
|
2850
|
-
},
|
|
2851
|
-
p
|
|
2852
|
-
)), isMoreAfterPages && /* @__PURE__ */ import_react23.default.createElement(
|
|
2635
|
+
), beforePages.map((p) => /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { active: "active", size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), isMoreAfterPages && /* @__PURE__ */ import_react23.default.createElement(
|
|
2853
2636
|
PaginationButton,
|
|
2854
2637
|
{
|
|
2855
2638
|
size,
|
|
@@ -2859,16 +2642,7 @@ function Pagination(props) {
|
|
|
2859
2642
|
onClick: () => handlePageChange(paginationModel.page + 3)
|
|
2860
2643
|
},
|
|
2861
2644
|
"..."
|
|
2862
|
-
), paginationModel.page !== lastPage && /* @__PURE__ */ import_react23.default.createElement(
|
|
2863
|
-
PaginationButton,
|
|
2864
|
-
{
|
|
2865
|
-
size,
|
|
2866
|
-
variant: "plain",
|
|
2867
|
-
color: "neutral",
|
|
2868
|
-
onClick: () => handlePageChange(lastPage)
|
|
2869
|
-
},
|
|
2870
|
-
lastPage
|
|
2871
|
-
), /* @__PURE__ */ import_react23.default.createElement(
|
|
2645
|
+
), paginationModel.page !== lastPage && /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(lastPage) }, lastPage), /* @__PURE__ */ import_react23.default.createElement(
|
|
2872
2646
|
PaginationIconButton,
|
|
2873
2647
|
{
|
|
2874
2648
|
size,
|
|
@@ -2910,7 +2684,7 @@ function InfoSign(props) {
|
|
|
2910
2684
|
maxWidth: "320px"
|
|
2911
2685
|
}
|
|
2912
2686
|
},
|
|
2913
|
-
title: message?.split("\n").map((line, i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: i }, line))
|
|
2687
|
+
title: message?.split("\n").map((line, i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: `info-sign-${i}` }, line))
|
|
2914
2688
|
},
|
|
2915
2689
|
/* @__PURE__ */ import_react24.default.createElement(InfoIcon, null)
|
|
2916
2690
|
);
|
|
@@ -2944,15 +2718,7 @@ var TextEllipsis = ({ children }) => {
|
|
|
2944
2718
|
}, [children]);
|
|
2945
2719
|
const content = /* @__PURE__ */ import_react25.default.createElement(EllipsisDiv, { ref: textRef }, children);
|
|
2946
2720
|
if (showTooltip) {
|
|
2947
|
-
return /* @__PURE__ */ import_react25.default.createElement(
|
|
2948
|
-
Tooltip_default,
|
|
2949
|
-
{
|
|
2950
|
-
title: children,
|
|
2951
|
-
placement: "top",
|
|
2952
|
-
onClick: (e) => e.stopPropagation()
|
|
2953
|
-
},
|
|
2954
|
-
content
|
|
2955
|
-
);
|
|
2721
|
+
return /* @__PURE__ */ import_react25.default.createElement(Tooltip_default, { title: children, placement: "top", onClick: (e) => e.stopPropagation() }, content);
|
|
2956
2722
|
}
|
|
2957
2723
|
return content;
|
|
2958
2724
|
};
|
|
@@ -3136,10 +2902,7 @@ var HeadCell = (props) => {
|
|
|
3136
2902
|
() => `${tableId}_header_${headerName ?? field}`.trim(),
|
|
3137
2903
|
[tableId, headerName, field]
|
|
3138
2904
|
);
|
|
3139
|
-
const resizer = (0, import_react25.useMemo)(
|
|
3140
|
-
() => resizable ?? true ? Resizer(ref) : null,
|
|
3141
|
-
[resizable, ref]
|
|
3142
|
-
);
|
|
2905
|
+
const resizer = (0, import_react25.useMemo)(() => resizable ?? true ? Resizer(ref) : null, [resizable, ref]);
|
|
3143
2906
|
const style = (0, import_react25.useMemo)(
|
|
3144
2907
|
() => ({
|
|
3145
2908
|
width,
|
|
@@ -3154,17 +2917,7 @@ var HeadCell = (props) => {
|
|
|
3154
2917
|
// TODO: multi-sort때문에 일단 추가한 property, joy-ui에서는 multi-sort시 th에 user-select: none을 적용하고 툴팁을 띄워준다.
|
|
3155
2918
|
userSelect: "none"
|
|
3156
2919
|
}),
|
|
3157
|
-
[
|
|
3158
|
-
isPinned,
|
|
3159
|
-
maxWidth,
|
|
3160
|
-
minWidth,
|
|
3161
|
-
pinnedEndPosition,
|
|
3162
|
-
pinnedStartPosition,
|
|
3163
|
-
sortable,
|
|
3164
|
-
stickyHeader,
|
|
3165
|
-
theme,
|
|
3166
|
-
width
|
|
3167
|
-
]
|
|
2920
|
+
[isPinned, maxWidth, minWidth, pinnedEndPosition, pinnedStartPosition, sortable, stickyHeader, theme, width]
|
|
3168
2921
|
);
|
|
3169
2922
|
const textAlign = getTextAlign(props);
|
|
3170
2923
|
const initialSort = sortOrder[0];
|
|
@@ -3221,20 +2974,7 @@ var HeadCell = (props) => {
|
|
|
3221
2974
|
whileHover: "hover",
|
|
3222
2975
|
initial: "initial"
|
|
3223
2976
|
},
|
|
3224
|
-
/* @__PURE__ */ import_react25.default.createElement(
|
|
3225
|
-
Stack_default,
|
|
3226
|
-
{
|
|
3227
|
-
gap: 1,
|
|
3228
|
-
direction: "row",
|
|
3229
|
-
justifyContent: textAlign,
|
|
3230
|
-
alignItems: "center"
|
|
3231
|
-
},
|
|
3232
|
-
textAlign === "end" && sortIcon,
|
|
3233
|
-
textAlign === "end" && infoSign,
|
|
3234
|
-
/* @__PURE__ */ import_react25.default.createElement(TextEllipsis, null, headerName ?? field, editMode && required && /* @__PURE__ */ import_react25.default.createElement(Asterisk, null, "*")),
|
|
3235
|
-
textAlign === "start" && infoSign,
|
|
3236
|
-
textAlign === "start" && sortIcon
|
|
3237
|
-
),
|
|
2977
|
+
/* @__PURE__ */ import_react25.default.createElement(Stack_default, { gap: 1, direction: "row", justifyContent: textAlign, alignItems: "center" }, textAlign === "end" && sortIcon, textAlign === "end" && infoSign, /* @__PURE__ */ import_react25.default.createElement(TextEllipsis, null, headerName ?? field, editMode && required && /* @__PURE__ */ import_react25.default.createElement(Asterisk, null, "*")), textAlign === "start" && infoSign, textAlign === "start" && sortIcon),
|
|
3238
2978
|
resizer
|
|
3239
2979
|
);
|
|
3240
2980
|
};
|
|
@@ -3253,7 +2993,10 @@ var BodyCell = (props) => {
|
|
|
3253
2993
|
pinnedStartPosition,
|
|
3254
2994
|
pinnedEndPosition,
|
|
3255
2995
|
row,
|
|
3256
|
-
rowId
|
|
2996
|
+
rowId,
|
|
2997
|
+
cellClassName,
|
|
2998
|
+
onCellEditStart,
|
|
2999
|
+
onCellEditStop
|
|
3257
3000
|
} = props;
|
|
3258
3001
|
const theme = (0, import_joy33.useTheme)();
|
|
3259
3002
|
const [value, setValue] = (0, import_react25.useState)(row[field]);
|
|
@@ -3262,20 +3005,22 @@ var BodyCell = (props) => {
|
|
|
3262
3005
|
() => ({
|
|
3263
3006
|
row,
|
|
3264
3007
|
value,
|
|
3265
|
-
id: rowId
|
|
3008
|
+
id: rowId,
|
|
3009
|
+
field
|
|
3266
3010
|
}),
|
|
3267
|
-
[row, rowId, value]
|
|
3011
|
+
[row, rowId, value, field]
|
|
3268
3012
|
);
|
|
3269
3013
|
const editMode = (0, import_react25.useMemo)(
|
|
3270
3014
|
() => !!(props.editMode && (typeof isCellEditable === "function" ? isCellEditable(params) : isCellEditable ?? true)),
|
|
3271
3015
|
[props.editMode, isCellEditable, params]
|
|
3272
3016
|
);
|
|
3017
|
+
const propsComponentProps = "componentProps" in props ? props.componentProps : null;
|
|
3273
3018
|
const componentProps = (0, import_react25.useMemo)(
|
|
3274
3019
|
() => ({
|
|
3275
|
-
..."componentProps" in props && (typeof
|
|
3020
|
+
..."componentProps" in props && (typeof propsComponentProps === "function" ? propsComponentProps(params) : propsComponentProps || {}),
|
|
3276
3021
|
size: "sm"
|
|
3277
3022
|
}),
|
|
3278
|
-
[
|
|
3023
|
+
[props, propsComponentProps, params]
|
|
3279
3024
|
);
|
|
3280
3025
|
const editModeComponentProps = (0, import_react25.useMemo)(
|
|
3281
3026
|
() => ({
|
|
@@ -3284,7 +3029,7 @@ var BodyCell = (props) => {
|
|
|
3284
3029
|
componentProps.onChange?.(e);
|
|
3285
3030
|
setValue(e.target.value);
|
|
3286
3031
|
if (type === "select") {
|
|
3287
|
-
|
|
3032
|
+
onCellEditStop?.({
|
|
3288
3033
|
...params,
|
|
3289
3034
|
originalRow: row,
|
|
3290
3035
|
row: {
|
|
@@ -3297,7 +3042,7 @@ var BodyCell = (props) => {
|
|
|
3297
3042
|
},
|
|
3298
3043
|
onFocus: (e) => {
|
|
3299
3044
|
componentProps.onFocus?.(e);
|
|
3300
|
-
|
|
3045
|
+
onCellEditStart?.({
|
|
3301
3046
|
...params,
|
|
3302
3047
|
originalRow: row,
|
|
3303
3048
|
row: {
|
|
@@ -3310,7 +3055,7 @@ var BodyCell = (props) => {
|
|
|
3310
3055
|
onBlur: (e) => {
|
|
3311
3056
|
componentProps.onBlur?.(e);
|
|
3312
3057
|
if (type && ["number", "text", "longText", "currency", "date"].includes(type)) {
|
|
3313
|
-
|
|
3058
|
+
onCellEditStop?.({
|
|
3314
3059
|
...params,
|
|
3315
3060
|
originalRow: row,
|
|
3316
3061
|
row: {
|
|
@@ -3325,7 +3070,7 @@ var BodyCell = (props) => {
|
|
|
3325
3070
|
onChangeComplete: (e) => {
|
|
3326
3071
|
componentProps.onChangeComplete?.(e);
|
|
3327
3072
|
setValue(e.target.value);
|
|
3328
|
-
|
|
3073
|
+
onCellEditStop?.({
|
|
3329
3074
|
...params,
|
|
3330
3075
|
originalRow: row,
|
|
3331
3076
|
row: {
|
|
@@ -3337,29 +3082,14 @@ var BodyCell = (props) => {
|
|
|
3337
3082
|
}
|
|
3338
3083
|
}
|
|
3339
3084
|
}),
|
|
3340
|
-
[
|
|
3341
|
-
params,
|
|
3342
|
-
row,
|
|
3343
|
-
field,
|
|
3344
|
-
value,
|
|
3345
|
-
componentProps,
|
|
3346
|
-
type,
|
|
3347
|
-
props.onCellEditStop,
|
|
3348
|
-
props.onCellEditStart
|
|
3349
|
-
]
|
|
3085
|
+
[params, row, field, value, componentProps, type, onCellEditStop, onCellEditStart]
|
|
3350
3086
|
);
|
|
3351
3087
|
const EditModeComponent = (0, import_react25.useMemo)(() => {
|
|
3352
3088
|
if (renderEditCell) {
|
|
3353
3089
|
return (0, import_react25.createElement)((0, import_react25.memo)(renderEditCell), params);
|
|
3354
3090
|
}
|
|
3355
3091
|
return {
|
|
3356
|
-
date: /* @__PURE__ */ import_react25.default.createElement(
|
|
3357
|
-
DatePicker_default,
|
|
3358
|
-
{
|
|
3359
|
-
value,
|
|
3360
|
-
...editModeComponentProps
|
|
3361
|
-
}
|
|
3362
|
-
),
|
|
3092
|
+
date: /* @__PURE__ */ import_react25.default.createElement(DatePicker_default, { value, ...editModeComponentProps }),
|
|
3363
3093
|
currency: /* @__PURE__ */ import_react25.default.createElement(
|
|
3364
3094
|
CurrencyInput_default,
|
|
3365
3095
|
{
|
|
@@ -3367,29 +3097,9 @@ var BodyCell = (props) => {
|
|
|
3367
3097
|
...editModeComponentProps
|
|
3368
3098
|
}
|
|
3369
3099
|
),
|
|
3370
|
-
number: /* @__PURE__ */ import_react25.default.createElement(
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
value,
|
|
3374
|
-
type: "number",
|
|
3375
|
-
...editModeComponentProps
|
|
3376
|
-
}
|
|
3377
|
-
),
|
|
3378
|
-
text: /* @__PURE__ */ import_react25.default.createElement(
|
|
3379
|
-
Input_default,
|
|
3380
|
-
{
|
|
3381
|
-
value,
|
|
3382
|
-
type: "text",
|
|
3383
|
-
...editModeComponentProps
|
|
3384
|
-
}
|
|
3385
|
-
),
|
|
3386
|
-
longText: /* @__PURE__ */ import_react25.default.createElement(
|
|
3387
|
-
Textarea_default,
|
|
3388
|
-
{
|
|
3389
|
-
value,
|
|
3390
|
-
...editModeComponentProps
|
|
3391
|
-
}
|
|
3392
|
-
),
|
|
3100
|
+
number: /* @__PURE__ */ import_react25.default.createElement(Input_default, { value, type: "number", ...editModeComponentProps }),
|
|
3101
|
+
text: /* @__PURE__ */ import_react25.default.createElement(Input_default, { value, type: "text", ...editModeComponentProps }),
|
|
3102
|
+
longText: /* @__PURE__ */ import_react25.default.createElement(Textarea_default, { value, ...editModeComponentProps }),
|
|
3393
3103
|
autocomplete: /* @__PURE__ */ import_react25.default.createElement(
|
|
3394
3104
|
Autocomplete_default,
|
|
3395
3105
|
{
|
|
@@ -3407,50 +3117,34 @@ var BodyCell = (props) => {
|
|
|
3407
3117
|
}
|
|
3408
3118
|
)
|
|
3409
3119
|
}[type || "text"];
|
|
3410
|
-
}, [value, editModeComponentProps, type]);
|
|
3120
|
+
}, [value, editModeComponentProps, type, renderEditCell, params]);
|
|
3121
|
+
const linkComponentFromProps = props.component;
|
|
3411
3122
|
const ReadModeComponent = (0, import_react25.useMemo)(() => {
|
|
3412
3123
|
if (renderCell) {
|
|
3413
3124
|
return (0, import_react25.createElement)((0, import_react25.memo)(renderCell), params);
|
|
3414
3125
|
}
|
|
3415
3126
|
const innerText = value;
|
|
3416
3127
|
const typedComponent = {
|
|
3417
|
-
link: import_react25.default.createElement(
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
...componentProps
|
|
3422
|
-
}
|
|
3423
|
-
)
|
|
3128
|
+
link: import_react25.default.createElement(linkComponentFromProps || import_joy33.Link, {
|
|
3129
|
+
children: innerText,
|
|
3130
|
+
...componentProps
|
|
3131
|
+
})
|
|
3424
3132
|
}[type || "text"];
|
|
3425
3133
|
return typedComponent || innerText;
|
|
3426
|
-
}, [value, renderCell, params, type, componentProps]);
|
|
3134
|
+
}, [value, renderCell, params, type, componentProps, linkComponentFromProps]);
|
|
3135
|
+
const getActions = props.getActions;
|
|
3427
3136
|
const CellComponent = (0, import_react25.useMemo)(() => {
|
|
3428
3137
|
if (type === "actions") {
|
|
3429
|
-
return /* @__PURE__ */ import_react25.default.createElement(
|
|
3430
|
-
Stack_default,
|
|
3431
|
-
{
|
|
3432
|
-
direction: "row",
|
|
3433
|
-
gap: 1,
|
|
3434
|
-
justifyContent: "center",
|
|
3435
|
-
alignItems: "center"
|
|
3436
|
-
},
|
|
3437
|
-
props.getActions?.(params)
|
|
3438
|
-
);
|
|
3138
|
+
return /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", gap: 1, justifyContent: "center", alignItems: "center" }, getActions?.(params));
|
|
3439
3139
|
}
|
|
3440
3140
|
return editMode && EditModeComponent ? EditModeComponent : ReadModeComponent;
|
|
3441
|
-
}, [
|
|
3442
|
-
|
|
3443
|
-
props.getActions,
|
|
3444
|
-
params,
|
|
3445
|
-
editMode,
|
|
3446
|
-
EditModeComponent,
|
|
3447
|
-
ReadModeComponent
|
|
3448
|
-
]);
|
|
3449
|
-
const showTooltip = (0, import_react25.useMemo)(
|
|
3450
|
-
() => noWrap && type === "longText",
|
|
3451
|
-
[noWrap, type]
|
|
3452
|
-
);
|
|
3141
|
+
}, [type, getActions, params, editMode, EditModeComponent, ReadModeComponent]);
|
|
3142
|
+
const showTooltip = (0, import_react25.useMemo)(() => noWrap && type === "longText", [noWrap, type]);
|
|
3453
3143
|
const isBoundary = props.isLastStartPinnedColumn || props.isLastEndPinnedColumn;
|
|
3144
|
+
const computedCellClassName = (0, import_react25.useMemo)(
|
|
3145
|
+
() => (typeof cellClassName === "function" ? cellClassName(params) : cellClassName) || "",
|
|
3146
|
+
[cellClassName, params]
|
|
3147
|
+
);
|
|
3454
3148
|
(0, import_react25.useEffect)(() => {
|
|
3455
3149
|
setValue(row[field]);
|
|
3456
3150
|
}, [row, field]);
|
|
@@ -3469,11 +3163,11 @@ var BodyCell = (props) => {
|
|
|
3469
3163
|
zIndex: isPinned ? `calc(${theme.getCssVar("zIndex-table")} + ${isBoundary ? 2 : 3})` : void 0,
|
|
3470
3164
|
"--TableCell-dataBackground": isPinned ? `var(--TableCell-headBackground)` : void 0
|
|
3471
3165
|
},
|
|
3472
|
-
className: isLastStartPinnedColumn && "is-last-left"
|
|
3166
|
+
className: [isLastStartPinnedColumn && "is-last-left", isLastEndPinnedColumn && "is-last-right", computedCellClassName].filter(Boolean).join(" ") || ""
|
|
3473
3167
|
},
|
|
3474
3168
|
(0, import_react25.useMemo)(
|
|
3475
3169
|
() => showTooltip ? /* @__PURE__ */ import_react25.default.createElement(CellTextEllipsis, null, CellComponent) : CellComponent,
|
|
3476
|
-
[CellComponent, showTooltip
|
|
3170
|
+
[CellComponent, showTooltip]
|
|
3477
3171
|
)
|
|
3478
3172
|
);
|
|
3479
3173
|
};
|
|
@@ -3483,9 +3177,9 @@ var BodyRow = (0, import_react25.memo)(
|
|
|
3483
3177
|
return /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, columns.map((column, i) => /* @__PURE__ */ import_react25.default.createElement(
|
|
3484
3178
|
BodyCell,
|
|
3485
3179
|
{
|
|
3180
|
+
key: `${rowId}_${column.field.toString()}_${i}`,
|
|
3486
3181
|
...column,
|
|
3487
3182
|
tableId,
|
|
3488
|
-
key: `${rowId}_${column.field.toString()}_${i}`,
|
|
3489
3183
|
row,
|
|
3490
3184
|
rowId,
|
|
3491
3185
|
editMode,
|
|
@@ -3551,10 +3245,7 @@ function useDataTableRenderer({
|
|
|
3551
3245
|
const [sortModel, setSortModel] = useControlledState(
|
|
3552
3246
|
controlledSortModel,
|
|
3553
3247
|
initialState?.sorting?.sortModel ?? [],
|
|
3554
|
-
(0, import_react25.useCallback)(
|
|
3555
|
-
(sortModel2) => onSortModelChange?.(sortModel2),
|
|
3556
|
-
[onSortModelChange]
|
|
3557
|
-
)
|
|
3248
|
+
(0, import_react25.useCallback)((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3558
3249
|
);
|
|
3559
3250
|
const columnsByField = (0, import_react25.useMemo)(
|
|
3560
3251
|
() => columnsProp.reduce(
|
|
@@ -3629,9 +3320,7 @@ function useDataTableRenderer({
|
|
|
3629
3320
|
[dataInPage, isRowSelectable, getId]
|
|
3630
3321
|
);
|
|
3631
3322
|
const isAllSelected = (0, import_react25.useMemo)(
|
|
3632
|
-
() => selectableDataInPage.length > 0 && selectableDataInPage.every(
|
|
3633
|
-
(row, i) => selectedModelSet.has(getId(row, i))
|
|
3634
|
-
),
|
|
3323
|
+
() => selectableDataInPage.length > 0 && selectableDataInPage.every((row, i) => selectedModelSet.has(getId(row, i))),
|
|
3635
3324
|
[selectableDataInPage, selectedModelSet, getId]
|
|
3636
3325
|
);
|
|
3637
3326
|
const rowCount = totalRowsProp || rows.length;
|
|
@@ -3655,12 +3344,8 @@ function useDataTableRenderer({
|
|
|
3655
3344
|
field: key
|
|
3656
3345
|
}));
|
|
3657
3346
|
return baseColumns.map((column) => {
|
|
3658
|
-
const isLeftPinned = pinnedColumns?.left?.includes(
|
|
3659
|
-
|
|
3660
|
-
);
|
|
3661
|
-
const isRightPinned = pinnedColumns?.right?.includes(
|
|
3662
|
-
column.field
|
|
3663
|
-
);
|
|
3347
|
+
const isLeftPinned = pinnedColumns?.left?.includes(column.field);
|
|
3348
|
+
const isRightPinned = pinnedColumns?.right?.includes(column.field);
|
|
3664
3349
|
const isPinned = isLeftPinned || isRightPinned;
|
|
3665
3350
|
return {
|
|
3666
3351
|
...column,
|
|
@@ -3672,13 +3357,8 @@ function useDataTableRenderer({
|
|
|
3672
3357
|
isLastStartPinnedColumn: isLeftPinned && [...pinnedColumns?.left || []].pop() === column.field,
|
|
3673
3358
|
isLastEndPinnedColumn: isRightPinned && (pinnedColumns?.right?.[0] ?? null) === column.field,
|
|
3674
3359
|
// pinned 관련 계산부
|
|
3675
|
-
pinnedStartPosition: pinnedColumns?.left?.slice(
|
|
3676
|
-
|
|
3677
|
-
isLeftPinned ? pinnedColumns.left.indexOf(column.field) : pinnedColumns.left.length
|
|
3678
|
-
).reduce((acc, curr) => acc + getWidth(curr), 0),
|
|
3679
|
-
pinnedEndPosition: pinnedColumns?.right?.slice(
|
|
3680
|
-
isRightPinned ? pinnedColumns.right.indexOf(column.field) + 1 : 0
|
|
3681
|
-
).reduce((acc, curr) => acc + getWidth(curr), 0)
|
|
3360
|
+
pinnedStartPosition: pinnedColumns?.left?.slice(0, isLeftPinned ? pinnedColumns.left.indexOf(column.field) : pinnedColumns.left.length).reduce((acc, curr) => acc + getWidth(curr), 0),
|
|
3361
|
+
pinnedEndPosition: pinnedColumns?.right?.slice(isRightPinned ? pinnedColumns.right.indexOf(column.field) + 1 : 0).reduce((acc, curr) => acc + getWidth(curr), 0)
|
|
3682
3362
|
};
|
|
3683
3363
|
});
|
|
3684
3364
|
}, [
|
|
@@ -3713,9 +3393,7 @@ function useDataTableRenderer({
|
|
|
3713
3393
|
setSortModel(newSortModel2);
|
|
3714
3394
|
return;
|
|
3715
3395
|
}
|
|
3716
|
-
const newSortModel = multiple ? sortModel.map(
|
|
3717
|
-
(model) => model.field === field ? { field, sort: nextSortOrder } : model
|
|
3718
|
-
) : [{ field, sort: nextSortOrder }];
|
|
3396
|
+
const newSortModel = multiple ? sortModel.map((model) => model.field === field ? { field, sort: nextSortOrder } : model) : [{ field, sort: nextSortOrder }];
|
|
3719
3397
|
setSortModel(newSortModel);
|
|
3720
3398
|
} else {
|
|
3721
3399
|
const newSortModel = multiple ? [...sortModel, { field, sort: columnSortOrder[0] }] : [{ field, sort: columnSortOrder[0] }];
|
|
@@ -3752,10 +3430,7 @@ function useDataTableRenderer({
|
|
|
3752
3430
|
isAllSelected,
|
|
3753
3431
|
// all rows are selected on this page
|
|
3754
3432
|
isTotalSelected,
|
|
3755
|
-
isSelectedRow: (0, import_react25.useCallback)(
|
|
3756
|
-
(model) => selectedModelSet.has(model),
|
|
3757
|
-
[selectedModelSet]
|
|
3758
|
-
),
|
|
3433
|
+
isSelectedRow: (0, import_react25.useCallback)((model) => selectedModelSet.has(model), [selectedModelSet]),
|
|
3759
3434
|
isRowSelectable: (0, import_react25.useCallback)(
|
|
3760
3435
|
(rowId, row) => {
|
|
3761
3436
|
if (!isRowSelectable) return true;
|
|
@@ -3768,16 +3443,12 @@ function useDataTableRenderer({
|
|
|
3768
3443
|
setFocusedRowId(rowId);
|
|
3769
3444
|
}, []),
|
|
3770
3445
|
onAllCheckboxChange: (0, import_react25.useCallback)(() => {
|
|
3771
|
-
onSelectionModelChange?.(
|
|
3772
|
-
isAllSelected ? [] : selectableDataInPage.map(getId)
|
|
3773
|
-
);
|
|
3446
|
+
onSelectionModelChange?.(isAllSelected ? [] : selectableDataInPage.map(getId));
|
|
3774
3447
|
}, [isAllSelected, selectableDataInPage, onSelectionModelChange, getId]),
|
|
3775
3448
|
onCheckboxChange: (0, import_react25.useCallback)(
|
|
3776
3449
|
(event, selectedModel) => {
|
|
3777
3450
|
if (selectedModelSet.has(selectedModel)) {
|
|
3778
|
-
const newSelectionModel = (selectionModel || []).filter(
|
|
3779
|
-
(model) => model !== selectedModel
|
|
3780
|
-
);
|
|
3451
|
+
const newSelectionModel = (selectionModel || []).filter((model) => model !== selectedModel);
|
|
3781
3452
|
onSelectionModelChange?.(newSelectionModel);
|
|
3782
3453
|
} else {
|
|
3783
3454
|
const newSelectionModel = [...selectionModel || [], selectedModel];
|
|
@@ -3792,10 +3463,7 @@ function useDataTableRenderer({
|
|
|
3792
3463
|
if (!isRowSelectable) return true;
|
|
3793
3464
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
3794
3465
|
});
|
|
3795
|
-
onSelectionModelChange?.(
|
|
3796
|
-
isTotalSelected ? [] : selectableRows.map(getId),
|
|
3797
|
-
!isTotalSelected
|
|
3798
|
-
);
|
|
3466
|
+
onSelectionModelChange?.(isTotalSelected ? [] : selectableRows.map(getId), !isTotalSelected);
|
|
3799
3467
|
}, [isTotalSelected, rows, onSelectionModelChange, getId, isRowSelectable])
|
|
3800
3468
|
};
|
|
3801
3469
|
}
|
|
@@ -3838,11 +3506,7 @@ function Component(props, apiRef) {
|
|
|
3838
3506
|
footer: Footer,
|
|
3839
3507
|
loadingOverlay: LoadingOverlay = DefaultLoadingOverlay
|
|
3840
3508
|
} = {},
|
|
3841
|
-
slotProps: {
|
|
3842
|
-
checkbox: checkboxProps = {},
|
|
3843
|
-
toolbar: toolbarProps,
|
|
3844
|
-
background: backgroundProps = {}
|
|
3845
|
-
} = {},
|
|
3509
|
+
slotProps: { checkbox: checkboxProps = {}, toolbar: toolbarProps, background: backgroundProps = {} } = {},
|
|
3846
3510
|
stripe,
|
|
3847
3511
|
isTotalSelected: ___________,
|
|
3848
3512
|
...innerProps
|
|
@@ -3887,13 +3551,7 @@ function Component(props, apiRef) {
|
|
|
3887
3551
|
onRowClick?.({ row, rowId }, e);
|
|
3888
3552
|
checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
|
|
3889
3553
|
},
|
|
3890
|
-
[
|
|
3891
|
-
onRowClick,
|
|
3892
|
-
checkboxSelection,
|
|
3893
|
-
disableSelectionOnClick,
|
|
3894
|
-
onCheckboxChange,
|
|
3895
|
-
isRowSelectableCheck
|
|
3896
|
-
]
|
|
3554
|
+
[onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
|
|
3897
3555
|
);
|
|
3898
3556
|
const getRowFocusHandler = (0, import_react25.useCallback)(
|
|
3899
3557
|
(rowId) => () => {
|
|
@@ -3951,16 +3609,7 @@ function Component(props, apiRef) {
|
|
|
3951
3609
|
justifyContent: "space-between",
|
|
3952
3610
|
alignItems: "center"
|
|
3953
3611
|
},
|
|
3954
|
-
!!checkboxSelection && /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ import_react25.default.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ import_react25.default.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ import_react25.default.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(selectableRowCount), " items")), isTotalSelected && /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ import_react25.default.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectableRowCount), " items are selected."), /* @__PURE__ */ import_react25.default.createElement(
|
|
3955
|
-
Button_default,
|
|
3956
|
-
{
|
|
3957
|
-
size: "sm",
|
|
3958
|
-
variant: "plain",
|
|
3959
|
-
color: "danger",
|
|
3960
|
-
onClick: onTotalSelect
|
|
3961
|
-
},
|
|
3962
|
-
"Cancel"
|
|
3963
|
-
))),
|
|
3612
|
+
!!checkboxSelection && /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ import_react25.default.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ import_react25.default.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ import_react25.default.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(selectableRowCount), " items")), isTotalSelected && /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ import_react25.default.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectableRowCount), " items are selected."), /* @__PURE__ */ import_react25.default.createElement(Button_default, { size: "sm", variant: "plain", color: "danger", onClick: onTotalSelect }, "Cancel"))),
|
|
3964
3613
|
Toolbar && /* @__PURE__ */ import_react25.default.createElement(Toolbar, { ...toolbarProps || {} })
|
|
3965
3614
|
),
|
|
3966
3615
|
/* @__PURE__ */ import_react25.default.createElement(
|
|
@@ -4129,9 +3778,7 @@ var CalendarButton2 = (0, import_joy34.styled)(IconButton_default, {
|
|
|
4129
3778
|
"&:focus": {
|
|
4130
3779
|
"--Icon-color": "currentColor",
|
|
4131
3780
|
outlineOffset: `${theme.getCssVar("focus-thickness")}`,
|
|
4132
|
-
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar(
|
|
4133
|
-
"palette-focusVisible"
|
|
4134
|
-
)}`
|
|
3781
|
+
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
4135
3782
|
}
|
|
4136
3783
|
}));
|
|
4137
3784
|
var StyledPopper2 = (0, import_joy34.styled)(import_base3.Popper, {
|
|
@@ -4168,10 +3815,7 @@ var validValueFormat2 = (value, format) => {
|
|
|
4168
3815
|
if (parsedDate1.toString() === "Invalid Date" || parsedDate2.toString() === "Invalid Date") {
|
|
4169
3816
|
return false;
|
|
4170
3817
|
}
|
|
4171
|
-
const formattedValue = formatValueString2(
|
|
4172
|
-
[parsedDate1, parsedDate2],
|
|
4173
|
-
format
|
|
4174
|
-
);
|
|
3818
|
+
const formattedValue = formatValueString2([parsedDate1, parsedDate2], format);
|
|
4175
3819
|
if (value !== formattedValue) {
|
|
4176
3820
|
return false;
|
|
4177
3821
|
}
|
|
@@ -4223,287 +3867,263 @@ var parseDates = (str, format) => {
|
|
|
4223
3867
|
var formatToPattern2 = (format) => {
|
|
4224
3868
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
4225
3869
|
};
|
|
4226
|
-
var TextMaskAdapter5 = import_react26.default.forwardRef(
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
maxLength: 2
|
|
4243
|
-
},
|
|
4244
|
-
M: {
|
|
4245
|
-
mask: import_react_imask2.IMask.MaskedRange,
|
|
4246
|
-
from: 1,
|
|
4247
|
-
to: 12,
|
|
4248
|
-
maxLength: 2
|
|
4249
|
-
},
|
|
4250
|
-
Y: {
|
|
4251
|
-
mask: import_react_imask2.IMask.MaskedRange,
|
|
4252
|
-
from: 1900,
|
|
4253
|
-
to: 9999
|
|
4254
|
-
}
|
|
3870
|
+
var TextMaskAdapter5 = import_react26.default.forwardRef(function TextMaskAdapter6(props, ref) {
|
|
3871
|
+
const { onChange, format, ...other } = props;
|
|
3872
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
3873
|
+
import_react_imask2.IMaskInput,
|
|
3874
|
+
{
|
|
3875
|
+
...other,
|
|
3876
|
+
inputRef: ref,
|
|
3877
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
3878
|
+
mask: Date,
|
|
3879
|
+
pattern: formatToPattern2(format),
|
|
3880
|
+
blocks: {
|
|
3881
|
+
D: {
|
|
3882
|
+
mask: import_react_imask2.IMask.MaskedRange,
|
|
3883
|
+
from: 1,
|
|
3884
|
+
to: 31,
|
|
3885
|
+
maxLength: 2
|
|
4255
3886
|
},
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
const props = (0, import_joy34.useThemeProps)({ props: inProps, name: "DateRangePicker" });
|
|
4267
|
-
const {
|
|
4268
|
-
onChange,
|
|
4269
|
-
disabled,
|
|
4270
|
-
label,
|
|
4271
|
-
error,
|
|
4272
|
-
helperText,
|
|
4273
|
-
minDate,
|
|
4274
|
-
maxDate,
|
|
4275
|
-
disableFuture,
|
|
4276
|
-
disablePast,
|
|
4277
|
-
required,
|
|
4278
|
-
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4279
|
-
sx,
|
|
4280
|
-
className,
|
|
4281
|
-
format = "YYYY/MM/DD",
|
|
4282
|
-
displayFormat = "YYYY/MM/DD",
|
|
4283
|
-
size,
|
|
4284
|
-
inputReadOnly,
|
|
4285
|
-
hideClearButton,
|
|
4286
|
-
readOnly,
|
|
4287
|
-
...innerProps
|
|
4288
|
-
} = props;
|
|
4289
|
-
const innerRef = (0, import_react26.useRef)(null);
|
|
4290
|
-
const buttonRef = (0, import_react26.useRef)(null);
|
|
4291
|
-
const [value, setValue] = useControlledState(
|
|
4292
|
-
props.value,
|
|
4293
|
-
props.defaultValue || "",
|
|
4294
|
-
(0, import_react26.useCallback)(
|
|
4295
|
-
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4296
|
-
[props.name, onChange]
|
|
4297
|
-
)
|
|
4298
|
-
);
|
|
4299
|
-
const [displayValue, setDisplayValue] = (0, import_react26.useState)(
|
|
4300
|
-
() => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
|
|
4301
|
-
);
|
|
4302
|
-
const [anchorEl, setAnchorEl] = (0, import_react26.useState)(null);
|
|
4303
|
-
const open = Boolean(anchorEl);
|
|
4304
|
-
const calendarValue = (0, import_react26.useMemo)(
|
|
4305
|
-
() => value ? parseDates(value, format) : void 0,
|
|
4306
|
-
[value, format]
|
|
4307
|
-
);
|
|
4308
|
-
(0, import_react26.useEffect)(() => {
|
|
4309
|
-
if (value) {
|
|
4310
|
-
try {
|
|
4311
|
-
const dates = parseDates(value, format);
|
|
4312
|
-
const newDisplayValue = formatValueString2(dates, displayFormat);
|
|
4313
|
-
setDisplayValue(newDisplayValue);
|
|
4314
|
-
} catch (error2) {
|
|
3887
|
+
M: {
|
|
3888
|
+
mask: import_react_imask2.IMask.MaskedRange,
|
|
3889
|
+
from: 1,
|
|
3890
|
+
to: 12,
|
|
3891
|
+
maxLength: 2
|
|
3892
|
+
},
|
|
3893
|
+
Y: {
|
|
3894
|
+
mask: import_react_imask2.IMask.MaskedRange,
|
|
3895
|
+
from: 1900,
|
|
3896
|
+
to: 9999
|
|
4315
3897
|
}
|
|
4316
|
-
} else {
|
|
4317
|
-
setDisplayValue("");
|
|
4318
|
-
}
|
|
4319
|
-
}, [displayFormat, value, format]);
|
|
4320
|
-
(0, import_react26.useEffect)(() => {
|
|
4321
|
-
if (!anchorEl) {
|
|
4322
|
-
innerRef.current?.blur();
|
|
4323
|
-
}
|
|
4324
|
-
}, [anchorEl, innerRef]);
|
|
4325
|
-
(0, import_react26.useImperativeHandle)(ref, () => innerRef.current, [
|
|
4326
|
-
innerRef
|
|
4327
|
-
]);
|
|
4328
|
-
const handleChange = (0, import_react26.useCallback)(
|
|
4329
|
-
(event) => {
|
|
4330
|
-
const value2 = event.target.value;
|
|
4331
|
-
setDisplayValue(
|
|
4332
|
-
value2 ? formatValueString2(parseDates(value2, format), displayFormat) : value2
|
|
4333
|
-
);
|
|
4334
|
-
setValue(value2);
|
|
4335
3898
|
},
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
3899
|
+
format: (dates) => formatValueString2(dates, format),
|
|
3900
|
+
parse: (str) => parseDates(str, format),
|
|
3901
|
+
autofix: "pad",
|
|
3902
|
+
overwrite: true
|
|
3903
|
+
}
|
|
3904
|
+
);
|
|
3905
|
+
});
|
|
3906
|
+
var DateRangePicker = (0, import_react26.forwardRef)((inProps, ref) => {
|
|
3907
|
+
const props = (0, import_joy34.useThemeProps)({ props: inProps, name: "DateRangePicker" });
|
|
3908
|
+
const {
|
|
3909
|
+
onChange,
|
|
3910
|
+
disabled,
|
|
3911
|
+
label,
|
|
3912
|
+
error,
|
|
3913
|
+
helperText,
|
|
3914
|
+
minDate,
|
|
3915
|
+
maxDate,
|
|
3916
|
+
disableFuture,
|
|
3917
|
+
disablePast,
|
|
3918
|
+
required,
|
|
3919
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
3920
|
+
sx,
|
|
3921
|
+
className,
|
|
3922
|
+
format = "YYYY/MM/DD",
|
|
3923
|
+
displayFormat = "YYYY/MM/DD",
|
|
3924
|
+
size,
|
|
3925
|
+
inputReadOnly,
|
|
3926
|
+
hideClearButton,
|
|
3927
|
+
readOnly,
|
|
3928
|
+
...innerProps
|
|
3929
|
+
} = props;
|
|
3930
|
+
const innerRef = (0, import_react26.useRef)(null);
|
|
3931
|
+
const buttonRef = (0, import_react26.useRef)(null);
|
|
3932
|
+
const [value, setValue] = useControlledState(
|
|
3933
|
+
props.value,
|
|
3934
|
+
props.defaultValue || "",
|
|
3935
|
+
(0, import_react26.useCallback)((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
3936
|
+
);
|
|
3937
|
+
const [displayValue, setDisplayValue] = (0, import_react26.useState)(
|
|
3938
|
+
() => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
|
|
3939
|
+
);
|
|
3940
|
+
const [anchorEl, setAnchorEl] = (0, import_react26.useState)(null);
|
|
3941
|
+
const open = Boolean(anchorEl);
|
|
3942
|
+
const calendarValue = (0, import_react26.useMemo)(
|
|
3943
|
+
() => value ? parseDates(value, format) : void 0,
|
|
3944
|
+
[value, format]
|
|
3945
|
+
);
|
|
3946
|
+
(0, import_react26.useEffect)(() => {
|
|
3947
|
+
if (value) {
|
|
3948
|
+
try {
|
|
3949
|
+
const dates = parseDates(value, format);
|
|
3950
|
+
const newDisplayValue = formatValueString2(dates, displayFormat);
|
|
3951
|
+
setDisplayValue(newDisplayValue);
|
|
3952
|
+
} catch (error2) {
|
|
3953
|
+
}
|
|
3954
|
+
} else {
|
|
3955
|
+
setDisplayValue("");
|
|
3956
|
+
}
|
|
3957
|
+
}, [displayFormat, value, format]);
|
|
3958
|
+
(0, import_react26.useEffect)(() => {
|
|
3959
|
+
if (!anchorEl) {
|
|
3960
|
+
innerRef.current?.blur();
|
|
3961
|
+
}
|
|
3962
|
+
}, [anchorEl, innerRef]);
|
|
3963
|
+
(0, import_react26.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
3964
|
+
const handleChange = (0, import_react26.useCallback)(
|
|
3965
|
+
(event) => {
|
|
3966
|
+
const value2 = event.target.value;
|
|
3967
|
+
setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat) : value2);
|
|
3968
|
+
setValue(value2);
|
|
3969
|
+
},
|
|
3970
|
+
[displayFormat, format, setValue]
|
|
3971
|
+
);
|
|
3972
|
+
const handleDisplayInputChange = (0, import_react26.useCallback)(
|
|
3973
|
+
(event) => {
|
|
3974
|
+
if (event.target.value === "") {
|
|
3975
|
+
handleChange({
|
|
3976
|
+
target: {
|
|
3977
|
+
name: props.name,
|
|
3978
|
+
value: ""
|
|
3979
|
+
}
|
|
3980
|
+
});
|
|
3981
|
+
return;
|
|
3982
|
+
}
|
|
3983
|
+
const isValidDisplayValue = validValueFormat2(event.target.value, displayFormat);
|
|
3984
|
+
if (isValidDisplayValue) {
|
|
3985
|
+
const dates = parseDates(event.target.value, displayFormat);
|
|
3986
|
+
const formattedValue = formatValueString2(dates, format);
|
|
3987
|
+
handleChange({
|
|
3988
|
+
target: {
|
|
3989
|
+
name: props.name,
|
|
3990
|
+
value: formattedValue
|
|
3991
|
+
}
|
|
3992
|
+
});
|
|
3993
|
+
}
|
|
3994
|
+
},
|
|
3995
|
+
[displayFormat, format, handleChange, props.name]
|
|
3996
|
+
);
|
|
3997
|
+
const handleCalendarToggle = (0, import_react26.useCallback)(
|
|
3998
|
+
(event) => {
|
|
3999
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4000
|
+
innerRef.current?.focus();
|
|
4001
|
+
},
|
|
4002
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
4003
|
+
);
|
|
4004
|
+
const handleCalendarChange = (0, import_react26.useCallback)(
|
|
4005
|
+
([date1, date2]) => {
|
|
4006
|
+
if (!date1 || !date2) return;
|
|
4007
|
+
const formattedValue = formatValueString2([date1, date2], format);
|
|
4008
|
+
if (props.value !== void 0) {
|
|
4009
|
+
onChange?.({ target: { name: props.name, value: formattedValue } });
|
|
4010
|
+
} else {
|
|
4011
|
+
setDisplayValue(formatValueString2([date1, date2], displayFormat));
|
|
4012
|
+
setValue(formattedValue);
|
|
4013
|
+
}
|
|
4014
|
+
setAnchorEl(null);
|
|
4015
|
+
},
|
|
4016
|
+
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat]
|
|
4017
|
+
);
|
|
4018
|
+
const handleInputMouseDown = (0, import_react26.useCallback)(
|
|
4019
|
+
(event) => {
|
|
4020
|
+
if (inputReadOnly) {
|
|
4021
|
+
event.preventDefault();
|
|
4022
|
+
buttonRef.current?.focus();
|
|
4023
|
+
}
|
|
4024
|
+
},
|
|
4025
|
+
[inputReadOnly, buttonRef]
|
|
4026
|
+
);
|
|
4027
|
+
return /* @__PURE__ */ import_react26.default.createElement(DateRangePickerRoot, null, /* @__PURE__ */ import_react26.default.createElement(import_base3.FocusTrap, { open: true }, /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement(
|
|
4028
|
+
Input_default,
|
|
4029
|
+
{
|
|
4030
|
+
...innerProps,
|
|
4031
|
+
color: error ? "danger" : innerProps.color,
|
|
4032
|
+
ref,
|
|
4033
|
+
size,
|
|
4034
|
+
value: displayValue,
|
|
4035
|
+
onChange: handleDisplayInputChange,
|
|
4036
|
+
disabled,
|
|
4037
|
+
required,
|
|
4038
|
+
placeholder: `${displayFormat} - ${displayFormat}`,
|
|
4039
|
+
slotProps: {
|
|
4040
|
+
input: {
|
|
4041
|
+
component: TextMaskAdapter5,
|
|
4042
|
+
ref: innerRef,
|
|
4043
|
+
format: displayFormat,
|
|
4044
|
+
sx: {
|
|
4045
|
+
"&:hover": {
|
|
4046
|
+
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
4360
4047
|
}
|
|
4361
|
-
}
|
|
4362
|
-
|
|
4363
|
-
},
|
|
4364
|
-
[displayFormat, format, handleChange, props.name]
|
|
4365
|
-
);
|
|
4366
|
-
const handleCalendarToggle = (0, import_react26.useCallback)(
|
|
4367
|
-
(event) => {
|
|
4368
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4369
|
-
innerRef.current?.focus();
|
|
4370
|
-
},
|
|
4371
|
-
[anchorEl, setAnchorEl, innerRef]
|
|
4372
|
-
);
|
|
4373
|
-
const handleCalendarChange = (0, import_react26.useCallback)(
|
|
4374
|
-
([date1, date2]) => {
|
|
4375
|
-
if (!date1 || !date2) return;
|
|
4376
|
-
const formattedValue = formatValueString2([date1, date2], format);
|
|
4377
|
-
if (props.value !== void 0) {
|
|
4378
|
-
onChange?.({ target: { name: props.name, value: formattedValue } });
|
|
4379
|
-
} else {
|
|
4380
|
-
setDisplayValue(
|
|
4381
|
-
formatValueString2([date1, date2], displayFormat)
|
|
4382
|
-
);
|
|
4383
|
-
setValue(formattedValue);
|
|
4048
|
+
},
|
|
4049
|
+
onMouseDown: handleInputMouseDown
|
|
4384
4050
|
}
|
|
4385
|
-
setAnchorEl(null);
|
|
4386
4051
|
},
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4052
|
+
error,
|
|
4053
|
+
className,
|
|
4054
|
+
sx,
|
|
4055
|
+
endDecorator: /* @__PURE__ */ import_react26.default.createElement(
|
|
4056
|
+
CalendarButton2,
|
|
4057
|
+
{
|
|
4058
|
+
ref: buttonRef,
|
|
4059
|
+
variant: "plain",
|
|
4060
|
+
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
4061
|
+
"aria-label": "Toggle Calendar",
|
|
4062
|
+
"aria-controls": "date-range-picker-popper",
|
|
4063
|
+
"aria-haspopup": "dialog",
|
|
4064
|
+
"aria-expanded": open,
|
|
4065
|
+
disabled
|
|
4066
|
+
},
|
|
4067
|
+
/* @__PURE__ */ import_react26.default.createElement(import_CalendarToday2.default, null)
|
|
4068
|
+
),
|
|
4069
|
+
label,
|
|
4070
|
+
helperText,
|
|
4071
|
+
readOnly: readOnly || inputReadOnly
|
|
4072
|
+
}
|
|
4073
|
+
), open && /* @__PURE__ */ import_react26.default.createElement(import_base3.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react26.default.createElement(
|
|
4074
|
+
StyledPopper2,
|
|
4075
|
+
{
|
|
4076
|
+
id: "date-range-picker-popper",
|
|
4077
|
+
open: true,
|
|
4078
|
+
anchorEl,
|
|
4079
|
+
placement: "bottom-end",
|
|
4080
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4081
|
+
modifiers: [
|
|
4082
|
+
{
|
|
4083
|
+
name: "offset",
|
|
4084
|
+
options: {
|
|
4085
|
+
offset: [4, 4]
|
|
4086
|
+
}
|
|
4402
4087
|
}
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4088
|
+
],
|
|
4089
|
+
"aria-label": "Calendar Tooltip",
|
|
4090
|
+
"aria-expanded": open
|
|
4091
|
+
},
|
|
4092
|
+
/* @__PURE__ */ import_react26.default.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react26.default.createElement(
|
|
4093
|
+
Calendar_default,
|
|
4408
4094
|
{
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
required,
|
|
4417
|
-
placeholder: `${displayFormat} - ${displayFormat}`,
|
|
4418
|
-
slotProps: {
|
|
4419
|
-
input: {
|
|
4420
|
-
component: TextMaskAdapter5,
|
|
4421
|
-
ref: innerRef,
|
|
4422
|
-
format: displayFormat,
|
|
4423
|
-
sx: {
|
|
4424
|
-
"&:hover": {
|
|
4425
|
-
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
4426
|
-
}
|
|
4427
|
-
},
|
|
4428
|
-
onMouseDown: handleInputMouseDown
|
|
4429
|
-
}
|
|
4430
|
-
},
|
|
4431
|
-
error,
|
|
4432
|
-
className,
|
|
4433
|
-
sx,
|
|
4434
|
-
endDecorator: /* @__PURE__ */ import_react26.default.createElement(
|
|
4435
|
-
CalendarButton2,
|
|
4436
|
-
{
|
|
4437
|
-
ref: buttonRef,
|
|
4438
|
-
variant: "plain",
|
|
4439
|
-
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
4440
|
-
"aria-label": "Toggle Calendar",
|
|
4441
|
-
"aria-controls": "date-range-picker-popper",
|
|
4442
|
-
"aria-haspopup": "dialog",
|
|
4443
|
-
"aria-expanded": open,
|
|
4444
|
-
disabled
|
|
4445
|
-
},
|
|
4446
|
-
/* @__PURE__ */ import_react26.default.createElement(import_CalendarToday2.default, null)
|
|
4447
|
-
),
|
|
4448
|
-
label,
|
|
4449
|
-
helperText,
|
|
4450
|
-
readOnly: readOnly || inputReadOnly
|
|
4095
|
+
rangeSelection: true,
|
|
4096
|
+
defaultValue: calendarValue,
|
|
4097
|
+
onChange: handleCalendarChange,
|
|
4098
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
4099
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4100
|
+
disableFuture,
|
|
4101
|
+
disablePast
|
|
4451
4102
|
}
|
|
4452
|
-
),
|
|
4453
|
-
|
|
4103
|
+
), !hideClearButton && /* @__PURE__ */ import_react26.default.createElement(
|
|
4104
|
+
DialogActions_default,
|
|
4454
4105
|
{
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
anchorEl,
|
|
4458
|
-
placement: "bottom-end",
|
|
4459
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
4460
|
-
modifiers: [
|
|
4461
|
-
{
|
|
4462
|
-
name: "offset",
|
|
4463
|
-
options: {
|
|
4464
|
-
offset: [4, 4]
|
|
4465
|
-
}
|
|
4466
|
-
}
|
|
4467
|
-
],
|
|
4468
|
-
"aria-label": "Calendar Tooltip",
|
|
4469
|
-
"aria-expanded": open
|
|
4470
|
-
},
|
|
4471
|
-
/* @__PURE__ */ import_react26.default.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react26.default.createElement(
|
|
4472
|
-
Calendar_default,
|
|
4473
|
-
{
|
|
4474
|
-
rangeSelection: true,
|
|
4475
|
-
defaultValue: calendarValue,
|
|
4476
|
-
onChange: handleCalendarChange,
|
|
4477
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
4478
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4479
|
-
disableFuture,
|
|
4480
|
-
disablePast
|
|
4106
|
+
sx: {
|
|
4107
|
+
p: 1
|
|
4481
4108
|
}
|
|
4482
|
-
|
|
4483
|
-
|
|
4109
|
+
},
|
|
4110
|
+
/* @__PURE__ */ import_react26.default.createElement(
|
|
4111
|
+
Button_default,
|
|
4484
4112
|
{
|
|
4485
|
-
|
|
4486
|
-
|
|
4113
|
+
size,
|
|
4114
|
+
variant: "plain",
|
|
4115
|
+
color: "neutral",
|
|
4116
|
+
onClick: () => {
|
|
4117
|
+
setValue("");
|
|
4118
|
+
setDisplayValue("");
|
|
4119
|
+
setAnchorEl(null);
|
|
4487
4120
|
}
|
|
4488
4121
|
},
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
color: "neutral",
|
|
4495
|
-
onClick: () => {
|
|
4496
|
-
setValue("");
|
|
4497
|
-
setDisplayValue("");
|
|
4498
|
-
setAnchorEl(null);
|
|
4499
|
-
}
|
|
4500
|
-
},
|
|
4501
|
-
"Clear"
|
|
4502
|
-
)
|
|
4503
|
-
))
|
|
4504
|
-
)))));
|
|
4505
|
-
}
|
|
4506
|
-
);
|
|
4122
|
+
"Clear"
|
|
4123
|
+
)
|
|
4124
|
+
))
|
|
4125
|
+
)))));
|
|
4126
|
+
});
|
|
4507
4127
|
DateRangePicker.displayName = "DateRangePicker";
|
|
4508
4128
|
|
|
4509
4129
|
// src/components/Drawer/Drawer.tsx
|
|
@@ -4590,17 +4210,7 @@ var StyledDialogFrame = (0, import_joy39.styled)(ModalDialog, {
|
|
|
4590
4210
|
});
|
|
4591
4211
|
var DialogFrame = import_react29.default.forwardRef((props, ref) => {
|
|
4592
4212
|
const { title, children, actions, fullscreen, ...innerProps } = props;
|
|
4593
|
-
return /* @__PURE__ */ import_react29.default.createElement(
|
|
4594
|
-
StyledDialogFrame,
|
|
4595
|
-
{
|
|
4596
|
-
layout: fullscreen ? "fullscreen" : "center",
|
|
4597
|
-
ref,
|
|
4598
|
-
...innerProps
|
|
4599
|
-
},
|
|
4600
|
-
/* @__PURE__ */ import_react29.default.createElement(DialogTitle_default, null, title),
|
|
4601
|
-
/* @__PURE__ */ import_react29.default.createElement(DialogContent_default, null, children),
|
|
4602
|
-
/* @__PURE__ */ import_react29.default.createElement(DialogActions_default, null, actions)
|
|
4603
|
-
);
|
|
4213
|
+
return /* @__PURE__ */ import_react29.default.createElement(StyledDialogFrame, { layout: fullscreen ? "fullscreen" : "center", ref, ...innerProps }, /* @__PURE__ */ import_react29.default.createElement(DialogTitle_default, null, title), /* @__PURE__ */ import_react29.default.createElement(DialogContent_default, null, children), /* @__PURE__ */ import_react29.default.createElement(DialogActions_default, null, actions));
|
|
4604
4214
|
});
|
|
4605
4215
|
DialogFrame.displayName = "DialogFrame";
|
|
4606
4216
|
|
|
@@ -4679,15 +4289,7 @@ function IconMenuButton(props) {
|
|
|
4679
4289
|
}
|
|
4680
4290
|
},
|
|
4681
4291
|
icon
|
|
4682
|
-
), /* @__PURE__ */ import_react31.default.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ import_react31.default.createElement(
|
|
4683
|
-
MenuItem,
|
|
4684
|
-
{
|
|
4685
|
-
key: i.text,
|
|
4686
|
-
component: i.component,
|
|
4687
|
-
...i.componentProps ?? {}
|
|
4688
|
-
},
|
|
4689
|
-
i.text
|
|
4690
|
-
))));
|
|
4292
|
+
), /* @__PURE__ */ import_react31.default.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ import_react31.default.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
4691
4293
|
}
|
|
4692
4294
|
IconMenuButton.displayName = "IconMenuButton";
|
|
4693
4295
|
|
|
@@ -4721,52 +4323,33 @@ var Markdown = (props) => {
|
|
|
4721
4323
|
if (!rehypeAccent2) {
|
|
4722
4324
|
return null;
|
|
4723
4325
|
}
|
|
4724
|
-
return /* @__PURE__ */ import_react32.default.createElement(
|
|
4725
|
-
|
|
4326
|
+
return /* @__PURE__ */ import_react32.default.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ import_react32.default.createElement(
|
|
4327
|
+
import_react32.Suspense,
|
|
4726
4328
|
{
|
|
4727
|
-
|
|
4728
|
-
color,
|
|
4729
|
-
textColor,
|
|
4730
|
-
level: defaultLevel,
|
|
4731
|
-
...innerProps
|
|
4329
|
+
fallback: fallback || /* @__PURE__ */ import_react32.default.createElement(Typography, null, /* @__PURE__ */ import_react32.default.createElement(import_joy44.Skeleton, null, content || ""))
|
|
4732
4330
|
},
|
|
4733
4331
|
/* @__PURE__ */ import_react32.default.createElement(
|
|
4734
|
-
|
|
4332
|
+
LazyReactMarkdown,
|
|
4735
4333
|
{
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
{
|
|
4741
|
-
|
|
4742
|
-
children:
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
Typography,
|
|
4752
|
-
{
|
|
4753
|
-
color,
|
|
4754
|
-
textColor,
|
|
4755
|
-
level: defaultLevel,
|
|
4756
|
-
...node?.properties
|
|
4757
|
-
},
|
|
4758
|
-
children
|
|
4759
|
-
),
|
|
4760
|
-
a: ({ children, href }) => /* @__PURE__ */ import_react32.default.createElement(import_joy45.Link, { href, target: defaultLinkAction }, children),
|
|
4761
|
-
hr: () => /* @__PURE__ */ import_react32.default.createElement(Divider, null),
|
|
4762
|
-
b: ({ children }) => /* @__PURE__ */ import_react32.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4763
|
-
strong: ({ children }) => /* @__PURE__ */ import_react32.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4764
|
-
...markdownOptions?.components
|
|
4765
|
-
}
|
|
4334
|
+
...markdownOptions,
|
|
4335
|
+
children: content,
|
|
4336
|
+
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
4337
|
+
remarkPlugins: [import_remark_gfm.default],
|
|
4338
|
+
components: {
|
|
4339
|
+
h1: ({ children }) => /* @__PURE__ */ import_react32.default.createElement(Typography, { color, textColor, level: "h1" }, children),
|
|
4340
|
+
h2: ({ children }) => /* @__PURE__ */ import_react32.default.createElement(Typography, { color, textColor, level: "h2" }, children),
|
|
4341
|
+
h3: ({ children }) => /* @__PURE__ */ import_react32.default.createElement(Typography, { color, textColor, level: "h3" }, children),
|
|
4342
|
+
h4: ({ children }) => /* @__PURE__ */ import_react32.default.createElement(Typography, { color, textColor, level: "h4" }, children),
|
|
4343
|
+
p: ({ children, node }) => /* @__PURE__ */ import_react32.default.createElement(Typography, { color, textColor, level: defaultLevel, ...node?.properties }, children),
|
|
4344
|
+
a: ({ children, href }) => /* @__PURE__ */ import_react32.default.createElement(import_joy45.Link, { href, target: defaultLinkAction }, children),
|
|
4345
|
+
hr: () => /* @__PURE__ */ import_react32.default.createElement(Divider, null),
|
|
4346
|
+
b: ({ children }) => /* @__PURE__ */ import_react32.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4347
|
+
strong: ({ children }) => /* @__PURE__ */ import_react32.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4348
|
+
...markdownOptions?.components
|
|
4766
4349
|
}
|
|
4767
|
-
|
|
4350
|
+
}
|
|
4768
4351
|
)
|
|
4769
|
-
);
|
|
4352
|
+
));
|
|
4770
4353
|
};
|
|
4771
4354
|
Markdown.displayName = "Markdown";
|
|
4772
4355
|
|
|
@@ -4819,15 +4402,7 @@ function MenuButton(props) {
|
|
|
4819
4402
|
endDecorator: showIcon ? /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, endDecorator, /* @__PURE__ */ import_react33.default.createElement(import_ExpandMore.default, null)) : /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, endDecorator)
|
|
4820
4403
|
},
|
|
4821
4404
|
buttonText
|
|
4822
|
-
), /* @__PURE__ */ import_react33.default.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ import_react33.default.createElement(
|
|
4823
|
-
MenuItem,
|
|
4824
|
-
{
|
|
4825
|
-
key: i.text,
|
|
4826
|
-
component: i.component,
|
|
4827
|
-
...i.componentProps ?? {}
|
|
4828
|
-
},
|
|
4829
|
-
i.text
|
|
4830
|
-
))));
|
|
4405
|
+
), /* @__PURE__ */ import_react33.default.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ import_react33.default.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
4831
4406
|
}
|
|
4832
4407
|
MenuButton.displayName = "MenuButton";
|
|
4833
4408
|
|
|
@@ -4887,215 +4462,202 @@ function parseDate3(dateString, format) {
|
|
|
4887
4462
|
const result = new Date(year, month, day);
|
|
4888
4463
|
return result;
|
|
4889
4464
|
}
|
|
4890
|
-
var MonthPicker = (0, import_react34.forwardRef)(
|
|
4891
|
-
(
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4465
|
+
var MonthPicker = (0, import_react34.forwardRef)((inProps, ref) => {
|
|
4466
|
+
const props = (0, import_joy47.useThemeProps)({ props: inProps, name: "MonthPicker" });
|
|
4467
|
+
const {
|
|
4468
|
+
onChange,
|
|
4469
|
+
disabled,
|
|
4470
|
+
label,
|
|
4471
|
+
error,
|
|
4472
|
+
helperText,
|
|
4473
|
+
minDate,
|
|
4474
|
+
maxDate,
|
|
4475
|
+
disableFuture,
|
|
4476
|
+
disablePast,
|
|
4477
|
+
required,
|
|
4478
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4479
|
+
sx,
|
|
4480
|
+
className,
|
|
4481
|
+
/**
|
|
4482
|
+
* NOTE: 현재 CalendarDate는 YYYY-MM-DD로 개발하고 있어 date를 포함하여 value를 관리한다.
|
|
4483
|
+
* @see https://ecubelabs.atlassian.net/wiki/spaces/SW/pages/1938784349/Date#CalendarDate
|
|
4484
|
+
* @see https://github.com/Ecube-Labs/hds/pull/145
|
|
4485
|
+
*/
|
|
4486
|
+
format = "YYYY/MM/DD",
|
|
4487
|
+
displayFormat = "YYYY/MM",
|
|
4488
|
+
size,
|
|
4489
|
+
locale,
|
|
4490
|
+
...innerProps
|
|
4491
|
+
} = props;
|
|
4492
|
+
const innerRef = (0, import_react34.useRef)(null);
|
|
4493
|
+
const buttonRef = (0, import_react34.useRef)(null);
|
|
4494
|
+
const [value, setValue, isControlled] = useControlledState(
|
|
4495
|
+
props.value,
|
|
4496
|
+
props.defaultValue || "",
|
|
4497
|
+
(0, import_react34.useCallback)((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4498
|
+
);
|
|
4499
|
+
const getFormattedDisplayValue = (0, import_react34.useCallback)(
|
|
4500
|
+
(inputValue) => {
|
|
4501
|
+
if (!inputValue) return "";
|
|
4502
|
+
try {
|
|
4503
|
+
return formatValueString3(parseDate3(inputValue, format), displayFormat, locale);
|
|
4504
|
+
} catch (e) {
|
|
4505
|
+
return inputValue;
|
|
4506
|
+
}
|
|
4507
|
+
},
|
|
4508
|
+
[format, displayFormat, locale]
|
|
4509
|
+
);
|
|
4510
|
+
const [displayValue, setDisplayValue] = (0, import_react34.useState)(() => getFormattedDisplayValue(value));
|
|
4511
|
+
const [anchorEl, setAnchorEl] = (0, import_react34.useState)(null);
|
|
4512
|
+
const open = Boolean(anchorEl);
|
|
4513
|
+
(0, import_react34.useEffect)(() => {
|
|
4514
|
+
if (!anchorEl) {
|
|
4515
|
+
innerRef.current?.blur();
|
|
4516
|
+
}
|
|
4517
|
+
}, [anchorEl, innerRef]);
|
|
4518
|
+
(0, import_react34.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
4519
|
+
(0, import_react34.useEffect)(() => {
|
|
4520
|
+
setDisplayValue(getFormattedDisplayValue(value));
|
|
4521
|
+
}, [value, getFormattedDisplayValue]);
|
|
4522
|
+
const handleChange = (0, import_react34.useCallback)(
|
|
4523
|
+
(event) => {
|
|
4524
|
+
const newValue = event.target.value;
|
|
4525
|
+
setValue(newValue);
|
|
4526
|
+
if (!isControlled) {
|
|
4527
|
+
setDisplayValue(getFormattedDisplayValue(newValue));
|
|
4528
|
+
}
|
|
4529
|
+
},
|
|
4530
|
+
[setValue, getFormattedDisplayValue, isControlled]
|
|
4531
|
+
);
|
|
4532
|
+
const handleCalendarToggle = (0, import_react34.useCallback)(
|
|
4533
|
+
(event) => {
|
|
4534
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4535
|
+
innerRef.current?.focus();
|
|
4536
|
+
},
|
|
4537
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
4538
|
+
);
|
|
4539
|
+
const handleInputMouseDown = (0, import_react34.useCallback)(
|
|
4540
|
+
(event) => {
|
|
4541
|
+
event.preventDefault();
|
|
4542
|
+
buttonRef.current?.focus();
|
|
4543
|
+
},
|
|
4544
|
+
[buttonRef]
|
|
4545
|
+
);
|
|
4546
|
+
return /* @__PURE__ */ import_react34.default.createElement(MonthPickerRoot, null, /* @__PURE__ */ import_react34.default.createElement(import_base4.FocusTrap, { open: true }, /* @__PURE__ */ import_react34.default.createElement(import_react34.default.Fragment, null, /* @__PURE__ */ import_react34.default.createElement(
|
|
4547
|
+
Input_default,
|
|
4548
|
+
{
|
|
4549
|
+
...innerProps,
|
|
4550
|
+
color: error ? "danger" : innerProps.color,
|
|
4551
|
+
ref: innerRef,
|
|
4552
|
+
size,
|
|
4553
|
+
value: displayValue,
|
|
4554
|
+
placeholder: displayFormat,
|
|
4895
4555
|
disabled,
|
|
4896
|
-
label,
|
|
4897
|
-
error,
|
|
4898
|
-
helperText,
|
|
4899
|
-
minDate,
|
|
4900
|
-
maxDate,
|
|
4901
|
-
disableFuture,
|
|
4902
|
-
disablePast,
|
|
4903
4556
|
required,
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
size,
|
|
4915
|
-
locale,
|
|
4916
|
-
...innerProps
|
|
4917
|
-
} = props;
|
|
4918
|
-
const innerRef = (0, import_react34.useRef)(null);
|
|
4919
|
-
const buttonRef = (0, import_react34.useRef)(null);
|
|
4920
|
-
const [value, setValue, isControlled] = useControlledState(
|
|
4921
|
-
props.value,
|
|
4922
|
-
props.defaultValue || "",
|
|
4923
|
-
(0, import_react34.useCallback)(
|
|
4924
|
-
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4925
|
-
[props.name, onChange]
|
|
4926
|
-
)
|
|
4927
|
-
);
|
|
4928
|
-
const getFormattedDisplayValue = (0, import_react34.useCallback)(
|
|
4929
|
-
(inputValue) => {
|
|
4930
|
-
if (!inputValue) return "";
|
|
4931
|
-
try {
|
|
4932
|
-
return formatValueString3(
|
|
4933
|
-
parseDate3(inputValue, format),
|
|
4934
|
-
displayFormat,
|
|
4935
|
-
locale
|
|
4936
|
-
);
|
|
4937
|
-
} catch (e) {
|
|
4938
|
-
return inputValue;
|
|
4939
|
-
}
|
|
4940
|
-
},
|
|
4941
|
-
[format, displayFormat, locale]
|
|
4942
|
-
);
|
|
4943
|
-
const [displayValue, setDisplayValue] = (0, import_react34.useState)(
|
|
4944
|
-
() => getFormattedDisplayValue(value)
|
|
4945
|
-
);
|
|
4946
|
-
const [anchorEl, setAnchorEl] = (0, import_react34.useState)(null);
|
|
4947
|
-
const open = Boolean(anchorEl);
|
|
4948
|
-
(0, import_react34.useEffect)(() => {
|
|
4949
|
-
if (!anchorEl) {
|
|
4950
|
-
innerRef.current?.blur();
|
|
4951
|
-
}
|
|
4952
|
-
}, [anchorEl, innerRef]);
|
|
4953
|
-
(0, import_react34.useImperativeHandle)(ref, () => innerRef.current, [
|
|
4954
|
-
innerRef
|
|
4955
|
-
]);
|
|
4956
|
-
(0, import_react34.useEffect)(() => {
|
|
4957
|
-
setDisplayValue(getFormattedDisplayValue(value));
|
|
4958
|
-
}, [value, getFormattedDisplayValue]);
|
|
4959
|
-
const handleChange = (0, import_react34.useCallback)(
|
|
4960
|
-
(event) => {
|
|
4961
|
-
const newValue = event.target.value;
|
|
4962
|
-
setValue(newValue);
|
|
4963
|
-
if (!isControlled) {
|
|
4964
|
-
setDisplayValue(getFormattedDisplayValue(newValue));
|
|
4557
|
+
slotProps: {
|
|
4558
|
+
input: {
|
|
4559
|
+
ref: innerRef,
|
|
4560
|
+
format: displayFormat,
|
|
4561
|
+
sx: {
|
|
4562
|
+
"&:hover": {
|
|
4563
|
+
cursor: "default"
|
|
4564
|
+
}
|
|
4565
|
+
},
|
|
4566
|
+
onMouseDown: handleInputMouseDown
|
|
4965
4567
|
}
|
|
4966
4568
|
},
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
},
|
|
4974
|
-
[anchorEl, setAnchorEl, innerRef]
|
|
4975
|
-
);
|
|
4976
|
-
const handleInputMouseDown = (0, import_react34.useCallback)(
|
|
4977
|
-
(event) => {
|
|
4978
|
-
event.preventDefault();
|
|
4979
|
-
buttonRef.current?.focus();
|
|
4569
|
+
error,
|
|
4570
|
+
className,
|
|
4571
|
+
sx: {
|
|
4572
|
+
...sx,
|
|
4573
|
+
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
4574
|
+
fontFamily: "monospace"
|
|
4980
4575
|
},
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
disabled,
|
|
4993
|
-
required,
|
|
4994
|
-
slotProps: {
|
|
4995
|
-
input: {
|
|
4996
|
-
ref: innerRef,
|
|
4997
|
-
format: displayFormat,
|
|
4998
|
-
sx: {
|
|
4999
|
-
"&:hover": {
|
|
5000
|
-
cursor: "default"
|
|
5001
|
-
}
|
|
5002
|
-
},
|
|
5003
|
-
onMouseDown: handleInputMouseDown
|
|
5004
|
-
}
|
|
4576
|
+
endDecorator: /* @__PURE__ */ import_react34.default.createElement(
|
|
4577
|
+
IconButton_default,
|
|
4578
|
+
{
|
|
4579
|
+
ref: buttonRef,
|
|
4580
|
+
variant: "plain",
|
|
4581
|
+
onClick: handleCalendarToggle,
|
|
4582
|
+
"aria-label": "Toggle Calendar",
|
|
4583
|
+
"aria-controls": "month-picker-popper",
|
|
4584
|
+
"aria-haspopup": "dialog",
|
|
4585
|
+
"aria-expanded": open,
|
|
4586
|
+
disabled
|
|
5005
4587
|
},
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
4588
|
+
/* @__PURE__ */ import_react34.default.createElement(import_CalendarToday3.default, null)
|
|
4589
|
+
),
|
|
4590
|
+
label,
|
|
4591
|
+
helperText
|
|
4592
|
+
}
|
|
4593
|
+
), open && /* @__PURE__ */ import_react34.default.createElement(import_base4.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react34.default.createElement(
|
|
4594
|
+
StyledPopper3,
|
|
4595
|
+
{
|
|
4596
|
+
id: "month-picker-popper",
|
|
4597
|
+
open: true,
|
|
4598
|
+
anchorEl,
|
|
4599
|
+
placement: "bottom-end",
|
|
4600
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4601
|
+
modifiers: [
|
|
4602
|
+
{
|
|
4603
|
+
name: "offset",
|
|
4604
|
+
options: {
|
|
4605
|
+
offset: [4, 4]
|
|
4606
|
+
}
|
|
4607
|
+
}
|
|
4608
|
+
],
|
|
4609
|
+
"aria-label": "Calendar Tooltip",
|
|
4610
|
+
"aria-expanded": open
|
|
4611
|
+
},
|
|
4612
|
+
/* @__PURE__ */ import_react34.default.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react34.default.createElement(
|
|
4613
|
+
Calendar_default,
|
|
4614
|
+
{
|
|
4615
|
+
view: "month",
|
|
4616
|
+
views: ["month"],
|
|
4617
|
+
value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
|
|
4618
|
+
onChange: ([date]) => {
|
|
4619
|
+
handleChange({
|
|
4620
|
+
target: {
|
|
4621
|
+
name: props.name,
|
|
4622
|
+
value: formatValueString3(date, format, locale)
|
|
4623
|
+
}
|
|
4624
|
+
});
|
|
4625
|
+
setAnchorEl(null);
|
|
5012
4626
|
},
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
onClick: handleCalendarToggle,
|
|
5019
|
-
"aria-label": "Toggle Calendar",
|
|
5020
|
-
"aria-controls": "month-picker-popper",
|
|
5021
|
-
"aria-haspopup": "dialog",
|
|
5022
|
-
"aria-expanded": open,
|
|
5023
|
-
disabled
|
|
5024
|
-
},
|
|
5025
|
-
/* @__PURE__ */ import_react34.default.createElement(import_CalendarToday3.default, null)
|
|
5026
|
-
),
|
|
5027
|
-
label,
|
|
5028
|
-
helperText
|
|
4627
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
4628
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4629
|
+
disableFuture,
|
|
4630
|
+
disablePast,
|
|
4631
|
+
locale
|
|
5029
4632
|
}
|
|
5030
|
-
),
|
|
5031
|
-
|
|
4633
|
+
), /* @__PURE__ */ import_react34.default.createElement(
|
|
4634
|
+
DialogActions_default,
|
|
5032
4635
|
{
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
placement: "bottom-end",
|
|
5037
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
5038
|
-
modifiers: [
|
|
5039
|
-
{
|
|
5040
|
-
name: "offset",
|
|
5041
|
-
options: {
|
|
5042
|
-
offset: [4, 4]
|
|
5043
|
-
}
|
|
5044
|
-
}
|
|
5045
|
-
],
|
|
5046
|
-
"aria-label": "Calendar Tooltip",
|
|
5047
|
-
"aria-expanded": open
|
|
4636
|
+
sx: {
|
|
4637
|
+
p: 1
|
|
4638
|
+
}
|
|
5048
4639
|
},
|
|
5049
|
-
/* @__PURE__ */ import_react34.default.createElement(
|
|
5050
|
-
|
|
4640
|
+
/* @__PURE__ */ import_react34.default.createElement(
|
|
4641
|
+
Button_default,
|
|
5051
4642
|
{
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
4643
|
+
size,
|
|
4644
|
+
variant: "plain",
|
|
4645
|
+
color: "neutral",
|
|
4646
|
+
onClick: () => {
|
|
5056
4647
|
handleChange({
|
|
5057
4648
|
target: {
|
|
5058
4649
|
name: props.name,
|
|
5059
|
-
value:
|
|
4650
|
+
value: ""
|
|
5060
4651
|
}
|
|
5061
4652
|
});
|
|
5062
4653
|
setAnchorEl(null);
|
|
5063
|
-
},
|
|
5064
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
5065
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
5066
|
-
disableFuture,
|
|
5067
|
-
disablePast,
|
|
5068
|
-
locale
|
|
5069
|
-
}
|
|
5070
|
-
), /* @__PURE__ */ import_react34.default.createElement(
|
|
5071
|
-
DialogActions_default,
|
|
5072
|
-
{
|
|
5073
|
-
sx: {
|
|
5074
|
-
p: 1
|
|
5075
4654
|
}
|
|
5076
4655
|
},
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
color: "neutral",
|
|
5083
|
-
onClick: () => {
|
|
5084
|
-
handleChange({
|
|
5085
|
-
target: {
|
|
5086
|
-
name: props.name,
|
|
5087
|
-
value: ""
|
|
5088
|
-
}
|
|
5089
|
-
});
|
|
5090
|
-
setAnchorEl(null);
|
|
5091
|
-
}
|
|
5092
|
-
},
|
|
5093
|
-
"Clear"
|
|
5094
|
-
)
|
|
5095
|
-
))
|
|
5096
|
-
)))));
|
|
5097
|
-
}
|
|
5098
|
-
);
|
|
4656
|
+
"Clear"
|
|
4657
|
+
)
|
|
4658
|
+
))
|
|
4659
|
+
)))));
|
|
4660
|
+
});
|
|
5099
4661
|
|
|
5100
4662
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
5101
4663
|
var import_react35 = __toESM(require("react"));
|
|
@@ -5156,196 +4718,184 @@ var parseDates2 = (str) => {
|
|
|
5156
4718
|
var formatToPattern3 = (format) => {
|
|
5157
4719
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
|
|
5158
4720
|
};
|
|
5159
|
-
var TextMaskAdapter7 = import_react35.default.forwardRef(
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
maxLength: 2
|
|
5176
|
-
},
|
|
5177
|
-
Y: {
|
|
5178
|
-
mask: import_react_imask3.IMask.MaskedRange,
|
|
5179
|
-
from: 1900,
|
|
5180
|
-
to: 9999
|
|
5181
|
-
}
|
|
4721
|
+
var TextMaskAdapter7 = import_react35.default.forwardRef(function TextMaskAdapter8(props, ref) {
|
|
4722
|
+
const { onChange, format, ...other } = props;
|
|
4723
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
4724
|
+
import_react_imask3.IMaskInput,
|
|
4725
|
+
{
|
|
4726
|
+
...other,
|
|
4727
|
+
inputRef: ref,
|
|
4728
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
4729
|
+
mask: Date,
|
|
4730
|
+
pattern: formatToPattern3(format),
|
|
4731
|
+
blocks: {
|
|
4732
|
+
m: {
|
|
4733
|
+
mask: import_react_imask3.IMask.MaskedRange,
|
|
4734
|
+
from: 1,
|
|
4735
|
+
to: 12,
|
|
4736
|
+
maxLength: 2
|
|
5182
4737
|
},
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
4738
|
+
Y: {
|
|
4739
|
+
mask: import_react_imask3.IMask.MaskedRange,
|
|
4740
|
+
from: 1900,
|
|
4741
|
+
to: 9999
|
|
4742
|
+
}
|
|
4743
|
+
},
|
|
4744
|
+
format: (dates) => formatValueString4(dates, format),
|
|
4745
|
+
parse: parseDates2,
|
|
4746
|
+
autofix: "pad",
|
|
4747
|
+
overwrite: true
|
|
4748
|
+
}
|
|
4749
|
+
);
|
|
4750
|
+
});
|
|
4751
|
+
var MonthRangePicker = (0, import_react35.forwardRef)((inProps, ref) => {
|
|
4752
|
+
const props = (0, import_joy48.useThemeProps)({ props: inProps, name: "MonthRangePicker" });
|
|
4753
|
+
const {
|
|
4754
|
+
onChange,
|
|
4755
|
+
disabled,
|
|
4756
|
+
label,
|
|
4757
|
+
error,
|
|
4758
|
+
helperText,
|
|
4759
|
+
minDate,
|
|
4760
|
+
maxDate,
|
|
4761
|
+
disableFuture,
|
|
4762
|
+
disablePast,
|
|
4763
|
+
required,
|
|
4764
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4765
|
+
sx,
|
|
4766
|
+
className,
|
|
4767
|
+
format = "YYYY/MM",
|
|
4768
|
+
size,
|
|
4769
|
+
...innerProps
|
|
4770
|
+
} = props;
|
|
4771
|
+
const innerRef = (0, import_react35.useRef)(null);
|
|
4772
|
+
const [value, setValue] = useControlledState(
|
|
4773
|
+
props.value,
|
|
4774
|
+
props.defaultValue || "",
|
|
4775
|
+
(0, import_react35.useCallback)((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4776
|
+
);
|
|
4777
|
+
const [anchorEl, setAnchorEl] = (0, import_react35.useState)(null);
|
|
4778
|
+
const open = Boolean(anchorEl);
|
|
4779
|
+
const calendarValue = (0, import_react35.useMemo)(() => value ? parseDates2(value) : void 0, [value]);
|
|
4780
|
+
(0, import_react35.useEffect)(() => {
|
|
4781
|
+
if (!anchorEl) {
|
|
4782
|
+
innerRef.current?.blur();
|
|
4783
|
+
}
|
|
4784
|
+
}, [anchorEl, innerRef]);
|
|
4785
|
+
(0, import_react35.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
4786
|
+
const handleChange = (0, import_react35.useCallback)(
|
|
4787
|
+
(event) => {
|
|
4788
|
+
setValue(event.target.value);
|
|
4789
|
+
},
|
|
4790
|
+
[setValue]
|
|
4791
|
+
);
|
|
4792
|
+
const handleCalendarToggle = (0, import_react35.useCallback)(
|
|
4793
|
+
(event) => {
|
|
4794
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4795
|
+
innerRef.current?.focus();
|
|
4796
|
+
},
|
|
4797
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
4798
|
+
);
|
|
4799
|
+
const handleCalendarChange = (0, import_react35.useCallback)(
|
|
4800
|
+
([date1, date2]) => {
|
|
4801
|
+
if (!date1 || !date2) return;
|
|
4802
|
+
setValue(formatValueString4([date1, date2], format));
|
|
4803
|
+
setAnchorEl(null);
|
|
4804
|
+
},
|
|
4805
|
+
[setValue, setAnchorEl, format]
|
|
4806
|
+
);
|
|
4807
|
+
return /* @__PURE__ */ import_react35.default.createElement(MonthRangePickerRoot, null, /* @__PURE__ */ import_react35.default.createElement(import_base5.FocusTrap, { open: true }, /* @__PURE__ */ import_react35.default.createElement(import_react35.default.Fragment, null, /* @__PURE__ */ import_react35.default.createElement(
|
|
4808
|
+
Input_default,
|
|
4809
|
+
{
|
|
4810
|
+
...innerProps,
|
|
4811
|
+
color: error ? "danger" : innerProps.color,
|
|
4812
|
+
ref,
|
|
4813
|
+
size,
|
|
4814
|
+
value,
|
|
4815
|
+
onChange: handleChange,
|
|
5196
4816
|
disabled,
|
|
5197
|
-
label,
|
|
5198
|
-
error,
|
|
5199
|
-
helperText,
|
|
5200
|
-
minDate,
|
|
5201
|
-
maxDate,
|
|
5202
|
-
disableFuture,
|
|
5203
|
-
disablePast,
|
|
5204
4817
|
required,
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
format = "YYYY/MM",
|
|
5209
|
-
size,
|
|
5210
|
-
...innerProps
|
|
5211
|
-
} = props;
|
|
5212
|
-
const innerRef = (0, import_react35.useRef)(null);
|
|
5213
|
-
const [value, setValue] = useControlledState(
|
|
5214
|
-
props.value,
|
|
5215
|
-
props.defaultValue || "",
|
|
5216
|
-
(0, import_react35.useCallback)(
|
|
5217
|
-
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
5218
|
-
[props.name, onChange]
|
|
5219
|
-
)
|
|
5220
|
-
);
|
|
5221
|
-
const [anchorEl, setAnchorEl] = (0, import_react35.useState)(null);
|
|
5222
|
-
const open = Boolean(anchorEl);
|
|
5223
|
-
const calendarValue = (0, import_react35.useMemo)(
|
|
5224
|
-
() => value ? parseDates2(value) : void 0,
|
|
5225
|
-
[value]
|
|
5226
|
-
);
|
|
5227
|
-
(0, import_react35.useEffect)(() => {
|
|
5228
|
-
if (!anchorEl) {
|
|
5229
|
-
innerRef.current?.blur();
|
|
5230
|
-
}
|
|
5231
|
-
}, [anchorEl, innerRef]);
|
|
5232
|
-
(0, import_react35.useImperativeHandle)(ref, () => innerRef.current, [
|
|
5233
|
-
innerRef
|
|
5234
|
-
]);
|
|
5235
|
-
const handleChange = (0, import_react35.useCallback)(
|
|
5236
|
-
(event) => {
|
|
5237
|
-
setValue(event.target.value);
|
|
5238
|
-
},
|
|
5239
|
-
[setValue]
|
|
5240
|
-
);
|
|
5241
|
-
const handleCalendarToggle = (0, import_react35.useCallback)(
|
|
5242
|
-
(event) => {
|
|
5243
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5244
|
-
innerRef.current?.focus();
|
|
4818
|
+
placeholder: `${format} - ${format}`,
|
|
4819
|
+
slotProps: {
|
|
4820
|
+
input: { component: TextMaskAdapter7, ref: innerRef, format }
|
|
5245
4821
|
},
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
setAnchorEl(null);
|
|
4822
|
+
error,
|
|
4823
|
+
className,
|
|
4824
|
+
sx: {
|
|
4825
|
+
...sx,
|
|
4826
|
+
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
4827
|
+
fontFamily: "monospace"
|
|
5253
4828
|
},
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
value,
|
|
5264
|
-
onChange: handleChange,
|
|
5265
|
-
disabled,
|
|
5266
|
-
required,
|
|
5267
|
-
placeholder: `${format} - ${format}`,
|
|
5268
|
-
slotProps: {
|
|
5269
|
-
input: { component: TextMaskAdapter7, ref: innerRef, format }
|
|
5270
|
-
},
|
|
5271
|
-
error,
|
|
5272
|
-
className,
|
|
5273
|
-
sx: {
|
|
5274
|
-
...sx,
|
|
5275
|
-
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
5276
|
-
fontFamily: "monospace"
|
|
4829
|
+
endDecorator: /* @__PURE__ */ import_react35.default.createElement(
|
|
4830
|
+
IconButton_default,
|
|
4831
|
+
{
|
|
4832
|
+
variant: "plain",
|
|
4833
|
+
onClick: handleCalendarToggle,
|
|
4834
|
+
"aria-label": "Toggle Calendar",
|
|
4835
|
+
"aria-controls": "month-range-picker-popper",
|
|
4836
|
+
"aria-haspopup": "dialog",
|
|
4837
|
+
"aria-expanded": open
|
|
5277
4838
|
},
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
4839
|
+
/* @__PURE__ */ import_react35.default.createElement(import_CalendarToday4.default, null)
|
|
4840
|
+
),
|
|
4841
|
+
label,
|
|
4842
|
+
helperText
|
|
4843
|
+
}
|
|
4844
|
+
), open && /* @__PURE__ */ import_react35.default.createElement(import_base5.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react35.default.createElement(
|
|
4845
|
+
StyledPopper4,
|
|
4846
|
+
{
|
|
4847
|
+
id: "month-range-picker-popper",
|
|
4848
|
+
open: true,
|
|
4849
|
+
anchorEl,
|
|
4850
|
+
placement: "bottom-end",
|
|
4851
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4852
|
+
modifiers: [
|
|
4853
|
+
{
|
|
4854
|
+
name: "offset",
|
|
4855
|
+
options: {
|
|
4856
|
+
offset: [4, 4]
|
|
4857
|
+
}
|
|
4858
|
+
}
|
|
4859
|
+
],
|
|
4860
|
+
"aria-label": "Calendar Tooltip",
|
|
4861
|
+
"aria-expanded": open
|
|
4862
|
+
},
|
|
4863
|
+
/* @__PURE__ */ import_react35.default.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react35.default.createElement(
|
|
4864
|
+
Calendar_default,
|
|
4865
|
+
{
|
|
4866
|
+
view: "month",
|
|
4867
|
+
views: ["month"],
|
|
4868
|
+
rangeSelection: true,
|
|
4869
|
+
defaultValue: calendarValue,
|
|
4870
|
+
onChange: handleCalendarChange,
|
|
4871
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
4872
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4873
|
+
disableFuture,
|
|
4874
|
+
disablePast
|
|
5292
4875
|
}
|
|
5293
|
-
),
|
|
5294
|
-
|
|
4876
|
+
), /* @__PURE__ */ import_react35.default.createElement(
|
|
4877
|
+
DialogActions_default,
|
|
5295
4878
|
{
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
anchorEl,
|
|
5299
|
-
placement: "bottom-end",
|
|
5300
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
5301
|
-
modifiers: [
|
|
5302
|
-
{
|
|
5303
|
-
name: "offset",
|
|
5304
|
-
options: {
|
|
5305
|
-
offset: [4, 4]
|
|
5306
|
-
}
|
|
5307
|
-
}
|
|
5308
|
-
],
|
|
5309
|
-
"aria-label": "Calendar Tooltip",
|
|
5310
|
-
"aria-expanded": open
|
|
5311
|
-
},
|
|
5312
|
-
/* @__PURE__ */ import_react35.default.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react35.default.createElement(
|
|
5313
|
-
Calendar_default,
|
|
5314
|
-
{
|
|
5315
|
-
view: "month",
|
|
5316
|
-
views: ["month"],
|
|
5317
|
-
rangeSelection: true,
|
|
5318
|
-
defaultValue: calendarValue,
|
|
5319
|
-
onChange: handleCalendarChange,
|
|
5320
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
5321
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
5322
|
-
disableFuture,
|
|
5323
|
-
disablePast
|
|
4879
|
+
sx: {
|
|
4880
|
+
p: 1
|
|
5324
4881
|
}
|
|
5325
|
-
|
|
5326
|
-
|
|
4882
|
+
},
|
|
4883
|
+
/* @__PURE__ */ import_react35.default.createElement(
|
|
4884
|
+
Button_default,
|
|
5327
4885
|
{
|
|
5328
|
-
|
|
5329
|
-
|
|
4886
|
+
size,
|
|
4887
|
+
variant: "plain",
|
|
4888
|
+
color: "neutral",
|
|
4889
|
+
onClick: () => {
|
|
4890
|
+
setValue("");
|
|
4891
|
+
setAnchorEl(null);
|
|
5330
4892
|
}
|
|
5331
4893
|
},
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
color: "neutral",
|
|
5338
|
-
onClick: () => {
|
|
5339
|
-
setValue("");
|
|
5340
|
-
setAnchorEl(null);
|
|
5341
|
-
}
|
|
5342
|
-
},
|
|
5343
|
-
"Clear"
|
|
5344
|
-
)
|
|
5345
|
-
))
|
|
5346
|
-
)))));
|
|
5347
|
-
}
|
|
5348
|
-
);
|
|
4894
|
+
"Clear"
|
|
4895
|
+
)
|
|
4896
|
+
))
|
|
4897
|
+
)))));
|
|
4898
|
+
});
|
|
5349
4899
|
MonthRangePicker.displayName = "MonthRangePicker";
|
|
5350
4900
|
|
|
5351
4901
|
// src/components/NavigationGroup/NavigationGroup.tsx
|
|
@@ -5445,7 +4995,7 @@ function Navigator(props) {
|
|
|
5445
4995
|
return /* @__PURE__ */ import_react38.default.createElement(
|
|
5446
4996
|
NavigationGroup,
|
|
5447
4997
|
{
|
|
5448
|
-
key: index
|
|
4998
|
+
key: `${item.title}-${index}`,
|
|
5449
4999
|
title: item.title,
|
|
5450
5000
|
startDecorator: item.startDecorator,
|
|
5451
5001
|
level,
|
|
@@ -5467,115 +5017,112 @@ var padDecimal = (value, decimalScale) => {
|
|
|
5467
5017
|
const [integer, decimal = ""] = `${value}`.split(".");
|
|
5468
5018
|
return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
|
|
5469
5019
|
};
|
|
5470
|
-
var TextMaskAdapter9 = import_react39.default.forwardRef(
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
}
|
|
5493
|
-
);
|
|
5020
|
+
var TextMaskAdapter9 = import_react39.default.forwardRef(function TextMaskAdapter10(props, ref) {
|
|
5021
|
+
const { onChange, min, max, ...innerProps } = props;
|
|
5022
|
+
return /* @__PURE__ */ import_react39.default.createElement(
|
|
5023
|
+
import_react_number_format2.NumericFormat,
|
|
5024
|
+
{
|
|
5025
|
+
...innerProps,
|
|
5026
|
+
onValueChange: ({ value }) => {
|
|
5027
|
+
onChange?.({
|
|
5028
|
+
target: {
|
|
5029
|
+
name: props.name,
|
|
5030
|
+
value
|
|
5031
|
+
}
|
|
5032
|
+
});
|
|
5033
|
+
},
|
|
5034
|
+
valueIsNumericString: true,
|
|
5035
|
+
thousandSeparator: true,
|
|
5036
|
+
suffix: "%",
|
|
5037
|
+
getInputRef: ref,
|
|
5038
|
+
allowNegative: true
|
|
5039
|
+
}
|
|
5040
|
+
);
|
|
5041
|
+
});
|
|
5494
5042
|
var PercentageInputRoot = (0, import_joy51.styled)(Input_default, {
|
|
5495
5043
|
name: "PercentageInput",
|
|
5496
5044
|
slot: "Root",
|
|
5497
5045
|
overridesResolver: (props, styles) => styles.root
|
|
5498
5046
|
})({});
|
|
5499
|
-
var PercentageInput = import_react39.default.forwardRef(
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
error,
|
|
5506
|
-
helperText,
|
|
5507
|
-
required,
|
|
5508
|
-
disabled,
|
|
5509
|
-
useMinorUnit,
|
|
5510
|
-
maxDecimalScale = 0,
|
|
5511
|
-
min,
|
|
5512
|
-
max,
|
|
5513
|
-
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
5514
|
-
sx,
|
|
5515
|
-
className,
|
|
5516
|
-
...innerProps
|
|
5517
|
-
} = props;
|
|
5518
|
-
const [_value, setValue] = useControlledState(
|
|
5519
|
-
props.value,
|
|
5520
|
-
props.defaultValue,
|
|
5521
|
-
(0, import_react39.useCallback)(
|
|
5522
|
-
(value2) => onChange?.({ target: { name, value: value2 } }),
|
|
5523
|
-
[onChange, name]
|
|
5524
|
-
)
|
|
5525
|
-
);
|
|
5526
|
-
const [internalError, setInternalError] = (0, import_react39.useState)(
|
|
5527
|
-
max && _value && _value > max || min && _value && _value < min
|
|
5528
|
-
);
|
|
5529
|
-
const value = (0, import_react39.useMemo)(() => {
|
|
5530
|
-
if (_value && useMinorUnit) {
|
|
5531
|
-
return _value / Math.pow(10, maxDecimalScale);
|
|
5532
|
-
}
|
|
5533
|
-
return _value;
|
|
5534
|
-
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
5535
|
-
const handleChange = (0, import_react39.useCallback)(
|
|
5536
|
-
(event) => {
|
|
5537
|
-
if (event.target.value === "") {
|
|
5538
|
-
setValue(void 0);
|
|
5539
|
-
return;
|
|
5540
|
-
}
|
|
5541
|
-
const originalAmount = Number(event.target.value);
|
|
5542
|
-
if (min && originalAmount < min || max && originalAmount > max) {
|
|
5543
|
-
setInternalError(true);
|
|
5544
|
-
} else {
|
|
5545
|
-
setInternalError(false);
|
|
5546
|
-
}
|
|
5547
|
-
const amount = useMinorUnit ? padDecimal(originalAmount, maxDecimalScale) : originalAmount;
|
|
5548
|
-
setValue(amount);
|
|
5549
|
-
},
|
|
5550
|
-
[setValue, useMinorUnit, maxDecimalScale, min, max]
|
|
5551
|
-
);
|
|
5552
|
-
return /* @__PURE__ */ import_react39.default.createElement(
|
|
5553
|
-
PercentageInputRoot,
|
|
5554
|
-
{
|
|
5555
|
-
...innerProps,
|
|
5556
|
-
ref,
|
|
5557
|
-
value,
|
|
5558
|
-
onChange: handleChange,
|
|
5559
|
-
error: internalError || error,
|
|
5560
|
-
disabled,
|
|
5561
|
-
required,
|
|
5562
|
-
color: internalError || error ? "danger" : props.color,
|
|
5047
|
+
var PercentageInput = import_react39.default.forwardRef(
|
|
5048
|
+
function PercentageInput2(inProps, ref) {
|
|
5049
|
+
const props = (0, import_joy51.useThemeProps)({ props: inProps, name: "PercentageInput" });
|
|
5050
|
+
const {
|
|
5051
|
+
name,
|
|
5052
|
+
onChange,
|
|
5563
5053
|
label,
|
|
5054
|
+
error,
|
|
5564
5055
|
helperText,
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5056
|
+
required,
|
|
5057
|
+
disabled,
|
|
5058
|
+
useMinorUnit,
|
|
5059
|
+
maxDecimalScale = 0,
|
|
5060
|
+
min,
|
|
5061
|
+
max,
|
|
5062
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
5063
|
+
sx,
|
|
5064
|
+
className,
|
|
5065
|
+
...innerProps
|
|
5066
|
+
} = props;
|
|
5067
|
+
const [_value, setValue] = useControlledState(
|
|
5068
|
+
props.value,
|
|
5069
|
+
props.defaultValue,
|
|
5070
|
+
(0, import_react39.useCallback)((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
5071
|
+
);
|
|
5072
|
+
const [internalError, setInternalError] = (0, import_react39.useState)(
|
|
5073
|
+
max && _value && _value > max || min && _value && _value < min
|
|
5074
|
+
);
|
|
5075
|
+
const value = (0, import_react39.useMemo)(() => {
|
|
5076
|
+
if (_value && useMinorUnit) {
|
|
5077
|
+
return _value / Math.pow(10, maxDecimalScale);
|
|
5078
|
+
}
|
|
5079
|
+
return _value;
|
|
5080
|
+
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
5081
|
+
const handleChange = (0, import_react39.useCallback)(
|
|
5082
|
+
(event) => {
|
|
5083
|
+
if (event.target.value === "") {
|
|
5084
|
+
setValue(void 0);
|
|
5085
|
+
return;
|
|
5570
5086
|
}
|
|
5087
|
+
const originalAmount = Number(event.target.value);
|
|
5088
|
+
if (min && originalAmount < min || max && originalAmount > max) {
|
|
5089
|
+
setInternalError(true);
|
|
5090
|
+
} else {
|
|
5091
|
+
setInternalError(false);
|
|
5092
|
+
}
|
|
5093
|
+
const amount = useMinorUnit ? padDecimal(originalAmount, maxDecimalScale) : originalAmount;
|
|
5094
|
+
setValue(amount);
|
|
5571
5095
|
},
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5096
|
+
[setValue, useMinorUnit, maxDecimalScale, min, max]
|
|
5097
|
+
);
|
|
5098
|
+
return /* @__PURE__ */ import_react39.default.createElement(
|
|
5099
|
+
PercentageInputRoot,
|
|
5100
|
+
{
|
|
5101
|
+
...innerProps,
|
|
5102
|
+
ref,
|
|
5103
|
+
value,
|
|
5104
|
+
onChange: handleChange,
|
|
5105
|
+
error: internalError || error,
|
|
5106
|
+
disabled,
|
|
5107
|
+
required,
|
|
5108
|
+
color: internalError || error ? "danger" : props.color,
|
|
5109
|
+
label,
|
|
5110
|
+
helperText,
|
|
5111
|
+
slotProps: {
|
|
5112
|
+
input: {
|
|
5113
|
+
component: TextMaskAdapter9,
|
|
5114
|
+
"aria-label": innerProps["aria-label"],
|
|
5115
|
+
decimalScale: maxDecimalScale
|
|
5116
|
+
}
|
|
5117
|
+
},
|
|
5118
|
+
sx: {
|
|
5119
|
+
...sx
|
|
5120
|
+
},
|
|
5121
|
+
className
|
|
5122
|
+
}
|
|
5123
|
+
);
|
|
5124
|
+
}
|
|
5125
|
+
);
|
|
5579
5126
|
PercentageInput.displayName = "PercentageInput";
|
|
5580
5127
|
|
|
5581
5128
|
// src/components/Radio/Radio.tsx
|
|
@@ -5660,6 +5207,7 @@ function Stepper(props) {
|
|
|
5660
5207
|
return /* @__PURE__ */ import_react41.default.createElement(
|
|
5661
5208
|
Step,
|
|
5662
5209
|
{
|
|
5210
|
+
key: `step-${i}`,
|
|
5663
5211
|
indicator: /* @__PURE__ */ import_react41.default.createElement(StepIndicator, { variant: "solid", color: "primary" }, completed ? /* @__PURE__ */ import_react41.default.createElement(import_Check.default, null) : step.indicatorContent),
|
|
5664
5212
|
active,
|
|
5665
5213
|
completed,
|
|
@@ -6054,52 +5602,11 @@ var ClearIcon2 = (0, import_joy57.styled)(import_ClearRounded.default, {
|
|
|
6054
5602
|
width: "18px",
|
|
6055
5603
|
height: "18px"
|
|
6056
5604
|
}));
|
|
6057
|
-
var UNITS = [
|
|
6058
|
-
"byte",
|
|
6059
|
-
"kilobyte",
|
|
6060
|
-
"megabyte",
|
|
6061
|
-
"gigabyte",
|
|
6062
|
-
"terabyte",
|
|
6063
|
-
"petabyte"
|
|
6064
|
-
];
|
|
5605
|
+
var UNITS = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "petabyte"];
|
|
6065
5606
|
var ALL_EXTENSIONS_BY_TYPE = {
|
|
6066
|
-
"image/*": [
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
".png",
|
|
6070
|
-
".gif",
|
|
6071
|
-
".bmp",
|
|
6072
|
-
".tiff",
|
|
6073
|
-
".svg",
|
|
6074
|
-
".webp",
|
|
6075
|
-
".heic",
|
|
6076
|
-
".ico"
|
|
6077
|
-
],
|
|
6078
|
-
"audio/*": [
|
|
6079
|
-
".mp3",
|
|
6080
|
-
".wav",
|
|
6081
|
-
".flac",
|
|
6082
|
-
".aac",
|
|
6083
|
-
".ogg",
|
|
6084
|
-
".m4a",
|
|
6085
|
-
".wma",
|
|
6086
|
-
".aiff",
|
|
6087
|
-
".alac",
|
|
6088
|
-
".midi",
|
|
6089
|
-
".mp4"
|
|
6090
|
-
],
|
|
6091
|
-
"video/*": [
|
|
6092
|
-
".mp4",
|
|
6093
|
-
".avi",
|
|
6094
|
-
".mkv",
|
|
6095
|
-
".mov",
|
|
6096
|
-
".wmv",
|
|
6097
|
-
".flv",
|
|
6098
|
-
".webm",
|
|
6099
|
-
".mpeg",
|
|
6100
|
-
".3gp",
|
|
6101
|
-
".m4v"
|
|
6102
|
-
]
|
|
5607
|
+
"image/*": [".jpeg", ".jpg", ".png", ".gif", ".bmp", ".tiff", ".svg", ".webp", ".heic", ".ico"],
|
|
5608
|
+
"audio/*": [".mp3", ".wav", ".flac", ".aac", ".ogg", ".m4a", ".wma", ".aiff", ".alac", ".midi", ".mp4"],
|
|
5609
|
+
"video/*": [".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".webm", ".mpeg", ".3gp", ".m4v"]
|
|
6103
5610
|
};
|
|
6104
5611
|
var getFileSize = (n) => {
|
|
6105
5612
|
const i = n == 0 ? 0 : Math.floor(Math.log(n) / Math.log(1024));
|
|
@@ -6113,16 +5620,7 @@ var getFileSize = (n) => {
|
|
|
6113
5620
|
};
|
|
6114
5621
|
var Preview = (props) => {
|
|
6115
5622
|
const { files, uploaded, onDelete } = props;
|
|
6116
|
-
return /* @__PURE__ */ import_react45.default.createElement(PreviewRoot, { gap: 1 }, [...uploaded, ...files].map((file) => /* @__PURE__ */ import_react45.default.createElement(UploadCard, { key: file.name, size: "sm", color: "neutral" }, /* @__PURE__ */ import_react45.default.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2 }, /* @__PURE__ */ import_react45.default.createElement(UploadFileIcon, null), /* @__PURE__ */ import_react45.default.createElement(Stack_default, { flex: "1" }, /* @__PURE__ */ import_react45.default.createElement(Typography_default, { level: "body-sm", textColor: "common.black" }, file.name), !!file.size && /* @__PURE__ */ import_react45.default.createElement(
|
|
6117
|
-
Typography_default,
|
|
6118
|
-
{
|
|
6119
|
-
level: "body-xs",
|
|
6120
|
-
fontWeight: "300",
|
|
6121
|
-
lineHeight: "1.33",
|
|
6122
|
-
textColor: "text.tertiary"
|
|
6123
|
-
},
|
|
6124
|
-
getFileSize(file.size)
|
|
6125
|
-
)), /* @__PURE__ */ import_react45.default.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ import_react45.default.createElement(ClearIcon2, null))))));
|
|
5623
|
+
return /* @__PURE__ */ import_react45.default.createElement(PreviewRoot, { gap: 1 }, [...uploaded, ...files].map((file) => /* @__PURE__ */ import_react45.default.createElement(UploadCard, { key: file.name, size: "sm", color: "neutral" }, /* @__PURE__ */ import_react45.default.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2 }, /* @__PURE__ */ import_react45.default.createElement(UploadFileIcon, null), /* @__PURE__ */ import_react45.default.createElement(Stack_default, { flex: "1" }, /* @__PURE__ */ import_react45.default.createElement(Typography_default, { level: "body-sm", textColor: "common.black" }, file.name), !!file.size && /* @__PURE__ */ import_react45.default.createElement(Typography_default, { level: "body-xs", fontWeight: "300", lineHeight: "1.33", textColor: "text.tertiary" }, getFileSize(file.size))), /* @__PURE__ */ import_react45.default.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ import_react45.default.createElement(ClearIcon2, null))))));
|
|
6126
5624
|
};
|
|
6127
5625
|
var UploaderRoot = (0, import_joy57.styled)(Stack_default, {
|
|
6128
5626
|
name: "Uploader",
|
|
@@ -6134,31 +5632,27 @@ var FileDropZone = (0, import_joy57.styled)(Sheet_default, {
|
|
|
6134
5632
|
name: "Uploader",
|
|
6135
5633
|
slot: "dropZone",
|
|
6136
5634
|
shouldForwardProp: (prop) => prop !== "error"
|
|
6137
|
-
})(
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
})
|
|
6150
|
-
);
|
|
5635
|
+
})(({ theme, state, error }) => ({
|
|
5636
|
+
width: "100%",
|
|
5637
|
+
display: "flex",
|
|
5638
|
+
flexDirection: "column",
|
|
5639
|
+
justifyContent: "center",
|
|
5640
|
+
alignItems: "center",
|
|
5641
|
+
padding: theme.spacing(5),
|
|
5642
|
+
gap: theme.spacing(4),
|
|
5643
|
+
cursor: "pointer",
|
|
5644
|
+
backgroundColor: theme.palette.background.surface,
|
|
5645
|
+
border: error ? `1px solid ${theme.palette.danger.outlinedBorder}` : state === "idle" ? `1px solid ${theme.palette.neutral.outlinedBorder}` : `1px solid ${theme.palette.primary.outlinedBorder}`
|
|
5646
|
+
}));
|
|
6151
5647
|
var UploaderIcon = (0, import_joy57.styled)(import_CloudUploadRounded.default, {
|
|
6152
5648
|
name: "Uploader",
|
|
6153
5649
|
slot: "iconContainer",
|
|
6154
5650
|
shouldForwardProp: (prop) => prop !== "error"
|
|
6155
|
-
})(
|
|
6156
|
-
({
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
})
|
|
6161
|
-
);
|
|
5651
|
+
})(({ theme, state, error }) => ({
|
|
5652
|
+
color: error ? `rgba(${theme.vars.palette.danger.mainChannel} / 0.6)` : state === "over" ? `rgba(${theme.palette.primary.mainChannel} / 0.6)` : theme.palette.neutral.softActiveBg,
|
|
5653
|
+
width: "32px",
|
|
5654
|
+
height: "32px"
|
|
5655
|
+
}));
|
|
6162
5656
|
var Uploader = import_react45.default.memo(
|
|
6163
5657
|
(props) => {
|
|
6164
5658
|
const {
|
|
@@ -6178,14 +5672,9 @@ var Uploader = import_react45.default.memo(
|
|
|
6178
5672
|
const inputRef = (0, import_react45.useRef)(null);
|
|
6179
5673
|
const [errorText, setErrorText] = (0, import_react45.useState)();
|
|
6180
5674
|
const [files, setFiles] = (0, import_react45.useState)([]);
|
|
6181
|
-
const [uploaded, setUploaded] = (0, import_react45.useState)(
|
|
6182
|
-
props.uploaded || []
|
|
6183
|
-
);
|
|
5675
|
+
const [uploaded, setUploaded] = (0, import_react45.useState)(props.uploaded || []);
|
|
6184
5676
|
const [previewState, setPreviewState] = (0, import_react45.useState)("idle");
|
|
6185
|
-
const accepts = (0, import_react45.useMemo)(
|
|
6186
|
-
() => accept.split(",").map((accept2) => accept2.trim()),
|
|
6187
|
-
[accept]
|
|
6188
|
-
);
|
|
5677
|
+
const accepts = (0, import_react45.useMemo)(() => accept.split(",").map((accept2) => accept2.trim()), [accept]);
|
|
6189
5678
|
const parsedAccepts = (0, import_react45.useMemo)(
|
|
6190
5679
|
() => accepts.flatMap((type) => {
|
|
6191
5680
|
if (["image/*", "video/*", "audio/*"].includes(type)) {
|
|
@@ -6197,15 +5686,11 @@ var Uploader = import_react45.default.memo(
|
|
|
6197
5686
|
);
|
|
6198
5687
|
const helperText = (0, import_react45.useMemo)(() => {
|
|
6199
5688
|
const [allAcceptedTypes, acceptedTypes] = [
|
|
6200
|
-
accepts.filter(
|
|
6201
|
-
(accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)
|
|
6202
|
-
).map((accept2) => {
|
|
5689
|
+
accepts.filter((accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
|
|
6203
5690
|
const [type] = accept2.split("/");
|
|
6204
5691
|
return type.toLowerCase();
|
|
6205
5692
|
}),
|
|
6206
|
-
accepts.filter(
|
|
6207
|
-
(accept2) => !["image/*", "video/*", "audio/*"].includes(accept2)
|
|
6208
|
-
).map((accept2) => {
|
|
5693
|
+
accepts.filter((accept2) => !["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
|
|
6209
5694
|
const [extensionOrType, subType] = accept2.split("/");
|
|
6210
5695
|
if (!subType) {
|
|
6211
5696
|
return extensionOrType.toUpperCase().replace(".", "");
|
|
@@ -6222,16 +5707,11 @@ var Uploader = import_react45.default.memo(
|
|
|
6222
5707
|
}
|
|
6223
5708
|
helperTexts.push(`Maximum ${getFileSize(maxFileTotalSize)}`);
|
|
6224
5709
|
if (maxCount) {
|
|
6225
|
-
helperTexts.push(
|
|
6226
|
-
`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`
|
|
6227
|
-
);
|
|
5710
|
+
helperTexts.push(`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`);
|
|
6228
5711
|
}
|
|
6229
5712
|
return helperTexts.join(", ");
|
|
6230
5713
|
}, [accepts, maxFileTotalSize, maxCount]);
|
|
6231
|
-
const error = (0, import_react45.useMemo)(
|
|
6232
|
-
() => !!errorText || props.error,
|
|
6233
|
-
[props.error, errorText]
|
|
6234
|
-
);
|
|
5714
|
+
const error = (0, import_react45.useMemo)(() => !!errorText || props.error, [props.error, errorText]);
|
|
6235
5715
|
const showDropZone = (0, import_react45.useMemo)(
|
|
6236
5716
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
6237
5717
|
[files, maxCount, uploaded]
|
|
@@ -6258,10 +5738,7 @@ var Uploader = import_react45.default.memo(
|
|
|
6258
5738
|
}
|
|
6259
5739
|
});
|
|
6260
5740
|
}
|
|
6261
|
-
const totalFileSize = [...files, ...uploads].reduce(
|
|
6262
|
-
(acc, file) => acc + file.size,
|
|
6263
|
-
0
|
|
6264
|
-
);
|
|
5741
|
+
const totalFileSize = [...files, ...uploads].reduce((acc, file) => acc + file.size, 0);
|
|
6265
5742
|
if (totalFileSize > maxFileTotalSize) {
|
|
6266
5743
|
throw new Error(`Total File size exceeded the maximum limit.`);
|
|
6267
5744
|
}
|
|
@@ -6282,34 +5759,15 @@ var Uploader = import_react45.default.memo(
|
|
|
6282
5759
|
setErrorText(err.message);
|
|
6283
5760
|
}
|
|
6284
5761
|
},
|
|
6285
|
-
[
|
|
6286
|
-
files,
|
|
6287
|
-
uploaded,
|
|
6288
|
-
maxCount,
|
|
6289
|
-
parsedAccepts,
|
|
6290
|
-
maxFileSize,
|
|
6291
|
-
maxFileTotalSize,
|
|
6292
|
-
name,
|
|
6293
|
-
onChange
|
|
6294
|
-
]
|
|
5762
|
+
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
6295
5763
|
);
|
|
6296
5764
|
(0, import_react45.useEffect)(() => {
|
|
6297
5765
|
if (!dropZoneRef.current || disabled) {
|
|
6298
5766
|
return;
|
|
6299
5767
|
}
|
|
6300
5768
|
let cleanup;
|
|
6301
|
-
Promise.all([
|
|
6302
|
-
|
|
6303
|
-
esmFiles.adapter,
|
|
6304
|
-
esmFiles.file,
|
|
6305
|
-
esmFiles.preventUnhandled
|
|
6306
|
-
]).then(
|
|
6307
|
-
([
|
|
6308
|
-
combineModule,
|
|
6309
|
-
adapterModule,
|
|
6310
|
-
fileModule,
|
|
6311
|
-
preventUnhandledModule
|
|
6312
|
-
]) => {
|
|
5769
|
+
Promise.all([esmFiles.combine, esmFiles.adapter, esmFiles.file, esmFiles.preventUnhandled]).then(
|
|
5770
|
+
([combineModule, adapterModule, fileModule, preventUnhandledModule]) => {
|
|
6313
5771
|
const { combine } = combineModule;
|
|
6314
5772
|
const { dropTargetForExternal, monitorForExternal } = adapterModule;
|
|
6315
5773
|
const { containsFiles, getFiles } = fileModule;
|
|
@@ -6344,9 +5802,7 @@ var Uploader = import_react45.default.memo(
|
|
|
6344
5802
|
(0, import_react45.useEffect)(() => {
|
|
6345
5803
|
if (inputRef.current && minCount) {
|
|
6346
5804
|
if (files.length < minCount) {
|
|
6347
|
-
inputRef.current.setCustomValidity(
|
|
6348
|
-
`At least ${minCount} files are required.`
|
|
6349
|
-
);
|
|
5805
|
+
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
6350
5806
|
} else {
|
|
6351
5807
|
inputRef.current.setCustomValidity("");
|
|
6352
5808
|
}
|
|
@@ -6372,9 +5828,7 @@ var Uploader = import_react45.default.memo(
|
|
|
6372
5828
|
return current.filter((file) => file !== deletedFile);
|
|
6373
5829
|
});
|
|
6374
5830
|
} else {
|
|
6375
|
-
setUploaded(
|
|
6376
|
-
(uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id)
|
|
6377
|
-
);
|
|
5831
|
+
setUploaded((uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id));
|
|
6378
5832
|
onDelete?.(deletedFile);
|
|
6379
5833
|
}
|
|
6380
5834
|
setErrorText(void 0);
|
|
@@ -6400,9 +5854,7 @@ var Uploader = import_react45.default.memo(
|
|
|
6400
5854
|
required: !!minCount,
|
|
6401
5855
|
onInvalid: (e) => {
|
|
6402
5856
|
if (minCount && files.length < minCount) {
|
|
6403
|
-
setErrorText(
|
|
6404
|
-
`Please choose ${minCount} ${minCount === 1 ? "file" : "files"} to upload.`
|
|
6405
|
-
);
|
|
5857
|
+
setErrorText(`Please choose ${minCount} ${minCount === 1 ? "file" : "files"} to upload.`);
|
|
6406
5858
|
}
|
|
6407
5859
|
},
|
|
6408
5860
|
slotProps: {
|
|
@@ -6418,25 +5870,7 @@ var Uploader = import_react45.default.memo(
|
|
|
6418
5870
|
}
|
|
6419
5871
|
)
|
|
6420
5872
|
);
|
|
6421
|
-
return /* @__PURE__ */ import_react45.default.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ import_react45.default.createElement(
|
|
6422
|
-
FormControl_default,
|
|
6423
|
-
{
|
|
6424
|
-
size,
|
|
6425
|
-
error: !!(error || errorText),
|
|
6426
|
-
disabled,
|
|
6427
|
-
required: !!minCount
|
|
6428
|
-
},
|
|
6429
|
-
label && /* @__PURE__ */ import_react45.default.createElement(FormLabel_default, null, label),
|
|
6430
|
-
uploader,
|
|
6431
|
-
/* @__PURE__ */ import_react45.default.createElement(FormHelperText_default, null, /* @__PURE__ */ import_react45.default.createElement(Stack_default, null, errorText && /* @__PURE__ */ import_react45.default.createElement("div", null, errorText), /* @__PURE__ */ import_react45.default.createElement("div", null, helperText)))
|
|
6432
|
-
), [...uploaded, ...files].length > 0 && /* @__PURE__ */ import_react45.default.createElement(
|
|
6433
|
-
Preview,
|
|
6434
|
-
{
|
|
6435
|
-
files,
|
|
6436
|
-
uploaded,
|
|
6437
|
-
onDelete: handleDeleteFile
|
|
6438
|
-
}
|
|
6439
|
-
));
|
|
5873
|
+
return /* @__PURE__ */ import_react45.default.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ import_react45.default.createElement(FormControl_default, { size, error: !!(error || errorText), disabled, required: !!minCount }, label && /* @__PURE__ */ import_react45.default.createElement(FormLabel_default, null, label), uploader, /* @__PURE__ */ import_react45.default.createElement(FormHelperText_default, null, /* @__PURE__ */ import_react45.default.createElement(Stack_default, null, errorText && /* @__PURE__ */ import_react45.default.createElement("div", null, errorText), /* @__PURE__ */ import_react45.default.createElement("div", null, helperText)))), [...uploaded, ...files].length > 0 && /* @__PURE__ */ import_react45.default.createElement(Preview, { files, uploaded, onDelete: handleDeleteFile }));
|
|
6440
5874
|
}
|
|
6441
5875
|
);
|
|
6442
5876
|
Uploader.displayName = "Uploader";
|