@pdg/react-form 1.0.78 → 1.0.79
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/@private/PrivateMonthPicker/PrivateMonthPickerMonth/PrivateMonthPickerMonth.types.d.ts +1 -0
- package/dist/@private/PrivateMonthRangePicker/PrivateMonthRangePicker.style.d.ts +34 -0
- package/dist/@private/PrivateYearPicker/PrivateYearPickerYear/PrivateYearPickerYear.types.d.ts +1 -0
- package/dist/@private/PrivateYearRangePicker/PrivateYearRangePicker.style.d.ts +34 -0
- package/dist/FormItemCustom/FormDateRangePicker/FormDateRangePicker.types.d.ts +4 -4
- package/dist/FormItemCustom/FormMonthRangePicker/FormMonthRangePicker.types.d.ts +4 -4
- package/dist/FormItemCustom/FormYearRangePicker/FormYearRangePicker.types.d.ts +4 -4
- package/dist/index.esm.js +196 -153
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +196 -153
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -977,8 +977,8 @@ FormIcon.defaultProps = FormIconDefaultProps;var FormButton = React.forwardRef(f
|
|
|
977
977
|
});
|
|
978
978
|
FormButton.displayName = 'FormButton';
|
|
979
979
|
FormButton.defaultProps = FormButtonDefaultProps;var FormLabelDefaultProps = {};var IconFormIcon = material.styled(FormIcon)(templateObject_1$g || (templateObject_1$g = __makeTemplateObject(["\n vertical-align: middle;\n margin-right: 3px;\n margin-top: -4px;\n margin-bottom: -2px;\n"], ["\n vertical-align: middle;\n margin-right: 3px;\n margin-top: -4px;\n margin-bottom: -2px;\n"])));
|
|
980
|
-
var ChildrenSpan = material.styled('span')(templateObject_2$
|
|
981
|
-
var templateObject_1$g, templateObject_2$
|
|
980
|
+
var ChildrenSpan = material.styled('span')(templateObject_2$8 || (templateObject_2$8 = __makeTemplateObject(["\n vertical-align: middle;\n"], ["\n vertical-align: middle;\n"])));
|
|
981
|
+
var templateObject_1$g, templateObject_2$8;var FormLabel = React.forwardRef(function (_a, ref) {
|
|
982
982
|
// Use ---------------------------------------------------------------------------------------------------------------
|
|
983
983
|
var children = _a.children, icon = _a.icon, size = _a.size, style = _a.style, error = _a.error, warning = _a.warning, props = __rest$4(_a, ["children", "icon", "size", "style", "error", "warning"]);
|
|
984
984
|
var theme = material.useTheme();
|
|
@@ -2226,8 +2226,8 @@ var isDOMElement = function (element) {
|
|
|
2226
2226
|
});
|
|
2227
2227
|
FormCol.displayName = 'FormCol';
|
|
2228
2228
|
FormCol.defaultProps = FormColDefaultProps;var FormBodyDefaultProps = {};var StyledContainerDiv = material.styled('div')(templateObject_1$c || (templateObject_1$c = __makeTemplateObject(["\n flex: 1;\n position: relative;\n"], ["\n flex: 1;\n position: relative;\n"])));
|
|
2229
|
-
var StyledContentDiv = material.styled('div')(templateObject_2$
|
|
2230
|
-
var templateObject_1$c, templateObject_2$
|
|
2229
|
+
var StyledContentDiv = material.styled('div')(templateObject_2$7 || (templateObject_2$7 = __makeTemplateObject(["\n ::-webkit-scrollbar {\n width: 8px;\n }\n\n ::-webkit-scrollbar-thumb {\n background-color: #e4e4e4;\n border-radius: 100px;\n }\n\n ::-webkit-scrollbar-thumb:hover {\n background-color: #cfcfcf;\n border-radius: 100px;\n }\n"], ["\n ::-webkit-scrollbar {\n width: 8px;\n }\n\n ::-webkit-scrollbar-thumb {\n background-color: #e4e4e4;\n border-radius: 100px;\n }\n\n ::-webkit-scrollbar-thumb:hover {\n background-color: #cfcfcf;\n border-radius: 100px;\n }\n"])));
|
|
2230
|
+
var templateObject_1$c, templateObject_2$7;var FormBody = function (_a) {
|
|
2231
2231
|
// Ref ---------------------------------------------------------------------------------------------------------------
|
|
2232
2232
|
var children = _a.children, hidden = _a.hidden;
|
|
2233
2233
|
var containerRef = React.useRef(null);
|
|
@@ -11818,8 +11818,8 @@ PrivateInputDatePicker.defaultProps = PrivateInputDatePickerDefaultProps;var Pri
|
|
|
11818
11818
|
minYear: 2020,
|
|
11819
11819
|
maxYear: 2050,
|
|
11820
11820
|
};var PrivateYearRangePickerYearListDefaultProps = {};var PrivateYearRangePickerYearDefaultProps = {};var StyledContainer$6 = material.styled(material.Grid)(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n padding: 4px;\n position: relative;\n"], ["\n padding: 4px;\n position: relative;\n"])));
|
|
11821
|
-
var StyledButton$2 = material.styled(material.Button)(templateObject_2$
|
|
11822
|
-
var templateObject_1$a, templateObject_2$
|
|
11821
|
+
var StyledButton$2 = material.styled(material.Button)(templateObject_2$6 || (templateObject_2$6 = __makeTemplateObject(["\n font-size: 12px;\n background-color: transparent;\n color: unset;\n outline: 0;\n font-weight: 400;\n line-height: 1.75;\n border-radius: 18px;\n cursor: pointer;\n width: 100%;\n border: 1px solid transparent;\n\n &:focus {\n background-color: rgba(0, 0, 0, 0.12);\n }\n &.default {\n background-color: #efefef;\n }\n &.selected,\n &.selected-temp {\n background-color: rgba(66, 165, 245, 0.6);\n }\n &.selected-start,\n &.selected-end {\n color: #fff;\n background-color: #1976d2;\n }\n &.disabled {\n opacity: 0.8;\n border: 1px solid transparent;\n }\n &:hover:not(.disabled):not(.selected-start):not(.selected-end) {\n color: inherit;\n border: 1px solid transparent;\n background-color: rgba(66, 165, 245, 0.3);\n }\n"], ["\n font-size: 12px;\n background-color: transparent;\n color: unset;\n outline: 0;\n font-weight: 400;\n line-height: 1.75;\n border-radius: 18px;\n cursor: pointer;\n width: 100%;\n border: 1px solid transparent;\n\n &:focus {\n background-color: rgba(0, 0, 0, 0.12);\n }\n &.default {\n background-color: #efefef;\n }\n &.selected,\n &.selected-temp {\n background-color: rgba(66, 165, 245, 0.6);\n }\n &.selected-start,\n &.selected-end {\n color: #fff;\n background-color: #1976d2;\n }\n &.disabled {\n opacity: 0.8;\n border: 1px solid transparent;\n }\n &:hover:not(.disabled):not(.selected-start):not(.selected-end) {\n color: inherit;\n border: 1px solid transparent;\n background-color: rgba(66, 165, 245, 0.3);\n }\n"])));
|
|
11822
|
+
var templateObject_1$a, templateObject_2$6;var PrivateYearRangePickerYear = React.forwardRef(function (_a, ref) {
|
|
11823
11823
|
var year = _a.year, disabled = _a.disabled, isDefault = _a.isDefault, selected = _a.selected, selectedStart = _a.selectedStart, selectedEnd = _a.selectedEnd, selectedTemp = _a.selectedTemp, onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave;
|
|
11824
11824
|
var className = React.useMemo(function () {
|
|
11825
11825
|
return classNames$1(isDefault && 'default', selected && 'selected', selectedStart && 'selected-start', selectedEnd && 'selected-end', selectedTemp && 'selected-temp', disabled && 'disabled');
|
|
@@ -11946,13 +11946,15 @@ var PrivateYearRangePickerYearList = function (_a) {
|
|
|
11946
11946
|
};
|
|
11947
11947
|
PrivateYearRangePickerYearList.displayName = 'PrivateYearRangePickerYearList';
|
|
11948
11948
|
PrivateYearRangePickerYearList.defaultProps = PrivateYearRangePickerYearListDefaultProps;var StyledTitleContainer$1 = material.styled('div')(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid #efefef;\n padding: 10px;\n font-size: 14px;\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid #efefef;\n padding: 10px;\n font-size: 14px;\n"])));
|
|
11949
|
-
var StyledYear = material.styled('span')(templateObject_2$
|
|
11950
|
-
var StyledYearError = material.styled('span')(templateObject_3$
|
|
11949
|
+
var StyledYear = material.styled('span')(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject([""], [""])));
|
|
11950
|
+
var StyledYearError = material.styled('span')(templateObject_3$3 || (templateObject_3$3 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
|
|
11951
11951
|
var theme = _a.theme;
|
|
11952
11952
|
return theme.palette.error.main;
|
|
11953
11953
|
});
|
|
11954
11954
|
var StyledTitleGap = material.styled('span')(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n padding: 0 7px;\n opacity: 0.5;\n"], ["\n padding: 0 7px;\n opacity: 0.5;\n"])));
|
|
11955
|
-
var
|
|
11955
|
+
var StyledActionContainer$1 = material.styled('div')(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n border-top: 1px solid #efefef;\n padding: 10px;\n text-align: right;\n &:empty {\n display: none;\n }\n"], ["\n border-top: 1px solid #efefef;\n padding: 10px;\n text-align: right;\n &:empty {\n display: none;\n }\n"])));
|
|
11956
|
+
var StyledActionButton$1 = material.styled(material.Button)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n min-width: 0;\n color: unset;\n &:not(:first-child) {\n margin-left: 5px;\n }\n &.disabled {\n color: rgba(0, 0, 0, 0.5);\n }\n"], ["\n min-width: 0;\n color: unset;\n &:not(:first-child) {\n margin-left: 5px;\n }\n &.disabled {\n color: rgba(0, 0, 0, 0.5);\n }\n"])));
|
|
11957
|
+
var templateObject_1$8, templateObject_2$5, templateObject_3$3, templateObject_4$2, templateObject_5$1, templateObject_6;var DEFAULT_VALUE$5 = [null, null];
|
|
11956
11958
|
var PrivateYearRangePicker = function (_a) {
|
|
11957
11959
|
// State -------------------------------------------------------------------------------------------------------------
|
|
11958
11960
|
var selectType = _a.selectType, initValue = _a.value, initMinYear = _a.minYear, initMaxYear = _a.maxYear, disablePast = _a.disablePast, disableFuture = _a.disableFuture, hideHeader = _a.hideHeader, onChange = _a.onChange;
|
|
@@ -11996,6 +11998,28 @@ var PrivateYearRangePicker = function (_a) {
|
|
|
11996
11998
|
displayValue[0] < minAvailableYear || displayValue[0] > maxAvailableYear,
|
|
11997
11999
|
displayValue[1] < minAvailableYear || displayValue[1] > maxAvailableYear,
|
|
11998
12000
|
]; }, [displayValue, minAvailableYear, maxAvailableYear]);
|
|
12001
|
+
// action button -----------------------------------------------------------------------------------------------------
|
|
12002
|
+
var getActionButton = React.useCallback(function (fromYear, toYear, label) {
|
|
12003
|
+
if (fromYear < minAvailableYear || toYear > maxAvailableYear) {
|
|
12004
|
+
return undefined;
|
|
12005
|
+
}
|
|
12006
|
+
else {
|
|
12007
|
+
var newValue_1 = [
|
|
12008
|
+
Math.max(fromYear, minAvailableYear),
|
|
12009
|
+
Math.min(toYear, maxAvailableYear),
|
|
12010
|
+
];
|
|
12011
|
+
return (React.createElement(StyledActionButton$1, { variant: 'text', onClick: function () {
|
|
12012
|
+
setValue(newValue_1);
|
|
12013
|
+
onChange(newValue_1, 'end');
|
|
12014
|
+
} }, label));
|
|
12015
|
+
}
|
|
12016
|
+
}, [maxAvailableYear, minAvailableYear, onChange, setValue]);
|
|
12017
|
+
var actionButtons = React.useMemo(function () {
|
|
12018
|
+
return (React.createElement(StyledActionContainer$1, null,
|
|
12019
|
+
getActionButton(nowYear - 2, nowYear, '최근 3년'),
|
|
12020
|
+
getActionButton(nowYear - 4, nowYear, '최근 5년'),
|
|
12021
|
+
getActionButton(nowYear - 9, nowYear, '최근 10년')));
|
|
12022
|
+
}, [getActionButton, nowYear]);
|
|
11999
12023
|
// Event Handler -----------------------------------------------------------------------------------------------------
|
|
12000
12024
|
var handleYearChange = React.useCallback(function (valueYear) {
|
|
12001
12025
|
var newValue = __spreadArray([], value, true);
|
|
@@ -12046,19 +12070,20 @@ var PrivateYearRangePicker = function (_a) {
|
|
|
12046
12070
|
displayValue[1],
|
|
12047
12071
|
"\uB144")))),
|
|
12048
12072
|
React.createElement("div", null,
|
|
12049
|
-
React.createElement(PrivateYearRangePickerYearList, { value: value, selectType: selectType, displayValue: displayValue, minYear: minYear, maxYear: maxYear, disablePast: disablePast, disableFuture: disableFuture, onChange: handleYearChange }))
|
|
12073
|
+
React.createElement(PrivateYearRangePickerYearList, { value: value, selectType: selectType, displayValue: displayValue, minYear: minYear, maxYear: maxYear, disablePast: disablePast, disableFuture: disableFuture, onChange: handleYearChange })),
|
|
12074
|
+
actionButtons));
|
|
12050
12075
|
};
|
|
12051
12076
|
PrivateYearRangePicker.displayName = 'PrivateYearRangePicker';
|
|
12052
12077
|
PrivateYearRangePicker.defaultProps = PrivateYearRangePickerDefaultProps;var PrivateYearPickerDefaultProps = {
|
|
12053
12078
|
minYear: 2020,
|
|
12054
12079
|
maxYear: 2050,
|
|
12055
12080
|
};var PrivateYearPickerYearListDefaultProps = {};var PrivateYearPickerYearDefaultProps = {};var StyledContainer$4 = material.styled(material.Grid)(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n padding: 4px;\n position: relative;\n"], ["\n padding: 4px;\n position: relative;\n"])));
|
|
12056
|
-
var StyledButton$1 = material.styled(material.Button)(templateObject_2$
|
|
12057
|
-
var templateObject_1$7, templateObject_2$
|
|
12058
|
-
var year = _a.year, disabled = _a.disabled, active = _a.active, isDefault = _a.isDefault, selected = _a.selected, selectedStart = _a.selectedStart, selectedEnd = _a.selectedEnd, selectedTemp = _a.selectedTemp, onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave;
|
|
12081
|
+
var StyledButton$1 = material.styled(material.Button)(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject(["\n font-size: 12px;\n background-color: transparent;\n color: unset;\n outline: 0;\n font-weight: 400;\n line-height: 1.75;\n border-radius: 18px;\n cursor: pointer;\n width: 100%;\n border: 1px solid transparent;\n\n &:focus {\n background-color: rgba(0, 0, 0, 0.12);\n }\n &.default {\n background-color: #efefef;\n }\n &.selected,\n &.selected-temp {\n background-color: rgba(66, 165, 245, 0.6);\n }\n &.selected-start,\n &.selected-end {\n color: #fff;\n background-color: rgba(25, 118, 210, 1);\n\n &.range:not(.active) {\n background-color: rgba(25, 118, 210, 0.8);\n }\n }\n &.active {\n color: #fff;\n background-color: rgba(25, 118, 210, 1);\n box-shadow: inset 1px 1px 1px 1px #05569f;\n }\n &.disabled {\n opacity: 0.8;\n border: 1px solid transparent;\n }\n &:hover:not(.disabled):not(.selected-start):not(.selected-end) {\n color: inherit;\n border: 1px solid transparent;\n background-color: rgba(66, 165, 245, 0.3);\n }\n"], ["\n font-size: 12px;\n background-color: transparent;\n color: unset;\n outline: 0;\n font-weight: 400;\n line-height: 1.75;\n border-radius: 18px;\n cursor: pointer;\n width: 100%;\n border: 1px solid transparent;\n\n &:focus {\n background-color: rgba(0, 0, 0, 0.12);\n }\n &.default {\n background-color: #efefef;\n }\n &.selected,\n &.selected-temp {\n background-color: rgba(66, 165, 245, 0.6);\n }\n &.selected-start,\n &.selected-end {\n color: #fff;\n background-color: rgba(25, 118, 210, 1);\n\n &.range:not(.active) {\n background-color: rgba(25, 118, 210, 0.8);\n }\n }\n &.active {\n color: #fff;\n background-color: rgba(25, 118, 210, 1);\n box-shadow: inset 1px 1px 1px 1px #05569f;\n }\n &.disabled {\n opacity: 0.8;\n border: 1px solid transparent;\n }\n &:hover:not(.disabled):not(.selected-start):not(.selected-end) {\n color: inherit;\n border: 1px solid transparent;\n background-color: rgba(66, 165, 245, 0.3);\n }\n"])));
|
|
12082
|
+
var templateObject_1$7, templateObject_2$4;var PrivateYearPickerYear = React.forwardRef(function (_a, ref) {
|
|
12083
|
+
var year = _a.year, disabled = _a.disabled, active = _a.active, range = _a.range, isDefault = _a.isDefault, selected = _a.selected, selectedStart = _a.selectedStart, selectedEnd = _a.selectedEnd, selectedTemp = _a.selectedTemp, onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave;
|
|
12059
12084
|
var className = React.useMemo(function () {
|
|
12060
|
-
return classNames$1(isDefault && 'default', selected && 'selected', selectedStart && 'selected-start', selectedEnd && 'selected-end', selectedTemp && 'selected-temp', active && 'active', disabled && 'disabled');
|
|
12061
|
-
}, [isDefault, selected, selectedStart, selectedEnd, selectedTemp, active, disabled]);
|
|
12085
|
+
return classNames$1(range && 'range', isDefault && 'default', selected && 'selected', selectedStart && 'selected-start', selectedEnd && 'selected-end', selectedTemp && 'selected-temp', active && 'active', disabled && 'disabled');
|
|
12086
|
+
}, [range, isDefault, selected, selectedStart, selectedEnd, selectedTemp, active, disabled]);
|
|
12062
12087
|
return (React.createElement(StyledContainer$4, { className: 'PrivateYearPickerYear', ref: ref, item: true, xs: 4 },
|
|
12063
12088
|
React.createElement(StyledButton$1, { className: className, disabled: disabled, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, year)));
|
|
12064
12089
|
});
|
|
@@ -12150,9 +12175,11 @@ var PrivateYearPickerYearList = function (_a) {
|
|
|
12150
12175
|
var newYears = [];
|
|
12151
12176
|
var startYear = selectFromYear ? selectFromYear : value ? value : 0;
|
|
12152
12177
|
var endYear = selectToYear ? selectToYear : value ? value : 0;
|
|
12178
|
+
var range = !!selectFromYear || !!selectToYear;
|
|
12153
12179
|
for (var i = minYear; i <= maxYear; i += 1) {
|
|
12154
12180
|
newYears.push({
|
|
12155
12181
|
year: i,
|
|
12182
|
+
range: range,
|
|
12156
12183
|
isDefault: !value && !selectFromYear && !selectToYear && i === defaultYear,
|
|
12157
12184
|
active: (!!selectFromYear || !!selectToYear) && i === value,
|
|
12158
12185
|
selected: i >= startYear && i <= endYear,
|
|
@@ -12206,17 +12233,17 @@ var PrivateYearPickerYearList = function (_a) {
|
|
|
12206
12233
|
else if (info.isDefault) {
|
|
12207
12234
|
defaultButtonRef.current = ref;
|
|
12208
12235
|
}
|
|
12209
|
-
}, year: info.year, isDefault: info.isDefault, active: info.active, selected: info.selected, selectedStart: info.selectedStart, selectedEnd: info.selectedEnd, selectedTemp: info.selectedTemp, disabled: info.disabled, onClick: function () { return onChange(info.year); }, onMouseEnter: function () { return mouseOver(info.year); }, onMouseLeave: function () { return mouseOver(undefined); } })); })));
|
|
12236
|
+
}, year: info.year, range: info.range, isDefault: info.isDefault, active: info.active, selected: info.selected, selectedStart: info.selectedStart, selectedEnd: info.selectedEnd, selectedTemp: info.selectedTemp, disabled: info.disabled, onClick: function () { return onChange(info.year); }, onMouseEnter: function () { return mouseOver(info.year); }, onMouseLeave: function () { return mouseOver(undefined); } })); })));
|
|
12210
12237
|
};
|
|
12211
12238
|
PrivateYearPickerYearList.displayName = 'PrivateYearPickerYearList';
|
|
12212
12239
|
PrivateYearPickerYearList.defaultProps = PrivateYearPickerYearListDefaultProps;var StyledTitleContainer = material.styled('div')(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid #efefef;\n padding: 10px;\n font-size: 14px;\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid #efefef;\n padding: 10px;\n font-size: 14px;\n"])));
|
|
12213
|
-
var StyledIconButton$1 = material.styled(material.IconButton)(templateObject_2$
|
|
12214
|
-
var StyledYearMonth$1 = material.styled('div')(templateObject_3$
|
|
12240
|
+
var StyledIconButton$1 = material.styled(material.IconButton)(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n margin-top: -8px;\n margin-bottom: -10px;\n"], ["\n margin-top: -8px;\n margin-bottom: -10px;\n"])));
|
|
12241
|
+
var StyledYearMonth$1 = material.styled('div')(templateObject_3$2 || (templateObject_3$2 = __makeTemplateObject(["\n flex: 1;\n text-align: center;\n"], ["\n flex: 1;\n text-align: center;\n"])));
|
|
12215
12242
|
var StyledYearMonthError$1 = material.styled('div')(templateObject_4$1 || (templateObject_4$1 = __makeTemplateObject(["\n flex: 1;\n text-align: center;\n color: ", ";\n"], ["\n flex: 1;\n text-align: center;\n color: ", ";\n"])), function (_a) {
|
|
12216
12243
|
var theme = _a.theme;
|
|
12217
12244
|
return theme.palette.error.main;
|
|
12218
12245
|
});
|
|
12219
|
-
var templateObject_1$5, templateObject_2$
|
|
12246
|
+
var templateObject_1$5, templateObject_2$3, templateObject_3$2, templateObject_4$1;var PrivateYearPicker = function (_a) {
|
|
12220
12247
|
// State -------------------------------------------------------------------------------------------------------------
|
|
12221
12248
|
var initValue = _a.value, initMinYear = _a.minYear, initMaxYear = _a.maxYear, disablePast = _a.disablePast, disableFuture = _a.disableFuture, hideHeader = _a.hideHeader, selectFromYear = _a.selectFromYear, selectToYear = _a.selectToYear, onChange = _a.onChange;
|
|
12222
12249
|
var _b = useAutoUpdateState$1(initValue || null), value = _b[0], setValue = _b[1];
|
|
@@ -12313,12 +12340,12 @@ PrivateYearPicker.defaultProps = PrivateYearPickerDefaultProps;var PrivateMonthP
|
|
|
12313
12340
|
month: 12,
|
|
12314
12341
|
},
|
|
12315
12342
|
};var PrivateMonthPickerMonthListDefaultProps = {};var PrivateMonthPickerMonthDefaultProps = {};var StyledContainer$2 = material.styled(material.Grid)(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n padding: 4px;\n position: relative;\n"], ["\n padding: 4px;\n position: relative;\n"])));
|
|
12316
|
-
var StyledButton = material.styled(material.Button)(templateObject_2$
|
|
12317
|
-
var templateObject_1$4, templateObject_2$
|
|
12318
|
-
var month = _a.month, disabled = _a.disabled, isDefault = _a.isDefault, active = _a.active, selected = _a.selected, selectedStart = _a.selectedStart, selectedEnd = _a.selectedEnd, selectedTemp = _a.selectedTemp, onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave;
|
|
12343
|
+
var StyledButton = material.styled(material.Button)(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["\n font-size: 12px;\n background-color: transparent;\n color: unset;\n outline: 0;\n font-weight: 400;\n line-height: 1.75;\n border-radius: 18px;\n cursor: pointer;\n width: 100%;\n border: 1px solid transparent;\n\n &:focus {\n background-color: rgba(0, 0, 0, 0.12);\n }\n\n &.default {\n background-color: #efefef;\n }\n &.selected,\n &.selected-temp {\n background-color: rgba(66, 165, 245, 0.6);\n }\n &.selected-start,\n &.selected-end {\n color: #fff;\n background-color: rgba(25, 118, 210, 1);\n\n &.range:not(.active) {\n background-color: rgba(25, 118, 210, 0.8);\n }\n }\n &.active {\n color: #fff;\n background-color: rgba(25, 118, 210, 1);\n box-shadow: inset 1px 1px 1px 1px #05569f;\n }\n &.disabled {\n opacity: 0.8;\n border: 1px solid transparent;\n }\n &:hover:not(.disabled):not(.selected-start):not(.selected-end) {\n color: inherit;\n background-color: rgba(66, 165, 245, 0.3);\n border: 1px solid transparent;\n }\n"], ["\n font-size: 12px;\n background-color: transparent;\n color: unset;\n outline: 0;\n font-weight: 400;\n line-height: 1.75;\n border-radius: 18px;\n cursor: pointer;\n width: 100%;\n border: 1px solid transparent;\n\n &:focus {\n background-color: rgba(0, 0, 0, 0.12);\n }\n\n &.default {\n background-color: #efefef;\n }\n &.selected,\n &.selected-temp {\n background-color: rgba(66, 165, 245, 0.6);\n }\n &.selected-start,\n &.selected-end {\n color: #fff;\n background-color: rgba(25, 118, 210, 1);\n\n &.range:not(.active) {\n background-color: rgba(25, 118, 210, 0.8);\n }\n }\n &.active {\n color: #fff;\n background-color: rgba(25, 118, 210, 1);\n box-shadow: inset 1px 1px 1px 1px #05569f;\n }\n &.disabled {\n opacity: 0.8;\n border: 1px solid transparent;\n }\n &:hover:not(.disabled):not(.selected-start):not(.selected-end) {\n color: inherit;\n background-color: rgba(66, 165, 245, 0.3);\n border: 1px solid transparent;\n }\n"])));
|
|
12344
|
+
var templateObject_1$4, templateObject_2$2;var PrivateMonthPickerMonth = React.forwardRef(function (_a, ref) {
|
|
12345
|
+
var month = _a.month, range = _a.range, disabled = _a.disabled, isDefault = _a.isDefault, active = _a.active, selected = _a.selected, selectedStart = _a.selectedStart, selectedEnd = _a.selectedEnd, selectedTemp = _a.selectedTemp, onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave;
|
|
12319
12346
|
var className = React.useMemo(function () {
|
|
12320
|
-
return classNames$1(isDefault && 'default', active && 'active', selected && 'selected', selectedStart && 'selected-start', selectedEnd && 'selected-end', selectedTemp && 'selected-temp', disabled && 'disabled');
|
|
12321
|
-
}, [isDefault, active, selected, selectedStart, selectedEnd, selectedTemp, disabled]);
|
|
12347
|
+
return classNames$1(range && 'range', isDefault && 'default', active && 'active', selected && 'selected', selectedStart && 'selected-start', selectedEnd && 'selected-end', selectedTemp && 'selected-temp', disabled && 'disabled');
|
|
12348
|
+
}, [range, isDefault, active, selected, selectedStart, selectedEnd, selectedTemp, disabled]);
|
|
12322
12349
|
var handleClick = React.useCallback(function () {
|
|
12323
12350
|
onClick && onClick(month);
|
|
12324
12351
|
}, [month, onClick]);
|
|
@@ -12359,12 +12386,14 @@ var templateObject_1$3;var PrivateMonthPickerMonthList = function (_a) {
|
|
|
12359
12386
|
var currentYear = React.useMemo(function () { return (value ? value.year : defaultYear); }, [value, defaultYear]);
|
|
12360
12387
|
var months = React.useMemo(function () {
|
|
12361
12388
|
var newMonths = [];
|
|
12389
|
+
var range = !!selectFromValue || !!selectToValue;
|
|
12362
12390
|
var startYm = selectFromValue ? valueToYm(selectFromValue) : value ? valueToYm(value) : 0;
|
|
12363
12391
|
var endYm = selectToValue ? valueToYm(selectToValue) : value ? valueToYm(value) : 0;
|
|
12364
12392
|
for (var i = 1; i <= 12; i += 1) {
|
|
12365
12393
|
var ym = currentYear * 100 + i;
|
|
12366
12394
|
newMonths.push({
|
|
12367
12395
|
month: i,
|
|
12396
|
+
range: range,
|
|
12368
12397
|
isDefault: !value && i === defaultMonth,
|
|
12369
12398
|
active: (!!selectFromValue || !!selectToValue) && !!value && ym === valueToYm(value),
|
|
12370
12399
|
selected: !!value && ym >= startYm && ym <= endYm,
|
|
@@ -12391,18 +12420,18 @@ var templateObject_1$3;var PrivateMonthPickerMonthList = function (_a) {
|
|
|
12391
12420
|
onChange({ year: currentYear, month: month });
|
|
12392
12421
|
}, [currentYear, onChange]);
|
|
12393
12422
|
// Render ------------------------------------------------------------------------------------------------------------
|
|
12394
|
-
return (React.createElement(StyledContainer$1, { className: 'PrivateMonthPickerMonthList', container: true }, months.map(function (info) { return (React.createElement(PrivateMonthPickerMonth, { key: info.month, month: info.month, isDefault: info.isDefault, active: info.active, selected: info.selected, selectedStart: info.selectedStart, selectedEnd: info.selectedEnd, selectedTemp: info.selectedTemp, disabled: info.disabled, onClick: handleMonthChange })); })));
|
|
12423
|
+
return (React.createElement(StyledContainer$1, { className: 'PrivateMonthPickerMonthList', container: true }, months.map(function (info) { return (React.createElement(PrivateMonthPickerMonth, { key: info.month, month: info.month, range: info.range, isDefault: info.isDefault, active: info.active, selected: info.selected, selectedStart: info.selectedStart, selectedEnd: info.selectedEnd, selectedTemp: info.selectedTemp, disabled: info.disabled, onClick: handleMonthChange })); })));
|
|
12395
12424
|
};
|
|
12396
12425
|
PrivateMonthPickerMonthList.displayName = 'PrivateMonthPickerMonthList';
|
|
12397
12426
|
PrivateMonthPickerMonthList.defaultProps = PrivateMonthPickerMonthListDefaultProps;var StyledContainer = material.styled('div')(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n .PrivateYearPickerYearList {\n max-height: 130px;\n }\n"], ["\n .PrivateYearPickerYearList {\n max-height: 130px;\n }\n"])));
|
|
12398
|
-
var TitleContainer = material.styled('div')(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid #efefef;\n padding: 10px;\n font-size: 14px;\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid #efefef;\n padding: 10px;\n font-size: 14px;\n"])));
|
|
12399
|
-
var StyledIconButton = material.styled(material.IconButton)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-top: -8px;\n margin-bottom: -10px;\n"], ["\n margin-top: -8px;\n margin-bottom: -10px;\n"])));
|
|
12427
|
+
var TitleContainer = material.styled('div')(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid #efefef;\n padding: 10px;\n font-size: 14px;\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid #efefef;\n padding: 10px;\n font-size: 14px;\n"])));
|
|
12428
|
+
var StyledIconButton = material.styled(material.IconButton)(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n margin-top: -8px;\n margin-bottom: -10px;\n"], ["\n margin-top: -8px;\n margin-bottom: -10px;\n"])));
|
|
12400
12429
|
var StyledYearMonth = material.styled('div')(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
|
|
12401
12430
|
var StyledYearMonthError = material.styled('div')(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ", ";\n"], ["\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ", ";\n"])), function (_a) {
|
|
12402
12431
|
var theme = _a.theme;
|
|
12403
12432
|
return theme.palette.error.main;
|
|
12404
12433
|
});
|
|
12405
|
-
var templateObject_1$2, templateObject_2, templateObject_3, templateObject_4, templateObject_5;var PrivateMonthPicker = function (_a) {
|
|
12434
|
+
var templateObject_1$2, templateObject_2$1, templateObject_3$1, templateObject_4, templateObject_5;var PrivateMonthPicker = function (_a) {
|
|
12406
12435
|
// State -------------------------------------------------------------------------------------------------------------
|
|
12407
12436
|
var initValue = _a.value, initMinValue = _a.minValue, initMaxValue = _a.maxValue, disablePast = _a.disablePast, disableFuture = _a.disableFuture, selectFromValue = _a.selectFromValue, selectToValue = _a.selectToValue, onChange = _a.onChange;
|
|
12408
12437
|
var _b = useAutoUpdateState$1(initValue || null), value = _b[0], setValue = _b[1];
|
|
@@ -12531,13 +12560,16 @@ PrivateMonthPicker.defaultProps = PrivateMonthPickerDefaultProps;var PrivateMont
|
|
|
12531
12560
|
month: 12,
|
|
12532
12561
|
},
|
|
12533
12562
|
};var StyledDiv = material.styled(material.Grid)(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n width: 30px;\n border-left: 1px solid #efefef;\n border-right: 1px solid #efefef;\n background-color: #fafafa;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n width: 30px;\n border-left: 1px solid #efefef;\n border-right: 1px solid #efefef;\n background-color: #fafafa;\n"])));
|
|
12534
|
-
var
|
|
12563
|
+
var StyledActionContainer = material.styled('div')(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-top: 1px solid #efefef;\n padding: 10px;\n text-align: right;\n &:empty {\n display: none;\n }\n"], ["\n border-top: 1px solid #efefef;\n padding: 10px;\n text-align: right;\n &:empty {\n display: none;\n }\n"])));
|
|
12564
|
+
var StyledActionButton = material.styled(material.Button)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n min-width: 0;\n color: unset;\n &:not(:first-child) {\n margin-left: 5px;\n }\n &.disabled {\n color: rgba(0, 0, 0, 0.5);\n }\n"], ["\n min-width: 0;\n color: unset;\n &:not(:first-child) {\n margin-left: 5px;\n }\n &.disabled {\n color: rgba(0, 0, 0, 0.5);\n }\n"])));
|
|
12565
|
+
var templateObject_1$1, templateObject_2, templateObject_3;var PrivateMonthRangePicker = function (_a) {
|
|
12535
12566
|
// Function ----------------------------------------------------------------------------------------------------------
|
|
12536
12567
|
var value = _a.value, initMinValue = _a.minValue, initMaxValue = _a.maxValue, disablePast = _a.disablePast, disableFuture = _a.disableFuture, onChange = _a.onChange;
|
|
12537
12568
|
var valueToYm = React.useCallback(function (v) { return v.year * 100 + v.month; }, []);
|
|
12538
12569
|
var dateToValue = React.useCallback(function (v) { return ({ year: v.year(), month: v.month() + 1 }); }, []);
|
|
12539
12570
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
12540
|
-
var
|
|
12571
|
+
var nowDate = React.useMemo(function () { return dayjs(); }, []);
|
|
12572
|
+
var nowValue = React.useMemo(function () { return dateToValue(nowDate); }, [dateToValue, nowDate]);
|
|
12541
12573
|
var nowYm = React.useMemo(function () { return valueToYm(nowValue); }, [nowValue, valueToYm]);
|
|
12542
12574
|
var minValue = React.useMemo(function () { return initMinValue || PrivateMonthRangePickerDefaultProps.minValue; }, [initMinValue]);
|
|
12543
12575
|
var maxValue = React.useMemo(function () { return initMaxValue || PrivateMonthRangePickerDefaultProps.maxValue; }, [initMaxValue]);
|
|
@@ -12595,6 +12627,33 @@ var templateObject_1$1;var PrivateMonthRangePicker = function (_a) {
|
|
|
12595
12627
|
}
|
|
12596
12628
|
return finalValue;
|
|
12597
12629
|
}, [maxAvailableValue, maxAvailableYm, minAvailableValue, minAvailableYm, valueToYm]);
|
|
12630
|
+
// action button -----------------------------------------------------------------------------------------------------
|
|
12631
|
+
var getActionButton = React.useCallback(function (fromDate, toDate, label, strict) {
|
|
12632
|
+
var fromValue = dateToValue(fromDate);
|
|
12633
|
+
var fromYm = valueToYm(fromValue);
|
|
12634
|
+
var toValue = dateToValue(toDate);
|
|
12635
|
+
var toYm = valueToYm(toValue);
|
|
12636
|
+
if (strict && (fromYm < minAvailableYm || toYm > maxAvailableYm)) {
|
|
12637
|
+
return undefined;
|
|
12638
|
+
}
|
|
12639
|
+
else if (!strict &&
|
|
12640
|
+
((fromYm < minAvailableYm && toYm < minAvailableYm) || (fromYm > maxAvailableYm && toYm > maxAvailableYm))) {
|
|
12641
|
+
return undefined;
|
|
12642
|
+
}
|
|
12643
|
+
else {
|
|
12644
|
+
return (React.createElement(StyledActionButton, { variant: 'text', onClick: function () { return onChange(getFinalValue([fromValue, toValue], 'end'), 'end', true); } }, label));
|
|
12645
|
+
}
|
|
12646
|
+
}, [dateToValue, getFinalValue, maxAvailableYm, minAvailableYm, onChange, valueToYm]);
|
|
12647
|
+
var actionButtons = React.useMemo(function () {
|
|
12648
|
+
return (React.createElement(StyledActionContainer, null,
|
|
12649
|
+
getActionButton(dayjs(nowDate).subtract(2, 'months'), nowDate, '최근 3개월', true),
|
|
12650
|
+
getActionButton(dayjs(nowDate).subtract(5, 'months'), nowDate, '최근 6개월', true),
|
|
12651
|
+
getActionButton(dayjs(nowDate).subtract(11, 'months'), nowDate, '최근 12개월', true),
|
|
12652
|
+
getActionButton(dayjs(nowDate).subtract(23, 'months'), nowDate, '최근 24개월', true),
|
|
12653
|
+
getActionButton(dayjs(nowDate).subtract(2, 'years').set('months', 0), dayjs(nowDate).subtract(2, 'years').set('months', 11), '재작년'),
|
|
12654
|
+
getActionButton(dayjs(nowDate).subtract(1, 'years').set('months', 0), dayjs(nowDate).subtract(1, 'years').set('months', 11), '작년'),
|
|
12655
|
+
getActionButton(dayjs(nowDate).set('months', 0), dayjs(nowDate).set('months', 11), '올해')));
|
|
12656
|
+
}, [getActionButton, nowDate]);
|
|
12598
12657
|
// Event Handler -----------------------------------------------------------------------------------------------------
|
|
12599
12658
|
var handleStartMonthChange = React.useCallback(function (v, isMonthSelect) {
|
|
12600
12659
|
var finalValue = getFinalValue([v, value[1]], 'start');
|
|
@@ -12605,12 +12664,14 @@ var templateObject_1$1;var PrivateMonthRangePicker = function (_a) {
|
|
|
12605
12664
|
onChange(finalValue, 'end', isMonthSelect);
|
|
12606
12665
|
}, [getFinalValue, onChange, value]);
|
|
12607
12666
|
// Render ------------------------------------------------------------------------------------------------------------
|
|
12608
|
-
return (React.createElement(
|
|
12609
|
-
React.createElement(material.Grid, {
|
|
12610
|
-
React.createElement(
|
|
12611
|
-
|
|
12612
|
-
|
|
12613
|
-
React.createElement(
|
|
12667
|
+
return (React.createElement("div", null,
|
|
12668
|
+
React.createElement(material.Grid, { container: true, className: 'PrivateMonthRangePicker' },
|
|
12669
|
+
React.createElement(material.Grid, { item: true },
|
|
12670
|
+
React.createElement(PrivateMonthPicker, { value: value[0], selectToValue: value[1], minValue: minValue, maxValue: maxValue, disablePast: disablePast, disableFuture: disableFuture, onChange: handleStartMonthChange })),
|
|
12671
|
+
React.createElement(StyledDiv, null, "~"),
|
|
12672
|
+
React.createElement(material.Grid, { item: true },
|
|
12673
|
+
React.createElement(PrivateMonthPicker, { value: value[1], selectFromValue: value[0], minValue: minValue, maxValue: maxValue, disablePast: disablePast, disableFuture: disableFuture, onChange: handleEndMonthChange }))),
|
|
12674
|
+
actionButtons));
|
|
12614
12675
|
};
|
|
12615
12676
|
PrivateMonthRangePicker.displayName = 'PrivateMonthRangePicker';
|
|
12616
12677
|
PrivateMonthRangePicker.defaultProps = PrivateMonthRangePickerDefaultProps;var FormDatePicker = React.forwardRef(function (_a, ref) {
|
|
@@ -13130,7 +13191,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13130
13191
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
13131
13192
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
13132
13193
|
//--------------------------------------------------------------------------------------------------------------------
|
|
13133
|
-
name = _a.name, initValue = _a.value, initData = _a.data,
|
|
13194
|
+
name = _a.name, initValue = _a.value, initData = _a.data, fromLabel = _a.fromLabel, fromLabelIcon = _a.fromLabelIcon, toLabel = _a.toLabel, toLabelIcon = _a.toLabelIcon, initCalendarCount = _a.calendarCount, initFormat = _a.format, formValueFormat = _a.formValueFormat, allowSingleSelect = _a.allowSingleSelect, required = _a.required, requiredStart = _a.requiredStart, requiredEnd = _a.requiredEnd, readOnly = _a.readOnly, readOnlyStart = _a.readOnlyStart, readOnlyEnd = _a.readOnlyEnd, readOnlyInput = _a.readOnlyInput, initDisabled = _a.disabled, inputWidth = _a.inputWidth, exceptValue = _a.exceptValue, initError = _a.error, helperText = _a.helperText, formValueFromNameSuffix = _a.formValueFromNameSuffix, formValueToNameSuffix = _a.formValueToNameSuffix, icon = _a.icon, startIcon = _a.startIcon, endIcon = _a.endIcon, startAdornment = _a.startAdornment, startStartAdornment = _a.startStartAdornment, endStartAdornment = _a.endStartAdornment, endAdornment = _a.endAdornment, startEndAdornment = _a.startEndAdornment, endEndAdornment = _a.endEndAdornment, disablePast = _a.disablePast, disableFuture = _a.disableFuture, minDate = _a.minDate, maxDate = _a.maxDate, initHidden = _a.hidden, align = _a.align, onGetActionButtons = _a.onGetActionButtons, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
13134
13195
|
// -------------------------------------------------------------------------------------------------------------------
|
|
13135
13196
|
className = _a.className;
|
|
13136
13197
|
var id = React.useId();
|
|
@@ -13157,10 +13218,10 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13157
13218
|
var _d = useAutoUpdateState$1(initHidden), hidden = _d[0], setHidden = _d[1];
|
|
13158
13219
|
var _e = useAutoUpdateState$1(initError), error = _e[0], setError = _e[1];
|
|
13159
13220
|
var _f = React.useState(), errorHelperText = _f[0], setErrorHelperText = _f[1];
|
|
13160
|
-
var _g = React.useState(false),
|
|
13161
|
-
var _h = React.useState(),
|
|
13162
|
-
var _j = React.useState(false),
|
|
13163
|
-
var _k = React.useState(),
|
|
13221
|
+
var _g = React.useState(false), fromError = _g[0], setFromError = _g[1];
|
|
13222
|
+
var _h = React.useState(), fromErrorHelperText = _h[0], setFromErrorHelperText = _h[1];
|
|
13223
|
+
var _j = React.useState(false), toError = _j[0], setToError = _j[1];
|
|
13224
|
+
var _k = React.useState(), toErrorHelperText = _k[0], setToErrorHelperText = _k[1];
|
|
13164
13225
|
var _l = useAutoUpdateState$1(initData), data = _l[0], setData = _l[1];
|
|
13165
13226
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
13166
13227
|
var format = React.useMemo(function () { return initFormat || DEFAULT_FORMAT$4; }, [initFormat]);
|
|
@@ -13175,25 +13236,25 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13175
13236
|
}, [startDateTextFieldRef]);
|
|
13176
13237
|
var focusValidate = React.useCallback(function () {
|
|
13177
13238
|
var _a, _b;
|
|
13178
|
-
if (
|
|
13239
|
+
if (toError) {
|
|
13179
13240
|
(_a = endDateTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
13180
13241
|
}
|
|
13181
13242
|
else {
|
|
13182
13243
|
(_b = startDateTextFieldRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
13183
13244
|
}
|
|
13184
|
-
}, [
|
|
13245
|
+
}, [toError, startDateTextFieldRef, endDateTextFieldRef]);
|
|
13185
13246
|
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
13186
13247
|
var setErrorErrorHelperText = React.useCallback(function (error, errorHelperText) {
|
|
13187
13248
|
setError(error);
|
|
13188
13249
|
setErrorHelperText(errorHelperText);
|
|
13189
13250
|
}, [setError]);
|
|
13190
|
-
var
|
|
13191
|
-
|
|
13192
|
-
|
|
13251
|
+
var setFromErrorErrorHelperText = React.useCallback(function (error, fromErrorHelperText) {
|
|
13252
|
+
setFromError(error);
|
|
13253
|
+
setFromErrorHelperText(fromErrorHelperText);
|
|
13193
13254
|
}, []);
|
|
13194
|
-
var
|
|
13195
|
-
|
|
13196
|
-
|
|
13255
|
+
var setToErrorErrorHelperText = React.useCallback(function (error, toErrorHelperText) {
|
|
13256
|
+
setToError(error);
|
|
13257
|
+
setToErrorHelperText(toErrorHelperText);
|
|
13197
13258
|
}, []);
|
|
13198
13259
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
13199
13260
|
var validate = React.useCallback(function (value) {
|
|
@@ -13203,46 +13264,46 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13203
13264
|
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
13204
13265
|
}
|
|
13205
13266
|
else if (value[0] == null) {
|
|
13206
|
-
|
|
13267
|
+
setFromErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
13207
13268
|
}
|
|
13208
13269
|
else {
|
|
13209
|
-
|
|
13270
|
+
setToErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
13210
13271
|
}
|
|
13211
13272
|
return false;
|
|
13212
13273
|
}
|
|
13213
13274
|
if (requiredStart && value[0] == null) {
|
|
13214
|
-
|
|
13275
|
+
setFromErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
13215
13276
|
return false;
|
|
13216
13277
|
}
|
|
13217
13278
|
if (requiredEnd && value[1] == null) {
|
|
13218
|
-
|
|
13279
|
+
setToErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
13219
13280
|
return false;
|
|
13220
13281
|
}
|
|
13221
13282
|
if (!allowSingleSelect && (value[0] || value[1]) && (value[0] == null || value[1] == null)) {
|
|
13222
13283
|
if (value[0] == null) {
|
|
13223
|
-
|
|
13284
|
+
setFromErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
13224
13285
|
}
|
|
13225
13286
|
else {
|
|
13226
|
-
|
|
13287
|
+
setToErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
13227
13288
|
}
|
|
13228
13289
|
return false;
|
|
13229
13290
|
}
|
|
13230
13291
|
var startInputValue = ((_a = startDateTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
13231
13292
|
var endInputValue = ((_b = endDateTextFieldRef.current) === null || _b === void 0 ? void 0 : _b.value) || '';
|
|
13232
13293
|
if (notEmpty(startInputValue) && !dayjs(startInputValue, format).isValid()) {
|
|
13233
|
-
|
|
13294
|
+
setFromErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
13234
13295
|
return false;
|
|
13235
13296
|
}
|
|
13236
13297
|
if (notEmpty(endInputValue) && !dayjs(endInputValue, format).isValid()) {
|
|
13237
|
-
|
|
13298
|
+
setToErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
13238
13299
|
return false;
|
|
13239
13300
|
}
|
|
13240
13301
|
if (startInputDatePickerErrorRef.current) {
|
|
13241
|
-
|
|
13302
|
+
setFromErrorErrorHelperText(true, getDateValidationErrorText(startInputDatePickerErrorRef.current));
|
|
13242
13303
|
return false;
|
|
13243
13304
|
}
|
|
13244
13305
|
if (endInputDatePickerErrorRef.current) {
|
|
13245
|
-
|
|
13306
|
+
setToErrorErrorHelperText(true, getDateValidationErrorText(endInputDatePickerErrorRef.current));
|
|
13246
13307
|
return false;
|
|
13247
13308
|
}
|
|
13248
13309
|
if (onValidate) {
|
|
@@ -13253,8 +13314,8 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13253
13314
|
}
|
|
13254
13315
|
}
|
|
13255
13316
|
setErrorErrorHelperText(false, undefined);
|
|
13256
|
-
|
|
13257
|
-
|
|
13317
|
+
setFromError(false);
|
|
13318
|
+
setToError(false);
|
|
13258
13319
|
return true;
|
|
13259
13320
|
}, [
|
|
13260
13321
|
required,
|
|
@@ -13264,8 +13325,8 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13264
13325
|
format,
|
|
13265
13326
|
onValidate,
|
|
13266
13327
|
setErrorErrorHelperText,
|
|
13267
|
-
|
|
13268
|
-
|
|
13328
|
+
setFromErrorErrorHelperText,
|
|
13329
|
+
setToErrorErrorHelperText,
|
|
13269
13330
|
]);
|
|
13270
13331
|
// Function activeMonth --------------------------------------------------------------------------------------------
|
|
13271
13332
|
var activeMonth = React.useCallback(function (month) {
|
|
@@ -13323,7 +13384,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13323
13384
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13324
13385
|
}, []);
|
|
13325
13386
|
useFirstSkipEffect$1(function () {
|
|
13326
|
-
if (error ||
|
|
13387
|
+
if (error || fromError || toError)
|
|
13327
13388
|
validate(value);
|
|
13328
13389
|
if (onChange)
|
|
13329
13390
|
onChange(value);
|
|
@@ -13373,9 +13434,9 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13373
13434
|
var handleChange = React.useCallback(function (newValue) {
|
|
13374
13435
|
setValue(newValue);
|
|
13375
13436
|
setOpen(false);
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
}, [
|
|
13437
|
+
setFromErrorErrorHelperText(false, undefined);
|
|
13438
|
+
setToErrorErrorHelperText(false, undefined);
|
|
13439
|
+
}, [setToErrorErrorHelperText, setFromErrorErrorHelperText, setValue]);
|
|
13379
13440
|
var handleValueChange = React.useCallback(function (selectType, newValue, fromInput) {
|
|
13380
13441
|
var _a;
|
|
13381
13442
|
var finalValue;
|
|
@@ -13404,7 +13465,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13404
13465
|
}
|
|
13405
13466
|
}
|
|
13406
13467
|
}
|
|
13407
|
-
|
|
13468
|
+
setFromErrorErrorHelperText(false, undefined);
|
|
13408
13469
|
if (fromInput && newValue) {
|
|
13409
13470
|
activeMonth(newValue);
|
|
13410
13471
|
}
|
|
@@ -13415,7 +13476,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13415
13476
|
if (fromInput && newValue) {
|
|
13416
13477
|
activeMonth(newValue.subtract(calendarCount - 1, 'month'));
|
|
13417
13478
|
}
|
|
13418
|
-
|
|
13479
|
+
setFromErrorErrorHelperText(false, undefined);
|
|
13419
13480
|
}
|
|
13420
13481
|
else {
|
|
13421
13482
|
finalValue = [value[0], newValue];
|
|
@@ -13436,7 +13497,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13436
13497
|
(_a = startDateTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
13437
13498
|
});
|
|
13438
13499
|
}
|
|
13439
|
-
|
|
13500
|
+
setToErrorErrorHelperText(false, undefined);
|
|
13440
13501
|
}
|
|
13441
13502
|
break;
|
|
13442
13503
|
}
|
|
@@ -13447,10 +13508,10 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13447
13508
|
}, [
|
|
13448
13509
|
setValue,
|
|
13449
13510
|
value,
|
|
13450
|
-
|
|
13511
|
+
setFromErrorErrorHelperText,
|
|
13451
13512
|
activeMonth,
|
|
13452
13513
|
calendarCount,
|
|
13453
|
-
|
|
13514
|
+
setToErrorErrorHelperText,
|
|
13454
13515
|
open,
|
|
13455
13516
|
onRequestSearchSubmit,
|
|
13456
13517
|
name,
|
|
@@ -13471,10 +13532,10 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13471
13532
|
}
|
|
13472
13533
|
switch (selectType) {
|
|
13473
13534
|
case 'start':
|
|
13474
|
-
|
|
13535
|
+
setFromError(error);
|
|
13475
13536
|
break;
|
|
13476
13537
|
case 'end':
|
|
13477
|
-
|
|
13538
|
+
setToError(error);
|
|
13478
13539
|
break;
|
|
13479
13540
|
}
|
|
13480
13541
|
}, [handleValueChange]);
|
|
@@ -13664,8 +13725,8 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13664
13725
|
offset: [
|
|
13665
13726
|
0,
|
|
13666
13727
|
(error && errorHelperText) ||
|
|
13667
|
-
(
|
|
13668
|
-
(
|
|
13728
|
+
(fromError && fromErrorHelperText) ||
|
|
13729
|
+
(toError && toErrorHelperText)
|
|
13669
13730
|
? 8
|
|
13670
13731
|
: -14,
|
|
13671
13732
|
],
|
|
@@ -13676,21 +13737,15 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
13676
13737
|
React.createElement(FormDateRangePickerTooltipPickerContainer, { ref: containerRef, calendarCount: calendarCount, selectType: selectType, value: value, months: months, disablePast: disablePast, disableFuture: disableFuture, minDate: minDate, maxDate: maxDate, onGetActionButtons: onGetActionButtons, onChange: handleChange, onValueChange: handleValueChange, onMonthsChange: setMonths })) },
|
|
13677
13738
|
React.createElement(material.Grid, { container: true, alignItems: 'center' },
|
|
13678
13739
|
React.createElement(material.Grid, { item: true, flex: 1 },
|
|
13679
|
-
React.createElement(PrivateInputDatePicker, __assign$7({}, inputDatePickerProps, { style: inputStyle, value: value[0], label:
|
|
13740
|
+
React.createElement(PrivateInputDatePicker, __assign$7({}, inputDatePickerProps, { style: inputStyle, value: value[0], label: fromLabel, labelIcon: fromLabelIcon, error: error || fromError, focused: focused || (open && selectType === 'start'), required: required || requiredStart, readOnly: readOnly || readOnlyStart, readOnlyInput: readOnlyInput, icon: startIcon || icon, startAdornment: startStartAdornment || startAdornment, endAdornment: startEndAdornment || endAdornment, inputRef: startDateTextFieldRef, onChange: function (newValue) { return handleInputDatePickerChange('start', newValue); }, onFocus: function () { return handleInputDatePickerFocus('start'); }, onError: function (reason) { return (startInputDatePickerErrorRef.current = reason); } }))),
|
|
13680
13741
|
React.createElement(material.Grid, { item: true, sx: { px: 1 } }, "~"),
|
|
13681
13742
|
React.createElement(material.Grid, { item: true, flex: 1 },
|
|
13682
|
-
React.createElement(PrivateInputDatePicker, __assign$7({}, inputDatePickerProps, { style: inputStyle, value: value[1], label:
|
|
13743
|
+
React.createElement(PrivateInputDatePicker, __assign$7({}, inputDatePickerProps, { style: inputStyle, value: value[1], label: toLabel, labelIcon: toLabelIcon, error: error || toError, focused: focused || (open && selectType === 'end'), required: required || requiredEnd, readOnly: readOnly || readOnlyEnd, readOnlyInput: readOnlyInput, icon: endIcon || icon, startAdornment: endStartAdornment || startAdornment, endAdornment: endEndAdornment || endAdornment, inputRef: endDateTextFieldRef, onChange: function (newValue) { return handleInputDatePickerChange('end', newValue); }, onFocus: function () { return handleInputDatePickerFocus('end'); }, onError: function (reason) { return (endInputDatePickerErrorRef.current = reason); } }))))),
|
|
13683
13744
|
!formColWithHelperText &&
|
|
13684
13745
|
(helperText ||
|
|
13685
13746
|
(error && errorHelperText) ||
|
|
13686
|
-
(
|
|
13687
|
-
(
|
|
13688
|
-
? errorHelperText
|
|
13689
|
-
: startError
|
|
13690
|
-
? startErrorHelperText
|
|
13691
|
-
: endError
|
|
13692
|
-
? endErrorHelperText
|
|
13693
|
-
: helperText))))));
|
|
13747
|
+
(fromError && fromErrorHelperText) ||
|
|
13748
|
+
(toError && toErrorHelperText)) && (React.createElement(material.FormHelperText, { error: error || fromError || toError, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, error ? errorHelperText : fromError ? fromErrorHelperText : toError ? toErrorHelperText : helperText))))));
|
|
13694
13749
|
});
|
|
13695
13750
|
FormDateRangePicker.displayName = 'FormDateRangePicker';
|
|
13696
13751
|
FormDateRangePicker.defaultProps = FormDateRangePickerDefaultProps;var FormFileDefaultProps = {
|
|
@@ -14557,7 +14612,7 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
14557
14612
|
//----------------------------------------------------------------------------------------------------------------
|
|
14558
14613
|
initHidden = _a.hidden,
|
|
14559
14614
|
//----------------------------------------------------------------------------------------------------------------
|
|
14560
|
-
name = _a.name,
|
|
14615
|
+
name = _a.name, fromLabel = _a.fromLabel, fromLabelIcon = _a.fromLabelIcon, toLabel = _a.toLabel, toLabelIcon = _a.toLabelIcon, readOnly = _a.readOnly, required = _a.required, initFullWidth = _a.fullWidth, initDisabled = _a.disabled, initError = _a.error, helperText = _a.helperText, initValue = _a.value, initData = _a.data, exceptValue = _a.exceptValue, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
14561
14616
|
// -------------------------------------------------------------------------------------------------------------------
|
|
14562
14617
|
icon = _a.icon, initFormat = _a.format, initLabelShrink = _a.labelShrink, disablePast = _a.disablePast, disableFuture = _a.disableFuture, initMinValue = _a.minValue, initMaxValue = _a.maxValue, inputWidth = _a.inputWidth, readOnlyInput = _a.readOnlyInput, startAdornment = _a.startAdornment, endAdornment = _a.endAdornment, formValueFromYearNameSuffix = _a.formValueFromYearNameSuffix, formValueFromMonthNameSuffix = _a.formValueFromMonthNameSuffix, formValueToYearNameSuffix = _a.formValueToYearNameSuffix, formValueToMonthNameSuffix = _a.formValueToMonthNameSuffix, align = _a.align,
|
|
14563
14618
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -14581,10 +14636,10 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
14581
14636
|
// State -----------------------------------------------------------------------------------------------------------
|
|
14582
14637
|
var _c = useAutoUpdateState$1(initError), error = _c[0], setError = _c[1];
|
|
14583
14638
|
var _d = React.useState(), errorHelperText = _d[0], setErrorHelperText = _d[1];
|
|
14584
|
-
var _e = React.useState(false),
|
|
14585
|
-
var _f = React.useState(),
|
|
14586
|
-
var _g = React.useState(false),
|
|
14587
|
-
var _h = React.useState(),
|
|
14639
|
+
var _e = React.useState(false), fromError = _e[0], setFromError = _e[1];
|
|
14640
|
+
var _f = React.useState(), fromErrorHelperText = _f[0], setFromErrorHelperText = _f[1];
|
|
14641
|
+
var _g = React.useState(false), toError = _g[0], setToError = _g[1];
|
|
14642
|
+
var _h = React.useState(), toErrorHelperText = _h[0], setToErrorHelperText = _h[1];
|
|
14588
14643
|
var _j = useAutoUpdateState$1(initDisabled), disabled = _j[0], setDisabled = _j[1];
|
|
14589
14644
|
var _k = useAutoUpdateState$1(initHidden), hidden = _k[0], setHidden = _k[1];
|
|
14590
14645
|
var _l = useAutoUpdateState$1(initData), data = _l[0], setData = _l[1];
|
|
@@ -14598,7 +14653,7 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
14598
14653
|
return initValue || DEFAULT_VALUE$2;
|
|
14599
14654
|
}, [initValue])), value = _o[0], setValue = _o[1];
|
|
14600
14655
|
useFirstSkipEffect$1(function () {
|
|
14601
|
-
if (error ||
|
|
14656
|
+
if (error || fromError || toError)
|
|
14602
14657
|
validate(value);
|
|
14603
14658
|
if (onChange)
|
|
14604
14659
|
onChange(value);
|
|
@@ -14675,13 +14730,13 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
14675
14730
|
var _a;
|
|
14676
14731
|
(_a = startInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
14677
14732
|
}, []);
|
|
14678
|
-
var
|
|
14679
|
-
|
|
14680
|
-
|
|
14733
|
+
var setFromErrorErrorHelperText = React.useCallback(function (error, fromErrorHelperText) {
|
|
14734
|
+
setFromError(error);
|
|
14735
|
+
setFromErrorHelperText(fromErrorHelperText);
|
|
14681
14736
|
}, []);
|
|
14682
|
-
var
|
|
14683
|
-
|
|
14684
|
-
|
|
14737
|
+
var setToErrorErrorHelperText = React.useCallback(function (error, toErrorHelperText) {
|
|
14738
|
+
setToError(error);
|
|
14739
|
+
setToErrorHelperText(toErrorHelperText);
|
|
14685
14740
|
}, []);
|
|
14686
14741
|
var setErrorErrorHelperText = React.useCallback(function (error, errorHelperText) {
|
|
14687
14742
|
setError(error);
|
|
@@ -14693,22 +14748,22 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
14693
14748
|
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
14694
14749
|
}
|
|
14695
14750
|
else if (value[0] == null) {
|
|
14696
|
-
|
|
14751
|
+
setFromErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
14697
14752
|
}
|
|
14698
14753
|
else {
|
|
14699
|
-
|
|
14754
|
+
setToErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
14700
14755
|
}
|
|
14701
14756
|
return false;
|
|
14702
14757
|
}
|
|
14703
14758
|
if (startInputDatePickerErrorRef.current) {
|
|
14704
|
-
|
|
14759
|
+
setFromErrorErrorHelperText(true, getDateValidationErrorText(startInputDatePickerErrorRef.current));
|
|
14705
14760
|
if (endInputDatePickerErrorRef.current) {
|
|
14706
|
-
|
|
14761
|
+
setToErrorErrorHelperText(true, getDateValidationErrorText(endInputDatePickerErrorRef.current));
|
|
14707
14762
|
}
|
|
14708
14763
|
return false;
|
|
14709
14764
|
}
|
|
14710
14765
|
if (endInputDatePickerErrorRef.current) {
|
|
14711
|
-
|
|
14766
|
+
setToErrorErrorHelperText(true, getDateValidationErrorText(endInputDatePickerErrorRef.current));
|
|
14712
14767
|
return false;
|
|
14713
14768
|
}
|
|
14714
14769
|
if (onValidate) {
|
|
@@ -14719,10 +14774,10 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
14719
14774
|
}
|
|
14720
14775
|
}
|
|
14721
14776
|
setErrorErrorHelperText(false, undefined);
|
|
14722
|
-
|
|
14723
|
-
|
|
14777
|
+
setFromErrorErrorHelperText(false, undefined);
|
|
14778
|
+
setToErrorErrorHelperText(false, undefined);
|
|
14724
14779
|
return true;
|
|
14725
|
-
}, [onValidate, required,
|
|
14780
|
+
}, [onValidate, required, setToErrorErrorHelperText, setErrorErrorHelperText, setFromErrorErrorHelperText]);
|
|
14726
14781
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
14727
14782
|
React.useLayoutEffect(function () {
|
|
14728
14783
|
var lastValue = value;
|
|
@@ -14920,7 +14975,7 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
14920
14975
|
newValue[1] = newValue[0];
|
|
14921
14976
|
}
|
|
14922
14977
|
}
|
|
14923
|
-
if (
|
|
14978
|
+
if (fromError) {
|
|
14924
14979
|
validate(newValue);
|
|
14925
14980
|
}
|
|
14926
14981
|
nextTick(function () {
|
|
@@ -14939,7 +14994,7 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
14939
14994
|
newValue[0] = newValue[1];
|
|
14940
14995
|
}
|
|
14941
14996
|
}
|
|
14942
|
-
if (
|
|
14997
|
+
if (toError) {
|
|
14943
14998
|
validate(newValue);
|
|
14944
14999
|
}
|
|
14945
15000
|
nextTick(function () {
|
|
@@ -14951,13 +15006,13 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
14951
15006
|
}
|
|
14952
15007
|
}, [
|
|
14953
15008
|
dateToValue,
|
|
14954
|
-
|
|
15009
|
+
toError,
|
|
14955
15010
|
maxAvailableYm,
|
|
14956
15011
|
minAvailableYm,
|
|
14957
15012
|
name,
|
|
14958
15013
|
onValueChangeByUser,
|
|
14959
15014
|
setValue,
|
|
14960
|
-
|
|
15015
|
+
fromError,
|
|
14961
15016
|
validate,
|
|
14962
15017
|
valueToYm,
|
|
14963
15018
|
]);
|
|
@@ -15011,21 +15066,15 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
15011
15066
|
React.createElement(PrivateMonthRangePicker, { minValue: minValue, maxValue: maxValue, disablePast: disablePast, disableFuture: disableFuture, value: value, onChange: handleContainerChange })) },
|
|
15012
15067
|
React.createElement(material.Grid, { container: true, alignItems: 'center' },
|
|
15013
15068
|
React.createElement(material.Grid, { item: true, flex: 1 },
|
|
15014
|
-
React.createElement(PrivateInputDatePicker, __assign$7({}, inputDatePickerProps, { style: inputStyle, sx: sx, value: valueDate[0], label:
|
|
15069
|
+
React.createElement(PrivateInputDatePicker, __assign$7({}, inputDatePickerProps, { style: inputStyle, sx: sx, value: valueDate[0], label: fromLabel, labelIcon: fromLabelIcon, error: error || fromError, focused: focused || open, required: required, readOnly: readOnly, readOnlyInput: readOnlyInput, icon: icon, startAdornment: startAdornment, endAdornment: endAdornment, inputRef: startInputRef, onChange: function (v) { return handleInputDatePickerChange('start', v); }, onFocus: function () { return handleInputDatePickerFocus('start'); }, onError: function (reason) { return (startInputDatePickerErrorRef.current = reason); }, shouldDisableYear: handleInputDatePickerShouldDisableYear }))),
|
|
15015
15070
|
React.createElement(material.Grid, { item: true, sx: { px: 1 } }, "~"),
|
|
15016
15071
|
React.createElement(material.Grid, { item: true, flex: 1 },
|
|
15017
|
-
React.createElement(PrivateInputDatePicker, __assign$7({}, inputDatePickerProps, { style: inputStyle, sx: sx, value: valueDate[1], label:
|
|
15072
|
+
React.createElement(PrivateInputDatePicker, __assign$7({}, inputDatePickerProps, { style: inputStyle, sx: sx, value: valueDate[1], label: toLabel, labelIcon: toLabelIcon, error: error || toError, focused: focused || open, required: required, readOnly: readOnly, readOnlyInput: readOnlyInput, icon: icon, startAdornment: startAdornment, endAdornment: endAdornment, inputRef: endInputRef, onChange: function (v) { return handleInputDatePickerChange('end', v); }, onFocus: function () { return handleInputDatePickerFocus('end'); }, onError: function (reason) { return (endInputDatePickerErrorRef.current = reason); }, shouldDisableYear: handleInputDatePickerShouldDisableYear }))))),
|
|
15018
15073
|
!formColWithHelperText &&
|
|
15019
15074
|
(helperText ||
|
|
15020
15075
|
(error && errorHelperText) ||
|
|
15021
|
-
(
|
|
15022
|
-
(
|
|
15023
|
-
? errorHelperText
|
|
15024
|
-
: startError
|
|
15025
|
-
? startErrorHelperText
|
|
15026
|
-
: endError
|
|
15027
|
-
? endErrorHelperText
|
|
15028
|
-
: helperText))))));
|
|
15076
|
+
(fromError && fromErrorHelperText) ||
|
|
15077
|
+
(toError && toErrorHelperText)) && (React.createElement(material.FormHelperText, { error: error || fromError || toError, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, error ? errorHelperText : fromError ? fromErrorHelperText : toError ? toErrorHelperText : helperText))))));
|
|
15029
15078
|
});
|
|
15030
15079
|
FormMonthRangePicker.displayName = 'FormMonthRangePicker';
|
|
15031
15080
|
FormMonthRangePicker.defaultProps = FormMonthRangePickerDefaultProps;var FormYearPickerDefaultProps = {
|
|
@@ -15340,7 +15389,7 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
15340
15389
|
//----------------------------------------------------------------------------------------------------------------
|
|
15341
15390
|
initHidden = _a.hidden,
|
|
15342
15391
|
//----------------------------------------------------------------------------------------------------------------
|
|
15343
|
-
name = _a.name,
|
|
15392
|
+
name = _a.name, fromLabel = _a.fromLabel, fromLabelIcon = _a.fromLabelIcon, toLabel = _a.toLabel, toLabelIcon = _a.toLabelIcon, readOnly = _a.readOnly, required = _a.required, initFullWidth = _a.fullWidth, initDisabled = _a.disabled, initError = _a.error, helperText = _a.helperText, initValue = _a.value, initData = _a.data, exceptValue = _a.exceptValue, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
15344
15393
|
// -------------------------------------------------------------------------------------------------------------------
|
|
15345
15394
|
icon = _a.icon, initFormat = _a.format, initLabelShrink = _a.labelShrink, disablePast = _a.disablePast, disableFuture = _a.disableFuture, initMinYear = _a.minYear, initMaxYear = _a.maxYear, inputWidth = _a.inputWidth, readOnlyInput = _a.readOnlyInput, startAdornment = _a.startAdornment, endAdornment = _a.endAdornment, formValueFromNameSuffix = _a.formValueFromNameSuffix, formValueToNameSuffix = _a.formValueToNameSuffix, align = _a.align,
|
|
15346
15395
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -15364,10 +15413,10 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
15364
15413
|
// State -----------------------------------------------------------------------------------------------------------
|
|
15365
15414
|
var _c = useAutoUpdateState$1(initError), error = _c[0], setError = _c[1];
|
|
15366
15415
|
var _d = React.useState(), errorHelperText = _d[0], setErrorHelperText = _d[1];
|
|
15367
|
-
var _e = React.useState(false),
|
|
15368
|
-
var _f = React.useState(),
|
|
15369
|
-
var _g = React.useState(false),
|
|
15370
|
-
var _h = React.useState(),
|
|
15416
|
+
var _e = React.useState(false), fromError = _e[0], setFromError = _e[1];
|
|
15417
|
+
var _f = React.useState(), fromErrorHelperText = _f[0], setFromErrorHelperText = _f[1];
|
|
15418
|
+
var _g = React.useState(false), toError = _g[0], setToError = _g[1];
|
|
15419
|
+
var _h = React.useState(), toErrorHelperText = _h[0], setToErrorHelperText = _h[1];
|
|
15371
15420
|
var _j = useAutoUpdateState$1(initDisabled), disabled = _j[0], setDisabled = _j[1];
|
|
15372
15421
|
var _k = useAutoUpdateState$1(initHidden), hidden = _k[0], setHidden = _k[1];
|
|
15373
15422
|
var _l = useAutoUpdateState$1(initData), data = _l[0], setData = _l[1];
|
|
@@ -15382,7 +15431,7 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
15382
15431
|
return initValue || DEFAULT_VALUE;
|
|
15383
15432
|
}, [initValue])), value = _p[0], setValue = _p[1];
|
|
15384
15433
|
useFirstSkipEffect$1(function () {
|
|
15385
|
-
if (error ||
|
|
15434
|
+
if (error || fromError || toError)
|
|
15386
15435
|
validate(value);
|
|
15387
15436
|
if (onChange)
|
|
15388
15437
|
onChange(value);
|
|
@@ -15436,13 +15485,13 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
15436
15485
|
var _a;
|
|
15437
15486
|
(_a = startInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
15438
15487
|
}, []);
|
|
15439
|
-
var
|
|
15440
|
-
|
|
15441
|
-
|
|
15488
|
+
var setFromErrorErrorHelperText = React.useCallback(function (error, fromErrorHelperText) {
|
|
15489
|
+
setFromError(error);
|
|
15490
|
+
setFromErrorHelperText(fromErrorHelperText);
|
|
15442
15491
|
}, []);
|
|
15443
|
-
var
|
|
15444
|
-
|
|
15445
|
-
|
|
15492
|
+
var setToErrorErrorHelperText = React.useCallback(function (error, toErrorHelperText) {
|
|
15493
|
+
setToError(error);
|
|
15494
|
+
setToErrorHelperText(toErrorHelperText);
|
|
15446
15495
|
}, []);
|
|
15447
15496
|
var setErrorErrorHelperText = React.useCallback(function (error, errorHelperText) {
|
|
15448
15497
|
setError(error);
|
|
@@ -15454,22 +15503,22 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
15454
15503
|
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
15455
15504
|
}
|
|
15456
15505
|
else if (value[0] == null) {
|
|
15457
|
-
|
|
15506
|
+
setFromErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
15458
15507
|
}
|
|
15459
15508
|
else {
|
|
15460
|
-
|
|
15509
|
+
setToErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
15461
15510
|
}
|
|
15462
15511
|
return false;
|
|
15463
15512
|
}
|
|
15464
15513
|
if (startInputDatePickerErrorRef.current) {
|
|
15465
|
-
|
|
15514
|
+
setFromErrorErrorHelperText(true, getDateValidationErrorText(startInputDatePickerErrorRef.current));
|
|
15466
15515
|
if (endInputDatePickerErrorRef.current) {
|
|
15467
|
-
|
|
15516
|
+
setToErrorErrorHelperText(true, getDateValidationErrorText(endInputDatePickerErrorRef.current));
|
|
15468
15517
|
}
|
|
15469
15518
|
return false;
|
|
15470
15519
|
}
|
|
15471
15520
|
if (endInputDatePickerErrorRef.current) {
|
|
15472
|
-
|
|
15521
|
+
setToErrorErrorHelperText(true, getDateValidationErrorText(endInputDatePickerErrorRef.current));
|
|
15473
15522
|
return false;
|
|
15474
15523
|
}
|
|
15475
15524
|
if (onValidate) {
|
|
@@ -15480,10 +15529,10 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
15480
15529
|
}
|
|
15481
15530
|
}
|
|
15482
15531
|
setErrorErrorHelperText(false, undefined);
|
|
15483
|
-
|
|
15484
|
-
|
|
15532
|
+
setFromErrorErrorHelperText(false, undefined);
|
|
15533
|
+
setToErrorErrorHelperText(false, undefined);
|
|
15485
15534
|
return true;
|
|
15486
|
-
}, [onValidate, required,
|
|
15535
|
+
}, [onValidate, required, setToErrorErrorHelperText, setErrorErrorHelperText, setFromErrorErrorHelperText]);
|
|
15487
15536
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
15488
15537
|
React.useLayoutEffect(function () {
|
|
15489
15538
|
var lastValue = value;
|
|
@@ -15616,7 +15665,7 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
15616
15665
|
newValue[1] = newValue[0];
|
|
15617
15666
|
}
|
|
15618
15667
|
}
|
|
15619
|
-
if (
|
|
15668
|
+
if (fromError) {
|
|
15620
15669
|
validate(newValue);
|
|
15621
15670
|
}
|
|
15622
15671
|
nextTick(function () {
|
|
@@ -15633,7 +15682,7 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
15633
15682
|
newValue[0] = newValue[1];
|
|
15634
15683
|
}
|
|
15635
15684
|
}
|
|
15636
|
-
if (
|
|
15685
|
+
if (toError) {
|
|
15637
15686
|
validate(newValue);
|
|
15638
15687
|
}
|
|
15639
15688
|
nextTick(function () {
|
|
@@ -15643,7 +15692,7 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
15643
15692
|
});
|
|
15644
15693
|
}
|
|
15645
15694
|
}
|
|
15646
|
-
}, [dateToValue,
|
|
15695
|
+
}, [dateToValue, toError, maxYear, minYear, name, onValueChangeByUser, setValue, fromError, validate]);
|
|
15647
15696
|
var handleInputDatePickerFocus = React.useCallback(function (selectType) {
|
|
15648
15697
|
var _a;
|
|
15649
15698
|
if (readOnly || disabled)
|
|
@@ -15694,21 +15743,15 @@ var FormYearRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
15694
15743
|
React.createElement(PrivateYearRangePicker, { selectType: selectType, minYear: minYear, maxYear: maxYear, disablePast: disablePast, disableFuture: disableFuture, value: value, onChange: handleContainerChange })) },
|
|
15695
15744
|
React.createElement(material.Grid, { container: true, alignItems: 'center' },
|
|
15696
15745
|
React.createElement(material.Grid, { item: true, flex: 1 },
|
|
15697
|
-
React.createElement(PrivateInputDatePicker, __assign$7({}, inputDatePickerProps, { style: inputStyle, sx: sx, value: valueDate[0], label:
|
|
15746
|
+
React.createElement(PrivateInputDatePicker, __assign$7({}, inputDatePickerProps, { style: inputStyle, sx: sx, value: valueDate[0], label: fromLabel, labelIcon: fromLabelIcon, error: error || fromError, focused: focused || (open && selectType === 'start'), required: required, readOnly: readOnly, readOnlyInput: readOnlyInput, icon: icon, startAdornment: startAdornment, endAdornment: endAdornment, inputRef: startInputRef, onChange: function (v) { return handleInputDatePickerChange('start', v); }, onFocus: function () { return handleInputDatePickerFocus('start'); }, onError: function (reason) { return (startInputDatePickerErrorRef.current = reason); }, shouldDisableYear: handleInputDatePickerShouldDisableYear }))),
|
|
15698
15747
|
React.createElement(material.Grid, { item: true, sx: { px: 1 } }, "~"),
|
|
15699
15748
|
React.createElement(material.Grid, { item: true, flex: 1 },
|
|
15700
|
-
React.createElement(PrivateInputDatePicker, __assign$7({}, inputDatePickerProps, { style: inputStyle, sx: sx, value: valueDate[1], label:
|
|
15749
|
+
React.createElement(PrivateInputDatePicker, __assign$7({}, inputDatePickerProps, { style: inputStyle, sx: sx, value: valueDate[1], label: toLabel, labelIcon: toLabelIcon, error: error || toError, focused: focused || (open && selectType === 'end'), required: required, readOnly: readOnly, readOnlyInput: readOnlyInput, icon: icon, startAdornment: startAdornment, endAdornment: endAdornment, inputRef: endInputRef, onChange: function (v) { return handleInputDatePickerChange('end', v); }, onFocus: function () { return handleInputDatePickerFocus('end'); }, onError: function (reason) { return (endInputDatePickerErrorRef.current = reason); }, shouldDisableYear: handleInputDatePickerShouldDisableYear }))))),
|
|
15701
15750
|
!formColWithHelperText &&
|
|
15702
15751
|
(helperText ||
|
|
15703
15752
|
(error && errorHelperText) ||
|
|
15704
|
-
(
|
|
15705
|
-
(
|
|
15706
|
-
? errorHelperText
|
|
15707
|
-
: startError
|
|
15708
|
-
? startErrorHelperText
|
|
15709
|
-
: endError
|
|
15710
|
-
? endErrorHelperText
|
|
15711
|
-
: helperText))))));
|
|
15753
|
+
(fromError && fromErrorHelperText) ||
|
|
15754
|
+
(toError && toErrorHelperText)) && (React.createElement(material.FormHelperText, { error: error || fromError || toError, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, error ? errorHelperText : fromError ? fromErrorHelperText : toError ? toErrorHelperText : helperText))))));
|
|
15712
15755
|
});
|
|
15713
15756
|
FormYearRangePicker.displayName = 'FormYearRangePicker';
|
|
15714
15757
|
FormYearRangePicker.defaultProps = FormYearRangePickerDefaultProps;var SearchDefaultProps = {
|