@ceed/cds 1.5.4-next.1 → 1.5.4

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.
@@ -20,8 +20,6 @@ interface BaseMonthPickerProps {
20
20
  disableFuture?: boolean;
21
21
  disablePast?: boolean;
22
22
  format?: string;
23
- displayFormat?: string;
24
- readonly?: boolean;
25
23
  }
26
24
  export type MonthPickerProps = BaseMonthPickerProps & Omit<React.ComponentProps<typeof Input>, "onChange" | "value" | "defaultValue">;
27
25
  declare const MonthPicker: React.ForwardRefExoticComponent<Omit<MonthPickerProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
package/dist/index.cjs CHANGED
@@ -4538,6 +4538,7 @@ MenuButton.displayName = "MenuButton";
4538
4538
 
4539
4539
  // src/components/MonthPicker/MonthPicker.tsx
4540
4540
  var import_react33 = __toESM(require("react"));
4541
+ var import_react_imask3 = require("react-imask");
4541
4542
  var import_CalendarToday3 = __toESM(require("@mui/icons-material/CalendarToday"));
4542
4543
  var import_joy46 = require("@mui/joy");
4543
4544
  var import_base4 = require("@mui/base");
@@ -4563,40 +4564,60 @@ var MonthPickerRoot = (0, import_joy46.styled)("div", {
4563
4564
  })({
4564
4565
  width: "100%"
4565
4566
  });
4566
- function getMonthName2(date) {
4567
- return new Intl.DateTimeFormat("en-US", { month: "long" }).format(date);
4568
- }
4569
4567
  var formatValueString3 = (date, format) => {
4570
- const year = date.getFullYear().toString();
4571
- const month = (date.getMonth() + 1).toString().padStart(2, "0");
4572
- const monthName = getMonthName2(date);
4573
- const day = date.getDate().toString().padStart(2, "0");
4574
- return format.replace(/MMMM/g, monthName).replace(/MM/g, month).replace(/DD/g, day).replace(/YYYY/g, year);
4568
+ let month = `${date.getMonth() + 1}`;
4569
+ const year = date.getFullYear();
4570
+ if (Number(month) < 10) month = "0" + month;
4571
+ return format.replace(/YYYY/g, year.toString()).replace(/MM/g, month);
4575
4572
  };
