@ceed/cds 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 +33 -33
- 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
|
@@ -4570,16 +4570,17 @@ var formatValueString3 = (date, format) => {
|
|
|
4570
4570
|
const year = date.getFullYear().toString();
|
|
4571
4571
|
const month = (date.getMonth() + 1).toString().padStart(2, "0");
|
|
4572
4572
|
const monthName = getMonthName2(date);
|
|
4573
|
-
const day =
|
|
4573
|
+
const day = "01";
|
|
4574
4574
|
return format.replace(/MMMM/g, monthName).replace(/MM/g, month).replace(/DD/g, day).replace(/YYYY/g, year);
|
|
4575
4575
|
};
|
|
4576
4576
|
function parseDate3(dateString, format) {
|
|
4577
|
-
const formatParts = format.split(/[-./\s]/);
|
|
4578
4577
|
const dateParts = dateString.split(/[-./\s]/);
|
|
4578
|
+
const formatParts = format.split(/[-./\s]/);
|
|
4579
4579
|
if (formatParts.length !== dateParts.length) {
|
|
4580
4580
|
throw new Error("Invalid date string or format");
|
|
4581
4581
|
}
|
|
4582
|
-
let
|
|
4582
|
+
let month, year;
|
|
4583
|
+
const day = 1;
|
|
4583
4584
|
for (let i = 0; i < formatParts.length; i++) {
|
|
4584
4585
|
const value = parseInt(dateParts[i], 10);
|
|
4585
4586
|
switch (formatParts[i]) {
|
|
@@ -4589,9 +4590,6 @@ function parseDate3(dateString, format) {
|
|
|
4589
4590
|
case "YYYY":
|
|
4590
4591
|
year = value;
|
|
4591
4592
|
break;
|
|
4592
|
-
case "DD":
|
|
4593
|
-
day = 1;
|
|
4594
|
-
break;
|
|
4595
4593
|
}
|
|
4596
4594
|
}
|
|
4597
4595
|
const result = new Date(year, month, day);
|
|
@@ -4614,9 +4612,14 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
4614
4612
|
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4615
4613
|
sx,
|
|
4616
4614
|
className,
|
|
4615
|
+
/**
|
|
4616
|
+
* NOTE: 현재 CalendarDate는 YYYY-MM-DD로 개발하고 있어 date를 포함하여 value를 관리한다.
|
|
4617
|
+
* @see https://ecubelabs.atlassian.net/wiki/spaces/SW/pages/1938784349/Date#CalendarDate
|
|
4618
|
+
* @see https://github.com/Ecube-Labs/hds/pull/145
|
|
4619
|
+
*
|
|
4620
|
+
*/
|
|
4617
4621
|
format = "YYYY/MM/DD",
|
|
4618
|
-
displayFormat = "YYYY/MM
|
|
4619
|
-
readOnly,
|
|
4622
|
+
displayFormat = "YYYY/MM",
|
|
4620
4623
|
size,
|
|
4621
4624
|
...innerProps
|
|
4622
4625
|
} = props;
|
|
@@ -4712,8 +4715,9 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
4712
4715
|
endDecorator: /* @__PURE__ */ import_react33.default.createElement(
|
|
4713
4716
|
IconButton_default,
|
|
4714
4717
|
{
|
|
4718
|
+
ref: buttonRef,
|
|
4715
4719
|
variant: "plain",
|
|
4716
|
-
onClick:
|
|
4720
|
+
onClick: handleCalendarToggle,
|
|
4717
4721
|
"aria-label": "Toggle Calendar",
|
|
4718
4722
|
"aria-controls": "month-picker-popper",
|
|
4719
4723
|
"aria-haspopup": "dialog",
|
|
@@ -4723,8 +4727,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
4723
4727
|
/* @__PURE__ */ import_react33.default.createElement(import_CalendarToday3.default, null)
|
|
4724
4728
|
),
|
|
4725
4729
|
label,
|
|
4726
|
-
helperText
|
|
4727
|
-
readOnly
|
|
4730
|
+
helperText
|
|
4728
4731
|
}
|
|
4729
4732
|
), open && /* @__PURE__ */ import_react33.default.createElement(import_base4.ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ import_react33.default.createElement(
|
|
4730
4733
|
StyledPopper3,
|
|
@@ -4752,11 +4755,10 @@ var MonthPicker = (0, import_react33.forwardRef)(
|
|
|
4752
4755
|
views: ["month"],
|
|
4753
4756
|
value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
|
|
4754
4757
|
onChange: ([date]) => {
|
|
4755
|
-
const monthDate = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
4756
4758
|
handleChange({
|
|
4757
4759
|
target: {
|
|
4758
4760
|
name: props.name,
|
|
4759
|
-
value: formatValueString3(
|
|
4761
|
+
value: formatValueString3(date, format)
|
|
4760
4762
|
}
|
|
4761
4763
|
});
|
|
4762
4764
|
setAnchorEl(null);
|
package/dist/index.js
CHANGED
|
@@ -4566,16 +4566,17 @@ var formatValueString3 = (date, format) => {
|
|
|
4566
4566
|
const year = date.getFullYear().toString();
|
|
4567
4567
|
const month = (date.getMonth() + 1).toString().padStart(2, "0");
|
|
4568
4568
|
const monthName = getMonthName2(date);
|
|
4569
|
-
const day =
|
|
4569
|
+
const day = "01";
|
|
4570
4570
|
return format.replace(/MMMM/g, monthName).replace(/MM/g, month).replace(/DD/g, day).replace(/YYYY/g, year);
|
|
4571
4571
|
};
|
|
4572
4572
|
function parseDate3(dateString, format) {
|
|
4573
|
-
const formatParts = format.split(/[-./\s]/);
|
|
4574
4573
|
const dateParts = dateString.split(/[-./\s]/);
|
|
4574
|
+
const formatParts = format.split(/[-./\s]/);
|
|
4575
4575
|
if (formatParts.length !== dateParts.length) {
|
|
4576
4576
|
throw new Error("Invalid date string or format");
|
|
4577
4577
|
}
|
|
4578
|
-
let
|
|
4578
|
+
let month, year;
|
|
4579
|
+
const day = 1;
|
|
4579
4580
|
for (let i = 0; i < formatParts.length; i++) {
|
|
4580
4581
|
const value = parseInt(dateParts[i], 10);
|
|
4581
4582
|
switch (formatParts[i]) {
|
|
@@ -4585,9 +4586,6 @@ function parseDate3(dateString, format) {
|
|
|
4585
4586
|
case "YYYY":
|
|
4586
4587
|
year = value;
|
|
4587
4588
|
break;
|
|
4588
|
-
case "DD":
|
|
4589
|
-
day = 1;
|
|
4590
|
-
break;
|
|
4591
4589
|
}
|
|
4592
4590
|
}
|
|
4593
4591
|
const result = new Date(year, month, day);
|
|
@@ -4610,9 +4608,14 @@ var MonthPicker = forwardRef9(
|
|
|
4610
4608
|
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
4611
4609
|
sx,
|
|
4612
4610
|
className,
|
|
4611
|
+
/**
|
|
4612
|
+
* NOTE: 현재 CalendarDate는 YYYY-MM-DD로 개발하고 있어 date를 포함하여 value를 관리한다.
|
|
4613
|
+
* @see https://ecubelabs.atlassian.net/wiki/spaces/SW/pages/1938784349/Date#CalendarDate
|
|
4614
|
+
* @see https://github.com/Ecube-Labs/hds/pull/145
|
|
4615
|
+
*
|
|
4616
|
+
*/
|
|
4613
4617
|
format = "YYYY/MM/DD",
|
|
4614
|
-
displayFormat = "YYYY/MM
|
|
4615
|
-
readOnly,
|
|
4618
|
+
displayFormat = "YYYY/MM",
|
|
4616
4619
|
size,
|
|
4617
4620
|
...innerProps
|
|
4618
4621
|
} = props;
|
|
@@ -4708,8 +4711,9 @@ var MonthPicker = forwardRef9(
|
|
|
4708
4711
|
endDecorator: /* @__PURE__ */ React31.createElement(
|
|
4709
4712
|
IconButton_default,
|
|
4710
4713
|
{
|
|
4714
|
+
ref: buttonRef,
|
|
4711
4715
|
variant: "plain",
|
|
4712
|
-
onClick:
|
|
4716
|
+
onClick: handleCalendarToggle,
|
|
4713
4717
|
"aria-label": "Toggle Calendar",
|
|
4714
4718
|
"aria-controls": "month-picker-popper",
|
|
4715
4719
|
"aria-haspopup": "dialog",
|
|
@@ -4719,8 +4723,7 @@ var MonthPicker = forwardRef9(
|
|
|
4719
4723
|
/* @__PURE__ */ React31.createElement(CalendarTodayIcon3, null)
|
|
4720
4724
|
),
|
|
4721
4725
|
label,
|
|
4722
|
-
helperText
|
|
4723
|
-
readOnly
|
|
4726
|
+
helperText
|
|
4724
4727
|
}
|
|
4725
4728
|
), open && /* @__PURE__ */ React31.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React31.createElement(
|
|
4726
4729
|
StyledPopper3,
|
|
@@ -4748,11 +4751,10 @@ var MonthPicker = forwardRef9(
|
|
|
4748
4751
|
views: ["month"],
|
|
4749
4752
|
value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
|
|
4750
4753
|
onChange: ([date]) => {
|
|
4751
|
-
const monthDate = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
4752
4754
|
handleChange({
|
|
4753
4755
|
target: {
|
|
4754
4756
|
name: props.name,
|
|
4755
|
-
value: formatValueString3(
|
|
4757
|
+
value: formatValueString3(date, format)
|
|
4756
4758
|
}
|
|
4757
4759
|
});
|
|
4758
4760
|
setAnchorEl(null);
|