@ceed/cds 1.8.6 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordions/Accordions.d.ts +1 -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 +5 -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 +45 -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 +1396 -1783
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1366 -1829
- package/dist/libs/rehype-accent/index.d.ts +2 -2
- package/framer/index.js +38 -38
- package/package.json +6 -1
package/dist/index.js
CHANGED
|
@@ -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) => {
|
|
@@ -715,33 +690,13 @@ function Breadcrumbs(props) {
|
|
|
715
690
|
}
|
|
716
691
|
};
|
|
717
692
|
if (!collapsed) {
|
|
718
|
-
return /* @__PURE__ */ React8.createElement(
|
|
719
|
-
JoyBreadcrumbs,
|
|
720
|
-
{
|
|
721
|
-
size,
|
|
722
|
-
slots: restSlots,
|
|
723
|
-
slotProps: restSlotProps,
|
|
724
|
-
...innerProps
|
|
725
|
-
},
|
|
726
|
-
crumbs.map((crumb, index) => /* @__PURE__ */ React8.createElement(Crumb, { key: `breadcrumb-${index}`, ...crumb }))
|
|
727
|
-
);
|
|
693
|
+
return /* @__PURE__ */ React8.createElement(JoyBreadcrumbs, { size, slots: restSlots, slotProps: restSlotProps, ...innerProps }, crumbs.map((crumb, index) => /* @__PURE__ */ React8.createElement(Crumb, { key: `breadcrumb-${index}`, ...crumb })));
|
|
728
694
|
}
|
|
729
695
|
const _endCrumbCount = Math.max(1, endCrumbCount);
|
|
730
696
|
const frontCrumbs = crumbs.slice(0, startCrumbCount).map((crumb) => /* @__PURE__ */ React8.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
|
|
731
697
|
const backCrumbs = (startCrumbCount + _endCrumbCount > crumbs.length ? crumbs.slice(startCrumbCount) : crumbs.slice(-_endCrumbCount)).map((crumb) => /* @__PURE__ */ React8.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
|
|
732
698
|
const collapsedCrumbs = crumbs.slice(startCrumbCount, -_endCrumbCount).map((crumb) => /* @__PURE__ */ React8.createElement(MenuItem, { key: `breadcrumb-${crumb.label}` }, /* @__PURE__ */ React8.createElement(Crumb, { ...crumb })));
|
|
733
|
-
return /* @__PURE__ */ React8.createElement(
|
|
734
|
-
JoyBreadcrumbs,
|
|
735
|
-
{
|
|
736
|
-
size,
|
|
737
|
-
slots: restSlots,
|
|
738
|
-
slotProps: restSlotProps,
|
|
739
|
-
...innerProps
|
|
740
|
-
},
|
|
741
|
-
frontCrumbs,
|
|
742
|
-
collapsedCrumbs.length && /* @__PURE__ */ React8.createElement(Dropdown_default, null, /* @__PURE__ */ React8.createElement(JoyMenuButton, { size, variant: "plain" }, "..."), /* @__PURE__ */ React8.createElement(Menu_default, { size }, collapsedCrumbs)),
|
|
743
|
-
backCrumbs
|
|
744
|
-
);
|
|
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);
|
|
745
700
|
}
|
|
746
701
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
747
702
|
|
|
@@ -750,11 +705,9 @@ import React9, { forwardRef as forwardRef3 } from "react";
|
|
|
750
705
|
import { Button as JoyButton } from "@mui/joy";
|
|
751
706
|
import { motion as motion11 } from "framer-motion";
|
|
752
707
|
var MotionButton = motion11(JoyButton);
|
|
753
|
-
var Button = forwardRef3(
|
|
754
|
-
({ ...props }
|
|
755
|
-
|
|
756
|
-
}
|
|
757
|
-
);
|
|
708
|
+
var Button = forwardRef3(({ ...props }, ref) => {
|
|
709
|
+
return /* @__PURE__ */ React9.createElement(MotionButton, { ref, ...props });
|
|
710
|
+
});
|
|
758
711
|
Button.displayName = "Button";
|
|
759
712
|
|
|
760
713
|
// src/components/Button/index.ts
|
|
@@ -773,9 +726,7 @@ var getCalendarDates = (date) => {
|
|
|
773
726
|
const firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
774
727
|
const lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
775
728
|
const firstWeekInThisMonth = Math.ceil((firstDay.getDay() + 1) / 7);
|
|
776
|
-
const lastWeekInThisMonth = Math.ceil(
|
|
777
|
-
(lastDay.getDate() + firstDay.getDay()) / 7
|
|
778
|
-
);
|
|
729
|
+
const lastWeekInThisMonth = Math.ceil((lastDay.getDate() + firstDay.getDay()) / 7);
|
|
779
730
|
let day = 1;
|
|
780
731
|
for (let i = 1; i <= lastWeekInThisMonth; i++) {
|
|
781
732
|
const week = [];
|
|
@@ -850,7 +801,9 @@ var useCalendarProps = (inProps) => {
|
|
|
850
801
|
const [uncontrolledView, setUncontrolledView] = useState2(
|
|
851
802
|
() => resolveView(inProps.view || "day", inProps.views || ["day", "month"])
|
|
852
803
|
);
|
|
853
|
-
const [uncontrolledValue, setUncontrolledValue] = useState2(
|
|
804
|
+
const [uncontrolledValue, setUncontrolledValue] = useState2(
|
|
805
|
+
inProps.defaultValue
|
|
806
|
+
);
|
|
854
807
|
const [viewMonth, setViewMonth] = useState2(() => {
|
|
855
808
|
const today = /* @__PURE__ */ new Date();
|
|
856
809
|
today.setDate(1);
|
|
@@ -923,10 +876,7 @@ var useCalendarProps = (inProps) => {
|
|
|
923
876
|
},
|
|
924
877
|
name: "Calendar"
|
|
925
878
|
});
|
|
926
|
-
const ownerState = useMemo3(
|
|
927
|
-
() => ({ ...props, viewMonth, direction }),
|
|
928
|
-
[props, viewMonth, direction]
|
|
929
|
-
);
|
|
879
|
+
const ownerState = useMemo3(() => ({ ...props, viewMonth, direction }), [props, viewMonth, direction]);
|
|
930
880
|
return [props, ownerState];
|
|
931
881
|
};
|
|
932
882
|
|
|
@@ -944,11 +894,7 @@ var useCalendar = (ownerState) => {
|
|
|
944
894
|
const currentMonth = currentDate.getMonth();
|
|
945
895
|
const currentDay = currentDate.getDate();
|
|
946
896
|
const prevMonth = new Date(currentYear, currentMonth - 1, 1);
|
|
947
|
-
const lastDayOfPrevMonth = new Date(
|
|
948
|
-
currentYear,
|
|
949
|
-
currentMonth,
|
|
950
|
-
0
|
|
951
|
-
).getDate();
|
|
897
|
+
const lastDayOfPrevMonth = new Date(currentYear, currentMonth, 0).getDate();
|
|
952
898
|
const prevMonthDay = Math.min(currentDay, lastDayOfPrevMonth);
|
|
953
899
|
prevMonth.setDate(prevMonthDay);
|
|
954
900
|
ownerState.onMonthChange?.(prevMonth);
|
|
@@ -965,11 +911,7 @@ var useCalendar = (ownerState) => {
|
|
|
965
911
|
const currentMonth = currentDate.getMonth();
|
|
966
912
|
const currentDay = currentDate.getDate();
|
|
967
913
|
const nextMonth = new Date(currentYear, currentMonth + 1, 1);
|
|
968
|
-
const lastDayOfNextMonth = new Date(
|
|
969
|
-
currentYear,
|
|
970
|
-
currentMonth + 2,
|
|
971
|
-
0
|
|
972
|
-
).getDate();
|
|
914
|
+
const lastDayOfNextMonth = new Date(currentYear, currentMonth + 2, 0).getDate();
|
|
973
915
|
const nextMonthDay = Math.min(currentDay, lastDayOfNextMonth);
|
|
974
916
|
nextMonth.setDate(nextMonthDay);
|
|
975
917
|
ownerState.onMonthChange?.(nextMonth);
|
|
@@ -986,22 +928,13 @@ var useCalendar = (ownerState) => {
|
|
|
986
928
|
thisDay.setDate(day);
|
|
987
929
|
const inRange = ownerState.rangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
988
930
|
(hoverDay && isWithinRange(ownerState.value[0], hoverDay, thisDay) || // NOTE: Selected range is included in the range
|
|
989
|
-
ownerState.value[1] && isWithinRange(
|
|
990
|
-
ownerState.value[0],
|
|
991
|
-
ownerState.value[1],
|
|
992
|
-
thisDay
|
|
993
|
-
));
|
|
931
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisDay));
|
|
994
932
|
return {
|
|
995
933
|
"aria-label": thisDay.toLocaleDateString(),
|
|
996
934
|
"aria-current": inRange ? "date" : void 0
|
|
997
935
|
};
|
|
998
936
|
},
|
|
999
|
-
[
|
|
1000
|
-
ownerState.rangeSelection,
|
|
1001
|
-
ownerState.value,
|
|
1002
|
-
ownerState.viewMonth,
|
|
1003
|
-
hoverDay
|
|
1004
|
-
]
|
|
937
|
+
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverDay]
|
|
1005
938
|
),
|
|
1006
939
|
getMonthCellProps: useCallback4(
|
|
1007
940
|
(monthIndex) => {
|
|
@@ -1012,22 +945,13 @@ var useCalendar = (ownerState) => {
|
|
|
1012
945
|
const isMonthRangeSelection = !ownerState.views?.find((view) => view === "day") && ownerState.rangeSelection;
|
|
1013
946
|
const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1014
947
|
(hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
|
|
1015
|
-
ownerState.value[1] && isWithinRange(
|
|
1016
|
-
ownerState.value[0],
|
|
1017
|
-
ownerState.value[1],
|
|
1018
|
-
thisMonth
|
|
1019
|
-
));
|
|
948
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisMonth));
|
|
1020
949
|
return {
|
|
1021
950
|
"aria-label": thisMonth.toLocaleDateString(),
|
|
1022
951
|
"aria-current": inRange ? "date" : void 0
|
|
1023
952
|
};
|
|
1024
953
|
},
|
|
1025
|
-
[
|
|
1026
|
-
ownerState.rangeSelection,
|
|
1027
|
-
ownerState.value,
|
|
1028
|
-
ownerState.viewMonth,
|
|
1029
|
-
hoverMonth
|
|
1030
|
-
]
|
|
954
|
+
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverMonth]
|
|
1031
955
|
),
|
|
1032
956
|
getPickerDayProps: useCallback4(
|
|
1033
957
|
(day) => {
|
|
@@ -1037,23 +961,15 @@ var useCalendar = (ownerState) => {
|
|
|
1037
961
|
const isSelected = !!ownerState.value && (isSameDay(thisDay, ownerState.value[0]) || ownerState.value[1] && isSameDay(thisDay, ownerState.value[1]));
|
|
1038
962
|
const inRange = ownerState.rangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1039
963
|
(hoverDay && isWithinRange(ownerState.value[0], hoverDay, thisDay) || // NOTE: Selected range is included in the range
|
|
1040
|
-
ownerState.value[1] && isWithinRange(
|
|
1041
|
-
ownerState.value[0],
|
|
1042
|
-
ownerState.value[1],
|
|
1043
|
-
thisDay
|
|
1044
|
-
));
|
|
964
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisDay));
|
|
1045
965
|
const handleDayClick = () => {
|
|
1046
966
|
if (ownerState.rangeSelection) {
|
|
1047
967
|
if (!ownerState.value) {
|
|
1048
968
|
ownerState.onChange?.([thisDay, void 0]);
|
|
1049
969
|
} else if (ownerState.value[0] && !ownerState.value[1]) {
|
|
1050
970
|
ownerState.onChange?.([
|
|
1051
|
-
new Date(
|
|
1052
|
-
|
|
1053
|
-
),
|
|
1054
|
-
new Date(
|
|
1055
|
-
Math.max(ownerState.value[0].getTime(), thisDay.getTime())
|
|
1056
|
-
)
|
|
971
|
+
new Date(Math.min(ownerState.value[0].getTime(), thisDay.getTime())),
|
|
972
|
+
new Date(Math.max(ownerState.value[0].getTime(), thisDay.getTime()))
|
|
1057
973
|
]);
|
|
1058
974
|
} else {
|
|
1059
975
|
ownerState.onChange?.([thisDay, void 0]);
|
|
@@ -1102,23 +1018,15 @@ var useCalendar = (ownerState) => {
|
|
|
1102
1018
|
const isSelected = !!ownerState.value && (isSameMonth(thisMonth, ownerState.value[0]) || ownerState.value[1] && isSameMonth(thisMonth, ownerState.value[1]));
|
|
1103
1019
|
const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1104
1020
|
(hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
|
|
1105
|
-
ownerState.value[1] && isWithinRange(
|
|
1106
|
-
ownerState.value[0],
|
|
1107
|
-
ownerState.value[1],
|
|
1108
|
-
thisMonth
|
|
1109
|
-
));
|
|
1021
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisMonth));
|
|
1110
1022
|
const handleMonthClick = () => {
|
|
1111
1023
|
if (isMonthRangeSelection) {
|
|
1112
1024
|
if (!ownerState.value) {
|
|
1113
1025
|
ownerState.onChange?.([thisMonth, void 0]);
|
|
1114
1026
|
} else if (ownerState.value[0] && !ownerState.value[1]) {
|
|
1115
1027
|
ownerState.onChange?.([
|
|
1116
|
-
new Date(
|
|
1117
|
-
|
|
1118
|
-
),
|
|
1119
|
-
new Date(
|
|
1120
|
-
Math.max(ownerState.value[0].getTime(), thisMonth.getTime())
|
|
1121
|
-
)
|
|
1028
|
+
new Date(Math.min(ownerState.value[0].getTime(), thisMonth.getTime())),
|
|
1029
|
+
new Date(Math.max(ownerState.value[0].getTime(), thisMonth.getTime()))
|
|
1122
1030
|
]);
|
|
1123
1031
|
} else {
|
|
1124
1032
|
ownerState.onChange?.([thisMonth, void 0]);
|
|
@@ -1188,15 +1096,13 @@ var CalendarViewContainer = styled5("div", {
|
|
|
1188
1096
|
name: "Calendar",
|
|
1189
1097
|
slot: "viewContainer",
|
|
1190
1098
|
shouldForwardProp: (prop) => prop !== "calendarType"
|
|
1191
|
-
})(
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
})
|
|
1199
|
-
);
|
|
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
|
+
}));
|
|
1200
1106
|
var CalendarViewTable = styled5(motion12.table, {
|
|
1201
1107
|
name: "Calendar",
|
|
1202
1108
|
slot: "viewTable"
|
|
@@ -1375,14 +1281,8 @@ var swipePower = (offset, velocity) => {
|
|
|
1375
1281
|
var PickerDays = (props) => {
|
|
1376
1282
|
const { ownerState } = props;
|
|
1377
1283
|
const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
|
|
1378
|
-
const calendarDates = useMemo4(
|
|
1379
|
-
|
|
1380
|
-
[ownerState.viewMonth]
|
|
1381
|
-
);
|
|
1382
|
-
const weekdayNames = useMemo4(
|
|
1383
|
-
() => getWeekdayNames(ownerState.locale || "default"),
|
|
1384
|
-
[ownerState.locale]
|
|
1385
|
-
);
|
|
1284
|
+
const calendarDates = useMemo4(() => getCalendarDates(ownerState.viewMonth), [ownerState.viewMonth]);
|
|
1285
|
+
const weekdayNames = useMemo4(() => getWeekdayNames(ownerState.locale || "default"), [ownerState.locale]);
|
|
1386
1286
|
return /* @__PURE__ */ React11.createElement(CalendarViewContainer, { calendarType: "datePicker" }, /* @__PURE__ */ React11.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React11.createElement(
|
|
1387
1287
|
CalendarViewTable,
|
|
1388
1288
|
{
|
|
@@ -1412,25 +1312,9 @@ var PickerDays = (props) => {
|
|
|
1412
1312
|
}
|
|
1413
1313
|
}
|
|
1414
1314
|
},
|
|
1415
|
-
/* @__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(
|
|
1416
|
-
"th",
|
|
1417
|
-
{
|
|
1418
|
-
style: { width: 4 },
|
|
1419
|
-
"aria-hidden": "true",
|
|
1420
|
-
"aria-description": "cell-gap"
|
|
1421
|
-
}
|
|
1422
|
-
))))),
|
|
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" }))))),
|
|
1423
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(
|
|
1424
|
-
(date, i) => date ? /* @__PURE__ */ React11.createElement(Fragment, { key: `${ownerState.viewMonth}_${date}_${i}` }, /* @__PURE__ */ React11.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ React11.createElement(
|
|
1425
|
-
CalendarDay,
|
|
1426
|
-
{
|
|
1427
|
-
size: "sm",
|
|
1428
|
-
variant: "plain",
|
|
1429
|
-
color: "neutral",
|
|
1430
|
-
...getPickerDayProps(date)
|
|
1431
|
-
},
|
|
1432
|
-
date
|
|
1433
|
-
)), 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" }))
|
|
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" }))
|
|
1434
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 } })))))
|
|
1435
1319
|
)));
|
|
1436
1320
|
};
|
|
@@ -1448,62 +1332,37 @@ var PickerMonths = (props) => {
|
|
|
1448
1332
|
[[]]
|
|
1449
1333
|
);
|
|
1450
1334
|
const isMonthPicker = !ownerState.views?.find((view) => view === "day");
|
|
1451
|
-
return /* @__PURE__ */ React11.createElement(
|
|
1452
|
-
|
|
1335
|
+
return /* @__PURE__ */ React11.createElement(CalendarViewContainer, { calendarType: isMonthPicker ? "monthPicker" : "datePicker" }, /* @__PURE__ */ React11.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React11.createElement(
|
|
1336
|
+
CalendarViewTable,
|
|
1453
1337
|
{
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
animate: "center",
|
|
1464
|
-
exit: "exit",
|
|
1465
|
-
transition: {
|
|
1466
|
-
x: { type: "spring", stiffness: 300, damping: 30 },
|
|
1467
|
-
opacity: { duration: 0.2 }
|
|
1468
|
-
},
|
|
1469
|
-
drag: "x",
|
|
1470
|
-
dragConstraints: { left: 0, right: 0 },
|
|
1471
|
-
dragElastic: 1,
|
|
1472
|
-
onDragEnd: (e, { offset, velocity }) => {
|
|
1473
|
-
const swipe = swipePower(offset.x, velocity.x);
|
|
1474
|
-
if (swipe < -swipeConfidenceThreshold) {
|
|
1475
|
-
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1476
|
-
date.setMonth(date.getMonth() + 1);
|
|
1477
|
-
ownerState.onMonthChange?.(date);
|
|
1478
|
-
} else if (swipe > swipeConfidenceThreshold) {
|
|
1479
|
-
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1480
|
-
date.setMonth(date.getMonth() - 1);
|
|
1481
|
-
ownerState.onMonthChange?.(date);
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
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 }
|
|
1484
1347
|
},
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
ownerState.
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
"td",
|
|
1499
|
-
{
|
|
1500
|
-
style: { width: 4 },
|
|
1501
|
-
"aria-hidden": "true",
|
|
1502
|
-
"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);
|
|
1503
1361
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
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
|
+
)));
|
|
1507
1366
|
};
|
|
1508
1367
|
var Calendar = forwardRef4((inProps, ref) => {
|
|
1509
1368
|
const [props, ownerState] = useCalendarProps(inProps);
|
|
@@ -1524,15 +1383,7 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1524
1383
|
...others
|
|
1525
1384
|
} = props;
|
|
1526
1385
|
const { calendarTitle, onPrev, onNext } = useCalendar(ownerState);
|
|
1527
|
-
return /* @__PURE__ */ React11.createElement(CalendarRoot, { ref, ...others }, /* @__PURE__ */ React11.createElement(CalendarHeader, null, /* @__PURE__ */ React11.createElement(
|
|
1528
|
-
IconButton_default,
|
|
1529
|
-
{
|
|
1530
|
-
size: "sm",
|
|
1531
|
-
onClick: onPrev,
|
|
1532
|
-
"aria-label": `Previous ${view === "day" ? "Month" : "Year"}`
|
|
1533
|
-
},
|
|
1534
|
-
/* @__PURE__ */ React11.createElement(ChevronLeftIcon, null)
|
|
1535
|
-
), /* @__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(
|
|
1536
1387
|
CalendarSwitchViewButton,
|
|
1537
1388
|
{
|
|
1538
1389
|
ownerState,
|
|
@@ -1542,15 +1393,7 @@ var Calendar = forwardRef4((inProps, ref) => {
|
|
|
1542
1393
|
"aria-label": "Switch Calendar View"
|
|
1543
1394
|
},
|
|
1544
1395
|
calendarTitle
|
|
1545
|
-
), /* @__PURE__ */ React11.createElement(
|
|
1546
|
-
IconButton_default,
|
|
1547
|
-
{
|
|
1548
|
-
size: "sm",
|
|
1549
|
-
onClick: onNext,
|
|
1550
|
-
"aria-label": `Next ${view === "day" ? "Month" : "Year"}`
|
|
1551
|
-
},
|
|
1552
|
-
/* @__PURE__ */ React11.createElement(ChevronRightIcon, null)
|
|
1553
|
-
)), 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 }));
|
|
1554
1397
|
});
|
|
1555
1398
|
Calendar.displayName = "Calendar";
|
|
1556
1399
|
|
|
@@ -1694,23 +1537,15 @@ var Input = React14.forwardRef((props, ref) => {
|
|
|
1694
1537
|
...innerProps.slotProps
|
|
1695
1538
|
},
|
|
1696
1539
|
...innerProps,
|
|
1697
|
-
endDecorator: enableClearable ? /* @__PURE__ */ React14.createElement(
|
|
1698
|
-
|
|
1540
|
+
endDecorator: enableClearable ? /* @__PURE__ */ React14.createElement(Stack_default, { gap: 1, direction: "row" }, innerProps.endDecorator, value && /* @__PURE__ */ React14.createElement(
|
|
1541
|
+
IconButton_default,
|
|
1699
1542
|
{
|
|
1700
|
-
|
|
1701
|
-
|
|
1543
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1544
|
+
onClick: handleClear,
|
|
1545
|
+
"aria-label": "Clear"
|
|
1702
1546
|
},
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
IconButton_default,
|
|
1706
|
-
{
|
|
1707
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
1708
|
-
onClick: handleClear,
|
|
1709
|
-
"aria-label": "Clear"
|
|
1710
|
-
},
|
|
1711
|
-
/* @__PURE__ */ React14.createElement(ClearIcon, null)
|
|
1712
|
-
)
|
|
1713
|
-
) : innerProps.endDecorator
|
|
1547
|
+
/* @__PURE__ */ React14.createElement(ClearIcon, null)
|
|
1548
|
+
)) : innerProps.endDecorator
|
|
1714
1549
|
}
|
|
1715
1550
|
);
|
|
1716
1551
|
return /* @__PURE__ */ React14.createElement(
|
|
@@ -1898,25 +1733,23 @@ var useCurrencySetting = (props) => {
|
|
|
1898
1733
|
};
|
|
1899
1734
|
|
|
1900
1735
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1901
|
-
var TextMaskAdapter = React15.forwardRef(
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
}
|
|
1919
|
-
);
|
|
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
|
+
});
|
|
1920
1753
|
var CurrencyInputRoot = styled7(Input_default, {
|
|
1921
1754
|
name: "CurrencyInput",
|
|
1922
1755
|
slot: "root",
|
|
@@ -1939,21 +1772,11 @@ var CurrencyInput = React15.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1939
1772
|
className,
|
|
1940
1773
|
...innerProps
|
|
1941
1774
|
} = props;
|
|
1942
|
-
const {
|
|
1943
|
-
symbol,
|
|
1944
|
-
thousandSeparator,
|
|
1945
|
-
decimalSeparator,
|
|
1946
|
-
placeholder,
|
|
1947
|
-
fixedDecimalScale,
|
|
1948
|
-
decimalScale
|
|
1949
|
-
} = useCurrencySetting(props);
|
|
1775
|
+
const { symbol, thousandSeparator, decimalSeparator, placeholder, fixedDecimalScale, decimalScale } = useCurrencySetting(props);
|
|
1950
1776
|
const [_value, setValue] = useControlledState(
|
|
1951
1777
|
props.value,
|
|
1952
1778
|
props.defaultValue,
|
|
1953
|
-
useCallback6(
|
|
1954
|
-
(value2) => onChange?.({ target: { name, value: value2 } }),
|
|
1955
|
-
[onChange, name]
|
|
1956
|
-
)
|
|
1779
|
+
useCallback6((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
1957
1780
|
);
|
|
1958
1781
|
const value = useMemo5(() => {
|
|
1959
1782
|
if (_value && useMinorUnit) {
|
|
@@ -1967,9 +1790,7 @@ var CurrencyInput = React15.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1967
1790
|
}
|
|
1968
1791
|
return props.max;
|
|
1969
1792
|
}, [props.max, useMinorUnit, decimalScale]);
|
|
1970
|
-
const [isOverLimit, setIsOverLimit] = useState4(
|
|
1971
|
-
!!max && !!value && value > max
|
|
1972
|
-
);
|
|
1793
|
+
const [isOverLimit, setIsOverLimit] = useState4(!!max && !!value && value > max);
|
|
1973
1794
|
const handleChange = useCallback6(
|
|
1974
1795
|
(event) => {
|
|
1975
1796
|
if (event.target.value === "") {
|
|
@@ -1999,9 +1820,9 @@ var CurrencyInput = React15.forwardRef(function CurrencyInput2(inProps, ref) {
|
|
|
1999
1820
|
required,
|
|
2000
1821
|
color: error || isOverLimit ? "danger" : props.color,
|
|
2001
1822
|
label,
|
|
2002
|
-
helperText: isOverLimit ? new IntlMessageFormat2(
|
|
2003
|
-
|
|
2004
|
-
|
|
1823
|
+
helperText: isOverLimit ? new IntlMessageFormat2(`limit: {amount, number, ::currency/${currency} unit-width-narrow}`).format({
|
|
1824
|
+
amount: max
|
|
1825
|
+
}) : helperText,
|
|
2005
1826
|
slotProps: {
|
|
2006
1827
|
input: {
|
|
2007
1828
|
component: TextMaskAdapter,
|
|
@@ -2036,17 +1857,11 @@ import React23, {
|
|
|
2036
1857
|
useImperativeHandle as useImperativeHandle2,
|
|
2037
1858
|
createElement,
|
|
2038
1859
|
memo,
|
|
2039
|
-
useLayoutEffect
|
|
1860
|
+
useLayoutEffect,
|
|
1861
|
+
Fragment as Fragment2
|
|
2040
1862
|
} from "react";
|
|
2041
1863
|
import { useVirtualizer as useVirtualizer2 } from "@tanstack/react-virtual";
|
|
2042
|
-
import {
|
|
2043
|
-
styled as styled12,
|
|
2044
|
-
LinearProgress,
|
|
2045
|
-
Link,
|
|
2046
|
-
useTheme,
|
|
2047
|
-
buttonClasses,
|
|
2048
|
-
iconButtonClasses
|
|
2049
|
-
} from "@mui/joy";
|
|
1864
|
+
import { styled as styled12, LinearProgress, Link, useTheme, buttonClasses, iconButtonClasses } from "@mui/joy";
|
|
2050
1865
|
import SortIcon from "@mui/icons-material/ArrowUpwardRounded";
|
|
2051
1866
|
|
|
2052
1867
|
// src/components/Sheet/Sheet.tsx
|
|
@@ -2116,13 +1931,7 @@ function TableBody(props) {
|
|
|
2116
1931
|
textAlign: "center"
|
|
2117
1932
|
}
|
|
2118
1933
|
},
|
|
2119
|
-
/* @__PURE__ */ React16.createElement(
|
|
2120
|
-
RenderCheckbox,
|
|
2121
|
-
{
|
|
2122
|
-
onChange: (event) => onCheckboxChange?.(event, rowIndex),
|
|
2123
|
-
...checkboxProps
|
|
2124
|
-
}
|
|
2125
|
-
)
|
|
1934
|
+
/* @__PURE__ */ React16.createElement(RenderCheckbox, { onChange: (event) => onCheckboxChange?.(event, rowIndex), ...checkboxProps })
|
|
2126
1935
|
), cellOrder.map((cellKey) => /* @__PURE__ */ React16.createElement(
|
|
2127
1936
|
"td",
|
|
2128
1937
|
{
|
|
@@ -2137,14 +1946,7 @@ function TableBody(props) {
|
|
|
2137
1946
|
TableBody.displayName = "TableBody";
|
|
2138
1947
|
|
|
2139
1948
|
// src/components/DatePicker/DatePicker.tsx
|
|
2140
|
-
import React17, {
|
|
2141
|
-
forwardRef as forwardRef6,
|
|
2142
|
-
useCallback as useCallback7,
|
|
2143
|
-
useEffect as useEffect3,
|
|
2144
|
-
useImperativeHandle,
|
|
2145
|
-
useRef as useRef3,
|
|
2146
|
-
useState as useState5
|
|
2147
|
-
} from "react";
|
|
1949
|
+
import React17, { forwardRef as forwardRef6, useCallback as useCallback7, useEffect as useEffect3, useImperativeHandle, useRef as useRef3, useState as useState5 } from "react";
|
|
2148
1950
|
import { IMaskInput, IMask } from "react-imask";
|
|
2149
1951
|
import CalendarTodayIcon from "@mui/icons-material/CalendarToday";
|
|
2150
1952
|
import { styled as styled9, useThemeProps as useThemeProps4 } from "@mui/joy";
|
|
@@ -2174,9 +1976,7 @@ var CalendarButton = styled9(IconButton_default, {
|
|
|
2174
1976
|
"&:focus": {
|
|
2175
1977
|
"--Icon-color": "currentColor",
|
|
2176
1978
|
outlineOffset: `${theme.getCssVar("focus-thickness")}`,
|
|
2177
|
-
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar(
|
|
2178
|
-
"palette-focusVisible"
|
|
2179
|
-
)}`
|
|
1979
|
+
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
2180
1980
|
}
|
|
2181
1981
|
}));
|
|
2182
1982
|
var StyledPopper = styled9(Popper2, {
|
|
@@ -2210,9 +2010,7 @@ var validValueFormat = (value, format) => {
|
|
|
2210
2010
|
if (value !== formatValueString(parsedValue, format)) {
|
|
2211
2011
|
return false;
|
|
2212
2012
|
}
|
|
2213
|
-
const regex = new RegExp(
|
|
2214
|
-
`^${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")}$`
|
|
2215
|
-
);
|
|
2013
|
+
const regex = new RegExp(`^${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")}$`);
|
|
2216
2014
|
return regex.test(value);
|
|
2217
2015
|
} catch (e) {
|
|
2218
2016
|
return false;
|
|
@@ -2253,276 +2051,259 @@ function parseDate(dateString, format) {
|
|
|
2253
2051
|
var formatToPattern = (format) => {
|
|
2254
2052
|
return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
2255
2053
|
};
|
|
2256
|
-
var TextMaskAdapter3 = React17.forwardRef(
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
maxLength: 2
|
|
2273
|
-
},
|
|
2274
|
-
M: {
|
|
2275
|
-
mask: IMask.MaskedRange,
|
|
2276
|
-
from: 1,
|
|
2277
|
-
to: 12,
|
|
2278
|
-
maxLength: 2
|
|
2279
|
-
},
|
|
2280
|
-
Y: {
|
|
2281
|
-
mask: IMask.MaskedRange,
|
|
2282
|
-
from: 1900,
|
|
2283
|
-
to: 9999,
|
|
2284
|
-
maxLength: 4
|
|
2285
|
-
}
|
|
2054
|
+
var TextMaskAdapter3 = React17.forwardRef(function TextMaskAdapter4(props, ref) {
|
|
2055
|
+
const { onChange, format, ...other } = props;
|
|
2056
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2057
|
+
IMaskInput,
|
|
2058
|
+
{
|
|
2059
|
+
...other,
|
|
2060
|
+
inputRef: ref,
|
|
2061
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
2062
|
+
mask: Date,
|
|
2063
|
+
pattern: formatToPattern(format),
|
|
2064
|
+
blocks: {
|
|
2065
|
+
D: {
|
|
2066
|
+
mask: IMask.MaskedRange,
|
|
2067
|
+
from: 1,
|
|
2068
|
+
to: 31,
|
|
2069
|
+
maxLength: 2
|
|
2286
2070
|
},
|
|
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
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2071
|
+
M: {
|
|
2072
|
+
mask: IMask.MaskedRange,
|
|
2073
|
+
from: 1,
|
|
2074
|
+
to: 12,
|
|
2075
|
+
maxLength: 2
|
|
2076
|
+
},
|
|
2077
|
+
Y: {
|
|
2078
|
+
mask: IMask.MaskedRange,
|
|
2079
|
+
from: 1900,
|
|
2080
|
+
to: 9999,
|
|
2081
|
+
maxLength: 4
|
|
2082
|
+
}
|
|
2083
|
+
},
|
|
2084
|
+
format: (date) => formatValueString(date, format),
|
|
2085
|
+
parse: (str) => parseDate(str, format),
|
|
2086
|
+
autofix: "pad",
|
|
2087
|
+
overwrite: true
|
|
2088
|
+
}
|
|
2089
|
+
);
|
|
2090
|
+
});
|
|
2091
|
+
var DatePicker = forwardRef6((inProps, ref) => {
|
|
2092
|
+
const props = useThemeProps4({ props: inProps, name: "DatePicker" });
|
|
2093
|
+
const {
|
|
2094
|
+
onChange,
|
|
2095
|
+
disabled,
|
|
2096
|
+
label,
|
|
2097
|
+
error,
|
|
2098
|
+
helperText,
|
|
2099
|
+
minDate,
|
|
2100
|
+
maxDate,
|
|
2101
|
+
disableFuture,
|
|
2102
|
+
disablePast,
|
|
2103
|
+
required,
|
|
2104
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
2105
|
+
sx,
|
|
2106
|
+
className,
|
|
2107
|
+
format = "YYYY/MM/DD",
|
|
2108
|
+
displayFormat = "YYYY/MM/DD",
|
|
2109
|
+
size,
|
|
2110
|
+
inputReadOnly,
|
|
2111
|
+
hideClearButton,
|
|
2112
|
+
readOnly,
|
|
2113
|
+
shouldDisableDate,
|
|
2114
|
+
...innerProps
|
|
2115
|
+
} = props;
|
|
2116
|
+
const innerRef = useRef3(null);
|
|
2117
|
+
const buttonRef = useRef3(null);
|
|
2118
|
+
const [value, setValue] = useControlledState(
|
|
2119
|
+
props.value,
|
|
2120
|
+
props.defaultValue || "",
|
|
2121
|
+
useCallback7((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
2122
|
+
);
|
|
2123
|
+
const [displayValue, setDisplayValue] = useState5(
|
|
2124
|
+
() => value ? formatValueString(parseDate(value, format), displayFormat) : ""
|
|
2125
|
+
);
|
|
2126
|
+
const [anchorEl, setAnchorEl] = useState5(null);
|
|
2127
|
+
const open = Boolean(anchorEl);
|
|
2128
|
+
useEffect3(() => {
|
|
2129
|
+
if (!anchorEl) {
|
|
2130
|
+
innerRef.current?.blur();
|
|
2131
|
+
}
|
|
2132
|
+
}, [anchorEl, innerRef]);
|
|
2133
|
+
useEffect3(() => {
|
|
2134
|
+
if (value === "") {
|
|
2135
|
+
setDisplayValue("");
|
|
2136
|
+
return;
|
|
2137
|
+
}
|
|
2138
|
+
const formattedValue = formatValueString(parseDate(value, format), displayFormat);
|
|
2139
|
+
if (validValueFormat(formattedValue, displayFormat) && formattedValue !== displayValue) {
|
|
2140
|
+
setDisplayValue(formattedValue);
|
|
2141
|
+
}
|
|
2142
|
+
}, [displayFormat, displayValue, format, value]);
|
|
2143
|
+
useImperativeHandle(ref, () => innerRef.current, [innerRef]);
|
|
2144
|
+
const handleChange = useCallback7(
|
|
2145
|
+
(event) => {
|
|
2146
|
+
const value2 = event.target.value;
|
|
2147
|
+
setDisplayValue(value2 ? formatValueString(parseDate(value2, format), displayFormat) : value2);
|
|
2148
|
+
setValue(value2);
|
|
2149
|
+
},
|
|
2150
|
+
[displayFormat, format, setValue]
|
|
2151
|
+
);
|
|
2152
|
+
const handleDisplayInputChange = useCallback7(
|
|
2153
|
+
(event) => {
|
|
2154
|
+
if (event.target.value === "") {
|
|
2155
|
+
handleChange({
|
|
2156
|
+
target: {
|
|
2157
|
+
name: props.name,
|
|
2158
|
+
value: ""
|
|
2159
|
+
}
|
|
2160
|
+
});
|
|
2344
2161
|
return;
|
|
2345
2162
|
}
|
|
2346
|
-
const
|
|
2347
|
-
|
|
2348
|
-
displayFormat
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2163
|
+
const isValidDisplayValue = validValueFormat(event.target.value, displayFormat);
|
|
2164
|
+
if (isValidDisplayValue) {
|
|
2165
|
+
const parsedDate = parseDate(event.target.value, displayFormat);
|
|
2166
|
+
const formattedValue = formatValueString(parsedDate, format);
|
|
2167
|
+
handleChange({
|
|
2168
|
+
target: {
|
|
2169
|
+
name: props.name,
|
|
2170
|
+
value: formattedValue
|
|
2171
|
+
}
|
|
2172
|
+
});
|
|
2352
2173
|
}
|
|
2353
|
-
},
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
(event)
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
)
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2174
|
+
},
|
|
2175
|
+
[displayFormat, format, handleChange, props.name]
|
|
2176
|
+
);
|
|
2177
|
+
const handleCalendarToggle = useCallback7(
|
|
2178
|
+
(event) => {
|
|
2179
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2180
|
+
setTimeout(() => {
|
|
2181
|
+
innerRef.current?.focus();
|
|
2182
|
+
}, 0);
|
|
2183
|
+
},
|
|
2184
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
2185
|
+
);
|
|
2186
|
+
const handleInputMouseDown = useCallback7(
|
|
2187
|
+
(event) => {
|
|
2188
|
+
if (inputReadOnly) {
|
|
2189
|
+
event.preventDefault();
|
|
2190
|
+
buttonRef.current?.focus();
|
|
2191
|
+
}
|
|
2192
|
+
},
|
|
2193
|
+
[inputReadOnly, buttonRef]
|
|
2194
|
+
);
|
|
2195
|
+
return /* @__PURE__ */ React17.createElement(DatePickerRoot, null, /* @__PURE__ */ React17.createElement(FocusTrap, { open: true }, /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
2196
|
+
Input_default,
|
|
2197
|
+
{
|
|
2198
|
+
...innerProps,
|
|
2199
|
+
color: error ? "danger" : innerProps.color,
|
|
2200
|
+
ref: innerRef,
|
|
2201
|
+
size,
|
|
2202
|
+
value: displayValue,
|
|
2203
|
+
onChange: handleDisplayInputChange,
|
|
2204
|
+
placeholder: displayFormat,
|
|
2205
|
+
disabled,
|
|
2206
|
+
required,
|
|
2207
|
+
error,
|
|
2208
|
+
slotProps: {
|
|
2209
|
+
input: {
|
|
2210
|
+
component: TextMaskAdapter3,
|
|
2211
|
+
ref: innerRef,
|
|
2212
|
+
format: displayFormat,
|
|
2213
|
+
sx: {
|
|
2214
|
+
"&:hover": {
|
|
2215
|
+
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
2374
2216
|
}
|
|
2375
|
-
}
|
|
2376
|
-
|
|
2217
|
+
},
|
|
2218
|
+
onMouseDown: handleInputMouseDown
|
|
2377
2219
|
}
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2220
|
+
},
|
|
2221
|
+
className,
|
|
2222
|
+
sx,
|
|
2223
|
+
endDecorator: /* @__PURE__ */ React17.createElement(
|
|
2224
|
+
CalendarButton,
|
|
2225
|
+
{
|
|
2226
|
+
ref: buttonRef,
|
|
2227
|
+
variant: "plain",
|
|
2228
|
+
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
2229
|
+
"aria-label": "Toggle Calendar",
|
|
2230
|
+
"aria-controls": "date-picker-popper",
|
|
2231
|
+
"aria-haspopup": "dialog",
|
|
2232
|
+
"aria-expanded": open,
|
|
2233
|
+
disabled
|
|
2234
|
+
},
|
|
2235
|
+
/* @__PURE__ */ React17.createElement(CalendarTodayIcon, null)
|
|
2236
|
+
),
|
|
2237
|
+
label,
|
|
2238
|
+
helperText,
|
|
2239
|
+
readOnly: readOnly || inputReadOnly
|
|
2240
|
+
}
|
|
2241
|
+
), open && /* @__PURE__ */ React17.createElement(ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React17.createElement(
|
|
2242
|
+
StyledPopper,
|
|
2243
|
+
{
|
|
2244
|
+
id: "date-picker-popper",
|
|
2245
|
+
open: true,
|
|
2246
|
+
anchorEl,
|
|
2247
|
+
placement: "bottom-end",
|
|
2248
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
2249
|
+
modifiers: [
|
|
2250
|
+
{
|
|
2251
|
+
name: "offset",
|
|
2252
|
+
options: {
|
|
2253
|
+
offset: [4, 4]
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
],
|
|
2257
|
+
"aria-label": "Calendar Tooltip",
|
|
2258
|
+
"aria-expanded": open
|
|
2259
|
+
},
|
|
2260
|
+
/* @__PURE__ */ React17.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React17.createElement(
|
|
2261
|
+
Calendar_default,
|
|
2262
|
+
{
|
|
2263
|
+
value: value && !Number.isNaN(parseDate(value, format).getTime()) ? [parseDate(value, format), void 0] : void 0,
|
|
2264
|
+
onChange: ([date]) => {
|
|
2385
2265
|
handleChange({
|
|
2386
2266
|
target: {
|
|
2387
2267
|
name: props.name,
|
|
2388
|
-
value:
|
|
2268
|
+
value: formatValueString(date, format)
|
|
2389
2269
|
}
|
|
2390
2270
|
});
|
|
2391
|
-
|
|
2392
|
-
},
|
|
2393
|
-
[displayFormat, format, handleChange, props.name]
|
|
2394
|
-
);
|
|
2395
|
-
const handleCalendarToggle = useCallback7(
|
|
2396
|
-
(event) => {
|
|
2397
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2398
|
-
setTimeout(() => {
|
|
2399
|
-
innerRef.current?.focus();
|
|
2400
|
-
}, 0);
|
|
2401
|
-
},
|
|
2402
|
-
[anchorEl, setAnchorEl, innerRef]
|
|
2403
|
-
);
|
|
2404
|
-
const handleInputMouseDown = useCallback7(
|
|
2405
|
-
(event) => {
|
|
2406
|
-
if (inputReadOnly) {
|
|
2407
|
-
event.preventDefault();
|
|
2408
|
-
buttonRef.current?.focus();
|
|
2409
|
-
}
|
|
2410
|
-
},
|
|
2411
|
-
[inputReadOnly, buttonRef]
|
|
2412
|
-
);
|
|
2413
|
-
return /* @__PURE__ */ React17.createElement(DatePickerRoot, null, /* @__PURE__ */ React17.createElement(FocusTrap, { open: true }, /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
2414
|
-
Input_default,
|
|
2415
|
-
{
|
|
2416
|
-
...innerProps,
|
|
2417
|
-
color: error ? "danger" : innerProps.color,
|
|
2418
|
-
ref: innerRef,
|
|
2419
|
-
size,
|
|
2420
|
-
value: displayValue,
|
|
2421
|
-
onChange: handleDisplayInputChange,
|
|
2422
|
-
placeholder: displayFormat,
|
|
2423
|
-
disabled,
|
|
2424
|
-
required,
|
|
2425
|
-
error,
|
|
2426
|
-
slotProps: {
|
|
2427
|
-
input: {
|
|
2428
|
-
component: TextMaskAdapter3,
|
|
2429
|
-
ref: innerRef,
|
|
2430
|
-
format: displayFormat,
|
|
2431
|
-
sx: {
|
|
2432
|
-
"&:hover": {
|
|
2433
|
-
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
2434
|
-
}
|
|
2435
|
-
},
|
|
2436
|
-
onMouseDown: handleInputMouseDown
|
|
2437
|
-
}
|
|
2271
|
+
setAnchorEl(null);
|
|
2438
2272
|
},
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
ref: buttonRef,
|
|
2445
|
-
variant: "plain",
|
|
2446
|
-
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
2447
|
-
"aria-label": "Toggle Calendar",
|
|
2448
|
-
"aria-controls": "date-picker-popper",
|
|
2449
|
-
"aria-haspopup": "dialog",
|
|
2450
|
-
"aria-expanded": open,
|
|
2451
|
-
disabled
|
|
2452
|
-
},
|
|
2453
|
-
/* @__PURE__ */ React17.createElement(CalendarTodayIcon, null)
|
|
2454
|
-
),
|
|
2455
|
-
label,
|
|
2456
|
-
helperText,
|
|
2457
|
-
readOnly: readOnly || inputReadOnly
|
|
2273
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
2274
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
2275
|
+
disableFuture,
|
|
2276
|
+
disablePast,
|
|
2277
|
+
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0
|
|
2458
2278
|
}
|
|
2459
|
-
),
|
|
2460
|
-
|
|
2279
|
+
), !hideClearButton && /* @__PURE__ */ React17.createElement(
|
|
2280
|
+
DialogActions_default,
|
|
2461
2281
|
{
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
placement: "bottom-end",
|
|
2466
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
2467
|
-
modifiers: [
|
|
2468
|
-
{
|
|
2469
|
-
name: "offset",
|
|
2470
|
-
options: {
|
|
2471
|
-
offset: [4, 4]
|
|
2472
|
-
}
|
|
2473
|
-
}
|
|
2474
|
-
],
|
|
2475
|
-
"aria-label": "Calendar Tooltip",
|
|
2476
|
-
"aria-expanded": open
|
|
2282
|
+
sx: {
|
|
2283
|
+
p: 1
|
|
2284
|
+
}
|
|
2477
2285
|
},
|
|
2478
|
-
/* @__PURE__ */ React17.createElement(
|
|
2479
|
-
|
|
2286
|
+
/* @__PURE__ */ React17.createElement(
|
|
2287
|
+
Button_default,
|
|
2480
2288
|
{
|
|
2481
|
-
|
|
2482
|
-
|
|
2289
|
+
size,
|
|
2290
|
+
variant: "plain",
|
|
2291
|
+
color: "neutral",
|
|
2292
|
+
onClick: () => {
|
|
2483
2293
|
handleChange({
|
|
2484
2294
|
target: {
|
|
2485
2295
|
name: props.name,
|
|
2486
|
-
value:
|
|
2296
|
+
value: ""
|
|
2487
2297
|
}
|
|
2488
2298
|
});
|
|
2489
2299
|
setAnchorEl(null);
|
|
2490
|
-
},
|
|
2491
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
2492
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
2493
|
-
disableFuture,
|
|
2494
|
-
disablePast,
|
|
2495
|
-
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0
|
|
2496
|
-
}
|
|
2497
|
-
), !hideClearButton && /* @__PURE__ */ React17.createElement(
|
|
2498
|
-
DialogActions_default,
|
|
2499
|
-
{
|
|
2500
|
-
sx: {
|
|
2501
|
-
p: 1
|
|
2502
2300
|
}
|
|
2503
2301
|
},
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
color: "neutral",
|
|
2510
|
-
onClick: () => {
|
|
2511
|
-
handleChange({
|
|
2512
|
-
target: {
|
|
2513
|
-
name: props.name,
|
|
2514
|
-
value: ""
|
|
2515
|
-
}
|
|
2516
|
-
});
|
|
2517
|
-
setAnchorEl(null);
|
|
2518
|
-
}
|
|
2519
|
-
},
|
|
2520
|
-
"Clear"
|
|
2521
|
-
)
|
|
2522
|
-
))
|
|
2523
|
-
)))));
|
|
2524
|
-
}
|
|
2525
|
-
);
|
|
2302
|
+
"Clear"
|
|
2303
|
+
)
|
|
2304
|
+
))
|
|
2305
|
+
)))));
|
|
2306
|
+
});
|
|
2526
2307
|
|
|
2527
2308
|
// src/components/DatePicker/index.ts
|
|
2528
2309
|
var DatePicker_default = DatePicker;
|
|
@@ -2583,10 +2364,7 @@ var Textarea_default = Textarea;
|
|
|
2583
2364
|
|
|
2584
2365
|
// src/components/Select/Select.tsx
|
|
2585
2366
|
import React19, { useMemo as useMemo7 } from "react";
|
|
2586
|
-
import {
|
|
2587
|
-
Select as JoySelect,
|
|
2588
|
-
Option as JoyOption
|
|
2589
|
-
} from "@mui/joy";
|
|
2367
|
+
import { Select as JoySelect, Option as JoyOption } from "@mui/joy";
|
|
2590
2368
|
import { motion as motion19 } from "framer-motion";
|
|
2591
2369
|
var MotionOption = motion19(JoyOption);
|
|
2592
2370
|
var Option = MotionOption;
|
|
@@ -2758,18 +2536,9 @@ function Pagination(props) {
|
|
|
2758
2536
|
setPaginationModel({ ...paginationModel, page: newPage });
|
|
2759
2537
|
};
|
|
2760
2538
|
const firstPage = 1;
|
|
2761
|
-
const lastPage = Math.max(
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
);
|
|
2765
|
-
const beforePages = [
|
|
2766
|
-
paginationModel.page - 2,
|
|
2767
|
-
paginationModel.page - 1
|
|
2768
|
-
].filter((p) => p > 1);
|
|
2769
|
-
const afterPages = [
|
|
2770
|
-
paginationModel.page + 1,
|
|
2771
|
-
paginationModel.page + 2
|
|
2772
|
-
].filter((p) => p <= lastPage - 1);
|
|
2539
|
+
const lastPage = Math.max(firstPage, Math.ceil(rowCount / paginationModel.pageSize));
|
|
2540
|
+
const beforePages = [paginationModel.page - 2, paginationModel.page - 1].filter((p) => p > 1);
|
|
2541
|
+
const afterPages = [paginationModel.page + 1, paginationModel.page + 2].filter((p) => p <= lastPage - 1);
|
|
2773
2542
|
const isMoreAfterPages = lastPage > 1 && paginationModel.page < lastPage - 3;
|
|
2774
2543
|
const isMoreBeforePages = lastPage > 1 && paginationModel.page > 4;
|
|
2775
2544
|
useEffect4(() => {
|
|
@@ -2788,16 +2557,7 @@ function Pagination(props) {
|
|
|
2788
2557
|
"aria-label": "Previous page"
|
|
2789
2558
|
},
|
|
2790
2559
|
/* @__PURE__ */ React21.createElement(PreviousIcon, null)
|
|
2791
|
-
), paginationModel.page !== firstPage && /* @__PURE__ */ React21.createElement(
|
|
2792
|
-
PaginationButton,
|
|
2793
|
-
{
|
|
2794
|
-
size,
|
|
2795
|
-
variant: "plain",
|
|
2796
|
-
color: "neutral",
|
|
2797
|
-
onClick: () => handlePageChange(firstPage)
|
|
2798
|
-
},
|
|
2799
|
-
firstPage
|
|
2800
|
-
), isMoreBeforePages && /* @__PURE__ */ React21.createElement(
|
|
2560
|
+
), paginationModel.page !== firstPage && /* @__PURE__ */ React21.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(firstPage) }, firstPage), isMoreBeforePages && /* @__PURE__ */ React21.createElement(
|
|
2801
2561
|
PaginationButton,
|
|
2802
2562
|
{
|
|
2803
2563
|
size,
|
|
@@ -2807,27 +2567,7 @@ function Pagination(props) {
|
|
|
2807
2567
|
"aria-label": "More previous pages"
|
|
2808
2568
|
},
|
|
2809
2569
|
"..."
|
|
2810
|
-
), beforePages.map((p) => /* @__PURE__ */ React21.createElement(
|
|
2811
|
-
PaginationButton,
|
|
2812
|
-
{
|
|
2813
|
-
key: p,
|
|
2814
|
-
size,
|
|
2815
|
-
variant: "plain",
|
|
2816
|
-
color: "neutral",
|
|
2817
|
-
onClick: () => handlePageChange(p)
|
|
2818
|
-
},
|
|
2819
|
-
p
|
|
2820
|
-
)), /* @__PURE__ */ React21.createElement(PaginationButton, { active: "active", size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ React21.createElement(
|
|
2821
|
-
PaginationButton,
|
|
2822
|
-
{
|
|
2823
|
-
key: p,
|
|
2824
|
-
size,
|
|
2825
|
-
variant: "plain",
|
|
2826
|
-
color: "neutral",
|
|
2827
|
-
onClick: () => handlePageChange(p)
|
|
2828
|
-
},
|
|
2829
|
-
p
|
|
2830
|
-
)), isMoreAfterPages && /* @__PURE__ */ React21.createElement(
|
|
2570
|
+
), 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(
|
|
2831
2571
|
PaginationButton,
|
|
2832
2572
|
{
|
|
2833
2573
|
size,
|
|
@@ -2837,16 +2577,7 @@ function Pagination(props) {
|
|
|
2837
2577
|
onClick: () => handlePageChange(paginationModel.page + 3)
|
|
2838
2578
|
},
|
|
2839
2579
|
"..."
|
|
2840
|
-
), paginationModel.page !== lastPage && /* @__PURE__ */ React21.createElement(
|
|
2841
|
-
PaginationButton,
|
|
2842
|
-
{
|
|
2843
|
-
size,
|
|
2844
|
-
variant: "plain",
|
|
2845
|
-
color: "neutral",
|
|
2846
|
-
onClick: () => handlePageChange(lastPage)
|
|
2847
|
-
},
|
|
2848
|
-
lastPage
|
|
2849
|
-
), /* @__PURE__ */ React21.createElement(
|
|
2580
|
+
), paginationModel.page !== lastPage && /* @__PURE__ */ React21.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(lastPage) }, lastPage), /* @__PURE__ */ React21.createElement(
|
|
2850
2581
|
PaginationIconButton,
|
|
2851
2582
|
{
|
|
2852
2583
|
size,
|
|
@@ -2866,10 +2597,7 @@ var Pagination_default = Pagination;
|
|
|
2866
2597
|
|
|
2867
2598
|
// src/components/InfoSign/InfoSign.tsx
|
|
2868
2599
|
import React22 from "react";
|
|
2869
|
-
import {
|
|
2870
|
-
styled as styled11,
|
|
2871
|
-
tooltipClasses
|
|
2872
|
-
} from "@mui/joy";
|
|
2600
|
+
import { styled as styled11, tooltipClasses } from "@mui/joy";
|
|
2873
2601
|
import MuiInfoIcon from "@mui/icons-material/Info";
|
|
2874
2602
|
var InfoIcon = styled11(MuiInfoIcon, {
|
|
2875
2603
|
name: "InfoSign",
|
|
@@ -2901,6 +2629,118 @@ function InfoSign(props) {
|
|
|
2901
2629
|
var InfoSign_default = InfoSign;
|
|
2902
2630
|
|
|
2903
2631
|
// src/components/DataTable/DataTable.tsx
|
|
2632
|
+
function extractFieldsFromGroupingModel(items) {
|
|
2633
|
+
const fields = /* @__PURE__ */ new Set();
|
|
2634
|
+
for (const item of items) {
|
|
2635
|
+
if ("groupId" in item) {
|
|
2636
|
+
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
2637
|
+
const childFields = extractFieldsFromGroupingModel(children);
|
|
2638
|
+
childFields.forEach((field) => fields.add(field));
|
|
2639
|
+
} else {
|
|
2640
|
+
fields.add(item.field);
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
return fields;
|
|
2644
|
+
}
|
|
2645
|
+
function reorderColumnsByGroupingModel(columns, columnGroupingModel) {
|
|
2646
|
+
const fieldsInGroupingModel = extractFieldsFromGroupingModel(columnGroupingModel);
|
|
2647
|
+
const orderedFields = [];
|
|
2648
|
+
function collectFieldsInOrder(items) {
|
|
2649
|
+
for (const item of items) {
|
|
2650
|
+
if ("groupId" in item) {
|
|
2651
|
+
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
2652
|
+
collectFieldsInOrder(children);
|
|
2653
|
+
} else {
|
|
2654
|
+
if (!orderedFields.includes(item.field)) {
|
|
2655
|
+
orderedFields.push(item.field);
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
collectFieldsInOrder(columnGroupingModel);
|
|
2661
|
+
const columnMap = new Map(columns.map((col) => [col.field, col]));
|
|
2662
|
+
const reorderedColumns = [];
|
|
2663
|
+
for (const field of orderedFields) {
|
|
2664
|
+
const column = columnMap.get(field);
|
|
2665
|
+
if (column) {
|
|
2666
|
+
reorderedColumns.push(column);
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
for (const column of columns) {
|
|
2670
|
+
if (!fieldsInGroupingModel.has(column.field)) {
|
|
2671
|
+
reorderedColumns.push(column);
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
return reorderedColumns;
|
|
2675
|
+
}
|
|
2676
|
+
function flattenColumnGroups(items, groupPath = [], columnIndex = { current: 0 }) {
|
|
2677
|
+
const result = [];
|
|
2678
|
+
for (const item of items) {
|
|
2679
|
+
if ("groupId" in item) {
|
|
2680
|
+
const newPath = [...groupPath, item.groupId];
|
|
2681
|
+
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
2682
|
+
result.push(...flattenColumnGroups(children, newPath, columnIndex));
|
|
2683
|
+
} else {
|
|
2684
|
+
result.push({
|
|
2685
|
+
...item,
|
|
2686
|
+
groupPath,
|
|
2687
|
+
columnIndex: columnIndex.current++
|
|
2688
|
+
});
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
return result;
|
|
2692
|
+
}
|
|
2693
|
+
function calculateColumnGroups(columnGroupingModel, columns) {
|
|
2694
|
+
const fieldsInGroupingModel = extractFieldsFromGroupingModel(columnGroupingModel);
|
|
2695
|
+
const flattenedColumns = flattenColumnGroups(columnGroupingModel);
|
|
2696
|
+
const columnIndexMap = new Map(flattenedColumns.map((col) => [col.field, col.columnIndex]));
|
|
2697
|
+
const processedGroups = /* @__PURE__ */ new Map();
|
|
2698
|
+
const groupsByLevel = [];
|
|
2699
|
+
let maxLevel = 0;
|
|
2700
|
+
function processGroup(items, level, parentGroupId) {
|
|
2701
|
+
let minIndex = Infinity;
|
|
2702
|
+
let maxIndex = -Infinity;
|
|
2703
|
+
for (const item of items) {
|
|
2704
|
+
if ("groupId" in item) {
|
|
2705
|
+
const groupKey = parentGroupId ? `${parentGroupId}.${item.groupId}` : item.groupId;
|
|
2706
|
+
if (!processedGroups.has(groupKey)) {
|
|
2707
|
+
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
2708
|
+
const { startIndex, colspan } = processGroup(children, level + 1, groupKey);
|
|
2709
|
+
const group = {
|
|
2710
|
+
groupId: item.groupId,
|
|
2711
|
+
headerName: item.headerName,
|
|
2712
|
+
colspan,
|
|
2713
|
+
level,
|
|
2714
|
+
startIndex
|
|
2715
|
+
};
|
|
2716
|
+
processedGroups.set(groupKey, group);
|
|
2717
|
+
if (!groupsByLevel[level]) {
|
|
2718
|
+
groupsByLevel[level] = [];
|
|
2719
|
+
}
|
|
2720
|
+
groupsByLevel[level].push(group);
|
|
2721
|
+
maxLevel = Math.max(maxLevel, level);
|
|
2722
|
+
minIndex = Math.min(minIndex, startIndex);
|
|
2723
|
+
maxIndex = Math.max(maxIndex, startIndex + colspan - 1);
|
|
2724
|
+
}
|
|
2725
|
+
} else {
|
|
2726
|
+
const columnIndex = columnIndexMap.get(item.field);
|
|
2727
|
+
if (columnIndex !== void 0) {
|
|
2728
|
+
minIndex = Math.min(minIndex, columnIndex);
|
|
2729
|
+
maxIndex = Math.max(maxIndex, columnIndex);
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
}
|
|
2733
|
+
return {
|
|
2734
|
+
startIndex: minIndex === Infinity ? 0 : minIndex,
|
|
2735
|
+
colspan: maxIndex === -Infinity ? 0 : maxIndex - minIndex + 1
|
|
2736
|
+
};
|
|
2737
|
+
}
|
|
2738
|
+
processGroup(columnGroupingModel, 0);
|
|
2739
|
+
groupsByLevel.forEach((level) => {
|
|
2740
|
+
level.sort((a, b) => a.startIndex - b.startIndex);
|
|
2741
|
+
});
|
|
2742
|
+
return { groups: groupsByLevel, maxLevel, fieldsInGroupingModel };
|
|
2743
|
+
}
|
|
2904
2744
|
function getTextAlign(props) {
|
|
2905
2745
|
return !props.editMode && ["number", "date", "currency"].includes(props.type || "") ? "end" : "start";
|
|
2906
2746
|
}
|
|
@@ -2925,15 +2765,7 @@ var TextEllipsis = ({ children }) => {
|
|
|
2925
2765
|
}, [children]);
|
|
2926
2766
|
const content = /* @__PURE__ */ React23.createElement(EllipsisDiv, { ref: textRef }, children);
|
|
2927
2767
|
if (showTooltip) {
|
|
2928
|
-
return /* @__PURE__ */ React23.createElement(
|
|
2929
|
-
Tooltip_default,
|
|
2930
|
-
{
|
|
2931
|
-
title: children,
|
|
2932
|
-
placement: "top",
|
|
2933
|
-
onClick: (e) => e.stopPropagation()
|
|
2934
|
-
},
|
|
2935
|
-
content
|
|
2936
|
-
);
|
|
2768
|
+
return /* @__PURE__ */ React23.createElement(Tooltip_default, { title: children, placement: "top", onClick: (e) => e.stopPropagation() }, content);
|
|
2937
2769
|
}
|
|
2938
2770
|
return content;
|
|
2939
2771
|
};
|
|
@@ -2979,7 +2811,7 @@ var OverlayWrapper = styled12("tr", {
|
|
|
2979
2811
|
}
|
|
2980
2812
|
});
|
|
2981
2813
|
var numberFormatter = (value) => "Intl" in window ? new Intl.NumberFormat().format(value) : value;
|
|
2982
|
-
var Resizer = (ref) => /* @__PURE__ */ React23.createElement(
|
|
2814
|
+
var Resizer = (ref, targetRef = ref) => /* @__PURE__ */ React23.createElement(
|
|
2983
2815
|
Box_default,
|
|
2984
2816
|
{
|
|
2985
2817
|
sx: {
|
|
@@ -2997,6 +2829,7 @@ var Resizer = (ref) => /* @__PURE__ */ React23.createElement(
|
|
|
2997
2829
|
const onMouseMove = (e2) => {
|
|
2998
2830
|
if (initialWidth && initialX) {
|
|
2999
2831
|
ref.current.style.width = `${initialWidth + (e2.clientX - initialX)}px`;
|
|
2832
|
+
targetRef.current.style.width = `${initialWidth + (e2.clientX - initialX)}px`;
|
|
3000
2833
|
}
|
|
3001
2834
|
};
|
|
3002
2835
|
const onMouseUp = () => {
|
|
@@ -3107,20 +2940,19 @@ var HeadCell = (props) => {
|
|
|
3107
2940
|
isPinned,
|
|
3108
2941
|
pinnedStartPosition,
|
|
3109
2942
|
pinnedEndPosition,
|
|
3110
|
-
headerRef
|
|
2943
|
+
headerRef,
|
|
2944
|
+
tableColRef
|
|
3111
2945
|
} = props;
|
|
3112
2946
|
const theme = useTheme();
|
|
3113
2947
|
const ref = headerRef;
|
|
2948
|
+
const colRef = tableColRef;
|
|
3114
2949
|
const [isHovered, setIsHovered] = useState6(false);
|
|
3115
2950
|
const sortable = type === "actions" ? false : _sortable;
|
|
3116
2951
|
const headId = useMemo8(
|
|
3117
2952
|
() => `${tableId}_header_${headerName ?? field}`.trim(),
|
|
3118
2953
|
[tableId, headerName, field]
|
|
3119
2954
|
);
|
|
3120
|
-
const resizer = useMemo8(
|
|
3121
|
-
() => resizable ?? true ? Resizer(ref) : null,
|
|
3122
|
-
[resizable, ref]
|
|
3123
|
-
);
|
|
2955
|
+
const resizer = useMemo8(() => resizable ?? true ? Resizer(ref, colRef) : null, [resizable, ref, colRef]);
|
|
3124
2956
|
const style = useMemo8(
|
|
3125
2957
|
() => ({
|
|
3126
2958
|
width,
|
|
@@ -3135,17 +2967,7 @@ var HeadCell = (props) => {
|
|
|
3135
2967
|
// TODO: multi-sort때문에 일단 추가한 property, joy-ui에서는 multi-sort시 th에 user-select: none을 적용하고 툴팁을 띄워준다.
|
|
3136
2968
|
userSelect: "none"
|
|
3137
2969
|
}),
|
|
3138
|
-
[
|
|
3139
|
-
isPinned,
|
|
3140
|
-
maxWidth,
|
|
3141
|
-
minWidth,
|
|
3142
|
-
pinnedEndPosition,
|
|
3143
|
-
pinnedStartPosition,
|
|
3144
|
-
sortable,
|
|
3145
|
-
stickyHeader,
|
|
3146
|
-
theme,
|
|
3147
|
-
width
|
|
3148
|
-
]
|
|
2970
|
+
[isPinned, maxWidth, minWidth, pinnedEndPosition, pinnedStartPosition, sortable, stickyHeader, theme, width]
|
|
3149
2971
|
);
|
|
3150
2972
|
const textAlign = getTextAlign(props);
|
|
3151
2973
|
const initialSort = sortOrder[0];
|
|
@@ -3202,20 +3024,7 @@ var HeadCell = (props) => {
|
|
|
3202
3024
|
whileHover: "hover",
|
|
3203
3025
|
initial: "initial"
|
|
3204
3026
|
},
|
|
3205
|
-
/* @__PURE__ */ React23.createElement(
|
|
3206
|
-
Stack_default,
|
|
3207
|
-
{
|
|
3208
|
-
gap: 1,
|
|
3209
|
-
direction: "row",
|
|
3210
|
-
justifyContent: textAlign,
|
|
3211
|
-
alignItems: "center"
|
|
3212
|
-
},
|
|
3213
|
-
textAlign === "end" && sortIcon,
|
|
3214
|
-
textAlign === "end" && infoSign,
|
|
3215
|
-
/* @__PURE__ */ React23.createElement(TextEllipsis, null, headerName ?? field, editMode && required && /* @__PURE__ */ React23.createElement(Asterisk, null, "*")),
|
|
3216
|
-
textAlign === "start" && infoSign,
|
|
3217
|
-
textAlign === "start" && sortIcon
|
|
3218
|
-
),
|
|
3027
|
+
/* @__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),
|
|
3219
3028
|
resizer
|
|
3220
3029
|
);
|
|
3221
3030
|
};
|
|
@@ -3234,7 +3043,10 @@ var BodyCell = (props) => {
|
|
|
3234
3043
|
pinnedStartPosition,
|
|
3235
3044
|
pinnedEndPosition,
|
|
3236
3045
|
row,
|
|
3237
|
-
rowId
|
|
3046
|
+
rowId,
|
|
3047
|
+
cellClassName,
|
|
3048
|
+
onCellEditStart,
|
|
3049
|
+
onCellEditStop
|
|
3238
3050
|
} = props;
|
|
3239
3051
|
const theme = useTheme();
|
|
3240
3052
|
const [value, setValue] = useState6(row[field]);
|
|
@@ -3243,20 +3055,22 @@ var BodyCell = (props) => {
|
|
|
3243
3055
|
() => ({
|
|
3244
3056
|
row,
|
|
3245
3057
|
value,
|
|
3246
|
-
id: rowId
|
|
3058
|
+
id: rowId,
|
|
3059
|
+
field
|
|
3247
3060
|
}),
|
|
3248
|
-
[row, rowId, value]
|
|
3061
|
+
[row, rowId, value, field]
|
|
3249
3062
|
);
|
|
3250
3063
|
const editMode = useMemo8(
|
|
3251
3064
|
() => !!(props.editMode && (typeof isCellEditable === "function" ? isCellEditable(params) : isCellEditable ?? true)),
|
|
3252
3065
|
[props.editMode, isCellEditable, params]
|
|
3253
3066
|
);
|
|
3067
|
+
const propsComponentProps = "componentProps" in props ? props.componentProps : null;
|
|
3254
3068
|
const componentProps = useMemo8(
|
|
3255
3069
|
() => ({
|
|
3256
|
-
..."componentProps" in props && (typeof
|
|
3070
|
+
..."componentProps" in props && (typeof propsComponentProps === "function" ? propsComponentProps(params) : propsComponentProps || {}),
|
|
3257
3071
|
size: "sm"
|
|
3258
3072
|
}),
|
|
3259
|
-
[
|
|
3073
|
+
[props, propsComponentProps, params]
|
|
3260
3074
|
);
|
|
3261
3075
|
const editModeComponentProps = useMemo8(
|
|
3262
3076
|
() => ({
|
|
@@ -3265,7 +3079,7 @@ var BodyCell = (props) => {
|
|
|
3265
3079
|
componentProps.onChange?.(e);
|
|
3266
3080
|
setValue(e.target.value);
|
|
3267
3081
|
if (type === "select") {
|
|
3268
|
-
|
|
3082
|
+
onCellEditStop?.({
|
|
3269
3083
|
...params,
|
|
3270
3084
|
originalRow: row,
|
|
3271
3085
|
row: {
|
|
@@ -3278,7 +3092,7 @@ var BodyCell = (props) => {
|
|
|
3278
3092
|
},
|
|
3279
3093
|
onFocus: (e) => {
|
|
3280
3094
|
componentProps.onFocus?.(e);
|
|
3281
|
-
|
|
3095
|
+
onCellEditStart?.({
|
|
3282
3096
|
...params,
|
|
3283
3097
|
originalRow: row,
|
|
3284
3098
|
row: {
|
|
@@ -3291,7 +3105,7 @@ var BodyCell = (props) => {
|
|
|
3291
3105
|
onBlur: (e) => {
|
|
3292
3106
|
componentProps.onBlur?.(e);
|
|
3293
3107
|
if (type && ["number", "text", "longText", "currency", "date"].includes(type)) {
|
|
3294
|
-
|
|
3108
|
+
onCellEditStop?.({
|
|
3295
3109
|
...params,
|
|
3296
3110
|
originalRow: row,
|
|
3297
3111
|
row: {
|
|
@@ -3306,7 +3120,7 @@ var BodyCell = (props) => {
|
|
|
3306
3120
|
onChangeComplete: (e) => {
|
|
3307
3121
|
componentProps.onChangeComplete?.(e);
|
|
3308
3122
|
setValue(e.target.value);
|
|
3309
|
-
|
|
3123
|
+
onCellEditStop?.({
|
|
3310
3124
|
...params,
|
|
3311
3125
|
originalRow: row,
|
|
3312
3126
|
row: {
|
|
@@ -3318,29 +3132,14 @@ var BodyCell = (props) => {
|
|
|
3318
3132
|
}
|
|
3319
3133
|
}
|
|
3320
3134
|
}),
|
|
3321
|
-
[
|
|
3322
|
-
params,
|
|
3323
|
-
row,
|
|
3324
|
-
field,
|
|
3325
|
-
value,
|
|
3326
|
-
componentProps,
|
|
3327
|
-
type,
|
|
3328
|
-
props.onCellEditStop,
|
|
3329
|
-
props.onCellEditStart
|
|
3330
|
-
]
|
|
3135
|
+
[params, row, field, value, componentProps, type, onCellEditStop, onCellEditStart]
|
|
3331
3136
|
);
|
|
3332
3137
|
const EditModeComponent = useMemo8(() => {
|
|
3333
3138
|
if (renderEditCell) {
|
|
3334
3139
|
return createElement(memo(renderEditCell), params);
|
|
3335
3140
|
}
|
|
3336
3141
|
return {
|
|
3337
|
-
date: /* @__PURE__ */ React23.createElement(
|
|
3338
|
-
DatePicker_default,
|
|
3339
|
-
{
|
|
3340
|
-
value,
|
|
3341
|
-
...editModeComponentProps
|
|
3342
|
-
}
|
|
3343
|
-
),
|
|
3142
|
+
date: /* @__PURE__ */ React23.createElement(DatePicker_default, { value, ...editModeComponentProps }),
|
|
3344
3143
|
currency: /* @__PURE__ */ React23.createElement(
|
|
3345
3144
|
CurrencyInput_default,
|
|
3346
3145
|
{
|
|
@@ -3348,29 +3147,9 @@ var BodyCell = (props) => {
|
|
|
3348
3147
|
...editModeComponentProps
|
|
3349
3148
|
}
|
|
3350
3149
|
),
|
|
3351
|
-
number: /* @__PURE__ */ React23.createElement(
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
value,
|
|
3355
|
-
type: "number",
|
|
3356
|
-
...editModeComponentProps
|
|
3357
|
-
}
|
|
3358
|
-
),
|
|
3359
|
-
text: /* @__PURE__ */ React23.createElement(
|
|
3360
|
-
Input_default,
|
|
3361
|
-
{
|
|
3362
|
-
value,
|
|
3363
|
-
type: "text",
|
|
3364
|
-
...editModeComponentProps
|
|
3365
|
-
}
|
|
3366
|
-
),
|
|
3367
|
-
longText: /* @__PURE__ */ React23.createElement(
|
|
3368
|
-
Textarea_default,
|
|
3369
|
-
{
|
|
3370
|
-
value,
|
|
3371
|
-
...editModeComponentProps
|
|
3372
|
-
}
|
|
3373
|
-
),
|
|
3150
|
+
number: /* @__PURE__ */ React23.createElement(Input_default, { value, type: "number", ...editModeComponentProps }),
|
|
3151
|
+
text: /* @__PURE__ */ React23.createElement(Input_default, { value, type: "text", ...editModeComponentProps }),
|
|
3152
|
+
longText: /* @__PURE__ */ React23.createElement(Textarea_default, { value, ...editModeComponentProps }),
|
|
3374
3153
|
autocomplete: /* @__PURE__ */ React23.createElement(
|
|
3375
3154
|
Autocomplete_default,
|
|
3376
3155
|
{
|
|
@@ -3388,50 +3167,34 @@ var BodyCell = (props) => {
|
|
|
3388
3167
|
}
|
|
3389
3168
|
)
|
|
3390
3169
|
}[type || "text"];
|
|
3391
|
-
}, [value, editModeComponentProps, type]);
|
|
3170
|
+
}, [value, editModeComponentProps, type, renderEditCell, params]);
|
|
3171
|
+
const linkComponentFromProps = props.component;
|
|
3392
3172
|
const ReadModeComponent = useMemo8(() => {
|
|
3393
3173
|
if (renderCell) {
|
|
3394
3174
|
return createElement(memo(renderCell), params);
|
|
3395
3175
|
}
|
|
3396
3176
|
const innerText = value;
|
|
3397
3177
|
const typedComponent = {
|
|
3398
|
-
link: React23.createElement(
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
...componentProps
|
|
3403
|
-
}
|
|
3404
|
-
)
|
|
3178
|
+
link: React23.createElement(linkComponentFromProps || Link, {
|
|
3179
|
+
children: innerText,
|
|
3180
|
+
...componentProps
|
|
3181
|
+
})
|
|
3405
3182
|
}[type || "text"];
|
|
3406
3183
|
return typedComponent || innerText;
|
|
3407
|
-
}, [value, renderCell, params, type, componentProps]);
|
|
3184
|
+
}, [value, renderCell, params, type, componentProps, linkComponentFromProps]);
|
|
3185
|
+
const getActions = props.getActions;
|
|
3408
3186
|
const CellComponent = useMemo8(() => {
|
|
3409
3187
|
if (type === "actions") {
|
|
3410
|
-
return /* @__PURE__ */ React23.createElement(
|
|
3411
|
-
Stack_default,
|
|
3412
|
-
{
|
|
3413
|
-
direction: "row",
|
|
3414
|
-
gap: 1,
|
|
3415
|
-
justifyContent: "center",
|
|
3416
|
-
alignItems: "center"
|
|
3417
|
-
},
|
|
3418
|
-
props.getActions?.(params)
|
|
3419
|
-
);
|
|
3188
|
+
return /* @__PURE__ */ React23.createElement(Stack_default, { direction: "row", gap: 1, justifyContent: "center", alignItems: "center" }, getActions?.(params));
|
|
3420
3189
|
}
|
|
3421
3190
|
return editMode && EditModeComponent ? EditModeComponent : ReadModeComponent;
|
|
3422
|
-
}, [
|
|
3423
|
-
|
|
3424
|
-
props.getActions,
|
|
3425
|
-
params,
|
|
3426
|
-
editMode,
|
|
3427
|
-
EditModeComponent,
|
|
3428
|
-
ReadModeComponent
|
|
3429
|
-
]);
|
|
3430
|
-
const showTooltip = useMemo8(
|
|
3431
|
-
() => noWrap && type === "longText",
|
|
3432
|
-
[noWrap, type]
|
|
3433
|
-
);
|
|
3191
|
+
}, [type, getActions, params, editMode, EditModeComponent, ReadModeComponent]);
|
|
3192
|
+
const showTooltip = useMemo8(() => noWrap && type === "longText", [noWrap, type]);
|
|
3434
3193
|
const isBoundary = props.isLastStartPinnedColumn || props.isLastEndPinnedColumn;
|
|
3194
|
+
const computedCellClassName = useMemo8(
|
|
3195
|
+
() => (typeof cellClassName === "function" ? cellClassName(params) : cellClassName) || "",
|
|
3196
|
+
[cellClassName, params]
|
|
3197
|
+
);
|
|
3435
3198
|
useEffect5(() => {
|
|
3436
3199
|
setValue(row[field]);
|
|
3437
3200
|
}, [row, field]);
|
|
@@ -3450,11 +3213,11 @@ var BodyCell = (props) => {
|
|
|
3450
3213
|
zIndex: isPinned ? `calc(${theme.getCssVar("zIndex-table")} + ${isBoundary ? 2 : 3})` : void 0,
|
|
3451
3214
|
"--TableCell-dataBackground": isPinned ? `var(--TableCell-headBackground)` : void 0
|
|
3452
3215
|
},
|
|
3453
|
-
className: isLastStartPinnedColumn && "is-last-left"
|
|
3216
|
+
className: [isLastStartPinnedColumn && "is-last-left", isLastEndPinnedColumn && "is-last-right", computedCellClassName].filter(Boolean).join(" ") || ""
|
|
3454
3217
|
},
|
|
3455
3218
|
useMemo8(
|
|
3456
3219
|
() => showTooltip ? /* @__PURE__ */ React23.createElement(CellTextEllipsis, null, CellComponent) : CellComponent,
|
|
3457
|
-
[CellComponent, showTooltip
|
|
3220
|
+
[CellComponent, showTooltip]
|
|
3458
3221
|
)
|
|
3459
3222
|
);
|
|
3460
3223
|
};
|
|
@@ -3524,31 +3287,40 @@ function useDataTableRenderer({
|
|
|
3524
3287
|
editMode,
|
|
3525
3288
|
getId: _getId,
|
|
3526
3289
|
isTotalSelected: _isTotalSelected,
|
|
3527
|
-
isRowSelectable
|
|
3290
|
+
isRowSelectable,
|
|
3291
|
+
columnGroupingModel
|
|
3292
|
+
// Add this prop
|
|
3528
3293
|
}) {
|
|
3294
|
+
if (pinnedColumns && columnGroupingModel) {
|
|
3295
|
+
throw new Error(
|
|
3296
|
+
"You cannot use both `pinnedColumns` and `columnGroupingModel` at the same time. Please choose one of them."
|
|
3297
|
+
);
|
|
3298
|
+
}
|
|
3529
3299
|
const onSelectionModelChangeRef = useRef4(onSelectionModelChange);
|
|
3530
3300
|
onSelectionModelChangeRef.current = onSelectionModelChange;
|
|
3531
3301
|
const [focusedRowId, setFocusedRowId] = useState6(null);
|
|
3532
3302
|
const [sortModel, setSortModel] = useControlledState(
|
|
3533
3303
|
controlledSortModel,
|
|
3534
3304
|
initialState?.sorting?.sortModel ?? [],
|
|
3535
|
-
useCallback9(
|
|
3536
|
-
(sortModel2) => onSortModelChange?.(sortModel2),
|
|
3537
|
-
[onSortModelChange]
|
|
3538
|
-
)
|
|
3305
|
+
useCallback9((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3539
3306
|
);
|
|
3307
|
+
const reorderedColumns = useMemo8(() => {
|
|
3308
|
+
if (!columnGroupingModel) return columnsProp;
|
|
3309
|
+
return reorderColumnsByGroupingModel(columnsProp, columnGroupingModel);
|
|
3310
|
+
}, [columnsProp, columnGroupingModel]);
|
|
3540
3311
|
const columnsByField = useMemo8(
|
|
3541
|
-
() =>
|
|
3312
|
+
() => reorderedColumns.reduce(
|
|
3542
3313
|
(acc, curr) => ({
|
|
3543
3314
|
...acc,
|
|
3544
3315
|
[curr.field]: {
|
|
3545
3316
|
...curr,
|
|
3546
|
-
headerRef: React23.createRef()
|
|
3317
|
+
headerRef: React23.createRef(),
|
|
3318
|
+
tableColRef: React23.createRef()
|
|
3547
3319
|
}
|
|
3548
3320
|
}),
|
|
3549
3321
|
{}
|
|
3550
3322
|
),
|
|
3551
|
-
[
|
|
3323
|
+
[reorderedColumns]
|
|
3552
3324
|
);
|
|
3553
3325
|
const sortComparator = useCallback9(
|
|
3554
3326
|
(rowA, rowB) => {
|
|
@@ -3610,9 +3382,7 @@ function useDataTableRenderer({
|
|
|
3610
3382
|
[dataInPage, isRowSelectable, getId]
|
|
3611
3383
|
);
|
|
3612
3384
|
const isAllSelected = useMemo8(
|
|
3613
|
-
() => selectableDataInPage.length > 0 && selectableDataInPage.every(
|
|
3614
|
-
(row, i) => selectedModelSet.has(getId(row, i))
|
|
3615
|
-
),
|
|
3385
|
+
() => selectableDataInPage.length > 0 && selectableDataInPage.every((row, i) => selectedModelSet.has(getId(row, i))),
|
|
3616
3386
|
[selectableDataInPage, selectedModelSet, getId]
|
|
3617
3387
|
);
|
|
3618
3388
|
const rowCount = totalRowsProp || rows.length;
|
|
@@ -3630,22 +3400,25 @@ function useDataTableRenderer({
|
|
|
3630
3400
|
columnsByField[f].minWidth ?? 0,
|
|
3631
3401
|
[columnWidths, columnsByField]
|
|
3632
3402
|
);
|
|
3403
|
+
const processedColumnGroups = useMemo8(() => {
|
|
3404
|
+
if (!columnGroupingModel) return null;
|
|
3405
|
+
return calculateColumnGroups(columnGroupingModel, reorderedColumns);
|
|
3406
|
+
}, [columnGroupingModel, reorderedColumns]);
|
|
3633
3407
|
const columns = useMemo8(() => {
|
|
3634
|
-
const baseColumns =
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3408
|
+
const baseColumns = reorderedColumns.length > 0 ? reorderedColumns : (
|
|
3409
|
+
// fallback
|
|
3410
|
+
Object.keys(rows[0] || {}).map((key) => ({
|
|
3411
|
+
field: key
|
|
3412
|
+
}))
|
|
3413
|
+
);
|
|
3638
3414
|
return baseColumns.map((column) => {
|
|
3639
|
-
const isLeftPinned = pinnedColumns?.left?.includes(
|
|
3640
|
-
|
|
3641
|
-
);
|
|
3642
|
-
const isRightPinned = pinnedColumns?.right?.includes(
|
|
3643
|
-
column.field
|
|
3644
|
-
);
|
|
3415
|
+
const isLeftPinned = pinnedColumns?.left?.includes(column.field);
|
|
3416
|
+
const isRightPinned = pinnedColumns?.right?.includes(column.field);
|
|
3645
3417
|
const isPinned = isLeftPinned || isRightPinned;
|
|
3646
3418
|
return {
|
|
3647
3419
|
...column,
|
|
3648
3420
|
headerRef: columnsByField[column.field].headerRef,
|
|
3421
|
+
tableColRef: columnsByField[column.field].tableColRef,
|
|
3649
3422
|
isCellEditable: editMode && (typeof column.isCellEditable === "function" ? column.isCellEditable : column.isCellEditable ?? true),
|
|
3650
3423
|
sort: sortModel.find((sort) => sort.field === column.field)?.sort,
|
|
3651
3424
|
sortOrder: columnsByField[column.field]?.sortOrder || sortOrder,
|
|
@@ -3653,17 +3426,12 @@ function useDataTableRenderer({
|
|
|
3653
3426
|
isLastStartPinnedColumn: isLeftPinned && [...pinnedColumns?.left || []].pop() === column.field,
|
|
3654
3427
|
isLastEndPinnedColumn: isRightPinned && (pinnedColumns?.right?.[0] ?? null) === column.field,
|
|
3655
3428
|
// pinned 관련 계산부
|
|
3656
|
-
pinnedStartPosition: pinnedColumns?.left?.slice(
|
|
3657
|
-
|
|
3658
|
-
isLeftPinned ? pinnedColumns.left.indexOf(column.field) : pinnedColumns.left.length
|
|
3659
|
-
).reduce((acc, curr) => acc + getWidth(curr), 0),
|
|
3660
|
-
pinnedEndPosition: pinnedColumns?.right?.slice(
|
|
3661
|
-
isRightPinned ? pinnedColumns.right.indexOf(column.field) + 1 : 0
|
|
3662
|
-
).reduce((acc, curr) => acc + getWidth(curr), 0)
|
|
3429
|
+
pinnedStartPosition: pinnedColumns?.left?.slice(0, isLeftPinned ? pinnedColumns.left.indexOf(column.field) : pinnedColumns.left.length).reduce((acc, curr) => acc + getWidth(curr), 0),
|
|
3430
|
+
pinnedEndPosition: pinnedColumns?.right?.slice(isRightPinned ? pinnedColumns.right.indexOf(column.field) + 1 : 0).reduce((acc, curr) => acc + getWidth(curr), 0)
|
|
3663
3431
|
};
|
|
3664
3432
|
});
|
|
3665
3433
|
}, [
|
|
3666
|
-
|
|
3434
|
+
reorderedColumns,
|
|
3667
3435
|
rows,
|
|
3668
3436
|
pinnedColumns?.left,
|
|
3669
3437
|
pinnedColumns?.right,
|
|
@@ -3694,9 +3462,7 @@ function useDataTableRenderer({
|
|
|
3694
3462
|
setSortModel(newSortModel2);
|
|
3695
3463
|
return;
|
|
3696
3464
|
}
|
|
3697
|
-
const newSortModel = multiple ? sortModel.map(
|
|
3698
|
-
(model) => model.field === field ? { field, sort: nextSortOrder } : model
|
|
3699
|
-
) : [{ field, sort: nextSortOrder }];
|
|
3465
|
+
const newSortModel = multiple ? sortModel.map((model) => model.field === field ? { field, sort: nextSortOrder } : model) : [{ field, sort: nextSortOrder }];
|
|
3700
3466
|
setSortModel(newSortModel);
|
|
3701
3467
|
} else {
|
|
3702
3468
|
const newSortModel = multiple ? [...sortModel, { field, sort: columnSortOrder[0] }] : [{ field, sort: columnSortOrder[0] }];
|
|
@@ -3733,10 +3499,7 @@ function useDataTableRenderer({
|
|
|
3733
3499
|
isAllSelected,
|
|
3734
3500
|
// all rows are selected on this page
|
|
3735
3501
|
isTotalSelected,
|
|
3736
|
-
isSelectedRow: useCallback9(
|
|
3737
|
-
(model) => selectedModelSet.has(model),
|
|
3738
|
-
[selectedModelSet]
|
|
3739
|
-
),
|
|
3502
|
+
isSelectedRow: useCallback9((model) => selectedModelSet.has(model), [selectedModelSet]),
|
|
3740
3503
|
isRowSelectable: useCallback9(
|
|
3741
3504
|
(rowId, row) => {
|
|
3742
3505
|
if (!isRowSelectable) return true;
|
|
@@ -3749,16 +3512,12 @@ function useDataTableRenderer({
|
|
|
3749
3512
|
setFocusedRowId(rowId);
|
|
3750
3513
|
}, []),
|
|
3751
3514
|
onAllCheckboxChange: useCallback9(() => {
|
|
3752
|
-
onSelectionModelChange?.(
|
|
3753
|
-
isAllSelected ? [] : selectableDataInPage.map(getId)
|
|
3754
|
-
);
|
|
3515
|
+
onSelectionModelChange?.(isAllSelected ? [] : selectableDataInPage.map(getId));
|
|
3755
3516
|
}, [isAllSelected, selectableDataInPage, onSelectionModelChange, getId]),
|
|
3756
3517
|
onCheckboxChange: useCallback9(
|
|
3757
3518
|
(event, selectedModel) => {
|
|
3758
3519
|
if (selectedModelSet.has(selectedModel)) {
|
|
3759
|
-
const newSelectionModel = (selectionModel || []).filter(
|
|
3760
|
-
(model) => model !== selectedModel
|
|
3761
|
-
);
|
|
3520
|
+
const newSelectionModel = (selectionModel || []).filter((model) => model !== selectedModel);
|
|
3762
3521
|
onSelectionModelChange?.(newSelectionModel);
|
|
3763
3522
|
} else {
|
|
3764
3523
|
const newSelectionModel = [...selectionModel || [], selectedModel];
|
|
@@ -3768,15 +3527,13 @@ function useDataTableRenderer({
|
|
|
3768
3527
|
[selectionModel, onSelectionModelChange, selectedModelSet]
|
|
3769
3528
|
),
|
|
3770
3529
|
columns,
|
|
3530
|
+
processedColumnGroups,
|
|
3771
3531
|
onTotalSelect: useCallback9(() => {
|
|
3772
3532
|
const selectableRows = rows.filter((row, i) => {
|
|
3773
3533
|
if (!isRowSelectable) return true;
|
|
3774
3534
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
3775
3535
|
});
|
|
3776
|
-
onSelectionModelChange?.(
|
|
3777
|
-
isTotalSelected ? [] : selectableRows.map(getId),
|
|
3778
|
-
!isTotalSelected
|
|
3779
|
-
);
|
|
3536
|
+
onSelectionModelChange?.(isTotalSelected ? [] : selectableRows.map(getId), !isTotalSelected);
|
|
3780
3537
|
}, [isTotalSelected, rows, onSelectionModelChange, getId, isRowSelectable])
|
|
3781
3538
|
};
|
|
3782
3539
|
}
|
|
@@ -3813,17 +3570,15 @@ function Component(props, apiRef) {
|
|
|
3813
3570
|
getId: ____________,
|
|
3814
3571
|
// getId is used in useDataTableRenderer
|
|
3815
3572
|
loading,
|
|
3573
|
+
columnGroupingModel: _________________,
|
|
3574
|
+
// columnGroupingModel is used in useDataTableRenderer
|
|
3816
3575
|
slots: {
|
|
3817
3576
|
checkbox: RenderCheckbox = Checkbox_default,
|
|
3818
3577
|
toolbar: Toolbar,
|
|
3819
3578
|
footer: Footer,
|
|
3820
3579
|
loadingOverlay: LoadingOverlay = DefaultLoadingOverlay
|
|
3821
3580
|
} = {},
|
|
3822
|
-
slotProps: {
|
|
3823
|
-
checkbox: checkboxProps = {},
|
|
3824
|
-
toolbar: toolbarProps,
|
|
3825
|
-
background: backgroundProps = {}
|
|
3826
|
-
} = {},
|
|
3581
|
+
slotProps: { checkbox: checkboxProps = {}, toolbar: toolbarProps, background: backgroundProps = {} } = {},
|
|
3827
3582
|
stripe,
|
|
3828
3583
|
isTotalSelected: ___________,
|
|
3829
3584
|
...innerProps
|
|
@@ -3833,6 +3588,7 @@ function Component(props, apiRef) {
|
|
|
3833
3588
|
const tableBodyRef = useRef4(null);
|
|
3834
3589
|
const {
|
|
3835
3590
|
columns,
|
|
3591
|
+
processedColumnGroups,
|
|
3836
3592
|
isAllSelected,
|
|
3837
3593
|
isSelectedRow,
|
|
3838
3594
|
isRowSelectable: isRowSelectableCheck,
|
|
@@ -3868,13 +3624,7 @@ function Component(props, apiRef) {
|
|
|
3868
3624
|
onRowClick?.({ row, rowId }, e);
|
|
3869
3625
|
checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
|
|
3870
3626
|
},
|
|
3871
|
-
[
|
|
3872
|
-
onRowClick,
|
|
3873
|
-
checkboxSelection,
|
|
3874
|
-
disableSelectionOnClick,
|
|
3875
|
-
onCheckboxChange,
|
|
3876
|
-
isRowSelectableCheck
|
|
3877
|
-
]
|
|
3627
|
+
[onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
|
|
3878
3628
|
);
|
|
3879
3629
|
const getRowFocusHandler = useCallback9(
|
|
3880
3630
|
(rowId) => () => {
|
|
@@ -3932,16 +3682,7 @@ function Component(props, apiRef) {
|
|
|
3932
3682
|
justifyContent: "space-between",
|
|
3933
3683
|
alignItems: "center"
|
|
3934
3684
|
},
|
|
3935
|
-
!!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(
|
|
3936
|
-
Button_default,
|
|
3937
|
-
{
|
|
3938
|
-
size: "sm",
|
|
3939
|
-
variant: "plain",
|
|
3940
|
-
color: "danger",
|
|
3941
|
-
onClick: onTotalSelect
|
|
3942
|
-
},
|
|
3943
|
-
"Cancel"
|
|
3944
|
-
))),
|
|
3685
|
+
!!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"))),
|
|
3945
3686
|
Toolbar && /* @__PURE__ */ React23.createElement(Toolbar, { ...toolbarProps || {} })
|
|
3946
3687
|
),
|
|
3947
3688
|
/* @__PURE__ */ React23.createElement(
|
|
@@ -3955,7 +3696,8 @@ function Component(props, apiRef) {
|
|
|
3955
3696
|
boxShadow: "sm",
|
|
3956
3697
|
borderRadius: "sm",
|
|
3957
3698
|
"--DataTableSheet-width": parentRef.current?.clientWidth + "px",
|
|
3958
|
-
backgroundColor: "white"
|
|
3699
|
+
backgroundColor: "white",
|
|
3700
|
+
"--TableCell-cornerRadius": "0px"
|
|
3959
3701
|
},
|
|
3960
3702
|
className: [
|
|
3961
3703
|
...(parentRef.current?.scrollLeft || 0) > 0 ? ["ScrollableRight"] : [],
|
|
@@ -3964,12 +3706,30 @@ function Component(props, apiRef) {
|
|
|
3964
3706
|
ref: parentRef,
|
|
3965
3707
|
...backgroundProps
|
|
3966
3708
|
},
|
|
3967
|
-
/* @__PURE__ */ React23.createElement(Table, { ...innerProps }, /* @__PURE__ */ React23.createElement("
|
|
3709
|
+
/* @__PURE__ */ React23.createElement(Table, { ...innerProps }, /* @__PURE__ */ React23.createElement("colgroup", null, checkboxSelection && /* @__PURE__ */ React23.createElement(
|
|
3710
|
+
"col",
|
|
3711
|
+
{
|
|
3712
|
+
style: {
|
|
3713
|
+
width: "40px"
|
|
3714
|
+
}
|
|
3715
|
+
}
|
|
3716
|
+
), columns.map((c) => /* @__PURE__ */ React23.createElement(
|
|
3717
|
+
"col",
|
|
3718
|
+
{
|
|
3719
|
+
ref: c.tableColRef,
|
|
3720
|
+
key: `${c.field.toString()}_${c.width}`,
|
|
3721
|
+
style: {
|
|
3722
|
+
width: c.width
|
|
3723
|
+
}
|
|
3724
|
+
}
|
|
3725
|
+
))), /* @__PURE__ */ React23.createElement("thead", null, processedColumnGroups && processedColumnGroups.groups.map((levelGroups, level) => /* @__PURE__ */ React23.createElement("tr", { key: `group-level-${level}` }, checkboxSelection && level === 0 && /* @__PURE__ */ React23.createElement(
|
|
3968
3726
|
"th",
|
|
3969
3727
|
{
|
|
3728
|
+
rowSpan: processedColumnGroups.maxLevel + 2,
|
|
3970
3729
|
style: {
|
|
3971
3730
|
width: "40px",
|
|
3972
|
-
textAlign: "center"
|
|
3731
|
+
textAlign: "center",
|
|
3732
|
+
verticalAlign: "middle"
|
|
3973
3733
|
}
|
|
3974
3734
|
},
|
|
3975
3735
|
/* @__PURE__ */ React23.createElement(
|
|
@@ -3982,16 +3742,52 @@ function Component(props, apiRef) {
|
|
|
3982
3742
|
...checkboxProps
|
|
3983
3743
|
}
|
|
3984
3744
|
)
|
|
3985
|
-
),
|
|
3986
|
-
|
|
3745
|
+
), level > 0 && Array.from({ length: levelGroups[0]?.startIndex || 0 }).map((_2, i) => /* @__PURE__ */ React23.createElement("th", { key: `empty-${level}-${i}` })), levelGroups.map((group, groupIndex) => {
|
|
3746
|
+
const nextGroup = levelGroups[groupIndex + 1];
|
|
3747
|
+
const emptyCells = nextGroup ? nextGroup.startIndex - (group.startIndex + group.colspan) : columns.length - (group.startIndex + group.colspan);
|
|
3748
|
+
return /* @__PURE__ */ React23.createElement(Fragment2, { key: group.groupId }, /* @__PURE__ */ React23.createElement(
|
|
3749
|
+
"th",
|
|
3750
|
+
{
|
|
3751
|
+
colSpan: group.colspan,
|
|
3752
|
+
style: {
|
|
3753
|
+
textAlign: "center",
|
|
3754
|
+
fontWeight: "bold",
|
|
3755
|
+
verticalAlign: "middle"
|
|
3756
|
+
}
|
|
3757
|
+
},
|
|
3758
|
+
group.headerName ?? group.groupId
|
|
3759
|
+
), emptyCells > 0 && Array.from({ length: emptyCells }).map((_2, i) => /* @__PURE__ */ React23.createElement("th", { key: `empty-between-${level}-${groupIndex}-${i}`, colSpan: 1 })));
|
|
3760
|
+
}))), /* @__PURE__ */ React23.createElement("tr", null, !processedColumnGroups && checkboxSelection && /* @__PURE__ */ React23.createElement(
|
|
3761
|
+
"th",
|
|
3987
3762
|
{
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3763
|
+
style: {
|
|
3764
|
+
width: "40px",
|
|
3765
|
+
textAlign: "center"
|
|
3766
|
+
}
|
|
3767
|
+
},
|
|
3768
|
+
/* @__PURE__ */ React23.createElement(
|
|
3769
|
+
RenderCheckbox,
|
|
3770
|
+
{
|
|
3771
|
+
onChange: onAllCheckboxChange,
|
|
3772
|
+
checked: isAllSelected,
|
|
3773
|
+
indeterminate: (selectionModel || []).length > 0 && !isAllSelected,
|
|
3774
|
+
disabled: dataInPage.length > 0 && !selectableRowCount,
|
|
3775
|
+
...checkboxProps
|
|
3776
|
+
}
|
|
3777
|
+
)
|
|
3778
|
+
), columns.map((c, i) => (
|
|
3779
|
+
// @ts-ignore
|
|
3780
|
+
/* @__PURE__ */ React23.createElement(
|
|
3781
|
+
HeadCell2,
|
|
3782
|
+
{
|
|
3783
|
+
tableId,
|
|
3784
|
+
key: `${c.field.toString()}_${i}`,
|
|
3785
|
+
stickyHeader: props.stickyHeader,
|
|
3786
|
+
editMode: !!c.isCellEditable,
|
|
3787
|
+
onSortChange: handleSortChange,
|
|
3788
|
+
...c
|
|
3789
|
+
}
|
|
3790
|
+
)
|
|
3995
3791
|
)))), /* @__PURE__ */ React23.createElement(
|
|
3996
3792
|
VirtualizedTableBody,
|
|
3997
3793
|
{
|
|
@@ -4098,15 +3894,7 @@ var DataTable = forwardRef7(Component);
|
|
|
4098
3894
|
DataTable.displayName = "DataTable";
|
|
4099
3895
|
|
|
4100
3896
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
4101
|
-
import React24, {
|
|
4102
|
-
forwardRef as forwardRef8,
|
|
4103
|
-
useCallback as useCallback10,
|
|
4104
|
-
useEffect as useEffect6,
|
|
4105
|
-
useImperativeHandle as useImperativeHandle3,
|
|
4106
|
-
useMemo as useMemo9,
|
|
4107
|
-
useRef as useRef5,
|
|
4108
|
-
useState as useState7
|
|
4109
|
-
} from "react";
|
|
3897
|
+
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";
|
|
4110
3898
|
import { IMaskInput as IMaskInput2, IMask as IMask2 } from "react-imask";
|
|
4111
3899
|
import CalendarTodayIcon2 from "@mui/icons-material/CalendarToday";
|
|
4112
3900
|
import { styled as styled13, useThemeProps as useThemeProps5 } from "@mui/joy";
|
|
@@ -4118,9 +3906,7 @@ var CalendarButton2 = styled13(IconButton_default, {
|
|
|
4118
3906
|
"&:focus": {
|
|
4119
3907
|
"--Icon-color": "currentColor",
|
|
4120
3908
|
outlineOffset: `${theme.getCssVar("focus-thickness")}`,
|
|
4121
|
-
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar(
|
|
4122
|
-
"palette-focusVisible"
|
|
4123
|
-
)}`
|
|
3909
|
+
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
4124
3910
|
}
|
|
4125
3911
|
}));
|
|
4126
3912
|
var StyledPopper2 = styled13(Popper3, {
|
|
@@ -4157,10 +3943,7 @@ var validValueFormat2 = (value, format) => {
|
|
|
4157
3943
|
if (parsedDate1.toString() === "Invalid Date" || parsedDate2.toString() === "Invalid Date") {
|
|
4158
3944
|
return false;
|
|
4159
3945
|
}
|
|
4160
|
-
const formattedValue = formatValueString2(
|
|
4161
|
-
[parsedDate1, parsedDate2],
|
|
4162
|
-
format
|
|
4163
|
-
);
|
|
3946
|
+
const formattedValue = formatValueString2([parsedDate1, parsedDate2], format);
|
|
4164
3947
|
if (value !== formattedValue) {
|
|
4165
3948
|
return false;
|
|
4166
3949
|
}
|
|
@@ -4212,296 +3995,268 @@ var parseDates = (str, format) => {
|
|
|
4212
3995
|
var formatToPattern2 = (format) => {
|
|
4213
3996
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
4214
3997
|
};
|
|
4215
|
-
var TextMaskAdapter5 = React24.forwardRef(
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
maxLength: 2
|
|
4232
|
-
},
|
|
4233
|
-
M: {
|
|
4234
|
-
mask: IMask2.MaskedRange,
|
|
4235
|
-
from: 1,
|
|
4236
|
-
to: 12,
|
|
4237
|
-
maxLength: 2
|
|
4238
|
-
},
|
|
4239
|
-
Y: {
|
|
4240
|
-
mask: IMask2.MaskedRange,
|
|
4241
|
-
from: 1900,
|
|
4242
|
-
to: 9999
|
|
4243
|
-
}
|
|
3998
|
+
var TextMaskAdapter5 = React24.forwardRef(function TextMaskAdapter6(props, ref) {
|
|
3999
|
+
const { onChange, format, ...other } = props;
|
|
4000
|
+
return /* @__PURE__ */ React24.createElement(
|
|
4001
|
+
IMaskInput2,
|
|
4002
|
+
{
|
|
4003
|
+
...other,
|
|
4004
|
+
inputRef: ref,
|
|
4005
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
4006
|
+
mask: Date,
|
|
4007
|
+
pattern: formatToPattern2(format),
|
|
4008
|
+
blocks: {
|
|
4009
|
+
D: {
|
|
4010
|
+
mask: IMask2.MaskedRange,
|
|
4011
|
+
from: 1,
|
|
4012
|
+
to: 31,
|
|
4013
|
+
maxLength: 2
|
|
4244
4014
|
},
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
const props = useThemeProps5({ props: inProps, name: "DateRangePicker" });
|
|
4256
|
-
const {
|
|
4257
|
-
onChange,
|
|
4258
|
-
disabled,
|
|
4259
|
-
label,
|
|
4260
|
-
error,
|
|
4261
|
-
helperText,
|
|
4262
|
-
minDate,
|
|
4263
|
-
maxDate,
|
|
4264
|
-
disableFuture,
|
|
4265
|
-
disablePast,
|
|
4266
|
-
required,
|
|
4267
|
-
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4268
|
-
sx,
|
|
4269
|
-
className,
|
|
4270
|
-
format = "YYYY/MM/DD",
|
|
4271
|
-
displayFormat = "YYYY/MM/DD",
|
|
4272
|
-
size,
|
|
4273
|
-
inputReadOnly,
|
|
4274
|
-
hideClearButton,
|
|
4275
|
-
readOnly,
|
|
4276
|
-
...innerProps
|
|
4277
|
-
} = props;
|
|
4278
|
-
const innerRef = useRef5(null);
|
|
4279
|
-
const buttonRef = useRef5(null);
|
|
4280
|
-
const [value, setValue] = useControlledState(
|
|
4281
|
-
props.value,
|
|
4282
|
-
props.defaultValue || "",
|
|
4283
|
-
useCallback10(
|
|
4284
|
-
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4285
|
-
[props.name, onChange]
|
|
4286
|
-
)
|
|
4287
|
-
);
|
|
4288
|
-
const [displayValue, setDisplayValue] = useState7(
|
|
4289
|
-
() => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
|
|
4290
|
-
);
|
|
4291
|
-
const [anchorEl, setAnchorEl] = useState7(null);
|
|
4292
|
-
const open = Boolean(anchorEl);
|
|
4293
|
-
const calendarValue = useMemo9(
|
|
4294
|
-
() => value ? parseDates(value, format) : void 0,
|
|
4295
|
-
[value, format]
|
|
4296
|
-
);
|
|
4297
|
-
useEffect6(() => {
|
|
4298
|
-
if (value) {
|
|
4299
|
-
try {
|
|
4300
|
-
const dates = parseDates(value, format);
|
|
4301
|
-
const newDisplayValue = formatValueString2(dates, displayFormat);
|
|
4302
|
-
setDisplayValue(newDisplayValue);
|
|
4303
|
-
} catch (error2) {
|
|
4015
|
+
M: {
|
|
4016
|
+
mask: IMask2.MaskedRange,
|
|
4017
|
+
from: 1,
|
|
4018
|
+
to: 12,
|
|
4019
|
+
maxLength: 2
|
|
4020
|
+
},
|
|
4021
|
+
Y: {
|
|
4022
|
+
mask: IMask2.MaskedRange,
|
|
4023
|
+
from: 1900,
|
|
4024
|
+
to: 9999
|
|
4304
4025
|
}
|
|
4305
|
-
} else {
|
|
4306
|
-
setDisplayValue("");
|
|
4307
|
-
}
|
|
4308
|
-
}, [displayFormat, value, format]);
|
|
4309
|
-
useEffect6(() => {
|
|
4310
|
-
if (!anchorEl) {
|
|
4311
|
-
innerRef.current?.blur();
|
|
4312
|
-
}
|
|
4313
|
-
}, [anchorEl, innerRef]);
|
|
4314
|
-
useImperativeHandle3(ref, () => innerRef.current, [
|
|
4315
|
-
innerRef
|
|
4316
|
-
]);
|
|
4317
|
-
const handleChange = useCallback10(
|
|
4318
|
-
(event) => {
|
|
4319
|
-
const value2 = event.target.value;
|
|
4320
|
-
setDisplayValue(
|
|
4321
|
-
value2 ? formatValueString2(parseDates(value2, format), displayFormat) : value2
|
|
4322
|
-
);
|
|
4323
|
-
setValue(value2);
|
|
4324
4026
|
},
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4027
|
+
format: (dates) => formatValueString2(dates, format),
|
|
4028
|
+
parse: (str) => parseDates(str, format),
|
|
4029
|
+
autofix: "pad",
|
|
4030
|
+
overwrite: true
|
|
4031
|
+
}
|
|
4032
|
+
);
|
|
4033
|
+
});
|
|
4034
|
+
var DateRangePicker = forwardRef8((inProps, ref) => {
|
|
4035
|
+
const props = useThemeProps5({ props: inProps, name: "DateRangePicker" });
|
|
4036
|
+
const {
|
|
4037
|
+
onChange,
|
|
4038
|
+
disabled,
|
|
4039
|
+
label,
|
|
4040
|
+
error,
|
|
4041
|
+
helperText,
|
|
4042
|
+
minDate,
|
|
4043
|
+
maxDate,
|
|
4044
|
+
disableFuture,
|
|
4045
|
+
disablePast,
|
|
4046
|
+
required,
|
|
4047
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4048
|
+
sx,
|
|
4049
|
+
className,
|
|
4050
|
+
format = "YYYY/MM/DD",
|
|
4051
|
+
displayFormat = "YYYY/MM/DD",
|
|
4052
|
+
size,
|
|
4053
|
+
inputReadOnly,
|
|
4054
|
+
hideClearButton,
|
|
4055
|
+
readOnly,
|
|
4056
|
+
...innerProps
|
|
4057
|
+
} = props;
|
|
4058
|
+
const innerRef = useRef5(null);
|
|
4059
|
+
const buttonRef = useRef5(null);
|
|
4060
|
+
const [value, setValue] = useControlledState(
|
|
4061
|
+
props.value,
|
|
4062
|
+
props.defaultValue || "",
|
|
4063
|
+
useCallback10((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4064
|
+
);
|
|
4065
|
+
const [displayValue, setDisplayValue] = useState7(
|
|
4066
|
+
() => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
|
|
4067
|
+
);
|
|
4068
|
+
const [anchorEl, setAnchorEl] = useState7(null);
|
|
4069
|
+
const open = Boolean(anchorEl);
|
|
4070
|
+
const calendarValue = useMemo9(
|
|
4071
|
+
() => value ? parseDates(value, format) : void 0,
|
|
4072
|
+
[value, format]
|
|
4073
|
+
);
|
|
4074
|
+
useEffect6(() => {
|
|
4075
|
+
if (value) {
|
|
4076
|
+
try {
|
|
4077
|
+
const dates = parseDates(value, format);
|
|
4078
|
+
const newDisplayValue = formatValueString2(dates, displayFormat);
|
|
4079
|
+
setDisplayValue(newDisplayValue);
|
|
4080
|
+
} catch (error2) {
|
|
4081
|
+
}
|
|
4082
|
+
} else {
|
|
4083
|
+
setDisplayValue("");
|
|
4084
|
+
}
|
|
4085
|
+
}, [displayFormat, value, format]);
|
|
4086
|
+
useEffect6(() => {
|
|
4087
|
+
if (!anchorEl) {
|
|
4088
|
+
innerRef.current?.blur();
|
|
4089
|
+
}
|
|
4090
|
+
}, [anchorEl, innerRef]);
|
|
4091
|
+
useImperativeHandle3(ref, () => innerRef.current, [innerRef]);
|
|
4092
|
+
const handleChange = useCallback10(
|
|
4093
|
+
(event) => {
|
|
4094
|
+
const value2 = event.target.value;
|
|
4095
|
+
setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat) : value2);
|
|
4096
|
+
setValue(value2);
|
|
4097
|
+
},
|
|
4098
|
+
[displayFormat, format, setValue]
|
|
4099
|
+
);
|
|
4100
|
+
const handleDisplayInputChange = useCallback10(
|
|
4101
|
+
(event) => {
|
|
4102
|
+
if (event.target.value === "") {
|
|
4103
|
+
handleChange({
|
|
4104
|
+
target: {
|
|
4105
|
+
name: props.name,
|
|
4106
|
+
value: ""
|
|
4107
|
+
}
|
|
4108
|
+
});
|
|
4109
|
+
return;
|
|
4110
|
+
}
|
|
4111
|
+
const isValidDisplayValue = validValueFormat2(event.target.value, displayFormat);
|
|
4112
|
+
if (isValidDisplayValue) {
|
|
4113
|
+
const dates = parseDates(event.target.value, displayFormat);
|
|
4114
|
+
const formattedValue = formatValueString2(dates, format);
|
|
4115
|
+
handleChange({
|
|
4116
|
+
target: {
|
|
4117
|
+
name: props.name,
|
|
4118
|
+
value: formattedValue
|
|
4119
|
+
}
|
|
4120
|
+
});
|
|
4121
|
+
}
|
|
4122
|
+
},
|
|
4123
|
+
[displayFormat, format, handleChange, props.name]
|
|
4124
|
+
);
|
|
4125
|
+
const handleCalendarToggle = useCallback10(
|
|
4126
|
+
(event) => {
|
|
4127
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4128
|
+
innerRef.current?.focus();
|
|
4129
|
+
},
|
|
4130
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
4131
|
+
);
|
|
4132
|
+
const handleCalendarChange = useCallback10(
|
|
4133
|
+
([date1, date2]) => {
|
|
4134
|
+
if (!date1 || !date2) return;
|
|
4135
|
+
const formattedValue = formatValueString2([date1, date2], format);
|
|
4136
|
+
if (props.value !== void 0) {
|
|
4137
|
+
onChange?.({ target: { name: props.name, value: formattedValue } });
|
|
4138
|
+
} else {
|
|
4139
|
+
setDisplayValue(formatValueString2([date1, date2], displayFormat));
|
|
4140
|
+
setValue(formattedValue);
|
|
4141
|
+
}
|
|
4142
|
+
setAnchorEl(null);
|
|
4143
|
+
},
|
|
4144
|
+
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat]
|
|
4145
|
+
);
|
|
4146
|
+
const handleInputMouseDown = useCallback10(
|
|
4147
|
+
(event) => {
|
|
4148
|
+
if (inputReadOnly) {
|
|
4149
|
+
event.preventDefault();
|
|
4150
|
+
buttonRef.current?.focus();
|
|
4151
|
+
}
|
|
4152
|
+
},
|
|
4153
|
+
[inputReadOnly, buttonRef]
|
|
4154
|
+
);
|
|
4155
|
+
return /* @__PURE__ */ React24.createElement(DateRangePickerRoot, null, /* @__PURE__ */ React24.createElement(FocusTrap2, { open: true }, /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(
|
|
4156
|
+
Input_default,
|
|
4157
|
+
{
|
|
4158
|
+
...innerProps,
|
|
4159
|
+
color: error ? "danger" : innerProps.color,
|
|
4160
|
+
ref,
|
|
4161
|
+
size,
|
|
4162
|
+
value: displayValue,
|
|
4163
|
+
onChange: handleDisplayInputChange,
|
|
4164
|
+
disabled,
|
|
4165
|
+
required,
|
|
4166
|
+
placeholder: `${displayFormat} - ${displayFormat}`,
|
|
4167
|
+
slotProps: {
|
|
4168
|
+
input: {
|
|
4169
|
+
component: TextMaskAdapter5,
|
|
4170
|
+
ref: innerRef,
|
|
4171
|
+
format: displayFormat,
|
|
4172
|
+
sx: {
|
|
4173
|
+
"&:hover": {
|
|
4174
|
+
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
4349
4175
|
}
|
|
4350
|
-
}
|
|
4351
|
-
|
|
4352
|
-
},
|
|
4353
|
-
[displayFormat, format, handleChange, props.name]
|
|
4354
|
-
);
|
|
4355
|
-
const handleCalendarToggle = useCallback10(
|
|
4356
|
-
(event) => {
|
|
4357
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4358
|
-
innerRef.current?.focus();
|
|
4359
|
-
},
|
|
4360
|
-
[anchorEl, setAnchorEl, innerRef]
|
|
4361
|
-
);
|
|
4362
|
-
const handleCalendarChange = useCallback10(
|
|
4363
|
-
([date1, date2]) => {
|
|
4364
|
-
if (!date1 || !date2) return;
|
|
4365
|
-
const formattedValue = formatValueString2([date1, date2], format);
|
|
4366
|
-
if (props.value !== void 0) {
|
|
4367
|
-
onChange?.({ target: { name: props.name, value: formattedValue } });
|
|
4368
|
-
} else {
|
|
4369
|
-
setDisplayValue(
|
|
4370
|
-
formatValueString2([date1, date2], displayFormat)
|
|
4371
|
-
);
|
|
4372
|
-
setValue(formattedValue);
|
|
4176
|
+
},
|
|
4177
|
+
onMouseDown: handleInputMouseDown
|
|
4373
4178
|
}
|
|
4374
|
-
setAnchorEl(null);
|
|
4375
4179
|
},
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4180
|
+
error,
|
|
4181
|
+
className,
|
|
4182
|
+
sx,
|
|
4183
|
+
endDecorator: /* @__PURE__ */ React24.createElement(
|
|
4184
|
+
CalendarButton2,
|
|
4185
|
+
{
|
|
4186
|
+
ref: buttonRef,
|
|
4187
|
+
variant: "plain",
|
|
4188
|
+
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
4189
|
+
"aria-label": "Toggle Calendar",
|
|
4190
|
+
"aria-controls": "date-range-picker-popper",
|
|
4191
|
+
"aria-haspopup": "dialog",
|
|
4192
|
+
"aria-expanded": open,
|
|
4193
|
+
disabled
|
|
4194
|
+
},
|
|
4195
|
+
/* @__PURE__ */ React24.createElement(CalendarTodayIcon2, null)
|
|
4196
|
+
),
|
|
4197
|
+
label,
|
|
4198
|
+
helperText,
|
|
4199
|
+
readOnly: readOnly || inputReadOnly
|
|
4200
|
+
}
|
|
4201
|
+
), open && /* @__PURE__ */ React24.createElement(ClickAwayListener2, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React24.createElement(
|
|
4202
|
+
StyledPopper2,
|
|
4203
|
+
{
|
|
4204
|
+
id: "date-range-picker-popper",
|
|
4205
|
+
open: true,
|
|
4206
|
+
anchorEl,
|
|
4207
|
+
placement: "bottom-end",
|
|
4208
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4209
|
+
modifiers: [
|
|
4210
|
+
{
|
|
4211
|
+
name: "offset",
|
|
4212
|
+
options: {
|
|
4213
|
+
offset: [4, 4]
|
|
4214
|
+
}
|
|
4391
4215
|
}
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4216
|
+
],
|
|
4217
|
+
"aria-label": "Calendar Tooltip",
|
|
4218
|
+
"aria-expanded": open
|
|
4219
|
+
},
|
|
4220
|
+
/* @__PURE__ */ React24.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React24.createElement(
|
|
4221
|
+
Calendar_default,
|
|
4397
4222
|
{
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
required,
|
|
4406
|
-
placeholder: `${displayFormat} - ${displayFormat}`,
|
|
4407
|
-
slotProps: {
|
|
4408
|
-
input: {
|
|
4409
|
-
component: TextMaskAdapter5,
|
|
4410
|
-
ref: innerRef,
|
|
4411
|
-
format: displayFormat,
|
|
4412
|
-
sx: {
|
|
4413
|
-
"&:hover": {
|
|
4414
|
-
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
4415
|
-
}
|
|
4416
|
-
},
|
|
4417
|
-
onMouseDown: handleInputMouseDown
|
|
4418
|
-
}
|
|
4419
|
-
},
|
|
4420
|
-
error,
|
|
4421
|
-
className,
|
|
4422
|
-
sx,
|
|
4423
|
-
endDecorator: /* @__PURE__ */ React24.createElement(
|
|
4424
|
-
CalendarButton2,
|
|
4425
|
-
{
|
|
4426
|
-
ref: buttonRef,
|
|
4427
|
-
variant: "plain",
|
|
4428
|
-
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
4429
|
-
"aria-label": "Toggle Calendar",
|
|
4430
|
-
"aria-controls": "date-range-picker-popper",
|
|
4431
|
-
"aria-haspopup": "dialog",
|
|
4432
|
-
"aria-expanded": open,
|
|
4433
|
-
disabled
|
|
4434
|
-
},
|
|
4435
|
-
/* @__PURE__ */ React24.createElement(CalendarTodayIcon2, null)
|
|
4436
|
-
),
|
|
4437
|
-
label,
|
|
4438
|
-
helperText,
|
|
4439
|
-
readOnly: readOnly || inputReadOnly
|
|
4223
|
+
rangeSelection: true,
|
|
4224
|
+
defaultValue: calendarValue,
|
|
4225
|
+
onChange: handleCalendarChange,
|
|
4226
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
4227
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4228
|
+
disableFuture,
|
|
4229
|
+
disablePast
|
|
4440
4230
|
}
|
|
4441
|
-
),
|
|
4442
|
-
|
|
4231
|
+
), !hideClearButton && /* @__PURE__ */ React24.createElement(
|
|
4232
|
+
DialogActions_default,
|
|
4443
4233
|
{
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
anchorEl,
|
|
4447
|
-
placement: "bottom-end",
|
|
4448
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
4449
|
-
modifiers: [
|
|
4450
|
-
{
|
|
4451
|
-
name: "offset",
|
|
4452
|
-
options: {
|
|
4453
|
-
offset: [4, 4]
|
|
4454
|
-
}
|
|
4455
|
-
}
|
|
4456
|
-
],
|
|
4457
|
-
"aria-label": "Calendar Tooltip",
|
|
4458
|
-
"aria-expanded": open
|
|
4459
|
-
},
|
|
4460
|
-
/* @__PURE__ */ React24.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React24.createElement(
|
|
4461
|
-
Calendar_default,
|
|
4462
|
-
{
|
|
4463
|
-
rangeSelection: true,
|
|
4464
|
-
defaultValue: calendarValue,
|
|
4465
|
-
onChange: handleCalendarChange,
|
|
4466
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
4467
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4468
|
-
disableFuture,
|
|
4469
|
-
disablePast
|
|
4234
|
+
sx: {
|
|
4235
|
+
p: 1
|
|
4470
4236
|
}
|
|
4471
|
-
|
|
4472
|
-
|
|
4237
|
+
},
|
|
4238
|
+
/* @__PURE__ */ React24.createElement(
|
|
4239
|
+
Button_default,
|
|
4473
4240
|
{
|
|
4474
|
-
|
|
4475
|
-
|
|
4241
|
+
size,
|
|
4242
|
+
variant: "plain",
|
|
4243
|
+
color: "neutral",
|
|
4244
|
+
onClick: () => {
|
|
4245
|
+
setValue("");
|
|
4246
|
+
setDisplayValue("");
|
|
4247
|
+
setAnchorEl(null);
|
|
4476
4248
|
}
|
|
4477
4249
|
},
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
color: "neutral",
|
|
4484
|
-
onClick: () => {
|
|
4485
|
-
setValue("");
|
|
4486
|
-
setDisplayValue("");
|
|
4487
|
-
setAnchorEl(null);
|
|
4488
|
-
}
|
|
4489
|
-
},
|
|
4490
|
-
"Clear"
|
|
4491
|
-
)
|
|
4492
|
-
))
|
|
4493
|
-
)))));
|
|
4494
|
-
}
|
|
4495
|
-
);
|
|
4250
|
+
"Clear"
|
|
4251
|
+
)
|
|
4252
|
+
))
|
|
4253
|
+
)))));
|
|
4254
|
+
});
|
|
4496
4255
|
DateRangePicker.displayName = "DateRangePicker";
|
|
4497
4256
|
|
|
4498
4257
|
// src/components/Drawer/Drawer.tsx
|
|
4499
4258
|
import React25 from "react";
|
|
4500
|
-
import {
|
|
4501
|
-
Drawer as JoyDrawer,
|
|
4502
|
-
styled as styled14,
|
|
4503
|
-
drawerClasses
|
|
4504
|
-
} from "@mui/joy";
|
|
4259
|
+
import { Drawer as JoyDrawer, styled as styled14, drawerClasses } from "@mui/joy";
|
|
4505
4260
|
import { motion as motion22 } from "framer-motion";
|
|
4506
4261
|
var MotionDrawer = motion22(JoyDrawer);
|
|
4507
4262
|
var StyledDrawer = styled14(MotionDrawer)(({ theme, size = "md" }) => ({
|
|
@@ -4589,17 +4344,7 @@ var StyledDialogFrame = styled18(ModalDialog, {
|
|
|
4589
4344
|
});
|
|
4590
4345
|
var DialogFrame = React27.forwardRef((props, ref) => {
|
|
4591
4346
|
const { title, children, actions, fullscreen, ...innerProps } = props;
|
|
4592
|
-
return /* @__PURE__ */ React27.createElement(
|
|
4593
|
-
StyledDialogFrame,
|
|
4594
|
-
{
|
|
4595
|
-
layout: fullscreen ? "fullscreen" : "center",
|
|
4596
|
-
ref,
|
|
4597
|
-
...innerProps
|
|
4598
|
-
},
|
|
4599
|
-
/* @__PURE__ */ React27.createElement(DialogTitle_default, null, title),
|
|
4600
|
-
/* @__PURE__ */ React27.createElement(DialogContent_default, null, children),
|
|
4601
|
-
/* @__PURE__ */ React27.createElement(DialogActions_default, null, actions)
|
|
4602
|
-
);
|
|
4347
|
+
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));
|
|
4603
4348
|
});
|
|
4604
4349
|
DialogFrame.displayName = "DialogFrame";
|
|
4605
4350
|
|
|
@@ -4634,10 +4379,7 @@ import { Grid } from "@mui/joy";
|
|
|
4634
4379
|
|
|
4635
4380
|
// src/components/IconMenuButton/IconMenuButton.tsx
|
|
4636
4381
|
import React29 from "react";
|
|
4637
|
-
import {
|
|
4638
|
-
MenuButton as JoyMenuButton2,
|
|
4639
|
-
IconButton as JoyIconButton2
|
|
4640
|
-
} from "@mui/joy";
|
|
4382
|
+
import { MenuButton as JoyMenuButton2, IconButton as JoyIconButton2 } from "@mui/joy";
|
|
4641
4383
|
function IconMenuButton(props) {
|
|
4642
4384
|
const {
|
|
4643
4385
|
size,
|
|
@@ -4681,15 +4423,7 @@ function IconMenuButton(props) {
|
|
|
4681
4423
|
}
|
|
4682
4424
|
},
|
|
4683
4425
|
icon
|
|
4684
|
-
), /* @__PURE__ */ React29.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React29.createElement(
|
|
4685
|
-
MenuItem,
|
|
4686
|
-
{
|
|
4687
|
-
key: i.text,
|
|
4688
|
-
component: i.component,
|
|
4689
|
-
...i.componentProps ?? {}
|
|
4690
|
-
},
|
|
4691
|
-
i.text
|
|
4692
|
-
))));
|
|
4426
|
+
), /* @__PURE__ */ React29.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React29.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
4693
4427
|
}
|
|
4694
4428
|
IconMenuButton.displayName = "IconMenuButton";
|
|
4695
4429
|
|
|
@@ -4723,61 +4457,39 @@ var Markdown = (props) => {
|
|
|
4723
4457
|
if (!rehypeAccent2) {
|
|
4724
4458
|
return null;
|
|
4725
4459
|
}
|
|
4726
|
-
return /* @__PURE__ */ React30.createElement(
|
|
4727
|
-
|
|
4460
|
+
return /* @__PURE__ */ React30.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ React30.createElement(
|
|
4461
|
+
Suspense,
|
|
4728
4462
|
{
|
|
4729
|
-
|
|
4730
|
-
color,
|
|
4731
|
-
textColor,
|
|
4732
|
-
level: defaultLevel,
|
|
4733
|
-
...innerProps
|
|
4463
|
+
fallback: fallback || /* @__PURE__ */ React30.createElement(Typography, null, /* @__PURE__ */ React30.createElement(Skeleton, null, content || ""))
|
|
4734
4464
|
},
|
|
4735
4465
|
/* @__PURE__ */ React30.createElement(
|
|
4736
|
-
|
|
4466
|
+
LazyReactMarkdown,
|
|
4737
4467
|
{
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
{
|
|
4743
|
-
|
|
4744
|
-
children:
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
Typography,
|
|
4754
|
-
{
|
|
4755
|
-
color,
|
|
4756
|
-
textColor,
|
|
4757
|
-
level: defaultLevel,
|
|
4758
|
-
...node?.properties
|
|
4759
|
-
},
|
|
4760
|
-
children
|
|
4761
|
-
),
|
|
4762
|
-
a: ({ children, href }) => /* @__PURE__ */ React30.createElement(Link2, { href, target: defaultLinkAction }, children),
|
|
4763
|
-
hr: () => /* @__PURE__ */ React30.createElement(Divider, null),
|
|
4764
|
-
b: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4765
|
-
strong: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4766
|
-
...markdownOptions?.components
|
|
4767
|
-
}
|
|
4468
|
+
...markdownOptions,
|
|
4469
|
+
children: content,
|
|
4470
|
+
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
4471
|
+
remarkPlugins: [remarkGfm],
|
|
4472
|
+
components: {
|
|
4473
|
+
h1: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: "h1" }, children),
|
|
4474
|
+
h2: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: "h2" }, children),
|
|
4475
|
+
h3: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: "h3" }, children),
|
|
4476
|
+
h4: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: "h4" }, children),
|
|
4477
|
+
p: ({ children, node }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: defaultLevel, ...node?.properties }, children),
|
|
4478
|
+
a: ({ children, href }) => /* @__PURE__ */ React30.createElement(Link2, { href, target: defaultLinkAction }, children),
|
|
4479
|
+
hr: () => /* @__PURE__ */ React30.createElement(Divider, null),
|
|
4480
|
+
b: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4481
|
+
strong: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
4482
|
+
...markdownOptions?.components
|
|
4768
4483
|
}
|
|
4769
|
-
|
|
4484
|
+
}
|
|
4770
4485
|
)
|
|
4771
|
-
);
|
|
4486
|
+
));
|
|
4772
4487
|
};
|
|
4773
4488
|
Markdown.displayName = "Markdown";
|
|
4774
4489
|
|
|
4775
4490
|
// src/components/MenuButton/MenuButton.tsx
|
|
4776
4491
|
import React31 from "react";
|
|
4777
|
-
import {
|
|
4778
|
-
MenuButton as JoyMenuButton3,
|
|
4779
|
-
Button as JoyButton2
|
|
4780
|
-
} from "@mui/joy";
|
|
4492
|
+
import { MenuButton as JoyMenuButton3, Button as JoyButton2 } from "@mui/joy";
|
|
4781
4493
|
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
4782
4494
|
function MenuButton(props) {
|
|
4783
4495
|
const {
|
|
@@ -4824,27 +4536,12 @@ function MenuButton(props) {
|
|
|
4824
4536
|
endDecorator: showIcon ? /* @__PURE__ */ React31.createElement(React31.Fragment, null, endDecorator, /* @__PURE__ */ React31.createElement(ExpandMoreIcon, null)) : /* @__PURE__ */ React31.createElement(React31.Fragment, null, endDecorator)
|
|
4825
4537
|
},
|
|
4826
4538
|
buttonText
|
|
4827
|
-
), /* @__PURE__ */ React31.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React31.createElement(
|
|
4828
|
-
MenuItem,
|
|
4829
|
-
{
|
|
4830
|
-
key: i.text,
|
|
4831
|
-
component: i.component,
|
|
4832
|
-
...i.componentProps ?? {}
|
|
4833
|
-
},
|
|
4834
|
-
i.text
|
|
4835
|
-
))));
|
|
4539
|
+
), /* @__PURE__ */ React31.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ React31.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
4836
4540
|
}
|
|
4837
4541
|
MenuButton.displayName = "MenuButton";
|
|
4838
4542
|
|
|
4839
4543
|
// src/components/MonthPicker/MonthPicker.tsx
|
|
4840
|
-
import React32, {
|
|
4841
|
-
forwardRef as forwardRef9,
|
|
4842
|
-
useCallback as useCallback11,
|
|
4843
|
-
useEffect as useEffect8,
|
|
4844
|
-
useImperativeHandle as useImperativeHandle4,
|
|
4845
|
-
useRef as useRef6,
|
|
4846
|
-
useState as useState9
|
|
4847
|
-
} from "react";
|
|
4544
|
+
import React32, { forwardRef as forwardRef9, useCallback as useCallback11, useEffect as useEffect8, useImperativeHandle as useImperativeHandle4, useRef as useRef6, useState as useState9 } from "react";
|
|
4848
4545
|
import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
|
|
4849
4546
|
import { styled as styled20, useThemeProps as useThemeProps6 } from "@mui/joy";
|
|
4850
4547
|
import { FocusTrap as FocusTrap3, ClickAwayListener as ClickAwayListener3, Popper as Popper4 } from "@mui/base";
|
|
@@ -4899,226 +4596,205 @@ function parseDate3(dateString, format) {
|
|
|
4899
4596
|
const result = new Date(year, month, day);
|
|
4900
4597
|
return result;
|
|
4901
4598
|
}
|
|
4902
|
-
var MonthPicker = forwardRef9(
|
|
4903
|
-
(inProps,
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4599
|
+
var MonthPicker = forwardRef9((inProps, ref) => {
|
|
4600
|
+
const props = useThemeProps6({ props: inProps, name: "MonthPicker" });
|
|
4601
|
+
const {
|
|
4602
|
+
onChange,
|
|
4603
|
+
disabled,
|
|
4604
|
+
label,
|
|
4605
|
+
error,
|
|
4606
|
+
helperText,
|
|
4607
|
+
minDate,
|
|
4608
|
+
maxDate,
|
|
4609
|
+
disableFuture,
|
|
4610
|
+
disablePast,
|
|
4611
|
+
required,
|
|
4612
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4613
|
+
sx,
|
|
4614
|
+
className,
|
|
4615
|
+
/**
|
|
4616
|
+
* NOTE: 현재 CalendarDate는 YYYY-MM-DD로 개발하고 있어 date를 포함하여 value를 관리한다.
|
|
4617
|
+
* @see https://ecubelabs.atlassian.net/wiki/spaces/SW/pages/1938784349/Date#CalendarDate
|
|
4618
|
+
* @see https://github.com/Ecube-Labs/hds/pull/145
|
|
4619
|
+
*/
|
|
4620
|
+
format = "YYYY/MM/DD",
|
|
4621
|
+
displayFormat = "YYYY/MM",
|
|
4622
|
+
size,
|
|
4623
|
+
locale,
|
|
4624
|
+
...innerProps
|
|
4625
|
+
} = props;
|
|
4626
|
+
const innerRef = useRef6(null);
|
|
4627
|
+
const buttonRef = useRef6(null);
|
|
4628
|
+
const [value, setValue, isControlled] = useControlledState(
|
|
4629
|
+
props.value,
|
|
4630
|
+
props.defaultValue || "",
|
|
4631
|
+
useCallback11((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4632
|
+
);
|
|
4633
|
+
const getFormattedDisplayValue = useCallback11(
|
|
4634
|
+
(inputValue) => {
|
|
4635
|
+
if (!inputValue) return "";
|
|
4636
|
+
try {
|
|
4637
|
+
return formatValueString3(parseDate3(inputValue, format), displayFormat, locale);
|
|
4638
|
+
} catch (e) {
|
|
4639
|
+
return inputValue;
|
|
4640
|
+
}
|
|
4641
|
+
},
|
|
4642
|
+
[format, displayFormat, locale]
|
|
4643
|
+
);
|
|
4644
|
+
const [displayValue, setDisplayValue] = useState9(() => getFormattedDisplayValue(value));
|
|
4645
|
+
const [anchorEl, setAnchorEl] = useState9(null);
|
|
4646
|
+
const open = Boolean(anchorEl);
|
|
4647
|
+
useEffect8(() => {
|
|
4648
|
+
if (!anchorEl) {
|
|
4649
|
+
innerRef.current?.blur();
|
|
4650
|
+
}
|
|
4651
|
+
}, [anchorEl, innerRef]);
|
|
4652
|
+
useImperativeHandle4(ref, () => innerRef.current, [innerRef]);
|
|
4653
|
+
useEffect8(() => {
|
|
4654
|
+
setDisplayValue(getFormattedDisplayValue(value));
|
|
4655
|
+
}, [value, getFormattedDisplayValue]);
|
|
4656
|
+
const handleChange = useCallback11(
|
|
4657
|
+
(event) => {
|
|
4658
|
+
const newValue = event.target.value;
|
|
4659
|
+
setValue(newValue);
|
|
4660
|
+
if (!isControlled) {
|
|
4661
|
+
setDisplayValue(getFormattedDisplayValue(newValue));
|
|
4662
|
+
}
|
|
4663
|
+
},
|
|
4664
|
+
[setValue, getFormattedDisplayValue, isControlled]
|
|
4665
|
+
);
|
|
4666
|
+
const handleCalendarToggle = useCallback11(
|
|
4667
|
+
(event) => {
|
|
4668
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4669
|
+
innerRef.current?.focus();
|
|
4670
|
+
},
|
|
4671
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
4672
|
+
);
|
|
4673
|
+
const handleInputMouseDown = useCallback11(
|
|
4674
|
+
(event) => {
|
|
4675
|
+
event.preventDefault();
|
|
4676
|
+
buttonRef.current?.focus();
|
|
4677
|
+
},
|
|
4678
|
+
[buttonRef]
|
|
4679
|
+
);
|
|
4680
|
+
return /* @__PURE__ */ React32.createElement(MonthPickerRoot, null, /* @__PURE__ */ React32.createElement(FocusTrap3, { open: true }, /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(
|
|
4681
|
+
Input_default,
|
|
4682
|
+
{
|
|
4683
|
+
...innerProps,
|
|
4684
|
+
color: error ? "danger" : innerProps.color,
|
|
4685
|
+
ref: innerRef,
|
|
4686
|
+
size,
|
|
4687
|
+
value: displayValue,
|
|
4688
|
+
placeholder: displayFormat,
|
|
4907
4689
|
disabled,
|
|
4908
|
-
label,
|
|
4909
|
-
error,
|
|
4910
|
-
helperText,
|
|
4911
|
-
minDate,
|
|
4912
|
-
maxDate,
|
|
4913
|
-
disableFuture,
|
|
4914
|
-
disablePast,
|
|
4915
4690
|
required,
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
size,
|
|
4927
|
-
locale,
|
|
4928
|
-
...innerProps
|
|
4929
|
-
} = props;
|
|
4930
|
-
const innerRef = useRef6(null);
|
|
4931
|
-
const buttonRef = useRef6(null);
|
|
4932
|
-
const [value, setValue, isControlled] = useControlledState(
|
|
4933
|
-
props.value,
|
|
4934
|
-
props.defaultValue || "",
|
|
4935
|
-
useCallback11(
|
|
4936
|
-
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4937
|
-
[props.name, onChange]
|
|
4938
|
-
)
|
|
4939
|
-
);
|
|
4940
|
-
const getFormattedDisplayValue = useCallback11(
|
|
4941
|
-
(inputValue) => {
|
|
4942
|
-
if (!inputValue) return "";
|
|
4943
|
-
try {
|
|
4944
|
-
return formatValueString3(
|
|
4945
|
-
parseDate3(inputValue, format),
|
|
4946
|
-
displayFormat,
|
|
4947
|
-
locale
|
|
4948
|
-
);
|
|
4949
|
-
} catch (e) {
|
|
4950
|
-
return inputValue;
|
|
4951
|
-
}
|
|
4952
|
-
},
|
|
4953
|
-
[format, displayFormat, locale]
|
|
4954
|
-
);
|
|
4955
|
-
const [displayValue, setDisplayValue] = useState9(
|
|
4956
|
-
() => getFormattedDisplayValue(value)
|
|
4957
|
-
);
|
|
4958
|
-
const [anchorEl, setAnchorEl] = useState9(null);
|
|
4959
|
-
const open = Boolean(anchorEl);
|
|
4960
|
-
useEffect8(() => {
|
|
4961
|
-
if (!anchorEl) {
|
|
4962
|
-
innerRef.current?.blur();
|
|
4963
|
-
}
|
|
4964
|
-
}, [anchorEl, innerRef]);
|
|
4965
|
-
useImperativeHandle4(ref, () => innerRef.current, [
|
|
4966
|
-
innerRef
|
|
4967
|
-
]);
|
|
4968
|
-
useEffect8(() => {
|
|
4969
|
-
setDisplayValue(getFormattedDisplayValue(value));
|
|
4970
|
-
}, [value, getFormattedDisplayValue]);
|
|
4971
|
-
const handleChange = useCallback11(
|
|
4972
|
-
(event) => {
|
|
4973
|
-
const newValue = event.target.value;
|
|
4974
|
-
setValue(newValue);
|
|
4975
|
-
if (!isControlled) {
|
|
4976
|
-
setDisplayValue(getFormattedDisplayValue(newValue));
|
|
4691
|
+
slotProps: {
|
|
4692
|
+
input: {
|
|
4693
|
+
ref: innerRef,
|
|
4694
|
+
format: displayFormat,
|
|
4695
|
+
sx: {
|
|
4696
|
+
"&:hover": {
|
|
4697
|
+
cursor: "default"
|
|
4698
|
+
}
|
|
4699
|
+
},
|
|
4700
|
+
onMouseDown: handleInputMouseDown
|
|
4977
4701
|
}
|
|
4978
4702
|
},
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
},
|
|
4986
|
-
[anchorEl, setAnchorEl, innerRef]
|
|
4987
|
-
);
|
|
4988
|
-
const handleInputMouseDown = useCallback11(
|
|
4989
|
-
(event) => {
|
|
4990
|
-
event.preventDefault();
|
|
4991
|
-
buttonRef.current?.focus();
|
|
4703
|
+
error,
|
|
4704
|
+
className,
|
|
4705
|
+
sx: {
|
|
4706
|
+
...sx,
|
|
4707
|
+
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
4708
|
+
fontFamily: "monospace"
|
|
4992
4709
|
},
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
disabled,
|
|
5005
|
-
required,
|
|
5006
|
-
slotProps: {
|
|
5007
|
-
input: {
|
|
5008
|
-
ref: innerRef,
|
|
5009
|
-
format: displayFormat,
|
|
5010
|
-
sx: {
|
|
5011
|
-
"&:hover": {
|
|
5012
|
-
cursor: "default"
|
|
5013
|
-
}
|
|
5014
|
-
},
|
|
5015
|
-
onMouseDown: handleInputMouseDown
|
|
5016
|
-
}
|
|
4710
|
+
endDecorator: /* @__PURE__ */ React32.createElement(
|
|
4711
|
+
IconButton_default,
|
|
4712
|
+
{
|
|
4713
|
+
ref: buttonRef,
|
|
4714
|
+
variant: "plain",
|
|
4715
|
+
onClick: handleCalendarToggle,
|
|
4716
|
+
"aria-label": "Toggle Calendar",
|
|
4717
|
+
"aria-controls": "month-picker-popper",
|
|
4718
|
+
"aria-haspopup": "dialog",
|
|
4719
|
+
"aria-expanded": open,
|
|
4720
|
+
disabled
|
|
5017
4721
|
},
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
4722
|
+
/* @__PURE__ */ React32.createElement(CalendarTodayIcon3, null)
|
|
4723
|
+
),
|
|
4724
|
+
label,
|
|
4725
|
+
helperText
|
|
4726
|
+
}
|
|
4727
|
+
), open && /* @__PURE__ */ React32.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React32.createElement(
|
|
4728
|
+
StyledPopper3,
|
|
4729
|
+
{
|
|
4730
|
+
id: "month-picker-popper",
|
|
4731
|
+
open: true,
|
|
4732
|
+
anchorEl,
|
|
4733
|
+
placement: "bottom-end",
|
|
4734
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4735
|
+
modifiers: [
|
|
4736
|
+
{
|
|
4737
|
+
name: "offset",
|
|
4738
|
+
options: {
|
|
4739
|
+
offset: [4, 4]
|
|
4740
|
+
}
|
|
4741
|
+
}
|
|
4742
|
+
],
|
|
4743
|
+
"aria-label": "Calendar Tooltip",
|
|
4744
|
+
"aria-expanded": open
|
|
4745
|
+
},
|
|
4746
|
+
/* @__PURE__ */ React32.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React32.createElement(
|
|
4747
|
+
Calendar_default,
|
|
4748
|
+
{
|
|
4749
|
+
view: "month",
|
|
4750
|
+
views: ["month"],
|
|
4751
|
+
value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
|
|
4752
|
+
onChange: ([date]) => {
|
|
4753
|
+
handleChange({
|
|
4754
|
+
target: {
|
|
4755
|
+
name: props.name,
|
|
4756
|
+
value: formatValueString3(date, format, locale)
|
|
4757
|
+
}
|
|
4758
|
+
});
|
|
4759
|
+
setAnchorEl(null);
|
|
5024
4760
|
},
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
onClick: handleCalendarToggle,
|
|
5031
|
-
"aria-label": "Toggle Calendar",
|
|
5032
|
-
"aria-controls": "month-picker-popper",
|
|
5033
|
-
"aria-haspopup": "dialog",
|
|
5034
|
-
"aria-expanded": open,
|
|
5035
|
-
disabled
|
|
5036
|
-
},
|
|
5037
|
-
/* @__PURE__ */ React32.createElement(CalendarTodayIcon3, null)
|
|
5038
|
-
),
|
|
5039
|
-
label,
|
|
5040
|
-
helperText
|
|
4761
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
4762
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4763
|
+
disableFuture,
|
|
4764
|
+
disablePast,
|
|
4765
|
+
locale
|
|
5041
4766
|
}
|
|
5042
|
-
),
|
|
5043
|
-
|
|
4767
|
+
), /* @__PURE__ */ React32.createElement(
|
|
4768
|
+
DialogActions_default,
|
|
5044
4769
|
{
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
placement: "bottom-end",
|
|
5049
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
5050
|
-
modifiers: [
|
|
5051
|
-
{
|
|
5052
|
-
name: "offset",
|
|
5053
|
-
options: {
|
|
5054
|
-
offset: [4, 4]
|
|
5055
|
-
}
|
|
5056
|
-
}
|
|
5057
|
-
],
|
|
5058
|
-
"aria-label": "Calendar Tooltip",
|
|
5059
|
-
"aria-expanded": open
|
|
4770
|
+
sx: {
|
|
4771
|
+
p: 1
|
|
4772
|
+
}
|
|
5060
4773
|
},
|
|
5061
|
-
/* @__PURE__ */ React32.createElement(
|
|
5062
|
-
|
|
4774
|
+
/* @__PURE__ */ React32.createElement(
|
|
4775
|
+
Button_default,
|
|
5063
4776
|
{
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
4777
|
+
size,
|
|
4778
|
+
variant: "plain",
|
|
4779
|
+
color: "neutral",
|
|
4780
|
+
onClick: () => {
|
|
5068
4781
|
handleChange({
|
|
5069
4782
|
target: {
|
|
5070
4783
|
name: props.name,
|
|
5071
|
-
value:
|
|
4784
|
+
value: ""
|
|
5072
4785
|
}
|
|
5073
4786
|
});
|
|
5074
4787
|
setAnchorEl(null);
|
|
5075
|
-
},
|
|
5076
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
5077
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
5078
|
-
disableFuture,
|
|
5079
|
-
disablePast,
|
|
5080
|
-
locale
|
|
5081
|
-
}
|
|
5082
|
-
), /* @__PURE__ */ React32.createElement(
|
|
5083
|
-
DialogActions_default,
|
|
5084
|
-
{
|
|
5085
|
-
sx: {
|
|
5086
|
-
p: 1
|
|
5087
4788
|
}
|
|
5088
4789
|
},
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
color: "neutral",
|
|
5095
|
-
onClick: () => {
|
|
5096
|
-
handleChange({
|
|
5097
|
-
target: {
|
|
5098
|
-
name: props.name,
|
|
5099
|
-
value: ""
|
|
5100
|
-
}
|
|
5101
|
-
});
|
|
5102
|
-
setAnchorEl(null);
|
|
5103
|
-
}
|
|
5104
|
-
},
|
|
5105
|
-
"Clear"
|
|
5106
|
-
)
|
|
5107
|
-
))
|
|
5108
|
-
)))));
|
|
5109
|
-
}
|
|
5110
|
-
);
|
|
4790
|
+
"Clear"
|
|
4791
|
+
)
|
|
4792
|
+
))
|
|
4793
|
+
)))));
|
|
4794
|
+
});
|
|
5111
4795
|
|
|
5112
4796
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
5113
|
-
import React33, {
|
|
5114
|
-
forwardRef as forwardRef10,
|
|
5115
|
-
useCallback as useCallback12,
|
|
5116
|
-
useEffect as useEffect9,
|
|
5117
|
-
useImperativeHandle as useImperativeHandle5,
|
|
5118
|
-
useMemo as useMemo10,
|
|
5119
|
-
useRef as useRef7,
|
|
5120
|
-
useState as useState10
|
|
5121
|
-
} from "react";
|
|
4797
|
+
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";
|
|
5122
4798
|
import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
|
|
5123
4799
|
import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
|
|
5124
4800
|
import { styled as styled21, useThemeProps as useThemeProps7 } from "@mui/joy";
|
|
@@ -5176,196 +4852,184 @@ var parseDates2 = (str) => {
|
|
|
5176
4852
|
var formatToPattern3 = (format) => {
|
|
5177
4853
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
|
|
5178
4854
|
};
|
|
5179
|
-
var TextMaskAdapter7 = React33.forwardRef(
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
maxLength: 2
|
|
5196
|
-
},
|
|
5197
|
-
Y: {
|
|
5198
|
-
mask: IMask3.MaskedRange,
|
|
5199
|
-
from: 1900,
|
|
5200
|
-
to: 9999
|
|
5201
|
-
}
|
|
4855
|
+
var TextMaskAdapter7 = React33.forwardRef(function TextMaskAdapter8(props, ref) {
|
|
4856
|
+
const { onChange, format, ...other } = props;
|
|
4857
|
+
return /* @__PURE__ */ React33.createElement(
|
|
4858
|
+
IMaskInput3,
|
|
4859
|
+
{
|
|
4860
|
+
...other,
|
|
4861
|
+
inputRef: ref,
|
|
4862
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
4863
|
+
mask: Date,
|
|
4864
|
+
pattern: formatToPattern3(format),
|
|
4865
|
+
blocks: {
|
|
4866
|
+
m: {
|
|
4867
|
+
mask: IMask3.MaskedRange,
|
|
4868
|
+
from: 1,
|
|
4869
|
+
to: 12,
|
|
4870
|
+
maxLength: 2
|
|
5202
4871
|
},
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
4872
|
+
Y: {
|
|
4873
|
+
mask: IMask3.MaskedRange,
|
|
4874
|
+
from: 1900,
|
|
4875
|
+
to: 9999
|
|
4876
|
+
}
|
|
4877
|
+
},
|
|
4878
|
+
format: (dates) => formatValueString4(dates, format),
|
|
4879
|
+
parse: parseDates2,
|
|
4880
|
+
autofix: "pad",
|
|
4881
|
+
overwrite: true
|
|
4882
|
+
}
|
|
4883
|
+
);
|
|
4884
|
+
});
|
|
4885
|
+
var MonthRangePicker = forwardRef10((inProps, ref) => {
|
|
4886
|
+
const props = useThemeProps7({ props: inProps, name: "MonthRangePicker" });
|
|
4887
|
+
const {
|
|
4888
|
+
onChange,
|
|
4889
|
+
disabled,
|
|
4890
|
+
label,
|
|
4891
|
+
error,
|
|
4892
|
+
helperText,
|
|
4893
|
+
minDate,
|
|
4894
|
+
maxDate,
|
|
4895
|
+
disableFuture,
|
|
4896
|
+
disablePast,
|
|
4897
|
+
required,
|
|
4898
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4899
|
+
sx,
|
|
4900
|
+
className,
|
|
4901
|
+
format = "YYYY/MM",
|
|
4902
|
+
size,
|
|
4903
|
+
...innerProps
|
|
4904
|
+
} = props;
|
|
4905
|
+
const innerRef = useRef7(null);
|
|
4906
|
+
const [value, setValue] = useControlledState(
|
|
4907
|
+
props.value,
|
|
4908
|
+
props.defaultValue || "",
|
|
4909
|
+
useCallback12((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4910
|
+
);
|
|
4911
|
+
const [anchorEl, setAnchorEl] = useState10(null);
|
|
4912
|
+
const open = Boolean(anchorEl);
|
|
4913
|
+
const calendarValue = useMemo10(() => value ? parseDates2(value) : void 0, [value]);
|
|
4914
|
+
useEffect9(() => {
|
|
4915
|
+
if (!anchorEl) {
|
|
4916
|
+
innerRef.current?.blur();
|
|
4917
|
+
}
|
|
4918
|
+
}, [anchorEl, innerRef]);
|
|
4919
|
+
useImperativeHandle5(ref, () => innerRef.current, [innerRef]);
|
|
4920
|
+
const handleChange = useCallback12(
|
|
4921
|
+
(event) => {
|
|
4922
|
+
setValue(event.target.value);
|
|
4923
|
+
},
|
|
4924
|
+
[setValue]
|
|
4925
|
+
);
|
|
4926
|
+
const handleCalendarToggle = useCallback12(
|
|
4927
|
+
(event) => {
|
|
4928
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4929
|
+
innerRef.current?.focus();
|
|
4930
|
+
},
|
|
4931
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
4932
|
+
);
|
|
4933
|
+
const handleCalendarChange = useCallback12(
|
|
4934
|
+
([date1, date2]) => {
|
|
4935
|
+
if (!date1 || !date2) return;
|
|
4936
|
+
setValue(formatValueString4([date1, date2], format));
|
|
4937
|
+
setAnchorEl(null);
|
|
4938
|
+
},
|
|
4939
|
+
[setValue, setAnchorEl, format]
|
|
4940
|
+
);
|
|
4941
|
+
return /* @__PURE__ */ React33.createElement(MonthRangePickerRoot, null, /* @__PURE__ */ React33.createElement(FocusTrap4, { open: true }, /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(
|
|
4942
|
+
Input_default,
|
|
4943
|
+
{
|
|
4944
|
+
...innerProps,
|
|
4945
|
+
color: error ? "danger" : innerProps.color,
|
|
4946
|
+
ref,
|
|
4947
|
+
size,
|
|
4948
|
+
value,
|
|
4949
|
+
onChange: handleChange,
|
|
5216
4950
|
disabled,
|
|
5217
|
-
label,
|
|
5218
|
-
error,
|
|
5219
|
-
helperText,
|
|
5220
|
-
minDate,
|
|
5221
|
-
maxDate,
|
|
5222
|
-
disableFuture,
|
|
5223
|
-
disablePast,
|
|
5224
4951
|
required,
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
format = "YYYY/MM",
|
|
5229
|
-
size,
|
|
5230
|
-
...innerProps
|
|
5231
|
-
} = props;
|
|
5232
|
-
const innerRef = useRef7(null);
|
|
5233
|
-
const [value, setValue] = useControlledState(
|
|
5234
|
-
props.value,
|
|
5235
|
-
props.defaultValue || "",
|
|
5236
|
-
useCallback12(
|
|
5237
|
-
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
5238
|
-
[props.name, onChange]
|
|
5239
|
-
)
|
|
5240
|
-
);
|
|
5241
|
-
const [anchorEl, setAnchorEl] = useState10(null);
|
|
5242
|
-
const open = Boolean(anchorEl);
|
|
5243
|
-
const calendarValue = useMemo10(
|
|
5244
|
-
() => value ? parseDates2(value) : void 0,
|
|
5245
|
-
[value]
|
|
5246
|
-
);
|
|
5247
|
-
useEffect9(() => {
|
|
5248
|
-
if (!anchorEl) {
|
|
5249
|
-
innerRef.current?.blur();
|
|
5250
|
-
}
|
|
5251
|
-
}, [anchorEl, innerRef]);
|
|
5252
|
-
useImperativeHandle5(ref, () => innerRef.current, [
|
|
5253
|
-
innerRef
|
|
5254
|
-
]);
|
|
5255
|
-
const handleChange = useCallback12(
|
|
5256
|
-
(event) => {
|
|
5257
|
-
setValue(event.target.value);
|
|
5258
|
-
},
|
|
5259
|
-
[setValue]
|
|
5260
|
-
);
|
|
5261
|
-
const handleCalendarToggle = useCallback12(
|
|
5262
|
-
(event) => {
|
|
5263
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5264
|
-
innerRef.current?.focus();
|
|
4952
|
+
placeholder: `${format} - ${format}`,
|
|
4953
|
+
slotProps: {
|
|
4954
|
+
input: { component: TextMaskAdapter7, ref: innerRef, format }
|
|
5265
4955
|
},
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
setAnchorEl(null);
|
|
4956
|
+
error,
|
|
4957
|
+
className,
|
|
4958
|
+
sx: {
|
|
4959
|
+
...sx,
|
|
4960
|
+
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
4961
|
+
fontFamily: "monospace"
|
|
5273
4962
|
},
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
value,
|
|
5284
|
-
onChange: handleChange,
|
|
5285
|
-
disabled,
|
|
5286
|
-
required,
|
|
5287
|
-
placeholder: `${format} - ${format}`,
|
|
5288
|
-
slotProps: {
|
|
5289
|
-
input: { component: TextMaskAdapter7, ref: innerRef, format }
|
|
5290
|
-
},
|
|
5291
|
-
error,
|
|
5292
|
-
className,
|
|
5293
|
-
sx: {
|
|
5294
|
-
...sx,
|
|
5295
|
-
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
5296
|
-
fontFamily: "monospace"
|
|
4963
|
+
endDecorator: /* @__PURE__ */ React33.createElement(
|
|
4964
|
+
IconButton_default,
|
|
4965
|
+
{
|
|
4966
|
+
variant: "plain",
|
|
4967
|
+
onClick: handleCalendarToggle,
|
|
4968
|
+
"aria-label": "Toggle Calendar",
|
|
4969
|
+
"aria-controls": "month-range-picker-popper",
|
|
4970
|
+
"aria-haspopup": "dialog",
|
|
4971
|
+
"aria-expanded": open
|
|
5297
4972
|
},
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
4973
|
+
/* @__PURE__ */ React33.createElement(CalendarTodayIcon4, null)
|
|
4974
|
+
),
|
|
4975
|
+
label,
|
|
4976
|
+
helperText
|
|
4977
|
+
}
|
|
4978
|
+
), open && /* @__PURE__ */ React33.createElement(ClickAwayListener4, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React33.createElement(
|
|
4979
|
+
StyledPopper4,
|
|
4980
|
+
{
|
|
4981
|
+
id: "month-range-picker-popper",
|
|
4982
|
+
open: true,
|
|
4983
|
+
anchorEl,
|
|
4984
|
+
placement: "bottom-end",
|
|
4985
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4986
|
+
modifiers: [
|
|
4987
|
+
{
|
|
4988
|
+
name: "offset",
|
|
4989
|
+
options: {
|
|
4990
|
+
offset: [4, 4]
|
|
4991
|
+
}
|
|
4992
|
+
}
|
|
4993
|
+
],
|
|
4994
|
+
"aria-label": "Calendar Tooltip",
|
|
4995
|
+
"aria-expanded": open
|
|
4996
|
+
},
|
|
4997
|
+
/* @__PURE__ */ React33.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React33.createElement(
|
|
4998
|
+
Calendar_default,
|
|
4999
|
+
{
|
|
5000
|
+
view: "month",
|
|
5001
|
+
views: ["month"],
|
|
5002
|
+
rangeSelection: true,
|
|
5003
|
+
defaultValue: calendarValue,
|
|
5004
|
+
onChange: handleCalendarChange,
|
|
5005
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
5006
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
5007
|
+
disableFuture,
|
|
5008
|
+
disablePast
|
|
5312
5009
|
}
|
|
5313
|
-
),
|
|
5314
|
-
|
|
5010
|
+
), /* @__PURE__ */ React33.createElement(
|
|
5011
|
+
DialogActions_default,
|
|
5315
5012
|
{
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
anchorEl,
|
|
5319
|
-
placement: "bottom-end",
|
|
5320
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
5321
|
-
modifiers: [
|
|
5322
|
-
{
|
|
5323
|
-
name: "offset",
|
|
5324
|
-
options: {
|
|
5325
|
-
offset: [4, 4]
|
|
5326
|
-
}
|
|
5327
|
-
}
|
|
5328
|
-
],
|
|
5329
|
-
"aria-label": "Calendar Tooltip",
|
|
5330
|
-
"aria-expanded": open
|
|
5331
|
-
},
|
|
5332
|
-
/* @__PURE__ */ React33.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React33.createElement(
|
|
5333
|
-
Calendar_default,
|
|
5334
|
-
{
|
|
5335
|
-
view: "month",
|
|
5336
|
-
views: ["month"],
|
|
5337
|
-
rangeSelection: true,
|
|
5338
|
-
defaultValue: calendarValue,
|
|
5339
|
-
onChange: handleCalendarChange,
|
|
5340
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
5341
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
5342
|
-
disableFuture,
|
|
5343
|
-
disablePast
|
|
5013
|
+
sx: {
|
|
5014
|
+
p: 1
|
|
5344
5015
|
}
|
|
5345
|
-
|
|
5346
|
-
|
|
5016
|
+
},
|
|
5017
|
+
/* @__PURE__ */ React33.createElement(
|
|
5018
|
+
Button_default,
|
|
5347
5019
|
{
|
|
5348
|
-
|
|
5349
|
-
|
|
5020
|
+
size,
|
|
5021
|
+
variant: "plain",
|
|
5022
|
+
color: "neutral",
|
|
5023
|
+
onClick: () => {
|
|
5024
|
+
setValue("");
|
|
5025
|
+
setAnchorEl(null);
|
|
5350
5026
|
}
|
|
5351
5027
|
},
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
color: "neutral",
|
|
5358
|
-
onClick: () => {
|
|
5359
|
-
setValue("");
|
|
5360
|
-
setAnchorEl(null);
|
|
5361
|
-
}
|
|
5362
|
-
},
|
|
5363
|
-
"Clear"
|
|
5364
|
-
)
|
|
5365
|
-
))
|
|
5366
|
-
)))));
|
|
5367
|
-
}
|
|
5368
|
-
);
|
|
5028
|
+
"Clear"
|
|
5029
|
+
)
|
|
5030
|
+
))
|
|
5031
|
+
)))));
|
|
5032
|
+
});
|
|
5369
5033
|
MonthRangePicker.displayName = "MonthRangePicker";
|
|
5370
5034
|
|
|
5371
5035
|
// src/components/NavigationGroup/NavigationGroup.tsx
|
|
@@ -5500,115 +5164,112 @@ var padDecimal = (value, decimalScale) => {
|
|
|
5500
5164
|
const [integer, decimal = ""] = `${value}`.split(".");
|
|
5501
5165
|
return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
|
|
5502
5166
|
};
|
|
5503
|
-
var TextMaskAdapter9 = React37.forwardRef(
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
}
|
|
5526
|
-
);
|
|
5167
|
+
var TextMaskAdapter9 = React37.forwardRef(function TextMaskAdapter10(props, ref) {
|
|
5168
|
+
const { onChange, min, max, ...innerProps } = props;
|
|
5169
|
+
return /* @__PURE__ */ React37.createElement(
|
|
5170
|
+
NumericFormat2,
|
|
5171
|
+
{
|
|
5172
|
+
...innerProps,
|
|
5173
|
+
onValueChange: ({ value }) => {
|
|
5174
|
+
onChange?.({
|
|
5175
|
+
target: {
|
|
5176
|
+
name: props.name,
|
|
5177
|
+
value
|
|
5178
|
+
}
|
|
5179
|
+
});
|
|
5180
|
+
},
|
|
5181
|
+
valueIsNumericString: true,
|
|
5182
|
+
thousandSeparator: true,
|
|
5183
|
+
suffix: "%",
|
|
5184
|
+
getInputRef: ref,
|
|
5185
|
+
allowNegative: true
|
|
5186
|
+
}
|
|
5187
|
+
);
|
|
5188
|
+
});
|
|
5527
5189
|
var PercentageInputRoot = styled24(Input_default, {
|
|
5528
5190
|
name: "PercentageInput",
|
|
5529
5191
|
slot: "Root",
|
|
5530
5192
|
overridesResolver: (props, styles) => styles.root
|
|
5531
5193
|
})({});
|
|
5532
|
-
var PercentageInput = React37.forwardRef(
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
error,
|
|
5539
|
-
helperText,
|
|
5540
|
-
required,
|
|
5541
|
-
disabled,
|
|
5542
|
-
useMinorUnit,
|
|
5543
|
-
maxDecimalScale = 0,
|
|
5544
|
-
min,
|
|
5545
|
-
max,
|
|
5546
|
-
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
5547
|
-
sx,
|
|
5548
|
-
className,
|
|
5549
|
-
...innerProps
|
|
5550
|
-
} = props;
|
|
5551
|
-
const [_value, setValue] = useControlledState(
|
|
5552
|
-
props.value,
|
|
5553
|
-
props.defaultValue,
|
|
5554
|
-
useCallback13(
|
|
5555
|
-
(value2) => onChange?.({ target: { name, value: value2 } }),
|
|
5556
|
-
[onChange, name]
|
|
5557
|
-
)
|
|
5558
|
-
);
|
|
5559
|
-
const [internalError, setInternalError] = useState11(
|
|
5560
|
-
max && _value && _value > max || min && _value && _value < min
|
|
5561
|
-
);
|
|
5562
|
-
const value = useMemo11(() => {
|
|
5563
|
-
if (_value && useMinorUnit) {
|
|
5564
|
-
return _value / Math.pow(10, maxDecimalScale);
|
|
5565
|
-
}
|
|
5566
|
-
return _value;
|
|
5567
|
-
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
5568
|
-
const handleChange = useCallback13(
|
|
5569
|
-
(event) => {
|
|
5570
|
-
if (event.target.value === "") {
|
|
5571
|
-
setValue(void 0);
|
|
5572
|
-
return;
|
|
5573
|
-
}
|
|
5574
|
-
const originalAmount = Number(event.target.value);
|
|
5575
|
-
if (min && originalAmount < min || max && originalAmount > max) {
|
|
5576
|
-
setInternalError(true);
|
|
5577
|
-
} else {
|
|
5578
|
-
setInternalError(false);
|
|
5579
|
-
}
|
|
5580
|
-
const amount = useMinorUnit ? padDecimal(originalAmount, maxDecimalScale) : originalAmount;
|
|
5581
|
-
setValue(amount);
|
|
5582
|
-
},
|
|
5583
|
-
[setValue, useMinorUnit, maxDecimalScale, min, max]
|
|
5584
|
-
);
|
|
5585
|
-
return /* @__PURE__ */ React37.createElement(
|
|
5586
|
-
PercentageInputRoot,
|
|
5587
|
-
{
|
|
5588
|
-
...innerProps,
|
|
5589
|
-
ref,
|
|
5590
|
-
value,
|
|
5591
|
-
onChange: handleChange,
|
|
5592
|
-
error: internalError || error,
|
|
5593
|
-
disabled,
|
|
5594
|
-
required,
|
|
5595
|
-
color: internalError || error ? "danger" : props.color,
|
|
5194
|
+
var PercentageInput = React37.forwardRef(
|
|
5195
|
+
function PercentageInput2(inProps, ref) {
|
|
5196
|
+
const props = useThemeProps8({ props: inProps, name: "PercentageInput" });
|
|
5197
|
+
const {
|
|
5198
|
+
name,
|
|
5199
|
+
onChange,
|
|
5596
5200
|
label,
|
|
5201
|
+
error,
|
|
5597
5202
|
helperText,
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5203
|
+
required,
|
|
5204
|
+
disabled,
|
|
5205
|
+
useMinorUnit,
|
|
5206
|
+
maxDecimalScale = 0,
|
|
5207
|
+
min,
|
|
5208
|
+
max,
|
|
5209
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
5210
|
+
sx,
|
|
5211
|
+
className,
|
|
5212
|
+
...innerProps
|
|
5213
|
+
} = props;
|
|
5214
|
+
const [_value, setValue] = useControlledState(
|
|
5215
|
+
props.value,
|
|
5216
|
+
props.defaultValue,
|
|
5217
|
+
useCallback13((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
5218
|
+
);
|
|
5219
|
+
const [internalError, setInternalError] = useState11(
|
|
5220
|
+
max && _value && _value > max || min && _value && _value < min
|
|
5221
|
+
);
|
|
5222
|
+
const value = useMemo11(() => {
|
|
5223
|
+
if (_value && useMinorUnit) {
|
|
5224
|
+
return _value / Math.pow(10, maxDecimalScale);
|
|
5225
|
+
}
|
|
5226
|
+
return _value;
|
|
5227
|
+
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
5228
|
+
const handleChange = useCallback13(
|
|
5229
|
+
(event) => {
|
|
5230
|
+
if (event.target.value === "") {
|
|
5231
|
+
setValue(void 0);
|
|
5232
|
+
return;
|
|
5603
5233
|
}
|
|
5234
|
+
const originalAmount = Number(event.target.value);
|
|
5235
|
+
if (min && originalAmount < min || max && originalAmount > max) {
|
|
5236
|
+
setInternalError(true);
|
|
5237
|
+
} else {
|
|
5238
|
+
setInternalError(false);
|
|
5239
|
+
}
|
|
5240
|
+
const amount = useMinorUnit ? padDecimal(originalAmount, maxDecimalScale) : originalAmount;
|
|
5241
|
+
setValue(amount);
|
|
5604
5242
|
},
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5243
|
+
[setValue, useMinorUnit, maxDecimalScale, min, max]
|
|
5244
|
+
);
|
|
5245
|
+
return /* @__PURE__ */ React37.createElement(
|
|
5246
|
+
PercentageInputRoot,
|
|
5247
|
+
{
|
|
5248
|
+
...innerProps,
|
|
5249
|
+
ref,
|
|
5250
|
+
value,
|
|
5251
|
+
onChange: handleChange,
|
|
5252
|
+
error: internalError || error,
|
|
5253
|
+
disabled,
|
|
5254
|
+
required,
|
|
5255
|
+
color: internalError || error ? "danger" : props.color,
|
|
5256
|
+
label,
|
|
5257
|
+
helperText,
|
|
5258
|
+
slotProps: {
|
|
5259
|
+
input: {
|
|
5260
|
+
component: TextMaskAdapter9,
|
|
5261
|
+
"aria-label": innerProps["aria-label"],
|
|
5262
|
+
decimalScale: maxDecimalScale
|
|
5263
|
+
}
|
|
5264
|
+
},
|
|
5265
|
+
sx: {
|
|
5266
|
+
...sx
|
|
5267
|
+
},
|
|
5268
|
+
className
|
|
5269
|
+
}
|
|
5270
|
+
);
|
|
5271
|
+
}
|
|
5272
|
+
);
|
|
5612
5273
|
PercentageInput.displayName = "PercentageInput";
|
|
5613
5274
|
|
|
5614
5275
|
// src/components/Radio/Radio.tsx
|
|
@@ -5715,11 +5376,7 @@ Stepper.displayName = "Stepper";
|
|
|
5715
5376
|
|
|
5716
5377
|
// src/components/Switch/Switch.tsx
|
|
5717
5378
|
import React40 from "react";
|
|
5718
|
-
import {
|
|
5719
|
-
Switch as JoySwitch,
|
|
5720
|
-
styled as styled26,
|
|
5721
|
-
switchClasses
|
|
5722
|
-
} from "@mui/joy";
|
|
5379
|
+
import { Switch as JoySwitch, styled as styled26, switchClasses } from "@mui/joy";
|
|
5723
5380
|
import { motion as motion29 } from "framer-motion";
|
|
5724
5381
|
var MotionSwitch = motion29(JoySwitch);
|
|
5725
5382
|
var StyledThumb = styled26(motion29.div)({
|
|
@@ -6053,13 +5710,7 @@ function ThemeProvider(props) {
|
|
|
6053
5710
|
ThemeProvider.displayName = "ThemeProvider";
|
|
6054
5711
|
|
|
6055
5712
|
// src/components/Uploader/Uploader.tsx
|
|
6056
|
-
import React43, {
|
|
6057
|
-
useCallback as useCallback14,
|
|
6058
|
-
useEffect as useEffect10,
|
|
6059
|
-
useMemo as useMemo12,
|
|
6060
|
-
useRef as useRef8,
|
|
6061
|
-
useState as useState12
|
|
6062
|
-
} from "react";
|
|
5713
|
+
import React43, { useCallback as useCallback14, useEffect as useEffect10, useMemo as useMemo12, useRef as useRef8, useState as useState12 } from "react";
|
|
6063
5714
|
import { styled as styled28, Input as Input2 } from "@mui/joy";
|
|
6064
5715
|
import MuiFileUploadIcon from "@mui/icons-material/CloudUploadRounded";
|
|
6065
5716
|
import MuiUploadFileIcon from "@mui/icons-material/UploadFileRounded";
|
|
@@ -6118,52 +5769,11 @@ var ClearIcon2 = styled28(MuiClearIcon, {
|
|
|
6118
5769
|
width: "18px",
|
|
6119
5770
|
height: "18px"
|
|
6120
5771
|
}));
|
|
6121
|
-
var UNITS = [
|
|
6122
|
-
"byte",
|
|
6123
|
-
"kilobyte",
|
|
6124
|
-
"megabyte",
|
|
6125
|
-
"gigabyte",
|
|
6126
|
-
"terabyte",
|
|
6127
|
-
"petabyte"
|
|
6128
|
-
];
|
|
5772
|
+
var UNITS = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "petabyte"];
|
|
6129
5773
|
var ALL_EXTENSIONS_BY_TYPE = {
|
|
6130
|
-
"image/*": [
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
".png",
|
|
6134
|
-
".gif",
|
|
6135
|
-
".bmp",
|
|
6136
|
-
".tiff",
|
|
6137
|
-
".svg",
|
|
6138
|
-
".webp",
|
|
6139
|
-
".heic",
|
|
6140
|
-
".ico"
|
|
6141
|
-
],
|
|
6142
|
-
"audio/*": [
|
|
6143
|
-
".mp3",
|
|
6144
|
-
".wav",
|
|
6145
|
-
".flac",
|
|
6146
|
-
".aac",
|
|
6147
|
-
".ogg",
|
|
6148
|
-
".m4a",
|
|
6149
|
-
".wma",
|
|
6150
|
-
".aiff",
|
|
6151
|
-
".alac",
|
|
6152
|
-
".midi",
|
|
6153
|
-
".mp4"
|
|
6154
|
-
],
|
|
6155
|
-
"video/*": [
|
|
6156
|
-
".mp4",
|
|
6157
|
-
".avi",
|
|
6158
|
-
".mkv",
|
|
6159
|
-
".mov",
|
|
6160
|
-
".wmv",
|
|
6161
|
-
".flv",
|
|
6162
|
-
".webm",
|
|
6163
|
-
".mpeg",
|
|
6164
|
-
".3gp",
|
|
6165
|
-
".m4v"
|
|
6166
|
-
]
|
|
5774
|
+
"image/*": [".jpeg", ".jpg", ".png", ".gif", ".bmp", ".tiff", ".svg", ".webp", ".heic", ".ico"],
|
|
5775
|
+
"audio/*": [".mp3", ".wav", ".flac", ".aac", ".ogg", ".m4a", ".wma", ".aiff", ".alac", ".midi", ".mp4"],
|
|
5776
|
+
"video/*": [".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".webm", ".mpeg", ".3gp", ".m4v"]
|
|
6167
5777
|
};
|
|
6168
5778
|
var getFileSize = (n) => {
|
|
6169
5779
|
const i = n == 0 ? 0 : Math.floor(Math.log(n) / Math.log(1024));
|
|
@@ -6177,16 +5787,7 @@ var getFileSize = (n) => {
|
|
|
6177
5787
|
};
|
|
6178
5788
|
var Preview = (props) => {
|
|
6179
5789
|
const { files, uploaded, onDelete } = props;
|
|
6180
|
-
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(
|
|
6181
|
-
Typography_default,
|
|
6182
|
-
{
|
|
6183
|
-
level: "body-xs",
|
|
6184
|
-
fontWeight: "300",
|
|
6185
|
-
lineHeight: "1.33",
|
|
6186
|
-
textColor: "text.tertiary"
|
|
6187
|
-
},
|
|
6188
|
-
getFileSize(file.size)
|
|
6189
|
-
)), /* @__PURE__ */ React43.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ React43.createElement(ClearIcon2, null))))));
|
|
5790
|
+
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))))));
|
|
6190
5791
|
};
|
|
6191
5792
|
var UploaderRoot = styled28(Stack_default, {
|
|
6192
5793
|
name: "Uploader",
|
|
@@ -6198,31 +5799,27 @@ var FileDropZone = styled28(Sheet_default, {
|
|
|
6198
5799
|
name: "Uploader",
|
|
6199
5800
|
slot: "dropZone",
|
|
6200
5801
|
shouldForwardProp: (prop) => prop !== "error"
|
|
6201
|
-
})(
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
})
|
|
6214
|
-
);
|
|
5802
|
+
})(({ theme, state, error }) => ({
|
|
5803
|
+
width: "100%",
|
|
5804
|
+
display: "flex",
|
|
5805
|
+
flexDirection: "column",
|
|
5806
|
+
justifyContent: "center",
|
|
5807
|
+
alignItems: "center",
|
|
5808
|
+
padding: theme.spacing(5),
|
|
5809
|
+
gap: theme.spacing(4),
|
|
5810
|
+
cursor: "pointer",
|
|
5811
|
+
backgroundColor: theme.palette.background.surface,
|
|
5812
|
+
border: error ? `1px solid ${theme.palette.danger.outlinedBorder}` : state === "idle" ? `1px solid ${theme.palette.neutral.outlinedBorder}` : `1px solid ${theme.palette.primary.outlinedBorder}`
|
|
5813
|
+
}));
|
|
6215
5814
|
var UploaderIcon = styled28(MuiFileUploadIcon, {
|
|
6216
5815
|
name: "Uploader",
|
|
6217
5816
|
slot: "iconContainer",
|
|
6218
5817
|
shouldForwardProp: (prop) => prop !== "error"
|
|
6219
|
-
})(
|
|
6220
|
-
({
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
})
|
|
6225
|
-
);
|
|
5818
|
+
})(({ theme, state, error }) => ({
|
|
5819
|
+
color: error ? `rgba(${theme.vars.palette.danger.mainChannel} / 0.6)` : state === "over" ? `rgba(${theme.palette.primary.mainChannel} / 0.6)` : theme.palette.neutral.softActiveBg,
|
|
5820
|
+
width: "32px",
|
|
5821
|
+
height: "32px"
|
|
5822
|
+
}));
|
|
6226
5823
|
var Uploader = React43.memo(
|
|
6227
5824
|
(props) => {
|
|
6228
5825
|
const {
|
|
@@ -6242,14 +5839,9 @@ var Uploader = React43.memo(
|
|
|
6242
5839
|
const inputRef = useRef8(null);
|
|
6243
5840
|
const [errorText, setErrorText] = useState12();
|
|
6244
5841
|
const [files, setFiles] = useState12([]);
|
|
6245
|
-
const [uploaded, setUploaded] = useState12(
|
|
6246
|
-
props.uploaded || []
|
|
6247
|
-
);
|
|
5842
|
+
const [uploaded, setUploaded] = useState12(props.uploaded || []);
|
|
6248
5843
|
const [previewState, setPreviewState] = useState12("idle");
|
|
6249
|
-
const accepts = useMemo12(
|
|
6250
|
-
() => accept.split(",").map((accept2) => accept2.trim()),
|
|
6251
|
-
[accept]
|
|
6252
|
-
);
|
|
5844
|
+
const accepts = useMemo12(() => accept.split(",").map((accept2) => accept2.trim()), [accept]);
|
|
6253
5845
|
const parsedAccepts = useMemo12(
|
|
6254
5846
|
() => accepts.flatMap((type) => {
|
|
6255
5847
|
if (["image/*", "video/*", "audio/*"].includes(type)) {
|
|
@@ -6261,15 +5853,11 @@ var Uploader = React43.memo(
|
|
|
6261
5853
|
);
|
|
6262
5854
|
const helperText = useMemo12(() => {
|
|
6263
5855
|
const [allAcceptedTypes, acceptedTypes] = [
|
|
6264
|
-
accepts.filter(
|
|
6265
|
-
(accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)
|
|
6266
|
-
).map((accept2) => {
|
|
5856
|
+
accepts.filter((accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
|
|
6267
5857
|
const [type] = accept2.split("/");
|
|
6268
5858
|
return type.toLowerCase();
|
|
6269
5859
|
}),
|
|
6270
|
-
accepts.filter(
|
|
6271
|
-
(accept2) => !["image/*", "video/*", "audio/*"].includes(accept2)
|
|
6272
|
-
).map((accept2) => {
|
|
5860
|
+
accepts.filter((accept2) => !["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
|
|
6273
5861
|
const [extensionOrType, subType] = accept2.split("/");
|
|
6274
5862
|
if (!subType) {
|
|
6275
5863
|
return extensionOrType.toUpperCase().replace(".", "");
|
|
@@ -6286,16 +5874,11 @@ var Uploader = React43.memo(
|
|
|
6286
5874
|
}
|
|
6287
5875
|
helperTexts.push(`Maximum ${getFileSize(maxFileTotalSize)}`);
|
|
6288
5876
|
if (maxCount) {
|
|
6289
|
-
helperTexts.push(
|
|
6290
|
-
`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`
|
|
6291
|
-
);
|
|
5877
|
+
helperTexts.push(`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`);
|
|
6292
5878
|
}
|
|
6293
5879
|
return helperTexts.join(", ");
|
|
6294
5880
|
}, [accepts, maxFileTotalSize, maxCount]);
|
|
6295
|
-
const error = useMemo12(
|
|
6296
|
-
() => !!errorText || props.error,
|
|
6297
|
-
[props.error, errorText]
|
|
6298
|
-
);
|
|
5881
|
+
const error = useMemo12(() => !!errorText || props.error, [props.error, errorText]);
|
|
6299
5882
|
const showDropZone = useMemo12(
|
|
6300
5883
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
6301
5884
|
[files, maxCount, uploaded]
|
|
@@ -6322,10 +5905,7 @@ var Uploader = React43.memo(
|
|
|
6322
5905
|
}
|
|
6323
5906
|
});
|
|
6324
5907
|
}
|
|
6325
|
-
const totalFileSize = [...files, ...uploads].reduce(
|
|
6326
|
-
(acc, file) => acc + file.size,
|
|
6327
|
-
0
|
|
6328
|
-
);
|
|
5908
|
+
const totalFileSize = [...files, ...uploads].reduce((acc, file) => acc + file.size, 0);
|
|
6329
5909
|
if (totalFileSize > maxFileTotalSize) {
|
|
6330
5910
|
throw new Error(`Total File size exceeded the maximum limit.`);
|
|
6331
5911
|
}
|
|
@@ -6346,34 +5926,15 @@ var Uploader = React43.memo(
|
|
|
6346
5926
|
setErrorText(err.message);
|
|
6347
5927
|
}
|
|
6348
5928
|
},
|
|
6349
|
-
[
|
|
6350
|
-
files,
|
|
6351
|
-
uploaded,
|
|
6352
|
-
maxCount,
|
|
6353
|
-
parsedAccepts,
|
|
6354
|
-
maxFileSize,
|
|
6355
|
-
maxFileTotalSize,
|
|
6356
|
-
name,
|
|
6357
|
-
onChange
|
|
6358
|
-
]
|
|
5929
|
+
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
6359
5930
|
);
|
|
6360
5931
|
useEffect10(() => {
|
|
6361
5932
|
if (!dropZoneRef.current || disabled) {
|
|
6362
5933
|
return;
|
|
6363
5934
|
}
|
|
6364
5935
|
let cleanup;
|
|
6365
|
-
Promise.all([
|
|
6366
|
-
|
|
6367
|
-
esmFiles.adapter,
|
|
6368
|
-
esmFiles.file,
|
|
6369
|
-
esmFiles.preventUnhandled
|
|
6370
|
-
]).then(
|
|
6371
|
-
([
|
|
6372
|
-
combineModule,
|
|
6373
|
-
adapterModule,
|
|
6374
|
-
fileModule,
|
|
6375
|
-
preventUnhandledModule
|
|
6376
|
-
]) => {
|
|
5936
|
+
Promise.all([esmFiles.combine, esmFiles.adapter, esmFiles.file, esmFiles.preventUnhandled]).then(
|
|
5937
|
+
([combineModule, adapterModule, fileModule, preventUnhandledModule]) => {
|
|
6377
5938
|
const { combine } = combineModule;
|
|
6378
5939
|
const { dropTargetForExternal, monitorForExternal } = adapterModule;
|
|
6379
5940
|
const { containsFiles, getFiles } = fileModule;
|
|
@@ -6408,9 +5969,7 @@ var Uploader = React43.memo(
|
|
|
6408
5969
|
useEffect10(() => {
|
|
6409
5970
|
if (inputRef.current && minCount) {
|
|
6410
5971
|
if (files.length < minCount) {
|
|
6411
|
-
inputRef.current.setCustomValidity(
|
|
6412
|
-
`At least ${minCount} files are required.`
|
|
6413
|
-
);
|
|
5972
|
+
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
6414
5973
|
} else {
|
|
6415
5974
|
inputRef.current.setCustomValidity("");
|
|
6416
5975
|
}
|
|
@@ -6436,9 +5995,7 @@ var Uploader = React43.memo(
|
|
|
6436
5995
|
return current.filter((file) => file !== deletedFile);
|
|
6437
5996
|
});
|
|
6438
5997
|
} else {
|
|
6439
|
-
setUploaded(
|
|
6440
|
-
(uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id)
|
|
6441
|
-
);
|
|
5998
|
+
setUploaded((uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id));
|
|
6442
5999
|
onDelete?.(deletedFile);
|
|
6443
6000
|
}
|
|
6444
6001
|
setErrorText(void 0);
|
|
@@ -6464,9 +6021,7 @@ var Uploader = React43.memo(
|
|
|
6464
6021
|
required: !!minCount,
|
|
6465
6022
|
onInvalid: (e) => {
|
|
6466
6023
|
if (minCount && files.length < minCount) {
|
|
6467
|
-
setErrorText(
|
|
6468
|
-
`Please choose ${minCount} ${minCount === 1 ? "file" : "files"} to upload.`
|
|
6469
|
-
);
|
|
6024
|
+
setErrorText(`Please choose ${minCount} ${minCount === 1 ? "file" : "files"} to upload.`);
|
|
6470
6025
|
}
|
|
6471
6026
|
},
|
|
6472
6027
|
slotProps: {
|
|
@@ -6482,25 +6037,7 @@ var Uploader = React43.memo(
|
|
|
6482
6037
|
}
|
|
6483
6038
|
)
|
|
6484
6039
|
);
|
|
6485
|
-
return /* @__PURE__ */ React43.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ React43.createElement(
|
|
6486
|
-
FormControl_default,
|
|
6487
|
-
{
|
|
6488
|
-
size,
|
|
6489
|
-
error: !!(error || errorText),
|
|
6490
|
-
disabled,
|
|
6491
|
-
required: !!minCount
|
|
6492
|
-
},
|
|
6493
|
-
label && /* @__PURE__ */ React43.createElement(FormLabel_default, null, label),
|
|
6494
|
-
uploader,
|
|
6495
|
-
/* @__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)))
|
|
6496
|
-
), [...uploaded, ...files].length > 0 && /* @__PURE__ */ React43.createElement(
|
|
6497
|
-
Preview,
|
|
6498
|
-
{
|
|
6499
|
-
files,
|
|
6500
|
-
uploaded,
|
|
6501
|
-
onDelete: handleDeleteFile
|
|
6502
|
-
}
|
|
6503
|
-
));
|
|
6040
|
+
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 }));
|
|
6504
6041
|
}
|
|
6505
6042
|
);
|
|
6506
6043
|
Uploader.displayName = "Uploader";
|