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

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.
@@ -21,7 +21,6 @@ interface BaseMonthPickerProps {
21
21
  disablePast?: boolean;
22
22
  format?: string;
23
23
  displayFormat?: string;
24
- readonly?: boolean;
25
24
  }
26
25
  export type MonthPickerProps = BaseMonthPickerProps & Omit<React.ComponentProps<typeof Input>, "onChange" | "value" | "defaultValue">;
27
26
  declare const MonthPicker: React.ForwardRefExoticComponent<Omit<MonthPickerProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
package/dist/index.cjs CHANGED
@@ -5008,16 +5008,17 @@ var formatValueString3 = (date, format) => {
5008
5008
  const year = date.getFullYear().toString();
5009
5009
  const month = (date.getMonth() + 1).toString().padStart(2, "0");
5010
5010
  const monthName = getMonthName2(date);
5011
- const day = date.getDate().toString().padStart(2, "0");
5011
+ const day = "01";
5012
5012
  return format.replace(/MMMM/g, monthName).replace(/MM/g, month).replace(/DD/g, day).replace(/YYYY/g, year);
5013
5013
  };
5014
5014
  function parseDate3(dateString, format) {
5015
- const formatParts = format.split(/[-./\s]/);
5016
5015
  const dateParts = dateString.split(/[-./\s]/);
5016
+ const formatParts = format.split(/[-./\s]/);
5017
5017
  if (formatParts.length !== dateParts.length) {
5018
5018
  throw new Error("Invalid date string or format");
5019
5019
  }
5020
- let day = 1, month, year;
5020
+ let month, year;
5021
+ const day = 1;
5021
5022
  for (let i = 0; i < formatParts.length; i++) {
5022
5023
  const value = parseInt(dateParts[i], 10);
5023
5024
  switch (formatParts[i]) {
@@ -5027,9 +5028,6 @@ function parseDate3(dateString, format) {
5027
5028
  case "YYYY":
5028
5029
  year = value;
5029
5030
  break;
5030
- case "DD":
5031
- day = 1;
5032
- break;
5033
5031
  }
5034
5032
  }
5035
5033
  const result = new Date(year, month, day);
@@ -5053,8 +5051,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
5053
5051
  sx,
5054
5052
  className,
5055
5053
  format = "YYYY/MM/DD",
5056
- displayFormat = "YYYY/MM/DD",
5057
- readOnly,
5054
+ displayFormat = "YYYY/MM",
5058
5055
  size,
5059
5056
  ...innerProps
5060
5057
  } = props;
@@ -5151,7 +5148,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
5151
5148
  IconButton_default,
5152
5149
  {
5153
5150
  variant: "plain",
5154
- onClick: readOnly ? void 0 : handleCalendarToggle,
5151
+ onClick: handleCalendarToggle,
5155
5152
  "aria-label": "Toggle Calendar",
5156
5153
  "aria-controls": "month-picker-popper",
5157
5154
  "aria-haspopup": "dialog",
@@ -5161,8 +5158,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
5161
5158
  /* @__PURE__ */ import_react33.default.createElement(import_CalendarToday3.default, null)
5162
5159
  ),
5163
5160
  label,
5164
- helperText,
5165
- readOnly
5161
+ helperText
5166
5162
  }
5167
5163
  ), open && /* @__PURE__ */ import_react33.default.createElement(import_base4.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react33.default.createElement(
5168
5164
  StyledPopper3,
@@ -5190,11 +5186,10 @@ var MonthPicker = (0, import_react33.forwardRef)(
5190
5186
  views: ["month"],
5191
5187
  value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
5192
5188
  onChange: ([date]) => {
5193
- const monthDate = new Date(date.getFullYear(), date.getMonth(), 1);
5194
5189
  handleChange({
5195
5190
  target: {
5196
5191
  name: props.name,
5197
- value: formatValueString3(monthDate, format)
5192
+ value: formatValueString3(date, format)
5198
5193
  }
5199
5194
  });
5200
5195
  setAnchorEl(null);
package/dist/index.js CHANGED
@@ -4995,16 +4995,17 @@ var formatValueString3 = (date, format) => {
4995
4995
  const year = date.getFullYear().toString();
4996
4996
  const month = (date.getMonth() + 1).toString().padStart(2, "0");
4997
4997
  const monthName = getMonthName2(date);
4998
- const day = date.getDate().toString().padStart(2, "0");
4998
+ const day = "01";
4999
4999
  return format.replace(/MMMM/g, monthName).replace(/MM/g, month).replace(/DD/g, day).replace(/YYYY/g, year);
5000
5000
  };
5001
5001
  function parseDate3(dateString, format) {
5002
- const formatParts = format.split(/[-./\s]/);
5003
5002
  const dateParts = dateString.split(/[-./\s]/);
5003
+ const formatParts = format.split(/[-./\s]/);
5004
5004
  if (formatParts.length !== dateParts.length) {
5005
5005
  throw new Error("Invalid date string or format");
5006
5006
  }
5007
- let day = 1, month, year;
5007
+ let month, year;
5008
+ const day = 1;
5008
5009
  for (let i = 0; i < formatParts.length; i++) {
5009
5010
  const value = parseInt(dateParts[i], 10);
5010
5011
  switch (formatParts[i]) {
@@ -5014,9 +5015,6 @@ function parseDate3(dateString, format) {
5014
5015
  case "YYYY":
5015
5016
  year = value;
5016
5017
  break;
5017
- case "DD":
5018
- day = 1;
5019
- break;
5020
5018
  }
5021
5019
  }
5022
5020
  const result = new Date(year, month, day);
@@ -5040,8 +5038,7 @@ var MonthPicker = forwardRef9(
5040
5038
  sx,
5041
5039
  className,
5042
5040
  format = "YYYY/MM/DD",
5043
- displayFormat = "YYYY/MM/DD",
5044
- readOnly,
5041
+ displayFormat = "YYYY/MM",
5045
5042
  size,
5046
5043
  ...innerProps
5047
5044
  } = props;
@@ -5138,7 +5135,7 @@ var MonthPicker = forwardRef9(
5138
5135
  IconButton_default,
5139
5136
  {
5140
5137
  variant: "plain",
5141
- onClick: readOnly ? void 0 : handleCalendarToggle,
5138
+ onClick: handleCalendarToggle,
5142
5139
  "aria-label": "Toggle Calendar",
5143
5140
  "aria-controls": "month-picker-popper",
5144
5141
  "aria-haspopup": "dialog",
@@ -5148,8 +5145,7 @@ var MonthPicker = forwardRef9(
5148
5145
  /* @__PURE__ */ React31.createElement(CalendarTodayIcon3, null)
5149
5146
  ),
5150
5147
  label,
5151
- helperText,
5152
- readOnly
5148
+ helperText
5153
5149
  }
5154
5150
  ), open && /* @__PURE__ */ React31.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React31.createElement(
5155
5151
  StyledPopper3,
@@ -5177,11 +5173,10 @@ var MonthPicker = forwardRef9(
5177
5173
  views: ["month"],
5178
5174
  value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
5179
5175
  onChange: ([date]) => {
5180
- const monthDate = new Date(date.getFullYear(), date.getMonth(), 1);
5181
5176
  handleChange({
5182
5177
  target: {
5183
5178
  name: props.name,
5184
- value: formatValueString3(monthDate, format)
5179
+ value: formatValueString3(date, format)
5185
5180
  }
5186
5181
  });
5187
5182
  setAnchorEl(null);