@ceed/ads 1.5.4-next.1 → 1.5.4-next.3
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.
- package/dist/components/MonthPicker/MonthPicker.d.ts +0 -1
- package/dist/index.cjs +15 -13
- package/dist/index.js +15 -13
- package/framer/index.js +29 -29
- package/package.json +1 -1
|
@@ -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 =
|
|
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
|
|
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);
|
|
@@ -5052,9 +5050,14 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
5052
5050
|
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
5053
5051
|
sx,
|
|
5054
5052
|
className,
|
|
5053
|
+
/**
|
|
5054
|
+
* NOTE: 현재 CalendarDate는 YYYY-MM-DD로 개발하고 있어 date를 포함하여 value를 관리한다.
|
|
5055
|
+
* @see https://ecubelabs.atlassian.net/wiki/spaces/SW/pages/1938784349/Date#CalendarDate
|
|
5056
|
+
* @see https://github.com/Ecube-Labs/hds/pull/145
|
|
5057
|
+
*
|
|
5058
|
+
*/
|
|
5055
5059
|
format = "YYYY/MM/DD",
|
|
5056
|
-
displayFormat = "YYYY/MM
|
|
5057
|
-
readOnly,
|
|
5060
|
+
displayFormat = "YYYY/MM",
|
|
5058
5061
|
size,
|
|
5059
5062
|
...innerProps
|
|
5060
5063
|
} = props;
|
|
@@ -5150,8 +5153,9 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
5150
5153
|
endDecorator: /* @__PURE__ */ import_react33.default.createElement(
|
|
5151
5154
|
IconButton_default,
|
|
5152
5155
|
{
|
|
5156
|
+
ref: buttonRef,
|
|
5153
5157
|
variant: "plain",
|
|
5154
|
-
onClick:
|
|
5158
|
+
onClick: handleCalendarToggle,
|
|
5155
5159
|
"aria-label": "Toggle Calendar",
|
|
5156
5160
|
"aria-controls": "month-picker-popper",
|
|
5157
5161
|
"aria-haspopup": "dialog",
|
|
@@ -5161,8 +5165,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
5161
5165
|
/* @__PURE__ */ import_react33.default.createElement(import_CalendarToday3.default, null)
|
|
5162
5166
|
),
|
|
5163
5167
|
label,
|
|
5164
|
-
helperText
|
|
5165
|
-
readOnly
|
|
5168
|
+
helperText
|
|
5166
5169
|
}
|
|
5167
5170
|
), open && /* @__PURE__ */ import_react33.default.createElement(import_base4.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react33.default.createElement(
|
|
5168
5171
|
StyledPopper3,
|
|
@@ -5190,11 +5193,10 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
5190
5193
|
views: ["month"],
|
|
5191
5194
|
value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
|
|
5192
5195
|
onChange: ([date]) => {
|
|
5193
|
-
const monthDate = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
5194
5196
|
handleChange({
|
|
5195
5197
|
target: {
|
|
5196
5198
|
name: props.name,
|
|
5197
|
-
value: formatValueString3(
|
|
5199
|
+
value: formatValueString3(date, format)
|
|
5198
5200
|
}
|
|
5199
5201
|
});
|
|
5200
5202
|
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 =
|
|
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
|
|
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);
|
|
@@ -5039,9 +5037,14 @@ var MonthPicker = forwardRef9(
|
|
|
5039
5037
|
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
5040
5038
|
sx,
|
|
5041
5039
|
className,
|
|
5040
|
+
/**
|
|
5041
|
+
* NOTE: 현재 CalendarDate는 YYYY-MM-DD로 개발하고 있어 date를 포함하여 value를 관리한다.
|
|
5042
|
+
* @see https://ecubelabs.atlassian.net/wiki/spaces/SW/pages/1938784349/Date#CalendarDate
|
|
5043
|
+
* @see https://github.com/Ecube-Labs/hds/pull/145
|
|
5044
|
+
*
|
|
5045
|
+
*/
|
|
5042
5046
|
format = "YYYY/MM/DD",
|
|
5043
|
-
displayFormat = "YYYY/MM
|
|
5044
|
-
readOnly,
|
|
5047
|
+
displayFormat = "YYYY/MM",
|
|
5045
5048
|
size,
|
|
5046
5049
|
...innerProps
|
|
5047
5050
|
} = props;
|
|
@@ -5137,8 +5140,9 @@ var MonthPicker = forwardRef9(
|
|
|
5137
5140
|
endDecorator: /* @__PURE__ */ React31.createElement(
|
|
5138
5141
|
IconButton_default,
|
|
5139
5142
|
{
|
|
5143
|
+
ref: buttonRef,
|
|
5140
5144
|
variant: "plain",
|
|
5141
|
-
onClick:
|
|
5145
|
+
onClick: handleCalendarToggle,
|
|
5142
5146
|
"aria-label": "Toggle Calendar",
|
|
5143
5147
|
"aria-controls": "month-picker-popper",
|
|
5144
5148
|
"aria-haspopup": "dialog",
|
|
@@ -5148,8 +5152,7 @@ var MonthPicker = forwardRef9(
|
|
|
5148
5152
|
/* @__PURE__ */ React31.createElement(CalendarTodayIcon3, null)
|
|
5149
5153
|
),
|
|
5150
5154
|
label,
|
|
5151
|
-
helperText
|
|
5152
|
-
readOnly
|
|
5155
|
+
helperText
|
|
5153
5156
|
}
|
|
5154
5157
|
), open && /* @__PURE__ */ React31.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React31.createElement(
|
|
5155
5158
|
StyledPopper3,
|
|
@@ -5177,11 +5180,10 @@ var MonthPicker = forwardRef9(
|
|
|
5177
5180
|
views: ["month"],
|
|
5178
5181
|
value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
|
|
5179
5182
|
onChange: ([date]) => {
|
|
5180
|
-
const monthDate = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
5181
5183
|
handleChange({
|
|
5182
5184
|
target: {
|
|
5183
5185
|
name: props.name,
|
|
5184
|
-
value: formatValueString3(
|
|
5186
|
+
value: formatValueString3(date, format)
|
|
5185
5187
|
}
|
|
5186
5188
|
});
|
|
5187
5189
|
setAnchorEl(null);
|