@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.js
CHANGED
|
@@ -183,7 +183,7 @@ function Accordions(props) {
|
|
|
183
183
|
return /* @__PURE__ */ React.createElement(MotionAccordions, { variant, color, ...innerProps }, items.map((item, index) => /* @__PURE__ */ React.createElement(
|
|
184
184
|
Accordion,
|
|
185
185
|
{
|
|
186
|
-
key: index
|
|
186
|
+
key: `accordion-${index}`,
|
|
187
187
|
summary: item.summary,
|
|
188
188
|
details: item.details,
|
|
189
189
|
index,
|
|
@@ -227,16 +227,7 @@ var MotionAlert = styled(motion3(JoyAlert))({
|
|
|
227
227
|
function Alert(props) {
|
|
228
228
|
const { title, content, actions, color = "primary", ...innerProps } = props;
|
|
229
229
|
const invertedColors = props.invertedColors || props.variant === "solid";
|
|
230
|
-
return /* @__PURE__ */ React3.createElement(
|
|
231
|
-
MotionAlert,
|
|
232
|
-
{
|
|
233
|
-
...innerProps,
|
|
234
|
-
color,
|
|
235
|
-
endDecorator: actions,
|
|
236
|
-
invertedColors
|
|
237
|
-
},
|
|
238
|
-
/* @__PURE__ */ React3.createElement(Stack_default, null, title && /* @__PURE__ */ React3.createElement(Typography_default, { level: "title-md", fontWeight: "bold", color }, title), /* @__PURE__ */ React3.createElement(Typography_default, { level: "body-sm", fontWeight: 500, color }, content))
|
|
239
|
-
);
|
|
230
|
+
return /* @__PURE__ */ React3.createElement(MotionAlert, { ...innerProps, color, endDecorator: actions, invertedColors }, /* @__PURE__ */ React3.createElement(Stack_default, null, title && /* @__PURE__ */ React3.createElement(Typography_default, { level: "title-md", fontWeight: "bold", color }, title), /* @__PURE__ */ React3.createElement(Typography_default, { level: "body-sm", fontWeight: 500, color }, content)));
|
|
240
231
|
}
|
|
241
232
|
Alert.displayName = "Alert";
|
|
242
233
|
|
|
@@ -256,11 +247,7 @@ import { useVirtualizer } from "@tanstack/react-virtual";
|
|
|
256
247
|
import { Popper } from "@mui/base";
|
|
257
248
|
|
|
258
249
|
// src/components/FormControl/FormControl.tsx
|
|
259
|
-
import {
|
|
260
|
-
FormControl as JoyFormControl,
|
|
261
|
-
styled as styled2,
|
|
262
|
-
formLabelClasses
|
|
263
|
-
} from "@mui/joy";
|
|
250
|
+
import { FormControl as JoyFormControl, styled as styled2, formLabelClasses } from "@mui/joy";
|
|
264
251
|
import { motion as motion4 } from "framer-motion";
|
|
265
252
|
var MotionFormControl = motion4(JoyFormControl);
|
|
266
253
|
var FormControl = styled2(MotionFormControl)(({ theme }) => ({
|
|
@@ -308,9 +295,7 @@ var Chip_default = Chip;
|
|
|
308
295
|
|
|
309
296
|
// src/components/IconButton/IconButton.tsx
|
|
310
297
|
import React4, { forwardRef } from "react";
|
|
311
|
-
import {
|
|
312
|
-
IconButton as JoyIconButton
|
|
313
|
-
} from "@mui/joy";
|
|
298
|
+
import { IconButton as JoyIconButton } from "@mui/joy";
|
|
314
299
|
import { motion as motion8 } from "framer-motion";
|
|
315
300
|
var MotionIconButton = motion8(JoyIconButton);
|
|
316
301
|
var IconButton = forwardRef(
|
|
@@ -327,9 +312,7 @@ var IconButton_default = IconButton;
|
|
|
327
312
|
import { useState, useCallback, useEffect, useRef } from "react";
|
|
328
313
|
function useControlledState(controlledValue, defaultValue, onChange) {
|
|
329
314
|
const { current: isControlled } = useRef(controlledValue !== void 0);
|
|
330
|
-
const [internalValue, setInternalValue] = useState(
|
|
331
|
-
controlledValue ?? defaultValue
|
|
332
|
-
);
|
|
315
|
+
const [internalValue, setInternalValue] = useState(controlledValue ?? defaultValue);
|
|
333
316
|
const displayValue = isControlled ? controlledValue : internalValue;
|
|
334
317
|
useEffect(() => {
|
|
335
318
|
if (isControlled) {
|
|
@@ -607,12 +590,7 @@ var Autocomplete_default = Autocomplete;
|
|
|
607
590
|
|
|
608
591
|
// src/components/Avatar/Avatar.tsx
|
|
609
592
|
import React6, { forwardRef as forwardRef2, useMemo as useMemo2 } from "react";
|
|
610
|
-
import {
|
|
611
|
-
Avatar as JoyAvatar,
|
|
612
|
-
AvatarGroup,
|
|
613
|
-
styled as styled4,
|
|
614
|
-
useThemeProps
|
|
615
|
-
} from "@mui/joy";
|
|
593
|
+
import { Avatar as JoyAvatar, AvatarGroup, styled as styled4, useThemeProps } from "@mui/joy";
|
|
616
594
|
var StyledAvatar = styled4(JoyAvatar, {
|
|
617
595
|
name: "Avatar",
|
|
618
596
|
slot: "Root",
|
|
@@ -668,10 +646,7 @@ import {
|
|
|
668
646
|
|
|
669
647
|
// src/components/Menu/Menu.tsx
|
|
670
648
|
import React7 from "react";
|
|
671
|
-
import {
|
|
672
|
-
Menu as JoyMenu,
|
|
673
|
-
MenuItem as JoyMenuItem
|
|
674
|
-
} from "@mui/joy";
|
|
649
|
+
import { Menu as JoyMenu, MenuItem as JoyMenuItem } from "@mui/joy";
|
|
675
650
|
import { motion as motion10 } from "framer-motion";
|
|
676
651
|
var MotionMenu = motion10(JoyMenu);
|
|
677
652
|
var Menu = (props) => {
|
|
@@ -704,9 +679,9 @@ function Breadcrumbs(props) {
|
|
|
704
679
|
slotProps: { link: linkProps, ...restSlotProps } = {
|
|
705
680
|
link: { color: "neutral" }
|
|
706
681
|
},
|
|
682
|
+
collapsed = true,
|
|
707
683
|
...innerProps
|
|
708
684
|
} = props;
|
|
709
|
-
const _endCrumbCount = Math.max(1, endCrumbCount);
|
|
710
685
|
const Crumb = (props2) => {
|
|
711
686
|
if (props2.type === "link" && Link4) {
|
|
712
687
|
return /* @__PURE__ */ React8.createElement(Link4, { to: props2.linkHref, href: props2.linkHref, ...linkProps }, props2.label);
|
|
@@ -714,21 +689,14 @@ function Breadcrumbs(props) {
|
|
|
714
689
|
return /* @__PURE__ */ React8.createElement(Typography_default, null, props2.label);
|
|
715
690
|
}
|
|
716
691
|
};
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
slotProps: restSlotProps,
|
|
726
|
-
...innerProps
|
|
727
|
-
},
|
|
728
|
-
frontCrumbs,
|
|
729
|
-
collapsedCrumbs.length && /* @__PURE__ */ React8.createElement(Dropdown_default, null, /* @__PURE__ */ React8.createElement(JoyMenuButton, { size, variant: "plain" }, "..."), /* @__PURE__ */ React8.createElement(Menu_default, { size }, collapsedCrumbs)),
|
|
730
|
-
backCrumbs
|
|
731
|
-
);
|
|
692
|
+
if (!collapsed) {
|
|
693
|
+
return /* @__PURE__ */ React8.createElement(JoyBreadcrumbs, { size, slots: restSlots, slotProps: restSlotProps, ...innerProps }, crumbs.map((crumb, index) => /* @__PURE__ */ React8.createElement(Crumb, { key: `breadcrumb-${index}`, ...crumb })));
|
|
694
|
+
}
|
|
695
|
+
const _endCrumbCount = Math.max(1, endCrumbCount);
|
|
696
|
+
const frontCrumbs = crumbs.slice(0, startCrumbCount).map((crumb) => /* @__PURE__ */ React8.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
|
|
697
|
+
const backCrumbs = (startCrumbCount + _endCrumbCount > crumbs.length ? crumbs.slice(startCrumbCount) : crumbs.slice(-_endCrumbCount)).map((crumb) => /* @__PURE__ */ React8.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
|
|
698
|
+
const collapsedCrumbs = crumbs.slice(startCrumbCount, -_endCrumbCount).map((crumb) => /* @__PURE__ */ React8.createElement(MenuItem, { key: `breadcrumb-${crumb.label}` }, /* @__PURE__ */ React8.createElement(Crumb, { ...crumb })));
|
|
699
|
+
return /* @__PURE__ */ React8.createElement(JoyBreadcrumbs, { size, slots: restSlots, slotProps: restSlotProps, ...innerProps }, frontCrumbs, collapsedCrumbs.length && /* @__PURE__ */ React8.createElement(Dropdown_default, null, /* @__PURE__ */ React8.createElement(JoyMenuButton, { size, variant: "plain" }, "..."), /* @__PURE__ */ React8.createElement(Menu_default, { size }, collapsedCrumbs)), backCrumbs);
|
|
732
700
|
}
|
|
733
701
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
734
702
|
|
|
@@ -737,11 +705,9 @@ import React9, { forwardRef as forwardRef3 } from "react";
|
|
|
737
705
|
import { Button as JoyButton } from "@mui/joy";
|
|
738
706
|
import { motion as motion11 } from "framer-motion";
|
|
739
707
|
var MotionButton = motion11(JoyButton);
|
|
740
|
-
var Button = forwardRef3(
|
|
741
|
-
({ ...props }
|
|
742
|
-
|
|
743
|
-
}
|
|
744
|
-
);
|
|
708
|
+
var Button = forwardRef3(({ ...props }, ref) => {
|
|
709
|
+
return /* @__PURE__ */ React9.createElement(MotionButton, { ref, ...props });
|
|
710
|
+
});
|
|
745
711
|
Button.displayName = "Button";
|
|
746
712
|
|
|
747
713
|
// src/components/Button/index.ts
|
|
@@ -760,9 +726,7 @@ var getCalendarDates = (date) => {
|
|
|
760
726
|
const firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
761
727
|
const lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
762
728
|
const firstWeekInThisMonth = Math.ceil((firstDay.getDay() + 1) / 7);
|
|
763
|
-
const lastWeekInThisMonth = Math.ceil(
|
|
764
|
-
(lastDay.getDate() + firstDay.getDay()) / 7
|
|
765
|
-
);
|
|
729
|
+
const lastWeekInThisMonth = Math.ceil((lastDay.getDate() + firstDay.getDay()) / 7);
|
|
766
730
|
let day = 1;
|
|
767
731
|
for (let i = 1; i <= lastWeekInThisMonth; i++) {
|
|
768
732
|
const week = [];
|
|
@@ -837,7 +801,9 @@ var useCalendarProps = (inProps) => {
|
|
|
837
801
|
const [uncontrolledView, setUncontrolledView] = useState2(
|
|
838
802
|
() => resolveView(inProps.view || "day", inProps.views || ["day", "month"])
|
|
839
803
|
);
|
|
840
|
-
const [uncontrolledValue, setUncontrolledValue] = useState2(
|
|
804
|
+
const [uncontrolledValue, setUncontrolledValue] = useState2(
|
|
805
|
+
inProps.defaultValue
|
|
806
|
+
);
|
|
841
807
|
const [viewMonth, setViewMonth] = useState2(() => {
|
|
842
808
|
const today = /* @__PURE__ */ new Date();
|
|
843
809
|
today.setDate(1);
|
|
@@ -910,10 +876,7 @@ var useCalendarProps = (inProps) => {
|
|
|
910
876
|
},
|
|
911
877
|
name: "Calendar"
|
|
912
878
|
});
|
|
913
|
-
const ownerState = useMemo3(
|
|
914
|
-
() => ({ ...props, viewMonth, direction }),
|
|
915
|
-
[props, viewMonth, direction]
|
|
916
|
-
);
|
|
879
|
+
const ownerState = useMemo3(() => ({ ...props, viewMonth, direction }), [props, viewMonth, direction]);
|
|
917
880
|
return [props, ownerState];
|
|
918
881
|
};
|
|
919
882
|
|
|
@@ -931,11 +894,7 @@ var useCalendar = (ownerState) => {
|
|
|
931
894
|
const currentMonth = currentDate.getMonth();
|
|
932
895
|
const currentDay = currentDate.getDate();
|
|
933
896
|
const prevMonth = new Date(currentYear, currentMonth - 1, 1);
|
|
934
|
-
const lastDayOfPrevMonth = new Date(
|
|
935
|
-
currentYear,
|
|
936
|
-
currentMonth,
|
|
937
|
-
0
|
|
938
|
-
).getDate();
|
|
897
|
+
const lastDayOfPrevMonth = new Date(currentYear, currentMonth, 0).getDate();
|
|
939
898
|
const prevMonthDay = Math.min(currentDay, lastDayOfPrevMonth);
|
|
940
899
|
prevMonth.setDate(prevMonthDay);
|
|
941
900
|
ownerState.onMonthChange?.(prevMonth);
|
|
@@ -952,11 +911,7 @@ var useCalendar = (ownerState) => {
|
|
|
952
911
|
const currentMonth = currentDate.getMonth();
|
|
953
912
|
const currentDay = currentDate.getDate();
|
|
954
913
|
const nextMonth = new Date(currentYear, currentMonth + 1, 1);
|
|
955
|
-
const lastDayOfNextMonth = new Date(
|
|
956
|
-
currentYear,
|
|
957
|
-
currentMonth + 2,
|
|
958
|
-
0
|
|
959
|
-
).getDate();
|
|
914
|
+
const lastDayOfNextMonth = new Date(currentYear, currentMonth + 2, 0).getDate();
|
|
960
915
|
const nextMonthDay = Math.min(currentDay, lastDayOfNextMonth);
|
|
961
916
|
nextMonth.setDate(nextMonthDay);
|
|
962
917
|
ownerState.onMonthChange?.(nextMonth);
|
|
@@ -973,22 +928,13 @@ var useCalendar = (ownerState) => {
|
|
|
973
928
|
thisDay.setDate(day);
|
|
974
929
|
const inRange = ownerState.rangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
975
930
|
(hoverDay && isWithinRange(ownerState.value[0], hoverDay, thisDay) || // NOTE: Selected range is included in the range
|
|
976
|
-
ownerState.value[1] && isWithinRange(
|
|
977
|
-
ownerState.value[0],
|
|
978
|
-
ownerState.value[1],
|
|
979
|
-
thisDay
|
|
980
|
-
));
|
|
931
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisDay));
|
|
981
932
|
return {
|
|
982
933
|
"aria-label": thisDay.toLocaleDateString(),
|
|
983
934
|
"aria-current": inRange ? "date" : void 0
|
|
984
935
|
};
|
|
985
936
|
},
|
|
986
|
-
[
|
|
987
|
-
ownerState.rangeSelection,
|
|
988
|
-
ownerState.value,
|
|
989
|
-
ownerState.viewMonth,
|
|
990
|
-
hoverDay
|
|
991
|
-
]
|
|
937
|
+
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverDay]
|
|
992
938
|
),
|
|
993
939
|
getMonthCellProps: useCallback4(
|
|
994
940
|
(monthIndex) => {
|
|
@@ -999,22 +945,13 @@ var useCalendar = (ownerState) => {
|
|
|
999
945
|
const isMonthRangeSelection = !ownerState.views?.find((view) => view === "day") && ownerState.rangeSelection;
|
|
1000
946
|
const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1001
947
|
(hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
|
|
1002
|
-
ownerState.value[1] && isWithinRange(
|
|
1003
|
-
ownerState.value[0],
|
|
1004
|
-
ownerState.value[1],
|
|
1005
|
-
thisMonth
|
|
1006
|
-
));
|
|
948
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisMonth));
|
|
1007
949
|
return {
|
|
1008
950
|
"aria-label": thisMonth.toLocaleDateString(),
|
|
1009
951
|
"aria-current": inRange ? "date" : void 0
|
|
1010
952
|
};
|
|
1011
953
|
},
|
|
1012
|
-
[
|
|
1013
|
-
ownerState.rangeSelection,
|
|
1014
|
-
ownerState.value,
|
|
1015
|
-
ownerState.viewMonth,
|
|
1016
|
-
hoverMonth
|
|
1017
|
-
]
|
|
954
|
+
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverMonth]
|
|
1018
955
|
),
|
|
1019
956
|
getPickerDayProps: useCallback4(
|
|
1020
957
|
(day) => {
|
|
@@ -1024,23 +961,15 @@ var useCalendar = (ownerState) => {
|
|
|
1024
961
|
const isSelected = !!ownerState.value && (isSameDay(thisDay, ownerState.value[0]) || ownerState.value[1] && isSameDay(thisDay, ownerState.value[1]));
|
|
1025
962
|
const inRange = ownerState.rangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1026
963
|
(hoverDay && isWithinRange(ownerState.value[0], hoverDay, thisDay) || // NOTE: Selected range is included in the range
|
|
1027
|
-
ownerState.value[1] && isWithinRange(
|
|
1028
|
-
ownerState.value[0],
|
|
1029
|
-
ownerState.value[1],
|
|
1030
|
-
thisDay
|
|
1031
|
-
));
|
|
964
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisDay));
|
|
1032
965
|
const handleDayClick = () => {
|
|
1033
966
|
if (ownerState.rangeSelection) {
|
|
1034
967
|
if (!ownerState.value) {
|
|
1035
968
|
ownerState.onChange?.([thisDay, void 0]);
|
|
1036
969
|
} else if (ownerState.value[0] && !ownerState.value[1]) {
|
|
1037
970
|
ownerState.onChange?.([
|
|
1038
|
-
new Date(
|
|
1039
|
-
|
|
1040
|
-
),
|
|
1041
|
-
new Date(
|
|
1042
|
-
Math.max(ownerState.value[0].getTime(), thisDay.getTime())
|
|
1043
|
-
)
|
|
971
|
+
new Date(Math.min(ownerState.value[0].getTime(), thisDay.getTime())),
|
|
972
|
+
new Date(Math.max(ownerState.value[0].getTime(), thisDay.getTime()))
|
|
1044
973
|
]);
|
|
1045
974
|
} else {
|
|
1046
975
|
ownerState.onChange?.([thisDay, void 0]);
|
|
@@ -1089,23 +1018,15 @@ var useCalendar = (ownerState) => {
|
|
|
1089
1018
|
const isSelected = !!ownerState.value && (isSameMonth(thisMonth, ownerState.value[0]) || ownerState.value[1] && isSameMonth(thisMonth, ownerState.value[1]));
|
|
1090
1019
|
const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1091
1020
|
(hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
|
|
1092
|
-
ownerState.value[1] && isWithinRange(
|
|
1093
|
-
ownerState.value[0],
|
|
1094
|
-
ownerState.value[1],
|
|
1095
|
-
thisMonth
|
|
1096
|
-
));
|
|
1021
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisMonth));
|
|
1097
1022
|
const handleMonthClick = () => {
|
|
1098
1023
|
if (isMonthRangeSelection) {
|
|
1099
1024
|
if (!ownerState.value) {
|
|
1100
1025
|
ownerState.onChange?.([thisMonth, void 0]);
|
|
1101
1026
|
} else if (ownerState.value[0] && !ownerState.value[1]) {
|
|
1102
1027
|
ownerState.onChange?.([
|
|
1103
|
-
new Date(
|
|
1104
|
-
|
|
1105
|
-
),
|
|
1106
|
-
new Date(
|
|
1107
|
-
Math.max(ownerState.value[0].getTime(), thisMonth.getTime())
|
|
1108
|
-
)
|
|
1028
|
+
new Date(Math.min(ownerState.value[0].getTime(), thisMonth.getTime())),
|
|
1029
|
+
new Date(Math.max(ownerState.value[0].getTime(), thisMonth.getTime()))
|
|
1109
1030
|
]);
|
|
1110
1031
|
} else {
|
|
1111
1032
|
ownerState.onChange?.([thisMonth, void 0]);
|
|
@@ -1175,15 +1096,13 @@ var CalendarViewContainer = styled5("div", {
|
|
|
1175
1096
|
name: "Calendar",
|
|
1176
1097
|
slot: "viewContainer",
|
|
1177
1098
|
shouldForwardProp: (prop) => prop !== "calendarType"
|
|
1178
|
-
})(
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
})
|
|
1186
|
-
);
|
|
1099
|
+
})(({ theme, calendarType }) => ({
|
|
1100
|
+
paddingLeft: theme.spacing(2),
|
|
1101
|
+
paddingRight: theme.spacing(2),
|
|
1102
|
+
position: "relative",
|
|
1103
|
+
overflow: "hidden",
|
|
1104
|
+
minHeight: calendarType === "datePicker" ? "250px" : "unset"
|
|
1105
|
+
}));
|
|
1187
1106
|
var CalendarViewTable = styled5(motion12.table, {
|
|
1188
1107
|
name: "Calendar",
|
|
1189
1108
|
slot: "viewTable"
|
|
@@ -1362,14 +1281,8 @@ var swipePower = (offset, velocity) => {
|
|
|
1362
1281
|
var PickerDays = (props) => {
|
|
1363
1282
|
const { ownerState } = props;
|
|
1364
1283
|
const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
|
|
1365
|
-
const calendarDates = useMemo4(
|
|
1366
|
-
|
|
1367
|
-
[ownerState.viewMonth]
|
|
1368
|
-
);
|
|
1369
|
-
const weekdayNames = useMemo4(
|
|
1370
|
-
() => getWeekdayNames(ownerState.locale || "default"),
|
|
1371
|
-
[ownerState.locale]
|
|
1372
|
-
);
|
|
1284
|
+
const calendarDates = useMemo4(() => getCalendarDates(ownerState.viewMonth), [ownerState.viewMonth]);
|
|
1285
|
+
const weekdayNames = useMemo4(() => getWeekdayNames(ownerState.locale || "default"), [ownerState.locale]);
|
|
1373
1286
|
return /* @__PURE__ */ React11.createElement(CalendarViewContainer, { calendarType: "datePicker" }, /* @__PURE__ */ React11.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React11.createElement(
|
|
1374
1287
|
CalendarViewTable,
|
|
1375
1288
|
{
|
|
@@ -1399,25 +1312,9 @@ var PickerDays = (props) => {
|
|
|
1399
1312
|
}
|
|
1400
1313
|
}
|
|
1401
1314
|
},
|
|
1402
|
-
/* @__PURE__ */ React11.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ React11.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ React11.createElement("th", null, /* @__PURE__ */ React11.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ React11.createElement(
|
|
1403
|
-
"th",
|
|
1404
|
-
{
|
|
1405
|
-
style: { width: 4 },
|
|
1406
|
-
"aria-hidden": "true",
|
|
1407
|
-
"aria-description": "cell-gap"
|
|
1408
|
-
}
|
|
1409
|
-
))))),
|
|
1315
|
+
/* @__PURE__ */ React11.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ React11.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ React11.createElement("th", null, /* @__PURE__ */ React11.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ React11.createElement("th", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" }))))),
|
|
1410
1316
|
/* @__PURE__ */ React11.createElement(CalendarDayPickerContainer, null, calendarDates.map((weekDates, rowIndex) => /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${rowIndex}` }, /* @__PURE__ */ React11.createElement("tr", null, weekDates.map(
|
|
1411
|
-
(date, i) => date ? /* @__PURE__ */ React11.createElement(Fragment, { key: i }, /* @__PURE__ */ React11.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ React11.createElement(
|
|
1412
|
-
CalendarDay,
|
|
1413
|
-
{
|
|
1414
|
-
size: "sm",
|
|
1415
|
-
variant: "plain",
|
|
1416
|
-
color: "neutral",
|
|
1417
|
-
...getPickerDayProps(date)
|
|
1418
|
-
},
|
|
1419
|
-
date
|
|
1420
|
-
)), i < 6 && /* @__PURE__ */ React11.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ React11.createElement(Fragment, { key: i }, /* @__PURE__ */ React11.createElement("td", null), i < 6 && /* @__PURE__ */ React11.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
|
|
1317
|
+
(date, i) => date ? /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${date}_${i}` }, /* @__PURE__ */ React11.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ React11.createElement(CalendarDay, { size: "sm", variant: "plain", color: "neutral", ...getPickerDayProps(date) }, date)), i < 6 && /* @__PURE__ */ React11.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${i}` }, /* @__PURE__ */ React11.createElement("td", null), i < 6 && /* @__PURE__ */ React11.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
|
|
1421
1318
|
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */ React11.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ React11.createElement("td", { colSpan: 13, style: { height: 4 } })))))
|
|
1422
1319
|
)));
|
|
1423
1320
|
};
|
|
@@ -1435,62 +1332,37 @@ var PickerMonths = (props) => {
|
|
|
1435
1332
|
[[]]
|
|
1436
1333
|
);
|
|
1437
1334
|
const isMonthPicker = !ownerState.views?.find((view) => view === "day");
|
|
1438
|
-
return /* @__PURE__ */ React11.createElement(
|
|
1439
|
-
|
|
1335
|
+
return /* @__PURE__ */ React11.createElement(CalendarViewContainer, { calendarType: isMonthPicker ? "monthPicker" : "datePicker" }, /* @__PURE__ */ React11.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React11.createElement(
|
|
1336
|
+
CalendarViewTable,
|
|
1440
1337
|
{
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
animate: "center",
|
|
1451
|
-
exit: "exit",
|
|
1452
|
-
transition: {
|
|
1453
|
-
x: { type: "spring", stiffness: 300, damping: 30 },
|
|
1454
|
-
opacity: { duration: 0.2 }
|
|
1455
|
-
},
|
|
1456
|
-
drag: "x",
|
|
1457
|
-
dragConstraints: { left: 0, right: 0 },
|
|
1458
|
-
dragElastic: 1,
|
|
1459
|
-
onDragEnd: (e, { offset, velocity }) => {
|
|
1460
|
-
const swipe = swipePower(offset.x, velocity.x);
|
|
1461
|
-
if (swipe < -swipeConfidenceThreshold) {
|
|
1462
|
-
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1463
|
-
date.setMonth(date.getMonth() + 1);
|
|
1464
|
-
ownerState.onMonthChange?.(date);
|
|
1465
|
-
} else if (swipe > swipeConfidenceThreshold) {
|
|
1466
|
-
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1467
|
-
date.setMonth(date.getMonth() - 1);
|
|
1468
|
-
ownerState.onMonthChange?.(date);
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1338
|
+
key: `${ownerState.viewMonth.getFullYear()}_${ownerState.direction}`,
|
|
1339
|
+
custom: ownerState.direction,
|
|
1340
|
+
variants,
|
|
1341
|
+
initial: "enter",
|
|
1342
|
+
animate: "center",
|
|
1343
|
+
exit: "exit",
|
|
1344
|
+
transition: {
|
|
1345
|
+
x: { type: "spring", stiffness: 300, damping: 30 },
|
|
1346
|
+
opacity: { duration: 0.2 }
|
|
1471
1347
|
},
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
ownerState.
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
"td",
|
|
1486
|
-
{
|
|
1487
|
-
style: { width: 4 },
|
|
1488
|
-
"aria-hidden": "true",
|
|
1489
|
-
"aria-description": "cell-gap"
|
|
1348
|
+
drag: "x",
|
|
1349
|
+
dragConstraints: { left: 0, right: 0 },
|
|
1350
|
+
dragElastic: 1,
|
|
1351
|
+
onDragEnd: (e, { offset, velocity }) => {
|
|
1352
|
+
const swipe = swipePower(offset.x, velocity.x);
|
|
1353
|
+
if (swipe < -swipeConfidenceThreshold) {
|
|
1354
|
+
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1355
|
+
date.setMonth(date.getMonth() + 1);
|
|
1356
|
+
ownerState.onMonthChange?.(date);
|
|
1357
|
+
} else if (swipe > swipeConfidenceThreshold) {
|
|
1358
|
+
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1359
|
+
date.setMonth(date.getMonth() - 1);
|
|
1360
|
+
ownerState.onMonthChange?.(date);
|
|
1490
1361
|
}
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1362
|
+
}
|
|
1363
|
+
},
|
|
1364
|
+
/* @__PURE__ */ React11.createElement("tbody", null, chunkedMonths.map((months, i) => /* @__PURE__ */ React11.createElement(Fragment, { key: months.join("_") }, /* @__PURE__ */ React11.createElement("tr", null, months.map((monthIndex, j) => /* @__PURE__ */ React11.createElement(Fragment, { key: monthIndex }, /* @__PURE__ */ React11.createElement(CalendarMonthCell, { ...getMonthCellProps(monthIndex) }, /* @__PURE__ */ React11.createElement(CalendarMonth, { size: "sm", variant: "plain", color: "neutral", ...getPickerMonthProps(monthIndex) }, getMonthNameFromIndex(monthIndex, ownerState.locale))), j < 3 && /* @__PURE__ */ React11.createElement("td", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" })))), i < chunkedMonths.length - 1 && /* @__PURE__ */ React11.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ React11.createElement("td", { colSpan: 7, style: { height: 4 } })))))
|
|
1365
|
+
)));
|
|
1494
1366
|
};
|
|
1495
1367
|
var Calendar = forwardRef4((inProps, ref) => {
|
|
1496
1368
|
const [props, ownerState] = useCalendarProps(inProps);
|
|
@@ -1511,15 +1383,7 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1511
1383
|
...others
|
|
1512
1384
|
} = props;
|
|
1513
1385
|
const { calendarTitle, onPrev, onNext } = useCalendar(ownerState);
|
|
1514
|
-
return /* @__PURE__ */ React11.createElement(CalendarRoot, { ref, ...others }, /* @__PURE__ */ React11.createElement(CalendarHeader, null, /* @__PURE__ */ React11.createElement(
|
|
1515
|
-
IconButton_default,
|
|
1516
|
-
{
|
|
1517
|
-
size: "sm",
|
|
1518
|
-
onClick: onPrev,
|
|
1519
|
-
"aria-label": `Previous ${view === "day" ? "Month" : "Year"}`
|
|
1520
|
-
},
|
|
1521
|
-
/* @__PURE__ */ React11.createElement(ChevronLeftIcon, null)
|
|
1522
|
-
), /* @__PURE__ */ React11.createElement(
|
|
1386
|
+
return /* @__PURE__ */ React11.createElement(CalendarRoot, { ref, ...others }, /* @__PURE__ */ React11.createElement(CalendarHeader, null, /* @__PURE__ */ React11.createElement(IconButton_default, { size: "sm", onClick: onPrev, "aria-label": `Previous ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ React11.createElement(ChevronLeftIcon, null)), /* @__PURE__ */ React11.createElement(
|
|
1523
1387
|
CalendarSwitchViewButton,
|
|
1524
1388
|
{
|
|
1525
1389
|
ownerState,
|
|
@@ -1529,15 +1393,7 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1529
1393
|
"aria-label": "Switch Calendar View"
|
|
1530
1394
|
},
|
|
1531
1395
|
calendarTitle
|
|
1532
|
-
), /* @__PURE__ */ React11.createElement(
|
|
1533
|
-
IconButton_default,
|
|
1534
|
-
{
|
|
1535
|
-
size: "sm",
|
|
1536
|
-
onClick: onNext,
|
|
1537
|
-
"aria-label": `Next ${view === "day" ? "Month" : "Year"}`
|
|
1538
|
-
},
|
|
1539
|
-
/* @__PURE__ */ React11.createElement(ChevronRightIcon, null)
|
|
1540
|
-
)), view === "day" && /* @__PURE__ */ React11.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ React11.createElement(PickerMonths, { ownerState }));
|
|
1396
|
+
), /* @__PURE__ */ React11.createElement(IconButton_default, { size: "sm", onClick: onNext, "aria-label": `Next ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ React11.createElement(ChevronRightIcon, null))), view === "day" && /* @__PURE__ */ React11.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ React11.createElement(PickerMonths, { ownerState }));
|
|
1541
1397
|
});
|
|
1542
1398
|
Calendar.displayName = "Calendar";
|
|
1543
1399
|
|
|
@@ -1681,23 +1537,15 @@ var Input = React14.forwardRef((props, ref) => {
|
|
|
1681
1537
|
...innerProps.slotProps
|
|
1682
1538
|
},
|
|
1683
1539
|
...innerProps,
|
|
1684
|
-
endDecorator: enableClearable ? /* @__PURE__ */ React14.createElement(
|
|
1685
|
-
|
|
1540
|
+
endDecorator: enableClearable ? /* @__PURE__ */ React14.createElement(Stack_default, { gap: 1, direction: "row" }, innerProps.endDecorator, value && /* @__PURE__ */ React14.createElement(
|
|
1541
|
+
IconButton_default,
|
|
1686
1542
|
{
|
|
1687
|
-
|
|
1688
|
-
|
|
1543
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1544
|
+
onClick: handleClear,
|
|
1545
|
+
"aria-label": "Clear"
|
|
1689
1546
|
},
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
IconButton_default,
|
|
1693
|
-
{
|
|
1694
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
1695
|
-
onClick: handleClear,
|
|
1696
|
-
"aria-label": "Clear"
|
|
1697
|
-
},
|
|
1698
|
-
/* @__PURE__ */ React14.createElement(ClearIcon, null)
|
|
1699
|
-
)
|
|
1700
|
-
) : innerProps.endDecorator
|
|
1547
|
+
/* @__PURE__ */ React14.createElement(ClearIcon, null)
|
|
1548
|
+
)) : innerProps.endDecorator
|
|
1701
1549
|
}
|
|
1702
1550
|
);
|
|
1703
1551
|
return /* @__PURE__ */ React14.createElement(
|
|
@@ -1885,25 +1733,23 @@ var useCurrencySetting = (props) => {
|
|
|
1885
1733
|
};
|
|
1886
1734
|
|
|
1887
1735
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1888
|
-
var TextMaskAdapter = React15.forwardRef(
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
}
|
|
1906
|
-
);
|
|
1736
|
+
var TextMaskAdapter = React15.forwardRef(function TextMaskAdapter2(props, ref) {
|
|
1737
|
+
const { onChange, ...innerProps } = props;
|
|
1738
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1739
|
+
NumericFormat,
|
|
1740
|
+
{
|
|
1741
|
+
...innerProps,
|
|
1742
|
+
onValueChange: ({ value }) => {
|
|
1743
|
+
onChange?.({
|
|
1744
|
+
target: { name: props.name, value }
|
|
1745
|
+
});
|
|
1746
|
+
},
|
|
1747
|
+
valueIsNumericString: true,
|
|
1748
|
+
getInputRef: ref,
|
|
1749
|
+
allowNegative: true
|
|
1750
|
+
}
|
|
1751
|
+
);
|
|
1752
|
+
});
|
|
1907
1753
|
var CurrencyInputRoot = styled7(Input_default, {
|
|
1908
1754
|
name: "CurrencyInput",
|
|
1909
1755
|
slot: "root",
|
|
@@ -1926,21 +1772,11 @@ var CurrencyInput = React15.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1926
1772
|
className,
|
|
1927
1773
|
...innerProps
|
|
1928
1774
|
} = props;
|
|
1929
|
-
const {
|
|
1930
|
-
symbol,
|
|
1931
|
-
thousandSeparator,
|
|
1932
|
-
decimalSeparator,
|
|
1933
|
-
placeholder,
|
|
1934
|
-
fixedDecimalScale,
|
|
1935
|
-
decimalScale
|
|
1936
|
-
} = useCurrencySetting(props);
|
|
1775
|
+
const { symbol, thousandSeparator, decimalSeparator, placeholder, fixedDecimalScale, decimalScale } = useCurrencySetting(props);
|
|
1937
1776
|
const [_value, setValue] = useControlledState(
|
|
1938
1777
|
props.value,
|
|
1939
1778
|
props.defaultValue,
|
|
1940
|
-
useCallback6(
|
|
1941
|
-
(value2) => onChange?.({ target: { name, value: value2 } }),
|
|
1942
|
-
[onChange, name]
|
|
1943
|
-
)
|
|
1779
|
+
useCallback6((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
1944
1780
|
);
|
|
1945
1781
|
const value = useMemo5(() => {
|
|
1946
1782
|
if (_value && useMinorUnit) {
|
|
@@ -1954,9 +1790,7 @@ var CurrencyInput = React15.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1954
1790
|
}
|
|
1955
1791
|
return props.max;
|
|
1956
1792
|
}, [props.max, useMinorUnit, decimalScale]);
|
|
1957
|
-
const [isOverLimit, setIsOverLimit] = useState4(
|
|
1958
|
-
!!max && !!value && value > max
|
|
1959
|
-
);
|
|
1793
|
+
const [isOverLimit, setIsOverLimit] = useState4(!!max && !!value && value > max);
|
|
1960
1794
|
const handleChange = useCallback6(
|
|
1961
1795
|
(event) => {
|
|
1962
1796
|
if (event.target.value === "") {
|
|
@@ -1986,9 +1820,9 @@ var CurrencyInput = React15.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1986
1820
|
required,
|
|
1987
1821
|
color: error || isOverLimit ? "danger" : props.color,
|
|
1988
1822
|
label,
|
|
1989
|
-
helperText: isOverLimit ? new IntlMessageFormat2(
|
|
1990
|
-
|
|
1991
|
-
|
|
1823
|
+
helperText: isOverLimit ? new IntlMessageFormat2(`limit: {amount, number, ::currency/${currency} unit-width-narrow}`).format({
|
|
1824
|
+
amount: max
|
|
1825
|
+
}) : helperText,
|
|
1992
1826
|
slotProps: {
|
|
1993
1827
|
input: {
|
|
1994
1828
|
component: TextMaskAdapter,
|
|
@@ -2026,14 +1860,7 @@ import React23, {
|
|
|
2026
1860
|
useLayoutEffect
|
|
2027
1861
|
} from "react";
|
|
2028
1862
|
import { useVirtualizer as useVirtualizer2 } from "@tanstack/react-virtual";
|
|
2029
|
-
import {
|
|
2030
|
-
styled as styled12,
|
|
2031
|
-
LinearProgress,
|
|
2032
|
-
Link,
|
|
2033
|
-
useTheme,
|
|
2034
|
-
buttonClasses,
|
|
2035
|
-
iconButtonClasses
|
|
2036
|
-
} from "@mui/joy";
|
|
1863
|
+
import { styled as styled12, LinearProgress, Link, useTheme, buttonClasses, iconButtonClasses } from "@mui/joy";
|
|
2037
1864
|
import SortIcon from "@mui/icons-material/ArrowUpwardRounded";
|
|
2038
1865
|
|
|
2039
1866
|
// src/components/Sheet/Sheet.tsx
|
|
@@ -2096,20 +1923,14 @@ function TableBody(props) {
|
|
|
2096
1923
|
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
2097
1924
|
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
2098
1925
|
} = props;
|
|
2099
|
-
return /* @__PURE__ */ React16.createElement("tbody", null, rows.map((row, rowIndex) => /* @__PURE__ */ React16.createElement("tr", { key: rowIndex }, showCheckbox && /* @__PURE__ */ React16.createElement(
|
|
1926
|
+
return /* @__PURE__ */ React16.createElement("tbody", null, rows.map((row, rowIndex) => /* @__PURE__ */ React16.createElement("tr", { key: `table-row-${rowIndex}` }, showCheckbox && /* @__PURE__ */ React16.createElement(
|
|
2100
1927
|
"td",
|
|
2101
1928
|
{
|
|
2102
1929
|
style: {
|
|
2103
1930
|
textAlign: "center"
|
|
2104
1931
|
}
|
|
2105
1932
|
},
|
|
2106
|
-
/* @__PURE__ */ React16.createElement(
|
|
2107
|
-
RenderCheckbox,
|
|
2108
|
-
{
|
|
2109
|
-
onChange: (event) => onCheckboxChange?.(event, rowIndex),
|
|
2110
|
-
...checkboxProps
|
|
2111
|
-
}
|
|
2112
|
-
)
|
|
1933
|
+
/* @__PURE__ */ React16.createElement(RenderCheckbox, { onChange: (event) => onCheckboxChange?.(event, rowIndex), ...checkboxProps })
|
|
2113
1934
|
), cellOrder.map((cellKey) => /* @__PURE__ */ React16.createElement(
|
|
2114
1935
|
"td",
|
|
2115
1936
|
{
|
|
@@ -2124,14 +1945,7 @@ function TableBody(props) {
|
|
|
2124
1945
|
TableBody.displayName = "TableBody";
|
|
2125
1946
|
|
|
2126
1947
|
// src/components/DatePicker/DatePicker.tsx
|
|
2127
|
-
import React17, {
|
|
2128
|
-
forwardRef as forwardRef6,
|
|
2129
|
-
useCallback as useCallback7,
|
|
2130
|
-
useEffect as useEffect3,
|
|
2131
|
-
useImperativeHandle,
|
|
2132
|
-
useRef as useRef3,
|
|
2133
|
-
useState as useState5
|
|
2134
|
-
} from "react";
|
|
1948
|
+
import React17, { forwardRef as forwardRef6, useCallback as useCallback7, useEffect as useEffect3, useImperativeHandle, useRef as useRef3, useState as useState5 } from "react";
|
|
2135
1949
|
import { IMaskInput, IMask } from "react-imask";
|
|
2136
1950
|
import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
|
|
2137
1951
|
import { styled as styled9, useThemeProps as useThemeProps4 } from "@mui/joy";
|
|
@@ -2161,9 +1975,7 @@ var CalendarButton = styled9(IconButton_default, {
|
|
|
2161
1975
|
"&:focus": {
|
|
2162
1976
|
"--Icon-color": "currentColor",
|
|
2163
1977
|
outlineOffset: `${theme.getCssVar("focus-thickness")}`,
|
|
2164
|
-
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar(
|
|
2165
|
-
"palette-focusVisible"
|
|
2166
|
-
)}`
|
|
1978
|
+
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
2167
1979
|
}
|
|
2168
1980
|
}));
|
|
2169
1981
|
var StyledPopper = styled9(Popper2, {
|
|
@@ -2197,9 +2009,7 @@ var validValueFormat = (value, format) => {
|
|
|
2197
2009
|
if (value !== formatValueString(parsedValue, format)) {
|
|
2198
2010
|
return false;
|
|
2199
2011
|
}
|
|
2200
|
-
const regex = new RegExp(
|
|
2201
|
-
`^${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")}$`
|
|
2202
|
-
);
|
|
2012
|
+
const regex = new RegExp(`^${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")}$`);
|
|
2203
2013
|
return regex.test(value);
|
|
2204
2014
|
} catch (e) {
|
|
2205
2015
|
return false;
|
|
@@ -2240,276 +2050,259 @@ function parseDate(dateString, format) {
|
|
|
2240
2050
|
var formatToPattern = (format) => {
|
|
2241
2051
|
return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
2242
2052
|
};
|
|
2243
|
-
var TextMaskAdapter3 = React17.forwardRef(
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
maxLength: 2
|
|
2260
|
-
},
|
|
2261
|
-
M: {
|
|
2262
|
-
mask: IMask.MaskedRange,
|
|
2263
|
-
from: 1,
|
|
2264
|
-
to: 12,
|
|
2265
|
-
maxLength: 2
|
|
2266
|
-
},
|
|
2267
|
-
Y: {
|
|
2268
|
-
mask: IMask.MaskedRange,
|
|
2269
|
-
from: 1900,
|
|
2270
|
-
to: 9999,
|
|
2271
|
-
maxLength: 4
|
|
2272
|
-
}
|
|
2053
|
+
var TextMaskAdapter3 = React17.forwardRef(function TextMaskAdapter4(props, ref) {
|
|
2054
|
+
const { onChange, format, ...other } = props;
|
|
2055
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2056
|
+
IMaskInput,
|
|
2057
|
+
{
|
|
2058
|
+
...other,
|
|
2059
|
+
inputRef: ref,
|
|
2060
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
2061
|
+
mask: Date,
|
|
2062
|
+
pattern: formatToPattern(format),
|
|
2063
|
+
blocks: {
|
|
2064
|
+
D: {
|
|
2065
|
+
mask: IMask.MaskedRange,
|
|
2066
|
+
from: 1,
|
|
2067
|
+
to: 31,
|
|
2068
|
+
maxLength: 2
|
|
2273
2069
|
},
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2070
|
+
M: {
|
|
2071
|
+
mask: IMask.MaskedRange,
|
|
2072
|
+
from: 1,
|
|
2073
|
+
to: 12,
|
|
2074
|
+
maxLength: 2
|
|
2075
|
+
},
|
|
2076
|
+
Y: {
|
|
2077
|
+
mask: IMask.MaskedRange,
|
|
2078
|
+
from: 1900,
|
|
2079
|
+
to: 9999,
|
|
2080
|
+
maxLength: 4
|
|
2081
|
+
}
|
|
2082
|
+
},
|
|
2083
|
+
format: (date) => formatValueString(date, format),
|
|
2084
|
+
parse: (str) => parseDate(str, format),
|
|
2085
|
+
autofix: "pad",
|
|
2086
|
+
overwrite: true
|
|
2087
|
+
}
|
|
2088
|
+
);
|
|
2089
|
+
});
|
|
2090
|
+
var DatePicker = forwardRef6((inProps, ref) => {
|
|
2091
|
+
const props = useThemeProps4({ props: inProps, name: "DatePicker" });
|
|
2092
|
+
const {
|
|
2093
|
+
onChange,
|
|
2094
|
+
disabled,
|
|
2095
|
+
label,
|
|
2096
|
+
error,
|
|
2097
|
+
helperText,
|
|
2098
|
+
minDate,
|
|
2099
|
+
maxDate,
|
|
2100
|
+
disableFuture,
|
|
2101
|
+
disablePast,
|
|
2102
|
+
required,
|
|
2103
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
2104
|
+
sx,
|
|
2105
|
+
className,
|
|
2106
|
+
format = "YYYY/MM/DD",
|
|
2107
|
+
displayFormat = "YYYY/MM/DD",
|
|
2108
|
+
size,
|
|
2109
|
+
inputReadOnly,
|
|
2110
|
+
hideClearButton,
|
|
2111
|
+
readOnly,
|
|
2112
|
+
shouldDisableDate,
|
|
2113
|
+
...innerProps
|
|
2114
|
+
} = props;
|
|
2115
|
+
const innerRef = useRef3(null);
|
|
2116
|
+
const buttonRef = useRef3(null);
|
|
2117
|
+
const [value, setValue] = useControlledState(
|
|
2118
|
+
props.value,
|
|
2119
|
+
props.defaultValue || "",
|
|
2120
|
+
useCallback7((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
2121
|
+
);
|
|
2122
|
+
const [displayValue, setDisplayValue] = useState5(
|
|
2123
|
+
() => value ? formatValueString(parseDate(value, format), displayFormat) : ""
|
|
2124
|
+
);
|
|
2125
|
+
const [anchorEl, setAnchorEl] = useState5(null);
|
|
2126
|
+
const open = Boolean(anchorEl);
|
|
2127
|
+
useEffect3(() => {
|
|
2128
|
+
if (!anchorEl) {
|
|
2129
|
+
innerRef.current?.blur();
|
|
2130
|
+
}
|
|
2131
|
+
}, [anchorEl, innerRef]);
|
|
2132
|
+
useEffect3(() => {
|
|
2133
|
+
if (value === "") {
|
|
2134
|
+
setDisplayValue("");
|
|
2135
|
+
return;
|
|
2136
|
+
}
|
|
2137
|
+
const formattedValue = formatValueString(parseDate(value, format), displayFormat);
|
|
2138
|
+
if (validValueFormat(formattedValue, displayFormat) && formattedValue !== displayValue) {
|
|
2139
|
+
setDisplayValue(formattedValue);
|
|
2140
|
+
}
|
|
2141
|
+
}, [displayFormat, displayValue, format, value]);
|
|
2142
|
+
useImperativeHandle(ref, () => innerRef.current, [innerRef]);
|
|
2143
|
+
const handleChange = useCallback7(
|
|
2144
|
+
(event) => {
|
|
2145
|
+
const value2 = event.target.value;
|
|
2146
|
+
setDisplayValue(value2 ? formatValueString(parseDate(value2, format), displayFormat) : value2);
|
|
2147
|
+
setValue(value2);
|
|
2148
|
+
},
|
|
2149
|
+
[displayFormat, format, setValue]
|
|
2150
|
+
);
|
|
2151
|
+
const handleDisplayInputChange = useCallback7(
|
|
2152
|
+
(event) => {
|
|
2153
|
+
if (event.target.value === "") {
|
|
2154
|
+
handleChange({
|
|
2155
|
+
target: {
|
|
2156
|
+
name: props.name,
|
|
2157
|
+
value: ""
|
|
2158
|
+
}
|
|
2159
|
+
});
|
|
2331
2160
|
return;
|
|
2332
2161
|
}
|
|
2333
|
-
const
|
|
2334
|
-
|
|
2335
|
-
displayFormat
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2162
|
+
const isValidDisplayValue = validValueFormat(event.target.value, displayFormat);
|
|
2163
|
+
if (isValidDisplayValue) {
|
|
2164
|
+
const parsedDate = parseDate(event.target.value, displayFormat);
|
|
2165
|
+
const formattedValue = formatValueString(parsedDate, format);
|
|
2166
|
+
handleChange({
|
|
2167
|
+
target: {
|
|
2168
|
+
name: props.name,
|
|
2169
|
+
value: formattedValue
|
|
2170
|
+
}
|
|
2171
|
+
});
|
|
2339
2172
|
}
|
|
2340
|
-
},
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
(event)
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
)
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2173
|
+
},
|
|
2174
|
+
[displayFormat, format, handleChange, props.name]
|
|
2175
|
+
);
|
|
2176
|
+
const handleCalendarToggle = useCallback7(
|
|
2177
|
+
(event) => {
|
|
2178
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2179
|
+
setTimeout(() => {
|
|
2180
|
+
innerRef.current?.focus();
|
|
2181
|
+
}, 0);
|
|
2182
|
+
},
|
|
2183
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
2184
|
+
);
|
|
2185
|
+
const handleInputMouseDown = useCallback7(
|
|
2186
|
+
(event) => {
|
|
2187
|
+
if (inputReadOnly) {
|
|
2188
|
+
event.preventDefault();
|
|
2189
|
+
buttonRef.current?.focus();
|
|
2190
|
+
}
|
|
2191
|
+
},
|
|
2192
|
+
[inputReadOnly, buttonRef]
|
|
2193
|
+
);
|
|
2194
|
+
return /* @__PURE__ */ React17.createElement(DatePickerRoot, null, /* @__PURE__ */ React17.createElement(FocusTrap, { open: true }, /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
2195
|
+
Input_default,
|
|
2196
|
+
{
|
|
2197
|
+
...innerProps,
|
|
2198
|
+
color: error ? "danger" : innerProps.color,
|
|
2199
|
+
ref: innerRef,
|
|
2200
|
+
size,
|
|
2201
|
+
value: displayValue,
|
|
2202
|
+
onChange: handleDisplayInputChange,
|
|
2203
|
+
placeholder: displayFormat,
|
|
2204
|
+
disabled,
|
|
2205
|
+
required,
|
|
2206
|
+
error,
|
|
2207
|
+
slotProps: {
|
|
2208
|
+
input: {
|
|
2209
|
+
component: TextMaskAdapter3,
|
|
2210
|
+
ref: innerRef,
|
|
2211
|
+
format: displayFormat,
|
|
2212
|
+
sx: {
|
|
2213
|
+
"&:hover": {
|
|
2214
|
+
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
2361
2215
|
}
|
|
2362
|
-
}
|
|
2363
|
-
|
|
2216
|
+
},
|
|
2217
|
+
onMouseDown: handleInputMouseDown
|
|
2364
2218
|
}
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2219
|
+
},
|
|
2220
|
+
className,
|
|
2221
|
+
sx,
|
|
2222
|
+
endDecorator: /* @__PURE__ */ React17.createElement(
|
|
2223
|
+
CalendarButton,
|
|
2224
|
+
{
|
|
2225
|
+
ref: buttonRef,
|
|
2226
|
+
variant: "plain",
|
|
2227
|
+
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
2228
|
+
"aria-label": "Toggle Calendar",
|
|
2229
|
+
"aria-controls": "date-picker-popper",
|
|
2230
|
+
"aria-haspopup": "dialog",
|
|
2231
|
+
"aria-expanded": open,
|
|
2232
|
+
disabled
|
|
2233
|
+
},
|
|
2234
|
+
/* @__PURE__ */ React17.createElement(CalendarTodayIcon, null)
|
|
2235
|
+
),
|
|
2236
|
+
label,
|
|
2237
|
+
helperText,
|
|
2238
|
+
readOnly: readOnly || inputReadOnly
|
|
2239
|
+
}
|
|
2240
|
+
), open && /* @__PURE__ */ React17.createElement(ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React17.createElement(
|
|
2241
|
+
StyledPopper,
|
|
2242
|
+
{
|
|
2243
|
+
id: "date-picker-popper",
|
|
2244
|
+
open: true,
|
|
2245
|
+
anchorEl,
|
|
2246
|
+
placement: "bottom-end",
|
|
2247
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
2248
|
+
modifiers: [
|
|
2249
|
+
{
|
|
2250
|
+
name: "offset",
|
|
2251
|
+
options: {
|
|
2252
|
+
offset: [4, 4]
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
],
|
|
2256
|
+
"aria-label": "Calendar Tooltip",
|
|
2257
|
+
"aria-expanded": open
|
|
2258
|
+
},
|
|
2259
|
+
/* @__PURE__ */ React17.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React17.createElement(
|
|
2260
|
+
Calendar_default,
|
|
2261
|
+
{
|
|
2262
|
+
value: value && !Number.isNaN(parseDate(value, format).getTime()) ? [parseDate(value, format), void 0] : void 0,
|
|
2263
|
+
onChange: ([date]) => {
|
|
2372
2264
|
handleChange({
|
|
2373
2265
|
target: {
|
|
2374
2266
|
name: props.name,
|
|
2375
|
-
value:
|
|
2267
|
+
value: formatValueString(date, format)
|
|
2376
2268
|
}
|
|
2377
2269
|
});
|
|
2378
|
-
|
|
2379
|
-
},
|
|
2380
|
-
[displayFormat, format, handleChange, props.name]
|
|
2381
|
-
);
|
|
2382
|
-
const handleCalendarToggle = useCallback7(
|
|
2383
|
-
(event) => {
|
|
2384
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2385
|
-
setTimeout(() => {
|
|
2386
|
-
innerRef.current?.focus();
|
|
2387
|
-
}, 0);
|
|
2388
|
-
},
|
|
2389
|
-
[anchorEl, setAnchorEl, innerRef]
|
|
2390
|
-
);
|
|
2391
|
-
const handleInputMouseDown = useCallback7(
|
|
2392
|
-
(event) => {
|
|
2393
|
-
if (inputReadOnly) {
|
|
2394
|
-
event.preventDefault();
|
|
2395
|
-
buttonRef.current?.focus();
|
|
2396
|
-
}
|
|
2397
|
-
},
|
|
2398
|
-
[inputReadOnly, buttonRef]
|
|
2399
|
-
);
|
|
2400
|
-
return /* @__PURE__ */ React17.createElement(DatePickerRoot, null, /* @__PURE__ */ React17.createElement(FocusTrap, { open: true }, /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
2401
|
-
Input_default,
|
|
2402
|
-
{
|
|
2403
|
-
...innerProps,
|
|
2404
|
-
color: error ? "danger" : innerProps.color,
|
|
2405
|
-
ref: innerRef,
|
|
2406
|
-
size,
|
|
2407
|
-
value: displayValue,
|
|
2408
|
-
onChange: handleDisplayInputChange,
|
|
2409
|
-
placeholder: displayFormat,
|
|
2410
|
-
disabled,
|
|
2411
|
-
required,
|
|
2412
|
-
error,
|
|
2413
|
-
slotProps: {
|
|
2414
|
-
input: {
|
|
2415
|
-
component: TextMaskAdapter3,
|
|
2416
|
-
ref: innerRef,
|
|
2417
|
-
format: displayFormat,
|
|
2418
|
-
sx: {
|
|
2419
|
-
"&:hover": {
|
|
2420
|
-
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
2421
|
-
}
|
|
2422
|
-
},
|
|
2423
|
-
onMouseDown: handleInputMouseDown
|
|
2424
|
-
}
|
|
2270
|
+
setAnchorEl(null);
|
|
2425
2271
|
},
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
ref: buttonRef,
|
|
2432
|
-
variant: "plain",
|
|
2433
|
-
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
2434
|
-
"aria-label": "Toggle Calendar",
|
|
2435
|
-
"aria-controls": "date-picker-popper",
|
|
2436
|
-
"aria-haspopup": "dialog",
|
|
2437
|
-
"aria-expanded": open,
|
|
2438
|
-
disabled
|
|
2439
|
-
},
|
|
2440
|
-
/* @__PURE__ */ React17.createElement(CalendarTodayIcon, null)
|
|
2441
|
-
),
|
|
2442
|
-
label,
|
|
2443
|
-
helperText,
|
|
2444
|
-
readOnly: readOnly || inputReadOnly
|
|
2272
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
2273
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
2274
|
+
disableFuture,
|
|
2275
|
+
disablePast,
|
|
2276
|
+
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0
|
|
2445
2277
|
}
|
|
2446
|
-
),
|
|
2447
|
-
|
|
2278
|
+
), !hideClearButton && /* @__PURE__ */ React17.createElement(
|
|
2279
|
+
DialogActions_default,
|
|
2448
2280
|
{
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
placement: "bottom-end",
|
|
2453
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
2454
|
-
modifiers: [
|
|
2455
|
-
{
|
|
2456
|
-
name: "offset",
|
|
2457
|
-
options: {
|
|
2458
|
-
offset: [4, 4]
|
|
2459
|
-
}
|
|
2460
|
-
}
|
|
2461
|
-
],
|
|
2462
|
-
"aria-label": "Calendar Tooltip",
|
|
2463
|
-
"aria-expanded": open
|
|
2281
|
+
sx: {
|
|
2282
|
+
p: 1
|
|
2283
|
+
}
|
|
2464
2284
|
},
|
|
2465
|
-
/* @__PURE__ */ React17.createElement(
|
|
2466
|
-
|
|
2285
|
+
/* @__PURE__ */ React17.createElement(
|
|
2286
|
+
Button_default,
|
|
2467
2287
|
{
|
|
2468
|
-
|
|
2469
|
-
|
|
2288
|
+
size,
|
|
2289
|
+
variant: "plain",
|
|
2290
|
+
color: "neutral",
|
|
2291
|
+
onClick: () => {
|
|
2470
2292
|
handleChange({
|
|
2471
2293
|
target: {
|
|
2472
2294
|
name: props.name,
|
|
2473
|
-
value:
|
|
2295
|
+
value: ""
|
|
2474
2296
|
}
|
|
2475
2297
|
});
|
|
2476
2298
|
setAnchorEl(null);
|
|
2477
|
-
},
|
|
2478
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
2479
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
2480
|
-
disableFuture,
|
|
2481
|
-
disablePast,
|
|
2482
|
-
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0
|
|
2483
|
-
}
|
|
2484
|
-
), !hideClearButton && /* @__PURE__ */ React17.createElement(
|
|
2485
|
-
DialogActions_default,
|
|
2486
|
-
{
|
|
2487
|
-
sx: {
|
|
2488
|
-
p: 1
|
|
2489
2299
|
}
|
|
2490
2300
|
},
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
color: "neutral",
|
|
2497
|
-
onClick: () => {
|
|
2498
|
-
handleChange({
|
|
2499
|
-
target: {
|
|
2500
|
-
name: props.name,
|
|
2501
|
-
value: ""
|
|
2502
|
-
}
|
|
2503
|
-
});
|
|
2504
|
-
setAnchorEl(null);
|
|
2505
|
-
}
|
|
2506
|
-
},
|
|
2507
|
-
"Clear"
|
|
2508
|
-
)
|
|
2509
|
-
))
|
|
2510
|
-
)))));
|
|
2511
|
-
}
|
|
2512
|
-
);
|
|
2301
|
+
"Clear"
|
|
2302
|
+
)
|
|
2303
|
+
))
|
|
2304
|
+
)))));
|
|
2305
|
+
});
|
|
2513
2306
|
|
|
2514
2307
|
// src/components/DatePicker/index.ts
|
|
2515
2308
|
var DatePicker_default = DatePicker;
|
|
@@ -2570,10 +2363,7 @@ var Textarea_default = Textarea;
|
|
|
2570
2363
|
|
|
2571
2364
|
// src/components/Select/Select.tsx
|
|
2572
2365
|
import React19, { useMemo as useMemo7 } from "react";
|
|
2573
|
-
import {
|
|
2574
|
-
Select as JoySelect,
|
|
2575
|
-
Option as JoyOption
|
|
2576
|
-
} from "@mui/joy";
|
|
2366
|
+
import { Select as JoySelect, Option as JoyOption } from "@mui/joy";
|
|
2577
2367
|
import { motion as motion19 } from "framer-motion";
|
|
2578
2368
|
var MotionOption = motion19(JoyOption);
|
|
2579
2369
|
var Option = MotionOption;
|
|
@@ -2745,18 +2535,9 @@ function Pagination(props) {
|
|
|
2745
2535
|
setPaginationModel({ ...paginationModel, page: newPage });
|
|
2746
2536
|
};
|
|
2747
2537
|
const firstPage = 1;
|
|
2748
|
-
const lastPage = Math.max(
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
);
|
|
2752
|
-
const beforePages = [
|
|
2753
|
-
paginationModel.page - 2,
|
|
2754
|
-
paginationModel.page - 1
|
|
2755
|
-
].filter((p) => p > 1);
|
|
2756
|
-
const afterPages = [
|
|
2757
|
-
paginationModel.page + 1,
|
|
2758
|
-
paginationModel.page + 2
|
|
2759
|
-
].filter((p) => p <= lastPage - 1);
|
|
2538
|
+
const lastPage = Math.max(firstPage, Math.ceil(rowCount / paginationModel.pageSize));
|
|
2539
|
+
const beforePages = [paginationModel.page - 2, paginationModel.page - 1].filter((p) => p > 1);
|
|
2540
|
+
const afterPages = [paginationModel.page + 1, paginationModel.page + 2].filter((p) => p <= lastPage - 1);
|
|
2760
2541
|
const isMoreAfterPages = lastPage > 1 && paginationModel.page < lastPage - 3;
|
|
2761
2542
|
const isMoreBeforePages = lastPage > 1 && paginationModel.page > 4;
|
|
2762
2543
|
useEffect4(() => {
|
|
@@ -2775,16 +2556,7 @@ function Pagination(props) {
|
|
|
2775
2556
|
"aria-label": "Previous page"
|
|
2776
2557
|
},
|
|
2777
2558
|
/* @__PURE__ */ React21.createElement(PreviousIcon, null)
|
|
2778
|
-
), paginationModel.page !== firstPage && /* @__PURE__ */ React21.createElement(
|
|
2779
|
-
PaginationButton,
|
|
2780
|
-
{
|
|
2781
|
-
size,
|
|
2782
|
-
variant: "plain",
|
|
2783
|
-
color: "neutral",
|
|
2784
|
-
onClick: () => handlePageChange(firstPage)
|
|
2785
|
-
},
|
|
2786
|
-
firstPage
|
|
2787
|
-
), isMoreBeforePages && /* @__PURE__ */ React21.createElement(
|
|
2559
|
+
), paginationModel.page !== firstPage && /* @__PURE__ */ React21.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(firstPage) }, firstPage), isMoreBeforePages && /* @__PURE__ */ React21.createElement(
|
|
2788
2560
|
PaginationButton,
|
|
2789
2561
|
{
|
|
2790
2562
|
size,
|
|
@@ -2794,27 +2566,7 @@ function Pagination(props) {
|
|
|
2794
2566
|
"aria-label": "More previous pages"
|
|
2795
2567
|
},
|
|
2796
2568
|
"..."
|
|
2797
|
-
), beforePages.map((p) => /* @__PURE__ */ React21.createElement(
|
|
2798
|
-
PaginationButton,
|
|
2799
|
-
{
|
|
2800
|
-
key: p,
|
|
2801
|
-
size,
|
|
2802
|
-
variant: "plain",
|
|
2803
|
-
color: "neutral",
|
|
2804
|
-
onClick: () => handlePageChange(p)
|
|
2805
|
-
},
|
|
2806
|
-
p
|
|
2807
|
-
)), /* @__PURE__ */ React21.createElement(PaginationButton, { active: "active", size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ React21.createElement(
|
|
2808
|
-
PaginationButton,
|
|
2809
|
-
{
|
|
2810
|
-
key: p,
|
|
2811
|
-
size,
|
|
2812
|
-
variant: "plain",
|
|
2813
|
-
color: "neutral",
|
|
2814
|
-
onClick: () => handlePageChange(p)
|
|
2815
|
-
},
|
|
2816
|
-
p
|
|
2817
|
-
)), isMoreAfterPages && /* @__PURE__ */ React21.createElement(
|
|
2569
|
+
), beforePages.map((p) => /* @__PURE__ */ React21.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), /* @__PURE__ */ React21.createElement(PaginationButton, { active: "active", size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ React21.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), isMoreAfterPages && /* @__PURE__ */ React21.createElement(
|
|
2818
2570
|
PaginationButton,
|
|
2819
2571
|
{
|
|
2820
2572
|
size,
|
|
@@ -2824,16 +2576,7 @@ function Pagination(props) {
|
|
|
2824
2576
|
onClick: () => handlePageChange(paginationModel.page + 3)
|
|
2825
2577
|
},
|
|
2826
2578
|
"..."
|
|
2827
|
-
), paginationModel.page !== lastPage && /* @__PURE__ */ React21.createElement(
|
|
2828
|
-
PaginationButton,
|
|
2829
|
-
{
|
|
2830
|
-
size,
|
|
2831
|
-
variant: "plain",
|
|
2832
|
-
color: "neutral",
|
|
2833
|
-
onClick: () => handlePageChange(lastPage)
|
|
2834
|
-
},
|
|
2835
|
-
lastPage
|
|
2836
|
-
), /* @__PURE__ */ React21.createElement(
|
|
2579
|
+
), paginationModel.page !== lastPage && /* @__PURE__ */ React21.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(lastPage) }, lastPage), /* @__PURE__ */ React21.createElement(
|
|
2837
2580
|
PaginationIconButton,
|
|
2838
2581
|
{
|
|
2839
2582
|
size,
|
|
@@ -2853,10 +2596,7 @@ var Pagination_default = Pagination;
|
|
|
2853
2596
|
|
|
2854
2597
|
// src/components/InfoSign/InfoSign.tsx
|
|
2855
2598
|
import React22 from "react";
|
|
2856
|
-
import {
|
|
2857
|
-
styled as styled11,
|
|
2858
|
-
tooltipClasses
|
|
2859
|
-
} from "@mui/joy";
|
|
2599
|
+
import { styled as styled11, tooltipClasses } from "@mui/joy";
|
|
2860
2600
|
import MuiInfoIcon from "@mui/icons-material/Info";
|
|
2861
2601
|
var InfoIcon = styled11(MuiInfoIcon, {
|
|
2862
2602
|
name: "InfoSign",
|
|
@@ -2878,7 +2618,7 @@ function InfoSign(props) {
|
|
|
2878
2618
|
maxWidth: "320px"
|
|
2879
2619
|
}
|
|
2880
2620
|
},
|
|
2881
|
-
title: message?.split("\n").map((line, i) => /* @__PURE__ */ React22.createElement("div", { key: i }, line))
|
|
2621
|
+
title: message?.split("\n").map((line, i) => /* @__PURE__ */ React22.createElement("div", { key: `info-sign-${i}` }, line))
|
|
2882
2622
|
},
|
|
2883
2623
|
/* @__PURE__ */ React22.createElement(InfoIcon, null)
|
|
2884
2624
|
);
|
|
@@ -2912,15 +2652,7 @@ var TextEllipsis = ({ children }) => {
|
|
|
2912
2652
|
}, [children]);
|
|
2913
2653
|
const content = /* @__PURE__ */ React23.createElement(EllipsisDiv, { ref: textRef }, children);
|
|
2914
2654
|
if (showTooltip) {
|
|
2915
|
-
return /* @__PURE__ */ React23.createElement(
|
|
2916
|
-
Tooltip_default,
|
|
2917
|
-
{
|
|
2918
|
-
title: children,
|
|
2919
|
-
placement: "top",
|
|
2920
|
-
onClick: (e) => e.stopPropagation()
|
|
2921
|
-
},
|
|
2922
|
-
content
|
|
2923
|
-
);
|
|
2655
|
+
return /* @__PURE__ */ React23.createElement(Tooltip_default, { title: children, placement: "top", onClick: (e) => e.stopPropagation() }, content);
|
|
2924
2656
|
}
|
|
2925
2657
|
return content;
|
|
2926
2658
|
};
|
|
@@ -3104,10 +2836,7 @@ var HeadCell = (props) => {
|
|
|
3104
2836
|
() => `${tableId}_header_${headerName ?? field}`.trim(),
|
|
3105
2837
|
[tableId, headerName, field]
|
|
3106
2838
|
);
|
|
3107
|
-
const resizer = useMemo8(
|
|
3108
|
-
() => resizable ?? true ? Resizer(ref) : null,
|
|
3109
|
-
[resizable, ref]
|
|
3110
|
-
);
|
|
2839
|
+
const resizer = useMemo8(() => resizable ?? true ? Resizer(ref) : null, [resizable, ref]);
|
|
3111
2840
|
const style = useMemo8(
|
|
3112
2841
|
() => ({
|
|
3113
2842
|
width,
|
|
@@ -3122,17 +2851,7 @@ var HeadCell = (props) => {
|
|
|
3122
2851
|
// TODO: multi-sort때문에 일단 추가한 property, joy-ui에서는 multi-sort시 th에 user-select: none을 적용하고 툴팁을 띄워준다.
|
|
3123
2852
|
userSelect: "none"
|
|
3124
2853
|
}),
|
|
3125
|
-
[
|
|
3126
|
-
isPinned,
|
|
3127
|
-
maxWidth,
|
|
3128
|
-
minWidth,
|
|
3129
|
-
pinnedEndPosition,
|
|
3130
|
-
pinnedStartPosition,
|
|
3131
|
-
sortable,
|
|
3132
|
-
stickyHeader,
|
|
3133
|
-
theme,
|
|
3134
|
-
width
|
|
3135
|
-
]
|
|
2854
|
+
[isPinned, maxWidth, minWidth, pinnedEndPosition, pinnedStartPosition, sortable, stickyHeader, theme, width]
|
|
3136
2855
|
);
|
|
3137
2856
|
const textAlign = getTextAlign(props);
|
|
3138
2857
|
const initialSort = sortOrder[0];
|
|
@@ -3189,20 +2908,7 @@ var HeadCell = (props) => {
|
|
|
3189
2908
|
whileHover: "hover",
|
|
3190
2909
|
initial: "initial"
|
|
3191
2910
|
},
|
|
3192
|
-
/* @__PURE__ */ React23.createElement(
|
|
3193
|
-
Stack_default,
|
|
3194
|
-
{
|
|
3195
|
-
gap: 1,
|
|
3196
|
-
direction: "row",
|
|
3197
|
-
justifyContent: textAlign,
|
|
3198
|
-
alignItems: "center"
|
|
3199
|
-
},
|
|
3200
|
-
textAlign === "end" && sortIcon,
|
|
3201
|
-
textAlign === "end" && infoSign,
|
|
3202
|
-
/* @__PURE__ */ React23.createElement(TextEllipsis, null, headerName ?? field, editMode && required && /* @__PURE__ */ React23.createElement(Asterisk, null, "*")),
|
|
3203
|
-
textAlign === "start" && infoSign,
|
|
3204
|
-
textAlign === "start" && sortIcon
|
|
3205
|
-
),
|
|
2911
|
+
/* @__PURE__ */ React23.createElement(Stack_default, { gap: 1, direction: "row", justifyContent: textAlign, alignItems: "center" }, textAlign === "end" && sortIcon, textAlign === "end" && infoSign, /* @__PURE__ */ React23.createElement(TextEllipsis, null, headerName ?? field, editMode && required && /* @__PURE__ */ React23.createElement(Asterisk, null, "*")), textAlign === "start" && infoSign, textAlign === "start" && sortIcon),
|
|
3206
2912
|
resizer
|
|
3207
2913
|
);
|
|
3208
2914
|
};
|
|
@@ -3221,7 +2927,10 @@ var BodyCell = (props) => {
|
|
|
3221
2927
|
pinnedStartPosition,
|
|
3222
2928
|
pinnedEndPosition,
|
|
3223
2929
|
row,
|
|
3224
|
-
rowId
|
|
2930
|
+
rowId,
|
|
2931
|
+
cellClassName,
|
|
2932
|
+
onCellEditStart,
|
|
2933
|
+
onCellEditStop
|
|
3225
2934
|
} = props;
|
|
3226
2935
|
const theme = useTheme();
|
|
3227
2936
|
const [value, setValue] = useState6(row[field]);
|
|
@@ -3230,20 +2939,22 @@ var BodyCell = (props) => {
|
|
|
3230
2939
|
() => ({
|
|
3231
2940
|
row,
|
|
3232
2941
|
value,
|
|
3233
|
-
id: rowId
|
|
2942
|
+
id: rowId,
|
|
2943
|
+
field
|
|
3234
2944
|
}),
|
|
3235
|
-
[row, rowId, value]
|
|
2945
|
+
[row, rowId, value, field]
|
|
3236
2946
|
);
|
|
3237
2947
|
const editMode = useMemo8(
|
|
3238
2948
|
() => !!(props.editMode && (typeof isCellEditable === "function" ? isCellEditable(params) : isCellEditable ?? true)),
|
|
3239
2949
|
[props.editMode, isCellEditable, params]
|
|
3240
2950
|
);
|
|
2951
|
+
const propsComponentProps = "componentProps" in props ? props.componentProps : null;
|
|
3241
2952
|
const componentProps = useMemo8(
|
|
3242
2953
|
() => ({
|
|
3243
|
-
..."componentProps" in props && (typeof
|
|
2954
|
+
..."componentProps" in props && (typeof propsComponentProps === "function" ? propsComponentProps(params) : propsComponentProps || {}),
|
|
3244
2955
|
size: "sm"
|
|
3245
2956
|
}),
|
|
3246
|
-
[
|
|
2957
|
+
[props, propsComponentProps, params]
|
|
3247
2958
|
);
|
|
3248
2959
|
const editModeComponentProps = useMemo8(
|
|
3249
2960
|
() => ({
|
|
@@ -3252,7 +2963,7 @@ var BodyCell = (props) => {
|
|
|
3252
2963
|
componentProps.onChange?.(e);
|
|
3253
2964
|
setValue(e.target.value);
|
|
3254
2965
|
if (type === "select") {
|
|
3255
|
-
|
|
2966
|
+
onCellEditStop?.({
|
|
3256
2967
|
...params,
|
|
3257
2968
|
originalRow: row,
|
|
3258
2969
|
row: {
|
|
@@ -3265,7 +2976,7 @@ var BodyCell = (props) => {
|
|
|
3265
2976
|
},
|
|
3266
2977
|
onFocus: (e) => {
|
|
3267
2978
|
componentProps.onFocus?.(e);
|
|
3268
|
-
|
|
2979
|
+
onCellEditStart?.({
|
|
3269
2980
|
...params,
|
|
3270
2981
|
originalRow: row,
|
|
3271
2982
|
row: {
|
|
@@ -3278,7 +2989,7 @@ var BodyCell = (props) => {
|
|
|
3278
2989
|
onBlur: (e) => {
|
|
3279
2990
|
componentProps.onBlur?.(e);
|
|
3280
2991
|
if (type && ["number", "text", "longText", "currency", "date"].includes(type)) {
|
|
3281
|
-
|
|
2992
|
+
onCellEditStop?.({
|
|
3282
2993
|
...params,
|
|
3283
2994
|
originalRow: row,
|
|
3284
2995
|
row: {
|
|
@@ -3293,7 +3004,7 @@ var BodyCell = (props) => {
|
|
|
3293
3004
|
onChangeComplete: (e) => {
|
|
3294
3005
|
componentProps.onChangeComplete?.(e);
|
|
3295
3006
|
setValue(e.target.value);
|
|
3296
|
-
|
|
3007
|
+
onCellEditStop?.({
|
|
3297
3008
|
...params,
|
|
3298
3009
|
originalRow: row,
|
|
3299
3010
|
row: {
|
|
@@ -3305,29 +3016,14 @@ var BodyCell = (props) => {
|
|
|
3305
3016
|
}
|
|
3306
3017
|
}
|
|
3307
3018
|
}),
|
|
3308
|
-
[
|
|
3309
|
-
params,
|
|
3310
|
-
row,
|
|
3311
|
-
field,
|
|
3312
|
-
value,
|
|
3313
|
-
componentProps,
|
|
3314
|
-
type,
|
|
3315
|
-
props.onCellEditStop,
|
|
3316
|
-
props.onCellEditStart
|
|
3317
|
-
]
|
|
3019
|
+
[params, row, field, value, componentProps, type, onCellEditStop, onCellEditStart]
|
|
3318
3020
|
);
|
|
3319
3021
|
const EditModeComponent = useMemo8(() => {
|
|
3320
3022
|
if (renderEditCell) {
|
|
3321
3023
|
return createElement(memo(renderEditCell), params);
|
|
3322
3024
|
}
|
|
3323
3025
|
return {
|
|
3324
|
-
date: /* @__PURE__ */ React23.createElement(
|
|
3325
|
-
DatePicker_default,
|
|
3326
|
-
{
|
|
3327
|
-
value,
|
|
3328
|
-
...editModeComponentProps
|
|
3329
|
-
}
|
|
3330
|
-
),
|
|
3026
|
+
date: /* @__PURE__ */ React23.createElement(DatePicker_default, { value, ...editModeComponentProps }),
|
|
3331
3027
|
currency: /* @__PURE__ */ React23.createElement(
|
|
3332
3028
|
CurrencyInput_default,
|
|
3333
3029
|
{
|
|
@@ -3335,29 +3031,9 @@ var BodyCell = (props) => {
|
|
|
3335
3031
|
...editModeComponentProps
|
|
3336
3032
|
}
|
|
3337
3033
|
),
|
|
3338
|
-
number: /* @__PURE__ */ React23.createElement(
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
value,
|
|
3342
|
-
type: "number",
|
|
3343
|
-
...editModeComponentProps
|
|
3344
|
-
}
|
|
3345
|
-
),
|
|
3346
|
-
text: /* @__PURE__ */ React23.createElement(
|
|
3347
|
-
Input_default,
|
|
3348
|
-
{
|
|
3349
|
-
value,
|
|
3350
|
-
type: "text",
|
|
3351
|
-
...editModeComponentProps
|
|
3352
|
-
}
|
|
3353
|
-
),
|
|
3354
|
-
longText: /* @__PURE__ */ React23.createElement(
|
|
3355
|
-
Textarea_default,
|
|
3356
|
-
{
|
|
3357
|
-
value,
|
|
3358
|
-
...editModeComponentProps
|
|
3359
|
-
}
|
|
3360
|
-
),
|
|
3034
|
+
number: /* @__PURE__ */ React23.createElement(Input_default, { value, type: "number", ...editModeComponentProps }),
|
|
3035
|
+
text: /* @__PURE__ */ React23.createElement(Input_default, { value, type: "text", ...editModeComponentProps }),
|
|
3036
|
+
longText: /* @__PURE__ */ React23.createElement(Textarea_default, { value, ...editModeComponentProps }),
|
|
3361
3037
|
autocomplete: /* @__PURE__ */ React23.createElement(
|
|
3362
3038
|
Autocomplete_default,
|
|
3363
3039
|
{
|
|
@@ -3375,50 +3051,34 @@ var BodyCell = (props) => {
|
|
|
3375
3051
|
}
|
|
3376
3052
|
)
|
|
3377
3053
|
}[type || "text"];
|
|
3378
|
-
}, [value, editModeComponentProps, type]);
|
|
3054
|
+
}, [value, editModeComponentProps, type, renderEditCell, params]);
|
|
3055
|
+
const linkComponentFromProps = props.component;
|
|
3379
3056
|
const ReadModeComponent = useMemo8(() => {
|
|
3380
3057
|
if (renderCell) {
|
|
3381
3058
|
return createElement(memo(renderCell), params);
|
|
3382
3059
|
}
|
|
3383
3060
|
const innerText = value;
|
|
3384
3061
|
const typedComponent = {
|
|
3385
|
-
link: React23.createElement(
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
...componentProps
|
|
3390
|
-
}
|
|
3391
|
-
)
|
|
3062
|
+
link: React23.createElement(linkComponentFromProps || Link, {
|
|
3063
|
+
children: innerText,
|
|
3064
|
+
...componentProps
|
|
3065
|
+
})
|
|
3392
3066
|
}[type || "text"];
|
|
3393
3067
|
return typedComponent || innerText;
|
|
3394
|
-
}, [value, renderCell, params, type, componentProps]);
|
|
3068
|
+
}, [value, renderCell, params, type, componentProps, linkComponentFromProps]);
|
|
3069
|
+
const getActions = props.getActions;
|
|
3395
3070
|
const CellComponent = useMemo8(() => {
|
|
3396
3071
|
if (type === "actions") {
|
|
3397
|
-
return /* @__PURE__ */ React23.createElement(
|
|
3398
|
-
Stack_default,
|
|
3399
|
-
{
|
|
3400
|
-
direction: "row",
|
|
3401
|
-
gap: 1,
|
|
3402
|
-
justifyContent: "center",
|
|
3403
|
-
alignItems: "center"
|
|
3404
|
-
},
|
|
3405
|
-
props.getActions?.(params)
|
|
3406
|
-
);
|
|
3072
|
+
return /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", gap: 1, justifyContent: "center", alignItems: "center" }, getActions?.(params));
|
|
3407
3073
|
}
|
|
3408
3074
|
return editMode && EditModeComponent ? EditModeComponent : ReadModeComponent;
|
|
3409
|
-
}, [
|
|
3410
|
-
|
|
3411
|
-
props.getActions,
|
|
3412
|
-
params,
|
|
3413
|
-
editMode,
|
|
3414
|
-
EditModeComponent,
|
|
3415
|
-
ReadModeComponent
|
|
3416
|
-
]);
|
|
3417
|
-
const showTooltip = useMemo8(
|
|
3418
|
-
() => noWrap && type === "longText",
|
|
3419
|
-
[noWrap, type]
|
|
3420
|
-
);
|
|
3075
|
+
}, [type, getActions, params, editMode, EditModeComponent, ReadModeComponent]);
|
|
3076
|
+
const showTooltip = useMemo8(() => noWrap && type === "longText", [noWrap, type]);
|
|
3421
3077
|
const isBoundary = props.isLastStartPinnedColumn || props.isLastEndPinnedColumn;
|
|
3078
|
+
const computedCellClassName = useMemo8(
|
|
3079
|
+
() => (typeof cellClassName === "function" ? cellClassName(params) : cellClassName) || "",
|
|
3080
|
+
[cellClassName, params]
|
|
3081
|
+
);
|
|
3422
3082
|
useEffect5(() => {
|
|
3423
3083
|
setValue(row[field]);
|
|
3424
3084
|
}, [row, field]);
|
|
@@ -3437,11 +3097,11 @@ var BodyCell = (props) => {
|
|
|
3437
3097
|
zIndex: isPinned ? `calc(${theme.getCssVar("zIndex-table")} + ${isBoundary ? 2 : 3})` : void 0,
|
|
3438
3098
|
"--TableCell-dataBackground": isPinned ? `var(--TableCell-headBackground)` : void 0
|
|
3439
3099
|
},
|
|
3440
|
-
className: isLastStartPinnedColumn && "is-last-left"
|
|
3100
|
+
className: [isLastStartPinnedColumn && "is-last-left", isLastEndPinnedColumn && "is-last-right", computedCellClassName].filter(Boolean).join(" ") || ""
|
|
3441
3101
|
},
|
|
3442
3102
|
useMemo8(
|
|
3443
3103
|
() => showTooltip ? /* @__PURE__ */ React23.createElement(CellTextEllipsis, null, CellComponent) : CellComponent,
|
|
3444
|
-
[CellComponent, showTooltip
|
|
3104
|
+
[CellComponent, showTooltip]
|
|
3445
3105
|
)
|
|
3446
3106
|
);
|
|
3447
3107
|
};
|
|
@@ -3451,9 +3111,9 @@ var BodyRow = memo(
|
|
|
3451
3111
|
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, columns.map((column, i) => /* @__PURE__ */ React23.createElement(
|
|
3452
3112
|
BodyCell,
|
|
3453
3113
|
{
|
|
3114
|
+
key: `${rowId}_${column.field.toString()}_${i}`,
|
|
3454
3115
|
...column,
|
|
3455
3116
|
tableId,
|
|
3456
|
-
key: `${rowId}_${column.field.toString()}_${i}`,
|
|
3457
3117
|
row,
|
|
3458
3118
|
rowId,
|
|
3459
3119
|
editMode,
|
|
@@ -3519,10 +3179,7 @@ function useDataTableRenderer({
|
|
|
3519
3179
|
const [sortModel, setSortModel] = useControlledState(
|
|
3520
3180
|
controlledSortModel,
|
|
3521
3181
|
initialState?.sorting?.sortModel ?? [],
|
|
3522
|
-
useCallback9(
|
|
3523
|
-
(sortModel2) => onSortModelChange?.(sortModel2),
|
|
3524
|
-
[onSortModelChange]
|
|
3525
|
-
)
|
|
3182
|
+
useCallback9((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3526
3183
|
);
|
|
3527
3184
|
const columnsByField = useMemo8(
|
|
3528
3185
|
() => columnsProp.reduce(
|
|
@@ -3597,9 +3254,7 @@ function useDataTableRenderer({
|
|
|
3597
3254
|
[dataInPage, isRowSelectable, getId]
|
|
3598
3255
|
);
|
|
3599
3256
|
const isAllSelected = useMemo8(
|
|
3600
|
-
() => selectableDataInPage.length > 0 && selectableDataInPage.every(
|
|
3601
|
-
(row, i) => selectedModelSet.has(getId(row, i))
|
|
3602
|
-
),
|
|
3257
|
+
() => selectableDataInPage.length > 0 && selectableDataInPage.every((row, i) => selectedModelSet.has(getId(row, i))),
|
|
3603
3258
|
[selectableDataInPage, selectedModelSet, getId]
|
|
3604
3259
|
);
|
|
3605
3260
|
const rowCount = totalRowsProp || rows.length;
|
|
@@ -3623,12 +3278,8 @@ function useDataTableRenderer({
|
|
|
3623
3278
|
field: key
|
|
3624
3279
|
}));
|
|
3625
3280
|
return baseColumns.map((column) => {
|
|
3626
|
-
const isLeftPinned = pinnedColumns?.left?.includes(
|
|
3627
|
-
|
|
3628
|
-
);
|
|
3629
|
-
const isRightPinned = pinnedColumns?.right?.includes(
|
|
3630
|
-
column.field
|
|
3631
|
-
);
|
|
3281
|
+
const isLeftPinned = pinnedColumns?.left?.includes(column.field);
|
|
3282
|
+
const isRightPinned = pinnedColumns?.right?.includes(column.field);
|
|
3632
3283
|
const isPinned = isLeftPinned || isRightPinned;
|
|
3633
3284
|
return {
|
|
3634
3285
|
...column,
|
|
@@ -3640,13 +3291,8 @@ function useDataTableRenderer({
|
|
|
3640
3291
|
isLastStartPinnedColumn: isLeftPinned && [...pinnedColumns?.left || []].pop() === column.field,
|
|
3641
3292
|
isLastEndPinnedColumn: isRightPinned && (pinnedColumns?.right?.[0] ?? null) === column.field,
|
|
3642
3293
|
// pinned 관련 계산부
|
|
3643
|
-
pinnedStartPosition: pinnedColumns?.left?.slice(
|
|
3644
|
-
|
|
3645
|
-
isLeftPinned ? pinnedColumns.left.indexOf(column.field) : pinnedColumns.left.length
|
|
3646
|
-
).reduce((acc, curr) => acc + getWidth(curr), 0),
|
|
3647
|
-
pinnedEndPosition: pinnedColumns?.right?.slice(
|
|
3648
|
-
isRightPinned ? pinnedColumns.right.indexOf(column.field) + 1 : 0
|
|
3649
|
-
).reduce((acc, curr) => acc + getWidth(curr), 0)
|
|
3294
|
+
pinnedStartPosition: pinnedColumns?.left?.slice(0, isLeftPinned ? pinnedColumns.left.indexOf(column.field) : pinnedColumns.left.length).reduce((acc, curr) => acc + getWidth(curr), 0),
|
|
3295
|
+
pinnedEndPosition: pinnedColumns?.right?.slice(isRightPinned ? pinnedColumns.right.indexOf(column.field) + 1 : 0).reduce((acc, curr) => acc + getWidth(curr), 0)
|
|
3650
3296
|
};
|
|
3651
3297
|
});
|
|
3652
3298
|
}, [
|
|
@@ -3681,9 +3327,7 @@ function useDataTableRenderer({
|
|
|
3681
3327
|
setSortModel(newSortModel2);
|
|
3682
3328
|
return;
|
|
3683
3329
|
}
|
|
3684
|
-
const newSortModel = multiple ? sortModel.map(
|
|
3685
|
-
(model) => model.field === field ? { field, sort: nextSortOrder } : model
|
|
3686
|
-
) : [{ field, sort: nextSortOrder }];
|
|
3330
|
+
const newSortModel = multiple ? sortModel.map((model) => model.field === field ? { field, sort: nextSortOrder } : model) : [{ field, sort: nextSortOrder }];
|
|
3687
3331
|
setSortModel(newSortModel);
|
|
3688
3332
|
} else {
|
|
3689
3333
|
const newSortModel = multiple ? [...sortModel, { field, sort: columnSortOrder[0] }] : [{ field, sort: columnSortOrder[0] }];
|
|
@@ -3720,10 +3364,7 @@ function useDataTableRenderer({
|
|
|
3720
3364
|
isAllSelected,
|
|
3721
3365
|
// all rows are selected on this page
|
|
3722
3366
|
isTotalSelected,
|
|
3723
|
-
isSelectedRow: useCallback9(
|
|
3724
|
-
(model) => selectedModelSet.has(model),
|
|
3725
|
-
[selectedModelSet]
|
|
3726
|
-
),
|
|
3367
|
+
isSelectedRow: useCallback9((model) => selectedModelSet.has(model), [selectedModelSet]),
|
|
3727
3368
|
isRowSelectable: useCallback9(
|
|
3728
3369
|
(rowId, row) => {
|
|
3729
3370
|
if (!isRowSelectable) return true;
|
|
@@ -3736,16 +3377,12 @@ function useDataTableRenderer({
|
|
|
3736
3377
|
setFocusedRowId(rowId);
|
|
3737
3378
|
}, []),
|
|
3738
3379
|
onAllCheckboxChange: useCallback9(() => {
|
|
3739
|
-
onSelectionModelChange?.(
|
|
3740
|
-
isAllSelected ? [] : selectableDataInPage.map(getId)
|
|
3741
|
-
);
|
|
3380
|
+
onSelectionModelChange?.(isAllSelected ? [] : selectableDataInPage.map(getId));
|
|
3742
3381
|
}, [isAllSelected, selectableDataInPage, onSelectionModelChange, getId]),
|
|
3743
3382
|
onCheckboxChange: useCallback9(
|
|
3744
3383
|
(event, selectedModel) => {
|
|
3745
3384
|
if (selectedModelSet.has(selectedModel)) {
|
|
3746
|
-
const newSelectionModel = (selectionModel || []).filter(
|
|
3747
|
-
(model) => model !== selectedModel
|
|
3748
|
-
);
|
|
3385
|
+
const newSelectionModel = (selectionModel || []).filter((model) => model !== selectedModel);
|
|
3749
3386
|
onSelectionModelChange?.(newSelectionModel);
|
|
3750
3387
|
} else {
|
|
3751
3388
|
const newSelectionModel = [...selectionModel || [], selectedModel];
|
|
@@ -3760,10 +3397,7 @@ function useDataTableRenderer({
|
|
|
3760
3397
|
if (!isRowSelectable) return true;
|
|
3761
3398
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
3762
3399
|
});
|
|
3763
|
-
onSelectionModelChange?.(
|
|
3764
|
-
isTotalSelected ? [] : selectableRows.map(getId),
|
|
3765
|
-
!isTotalSelected
|
|
3766
|
-
);
|
|
3400
|
+
onSelectionModelChange?.(isTotalSelected ? [] : selectableRows.map(getId), !isTotalSelected);
|
|
3767
3401
|
}, [isTotalSelected, rows, onSelectionModelChange, getId, isRowSelectable])
|
|
3768
3402
|
};
|
|
3769
3403
|
}
|
|
@@ -3806,11 +3440,7 @@ function Component(props, apiRef) {
|
|
|
3806
3440
|
footer: Footer,
|
|
3807
3441
|
loadingOverlay: LoadingOverlay = DefaultLoadingOverlay
|
|
3808
3442
|
} = {},
|
|
3809
|
-
slotProps: {
|
|
3810
|
-
checkbox: checkboxProps = {},
|
|
3811
|
-
toolbar: toolbarProps,
|
|
3812
|
-
background: backgroundProps = {}
|
|
3813
|
-
} = {},
|
|
3443
|
+
slotProps: { checkbox: checkboxProps = {}, toolbar: toolbarProps, background: backgroundProps = {} } = {},
|
|
3814
3444
|
stripe,
|
|
3815
3445
|
isTotalSelected: ___________,
|
|
3816
3446
|
...innerProps
|
|
@@ -3855,13 +3485,7 @@ function Component(props, apiRef) {
|
|
|
3855
3485
|
onRowClick?.({ row, rowId }, e);
|
|
3856
3486
|
checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
|
|
3857
3487
|
},
|
|
3858
|
-
[
|
|
3859
|
-
onRowClick,
|
|
3860
|
-
checkboxSelection,
|
|
3861
|
-
disableSelectionOnClick,
|
|
3862
|
-
onCheckboxChange,
|
|
3863
|
-
isRowSelectableCheck
|
|
3864
|
-
]
|
|
3488
|
+
[onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
|
|
3865
3489
|
);
|
|
3866
3490
|
const getRowFocusHandler = useCallback9(
|
|
3867
3491
|
(rowId) => () => {
|
|
@@ -3919,16 +3543,7 @@ function Component(props, apiRef) {
|
|
|
3919
3543
|
justifyContent: "space-between",
|
|
3920
3544
|
alignItems: "center"
|
|
3921
3545
|
},
|
|
3922
|
-
!!checkboxSelection && /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ React23.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ React23.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(selectableRowCount), " items")), isTotalSelected && /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectableRowCount), " items are selected."), /* @__PURE__ */ React23.createElement(
|
|
3923
|
-
Button_default,
|
|
3924
|
-
{
|
|
3925
|
-
size: "sm",
|
|
3926
|
-
variant: "plain",
|
|
3927
|
-
color: "danger",
|
|
3928
|
-
onClick: onTotalSelect
|
|
3929
|
-
},
|
|
3930
|
-
"Cancel"
|
|
3931
|
-
))),
|
|
3546
|
+
!!checkboxSelection && /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ React23.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ React23.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(selectableRowCount), " items")), isTotalSelected && /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectableRowCount), " items are selected."), /* @__PURE__ */ React23.createElement(Button_default, { size: "sm", variant: "plain", color: "danger", onClick: onTotalSelect }, "Cancel"))),
|
|
3932
3547
|
Toolbar && /* @__PURE__ */ React23.createElement(Toolbar, { ...toolbarProps || {} })
|
|
3933
3548
|
),
|
|
3934
3549
|
/* @__PURE__ */ React23.createElement(
|
|
@@ -4085,15 +3700,7 @@ var DataTable = forwardRef7(Component);
|
|
|
4085
3700
|
DataTable.displayName = "DataTable";
|
|
4086
3701
|
|
|
4087
3702
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
4088
|
-
import React24, {
|
|
4089
|
-
forwardRef as forwardRef8,
|
|
4090
|
-
useCallback as useCallback10,
|
|
4091
|
-
useEffect as useEffect6,
|
|
4092
|
-
useImperativeHandle as useImperativeHandle3,
|
|
4093
|
-
useMemo as useMemo9,
|
|
4094
|
-
useRef as useRef5,
|
|
4095
|
-
useState as useState7
|
|
4096
|
-
} from "react";
|
|
3703
|
+
import React24, { forwardRef as forwardRef8, useCallback as useCallback10, useEffect as useEffect6, useImperativeHandle as useImperativeHandle3, useMemo as useMemo9, useRef as useRef5, useState as useState7 } from "react";
|
|
4097
3704
|
import { IMaskInput as IMaskInput2, IMask as IMask2 } from "react-imask";
|
|
4098
3705
|
import CalendarTodayIcon2 from "@mui/icons-material/CalendarToday";
|
|
4099
3706
|
import { styled as styled13, useThemeProps as useThemeProps5 } from "@mui/joy";
|
|
@@ -4105,9 +3712,7 @@ var CalendarButton2 = styled13(IconButton_default, {
|
|
|
4105
3712
|
"&:focus": {
|
|
4106
3713
|
"--Icon-color": "currentColor",
|
|
4107
3714
|
outlineOffset: `${theme.getCssVar("focus-thickness")}`,
|
|
4108
|
-
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar(
|
|
4109
|
-
"palette-focusVisible"
|
|
4110
|
-
)}`
|
|
3715
|
+
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
4111
3716
|
}
|
|
4112
3717
|
}));
|
|
4113
3718
|
var StyledPopper2 = styled13(Popper3, {
|
|
@@ -4144,10 +3749,7 @@ var validValueFormat2 = (value, format) => {
|
|
|
4144
3749
|
if (parsedDate1.toString() === "Invalid Date" || parsedDate2.toString() === "Invalid Date") {
|
|
4145
3750
|
return false;
|
|
4146
3751
|
}
|
|
4147
|
-
const formattedValue = formatValueString2(
|
|
4148
|
-
[parsedDate1, parsedDate2],
|
|
4149
|
-
format
|
|
4150
|
-
);
|
|
3752
|
+
const formattedValue = formatValueString2([parsedDate1, parsedDate2], format);
|
|
4151
3753
|
if (value !== formattedValue) {
|
|
4152
3754
|
return false;
|
|
4153
3755
|
}
|
|
@@ -4199,296 +3801,268 @@ var parseDates = (str, format) => {
|
|
|
4199
3801
|
var formatToPattern2 = (format) => {
|
|
4200
3802
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
4201
3803
|
};
|
|
4202
|
-
var TextMaskAdapter5 = React24.forwardRef(
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
maxLength: 2
|
|
4219
|
-
},
|
|
4220
|
-
M: {
|
|
4221
|
-
mask: IMask2.MaskedRange,
|
|
4222
|
-
from: 1,
|
|
4223
|
-
to: 12,
|
|
4224
|
-
maxLength: 2
|
|
4225
|
-
},
|
|
4226
|
-
Y: {
|
|
4227
|
-
mask: IMask2.MaskedRange,
|
|
4228
|
-
from: 1900,
|
|
4229
|
-
to: 9999
|
|
4230
|
-
}
|
|
3804
|
+
var TextMaskAdapter5 = React24.forwardRef(function TextMaskAdapter6(props, ref) {
|
|
3805
|
+
const { onChange, format, ...other } = props;
|
|
3806
|
+
return /* @__PURE__ */ React24.createElement(
|
|
3807
|
+
IMaskInput2,
|
|
3808
|
+
{
|
|
3809
|
+
...other,
|
|
3810
|
+
inputRef: ref,
|
|
3811
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
3812
|
+
mask: Date,
|
|
3813
|
+
pattern: formatToPattern2(format),
|
|
3814
|
+
blocks: {
|
|
3815
|
+
D: {
|
|
3816
|
+
mask: IMask2.MaskedRange,
|
|
3817
|
+
from: 1,
|
|
3818
|
+
to: 31,
|
|
3819
|
+
maxLength: 2
|
|
4231
3820
|
},
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
const props = useThemeProps5({ props: inProps, name: "DateRangePicker" });
|
|
4243
|
-
const {
|
|
4244
|
-
onChange,
|
|
4245
|
-
disabled,
|
|
4246
|
-
label,
|
|
4247
|
-
error,
|
|
4248
|
-
helperText,
|
|
4249
|
-
minDate,
|
|
4250
|
-
maxDate,
|
|
4251
|
-
disableFuture,
|
|
4252
|
-
disablePast,
|
|
4253
|
-
required,
|
|
4254
|
-
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4255
|
-
sx,
|
|
4256
|
-
className,
|
|
4257
|
-
format = "YYYY/MM/DD",
|
|
4258
|
-
displayFormat = "YYYY/MM/DD",
|
|
4259
|
-
size,
|
|
4260
|
-
inputReadOnly,
|
|
4261
|
-
hideClearButton,
|
|
4262
|
-
readOnly,
|
|
4263
|
-
...innerProps
|
|
4264
|
-
} = props;
|
|
4265
|
-
const innerRef = useRef5(null);
|
|
4266
|
-
const buttonRef = useRef5(null);
|
|
4267
|
-
const [value, setValue] = useControlledState(
|
|
4268
|
-
props.value,
|
|
4269
|
-
props.defaultValue || "",
|
|
4270
|
-
useCallback10(
|
|
4271
|
-
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4272
|
-
[props.name, onChange]
|
|
4273
|
-
)
|
|
4274
|
-
);
|
|
4275
|
-
const [displayValue, setDisplayValue] = useState7(
|
|
4276
|
-
() => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
|
|
4277
|
-
);
|
|
4278
|
-
const [anchorEl, setAnchorEl] = useState7(null);
|
|
4279
|
-
const open = Boolean(anchorEl);
|
|
4280
|
-
const calendarValue = useMemo9(
|
|
4281
|
-
() => value ? parseDates(value, format) : void 0,
|
|
4282
|
-
[value, format]
|
|
4283
|
-
);
|
|
4284
|
-
useEffect6(() => {
|
|
4285
|
-
if (value) {
|
|
4286
|
-
try {
|
|
4287
|
-
const dates = parseDates(value, format);
|
|
4288
|
-
const newDisplayValue = formatValueString2(dates, displayFormat);
|
|
4289
|
-
setDisplayValue(newDisplayValue);
|
|
4290
|
-
} catch (error2) {
|
|
3821
|
+
M: {
|
|
3822
|
+
mask: IMask2.MaskedRange,
|
|
3823
|
+
from: 1,
|
|
3824
|
+
to: 12,
|
|
3825
|
+
maxLength: 2
|
|
3826
|
+
},
|
|
3827
|
+
Y: {
|
|
3828
|
+
mask: IMask2.MaskedRange,
|
|
3829
|
+
from: 1900,
|
|
3830
|
+
to: 9999
|
|
4291
3831
|
}
|
|
3832
|
+
},
|
|
3833
|
+
format: (dates) => formatValueString2(dates, format),
|
|
3834
|
+
parse: (str) => parseDates(str, format),
|
|
3835
|
+
autofix: "pad",
|
|
3836
|
+
overwrite: true
|
|
3837
|
+
}
|
|
3838
|
+
);
|
|
3839
|
+
});
|
|
3840
|
+
var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
3841
|
+
const props = useThemeProps5({ props: inProps, name: "DateRangePicker" });
|
|
3842
|
+
const {
|
|
3843
|
+
onChange,
|
|
3844
|
+
disabled,
|
|
3845
|
+
label,
|
|
3846
|
+
error,
|
|
3847
|
+
helperText,
|
|
3848
|
+
minDate,
|
|
3849
|
+
maxDate,
|
|
3850
|
+
disableFuture,
|
|
3851
|
+
disablePast,
|
|
3852
|
+
required,
|
|
3853
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
3854
|
+
sx,
|
|
3855
|
+
className,
|
|
3856
|
+
format = "YYYY/MM/DD",
|
|
3857
|
+
displayFormat = "YYYY/MM/DD",
|
|
3858
|
+
size,
|
|
3859
|
+
inputReadOnly,
|
|
3860
|
+
hideClearButton,
|
|
3861
|
+
readOnly,
|
|
3862
|
+
...innerProps
|
|
3863
|
+
} = props;
|
|
3864
|
+
const innerRef = useRef5(null);
|
|
3865
|
+
const buttonRef = useRef5(null);
|
|
3866
|
+
const [value, setValue] = useControlledState(
|
|
3867
|
+
props.value,
|
|
3868
|
+
props.defaultValue || "",
|
|
3869
|
+
useCallback10((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
3870
|
+
);
|
|
3871
|
+
const [displayValue, setDisplayValue] = useState7(
|
|
3872
|
+
() => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
|
|
3873
|
+
);
|
|
3874
|
+
const [anchorEl, setAnchorEl] = useState7(null);
|
|
3875
|
+
const open = Boolean(anchorEl);
|
|
3876
|
+
const calendarValue = useMemo9(
|
|
3877
|
+
() => value ? parseDates(value, format) : void 0,
|
|
3878
|
+
[value, format]
|
|
3879
|
+
);
|
|
3880
|
+
useEffect6(() => {
|
|
3881
|
+
if (value) {
|
|
3882
|
+
try {
|
|
3883
|
+
const dates = parseDates(value, format);
|
|
3884
|
+
const newDisplayValue = formatValueString2(dates, displayFormat);
|
|
3885
|
+
setDisplayValue(newDisplayValue);
|
|
3886
|
+
} catch (error2) {
|
|
3887
|
+
}
|
|
3888
|
+
} else {
|
|
3889
|
+
setDisplayValue("");
|
|
3890
|
+
}
|
|
3891
|
+
}, [displayFormat, value, format]);
|
|
3892
|
+
useEffect6(() => {
|
|
3893
|
+
if (!anchorEl) {
|
|
3894
|
+
innerRef.current?.blur();
|
|
3895
|
+
}
|
|
3896
|
+
}, [anchorEl, innerRef]);
|
|
3897
|
+
useImperativeHandle3(ref, () => innerRef.current, [innerRef]);
|
|
3898
|
+
const handleChange = useCallback10(
|
|
3899
|
+
(event) => {
|
|
3900
|
+
const value2 = event.target.value;
|
|
3901
|
+
setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat) : value2);
|
|
3902
|
+
setValue(value2);
|
|
3903
|
+
},
|
|
3904
|
+
[displayFormat, format, setValue]
|
|
3905
|
+
);
|
|
3906
|
+
const handleDisplayInputChange = useCallback10(
|
|
3907
|
+
(event) => {
|
|
3908
|
+
if (event.target.value === "") {
|
|
3909
|
+
handleChange({
|
|
3910
|
+
target: {
|
|
3911
|
+
name: props.name,
|
|
3912
|
+
value: ""
|
|
3913
|
+
}
|
|
3914
|
+
});
|
|
3915
|
+
return;
|
|
3916
|
+
}
|
|
3917
|
+
const isValidDisplayValue = validValueFormat2(event.target.value, displayFormat);
|
|
3918
|
+
if (isValidDisplayValue) {
|
|
3919
|
+
const dates = parseDates(event.target.value, displayFormat);
|
|
3920
|
+
const formattedValue = formatValueString2(dates, format);
|
|
3921
|
+
handleChange({
|
|
3922
|
+
target: {
|
|
3923
|
+
name: props.name,
|
|
3924
|
+
value: formattedValue
|
|
3925
|
+
}
|
|
3926
|
+
});
|
|
3927
|
+
}
|
|
3928
|
+
},
|
|
3929
|
+
[displayFormat, format, handleChange, props.name]
|
|
3930
|
+
);
|
|
3931
|
+
const handleCalendarToggle = useCallback10(
|
|
3932
|
+
(event) => {
|
|
3933
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
3934
|
+
innerRef.current?.focus();
|
|
3935
|
+
},
|
|
3936
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
3937
|
+
);
|
|
3938
|
+
const handleCalendarChange = useCallback10(
|
|
3939
|
+
([date1, date2]) => {
|
|
3940
|
+
if (!date1 || !date2) return;
|
|
3941
|
+
const formattedValue = formatValueString2([date1, date2], format);
|
|
3942
|
+
if (props.value !== void 0) {
|
|
3943
|
+
onChange?.({ target: { name: props.name, value: formattedValue } });
|
|
4292
3944
|
} else {
|
|
4293
|
-
setDisplayValue(
|
|
3945
|
+
setDisplayValue(formatValueString2([date1, date2], displayFormat));
|
|
3946
|
+
setValue(formattedValue);
|
|
4294
3947
|
}
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
3948
|
+
setAnchorEl(null);
|
|
3949
|
+
},
|
|
3950
|
+
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat]
|
|
3951
|
+
);
|
|
3952
|
+
const handleInputMouseDown = useCallback10(
|
|
3953
|
+
(event) => {
|
|
3954
|
+
if (inputReadOnly) {
|
|
3955
|
+
event.preventDefault();
|
|
3956
|
+
buttonRef.current?.focus();
|
|
4299
3957
|
}
|
|
4300
|
-
},
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
3958
|
+
},
|
|
3959
|
+
[inputReadOnly, buttonRef]
|
|
3960
|
+
);
|
|
3961
|
+
return /* @__PURE__ */ React24.createElement(DateRangePickerRoot, null, /* @__PURE__ */ React24.createElement(FocusTrap2, { open: true }, /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(
|
|
3962
|
+
Input_default,
|
|
3963
|
+
{
|
|
3964
|
+
...innerProps,
|
|
3965
|
+
color: error ? "danger" : innerProps.color,
|
|
3966
|
+
ref,
|
|
3967
|
+
size,
|
|
3968
|
+
value: displayValue,
|
|
3969
|
+
onChange: handleDisplayInputChange,
|
|
3970
|
+
disabled,
|
|
3971
|
+
required,
|
|
3972
|
+
placeholder: `${displayFormat} - ${displayFormat}`,
|
|
3973
|
+
slotProps: {
|
|
3974
|
+
input: {
|
|
3975
|
+
component: TextMaskAdapter5,
|
|
3976
|
+
ref: innerRef,
|
|
3977
|
+
format: displayFormat,
|
|
3978
|
+
sx: {
|
|
3979
|
+
"&:hover": {
|
|
3980
|
+
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
4321
3981
|
}
|
|
4322
|
-
}
|
|
4323
|
-
|
|
3982
|
+
},
|
|
3983
|
+
onMouseDown: handleInputMouseDown
|
|
4324
3984
|
}
|
|
4325
|
-
const isValidDisplayValue = validValueFormat2(
|
|
4326
|
-
event.target.value,
|
|
4327
|
-
displayFormat
|
|
4328
|
-
);
|
|
4329
|
-
if (isValidDisplayValue) {
|
|
4330
|
-
const dates = parseDates(event.target.value, displayFormat);
|
|
4331
|
-
const formattedValue = formatValueString2(dates, format);
|
|
4332
|
-
handleChange({
|
|
4333
|
-
target: {
|
|
4334
|
-
name: props.name,
|
|
4335
|
-
value: formattedValue
|
|
4336
|
-
}
|
|
4337
|
-
});
|
|
4338
|
-
}
|
|
4339
|
-
},
|
|
4340
|
-
[displayFormat, format, handleChange, props.name]
|
|
4341
|
-
);
|
|
4342
|
-
const handleCalendarToggle = useCallback10(
|
|
4343
|
-
(event) => {
|
|
4344
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4345
|
-
innerRef.current?.focus();
|
|
4346
3985
|
},
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
3986
|
+
error,
|
|
3987
|
+
className,
|
|
3988
|
+
sx,
|
|
3989
|
+
endDecorator: /* @__PURE__ */ React24.createElement(
|
|
3990
|
+
CalendarButton2,
|
|
3991
|
+
{
|
|
3992
|
+
ref: buttonRef,
|
|
3993
|
+
variant: "plain",
|
|
3994
|
+
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
3995
|
+
"aria-label": "Toggle Calendar",
|
|
3996
|
+
"aria-controls": "date-range-picker-popper",
|
|
3997
|
+
"aria-haspopup": "dialog",
|
|
3998
|
+
"aria-expanded": open,
|
|
3999
|
+
disabled
|
|
4000
|
+
},
|
|
4001
|
+
/* @__PURE__ */ React24.createElement(CalendarTodayIcon2, null)
|
|
4002
|
+
),
|
|
4003
|
+
label,
|
|
4004
|
+
helperText,
|
|
4005
|
+
readOnly: readOnly || inputReadOnly
|
|
4006
|
+
}
|
|
4007
|
+
), open && /* @__PURE__ */ React24.createElement(ClickAwayListener2, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React24.createElement(
|
|
4008
|
+
StyledPopper2,
|
|
4009
|
+
{
|
|
4010
|
+
id: "date-range-picker-popper",
|
|
4011
|
+
open: true,
|
|
4012
|
+
anchorEl,
|
|
4013
|
+
placement: "bottom-end",
|
|
4014
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4015
|
+
modifiers: [
|
|
4016
|
+
{
|
|
4017
|
+
name: "offset",
|
|
4018
|
+
options: {
|
|
4019
|
+
offset: [4, 4]
|
|
4020
|
+
}
|
|
4378
4021
|
}
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4022
|
+
],
|
|
4023
|
+
"aria-label": "Calendar Tooltip",
|
|
4024
|
+
"aria-expanded": open
|
|
4025
|
+
},
|
|
4026
|
+
/* @__PURE__ */ React24.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React24.createElement(
|
|
4027
|
+
Calendar_default,
|
|
4384
4028
|
{
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
required,
|
|
4393
|
-
placeholder: `${displayFormat} - ${displayFormat}`,
|
|
4394
|
-
slotProps: {
|
|
4395
|
-
input: {
|
|
4396
|
-
component: TextMaskAdapter5,
|
|
4397
|
-
ref: innerRef,
|
|
4398
|
-
format: displayFormat,
|
|
4399
|
-
sx: {
|
|
4400
|
-
"&:hover": {
|
|
4401
|
-
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
4402
|
-
}
|
|
4403
|
-
},
|
|
4404
|
-
onMouseDown: handleInputMouseDown
|
|
4405
|
-
}
|
|
4406
|
-
},
|
|
4407
|
-
error,
|
|
4408
|
-
className,
|
|
4409
|
-
sx,
|
|
4410
|
-
endDecorator: /* @__PURE__ */ React24.createElement(
|
|
4411
|
-
CalendarButton2,
|
|
4412
|
-
{
|
|
4413
|
-
ref: buttonRef,
|
|
4414
|
-
variant: "plain",
|
|
4415
|
-
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
4416
|
-
"aria-label": "Toggle Calendar",
|
|
4417
|
-
"aria-controls": "date-range-picker-popper",
|
|
4418
|
-
"aria-haspopup": "dialog",
|
|
4419
|
-
"aria-expanded": open,
|
|
4420
|
-
disabled
|
|
4421
|
-
},
|
|
4422
|
-
/* @__PURE__ */ React24.createElement(CalendarTodayIcon2, null)
|
|
4423
|
-
),
|
|
4424
|
-
label,
|
|
4425
|
-
helperText,
|
|
4426
|
-
readOnly: readOnly || inputReadOnly
|
|
4029
|
+
rangeSelection: true,
|
|
4030
|
+
defaultValue: calendarValue,
|
|
4031
|
+
onChange: handleCalendarChange,
|
|
4032
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
4033
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4034
|
+
disableFuture,
|
|
4035
|
+
disablePast
|
|
4427
4036
|
}
|
|
4428
|
-
),
|
|
4429
|
-
|
|
4037
|
+
), !hideClearButton && /* @__PURE__ */ React24.createElement(
|
|
4038
|
+
DialogActions_default,
|
|
4430
4039
|
{
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
anchorEl,
|
|
4434
|
-
placement: "bottom-end",
|
|
4435
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
4436
|
-
modifiers: [
|
|
4437
|
-
{
|
|
4438
|
-
name: "offset",
|
|
4439
|
-
options: {
|
|
4440
|
-
offset: [4, 4]
|
|
4441
|
-
}
|
|
4442
|
-
}
|
|
4443
|
-
],
|
|
4444
|
-
"aria-label": "Calendar Tooltip",
|
|
4445
|
-
"aria-expanded": open
|
|
4446
|
-
},
|
|
4447
|
-
/* @__PURE__ */ React24.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React24.createElement(
|
|
4448
|
-
Calendar_default,
|
|
4449
|
-
{
|
|
4450
|
-
rangeSelection: true,
|
|
4451
|
-
defaultValue: calendarValue,
|
|
4452
|
-
onChange: handleCalendarChange,
|
|
4453
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
4454
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4455
|
-
disableFuture,
|
|
4456
|
-
disablePast
|
|
4040
|
+
sx: {
|
|
4041
|
+
p: 1
|
|
4457
4042
|
}
|
|
4458
|
-
|
|
4459
|
-
|
|
4043
|
+
},
|
|
4044
|
+
/* @__PURE__ */ React24.createElement(
|
|
4045
|
+
Button_default,
|
|
4460
4046
|
{
|
|
4461
|
-
|
|
4462
|
-
|
|
4047
|
+
size,
|
|
4048
|
+
variant: "plain",
|
|
4049
|
+
color: "neutral",
|
|
4050
|
+
onClick: () => {
|
|
4051
|
+
setValue("");
|
|
4052
|
+
setDisplayValue("");
|
|
4053
|
+
setAnchorEl(null);
|
|
4463
4054
|
}
|
|
4464
4055
|
},
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
color: "neutral",
|
|
4471
|
-
onClick: () => {
|
|
4472
|
-
setValue("");
|
|
4473
|
-
setDisplayValue("");
|
|
4474
|
-
setAnchorEl(null);
|
|
4475
|
-
}
|
|
4476
|
-
},
|
|
4477
|
-
"Clear"
|
|
4478
|
-
)
|
|
4479
|
-
))
|
|
4480
|
-
)))));
|
|
4481
|
-
}
|
|
4482
|
-
);
|
|
4056
|
+
"Clear"
|
|
4057
|
+
)
|
|
4058
|
+
))
|
|
4059
|
+
)))));
|
|
4060
|
+
});
|
|
4483
4061
|
DateRangePicker.displayName = "DateRangePicker";
|
|
4484
4062
|
|
|
4485
4063
|
// src/components/Drawer/Drawer.tsx
|
|
4486
4064
|
import React25 from "react";
|
|
4487
|
-
import {
|
|
4488
|
-
Drawer as JoyDrawer,
|
|
4489
|
-
styled as styled14,
|
|
4490
|
-
drawerClasses
|
|
4491
|
-
} from "@mui/joy";
|
|
4065
|
+
import { Drawer as JoyDrawer, styled as styled14, drawerClasses } from "@mui/joy";
|
|
4492
4066
|
import { motion as motion22 } from "framer-motion";
|
|
4493
4067
|
var MotionDrawer = motion22(JoyDrawer);
|
|
4494
4068
|
var StyledDrawer = styled14(MotionDrawer)(({ theme, size = "md" }) => ({
|
|
@@ -4576,17 +4150,7 @@ var StyledDialogFrame = styled18(ModalDialog, {
|
|
|
4576
4150
|
});
|
|
4577
4151
|
var DialogFrame = React27.forwardRef((props, ref) => {
|
|
4578
4152
|
const { title, children, actions, fullscreen, ...innerProps } = props;
|
|
4579
|
-
return /* @__PURE__ */ React27.createElement(
|
|
4580
|
-
StyledDialogFrame,
|
|
4581
|
-
{
|
|
4582
|
-
layout: fullscreen ? "fullscreen" : "center",
|
|
4583
|
-
ref,
|
|
4584
|
-
...innerProps
|
|
4585
|
-
},
|
|
4586
|
-
/* @__PURE__ */ React27.createElement(DialogTitle_default, null, title),
|
|
4587
|
-
/* @__PURE__ */ React27.createElement(DialogContent_default, null, children),
|
|
4588
|
-
/* @__PURE__ */ React27.createElement(DialogActions_default, null, actions)
|
|
4589
|
-
);
|
|
4153
|
+
return /* @__PURE__ */ React27.createElement(StyledDialogFrame, { layout: fullscreen ? "fullscreen" : "center", ref, ...innerProps }, /* @__PURE__ */ React27.createElement(DialogTitle_default, null, title), /* @__PURE__ */ React27.createElement(DialogContent_default, null, children), /* @__PURE__ */ React27.createElement(DialogActions_default, null, actions));
|
|
4590
4154
|
});
|
|
4591
4155
|
DialogFrame.displayName = "DialogFrame";
|
|
4592
4156
|
|
|
@@ -4621,10 +4185,7 @@ import { Grid } from "@mui/joy";
|
|
|
4621
4185
|
|
|
4622
4186
|
// src/components/IconMenuButton/IconMenuButton.tsx
|
|
4623
4187
|
import React29 from "react";
|
|
4624
|
-
import {
|
|
4625
|
-
MenuButton as JoyMenuButton2,
|
|
4626
|
-
IconButton as JoyIconButton2
|
|
4627
|
-
} from "@mui/joy";
|
|
4188
|
+
import { MenuButton as JoyMenuButton2, IconButton as JoyIconButton2 } from "@mui/joy";
|
|
4628
4189
|
function IconMenuButton(props) {
|
|
4629
4190
|
const {
|
|
4630
4191
|
size,
|
|
@@ -4668,15 +4229,7 @@ function IconMenuButton(props) {
|
|
|
4668
4229
|
}
|
|
4669
4230
|
},
|
|
4670
4231
|
icon
|
|
4671
|
-
), /* @__PURE__ */ React29.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React29.createElement(
|
|
4672
|
-
MenuItem,
|
|
4673
|
-
{
|
|
4674
|
-
key: i.text,
|
|
4675
|
-
component: i.component,
|
|
4676
|
-
...i.componentProps ?? {}
|
|
4677
|
-
},
|
|
4678
|
-
i.text
|
|
4679
|
-
))));
|
|
4232
|
+
), /* @__PURE__ */ React29.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React29.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
4680
4233
|
}
|
|
4681
4234
|
IconMenuButton.displayName = "IconMenuButton";
|
|
4682
4235
|
|
|
@@ -4710,61 +4263,39 @@ var Markdown = (props) => {
|
|
|
4710
4263
|
if (!rehypeAccent2) {
|
|
4711
4264
|
return null;
|
|
4712
4265
|
}
|
|
4713
|
-
return /* @__PURE__ */ React30.createElement(
|
|
4714
|
-
|
|
4266
|
+
return /* @__PURE__ */ React30.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ React30.createElement(
|
|
4267
|
+
Suspense,
|
|
4715
4268
|
{
|
|
4716
|
-
|
|
4717
|
-
color,
|
|
4718
|
-
textColor,
|
|
4719
|
-
level: defaultLevel,
|
|
4720
|
-
...innerProps
|
|
4269
|
+
fallback: fallback || /* @__PURE__ */ React30.createElement(Typography, null, /* @__PURE__ */ React30.createElement(Skeleton, null, content || ""))
|
|
4721
4270
|
},
|
|
4722
4271
|
/* @__PURE__ */ React30.createElement(
|
|
4723
|
-
|
|
4272
|
+
LazyReactMarkdown,
|
|
4724
4273
|
{
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
{
|
|
4730
|
-
|
|
4731
|
-
children:
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
Typography,
|
|
4741
|
-
{
|
|
4742
|
-
color,
|
|
4743
|
-
textColor,
|
|
4744
|
-
level: defaultLevel,
|
|
4745
|
-
...node?.properties
|
|
4746
|
-
},
|
|
4747
|
-
children
|
|
4748
|
-
),
|
|
4749
|
-
a: ({ children, href }) => /* @__PURE__ */ React30.createElement(Link2, { href, target: defaultLinkAction }, children),
|
|
4750
|
-
hr: () => /* @__PURE__ */ React30.createElement(Divider, null),
|
|
4751
|
-
b: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4752
|
-
strong: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4753
|
-
...markdownOptions?.components
|
|
4754
|
-
}
|
|
4274
|
+
...markdownOptions,
|
|
4275
|
+
children: content,
|
|
4276
|
+
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
4277
|
+
remarkPlugins: [remarkGfm],
|
|
4278
|
+
components: {
|
|
4279
|
+
h1: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: "h1" }, children),
|
|
4280
|
+
h2: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: "h2" }, children),
|
|
4281
|
+
h3: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: "h3" }, children),
|
|
4282
|
+
h4: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: "h4" }, children),
|
|
4283
|
+
p: ({ children, node }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: defaultLevel, ...node?.properties }, children),
|
|
4284
|
+
a: ({ children, href }) => /* @__PURE__ */ React30.createElement(Link2, { href, target: defaultLinkAction }, children),
|
|
4285
|
+
hr: () => /* @__PURE__ */ React30.createElement(Divider, null),
|
|
4286
|
+
b: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4287
|
+
strong: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4288
|
+
...markdownOptions?.components
|
|
4755
4289
|
}
|
|
4756
|
-
|
|
4290
|
+
}
|
|
4757
4291
|
)
|
|
4758
|
-
);
|
|
4292
|
+
));
|
|
4759
4293
|
};
|
|
4760
4294
|
Markdown.displayName = "Markdown";
|
|
4761
4295
|
|
|
4762
4296
|
// src/components/MenuButton/MenuButton.tsx
|
|
4763
4297
|
import React31 from "react";
|
|
4764
|
-
import {
|
|
4765
|
-
MenuButton as JoyMenuButton3,
|
|
4766
|
-
Button as JoyButton2
|
|
4767
|
-
} from "@mui/joy";
|
|
4298
|
+
import { MenuButton as JoyMenuButton3, Button as JoyButton2 } from "@mui/joy";
|
|
4768
4299
|
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
4769
4300
|
function MenuButton(props) {
|
|
4770
4301
|
const {
|
|
@@ -4811,27 +4342,12 @@ function MenuButton(props) {
|
|
|
4811
4342
|
endDecorator: showIcon ? /* @__PURE__ */ React31.createElement(React31.Fragment, null, endDecorator, /* @__PURE__ */ React31.createElement(ExpandMoreIcon, null)) : /* @__PURE__ */ React31.createElement(React31.Fragment, null, endDecorator)
|
|
4812
4343
|
},
|
|
4813
4344
|
buttonText
|
|
4814
|
-
), /* @__PURE__ */ React31.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React31.createElement(
|
|
4815
|
-
MenuItem,
|
|
4816
|
-
{
|
|
4817
|
-
key: i.text,
|
|
4818
|
-
component: i.component,
|
|
4819
|
-
...i.componentProps ?? {}
|
|
4820
|
-
},
|
|
4821
|
-
i.text
|
|
4822
|
-
))));
|
|
4345
|
+
), /* @__PURE__ */ React31.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React31.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
4823
4346
|
}
|
|
4824
4347
|
MenuButton.displayName = "MenuButton";
|
|
4825
4348
|
|
|
4826
4349
|
// src/components/MonthPicker/MonthPicker.tsx
|
|
4827
|
-
import React32, {
|
|
4828
|
-
forwardRef as forwardRef9,
|
|
4829
|
-
useCallback as useCallback11,
|
|
4830
|
-
useEffect as useEffect8,
|
|
4831
|
-
useImperativeHandle as useImperativeHandle4,
|
|
4832
|
-
useRef as useRef6,
|
|
4833
|
-
useState as useState9
|
|
4834
|
-
} from "react";
|
|
4350
|
+
import React32, { forwardRef as forwardRef9, useCallback as useCallback11, useEffect as useEffect8, useImperativeHandle as useImperativeHandle4, useRef as useRef6, useState as useState9 } from "react";
|
|
4835
4351
|
import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
|
|
4836
4352
|
import { styled as styled20, useThemeProps as useThemeProps6 } from "@mui/joy";
|
|
4837
4353
|
import { FocusTrap as FocusTrap3, ClickAwayListener as ClickAwayListener3, Popper as Popper4 } from "@mui/base";
|
|
@@ -4886,226 +4402,205 @@ function parseDate3(dateString, format) {
|
|
|
4886
4402
|
const result = new Date(year, month, day);
|
|
4887
4403
|
return result;
|
|
4888
4404
|
}
|
|
4889
|
-
var MonthPicker = forwardRef9(
|
|
4890
|
-
(inProps,
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4405
|
+
var MonthPicker = forwardRef9((inProps, ref) => {
|
|
4406
|
+
const props = useThemeProps6({ props: inProps, name: "MonthPicker" });
|
|
4407
|
+
const {
|
|
4408
|
+
onChange,
|
|
4409
|
+
disabled,
|
|
4410
|
+
label,
|
|
4411
|
+
error,
|
|
4412
|
+
helperText,
|
|
4413
|
+
minDate,
|
|
4414
|
+
maxDate,
|
|
4415
|
+
disableFuture,
|
|
4416
|
+
disablePast,
|
|
4417
|
+
required,
|
|
4418
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4419
|
+
sx,
|
|
4420
|
+
className,
|
|
4421
|
+
/**
|
|
4422
|
+
* NOTE: 현재 CalendarDate는 YYYY-MM-DD로 개발하고 있어 date를 포함하여 value를 관리한다.
|
|
4423
|
+
* @see https://ecubelabs.atlassian.net/wiki/spaces/SW/pages/1938784349/Date#CalendarDate
|
|
4424
|
+
* @see https://github.com/Ecube-Labs/hds/pull/145
|
|
4425
|
+
*/
|
|
4426
|
+
format = "YYYY/MM/DD",
|
|
4427
|
+
displayFormat = "YYYY/MM",
|
|
4428
|
+
size,
|
|
4429
|
+
locale,
|
|
4430
|
+
...innerProps
|
|
4431
|
+
} = props;
|
|
4432
|
+
const innerRef = useRef6(null);
|
|
4433
|
+
const buttonRef = useRef6(null);
|
|
4434
|
+
const [value, setValue, isControlled] = useControlledState(
|
|
4435
|
+
props.value,
|
|
4436
|
+
props.defaultValue || "",
|
|
4437
|
+
useCallback11((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4438
|
+
);
|
|
4439
|
+
const getFormattedDisplayValue = useCallback11(
|
|
4440
|
+
(inputValue) => {
|
|
4441
|
+
if (!inputValue) return "";
|
|
4442
|
+
try {
|
|
4443
|
+
return formatValueString3(parseDate3(inputValue, format), displayFormat, locale);
|
|
4444
|
+
} catch (e) {
|
|
4445
|
+
return inputValue;
|
|
4446
|
+
}
|
|
4447
|
+
},
|
|
4448
|
+
[format, displayFormat, locale]
|
|
4449
|
+
);
|
|
4450
|
+
const [displayValue, setDisplayValue] = useState9(() => getFormattedDisplayValue(value));
|
|
4451
|
+
const [anchorEl, setAnchorEl] = useState9(null);
|
|
4452
|
+
const open = Boolean(anchorEl);
|
|
4453
|
+
useEffect8(() => {
|
|
4454
|
+
if (!anchorEl) {
|
|
4455
|
+
innerRef.current?.blur();
|
|
4456
|
+
}
|
|
4457
|
+
}, [anchorEl, innerRef]);
|
|
4458
|
+
useImperativeHandle4(ref, () => innerRef.current, [innerRef]);
|
|
4459
|
+
useEffect8(() => {
|
|
4460
|
+
setDisplayValue(getFormattedDisplayValue(value));
|
|
4461
|
+
}, [value, getFormattedDisplayValue]);
|
|
4462
|
+
const handleChange = useCallback11(
|
|
4463
|
+
(event) => {
|
|
4464
|
+
const newValue = event.target.value;
|
|
4465
|
+
setValue(newValue);
|
|
4466
|
+
if (!isControlled) {
|
|
4467
|
+
setDisplayValue(getFormattedDisplayValue(newValue));
|
|
4468
|
+
}
|
|
4469
|
+
},
|
|
4470
|
+
[setValue, getFormattedDisplayValue, isControlled]
|
|
4471
|
+
);
|
|
4472
|
+
const handleCalendarToggle = useCallback11(
|
|
4473
|
+
(event) => {
|
|
4474
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4475
|
+
innerRef.current?.focus();
|
|
4476
|
+
},
|
|
4477
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
4478
|
+
);
|
|
4479
|
+
const handleInputMouseDown = useCallback11(
|
|
4480
|
+
(event) => {
|
|
4481
|
+
event.preventDefault();
|
|
4482
|
+
buttonRef.current?.focus();
|
|
4483
|
+
},
|
|
4484
|
+
[buttonRef]
|
|
4485
|
+
);
|
|
4486
|
+
return /* @__PURE__ */ React32.createElement(MonthPickerRoot, null, /* @__PURE__ */ React32.createElement(FocusTrap3, { open: true }, /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(
|
|
4487
|
+
Input_default,
|
|
4488
|
+
{
|
|
4489
|
+
...innerProps,
|
|
4490
|
+
color: error ? "danger" : innerProps.color,
|
|
4491
|
+
ref: innerRef,
|
|
4492
|
+
size,
|
|
4493
|
+
value: displayValue,
|
|
4494
|
+
placeholder: displayFormat,
|
|
4894
4495
|
disabled,
|
|
4895
|
-
label,
|
|
4896
|
-
error,
|
|
4897
|
-
helperText,
|
|
4898
|
-
minDate,
|
|
4899
|
-
maxDate,
|
|
4900
|
-
disableFuture,
|
|
4901
|
-
disablePast,
|
|
4902
4496
|
required,
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
size,
|
|
4914
|
-
locale,
|
|
4915
|
-
...innerProps
|
|
4916
|
-
} = props;
|
|
4917
|
-
const innerRef = useRef6(null);
|
|
4918
|
-
const buttonRef = useRef6(null);
|
|
4919
|
-
const [value, setValue, isControlled] = useControlledState(
|
|
4920
|
-
props.value,
|
|
4921
|
-
props.defaultValue || "",
|
|
4922
|
-
useCallback11(
|
|
4923
|
-
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4924
|
-
[props.name, onChange]
|
|
4925
|
-
)
|
|
4926
|
-
);
|
|
4927
|
-
const getFormattedDisplayValue = useCallback11(
|
|
4928
|
-
(inputValue) => {
|
|
4929
|
-
if (!inputValue) return "";
|
|
4930
|
-
try {
|
|
4931
|
-
return formatValueString3(
|
|
4932
|
-
parseDate3(inputValue, format),
|
|
4933
|
-
displayFormat,
|
|
4934
|
-
locale
|
|
4935
|
-
);
|
|
4936
|
-
} catch (e) {
|
|
4937
|
-
return inputValue;
|
|
4938
|
-
}
|
|
4939
|
-
},
|
|
4940
|
-
[format, displayFormat, locale]
|
|
4941
|
-
);
|
|
4942
|
-
const [displayValue, setDisplayValue] = useState9(
|
|
4943
|
-
() => getFormattedDisplayValue(value)
|
|
4944
|
-
);
|
|
4945
|
-
const [anchorEl, setAnchorEl] = useState9(null);
|
|
4946
|
-
const open = Boolean(anchorEl);
|
|
4947
|
-
useEffect8(() => {
|
|
4948
|
-
if (!anchorEl) {
|
|
4949
|
-
innerRef.current?.blur();
|
|
4950
|
-
}
|
|
4951
|
-
}, [anchorEl, innerRef]);
|
|
4952
|
-
useImperativeHandle4(ref, () => innerRef.current, [
|
|
4953
|
-
innerRef
|
|
4954
|
-
]);
|
|
4955
|
-
useEffect8(() => {
|
|
4956
|
-
setDisplayValue(getFormattedDisplayValue(value));
|
|
4957
|
-
}, [value, getFormattedDisplayValue]);
|
|
4958
|
-
const handleChange = useCallback11(
|
|
4959
|
-
(event) => {
|
|
4960
|
-
const newValue = event.target.value;
|
|
4961
|
-
setValue(newValue);
|
|
4962
|
-
if (!isControlled) {
|
|
4963
|
-
setDisplayValue(getFormattedDisplayValue(newValue));
|
|
4497
|
+
slotProps: {
|
|
4498
|
+
input: {
|
|
4499
|
+
ref: innerRef,
|
|
4500
|
+
format: displayFormat,
|
|
4501
|
+
sx: {
|
|
4502
|
+
"&:hover": {
|
|
4503
|
+
cursor: "default"
|
|
4504
|
+
}
|
|
4505
|
+
},
|
|
4506
|
+
onMouseDown: handleInputMouseDown
|
|
4964
4507
|
}
|
|
4965
4508
|
},
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
},
|
|
4973
|
-
[anchorEl, setAnchorEl, innerRef]
|
|
4974
|
-
);
|
|
4975
|
-
const handleInputMouseDown = useCallback11(
|
|
4976
|
-
(event) => {
|
|
4977
|
-
event.preventDefault();
|
|
4978
|
-
buttonRef.current?.focus();
|
|
4509
|
+
error,
|
|
4510
|
+
className,
|
|
4511
|
+
sx: {
|
|
4512
|
+
...sx,
|
|
4513
|
+
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
4514
|
+
fontFamily: "monospace"
|
|
4979
4515
|
},
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
disabled,
|
|
4992
|
-
required,
|
|
4993
|
-
slotProps: {
|
|
4994
|
-
input: {
|
|
4995
|
-
ref: innerRef,
|
|
4996
|
-
format: displayFormat,
|
|
4997
|
-
sx: {
|
|
4998
|
-
"&:hover": {
|
|
4999
|
-
cursor: "default"
|
|
5000
|
-
}
|
|
5001
|
-
},
|
|
5002
|
-
onMouseDown: handleInputMouseDown
|
|
5003
|
-
}
|
|
4516
|
+
endDecorator: /* @__PURE__ */ React32.createElement(
|
|
4517
|
+
IconButton_default,
|
|
4518
|
+
{
|
|
4519
|
+
ref: buttonRef,
|
|
4520
|
+
variant: "plain",
|
|
4521
|
+
onClick: handleCalendarToggle,
|
|
4522
|
+
"aria-label": "Toggle Calendar",
|
|
4523
|
+
"aria-controls": "month-picker-popper",
|
|
4524
|
+
"aria-haspopup": "dialog",
|
|
4525
|
+
"aria-expanded": open,
|
|
4526
|
+
disabled
|
|
5004
4527
|
},
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
4528
|
+
/* @__PURE__ */ React32.createElement(CalendarTodayIcon3, null)
|
|
4529
|
+
),
|
|
4530
|
+
label,
|
|
4531
|
+
helperText
|
|
4532
|
+
}
|
|
4533
|
+
), open && /* @__PURE__ */ React32.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React32.createElement(
|
|
4534
|
+
StyledPopper3,
|
|
4535
|
+
{
|
|
4536
|
+
id: "month-picker-popper",
|
|
4537
|
+
open: true,
|
|
4538
|
+
anchorEl,
|
|
4539
|
+
placement: "bottom-end",
|
|
4540
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4541
|
+
modifiers: [
|
|
4542
|
+
{
|
|
4543
|
+
name: "offset",
|
|
4544
|
+
options: {
|
|
4545
|
+
offset: [4, 4]
|
|
4546
|
+
}
|
|
4547
|
+
}
|
|
4548
|
+
],
|
|
4549
|
+
"aria-label": "Calendar Tooltip",
|
|
4550
|
+
"aria-expanded": open
|
|
4551
|
+
},
|
|
4552
|
+
/* @__PURE__ */ React32.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React32.createElement(
|
|
4553
|
+
Calendar_default,
|
|
4554
|
+
{
|
|
4555
|
+
view: "month",
|
|
4556
|
+
views: ["month"],
|
|
4557
|
+
value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
|
|
4558
|
+
onChange: ([date]) => {
|
|
4559
|
+
handleChange({
|
|
4560
|
+
target: {
|
|
4561
|
+
name: props.name,
|
|
4562
|
+
value: formatValueString3(date, format, locale)
|
|
4563
|
+
}
|
|
4564
|
+
});
|
|
4565
|
+
setAnchorEl(null);
|
|
5011
4566
|
},
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
onClick: handleCalendarToggle,
|
|
5018
|
-
"aria-label": "Toggle Calendar",
|
|
5019
|
-
"aria-controls": "month-picker-popper",
|
|
5020
|
-
"aria-haspopup": "dialog",
|
|
5021
|
-
"aria-expanded": open,
|
|
5022
|
-
disabled
|
|
5023
|
-
},
|
|
5024
|
-
/* @__PURE__ */ React32.createElement(CalendarTodayIcon3, null)
|
|
5025
|
-
),
|
|
5026
|
-
label,
|
|
5027
|
-
helperText
|
|
4567
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
4568
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4569
|
+
disableFuture,
|
|
4570
|
+
disablePast,
|
|
4571
|
+
locale
|
|
5028
4572
|
}
|
|
5029
|
-
),
|
|
5030
|
-
|
|
4573
|
+
), /* @__PURE__ */ React32.createElement(
|
|
4574
|
+
DialogActions_default,
|
|
5031
4575
|
{
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
placement: "bottom-end",
|
|
5036
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
5037
|
-
modifiers: [
|
|
5038
|
-
{
|
|
5039
|
-
name: "offset",
|
|
5040
|
-
options: {
|
|
5041
|
-
offset: [4, 4]
|
|
5042
|
-
}
|
|
5043
|
-
}
|
|
5044
|
-
],
|
|
5045
|
-
"aria-label": "Calendar Tooltip",
|
|
5046
|
-
"aria-expanded": open
|
|
4576
|
+
sx: {
|
|
4577
|
+
p: 1
|
|
4578
|
+
}
|
|
5047
4579
|
},
|
|
5048
|
-
/* @__PURE__ */ React32.createElement(
|
|
5049
|
-
|
|
4580
|
+
/* @__PURE__ */ React32.createElement(
|
|
4581
|
+
Button_default,
|
|
5050
4582
|
{
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
4583
|
+
size,
|
|
4584
|
+
variant: "plain",
|
|
4585
|
+
color: "neutral",
|
|
4586
|
+
onClick: () => {
|
|
5055
4587
|
handleChange({
|
|
5056
4588
|
target: {
|
|
5057
4589
|
name: props.name,
|
|
5058
|
-
value:
|
|
4590
|
+
value: ""
|
|
5059
4591
|
}
|
|
5060
4592
|
});
|
|
5061
4593
|
setAnchorEl(null);
|
|
5062
|
-
},
|
|
5063
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
5064
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
5065
|
-
disableFuture,
|
|
5066
|
-
disablePast,
|
|
5067
|
-
locale
|
|
5068
|
-
}
|
|
5069
|
-
), /* @__PURE__ */ React32.createElement(
|
|
5070
|
-
DialogActions_default,
|
|
5071
|
-
{
|
|
5072
|
-
sx: {
|
|
5073
|
-
p: 1
|
|
5074
4594
|
}
|
|
5075
4595
|
},
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
color: "neutral",
|
|
5082
|
-
onClick: () => {
|
|
5083
|
-
handleChange({
|
|
5084
|
-
target: {
|
|
5085
|
-
name: props.name,
|
|
5086
|
-
value: ""
|
|
5087
|
-
}
|
|
5088
|
-
});
|
|
5089
|
-
setAnchorEl(null);
|
|
5090
|
-
}
|
|
5091
|
-
},
|
|
5092
|
-
"Clear"
|
|
5093
|
-
)
|
|
5094
|
-
))
|
|
5095
|
-
)))));
|
|
5096
|
-
}
|
|
5097
|
-
);
|
|
4596
|
+
"Clear"
|
|
4597
|
+
)
|
|
4598
|
+
))
|
|
4599
|
+
)))));
|
|
4600
|
+
});
|
|
5098
4601
|
|
|
5099
4602
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
5100
|
-
import React33, {
|
|
5101
|
-
forwardRef as forwardRef10,
|
|
5102
|
-
useCallback as useCallback12,
|
|
5103
|
-
useEffect as useEffect9,
|
|
5104
|
-
useImperativeHandle as useImperativeHandle5,
|
|
5105
|
-
useMemo as useMemo10,
|
|
5106
|
-
useRef as useRef7,
|
|
5107
|
-
useState as useState10
|
|
5108
|
-
} from "react";
|
|
4603
|
+
import React33, { forwardRef as forwardRef10, useCallback as useCallback12, useEffect as useEffect9, useImperativeHandle as useImperativeHandle5, useMemo as useMemo10, useRef as useRef7, useState as useState10 } from "react";
|
|
5109
4604
|
import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
|
|
5110
4605
|
import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
|
|
5111
4606
|
import { styled as styled21, useThemeProps as useThemeProps7 } from "@mui/joy";
|
|
@@ -5163,196 +4658,184 @@ var parseDates2 = (str) => {
|
|
|
5163
4658
|
var formatToPattern3 = (format) => {
|
|
5164
4659
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
|
|
5165
4660
|
};
|
|
5166
|
-
var TextMaskAdapter7 = React33.forwardRef(
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
maxLength: 2
|
|
5183
|
-
},
|
|
5184
|
-
Y: {
|
|
5185
|
-
mask: IMask3.MaskedRange,
|
|
5186
|
-
from: 1900,
|
|
5187
|
-
to: 9999
|
|
5188
|
-
}
|
|
4661
|
+
var TextMaskAdapter7 = React33.forwardRef(function TextMaskAdapter8(props, ref) {
|
|
4662
|
+
const { onChange, format, ...other } = props;
|
|
4663
|
+
return /* @__PURE__ */ React33.createElement(
|
|
4664
|
+
IMaskInput3,
|
|
4665
|
+
{
|
|
4666
|
+
...other,
|
|
4667
|
+
inputRef: ref,
|
|
4668
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
4669
|
+
mask: Date,
|
|
4670
|
+
pattern: formatToPattern3(format),
|
|
4671
|
+
blocks: {
|
|
4672
|
+
m: {
|
|
4673
|
+
mask: IMask3.MaskedRange,
|
|
4674
|
+
from: 1,
|
|
4675
|
+
to: 12,
|
|
4676
|
+
maxLength: 2
|
|
5189
4677
|
},
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
4678
|
+
Y: {
|
|
4679
|
+
mask: IMask3.MaskedRange,
|
|
4680
|
+
from: 1900,
|
|
4681
|
+
to: 9999
|
|
4682
|
+
}
|
|
4683
|
+
},
|
|
4684
|
+
format: (dates) => formatValueString4(dates, format),
|
|
4685
|
+
parse: parseDates2,
|
|
4686
|
+
autofix: "pad",
|
|
4687
|
+
overwrite: true
|
|
4688
|
+
}
|
|
4689
|
+
);
|
|
4690
|
+
});
|
|
4691
|
+
var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
4692
|
+
const props = useThemeProps7({ props: inProps, name: "MonthRangePicker" });
|
|
4693
|
+
const {
|
|
4694
|
+
onChange,
|
|
4695
|
+
disabled,
|
|
4696
|
+
label,
|
|
4697
|
+
error,
|
|
4698
|
+
helperText,
|
|
4699
|
+
minDate,
|
|
4700
|
+
maxDate,
|
|
4701
|
+
disableFuture,
|
|
4702
|
+
disablePast,
|
|
4703
|
+
required,
|
|
4704
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4705
|
+
sx,
|
|
4706
|
+
className,
|
|
4707
|
+
format = "YYYY/MM",
|
|
4708
|
+
size,
|
|
4709
|
+
...innerProps
|
|
4710
|
+
} = props;
|
|
4711
|
+
const innerRef = useRef7(null);
|
|
4712
|
+
const [value, setValue] = useControlledState(
|
|
4713
|
+
props.value,
|
|
4714
|
+
props.defaultValue || "",
|
|
4715
|
+
useCallback12((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4716
|
+
);
|
|
4717
|
+
const [anchorEl, setAnchorEl] = useState10(null);
|
|
4718
|
+
const open = Boolean(anchorEl);
|
|
4719
|
+
const calendarValue = useMemo10(() => value ? parseDates2(value) : void 0, [value]);
|
|
4720
|
+
useEffect9(() => {
|
|
4721
|
+
if (!anchorEl) {
|
|
4722
|
+
innerRef.current?.blur();
|
|
4723
|
+
}
|
|
4724
|
+
}, [anchorEl, innerRef]);
|
|
4725
|
+
useImperativeHandle5(ref, () => innerRef.current, [innerRef]);
|
|
4726
|
+
const handleChange = useCallback12(
|
|
4727
|
+
(event) => {
|
|
4728
|
+
setValue(event.target.value);
|
|
4729
|
+
},
|
|
4730
|
+
[setValue]
|
|
4731
|
+
);
|
|
4732
|
+
const handleCalendarToggle = useCallback12(
|
|
4733
|
+
(event) => {
|
|
4734
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4735
|
+
innerRef.current?.focus();
|
|
4736
|
+
},
|
|
4737
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
4738
|
+
);
|
|
4739
|
+
const handleCalendarChange = useCallback12(
|
|
4740
|
+
([date1, date2]) => {
|
|
4741
|
+
if (!date1 || !date2) return;
|
|
4742
|
+
setValue(formatValueString4([date1, date2], format));
|
|
4743
|
+
setAnchorEl(null);
|
|
4744
|
+
},
|
|
4745
|
+
[setValue, setAnchorEl, format]
|
|
4746
|
+
);
|
|
4747
|
+
return /* @__PURE__ */ React33.createElement(MonthRangePickerRoot, null, /* @__PURE__ */ React33.createElement(FocusTrap4, { open: true }, /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(
|
|
4748
|
+
Input_default,
|
|
4749
|
+
{
|
|
4750
|
+
...innerProps,
|
|
4751
|
+
color: error ? "danger" : innerProps.color,
|
|
4752
|
+
ref,
|
|
4753
|
+
size,
|
|
4754
|
+
value,
|
|
4755
|
+
onChange: handleChange,
|
|
5203
4756
|
disabled,
|
|
5204
|
-
label,
|
|
5205
|
-
error,
|
|
5206
|
-
helperText,
|
|
5207
|
-
minDate,
|
|
5208
|
-
maxDate,
|
|
5209
|
-
disableFuture,
|
|
5210
|
-
disablePast,
|
|
5211
4757
|
required,
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
format = "YYYY/MM",
|
|
5216
|
-
size,
|
|
5217
|
-
...innerProps
|
|
5218
|
-
} = props;
|
|
5219
|
-
const innerRef = useRef7(null);
|
|
5220
|
-
const [value, setValue] = useControlledState(
|
|
5221
|
-
props.value,
|
|
5222
|
-
props.defaultValue || "",
|
|
5223
|
-
useCallback12(
|
|
5224
|
-
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
5225
|
-
[props.name, onChange]
|
|
5226
|
-
)
|
|
5227
|
-
);
|
|
5228
|
-
const [anchorEl, setAnchorEl] = useState10(null);
|
|
5229
|
-
const open = Boolean(anchorEl);
|
|
5230
|
-
const calendarValue = useMemo10(
|
|
5231
|
-
() => value ? parseDates2(value) : void 0,
|
|
5232
|
-
[value]
|
|
5233
|
-
);
|
|
5234
|
-
useEffect9(() => {
|
|
5235
|
-
if (!anchorEl) {
|
|
5236
|
-
innerRef.current?.blur();
|
|
5237
|
-
}
|
|
5238
|
-
}, [anchorEl, innerRef]);
|
|
5239
|
-
useImperativeHandle5(ref, () => innerRef.current, [
|
|
5240
|
-
innerRef
|
|
5241
|
-
]);
|
|
5242
|
-
const handleChange = useCallback12(
|
|
5243
|
-
(event) => {
|
|
5244
|
-
setValue(event.target.value);
|
|
5245
|
-
},
|
|
5246
|
-
[setValue]
|
|
5247
|
-
);
|
|
5248
|
-
const handleCalendarToggle = useCallback12(
|
|
5249
|
-
(event) => {
|
|
5250
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5251
|
-
innerRef.current?.focus();
|
|
4758
|
+
placeholder: `${format} - ${format}`,
|
|
4759
|
+
slotProps: {
|
|
4760
|
+
input: { component: TextMaskAdapter7, ref: innerRef, format }
|
|
5252
4761
|
},
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
setAnchorEl(null);
|
|
4762
|
+
error,
|
|
4763
|
+
className,
|
|
4764
|
+
sx: {
|
|
4765
|
+
...sx,
|
|
4766
|
+
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
4767
|
+
fontFamily: "monospace"
|
|
5260
4768
|
},
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
value,
|
|
5271
|
-
onChange: handleChange,
|
|
5272
|
-
disabled,
|
|
5273
|
-
required,
|
|
5274
|
-
placeholder: `${format} - ${format}`,
|
|
5275
|
-
slotProps: {
|
|
5276
|
-
input: { component: TextMaskAdapter7, ref: innerRef, format }
|
|
5277
|
-
},
|
|
5278
|
-
error,
|
|
5279
|
-
className,
|
|
5280
|
-
sx: {
|
|
5281
|
-
...sx,
|
|
5282
|
-
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
5283
|
-
fontFamily: "monospace"
|
|
4769
|
+
endDecorator: /* @__PURE__ */ React33.createElement(
|
|
4770
|
+
IconButton_default,
|
|
4771
|
+
{
|
|
4772
|
+
variant: "plain",
|
|
4773
|
+
onClick: handleCalendarToggle,
|
|
4774
|
+
"aria-label": "Toggle Calendar",
|
|
4775
|
+
"aria-controls": "month-range-picker-popper",
|
|
4776
|
+
"aria-haspopup": "dialog",
|
|
4777
|
+
"aria-expanded": open
|
|
5284
4778
|
},
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
4779
|
+
/* @__PURE__ */ React33.createElement(CalendarTodayIcon4, null)
|
|
4780
|
+
),
|
|
4781
|
+
label,
|
|
4782
|
+
helperText
|
|
4783
|
+
}
|
|
4784
|
+
), open && /* @__PURE__ */ React33.createElement(ClickAwayListener4, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React33.createElement(
|
|
4785
|
+
StyledPopper4,
|
|
4786
|
+
{
|
|
4787
|
+
id: "month-range-picker-popper",
|
|
4788
|
+
open: true,
|
|
4789
|
+
anchorEl,
|
|
4790
|
+
placement: "bottom-end",
|
|
4791
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4792
|
+
modifiers: [
|
|
4793
|
+
{
|
|
4794
|
+
name: "offset",
|
|
4795
|
+
options: {
|
|
4796
|
+
offset: [4, 4]
|
|
4797
|
+
}
|
|
4798
|
+
}
|
|
4799
|
+
],
|
|
4800
|
+
"aria-label": "Calendar Tooltip",
|
|
4801
|
+
"aria-expanded": open
|
|
4802
|
+
},
|
|
4803
|
+
/* @__PURE__ */ React33.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React33.createElement(
|
|
4804
|
+
Calendar_default,
|
|
4805
|
+
{
|
|
4806
|
+
view: "month",
|
|
4807
|
+
views: ["month"],
|
|
4808
|
+
rangeSelection: true,
|
|
4809
|
+
defaultValue: calendarValue,
|
|
4810
|
+
onChange: handleCalendarChange,
|
|
4811
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
4812
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4813
|
+
disableFuture,
|
|
4814
|
+
disablePast
|
|
5299
4815
|
}
|
|
5300
|
-
),
|
|
5301
|
-
|
|
4816
|
+
), /* @__PURE__ */ React33.createElement(
|
|
4817
|
+
DialogActions_default,
|
|
5302
4818
|
{
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
anchorEl,
|
|
5306
|
-
placement: "bottom-end",
|
|
5307
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
5308
|
-
modifiers: [
|
|
5309
|
-
{
|
|
5310
|
-
name: "offset",
|
|
5311
|
-
options: {
|
|
5312
|
-
offset: [4, 4]
|
|
5313
|
-
}
|
|
5314
|
-
}
|
|
5315
|
-
],
|
|
5316
|
-
"aria-label": "Calendar Tooltip",
|
|
5317
|
-
"aria-expanded": open
|
|
5318
|
-
},
|
|
5319
|
-
/* @__PURE__ */ React33.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React33.createElement(
|
|
5320
|
-
Calendar_default,
|
|
5321
|
-
{
|
|
5322
|
-
view: "month",
|
|
5323
|
-
views: ["month"],
|
|
5324
|
-
rangeSelection: true,
|
|
5325
|
-
defaultValue: calendarValue,
|
|
5326
|
-
onChange: handleCalendarChange,
|
|
5327
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
5328
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
5329
|
-
disableFuture,
|
|
5330
|
-
disablePast
|
|
4819
|
+
sx: {
|
|
4820
|
+
p: 1
|
|
5331
4821
|
}
|
|
5332
|
-
|
|
5333
|
-
|
|
4822
|
+
},
|
|
4823
|
+
/* @__PURE__ */ React33.createElement(
|
|
4824
|
+
Button_default,
|
|
5334
4825
|
{
|
|
5335
|
-
|
|
5336
|
-
|
|
4826
|
+
size,
|
|
4827
|
+
variant: "plain",
|
|
4828
|
+
color: "neutral",
|
|
4829
|
+
onClick: () => {
|
|
4830
|
+
setValue("");
|
|
4831
|
+
setAnchorEl(null);
|
|
5337
4832
|
}
|
|
5338
4833
|
},
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
color: "neutral",
|
|
5345
|
-
onClick: () => {
|
|
5346
|
-
setValue("");
|
|
5347
|
-
setAnchorEl(null);
|
|
5348
|
-
}
|
|
5349
|
-
},
|
|
5350
|
-
"Clear"
|
|
5351
|
-
)
|
|
5352
|
-
))
|
|
5353
|
-
)))));
|
|
5354
|
-
}
|
|
5355
|
-
);
|
|
4834
|
+
"Clear"
|
|
4835
|
+
)
|
|
4836
|
+
))
|
|
4837
|
+
)))));
|
|
4838
|
+
});
|
|
5356
4839
|
MonthRangePicker.displayName = "MonthRangePicker";
|
|
5357
4840
|
|
|
5358
4841
|
// src/components/NavigationGroup/NavigationGroup.tsx
|
|
@@ -5465,7 +4948,7 @@ function Navigator(props) {
|
|
|
5465
4948
|
return /* @__PURE__ */ React36.createElement(
|
|
5466
4949
|
NavigationGroup,
|
|
5467
4950
|
{
|
|
5468
|
-
key: index
|
|
4951
|
+
key: `${item.title}-${index}`,
|
|
5469
4952
|
title: item.title,
|
|
5470
4953
|
startDecorator: item.startDecorator,
|
|
5471
4954
|
level,
|
|
@@ -5487,115 +4970,112 @@ var padDecimal = (value, decimalScale) => {
|
|
|
5487
4970
|
const [integer, decimal = ""] = `${value}`.split(".");
|
|
5488
4971
|
return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
|
|
5489
4972
|
};
|
|
5490
|
-
var TextMaskAdapter9 = React37.forwardRef(
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
}
|
|
5513
|
-
);
|
|
4973
|
+
var TextMaskAdapter9 = React37.forwardRef(function TextMaskAdapter10(props, ref) {
|
|
4974
|
+
const { onChange, min, max, ...innerProps } = props;
|
|
4975
|
+
return /* @__PURE__ */ React37.createElement(
|
|
4976
|
+
NumericFormat2,
|
|
4977
|
+
{
|
|
4978
|
+
...innerProps,
|
|
4979
|
+
onValueChange: ({ value }) => {
|
|
4980
|
+
onChange?.({
|
|
4981
|
+
target: {
|
|
4982
|
+
name: props.name,
|
|
4983
|
+
value
|
|
4984
|
+
}
|
|
4985
|
+
});
|
|
4986
|
+
},
|
|
4987
|
+
valueIsNumericString: true,
|
|
4988
|
+
thousandSeparator: true,
|
|
4989
|
+
suffix: "%",
|
|
4990
|
+
getInputRef: ref,
|
|
4991
|
+
allowNegative: true
|
|
4992
|
+
}
|
|
4993
|
+
);
|
|
4994
|
+
});
|
|
5514
4995
|
var PercentageInputRoot = styled24(Input_default, {
|
|
5515
4996
|
name: "PercentageInput",
|
|
5516
4997
|
slot: "Root",
|
|
5517
4998
|
overridesResolver: (props, styles) => styles.root
|
|
5518
4999
|
})({});
|
|
5519
|
-
var PercentageInput = React37.forwardRef(
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
error,
|
|
5526
|
-
helperText,
|
|
5527
|
-
required,
|
|
5528
|
-
disabled,
|
|
5529
|
-
useMinorUnit,
|
|
5530
|
-
maxDecimalScale = 0,
|
|
5531
|
-
min,
|
|
5532
|
-
max,
|
|
5533
|
-
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
5534
|
-
sx,
|
|
5535
|
-
className,
|
|
5536
|
-
...innerProps
|
|
5537
|
-
} = props;
|
|
5538
|
-
const [_value, setValue] = useControlledState(
|
|
5539
|
-
props.value,
|
|
5540
|
-
props.defaultValue,
|
|
5541
|
-
useCallback13(
|
|
5542
|
-
(value2) => onChange?.({ target: { name, value: value2 } }),
|
|
5543
|
-
[onChange, name]
|
|
5544
|
-
)
|
|
5545
|
-
);
|
|
5546
|
-
const [internalError, setInternalError] = useState11(
|
|
5547
|
-
max && _value && _value > max || min && _value && _value < min
|
|
5548
|
-
);
|
|
5549
|
-
const value = useMemo11(() => {
|
|
5550
|
-
if (_value && useMinorUnit) {
|
|
5551
|
-
return _value / Math.pow(10, maxDecimalScale);
|
|
5552
|
-
}
|
|
5553
|
-
return _value;
|
|
5554
|
-
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
5555
|
-
const handleChange = useCallback13(
|
|
5556
|
-
(event) => {
|
|
5557
|
-
if (event.target.value === "") {
|
|
5558
|
-
setValue(void 0);
|
|
5559
|
-
return;
|
|
5560
|
-
}
|
|
5561
|
-
const originalAmount = Number(event.target.value);
|
|
5562
|
-
if (min && originalAmount < min || max && originalAmount > max) {
|
|
5563
|
-
setInternalError(true);
|
|
5564
|
-
} else {
|
|
5565
|
-
setInternalError(false);
|
|
5566
|
-
}
|
|
5567
|
-
const amount = useMinorUnit ? padDecimal(originalAmount, maxDecimalScale) : originalAmount;
|
|
5568
|
-
setValue(amount);
|
|
5569
|
-
},
|
|
5570
|
-
[setValue, useMinorUnit, maxDecimalScale, min, max]
|
|
5571
|
-
);
|
|
5572
|
-
return /* @__PURE__ */ React37.createElement(
|
|
5573
|
-
PercentageInputRoot,
|
|
5574
|
-
{
|
|
5575
|
-
...innerProps,
|
|
5576
|
-
ref,
|
|
5577
|
-
value,
|
|
5578
|
-
onChange: handleChange,
|
|
5579
|
-
error: internalError || error,
|
|
5580
|
-
disabled,
|
|
5581
|
-
required,
|
|
5582
|
-
color: internalError || error ? "danger" : props.color,
|
|
5000
|
+
var PercentageInput = React37.forwardRef(
|
|
5001
|
+
function PercentageInput2(inProps, ref) {
|
|
5002
|
+
const props = useThemeProps8({ props: inProps, name: "PercentageInput" });
|
|
5003
|
+
const {
|
|
5004
|
+
name,
|
|
5005
|
+
onChange,
|
|
5583
5006
|
label,
|
|
5007
|
+
error,
|
|
5584
5008
|
helperText,
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5009
|
+
required,
|
|
5010
|
+
disabled,
|
|
5011
|
+
useMinorUnit,
|
|
5012
|
+
maxDecimalScale = 0,
|
|
5013
|
+
min,
|
|
5014
|
+
max,
|
|
5015
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
5016
|
+
sx,
|
|
5017
|
+
className,
|
|
5018
|
+
...innerProps
|
|
5019
|
+
} = props;
|
|
5020
|
+
const [_value, setValue] = useControlledState(
|
|
5021
|
+
props.value,
|
|
5022
|
+
props.defaultValue,
|
|
5023
|
+
useCallback13((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
5024
|
+
);
|
|
5025
|
+
const [internalError, setInternalError] = useState11(
|
|
5026
|
+
max && _value && _value > max || min && _value && _value < min
|
|
5027
|
+
);
|
|
5028
|
+
const value = useMemo11(() => {
|
|
5029
|
+
if (_value && useMinorUnit) {
|
|
5030
|
+
return _value / Math.pow(10, maxDecimalScale);
|
|
5031
|
+
}
|
|
5032
|
+
return _value;
|
|
5033
|
+
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
5034
|
+
const handleChange = useCallback13(
|
|
5035
|
+
(event) => {
|
|
5036
|
+
if (event.target.value === "") {
|
|
5037
|
+
setValue(void 0);
|
|
5038
|
+
return;
|
|
5590
5039
|
}
|
|
5040
|
+
const originalAmount = Number(event.target.value);
|
|
5041
|
+
if (min && originalAmount < min || max && originalAmount > max) {
|
|
5042
|
+
setInternalError(true);
|
|
5043
|
+
} else {
|
|
5044
|
+
setInternalError(false);
|
|
5045
|
+
}
|
|
5046
|
+
const amount = useMinorUnit ? padDecimal(originalAmount, maxDecimalScale) : originalAmount;
|
|
5047
|
+
setValue(amount);
|
|
5591
5048
|
},
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5049
|
+
[setValue, useMinorUnit, maxDecimalScale, min, max]
|
|
5050
|
+
);
|
|
5051
|
+
return /* @__PURE__ */ React37.createElement(
|
|
5052
|
+
PercentageInputRoot,
|
|
5053
|
+
{
|
|
5054
|
+
...innerProps,
|
|
5055
|
+
ref,
|
|
5056
|
+
value,
|
|
5057
|
+
onChange: handleChange,
|
|
5058
|
+
error: internalError || error,
|
|
5059
|
+
disabled,
|
|
5060
|
+
required,
|
|
5061
|
+
color: internalError || error ? "danger" : props.color,
|
|
5062
|
+
label,
|
|
5063
|
+
helperText,
|
|
5064
|
+
slotProps: {
|
|
5065
|
+
input: {
|
|
5066
|
+
component: TextMaskAdapter9,
|
|
5067
|
+
"aria-label": innerProps["aria-label"],
|
|
5068
|
+
decimalScale: maxDecimalScale
|
|
5069
|
+
}
|
|
5070
|
+
},
|
|
5071
|
+
sx: {
|
|
5072
|
+
...sx
|
|
5073
|
+
},
|
|
5074
|
+
className
|
|
5075
|
+
}
|
|
5076
|
+
);
|
|
5077
|
+
}
|
|
5078
|
+
);
|
|
5599
5079
|
PercentageInput.displayName = "PercentageInput";
|
|
5600
5080
|
|
|
5601
5081
|
// src/components/Radio/Radio.tsx
|
|
@@ -5687,6 +5167,7 @@ function Stepper(props) {
|
|
|
5687
5167
|
return /* @__PURE__ */ React39.createElement(
|
|
5688
5168
|
Step,
|
|
5689
5169
|
{
|
|
5170
|
+
key: `step-${i}`,
|
|
5690
5171
|
indicator: /* @__PURE__ */ React39.createElement(StepIndicator, { variant: "solid", color: "primary" }, completed ? /* @__PURE__ */ React39.createElement(CheckIcon, null) : step.indicatorContent),
|
|
5691
5172
|
active,
|
|
5692
5173
|
completed,
|
|
@@ -5701,11 +5182,7 @@ Stepper.displayName = "Stepper";
|
|
|
5701
5182
|
|
|
5702
5183
|
// src/components/Switch/Switch.tsx
|
|
5703
5184
|
import React40 from "react";
|
|
5704
|
-
import {
|
|
5705
|
-
Switch as JoySwitch,
|
|
5706
|
-
styled as styled26,
|
|
5707
|
-
switchClasses
|
|
5708
|
-
} from "@mui/joy";
|
|
5185
|
+
import { Switch as JoySwitch, styled as styled26, switchClasses } from "@mui/joy";
|
|
5709
5186
|
import { motion as motion29 } from "framer-motion";
|
|
5710
5187
|
var MotionSwitch = motion29(JoySwitch);
|
|
5711
5188
|
var StyledThumb = styled26(motion29.div)({
|
|
@@ -6039,13 +5516,7 @@ function ThemeProvider(props) {
|
|
|
6039
5516
|
ThemeProvider.displayName = "ThemeProvider";
|
|
6040
5517
|
|
|
6041
5518
|
// src/components/Uploader/Uploader.tsx
|
|
6042
|
-
import React43, {
|
|
6043
|
-
useCallback as useCallback14,
|
|
6044
|
-
useEffect as useEffect10,
|
|
6045
|
-
useMemo as useMemo12,
|
|
6046
|
-
useRef as useRef8,
|
|
6047
|
-
useState as useState12
|
|
6048
|
-
} from "react";
|
|
5519
|
+
import React43, { useCallback as useCallback14, useEffect as useEffect10, useMemo as useMemo12, useRef as useRef8, useState as useState12 } from "react";
|
|
6049
5520
|
import { styled as styled28, Input as Input2 } from "@mui/joy";
|
|
6050
5521
|
import MuiFileUploadIcon from "@mui/icons-material/CloudUploadRounded";
|
|
6051
5522
|
import MuiUploadFileIcon from "@mui/icons-material/UploadFileRounded";
|
|
@@ -6104,52 +5575,11 @@ var ClearIcon2 = styled28(MuiClearIcon, {
|
|
|
6104
5575
|
width: "18px",
|
|
6105
5576
|
height: "18px"
|
|
6106
5577
|
}));
|
|
6107
|
-
var UNITS = [
|
|
6108
|
-
"byte",
|
|
6109
|
-
"kilobyte",
|
|
6110
|
-
"megabyte",
|
|
6111
|
-
"gigabyte",
|
|
6112
|
-
"terabyte",
|
|
6113
|
-
"petabyte"
|
|
6114
|
-
];
|
|
5578
|
+
var UNITS = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "petabyte"];
|
|
6115
5579
|
var ALL_EXTENSIONS_BY_TYPE = {
|
|
6116
|
-
"image/*": [
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
".png",
|
|
6120
|
-
".gif",
|
|
6121
|
-
".bmp",
|
|
6122
|
-
".tiff",
|
|
6123
|
-
".svg",
|
|
6124
|
-
".webp",
|
|
6125
|
-
".heic",
|
|
6126
|
-
".ico"
|
|
6127
|
-
],
|
|
6128
|
-
"audio/*": [
|
|
6129
|
-
".mp3",
|
|
6130
|
-
".wav",
|
|
6131
|
-
".flac",
|
|
6132
|
-
".aac",
|
|
6133
|
-
".ogg",
|
|
6134
|
-
".m4a",
|
|
6135
|
-
".wma",
|
|
6136
|
-
".aiff",
|
|
6137
|
-
".alac",
|
|
6138
|
-
".midi",
|
|
6139
|
-
".mp4"
|
|
6140
|
-
],
|
|
6141
|
-
"video/*": [
|
|
6142
|
-
".mp4",
|
|
6143
|
-
".avi",
|
|
6144
|
-
".mkv",
|
|
6145
|
-
".mov",
|
|
6146
|
-
".wmv",
|
|
6147
|
-
".flv",
|
|
6148
|
-
".webm",
|
|
6149
|
-
".mpeg",
|
|
6150
|
-
".3gp",
|
|
6151
|
-
".m4v"
|
|
6152
|
-
]
|
|
5580
|
+
"image/*": [".jpeg", ".jpg", ".png", ".gif", ".bmp", ".tiff", ".svg", ".webp", ".heic", ".ico"],
|
|
5581
|
+
"audio/*": [".mp3", ".wav", ".flac", ".aac", ".ogg", ".m4a", ".wma", ".aiff", ".alac", ".midi", ".mp4"],
|
|
5582
|
+
"video/*": [".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".webm", ".mpeg", ".3gp", ".m4v"]
|
|
6153
5583
|
};
|
|
6154
5584
|
var getFileSize = (n) => {
|
|
6155
5585
|
const i = n == 0 ? 0 : Math.floor(Math.log(n) / Math.log(1024));
|
|
@@ -6163,16 +5593,7 @@ var getFileSize = (n) => {
|
|
|
6163
5593
|
};
|
|
6164
5594
|
var Preview = (props) => {
|
|
6165
5595
|
const { files, uploaded, onDelete } = props;
|
|
6166
|
-
return /* @__PURE__ */ React43.createElement(PreviewRoot, { gap: 1 }, [...uploaded, ...files].map((file) => /* @__PURE__ */ React43.createElement(UploadCard, { key: file.name, size: "sm", color: "neutral" }, /* @__PURE__ */ React43.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2 }, /* @__PURE__ */ React43.createElement(UploadFileIcon, null), /* @__PURE__ */ React43.createElement(Stack_default, { flex: "1" }, /* @__PURE__ */ React43.createElement(Typography_default, { level: "body-sm", textColor: "common.black" }, file.name), !!file.size && /* @__PURE__ */ React43.createElement(
|
|
6167
|
-
Typography_default,
|
|
6168
|
-
{
|
|
6169
|
-
level: "body-xs",
|
|
6170
|
-
fontWeight: "300",
|
|
6171
|
-
lineHeight: "1.33",
|
|
6172
|
-
textColor: "text.tertiary"
|
|
6173
|
-
},
|
|
6174
|
-
getFileSize(file.size)
|
|
6175
|
-
)), /* @__PURE__ */ React43.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ React43.createElement(ClearIcon2, null))))));
|
|
5596
|
+
return /* @__PURE__ */ React43.createElement(PreviewRoot, { gap: 1 }, [...uploaded, ...files].map((file) => /* @__PURE__ */ React43.createElement(UploadCard, { key: file.name, size: "sm", color: "neutral" }, /* @__PURE__ */ React43.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2 }, /* @__PURE__ */ React43.createElement(UploadFileIcon, null), /* @__PURE__ */ React43.createElement(Stack_default, { flex: "1" }, /* @__PURE__ */ React43.createElement(Typography_default, { level: "body-sm", textColor: "common.black" }, file.name), !!file.size && /* @__PURE__ */ React43.createElement(Typography_default, { level: "body-xs", fontWeight: "300", lineHeight: "1.33", textColor: "text.tertiary" }, getFileSize(file.size))), /* @__PURE__ */ React43.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ React43.createElement(ClearIcon2, null))))));
|
|
6176
5597
|
};
|
|
6177
5598
|
var UploaderRoot = styled28(Stack_default, {
|
|
6178
5599
|
name: "Uploader",
|
|
@@ -6184,31 +5605,27 @@ var FileDropZone = styled28(Sheet_default, {
|
|
|
6184
5605
|
name: "Uploader",
|
|
6185
5606
|
slot: "dropZone",
|
|
6186
5607
|
shouldForwardProp: (prop) => prop !== "error"
|
|
6187
|
-
})(
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
})
|
|
6200
|
-
);
|
|
5608
|
+
})(({ theme, state, error }) => ({
|
|
5609
|
+
width: "100%",
|
|
5610
|
+
display: "flex",
|
|
5611
|
+
flexDirection: "column",
|
|
5612
|
+
justifyContent: "center",
|
|
5613
|
+
alignItems: "center",
|
|
5614
|
+
padding: theme.spacing(5),
|
|
5615
|
+
gap: theme.spacing(4),
|
|
5616
|
+
cursor: "pointer",
|
|
5617
|
+
backgroundColor: theme.palette.background.surface,
|
|
5618
|
+
border: error ? `1px solid ${theme.palette.danger.outlinedBorder}` : state === "idle" ? `1px solid ${theme.palette.neutral.outlinedBorder}` : `1px solid ${theme.palette.primary.outlinedBorder}`
|
|
5619
|
+
}));
|
|
6201
5620
|
var UploaderIcon = styled28(MuiFileUploadIcon, {
|
|
6202
5621
|
name: "Uploader",
|
|
6203
5622
|
slot: "iconContainer",
|
|
6204
5623
|
shouldForwardProp: (prop) => prop !== "error"
|
|
6205
|
-
})(
|
|
6206
|
-
({
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
})
|
|
6211
|
-
);
|
|
5624
|
+
})(({ theme, state, error }) => ({
|
|
5625
|
+
color: error ? `rgba(${theme.vars.palette.danger.mainChannel} / 0.6)` : state === "over" ? `rgba(${theme.palette.primary.mainChannel} / 0.6)` : theme.palette.neutral.softActiveBg,
|
|
5626
|
+
width: "32px",
|
|
5627
|
+
height: "32px"
|
|
5628
|
+
}));
|
|
6212
5629
|
var Uploader = React43.memo(
|
|
6213
5630
|
(props) => {
|
|
6214
5631
|
const {
|
|
@@ -6228,14 +5645,9 @@ var Uploader = React43.memo(
|
|
|
6228
5645
|
const inputRef = useRef8(null);
|
|
6229
5646
|
const [errorText, setErrorText] = useState12();
|
|
6230
5647
|
const [files, setFiles] = useState12([]);
|
|
6231
|
-
const [uploaded, setUploaded] = useState12(
|
|
6232
|
-
props.uploaded || []
|
|
6233
|
-
);
|
|
5648
|
+
const [uploaded, setUploaded] = useState12(props.uploaded || []);
|
|
6234
5649
|
const [previewState, setPreviewState] = useState12("idle");
|
|
6235
|
-
const accepts = useMemo12(
|
|
6236
|
-
() => accept.split(",").map((accept2) => accept2.trim()),
|
|
6237
|
-
[accept]
|
|
6238
|
-
);
|
|
5650
|
+
const accepts = useMemo12(() => accept.split(",").map((accept2) => accept2.trim()), [accept]);
|
|
6239
5651
|
const parsedAccepts = useMemo12(
|
|
6240
5652
|
() => accepts.flatMap((type) => {
|
|
6241
5653
|
if (["image/*", "video/*", "audio/*"].includes(type)) {
|
|
@@ -6247,15 +5659,11 @@ var Uploader = React43.memo(
|
|
|
6247
5659
|
);
|
|
6248
5660
|
const helperText = useMemo12(() => {
|
|
6249
5661
|
const [allAcceptedTypes, acceptedTypes] = [
|
|
6250
|
-
accepts.filter(
|
|
6251
|
-
(accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)
|
|
6252
|
-
).map((accept2) => {
|
|
5662
|
+
accepts.filter((accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
|
|
6253
5663
|
const [type] = accept2.split("/");
|
|
6254
5664
|
return type.toLowerCase();
|
|
6255
5665
|
}),
|
|
6256
|
-
accepts.filter(
|
|
6257
|
-
(accept2) => !["image/*", "video/*", "audio/*"].includes(accept2)
|
|
6258
|
-
).map((accept2) => {
|
|
5666
|
+
accepts.filter((accept2) => !["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
|
|
6259
5667
|
const [extensionOrType, subType] = accept2.split("/");
|
|
6260
5668
|
if (!subType) {
|
|
6261
5669
|
return extensionOrType.toUpperCase().replace(".", "");
|
|
@@ -6272,16 +5680,11 @@ var Uploader = React43.memo(
|
|
|
6272
5680
|
}
|
|
6273
5681
|
helperTexts.push(`Maximum ${getFileSize(maxFileTotalSize)}`);
|
|
6274
5682
|
if (maxCount) {
|
|
6275
|
-
helperTexts.push(
|
|
6276
|
-
`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`
|
|
6277
|
-
);
|
|
5683
|
+
helperTexts.push(`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`);
|
|
6278
5684
|
}
|
|
6279
5685
|
return helperTexts.join(", ");
|
|
6280
5686
|
}, [accepts, maxFileTotalSize, maxCount]);
|
|
6281
|
-
const error = useMemo12(
|
|
6282
|
-
() => !!errorText || props.error,
|
|
6283
|
-
[props.error, errorText]
|
|
6284
|
-
);
|
|
5687
|
+
const error = useMemo12(() => !!errorText || props.error, [props.error, errorText]);
|
|
6285
5688
|
const showDropZone = useMemo12(
|
|
6286
5689
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
6287
5690
|
[files, maxCount, uploaded]
|
|
@@ -6308,10 +5711,7 @@ var Uploader = React43.memo(
|
|
|
6308
5711
|
}
|
|
6309
5712
|
});
|
|
6310
5713
|
}
|
|
6311
|
-
const totalFileSize = [...files, ...uploads].reduce(
|
|
6312
|
-
(acc, file) => acc + file.size,
|
|
6313
|
-
0
|
|
6314
|
-
);
|
|
5714
|
+
const totalFileSize = [...files, ...uploads].reduce((acc, file) => acc + file.size, 0);
|
|
6315
5715
|
if (totalFileSize > maxFileTotalSize) {
|
|
6316
5716
|
throw new Error(`Total File size exceeded the maximum limit.`);
|
|
6317
5717
|
}
|
|
@@ -6332,34 +5732,15 @@ var Uploader = React43.memo(
|
|
|
6332
5732
|
setErrorText(err.message);
|
|
6333
5733
|
}
|
|
6334
5734
|
},
|
|
6335
|
-
[
|
|
6336
|
-
files,
|
|
6337
|
-
uploaded,
|
|
6338
|
-
maxCount,
|
|
6339
|
-
parsedAccepts,
|
|
6340
|
-
maxFileSize,
|
|
6341
|
-
maxFileTotalSize,
|
|
6342
|
-
name,
|
|
6343
|
-
onChange
|
|
6344
|
-
]
|
|
5735
|
+
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
6345
5736
|
);
|
|
6346
5737
|
useEffect10(() => {
|
|
6347
5738
|
if (!dropZoneRef.current || disabled) {
|
|
6348
5739
|
return;
|
|
6349
5740
|
}
|
|
6350
5741
|
let cleanup;
|
|
6351
|
-
Promise.all([
|
|
6352
|
-
|
|
6353
|
-
esmFiles.adapter,
|
|
6354
|
-
esmFiles.file,
|
|
6355
|
-
esmFiles.preventUnhandled
|
|
6356
|
-
]).then(
|
|
6357
|
-
([
|
|
6358
|
-
combineModule,
|
|
6359
|
-
adapterModule,
|
|
6360
|
-
fileModule,
|
|
6361
|
-
preventUnhandledModule
|
|
6362
|
-
]) => {
|
|
5742
|
+
Promise.all([esmFiles.combine, esmFiles.adapter, esmFiles.file, esmFiles.preventUnhandled]).then(
|
|
5743
|
+
([combineModule, adapterModule, fileModule, preventUnhandledModule]) => {
|
|
6363
5744
|
const { combine } = combineModule;
|
|
6364
5745
|
const { dropTargetForExternal, monitorForExternal } = adapterModule;
|
|
6365
5746
|
const { containsFiles, getFiles } = fileModule;
|
|
@@ -6394,9 +5775,7 @@ var Uploader = React43.memo(
|
|
|
6394
5775
|
useEffect10(() => {
|
|
6395
5776
|
if (inputRef.current && minCount) {
|
|
6396
5777
|
if (files.length < minCount) {
|
|
6397
|
-
inputRef.current.setCustomValidity(
|
|
6398
|
-
`At least ${minCount} files are required.`
|
|
6399
|
-
);
|
|
5778
|
+
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
6400
5779
|
} else {
|
|
6401
5780
|
inputRef.current.setCustomValidity("");
|
|
6402
5781
|
}
|
|
@@ -6422,9 +5801,7 @@ var Uploader = React43.memo(
|
|
|
6422
5801
|
return current.filter((file) => file !== deletedFile);
|
|
6423
5802
|
});
|
|
6424
5803
|
} else {
|
|
6425
|
-
setUploaded(
|
|
6426
|
-
(uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id)
|
|
6427
|
-
);
|
|
5804
|
+
setUploaded((uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id));
|
|
6428
5805
|
onDelete?.(deletedFile);
|
|
6429
5806
|
}
|
|
6430
5807
|
setErrorText(void 0);
|
|
@@ -6450,9 +5827,7 @@ var Uploader = React43.memo(
|
|
|
6450
5827
|
required: !!minCount,
|
|
6451
5828
|
onInvalid: (e) => {
|
|
6452
5829
|
if (minCount && files.length < minCount) {
|
|
6453
|
-
setErrorText(
|
|
6454
|
-
`Please choose ${minCount} ${minCount === 1 ? "file" : "files"} to upload.`
|
|
6455
|
-
);
|
|
5830
|
+
setErrorText(`Please choose ${minCount} ${minCount === 1 ? "file" : "files"} to upload.`);
|
|
6456
5831
|
}
|
|
6457
5832
|
},
|
|
6458
5833
|
slotProps: {
|
|
@@ -6468,25 +5843,7 @@ var Uploader = React43.memo(
|
|
|
6468
5843
|
}
|
|
6469
5844
|
)
|
|
6470
5845
|
);
|
|
6471
|
-
return /* @__PURE__ */ React43.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ React43.createElement(
|
|
6472
|
-
FormControl_default,
|
|
6473
|
-
{
|
|
6474
|
-
size,
|
|
6475
|
-
error: !!(error || errorText),
|
|
6476
|
-
disabled,
|
|
6477
|
-
required: !!minCount
|
|
6478
|
-
},
|
|
6479
|
-
label && /* @__PURE__ */ React43.createElement(FormLabel_default, null, label),
|
|
6480
|
-
uploader,
|
|
6481
|
-
/* @__PURE__ */ React43.createElement(FormHelperText_default, null, /* @__PURE__ */ React43.createElement(Stack_default, null, errorText && /* @__PURE__ */ React43.createElement("div", null, errorText), /* @__PURE__ */ React43.createElement("div", null, helperText)))
|
|
6482
|
-
), [...uploaded, ...files].length > 0 && /* @__PURE__ */ React43.createElement(
|
|
6483
|
-
Preview,
|
|
6484
|
-
{
|
|
6485
|
-
files,
|
|
6486
|
-
uploaded,
|
|
6487
|
-
onDelete: handleDeleteFile
|
|
6488
|
-
}
|
|
6489
|
-
));
|
|
5846
|
+
return /* @__PURE__ */ React43.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ React43.createElement(FormControl_default, { size, error: !!(error || errorText), disabled, required: !!minCount }, label && /* @__PURE__ */ React43.createElement(FormLabel_default, null, label), uploader, /* @__PURE__ */ React43.createElement(FormHelperText_default, null, /* @__PURE__ */ React43.createElement(Stack_default, null, errorText && /* @__PURE__ */ React43.createElement("div", null, errorText), /* @__PURE__ */ React43.createElement("div", null, helperText)))), [...uploaded, ...files].length > 0 && /* @__PURE__ */ React43.createElement(Preview, { files, uploaded, onDelete: handleDeleteFile }));
|
|
6490
5847
|
}
|
|
6491
5848
|
);
|
|
6492
5849
|
Uploader.displayName = "Uploader";
|