@ceed/ads 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 +3 -3
- 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/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Dropdown/index.d.ts +2 -2
- package/dist/components/FilterMenu/FilterMenu.d.ts +2 -2
- package/dist/components/FilterMenu/components/Autocomplete.d.ts +2 -2
- package/dist/components/FilterMenu/components/CheckboxGroup.d.ts +2 -2
- package/dist/components/FilterMenu/components/CurrencyInput.d.ts +2 -2
- package/dist/components/FilterMenu/components/CurrencyRange.d.ts +2 -2
- package/dist/components/FilterMenu/components/DateRange.d.ts +2 -2
- package/dist/components/FilterMenu/components/PercentageInput.d.ts +2 -2
- package/dist/components/FilterMenu/components/PercentageRange.d.ts +2 -2
- package/dist/components/FilterMenu/components/RadioGroup.d.ts +2 -2
- package/dist/components/FilterMenu/index.d.ts +2 -2
- package/dist/components/FilterMenu/types.d.ts +18 -18
- 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/ProfileMenu/ProfileMenu.d.ts +5 -5
- package/dist/components/ProfileMenu/index.d.ts +2 -2
- 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 +18 -18
- 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 +60 -60
- package/dist/index.cjs +1421 -2083
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1445 -2187
- package/dist/libs/rehype-accent/index.d.ts +2 -2
- package/framer/index.js +40 -40
- package/package.json +6 -1
package/dist/index.cjs
CHANGED
|
@@ -326,16 +326,7 @@ var MotionAlert = (0, import_joy4.styled)((0, import_framer_motion3.motion)(impo
|
|
|
326
326
|
function Alert(props) {
|
|
327
327
|
const { title, content, actions, color = "primary", ...innerProps } = props;
|
|
328
328
|
const invertedColors = props.invertedColors || props.variant === "solid";
|
|
329
|
-
return /* @__PURE__ */ import_react3.default.createElement(
|
|
330
|
-
MotionAlert,
|
|
331
|
-
{
|
|
332
|
-
...innerProps,
|
|
333
|
-
color,
|
|
334
|
-
endDecorator: actions,
|
|
335
|
-
invertedColors
|
|
336
|
-
},
|
|
337
|
-
/* @__PURE__ */ import_react3.default.createElement(Stack_default, null, title && /* @__PURE__ */ import_react3.default.createElement(Typography_default, { level: "title-md", fontWeight: "bold", color }, title), /* @__PURE__ */ import_react3.default.createElement(Typography_default, { level: "body-sm", fontWeight: 500, color }, content))
|
|
338
|
-
);
|
|
329
|
+
return /* @__PURE__ */ import_react3.default.createElement(MotionAlert, { ...innerProps, color, endDecorator: actions, invertedColors }, /* @__PURE__ */ import_react3.default.createElement(Stack_default, null, title && /* @__PURE__ */ import_react3.default.createElement(Typography_default, { level: "title-md", fontWeight: "bold", color }, title), /* @__PURE__ */ import_react3.default.createElement(Typography_default, { level: "body-sm", fontWeight: 500, color }, content)));
|
|
339
330
|
}
|
|
340
331
|
Alert.displayName = "Alert";
|
|
341
332
|
|
|
@@ -407,9 +398,7 @@ var IconButton_default = IconButton;
|
|
|
407
398
|
var import_react5 = require("react");
|
|
408
399
|
function useControlledState(controlledValue, defaultValue, onChange) {
|
|
409
400
|
const { current: isControlled } = (0, import_react5.useRef)(controlledValue !== void 0);
|
|
410
|
-
const [internalValue, setInternalValue] = (0, import_react5.useState)(
|
|
411
|
-
controlledValue ?? defaultValue
|
|
412
|
-
);
|
|
401
|
+
const [internalValue, setInternalValue] = (0, import_react5.useState)(controlledValue ?? defaultValue);
|
|
413
402
|
const displayValue = isControlled ? controlledValue : internalValue;
|
|
414
403
|
(0, import_react5.useEffect)(() => {
|
|
415
404
|
if (isControlled) {
|
|
@@ -475,51 +464,42 @@ var AutocompleteListBox = import_react6.default.forwardRef((props, ref) => {
|
|
|
475
464
|
virtualizer.measure();
|
|
476
465
|
}
|
|
477
466
|
}, [open, virtualizer]);
|
|
478
|
-
return /* @__PURE__ */ import_react6.default.createElement(
|
|
479
|
-
|
|
467
|
+
return /* @__PURE__ */ import_react6.default.createElement(AutocompletePopper, { ref, anchorEl, open, modifiers }, /* @__PURE__ */ import_react6.default.createElement(import_joy10.AutocompleteListbox, { ...innerProps }, /* @__PURE__ */ import_react6.default.createElement("div", { ref: parentRef, style: { overflow: "auto" } }, /* @__PURE__ */ import_react6.default.createElement(
|
|
468
|
+
"div",
|
|
480
469
|
{
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
470
|
+
style: {
|
|
471
|
+
height: `${virtualizer.getTotalSize()}px`,
|
|
472
|
+
position: "relative"
|
|
473
|
+
}
|
|
485
474
|
},
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
475
|
+
items.map(
|
|
476
|
+
({ index, size, start, key }) => import_react6.default.cloneElement(renderTargets[index], {
|
|
477
|
+
key,
|
|
489
478
|
style: {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
479
|
+
position: "absolute",
|
|
480
|
+
top: 0,
|
|
481
|
+
left: 0,
|
|
482
|
+
width: "100%",
|
|
483
|
+
fontSize: `var(--ceed-fontSize-${fontSize})`,
|
|
484
|
+
height: `${size}px`,
|
|
485
|
+
transform: `translateY(${start}px)`,
|
|
486
|
+
overflow: "visible"
|
|
487
|
+
},
|
|
488
|
+
children: /* @__PURE__ */ import_react6.default.createElement(
|
|
489
|
+
"div",
|
|
490
|
+
{
|
|
491
|
+
style: {
|
|
492
|
+
textOverflow: "ellipsis",
|
|
493
|
+
textWrap: "nowrap",
|
|
494
|
+
overflow: "hidden",
|
|
495
|
+
width: "100%"
|
|
496
|
+
}
|
|
506
497
|
},
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
textWrap: "nowrap",
|
|
513
|
-
overflow: "hidden",
|
|
514
|
-
width: "100%"
|
|
515
|
-
}
|
|
516
|
-
},
|
|
517
|
-
renderTargets[index].props.children
|
|
518
|
-
)
|
|
519
|
-
})
|
|
520
|
-
)
|
|
521
|
-
)))
|
|
522
|
-
);
|
|
498
|
+
renderTargets[index].props.children
|
|
499
|
+
)
|
|
500
|
+
})
|
|
501
|
+
)
|
|
502
|
+
))));
|
|
523
503
|
});
|
|
524
504
|
var AutocompleteDeleteSize = {
|
|
525
505
|
sm: "20px",
|
|
@@ -589,15 +569,7 @@ function Autocomplete(props) {
|
|
|
589
569
|
return {
|
|
590
570
|
value: "",
|
|
591
571
|
label: "",
|
|
592
|
-
startDecorator: /* @__PURE__ */ import_react6.default.createElement(
|
|
593
|
-
import_joy10.CircularProgress,
|
|
594
|
-
{
|
|
595
|
-
size: "sm",
|
|
596
|
-
color: "neutral",
|
|
597
|
-
variant: "plain",
|
|
598
|
-
thickness: 3
|
|
599
|
-
}
|
|
600
|
-
)
|
|
572
|
+
startDecorator: /* @__PURE__ */ import_react6.default.createElement(import_joy10.CircularProgress, { size: "sm", color: "neutral", variant: "plain", thickness: 3 })
|
|
601
573
|
};
|
|
602
574
|
}
|
|
603
575
|
if (Array.isArray(_value)) {
|
|
@@ -612,15 +584,11 @@ function Autocomplete(props) {
|
|
|
612
584
|
[size, props.loading]
|
|
613
585
|
);
|
|
614
586
|
const startDecorator = (0, import_react6.useMemo)(
|
|
615
|
-
() => applySize(
|
|
616
|
-
value?.startDecorator || props.startDecorator
|
|
617
|
-
),
|
|
587
|
+
() => applySize(value?.startDecorator || props.startDecorator),
|
|
618
588
|
[value, applySize, props.startDecorator]
|
|
619
589
|
);
|
|
620
590
|
const endDecorator = (0, import_react6.useMemo)(
|
|
621
|
-
() => applySize(
|
|
622
|
-
value?.endDecorator || props.endDecorator
|
|
623
|
-
),
|
|
591
|
+
() => applySize(value?.endDecorator || props.endDecorator),
|
|
624
592
|
[value, applySize, props.endDecorator]
|
|
625
593
|
);
|
|
626
594
|
const handleChange = (0, import_react6.useCallback)(
|
|
@@ -658,16 +626,7 @@ function Autocomplete(props) {
|
|
|
658
626
|
const { onClick, ...rest } = getTagProps({ index });
|
|
659
627
|
return applySize(
|
|
660
628
|
/* @__PURE__ */ import_react6.default.createElement(Chip_default, { color: "primary", ...rest }, /* @__PURE__ */ import_react6.default.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2, py: 0.5 }, tag.value, applySize(
|
|
661
|
-
/* @__PURE__ */ import_react6.default.createElement(
|
|
662
|
-
AutocompleteTagDelete,
|
|
663
|
-
{
|
|
664
|
-
color: "primary",
|
|
665
|
-
variant: "soft",
|
|
666
|
-
onClick,
|
|
667
|
-
size
|
|
668
|
-
},
|
|
669
|
-
/* @__PURE__ */ import_react6.default.createElement(import_Close.default, null)
|
|
670
|
-
)
|
|
629
|
+
/* @__PURE__ */ import_react6.default.createElement(AutocompleteTagDelete, { color: "primary", variant: "soft", onClick, size }, /* @__PURE__ */ import_react6.default.createElement(import_Close.default, null))
|
|
671
630
|
)))
|
|
672
631
|
);
|
|
673
632
|
}),
|
|
@@ -813,33 +772,13 @@ function Breadcrumbs(props) {
|
|
|
813
772
|
}
|
|
814
773
|
};
|
|
815
774
|
if (!collapsed) {
|
|
816
|
-
return /* @__PURE__ */ import_react9.default.createElement(
|
|
817
|
-
import_joy15.Breadcrumbs,
|
|
818
|
-
{
|
|
819
|
-
size,
|
|
820
|
-
slots: restSlots,
|
|
821
|
-
slotProps: restSlotProps,
|
|
822
|
-
...innerProps
|
|
823
|
-
},
|
|
824
|
-
crumbs.map((crumb, index) => /* @__PURE__ */ import_react9.default.createElement(Crumb, { key: `breadcrumb-${index}`, ...crumb }))
|
|
825
|
-
);
|
|
775
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_joy15.Breadcrumbs, { size, slots: restSlots, slotProps: restSlotProps, ...innerProps }, crumbs.map((crumb, index) => /* @__PURE__ */ import_react9.default.createElement(Crumb, { key: `breadcrumb-${index}`, ...crumb })));
|
|
826
776
|
}
|
|
827
777
|
const _endCrumbCount = Math.max(1, endCrumbCount);
|
|
828
778
|
const frontCrumbs = crumbs.slice(0, startCrumbCount).map((crumb) => /* @__PURE__ */ import_react9.default.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
|
|
829
779
|
const backCrumbs = (startCrumbCount + _endCrumbCount > crumbs.length ? crumbs.slice(startCrumbCount) : crumbs.slice(-_endCrumbCount)).map((crumb) => /* @__PURE__ */ import_react9.default.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
|
|
830
780
|
const collapsedCrumbs = crumbs.slice(startCrumbCount, -_endCrumbCount).map((crumb) => /* @__PURE__ */ import_react9.default.createElement(MenuItem, { key: `breadcrumb-${crumb.label}` }, /* @__PURE__ */ import_react9.default.createElement(Crumb, { ...crumb })));
|
|
831
|
-
return /* @__PURE__ */ import_react9.default.createElement(
|
|
832
|
-
import_joy15.Breadcrumbs,
|
|
833
|
-
{
|
|
834
|
-
size,
|
|
835
|
-
slots: restSlots,
|
|
836
|
-
slotProps: restSlotProps,
|
|
837
|
-
...innerProps
|
|
838
|
-
},
|
|
839
|
-
frontCrumbs,
|
|
840
|
-
collapsedCrumbs.length && /* @__PURE__ */ import_react9.default.createElement(Dropdown_default, null, /* @__PURE__ */ import_react9.default.createElement(import_joy15.MenuButton, { size, variant: "plain" }, "..."), /* @__PURE__ */ import_react9.default.createElement(Menu_default, { size }, collapsedCrumbs)),
|
|
841
|
-
backCrumbs
|
|
842
|
-
);
|
|
781
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_joy15.Breadcrumbs, { size, slots: restSlots, slotProps: restSlotProps, ...innerProps }, frontCrumbs, collapsedCrumbs.length && /* @__PURE__ */ import_react9.default.createElement(Dropdown_default, null, /* @__PURE__ */ import_react9.default.createElement(import_joy15.MenuButton, { size, variant: "plain" }, "..."), /* @__PURE__ */ import_react9.default.createElement(Menu_default, { size }, collapsedCrumbs)), backCrumbs);
|
|
843
782
|
}
|
|
844
783
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
845
784
|
|
|
@@ -849,13 +788,7 @@ var import_joy16 = require("@mui/joy");
|
|
|
849
788
|
var import_framer_motion11 = require("framer-motion");
|
|
850
789
|
var MotionButton = (0, import_framer_motion11.motion)(import_joy16.Button);
|
|
851
790
|
var Button = (0, import_react10.forwardRef)(({ ...props }, ref) => {
|
|
852
|
-
return /* @__PURE__ */ import_react10.default.createElement(
|
|
853
|
-
MotionButton,
|
|
854
|
-
{
|
|
855
|
-
ref,
|
|
856
|
-
...props
|
|
857
|
-
}
|
|
858
|
-
);
|
|
791
|
+
return /* @__PURE__ */ import_react10.default.createElement(MotionButton, { ref, ...props });
|
|
859
792
|
});
|
|
860
793
|
Button.displayName = "Button";
|
|
861
794
|
|
|
@@ -875,9 +808,7 @@ var getCalendarDates = (date) => {
|
|
|
875
808
|
const firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
876
809
|
const lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
877
810
|
const firstWeekInThisMonth = Math.ceil((firstDay.getDay() + 1) / 7);
|
|
878
|
-
const lastWeekInThisMonth = Math.ceil(
|
|
879
|
-
(lastDay.getDate() + firstDay.getDay()) / 7
|
|
880
|
-
);
|
|
811
|
+
const lastWeekInThisMonth = Math.ceil((lastDay.getDate() + firstDay.getDay()) / 7);
|
|
881
812
|
let day = 1;
|
|
882
813
|
for (let i = 1; i <= lastWeekInThisMonth; i++) {
|
|
883
814
|
const week = [];
|
|
@@ -952,7 +883,9 @@ var useCalendarProps = (inProps) => {
|
|
|
952
883
|
const [uncontrolledView, setUncontrolledView] = (0, import_react11.useState)(
|
|
953
884
|
() => resolveView(inProps.view || "day", inProps.views || ["day", "month"])
|
|
954
885
|
);
|
|
955
|
-
const [uncontrolledValue, setUncontrolledValue] = (0, import_react11.useState)(
|
|
886
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react11.useState)(
|
|
887
|
+
inProps.defaultValue
|
|
888
|
+
);
|
|
956
889
|
const [viewMonth, setViewMonth] = (0, import_react11.useState)(() => {
|
|
957
890
|
const today = /* @__PURE__ */ new Date();
|
|
958
891
|
today.setDate(1);
|
|
@@ -1025,10 +958,7 @@ var useCalendarProps = (inProps) => {
|
|
|
1025
958
|
},
|
|
1026
959
|
name: "Calendar"
|
|
1027
960
|
});
|
|
1028
|
-
const ownerState = (0, import_react11.useMemo)(
|
|
1029
|
-
() => ({ ...props, viewMonth, direction }),
|
|
1030
|
-
[props, viewMonth, direction]
|
|
1031
|
-
);
|
|
961
|
+
const ownerState = (0, import_react11.useMemo)(() => ({ ...props, viewMonth, direction }), [props, viewMonth, direction]);
|
|
1032
962
|
return [props, ownerState];
|
|
1033
963
|
};
|
|
1034
964
|
|
|
@@ -1046,11 +976,7 @@ var useCalendar = (ownerState) => {
|
|
|
1046
976
|
const currentMonth = currentDate.getMonth();
|
|
1047
977
|
const currentDay = currentDate.getDate();
|
|
1048
978
|
const prevMonth = new Date(currentYear, currentMonth - 1, 1);
|
|
1049
|
-
const lastDayOfPrevMonth = new Date(
|
|
1050
|
-
currentYear,
|
|
1051
|
-
currentMonth,
|
|
1052
|
-
0
|
|
1053
|
-
).getDate();
|
|
979
|
+
const lastDayOfPrevMonth = new Date(currentYear, currentMonth, 0).getDate();
|
|
1054
980
|
const prevMonthDay = Math.min(currentDay, lastDayOfPrevMonth);
|
|
1055
981
|
prevMonth.setDate(prevMonthDay);
|
|
1056
982
|
ownerState.onMonthChange?.(prevMonth);
|
|
@@ -1067,11 +993,7 @@ var useCalendar = (ownerState) => {
|
|
|
1067
993
|
const currentMonth = currentDate.getMonth();
|
|
1068
994
|
const currentDay = currentDate.getDate();
|
|
1069
995
|
const nextMonth = new Date(currentYear, currentMonth + 1, 1);
|
|
1070
|
-
const lastDayOfNextMonth = new Date(
|
|
1071
|
-
currentYear,
|
|
1072
|
-
currentMonth + 2,
|
|
1073
|
-
0
|
|
1074
|
-
).getDate();
|
|
996
|
+
const lastDayOfNextMonth = new Date(currentYear, currentMonth + 2, 0).getDate();
|
|
1075
997
|
const nextMonthDay = Math.min(currentDay, lastDayOfNextMonth);
|
|
1076
998
|
nextMonth.setDate(nextMonthDay);
|
|
1077
999
|
ownerState.onMonthChange?.(nextMonth);
|
|
@@ -1088,22 +1010,13 @@ var useCalendar = (ownerState) => {
|
|
|
1088
1010
|
thisDay.setDate(day);
|
|
1089
1011
|
const inRange = ownerState.rangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1090
1012
|
(hoverDay && isWithinRange(ownerState.value[0], hoverDay, thisDay) || // NOTE: Selected range is included in the range
|
|
1091
|
-
ownerState.value[1] && isWithinRange(
|
|
1092
|
-
ownerState.value[0],
|
|
1093
|
-
ownerState.value[1],
|
|
1094
|
-
thisDay
|
|
1095
|
-
));
|
|
1013
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisDay));
|
|
1096
1014
|
return {
|
|
1097
1015
|
"aria-label": thisDay.toLocaleDateString(),
|
|
1098
1016
|
"aria-current": inRange ? "date" : void 0
|
|
1099
1017
|
};
|
|
1100
1018
|
},
|
|
1101
|
-
[
|
|
1102
|
-
ownerState.rangeSelection,
|
|
1103
|
-
ownerState.value,
|
|
1104
|
-
ownerState.viewMonth,
|
|
1105
|
-
hoverDay
|
|
1106
|
-
]
|
|
1019
|
+
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverDay]
|
|
1107
1020
|
),
|
|
1108
1021
|
getMonthCellProps: (0, import_react12.useCallback)(
|
|
1109
1022
|
(monthIndex) => {
|
|
@@ -1114,22 +1027,13 @@ var useCalendar = (ownerState) => {
|
|
|
1114
1027
|
const isMonthRangeSelection = !ownerState.views?.find((view) => view === "day") && ownerState.rangeSelection;
|
|
1115
1028
|
const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1116
1029
|
(hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
|
|
1117
|
-
ownerState.value[1] && isWithinRange(
|
|
1118
|
-
ownerState.value[0],
|
|
1119
|
-
ownerState.value[1],
|
|
1120
|
-
thisMonth
|
|
1121
|
-
));
|
|
1030
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisMonth));
|
|
1122
1031
|
return {
|
|
1123
1032
|
"aria-label": thisMonth.toLocaleDateString(),
|
|
1124
1033
|
"aria-current": inRange ? "date" : void 0
|
|
1125
1034
|
};
|
|
1126
1035
|
},
|
|
1127
|
-
[
|
|
1128
|
-
ownerState.rangeSelection,
|
|
1129
|
-
ownerState.value,
|
|
1130
|
-
ownerState.viewMonth,
|
|
1131
|
-
hoverMonth
|
|
1132
|
-
]
|
|
1036
|
+
[ownerState.rangeSelection, ownerState.value, ownerState.viewMonth, hoverMonth]
|
|
1133
1037
|
),
|
|
1134
1038
|
getPickerDayProps: (0, import_react12.useCallback)(
|
|
1135
1039
|
(day) => {
|
|
@@ -1139,23 +1043,15 @@ var useCalendar = (ownerState) => {
|
|
|
1139
1043
|
const isSelected = !!ownerState.value && (isSameDay(thisDay, ownerState.value[0]) || ownerState.value[1] && isSameDay(thisDay, ownerState.value[1]));
|
|
1140
1044
|
const inRange = ownerState.rangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1141
1045
|
(hoverDay && isWithinRange(ownerState.value[0], hoverDay, thisDay) || // NOTE: Selected range is included in the range
|
|
1142
|
-
ownerState.value[1] && isWithinRange(
|
|
1143
|
-
ownerState.value[0],
|
|
1144
|
-
ownerState.value[1],
|
|
1145
|
-
thisDay
|
|
1146
|
-
));
|
|
1046
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisDay));
|
|
1147
1047
|
const handleDayClick = () => {
|
|
1148
1048
|
if (ownerState.rangeSelection) {
|
|
1149
1049
|
if (!ownerState.value) {
|
|
1150
1050
|
ownerState.onChange?.([thisDay, void 0]);
|
|
1151
1051
|
} else if (ownerState.value[0] && !ownerState.value[1]) {
|
|
1152
1052
|
ownerState.onChange?.([
|
|
1153
|
-
new Date(
|
|
1154
|
-
|
|
1155
|
-
),
|
|
1156
|
-
new Date(
|
|
1157
|
-
Math.max(ownerState.value[0].getTime(), thisDay.getTime())
|
|
1158
|
-
)
|
|
1053
|
+
new Date(Math.min(ownerState.value[0].getTime(), thisDay.getTime())),
|
|
1054
|
+
new Date(Math.max(ownerState.value[0].getTime(), thisDay.getTime()))
|
|
1159
1055
|
]);
|
|
1160
1056
|
} else {
|
|
1161
1057
|
ownerState.onChange?.([thisDay, void 0]);
|
|
@@ -1204,23 +1100,15 @@ var useCalendar = (ownerState) => {
|
|
|
1204
1100
|
const isSelected = !!ownerState.value && (isSameMonth(thisMonth, ownerState.value[0]) || ownerState.value[1] && isSameMonth(thisMonth, ownerState.value[1]));
|
|
1205
1101
|
const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
1206
1102
|
(hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
|
|
1207
|
-
ownerState.value[1] && isWithinRange(
|
|
1208
|
-
ownerState.value[0],
|
|
1209
|
-
ownerState.value[1],
|
|
1210
|
-
thisMonth
|
|
1211
|
-
));
|
|
1103
|
+
ownerState.value[1] && isWithinRange(ownerState.value[0], ownerState.value[1], thisMonth));
|
|
1212
1104
|
const handleMonthClick = () => {
|
|
1213
1105
|
if (isMonthRangeSelection) {
|
|
1214
1106
|
if (!ownerState.value) {
|
|
1215
1107
|
ownerState.onChange?.([thisMonth, void 0]);
|
|
1216
1108
|
} else if (ownerState.value[0] && !ownerState.value[1]) {
|
|
1217
1109
|
ownerState.onChange?.([
|
|
1218
|
-
new Date(
|
|
1219
|
-
|
|
1220
|
-
),
|
|
1221
|
-
new Date(
|
|
1222
|
-
Math.max(ownerState.value[0].getTime(), thisMonth.getTime())
|
|
1223
|
-
)
|
|
1110
|
+
new Date(Math.min(ownerState.value[0].getTime(), thisMonth.getTime())),
|
|
1111
|
+
new Date(Math.max(ownerState.value[0].getTime(), thisMonth.getTime()))
|
|
1224
1112
|
]);
|
|
1225
1113
|
} else {
|
|
1226
1114
|
ownerState.onChange?.([thisMonth, void 0]);
|
|
@@ -1290,15 +1178,13 @@ var CalendarViewContainer = (0, import_joy18.styled)("div", {
|
|
|
1290
1178
|
name: "Calendar",
|
|
1291
1179
|
slot: "viewContainer",
|
|
1292
1180
|
shouldForwardProp: (prop) => prop !== "calendarType"
|
|
1293
|
-
})(
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
})
|
|
1301
|
-
);
|
|
1181
|
+
})(({ theme, calendarType }) => ({
|
|
1182
|
+
paddingLeft: theme.spacing(2),
|
|
1183
|
+
paddingRight: theme.spacing(2),
|
|
1184
|
+
position: "relative",
|
|
1185
|
+
overflow: "hidden",
|
|
1186
|
+
minHeight: calendarType === "datePicker" ? "250px" : "unset"
|
|
1187
|
+
}));
|
|
1302
1188
|
var CalendarViewTable = (0, import_joy18.styled)(import_framer_motion12.motion.table, {
|
|
1303
1189
|
name: "Calendar",
|
|
1304
1190
|
slot: "viewTable"
|
|
@@ -1477,14 +1363,8 @@ var swipePower = (offset, velocity) => {
|
|
|
1477
1363
|
var PickerDays = (props) => {
|
|
1478
1364
|
const { ownerState } = props;
|
|
1479
1365
|
const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
|
|
1480
|
-
const calendarDates = (0, import_react13.useMemo)(
|
|
1481
|
-
|
|
1482
|
-
[ownerState.viewMonth]
|
|
1483
|
-
);
|
|
1484
|
-
const weekdayNames = (0, import_react13.useMemo)(
|
|
1485
|
-
() => getWeekdayNames(ownerState.locale || "default"),
|
|
1486
|
-
[ownerState.locale]
|
|
1487
|
-
);
|
|
1366
|
+
const calendarDates = (0, import_react13.useMemo)(() => getCalendarDates(ownerState.viewMonth), [ownerState.viewMonth]);
|
|
1367
|
+
const weekdayNames = (0, import_react13.useMemo)(() => getWeekdayNames(ownerState.locale || "default"), [ownerState.locale]);
|
|
1488
1368
|
return /* @__PURE__ */ import_react13.default.createElement(CalendarViewContainer, { calendarType: "datePicker" }, /* @__PURE__ */ import_react13.default.createElement(import_framer_motion12.AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ import_react13.default.createElement(
|
|
1489
1369
|
CalendarViewTable,
|
|
1490
1370
|
{
|
|
@@ -1514,25 +1394,9 @@ var PickerDays = (props) => {
|
|
|
1514
1394
|
}
|
|
1515
1395
|
}
|
|
1516
1396
|
},
|
|
1517
|
-
/* @__PURE__ */ import_react13.default.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ import_react13.default.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ import_react13.default.createElement("th", null, /* @__PURE__ */ import_react13.default.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ import_react13.default.createElement(
|
|
1518
|
-
"th",
|
|
1519
|
-
{
|
|
1520
|
-
style: { width: 4 },
|
|
1521
|
-
"aria-hidden": "true",
|
|
1522
|
-
"aria-description": "cell-gap"
|
|
1523
|
-
}
|
|
1524
|
-
))))),
|
|
1397
|
+
/* @__PURE__ */ import_react13.default.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ import_react13.default.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: `${ownerState.viewMonth}_${name}_${i}` }, /* @__PURE__ */ import_react13.default.createElement("th", null, /* @__PURE__ */ import_react13.default.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ import_react13.default.createElement("th", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" }))))),
|
|
1525
1398
|
/* @__PURE__ */ import_react13.default.createElement(CalendarDayPickerContainer, null, calendarDates.map((weekDates, rowIndex) => /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: `${ownerState.viewMonth}_${rowIndex}` }, /* @__PURE__ */ import_react13.default.createElement("tr", null, weekDates.map(
|
|
1526
|
-
(date, i) => date ? /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: `${ownerState.viewMonth}_${date}_${i}` }, /* @__PURE__ */ import_react13.default.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ import_react13.default.createElement(
|
|
1527
|
-
CalendarDay,
|
|
1528
|
-
{
|
|
1529
|
-
size: "sm",
|
|
1530
|
-
variant: "plain",
|
|
1531
|
-
color: "neutral",
|
|
1532
|
-
...getPickerDayProps(date)
|
|
1533
|
-
},
|
|
1534
|
-
date
|
|
1535
|
-
)), i < 6 && /* @__PURE__ */ import_react13.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: `${ownerState.viewMonth}_${i}` }, /* @__PURE__ */ import_react13.default.createElement("td", null), i < 6 && /* @__PURE__ */ import_react13.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
|
|
1399
|
+
(date, i) => date ? /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: `${ownerState.viewMonth}_${date}_${i}` }, /* @__PURE__ */ import_react13.default.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ import_react13.default.createElement(CalendarDay, { size: "sm", variant: "plain", color: "neutral", ...getPickerDayProps(date) }, date)), i < 6 && /* @__PURE__ */ import_react13.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: `${ownerState.viewMonth}_${i}` }, /* @__PURE__ */ import_react13.default.createElement("td", null), i < 6 && /* @__PURE__ */ import_react13.default.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
|
|
1536
1400
|
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */ import_react13.default.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ import_react13.default.createElement("td", { colSpan: 13, style: { height: 4 } })))))
|
|
1537
1401
|
)));
|
|
1538
1402
|
};
|
|
@@ -1550,62 +1414,37 @@ var PickerMonths = (props) => {
|
|
|
1550
1414
|
[[]]
|
|
1551
1415
|
);
|
|
1552
1416
|
const isMonthPicker = !ownerState.views?.find((view) => view === "day");
|
|
1553
|
-
return /* @__PURE__ */ import_react13.default.createElement(
|
|
1554
|
-
|
|
1417
|
+
return /* @__PURE__ */ import_react13.default.createElement(CalendarViewContainer, { calendarType: isMonthPicker ? "monthPicker" : "datePicker" }, /* @__PURE__ */ import_react13.default.createElement(import_framer_motion12.AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ import_react13.default.createElement(
|
|
1418
|
+
CalendarViewTable,
|
|
1555
1419
|
{
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
animate: "center",
|
|
1566
|
-
exit: "exit",
|
|
1567
|
-
transition: {
|
|
1568
|
-
x: { type: "spring", stiffness: 300, damping: 30 },
|
|
1569
|
-
opacity: { duration: 0.2 }
|
|
1570
|
-
},
|
|
1571
|
-
drag: "x",
|
|
1572
|
-
dragConstraints: { left: 0, right: 0 },
|
|
1573
|
-
dragElastic: 1,
|
|
1574
|
-
onDragEnd: (e, { offset, velocity }) => {
|
|
1575
|
-
const swipe = swipePower(offset.x, velocity.x);
|
|
1576
|
-
if (swipe < -swipeConfidenceThreshold) {
|
|
1577
|
-
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1578
|
-
date.setMonth(date.getMonth() + 1);
|
|
1579
|
-
ownerState.onMonthChange?.(date);
|
|
1580
|
-
} else if (swipe > swipeConfidenceThreshold) {
|
|
1581
|
-
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1582
|
-
date.setMonth(date.getMonth() - 1);
|
|
1583
|
-
ownerState.onMonthChange?.(date);
|
|
1584
|
-
}
|
|
1585
|
-
}
|
|
1420
|
+
key: `${ownerState.viewMonth.getFullYear()}_${ownerState.direction}`,
|
|
1421
|
+
custom: ownerState.direction,
|
|
1422
|
+
variants,
|
|
1423
|
+
initial: "enter",
|
|
1424
|
+
animate: "center",
|
|
1425
|
+
exit: "exit",
|
|
1426
|
+
transition: {
|
|
1427
|
+
x: { type: "spring", stiffness: 300, damping: 30 },
|
|
1428
|
+
opacity: { duration: 0.2 }
|
|
1586
1429
|
},
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
ownerState.
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
"td",
|
|
1601
|
-
{
|
|
1602
|
-
style: { width: 4 },
|
|
1603
|
-
"aria-hidden": "true",
|
|
1604
|
-
"aria-description": "cell-gap"
|
|
1430
|
+
drag: "x",
|
|
1431
|
+
dragConstraints: { left: 0, right: 0 },
|
|
1432
|
+
dragElastic: 1,
|
|
1433
|
+
onDragEnd: (e, { offset, velocity }) => {
|
|
1434
|
+
const swipe = swipePower(offset.x, velocity.x);
|
|
1435
|
+
if (swipe < -swipeConfidenceThreshold) {
|
|
1436
|
+
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1437
|
+
date.setMonth(date.getMonth() + 1);
|
|
1438
|
+
ownerState.onMonthChange?.(date);
|
|
1439
|
+
} else if (swipe > swipeConfidenceThreshold) {
|
|
1440
|
+
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1441
|
+
date.setMonth(date.getMonth() - 1);
|
|
1442
|
+
ownerState.onMonthChange?.(date);
|
|
1605
1443
|
}
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1444
|
+
}
|
|
1445
|
+
},
|
|
1446
|
+
/* @__PURE__ */ import_react13.default.createElement("tbody", null, chunkedMonths.map((months, i) => /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: months.join("_") }, /* @__PURE__ */ import_react13.default.createElement("tr", null, months.map((monthIndex, j) => /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, { key: monthIndex }, /* @__PURE__ */ import_react13.default.createElement(CalendarMonthCell, { ...getMonthCellProps(monthIndex) }, /* @__PURE__ */ import_react13.default.createElement(CalendarMonth, { size: "sm", variant: "plain", color: "neutral", ...getPickerMonthProps(monthIndex) }, getMonthNameFromIndex(monthIndex, ownerState.locale))), j < 3 && /* @__PURE__ */ import_react13.default.createElement("td", { style: { width: 4 }, "aria-hidden": "true", "aria-description": "cell-gap" })))), i < chunkedMonths.length - 1 && /* @__PURE__ */ import_react13.default.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ import_react13.default.createElement("td", { colSpan: 7, style: { height: 4 } })))))
|
|
1447
|
+
)));
|
|
1609
1448
|
};
|
|
1610
1449
|
var Calendar = (0, import_react13.forwardRef)((inProps, ref) => {
|
|
1611
1450
|
const [props, ownerState] = useCalendarProps(inProps);
|
|
@@ -1626,15 +1465,7 @@ var Calendar = (0, import_react13.forwardRef)((inProps, ref) => {
|
|
|
1626
1465
|
...others
|
|
1627
1466
|
} = props;
|
|
1628
1467
|
const { calendarTitle, onPrev, onNext } = useCalendar(ownerState);
|
|
1629
|
-
return /* @__PURE__ */ import_react13.default.createElement(CalendarRoot, { ref, ...others }, /* @__PURE__ */ import_react13.default.createElement(CalendarHeader, null, /* @__PURE__ */ import_react13.default.createElement(
|
|
1630
|
-
IconButton_default,
|
|
1631
|
-
{
|
|
1632
|
-
size: "sm",
|
|
1633
|
-
onClick: onPrev,
|
|
1634
|
-
"aria-label": `Previous ${view === "day" ? "Month" : "Year"}`
|
|
1635
|
-
},
|
|
1636
|
-
/* @__PURE__ */ import_react13.default.createElement(import_ChevronLeft.default, null)
|
|
1637
|
-
), /* @__PURE__ */ import_react13.default.createElement(
|
|
1468
|
+
return /* @__PURE__ */ import_react13.default.createElement(CalendarRoot, { ref, ...others }, /* @__PURE__ */ import_react13.default.createElement(CalendarHeader, null, /* @__PURE__ */ import_react13.default.createElement(IconButton_default, { size: "sm", onClick: onPrev, "aria-label": `Previous ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ import_react13.default.createElement(import_ChevronLeft.default, null)), /* @__PURE__ */ import_react13.default.createElement(
|
|
1638
1469
|
CalendarSwitchViewButton,
|
|
1639
1470
|
{
|
|
1640
1471
|
ownerState,
|
|
@@ -1644,15 +1475,7 @@ var Calendar = (0, import_react13.forwardRef)((inProps, ref) => {
|
|
|
1644
1475
|
"aria-label": "Switch Calendar View"
|
|
1645
1476
|
},
|
|
1646
1477
|
calendarTitle
|
|
1647
|
-
), /* @__PURE__ */ import_react13.default.createElement(
|
|
1648
|
-
IconButton_default,
|
|
1649
|
-
{
|
|
1650
|
-
size: "sm",
|
|
1651
|
-
onClick: onNext,
|
|
1652
|
-
"aria-label": `Next ${view === "day" ? "Month" : "Year"}`
|
|
1653
|
-
},
|
|
1654
|
-
/* @__PURE__ */ import_react13.default.createElement(import_ChevronRight.default, null)
|
|
1655
|
-
)), view === "day" && /* @__PURE__ */ import_react13.default.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ import_react13.default.createElement(PickerMonths, { ownerState }));
|
|
1478
|
+
), /* @__PURE__ */ import_react13.default.createElement(IconButton_default, { size: "sm", onClick: onNext, "aria-label": `Next ${view === "day" ? "Month" : "Year"}` }, /* @__PURE__ */ import_react13.default.createElement(import_ChevronRight.default, null))), view === "day" && /* @__PURE__ */ import_react13.default.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ import_react13.default.createElement(PickerMonths, { ownerState }));
|
|
1656
1479
|
});
|
|
1657
1480
|
Calendar.displayName = "Calendar";
|
|
1658
1481
|
|
|
@@ -1790,23 +1613,15 @@ var Input = import_react16.default.forwardRef((props, ref) => {
|
|
|
1790
1613
|
...innerProps.slotProps
|
|
1791
1614
|
},
|
|
1792
1615
|
...innerProps,
|
|
1793
|
-
endDecorator: enableClearable ? /* @__PURE__ */ import_react16.default.createElement(
|
|
1794
|
-
|
|
1616
|
+
endDecorator: enableClearable ? /* @__PURE__ */ import_react16.default.createElement(Stack_default, { gap: 1, direction: "row" }, innerProps.endDecorator, value && /* @__PURE__ */ import_react16.default.createElement(
|
|
1617
|
+
IconButton_default,
|
|
1795
1618
|
{
|
|
1796
|
-
|
|
1797
|
-
|
|
1619
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1620
|
+
onClick: handleClear,
|
|
1621
|
+
"aria-label": "Clear"
|
|
1798
1622
|
},
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
IconButton_default,
|
|
1802
|
-
{
|
|
1803
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
1804
|
-
onClick: handleClear,
|
|
1805
|
-
"aria-label": "Clear"
|
|
1806
|
-
},
|
|
1807
|
-
/* @__PURE__ */ import_react16.default.createElement(import_Close2.default, null)
|
|
1808
|
-
)
|
|
1809
|
-
) : innerProps.endDecorator
|
|
1623
|
+
/* @__PURE__ */ import_react16.default.createElement(import_Close2.default, null)
|
|
1624
|
+
)) : innerProps.endDecorator
|
|
1810
1625
|
}
|
|
1811
1626
|
);
|
|
1812
1627
|
return /* @__PURE__ */ import_react16.default.createElement(
|
|
@@ -1994,25 +1809,23 @@ var useCurrencySetting = (props) => {
|
|
|
1994
1809
|
};
|
|
1995
1810
|
|
|
1996
1811
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
1997
|
-
var TextMaskAdapter = import_react17.default.forwardRef(
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
}
|
|
2015
|
-
);
|
|
1812
|
+
var TextMaskAdapter = import_react17.default.forwardRef(function TextMaskAdapter2(props, ref) {
|
|
1813
|
+
const { onChange, ...innerProps } = props;
|
|
1814
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
1815
|
+
import_react_number_format.NumericFormat,
|
|
1816
|
+
{
|
|
1817
|
+
...innerProps,
|
|
1818
|
+
onValueChange: ({ value }) => {
|
|
1819
|
+
onChange?.({
|
|
1820
|
+
target: { name: props.name, value }
|
|
1821
|
+
});
|
|
1822
|
+
},
|
|
1823
|
+
valueIsNumericString: true,
|
|
1824
|
+
getInputRef: ref,
|
|
1825
|
+
allowNegative: true
|
|
1826
|
+
}
|
|
1827
|
+
);
|
|
1828
|
+
});
|
|
2016
1829
|
var CurrencyInputRoot = (0, import_joy23.styled)(Input_default, {
|
|
2017
1830
|
name: "CurrencyInput",
|
|
2018
1831
|
slot: "root",
|
|
@@ -2035,21 +1848,11 @@ var CurrencyInput = import_react17.default.forwardRef(function CurrencyInput2(in
|
|
|
2035
1848
|
className,
|
|
2036
1849
|
...innerProps
|
|
2037
1850
|
} = props;
|
|
2038
|
-
const {
|
|
2039
|
-
symbol,
|
|
2040
|
-
thousandSeparator,
|
|
2041
|
-
decimalSeparator,
|
|
2042
|
-
placeholder,
|
|
2043
|
-
fixedDecimalScale,
|
|
2044
|
-
decimalScale
|
|
2045
|
-
} = useCurrencySetting(props);
|
|
1851
|
+
const { symbol, thousandSeparator, decimalSeparator, placeholder, fixedDecimalScale, decimalScale } = useCurrencySetting(props);
|
|
2046
1852
|
const [_value, setValue] = useControlledState(
|
|
2047
1853
|
props.value,
|
|
2048
1854
|
props.defaultValue,
|
|
2049
|
-
(0, import_react17.useCallback)(
|
|
2050
|
-
(value2) => onChange?.({ target: { name, value: value2 } }),
|
|
2051
|
-
[onChange, name]
|
|
2052
|
-
)
|
|
1855
|
+
(0, import_react17.useCallback)((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
2053
1856
|
);
|
|
2054
1857
|
const value = (0, import_react17.useMemo)(() => {
|
|
2055
1858
|
if (_value && useMinorUnit) {
|
|
@@ -2063,9 +1866,7 @@ var CurrencyInput = import_react17.default.forwardRef(function CurrencyInput2(in
|
|
|
2063
1866
|
}
|
|
2064
1867
|
return props.max;
|
|
2065
1868
|
}, [props.max, useMinorUnit, decimalScale]);
|
|
2066
|
-
const [isOverLimit, setIsOverLimit] = (0, import_react17.useState)(
|
|
2067
|
-
!!max && !!value && value > max
|
|
2068
|
-
);
|
|
1869
|
+
const [isOverLimit, setIsOverLimit] = (0, import_react17.useState)(!!max && !!value && value > max);
|
|
2069
1870
|
const handleChange = (0, import_react17.useCallback)(
|
|
2070
1871
|
(event) => {
|
|
2071
1872
|
if (event.target.value === "") {
|
|
@@ -2095,9 +1896,9 @@ var CurrencyInput = import_react17.default.forwardRef(function CurrencyInput2(in
|
|
|
2095
1896
|
required,
|
|
2096
1897
|
color: error || isOverLimit ? "danger" : props.color,
|
|
2097
1898
|
label,
|
|
2098
|
-
helperText: isOverLimit ? new import_intl_messageformat2.IntlMessageFormat(
|
|
2099
|
-
|
|
2100
|
-
|
|
1899
|
+
helperText: isOverLimit ? new import_intl_messageformat2.IntlMessageFormat(`limit: {amount, number, ::currency/${currency} unit-width-narrow}`).format({
|
|
1900
|
+
amount: max
|
|
1901
|
+
}) : helperText,
|
|
2101
1902
|
slotProps: {
|
|
2102
1903
|
input: {
|
|
2103
1904
|
component: TextMaskAdapter,
|
|
@@ -2193,13 +1994,7 @@ function TableBody(props) {
|
|
|
2193
1994
|
textAlign: "center"
|
|
2194
1995
|
}
|
|
2195
1996
|
},
|
|
2196
|
-
/* @__PURE__ */ import_react18.default.createElement(
|
|
2197
|
-
RenderCheckbox,
|
|
2198
|
-
{
|
|
2199
|
-
onChange: (event) => onCheckboxChange?.(event, rowIndex),
|
|
2200
|
-
...checkboxProps
|
|
2201
|
-
}
|
|
2202
|
-
)
|
|
1997
|
+
/* @__PURE__ */ import_react18.default.createElement(RenderCheckbox, { onChange: (event) => onCheckboxChange?.(event, rowIndex), ...checkboxProps })
|
|
2203
1998
|
), cellOrder.map((cellKey) => /* @__PURE__ */ import_react18.default.createElement(
|
|
2204
1999
|
"td",
|
|
2205
2000
|
{
|
|
@@ -2244,9 +2039,7 @@ var CalendarButton = (0, import_joy27.styled)(IconButton_default, {
|
|
|
2244
2039
|
"&:focus": {
|
|
2245
2040
|
"--Icon-color": "currentColor",
|
|
2246
2041
|
outlineOffset: `${theme.getCssVar("focus-thickness")}`,
|
|
2247
|
-
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar(
|
|
2248
|
-
"palette-focusVisible"
|
|
2249
|
-
)}`
|
|
2042
|
+
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
2250
2043
|
}
|
|
2251
2044
|
}));
|
|
2252
2045
|
var StyledPopper = (0, import_joy27.styled)(import_base2.Popper, {
|
|
@@ -2280,9 +2073,7 @@ var validValueFormat = (value, format) => {
|
|
|
2280
2073
|
if (value !== formatValueString(parsedValue, format)) {
|
|
2281
2074
|
return false;
|
|
2282
2075
|
}
|
|
2283
|
-
const regex = new RegExp(
|
|
2284
|
-
`^${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")}$`
|
|
2285
|
-
);
|
|
2076
|
+
const regex = new RegExp(`^${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")}$`);
|
|
2286
2077
|
return regex.test(value);
|
|
2287
2078
|
} catch (e) {
|
|
2288
2079
|
return false;
|
|
@@ -2323,276 +2114,259 @@ function parseDate(dateString, format) {
|
|
|
2323
2114
|
var formatToPattern = (format) => {
|
|
2324
2115
|
return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
2325
2116
|
};
|
|
2326
|
-
var TextMaskAdapter3 = import_react19.default.forwardRef(
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
maxLength: 2
|
|
2349
|
-
},
|
|
2350
|
-
Y: {
|
|
2351
|
-
mask: import_react_imask.IMask.MaskedRange,
|
|
2352
|
-
from: 1900,
|
|
2353
|
-
to: 9999,
|
|
2354
|
-
maxLength: 4
|
|
2355
|
-
}
|
|
2117
|
+
var TextMaskAdapter3 = import_react19.default.forwardRef(function TextMaskAdapter4(props, ref) {
|
|
2118
|
+
const { onChange, format, ...other } = props;
|
|
2119
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
2120
|
+
import_react_imask.IMaskInput,
|
|
2121
|
+
{
|
|
2122
|
+
...other,
|
|
2123
|
+
inputRef: ref,
|
|
2124
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
2125
|
+
mask: Date,
|
|
2126
|
+
pattern: formatToPattern(format),
|
|
2127
|
+
blocks: {
|
|
2128
|
+
D: {
|
|
2129
|
+
mask: import_react_imask.IMask.MaskedRange,
|
|
2130
|
+
from: 1,
|
|
2131
|
+
to: 31,
|
|
2132
|
+
maxLength: 2
|
|
2133
|
+
},
|
|
2134
|
+
M: {
|
|
2135
|
+
mask: import_react_imask.IMask.MaskedRange,
|
|
2136
|
+
from: 1,
|
|
2137
|
+
to: 12,
|
|
2138
|
+
maxLength: 2
|
|
2356
2139
|
},
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2140
|
+
Y: {
|
|
2141
|
+
mask: import_react_imask.IMask.MaskedRange,
|
|
2142
|
+
from: 1900,
|
|
2143
|
+
to: 9999,
|
|
2144
|
+
maxLength: 4
|
|
2145
|
+
}
|
|
2146
|
+
},
|
|
2147
|
+
format: (date) => formatValueString(date, format),
|
|
2148
|
+
parse: (str) => parseDate(str, format),
|
|
2149
|
+
autofix: "pad",
|
|
2150
|
+
overwrite: true
|
|
2151
|
+
}
|
|
2152
|
+
);
|
|
2153
|
+
});
|
|
2154
|
+
var DatePicker = (0, import_react19.forwardRef)((inProps, ref) => {
|
|
2155
|
+
const props = (0, import_joy27.useThemeProps)({ props: inProps, name: "DatePicker" });
|
|
2156
|
+
const {
|
|
2157
|
+
onChange,
|
|
2158
|
+
disabled,
|
|
2159
|
+
label,
|
|
2160
|
+
error,
|
|
2161
|
+
helperText,
|
|
2162
|
+
minDate,
|
|
2163
|
+
maxDate,
|
|
2164
|
+
disableFuture,
|
|
2165
|
+
disablePast,
|
|
2166
|
+
required,
|
|
2167
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
2168
|
+
sx,
|
|
2169
|
+
className,
|
|
2170
|
+
format = "YYYY/MM/DD",
|
|
2171
|
+
displayFormat = "YYYY/MM/DD",
|
|
2172
|
+
size,
|
|
2173
|
+
inputReadOnly,
|
|
2174
|
+
hideClearButton,
|
|
2175
|
+
readOnly,
|
|
2176
|
+
shouldDisableDate,
|
|
2177
|
+
...innerProps
|
|
2178
|
+
} = props;
|
|
2179
|
+
const innerRef = (0, import_react19.useRef)(null);
|
|
2180
|
+
const buttonRef = (0, import_react19.useRef)(null);
|
|
2181
|
+
const [value, setValue] = useControlledState(
|
|
2182
|
+
props.value,
|
|
2183
|
+
props.defaultValue || "",
|
|
2184
|
+
(0, import_react19.useCallback)((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
2185
|
+
);
|
|
2186
|
+
const [displayValue, setDisplayValue] = (0, import_react19.useState)(
|
|
2187
|
+
() => value ? formatValueString(parseDate(value, format), displayFormat) : ""
|
|
2188
|
+
);
|
|
2189
|
+
const [anchorEl, setAnchorEl] = (0, import_react19.useState)(null);
|
|
2190
|
+
const open = Boolean(anchorEl);
|
|
2191
|
+
(0, import_react19.useEffect)(() => {
|
|
2192
|
+
if (!anchorEl) {
|
|
2193
|
+
innerRef.current?.blur();
|
|
2194
|
+
}
|
|
2195
|
+
}, [anchorEl, innerRef]);
|
|
2196
|
+
(0, import_react19.useEffect)(() => {
|
|
2197
|
+
if (value === "") {
|
|
2198
|
+
setDisplayValue("");
|
|
2199
|
+
return;
|
|
2200
|
+
}
|
|
2201
|
+
const formattedValue = formatValueString(parseDate(value, format), displayFormat);
|
|
2202
|
+
if (validValueFormat(formattedValue, displayFormat) && formattedValue !== displayValue) {
|
|
2203
|
+
setDisplayValue(formattedValue);
|
|
2204
|
+
}
|
|
2205
|
+
}, [displayFormat, displayValue, format, value]);
|
|
2206
|
+
(0, import_react19.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
2207
|
+
const handleChange = (0, import_react19.useCallback)(
|
|
2208
|
+
(event) => {
|
|
2209
|
+
const value2 = event.target.value;
|
|
2210
|
+
setDisplayValue(value2 ? formatValueString(parseDate(value2, format), displayFormat) : value2);
|
|
2211
|
+
setValue(value2);
|
|
2212
|
+
},
|
|
2213
|
+
[displayFormat, format, setValue]
|
|
2214
|
+
);
|
|
2215
|
+
const handleDisplayInputChange = (0, import_react19.useCallback)(
|
|
2216
|
+
(event) => {
|
|
2217
|
+
if (event.target.value === "") {
|
|
2218
|
+
handleChange({
|
|
2219
|
+
target: {
|
|
2220
|
+
name: props.name,
|
|
2221
|
+
value: ""
|
|
2222
|
+
}
|
|
2223
|
+
});
|
|
2224
|
+
return;
|
|
2361
2225
|
}
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
);
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2226
|
+
const isValidDisplayValue = validValueFormat(event.target.value, displayFormat);
|
|
2227
|
+
if (isValidDisplayValue) {
|
|
2228
|
+
const parsedDate = parseDate(event.target.value, displayFormat);
|
|
2229
|
+
const formattedValue = formatValueString(parsedDate, format);
|
|
2230
|
+
handleChange({
|
|
2231
|
+
target: {
|
|
2232
|
+
name: props.name,
|
|
2233
|
+
value: formattedValue
|
|
2234
|
+
}
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
},
|
|
2238
|
+
[displayFormat, format, handleChange, props.name]
|
|
2239
|
+
);
|
|
2240
|
+
const handleCalendarToggle = (0, import_react19.useCallback)(
|
|
2241
|
+
(event) => {
|
|
2242
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2243
|
+
setTimeout(() => {
|
|
2244
|
+
innerRef.current?.focus();
|
|
2245
|
+
}, 0);
|
|
2246
|
+
},
|
|
2247
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
2248
|
+
);
|
|
2249
|
+
const handleInputMouseDown = (0, import_react19.useCallback)(
|
|
2250
|
+
(event) => {
|
|
2251
|
+
if (inputReadOnly) {
|
|
2252
|
+
event.preventDefault();
|
|
2253
|
+
buttonRef.current?.focus();
|
|
2254
|
+
}
|
|
2255
|
+
},
|
|
2256
|
+
[inputReadOnly, buttonRef]
|
|
2257
|
+
);
|
|
2258
|
+
return /* @__PURE__ */ import_react19.default.createElement(DatePickerRoot, null, /* @__PURE__ */ import_react19.default.createElement(import_base2.FocusTrap, { open: true }, /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement(
|
|
2259
|
+
Input_default,
|
|
2260
|
+
{
|
|
2261
|
+
...innerProps,
|
|
2262
|
+
color: error ? "danger" : innerProps.color,
|
|
2263
|
+
ref: innerRef,
|
|
2264
|
+
size,
|
|
2265
|
+
value: displayValue,
|
|
2266
|
+
onChange: handleDisplayInputChange,
|
|
2267
|
+
placeholder: displayFormat,
|
|
2370
2268
|
disabled,
|
|
2371
|
-
label,
|
|
2372
|
-
error,
|
|
2373
|
-
helperText,
|
|
2374
|
-
minDate,
|
|
2375
|
-
maxDate,
|
|
2376
|
-
disableFuture,
|
|
2377
|
-
disablePast,
|
|
2378
2269
|
required,
|
|
2379
|
-
|
|
2380
|
-
|
|
2270
|
+
error,
|
|
2271
|
+
slotProps: {
|
|
2272
|
+
input: {
|
|
2273
|
+
component: TextMaskAdapter3,
|
|
2274
|
+
ref: innerRef,
|
|
2275
|
+
format: displayFormat,
|
|
2276
|
+
sx: {
|
|
2277
|
+
"&:hover": {
|
|
2278
|
+
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
2279
|
+
}
|
|
2280
|
+
},
|
|
2281
|
+
onMouseDown: handleInputMouseDown
|
|
2282
|
+
}
|
|
2283
|
+
},
|
|
2381
2284
|
className,
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
}
|
|
2416
|
-
const formattedValue = formatValueString(
|
|
2417
|
-
parseDate(value, format),
|
|
2418
|
-
displayFormat
|
|
2419
|
-
);
|
|
2420
|
-
if (validValueFormat(formattedValue, displayFormat) && formattedValue !== displayValue) {
|
|
2421
|
-
setDisplayValue(formattedValue);
|
|
2422
|
-
}
|
|
2423
|
-
}, [displayFormat, displayValue, format, value]);
|
|
2424
|
-
(0, import_react19.useImperativeHandle)(ref, () => innerRef.current, [
|
|
2425
|
-
innerRef
|
|
2426
|
-
]);
|
|
2427
|
-
const handleChange = (0, import_react19.useCallback)(
|
|
2428
|
-
(event) => {
|
|
2429
|
-
const value2 = event.target.value;
|
|
2430
|
-
setDisplayValue(
|
|
2431
|
-
value2 ? formatValueString(parseDate(value2, format), displayFormat) : value2
|
|
2432
|
-
);
|
|
2433
|
-
setValue(value2);
|
|
2434
|
-
},
|
|
2435
|
-
[displayFormat, format, setValue]
|
|
2436
|
-
);
|
|
2437
|
-
const handleDisplayInputChange = (0, import_react19.useCallback)(
|
|
2438
|
-
(event) => {
|
|
2439
|
-
if (event.target.value === "") {
|
|
2440
|
-
handleChange({
|
|
2441
|
-
target: {
|
|
2442
|
-
name: props.name,
|
|
2443
|
-
value: ""
|
|
2444
|
-
}
|
|
2445
|
-
});
|
|
2446
|
-
return;
|
|
2285
|
+
sx,
|
|
2286
|
+
endDecorator: /* @__PURE__ */ import_react19.default.createElement(
|
|
2287
|
+
CalendarButton,
|
|
2288
|
+
{
|
|
2289
|
+
ref: buttonRef,
|
|
2290
|
+
variant: "plain",
|
|
2291
|
+
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
2292
|
+
"aria-label": "Toggle Calendar",
|
|
2293
|
+
"aria-controls": "date-picker-popper",
|
|
2294
|
+
"aria-haspopup": "dialog",
|
|
2295
|
+
"aria-expanded": open,
|
|
2296
|
+
disabled
|
|
2297
|
+
},
|
|
2298
|
+
/* @__PURE__ */ import_react19.default.createElement(import_CalendarToday.default, null)
|
|
2299
|
+
),
|
|
2300
|
+
label,
|
|
2301
|
+
helperText,
|
|
2302
|
+
readOnly: readOnly || inputReadOnly
|
|
2303
|
+
}
|
|
2304
|
+
), open && /* @__PURE__ */ import_react19.default.createElement(import_base2.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2305
|
+
StyledPopper,
|
|
2306
|
+
{
|
|
2307
|
+
id: "date-picker-popper",
|
|
2308
|
+
open: true,
|
|
2309
|
+
anchorEl,
|
|
2310
|
+
placement: "bottom-end",
|
|
2311
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
2312
|
+
modifiers: [
|
|
2313
|
+
{
|
|
2314
|
+
name: "offset",
|
|
2315
|
+
options: {
|
|
2316
|
+
offset: [4, 4]
|
|
2317
|
+
}
|
|
2447
2318
|
}
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2319
|
+
],
|
|
2320
|
+
"aria-label": "Calendar Tooltip",
|
|
2321
|
+
"aria-expanded": open
|
|
2322
|
+
},
|
|
2323
|
+
/* @__PURE__ */ import_react19.default.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2324
|
+
Calendar_default,
|
|
2325
|
+
{
|
|
2326
|
+
value: value && !Number.isNaN(parseDate(value, format).getTime()) ? [parseDate(value, format), void 0] : void 0,
|
|
2327
|
+
onChange: ([date]) => {
|
|
2455
2328
|
handleChange({
|
|
2456
2329
|
target: {
|
|
2457
2330
|
name: props.name,
|
|
2458
|
-
value:
|
|
2331
|
+
value: formatValueString(date, format)
|
|
2459
2332
|
}
|
|
2460
2333
|
});
|
|
2461
|
-
|
|
2462
|
-
},
|
|
2463
|
-
[displayFormat, format, handleChange, props.name]
|
|
2464
|
-
);
|
|
2465
|
-
const handleCalendarToggle = (0, import_react19.useCallback)(
|
|
2466
|
-
(event) => {
|
|
2467
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2468
|
-
setTimeout(() => {
|
|
2469
|
-
innerRef.current?.focus();
|
|
2470
|
-
}, 0);
|
|
2471
|
-
},
|
|
2472
|
-
[anchorEl, setAnchorEl, innerRef]
|
|
2473
|
-
);
|
|
2474
|
-
const handleInputMouseDown = (0, import_react19.useCallback)(
|
|
2475
|
-
(event) => {
|
|
2476
|
-
if (inputReadOnly) {
|
|
2477
|
-
event.preventDefault();
|
|
2478
|
-
buttonRef.current?.focus();
|
|
2479
|
-
}
|
|
2480
|
-
},
|
|
2481
|
-
[inputReadOnly, buttonRef]
|
|
2482
|
-
);
|
|
2483
|
-
return /* @__PURE__ */ import_react19.default.createElement(DatePickerRoot, null, /* @__PURE__ */ import_react19.default.createElement(import_base2.FocusTrap, { open: true }, /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement(
|
|
2484
|
-
Input_default,
|
|
2485
|
-
{
|
|
2486
|
-
...innerProps,
|
|
2487
|
-
color: error ? "danger" : innerProps.color,
|
|
2488
|
-
ref: innerRef,
|
|
2489
|
-
size,
|
|
2490
|
-
value: displayValue,
|
|
2491
|
-
onChange: handleDisplayInputChange,
|
|
2492
|
-
placeholder: displayFormat,
|
|
2493
|
-
disabled,
|
|
2494
|
-
required,
|
|
2495
|
-
error,
|
|
2496
|
-
slotProps: {
|
|
2497
|
-
input: {
|
|
2498
|
-
component: TextMaskAdapter3,
|
|
2499
|
-
ref: innerRef,
|
|
2500
|
-
format: displayFormat,
|
|
2501
|
-
sx: {
|
|
2502
|
-
"&:hover": {
|
|
2503
|
-
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
2504
|
-
}
|
|
2505
|
-
},
|
|
2506
|
-
onMouseDown: handleInputMouseDown
|
|
2507
|
-
}
|
|
2334
|
+
setAnchorEl(null);
|
|
2508
2335
|
},
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
ref: buttonRef,
|
|
2515
|
-
variant: "plain",
|
|
2516
|
-
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
2517
|
-
"aria-label": "Toggle Calendar",
|
|
2518
|
-
"aria-controls": "date-picker-popper",
|
|
2519
|
-
"aria-haspopup": "dialog",
|
|
2520
|
-
"aria-expanded": open,
|
|
2521
|
-
disabled
|
|
2522
|
-
},
|
|
2523
|
-
/* @__PURE__ */ import_react19.default.createElement(import_CalendarToday.default, null)
|
|
2524
|
-
),
|
|
2525
|
-
label,
|
|
2526
|
-
helperText,
|
|
2527
|
-
readOnly: readOnly || inputReadOnly
|
|
2336
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
2337
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
2338
|
+
disableFuture,
|
|
2339
|
+
disablePast,
|
|
2340
|
+
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0
|
|
2528
2341
|
}
|
|
2529
|
-
),
|
|
2530
|
-
|
|
2342
|
+
), !hideClearButton && /* @__PURE__ */ import_react19.default.createElement(
|
|
2343
|
+
DialogActions_default,
|
|
2531
2344
|
{
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
placement: "bottom-end",
|
|
2536
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
2537
|
-
modifiers: [
|
|
2538
|
-
{
|
|
2539
|
-
name: "offset",
|
|
2540
|
-
options: {
|
|
2541
|
-
offset: [4, 4]
|
|
2542
|
-
}
|
|
2543
|
-
}
|
|
2544
|
-
],
|
|
2545
|
-
"aria-label": "Calendar Tooltip",
|
|
2546
|
-
"aria-expanded": open
|
|
2345
|
+
sx: {
|
|
2346
|
+
p: 1
|
|
2347
|
+
}
|
|
2547
2348
|
},
|
|
2548
|
-
/* @__PURE__ */ import_react19.default.createElement(
|
|
2549
|
-
|
|
2349
|
+
/* @__PURE__ */ import_react19.default.createElement(
|
|
2350
|
+
Button_default,
|
|
2550
2351
|
{
|
|
2551
|
-
|
|
2552
|
-
|
|
2352
|
+
size,
|
|
2353
|
+
variant: "plain",
|
|
2354
|
+
color: "neutral",
|
|
2355
|
+
onClick: () => {
|
|
2553
2356
|
handleChange({
|
|
2554
2357
|
target: {
|
|
2555
2358
|
name: props.name,
|
|
2556
|
-
value:
|
|
2359
|
+
value: ""
|
|
2557
2360
|
}
|
|
2558
2361
|
});
|
|
2559
2362
|
setAnchorEl(null);
|
|
2560
|
-
},
|
|
2561
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
2562
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
2563
|
-
disableFuture,
|
|
2564
|
-
disablePast,
|
|
2565
|
-
shouldDisableDate: shouldDisableDate ? (date) => shouldDisableDate(formatValueString(date, format)) : void 0
|
|
2566
|
-
}
|
|
2567
|
-
), !hideClearButton && /* @__PURE__ */ import_react19.default.createElement(
|
|
2568
|
-
DialogActions_default,
|
|
2569
|
-
{
|
|
2570
|
-
sx: {
|
|
2571
|
-
p: 1
|
|
2572
2363
|
}
|
|
2573
2364
|
},
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
color: "neutral",
|
|
2580
|
-
onClick: () => {
|
|
2581
|
-
handleChange({
|
|
2582
|
-
target: {
|
|
2583
|
-
name: props.name,
|
|
2584
|
-
value: ""
|
|
2585
|
-
}
|
|
2586
|
-
});
|
|
2587
|
-
setAnchorEl(null);
|
|
2588
|
-
}
|
|
2589
|
-
},
|
|
2590
|
-
"Clear"
|
|
2591
|
-
)
|
|
2592
|
-
))
|
|
2593
|
-
)))));
|
|
2594
|
-
}
|
|
2595
|
-
);
|
|
2365
|
+
"Clear"
|
|
2366
|
+
)
|
|
2367
|
+
))
|
|
2368
|
+
)))));
|
|
2369
|
+
});
|
|
2596
2370
|
|
|
2597
2371
|
// src/components/DatePicker/index.ts
|
|
2598
2372
|
var DatePicker_default = DatePicker;
|
|
@@ -2825,18 +2599,9 @@ function Pagination(props) {
|
|
|
2825
2599
|
setPaginationModel({ ...paginationModel, page: newPage });
|
|
2826
2600
|
};
|
|
2827
2601
|
const firstPage = 1;
|
|
2828
|
-
const lastPage = Math.max(
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
);
|
|
2832
|
-
const beforePages = [
|
|
2833
|
-
paginationModel.page - 2,
|
|
2834
|
-
paginationModel.page - 1
|
|
2835
|
-
].filter((p) => p > 1);
|
|
2836
|
-
const afterPages = [
|
|
2837
|
-
paginationModel.page + 1,
|
|
2838
|
-
paginationModel.page + 2
|
|
2839
|
-
].filter((p) => p <= lastPage - 1);
|
|
2602
|
+
const lastPage = Math.max(firstPage, Math.ceil(rowCount / paginationModel.pageSize));
|
|
2603
|
+
const beforePages = [paginationModel.page - 2, paginationModel.page - 1].filter((p) => p > 1);
|
|
2604
|
+
const afterPages = [paginationModel.page + 1, paginationModel.page + 2].filter((p) => p <= lastPage - 1);
|
|
2840
2605
|
const isMoreAfterPages = lastPage > 1 && paginationModel.page < lastPage - 3;
|
|
2841
2606
|
const isMoreBeforePages = lastPage > 1 && paginationModel.page > 4;
|
|
2842
2607
|
(0, import_react23.useEffect)(() => {
|
|
@@ -2855,16 +2620,7 @@ function Pagination(props) {
|
|
|
2855
2620
|
"aria-label": "Previous page"
|
|
2856
2621
|
},
|
|
2857
2622
|
/* @__PURE__ */ import_react23.default.createElement(import_ChevronLeft2.default, null)
|
|
2858
|
-
), paginationModel.page !== firstPage && /* @__PURE__ */ import_react23.default.createElement(
|
|
2859
|
-
PaginationButton,
|
|
2860
|
-
{
|
|
2861
|
-
size,
|
|
2862
|
-
variant: "plain",
|
|
2863
|
-
color: "neutral",
|
|
2864
|
-
onClick: () => handlePageChange(firstPage)
|
|
2865
|
-
},
|
|
2866
|
-
firstPage
|
|
2867
|
-
), isMoreBeforePages && /* @__PURE__ */ import_react23.default.createElement(
|
|
2623
|
+
), paginationModel.page !== firstPage && /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(firstPage) }, firstPage), isMoreBeforePages && /* @__PURE__ */ import_react23.default.createElement(
|
|
2868
2624
|
PaginationButton,
|
|
2869
2625
|
{
|
|
2870
2626
|
size,
|
|
@@ -2874,27 +2630,7 @@ function Pagination(props) {
|
|
|
2874
2630
|
"aria-label": "More previous pages"
|
|
2875
2631
|
},
|
|
2876
2632
|
"..."
|
|
2877
|
-
), beforePages.map((p) => /* @__PURE__ */ import_react23.default.createElement(
|
|
2878
|
-
PaginationButton,
|
|
2879
|
-
{
|
|
2880
|
-
key: p,
|
|
2881
|
-
size,
|
|
2882
|
-
variant: "plain",
|
|
2883
|
-
color: "neutral",
|
|
2884
|
-
onClick: () => handlePageChange(p)
|
|
2885
|
-
},
|
|
2886
|
-
p
|
|
2887
|
-
)), /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { active: "true", size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ import_react23.default.createElement(
|
|
2888
|
-
PaginationButton,
|
|
2889
|
-
{
|
|
2890
|
-
key: p,
|
|
2891
|
-
size,
|
|
2892
|
-
variant: "plain",
|
|
2893
|
-
color: "neutral",
|
|
2894
|
-
onClick: () => handlePageChange(p)
|
|
2895
|
-
},
|
|
2896
|
-
p
|
|
2897
|
-
)), isMoreAfterPages && /* @__PURE__ */ import_react23.default.createElement(
|
|
2633
|
+
), beforePages.map((p) => /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { active: "true", size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { key: p, size, variant: "plain", color: "neutral", onClick: () => handlePageChange(p) }, p)), isMoreAfterPages && /* @__PURE__ */ import_react23.default.createElement(
|
|
2898
2634
|
PaginationButton,
|
|
2899
2635
|
{
|
|
2900
2636
|
size,
|
|
@@ -2904,16 +2640,7 @@ function Pagination(props) {
|
|
|
2904
2640
|
onClick: () => handlePageChange(paginationModel.page + 3)
|
|
2905
2641
|
},
|
|
2906
2642
|
"..."
|
|
2907
|
-
), paginationModel.page !== lastPage && /* @__PURE__ */ import_react23.default.createElement(
|
|
2908
|
-
PaginationButton,
|
|
2909
|
-
{
|
|
2910
|
-
size,
|
|
2911
|
-
variant: "plain",
|
|
2912
|
-
color: "neutral",
|
|
2913
|
-
onClick: () => handlePageChange(lastPage)
|
|
2914
|
-
},
|
|
2915
|
-
lastPage
|
|
2916
|
-
), /* @__PURE__ */ import_react23.default.createElement(
|
|
2643
|
+
), paginationModel.page !== lastPage && /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { size, variant: "plain", color: "neutral", onClick: () => handlePageChange(lastPage) }, lastPage), /* @__PURE__ */ import_react23.default.createElement(
|
|
2917
2644
|
PaginationIconButton,
|
|
2918
2645
|
{
|
|
2919
2646
|
size,
|
|
@@ -2965,6 +2692,118 @@ function InfoSign(props) {
|
|
|
2965
2692
|
var InfoSign_default = InfoSign;
|
|
2966
2693
|
|
|
2967
2694
|
// src/components/DataTable/DataTable.tsx
|
|
2695
|
+
function extractFieldsFromGroupingModel(items) {
|
|
2696
|
+
const fields = /* @__PURE__ */ new Set();
|
|
2697
|
+
for (const item of items) {
|
|
2698
|
+
if ("groupId" in item) {
|
|
2699
|
+
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
2700
|
+
const childFields = extractFieldsFromGroupingModel(children);
|
|
2701
|
+
childFields.forEach((field) => fields.add(field));
|
|
2702
|
+
} else {
|
|
2703
|
+
fields.add(item.field);
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
return fields;
|
|
2707
|
+
}
|
|
2708
|
+
function reorderColumnsByGroupingModel(columns, columnGroupingModel) {
|
|
2709
|
+
const fieldsInGroupingModel = extractFieldsFromGroupingModel(columnGroupingModel);
|
|
2710
|
+
const orderedFields = [];
|
|
2711
|
+
function collectFieldsInOrder(items) {
|
|
2712
|
+
for (const item of items) {
|
|
2713
|
+
if ("groupId" in item) {
|
|
2714
|
+
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
2715
|
+
collectFieldsInOrder(children);
|
|
2716
|
+
} else {
|
|
2717
|
+
if (!orderedFields.includes(item.field)) {
|
|
2718
|
+
orderedFields.push(item.field);
|
|
2719
|
+
}
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
collectFieldsInOrder(columnGroupingModel);
|
|
2724
|
+
const columnMap = new Map(columns.map((col) => [col.field, col]));
|
|
2725
|
+
const reorderedColumns = [];
|
|
2726
|
+
for (const field of orderedFields) {
|
|
2727
|
+
const column = columnMap.get(field);
|
|
2728
|
+
if (column) {
|
|
2729
|
+
reorderedColumns.push(column);
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
for (const column of columns) {
|
|
2733
|
+
if (!fieldsInGroupingModel.has(column.field)) {
|
|
2734
|
+
reorderedColumns.push(column);
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
return reorderedColumns;
|
|
2738
|
+
}
|
|
2739
|
+
function flattenColumnGroups(items, groupPath = [], columnIndex = { current: 0 }) {
|
|
2740
|
+
const result = [];
|
|
2741
|
+
for (const item of items) {
|
|
2742
|
+
if ("groupId" in item) {
|
|
2743
|
+
const newPath = [...groupPath, item.groupId];
|
|
2744
|
+
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
2745
|
+
result.push(...flattenColumnGroups(children, newPath, columnIndex));
|
|
2746
|
+
} else {
|
|
2747
|
+
result.push({
|
|
2748
|
+
...item,
|
|
2749
|
+
groupPath,
|
|
2750
|
+
columnIndex: columnIndex.current++
|
|
2751
|
+
});
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
return result;
|
|
2755
|
+
}
|
|
2756
|
+
function calculateColumnGroups(columnGroupingModel, columns) {
|
|
2757
|
+
const fieldsInGroupingModel = extractFieldsFromGroupingModel(columnGroupingModel);
|
|
2758
|
+
const flattenedColumns = flattenColumnGroups(columnGroupingModel);
|
|
2759
|
+
const columnIndexMap = new Map(flattenedColumns.map((col) => [col.field, col.columnIndex]));
|
|
2760
|
+
const processedGroups = /* @__PURE__ */ new Map();
|
|
2761
|
+
const groupsByLevel = [];
|
|
2762
|
+
let maxLevel = 0;
|
|
2763
|
+
function processGroup(items, level, parentGroupId) {
|
|
2764
|
+
let minIndex = Infinity;
|
|
2765
|
+
let maxIndex = -Infinity;
|
|
2766
|
+
for (const item of items) {
|
|
2767
|
+
if ("groupId" in item) {
|
|
2768
|
+
const groupKey = parentGroupId ? `${parentGroupId}.${item.groupId}` : item.groupId;
|
|
2769
|
+
if (!processedGroups.has(groupKey)) {
|
|
2770
|
+
const children = Array.isArray(item.children) ? item.children : [item.children];
|
|
2771
|
+
const { startIndex, colspan } = processGroup(children, level + 1, groupKey);
|
|
2772
|
+
const group = {
|
|
2773
|
+
groupId: item.groupId,
|
|
2774
|
+
headerName: item.headerName,
|
|
2775
|
+
colspan,
|
|
2776
|
+
level,
|
|
2777
|
+
startIndex
|
|
2778
|
+
};
|
|
2779
|
+
processedGroups.set(groupKey, group);
|
|
2780
|
+
if (!groupsByLevel[level]) {
|
|
2781
|
+
groupsByLevel[level] = [];
|
|
2782
|
+
}
|
|
2783
|
+
groupsByLevel[level].push(group);
|
|
2784
|
+
maxLevel = Math.max(maxLevel, level);
|
|
2785
|
+
minIndex = Math.min(minIndex, startIndex);
|
|
2786
|
+
maxIndex = Math.max(maxIndex, startIndex + colspan - 1);
|
|
2787
|
+
}
|
|
2788
|
+
} else {
|
|
2789
|
+
const columnIndex = columnIndexMap.get(item.field);
|
|
2790
|
+
if (columnIndex !== void 0) {
|
|
2791
|
+
minIndex = Math.min(minIndex, columnIndex);
|
|
2792
|
+
maxIndex = Math.max(maxIndex, columnIndex);
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
return {
|
|
2797
|
+
startIndex: minIndex === Infinity ? 0 : minIndex,
|
|
2798
|
+
colspan: maxIndex === -Infinity ? 0 : maxIndex - minIndex + 1
|
|
2799
|
+
};
|
|
2800
|
+
}
|
|
2801
|
+
processGroup(columnGroupingModel, 0);
|
|
2802
|
+
groupsByLevel.forEach((level) => {
|
|
2803
|
+
level.sort((a, b) => a.startIndex - b.startIndex);
|
|
2804
|
+
});
|
|
2805
|
+
return { groups: groupsByLevel, maxLevel, fieldsInGroupingModel };
|
|
2806
|
+
}
|
|
2968
2807
|
function getTextAlign(props) {
|
|
2969
2808
|
return !props.editMode && ["number", "date", "currency"].includes(props.type || "") ? "end" : "start";
|
|
2970
2809
|
}
|
|
@@ -2989,15 +2828,7 @@ var TextEllipsis = ({ children }) => {
|
|
|
2989
2828
|
}, [children]);
|
|
2990
2829
|
const content = /* @__PURE__ */ import_react25.default.createElement(EllipsisDiv, { ref: textRef }, children);
|
|
2991
2830
|
if (showTooltip) {
|
|
2992
|
-
return /* @__PURE__ */ import_react25.default.createElement(
|
|
2993
|
-
Tooltip_default,
|
|
2994
|
-
{
|
|
2995
|
-
title: children,
|
|
2996
|
-
placement: "top",
|
|
2997
|
-
onClick: (e) => e.stopPropagation()
|
|
2998
|
-
},
|
|
2999
|
-
content
|
|
3000
|
-
);
|
|
2831
|
+
return /* @__PURE__ */ import_react25.default.createElement(Tooltip_default, { title: children, placement: "top", onClick: (e) => e.stopPropagation() }, content);
|
|
3001
2832
|
}
|
|
3002
2833
|
return content;
|
|
3003
2834
|
};
|
|
@@ -3043,7 +2874,7 @@ var OverlayWrapper = (0, import_joy33.styled)("tr", {
|
|
|
3043
2874
|
}
|
|
3044
2875
|
});
|
|
3045
2876
|
var numberFormatter = (value) => "Intl" in window ? new Intl.NumberFormat().format(value) : value;
|
|
3046
|
-
var Resizer = (ref) => /* @__PURE__ */ import_react25.default.createElement(
|
|
2877
|
+
var Resizer = (ref, targetRef = ref) => /* @__PURE__ */ import_react25.default.createElement(
|
|
3047
2878
|
Box_default,
|
|
3048
2879
|
{
|
|
3049
2880
|
sx: {
|
|
@@ -3061,6 +2892,7 @@ var Resizer = (ref) => /* @__PURE__ */ import_react25.default.createElement(
|
|
|
3061
2892
|
const onMouseMove = (e2) => {
|
|
3062
2893
|
if (initialWidth && initialX) {
|
|
3063
2894
|
ref.current.style.width = `${initialWidth + (e2.clientX - initialX)}px`;
|
|
2895
|
+
targetRef.current.style.width = `${initialWidth + (e2.clientX - initialX)}px`;
|
|
3064
2896
|
}
|
|
3065
2897
|
};
|
|
3066
2898
|
const onMouseUp = () => {
|
|
@@ -3171,20 +3003,19 @@ var HeadCell = (props) => {
|
|
|
3171
3003
|
isPinned,
|
|
3172
3004
|
pinnedStartPosition,
|
|
3173
3005
|
pinnedEndPosition,
|
|
3174
|
-
headerRef
|
|
3006
|
+
headerRef,
|
|
3007
|
+
tableColRef
|
|
3175
3008
|
} = props;
|
|
3176
3009
|
const theme = (0, import_joy33.useTheme)();
|
|
3177
3010
|
const ref = headerRef;
|
|
3011
|
+
const colRef = tableColRef;
|
|
3178
3012
|
const [isHovered, setIsHovered] = (0, import_react25.useState)(false);
|
|
3179
3013
|
const sortable = type === "actions" ? false : _sortable;
|
|
3180
3014
|
const headId = (0, import_react25.useMemo)(
|
|
3181
3015
|
() => `${tableId}_header_${headerName ?? field}`.trim(),
|
|
3182
3016
|
[tableId, headerName, field]
|
|
3183
3017
|
);
|
|
3184
|
-
const resizer = (0, import_react25.useMemo)(
|
|
3185
|
-
() => resizable ?? true ? Resizer(ref) : null,
|
|
3186
|
-
[resizable, ref]
|
|
3187
|
-
);
|
|
3018
|
+
const resizer = (0, import_react25.useMemo)(() => resizable ?? true ? Resizer(ref, colRef) : null, [resizable, ref, colRef]);
|
|
3188
3019
|
const style = (0, import_react25.useMemo)(
|
|
3189
3020
|
() => ({
|
|
3190
3021
|
width,
|
|
@@ -3199,17 +3030,7 @@ var HeadCell = (props) => {
|
|
|
3199
3030
|
// TODO: multi-sort때문에 일단 추가한 property, joy-ui에서는 multi-sort시 th에 user-select: none을 적용하고 툴팁을 띄워준다.
|
|
3200
3031
|
userSelect: "none"
|
|
3201
3032
|
}),
|
|
3202
|
-
[
|
|
3203
|
-
isPinned,
|
|
3204
|
-
maxWidth,
|
|
3205
|
-
minWidth,
|
|
3206
|
-
pinnedEndPosition,
|
|
3207
|
-
pinnedStartPosition,
|
|
3208
|
-
sortable,
|
|
3209
|
-
stickyHeader,
|
|
3210
|
-
theme,
|
|
3211
|
-
width
|
|
3212
|
-
]
|
|
3033
|
+
[isPinned, maxWidth, minWidth, pinnedEndPosition, pinnedStartPosition, sortable, stickyHeader, theme, width]
|
|
3213
3034
|
);
|
|
3214
3035
|
const textAlign = getTextAlign(props);
|
|
3215
3036
|
const initialSort = sortOrder[0];
|
|
@@ -3266,20 +3087,7 @@ var HeadCell = (props) => {
|
|
|
3266
3087
|
whileHover: "hover",
|
|
3267
3088
|
initial: "initial"
|
|
3268
3089
|
},
|
|
3269
|
-
/* @__PURE__ */ import_react25.default.createElement(
|
|
3270
|
-
Stack_default,
|
|
3271
|
-
{
|
|
3272
|
-
gap: 1,
|
|
3273
|
-
direction: "row",
|
|
3274
|
-
justifyContent: textAlign,
|
|
3275
|
-
alignItems: "center"
|
|
3276
|
-
},
|
|
3277
|
-
textAlign === "end" && sortIcon,
|
|
3278
|
-
textAlign === "end" && infoSign,
|
|
3279
|
-
/* @__PURE__ */ import_react25.default.createElement(TextEllipsis, null, headerName ?? field, editMode && required && /* @__PURE__ */ import_react25.default.createElement(Asterisk, null, "*")),
|
|
3280
|
-
textAlign === "start" && infoSign,
|
|
3281
|
-
textAlign === "start" && sortIcon
|
|
3282
|
-
),
|
|
3090
|
+
/* @__PURE__ */ import_react25.default.createElement(Stack_default, { gap: 1, direction: "row", justifyContent: textAlign, alignItems: "center" }, textAlign === "end" && sortIcon, textAlign === "end" && infoSign, /* @__PURE__ */ import_react25.default.createElement(TextEllipsis, null, headerName ?? field, editMode && required && /* @__PURE__ */ import_react25.default.createElement(Asterisk, null, "*")), textAlign === "start" && infoSign, textAlign === "start" && sortIcon),
|
|
3283
3091
|
resizer
|
|
3284
3092
|
);
|
|
3285
3093
|
};
|
|
@@ -3298,7 +3106,10 @@ var BodyCell = (props) => {
|
|
|
3298
3106
|
pinnedStartPosition,
|
|
3299
3107
|
pinnedEndPosition,
|
|
3300
3108
|
row,
|
|
3301
|
-
rowId
|
|
3109
|
+
rowId,
|
|
3110
|
+
cellClassName,
|
|
3111
|
+
onCellEditStart,
|
|
3112
|
+
onCellEditStop
|
|
3302
3113
|
} = props;
|
|
3303
3114
|
const theme = (0, import_joy33.useTheme)();
|
|
3304
3115
|
const [value, setValue] = (0, import_react25.useState)(row[field]);
|
|
@@ -3307,20 +3118,22 @@ var BodyCell = (props) => {
|
|
|
3307
3118
|
() => ({
|
|
3308
3119
|
row,
|
|
3309
3120
|
value,
|
|
3310
|
-
id: rowId
|
|
3121
|
+
id: rowId,
|
|
3122
|
+
field
|
|
3311
3123
|
}),
|
|
3312
|
-
[row, rowId, value]
|
|
3124
|
+
[row, rowId, value, field]
|
|
3313
3125
|
);
|
|
3314
3126
|
const editMode = (0, import_react25.useMemo)(
|
|
3315
3127
|
() => !!(props.editMode && (typeof isCellEditable === "function" ? isCellEditable(params) : isCellEditable ?? true)),
|
|
3316
3128
|
[props.editMode, isCellEditable, params]
|
|
3317
3129
|
);
|
|
3130
|
+
const propsComponentProps = "componentProps" in props ? props.componentProps : null;
|
|
3318
3131
|
const componentProps = (0, import_react25.useMemo)(
|
|
3319
3132
|
() => ({
|
|
3320
|
-
..."componentProps" in props && (typeof
|
|
3133
|
+
..."componentProps" in props && (typeof propsComponentProps === "function" ? propsComponentProps(params) : propsComponentProps || {}),
|
|
3321
3134
|
size: "sm"
|
|
3322
3135
|
}),
|
|
3323
|
-
[
|
|
3136
|
+
[props, propsComponentProps, params]
|
|
3324
3137
|
);
|
|
3325
3138
|
const editModeComponentProps = (0, import_react25.useMemo)(
|
|
3326
3139
|
() => ({
|
|
@@ -3329,7 +3142,7 @@ var BodyCell = (props) => {
|
|
|
3329
3142
|
componentProps.onChange?.(e);
|
|
3330
3143
|
setValue(e.target.value);
|
|
3331
3144
|
if (type === "select") {
|
|
3332
|
-
|
|
3145
|
+
onCellEditStop?.({
|
|
3333
3146
|
...params,
|
|
3334
3147
|
originalRow: row,
|
|
3335
3148
|
row: {
|
|
@@ -3342,7 +3155,7 @@ var BodyCell = (props) => {
|
|
|
3342
3155
|
},
|
|
3343
3156
|
onFocus: (e) => {
|
|
3344
3157
|
componentProps.onFocus?.(e);
|
|
3345
|
-
|
|
3158
|
+
onCellEditStart?.({
|
|
3346
3159
|
...params,
|
|
3347
3160
|
originalRow: row,
|
|
3348
3161
|
row: {
|
|
@@ -3355,7 +3168,7 @@ var BodyCell = (props) => {
|
|
|
3355
3168
|
onBlur: (e) => {
|
|
3356
3169
|
componentProps.onBlur?.(e);
|
|
3357
3170
|
if (type && ["number", "text", "longText", "currency", "date"].includes(type)) {
|
|
3358
|
-
|
|
3171
|
+
onCellEditStop?.({
|
|
3359
3172
|
...params,
|
|
3360
3173
|
originalRow: row,
|
|
3361
3174
|
row: {
|
|
@@ -3370,7 +3183,7 @@ var BodyCell = (props) => {
|
|
|
3370
3183
|
onChangeComplete: (e) => {
|
|
3371
3184
|
componentProps.onChangeComplete?.(e);
|
|
3372
3185
|
setValue(e.target.value);
|
|
3373
|
-
|
|
3186
|
+
onCellEditStop?.({
|
|
3374
3187
|
...params,
|
|
3375
3188
|
originalRow: row,
|
|
3376
3189
|
row: {
|
|
@@ -3382,29 +3195,14 @@ var BodyCell = (props) => {
|
|
|
3382
3195
|
}
|
|
3383
3196
|
}
|
|
3384
3197
|
}),
|
|
3385
|
-
[
|
|
3386
|
-
params,
|
|
3387
|
-
row,
|
|
3388
|
-
field,
|
|
3389
|
-
value,
|
|
3390
|
-
componentProps,
|
|
3391
|
-
type,
|
|
3392
|
-
props.onCellEditStop,
|
|
3393
|
-
props.onCellEditStart
|
|
3394
|
-
]
|
|
3198
|
+
[params, row, field, value, componentProps, type, onCellEditStop, onCellEditStart]
|
|
3395
3199
|
);
|
|
3396
3200
|
const EditModeComponent = (0, import_react25.useMemo)(() => {
|
|
3397
3201
|
if (renderEditCell) {
|
|
3398
3202
|
return (0, import_react25.createElement)((0, import_react25.memo)(renderEditCell), params);
|
|
3399
3203
|
}
|
|
3400
3204
|
return {
|
|
3401
|
-
date: /* @__PURE__ */ import_react25.default.createElement(
|
|
3402
|
-
DatePicker_default,
|
|
3403
|
-
{
|
|
3404
|
-
value,
|
|
3405
|
-
...editModeComponentProps
|
|
3406
|
-
}
|
|
3407
|
-
),
|
|
3205
|
+
date: /* @__PURE__ */ import_react25.default.createElement(DatePicker_default, { value, ...editModeComponentProps }),
|
|
3408
3206
|
currency: /* @__PURE__ */ import_react25.default.createElement(
|
|
3409
3207
|
CurrencyInput_default,
|
|
3410
3208
|
{
|
|
@@ -3412,29 +3210,9 @@ var BodyCell = (props) => {
|
|
|
3412
3210
|
...editModeComponentProps
|
|
3413
3211
|
}
|
|
3414
3212
|
),
|
|
3415
|
-
number: /* @__PURE__ */ import_react25.default.createElement(
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
value,
|
|
3419
|
-
type: "number",
|
|
3420
|
-
...editModeComponentProps
|
|
3421
|
-
}
|
|
3422
|
-
),
|
|
3423
|
-
text: /* @__PURE__ */ import_react25.default.createElement(
|
|
3424
|
-
Input_default,
|
|
3425
|
-
{
|
|
3426
|
-
value,
|
|
3427
|
-
type: "text",
|
|
3428
|
-
...editModeComponentProps
|
|
3429
|
-
}
|
|
3430
|
-
),
|
|
3431
|
-
longText: /* @__PURE__ */ import_react25.default.createElement(
|
|
3432
|
-
Textarea_default,
|
|
3433
|
-
{
|
|
3434
|
-
value,
|
|
3435
|
-
...editModeComponentProps
|
|
3436
|
-
}
|
|
3437
|
-
),
|
|
3213
|
+
number: /* @__PURE__ */ import_react25.default.createElement(Input_default, { value, type: "number", ...editModeComponentProps }),
|
|
3214
|
+
text: /* @__PURE__ */ import_react25.default.createElement(Input_default, { value, type: "text", ...editModeComponentProps }),
|
|
3215
|
+
longText: /* @__PURE__ */ import_react25.default.createElement(Textarea_default, { value, ...editModeComponentProps }),
|
|
3438
3216
|
autocomplete: /* @__PURE__ */ import_react25.default.createElement(
|
|
3439
3217
|
Autocomplete_default,
|
|
3440
3218
|
{
|
|
@@ -3452,50 +3230,34 @@ var BodyCell = (props) => {
|
|
|
3452
3230
|
}
|
|
3453
3231
|
)
|
|
3454
3232
|
}[type || "text"];
|
|
3455
|
-
}, [value, editModeComponentProps, type]);
|
|
3233
|
+
}, [value, editModeComponentProps, type, renderEditCell, params]);
|
|
3234
|
+
const linkComponentFromProps = props.component;
|
|
3456
3235
|
const ReadModeComponent = (0, import_react25.useMemo)(() => {
|
|
3457
3236
|
if (renderCell) {
|
|
3458
3237
|
return (0, import_react25.createElement)((0, import_react25.memo)(renderCell), params);
|
|
3459
3238
|
}
|
|
3460
3239
|
const innerText = value;
|
|
3461
3240
|
const typedComponent = {
|
|
3462
|
-
link: import_react25.default.createElement(
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
...componentProps
|
|
3467
|
-
}
|
|
3468
|
-
)
|
|
3241
|
+
link: import_react25.default.createElement(linkComponentFromProps || import_joy33.Link, {
|
|
3242
|
+
children: innerText,
|
|
3243
|
+
...componentProps
|
|
3244
|
+
})
|
|
3469
3245
|
}[type || "text"];
|
|
3470
3246
|
return typedComponent || innerText;
|
|
3471
|
-
}, [value, renderCell, params, type, componentProps]);
|
|
3247
|
+
}, [value, renderCell, params, type, componentProps, linkComponentFromProps]);
|
|
3248
|
+
const getActions = props.getActions;
|
|
3472
3249
|
const CellComponent = (0, import_react25.useMemo)(() => {
|
|
3473
3250
|
if (type === "actions") {
|
|
3474
|
-
return /* @__PURE__ */ import_react25.default.createElement(
|
|
3475
|
-
Stack_default,
|
|
3476
|
-
{
|
|
3477
|
-
direction: "row",
|
|
3478
|
-
gap: 1,
|
|
3479
|
-
justifyContent: "center",
|
|
3480
|
-
alignItems: "center"
|
|
3481
|
-
},
|
|
3482
|
-
props.getActions?.(params)
|
|
3483
|
-
);
|
|
3251
|
+
return /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", gap: 1, justifyContent: "center", alignItems: "center" }, getActions?.(params));
|
|
3484
3252
|
}
|
|
3485
3253
|
return editMode && EditModeComponent ? EditModeComponent : ReadModeComponent;
|
|
3486
|
-
}, [
|
|
3487
|
-
|
|
3488
|
-
props.getActions,
|
|
3489
|
-
params,
|
|
3490
|
-
editMode,
|
|
3491
|
-
EditModeComponent,
|
|
3492
|
-
ReadModeComponent
|
|
3493
|
-
]);
|
|
3494
|
-
const showTooltip = (0, import_react25.useMemo)(
|
|
3495
|
-
() => noWrap && type === "longText",
|
|
3496
|
-
[noWrap, type]
|
|
3497
|
-
);
|
|
3254
|
+
}, [type, getActions, params, editMode, EditModeComponent, ReadModeComponent]);
|
|
3255
|
+
const showTooltip = (0, import_react25.useMemo)(() => noWrap && type === "longText", [noWrap, type]);
|
|
3498
3256
|
const isBoundary = props.isLastStartPinnedColumn || props.isLastEndPinnedColumn;
|
|
3257
|
+
const computedCellClassName = (0, import_react25.useMemo)(
|
|
3258
|
+
() => (typeof cellClassName === "function" ? cellClassName(params) : cellClassName) || "",
|
|
3259
|
+
[cellClassName, params]
|
|
3260
|
+
);
|
|
3499
3261
|
(0, import_react25.useEffect)(() => {
|
|
3500
3262
|
setValue(row[field]);
|
|
3501
3263
|
}, [row, field]);
|
|
@@ -3514,11 +3276,11 @@ var BodyCell = (props) => {
|
|
|
3514
3276
|
zIndex: isPinned ? `calc(${theme.getCssVar("zIndex-table")} + ${isBoundary ? 2 : 3})` : void 0,
|
|
3515
3277
|
"--TableCell-dataBackground": isPinned ? `var(--TableCell-headBackground)` : void 0
|
|
3516
3278
|
},
|
|
3517
|
-
className: isLastStartPinnedColumn && "is-last-left"
|
|
3279
|
+
className: [isLastStartPinnedColumn && "is-last-left", isLastEndPinnedColumn && "is-last-right", computedCellClassName].filter(Boolean).join(" ") || ""
|
|
3518
3280
|
},
|
|
3519
3281
|
(0, import_react25.useMemo)(
|
|
3520
3282
|
() => showTooltip ? /* @__PURE__ */ import_react25.default.createElement(CellTextEllipsis, null, CellComponent) : CellComponent,
|
|
3521
|
-
[CellComponent, showTooltip
|
|
3283
|
+
[CellComponent, showTooltip]
|
|
3522
3284
|
)
|
|
3523
3285
|
);
|
|
3524
3286
|
};
|
|
@@ -3588,31 +3350,40 @@ function useDataTableRenderer({
|
|
|
3588
3350
|
editMode,
|
|
3589
3351
|
getId: _getId,
|
|
3590
3352
|
isTotalSelected: _isTotalSelected,
|
|
3591
|
-
isRowSelectable
|
|
3353
|
+
isRowSelectable,
|
|
3354
|
+
columnGroupingModel
|
|
3355
|
+
// Add this prop
|
|
3592
3356
|
}) {
|
|
3357
|
+
if (pinnedColumns && columnGroupingModel) {
|
|
3358
|
+
throw new Error(
|
|
3359
|
+
"You cannot use both `pinnedColumns` and `columnGroupingModel` at the same time. Please choose one of them."
|
|
3360
|
+
);
|
|
3361
|
+
}
|
|
3593
3362
|
const onSelectionModelChangeRef = (0, import_react25.useRef)(onSelectionModelChange);
|
|
3594
3363
|
onSelectionModelChangeRef.current = onSelectionModelChange;
|
|
3595
3364
|
const [focusedRowId, setFocusedRowId] = (0, import_react25.useState)(null);
|
|
3596
3365
|
const [sortModel, setSortModel] = useControlledState(
|
|
3597
3366
|
controlledSortModel,
|
|
3598
3367
|
initialState?.sorting?.sortModel ?? [],
|
|
3599
|
-
(0, import_react25.useCallback)(
|
|
3600
|
-
(sortModel2) => onSortModelChange?.(sortModel2),
|
|
3601
|
-
[onSortModelChange]
|
|
3602
|
-
)
|
|
3368
|
+
(0, import_react25.useCallback)((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3603
3369
|
);
|
|
3370
|
+
const reorderedColumns = (0, import_react25.useMemo)(() => {
|
|
3371
|
+
if (!columnGroupingModel) return columnsProp;
|
|
3372
|
+
return reorderColumnsByGroupingModel(columnsProp, columnGroupingModel);
|
|
3373
|
+
}, [columnsProp, columnGroupingModel]);
|
|
3604
3374
|
const columnsByField = (0, import_react25.useMemo)(
|
|
3605
|
-
() =>
|
|
3375
|
+
() => reorderedColumns.reduce(
|
|
3606
3376
|
(acc, curr) => ({
|
|
3607
3377
|
...acc,
|
|
3608
3378
|
[curr.field]: {
|
|
3609
3379
|
...curr,
|
|
3610
|
-
headerRef: import_react25.default.createRef()
|
|
3380
|
+
headerRef: import_react25.default.createRef(),
|
|
3381
|
+
tableColRef: import_react25.default.createRef()
|
|
3611
3382
|
}
|
|
3612
3383
|
}),
|
|
3613
3384
|
{}
|
|
3614
3385
|
),
|
|
3615
|
-
[
|
|
3386
|
+
[reorderedColumns]
|
|
3616
3387
|
);
|
|
3617
3388
|
const sortComparator = (0, import_react25.useCallback)(
|
|
3618
3389
|
(rowA, rowB) => {
|
|
@@ -3674,9 +3445,7 @@ function useDataTableRenderer({
|
|
|
3674
3445
|
[dataInPage, isRowSelectable, getId]
|
|
3675
3446
|
);
|
|
3676
3447
|
const isAllSelected = (0, import_react25.useMemo)(
|
|
3677
|
-
() => selectableDataInPage.length > 0 && selectableDataInPage.every(
|
|
3678
|
-
(row, i) => selectedModelSet.has(getId(row, i))
|
|
3679
|
-
),
|
|
3448
|
+
() => selectableDataInPage.length > 0 && selectableDataInPage.every((row, i) => selectedModelSet.has(getId(row, i))),
|
|
3680
3449
|
[selectableDataInPage, selectedModelSet, getId]
|
|
3681
3450
|
);
|
|
3682
3451
|
const rowCount = totalRowsProp || rows.length;
|
|
@@ -3694,22 +3463,25 @@ function useDataTableRenderer({
|
|
|
3694
3463
|
columnsByField[f].minWidth ?? 0,
|
|
3695
3464
|
[columnWidths, columnsByField]
|
|
3696
3465
|
);
|
|
3466
|
+
const processedColumnGroups = (0, import_react25.useMemo)(() => {
|
|
3467
|
+
if (!columnGroupingModel) return null;
|
|
3468
|
+
return calculateColumnGroups(columnGroupingModel, reorderedColumns);
|
|
3469
|
+
}, [columnGroupingModel, reorderedColumns]);
|
|
3697
3470
|
const columns = (0, import_react25.useMemo)(() => {
|
|
3698
|
-
const baseColumns =
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3471
|
+
const baseColumns = reorderedColumns.length > 0 ? reorderedColumns : (
|
|
3472
|
+
// fallback
|
|
3473
|
+
Object.keys(rows[0] || {}).map((key) => ({
|
|
3474
|
+
field: key
|
|
3475
|
+
}))
|
|
3476
|
+
);
|
|
3702
3477
|
return baseColumns.map((column) => {
|
|
3703
|
-
const isLeftPinned = pinnedColumns?.left?.includes(
|
|
3704
|
-
|
|
3705
|
-
);
|
|
3706
|
-
const isRightPinned = pinnedColumns?.right?.includes(
|
|
3707
|
-
column.field
|
|
3708
|
-
);
|
|
3478
|
+
const isLeftPinned = pinnedColumns?.left?.includes(column.field);
|
|
3479
|
+
const isRightPinned = pinnedColumns?.right?.includes(column.field);
|
|
3709
3480
|
const isPinned = isLeftPinned || isRightPinned;
|
|
3710
3481
|
return {
|
|
3711
3482
|
...column,
|
|
3712
3483
|
headerRef: columnsByField[column.field].headerRef,
|
|
3484
|
+
tableColRef: columnsByField[column.field].tableColRef,
|
|
3713
3485
|
isCellEditable: editMode && (typeof column.isCellEditable === "function" ? column.isCellEditable : column.isCellEditable ?? true),
|
|
3714
3486
|
sort: sortModel.find((sort) => sort.field === column.field)?.sort,
|
|
3715
3487
|
sortOrder: columnsByField[column.field]?.sortOrder || sortOrder,
|
|
@@ -3717,17 +3489,12 @@ function useDataTableRenderer({
|
|
|
3717
3489
|
isLastStartPinnedColumn: isLeftPinned && [...pinnedColumns?.left || []].pop() === column.field,
|
|
3718
3490
|
isLastEndPinnedColumn: isRightPinned && (pinnedColumns?.right?.[0] ?? null) === column.field,
|
|
3719
3491
|
// pinned 관련 계산부
|
|
3720
|
-
pinnedStartPosition: pinnedColumns?.left?.slice(
|
|
3721
|
-
|
|
3722
|
-
isLeftPinned ? pinnedColumns.left.indexOf(column.field) : pinnedColumns.left.length
|
|
3723
|
-
).reduce((acc, curr) => acc + getWidth(curr), 0),
|
|
3724
|
-
pinnedEndPosition: pinnedColumns?.right?.slice(
|
|
3725
|
-
isRightPinned ? pinnedColumns.right.indexOf(column.field) + 1 : 0
|
|
3726
|
-
).reduce((acc, curr) => acc + getWidth(curr), 0)
|
|
3492
|
+
pinnedStartPosition: pinnedColumns?.left?.slice(0, isLeftPinned ? pinnedColumns.left.indexOf(column.field) : pinnedColumns.left.length).reduce((acc, curr) => acc + getWidth(curr), 0),
|
|
3493
|
+
pinnedEndPosition: pinnedColumns?.right?.slice(isRightPinned ? pinnedColumns.right.indexOf(column.field) + 1 : 0).reduce((acc, curr) => acc + getWidth(curr), 0)
|
|
3727
3494
|
};
|
|
3728
3495
|
});
|
|
3729
3496
|
}, [
|
|
3730
|
-
|
|
3497
|
+
reorderedColumns,
|
|
3731
3498
|
rows,
|
|
3732
3499
|
pinnedColumns?.left,
|
|
3733
3500
|
pinnedColumns?.right,
|
|
@@ -3758,9 +3525,7 @@ function useDataTableRenderer({
|
|
|
3758
3525
|
setSortModel(newSortModel2);
|
|
3759
3526
|
return;
|
|
3760
3527
|
}
|
|
3761
|
-
const newSortModel = multiple ? sortModel.map(
|
|
3762
|
-
(model) => model.field === field ? { field, sort: nextSortOrder } : model
|
|
3763
|
-
) : [{ field, sort: nextSortOrder }];
|
|
3528
|
+
const newSortModel = multiple ? sortModel.map((model) => model.field === field ? { field, sort: nextSortOrder } : model) : [{ field, sort: nextSortOrder }];
|
|
3764
3529
|
setSortModel(newSortModel);
|
|
3765
3530
|
} else {
|
|
3766
3531
|
const newSortModel = multiple ? [...sortModel, { field, sort: columnSortOrder[0] }] : [{ field, sort: columnSortOrder[0] }];
|
|
@@ -3797,10 +3562,7 @@ function useDataTableRenderer({
|
|
|
3797
3562
|
isAllSelected,
|
|
3798
3563
|
// all rows are selected on this page
|
|
3799
3564
|
isTotalSelected,
|
|
3800
|
-
isSelectedRow: (0, import_react25.useCallback)(
|
|
3801
|
-
(model) => selectedModelSet.has(model),
|
|
3802
|
-
[selectedModelSet]
|
|
3803
|
-
),
|
|
3565
|
+
isSelectedRow: (0, import_react25.useCallback)((model) => selectedModelSet.has(model), [selectedModelSet]),
|
|
3804
3566
|
isRowSelectable: (0, import_react25.useCallback)(
|
|
3805
3567
|
(rowId, row) => {
|
|
3806
3568
|
if (!isRowSelectable) return true;
|
|
@@ -3813,16 +3575,12 @@ function useDataTableRenderer({
|
|
|
3813
3575
|
setFocusedRowId(rowId);
|
|
3814
3576
|
}, []),
|
|
3815
3577
|
onAllCheckboxChange: (0, import_react25.useCallback)(() => {
|
|
3816
|
-
onSelectionModelChange?.(
|
|
3817
|
-
isAllSelected ? [] : selectableDataInPage.map(getId)
|
|
3818
|
-
);
|
|
3578
|
+
onSelectionModelChange?.(isAllSelected ? [] : selectableDataInPage.map(getId));
|
|
3819
3579
|
}, [isAllSelected, selectableDataInPage, onSelectionModelChange, getId]),
|
|
3820
3580
|
onCheckboxChange: (0, import_react25.useCallback)(
|
|
3821
3581
|
(event, selectedModel) => {
|
|
3822
3582
|
if (selectedModelSet.has(selectedModel)) {
|
|
3823
|
-
const newSelectionModel = (selectionModel || []).filter(
|
|
3824
|
-
(model) => model !== selectedModel
|
|
3825
|
-
);
|
|
3583
|
+
const newSelectionModel = (selectionModel || []).filter((model) => model !== selectedModel);
|
|
3826
3584
|
onSelectionModelChange?.(newSelectionModel);
|
|
3827
3585
|
} else {
|
|
3828
3586
|
const newSelectionModel = [...selectionModel || [], selectedModel];
|
|
@@ -3832,15 +3590,13 @@ function useDataTableRenderer({
|
|
|
3832
3590
|
[selectionModel, onSelectionModelChange, selectedModelSet]
|
|
3833
3591
|
),
|
|
3834
3592
|
columns,
|
|
3593
|
+
processedColumnGroups,
|
|
3835
3594
|
onTotalSelect: (0, import_react25.useCallback)(() => {
|
|
3836
3595
|
const selectableRows = rows.filter((row, i) => {
|
|
3837
3596
|
if (!isRowSelectable) return true;
|
|
3838
3597
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
3839
3598
|
});
|
|
3840
|
-
onSelectionModelChange?.(
|
|
3841
|
-
isTotalSelected ? [] : selectableRows.map(getId),
|
|
3842
|
-
!isTotalSelected
|
|
3843
|
-
);
|
|
3599
|
+
onSelectionModelChange?.(isTotalSelected ? [] : selectableRows.map(getId), !isTotalSelected);
|
|
3844
3600
|
}, [isTotalSelected, rows, onSelectionModelChange, getId, isRowSelectable])
|
|
3845
3601
|
};
|
|
3846
3602
|
}
|
|
@@ -3877,17 +3633,15 @@ function Component(props, apiRef) {
|
|
|
3877
3633
|
getId: ____________,
|
|
3878
3634
|
// getId is used in useDataTableRenderer
|
|
3879
3635
|
loading,
|
|
3636
|
+
columnGroupingModel: _________________,
|
|
3637
|
+
// columnGroupingModel is used in useDataTableRenderer
|
|
3880
3638
|
slots: {
|
|
3881
3639
|
checkbox: RenderCheckbox = Checkbox_default,
|
|
3882
3640
|
toolbar: Toolbar,
|
|
3883
3641
|
footer: Footer,
|
|
3884
3642
|
loadingOverlay: LoadingOverlay = DefaultLoadingOverlay
|
|
3885
3643
|
} = {},
|
|
3886
|
-
slotProps: {
|
|
3887
|
-
checkbox: checkboxProps = {},
|
|
3888
|
-
toolbar: toolbarProps,
|
|
3889
|
-
background: backgroundProps = {}
|
|
3890
|
-
} = {},
|
|
3644
|
+
slotProps: { checkbox: checkboxProps = {}, toolbar: toolbarProps, background: backgroundProps = {} } = {},
|
|
3891
3645
|
stripe,
|
|
3892
3646
|
isTotalSelected: ___________,
|
|
3893
3647
|
...innerProps
|
|
@@ -3897,6 +3651,7 @@ function Component(props, apiRef) {
|
|
|
3897
3651
|
const tableBodyRef = (0, import_react25.useRef)(null);
|
|
3898
3652
|
const {
|
|
3899
3653
|
columns,
|
|
3654
|
+
processedColumnGroups,
|
|
3900
3655
|
isAllSelected,
|
|
3901
3656
|
isSelectedRow,
|
|
3902
3657
|
isRowSelectable: isRowSelectableCheck,
|
|
@@ -3932,13 +3687,7 @@ function Component(props, apiRef) {
|
|
|
3932
3687
|
onRowClick?.({ row, rowId }, e);
|
|
3933
3688
|
checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
|
|
3934
3689
|
},
|
|
3935
|
-
[
|
|
3936
|
-
onRowClick,
|
|
3937
|
-
checkboxSelection,
|
|
3938
|
-
disableSelectionOnClick,
|
|
3939
|
-
onCheckboxChange,
|
|
3940
|
-
isRowSelectableCheck
|
|
3941
|
-
]
|
|
3690
|
+
[onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
|
|
3942
3691
|
);
|
|
3943
3692
|
const getRowFocusHandler = (0, import_react25.useCallback)(
|
|
3944
3693
|
(rowId) => () => {
|
|
@@ -3996,16 +3745,7 @@ function Component(props, apiRef) {
|
|
|
3996
3745
|
justifyContent: "space-between",
|
|
3997
3746
|
alignItems: "center"
|
|
3998
3747
|
},
|
|
3999
|
-
!!checkboxSelection && /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ import_react25.default.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ import_react25.default.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ import_react25.default.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(selectableRowCount), " items")), isTotalSelected && /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ import_react25.default.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectableRowCount), " items are selected."), /* @__PURE__ */ import_react25.default.createElement(
|
|
4000
|
-
Button_default,
|
|
4001
|
-
{
|
|
4002
|
-
size: "sm",
|
|
4003
|
-
variant: "plain",
|
|
4004
|
-
color: "danger",
|
|
4005
|
-
onClick: onTotalSelect
|
|
4006
|
-
},
|
|
4007
|
-
"Cancel"
|
|
4008
|
-
))),
|
|
3748
|
+
!!checkboxSelection && /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ import_react25.default.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ import_react25.default.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ import_react25.default.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(selectableRowCount), " items")), isTotalSelected && /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ import_react25.default.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectableRowCount), " items are selected."), /* @__PURE__ */ import_react25.default.createElement(Button_default, { size: "sm", variant: "plain", color: "danger", onClick: onTotalSelect }, "Cancel"))),
|
|
4009
3749
|
Toolbar && /* @__PURE__ */ import_react25.default.createElement(Toolbar, { ...toolbarProps || {} })
|
|
4010
3750
|
),
|
|
4011
3751
|
/* @__PURE__ */ import_react25.default.createElement(
|
|
@@ -4019,7 +3759,8 @@ function Component(props, apiRef) {
|
|
|
4019
3759
|
boxShadow: "sm",
|
|
4020
3760
|
borderRadius: "sm",
|
|
4021
3761
|
"--DataTableSheet-width": parentRef.current?.clientWidth + "px",
|
|
4022
|
-
backgroundColor: "white"
|
|
3762
|
+
backgroundColor: "white",
|
|
3763
|
+
"--TableCell-cornerRadius": "0px"
|
|
4023
3764
|
},
|
|
4024
3765
|
className: [
|
|
4025
3766
|
...(parentRef.current?.scrollLeft || 0) > 0 ? ["ScrollableRight"] : [],
|
|
@@ -4028,12 +3769,30 @@ function Component(props, apiRef) {
|
|
|
4028
3769
|
ref: parentRef,
|
|
4029
3770
|
...backgroundProps
|
|
4030
3771
|
},
|
|
4031
|
-
/* @__PURE__ */ import_react25.default.createElement(Table, { ...innerProps }, /* @__PURE__ */ import_react25.default.createElement("
|
|
3772
|
+
/* @__PURE__ */ import_react25.default.createElement(Table, { ...innerProps }, /* @__PURE__ */ import_react25.default.createElement("colgroup", null, checkboxSelection && /* @__PURE__ */ import_react25.default.createElement(
|
|
3773
|
+
"col",
|
|
3774
|
+
{
|
|
3775
|
+
style: {
|
|
3776
|
+
width: "40px"
|
|
3777
|
+
}
|
|
3778
|
+
}
|
|
3779
|
+
), columns.map((c) => /* @__PURE__ */ import_react25.default.createElement(
|
|
3780
|
+
"col",
|
|
3781
|
+
{
|
|
3782
|
+
ref: c.tableColRef,
|
|
3783
|
+
key: `${c.field.toString()}_${c.width}`,
|
|
3784
|
+
style: {
|
|
3785
|
+
width: c.width
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3788
|
+
))), /* @__PURE__ */ import_react25.default.createElement("thead", null, processedColumnGroups && processedColumnGroups.groups.map((levelGroups, level) => /* @__PURE__ */ import_react25.default.createElement("tr", { key: `group-level-${level}` }, checkboxSelection && level === 0 && /* @__PURE__ */ import_react25.default.createElement(
|
|
4032
3789
|
"th",
|
|
4033
3790
|
{
|
|
3791
|
+
rowSpan: processedColumnGroups.maxLevel + 2,
|
|
4034
3792
|
style: {
|
|
4035
3793
|
width: "40px",
|
|
4036
|
-
textAlign: "center"
|
|
3794
|
+
textAlign: "center",
|
|
3795
|
+
verticalAlign: "middle"
|
|
4037
3796
|
}
|
|
4038
3797
|
},
|
|
4039
3798
|
/* @__PURE__ */ import_react25.default.createElement(
|
|
@@ -4046,16 +3805,52 @@ function Component(props, apiRef) {
|
|
|
4046
3805
|
...checkboxProps
|
|
4047
3806
|
}
|
|
4048
3807
|
)
|
|
4049
|
-
),
|
|
4050
|
-
|
|
3808
|
+
), level > 0 && Array.from({ length: levelGroups[0]?.startIndex || 0 }).map((_2, i) => /* @__PURE__ */ import_react25.default.createElement("th", { key: `empty-${level}-${i}` })), levelGroups.map((group, groupIndex) => {
|
|
3809
|
+
const nextGroup = levelGroups[groupIndex + 1];
|
|
3810
|
+
const emptyCells = nextGroup ? nextGroup.startIndex - (group.startIndex + group.colspan) : columns.length - (group.startIndex + group.colspan);
|
|
3811
|
+
return /* @__PURE__ */ import_react25.default.createElement(import_react25.Fragment, { key: group.groupId }, /* @__PURE__ */ import_react25.default.createElement(
|
|
3812
|
+
"th",
|
|
3813
|
+
{
|
|
3814
|
+
colSpan: group.colspan,
|
|
3815
|
+
style: {
|
|
3816
|
+
textAlign: "center",
|
|
3817
|
+
fontWeight: "bold",
|
|
3818
|
+
verticalAlign: "middle"
|
|
3819
|
+
}
|
|
3820
|
+
},
|
|
3821
|
+
group.headerName ?? group.groupId
|
|
3822
|
+
), emptyCells > 0 && Array.from({ length: emptyCells }).map((_2, i) => /* @__PURE__ */ import_react25.default.createElement("th", { key: `empty-between-${level}-${groupIndex}-${i}`, colSpan: 1 })));
|
|
3823
|
+
}))), /* @__PURE__ */ import_react25.default.createElement("tr", null, !processedColumnGroups && checkboxSelection && /* @__PURE__ */ import_react25.default.createElement(
|
|
3824
|
+
"th",
|
|
4051
3825
|
{
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
3826
|
+
style: {
|
|
3827
|
+
width: "40px",
|
|
3828
|
+
textAlign: "center"
|
|
3829
|
+
}
|
|
3830
|
+
},
|
|
3831
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
3832
|
+
RenderCheckbox,
|
|
3833
|
+
{
|
|
3834
|
+
onChange: onAllCheckboxChange,
|
|
3835
|
+
checked: isAllSelected,
|
|
3836
|
+
indeterminate: (selectionModel || []).length > 0 && !isAllSelected,
|
|
3837
|
+
disabled: dataInPage.length > 0 && !selectableRowCount,
|
|
3838
|
+
...checkboxProps
|
|
3839
|
+
}
|
|
3840
|
+
)
|
|
3841
|
+
), columns.map((c, i) => (
|
|
3842
|
+
// @ts-ignore
|
|
3843
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
3844
|
+
HeadCell2,
|
|
3845
|
+
{
|
|
3846
|
+
tableId,
|
|
3847
|
+
key: `${c.field.toString()}_${i}`,
|
|
3848
|
+
stickyHeader: props.stickyHeader,
|
|
3849
|
+
editMode: !!c.isCellEditable,
|
|
3850
|
+
onSortChange: handleSortChange,
|
|
3851
|
+
...c
|
|
3852
|
+
}
|
|
3853
|
+
)
|
|
4059
3854
|
)))), /* @__PURE__ */ import_react25.default.createElement(
|
|
4060
3855
|
VirtualizedTableBody,
|
|
4061
3856
|
{
|
|
@@ -4174,9 +3969,7 @@ var CalendarButton2 = (0, import_joy34.styled)(IconButton_default, {
|
|
|
4174
3969
|
"&:focus": {
|
|
4175
3970
|
"--Icon-color": "currentColor",
|
|
4176
3971
|
outlineOffset: `${theme.getCssVar("focus-thickness")}`,
|
|
4177
|
-
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar(
|
|
4178
|
-
"palette-focusVisible"
|
|
4179
|
-
)}`
|
|
3972
|
+
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
4180
3973
|
}
|
|
4181
3974
|
}));
|
|
4182
3975
|
var StyledPopper2 = (0, import_joy34.styled)(import_base3.Popper, {
|
|
@@ -4213,10 +4006,7 @@ var validValueFormat2 = (value, format) => {
|
|
|
4213
4006
|
if (parsedDate1.toString() === "Invalid Date" || parsedDate2.toString() === "Invalid Date") {
|
|
4214
4007
|
return false;
|
|
4215
4008
|
}
|
|
4216
|
-
const formattedValue = formatValueString2(
|
|
4217
|
-
[parsedDate1, parsedDate2],
|
|
4218
|
-
format
|
|
4219
|
-
);
|
|
4009
|
+
const formattedValue = formatValueString2([parsedDate1, parsedDate2], format);
|
|
4220
4010
|
if (value !== formattedValue) {
|
|
4221
4011
|
return false;
|
|
4222
4012
|
}
|
|
@@ -4268,287 +4058,263 @@ var parseDates = (str, format) => {
|
|
|
4268
4058
|
var formatToPattern2 = (format) => {
|
|
4269
4059
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
4270
4060
|
};
|
|
4271
|
-
var TextMaskAdapter5 = import_react26.default.forwardRef(
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
maxLength: 2
|
|
4288
|
-
},
|
|
4289
|
-
M: {
|
|
4290
|
-
mask: import_react_imask2.IMask.MaskedRange,
|
|
4291
|
-
from: 1,
|
|
4292
|
-
to: 12,
|
|
4293
|
-
maxLength: 2
|
|
4294
|
-
},
|
|
4295
|
-
Y: {
|
|
4296
|
-
mask: import_react_imask2.IMask.MaskedRange,
|
|
4297
|
-
from: 1900,
|
|
4298
|
-
to: 9999
|
|
4299
|
-
}
|
|
4061
|
+
var TextMaskAdapter5 = import_react26.default.forwardRef(function TextMaskAdapter6(props, ref) {
|
|
4062
|
+
const { onChange, format, ...other } = props;
|
|
4063
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
4064
|
+
import_react_imask2.IMaskInput,
|
|
4065
|
+
{
|
|
4066
|
+
...other,
|
|
4067
|
+
inputRef: ref,
|
|
4068
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
4069
|
+
mask: Date,
|
|
4070
|
+
pattern: formatToPattern2(format),
|
|
4071
|
+
blocks: {
|
|
4072
|
+
D: {
|
|
4073
|
+
mask: import_react_imask2.IMask.MaskedRange,
|
|
4074
|
+
from: 1,
|
|
4075
|
+
to: 31,
|
|
4076
|
+
maxLength: 2
|
|
4300
4077
|
},
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
const props = (0, import_joy34.useThemeProps)({ props: inProps, name: "DateRangePicker" });
|
|
4312
|
-
const {
|
|
4313
|
-
onChange,
|
|
4314
|
-
disabled,
|
|
4315
|
-
label,
|
|
4316
|
-
error,
|
|
4317
|
-
helperText,
|
|
4318
|
-
minDate,
|
|
4319
|
-
maxDate,
|
|
4320
|
-
disableFuture,
|
|
4321
|
-
disablePast,
|
|
4322
|
-
required,
|
|
4323
|
-
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4324
|
-
sx,
|
|
4325
|
-
className,
|
|
4326
|
-
format = "YYYY/MM/DD",
|
|
4327
|
-
displayFormat = "YYYY/MM/DD",
|
|
4328
|
-
size,
|
|
4329
|
-
inputReadOnly,
|
|
4330
|
-
hideClearButton,
|
|
4331
|
-
readOnly,
|
|
4332
|
-
...innerProps
|
|
4333
|
-
} = props;
|
|
4334
|
-
const innerRef = (0, import_react26.useRef)(null);
|
|
4335
|
-
const buttonRef = (0, import_react26.useRef)(null);
|
|
4336
|
-
const [value, setValue] = useControlledState(
|
|
4337
|
-
props.value,
|
|
4338
|
-
props.defaultValue || "",
|
|
4339
|
-
(0, import_react26.useCallback)(
|
|
4340
|
-
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
4341
|
-
[props.name, onChange]
|
|
4342
|
-
)
|
|
4343
|
-
);
|
|
4344
|
-
const [displayValue, setDisplayValue] = (0, import_react26.useState)(
|
|
4345
|
-
() => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
|
|
4346
|
-
);
|
|
4347
|
-
const [anchorEl, setAnchorEl] = (0, import_react26.useState)(null);
|
|
4348
|
-
const open = Boolean(anchorEl);
|
|
4349
|
-
const calendarValue = (0, import_react26.useMemo)(
|
|
4350
|
-
() => value ? parseDates(value, format) : void 0,
|
|
4351
|
-
[value, format]
|
|
4352
|
-
);
|
|
4353
|
-
(0, import_react26.useEffect)(() => {
|
|
4354
|
-
if (value) {
|
|
4355
|
-
try {
|
|
4356
|
-
const dates = parseDates(value, format);
|
|
4357
|
-
const newDisplayValue = formatValueString2(dates, displayFormat);
|
|
4358
|
-
setDisplayValue(newDisplayValue);
|
|
4359
|
-
} catch (error2) {
|
|
4078
|
+
M: {
|
|
4079
|
+
mask: import_react_imask2.IMask.MaskedRange,
|
|
4080
|
+
from: 1,
|
|
4081
|
+
to: 12,
|
|
4082
|
+
maxLength: 2
|
|
4083
|
+
},
|
|
4084
|
+
Y: {
|
|
4085
|
+
mask: import_react_imask2.IMask.MaskedRange,
|
|
4086
|
+
from: 1900,
|
|
4087
|
+
to: 9999
|
|
4360
4088
|
}
|
|
4089
|
+
},
|
|
4090
|
+
format: (dates) => formatValueString2(dates, format),
|
|
4091
|
+
parse: (str) => parseDates(str, format),
|
|
4092
|
+
autofix: "pad",
|
|
4093
|
+
overwrite: true
|
|
4094
|
+
}
|
|
4095
|
+
);
|
|
4096
|
+
});
|
|
4097
|
+
var DateRangePicker = (0, import_react26.forwardRef)((inProps, ref) => {
|
|
4098
|
+
const props = (0, import_joy34.useThemeProps)({ props: inProps, name: "DateRangePicker" });
|
|
4099
|
+
const {
|
|
4100
|
+
onChange,
|
|
4101
|
+
disabled,
|
|
4102
|
+
label,
|
|
4103
|
+
error,
|
|
4104
|
+
helperText,
|
|
4105
|
+
minDate,
|
|
4106
|
+
maxDate,
|
|
4107
|
+
disableFuture,
|
|
4108
|
+
disablePast,
|
|
4109
|
+
required,
|
|
4110
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4111
|
+
sx,
|
|
4112
|
+
className,
|
|
4113
|
+
format = "YYYY/MM/DD",
|
|
4114
|
+
displayFormat = "YYYY/MM/DD",
|
|
4115
|
+
size,
|
|
4116
|
+
inputReadOnly,
|
|
4117
|
+
hideClearButton,
|
|
4118
|
+
readOnly,
|
|
4119
|
+
...innerProps
|
|
4120
|
+
} = props;
|
|
4121
|
+
const innerRef = (0, import_react26.useRef)(null);
|
|
4122
|
+
const buttonRef = (0, import_react26.useRef)(null);
|
|
4123
|
+
const [value, setValue] = useControlledState(
|
|
4124
|
+
props.value,
|
|
4125
|
+
props.defaultValue || "",
|
|
4126
|
+
(0, import_react26.useCallback)((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
4127
|
+
);
|
|
4128
|
+
const [displayValue, setDisplayValue] = (0, import_react26.useState)(
|
|
4129
|
+
() => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
|
|
4130
|
+
);
|
|
4131
|
+
const [anchorEl, setAnchorEl] = (0, import_react26.useState)(null);
|
|
4132
|
+
const open = Boolean(anchorEl);
|
|
4133
|
+
const calendarValue = (0, import_react26.useMemo)(
|
|
4134
|
+
() => value ? parseDates(value, format) : void 0,
|
|
4135
|
+
[value, format]
|
|
4136
|
+
);
|
|
4137
|
+
(0, import_react26.useEffect)(() => {
|
|
4138
|
+
if (value) {
|
|
4139
|
+
try {
|
|
4140
|
+
const dates = parseDates(value, format);
|
|
4141
|
+
const newDisplayValue = formatValueString2(dates, displayFormat);
|
|
4142
|
+
setDisplayValue(newDisplayValue);
|
|
4143
|
+
} catch (error2) {
|
|
4144
|
+
}
|
|
4145
|
+
} else {
|
|
4146
|
+
setDisplayValue("");
|
|
4147
|
+
}
|
|
4148
|
+
}, [displayFormat, value, format]);
|
|
4149
|
+
(0, import_react26.useEffect)(() => {
|
|
4150
|
+
if (!anchorEl) {
|
|
4151
|
+
innerRef.current?.blur();
|
|
4152
|
+
}
|
|
4153
|
+
}, [anchorEl, innerRef]);
|
|
4154
|
+
(0, import_react26.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
4155
|
+
const handleChange = (0, import_react26.useCallback)(
|
|
4156
|
+
(event) => {
|
|
4157
|
+
const value2 = event.target.value;
|
|
4158
|
+
setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat) : value2);
|
|
4159
|
+
setValue(value2);
|
|
4160
|
+
},
|
|
4161
|
+
[displayFormat, format, setValue]
|
|
4162
|
+
);
|
|
4163
|
+
const handleDisplayInputChange = (0, import_react26.useCallback)(
|
|
4164
|
+
(event) => {
|
|
4165
|
+
if (event.target.value === "") {
|
|
4166
|
+
handleChange({
|
|
4167
|
+
target: {
|
|
4168
|
+
name: props.name,
|
|
4169
|
+
value: ""
|
|
4170
|
+
}
|
|
4171
|
+
});
|
|
4172
|
+
return;
|
|
4173
|
+
}
|
|
4174
|
+
const isValidDisplayValue = validValueFormat2(event.target.value, displayFormat);
|
|
4175
|
+
if (isValidDisplayValue) {
|
|
4176
|
+
const dates = parseDates(event.target.value, displayFormat);
|
|
4177
|
+
const formattedValue = formatValueString2(dates, format);
|
|
4178
|
+
handleChange({
|
|
4179
|
+
target: {
|
|
4180
|
+
name: props.name,
|
|
4181
|
+
value: formattedValue
|
|
4182
|
+
}
|
|
4183
|
+
});
|
|
4184
|
+
}
|
|
4185
|
+
},
|
|
4186
|
+
[displayFormat, format, handleChange, props.name]
|
|
4187
|
+
);
|
|
4188
|
+
const handleCalendarToggle = (0, import_react26.useCallback)(
|
|
4189
|
+
(event) => {
|
|
4190
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4191
|
+
innerRef.current?.focus();
|
|
4192
|
+
},
|
|
4193
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
4194
|
+
);
|
|
4195
|
+
const handleCalendarChange = (0, import_react26.useCallback)(
|
|
4196
|
+
([date1, date2]) => {
|
|
4197
|
+
if (!date1 || !date2) return;
|
|
4198
|
+
const formattedValue = formatValueString2([date1, date2], format);
|
|
4199
|
+
if (props.value !== void 0) {
|
|
4200
|
+
onChange?.({ target: { name: props.name, value: formattedValue } });
|
|
4361
4201
|
} else {
|
|
4362
|
-
setDisplayValue(
|
|
4202
|
+
setDisplayValue(formatValueString2([date1, date2], displayFormat));
|
|
4203
|
+
setValue(formattedValue);
|
|
4363
4204
|
}
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4205
|
+
setAnchorEl(null);
|
|
4206
|
+
},
|
|
4207
|
+
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat]
|
|
4208
|
+
);
|
|
4209
|
+
const handleInputMouseDown = (0, import_react26.useCallback)(
|
|
4210
|
+
(event) => {
|
|
4211
|
+
if (inputReadOnly) {
|
|
4212
|
+
event.preventDefault();
|
|
4213
|
+
buttonRef.current?.focus();
|
|
4368
4214
|
}
|
|
4369
|
-
},
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
return;
|
|
4393
|
-
}
|
|
4394
|
-
const isValidDisplayValue = validValueFormat2(
|
|
4395
|
-
event.target.value,
|
|
4396
|
-
displayFormat
|
|
4397
|
-
);
|
|
4398
|
-
if (isValidDisplayValue) {
|
|
4399
|
-
const dates = parseDates(event.target.value, displayFormat);
|
|
4400
|
-
const formattedValue = formatValueString2(dates, format);
|
|
4401
|
-
handleChange({
|
|
4402
|
-
target: {
|
|
4403
|
-
name: props.name,
|
|
4404
|
-
value: formattedValue
|
|
4215
|
+
},
|
|
4216
|
+
[inputReadOnly, buttonRef]
|
|
4217
|
+
);
|
|
4218
|
+
return /* @__PURE__ */ import_react26.default.createElement(DateRangePickerRoot, null, /* @__PURE__ */ import_react26.default.createElement(import_base3.FocusTrap, { open: true }, /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement(
|
|
4219
|
+
Input_default,
|
|
4220
|
+
{
|
|
4221
|
+
...innerProps,
|
|
4222
|
+
color: error ? "danger" : innerProps.color,
|
|
4223
|
+
ref,
|
|
4224
|
+
size,
|
|
4225
|
+
value: displayValue,
|
|
4226
|
+
onChange: handleDisplayInputChange,
|
|
4227
|
+
disabled,
|
|
4228
|
+
required,
|
|
4229
|
+
placeholder: `${displayFormat} - ${displayFormat}`,
|
|
4230
|
+
slotProps: {
|
|
4231
|
+
input: {
|
|
4232
|
+
component: TextMaskAdapter5,
|
|
4233
|
+
ref: innerRef,
|
|
4234
|
+
format: displayFormat,
|
|
4235
|
+
sx: {
|
|
4236
|
+
"&:hover": {
|
|
4237
|
+
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
4405
4238
|
}
|
|
4406
|
-
}
|
|
4407
|
-
|
|
4408
|
-
},
|
|
4409
|
-
[displayFormat, format, handleChange, props.name]
|
|
4410
|
-
);
|
|
4411
|
-
const handleCalendarToggle = (0, import_react26.useCallback)(
|
|
4412
|
-
(event) => {
|
|
4413
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
4414
|
-
innerRef.current?.focus();
|
|
4415
|
-
},
|
|
4416
|
-
[anchorEl, setAnchorEl, innerRef]
|
|
4417
|
-
);
|
|
4418
|
-
const handleCalendarChange = (0, import_react26.useCallback)(
|
|
4419
|
-
([date1, date2]) => {
|
|
4420
|
-
if (!date1 || !date2) return;
|
|
4421
|
-
const formattedValue = formatValueString2([date1, date2], format);
|
|
4422
|
-
if (props.value !== void 0) {
|
|
4423
|
-
onChange?.({ target: { name: props.name, value: formattedValue } });
|
|
4424
|
-
} else {
|
|
4425
|
-
setDisplayValue(
|
|
4426
|
-
formatValueString2([date1, date2], displayFormat)
|
|
4427
|
-
);
|
|
4428
|
-
setValue(formattedValue);
|
|
4239
|
+
},
|
|
4240
|
+
onMouseDown: handleInputMouseDown
|
|
4429
4241
|
}
|
|
4430
|
-
setAnchorEl(null);
|
|
4431
4242
|
},
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4243
|
+
error,
|
|
4244
|
+
className,
|
|
4245
|
+
sx,
|
|
4246
|
+
endDecorator: /* @__PURE__ */ import_react26.default.createElement(
|
|
4247
|
+
CalendarButton2,
|
|
4248
|
+
{
|
|
4249
|
+
ref: buttonRef,
|
|
4250
|
+
variant: "plain",
|
|
4251
|
+
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
4252
|
+
"aria-label": "Toggle Calendar",
|
|
4253
|
+
"aria-controls": "date-range-picker-popper",
|
|
4254
|
+
"aria-haspopup": "dialog",
|
|
4255
|
+
"aria-expanded": open,
|
|
4256
|
+
disabled
|
|
4257
|
+
},
|
|
4258
|
+
/* @__PURE__ */ import_react26.default.createElement(import_CalendarToday2.default, null)
|
|
4259
|
+
),
|
|
4260
|
+
label,
|
|
4261
|
+
helperText,
|
|
4262
|
+
readOnly: readOnly || inputReadOnly
|
|
4263
|
+
}
|
|
4264
|
+
), open && /* @__PURE__ */ import_react26.default.createElement(import_base3.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react26.default.createElement(
|
|
4265
|
+
StyledPopper2,
|
|
4266
|
+
{
|
|
4267
|
+
id: "date-range-picker-popper",
|
|
4268
|
+
open: true,
|
|
4269
|
+
anchorEl,
|
|
4270
|
+
placement: "bottom-end",
|
|
4271
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4272
|
+
modifiers: [
|
|
4273
|
+
{
|
|
4274
|
+
name: "offset",
|
|
4275
|
+
options: {
|
|
4276
|
+
offset: [4, 4]
|
|
4277
|
+
}
|
|
4447
4278
|
}
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4279
|
+
],
|
|
4280
|
+
"aria-label": "Calendar Tooltip",
|
|
4281
|
+
"aria-expanded": open
|
|
4282
|
+
},
|
|
4283
|
+
/* @__PURE__ */ import_react26.default.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react26.default.createElement(
|
|
4284
|
+
Calendar_default,
|
|
4453
4285
|
{
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
required,
|
|
4462
|
-
placeholder: `${displayFormat} - ${displayFormat}`,
|
|
4463
|
-
slotProps: {
|
|
4464
|
-
input: {
|
|
4465
|
-
component: TextMaskAdapter5,
|
|
4466
|
-
ref: innerRef,
|
|
4467
|
-
format: displayFormat,
|
|
4468
|
-
sx: {
|
|
4469
|
-
"&:hover": {
|
|
4470
|
-
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
4471
|
-
}
|
|
4472
|
-
},
|
|
4473
|
-
onMouseDown: handleInputMouseDown
|
|
4474
|
-
}
|
|
4475
|
-
},
|
|
4476
|
-
error,
|
|
4477
|
-
className,
|
|
4478
|
-
sx,
|
|
4479
|
-
endDecorator: /* @__PURE__ */ import_react26.default.createElement(
|
|
4480
|
-
CalendarButton2,
|
|
4481
|
-
{
|
|
4482
|
-
ref: buttonRef,
|
|
4483
|
-
variant: "plain",
|
|
4484
|
-
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
4485
|
-
"aria-label": "Toggle Calendar",
|
|
4486
|
-
"aria-controls": "date-range-picker-popper",
|
|
4487
|
-
"aria-haspopup": "dialog",
|
|
4488
|
-
"aria-expanded": open,
|
|
4489
|
-
disabled
|
|
4490
|
-
},
|
|
4491
|
-
/* @__PURE__ */ import_react26.default.createElement(import_CalendarToday2.default, null)
|
|
4492
|
-
),
|
|
4493
|
-
label,
|
|
4494
|
-
helperText,
|
|
4495
|
-
readOnly: readOnly || inputReadOnly
|
|
4286
|
+
rangeSelection: true,
|
|
4287
|
+
defaultValue: calendarValue,
|
|
4288
|
+
onChange: handleCalendarChange,
|
|
4289
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
4290
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4291
|
+
disableFuture,
|
|
4292
|
+
disablePast
|
|
4496
4293
|
}
|
|
4497
|
-
),
|
|
4498
|
-
|
|
4294
|
+
), !hideClearButton && /* @__PURE__ */ import_react26.default.createElement(
|
|
4295
|
+
DialogActions_default,
|
|
4499
4296
|
{
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
anchorEl,
|
|
4503
|
-
placement: "bottom-end",
|
|
4504
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
4505
|
-
modifiers: [
|
|
4506
|
-
{
|
|
4507
|
-
name: "offset",
|
|
4508
|
-
options: {
|
|
4509
|
-
offset: [4, 4]
|
|
4510
|
-
}
|
|
4511
|
-
}
|
|
4512
|
-
],
|
|
4513
|
-
"aria-label": "Calendar Tooltip",
|
|
4514
|
-
"aria-expanded": open
|
|
4515
|
-
},
|
|
4516
|
-
/* @__PURE__ */ import_react26.default.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react26.default.createElement(
|
|
4517
|
-
Calendar_default,
|
|
4518
|
-
{
|
|
4519
|
-
rangeSelection: true,
|
|
4520
|
-
defaultValue: calendarValue,
|
|
4521
|
-
onChange: handleCalendarChange,
|
|
4522
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
4523
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4524
|
-
disableFuture,
|
|
4525
|
-
disablePast
|
|
4297
|
+
sx: {
|
|
4298
|
+
p: 1
|
|
4526
4299
|
}
|
|
4527
|
-
|
|
4528
|
-
|
|
4300
|
+
},
|
|
4301
|
+
/* @__PURE__ */ import_react26.default.createElement(
|
|
4302
|
+
Button_default,
|
|
4529
4303
|
{
|
|
4530
|
-
|
|
4531
|
-
|
|
4304
|
+
size,
|
|
4305
|
+
variant: "plain",
|
|
4306
|
+
color: "neutral",
|
|
4307
|
+
onClick: () => {
|
|
4308
|
+
setValue("");
|
|
4309
|
+
setDisplayValue("");
|
|
4310
|
+
setAnchorEl(null);
|
|
4532
4311
|
}
|
|
4533
4312
|
},
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
color: "neutral",
|
|
4540
|
-
onClick: () => {
|
|
4541
|
-
setValue("");
|
|
4542
|
-
setDisplayValue("");
|
|
4543
|
-
setAnchorEl(null);
|
|
4544
|
-
}
|
|
4545
|
-
},
|
|
4546
|
-
"Clear"
|
|
4547
|
-
)
|
|
4548
|
-
))
|
|
4549
|
-
)))));
|
|
4550
|
-
}
|
|
4551
|
-
);
|
|
4313
|
+
"Clear"
|
|
4314
|
+
)
|
|
4315
|
+
))
|
|
4316
|
+
)))));
|
|
4317
|
+
});
|
|
4552
4318
|
DateRangePicker.displayName = "DateRangePicker";
|
|
4553
4319
|
|
|
4554
4320
|
// src/components/DialogContent/DialogContent.tsx
|
|
@@ -4612,17 +4378,7 @@ var StyledDialogFrame = (0, import_joy38.styled)(ModalDialog, {
|
|
|
4612
4378
|
});
|
|
4613
4379
|
var DialogFrame = import_react28.default.forwardRef((props, ref) => {
|
|
4614
4380
|
const { title, children, actions, fullscreen, ...innerProps } = props;
|
|
4615
|
-
return /* @__PURE__ */ import_react28.default.createElement(
|
|
4616
|
-
StyledDialogFrame,
|
|
4617
|
-
{
|
|
4618
|
-
layout: fullscreen ? "fullscreen" : "center",
|
|
4619
|
-
ref,
|
|
4620
|
-
...innerProps
|
|
4621
|
-
},
|
|
4622
|
-
/* @__PURE__ */ import_react28.default.createElement(DialogTitle_default, null, title),
|
|
4623
|
-
/* @__PURE__ */ import_react28.default.createElement(DialogContent_default, null, children),
|
|
4624
|
-
/* @__PURE__ */ import_react28.default.createElement(DialogActions_default, null, actions)
|
|
4625
|
-
);
|
|
4381
|
+
return /* @__PURE__ */ import_react28.default.createElement(StyledDialogFrame, { layout: fullscreen ? "fullscreen" : "center", ref, ...innerProps }, /* @__PURE__ */ import_react28.default.createElement(DialogTitle_default, null, title), /* @__PURE__ */ import_react28.default.createElement(DialogContent_default, null, children), /* @__PURE__ */ import_react28.default.createElement(DialogActions_default, null, actions));
|
|
4626
4382
|
});
|
|
4627
4383
|
DialogFrame.displayName = "DialogFrame";
|
|
4628
4384
|
|
|
@@ -4661,11 +4417,7 @@ var import_react30 = __toESM(require("react"));
|
|
|
4661
4417
|
var import_joy41 = require("@mui/joy");
|
|
4662
4418
|
function CheckboxGroup(props) {
|
|
4663
4419
|
const { id, label, options, value, onChange, hidden } = props;
|
|
4664
|
-
const [internalValue, setInternalValue] = useControlledState(
|
|
4665
|
-
value,
|
|
4666
|
-
[],
|
|
4667
|
-
onChange
|
|
4668
|
-
);
|
|
4420
|
+
const [internalValue, setInternalValue] = useControlledState(value, [], onChange);
|
|
4669
4421
|
const handleCheckboxChange = (0, import_react30.useCallback)(
|
|
4670
4422
|
(optionValue) => (event) => {
|
|
4671
4423
|
const checked = event.target.checked;
|
|
@@ -4682,16 +4434,7 @@ function CheckboxGroup(props) {
|
|
|
4682
4434
|
if (hidden) {
|
|
4683
4435
|
return null;
|
|
4684
4436
|
}
|
|
4685
|
-
return /* @__PURE__ */ import_react30.default.createElement(import_joy41.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react30.default.createElement(
|
|
4686
|
-
Typography_default,
|
|
4687
|
-
{
|
|
4688
|
-
id,
|
|
4689
|
-
level: "title-sm",
|
|
4690
|
-
component: "label",
|
|
4691
|
-
textColor: "text.tertiary"
|
|
4692
|
-
},
|
|
4693
|
-
label
|
|
4694
|
-
), options.map((option) => /* @__PURE__ */ import_react30.default.createElement(
|
|
4437
|
+
return /* @__PURE__ */ import_react30.default.createElement(import_joy41.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react30.default.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), options.map((option) => /* @__PURE__ */ import_react30.default.createElement(
|
|
4695
4438
|
Checkbox_default,
|
|
4696
4439
|
{
|
|
4697
4440
|
key: `${id}-${option.value}`,
|
|
@@ -4720,11 +4463,7 @@ RadioGroup.displayName = "RadioGroup";
|
|
|
4720
4463
|
var import_joy43 = require("@mui/joy");
|
|
4721
4464
|
function RadioGroup2(props) {
|
|
4722
4465
|
const { id, label, options, value, onChange, hidden } = props;
|
|
4723
|
-
const [internalValue, setInternalValue] = useControlledState(
|
|
4724
|
-
value,
|
|
4725
|
-
value ?? "",
|
|
4726
|
-
onChange
|
|
4727
|
-
);
|
|
4466
|
+
const [internalValue, setInternalValue] = useControlledState(value, value ?? "", onChange);
|
|
4728
4467
|
const handleRadioChange = (0, import_react31.useCallback)(
|
|
4729
4468
|
(event) => {
|
|
4730
4469
|
const newValue = event.target.value;
|
|
@@ -4737,31 +4476,7 @@ function RadioGroup2(props) {
|
|
|
4737
4476
|
if (hidden) {
|
|
4738
4477
|
return null;
|
|
4739
4478
|
}
|
|
4740
|
-
return /* @__PURE__ */ import_react31.default.createElement(import_joy43.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react31.default.createElement(import_joy43.Stack, { spacing: 1 }, /* @__PURE__ */ import_react31.default.createElement(
|
|
4741
|
-
Typography_default,
|
|
4742
|
-
{
|
|
4743
|
-
id,
|
|
4744
|
-
level: "title-sm",
|
|
4745
|
-
component: "label",
|
|
4746
|
-
textColor: "text.tertiary"
|
|
4747
|
-
},
|
|
4748
|
-
label
|
|
4749
|
-
)), /* @__PURE__ */ import_react31.default.createElement(
|
|
4750
|
-
RadioGroup,
|
|
4751
|
-
{
|
|
4752
|
-
name: id,
|
|
4753
|
-
value: internalValue?.toString(),
|
|
4754
|
-
onChange: handleRadioChange
|
|
4755
|
-
},
|
|
4756
|
-
options.map((option) => /* @__PURE__ */ import_react31.default.createElement(
|
|
4757
|
-
Radio,
|
|
4758
|
-
{
|
|
4759
|
-
key: `${id}-${option.value}`,
|
|
4760
|
-
value: option.value.toString(),
|
|
4761
|
-
label: option.label
|
|
4762
|
-
}
|
|
4763
|
-
))
|
|
4764
|
-
));
|
|
4479
|
+
return /* @__PURE__ */ import_react31.default.createElement(import_joy43.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react31.default.createElement(import_joy43.Stack, { spacing: 1 }, /* @__PURE__ */ import_react31.default.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label)), /* @__PURE__ */ import_react31.default.createElement(RadioGroup, { name: id, value: internalValue?.toString(), onChange: handleRadioChange }, options.map((option) => /* @__PURE__ */ import_react31.default.createElement(Radio, { key: `${id}-${option.value}`, value: option.value.toString(), label: option.label }))));
|
|
4765
4480
|
}
|
|
4766
4481
|
RadioGroup2.displayName = "RadioGroup";
|
|
4767
4482
|
|
|
@@ -4784,11 +4499,7 @@ function DateRange(props) {
|
|
|
4784
4499
|
inputReadOnly,
|
|
4785
4500
|
hideClearButton
|
|
4786
4501
|
} = props;
|
|
4787
|
-
const [internalValue, setInternalValue] = useControlledState(
|
|
4788
|
-
value,
|
|
4789
|
-
null,
|
|
4790
|
-
onChange
|
|
4791
|
-
);
|
|
4502
|
+
const [internalValue, setInternalValue] = useControlledState(value, null, onChange);
|
|
4792
4503
|
const [selectedOption, setSelectedOption] = (0, import_react32.useState)("all-time");
|
|
4793
4504
|
const dateRangeOptions = (0, import_react32.useMemo)(
|
|
4794
4505
|
() => [
|
|
@@ -4817,28 +4528,19 @@ function DateRange(props) {
|
|
|
4817
4528
|
case "this-month": {
|
|
4818
4529
|
const startOfMonth = new Date(currentYear, currentMonth, 1);
|
|
4819
4530
|
const endOfMonth = new Date(currentYear, currentMonth + 1, 0);
|
|
4820
|
-
return [
|
|
4821
|
-
formatDate(startOfMonth),
|
|
4822
|
-
formatDate(endOfMonth)
|
|
4823
|
-
];
|
|
4531
|
+
return [formatDate(startOfMonth), formatDate(endOfMonth)];
|
|
4824
4532
|
}
|
|
4825
4533
|
case "this-year": {
|
|
4826
4534
|
const startOfYear = new Date(currentYear, 0, 1);
|
|
4827
4535
|
const endOfYear = new Date(currentYear, 11, 31);
|
|
4828
|
-
return [
|
|
4829
|
-
formatDate(startOfYear),
|
|
4830
|
-
formatDate(endOfYear)
|
|
4831
|
-
];
|
|
4536
|
+
return [formatDate(startOfYear), formatDate(endOfYear)];
|
|
4832
4537
|
}
|
|
4833
4538
|
case "last-month": {
|
|
4834
4539
|
const lastMonthYear = currentMonth === 0 ? currentYear - 1 : currentYear;
|
|
4835
4540
|
const lastMonth = currentMonth === 0 ? 11 : currentMonth - 1;
|
|
4836
4541
|
const startOfLastMonth = new Date(lastMonthYear, lastMonth, 1);
|
|
4837
4542
|
const endOfLastMonth = new Date(lastMonthYear, lastMonth + 1, 0);
|
|
4838
|
-
return [
|
|
4839
|
-
formatDate(startOfLastMonth),
|
|
4840
|
-
formatDate(endOfLastMonth)
|
|
4841
|
-
];
|
|
4543
|
+
return [formatDate(startOfLastMonth), formatDate(endOfLastMonth)];
|
|
4842
4544
|
}
|
|
4843
4545
|
case "custom":
|
|
4844
4546
|
return internalValue;
|
|
@@ -4901,31 +4603,7 @@ function DateRange(props) {
|
|
|
4901
4603
|
if (hidden) {
|
|
4902
4604
|
return null;
|
|
4903
4605
|
}
|
|
4904
|
-
return /* @__PURE__ */ import_react32.default.createElement(import_joy44.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react32.default.createElement(
|
|
4905
|
-
Typography_default,
|
|
4906
|
-
{
|
|
4907
|
-
id,
|
|
4908
|
-
level: "title-sm",
|
|
4909
|
-
component: "label",
|
|
4910
|
-
textColor: "text.tertiary"
|
|
4911
|
-
},
|
|
4912
|
-
label
|
|
4913
|
-
), /* @__PURE__ */ import_react32.default.createElement(
|
|
4914
|
-
RadioGroup,
|
|
4915
|
-
{
|
|
4916
|
-
name: `${id}-options`,
|
|
4917
|
-
value: selectedOption,
|
|
4918
|
-
onChange: handleOptionChange
|
|
4919
|
-
},
|
|
4920
|
-
dateRangeOptions.map((option) => /* @__PURE__ */ import_react32.default.createElement(
|
|
4921
|
-
Radio,
|
|
4922
|
-
{
|
|
4923
|
-
key: `${id}-${option.value}`,
|
|
4924
|
-
value: option.value,
|
|
4925
|
-
label: option.label
|
|
4926
|
-
}
|
|
4927
|
-
))
|
|
4928
|
-
), selectedOption === "custom" && /* @__PURE__ */ import_react32.default.createElement(
|
|
4606
|
+
return /* @__PURE__ */ import_react32.default.createElement(import_joy44.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react32.default.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), /* @__PURE__ */ import_react32.default.createElement(RadioGroup, { name: `${id}-options`, value: selectedOption, onChange: handleOptionChange }, dateRangeOptions.map((option) => /* @__PURE__ */ import_react32.default.createElement(Radio, { key: `${id}-${option.value}`, value: option.value, label: option.label }))), selectedOption === "custom" && /* @__PURE__ */ import_react32.default.createElement(
|
|
4929
4607
|
DateRangePicker,
|
|
4930
4608
|
{
|
|
4931
4609
|
value: customDateRangeValue,
|
|
@@ -4947,22 +4625,8 @@ DateRange.displayName = "DateRange";
|
|
|
4947
4625
|
var import_react33 = __toESM(require("react"));
|
|
4948
4626
|
var import_joy45 = require("@mui/joy");
|
|
4949
4627
|
function CurrencyInput3(props) {
|
|
4950
|
-
const {
|
|
4951
|
-
|
|
4952
|
-
label,
|
|
4953
|
-
value,
|
|
4954
|
-
onChange,
|
|
4955
|
-
hidden,
|
|
4956
|
-
max,
|
|
4957
|
-
placeholder,
|
|
4958
|
-
useMinorUnit,
|
|
4959
|
-
currency = "USD"
|
|
4960
|
-
} = props;
|
|
4961
|
-
const [internalValue, setInternalValue] = useControlledState(
|
|
4962
|
-
value,
|
|
4963
|
-
value,
|
|
4964
|
-
onChange
|
|
4965
|
-
);
|
|
4628
|
+
const { id, label, value, onChange, hidden, max, placeholder, useMinorUnit, currency = "USD" } = props;
|
|
4629
|
+
const [internalValue, setInternalValue] = useControlledState(value, value, onChange);
|
|
4966
4630
|
const handleCurrencyChange = (0, import_react33.useCallback)(
|
|
4967
4631
|
(event) => {
|
|
4968
4632
|
const newValue = event.target.value;
|
|
@@ -4973,16 +4637,7 @@ function CurrencyInput3(props) {
|
|
|
4973
4637
|
if (hidden) {
|
|
4974
4638
|
return null;
|
|
4975
4639
|
}
|
|
4976
|
-
return /* @__PURE__ */ import_react33.default.createElement(import_joy45.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react33.default.createElement(
|
|
4977
|
-
Typography_default,
|
|
4978
|
-
{
|
|
4979
|
-
id,
|
|
4980
|
-
level: "title-sm",
|
|
4981
|
-
component: "label",
|
|
4982
|
-
textColor: "text.tertiary"
|
|
4983
|
-
},
|
|
4984
|
-
label
|
|
4985
|
-
), /* @__PURE__ */ import_react33.default.createElement(
|
|
4640
|
+
return /* @__PURE__ */ import_react33.default.createElement(import_joy45.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react33.default.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), /* @__PURE__ */ import_react33.default.createElement(
|
|
4986
4641
|
CurrencyInput,
|
|
4987
4642
|
{
|
|
4988
4643
|
value: internalValue,
|
|
@@ -5001,22 +4656,8 @@ CurrencyInput3.displayName = "CurrencyInput";
|
|
|
5001
4656
|
var import_react34 = __toESM(require("react"));
|
|
5002
4657
|
var import_joy46 = require("@mui/joy");
|
|
5003
4658
|
function CurrencyRange(props) {
|
|
5004
|
-
const {
|
|
5005
|
-
|
|
5006
|
-
label,
|
|
5007
|
-
value,
|
|
5008
|
-
onChange,
|
|
5009
|
-
hidden,
|
|
5010
|
-
max,
|
|
5011
|
-
placeholder,
|
|
5012
|
-
useMinorUnit,
|
|
5013
|
-
currency = "USD"
|
|
5014
|
-
} = props;
|
|
5015
|
-
const [internalValue, setInternalValue] = useControlledState(
|
|
5016
|
-
value,
|
|
5017
|
-
null,
|
|
5018
|
-
onChange
|
|
5019
|
-
);
|
|
4659
|
+
const { id, label, value, onChange, hidden, max, placeholder, useMinorUnit, currency = "USD" } = props;
|
|
4660
|
+
const [internalValue, setInternalValue] = useControlledState(value, null, onChange);
|
|
5020
4661
|
const minValue = internalValue?.[0];
|
|
5021
4662
|
const maxValue = internalValue?.[1];
|
|
5022
4663
|
const handleMinChange = (0, import_react34.useCallback)(
|
|
@@ -5050,16 +4691,7 @@ function CurrencyRange(props) {
|
|
|
5050
4691
|
if (hidden) {
|
|
5051
4692
|
return null;
|
|
5052
4693
|
}
|
|
5053
|
-
return /* @__PURE__ */ import_react34.default.createElement(import_joy46.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react34.default.createElement(
|
|
5054
|
-
Typography_default,
|
|
5055
|
-
{
|
|
5056
|
-
id,
|
|
5057
|
-
level: "title-sm",
|
|
5058
|
-
component: "label",
|
|
5059
|
-
textColor: "text.tertiary"
|
|
5060
|
-
},
|
|
5061
|
-
label
|
|
5062
|
-
), /* @__PURE__ */ import_react34.default.createElement(import_joy46.Stack, { direction: "row", spacing: 2, alignItems: "flex-end" }, /* @__PURE__ */ import_react34.default.createElement(
|
|
4694
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_joy46.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react34.default.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), /* @__PURE__ */ import_react34.default.createElement(import_joy46.Stack, { direction: "row", spacing: 2, alignItems: "flex-end" }, /* @__PURE__ */ import_react34.default.createElement(
|
|
5063
4695
|
CurrencyInput,
|
|
5064
4696
|
{
|
|
5065
4697
|
label: "Minimum",
|
|
@@ -5101,115 +4733,112 @@ var padDecimal = (value, decimalScale) => {
|
|
|
5101
4733
|
const [integer, decimal = ""] = `${value}`.split(".");
|
|
5102
4734
|
return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
|
|
5103
4735
|
};
|
|
5104
|
-
var TextMaskAdapter7 = import_react35.default.forwardRef(
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
}
|
|
5127
|
-
);
|
|
4736
|
+
var TextMaskAdapter7 = import_react35.default.forwardRef(function TextMaskAdapter8(props, ref) {
|
|
4737
|
+
const { onChange, min, max, ...innerProps } = props;
|
|
4738
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
4739
|
+
import_react_number_format2.NumericFormat,
|
|
4740
|
+
{
|
|
4741
|
+
...innerProps,
|
|
4742
|
+
onValueChange: ({ value }) => {
|
|
4743
|
+
onChange?.({
|
|
4744
|
+
target: {
|
|
4745
|
+
name: props.name,
|
|
4746
|
+
value
|
|
4747
|
+
}
|
|
4748
|
+
});
|
|
4749
|
+
},
|
|
4750
|
+
valueIsNumericString: true,
|
|
4751
|
+
thousandSeparator: true,
|
|
4752
|
+
suffix: "%",
|
|
4753
|
+
getInputRef: ref,
|
|
4754
|
+
allowNegative: true
|
|
4755
|
+
}
|
|
4756
|
+
);
|
|
4757
|
+
});
|
|
5128
4758
|
var PercentageInputRoot = (0, import_joy47.styled)(Input_default, {
|
|
5129
4759
|
name: "PercentageInput",
|
|
5130
4760
|
slot: "Root",
|
|
5131
4761
|
overridesResolver: (props, styles) => styles.root
|
|
5132
4762
|
})({});
|
|
5133
|
-
var PercentageInput = import_react35.default.forwardRef(
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
error,
|
|
5140
|
-
helperText,
|
|
5141
|
-
required,
|
|
5142
|
-
disabled,
|
|
5143
|
-
useMinorUnit,
|
|
5144
|
-
maxDecimalScale = 0,
|
|
5145
|
-
min,
|
|
5146
|
-
max,
|
|
5147
|
-
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
5148
|
-
sx,
|
|
5149
|
-
className,
|
|
5150
|
-
...innerProps
|
|
5151
|
-
} = props;
|
|
5152
|
-
const [_value, setValue] = useControlledState(
|
|
5153
|
-
props.value,
|
|
5154
|
-
props.defaultValue,
|
|
5155
|
-
(0, import_react35.useCallback)(
|
|
5156
|
-
(value2) => onChange?.({ target: { name, value: value2 } }),
|
|
5157
|
-
[onChange, name]
|
|
5158
|
-
)
|
|
5159
|
-
);
|
|
5160
|
-
const [internalError, setInternalError] = (0, import_react35.useState)(
|
|
5161
|
-
max && _value && _value > max || min && _value && _value < min
|
|
5162
|
-
);
|
|
5163
|
-
const value = (0, import_react35.useMemo)(() => {
|
|
5164
|
-
if (_value && useMinorUnit) {
|
|
5165
|
-
return _value / Math.pow(10, maxDecimalScale);
|
|
5166
|
-
}
|
|
5167
|
-
return _value;
|
|
5168
|
-
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
5169
|
-
const handleChange = (0, import_react35.useCallback)(
|
|
5170
|
-
(event) => {
|
|
5171
|
-
if (event.target.value === "") {
|
|
5172
|
-
setValue(void 0);
|
|
5173
|
-
return;
|
|
5174
|
-
}
|
|
5175
|
-
const originalAmount = Number(event.target.value);
|
|
5176
|
-
if (min && originalAmount < min || max && originalAmount > max) {
|
|
5177
|
-
setInternalError(true);
|
|
5178
|
-
} else {
|
|
5179
|
-
setInternalError(false);
|
|
5180
|
-
}
|
|
5181
|
-
const amount = useMinorUnit ? padDecimal(originalAmount, maxDecimalScale) : originalAmount;
|
|
5182
|
-
setValue(amount);
|
|
5183
|
-
},
|
|
5184
|
-
[setValue, useMinorUnit, maxDecimalScale, min, max]
|
|
5185
|
-
);
|
|
5186
|
-
return /* @__PURE__ */ import_react35.default.createElement(
|
|
5187
|
-
PercentageInputRoot,
|
|
5188
|
-
{
|
|
5189
|
-
...innerProps,
|
|
5190
|
-
ref,
|
|
5191
|
-
value,
|
|
5192
|
-
onChange: handleChange,
|
|
5193
|
-
error: internalError || error,
|
|
5194
|
-
disabled,
|
|
5195
|
-
required,
|
|
5196
|
-
color: internalError || error ? "danger" : props.color,
|
|
4763
|
+
var PercentageInput = import_react35.default.forwardRef(
|
|
4764
|
+
function PercentageInput2(inProps, ref) {
|
|
4765
|
+
const props = (0, import_joy47.useThemeProps)({ props: inProps, name: "PercentageInput" });
|
|
4766
|
+
const {
|
|
4767
|
+
name,
|
|
4768
|
+
onChange,
|
|
5197
4769
|
label,
|
|
4770
|
+
error,
|
|
5198
4771
|
helperText,
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
4772
|
+
required,
|
|
4773
|
+
disabled,
|
|
4774
|
+
useMinorUnit,
|
|
4775
|
+
maxDecimalScale = 0,
|
|
4776
|
+
min,
|
|
4777
|
+
max,
|
|
4778
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4779
|
+
sx,
|
|
4780
|
+
className,
|
|
4781
|
+
...innerProps
|
|
4782
|
+
} = props;
|
|
4783
|
+
const [_value, setValue] = useControlledState(
|
|
4784
|
+
props.value,
|
|
4785
|
+
props.defaultValue,
|
|
4786
|
+
(0, import_react35.useCallback)((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
4787
|
+
);
|
|
4788
|
+
const [internalError, setInternalError] = (0, import_react35.useState)(
|
|
4789
|
+
max && _value && _value > max || min && _value && _value < min
|
|
4790
|
+
);
|
|
4791
|
+
const value = (0, import_react35.useMemo)(() => {
|
|
4792
|
+
if (_value && useMinorUnit) {
|
|
4793
|
+
return _value / Math.pow(10, maxDecimalScale);
|
|
4794
|
+
}
|
|
4795
|
+
return _value;
|
|
4796
|
+
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
4797
|
+
const handleChange = (0, import_react35.useCallback)(
|
|
4798
|
+
(event) => {
|
|
4799
|
+
if (event.target.value === "") {
|
|
4800
|
+
setValue(void 0);
|
|
4801
|
+
return;
|
|
5204
4802
|
}
|
|
4803
|
+
const originalAmount = Number(event.target.value);
|
|
4804
|
+
if (min && originalAmount < min || max && originalAmount > max) {
|
|
4805
|
+
setInternalError(true);
|
|
4806
|
+
} else {
|
|
4807
|
+
setInternalError(false);
|
|
4808
|
+
}
|
|
4809
|
+
const amount = useMinorUnit ? padDecimal(originalAmount, maxDecimalScale) : originalAmount;
|
|
4810
|
+
setValue(amount);
|
|
5205
4811
|
},
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
4812
|
+
[setValue, useMinorUnit, maxDecimalScale, min, max]
|
|
4813
|
+
);
|
|
4814
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
4815
|
+
PercentageInputRoot,
|
|
4816
|
+
{
|
|
4817
|
+
...innerProps,
|
|
4818
|
+
ref,
|
|
4819
|
+
value,
|
|
4820
|
+
onChange: handleChange,
|
|
4821
|
+
error: internalError || error,
|
|
4822
|
+
disabled,
|
|
4823
|
+
required,
|
|
4824
|
+
color: internalError || error ? "danger" : props.color,
|
|
4825
|
+
label,
|
|
4826
|
+
helperText,
|
|
4827
|
+
slotProps: {
|
|
4828
|
+
input: {
|
|
4829
|
+
component: TextMaskAdapter7,
|
|
4830
|
+
"aria-label": innerProps["aria-label"],
|
|
4831
|
+
decimalScale: maxDecimalScale
|
|
4832
|
+
}
|
|
4833
|
+
},
|
|
4834
|
+
sx: {
|
|
4835
|
+
...sx
|
|
4836
|
+
},
|
|
4837
|
+
className
|
|
4838
|
+
}
|
|
4839
|
+
);
|
|
4840
|
+
}
|
|
4841
|
+
);
|
|
5213
4842
|
PercentageInput.displayName = "PercentageInput";
|
|
5214
4843
|
|
|
5215
4844
|
// src/components/FilterMenu/components/PercentageInput.tsx
|
|
@@ -5229,16 +4858,7 @@ var PercentageInput3 = ({
|
|
|
5229
4858
|
if (hidden) {
|
|
5230
4859
|
return null;
|
|
5231
4860
|
}
|
|
5232
|
-
return /* @__PURE__ */ import_react36.default.createElement(import_joy48.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react36.default.createElement(
|
|
5233
|
-
import_joy48.Typography,
|
|
5234
|
-
{
|
|
5235
|
-
id,
|
|
5236
|
-
level: "title-sm",
|
|
5237
|
-
component: "label",
|
|
5238
|
-
textColor: "text.tertiary"
|
|
5239
|
-
},
|
|
5240
|
-
label
|
|
5241
|
-
), /* @__PURE__ */ import_react36.default.createElement(
|
|
4861
|
+
return /* @__PURE__ */ import_react36.default.createElement(import_joy48.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react36.default.createElement(import_joy48.Typography, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), /* @__PURE__ */ import_react36.default.createElement(
|
|
5242
4862
|
PercentageInput,
|
|
5243
4863
|
{
|
|
5244
4864
|
value: _value,
|
|
@@ -5256,18 +4876,12 @@ var PercentageInput3 = ({
|
|
|
5256
4876
|
var import_react37 = __toESM(require("react"));
|
|
5257
4877
|
var import_joy49 = require("@mui/joy");
|
|
5258
4878
|
function PercentageRange(props) {
|
|
5259
|
-
const {
|
|
5260
|
-
|
|
5261
|
-
label,
|
|
4879
|
+
const { id, label, value, onChange, hidden, useMinorUnit, maxDecimalScale, min, max } = props;
|
|
4880
|
+
const [internalValue, setInternalValue] = useControlledState(
|
|
5262
4881
|
value,
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
maxDecimalScale,
|
|
5267
|
-
min,
|
|
5268
|
-
max
|
|
5269
|
-
} = props;
|
|
5270
|
-
const [internalValue, setInternalValue] = useControlledState(value, null, onChange);
|
|
4882
|
+
null,
|
|
4883
|
+
onChange
|
|
4884
|
+
);
|
|
5271
4885
|
const minValue = internalValue?.[0];
|
|
5272
4886
|
const maxValue = internalValue?.[1];
|
|
5273
4887
|
const handleMinChange = (0, import_react37.useCallback)(
|
|
@@ -5297,16 +4911,7 @@ function PercentageRange(props) {
|
|
|
5297
4911
|
if (hidden) {
|
|
5298
4912
|
return null;
|
|
5299
4913
|
}
|
|
5300
|
-
return /* @__PURE__ */ import_react37.default.createElement(import_joy49.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react37.default.createElement(
|
|
5301
|
-
Typography_default,
|
|
5302
|
-
{
|
|
5303
|
-
id,
|
|
5304
|
-
level: "title-sm",
|
|
5305
|
-
component: "label",
|
|
5306
|
-
textColor: "text.tertiary"
|
|
5307
|
-
},
|
|
5308
|
-
label
|
|
5309
|
-
), /* @__PURE__ */ import_react37.default.createElement(import_joy49.Stack, { direction: "row", spacing: 2, alignItems: "flex-end" }, /* @__PURE__ */ import_react37.default.createElement(
|
|
4914
|
+
return /* @__PURE__ */ import_react37.default.createElement(import_joy49.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react37.default.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), /* @__PURE__ */ import_react37.default.createElement(import_joy49.Stack, { direction: "row", spacing: 2, alignItems: "flex-end" }, /* @__PURE__ */ import_react37.default.createElement(
|
|
5310
4915
|
PercentageInput,
|
|
5311
4916
|
{
|
|
5312
4917
|
label: "Minimum",
|
|
@@ -5343,11 +4948,7 @@ var import_react38 = __toESM(require("react"));
|
|
|
5343
4948
|
var import_joy50 = require("@mui/joy");
|
|
5344
4949
|
function Autocomplete2(props) {
|
|
5345
4950
|
const { id, label, value, onChange, options, multiple, hidden, placeholder } = props;
|
|
5346
|
-
const [internalValue, setInternalValue] = useControlledState(
|
|
5347
|
-
value,
|
|
5348
|
-
void 0,
|
|
5349
|
-
onChange
|
|
5350
|
-
);
|
|
4951
|
+
const [internalValue, setInternalValue] = useControlledState(value, void 0, onChange);
|
|
5351
4952
|
const autocompleteValue = typeof internalValue === "string" || typeof internalValue === "number" ? String(internalValue) : void 0;
|
|
5352
4953
|
const handleChange = (0, import_react38.useCallback)(
|
|
5353
4954
|
(event) => {
|
|
@@ -5364,16 +4965,7 @@ function Autocomplete2(props) {
|
|
|
5364
4965
|
if (hidden) {
|
|
5365
4966
|
return null;
|
|
5366
4967
|
}
|
|
5367
|
-
return /* @__PURE__ */ import_react38.default.createElement(import_joy50.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react38.default.createElement(
|
|
5368
|
-
Typography_default,
|
|
5369
|
-
{
|
|
5370
|
-
id,
|
|
5371
|
-
level: "title-sm",
|
|
5372
|
-
component: "label",
|
|
5373
|
-
textColor: "text.tertiary"
|
|
5374
|
-
},
|
|
5375
|
-
label
|
|
5376
|
-
), /* @__PURE__ */ import_react38.default.createElement(
|
|
4968
|
+
return /* @__PURE__ */ import_react38.default.createElement(import_joy50.Stack, { spacing: 3, role: "group", "aria-labelledby": id }, !!label && /* @__PURE__ */ import_react38.default.createElement(Typography_default, { id, level: "title-sm", component: "label", textColor: "text.tertiary" }, label), /* @__PURE__ */ import_react38.default.createElement(
|
|
5377
4969
|
Autocomplete,
|
|
5378
4970
|
{
|
|
5379
4971
|
value: autocompleteValue,
|
|
@@ -5399,16 +4991,7 @@ var componentMap = {
|
|
|
5399
4991
|
autocomplete: Autocomplete2
|
|
5400
4992
|
};
|
|
5401
4993
|
function FilterMenu(props) {
|
|
5402
|
-
const {
|
|
5403
|
-
filters,
|
|
5404
|
-
values,
|
|
5405
|
-
defaultValues,
|
|
5406
|
-
resetValues = {},
|
|
5407
|
-
onChange,
|
|
5408
|
-
onClose,
|
|
5409
|
-
useClear,
|
|
5410
|
-
useReset
|
|
5411
|
-
} = props;
|
|
4994
|
+
const { filters, values, defaultValues, resetValues = {}, onChange, onClose, useClear, useReset } = props;
|
|
5412
4995
|
const [internalValues, setInternalValues] = useControlledState(
|
|
5413
4996
|
values,
|
|
5414
4997
|
defaultValues || {},
|
|
@@ -5458,25 +5041,7 @@ function FilterMenu(props) {
|
|
|
5458
5041
|
}
|
|
5459
5042
|
) : null;
|
|
5460
5043
|
}))),
|
|
5461
|
-
/* @__PURE__ */ import_react39.default.createElement(DialogActions, { sx: { justifyContent: "space-between" } }, useClear && filters?.length === 1 && /* @__PURE__ */ import_react39.default.createElement(
|
|
5462
|
-
import_joy51.Button,
|
|
5463
|
-
{
|
|
5464
|
-
variant: "plain",
|
|
5465
|
-
color: "neutral",
|
|
5466
|
-
size: "md",
|
|
5467
|
-
onClick: handleClear
|
|
5468
|
-
},
|
|
5469
|
-
"Clear"
|
|
5470
|
-
), useReset && !useClear && /* @__PURE__ */ import_react39.default.createElement(
|
|
5471
|
-
import_joy51.Button,
|
|
5472
|
-
{
|
|
5473
|
-
variant: "plain",
|
|
5474
|
-
color: "neutral",
|
|
5475
|
-
size: "md",
|
|
5476
|
-
onClick: handleClear
|
|
5477
|
-
},
|
|
5478
|
-
"Reset"
|
|
5479
|
-
), /* @__PURE__ */ import_react39.default.createElement(import_joy51.Button, { variant: "solid", color: "primary", size: "md", onClick: handleApply }, "Apply"))
|
|
5044
|
+
/* @__PURE__ */ import_react39.default.createElement(DialogActions, { sx: { justifyContent: "space-between" } }, useClear && filters?.length === 1 && /* @__PURE__ */ import_react39.default.createElement(import_joy51.Button, { variant: "plain", color: "neutral", size: "md", onClick: handleClear }, "Clear"), useReset && !useClear && /* @__PURE__ */ import_react39.default.createElement(import_joy51.Button, { variant: "plain", color: "neutral", size: "md", onClick: handleClear }, "Reset"), /* @__PURE__ */ import_react39.default.createElement(import_joy51.Button, { variant: "solid", color: "primary", size: "md", onClick: handleApply }, "Apply"))
|
|
5480
5045
|
);
|
|
5481
5046
|
}
|
|
5482
5047
|
FilterMenu.displayName = "FilterMenu";
|
|
@@ -5541,52 +5106,11 @@ var ClearIcon2 = (0, import_joy52.styled)(import_ClearRounded.default, {
|
|
|
5541
5106
|
width: "18px",
|
|
5542
5107
|
height: "18px"
|
|
5543
5108
|
}));
|
|
5544
|
-
var UNITS = [
|
|
5545
|
-
"byte",
|
|
5546
|
-
"kilobyte",
|
|
5547
|
-
"megabyte",
|
|
5548
|
-
"gigabyte",
|
|
5549
|
-
"terabyte",
|
|
5550
|
-
"petabyte"
|
|
5551
|
-
];
|
|
5109
|
+
var UNITS = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "petabyte"];
|
|
5552
5110
|
var ALL_EXTENSIONS_BY_TYPE = {
|
|
5553
|
-
"image/*": [
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
".png",
|
|
5557
|
-
".gif",
|
|
5558
|
-
".bmp",
|
|
5559
|
-
".tiff",
|
|
5560
|
-
".svg",
|
|
5561
|
-
".webp",
|
|
5562
|
-
".heic",
|
|
5563
|
-
".ico"
|
|
5564
|
-
],
|
|
5565
|
-
"audio/*": [
|
|
5566
|
-
".mp3",
|
|
5567
|
-
".wav",
|
|
5568
|
-
".flac",
|
|
5569
|
-
".aac",
|
|
5570
|
-
".ogg",
|
|
5571
|
-
".m4a",
|
|
5572
|
-
".wma",
|
|
5573
|
-
".aiff",
|
|
5574
|
-
".alac",
|
|
5575
|
-
".midi",
|
|
5576
|
-
".mp4"
|
|
5577
|
-
],
|
|
5578
|
-
"video/*": [
|
|
5579
|
-
".mp4",
|
|
5580
|
-
".avi",
|
|
5581
|
-
".mkv",
|
|
5582
|
-
".mov",
|
|
5583
|
-
".wmv",
|
|
5584
|
-
".flv",
|
|
5585
|
-
".webm",
|
|
5586
|
-
".mpeg",
|
|
5587
|
-
".3gp",
|
|
5588
|
-
".m4v"
|
|
5589
|
-
]
|
|
5111
|
+
"image/*": [".jpeg", ".jpg", ".png", ".gif", ".bmp", ".tiff", ".svg", ".webp", ".heic", ".ico"],
|
|
5112
|
+
"audio/*": [".mp3", ".wav", ".flac", ".aac", ".ogg", ".m4a", ".wma", ".aiff", ".alac", ".midi", ".mp4"],
|
|
5113
|
+
"video/*": [".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".webm", ".mpeg", ".3gp", ".m4v"]
|
|
5590
5114
|
};
|
|
5591
5115
|
var getFileSize = (n) => {
|
|
5592
5116
|
const i = n == 0 ? 0 : Math.floor(Math.log(n) / Math.log(1024));
|
|
@@ -5600,16 +5124,7 @@ var getFileSize = (n) => {
|
|
|
5600
5124
|
};
|
|
5601
5125
|
var Preview = (props) => {
|
|
5602
5126
|
const { files, uploaded, onDelete } = props;
|
|
5603
|
-
return /* @__PURE__ */ import_react40.default.createElement(PreviewRoot, { gap: 1 }, [...uploaded, ...files].map((file) => /* @__PURE__ */ import_react40.default.createElement(UploadCard, { key: file.name, size: "sm", color: "neutral" }, /* @__PURE__ */ import_react40.default.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2 }, /* @__PURE__ */ import_react40.default.createElement(UploadFileIcon, null), /* @__PURE__ */ import_react40.default.createElement(Stack_default, { flex: "1" }, /* @__PURE__ */ import_react40.default.createElement(Typography_default, { level: "body-sm", textColor: "common.black" }, file.name), !!file.size && /* @__PURE__ */ import_react40.default.createElement(
|
|
5604
|
-
Typography_default,
|
|
5605
|
-
{
|
|
5606
|
-
level: "body-xs",
|
|
5607
|
-
fontWeight: "300",
|
|
5608
|
-
lineHeight: "1.33",
|
|
5609
|
-
textColor: "text.tertiary"
|
|
5610
|
-
},
|
|
5611
|
-
getFileSize(file.size)
|
|
5612
|
-
)), /* @__PURE__ */ import_react40.default.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ import_react40.default.createElement(ClearIcon2, null))))));
|
|
5127
|
+
return /* @__PURE__ */ import_react40.default.createElement(PreviewRoot, { gap: 1 }, [...uploaded, ...files].map((file) => /* @__PURE__ */ import_react40.default.createElement(UploadCard, { key: file.name, size: "sm", color: "neutral" }, /* @__PURE__ */ import_react40.default.createElement(Stack_default, { direction: "row", alignItems: "center", gap: 2 }, /* @__PURE__ */ import_react40.default.createElement(UploadFileIcon, null), /* @__PURE__ */ import_react40.default.createElement(Stack_default, { flex: "1" }, /* @__PURE__ */ import_react40.default.createElement(Typography_default, { level: "body-sm", textColor: "common.black" }, file.name), !!file.size && /* @__PURE__ */ import_react40.default.createElement(Typography_default, { level: "body-xs", fontWeight: "300", lineHeight: "1.33", textColor: "text.tertiary" }, getFileSize(file.size))), /* @__PURE__ */ import_react40.default.createElement(IconButton_default, { onClick: () => onDelete?.(file) }, /* @__PURE__ */ import_react40.default.createElement(ClearIcon2, null))))));
|
|
5613
5128
|
};
|
|
5614
5129
|
var UploaderRoot = (0, import_joy52.styled)(Stack_default, {
|
|
5615
5130
|
name: "Uploader",
|
|
@@ -5621,31 +5136,27 @@ var FileDropZone = (0, import_joy52.styled)(Sheet_default, {
|
|
|
5621
5136
|
name: "Uploader",
|
|
5622
5137
|
slot: "dropZone",
|
|
5623
5138
|
shouldForwardProp: (prop) => prop !== "error"
|
|
5624
|
-
})(
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
})
|
|
5637
|
-
);
|
|
5139
|
+
})(({ theme, state, error }) => ({
|
|
5140
|
+
width: "100%",
|
|
5141
|
+
display: "flex",
|
|
5142
|
+
flexDirection: "column",
|
|
5143
|
+
justifyContent: "center",
|
|
5144
|
+
alignItems: "center",
|
|
5145
|
+
padding: theme.spacing(5),
|
|
5146
|
+
gap: theme.spacing(4),
|
|
5147
|
+
cursor: "pointer",
|
|
5148
|
+
backgroundColor: theme.palette.background.surface,
|
|
5149
|
+
border: error ? `1px solid ${theme.palette.danger.outlinedBorder}` : state === "idle" ? `1px solid ${theme.palette.neutral.outlinedBorder}` : `1px solid ${theme.palette.primary.outlinedBorder}`
|
|
5150
|
+
}));
|
|
5638
5151
|
var UploaderIcon = (0, import_joy52.styled)(import_CloudUploadRounded.default, {
|
|
5639
5152
|
name: "Uploader",
|
|
5640
5153
|
slot: "iconContainer",
|
|
5641
5154
|
shouldForwardProp: (prop) => prop !== "error"
|
|
5642
|
-
})(
|
|
5643
|
-
({
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
})
|
|
5648
|
-
);
|
|
5155
|
+
})(({ theme, state, error }) => ({
|
|
5156
|
+
color: error ? `rgba(${theme.vars.palette.danger.mainChannel} / 0.6)` : state === "over" ? `rgba(${theme.palette.primary.mainChannel} / 0.6)` : theme.palette.neutral.softActiveBg,
|
|
5157
|
+
width: "32px",
|
|
5158
|
+
height: "32px"
|
|
5159
|
+
}));
|
|
5649
5160
|
var Uploader = import_react40.default.memo(
|
|
5650
5161
|
(props) => {
|
|
5651
5162
|
const {
|
|
@@ -5665,14 +5176,9 @@ var Uploader = import_react40.default.memo(
|
|
|
5665
5176
|
const inputRef = (0, import_react40.useRef)(null);
|
|
5666
5177
|
const [errorText, setErrorText] = (0, import_react40.useState)();
|
|
5667
5178
|
const [files, setFiles] = (0, import_react40.useState)([]);
|
|
5668
|
-
const [uploaded, setUploaded] = (0, import_react40.useState)(
|
|
5669
|
-
props.uploaded || []
|
|
5670
|
-
);
|
|
5179
|
+
const [uploaded, setUploaded] = (0, import_react40.useState)(props.uploaded || []);
|
|
5671
5180
|
const [previewState, setPreviewState] = (0, import_react40.useState)("idle");
|
|
5672
|
-
const accepts = (0, import_react40.useMemo)(
|
|
5673
|
-
() => accept.split(",").map((accept2) => accept2.trim()),
|
|
5674
|
-
[accept]
|
|
5675
|
-
);
|
|
5181
|
+
const accepts = (0, import_react40.useMemo)(() => accept.split(",").map((accept2) => accept2.trim()), [accept]);
|
|
5676
5182
|
const parsedAccepts = (0, import_react40.useMemo)(
|
|
5677
5183
|
() => accepts.flatMap((type) => {
|
|
5678
5184
|
if (["image/*", "video/*", "audio/*"].includes(type)) {
|
|
@@ -5684,15 +5190,11 @@ var Uploader = import_react40.default.memo(
|
|
|
5684
5190
|
);
|
|
5685
5191
|
const helperText = (0, import_react40.useMemo)(() => {
|
|
5686
5192
|
const [allAcceptedTypes, acceptedTypes] = [
|
|
5687
|
-
accepts.filter(
|
|
5688
|
-
(accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)
|
|
5689
|
-
).map((accept2) => {
|
|
5193
|
+
accepts.filter((accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
|
|
5690
5194
|
const [type] = accept2.split("/");
|
|
5691
5195
|
return type.toLowerCase();
|
|
5692
5196
|
}),
|
|
5693
|
-
accepts.filter(
|
|
5694
|
-
(accept2) => !["image/*", "video/*", "audio/*"].includes(accept2)
|
|
5695
|
-
).map((accept2) => {
|
|
5197
|
+
accepts.filter((accept2) => !["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
|
|
5696
5198
|
const [extensionOrType, subType] = accept2.split("/");
|
|
5697
5199
|
if (!subType) {
|
|
5698
5200
|
return extensionOrType.toUpperCase().replace(".", "");
|
|
@@ -5709,16 +5211,11 @@ var Uploader = import_react40.default.memo(
|
|
|
5709
5211
|
}
|
|
5710
5212
|
helperTexts.push(`Maximum ${getFileSize(maxFileTotalSize)}`);
|
|
5711
5213
|
if (maxCount) {
|
|
5712
|
-
helperTexts.push(
|
|
5713
|
-
`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`
|
|
5714
|
-
);
|
|
5214
|
+
helperTexts.push(`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`);
|
|
5715
5215
|
}
|
|
5716
5216
|
return helperTexts.join(", ");
|
|
5717
5217
|
}, [accepts, maxFileTotalSize, maxCount]);
|
|
5718
|
-
const error = (0, import_react40.useMemo)(
|
|
5719
|
-
() => !!errorText || props.error,
|
|
5720
|
-
[props.error, errorText]
|
|
5721
|
-
);
|
|
5218
|
+
const error = (0, import_react40.useMemo)(() => !!errorText || props.error, [props.error, errorText]);
|
|
5722
5219
|
const showDropZone = (0, import_react40.useMemo)(
|
|
5723
5220
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
5724
5221
|
[files, maxCount, uploaded]
|
|
@@ -5745,10 +5242,7 @@ var Uploader = import_react40.default.memo(
|
|
|
5745
5242
|
}
|
|
5746
5243
|
});
|
|
5747
5244
|
}
|
|
5748
|
-
const totalFileSize = [...files, ...uploads].reduce(
|
|
5749
|
-
(acc, file) => acc + file.size,
|
|
5750
|
-
0
|
|
5751
|
-
);
|
|
5245
|
+
const totalFileSize = [...files, ...uploads].reduce((acc, file) => acc + file.size, 0);
|
|
5752
5246
|
if (totalFileSize > maxFileTotalSize) {
|
|
5753
5247
|
throw new Error(`Total File size exceeded the maximum limit.`);
|
|
5754
5248
|
}
|
|
@@ -5769,34 +5263,15 @@ var Uploader = import_react40.default.memo(
|
|
|
5769
5263
|
setErrorText(err.message);
|
|
5770
5264
|
}
|
|
5771
5265
|
},
|
|
5772
|
-
[
|
|
5773
|
-
files,
|
|
5774
|
-
uploaded,
|
|
5775
|
-
maxCount,
|
|
5776
|
-
parsedAccepts,
|
|
5777
|
-
maxFileSize,
|
|
5778
|
-
maxFileTotalSize,
|
|
5779
|
-
name,
|
|
5780
|
-
onChange
|
|
5781
|
-
]
|
|
5266
|
+
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
5782
5267
|
);
|
|
5783
5268
|
(0, import_react40.useEffect)(() => {
|
|
5784
5269
|
if (!dropZoneRef.current || disabled) {
|
|
5785
5270
|
return;
|
|
5786
5271
|
}
|
|
5787
5272
|
let cleanup;
|
|
5788
|
-
Promise.all([
|
|
5789
|
-
|
|
5790
|
-
esmFiles.adapter,
|
|
5791
|
-
esmFiles.file,
|
|
5792
|
-
esmFiles.preventUnhandled
|
|
5793
|
-
]).then(
|
|
5794
|
-
([
|
|
5795
|
-
combineModule,
|
|
5796
|
-
adapterModule,
|
|
5797
|
-
fileModule,
|
|
5798
|
-
preventUnhandledModule
|
|
5799
|
-
]) => {
|
|
5273
|
+
Promise.all([esmFiles.combine, esmFiles.adapter, esmFiles.file, esmFiles.preventUnhandled]).then(
|
|
5274
|
+
([combineModule, adapterModule, fileModule, preventUnhandledModule]) => {
|
|
5800
5275
|
const { combine } = combineModule;
|
|
5801
5276
|
const { dropTargetForExternal, monitorForExternal } = adapterModule;
|
|
5802
5277
|
const { containsFiles, getFiles } = fileModule;
|
|
@@ -5831,9 +5306,7 @@ var Uploader = import_react40.default.memo(
|
|
|
5831
5306
|
(0, import_react40.useEffect)(() => {
|
|
5832
5307
|
if (inputRef.current && minCount) {
|
|
5833
5308
|
if (files.length < minCount) {
|
|
5834
|
-
inputRef.current.setCustomValidity(
|
|
5835
|
-
`At least ${minCount} files are required.`
|
|
5836
|
-
);
|
|
5309
|
+
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
5837
5310
|
} else {
|
|
5838
5311
|
inputRef.current.setCustomValidity("");
|
|
5839
5312
|
}
|
|
@@ -5859,9 +5332,7 @@ var Uploader = import_react40.default.memo(
|
|
|
5859
5332
|
return current.filter((file) => file !== deletedFile);
|
|
5860
5333
|
});
|
|
5861
5334
|
} else {
|
|
5862
|
-
setUploaded(
|
|
5863
|
-
(uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id)
|
|
5864
|
-
);
|
|
5335
|
+
setUploaded((uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id));
|
|
5865
5336
|
onDelete?.(deletedFile);
|
|
5866
5337
|
}
|
|
5867
5338
|
setErrorText(void 0);
|
|
@@ -5887,9 +5358,7 @@ var Uploader = import_react40.default.memo(
|
|
|
5887
5358
|
required: !!minCount,
|
|
5888
5359
|
onInvalid: (e) => {
|
|
5889
5360
|
if (minCount && files.length < minCount) {
|
|
5890
|
-
setErrorText(
|
|
5891
|
-
`Please choose ${minCount} ${minCount === 1 ? "file" : "files"} to upload.`
|
|
5892
|
-
);
|
|
5361
|
+
setErrorText(`Please choose ${minCount} ${minCount === 1 ? "file" : "files"} to upload.`);
|
|
5893
5362
|
}
|
|
5894
5363
|
},
|
|
5895
5364
|
slotProps: {
|
|
@@ -5905,25 +5374,7 @@ var Uploader = import_react40.default.memo(
|
|
|
5905
5374
|
}
|
|
5906
5375
|
)
|
|
5907
5376
|
);
|
|
5908
|
-
return /* @__PURE__ */ import_react40.default.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ import_react40.default.createElement(
|
|
5909
|
-
FormControl_default,
|
|
5910
|
-
{
|
|
5911
|
-
size,
|
|
5912
|
-
error: !!(error || errorText),
|
|
5913
|
-
disabled,
|
|
5914
|
-
required: !!minCount
|
|
5915
|
-
},
|
|
5916
|
-
label && /* @__PURE__ */ import_react40.default.createElement(FormLabel_default, null, label),
|
|
5917
|
-
uploader,
|
|
5918
|
-
/* @__PURE__ */ import_react40.default.createElement(FormHelperText_default, null, /* @__PURE__ */ import_react40.default.createElement(Stack_default, null, errorText && /* @__PURE__ */ import_react40.default.createElement("div", null, errorText), /* @__PURE__ */ import_react40.default.createElement("div", null, helperText)))
|
|
5919
|
-
), [...uploaded, ...files].length > 0 && /* @__PURE__ */ import_react40.default.createElement(
|
|
5920
|
-
Preview,
|
|
5921
|
-
{
|
|
5922
|
-
files,
|
|
5923
|
-
uploaded,
|
|
5924
|
-
onDelete: handleDeleteFile
|
|
5925
|
-
}
|
|
5926
|
-
));
|
|
5377
|
+
return /* @__PURE__ */ import_react40.default.createElement(UploaderRoot, null, showDropZone && /* @__PURE__ */ import_react40.default.createElement(FormControl_default, { size, error: !!(error || errorText), disabled, required: !!minCount }, label && /* @__PURE__ */ import_react40.default.createElement(FormLabel_default, null, label), uploader, /* @__PURE__ */ import_react40.default.createElement(FormHelperText_default, null, /* @__PURE__ */ import_react40.default.createElement(Stack_default, null, errorText && /* @__PURE__ */ import_react40.default.createElement("div", null, errorText), /* @__PURE__ */ import_react40.default.createElement("div", null, helperText)))), [...uploaded, ...files].length > 0 && /* @__PURE__ */ import_react40.default.createElement(Preview, { files, uploaded, onDelete: handleDeleteFile }));
|
|
5927
5378
|
}
|
|
5928
5379
|
);
|
|
5929
5380
|
Uploader.displayName = "Uploader";
|
|
@@ -5977,15 +5428,7 @@ function IconMenuButton(props) {
|
|
|
5977
5428
|
}
|
|
5978
5429
|
},
|
|
5979
5430
|
icon
|
|
5980
|
-
), /* @__PURE__ */ import_react41.default.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ import_react41.default.createElement(
|
|
5981
|
-
MenuItem,
|
|
5982
|
-
{
|
|
5983
|
-
key: i.text,
|
|
5984
|
-
component: i.component,
|
|
5985
|
-
...i.componentProps ?? {}
|
|
5986
|
-
},
|
|
5987
|
-
i.text
|
|
5988
|
-
))));
|
|
5431
|
+
), /* @__PURE__ */ import_react41.default.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ import_react41.default.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
5989
5432
|
}
|
|
5990
5433
|
IconMenuButton.displayName = "IconMenuButton";
|
|
5991
5434
|
|
|
@@ -6019,52 +5462,33 @@ var Markdown = (props) => {
|
|
|
6019
5462
|
if (!rehypeAccent2) {
|
|
6020
5463
|
return null;
|
|
6021
5464
|
}
|
|
6022
|
-
return /* @__PURE__ */ import_react42.default.createElement(
|
|
6023
|
-
|
|
5465
|
+
return /* @__PURE__ */ import_react42.default.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ import_react42.default.createElement(
|
|
5466
|
+
import_react42.Suspense,
|
|
6024
5467
|
{
|
|
6025
|
-
|
|
6026
|
-
color,
|
|
6027
|
-
textColor,
|
|
6028
|
-
level: defaultLevel,
|
|
6029
|
-
...innerProps
|
|
5468
|
+
fallback: fallback || /* @__PURE__ */ import_react42.default.createElement(Typography, null, /* @__PURE__ */ import_react42.default.createElement(import_joy55.Skeleton, null, content || ""))
|
|
6030
5469
|
},
|
|
6031
5470
|
/* @__PURE__ */ import_react42.default.createElement(
|
|
6032
|
-
|
|
5471
|
+
LazyReactMarkdown,
|
|
6033
5472
|
{
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
{
|
|
6039
|
-
|
|
6040
|
-
children:
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
Typography,
|
|
6050
|
-
{
|
|
6051
|
-
color,
|
|
6052
|
-
textColor,
|
|
6053
|
-
level: defaultLevel,
|
|
6054
|
-
...node?.properties
|
|
6055
|
-
},
|
|
6056
|
-
children
|
|
6057
|
-
),
|
|
6058
|
-
a: ({ children, href }) => /* @__PURE__ */ import_react42.default.createElement(import_joy56.Link, { href, target: defaultLinkAction }, children),
|
|
6059
|
-
hr: () => /* @__PURE__ */ import_react42.default.createElement(Divider, null),
|
|
6060
|
-
b: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
6061
|
-
strong: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
6062
|
-
...markdownOptions?.components
|
|
6063
|
-
}
|
|
5473
|
+
...markdownOptions,
|
|
5474
|
+
children: content,
|
|
5475
|
+
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
5476
|
+
remarkPlugins: [import_remark_gfm.default],
|
|
5477
|
+
components: {
|
|
5478
|
+
h1: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { color, textColor, level: "h1" }, children),
|
|
5479
|
+
h2: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { color, textColor, level: "h2" }, children),
|
|
5480
|
+
h3: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { color, textColor, level: "h3" }, children),
|
|
5481
|
+
h4: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { color, textColor, level: "h4" }, children),
|
|
5482
|
+
p: ({ children, node }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { color, textColor, level: defaultLevel, ...node?.properties }, children),
|
|
5483
|
+
a: ({ children, href }) => /* @__PURE__ */ import_react42.default.createElement(import_joy56.Link, { href, target: defaultLinkAction }, children),
|
|
5484
|
+
hr: () => /* @__PURE__ */ import_react42.default.createElement(Divider, null),
|
|
5485
|
+
b: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
5486
|
+
strong: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
5487
|
+
...markdownOptions?.components
|
|
6064
5488
|
}
|
|
6065
|
-
|
|
5489
|
+
}
|
|
6066
5490
|
)
|
|
6067
|
-
);
|
|
5491
|
+
));
|
|
6068
5492
|
};
|
|
6069
5493
|
Markdown.displayName = "Markdown";
|
|
6070
5494
|
|
|
@@ -6117,15 +5541,7 @@ function MenuButton(props) {
|
|
|
6117
5541
|
endDecorator: showIcon ? /* @__PURE__ */ import_react43.default.createElement(import_react43.default.Fragment, null, endDecorator, /* @__PURE__ */ import_react43.default.createElement(import_ExpandMore.default, null)) : /* @__PURE__ */ import_react43.default.createElement(import_react43.default.Fragment, null, endDecorator)
|
|
6118
5542
|
},
|
|
6119
5543
|
buttonText
|
|
6120
|
-
), /* @__PURE__ */ import_react43.default.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ import_react43.default.createElement(
|
|
6121
|
-
MenuItem,
|
|
6122
|
-
{
|
|
6123
|
-
key: i.text,
|
|
6124
|
-
component: i.component,
|
|
6125
|
-
...i.componentProps ?? {}
|
|
6126
|
-
},
|
|
6127
|
-
i.text
|
|
6128
|
-
))));
|
|
5544
|
+
), /* @__PURE__ */ import_react43.default.createElement(Menu, { placement, size }, items.map((i) => /* @__PURE__ */ import_react43.default.createElement(MenuItem, { key: i.text, component: i.component, ...i.componentProps ?? {} }, i.text))));
|
|
6129
5545
|
}
|
|
6130
5546
|
MenuButton.displayName = "MenuButton";
|
|
6131
5547
|
|
|
@@ -6185,215 +5601,202 @@ function parseDate3(dateString, format) {
|
|
|
6185
5601
|
const result = new Date(year, month, day);
|
|
6186
5602
|
return result;
|
|
6187
5603
|
}
|
|
6188
|
-
var MonthPicker = (0, import_react44.forwardRef)(
|
|
6189
|
-
(
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
5604
|
+
var MonthPicker = (0, import_react44.forwardRef)((inProps, ref) => {
|
|
5605
|
+
const props = (0, import_joy58.useThemeProps)({ props: inProps, name: "MonthPicker" });
|
|
5606
|
+
const {
|
|
5607
|
+
onChange,
|
|
5608
|
+
disabled,
|
|
5609
|
+
label,
|
|
5610
|
+
error,
|
|
5611
|
+
helperText,
|
|
5612
|
+
minDate,
|
|
5613
|
+
maxDate,
|
|
5614
|
+
disableFuture,
|
|
5615
|
+
disablePast,
|
|
5616
|
+
required,
|
|
5617
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
5618
|
+
sx,
|
|
5619
|
+
className,
|
|
5620
|
+
/**
|
|
5621
|
+
* NOTE: 현재 CalendarDate는 YYYY-MM-DD로 개발하고 있어 date를 포함하여 value를 관리한다.
|
|
5622
|
+
* @see https://ecubelabs.atlassian.net/wiki/spaces/SW/pages/1938784349/Date#CalendarDate
|
|
5623
|
+
* @see https://github.com/Ecube-Labs/hds/pull/145
|
|
5624
|
+
*/
|
|
5625
|
+
format = "YYYY/MM/DD",
|
|
5626
|
+
displayFormat = "YYYY/MM",
|
|
5627
|
+
size,
|
|
5628
|
+
locale,
|
|
5629
|
+
...innerProps
|
|
5630
|
+
} = props;
|
|
5631
|
+
const innerRef = (0, import_react44.useRef)(null);
|
|
5632
|
+
const buttonRef = (0, import_react44.useRef)(null);
|
|
5633
|
+
const [value, setValue, isControlled] = useControlledState(
|
|
5634
|
+
props.value,
|
|
5635
|
+
props.defaultValue || "",
|
|
5636
|
+
(0, import_react44.useCallback)((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
5637
|
+
);
|
|
5638
|
+
const getFormattedDisplayValue = (0, import_react44.useCallback)(
|
|
5639
|
+
(inputValue) => {
|
|
5640
|
+
if (!inputValue) return "";
|
|
5641
|
+
try {
|
|
5642
|
+
return formatValueString3(parseDate3(inputValue, format), displayFormat, locale);
|
|
5643
|
+
} catch (e) {
|
|
5644
|
+
return inputValue;
|
|
5645
|
+
}
|
|
5646
|
+
},
|
|
5647
|
+
[format, displayFormat, locale]
|
|
5648
|
+
);
|
|
5649
|
+
const [displayValue, setDisplayValue] = (0, import_react44.useState)(() => getFormattedDisplayValue(value));
|
|
5650
|
+
const [anchorEl, setAnchorEl] = (0, import_react44.useState)(null);
|
|
5651
|
+
const open = Boolean(anchorEl);
|
|
5652
|
+
(0, import_react44.useEffect)(() => {
|
|
5653
|
+
if (!anchorEl) {
|
|
5654
|
+
innerRef.current?.blur();
|
|
5655
|
+
}
|
|
5656
|
+
}, [anchorEl, innerRef]);
|
|
5657
|
+
(0, import_react44.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
5658
|
+
(0, import_react44.useEffect)(() => {
|
|
5659
|
+
setDisplayValue(getFormattedDisplayValue(value));
|
|
5660
|
+
}, [value, getFormattedDisplayValue]);
|
|
5661
|
+
const handleChange = (0, import_react44.useCallback)(
|
|
5662
|
+
(event) => {
|
|
5663
|
+
const newValue = event.target.value;
|
|
5664
|
+
setValue(newValue);
|
|
5665
|
+
if (!isControlled) {
|
|
5666
|
+
setDisplayValue(getFormattedDisplayValue(newValue));
|
|
5667
|
+
}
|
|
5668
|
+
},
|
|
5669
|
+
[setValue, getFormattedDisplayValue, isControlled]
|
|
5670
|
+
);
|
|
5671
|
+
const handleCalendarToggle = (0, import_react44.useCallback)(
|
|
5672
|
+
(event) => {
|
|
5673
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5674
|
+
innerRef.current?.focus();
|
|
5675
|
+
},
|
|
5676
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
5677
|
+
);
|
|
5678
|
+
const handleInputMouseDown = (0, import_react44.useCallback)(
|
|
5679
|
+
(event) => {
|
|
5680
|
+
event.preventDefault();
|
|
5681
|
+
buttonRef.current?.focus();
|
|
5682
|
+
},
|
|
5683
|
+
[buttonRef]
|
|
5684
|
+
);
|
|
5685
|
+
return /* @__PURE__ */ import_react44.default.createElement(MonthPickerRoot, null, /* @__PURE__ */ import_react44.default.createElement(import_base4.FocusTrap, { open: true }, /* @__PURE__ */ import_react44.default.createElement(import_react44.default.Fragment, null, /* @__PURE__ */ import_react44.default.createElement(
|
|
5686
|
+
Input_default,
|
|
5687
|
+
{
|
|
5688
|
+
...innerProps,
|
|
5689
|
+
color: error ? "danger" : innerProps.color,
|
|
5690
|
+
ref: innerRef,
|
|
5691
|
+
size,
|
|
5692
|
+
value: displayValue,
|
|
5693
|
+
placeholder: displayFormat,
|
|
6193
5694
|
disabled,
|
|
6194
|
-
label,
|
|
6195
|
-
error,
|
|
6196
|
-
helperText,
|
|
6197
|
-
minDate,
|
|
6198
|
-
maxDate,
|
|
6199
|
-
disableFuture,
|
|
6200
|
-
disablePast,
|
|
6201
5695
|
required,
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
size,
|
|
6213
|
-
locale,
|
|
6214
|
-
...innerProps
|
|
6215
|
-
} = props;
|
|
6216
|
-
const innerRef = (0, import_react44.useRef)(null);
|
|
6217
|
-
const buttonRef = (0, import_react44.useRef)(null);
|
|
6218
|
-
const [value, setValue, isControlled] = useControlledState(
|
|
6219
|
-
props.value,
|
|
6220
|
-
props.defaultValue || "",
|
|
6221
|
-
(0, import_react44.useCallback)(
|
|
6222
|
-
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
6223
|
-
[props.name, onChange]
|
|
6224
|
-
)
|
|
6225
|
-
);
|
|
6226
|
-
const getFormattedDisplayValue = (0, import_react44.useCallback)(
|
|
6227
|
-
(inputValue) => {
|
|
6228
|
-
if (!inputValue) return "";
|
|
6229
|
-
try {
|
|
6230
|
-
return formatValueString3(
|
|
6231
|
-
parseDate3(inputValue, format),
|
|
6232
|
-
displayFormat,
|
|
6233
|
-
locale
|
|
6234
|
-
);
|
|
6235
|
-
} catch (e) {
|
|
6236
|
-
return inputValue;
|
|
6237
|
-
}
|
|
6238
|
-
},
|
|
6239
|
-
[format, displayFormat, locale]
|
|
6240
|
-
);
|
|
6241
|
-
const [displayValue, setDisplayValue] = (0, import_react44.useState)(
|
|
6242
|
-
() => getFormattedDisplayValue(value)
|
|
6243
|
-
);
|
|
6244
|
-
const [anchorEl, setAnchorEl] = (0, import_react44.useState)(null);
|
|
6245
|
-
const open = Boolean(anchorEl);
|
|
6246
|
-
(0, import_react44.useEffect)(() => {
|
|
6247
|
-
if (!anchorEl) {
|
|
6248
|
-
innerRef.current?.blur();
|
|
6249
|
-
}
|
|
6250
|
-
}, [anchorEl, innerRef]);
|
|
6251
|
-
(0, import_react44.useImperativeHandle)(ref, () => innerRef.current, [
|
|
6252
|
-
innerRef
|
|
6253
|
-
]);
|
|
6254
|
-
(0, import_react44.useEffect)(() => {
|
|
6255
|
-
setDisplayValue(getFormattedDisplayValue(value));
|
|
6256
|
-
}, [value, getFormattedDisplayValue]);
|
|
6257
|
-
const handleChange = (0, import_react44.useCallback)(
|
|
6258
|
-
(event) => {
|
|
6259
|
-
const newValue = event.target.value;
|
|
6260
|
-
setValue(newValue);
|
|
6261
|
-
if (!isControlled) {
|
|
6262
|
-
setDisplayValue(getFormattedDisplayValue(newValue));
|
|
5696
|
+
slotProps: {
|
|
5697
|
+
input: {
|
|
5698
|
+
ref: innerRef,
|
|
5699
|
+
format: displayFormat,
|
|
5700
|
+
sx: {
|
|
5701
|
+
"&:hover": {
|
|
5702
|
+
cursor: "default"
|
|
5703
|
+
}
|
|
5704
|
+
},
|
|
5705
|
+
onMouseDown: handleInputMouseDown
|
|
6263
5706
|
}
|
|
6264
5707
|
},
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
},
|
|
6272
|
-
[anchorEl, setAnchorEl, innerRef]
|
|
6273
|
-
);
|
|
6274
|
-
const handleInputMouseDown = (0, import_react44.useCallback)(
|
|
6275
|
-
(event) => {
|
|
6276
|
-
event.preventDefault();
|
|
6277
|
-
buttonRef.current?.focus();
|
|
5708
|
+
error,
|
|
5709
|
+
className,
|
|
5710
|
+
sx: {
|
|
5711
|
+
...sx,
|
|
5712
|
+
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
5713
|
+
fontFamily: "monospace"
|
|
6278
5714
|
},
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
disabled,
|
|
6291
|
-
required,
|
|
6292
|
-
slotProps: {
|
|
6293
|
-
input: {
|
|
6294
|
-
ref: innerRef,
|
|
6295
|
-
format: displayFormat,
|
|
6296
|
-
sx: {
|
|
6297
|
-
"&:hover": {
|
|
6298
|
-
cursor: "default"
|
|
6299
|
-
}
|
|
6300
|
-
},
|
|
6301
|
-
onMouseDown: handleInputMouseDown
|
|
6302
|
-
}
|
|
5715
|
+
endDecorator: /* @__PURE__ */ import_react44.default.createElement(
|
|
5716
|
+
IconButton_default,
|
|
5717
|
+
{
|
|
5718
|
+
ref: buttonRef,
|
|
5719
|
+
variant: "plain",
|
|
5720
|
+
onClick: handleCalendarToggle,
|
|
5721
|
+
"aria-label": "Toggle Calendar",
|
|
5722
|
+
"aria-controls": "month-picker-popper",
|
|
5723
|
+
"aria-haspopup": "dialog",
|
|
5724
|
+
"aria-expanded": open,
|
|
5725
|
+
disabled
|
|
6303
5726
|
},
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
5727
|
+
/* @__PURE__ */ import_react44.default.createElement(import_CalendarToday3.default, null)
|
|
5728
|
+
),
|
|
5729
|
+
label,
|
|
5730
|
+
helperText
|
|
5731
|
+
}
|
|
5732
|
+
), open && /* @__PURE__ */ import_react44.default.createElement(import_base4.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react44.default.createElement(
|
|
5733
|
+
StyledPopper3,
|
|
5734
|
+
{
|
|
5735
|
+
id: "month-picker-popper",
|
|
5736
|
+
open: true,
|
|
5737
|
+
anchorEl,
|
|
5738
|
+
placement: "bottom-end",
|
|
5739
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
5740
|
+
modifiers: [
|
|
5741
|
+
{
|
|
5742
|
+
name: "offset",
|
|
5743
|
+
options: {
|
|
5744
|
+
offset: [4, 4]
|
|
5745
|
+
}
|
|
5746
|
+
}
|
|
5747
|
+
],
|
|
5748
|
+
"aria-label": "Calendar Tooltip",
|
|
5749
|
+
"aria-expanded": open
|
|
5750
|
+
},
|
|
5751
|
+
/* @__PURE__ */ import_react44.default.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react44.default.createElement(
|
|
5752
|
+
Calendar_default,
|
|
5753
|
+
{
|
|
5754
|
+
view: "month",
|
|
5755
|
+
views: ["month"],
|
|
5756
|
+
value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
|
|
5757
|
+
onChange: ([date]) => {
|
|
5758
|
+
handleChange({
|
|
5759
|
+
target: {
|
|
5760
|
+
name: props.name,
|
|
5761
|
+
value: formatValueString3(date, format, locale)
|
|
5762
|
+
}
|
|
5763
|
+
});
|
|
5764
|
+
setAnchorEl(null);
|
|
6310
5765
|
},
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
onClick: handleCalendarToggle,
|
|
6317
|
-
"aria-label": "Toggle Calendar",
|
|
6318
|
-
"aria-controls": "month-picker-popper",
|
|
6319
|
-
"aria-haspopup": "dialog",
|
|
6320
|
-
"aria-expanded": open,
|
|
6321
|
-
disabled
|
|
6322
|
-
},
|
|
6323
|
-
/* @__PURE__ */ import_react44.default.createElement(import_CalendarToday3.default, null)
|
|
6324
|
-
),
|
|
6325
|
-
label,
|
|
6326
|
-
helperText
|
|
5766
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
5767
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
5768
|
+
disableFuture,
|
|
5769
|
+
disablePast,
|
|
5770
|
+
locale
|
|
6327
5771
|
}
|
|
6328
|
-
),
|
|
6329
|
-
|
|
5772
|
+
), /* @__PURE__ */ import_react44.default.createElement(
|
|
5773
|
+
DialogActions_default,
|
|
6330
5774
|
{
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
placement: "bottom-end",
|
|
6335
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
6336
|
-
modifiers: [
|
|
6337
|
-
{
|
|
6338
|
-
name: "offset",
|
|
6339
|
-
options: {
|
|
6340
|
-
offset: [4, 4]
|
|
6341
|
-
}
|
|
6342
|
-
}
|
|
6343
|
-
],
|
|
6344
|
-
"aria-label": "Calendar Tooltip",
|
|
6345
|
-
"aria-expanded": open
|
|
5775
|
+
sx: {
|
|
5776
|
+
p: 1
|
|
5777
|
+
}
|
|
6346
5778
|
},
|
|
6347
|
-
/* @__PURE__ */ import_react44.default.createElement(
|
|
6348
|
-
|
|
5779
|
+
/* @__PURE__ */ import_react44.default.createElement(
|
|
5780
|
+
Button_default,
|
|
6349
5781
|
{
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
5782
|
+
size,
|
|
5783
|
+
variant: "plain",
|
|
5784
|
+
color: "neutral",
|
|
5785
|
+
onClick: () => {
|
|
6354
5786
|
handleChange({
|
|
6355
5787
|
target: {
|
|
6356
5788
|
name: props.name,
|
|
6357
|
-
value:
|
|
5789
|
+
value: ""
|
|
6358
5790
|
}
|
|
6359
5791
|
});
|
|
6360
5792
|
setAnchorEl(null);
|
|
6361
|
-
},
|
|
6362
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
6363
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
6364
|
-
disableFuture,
|
|
6365
|
-
disablePast,
|
|
6366
|
-
locale
|
|
6367
|
-
}
|
|
6368
|
-
), /* @__PURE__ */ import_react44.default.createElement(
|
|
6369
|
-
DialogActions_default,
|
|
6370
|
-
{
|
|
6371
|
-
sx: {
|
|
6372
|
-
p: 1
|
|
6373
5793
|
}
|
|
6374
5794
|
},
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
color: "neutral",
|
|
6381
|
-
onClick: () => {
|
|
6382
|
-
handleChange({
|
|
6383
|
-
target: {
|
|
6384
|
-
name: props.name,
|
|
6385
|
-
value: ""
|
|
6386
|
-
}
|
|
6387
|
-
});
|
|
6388
|
-
setAnchorEl(null);
|
|
6389
|
-
}
|
|
6390
|
-
},
|
|
6391
|
-
"Clear"
|
|
6392
|
-
)
|
|
6393
|
-
))
|
|
6394
|
-
)))));
|
|
6395
|
-
}
|
|
6396
|
-
);
|
|
5795
|
+
"Clear"
|
|
5796
|
+
)
|
|
5797
|
+
))
|
|
5798
|
+
)))));
|
|
5799
|
+
});
|
|
6397
5800
|
|
|
6398
5801
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
6399
5802
|
var import_react45 = __toESM(require("react"));
|
|
@@ -6454,196 +5857,184 @@ var parseDates2 = (str) => {
|
|
|
6454
5857
|
var formatToPattern3 = (format) => {
|
|
6455
5858
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
|
|
6456
5859
|
};
|
|
6457
|
-
var TextMaskAdapter9 = import_react45.default.forwardRef(
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
maxLength: 2
|
|
6474
|
-
},
|
|
6475
|
-
Y: {
|
|
6476
|
-
mask: import_react_imask3.IMask.MaskedRange,
|
|
6477
|
-
from: 1900,
|
|
6478
|
-
to: 9999
|
|
6479
|
-
}
|
|
5860
|
+
var TextMaskAdapter9 = import_react45.default.forwardRef(function TextMaskAdapter10(props, ref) {
|
|
5861
|
+
const { onChange, format, ...other } = props;
|
|
5862
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
5863
|
+
import_react_imask3.IMaskInput,
|
|
5864
|
+
{
|
|
5865
|
+
...other,
|
|
5866
|
+
inputRef: ref,
|
|
5867
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
5868
|
+
mask: Date,
|
|
5869
|
+
pattern: formatToPattern3(format),
|
|
5870
|
+
blocks: {
|
|
5871
|
+
m: {
|
|
5872
|
+
mask: import_react_imask3.IMask.MaskedRange,
|
|
5873
|
+
from: 1,
|
|
5874
|
+
to: 12,
|
|
5875
|
+
maxLength: 2
|
|
6480
5876
|
},
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
5877
|
+
Y: {
|
|
5878
|
+
mask: import_react_imask3.IMask.MaskedRange,
|
|
5879
|
+
from: 1900,
|
|
5880
|
+
to: 9999
|
|
5881
|
+
}
|
|
5882
|
+
},
|
|
5883
|
+
format: (dates) => formatValueString4(dates, format),
|
|
5884
|
+
parse: parseDates2,
|
|
5885
|
+
autofix: "pad",
|
|
5886
|
+
overwrite: true
|
|
5887
|
+
}
|
|
5888
|
+
);
|
|
5889
|
+
});
|
|
5890
|
+
var MonthRangePicker = (0, import_react45.forwardRef)((inProps, ref) => {
|
|
5891
|
+
const props = (0, import_joy59.useThemeProps)({ props: inProps, name: "MonthRangePicker" });
|
|
5892
|
+
const {
|
|
5893
|
+
onChange,
|
|
5894
|
+
disabled,
|
|
5895
|
+
label,
|
|
5896
|
+
error,
|
|
5897
|
+
helperText,
|
|
5898
|
+
minDate,
|
|
5899
|
+
maxDate,
|
|
5900
|
+
disableFuture,
|
|
5901
|
+
disablePast,
|
|
5902
|
+
required,
|
|
5903
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
5904
|
+
sx,
|
|
5905
|
+
className,
|
|
5906
|
+
format = "YYYY/MM",
|
|
5907
|
+
size,
|
|
5908
|
+
...innerProps
|
|
5909
|
+
} = props;
|
|
5910
|
+
const innerRef = (0, import_react45.useRef)(null);
|
|
5911
|
+
const [value, setValue] = useControlledState(
|
|
5912
|
+
props.value,
|
|
5913
|
+
props.defaultValue || "",
|
|
5914
|
+
(0, import_react45.useCallback)((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
5915
|
+
);
|
|
5916
|
+
const [anchorEl, setAnchorEl] = (0, import_react45.useState)(null);
|
|
5917
|
+
const open = Boolean(anchorEl);
|
|
5918
|
+
const calendarValue = (0, import_react45.useMemo)(() => value ? parseDates2(value) : void 0, [value]);
|
|
5919
|
+
(0, import_react45.useEffect)(() => {
|
|
5920
|
+
if (!anchorEl) {
|
|
5921
|
+
innerRef.current?.blur();
|
|
5922
|
+
}
|
|
5923
|
+
}, [anchorEl, innerRef]);
|
|
5924
|
+
(0, import_react45.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
5925
|
+
const handleChange = (0, import_react45.useCallback)(
|
|
5926
|
+
(event) => {
|
|
5927
|
+
setValue(event.target.value);
|
|
5928
|
+
},
|
|
5929
|
+
[setValue]
|
|
5930
|
+
);
|
|
5931
|
+
const handleCalendarToggle = (0, import_react45.useCallback)(
|
|
5932
|
+
(event) => {
|
|
5933
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5934
|
+
innerRef.current?.focus();
|
|
5935
|
+
},
|
|
5936
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
5937
|
+
);
|
|
5938
|
+
const handleCalendarChange = (0, import_react45.useCallback)(
|
|
5939
|
+
([date1, date2]) => {
|
|
5940
|
+
if (!date1 || !date2) return;
|
|
5941
|
+
setValue(formatValueString4([date1, date2], format));
|
|
5942
|
+
setAnchorEl(null);
|
|
5943
|
+
},
|
|
5944
|
+
[setValue, setAnchorEl, format]
|
|
5945
|
+
);
|
|
5946
|
+
return /* @__PURE__ */ import_react45.default.createElement(MonthRangePickerRoot, null, /* @__PURE__ */ import_react45.default.createElement(import_base5.FocusTrap, { open: true }, /* @__PURE__ */ import_react45.default.createElement(import_react45.default.Fragment, null, /* @__PURE__ */ import_react45.default.createElement(
|
|
5947
|
+
Input_default,
|
|
5948
|
+
{
|
|
5949
|
+
...innerProps,
|
|
5950
|
+
color: error ? "danger" : innerProps.color,
|
|
5951
|
+
ref,
|
|
5952
|
+
size,
|
|
5953
|
+
value,
|
|
5954
|
+
onChange: handleChange,
|
|
6494
5955
|
disabled,
|
|
6495
|
-
label,
|
|
6496
|
-
error,
|
|
6497
|
-
helperText,
|
|
6498
|
-
minDate,
|
|
6499
|
-
maxDate,
|
|
6500
|
-
disableFuture,
|
|
6501
|
-
disablePast,
|
|
6502
5956
|
required,
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
format = "YYYY/MM",
|
|
6507
|
-
size,
|
|
6508
|
-
...innerProps
|
|
6509
|
-
} = props;
|
|
6510
|
-
const innerRef = (0, import_react45.useRef)(null);
|
|
6511
|
-
const [value, setValue] = useControlledState(
|
|
6512
|
-
props.value,
|
|
6513
|
-
props.defaultValue || "",
|
|
6514
|
-
(0, import_react45.useCallback)(
|
|
6515
|
-
(value2) => onChange?.({ target: { name: props.name, value: value2 } }),
|
|
6516
|
-
[props.name, onChange]
|
|
6517
|
-
)
|
|
6518
|
-
);
|
|
6519
|
-
const [anchorEl, setAnchorEl] = (0, import_react45.useState)(null);
|
|
6520
|
-
const open = Boolean(anchorEl);
|
|
6521
|
-
const calendarValue = (0, import_react45.useMemo)(
|
|
6522
|
-
() => value ? parseDates2(value) : void 0,
|
|
6523
|
-
[value]
|
|
6524
|
-
);
|
|
6525
|
-
(0, import_react45.useEffect)(() => {
|
|
6526
|
-
if (!anchorEl) {
|
|
6527
|
-
innerRef.current?.blur();
|
|
6528
|
-
}
|
|
6529
|
-
}, [anchorEl, innerRef]);
|
|
6530
|
-
(0, import_react45.useImperativeHandle)(ref, () => innerRef.current, [
|
|
6531
|
-
innerRef
|
|
6532
|
-
]);
|
|
6533
|
-
const handleChange = (0, import_react45.useCallback)(
|
|
6534
|
-
(event) => {
|
|
6535
|
-
setValue(event.target.value);
|
|
6536
|
-
},
|
|
6537
|
-
[setValue]
|
|
6538
|
-
);
|
|
6539
|
-
const handleCalendarToggle = (0, import_react45.useCallback)(
|
|
6540
|
-
(event) => {
|
|
6541
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
6542
|
-
innerRef.current?.focus();
|
|
5957
|
+
placeholder: `${format} - ${format}`,
|
|
5958
|
+
slotProps: {
|
|
5959
|
+
input: { component: TextMaskAdapter9, ref: innerRef, format }
|
|
6543
5960
|
},
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
setAnchorEl(null);
|
|
5961
|
+
error,
|
|
5962
|
+
className,
|
|
5963
|
+
sx: {
|
|
5964
|
+
...sx,
|
|
5965
|
+
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
5966
|
+
fontFamily: "monospace"
|
|
6551
5967
|
},
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
value,
|
|
6562
|
-
onChange: handleChange,
|
|
6563
|
-
disabled,
|
|
6564
|
-
required,
|
|
6565
|
-
placeholder: `${format} - ${format}`,
|
|
6566
|
-
slotProps: {
|
|
6567
|
-
input: { component: TextMaskAdapter9, ref: innerRef, format }
|
|
6568
|
-
},
|
|
6569
|
-
error,
|
|
6570
|
-
className,
|
|
6571
|
-
sx: {
|
|
6572
|
-
...sx,
|
|
6573
|
-
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
6574
|
-
fontFamily: "monospace"
|
|
5968
|
+
endDecorator: /* @__PURE__ */ import_react45.default.createElement(
|
|
5969
|
+
IconButton_default,
|
|
5970
|
+
{
|
|
5971
|
+
variant: "plain",
|
|
5972
|
+
onClick: handleCalendarToggle,
|
|
5973
|
+
"aria-label": "Toggle Calendar",
|
|
5974
|
+
"aria-controls": "month-range-picker-popper",
|
|
5975
|
+
"aria-haspopup": "dialog",
|
|
5976
|
+
"aria-expanded": open
|
|
6575
5977
|
},
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
5978
|
+
/* @__PURE__ */ import_react45.default.createElement(import_CalendarToday4.default, null)
|
|
5979
|
+
),
|
|
5980
|
+
label,
|
|
5981
|
+
helperText
|
|
5982
|
+
}
|
|
5983
|
+
), open && /* @__PURE__ */ import_react45.default.createElement(import_base5.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react45.default.createElement(
|
|
5984
|
+
StyledPopper4,
|
|
5985
|
+
{
|
|
5986
|
+
id: "month-range-picker-popper",
|
|
5987
|
+
open: true,
|
|
5988
|
+
anchorEl,
|
|
5989
|
+
placement: "bottom-end",
|
|
5990
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
5991
|
+
modifiers: [
|
|
5992
|
+
{
|
|
5993
|
+
name: "offset",
|
|
5994
|
+
options: {
|
|
5995
|
+
offset: [4, 4]
|
|
5996
|
+
}
|
|
5997
|
+
}
|
|
5998
|
+
],
|
|
5999
|
+
"aria-label": "Calendar Tooltip",
|
|
6000
|
+
"aria-expanded": open
|
|
6001
|
+
},
|
|
6002
|
+
/* @__PURE__ */ import_react45.default.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react45.default.createElement(
|
|
6003
|
+
Calendar_default,
|
|
6004
|
+
{
|
|
6005
|
+
view: "month",
|
|
6006
|
+
views: ["month"],
|
|
6007
|
+
rangeSelection: true,
|
|
6008
|
+
defaultValue: calendarValue,
|
|
6009
|
+
onChange: handleCalendarChange,
|
|
6010
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
6011
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
6012
|
+
disableFuture,
|
|
6013
|
+
disablePast
|
|
6590
6014
|
}
|
|
6591
|
-
),
|
|
6592
|
-
|
|
6015
|
+
), /* @__PURE__ */ import_react45.default.createElement(
|
|
6016
|
+
DialogActions_default,
|
|
6593
6017
|
{
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
anchorEl,
|
|
6597
|
-
placement: "bottom-end",
|
|
6598
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
6599
|
-
modifiers: [
|
|
6600
|
-
{
|
|
6601
|
-
name: "offset",
|
|
6602
|
-
options: {
|
|
6603
|
-
offset: [4, 4]
|
|
6604
|
-
}
|
|
6605
|
-
}
|
|
6606
|
-
],
|
|
6607
|
-
"aria-label": "Calendar Tooltip",
|
|
6608
|
-
"aria-expanded": open
|
|
6609
|
-
},
|
|
6610
|
-
/* @__PURE__ */ import_react45.default.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react45.default.createElement(
|
|
6611
|
-
Calendar_default,
|
|
6612
|
-
{
|
|
6613
|
-
view: "month",
|
|
6614
|
-
views: ["month"],
|
|
6615
|
-
rangeSelection: true,
|
|
6616
|
-
defaultValue: calendarValue,
|
|
6617
|
-
onChange: handleCalendarChange,
|
|
6618
|
-
minDate: minDate ? new Date(minDate) : void 0,
|
|
6619
|
-
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
6620
|
-
disableFuture,
|
|
6621
|
-
disablePast
|
|
6018
|
+
sx: {
|
|
6019
|
+
p: 1
|
|
6622
6020
|
}
|
|
6623
|
-
|
|
6624
|
-
|
|
6021
|
+
},
|
|
6022
|
+
/* @__PURE__ */ import_react45.default.createElement(
|
|
6023
|
+
Button_default,
|
|
6625
6024
|
{
|
|
6626
|
-
|
|
6627
|
-
|
|
6025
|
+
size,
|
|
6026
|
+
variant: "plain",
|
|
6027
|
+
color: "neutral",
|
|
6028
|
+
onClick: () => {
|
|
6029
|
+
setValue("");
|
|
6030
|
+
setAnchorEl(null);
|
|
6628
6031
|
}
|
|
6629
6032
|
},
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
color: "neutral",
|
|
6636
|
-
onClick: () => {
|
|
6637
|
-
setValue("");
|
|
6638
|
-
setAnchorEl(null);
|
|
6639
|
-
}
|
|
6640
|
-
},
|
|
6641
|
-
"Clear"
|
|
6642
|
-
)
|
|
6643
|
-
))
|
|
6644
|
-
)))));
|
|
6645
|
-
}
|
|
6646
|
-
);
|
|
6033
|
+
"Clear"
|
|
6034
|
+
)
|
|
6035
|
+
))
|
|
6036
|
+
)))));
|
|
6037
|
+
});
|
|
6647
6038
|
MonthRangePicker.displayName = "MonthRangePicker";
|
|
6648
6039
|
|
|
6649
6040
|
// src/components/NavigationGroup/NavigationGroup.tsx
|
|
@@ -6768,23 +6159,9 @@ var StyledProfileCard = (0, import_joy62.styled)(import_joy3.Stack, {
|
|
|
6768
6159
|
})({});
|
|
6769
6160
|
function ProfileCard(props) {
|
|
6770
6161
|
const { children, chip, caption, size } = props;
|
|
6771
|
-
const captionLevel = (0, import_react49.useMemo)(
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
);
|
|
6775
|
-
const nameLevel = (0, import_react49.useMemo)(
|
|
6776
|
-
() => size === "sm" ? "body-sm" : "body-md",
|
|
6777
|
-
[size]
|
|
6778
|
-
);
|
|
6779
|
-
return /* @__PURE__ */ import_react49.default.createElement(StyledProfileCard, { px: 4, py: 2 }, /* @__PURE__ */ import_react49.default.createElement(import_joy3.Stack, { direction: "row", gap: 2 }, /* @__PURE__ */ import_react49.default.createElement(
|
|
6780
|
-
Typography,
|
|
6781
|
-
{
|
|
6782
|
-
level: nameLevel,
|
|
6783
|
-
fontWeight: "bold",
|
|
6784
|
-
textColor: "text.primary"
|
|
6785
|
-
},
|
|
6786
|
-
children
|
|
6787
|
-
), chip && /* @__PURE__ */ import_react49.default.createElement(Chip, { size, color: "neutral", variant: "outlined" }, chip)), caption && /* @__PURE__ */ import_react49.default.createElement(Typography, { level: captionLevel, textColor: "text.tertiary" }, caption));
|
|
6162
|
+
const captionLevel = (0, import_react49.useMemo)(() => size === "sm" ? "body-xs" : "body-sm", [size]);
|
|
6163
|
+
const nameLevel = (0, import_react49.useMemo)(() => size === "sm" ? "body-sm" : "body-md", [size]);
|
|
6164
|
+
return /* @__PURE__ */ import_react49.default.createElement(StyledProfileCard, { px: 4, py: 2 }, /* @__PURE__ */ import_react49.default.createElement(import_joy3.Stack, { direction: "row", gap: 2 }, /* @__PURE__ */ import_react49.default.createElement(Typography, { level: nameLevel, fontWeight: "bold", textColor: "text.primary" }, children), chip && /* @__PURE__ */ import_react49.default.createElement(Chip, { size, color: "neutral", variant: "outlined" }, chip)), caption && /* @__PURE__ */ import_react49.default.createElement(Typography, { level: captionLevel, textColor: "text.tertiary" }, caption));
|
|
6788
6165
|
}
|
|
6789
6166
|
ProfileCard.displayName = "ProfileCard";
|
|
6790
6167
|
var StyledProfileMenuButton = (0, import_joy62.styled)(import_joy62.MenuButton, {
|
|
@@ -6805,18 +6182,7 @@ function ProfileMenuButton(props) {
|
|
|
6805
6182
|
endDecorator: /* @__PURE__ */ import_react49.default.createElement(import_ArrowDropDown.default, null),
|
|
6806
6183
|
...innerProps
|
|
6807
6184
|
},
|
|
6808
|
-
/* @__PURE__ */ import_react49.default.createElement(
|
|
6809
|
-
Avatar,
|
|
6810
|
-
{
|
|
6811
|
-
variant: "soft",
|
|
6812
|
-
color: "primary",
|
|
6813
|
-
size,
|
|
6814
|
-
src,
|
|
6815
|
-
alt,
|
|
6816
|
-
getInitial
|
|
6817
|
-
},
|
|
6818
|
-
children
|
|
6819
|
-
)
|
|
6185
|
+
/* @__PURE__ */ import_react49.default.createElement(Avatar, { variant: "soft", color: "primary", size, src, alt, getInitial }, children)
|
|
6820
6186
|
);
|
|
6821
6187
|
}
|
|
6822
6188
|
ProfileMenuButton.displayName = "ProfileMenuButton";
|
|
@@ -6831,16 +6197,7 @@ var ProfileMenuRoot = (0, import_joy62.styled)(Menu, {
|
|
|
6831
6197
|
}
|
|
6832
6198
|
}));
|
|
6833
6199
|
function ProfileMenu(props) {
|
|
6834
|
-
const {
|
|
6835
|
-
open: _open,
|
|
6836
|
-
defaultOpen,
|
|
6837
|
-
onOpenChange,
|
|
6838
|
-
profile,
|
|
6839
|
-
getInitial,
|
|
6840
|
-
menuItems,
|
|
6841
|
-
size,
|
|
6842
|
-
...innerProps
|
|
6843
|
-
} = props;
|
|
6200
|
+
const { open: _open, defaultOpen, onOpenChange, profile, getInitial, menuItems, size, ...innerProps } = props;
|
|
6844
6201
|
const [open, setOpen] = useControlledState(
|
|
6845
6202
|
_open,
|
|
6846
6203
|
defaultOpen ?? false,
|
|
@@ -6856,37 +6213,18 @@ function ProfileMenu(props) {
|
|
|
6856
6213
|
getInitial
|
|
6857
6214
|
},
|
|
6858
6215
|
profile.name
|
|
6859
|
-
), /* @__PURE__ */ import_react49.default.createElement(
|
|
6860
|
-
|
|
6216
|
+
), /* @__PURE__ */ import_react49.default.createElement(ProfileMenuRoot, { size, placement: "bottom-end", ...innerProps, onClose: () => setOpen(false) }, /* @__PURE__ */ import_react49.default.createElement(ProfileCard, { size, caption: profile.caption, chip: profile.chip }, profile.name), !!menuItems.length && /* @__PURE__ */ import_react49.default.createElement(import_joy62.ListDivider, null), menuItems.map(({ label, ...menuProps }) => /* @__PURE__ */ import_react49.default.createElement(
|
|
6217
|
+
MenuItem,
|
|
6861
6218
|
{
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6219
|
+
key: label,
|
|
6220
|
+
...menuProps,
|
|
6221
|
+
onClick: (e) => {
|
|
6222
|
+
menuProps.onClick?.(e);
|
|
6223
|
+
setOpen(false);
|
|
6224
|
+
}
|
|
6866
6225
|
},
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
{
|
|
6870
|
-
size,
|
|
6871
|
-
caption: profile.caption,
|
|
6872
|
-
chip: profile.chip
|
|
6873
|
-
},
|
|
6874
|
-
profile.name
|
|
6875
|
-
),
|
|
6876
|
-
!!menuItems.length && /* @__PURE__ */ import_react49.default.createElement(import_joy62.ListDivider, null),
|
|
6877
|
-
menuItems.map(({ label, ...menuProps }) => /* @__PURE__ */ import_react49.default.createElement(
|
|
6878
|
-
MenuItem,
|
|
6879
|
-
{
|
|
6880
|
-
key: label,
|
|
6881
|
-
...menuProps,
|
|
6882
|
-
onClick: (e) => {
|
|
6883
|
-
menuProps.onClick?.(e);
|
|
6884
|
-
setOpen(false);
|
|
6885
|
-
}
|
|
6886
|
-
},
|
|
6887
|
-
label
|
|
6888
|
-
))
|
|
6889
|
-
))));
|
|
6226
|
+
label
|
|
6227
|
+
))))));
|
|
6890
6228
|
}
|
|
6891
6229
|
ProfileMenu.displayName = "ProfileMenu";
|
|
6892
6230
|
|