@ceed/ads 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
@@ -4976,6 +4976,7 @@ MenuButton.displayName = "MenuButton";
4976
4976
 
4977
4977
  // src/components/MonthPicker/MonthPicker.tsx
4978
4978
  var import_react33 = __toESM(require("react"));
4979
+ var import_react_imask3 = require("react-imask");
4979
4980
  var import_CalendarToday3 = __toESM(require("@mui/icons-material/CalendarToday"));
4980
4981
  var import_joy46 = require("@mui/joy");
4981
4982
  var import_base4 = require("@mui/base");
@@ -5001,40 +5002,60 @@ var MonthPickerRoot = (0, import_joy46.styled)("div", {
5001
5002
  })({
5002
5003
  width: "100%"
5003
5004
  });
5004
- function getMonthName2(date) {
5005
- return new Intl.DateTimeFormat("en-US", { month: "long" }).format(date);
5006
- }
5007
5005
  var formatValueString3 = (date, format) => {
5008
- const year = date.getFullYear().toString();
5009
- const month = (date.getMonth() + 1).toString().padStart(2, "0");
5010
- const monthName = getMonthName2(date);
5011
- const day = date.getDate().toString().padStart(2, "0");
5012
- return format.replace(/MMMM/g, monthName).replace(/MM/g, month).replace(/DD/g, day).replace(/YYYY/g, year);
5006
+ let month = `${date.getMonth() + 1}`;
5007
+ const year = date.getFullYear();
5008
+ if (Number(month) < 10) month = "0" + month;
5009
+ return format.replace(/YYYY/g, year.toString()).replace(/MM/g, month);
5013
5010
  };
