@ceed/ads 1.5.3-next.1 → 1.5.4-next.1

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