@ceed/ads 1.8.5 → 1.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordions/Accordions.d.ts +1 -1
- package/dist/components/Accordions/index.d.ts +2 -2
- package/dist/components/Alert/Alert.d.ts +3 -3
- package/dist/components/Autocomplete/Autocomplete.d.ts +3 -3
- package/dist/components/Autocomplete/index.d.ts +2 -2
- package/dist/components/Avatar/Avatar.d.ts +2 -2
- package/dist/components/Box/Box.d.ts +1 -1
- package/dist/components/Box/index.d.ts +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +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 +27 -20
- package/dist/components/DatePicker/DatePicker.d.ts +3 -3
- package/dist/components/DatePicker/index.d.ts +2 -2
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/dist/components/DateRangePicker/index.d.ts +2 -2
- package/dist/components/DialogActions/DialogActions.d.ts +1 -1
- package/dist/components/DialogActions/index.d.ts +2 -2
- package/dist/components/DialogContent/DialogContent.d.ts +1 -1
- package/dist/components/DialogContent/index.d.ts +2 -2
- package/dist/components/DialogFrame/DialogFrame.d.ts +1 -1
- package/dist/components/DialogFrame/index.d.ts +2 -2
- package/dist/components/DialogTitle/DialogTitle.d.ts +1 -1
- package/dist/components/DialogTitle/index.d.ts +2 -2
- package/dist/components/Divider/Divider.d.ts +3 -3
- package/dist/components/Divider/index.d.ts +2 -2
- package/dist/components/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 +1216 -2069
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1235 -2169
- package/dist/libs/rehype-accent/index.d.ts +2 -2
- package/framer/index.js +41 -40
- package/package.json +9 -2
package/dist/index.cjs
CHANGED
|
@@ -282,7 +282,7 @@ function Accordions(props) {
|
|
|
282
282
|
return /* @__PURE__ */ import_react.default.createElement(MotionAccordions, { variant, color, ...innerProps }, items.map((item, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
283
283
|
Accordion,
|
|
284
284
|
{
|
|
285
|
-
key: index
|
|
285
|
+
key: `accordion-${index}`,
|
|
286
286
|
summary: item.summary,
|
|
287
287
|
details: item.details,
|
|
288
288
|
index,
|
|
@@ -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) => /* @__PURE__ */ import_react9.default.createElement(Crumb, { ...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
|
-
const frontCrumbs = crumbs.slice(0, startCrumbCount).map((crumb) => /* @__PURE__ */ import_react9.default.createElement(Crumb, { ...crumb }));
|
|
829
|
-
const backCrumbs = (startCrumbCount + _endCrumbCount > crumbs.length ? crumbs.slice(startCrumbCount) : crumbs.slice(-_endCrumbCount)).map((crumb) => /* @__PURE__ */ import_react9.default.createElement(Crumb, { ...crumb }));
|
|
830
|
-
const collapsedCrumbs = crumbs.slice(startCrumbCount, -_endCrumbCount).map((crumb) => /* @__PURE__ */ import_react9.default.createElement(MenuItem,
|
|
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
|
-
);
|
|
778
|
+
const frontCrumbs = crumbs.slice(0, startCrumbCount).map((crumb) => /* @__PURE__ */ import_react9.default.createElement(Crumb, { key: `breadcrumb-${crumb.label}`, ...crumb }));
|
|
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 }));
|
|
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 })));
|
|
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: 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: 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,
|
|
@@ -2186,20 +1987,14 @@ function TableBody(props) {
|
|
|
2186
1987
|
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
2187
1988
|
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
2188
1989
|
} = props;
|
|
2189
|
-
return /* @__PURE__ */ import_react18.default.createElement("tbody", null, rows.map((row, rowIndex) => /* @__PURE__ */ import_react18.default.createElement("tr", { key: rowIndex }, showCheckbox && /* @__PURE__ */ import_react18.default.createElement(
|
|
1990
|
+
return /* @__PURE__ */ import_react18.default.createElement("tbody", null, rows.map((row, rowIndex) => /* @__PURE__ */ import_react18.default.createElement("tr", { key: `table-row-${rowIndex}` }, showCheckbox && /* @__PURE__ */ import_react18.default.createElement(
|
|
2190
1991
|
"td",
|
|
2191
1992
|
{
|
|
2192
1993
|
style: {
|
|
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,
|
|
@@ -2955,7 +2682,7 @@ function InfoSign(props) {
|
|
|
2955
2682
|
maxWidth: "320px"
|
|
2956
2683
|
}
|
|
2957
2684
|
},
|
|
2958
|
-
title: message?.split("\n").map((line, i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: i }, line))
|
|
2685
|
+
title: message?.split("\n").map((line, i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: `info-sign-${i}` }, line))
|
|
2959
2686
|
},
|
|
2960
2687
|
/* @__PURE__ */ import_react24.default.createElement(InfoIcon, null)
|
|
2961
2688
|
);
|
|
@@ -2989,15 +2716,7 @@ var TextEllipsis = ({ children }) => {
|
|
|
2989
2716
|
}, [children]);
|
|
2990
2717
|
const content = /* @__PURE__ */ import_react25.default.createElement(EllipsisDiv, { ref: textRef }, children);
|
|
2991
2718
|
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
|
-
);
|
|
2719
|
+
return /* @__PURE__ */ import_react25.default.createElement(Tooltip_default, { title: children, placement: "top", onClick: (e) => e.stopPropagation() }, content);
|
|
3001
2720
|
}
|
|
3002
2721
|
return content;
|
|
3003
2722
|
};
|
|
@@ -3181,10 +2900,7 @@ var HeadCell = (props) => {
|
|
|
3181
2900
|
() => `${tableId}_header_${headerName ?? field}`.trim(),
|
|
3182
2901
|
[tableId, headerName, field]
|
|
3183
2902
|
);
|
|
3184
|
-
const resizer = (0, import_react25.useMemo)(
|
|
3185
|
-
() => resizable ?? true ? Resizer(ref) : null,
|
|
3186
|
-
[resizable, ref]
|
|
3187
|
-
);
|
|
2903
|
+
const resizer = (0, import_react25.useMemo)(() => resizable ?? true ? Resizer(ref) : null, [resizable, ref]);
|
|
3188
2904
|
const style = (0, import_react25.useMemo)(
|
|
3189
2905
|
() => ({
|
|
3190
2906
|
width,
|
|
@@ -3199,17 +2915,7 @@ var HeadCell = (props) => {
|
|
|
3199
2915
|
// TODO: multi-sort때문에 일단 추가한 property, joy-ui에서는 multi-sort시 th에 user-select: none을 적용하고 툴팁을 띄워준다.
|
|
3200
2916
|
userSelect: "none"
|
|
3201
2917
|
}),
|
|
3202
|
-
[
|
|
3203
|
-
isPinned,
|
|
3204
|
-
maxWidth,
|
|
3205
|
-
minWidth,
|
|
3206
|
-
pinnedEndPosition,
|
|
3207
|
-
pinnedStartPosition,
|
|
3208
|
-
sortable,
|
|
3209
|
-
stickyHeader,
|
|
3210
|
-
theme,
|
|
3211
|
-
width
|
|
3212
|
-
]
|
|
2918
|
+
[isPinned, maxWidth, minWidth, pinnedEndPosition, pinnedStartPosition, sortable, stickyHeader, theme, width]
|
|
3213
2919
|
);
|
|
3214
2920
|
const textAlign = getTextAlign(props);
|
|
3215
2921
|
const initialSort = sortOrder[0];
|
|
@@ -3266,20 +2972,7 @@ var HeadCell = (props) => {
|
|
|
3266
2972
|
whileHover: "hover",
|
|
3267
2973
|
initial: "initial"
|
|
3268
2974
|
},
|
|
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
|
-
),
|
|
2975
|
+
/* @__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
2976
|
resizer
|
|
3284
2977
|
);
|
|
3285
2978
|
};
|
|
@@ -3298,7 +2991,10 @@ var BodyCell = (props) => {
|
|
|
3298
2991
|
pinnedStartPosition,
|
|
3299
2992
|
pinnedEndPosition,
|
|
3300
2993
|
row,
|
|
3301
|
-
rowId
|
|
2994
|
+
rowId,
|
|
2995
|
+
cellClassName,
|
|
2996
|
+
onCellEditStart,
|
|
2997
|
+
onCellEditStop
|
|
3302
2998
|
} = props;
|
|
3303
2999
|
const theme = (0, import_joy33.useTheme)();
|
|
3304
3000
|
const [value, setValue] = (0, import_react25.useState)(row[field]);
|
|
@@ -3307,20 +3003,22 @@ var BodyCell = (props) => {
|
|
|
3307
3003
|
() => ({
|
|
3308
3004
|
row,
|
|
3309
3005
|
value,
|
|
3310
|
-
id: rowId
|
|
3006
|
+
id: rowId,
|
|
3007
|
+
field
|
|
3311
3008
|
}),
|
|
3312
|
-
[row, rowId, value]
|
|
3009
|
+
[row, rowId, value, field]
|
|
3313
3010
|
);
|
|
3314
3011
|
const editMode = (0, import_react25.useMemo)(
|
|
3315
3012
|
() => !!(props.editMode && (typeof isCellEditable === "function" ? isCellEditable(params) : isCellEditable ?? true)),
|
|
3316
3013
|
[props.editMode, isCellEditable, params]
|
|
3317
3014
|
);
|
|
3015
|
+
const propsComponentProps = "componentProps" in props ? props.componentProps : null;
|
|
3318
3016
|
const componentProps = (0, import_react25.useMemo)(
|
|
3319
3017
|
() => ({
|
|
3320
|
-
..."componentProps" in props && (typeof
|
|
3018
|
+
..."componentProps" in props && (typeof propsComponentProps === "function" ? propsComponentProps(params) : propsComponentProps || {}),
|
|
3321
3019
|
size: "sm"
|
|
3322
3020
|
}),
|
|
3323
|
-
[
|
|
3021
|
+
[props, propsComponentProps, params]
|
|
3324
3022
|
);
|
|
3325
3023
|
const editModeComponentProps = (0, import_react25.useMemo)(
|
|
3326
3024
|
() => ({
|
|
@@ -3329,7 +3027,7 @@ var BodyCell = (props) => {
|
|
|
3329
3027
|
componentProps.onChange?.(e);
|
|
3330
3028
|
setValue(e.target.value);
|
|
3331
3029
|
if (type === "select") {
|
|
3332
|
-
|
|
3030
|
+
onCellEditStop?.({
|
|
3333
3031
|
...params,
|
|
3334
3032
|
originalRow: row,
|
|
3335
3033
|
row: {
|
|
@@ -3342,7 +3040,7 @@ var BodyCell = (props) => {
|
|
|
3342
3040
|
},
|
|
3343
3041
|
onFocus: (e) => {
|
|
3344
3042
|
componentProps.onFocus?.(e);
|
|
3345
|
-
|
|
3043
|
+
onCellEditStart?.({
|
|
3346
3044
|
...params,
|
|
3347
3045
|
originalRow: row,
|
|
3348
3046
|
row: {
|
|
@@ -3355,7 +3053,7 @@ var BodyCell = (props) => {
|
|
|
3355
3053
|
onBlur: (e) => {
|
|
3356
3054
|
componentProps.onBlur?.(e);
|
|
3357
3055
|
if (type && ["number", "text", "longText", "currency", "date"].includes(type)) {
|
|
3358
|
-
|
|
3056
|
+
onCellEditStop?.({
|
|
3359
3057
|
...params,
|
|
3360
3058
|
originalRow: row,
|
|
3361
3059
|
row: {
|
|
@@ -3370,7 +3068,7 @@ var BodyCell = (props) => {
|
|
|
3370
3068
|
onChangeComplete: (e) => {
|
|
3371
3069
|
componentProps.onChangeComplete?.(e);
|
|
3372
3070
|
setValue(e.target.value);
|
|
3373
|
-
|
|
3071
|
+
onCellEditStop?.({
|
|
3374
3072
|
...params,
|
|
3375
3073
|
originalRow: row,
|
|
3376
3074
|
row: {
|
|
@@ -3382,29 +3080,14 @@ var BodyCell = (props) => {
|
|
|
3382
3080
|
}
|
|
3383
3081
|
}
|
|
3384
3082
|
}),
|
|
3385
|
-
[
|
|
3386
|
-
params,
|
|
3387
|
-
row,
|
|
3388
|
-
field,
|
|
3389
|
-
value,
|
|
3390
|
-
componentProps,
|
|
3391
|
-
type,
|
|
3392
|
-
props.onCellEditStop,
|
|
3393
|
-
props.onCellEditStart
|
|
3394
|
-
]
|
|
3083
|
+
[params, row, field, value, componentProps, type, onCellEditStop, onCellEditStart]
|
|
3395
3084
|
);
|
|
3396
3085
|
const EditModeComponent = (0, import_react25.useMemo)(() => {
|
|
3397
3086
|
if (renderEditCell) {
|
|
3398
3087
|
return (0, import_react25.createElement)((0, import_react25.memo)(renderEditCell), params);
|
|
3399
3088
|
}
|
|
3400
3089
|
return {
|
|
3401
|
-
date: /* @__PURE__ */ import_react25.default.createElement(
|
|
3402
|
-
DatePicker_default,
|
|
3403
|
-
{
|
|
3404
|
-
value,
|
|
3405
|
-
...editModeComponentProps
|
|
3406
|
-
}
|
|
3407
|
-
),
|
|
3090
|
+
date: /* @__PURE__ */ import_react25.default.createElement(DatePicker_default, { value, ...editModeComponentProps }),
|
|
3408
3091
|
currency: /* @__PURE__ */ import_react25.default.createElement(
|
|
3409
3092
|
CurrencyInput_default,
|
|
3410
3093
|
{
|
|
@@ -3412,29 +3095,9 @@ var BodyCell = (props) => {
|
|
|
3412
3095
|
...editModeComponentProps
|
|
3413
3096
|
}
|
|
3414
3097
|
),
|
|
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
|
-
),
|
|
3098
|
+
number: /* @__PURE__ */ import_react25.default.createElement(Input_default, { value, type: "number", ...editModeComponentProps }),
|
|
3099
|
+
text: /* @__PURE__ */ import_react25.default.createElement(Input_default, { value, type: "text", ...editModeComponentProps }),
|
|
3100
|
+
longText: /* @__PURE__ */ import_react25.default.createElement(Textarea_default, { value, ...editModeComponentProps }),
|
|
3438
3101
|
autocomplete: /* @__PURE__ */ import_react25.default.createElement(
|
|
3439
3102
|
Autocomplete_default,
|
|
3440
3103
|
{
|
|
@@ -3452,50 +3115,34 @@ var BodyCell = (props) => {
|
|
|
3452
3115
|
}
|
|
3453
3116
|
)
|
|
3454
3117
|
}[type || "text"];
|
|
3455
|
-
}, [value, editModeComponentProps, type]);
|
|
3118
|
+
}, [value, editModeComponentProps, type, renderEditCell, params]);
|
|
3119
|
+
const linkComponentFromProps = props.component;
|
|
3456
3120
|
const ReadModeComponent = (0, import_react25.useMemo)(() => {
|
|
3457
3121
|
if (renderCell) {
|
|
3458
3122
|
return (0, import_react25.createElement)((0, import_react25.memo)(renderCell), params);
|
|
3459
3123
|
}
|
|
3460
3124
|
const innerText = value;
|
|
3461
3125
|
const typedComponent = {
|
|
3462
|
-
link: import_react25.default.createElement(
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
...componentProps
|
|
3467
|
-
}
|
|
3468
|
-
)
|
|
3126
|
+
link: import_react25.default.createElement(linkComponentFromProps || import_joy33.Link, {
|
|
3127
|
+
children: innerText,
|
|
3128
|
+
...componentProps
|
|
3129
|
+
})
|
|
3469
3130
|
}[type || "text"];
|
|
3470
3131
|
return typedComponent || innerText;
|
|
3471
|
-
}, [value, renderCell, params, type, componentProps]);
|
|
3132
|
+
}, [value, renderCell, params, type, componentProps, linkComponentFromProps]);
|
|
3133
|
+
const getActions = props.getActions;
|
|
3472
3134
|
const CellComponent = (0, import_react25.useMemo)(() => {
|
|
3473
3135
|
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
|
-
);
|
|
3136
|
+
return /* @__PURE__ */ import_react25.default.createElement(Stack_default, { direction: "row", gap: 1, justifyContent: "center", alignItems: "center" }, getActions?.(params));
|
|
3484
3137
|
}
|
|
3485
3138
|
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
|
-
);
|
|
3139
|
+
}, [type, getActions, params, editMode, EditModeComponent, ReadModeComponent]);
|
|
3140
|
+
const showTooltip = (0, import_react25.useMemo)(() => noWrap && type === "longText", [noWrap, type]);
|
|
3498
3141
|
const isBoundary = props.isLastStartPinnedColumn || props.isLastEndPinnedColumn;
|
|
3142
|
+
const computedCellClassName = (0, import_react25.useMemo)(
|
|
3143
|
+
() => (typeof cellClassName === "function" ? cellClassName(params) : cellClassName) || "",
|
|
3144
|
+
[cellClassName, params]
|
|
3145
|
+
);
|
|
3499
3146
|
(0, import_react25.useEffect)(() => {
|
|
3500
3147
|
setValue(row[field]);
|
|
3501
3148
|
}, [row, field]);
|
|
@@ -3514,11 +3161,11 @@ var BodyCell = (props) => {
|
|
|
3514
3161
|
zIndex: isPinned ? `calc(${theme.getCssVar("zIndex-table")} + ${isBoundary ? 2 : 3})` : void 0,
|
|
3515
3162
|
"--TableCell-dataBackground": isPinned ? `var(--TableCell-headBackground)` : void 0
|
|
3516
3163
|
},
|
|
3517
|
-
className: isLastStartPinnedColumn && "is-last-left"
|
|
3164
|
+
className: [isLastStartPinnedColumn && "is-last-left", isLastEndPinnedColumn && "is-last-right", computedCellClassName].filter(Boolean).join(" ") || ""
|
|
3518
3165
|
},
|
|
3519
3166
|
(0, import_react25.useMemo)(
|
|
3520
3167
|
() => showTooltip ? /* @__PURE__ */ import_react25.default.createElement(CellTextEllipsis, null, CellComponent) : CellComponent,
|
|
3521
|
-
[CellComponent, showTooltip
|
|
3168
|
+
[CellComponent, showTooltip]
|
|
3522
3169
|
)
|
|
3523
3170
|
);
|
|
3524
3171
|
};
|
|
@@ -3528,9 +3175,9 @@ var BodyRow = (0, import_react25.memo)(
|
|
|
3528
3175
|
return /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, columns.map((column, i) => /* @__PURE__ */ import_react25.default.createElement(
|
|
3529
3176
|
BodyCell,
|
|
3530
3177
|
{
|
|
3178
|
+
key: `${rowId}_${column.field.toString()}_${i}`,
|
|
3531
3179
|
...column,
|
|
3532
3180
|
tableId,
|
|
3533
|
-
key: `${rowId}_${column.field.toString()}_${i}`,
|
|
3534
3181
|
row,
|
|
3535
3182
|
rowId,
|
|
3536
3183
|
editMode,
|
|
@@ -3596,10 +3243,7 @@ function useDataTableRenderer({
|
|
|
3596
3243
|
const [sortModel, setSortModel] = useControlledState(
|
|
3597
3244
|
controlledSortModel,
|
|
3598
3245
|
initialState?.sorting?.sortModel ?? [],
|
|
3599
|
-
(0, import_react25.useCallback)(
|
|
3600
|
-
(sortModel2) => onSortModelChange?.(sortModel2),
|
|
3601
|
-
[onSortModelChange]
|
|
3602
|
-
)
|
|
3246
|
+
(0, import_react25.useCallback)((sortModel2) => onSortModelChange?.(sortModel2), [onSortModelChange])
|
|
3603
3247
|
);
|
|
3604
3248
|
const columnsByField = (0, import_react25.useMemo)(
|
|
3605
3249
|
() => columnsProp.reduce(
|
|
@@ -3674,9 +3318,7 @@ function useDataTableRenderer({
|
|
|
3674
3318
|
[dataInPage, isRowSelectable, getId]
|
|
3675
3319
|
);
|
|
3676
3320
|
const isAllSelected = (0, import_react25.useMemo)(
|
|
3677
|
-
() => selectableDataInPage.length > 0 && selectableDataInPage.every(
|
|
3678
|
-
(row, i) => selectedModelSet.has(getId(row, i))
|
|
3679
|
-
),
|
|
3321
|
+
() => selectableDataInPage.length > 0 && selectableDataInPage.every((row, i) => selectedModelSet.has(getId(row, i))),
|
|
3680
3322
|
[selectableDataInPage, selectedModelSet, getId]
|
|
3681
3323
|
);
|
|
3682
3324
|
const rowCount = totalRowsProp || rows.length;
|
|
@@ -3700,12 +3342,8 @@ function useDataTableRenderer({
|
|
|
3700
3342
|
field: key
|
|
3701
3343
|
}));
|
|
3702
3344
|
return baseColumns.map((column) => {
|
|
3703
|
-
const isLeftPinned = pinnedColumns?.left?.includes(
|
|
3704
|
-
|
|
3705
|
-
);
|
|
3706
|
-
const isRightPinned = pinnedColumns?.right?.includes(
|
|
3707
|
-
column.field
|
|
3708
|
-
);
|
|
3345
|
+
const isLeftPinned = pinnedColumns?.left?.includes(column.field);
|
|
3346
|
+
const isRightPinned = pinnedColumns?.right?.includes(column.field);
|
|
3709
3347
|
const isPinned = isLeftPinned || isRightPinned;
|
|
3710
3348
|
return {
|
|
3711
3349
|
...column,
|
|
@@ -3717,13 +3355,8 @@ function useDataTableRenderer({
|
|
|
3717
3355
|
isLastStartPinnedColumn: isLeftPinned && [...pinnedColumns?.left || []].pop() === column.field,
|
|
3718
3356
|
isLastEndPinnedColumn: isRightPinned && (pinnedColumns?.right?.[0] ?? null) === column.field,
|
|
3719
3357
|
// 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)
|
|
3358
|
+
pinnedStartPosition: pinnedColumns?.left?.slice(0, isLeftPinned ? pinnedColumns.left.indexOf(column.field) : pinnedColumns.left.length).reduce((acc, curr) => acc + getWidth(curr), 0),
|
|
3359
|
+
pinnedEndPosition: pinnedColumns?.right?.slice(isRightPinned ? pinnedColumns.right.indexOf(column.field) + 1 : 0).reduce((acc, curr) => acc + getWidth(curr), 0)
|
|
3727
3360
|
};
|
|
3728
3361
|
});
|
|
3729
3362
|
}, [
|
|
@@ -3758,9 +3391,7 @@ function useDataTableRenderer({
|
|
|
3758
3391
|
setSortModel(newSortModel2);
|
|
3759
3392
|
return;
|
|
3760
3393
|
}
|
|
3761
|
-
const newSortModel = multiple ? sortModel.map(
|
|
3762
|
-
(model) => model.field === field ? { field, sort: nextSortOrder } : model
|
|
3763
|
-
) : [{ field, sort: nextSortOrder }];
|
|
3394
|
+
const newSortModel = multiple ? sortModel.map((model) => model.field === field ? { field, sort: nextSortOrder } : model) : [{ field, sort: nextSortOrder }];
|
|
3764
3395
|
setSortModel(newSortModel);
|
|
3765
3396
|
} else {
|
|
3766
3397
|
const newSortModel = multiple ? [...sortModel, { field, sort: columnSortOrder[0] }] : [{ field, sort: columnSortOrder[0] }];
|
|
@@ -3797,10 +3428,7 @@ function useDataTableRenderer({
|
|
|
3797
3428
|
isAllSelected,
|
|
3798
3429
|
// all rows are selected on this page
|
|
3799
3430
|
isTotalSelected,
|
|
3800
|
-
isSelectedRow: (0, import_react25.useCallback)(
|
|
3801
|
-
(model) => selectedModelSet.has(model),
|
|
3802
|
-
[selectedModelSet]
|
|
3803
|
-
),
|
|
3431
|
+
isSelectedRow: (0, import_react25.useCallback)((model) => selectedModelSet.has(model), [selectedModelSet]),
|
|
3804
3432
|
isRowSelectable: (0, import_react25.useCallback)(
|
|
3805
3433
|
(rowId, row) => {
|
|
3806
3434
|
if (!isRowSelectable) return true;
|
|
@@ -3813,16 +3441,12 @@ function useDataTableRenderer({
|
|
|
3813
3441
|
setFocusedRowId(rowId);
|
|
3814
3442
|
}, []),
|
|
3815
3443
|
onAllCheckboxChange: (0, import_react25.useCallback)(() => {
|
|
3816
|
-
onSelectionModelChange?.(
|
|
3817
|
-
isAllSelected ? [] : selectableDataInPage.map(getId)
|
|
3818
|
-
);
|
|
3444
|
+
onSelectionModelChange?.(isAllSelected ? [] : selectableDataInPage.map(getId));
|
|
3819
3445
|
}, [isAllSelected, selectableDataInPage, onSelectionModelChange, getId]),
|
|
3820
3446
|
onCheckboxChange: (0, import_react25.useCallback)(
|
|
3821
3447
|
(event, selectedModel) => {
|
|
3822
3448
|
if (selectedModelSet.has(selectedModel)) {
|
|
3823
|
-
const newSelectionModel = (selectionModel || []).filter(
|
|
3824
|
-
(model) => model !== selectedModel
|
|
3825
|
-
);
|
|
3449
|
+
const newSelectionModel = (selectionModel || []).filter((model) => model !== selectedModel);
|
|
3826
3450
|
onSelectionModelChange?.(newSelectionModel);
|
|
3827
3451
|
} else {
|
|
3828
3452
|
const newSelectionModel = [...selectionModel || [], selectedModel];
|
|
@@ -3837,10 +3461,7 @@ function useDataTableRenderer({
|
|
|
3837
3461
|
if (!isRowSelectable) return true;
|
|
3838
3462
|
return isRowSelectable({ row, id: getId(row, i) });
|
|
3839
3463
|
});
|
|
3840
|
-
onSelectionModelChange?.(
|
|
3841
|
-
isTotalSelected ? [] : selectableRows.map(getId),
|
|
3842
|
-
!isTotalSelected
|
|
3843
|
-
);
|
|
3464
|
+
onSelectionModelChange?.(isTotalSelected ? [] : selectableRows.map(getId), !isTotalSelected);
|
|
3844
3465
|
}, [isTotalSelected, rows, onSelectionModelChange, getId, isRowSelectable])
|
|
3845
3466
|
};
|
|
3846
3467
|
}
|
|
@@ -3883,11 +3504,7 @@ function Component(props, apiRef) {
|
|
|
3883
3504
|
footer: Footer,
|
|
3884
3505
|
loadingOverlay: LoadingOverlay = DefaultLoadingOverlay
|
|
3885
3506
|
} = {},
|
|
3886
|
-
slotProps: {
|
|
3887
|
-
checkbox: checkboxProps = {},
|
|
3888
|
-
toolbar: toolbarProps,
|
|
3889
|
-
background: backgroundProps = {}
|
|
3890
|
-
} = {},
|
|
3507
|
+
slotProps: { checkbox: checkboxProps = {}, toolbar: toolbarProps, background: backgroundProps = {} } = {},
|
|
3891
3508
|
stripe,
|
|
3892
3509
|
isTotalSelected: ___________,
|
|
3893
3510
|
...innerProps
|
|
@@ -3932,13 +3549,7 @@ function Component(props, apiRef) {
|
|
|
3932
3549
|
onRowClick?.({ row, rowId }, e);
|
|
3933
3550
|
checkboxSelection && !disableSelectionOnClick && isRowSelectableCheck(rowId, row) && onCheckboxChange(e, rowId);
|
|
3934
3551
|
},
|
|
3935
|
-
[
|
|
3936
|
-
onRowClick,
|
|
3937
|
-
checkboxSelection,
|
|
3938
|
-
disableSelectionOnClick,
|
|
3939
|
-
onCheckboxChange,
|
|
3940
|
-
isRowSelectableCheck
|
|
3941
|
-
]
|
|
3552
|
+
[onRowClick, checkboxSelection, disableSelectionOnClick, onCheckboxChange, isRowSelectableCheck]
|
|
3942
3553
|
);
|
|
3943
3554
|
const getRowFocusHandler = (0, import_react25.useCallback)(
|
|
3944
3555
|
(rowId) => () => {
|
|
@@ -3996,16 +3607,7 @@ function Component(props, apiRef) {
|
|
|
3996
3607
|
justifyContent: "space-between",
|
|
3997
3608
|
alignItems: "center"
|
|
3998
3609
|
},
|
|
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
|
-
))),
|
|
3610
|
+
!!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
3611
|
Toolbar && /* @__PURE__ */ import_react25.default.createElement(Toolbar, { ...toolbarProps || {} })
|
|
4010
3612
|
),
|
|
4011
3613
|
/* @__PURE__ */ import_react25.default.createElement(
|
|
@@ -4174,9 +3776,7 @@ var CalendarButton2 = (0, import_joy34.styled)(IconButton_default, {
|
|
|
4174
3776
|
"&:focus": {
|
|
4175
3777
|
"--Icon-color": "currentColor",
|
|
4176
3778
|
outlineOffset: `${theme.getCssVar("focus-thickness")}`,
|
|
4177
|
-
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar(
|
|
4178
|
-
"palette-focusVisible"
|
|
4179
|
-
)}`
|
|
3779
|
+
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
4180
3780
|
}
|
|
4181
3781
|
}));
|
|
4182
3782
|
var StyledPopper2 = (0, import_joy34.styled)(import_base3.Popper, {
|
|
@@ -4213,10 +3813,7 @@ var validValueFormat2 = (value, format) => {
|
|
|
4213
3813
|
if (parsedDate1.toString() === "Invalid Date" || parsedDate2.toString() === "Invalid Date") {
|
|
4214
3814
|
return false;
|
|
4215
3815
|
}
|
|
4216
|
-
const formattedValue = formatValueString2(
|
|
4217
|
-
[parsedDate1, parsedDate2],
|
|
4218
|
-
format
|
|
4219
|
-
);
|
|
3816
|
+
const formattedValue = formatValueString2([parsedDate1, parsedDate2], format);
|
|
4220
3817
|
if (value !== formattedValue) {
|
|
4221
3818
|
return false;
|
|
4222
3819
|
}
|
|
@@ -4268,287 +3865,263 @@ var parseDates = (str, format) => {
|
|
|
4268
3865
|
var formatToPattern2 = (format) => {
|
|
4269
3866
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/DD/g, "D").replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
4270
3867
|
};
|
|
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
|
-
}
|
|
3868
|
+
var TextMaskAdapter5 = import_react26.default.forwardRef(function TextMaskAdapter6(props, ref) {
|
|
3869
|
+
const { onChange, format, ...other } = props;
|
|
3870
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
3871
|
+
import_react_imask2.IMaskInput,
|
|
3872
|
+
{
|
|
3873
|
+
...other,
|
|
3874
|
+
inputRef: ref,
|
|
3875
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
3876
|
+
mask: Date,
|
|
3877
|
+
pattern: formatToPattern2(format),
|
|
3878
|
+
blocks: {
|
|
3879
|
+
D: {
|
|
3880
|
+
mask: import_react_imask2.IMask.MaskedRange,
|
|
3881
|
+
from: 1,
|
|
3882
|
+
to: 31,
|
|
3883
|
+
maxLength: 2
|
|
4300
3884
|
},
|
|
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) {
|
|
3885
|
+
M: {
|
|
3886
|
+
mask: import_react_imask2.IMask.MaskedRange,
|
|
3887
|
+
from: 1,
|
|
3888
|
+
to: 12,
|
|
3889
|
+
maxLength: 2
|
|
3890
|
+
},
|
|
3891
|
+
Y: {
|
|
3892
|
+
mask: import_react_imask2.IMask.MaskedRange,
|
|
3893
|
+
from: 1900,
|
|
3894
|
+
to: 9999
|
|
4360
3895
|
}
|
|
4361
|
-
}
|
|
4362
|
-
|
|
3896
|
+
},
|
|
3897
|
+
format: (dates) => formatValueString2(dates, format),
|
|
3898
|
+
parse: (str) => parseDates(str, format),
|
|
3899
|
+
autofix: "pad",
|
|
3900
|
+
overwrite: true
|
|
3901
|
+
}
|
|
3902
|
+
);
|
|
3903
|
+
});
|
|
3904
|
+
var DateRangePicker = (0, import_react26.forwardRef)((inProps, ref) => {
|
|
3905
|
+
const props = (0, import_joy34.useThemeProps)({ props: inProps, name: "DateRangePicker" });
|
|
3906
|
+
const {
|
|
3907
|
+
onChange,
|
|
3908
|
+
disabled,
|
|
3909
|
+
label,
|
|
3910
|
+
error,
|
|
3911
|
+
helperText,
|
|
3912
|
+
minDate,
|
|
3913
|
+
maxDate,
|
|
3914
|
+
disableFuture,
|
|
3915
|
+
disablePast,
|
|
3916
|
+
required,
|
|
3917
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
3918
|
+
sx,
|
|
3919
|
+
className,
|
|
3920
|
+
format = "YYYY/MM/DD",
|
|
3921
|
+
displayFormat = "YYYY/MM/DD",
|
|
3922
|
+
size,
|
|
3923
|
+
inputReadOnly,
|
|
3924
|
+
hideClearButton,
|
|
3925
|
+
readOnly,
|
|
3926
|
+
...innerProps
|
|
3927
|
+
} = props;
|
|
3928
|
+
const innerRef = (0, import_react26.useRef)(null);
|
|
3929
|
+
const buttonRef = (0, import_react26.useRef)(null);
|
|
3930
|
+
const [value, setValue] = useControlledState(
|
|
3931
|
+
props.value,
|
|
3932
|
+
props.defaultValue || "",
|
|
3933
|
+
(0, import_react26.useCallback)((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
3934
|
+
);
|
|
3935
|
+
const [displayValue, setDisplayValue] = (0, import_react26.useState)(
|
|
3936
|
+
() => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
|
|
3937
|
+
);
|
|
3938
|
+
const [anchorEl, setAnchorEl] = (0, import_react26.useState)(null);
|
|
3939
|
+
const open = Boolean(anchorEl);
|
|
3940
|
+
const calendarValue = (0, import_react26.useMemo)(
|
|
3941
|
+
() => value ? parseDates(value, format) : void 0,
|
|
3942
|
+
[value, format]
|
|
3943
|
+
);
|
|
3944
|
+
(0, import_react26.useEffect)(() => {
|
|
3945
|
+
if (value) {
|
|
3946
|
+
try {
|
|
3947
|
+
const dates = parseDates(value, format);
|
|
3948
|
+
const newDisplayValue = formatValueString2(dates, displayFormat);
|
|
3949
|
+
setDisplayValue(newDisplayValue);
|
|
3950
|
+
} catch (error2) {
|
|
4363
3951
|
}
|
|
4364
|
-
}
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
3952
|
+
} else {
|
|
3953
|
+
setDisplayValue("");
|
|
3954
|
+
}
|
|
3955
|
+
}, [displayFormat, value, format]);
|
|
3956
|
+
(0, import_react26.useEffect)(() => {
|
|
3957
|
+
if (!anchorEl) {
|
|
3958
|
+
innerRef.current?.blur();
|
|
3959
|
+
}
|
|
3960
|
+
}, [anchorEl, innerRef]);
|
|
3961
|
+
(0, import_react26.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
3962
|
+
const handleChange = (0, import_react26.useCallback)(
|
|
3963
|
+
(event) => {
|
|
3964
|
+
const value2 = event.target.value;
|
|
3965
|
+
setDisplayValue(value2 ? formatValueString2(parseDates(value2, format), displayFormat) : value2);
|
|
3966
|
+
setValue(value2);
|
|
3967
|
+
},
|
|
3968
|
+
[displayFormat, format, setValue]
|
|
3969
|
+
);
|
|
3970
|
+
const handleDisplayInputChange = (0, import_react26.useCallback)(
|
|
3971
|
+
(event) => {
|
|
3972
|
+
if (event.target.value === "") {
|
|
3973
|
+
handleChange({
|
|
3974
|
+
target: {
|
|
3975
|
+
name: props.name,
|
|
3976
|
+
value: ""
|
|
3977
|
+
}
|
|
3978
|
+
});
|
|
3979
|
+
return;
|
|
4368
3980
|
}
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
);
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
);
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
3981
|
+
const isValidDisplayValue = validValueFormat2(event.target.value, displayFormat);
|
|
3982
|
+
if (isValidDisplayValue) {
|
|
3983
|
+
const dates = parseDates(event.target.value, displayFormat);
|
|
3984
|
+
const formattedValue = formatValueString2(dates, format);
|
|
3985
|
+
handleChange({
|
|
3986
|
+
target: {
|
|
3987
|
+
name: props.name,
|
|
3988
|
+
value: formattedValue
|
|
3989
|
+
}
|
|
3990
|
+
});
|
|
3991
|
+
}
|
|
3992
|
+
},
|
|
3993
|
+
[displayFormat, format, handleChange, props.name]
|
|
3994
|
+
);
|
|
3995
|
+
const handleCalendarToggle = (0, import_react26.useCallback)(
|
|
3996
|
+
(event) => {
|
|
3997
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
3998
|
+
innerRef.current?.focus();
|
|
3999
|
+
},
|
|
4000
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
4001
|
+
);
|
|
4002
|
+
const handleCalendarChange = (0, import_react26.useCallback)(
|
|
4003
|
+
([date1, date2]) => {
|
|
4004
|
+
if (!date1 || !date2) return;
|
|
4005
|
+
const formattedValue = formatValueString2([date1, date2], format);
|
|
4006
|
+
if (props.value !== void 0) {
|
|
4007
|
+
onChange?.({ target: { name: props.name, value: formattedValue } });
|
|
4008
|
+
} else {
|
|
4009
|
+
setDisplayValue(formatValueString2([date1, date2], displayFormat));
|
|
4010
|
+
setValue(formattedValue);
|
|
4011
|
+
}
|
|
4012
|
+
setAnchorEl(null);
|
|
4013
|
+
},
|
|
4014
|
+
[props.value, props.name, onChange, setValue, setAnchorEl, format, displayFormat]
|
|
4015
|
+
);
|
|
4016
|
+
const handleInputMouseDown = (0, import_react26.useCallback)(
|
|
4017
|
+
(event) => {
|
|
4018
|
+
if (inputReadOnly) {
|
|
4019
|
+
event.preventDefault();
|
|
4020
|
+
buttonRef.current?.focus();
|
|
4021
|
+
}
|
|
4022
|
+
},
|
|
4023
|
+
[inputReadOnly, buttonRef]
|
|
4024
|
+
);
|
|
4025
|
+
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(
|
|
4026
|
+
Input_default,
|
|
4027
|
+
{
|
|
4028
|
+
...innerProps,
|
|
4029
|
+
color: error ? "danger" : innerProps.color,
|
|
4030
|
+
ref,
|
|
4031
|
+
size,
|
|
4032
|
+
value: displayValue,
|
|
4033
|
+
onChange: handleDisplayInputChange,
|
|
4034
|
+
disabled,
|
|
4035
|
+
required,
|
|
4036
|
+
placeholder: `${displayFormat} - ${displayFormat}`,
|
|
4037
|
+
slotProps: {
|
|
4038
|
+
input: {
|
|
4039
|
+
component: TextMaskAdapter5,
|
|
4040
|
+
ref: innerRef,
|
|
4041
|
+
format: displayFormat,
|
|
4042
|
+
sx: {
|
|
4043
|
+
"&:hover": {
|
|
4044
|
+
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
4405
4045
|
}
|
|
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);
|
|
4046
|
+
},
|
|
4047
|
+
onMouseDown: handleInputMouseDown
|
|
4429
4048
|
}
|
|
4430
|
-
setAnchorEl(null);
|
|
4431
4049
|
},
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4050
|
+
error,
|
|
4051
|
+
className,
|
|
4052
|
+
sx,
|
|
4053
|
+
endDecorator: /* @__PURE__ */ import_react26.default.createElement(
|
|
4054
|
+
CalendarButton2,
|
|
4055
|
+
{
|
|
4056
|
+
ref: buttonRef,
|
|
4057
|
+
variant: "plain",
|
|
4058
|
+
onClick: readOnly ? void 0 : handleCalendarToggle,
|
|
4059
|
+
"aria-label": "Toggle Calendar",
|
|
4060
|
+
"aria-controls": "date-range-picker-popper",
|
|
4061
|
+
"aria-haspopup": "dialog",
|
|
4062
|
+
"aria-expanded": open,
|
|
4063
|
+
disabled
|
|
4064
|
+
},
|
|
4065
|
+
/* @__PURE__ */ import_react26.default.createElement(import_CalendarToday2.default, null)
|
|
4066
|
+
),
|
|
4067
|
+
label,
|
|
4068
|
+
helperText,
|
|
4069
|
+
readOnly: readOnly || inputReadOnly
|
|
4070
|
+
}
|
|
4071
|
+
), open && /* @__PURE__ */ import_react26.default.createElement(import_base3.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react26.default.createElement(
|
|
4072
|
+
StyledPopper2,
|
|
4073
|
+
{
|
|
4074
|
+
id: "date-range-picker-popper",
|
|
4075
|
+
open: true,
|
|
4076
|
+
anchorEl,
|
|
4077
|
+
placement: "bottom-end",
|
|
4078
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4079
|
+
modifiers: [
|
|
4080
|
+
{
|
|
4081
|
+
name: "offset",
|
|
4082
|
+
options: {
|
|
4083
|
+
offset: [4, 4]
|
|
4084
|
+
}
|
|
4447
4085
|
}
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4086
|
+
],
|
|
4087
|
+
"aria-label": "Calendar Tooltip",
|
|
4088
|
+
"aria-expanded": open
|
|
4089
|
+
},
|
|
4090
|
+
/* @__PURE__ */ import_react26.default.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react26.default.createElement(
|
|
4091
|
+
Calendar_default,
|
|
4453
4092
|
{
|
|
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
|
|
4093
|
+
rangeSelection: true,
|
|
4094
|
+
defaultValue: calendarValue,
|
|
4095
|
+
onChange: handleCalendarChange,
|
|
4096
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
4097
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
4098
|
+
disableFuture,
|
|
4099
|
+
disablePast
|
|
4496
4100
|
}
|
|
4497
|
-
),
|
|
4498
|
-
|
|
4101
|
+
), !hideClearButton && /* @__PURE__ */ import_react26.default.createElement(
|
|
4102
|
+
DialogActions_default,
|
|
4499
4103
|
{
|
|
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
|
|
4104
|
+
sx: {
|
|
4105
|
+
p: 1
|
|
4526
4106
|
}
|
|
4527
|
-
|
|
4528
|
-
|
|
4107
|
+
},
|
|
4108
|
+
/* @__PURE__ */ import_react26.default.createElement(
|
|
4109
|
+
Button_default,
|
|
4529
4110
|
{
|
|
4530
|
-
|
|
4531
|
-
|
|
4111
|
+
size,
|
|
4112
|
+
variant: "plain",
|
|
4113
|
+
color: "neutral",
|
|
4114
|
+
onClick: () => {
|
|
4115
|
+
setValue("");
|
|
4116
|
+
setDisplayValue("");
|
|
4117
|
+
setAnchorEl(null);
|
|
4532
4118
|
}
|
|
4533
4119
|
},
|
|
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
|
-
);
|
|
4120
|
+
"Clear"
|
|
4121
|
+
)
|
|
4122
|
+
))
|
|
4123
|
+
)))));
|
|
4124
|
+
});
|
|
4552
4125
|
DateRangePicker.displayName = "DateRangePicker";
|
|
4553
4126
|
|
|
4554
4127
|
// src/components/DialogContent/DialogContent.tsx
|
|
@@ -4612,17 +4185,7 @@ var StyledDialogFrame = (0, import_joy38.styled)(ModalDialog, {
|
|
|
4612
4185
|
});
|
|
4613
4186
|
var DialogFrame = import_react28.default.forwardRef((props, ref) => {
|
|
4614
4187
|
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
|
-
);
|
|
4188
|
+
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
4189
|
});
|
|
4627
4190
|
DialogFrame.displayName = "DialogFrame";
|
|
4628
4191
|
|
|
@@ -4661,11 +4224,7 @@ var import_react30 = __toESM(require("react"));
|
|
|
4661
4224
|
var import_joy41 = require("@mui/joy");
|
|
4662
4225
|
function CheckboxGroup(props) {
|
|
4663
4226
|
const { id, label, options, value, onChange, hidden } = props;
|
|
4664
|
-
const [internalValue, setInternalValue] = useControlledState(
|
|
4665
|
-
value,
|
|
4666
|
-
[],
|
|
4667
|
-
onChange
|
|
4668
|
-
);
|
|
4227
|
+
const [internalValue, setInternalValue] = useControlledState(value, [], onChange);
|
|
4669
4228
|
const handleCheckboxChange = (0, import_react30.useCallback)(
|
|
4670
4229
|
(optionValue) => (event) => {
|
|
4671
4230
|
const checked = event.target.checked;
|
|
@@ -4682,16 +4241,7 @@ function CheckboxGroup(props) {
|
|
|
4682
4241
|
if (hidden) {
|
|
4683
4242
|
return null;
|
|
4684
4243
|
}
|
|
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(
|
|
4244
|
+
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
4245
|
Checkbox_default,
|
|
4696
4246
|
{
|
|
4697
4247
|
key: `${id}-${option.value}`,
|
|
@@ -4720,11 +4270,7 @@ RadioGroup.displayName = "RadioGroup";
|
|
|
4720
4270
|
var import_joy43 = require("@mui/joy");
|
|
4721
4271
|
function RadioGroup2(props) {
|
|
4722
4272
|
const { id, label, options, value, onChange, hidden } = props;
|
|
4723
|
-
const [internalValue, setInternalValue] = useControlledState(
|
|
4724
|
-
value,
|
|
4725
|
-
value ?? "",
|
|
4726
|
-
onChange
|
|
4727
|
-
);
|
|
4273
|
+
const [internalValue, setInternalValue] = useControlledState(value, value ?? "", onChange);
|
|
4728
4274
|
const handleRadioChange = (0, import_react31.useCallback)(
|
|
4729
4275
|
(event) => {
|
|
4730
4276
|
const newValue = event.target.value;
|
|
@@ -4737,31 +4283,7 @@ function RadioGroup2(props) {
|
|
|
4737
4283
|
if (hidden) {
|
|
4738
4284
|
return null;
|
|
4739
4285
|
}
|
|
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
|
-
));
|
|
4286
|
+
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
4287
|
}
|
|
4766
4288
|
RadioGroup2.displayName = "RadioGroup";
|
|
4767
4289
|
|
|
@@ -4784,11 +4306,7 @@ function DateRange(props) {
|
|
|
4784
4306
|
inputReadOnly,
|
|
4785
4307
|
hideClearButton
|
|
4786
4308
|
} = props;
|
|
4787
|
-
const [internalValue, setInternalValue] = useControlledState(
|
|
4788
|
-
value,
|
|
4789
|
-
null,
|
|
4790
|
-
onChange
|
|
4791
|
-
);
|
|
4309
|
+
const [internalValue, setInternalValue] = useControlledState(value, null, onChange);
|
|
4792
4310
|
const [selectedOption, setSelectedOption] = (0, import_react32.useState)("all-time");
|
|
4793
4311
|
const dateRangeOptions = (0, import_react32.useMemo)(
|
|
4794
4312
|
() => [
|
|
@@ -4817,28 +4335,19 @@ function DateRange(props) {
|
|
|
4817
4335
|
case "this-month": {
|
|
4818
4336
|
const startOfMonth = new Date(currentYear, currentMonth, 1);
|
|
4819
4337
|
const endOfMonth = new Date(currentYear, currentMonth + 1, 0);
|
|
4820
|
-
return [
|
|
4821
|
-
formatDate(startOfMonth),
|
|
4822
|
-
formatDate(endOfMonth)
|
|
4823
|
-
];
|
|
4338
|
+
return [formatDate(startOfMonth), formatDate(endOfMonth)];
|
|
4824
4339
|
}
|
|
4825
4340
|
case "this-year": {
|
|
4826
4341
|
const startOfYear = new Date(currentYear, 0, 1);
|
|
4827
4342
|
const endOfYear = new Date(currentYear, 11, 31);
|
|
4828
|
-
return [
|
|
4829
|
-
formatDate(startOfYear),
|
|
4830
|
-
formatDate(endOfYear)
|
|
4831
|
-
];
|
|
4343
|
+
return [formatDate(startOfYear), formatDate(endOfYear)];
|
|
4832
4344
|
}
|
|
4833
4345
|
case "last-month": {
|
|
4834
4346
|
const lastMonthYear = currentMonth === 0 ? currentYear - 1 : currentYear;
|
|
4835
4347
|
const lastMonth = currentMonth === 0 ? 11 : currentMonth - 1;
|
|
4836
4348
|
const startOfLastMonth = new Date(lastMonthYear, lastMonth, 1);
|
|
4837
4349
|
const endOfLastMonth = new Date(lastMonthYear, lastMonth + 1, 0);
|
|
4838
|
-
return [
|
|
4839
|
-
formatDate(startOfLastMonth),
|
|
4840
|
-
formatDate(endOfLastMonth)
|
|
4841
|
-
];
|
|
4350
|
+
return [formatDate(startOfLastMonth), formatDate(endOfLastMonth)];
|
|
4842
4351
|
}
|
|
4843
4352
|
case "custom":
|
|
4844
4353
|
return internalValue;
|
|
@@ -4901,31 +4410,7 @@ function DateRange(props) {
|
|
|
4901
4410
|
if (hidden) {
|
|
4902
4411
|
return null;
|
|
4903
4412
|
}
|
|
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(
|
|
4413
|
+
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
4414
|
DateRangePicker,
|
|
4930
4415
|
{
|
|
4931
4416
|
value: customDateRangeValue,
|
|
@@ -4947,22 +4432,8 @@ DateRange.displayName = "DateRange";
|
|
|
4947
4432
|
var import_react33 = __toESM(require("react"));
|
|
4948
4433
|
var import_joy45 = require("@mui/joy");
|
|
4949
4434
|
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
|
-
);
|
|
4435
|
+
const { id, label, value, onChange, hidden, max, placeholder, useMinorUnit, currency = "USD" } = props;
|
|
4436
|
+
const [internalValue, setInternalValue] = useControlledState(value, value, onChange);
|
|
4966
4437
|
const handleCurrencyChange = (0, import_react33.useCallback)(
|
|
4967
4438
|
(event) => {
|
|
4968
4439
|
const newValue = event.target.value;
|
|
@@ -4973,16 +4444,7 @@ function CurrencyInput3(props) {
|
|
|
4973
4444
|
if (hidden) {
|
|
4974
4445
|
return null;
|
|
4975
4446
|
}
|
|
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(
|
|
4447
|
+
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
4448
|
CurrencyInput,
|
|
4987
4449
|
{
|
|
4988
4450
|
value: internalValue,
|
|
@@ -5001,22 +4463,8 @@ CurrencyInput3.displayName = "CurrencyInput";
|
|
|
5001
4463
|
var import_react34 = __toESM(require("react"));
|
|
5002
4464
|
var import_joy46 = require("@mui/joy");
|
|
5003
4465
|
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
|
-
);
|
|
4466
|
+
const { id, label, value, onChange, hidden, max, placeholder, useMinorUnit, currency = "USD" } = props;
|
|
4467
|
+
const [internalValue, setInternalValue] = useControlledState(value, null, onChange);
|
|
5020
4468
|
const minValue = internalValue?.[0];
|
|
5021
4469
|
const maxValue = internalValue?.[1];
|
|
5022
4470
|
const handleMinChange = (0, import_react34.useCallback)(
|
|
@@ -5050,16 +4498,7 @@ function CurrencyRange(props) {
|
|
|
5050
4498
|
if (hidden) {
|
|
5051
4499
|
return null;
|
|
5052
4500
|
}
|
|
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(
|
|
4501
|
+
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
4502
|
CurrencyInput,
|
|
5064
4503
|
{
|
|
5065
4504
|
label: "Minimum",
|
|
@@ -5101,115 +4540,112 @@ var padDecimal = (value, decimalScale) => {
|
|
|
5101
4540
|
const [integer, decimal = ""] = `${value}`.split(".");
|
|
5102
4541
|
return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
|
|
5103
4542
|
};
|
|
5104
|
-
var TextMaskAdapter7 = import_react35.default.forwardRef(
|
|
5105
|
-
|
|
5106
|
-
|
|
4543
|
+
var TextMaskAdapter7 = import_react35.default.forwardRef(function TextMaskAdapter8(props, ref) {
|
|
4544
|
+
const { onChange, min, max, ...innerProps } = props;
|
|
4545
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
4546
|
+
import_react_number_format2.NumericFormat,
|
|
4547
|
+
{
|
|
4548
|
+
...innerProps,
|
|
4549
|
+
onValueChange: ({ value }) => {
|
|
4550
|
+
onChange?.({
|
|
4551
|
+
target: {
|
|
4552
|
+
name: props.name,
|
|
4553
|
+
value
|
|
4554
|
+
}
|
|
4555
|
+
});
|
|
4556
|
+
},
|
|
4557
|
+
valueIsNumericString: true,
|
|
4558
|
+
thousandSeparator: true,
|
|
4559
|
+
suffix: "%",
|
|
4560
|
+
getInputRef: ref,
|
|
4561
|
+
allowNegative: true
|
|
4562
|
+
}
|
|
4563
|
+
);
|
|
4564
|
+
});
|
|
4565
|
+
var PercentageInputRoot = (0, import_joy47.styled)(Input_default, {
|
|
4566
|
+
name: "PercentageInput",
|
|
4567
|
+
slot: "Root",
|
|
4568
|
+
overridesResolver: (props, styles) => styles.root
|
|
4569
|
+
})({});
|
|
4570
|
+
var PercentageInput = import_react35.default.forwardRef(
|
|
4571
|
+
function PercentageInput2(inProps, ref) {
|
|
4572
|
+
const props = (0, import_joy47.useThemeProps)({ props: inProps, name: "PercentageInput" });
|
|
4573
|
+
const {
|
|
4574
|
+
name,
|
|
4575
|
+
onChange,
|
|
4576
|
+
label,
|
|
4577
|
+
error,
|
|
4578
|
+
helperText,
|
|
4579
|
+
required,
|
|
4580
|
+
disabled,
|
|
4581
|
+
useMinorUnit,
|
|
4582
|
+
maxDecimalScale = 0,
|
|
4583
|
+
min,
|
|
4584
|
+
max,
|
|
4585
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4586
|
+
sx,
|
|
4587
|
+
className,
|
|
4588
|
+
...innerProps
|
|
4589
|
+
} = props;
|
|
4590
|
+
const [_value, setValue] = useControlledState(
|
|
4591
|
+
props.value,
|
|
4592
|
+
props.defaultValue,
|
|
4593
|
+
(0, import_react35.useCallback)((value2) => onChange?.({ target: { name, value: value2 } }), [onChange, name])
|
|
4594
|
+
);
|
|
4595
|
+
const [internalError, setInternalError] = (0, import_react35.useState)(
|
|
4596
|
+
max && _value && _value > max || min && _value && _value < min
|
|
4597
|
+
);
|
|
4598
|
+
const value = (0, import_react35.useMemo)(() => {
|
|
4599
|
+
if (_value && useMinorUnit) {
|
|
4600
|
+
return _value / Math.pow(10, maxDecimalScale);
|
|
4601
|
+
}
|
|
4602
|
+
return _value;
|
|
4603
|
+
}, [_value, useMinorUnit, maxDecimalScale]);
|
|
4604
|
+
const handleChange = (0, import_react35.useCallback)(
|
|
4605
|
+
(event) => {
|
|
4606
|
+
if (event.target.value === "") {
|
|
4607
|
+
setValue(void 0);
|
|
4608
|
+
return;
|
|
4609
|
+
}
|
|
4610
|
+
const originalAmount = Number(event.target.value);
|
|
4611
|
+
if (min && originalAmount < min || max && originalAmount > max) {
|
|
4612
|
+
setInternalError(true);
|
|
4613
|
+
} else {
|
|
4614
|
+
setInternalError(false);
|
|
4615
|
+
}
|
|
4616
|
+
const amount = useMinorUnit ? padDecimal(originalAmount, maxDecimalScale) : originalAmount;
|
|
4617
|
+
setValue(amount);
|
|
4618
|
+
},
|
|
4619
|
+
[setValue, useMinorUnit, maxDecimalScale, min, max]
|
|
4620
|
+
);
|
|
5107
4621
|
return /* @__PURE__ */ import_react35.default.createElement(
|
|
5108
|
-
|
|
4622
|
+
PercentageInputRoot,
|
|
5109
4623
|
{
|
|
5110
4624
|
...innerProps,
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
4625
|
+
ref,
|
|
4626
|
+
value,
|
|
4627
|
+
onChange: handleChange,
|
|
4628
|
+
error: internalError || error,
|
|
4629
|
+
disabled,
|
|
4630
|
+
required,
|
|
4631
|
+
color: internalError || error ? "danger" : props.color,
|
|
4632
|
+
label,
|
|
4633
|
+
helperText,
|
|
4634
|
+
slotProps: {
|
|
4635
|
+
input: {
|
|
4636
|
+
component: TextMaskAdapter7,
|
|
4637
|
+
"aria-label": innerProps["aria-label"],
|
|
4638
|
+
decimalScale: maxDecimalScale
|
|
4639
|
+
}
|
|
4640
|
+
},
|
|
4641
|
+
sx: {
|
|
4642
|
+
...sx
|
|
5118
4643
|
},
|
|
5119
|
-
|
|
5120
|
-
thousandSeparator: true,
|
|
5121
|
-
suffix: "%",
|
|
5122
|
-
getInputRef: ref,
|
|
5123
|
-
allowNegative: true
|
|
4644
|
+
className
|
|
5124
4645
|
}
|
|
5125
4646
|
);
|
|
5126
4647
|
}
|
|
5127
4648
|
);
|
|
5128
|
-
var PercentageInputRoot = (0, import_joy47.styled)(Input_default, {
|
|
5129
|
-
name: "PercentageInput",
|
|
5130
|
-
slot: "Root",
|
|
5131
|
-
overridesResolver: (props, styles) => styles.root
|
|
5132
|
-
})({});
|
|
5133
|
-
var PercentageInput = import_react35.default.forwardRef(function PercentageInput2(inProps, ref) {
|
|
5134
|
-
const props = (0, import_joy47.useThemeProps)({ props: inProps, name: "PercentageInput" });
|
|
5135
|
-
const {
|
|
5136
|
-
name,
|
|
5137
|
-
onChange,
|
|
5138
|
-
label,
|
|
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,
|
|
5197
|
-
label,
|
|
5198
|
-
helperText,
|
|
5199
|
-
slotProps: {
|
|
5200
|
-
input: {
|
|
5201
|
-
component: TextMaskAdapter7,
|
|
5202
|
-
"aria-label": innerProps["aria-label"],
|
|
5203
|
-
decimalScale: maxDecimalScale
|
|
5204
|
-
}
|
|
5205
|
-
},
|
|
5206
|
-
sx: {
|
|
5207
|
-
...sx
|
|
5208
|
-
},
|
|
5209
|
-
className
|
|
5210
|
-
}
|
|
5211
|
-
);
|
|
5212
|
-
});
|
|
5213
4649
|
PercentageInput.displayName = "PercentageInput";
|
|
5214
4650
|
|
|
5215
4651
|
// src/components/FilterMenu/components/PercentageInput.tsx
|
|
@@ -5229,16 +4665,7 @@ var PercentageInput3 = ({
|
|
|
5229
4665
|
if (hidden) {
|
|
5230
4666
|
return null;
|
|
5231
4667
|
}
|
|
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(
|
|
4668
|
+
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
4669
|
PercentageInput,
|
|
5243
4670
|
{
|
|
5244
4671
|
value: _value,
|
|
@@ -5256,18 +4683,12 @@ var PercentageInput3 = ({
|
|
|
5256
4683
|
var import_react37 = __toESM(require("react"));
|
|
5257
4684
|
var import_joy49 = require("@mui/joy");
|
|
5258
4685
|
function PercentageRange(props) {
|
|
5259
|
-
const {
|
|
5260
|
-
|
|
5261
|
-
label,
|
|
4686
|
+
const { id, label, value, onChange, hidden, useMinorUnit, maxDecimalScale, min, max } = props;
|
|
4687
|
+
const [internalValue, setInternalValue] = useControlledState(
|
|
5262
4688
|
value,
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
maxDecimalScale,
|
|
5267
|
-
min,
|
|
5268
|
-
max
|
|
5269
|
-
} = props;
|
|
5270
|
-
const [internalValue, setInternalValue] = useControlledState(value, null, onChange);
|
|
4689
|
+
null,
|
|
4690
|
+
onChange
|
|
4691
|
+
);
|
|
5271
4692
|
const minValue = internalValue?.[0];
|
|
5272
4693
|
const maxValue = internalValue?.[1];
|
|
5273
4694
|
const handleMinChange = (0, import_react37.useCallback)(
|
|
@@ -5297,16 +4718,7 @@ function PercentageRange(props) {
|
|
|
5297
4718
|
if (hidden) {
|
|
5298
4719
|
return null;
|
|
5299
4720
|
}
|
|
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(
|
|
4721
|
+
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
4722
|
PercentageInput,
|
|
5311
4723
|
{
|
|
5312
4724
|
label: "Minimum",
|
|
@@ -5343,11 +4755,7 @@ var import_react38 = __toESM(require("react"));
|
|
|
5343
4755
|
var import_joy50 = require("@mui/joy");
|
|
5344
4756
|
function Autocomplete2(props) {
|
|
5345
4757
|
const { id, label, value, onChange, options, multiple, hidden, placeholder } = props;
|
|
5346
|
-
const [internalValue, setInternalValue] = useControlledState(
|
|
5347
|
-
value,
|
|
5348
|
-
void 0,
|
|
5349
|
-
onChange
|
|
5350
|
-
);
|
|
4758
|
+
const [internalValue, setInternalValue] = useControlledState(value, void 0, onChange);
|
|
5351
4759
|
const autocompleteValue = typeof internalValue === "string" || typeof internalValue === "number" ? String(internalValue) : void 0;
|
|
5352
4760
|
const handleChange = (0, import_react38.useCallback)(
|
|
5353
4761
|
(event) => {
|
|
@@ -5364,16 +4772,7 @@ function Autocomplete2(props) {
|
|
|
5364
4772
|
if (hidden) {
|
|
5365
4773
|
return null;
|
|
5366
4774
|
}
|
|
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(
|
|
4775
|
+
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
4776
|
Autocomplete,
|
|
5378
4777
|
{
|
|
5379
4778
|
value: autocompleteValue,
|
|
@@ -5399,16 +4798,7 @@ var componentMap = {
|
|
|
5399
4798
|
autocomplete: Autocomplete2
|
|
5400
4799
|
};
|
|
5401
4800
|
function FilterMenu(props) {
|
|
5402
|
-
const {
|
|
5403
|
-
filters,
|
|
5404
|
-
values,
|
|
5405
|
-
defaultValues,
|
|
5406
|
-
resetValues = {},
|
|
5407
|
-
onChange,
|
|
5408
|
-
onClose,
|
|
5409
|
-
useClear,
|
|
5410
|
-
useReset
|
|
5411
|
-
} = props;
|
|
4801
|
+
const { filters, values, defaultValues, resetValues = {}, onChange, onClose, useClear, useReset } = props;
|
|
5412
4802
|
const [internalValues, setInternalValues] = useControlledState(
|
|
5413
4803
|
values,
|
|
5414
4804
|
defaultValues || {},
|
|
@@ -5458,25 +4848,7 @@ function FilterMenu(props) {
|
|
|
5458
4848
|
}
|
|
5459
4849
|
) : null;
|
|
5460
4850
|
}))),
|
|
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"))
|
|
4851
|
+
/* @__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
4852
|
);
|
|
5481
4853
|
}
|
|
5482
4854
|
FilterMenu.displayName = "FilterMenu";
|
|
@@ -5541,52 +4913,11 @@ var ClearIcon2 = (0, import_joy52.styled)(import_ClearRounded.default, {
|
|
|
5541
4913
|
width: "18px",
|
|
5542
4914
|
height: "18px"
|
|
5543
4915
|
}));
|
|
5544
|
-
var UNITS = [
|
|
5545
|
-
"byte",
|
|
5546
|
-
"kilobyte",
|
|
5547
|
-
"megabyte",
|
|
5548
|
-
"gigabyte",
|
|
5549
|
-
"terabyte",
|
|
5550
|
-
"petabyte"
|
|
5551
|
-
];
|
|
4916
|
+
var UNITS = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "petabyte"];
|
|
5552
4917
|
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
|
-
]
|
|
4918
|
+
"image/*": [".jpeg", ".jpg", ".png", ".gif", ".bmp", ".tiff", ".svg", ".webp", ".heic", ".ico"],
|
|
4919
|
+
"audio/*": [".mp3", ".wav", ".flac", ".aac", ".ogg", ".m4a", ".wma", ".aiff", ".alac", ".midi", ".mp4"],
|
|
4920
|
+
"video/*": [".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".webm", ".mpeg", ".3gp", ".m4v"]
|
|
5590
4921
|
};
|
|
5591
4922
|
var getFileSize = (n) => {
|
|
5592
4923
|
const i = n == 0 ? 0 : Math.floor(Math.log(n) / Math.log(1024));
|
|
@@ -5600,16 +4931,7 @@ var getFileSize = (n) => {
|
|
|
5600
4931
|
};
|
|
5601
4932
|
var Preview = (props) => {
|
|
5602
4933
|
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))))));
|
|
4934
|
+
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
4935
|
};
|
|
5614
4936
|
var UploaderRoot = (0, import_joy52.styled)(Stack_default, {
|
|
5615
4937
|
name: "Uploader",
|
|
@@ -5621,31 +4943,27 @@ var FileDropZone = (0, import_joy52.styled)(Sheet_default, {
|
|
|
5621
4943
|
name: "Uploader",
|
|
5622
4944
|
slot: "dropZone",
|
|
5623
4945
|
shouldForwardProp: (prop) => prop !== "error"
|
|
5624
|
-
})(
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
})
|
|
5637
|
-
);
|
|
4946
|
+
})(({ theme, state, error }) => ({
|
|
4947
|
+
width: "100%",
|
|
4948
|
+
display: "flex",
|
|
4949
|
+
flexDirection: "column",
|
|
4950
|
+
justifyContent: "center",
|
|
4951
|
+
alignItems: "center",
|
|
4952
|
+
padding: theme.spacing(5),
|
|
4953
|
+
gap: theme.spacing(4),
|
|
4954
|
+
cursor: "pointer",
|
|
4955
|
+
backgroundColor: theme.palette.background.surface,
|
|
4956
|
+
border: error ? `1px solid ${theme.palette.danger.outlinedBorder}` : state === "idle" ? `1px solid ${theme.palette.neutral.outlinedBorder}` : `1px solid ${theme.palette.primary.outlinedBorder}`
|
|
4957
|
+
}));
|
|
5638
4958
|
var UploaderIcon = (0, import_joy52.styled)(import_CloudUploadRounded.default, {
|
|
5639
4959
|
name: "Uploader",
|
|
5640
4960
|
slot: "iconContainer",
|
|
5641
4961
|
shouldForwardProp: (prop) => prop !== "error"
|
|
5642
|
-
})(
|
|
5643
|
-
({
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
})
|
|
5648
|
-
);
|
|
4962
|
+
})(({ theme, state, error }) => ({
|
|
4963
|
+
color: error ? `rgba(${theme.vars.palette.danger.mainChannel} / 0.6)` : state === "over" ? `rgba(${theme.palette.primary.mainChannel} / 0.6)` : theme.palette.neutral.softActiveBg,
|
|
4964
|
+
width: "32px",
|
|
4965
|
+
height: "32px"
|
|
4966
|
+
}));
|
|
5649
4967
|
var Uploader = import_react40.default.memo(
|
|
5650
4968
|
(props) => {
|
|
5651
4969
|
const {
|
|
@@ -5665,14 +4983,9 @@ var Uploader = import_react40.default.memo(
|
|
|
5665
4983
|
const inputRef = (0, import_react40.useRef)(null);
|
|
5666
4984
|
const [errorText, setErrorText] = (0, import_react40.useState)();
|
|
5667
4985
|
const [files, setFiles] = (0, import_react40.useState)([]);
|
|
5668
|
-
const [uploaded, setUploaded] = (0, import_react40.useState)(
|
|
5669
|
-
props.uploaded || []
|
|
5670
|
-
);
|
|
4986
|
+
const [uploaded, setUploaded] = (0, import_react40.useState)(props.uploaded || []);
|
|
5671
4987
|
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
|
-
);
|
|
4988
|
+
const accepts = (0, import_react40.useMemo)(() => accept.split(",").map((accept2) => accept2.trim()), [accept]);
|
|
5676
4989
|
const parsedAccepts = (0, import_react40.useMemo)(
|
|
5677
4990
|
() => accepts.flatMap((type) => {
|
|
5678
4991
|
if (["image/*", "video/*", "audio/*"].includes(type)) {
|
|
@@ -5684,15 +4997,11 @@ var Uploader = import_react40.default.memo(
|
|
|
5684
4997
|
);
|
|
5685
4998
|
const helperText = (0, import_react40.useMemo)(() => {
|
|
5686
4999
|
const [allAcceptedTypes, acceptedTypes] = [
|
|
5687
|
-
accepts.filter(
|
|
5688
|
-
(accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)
|
|
5689
|
-
).map((accept2) => {
|
|
5000
|
+
accepts.filter((accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
|
|
5690
5001
|
const [type] = accept2.split("/");
|
|
5691
5002
|
return type.toLowerCase();
|
|
5692
5003
|
}),
|
|
5693
|
-
accepts.filter(
|
|
5694
|
-
(accept2) => !["image/*", "video/*", "audio/*"].includes(accept2)
|
|
5695
|
-
).map((accept2) => {
|
|
5004
|
+
accepts.filter((accept2) => !["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
|
|
5696
5005
|
const [extensionOrType, subType] = accept2.split("/");
|
|
5697
5006
|
if (!subType) {
|
|
5698
5007
|
return extensionOrType.toUpperCase().replace(".", "");
|
|
@@ -5709,16 +5018,11 @@ var Uploader = import_react40.default.memo(
|
|
|
5709
5018
|
}
|
|
5710
5019
|
helperTexts.push(`Maximum ${getFileSize(maxFileTotalSize)}`);
|
|
5711
5020
|
if (maxCount) {
|
|
5712
|
-
helperTexts.push(
|
|
5713
|
-
`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`
|
|
5714
|
-
);
|
|
5021
|
+
helperTexts.push(`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`);
|
|
5715
5022
|
}
|
|
5716
5023
|
return helperTexts.join(", ");
|
|
5717
5024
|
}, [accepts, maxFileTotalSize, maxCount]);
|
|
5718
|
-
const error = (0, import_react40.useMemo)(
|
|
5719
|
-
() => !!errorText || props.error,
|
|
5720
|
-
[props.error, errorText]
|
|
5721
|
-
);
|
|
5025
|
+
const error = (0, import_react40.useMemo)(() => !!errorText || props.error, [props.error, errorText]);
|
|
5722
5026
|
const showDropZone = (0, import_react40.useMemo)(
|
|
5723
5027
|
() => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
|
|
5724
5028
|
[files, maxCount, uploaded]
|
|
@@ -5745,10 +5049,7 @@ var Uploader = import_react40.default.memo(
|
|
|
5745
5049
|
}
|
|
5746
5050
|
});
|
|
5747
5051
|
}
|
|
5748
|
-
const totalFileSize = [...files, ...uploads].reduce(
|
|
5749
|
-
(acc, file) => acc + file.size,
|
|
5750
|
-
0
|
|
5751
|
-
);
|
|
5052
|
+
const totalFileSize = [...files, ...uploads].reduce((acc, file) => acc + file.size, 0);
|
|
5752
5053
|
if (totalFileSize > maxFileTotalSize) {
|
|
5753
5054
|
throw new Error(`Total File size exceeded the maximum limit.`);
|
|
5754
5055
|
}
|
|
@@ -5769,34 +5070,15 @@ var Uploader = import_react40.default.memo(
|
|
|
5769
5070
|
setErrorText(err.message);
|
|
5770
5071
|
}
|
|
5771
5072
|
},
|
|
5772
|
-
[
|
|
5773
|
-
files,
|
|
5774
|
-
uploaded,
|
|
5775
|
-
maxCount,
|
|
5776
|
-
parsedAccepts,
|
|
5777
|
-
maxFileSize,
|
|
5778
|
-
maxFileTotalSize,
|
|
5779
|
-
name,
|
|
5780
|
-
onChange
|
|
5781
|
-
]
|
|
5073
|
+
[files, uploaded, maxCount, parsedAccepts, maxFileSize, maxFileTotalSize, name, onChange]
|
|
5782
5074
|
);
|
|
5783
5075
|
(0, import_react40.useEffect)(() => {
|
|
5784
5076
|
if (!dropZoneRef.current || disabled) {
|
|
5785
5077
|
return;
|
|
5786
5078
|
}
|
|
5787
5079
|
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
|
-
]) => {
|
|
5080
|
+
Promise.all([esmFiles.combine, esmFiles.adapter, esmFiles.file, esmFiles.preventUnhandled]).then(
|
|
5081
|
+
([combineModule, adapterModule, fileModule, preventUnhandledModule]) => {
|
|
5800
5082
|
const { combine } = combineModule;
|
|
5801
5083
|
const { dropTargetForExternal, monitorForExternal } = adapterModule;
|
|
5802
5084
|
const { containsFiles, getFiles } = fileModule;
|
|
@@ -5831,9 +5113,7 @@ var Uploader = import_react40.default.memo(
|
|
|
5831
5113
|
(0, import_react40.useEffect)(() => {
|
|
5832
5114
|
if (inputRef.current && minCount) {
|
|
5833
5115
|
if (files.length < minCount) {
|
|
5834
|
-
inputRef.current.setCustomValidity(
|
|
5835
|
-
`At least ${minCount} files are required.`
|
|
5836
|
-
);
|
|
5116
|
+
inputRef.current.setCustomValidity(`At least ${minCount} files are required.`);
|
|
5837
5117
|
} else {
|
|
5838
5118
|
inputRef.current.setCustomValidity("");
|
|
5839
5119
|
}
|
|
@@ -5859,9 +5139,7 @@ var Uploader = import_react40.default.memo(
|
|
|
5859
5139
|
return current.filter((file) => file !== deletedFile);
|
|
5860
5140
|
});
|
|
5861
5141
|
} else {
|
|
5862
|
-
setUploaded(
|
|
5863
|
-
(uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id)
|
|
5864
|
-
);
|
|
5142
|
+
setUploaded((uploaded2) => uploaded2.filter((file) => file.id !== deletedFile.id));
|
|
5865
5143
|
onDelete?.(deletedFile);
|
|
5866
5144
|
}
|
|
5867
5145
|
setErrorText(void 0);
|
|
@@ -5887,9 +5165,7 @@ var Uploader = import_react40.default.memo(
|
|
|
5887
5165
|
required: !!minCount,
|
|
5888
5166
|
onInvalid: (e) => {
|
|
5889
5167
|
if (minCount && files.length < minCount) {
|
|
5890
|
-
setErrorText(
|
|
5891
|
-
`Please choose ${minCount} ${minCount === 1 ? "file" : "files"} to upload.`
|
|
5892
|
-
);
|
|
5168
|
+
setErrorText(`Please choose ${minCount} ${minCount === 1 ? "file" : "files"} to upload.`);
|
|
5893
5169
|
}
|
|
5894
5170
|
},
|
|
5895
5171
|
slotProps: {
|
|
@@ -5905,25 +5181,7 @@ var Uploader = import_react40.default.memo(
|
|
|
5905
5181
|
}
|
|
5906
5182
|
)
|
|
5907
5183
|
);
|
|
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
|
-
));
|
|
5184
|
+
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
5185
|
}
|
|
5928
5186
|
);
|
|
5929
5187
|
Uploader.displayName = "Uploader";
|
|
@@ -5977,15 +5235,7 @@ function IconMenuButton(props) {
|
|
|
5977
5235
|
}
|
|
5978
5236
|
},
|
|
5979
5237
|
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
|
-
))));
|
|
5238
|
+
), /* @__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
5239
|
}
|
|
5990
5240
|
IconMenuButton.displayName = "IconMenuButton";
|
|
5991
5241
|
|
|
@@ -6019,52 +5269,33 @@ var Markdown = (props) => {
|
|
|
6019
5269
|
if (!rehypeAccent2) {
|
|
6020
5270
|
return null;
|
|
6021
5271
|
}
|
|
6022
|
-
return /* @__PURE__ */ import_react42.default.createElement(
|
|
6023
|
-
|
|
5272
|
+
return /* @__PURE__ */ import_react42.default.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ import_react42.default.createElement(
|
|
5273
|
+
import_react42.Suspense,
|
|
6024
5274
|
{
|
|
6025
|
-
|
|
6026
|
-
color,
|
|
6027
|
-
textColor,
|
|
6028
|
-
level: defaultLevel,
|
|
6029
|
-
...innerProps
|
|
5275
|
+
fallback: fallback || /* @__PURE__ */ import_react42.default.createElement(Typography, null, /* @__PURE__ */ import_react42.default.createElement(import_joy55.Skeleton, null, content || ""))
|
|
6030
5276
|
},
|
|
6031
5277
|
/* @__PURE__ */ import_react42.default.createElement(
|
|
6032
|
-
|
|
5278
|
+
LazyReactMarkdown,
|
|
6033
5279
|
{
|
|
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
|
-
}
|
|
5280
|
+
...markdownOptions,
|
|
5281
|
+
children: content,
|
|
5282
|
+
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
5283
|
+
remarkPlugins: [import_remark_gfm.default],
|
|
5284
|
+
components: {
|
|
5285
|
+
h1: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { color, textColor, level: "h1" }, children),
|
|
5286
|
+
h2: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { color, textColor, level: "h2" }, children),
|
|
5287
|
+
h3: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { color, textColor, level: "h3" }, children),
|
|
5288
|
+
h4: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { color, textColor, level: "h4" }, children),
|
|
5289
|
+
p: ({ children, node }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { color, textColor, level: defaultLevel, ...node?.properties }, children),
|
|
5290
|
+
a: ({ children, href }) => /* @__PURE__ */ import_react42.default.createElement(import_joy56.Link, { href, target: defaultLinkAction }, children),
|
|
5291
|
+
hr: () => /* @__PURE__ */ import_react42.default.createElement(Divider, null),
|
|
5292
|
+
b: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
5293
|
+
strong: ({ children }) => /* @__PURE__ */ import_react42.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
|
|
5294
|
+
...markdownOptions?.components
|
|
6064
5295
|
}
|
|
6065
|
-
|
|
5296
|
+
}
|
|
6066
5297
|
)
|
|
6067
|
-
);
|
|
5298
|
+
));
|
|
6068
5299
|
};
|
|
6069
5300
|
Markdown.displayName = "Markdown";
|
|
6070
5301
|
|
|
@@ -6117,15 +5348,7 @@ function MenuButton(props) {
|
|
|
6117
5348
|
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
5349
|
},
|
|
6119
5350
|
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
|
-
))));
|
|
5351
|
+
), /* @__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
5352
|
}
|
|
6130
5353
|
MenuButton.displayName = "MenuButton";
|
|
6131
5354
|
|
|
@@ -6185,215 +5408,202 @@ function parseDate3(dateString, format) {
|
|
|
6185
5408
|
const result = new Date(year, month, day);
|
|
6186
5409
|
return result;
|
|
6187
5410
|
}
|
|
6188
|
-
var MonthPicker = (0, import_react44.forwardRef)(
|
|
6189
|
-
(
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
5411
|
+
var MonthPicker = (0, import_react44.forwardRef)((inProps, ref) => {
|
|
5412
|
+
const props = (0, import_joy58.useThemeProps)({ props: inProps, name: "MonthPicker" });
|
|
5413
|
+
const {
|
|
5414
|
+
onChange,
|
|
5415
|
+
disabled,
|
|
5416
|
+
label,
|
|
5417
|
+
error,
|
|
5418
|
+
helperText,
|
|
5419
|
+
minDate,
|
|
5420
|
+
maxDate,
|
|
5421
|
+
disableFuture,
|
|
5422
|
+
disablePast,
|
|
5423
|
+
required,
|
|
5424
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
5425
|
+
sx,
|
|
5426
|
+
className,
|
|
5427
|
+
/**
|
|
5428
|
+
* NOTE: 현재 CalendarDate는 YYYY-MM-DD로 개발하고 있어 date를 포함하여 value를 관리한다.
|
|
5429
|
+
* @see https://ecubelabs.atlassian.net/wiki/spaces/SW/pages/1938784349/Date#CalendarDate
|
|
5430
|
+
* @see https://github.com/Ecube-Labs/hds/pull/145
|
|
5431
|
+
*/
|
|
5432
|
+
format = "YYYY/MM/DD",
|
|
5433
|
+
displayFormat = "YYYY/MM",
|
|
5434
|
+
size,
|
|
5435
|
+
locale,
|
|
5436
|
+
...innerProps
|
|
5437
|
+
} = props;
|
|
5438
|
+
const innerRef = (0, import_react44.useRef)(null);
|
|
5439
|
+
const buttonRef = (0, import_react44.useRef)(null);
|
|
5440
|
+
const [value, setValue, isControlled] = useControlledState(
|
|
5441
|
+
props.value,
|
|
5442
|
+
props.defaultValue || "",
|
|
5443
|
+
(0, import_react44.useCallback)((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
5444
|
+
);
|
|
5445
|
+
const getFormattedDisplayValue = (0, import_react44.useCallback)(
|
|
5446
|
+
(inputValue) => {
|
|
5447
|
+
if (!inputValue) return "";
|
|
5448
|
+
try {
|
|
5449
|
+
return formatValueString3(parseDate3(inputValue, format), displayFormat, locale);
|
|
5450
|
+
} catch (e) {
|
|
5451
|
+
return inputValue;
|
|
5452
|
+
}
|
|
5453
|
+
},
|
|
5454
|
+
[format, displayFormat, locale]
|
|
5455
|
+
);
|
|
5456
|
+
const [displayValue, setDisplayValue] = (0, import_react44.useState)(() => getFormattedDisplayValue(value));
|
|
5457
|
+
const [anchorEl, setAnchorEl] = (0, import_react44.useState)(null);
|
|
5458
|
+
const open = Boolean(anchorEl);
|
|
5459
|
+
(0, import_react44.useEffect)(() => {
|
|
5460
|
+
if (!anchorEl) {
|
|
5461
|
+
innerRef.current?.blur();
|
|
5462
|
+
}
|
|
5463
|
+
}, [anchorEl, innerRef]);
|
|
5464
|
+
(0, import_react44.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
5465
|
+
(0, import_react44.useEffect)(() => {
|
|
5466
|
+
setDisplayValue(getFormattedDisplayValue(value));
|
|
5467
|
+
}, [value, getFormattedDisplayValue]);
|
|
5468
|
+
const handleChange = (0, import_react44.useCallback)(
|
|
5469
|
+
(event) => {
|
|
5470
|
+
const newValue = event.target.value;
|
|
5471
|
+
setValue(newValue);
|
|
5472
|
+
if (!isControlled) {
|
|
5473
|
+
setDisplayValue(getFormattedDisplayValue(newValue));
|
|
5474
|
+
}
|
|
5475
|
+
},
|
|
5476
|
+
[setValue, getFormattedDisplayValue, isControlled]
|
|
5477
|
+
);
|
|
5478
|
+
const handleCalendarToggle = (0, import_react44.useCallback)(
|
|
5479
|
+
(event) => {
|
|
5480
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5481
|
+
innerRef.current?.focus();
|
|
5482
|
+
},
|
|
5483
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
5484
|
+
);
|
|
5485
|
+
const handleInputMouseDown = (0, import_react44.useCallback)(
|
|
5486
|
+
(event) => {
|
|
5487
|
+
event.preventDefault();
|
|
5488
|
+
buttonRef.current?.focus();
|
|
5489
|
+
},
|
|
5490
|
+
[buttonRef]
|
|
5491
|
+
);
|
|
5492
|
+
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(
|
|
5493
|
+
Input_default,
|
|
5494
|
+
{
|
|
5495
|
+
...innerProps,
|
|
5496
|
+
color: error ? "danger" : innerProps.color,
|
|
5497
|
+
ref: innerRef,
|
|
5498
|
+
size,
|
|
5499
|
+
value: displayValue,
|
|
5500
|
+
placeholder: displayFormat,
|
|
6193
5501
|
disabled,
|
|
6194
|
-
label,
|
|
6195
|
-
error,
|
|
6196
|
-
helperText,
|
|
6197
|
-
minDate,
|
|
6198
|
-
maxDate,
|
|
6199
|
-
disableFuture,
|
|
6200
|
-
disablePast,
|
|
6201
5502
|
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));
|
|
5503
|
+
slotProps: {
|
|
5504
|
+
input: {
|
|
5505
|
+
ref: innerRef,
|
|
5506
|
+
format: displayFormat,
|
|
5507
|
+
sx: {
|
|
5508
|
+
"&:hover": {
|
|
5509
|
+
cursor: "default"
|
|
5510
|
+
}
|
|
5511
|
+
},
|
|
5512
|
+
onMouseDown: handleInputMouseDown
|
|
6263
5513
|
}
|
|
6264
5514
|
},
|
|
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();
|
|
5515
|
+
error,
|
|
5516
|
+
className,
|
|
5517
|
+
sx: {
|
|
5518
|
+
...sx,
|
|
5519
|
+
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
5520
|
+
fontFamily: "monospace"
|
|
6278
5521
|
},
|
|
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
|
-
}
|
|
5522
|
+
endDecorator: /* @__PURE__ */ import_react44.default.createElement(
|
|
5523
|
+
IconButton_default,
|
|
5524
|
+
{
|
|
5525
|
+
ref: buttonRef,
|
|
5526
|
+
variant: "plain",
|
|
5527
|
+
onClick: handleCalendarToggle,
|
|
5528
|
+
"aria-label": "Toggle Calendar",
|
|
5529
|
+
"aria-controls": "month-picker-popper",
|
|
5530
|
+
"aria-haspopup": "dialog",
|
|
5531
|
+
"aria-expanded": open,
|
|
5532
|
+
disabled
|
|
6303
5533
|
},
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
5534
|
+
/* @__PURE__ */ import_react44.default.createElement(import_CalendarToday3.default, null)
|
|
5535
|
+
),
|
|
5536
|
+
label,
|
|
5537
|
+
helperText
|
|
5538
|
+
}
|
|
5539
|
+
), open && /* @__PURE__ */ import_react44.default.createElement(import_base4.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react44.default.createElement(
|
|
5540
|
+
StyledPopper3,
|
|
5541
|
+
{
|
|
5542
|
+
id: "month-picker-popper",
|
|
5543
|
+
open: true,
|
|
5544
|
+
anchorEl,
|
|
5545
|
+
placement: "bottom-end",
|
|
5546
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
5547
|
+
modifiers: [
|
|
5548
|
+
{
|
|
5549
|
+
name: "offset",
|
|
5550
|
+
options: {
|
|
5551
|
+
offset: [4, 4]
|
|
5552
|
+
}
|
|
5553
|
+
}
|
|
5554
|
+
],
|
|
5555
|
+
"aria-label": "Calendar Tooltip",
|
|
5556
|
+
"aria-expanded": open
|
|
5557
|
+
},
|
|
5558
|
+
/* @__PURE__ */ import_react44.default.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react44.default.createElement(
|
|
5559
|
+
Calendar_default,
|
|
5560
|
+
{
|
|
5561
|
+
view: "month",
|
|
5562
|
+
views: ["month"],
|
|
5563
|
+
value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
|
|
5564
|
+
onChange: ([date]) => {
|
|
5565
|
+
handleChange({
|
|
5566
|
+
target: {
|
|
5567
|
+
name: props.name,
|
|
5568
|
+
value: formatValueString3(date, format, locale)
|
|
5569
|
+
}
|
|
5570
|
+
});
|
|
5571
|
+
setAnchorEl(null);
|
|
6310
5572
|
},
|
|
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
|
|
5573
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
5574
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
5575
|
+
disableFuture,
|
|
5576
|
+
disablePast,
|
|
5577
|
+
locale
|
|
6327
5578
|
}
|
|
6328
|
-
),
|
|
6329
|
-
|
|
5579
|
+
), /* @__PURE__ */ import_react44.default.createElement(
|
|
5580
|
+
DialogActions_default,
|
|
6330
5581
|
{
|
|
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
|
|
5582
|
+
sx: {
|
|
5583
|
+
p: 1
|
|
5584
|
+
}
|
|
6346
5585
|
},
|
|
6347
|
-
/* @__PURE__ */ import_react44.default.createElement(
|
|
6348
|
-
|
|
5586
|
+
/* @__PURE__ */ import_react44.default.createElement(
|
|
5587
|
+
Button_default,
|
|
6349
5588
|
{
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
5589
|
+
size,
|
|
5590
|
+
variant: "plain",
|
|
5591
|
+
color: "neutral",
|
|
5592
|
+
onClick: () => {
|
|
6354
5593
|
handleChange({
|
|
6355
5594
|
target: {
|
|
6356
5595
|
name: props.name,
|
|
6357
|
-
value:
|
|
5596
|
+
value: ""
|
|
6358
5597
|
}
|
|
6359
5598
|
});
|
|
6360
5599
|
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
5600
|
}
|
|
6374
5601
|
},
|
|
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
|
-
);
|
|
5602
|
+
"Clear"
|
|
5603
|
+
)
|
|
5604
|
+
))
|
|
5605
|
+
)))));
|
|
5606
|
+
});
|
|
6397
5607
|
|
|
6398
5608
|
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
6399
5609
|
var import_react45 = __toESM(require("react"));
|
|
@@ -6454,196 +5664,184 @@ var parseDates2 = (str) => {
|
|
|
6454
5664
|
var formatToPattern3 = (format) => {
|
|
6455
5665
|
return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
|
|
6456
5666
|
};
|
|
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
|
-
}
|
|
5667
|
+
var TextMaskAdapter9 = import_react45.default.forwardRef(function TextMaskAdapter10(props, ref) {
|
|
5668
|
+
const { onChange, format, ...other } = props;
|
|
5669
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
5670
|
+
import_react_imask3.IMaskInput,
|
|
5671
|
+
{
|
|
5672
|
+
...other,
|
|
5673
|
+
inputRef: ref,
|
|
5674
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
5675
|
+
mask: Date,
|
|
5676
|
+
pattern: formatToPattern3(format),
|
|
5677
|
+
blocks: {
|
|
5678
|
+
m: {
|
|
5679
|
+
mask: import_react_imask3.IMask.MaskedRange,
|
|
5680
|
+
from: 1,
|
|
5681
|
+
to: 12,
|
|
5682
|
+
maxLength: 2
|
|
6480
5683
|
},
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
5684
|
+
Y: {
|
|
5685
|
+
mask: import_react_imask3.IMask.MaskedRange,
|
|
5686
|
+
from: 1900,
|
|
5687
|
+
to: 9999
|
|
5688
|
+
}
|
|
5689
|
+
},
|
|
5690
|
+
format: (dates) => formatValueString4(dates, format),
|
|
5691
|
+
parse: parseDates2,
|
|
5692
|
+
autofix: "pad",
|
|
5693
|
+
overwrite: true
|
|
5694
|
+
}
|
|
5695
|
+
);
|
|
5696
|
+
});
|
|
5697
|
+
var MonthRangePicker = (0, import_react45.forwardRef)((inProps, ref) => {
|
|
5698
|
+
const props = (0, import_joy59.useThemeProps)({ props: inProps, name: "MonthRangePicker" });
|
|
5699
|
+
const {
|
|
5700
|
+
onChange,
|
|
5701
|
+
disabled,
|
|
5702
|
+
label,
|
|
5703
|
+
error,
|
|
5704
|
+
helperText,
|
|
5705
|
+
minDate,
|
|
5706
|
+
maxDate,
|
|
5707
|
+
disableFuture,
|
|
5708
|
+
disablePast,
|
|
5709
|
+
required,
|
|
5710
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
5711
|
+
sx,
|
|
5712
|
+
className,
|
|
5713
|
+
format = "YYYY/MM",
|
|
5714
|
+
size,
|
|
5715
|
+
...innerProps
|
|
5716
|
+
} = props;
|
|
5717
|
+
const innerRef = (0, import_react45.useRef)(null);
|
|
5718
|
+
const [value, setValue] = useControlledState(
|
|
5719
|
+
props.value,
|
|
5720
|
+
props.defaultValue || "",
|
|
5721
|
+
(0, import_react45.useCallback)((value2) => onChange?.({ target: { name: props.name, value: value2 } }), [props.name, onChange])
|
|
5722
|
+
);
|
|
5723
|
+
const [anchorEl, setAnchorEl] = (0, import_react45.useState)(null);
|
|
5724
|
+
const open = Boolean(anchorEl);
|
|
5725
|
+
const calendarValue = (0, import_react45.useMemo)(() => value ? parseDates2(value) : void 0, [value]);
|
|
5726
|
+
(0, import_react45.useEffect)(() => {
|
|
5727
|
+
if (!anchorEl) {
|
|
5728
|
+
innerRef.current?.blur();
|
|
5729
|
+
}
|
|
5730
|
+
}, [anchorEl, innerRef]);
|
|
5731
|
+
(0, import_react45.useImperativeHandle)(ref, () => innerRef.current, [innerRef]);
|
|
5732
|
+
const handleChange = (0, import_react45.useCallback)(
|
|
5733
|
+
(event) => {
|
|
5734
|
+
setValue(event.target.value);
|
|
5735
|
+
},
|
|
5736
|
+
[setValue]
|
|
5737
|
+
);
|
|
5738
|
+
const handleCalendarToggle = (0, import_react45.useCallback)(
|
|
5739
|
+
(event) => {
|
|
5740
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
5741
|
+
innerRef.current?.focus();
|
|
5742
|
+
},
|
|
5743
|
+
[anchorEl, setAnchorEl, innerRef]
|
|
5744
|
+
);
|
|
5745
|
+
const handleCalendarChange = (0, import_react45.useCallback)(
|
|
5746
|
+
([date1, date2]) => {
|
|
5747
|
+
if (!date1 || !date2) return;
|
|
5748
|
+
setValue(formatValueString4([date1, date2], format));
|
|
5749
|
+
setAnchorEl(null);
|
|
5750
|
+
},
|
|
5751
|
+
[setValue, setAnchorEl, format]
|
|
5752
|
+
);
|
|
5753
|
+
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(
|
|
5754
|
+
Input_default,
|
|
5755
|
+
{
|
|
5756
|
+
...innerProps,
|
|
5757
|
+
color: error ? "danger" : innerProps.color,
|
|
5758
|
+
ref,
|
|
5759
|
+
size,
|
|
5760
|
+
value,
|
|
5761
|
+
onChange: handleChange,
|
|
6494
5762
|
disabled,
|
|
6495
|
-
label,
|
|
6496
|
-
error,
|
|
6497
|
-
helperText,
|
|
6498
|
-
minDate,
|
|
6499
|
-
maxDate,
|
|
6500
|
-
disableFuture,
|
|
6501
|
-
disablePast,
|
|
6502
5763
|
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();
|
|
5764
|
+
placeholder: `${format} - ${format}`,
|
|
5765
|
+
slotProps: {
|
|
5766
|
+
input: { component: TextMaskAdapter9, ref: innerRef, format }
|
|
6543
5767
|
},
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
setAnchorEl(null);
|
|
5768
|
+
error,
|
|
5769
|
+
className,
|
|
5770
|
+
sx: {
|
|
5771
|
+
...sx,
|
|
5772
|
+
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
5773
|
+
fontFamily: "monospace"
|
|
6551
5774
|
},
|
|
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"
|
|
5775
|
+
endDecorator: /* @__PURE__ */ import_react45.default.createElement(
|
|
5776
|
+
IconButton_default,
|
|
5777
|
+
{
|
|
5778
|
+
variant: "plain",
|
|
5779
|
+
onClick: handleCalendarToggle,
|
|
5780
|
+
"aria-label": "Toggle Calendar",
|
|
5781
|
+
"aria-controls": "month-range-picker-popper",
|
|
5782
|
+
"aria-haspopup": "dialog",
|
|
5783
|
+
"aria-expanded": open
|
|
6575
5784
|
},
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
5785
|
+
/* @__PURE__ */ import_react45.default.createElement(import_CalendarToday4.default, null)
|
|
5786
|
+
),
|
|
5787
|
+
label,
|
|
5788
|
+
helperText
|
|
5789
|
+
}
|
|
5790
|
+
), open && /* @__PURE__ */ import_react45.default.createElement(import_base5.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react45.default.createElement(
|
|
5791
|
+
StyledPopper4,
|
|
5792
|
+
{
|
|
5793
|
+
id: "month-range-picker-popper",
|
|
5794
|
+
open: true,
|
|
5795
|
+
anchorEl,
|
|
5796
|
+
placement: "bottom-end",
|
|
5797
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
5798
|
+
modifiers: [
|
|
5799
|
+
{
|
|
5800
|
+
name: "offset",
|
|
5801
|
+
options: {
|
|
5802
|
+
offset: [4, 4]
|
|
5803
|
+
}
|
|
5804
|
+
}
|
|
5805
|
+
],
|
|
5806
|
+
"aria-label": "Calendar Tooltip",
|
|
5807
|
+
"aria-expanded": open
|
|
5808
|
+
},
|
|
5809
|
+
/* @__PURE__ */ import_react45.default.createElement(CalendarSheet4, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ import_react45.default.createElement(
|
|
5810
|
+
Calendar_default,
|
|
5811
|
+
{
|
|
5812
|
+
view: "month",
|
|
5813
|
+
views: ["month"],
|
|
5814
|
+
rangeSelection: true,
|
|
5815
|
+
defaultValue: calendarValue,
|
|
5816
|
+
onChange: handleCalendarChange,
|
|
5817
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
5818
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
5819
|
+
disableFuture,
|
|
5820
|
+
disablePast
|
|
6590
5821
|
}
|
|
6591
|
-
),
|
|
6592
|
-
|
|
5822
|
+
), /* @__PURE__ */ import_react45.default.createElement(
|
|
5823
|
+
DialogActions_default,
|
|
6593
5824
|
{
|
|
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
|
|
5825
|
+
sx: {
|
|
5826
|
+
p: 1
|
|
6622
5827
|
}
|
|
6623
|
-
|
|
6624
|
-
|
|
5828
|
+
},
|
|
5829
|
+
/* @__PURE__ */ import_react45.default.createElement(
|
|
5830
|
+
Button_default,
|
|
6625
5831
|
{
|
|
6626
|
-
|
|
6627
|
-
|
|
5832
|
+
size,
|
|
5833
|
+
variant: "plain",
|
|
5834
|
+
color: "neutral",
|
|
5835
|
+
onClick: () => {
|
|
5836
|
+
setValue("");
|
|
5837
|
+
setAnchorEl(null);
|
|
6628
5838
|
}
|
|
6629
5839
|
},
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
color: "neutral",
|
|
6636
|
-
onClick: () => {
|
|
6637
|
-
setValue("");
|
|
6638
|
-
setAnchorEl(null);
|
|
6639
|
-
}
|
|
6640
|
-
},
|
|
6641
|
-
"Clear"
|
|
6642
|
-
)
|
|
6643
|
-
))
|
|
6644
|
-
)))));
|
|
6645
|
-
}
|
|
6646
|
-
);
|
|
5840
|
+
"Clear"
|
|
5841
|
+
)
|
|
5842
|
+
))
|
|
5843
|
+
)))));
|
|
5844
|
+
});
|
|
6647
5845
|
MonthRangePicker.displayName = "MonthRangePicker";
|
|
6648
5846
|
|
|
6649
5847
|
// src/components/NavigationGroup/NavigationGroup.tsx
|
|
@@ -6743,7 +5941,7 @@ function Navigator(props) {
|
|
|
6743
5941
|
return /* @__PURE__ */ import_react48.default.createElement(
|
|
6744
5942
|
NavigationGroup,
|
|
6745
5943
|
{
|
|
6746
|
-
key: index
|
|
5944
|
+
key: `${item.title}-${index}`,
|
|
6747
5945
|
title: item.title,
|
|
6748
5946
|
startDecorator: item.startDecorator,
|
|
6749
5947
|
level,
|
|
@@ -6768,23 +5966,9 @@ var StyledProfileCard = (0, import_joy62.styled)(import_joy3.Stack, {
|
|
|
6768
5966
|
})({});
|
|
6769
5967
|
function ProfileCard(props) {
|
|
6770
5968
|
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));
|
|
5969
|
+
const captionLevel = (0, import_react49.useMemo)(() => size === "sm" ? "body-xs" : "body-sm", [size]);
|
|
5970
|
+
const nameLevel = (0, import_react49.useMemo)(() => size === "sm" ? "body-sm" : "body-md", [size]);
|
|
5971
|
+
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
5972
|
}
|
|
6789
5973
|
ProfileCard.displayName = "ProfileCard";
|
|
6790
5974
|
var StyledProfileMenuButton = (0, import_joy62.styled)(import_joy62.MenuButton, {
|
|
@@ -6805,18 +5989,7 @@ function ProfileMenuButton(props) {
|
|
|
6805
5989
|
endDecorator: /* @__PURE__ */ import_react49.default.createElement(import_ArrowDropDown.default, null),
|
|
6806
5990
|
...innerProps
|
|
6807
5991
|
},
|
|
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
|
-
)
|
|
5992
|
+
/* @__PURE__ */ import_react49.default.createElement(Avatar, { variant: "soft", color: "primary", size, src, alt, getInitial }, children)
|
|
6820
5993
|
);
|
|
6821
5994
|
}
|
|
6822
5995
|
ProfileMenuButton.displayName = "ProfileMenuButton";
|
|
@@ -6831,16 +6004,7 @@ var ProfileMenuRoot = (0, import_joy62.styled)(Menu, {
|
|
|
6831
6004
|
}
|
|
6832
6005
|
}));
|
|
6833
6006
|
function ProfileMenu(props) {
|
|
6834
|
-
const {
|
|
6835
|
-
open: _open,
|
|
6836
|
-
defaultOpen,
|
|
6837
|
-
onOpenChange,
|
|
6838
|
-
profile,
|
|
6839
|
-
getInitial,
|
|
6840
|
-
menuItems,
|
|
6841
|
-
size,
|
|
6842
|
-
...innerProps
|
|
6843
|
-
} = props;
|
|
6007
|
+
const { open: _open, defaultOpen, onOpenChange, profile, getInitial, menuItems, size, ...innerProps } = props;
|
|
6844
6008
|
const [open, setOpen] = useControlledState(
|
|
6845
6009
|
_open,
|
|
6846
6010
|
defaultOpen ?? false,
|
|
@@ -6856,36 +6020,18 @@ function ProfileMenu(props) {
|
|
|
6856
6020
|
getInitial
|
|
6857
6021
|
},
|
|
6858
6022
|
profile.name
|
|
6859
|
-
), /* @__PURE__ */ import_react49.default.createElement(
|
|
6860
|
-
|
|
6023
|
+
), /* @__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(
|
|
6024
|
+
MenuItem,
|
|
6861
6025
|
{
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6026
|
+
key: label,
|
|
6027
|
+
...menuProps,
|
|
6028
|
+
onClick: (e) => {
|
|
6029
|
+
menuProps.onClick?.(e);
|
|
6030
|
+
setOpen(false);
|
|
6031
|
+
}
|
|
6866
6032
|
},
|
|
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
|
-
...menuProps,
|
|
6881
|
-
onClick: (e) => {
|
|
6882
|
-
menuProps.onClick?.(e);
|
|
6883
|
-
setOpen(false);
|
|
6884
|
-
}
|
|
6885
|
-
},
|
|
6886
|
-
label
|
|
6887
|
-
))
|
|
6888
|
-
))));
|
|
6033
|
+
label
|
|
6034
|
+
))))));
|
|
6889
6035
|
}
|
|
6890
6036
|
ProfileMenu.displayName = "ProfileMenu";
|
|
6891
6037
|
|
|
@@ -6961,6 +6107,7 @@ function Stepper(props) {
|
|
|
6961
6107
|
return /* @__PURE__ */ import_react51.default.createElement(
|
|
6962
6108
|
Step,
|
|
6963
6109
|
{
|
|
6110
|
+
key: `step-${i}`,
|
|
6964
6111
|
indicator: /* @__PURE__ */ import_react51.default.createElement(StepIndicator, { variant: "solid", color: "primary" }, completed ? /* @__PURE__ */ import_react51.default.createElement(import_Check.default, null) : step.indicatorContent),
|
|
6965
6112
|
active,
|
|
6966
6113
|
completed,
|