5014
- function parseDate3(dateString, format) {
5015
- const formatParts = format.split(/[-./\s]/);
5016
- const dateParts = dateString.split(/[-./\s]/);
5017
- if (formatParts.length !== dateParts.length) {
5018
- throw new Error("Invalid date string or format");
5019
- }
5020
- let day = 1, month, year;
5021
- for (let i = 0; i < formatParts.length; i++) {
5022
- const value = parseInt(dateParts[i], 10);
5023
- switch (formatParts[i]) {
5024
- case "MM":
5025
- month = value - 1;
5026
- break;
5027
- case "YYYY":
5028
- year = value;
5029
- break;
5030
- case "DD":
5031
- day = 1;
5032
- break;
5033
- }
5011
+ var formatToPattern3 = (format) => {
5012
+ return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/[^YM\s]/g, (match) => `${match}\``);
5013
+ };
5014
+ function parseDate3(dateString) {
5015
+ let month, year;
5016
+ const cleanDateString = dateString.replace(/[^\d]/g, "");
5017
+ if (dateString.match(/\d{1,2}.\d{4}/)) {
5018
+ month = cleanDateString.slice(0, 2);
5019
+ year = cleanDateString.slice(2);
5020
+ } else if (dateString.match(/\d{4}.\d{1,2}/)) {
5021
+ year = cleanDateString.slice(0, 4);
5022
+ month = cleanDateString.slice(4);
5034
5023
  }
5035
- const result = new Date(year, month, day);
5036
- return result;
5024
+ const date = /* @__PURE__ */ new Date(`${year}/${month}`);
5025
+ return date;
5037
5026
  }
5027
+ var TextMaskAdapter7 = import_react33.default.forwardRef(
5028
+ function TextMaskAdapter8(props, ref) {
5029
+ const { onChange, format, ...other } = props;
5030
+ return /* @__PURE__ */ import_react33.default.createElement(
5031
+ import_react_imask3.IMaskInput,
5032
+ {
5033
+ ...other,
5034
+ inputRef: ref,
5035
+ onAccept: (value) => onChange({ target: { name: props.name, value } }),
5036
+ mask: Date,
5037
+ pattern: formatToPattern3(format),
5038
+ blocks: {
5039
+ M: {
5040
+ mask: import_react_imask3.IMask.MaskedRange,
5041
+ from: 1,
5042
+ to: 12,
5043
+ maxLength: 2
5044
+ },
5045
+ Y: {
5046
+ mask: import_react_imask3.IMask.MaskedRange,
5047
+ from: 1900,
5048
+ to: 9999
5049
+ }
5050
+ },
5051
+ format: (date) => formatValueString3(date, format),
5052
+ parse: parseDate3,
5053
+ autofix: "pad",
5054
+ overwrite: true
5055
+ }
5056
+ );
5057
+ }
5058
+ );
5038
5059
  var MonthPicker = (0, import_react33.forwardRef)(
5039
5060
  (inProps, ref) => {
5040
5061
  const props = (0, import_joy46.useThemeProps)({ props: inProps, name: "MonthPicker" });
@@ -5052,14 +5073,11 @@ var MonthPicker = (0, import_react33.forwardRef)(
5052
5073
  // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
5053
5074
  sx,
5054
5075
  className,
5055
- format = "YYYY/MM/DD",
5056
- displayFormat = "YYYY/MM/DD",
5057
- readOnly,
5076
+ format = "YYYY/MM",
5058
5077
  size,
5059
5078
  ...innerProps
5060
5079
  } = props;
5061
5080
  const innerRef = (0, import_react33.useRef)(null);
5062
- const buttonRef = (0, import_react33.useRef)(null);
5063
5081
  const [value, setValue] = useControlledState(
5064
5082
  props.value,
5065
5083
  props.defaultValue || "",
@@ -5069,9 +5087,6 @@ var MonthPicker = (0, import_react33.forwardRef)(
5069
5087
  ),
5070
5088
  { disableStrict: true }
5071
5089
  );
5072
- const [displayValue, setDisplayValue] = (0, import_react33.useState)(
5073
- () => value ? formatValueString3(parseDate3(value, format), displayFormat) : ""
5074
- );
5075
5090
  const [anchorEl, setAnchorEl] = (0, import_react33.useState)(null);
5076
5091
  const open = Boolean(anchorEl);
5077
5092
  (0, import_react33.useEffect)(() => {
@@ -5082,26 +5097,11 @@ var MonthPicker = (0, import_react33.forwardRef)(
5082
5097
  (0, import_react33.useImperativeHandle)(ref, () => innerRef.current, [
5083
5098
  innerRef
5084
5099
  ]);
5085
- (0, import_react33.useEffect)(() => {
5086
- if (value === "") {
5087
- setDisplayValue("");
5088
- return;
5089
- }
5090
- const formattedValue = formatValueString3(
5091
- parseDate3(value, format),
5092
- displayFormat
5093
- );
5094
- setDisplayValue(formattedValue);
5095
- }, [displayFormat, format, value]);
5096
5100
  const handleChange = (0, import_react33.useCallback)(
5097
5101
  (event) => {
5098
- const value2 = event.target.value;
5099
- setDisplayValue(
5100
- value2 ? formatValueString3(parseDate3(value2, format), displayFormat) : value2
5101
- );
5102
- setValue(value2);
5102
+ setValue(event.target.value);
5103
5103
  },
5104
- [displayFormat, format, setValue]
5104
+ [setValue]
5105
5105
  );
5106
5106
  const handleCalendarToggle = (0, import_react33.useCallback)(
5107
5107
  (event) => {
@@ -5110,13 +5110,6 @@ var MonthPicker = (0, import_react33.forwardRef)(
5110
5110
  },
5111
5111
  [anchorEl, setAnchorEl, innerRef]
5112
5112
  );
5113
- const handleInputMouseDown = (0, import_react33.useCallback)(
5114
- (event) => {
5115
- event.preventDefault();
5116
- buttonRef.current?.focus();
5117
- },
5118
- [buttonRef]
5119
- );
5120
5113
  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(
5121
5114
  Input_default,
5122
5115
  {
@@ -5124,21 +5117,13 @@ var MonthPicker = (0, import_react33.forwardRef)(
5124
5117
  color: error ? "danger" : innerProps.color,
5125
5118
  ref: innerRef,
5126
5119
  size,
5127
- value: displayValue,
5128
- placeholder: displayFormat,
5120
+ value,
5121
+ onChange: handleChange,
5122
+ placeholder: format,
5129
5123
  disabled,
5130
5124
  required,
5131
5125
  slotProps: {
5132
- input: {
5133
- ref: innerRef,
5134
- format: displayFormat,
5135
- sx: {
5136
- "&:hover": {
5137
- cursor: "default"
5138
- }
5139
- },
5140
- onMouseDown: handleInputMouseDown
5141
- }
5126
+ input: { component: TextMaskAdapter7, ref: innerRef, format }
5142
5127
  },
5143
5128
  error,
5144
5129
  className,
@@ -5151,18 +5136,16 @@ var MonthPicker = (0, import_react33.forwardRef)(
5151
5136
  IconButton_default,
5152
5137
  {
5153
5138
  variant: "plain",
5154
- onClick: readOnly ? void 0 : handleCalendarToggle,
5139
+ onClick: handleCalendarToggle,
5155
5140
  "aria-label": "Toggle Calendar",
5156
5141
  "aria-controls": "month-picker-popper",
5157
5142
  "aria-haspopup": "dialog",
5158
- "aria-expanded": open,
5159
- disabled
5143
+ "aria-expanded": open
5160
5144
  },
5161
5145
  /* @__PURE__ */ import_react33.default.createElement(import_CalendarToday3.default, null)
5162
5146
  ),
5163
5147
  label,
5164
- helperText,
5165
- readOnly
5148
+ helperText
5166
5149
  }
5167
5150
  ), open && /* @__PURE__ */ import_react33.default.createElement(import_base4.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react33.default.createElement(
5168
5151
  StyledPopper3,
@@ -5190,11 +5173,10 @@ var MonthPicker = (0, import_react33.forwardRef)(
5190
5173
  views: ["month"],
5191
5174
  value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
5192
5175
  onChange: ([date]) => {
5193
- const monthDate = new Date(date.getFullYear(), date.getMonth(), 1);
5194
5176
  handleChange({
5195
5177
  target: {
5196
5178
  name: props.name,
5197
- value: formatValueString3(monthDate, format)
5179
+ value: formatValueString3(date, format)
5198
5180
  }
5199
5181
  });
5200
5182
  setAnchorEl(null);
@@ -5236,7 +5218,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
5236
5218
 
5237
5219
  // src/components/MonthRangePicker/MonthRangePicker.tsx
5238
5220
  var import_react34 = __toESM(require("react"));
5239
- var import_react_imask3 = require("react-imask");
5221
+ var import_react_imask4 = require("react-imask");
5240
5222
  var import_CalendarToday4 = __toESM(require("@mui/icons-material/CalendarToday"));
5241
5223
  var import_joy47 = require("@mui/joy");
5242
5224
  var import_base5 = require("@mui/base");
@@ -5290,29 +5272,29 @@ var parseDates2 = (str) => {
5290
5272
  const date2 = str.split(" - ")[1] || "";
5291
5273
  return [parseDate4(date1), parseDate4(date2)];
5292
5274
  };
5293
- var formatToPattern3 = (format) => {
5275
+ var formatToPattern4 = (format) => {
5294
5276
  return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
5295
5277
  };
5296
- var TextMaskAdapter7 = import_react34.default.forwardRef(
5297
- function TextMaskAdapter8(props, ref) {
5278
+ var TextMaskAdapter9 = import_react34.default.forwardRef(
5279
+ function TextMaskAdapter10(props, ref) {
5298
5280
  const { onChange, format, ...other } = props;
5299
5281
  return /* @__PURE__ */ import_react34.default.createElement(
5300
- import_react_imask3.IMaskInput,
5282
+ import_react_imask4.IMaskInput,
5301
5283
  {
5302
5284
  ...other,
5303
5285
  inputRef: ref,
5304
5286
  onAccept: (value) => onChange({ target: { name: props.name, value } }),
5305
5287
  mask: Date,
5306
- pattern: formatToPattern3(format),
5288
+ pattern: formatToPattern4(format),
5307
5289
  blocks: {
5308
5290
  m: {
5309
- mask: import_react_imask3.IMask.MaskedRange,
5291
+ mask: import_react_imask4.IMask.MaskedRange,
5310
5292
  from: 1,
5311
5293
  to: 12,
5312
5294
  maxLength: 2
5313
5295
  },
5314
5296
  Y: {
5315
- mask: import_react_imask3.IMask.MaskedRange,
5297
+ mask: import_react_imask4.IMask.MaskedRange,
5316
5298
  from: 1900,
5317
5299
  to: 9999
5318
5300
  }
@@ -5404,7 +5386,7 @@ var MonthRangePicker = (0, import_react34.forwardRef)(
5404
5386
  required,
5405
5387
  placeholder: `${format} - ${format}`,
5406
5388
  slotProps: {
5407
- input: { component: TextMaskAdapter7, ref: innerRef, format }
5389
+ input: { component: TextMaskAdapter9, ref: innerRef, format }
5408
5390
  },
5409
5391
  error,
5410
5392
  className,
@@ -5605,8 +5587,8 @@ var padDecimal = (value, decimalScale) => {
5605
5587
  const [integer, decimal = ""] = `${value}`.split(".");
5606
5588
  return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
5607
5589
  };
5608
- var TextMaskAdapter9 = import_react38.default.forwardRef(
5609
- function TextMaskAdapter10(props, ref) {
5590
+ var TextMaskAdapter11 = import_react38.default.forwardRef(
5591
+ function TextMaskAdapter12(props, ref) {
5610
5592
  const { onChange, min, max, ...innerProps } = props;
5611
5593
  return /* @__PURE__ */ import_react38.default.createElement(
5612
5594
  import_react_number_format2.NumericFormat,
@@ -5702,7 +5684,7 @@ var PercentageInput = import_react38.default.forwardRef(function PercentageInput
5702
5684
  helperText,
5703
5685
  slotProps: {
5704
5686
  input: {
5705
- component: TextMaskAdapter9,
5687
+ component: TextMaskAdapter11,
5706
5688
  "aria-label": innerProps["aria-label"],
5707
5689
  decimalScale: maxDecimalScale
5708
5690
  }
package/dist/index.js CHANGED
@@ -4963,6 +4963,7 @@ import React31, {
4963
4963
  useRef as useRef7,
4964
4964
  useState as useState10
4965
4965
  } from "react";
4966
+ import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
4966
4967
  import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
4967
4968
  import { styled as styled20, useThemeProps as useThemeProps6 } from "@mui/joy";
4968
4969
  import { FocusTrap as FocusTrap3, ClickAwayListener as ClickAwayListener3, Popper as Popper4 } from "@mui/base";
@@ -4988,40 +4989,60 @@ var MonthPickerRoot = styled20("div", {
4988
4989
  })({
4989
4990
  width: "100%"
4990
4991
  });
4991
- function getMonthName2(date) {
4992
- return new Intl.DateTimeFormat("en-US", { month: "long" }).format(date);
4993
- }
4994
4992
  var formatValueString3 = (date, format) => {
4995
- const year = date.getFullYear().toString();
4996
- const month = (date.getMonth() + 1).toString().padStart(2, "0");
4997
- const monthName = getMonthName2(date);
4998
- const day = date.getDate().toString().padStart(2, "0");
4999
- return format.replace(/MMMM/g, monthName).replace(/MM/g, month).replace(/DD/g, day).replace(/YYYY/g, year);
4993
+ let month = `${date.getMonth() + 1}`;
4994
+ const year = date.getFullYear();
4995
+ if (Number(month) < 10) month = "0" + month;
4996
+ return format.replace(/YYYY/g, year.toString()).replace(/MM/g, month);
5000
4997
  };
5001
- function parseDate3(dateString, format) {
5002
- const formatParts = format.split(/[-./\s]/);
5003
- const dateParts = dateString.split(/[-./\s]/);
5004
- if (formatParts.length !== dateParts.length) {
5005
- throw new Error("Invalid date string or format");
5006
- }
5007
- let day = 1, month, year;
5008
- for (let i = 0; i < formatParts.length; i++) {
5009
- const value = parseInt(dateParts[i], 10);
5010
- switch (formatParts[i]) {
5011
- case "MM":
5012
- month = value - 1;
5013
- break;
5014
- case "YYYY":
5015
- year = value;
5016
- break;
5017
- case "DD":
5018
- day = 1;
5019
- break;
5020
- }
4998
+ var formatToPattern3 = (format) => {
4999
+ return format.replace(/YYYY/g, "Y").replace(/MM/g, "M").replace(/[^YM\s]/g, (match) => `${match}\``);
5000
+ };
5001
+ function parseDate3(dateString) {
5002
+ let month, year;
5003
+ const cleanDateString = dateString.replace(/[^\d]/g, "");
5004
+ if (dateString.match(/\d{1,2}.\d{4}/)) {
5005
+ month = cleanDateString.slice(0, 2);
5006
+ year = cleanDateString.slice(2);
5007
+ } else if (dateString.match(/\d{4}.\d{1,2}/)) {
5008
+ year = cleanDateString.slice(0, 4);
5009
+ month = cleanDateString.slice(4);
5021
5010
  }
5022
- const result = new Date(year, month, day);
5023
- return result;
5011
+ const date = /* @__PURE__ */ new Date(`${year}/${month}`);
5012
+ return date;
5024
5013
  }
5014
+ var TextMaskAdapter7 = React31.forwardRef(
5015
+ function TextMaskAdapter8(props, ref) {
5016
+ const { onChange, format, ...other } = props;
5017
+ return /* @__PURE__ */ React31.createElement(
5018
+ IMaskInput3,
5019
+ {
5020
+ ...other,
5021
+ inputRef: ref,
5022
+ onAccept: (value) => onChange({ target: { name: props.name, value } }),
5023
+ mask: Date,
5024
+ pattern: formatToPattern3(format),
5025
+ blocks: {
5026
+ M: {
5027
+ mask: IMask3.MaskedRange,
5028
+ from: 1,
5029
+ to: 12,
5030
+ maxLength: 2
5031
+ },
5032
+ Y: {
5033
+ mask: IMask3.MaskedRange,
5034
+ from: 1900,
5035
+ to: 9999
5036
+ }
5037
+ },
5038
+ format: (date) => formatValueString3(date, format),
5039
+ parse: parseDate3,
5040
+ autofix: "pad",
5041
+ overwrite: true
5042
+ }
5043
+ );
5044
+ }
5045
+ );
5025
5046
  var MonthPicker = forwardRef9(
5026
5047
  (inProps, ref) => {
5027
5048
  const props = useThemeProps6({ props: inProps, name: "MonthPicker" });
@@ -5039,14 +5060,11 @@ var MonthPicker = forwardRef9(
5039
5060
  // NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
5040
5061
  sx,
5041
5062
  className,
5042
- format = "YYYY/MM/DD",
5043
- displayFormat = "YYYY/MM/DD",
5044
- readOnly,
5063
+ format = "YYYY/MM",
5045
5064
  size,
5046
5065
  ...innerProps
5047
5066
  } = props;
5048
5067
  const innerRef = useRef7(null);
5049
- const buttonRef = useRef7(null);
5050
5068
  const [value, setValue] = useControlledState(
5051
5069
  props.value,
5052
5070
  props.defaultValue || "",
@@ -5056,9 +5074,6 @@ var MonthPicker = forwardRef9(
5056
5074
  ),
5057
5075
  { disableStrict: true }
5058
5076
  );
5059
- const [displayValue, setDisplayValue] = useState10(
5060
- () => value ? formatValueString3(parseDate3(value, format), displayFormat) : ""
5061
- );
5062
5077
  const [anchorEl, setAnchorEl] = useState10(null);
5063
5078
  const open = Boolean(anchorEl);
5064
5079
  useEffect9(() => {
@@ -5069,26 +5084,11 @@ var MonthPicker = forwardRef9(
5069
5084
  useImperativeHandle4(ref, () => innerRef.current, [
5070
5085
  innerRef
5071
5086
  ]);
5072
- useEffect9(() => {
5073
- if (value === "") {
5074
- setDisplayValue("");
5075
- return;
5076
- }
5077
- const formattedValue = formatValueString3(
5078
- parseDate3(value, format),
5079
- displayFormat
5080
- );
5081
- setDisplayValue(formattedValue);
5082
- }, [displayFormat, format, value]);
5083
5087
  const handleChange = useCallback12(
5084
5088
  (event) => {
5085
- const value2 = event.target.value;
5086
- setDisplayValue(
5087
- value2 ? formatValueString3(parseDate3(value2, format), displayFormat) : value2
5088
- );
5089
- setValue(value2);
5089
+ setValue(event.target.value);
5090
5090
  },
5091
- [displayFormat, format, setValue]
5091
+ [setValue]
5092
5092
  );
5093
5093
  const handleCalendarToggle = useCallback12(
5094
5094
  (event) => {
@@ -5097,13 +5097,6 @@ var MonthPicker = forwardRef9(
5097
5097
  },
5098
5098
  [anchorEl, setAnchorEl, innerRef]
5099
5099
  );
5100
- const handleInputMouseDown = useCallback12(
5101
- (event) => {
5102
- event.preventDefault();
5103
- buttonRef.current?.focus();
5104
- },
5105
- [buttonRef]
5106
- );
5107
5100
  return /* @__PURE__ */ React31.createElement(MonthPickerRoot, null, /* @__PURE__ */ React31.createElement(FocusTrap3, { open: true }, /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(
5108
5101
  Input_default,
5109
5102
  {
@@ -5111,21 +5104,13 @@ var MonthPicker = forwardRef9(
5111
5104
  color: error ? "danger" : innerProps.color,
5112
5105
  ref: innerRef,
5113
5106
  size,
5114
- value: displayValue,
5115
- placeholder: displayFormat,
5107
+ value,
5108
+ onChange: handleChange,
5109
+ placeholder: format,
5116
5110
  disabled,
5117
5111
  required,
5118
5112
  slotProps: {
5119
- input: {
5120
- ref: innerRef,
5121
- format: displayFormat,
5122
- sx: {
5123
- "&:hover": {
5124
- cursor: "default"
5125
- }
5126
- },
5127
- onMouseDown: handleInputMouseDown
5128
- }
5113
+ input: { component: TextMaskAdapter7, ref: innerRef, format }
5129
5114
  },
5130
5115
  error,
5131
5116
  className,
@@ -5138,18 +5123,16 @@ var MonthPicker = forwardRef9(
5138
5123
  IconButton_default,
5139
5124
  {
5140
5125
  variant: "plain",
5141
- onClick: readOnly ? void 0 : handleCalendarToggle,
5126
+ onClick: handleCalendarToggle,
5142
5127
  "aria-label": "Toggle Calendar",
5143
5128
  "aria-controls": "month-picker-popper",
5144
5129
  "aria-haspopup": "dialog",
5145
- "aria-expanded": open,
5146
- disabled
5130
+ "aria-expanded": open
5147
5131
  },
5148
5132
  /* @__PURE__ */ React31.createElement(CalendarTodayIcon3, null)
5149
5133
  ),
5150
5134
  label,
5151
- helperText,
5152
- readOnly
5135
+ helperText
5153
5136
  }
5154
5137
  ), open && /* @__PURE__ */ React31.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React31.createElement(
5155
5138
  StyledPopper3,
@@ -5177,11 +5160,10 @@ var MonthPicker = forwardRef9(
5177
5160
  views: ["month"],
5178
5161
  value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
5179
5162
  onChange: ([date]) => {
5180
- const monthDate = new Date(date.getFullYear(), date.getMonth(), 1);
5181
5163
  handleChange({
5182
5164
  target: {
5183
5165
  name: props.name,
5184
- value: formatValueString3(monthDate, format)
5166
+ value: formatValueString3(date, format)
5185
5167
  }
5186
5168
  });
5187
5169
  setAnchorEl(null);
@@ -5231,7 +5213,7 @@ import React32, {
5231
5213
  useRef as useRef8,
5232
5214
  useState as useState11
5233
5215
  } from "react";
5234
- import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
5216
+ import { IMaskInput as IMaskInput4, IMask as IMask4 } from "react-imask";
5235
5217
  import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
5236
5218
  import { styled as styled21, useThemeProps as useThemeProps7 } from "@mui/joy";
5237
5219
  import { FocusTrap as FocusTrap4, ClickAwayListener as ClickAwayListener4, Popper as Popper5 } from "@mui/base";
@@ -5285,29 +5267,29 @@ var parseDates2 = (str) => {
5285
5267
  const date2 = str.split(" - ")[1] || "";
5286
5268
  return [parseDate4(date1), parseDate4(date2)];
5287
5269
  };
5288
- var formatToPattern3 = (format) => {
5270
+ var formatToPattern4 = (format) => {
5289
5271
  return `${format} - ${format}`.replace(/YYYY/g, "Y").replace(/MM/g, "m").replace(/[^YMm\s]/g, (match) => `${match}\``);
5290
5272
  };
5291
- var TextMaskAdapter7 = React32.forwardRef(
5292
- function TextMaskAdapter8(props, ref) {
5273
+ var TextMaskAdapter9 = React32.forwardRef(
5274
+ function TextMaskAdapter10(props, ref) {
5293
5275
  const { onChange, format, ...other } = props;
5294
5276
  return /* @__PURE__ */ React32.createElement(
5295
- IMaskInput3,
5277
+ IMaskInput4,
5296
5278
  {
5297
5279
  ...other,
5298
5280
  inputRef: ref,
5299
5281
  onAccept: (value) => onChange({ target: { name: props.name, value } }),
5300
5282
  mask: Date,
5301
- pattern: formatToPattern3(format),
5283
+ pattern: formatToPattern4(format),
5302
5284
  blocks: {
5303
5285
  m: {
5304
- mask: IMask3.MaskedRange,
5286
+ mask: IMask4.MaskedRange,
5305
5287
  from: 1,
5306
5288
  to: 12,
5307
5289
  maxLength: 2
5308
5290
  },
5309
5291
  Y: {
5310
- mask: IMask3.MaskedRange,
5292
+ mask: IMask4.MaskedRange,
5311
5293
  from: 1900,
5312
5294
  to: 9999
5313
5295
  }
@@ -5399,7 +5381,7 @@ var MonthRangePicker = forwardRef10(
5399
5381
  required,
5400
5382
  placeholder: `${format} - ${format}`,
5401
5383
  slotProps: {
5402
- input: { component: TextMaskAdapter7, ref: innerRef, format }
5384
+ input: { component: TextMaskAdapter9, ref: innerRef, format }
5403
5385
  },
5404
5386
  error,
5405
5387
  className,
@@ -5613,8 +5595,8 @@ var padDecimal = (value, decimalScale) => {
5613
5595
  const [integer, decimal = ""] = `${value}`.split(".");
5614
5596
  return Number(`${integer}${decimal.padEnd(decimalScale, "0")}`);
5615
5597
  };
5616
- var TextMaskAdapter9 = React36.forwardRef(
5617
- function TextMaskAdapter10(props, ref) {
5598
+ var TextMaskAdapter11 = React36.forwardRef(
5599
+ function TextMaskAdapter12(props, ref) {
5618
5600
  const { onChange, min, max, ...innerProps } = props;
5619
5601
  return /* @__PURE__ */ React36.createElement(
5620
5602
  NumericFormat2,
@@ -5710,7 +5692,7 @@ var PercentageInput = React36.forwardRef(function PercentageInput2(inProps, ref)
5710
5692
  helperText,
5711
5693
  slotProps: {
5712
5694
  input: {
5713
- component: TextMaskAdapter9,
5695
+ component: TextMaskAdapter11,
5714
5696
  "aria-label": innerProps["aria-label"],
5715
5697
  decimalScale: maxDecimalScale
5716
5698
  }