@ceed/ads 1.5.4-next.3 → 1.5.4-next.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.
@@ -1,6 +1,8 @@
1
1
  export declare const getCalendarDates: (date: Date) => (number | undefined)[][];
2
2
  export declare const getYearName: (date: Date, locale: string) => string;
3
- export declare const getMonthName: (date: Date, locale: string) => string;
3
+ export declare const getMonthName: (date: Date, locale: string, options?: {
4
+ hideYear?: boolean;
5
+ }) => string;
4
6
  export declare const getMonthNameFromIndex: (index: number, locale: string) => string;
5
7
  /**
6
8
  * 일~토 / Sun ~ Sat 같은 요일 이름을 가져옵니다.
@@ -21,6 +21,7 @@ interface BaseMonthPickerProps {
21
21
  disablePast?: boolean;
22
22
  format?: string;
23
23
  displayFormat?: string;
24
+ locale?: string;
24
25
  }
25
26
  export type MonthPickerProps = BaseMonthPickerProps & Omit<React.ComponentProps<typeof Input>, "onChange" | "value" | "defaultValue">;
26
27
  declare const MonthPicker: React.ForwardRefExoticComponent<Omit<MonthPickerProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
package/dist/index.cjs CHANGED
@@ -865,8 +865,11 @@ var getCalendarDates = (date) => {
865
865
  var getYearName = (date, locale) => {
866
866
  return date.toLocaleString(locale, { year: "numeric" });
867
867
  };
868
- var getMonthName = (date, locale) => {
869
- return date.toLocaleString(locale, { year: "numeric", month: "long" });
868
+ var getMonthName = (date, locale, options) => {
869
+ return date.toLocaleString(locale, {
870
+ month: "long",
871
+ ...options?.hideYear ? {} : { year: "numeric" }
872
+ });
870
873
  };
871
874
  var getMonthNameFromIndex = (index, locale) => {
872
875
  return new Date(0, index).toLocaleString(locale, { month: "short" });
@@ -5001,13 +5004,10 @@ var MonthPickerRoot = (0, import_joy46.styled)("div", {
5001
5004
  })({
5002
5005
  width: "100%"
5003
5006
  });
5004
- function getMonthName2(date) {
5005
- return new Intl.DateTimeFormat("en-US", { month: "long" }).format(date);
5006
- }
5007
- var formatValueString3 = (date, format) => {
5007
+ var formatValueString3 = (date, format, locale = "default") => {
5008
5008
  const year = date.getFullYear().toString();
5009
5009
  const month = (date.getMonth() + 1).toString().padStart(2, "0");
5010
- const monthName = getMonthName2(date);
5010
+ const monthName = getMonthName(date, locale, { hideYear: true });
5011
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
  };
@@ -5059,6 +5059,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
5059
5059
  format = "YYYY/MM/DD",
5060
5060
  displayFormat = "YYYY/MM",
5061
5061
  size,
5062
+ locale,
5062
5063
  ...innerProps
5063
5064
  } = props;
5064
5065
  const innerRef = (0, import_react33.useRef)(null);
@@ -5073,7 +5074,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
5073
5074
  { disableStrict: true }
5074
5075
  );
5075
5076
  const [displayValue, setDisplayValue] = (0, import_react33.useState)(
5076
- () => value ? formatValueString3(parseDate3(value, format), displayFormat) : ""
5077
+ () => value ? formatValueString3(parseDate3(value, format), displayFormat, locale) : ""
5077
5078
  );
5078
5079
  const [anchorEl, setAnchorEl] = (0, import_react33.useState)(null);
5079
5080
  const open = Boolean(anchorEl);
@@ -5092,7 +5093,8 @@ var MonthPicker = (0, import_react33.forwardRef)(
5092
5093
  }
5093
5094
  const formattedValue = formatValueString3(
5094
5095
  parseDate3(value, format),
5095
- displayFormat
5096
+ displayFormat,
5097
+ locale
5096
5098
  );
5097
5099
  setDisplayValue(formattedValue);
5098
5100
  }, [displayFormat, format, value]);
@@ -5100,11 +5102,11 @@ var MonthPicker = (0, import_react33.forwardRef)(
5100
5102
  (event) => {
5101
5103
  const value2 = event.target.value;
5102
5104
  setDisplayValue(
5103
- value2 ? formatValueString3(parseDate3(value2, format), displayFormat) : value2
5105
+ value2 ? formatValueString3(parseDate3(value2, format), displayFormat, locale) : value2
5104
5106
  );
5105
5107
  setValue(value2);
5106
5108
  },
5107
- [displayFormat, format, setValue]
5109
+ [displayFormat, format, setValue, locale]
5108
5110
  );
5109
5111
  const handleCalendarToggle = (0, import_react33.useCallback)(
5110
5112
  (event) => {
@@ -5196,7 +5198,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
5196
5198
  handleChange({
5197
5199
  target: {
5198
5200
  name: props.name,
5199
- value: formatValueString3(date, format)
5201
+ value: formatValueString3(date, format, locale)
5200
5202
  }
5201
5203
  });
5202
5204
  setAnchorEl(null);
@@ -5204,7 +5206,8 @@ var MonthPicker = (0, import_react33.forwardRef)(
5204
5206
  minDate: minDate ? new Date(minDate) : void 0,
5205
5207
  maxDate: maxDate ? new Date(maxDate) : void 0,
5206
5208
  disableFuture,
5207
- disablePast
5209
+ disablePast,
5210
+ locale
5208
5211
  }
5209
5212
  ), /* @__PURE__ */ import_react33.default.createElement(
5210
5213
  DialogActions_default,
package/dist/index.js CHANGED
@@ -785,8 +785,11 @@ var getCalendarDates = (date) => {
785
785
  var getYearName = (date, locale) => {
786
786
  return date.toLocaleString(locale, { year: "numeric" });
787
787
  };
788
- var getMonthName = (date, locale) => {
789
- return date.toLocaleString(locale, { year: "numeric", month: "long" });
788
+ var getMonthName = (date, locale, options) => {
789
+ return date.toLocaleString(locale, {
790
+ month: "long",
791
+ ...options?.hideYear ? {} : { year: "numeric" }
792
+ });
790
793
  };
791
794
  var getMonthNameFromIndex = (index, locale) => {
792
795
  return new Date(0, index).toLocaleString(locale, { month: "short" });
@@ -4988,13 +4991,10 @@ var MonthPickerRoot = styled20("div", {
4988
4991
  })({
4989
4992
  width: "100%"
4990
4993
  });
4991
- function getMonthName2(date) {
4992
- return new Intl.DateTimeFormat("en-US", { month: "long" }).format(date);
4993
- }
4994
- var formatValueString3 = (date, format) => {
4994
+ var formatValueString3 = (date, format, locale = "default") => {
4995
4995
  const year = date.getFullYear().toString();
4996
4996
  const month = (date.getMonth() + 1).toString().padStart(2, "0");
4997
- const monthName = getMonthName2(date);
4997
+ const monthName = getMonthName(date, locale, { hideYear: true });
4998
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
  };
@@ -5046,6 +5046,7 @@ var MonthPicker = forwardRef9(
5046
5046
  format = "YYYY/MM/DD",
5047
5047
  displayFormat = "YYYY/MM",
5048
5048
  size,
5049
+ locale,
5049
5050
  ...innerProps
5050
5051
  } = props;
5051
5052
  const innerRef = useRef7(null);
@@ -5060,7 +5061,7 @@ var MonthPicker = forwardRef9(
5060
5061
  { disableStrict: true }
5061
5062
  );
5062
5063
  const [displayValue, setDisplayValue] = useState10(
5063
- () => value ? formatValueString3(parseDate3(value, format), displayFormat) : ""
5064
+ () => value ? formatValueString3(parseDate3(value, format), displayFormat, locale) : ""
5064
5065
  );
5065
5066
  const [anchorEl, setAnchorEl] = useState10(null);
5066
5067
  const open = Boolean(anchorEl);
@@ -5079,7 +5080,8 @@ var MonthPicker = forwardRef9(
5079
5080
  }
5080
5081
  const formattedValue = formatValueString3(
5081
5082
  parseDate3(value, format),
5082
- displayFormat
5083
+ displayFormat,
5084
+ locale
5083
5085
  );
5084
5086
  setDisplayValue(formattedValue);
5085
5087
  }, [displayFormat, format, value]);
@@ -5087,11 +5089,11 @@ var MonthPicker = forwardRef9(
5087
5089
  (event) => {
5088
5090
  const value2 = event.target.value;
5089
5091
  setDisplayValue(
5090
- value2 ? formatValueString3(parseDate3(value2, format), displayFormat) : value2
5092
+ value2 ? formatValueString3(parseDate3(value2, format), displayFormat, locale) : value2
5091
5093
  );
5092
5094
  setValue(value2);
5093
5095
  },
5094
- [displayFormat, format, setValue]
5096
+ [displayFormat, format, setValue, locale]
5095
5097
  );
5096
5098
  const handleCalendarToggle = useCallback12(
5097
5099
  (event) => {
@@ -5183,7 +5185,7 @@ var MonthPicker = forwardRef9(
5183
5185
  handleChange({
5184
5186
  target: {
5185
5187
  name: props.name,
5186
- value: formatValueString3(date, format)
5188
+ value: formatValueString3(date, format, locale)
5187
5189
  }
5188
5190
  });
5189
5191
  setAnchorEl(null);
@@ -5191,7 +5193,8 @@ var MonthPicker = forwardRef9(
5191
5193
  minDate: minDate ? new Date(minDate) : void 0,
5192
5194
  maxDate: maxDate ? new Date(maxDate) : void 0,
5193
5195
  disableFuture,
5194
- disablePast
5196
+ disablePast,
5197
+ locale
5195
5198
  }
5196
5199
  ), /* @__PURE__ */ React31.createElement(
5197
5200
  DialogActions_default,