4576
- function parseDate3(dateString, format) {
4577
- const formatParts = format.split(/[-./\s]/);
4578
- const dateParts = dateString.split(/[-./\s]/);
4579
- if (formatParts.length !== dateParts.length) {
4580
- throw new Error("Invalid date string or format");
4581
- }
4582
- let day = 1, month, year;
4583
- for (let i = 0; i < formatParts.length; i++) {
4584
- const value = parseInt(dateParts[i], 10);
4585
- switch (formatParts[i]) {
4586
- case "MM":
4587
- month = value - 1;
4588
- break;
4589
- case "YYYY":
4590
- year = value;
4591
- break;
4592
- case "DD":
4593
- day = 1;
4594
- break;
4595
- }
4573
+ var formatToPattern3 = (format) => {
4574
+ return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/[^YM\s]/g, (match) => `${match}\``);
4575
+ };
4576
+ function parseDate3(dateString) {
4577
+ let month, year;
4578
+ const cleanDateString = dateString.replace(/[^\d]/g, "");
4579
+ if (dateString.match(/\d{1,2}.\d{4}/)) {
4580
+ month = cleanDateString.slice(0, 2);
4581
+ year = cleanDateString.slice(2);
4582
+ } else if (dateString.match(/\d{4}.\d{1,2}/)) {
4583
+ year = cleanDateString.slice(0, 4);
4584
+ month = cleanDateString.slice(4);
4596
4585
  }
4597
- const result = new Date(year, month, day);
4598
- return result;
4586
+ const date = /* @__PURE__ */ new Date(`${year}/${month}`);
4587
+ return date;
4599
4588
  }
4589
+ var TextMaskAdapter7 = import_react33.default.forwardRef(
4590
+ function TextMaskAdapter8(props, ref) {
4591
+ const { onChange, format, ...other } = props;
4592
+ return /* @__PURE__ */ import_react33.default.createElement(
4593
+ import_react_imask3.IMaskInput,
4594
+ {
4595
+ ...other,
4596
+ inputRef: ref,
4597
+ onAccept: (value) => onChange({ target: { name: props.name, value } }),
4598
+ mask: Date,
4599
+ pattern: formatToPattern3(format),
4600
+ blocks: {
4601
+ M: {
4602
+ mask: import_react_imask3.IMask.MaskedRange,
4603
+ from: 1,
4604
+ to: 12,
4605
+ maxLength: 2
4606
+ },
4607
+ Y: {
4608
+ mask: import_react_imask3.IMask.MaskedRange,
4609
+ from: 1900,
4610
+ to: 9999
4611
+ }
4612
+ },
4613
+ format: (date) => formatValueString3(date, format),
4614
+ parse: parseDate3,
4615
+ autofix: "pad",
4616
+ overwrite: true
4617
+ }
4618
+ );
4619
+ }
4620
+ );
4600
4621
  var MonthPicker = (0, import_react33.forwardRef)(
4601
4622
  (inProps, ref) => {
4602
4623
  const props = (0, import_joy46.useThemeProps)({ props: inProps, name: "MonthPicker" });
@@ -4614,14 +4635,11 @@ var MonthPicker = (0, import_react33.forwardRef)(
4614
4635
  // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
4615
4636
  sx,
4616
4637
  className,
4617
- format = "YYYY/MM/DD",
4618
- displayFormat = "YYYY/MM/DD",
4619
- readOnly,
4638
+ format = "YYYY/MM",
4620
4639
  size,
4621
4640
  ...innerProps
4622
4641
  } = props;
4623
4642
  const innerRef = (0, import_react33.useRef)(null);
4624
- const buttonRef = (0, import_react33.useRef)(null);
4625
4643
  const [value, setValue] = useControlledState(
4626
4644
  props.value,
4627
4645
  props.defaultValue || "",
@@ -4631,9 +4649,6 @@ var MonthPicker = (0, import_react33.forwardRef)(
4631
4649
  ),
4632
4650
  { disableStrict: true }
4633
4651
  );
4634
- const [displayValue, setDisplayValue] = (0, import_react33.useState)(
4635
- () => value ? formatValueString3(parseDate3(value, format), displayFormat) : ""
4636
- );
4637
4652
  const [anchorEl, setAnchorEl] = (0, import_react33.useState)(null);
4638
4653
  const open = Boolean(anchorEl);
4639
4654
  (0, import_react33.useEffect)(() => {
@@ -4644,26 +4659,11 @@ var MonthPicker = (0, import_react33.forwardRef)(
4644
4659
  (0, import_react33.useImperativeHandle)(ref, () => innerRef.current, [
4645
4660
  innerRef
4646
4661
  ]);
4647
- (0, import_react33.useEffect)(() => {
4648
- if (value === "") {
4649
- setDisplayValue("");
4650
- return;
4651
- }
4652
- const formattedValue = formatValueString3(
4653
- parseDate3(value, format),
4654
- displayFormat
4655
- );
4656
- setDisplayValue(formattedValue);
4657
- }, [displayFormat, format, value]);
4658
4662
  const handleChange = (0, import_react33.useCallback)(
4659
4663
  (event) => {
4660
- const value2 = event.target.value;
4661
- setDisplayValue(
4662
- value2 ? formatValueString3(parseDate3(value2, format), displayFormat) : value2
4663
- );
4664
- setValue(value2);
4664
+ setValue(event.target.value);
4665
4665
  },
4666
- [displayFormat, format, setValue]
4666
+ [setValue]
4667
4667
  );
4668
4668
  const handleCalendarToggle = (0, import_react33.useCallback)(
4669
4669
  (event) => {
@@ -4672,13 +4672,6 @@ var MonthPicker = (0, import_react33.forwardRef)(
4672
4672
  },
4673
4673
  [anchorEl, setAnchorEl, innerRef]
4674
4674
  );
4675
- const handleInputMouseDown = (0, import_react33.useCallback)(
4676
- (event) => {
4677
- event.preventDefault();
4678
- buttonRef.current?.focus();
4679
- },
4680
- [buttonRef]
4681
- );
4682
4675
  return /* @__PURE__ */ import_react33.default.createElement(MonthPickerRoot, null, /* @__PURE__ */ import_react33.default.createElement(import_base4.FocusTrap, { open: true }, /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, /* @__PURE__ */ import_react33.default.createElement(
4683
4676
  Input_default,
4684
4677
  {
@@ -4686,21 +4679,13 @@ var MonthPicker = (0, import_react33.forwardRef)(
4686
4679
  color: error ? "danger" : innerProps.color,
4687
4680
  ref: innerRef,
4688
4681
  size,
4689
- value: displayValue,
4690
- placeholder: displayFormat,
4682
+ value,
4683
+ onChange: handleChange,
4684
+ placeholder: format,
4691
4685
  disabled,
4692
4686
  required,
4693
4687
  slotProps: {
4694
- input: {
4695
- ref: innerRef,
4696
- format: displayFormat,
4697
- sx: {
4698
- "&:hover": {
4699
- cursor: "default"
4700
- }
4701
- },
4702
- onMouseDown: handleInputMouseDown
4703
- }
4688
+ input: { component: TextMaskAdapter7, ref: innerRef, format }
4704
4689
  },
4705
4690
  error,
4706
4691
  className,
@@ -4713,18 +4698,16 @@ var MonthPicker = (0, import_react33.forwardRef)(
4713
4698
  IconButton_default,
4714
4699
  {
4715
4700
  variant: "plain",
4716
- onClick: readOnly ? void 0 : handleCalendarToggle,
4701
+ onClick: handleCalendarToggle,
4717
4702
  "aria-label": "Toggle Calendar",
4718
4703
  "aria-controls": "month-picker-popper",
4719
4704
  "aria-haspopup": "dialog",
4720
- "aria-expanded": open,
4721
- disabled
4705
+ "aria-expanded": open
4722
4706
  },
4723
4707
  /* @__PURE__ */ import_react33.default.createElement(import_CalendarToday3.default, null)
4724
4708
  ),
4725
4709
  label,
4726
- helperText,
4727
- readOnly
4710
+ helperText
4728
4711
  }
4729
4712
  ), open && /* @__PURE__ */ import_react33.default.createElement(import_base4.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react33.default.createElement(
4730
4713
  StyledPopper3,
@@ -4752,11 +4735,10 @@ var MonthPicker = (0, import_react33.forwardRef)(
4752
4735
  views: ["month"],
4753
4736
  value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
4754
4737
  onChange: ([date]) => {
4755
- const monthDate = new Date(date.getFullYear(), date.getMonth(), 1);
4756
4738
  handleChange({
4757
4739
  target: {
4758
4740
  name: props.name,
4759
- value: formatValueString3(monthDate, format)
4741
+ value: formatValueString3(date, format)
4760
4742
  }
4761
4743
  });
4762
4744
  setAnchorEl(null);
@@ -4798,7 +4780,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
4798
4780
 
4799
4781
  // src/components/MonthRangePicker/MonthRangePicker.tsx
4800
4782
  var import_react34 = __toESM(require("react"));
4801
- var import_react_imask3 = require("react-imask");
4783
+ var import_react_imask4 = require("react-imask");
4802
4784
  var import_CalendarToday4 = __toESM(require("@mui/icons-material/CalendarToday"));
4803
4785
  var import_joy47 = require("@mui/joy");
4804
4786
  var import_base5 = require("@mui/base");
@@ -4852,29 +4834,29 @@ var parseDates2 = (str) => {
4852
4834
  const date2 = str.split(" - ")[1] || "";
4853
4835
  return [parseDate4(date1), parseDate4(date2)];
4854
4836
  };
4855
- var formatToPattern3 = (format) => {
4837
+ var formatToPattern4 = (format) => {
4856
4838
  return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
4857
4839
  };
4858
- var TextMaskAdapter7 = import_react34.default.forwardRef(
4859
- function TextMaskAdapter8(props, ref) {
4840
+ var TextMaskAdapter9 = import_react34.default.forwardRef(
4841
+ function TextMaskAdapter10(props, ref) {
4860
4842
  const { onChange, format, ...other } = props;
4861
4843
  return /* @__PURE__ */ import_react34.default.createElement(
4862
- import_react_imask3.IMaskInput,
4844
+ import_react_imask4.IMaskInput,
4863
4845
  {
4864
4846
  ...other,
4865
4847
  inputRef: ref,
4866
4848
  onAccept: (value) => onChange({ target: { name: props.name, value } }),
4867
4849
  mask: Date,
4868
- pattern: formatToPattern3(format),
4850
+ pattern: formatToPattern4(format),
4869
4851
  blocks: {
4870
4852
  m: {
4871
- mask: import_react_imask3.IMask.MaskedRange,
4853
+ mask: import_react_imask4.IMask.MaskedRange,
4872
4854
  from: 1,
4873
4855
  to: 12,
4874
4856
  maxLength: 2
4875
4857
  },
4876
4858
  Y: {
4877
- mask: import_react_imask3.IMask.MaskedRange,
4859
+ mask: import_react_imask4.IMask.MaskedRange,
4878
4860
  from: 1900,
4879
4861
  to: 9999
4880
4862
  }
@@ -4966,7 +4948,7 @@ var MonthRangePicker = (0, import_react34.forwardRef)(
4966
4948
  required,
4967
4949
  placeholder: `${format} - ${format}`,
4968
4950
  slotProps: {
4969
- input: { component: TextMaskAdapter7, ref: innerRef, format }
4951
+ input: { component: TextMaskAdapter9, ref: innerRef, format }
4970
4952
  },
4971
4953
  error,
4972
4954
  className,
@@ -5167,8 +5149,8 @@ var padDecimal = (value, decimalScale) => {
5167
5149
  const [integer, decimal = ""] = `${value}`.split(".");
5168
5150
  return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
5169
5151
  };
5170
- var TextMaskAdapter9 = import_react38.default.forwardRef(
5171
- function TextMaskAdapter10(props, ref) {
5152
+ var TextMaskAdapter11 = import_react38.default.forwardRef(
5153
+ function TextMaskAdapter12(props, ref) {
5172
5154
  const { onChange, min, max, ...innerProps } = props;
5173
5155
  return /* @__PURE__ */ import_react38.default.createElement(
5174
5156
  import_react_number_format2.NumericFormat,
@@ -5264,7 +5246,7 @@ var PercentageInput = import_react38.default.forwardRef(function PercentageInput
5264
5246
  helperText,
5265
5247
  slotProps: {
5266
5248
  input: {
5267
- component: TextMaskAdapter9,
5249
+ component: TextMaskAdapter11,
5268
5250
  "aria-label": innerProps["aria-label"],
5269
5251
  decimalScale: maxDecimalScale
5270
5252
  }
package/dist/index.js CHANGED
@@ -4534,6 +4534,7 @@ import React31, {
4534
4534
  useRef as useRef6,
4535
4535
  useState as useState9
4536
4536
  } from "react";
4537
+ import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
4537
4538
  import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
4538
4539
  import { styled as styled20, useThemeProps as useThemeProps6 } from "@mui/joy";
4539
4540
  import { FocusTrap as FocusTrap3, ClickAwayListener as ClickAwayListener3, Popper as Popper4 } from "@mui/base";
@@ -4559,40 +4560,60 @@ var MonthPickerRoot = styled20("div", {
4559
4560
  })({
4560
4561
  width: "100%"
4561
4562
  });
4562
- function getMonthName2(date) {
4563
- return new Intl.DateTimeFormat("en-US", { month: "long" }).format(date);
4564
- }
4565
4563
  var formatValueString3 = (date, format) => {
4566
- const year = date.getFullYear().toString();
4567
- const month = (date.getMonth() + 1).toString().padStart(2, "0");
4568
- const monthName = getMonthName2(date);
4569
- const day = date.getDate().toString().padStart(2, "0");
4570
- return format.replace(/MMMM/g, monthName).replace(/MM/g, month).replace(/DD/g, day).replace(/YYYY/g, year);
4564
+ let month = `${date.getMonth() + 1}`;
4565
+ const year = date.getFullYear();
4566
+ if (Number(month) < 10) month = "0" + month;
4567
+ return format.replace(/YYYY/g, year.toString()).replace(/MM/g, month);
4571
4568
  };
4572
- function parseDate3(dateString, format) {
4573
- const formatParts = format.split(/[-./\s]/);
4574
- const dateParts = dateString.split(/[-./\s]/);
4575
- if (formatParts.length !== dateParts.length) {
4576
- throw new Error("Invalid date string or format");
4577
- }
4578
- let day = 1, month, year;
4579
- for (let i = 0; i < formatParts.length; i++) {
4580
- const value = parseInt(dateParts[i], 10);
4581
- switch (formatParts[i]) {
4582
- case "MM":
4583
- month = value - 1;
4584
- break;
4585
- case "YYYY":
4586
- year = value;
4587
- break;
4588
- case "DD":
4589
- day = 1;
4590
- break;
4591
- }
4569
+ var formatToPattern3 = (format) => {
4570
+ return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/[^YM\s]/g, (match) => `${match}\``);
4571
+ };
4572
+ function parseDate3(dateString) {
4573
+ let month, year;
4574
+ const cleanDateString = dateString.replace(/[^\d]/g, "");
4575
+ if (dateString.match(/\d{1,2}.\d{4}/)) {
4576
+ month = cleanDateString.slice(0, 2);
4577
+ year = cleanDateString.slice(2);
4578
+ } else if (dateString.match(/\d{4}.\d{1,2}/)) {
4579
+ year = cleanDateString.slice(0, 4);
4580
+ month = cleanDateString.slice(4);
4592
4581
  }
4593
- const result = new Date(year, month, day);
4594
- return result;
4582
+ const date = /* @__PURE__ */ new Date(`${year}/${month}`);
4583
+ return date;
4595
4584
  }
4585
+ var TextMaskAdapter7 = React31.forwardRef(
4586
+ function TextMaskAdapter8(props, ref) {
4587
+ const { onChange, format, ...other } = props;
4588
+ return /* @__PURE__ */ React31.createElement(
4589
+ IMaskInput3,
4590
+ {
4591
+ ...other,
4592
+ inputRef: ref,
4593
+ onAccept: (value) => onChange({ target: { name: props.name, value } }),
4594
+ mask: Date,
4595
+ pattern: formatToPattern3(format),
4596
+ blocks: {
4597
+ M: {
4598
+ mask: IMask3.MaskedRange,
4599
+ from: 1,
4600
+ to: 12,
4601
+ maxLength: 2
4602
+ },
4603
+ Y: {
4604
+ mask: IMask3.MaskedRange,
4605
+ from: 1900,
4606
+ to: 9999
4607
+ }
4608
+ },
4609
+ format: (date) => formatValueString3(date, format),
4610
+ parse: parseDate3,
4611
+ autofix: "pad",
4612
+ overwrite: true
4613
+ }
4614
+ );
4615
+ }
4616
+ );
4596
4617
  var MonthPicker = forwardRef9(
4597
4618
  (inProps, ref) => {
4598
4619
  const props = useThemeProps6({ props: inProps, name: "MonthPicker" });
@@ -4610,14 +4631,11 @@ var MonthPicker = forwardRef9(
4610
4631
  // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
4611
4632
  sx,
4612
4633
  className,
4613
- format = "YYYY/MM/DD",
4614
- displayFormat = "YYYY/MM/DD",
4615
- readOnly,
4634
+ format = "YYYY/MM",
4616
4635
  size,
4617
4636
  ...innerProps
4618
4637
  } = props;
4619
4638
  const innerRef = useRef6(null);
4620
- const buttonRef = useRef6(null);
4621
4639
  const [value, setValue] = useControlledState(
4622
4640
  props.value,
4623
4641
  props.defaultValue || "",
@@ -4627,9 +4645,6 @@ var MonthPicker = forwardRef9(
4627
4645
  ),
4628
4646
  { disableStrict: true }
4629
4647
  );
4630
- const [displayValue, setDisplayValue] = useState9(
4631
- () => value ? formatValueString3(parseDate3(value, format), displayFormat) : ""
4632
- );
4633
4648
  const [anchorEl, setAnchorEl] = useState9(null);
4634
4649
  const open = Boolean(anchorEl);
4635
4650
  useEffect8(() => {
@@ -4640,26 +4655,11 @@ var MonthPicker = forwardRef9(
4640
4655
  useImperativeHandle4(ref, () => innerRef.current, [
4641
4656
  innerRef
4642
4657
  ]);
4643
- useEffect8(() => {
4644
- if (value === "") {
4645
- setDisplayValue("");
4646
- return;
4647
- }
4648
- const formattedValue = formatValueString3(
4649
- parseDate3(value, format),
4650
- displayFormat
4651
- );
4652
- setDisplayValue(formattedValue);
4653
- }, [displayFormat, format, value]);
4654
4658
  const handleChange = useCallback11(
4655
4659
  (event) => {
4656
- const value2 = event.target.value;
4657
- setDisplayValue(
4658
- value2 ? formatValueString3(parseDate3(value2, format), displayFormat) : value2
4659
- );
4660
- setValue(value2);
4660
+ setValue(event.target.value);
4661
4661
  },
4662
- [displayFormat, format, setValue]
4662
+ [setValue]
4663
4663
  );
4664
4664
  const handleCalendarToggle = useCallback11(
4665
4665
  (event) => {
@@ -4668,13 +4668,6 @@ var MonthPicker = forwardRef9(
4668
4668
  },
4669
4669
  [anchorEl, setAnchorEl, innerRef]
4670
4670
  );
4671
- const handleInputMouseDown = useCallback11(
4672
- (event) => {
4673
- event.preventDefault();
4674
- buttonRef.current?.focus();
4675
- },
4676
- [buttonRef]
4677
- );
4678
4671
  return /* @__PURE__ */ React31.createElement(MonthPickerRoot, null, /* @__PURE__ */ React31.createElement(FocusTrap3, { open: true }, /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(
4679
4672
  Input_default,
4680
4673
  {
@@ -4682,21 +4675,13 @@ var MonthPicker = forwardRef9(
4682
4675
  color: error ? "danger" : innerProps.color,
4683
4676
  ref: innerRef,
4684
4677
  size,
4685
- value: displayValue,
4686
- placeholder: displayFormat,
4678
+ value,
4679
+ onChange: handleChange,
4680
+ placeholder: format,
4687
4681
  disabled,
4688
4682
  required,
4689
4683
  slotProps: {
4690
- input: {
4691
- ref: innerRef,
4692
- format: displayFormat,
4693
- sx: {
4694
- "&:hover": {
4695
- cursor: "default"
4696
- }
4697
- },
4698
- onMouseDown: handleInputMouseDown
4699
- }
4684
+ input: { component: TextMaskAdapter7, ref: innerRef, format }
4700
4685
  },
4701
4686
  error,
4702
4687
  className,
@@ -4709,18 +4694,16 @@ var MonthPicker = forwardRef9(
4709
4694
  IconButton_default,
4710
4695
  {
4711
4696
  variant: "plain",
4712
- onClick: readOnly ? void 0 : handleCalendarToggle,
4697
+ onClick: handleCalendarToggle,
4713
4698
  "aria-label": "Toggle Calendar",
4714
4699
  "aria-controls": "month-picker-popper",
4715
4700
  "aria-haspopup": "dialog",
4716
- "aria-expanded": open,
4717
- disabled
4701
+ "aria-expanded": open
4718
4702
  },
4719
4703
  /* @__PURE__ */ React31.createElement(CalendarTodayIcon3, null)
4720
4704
  ),
4721
4705
  label,
4722
- helperText,
4723
- readOnly
4706
+ helperText
4724
4707
  }
4725
4708
  ), open && /* @__PURE__ */ React31.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React31.createElement(
4726
4709
  StyledPopper3,
@@ -4748,11 +4731,10 @@ var MonthPicker = forwardRef9(
4748
4731
  views: ["month"],
4749
4732
  value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
4750
4733
  onChange: ([date]) => {
4751
- const monthDate = new Date(date.getFullYear(), date.getMonth(), 1);
4752
4734
  handleChange({
4753
4735
  target: {
4754
4736
  name: props.name,
4755
- value: formatValueString3(monthDate, format)
4737
+ value: formatValueString3(date, format)
4756
4738
  }
4757
4739
  });
4758
4740
  setAnchorEl(null);
@@ -4802,7 +4784,7 @@ import React32, {
4802
4784
  useRef as useRef7,
4803
4785
  useState as useState10
4804
4786
  } from "react";
4805
- import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
4787
+ import { IMaskInput as IMaskInput4, IMask as IMask4 } from "react-imask";
4806
4788
  import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
4807
4789
  import { styled as styled21, useThemeProps as useThemeProps7 } from "@mui/joy";
4808
4790
  import { FocusTrap as FocusTrap4, ClickAwayListener as ClickAwayListener4, Popper as Popper5 } from "@mui/base";
@@ -4856,29 +4838,29 @@ var parseDates2 = (str) => {
4856
4838
  const date2 = str.split(" - ")[1] || "";
4857
4839
  return [parseDate4(date1), parseDate4(date2)];
4858
4840
  };
4859
- var formatToPattern3 = (format) => {
4841
+ var formatToPattern4 = (format) => {
4860
4842
  return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
4861
4843
  };
4862
- var TextMaskAdapter7 = React32.forwardRef(
4863
- function TextMaskAdapter8(props, ref) {
4844
+ var TextMaskAdapter9 = React32.forwardRef(
4845
+ function TextMaskAdapter10(props, ref) {
4864
4846
  const { onChange, format, ...other } = props;
4865
4847
  return /* @__PURE__ */ React32.createElement(
4866
- IMaskInput3,
4848
+ IMaskInput4,
4867
4849
  {
4868
4850
  ...other,
4869
4851
  inputRef: ref,
4870
4852
  onAccept: (value) => onChange({ target: { name: props.name, value } }),
4871
4853
  mask: Date,
4872
- pattern: formatToPattern3(format),
4854
+ pattern: formatToPattern4(format),
4873
4855
  blocks: {
4874
4856
  m: {
4875
- mask: IMask3.MaskedRange,
4857
+ mask: IMask4.MaskedRange,
4876
4858
  from: 1,
4877
4859
  to: 12,
4878
4860
  maxLength: 2
4879
4861
  },
4880
4862
  Y: {
4881
- mask: IMask3.MaskedRange,
4863
+ mask: IMask4.MaskedRange,
4882
4864
  from: 1900,
4883
4865
  to: 9999
4884
4866
  }
@@ -4970,7 +4952,7 @@ var MonthRangePicker = forwardRef10(
4970
4952
  required,
4971
4953
  placeholder: `${format} - ${format}`,
4972
4954
  slotProps: {
4973
- input: { component: TextMaskAdapter7, ref: innerRef, format }
4955
+ input: { component: TextMaskAdapter9, ref: innerRef, format }
4974
4956
  },
4975
4957
  error,
4976
4958
  className,
@@ -5184,8 +5166,8 @@ var padDecimal = (value, decimalScale) => {
5184
5166
  const [integer, decimal = ""] = `${value}`.split(".");
5185
5167
  return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
5186
5168
  };
5187
- var TextMaskAdapter9 = React36.forwardRef(
5188
- function TextMaskAdapter10(props, ref) {
5169
+ var TextMaskAdapter11 = React36.forwardRef(
5170
+ function TextMaskAdapter12(props, ref) {
5189
5171
  const { onChange, min, max, ...innerProps } = props;
5190
5172
  return /* @__PURE__ */ React36.createElement(
5191
5173
  NumericFormat2,
@@ -5281,7 +5263,7 @@ var PercentageInput = React36.forwardRef(function PercentageInput2(inProps, ref)
5281
5263
  helperText,
5282
5264
  slotProps: {
5283
5265
  input: {
5284
- component: TextMaskAdapter9,
5266
+ component: TextMaskAdapter11,
5285
5267
  "aria-label": innerProps["aria-label"],
5286
5268
  decimalScale: maxDecimalScale
5287
5269
  }