@pdg/react-form 1.0.65 → 1.0.67
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/index.esm.js +265 -238
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +265 -238
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2207,7 +2207,7 @@ styleInject(css_248z$l);var FormTextField = React__default.forwardRef(function (
|
|
|
2207
2207
|
var _b;
|
|
2208
2208
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
2209
2209
|
//----------------------------------------------------------------------------------------------------------------
|
|
2210
|
-
name = _a.name, required = _a.required, initValue = _a.value, initData = _a.data, icon = _a.icon, labelIcon = _a.labelIcon, initLabel = _a.label, initError = _a.error,
|
|
2210
|
+
name = _a.name, required = _a.required, initValue = _a.value, initData = _a.data, icon = _a.icon, labelIcon = _a.labelIcon, initLabel = _a.label, initError = _a.error, helperText = _a.helperText, exceptValue = _a.exceptValue, readOnly = _a.readOnly, tabIndex = _a.tabIndex, initDisabled = _a.disabled, placeholder = _a.placeholder, maxLength = _a.maxLength, clear = _a.clear, width = _a.width, initMuiInputProps = _a.InputProps, initMuiInputLabelProps = _a.InputLabelProps, initInputProps = _a.inputProps, initInputRef = _a.inputRef, select = _a.select, SelectProps = _a.SelectProps, multiline = _a.multiline, validPattern = _a.validPattern, invalidPattern = _a.invalidPattern, startAdornment = _a.startAdornment, endAdornment = _a.endAdornment, noFormValueItem = _a.noFormValueItem, hidden = _a.hidden, disableReturnKey = _a.disableReturnKey,
|
|
2211
2211
|
//----------------------------------------------------------------------------------------------------------------
|
|
2212
2212
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate, onBlur = _a.onBlur, onKeyDown = _a.onKeyDown,
|
|
2213
2213
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -2228,7 +2228,7 @@ styleInject(css_248z$l);var FormTextField = React__default.forwardRef(function (
|
|
|
2228
2228
|
var fullWidth = useMemo(function () { return (initFullWidth == null ? formFullWidth : initFullWidth); }, [initFullWidth, formFullWidth]);
|
|
2229
2229
|
// State -----------------------------------------------------------------------------------------------------------
|
|
2230
2230
|
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
2231
|
-
var _e =
|
|
2231
|
+
var _e = useState(), errorHelperText = _e[0], setErrorHelperText = _e[1];
|
|
2232
2232
|
var _f = useState(false), showClear = _f[0], setShowClear = _f[1];
|
|
2233
2233
|
var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
|
|
2234
2234
|
var _h = useAutoUpdateState$1(initData), data = _h[0], setData = _h[1];
|
|
@@ -2304,39 +2304,39 @@ styleInject(css_248z$l);var FormTextField = React__default.forwardRef(function (
|
|
|
2304
2304
|
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
2305
2305
|
}
|
|
2306
2306
|
}, [initInputRef, inputRef]);
|
|
2307
|
-
// Function -
|
|
2308
|
-
var
|
|
2307
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
2308
|
+
var setErrorErrorHelperText = useCallback(function (error, errorHelperText) {
|
|
2309
2309
|
setError(error);
|
|
2310
|
-
|
|
2311
|
-
}, [setError
|
|
2310
|
+
setErrorHelperText(errorHelperText);
|
|
2311
|
+
}, [setError]);
|
|
2312
2312
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
2313
2313
|
var validate = useCallback(function (value) {
|
|
2314
2314
|
if (required && empty(value)) {
|
|
2315
|
-
|
|
2315
|
+
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
2316
2316
|
return false;
|
|
2317
2317
|
}
|
|
2318
2318
|
if (notEmpty(value) && validPattern) {
|
|
2319
2319
|
if (!new RegExp(validPattern).test(value)) {
|
|
2320
|
-
|
|
2320
|
+
setErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
2321
2321
|
return false;
|
|
2322
2322
|
}
|
|
2323
2323
|
}
|
|
2324
2324
|
if (notEmpty(value) && invalidPattern) {
|
|
2325
2325
|
if (new RegExp(invalidPattern).test(value)) {
|
|
2326
|
-
|
|
2326
|
+
setErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
2327
2327
|
return false;
|
|
2328
2328
|
}
|
|
2329
2329
|
}
|
|
2330
2330
|
if (onValidate) {
|
|
2331
2331
|
var validateResult = onValidate(value);
|
|
2332
2332
|
if (validateResult != null && validateResult !== true) {
|
|
2333
|
-
|
|
2333
|
+
setErrorErrorHelperText(true, validateResult);
|
|
2334
2334
|
return false;
|
|
2335
2335
|
}
|
|
2336
2336
|
}
|
|
2337
|
-
|
|
2337
|
+
setErrorErrorHelperText(false, undefined);
|
|
2338
2338
|
return true;
|
|
2339
|
-
}, [required, validPattern, invalidPattern, onValidate,
|
|
2339
|
+
}, [required, validPattern, invalidPattern, onValidate, setErrorErrorHelperText]);
|
|
2340
2340
|
// Memo - muiInputProps --------------------------------------------------------------------------------------------
|
|
2341
2341
|
var muiInputProps = useMemo(function () {
|
|
2342
2342
|
var muiInputProps = __assign$7({}, initMuiInputProps);
|
|
@@ -2426,7 +2426,7 @@ styleInject(css_248z$l);var FormTextField = React__default.forwardRef(function (
|
|
|
2426
2426
|
focusValidate: focus,
|
|
2427
2427
|
validate: function () { return validate(lastValue_1); },
|
|
2428
2428
|
setError: function (error, errorText) {
|
|
2429
|
-
return
|
|
2429
|
+
return setErrorErrorHelperText(error, error ? errorText : undefined);
|
|
2430
2430
|
},
|
|
2431
2431
|
};
|
|
2432
2432
|
if (ref) {
|
|
@@ -2469,8 +2469,7 @@ styleInject(css_248z$l);var FormTextField = React__default.forwardRef(function (
|
|
|
2469
2469
|
id,
|
|
2470
2470
|
setValue,
|
|
2471
2471
|
setDisabled,
|
|
2472
|
-
|
|
2473
|
-
initHelperText,
|
|
2472
|
+
setErrorErrorHelperText,
|
|
2474
2473
|
setData,
|
|
2475
2474
|
]);
|
|
2476
2475
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
@@ -2505,7 +2504,7 @@ styleInject(css_248z$l);var FormTextField = React__default.forwardRef(function (
|
|
|
2505
2504
|
onKeyDown(e);
|
|
2506
2505
|
}, [select, multiline, disableReturnKey, noFormValueItem, onKeyDown, onRequestSearchSubmit, name, value]);
|
|
2507
2506
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
2508
|
-
return (React__default.createElement(TextField, __assign$7({}, props, { variant: variant, size: size, color: color, focused: focused || undefined, name: name, label: label, placeholder: placeholder, className: classNames$1(className, 'FormValueItem', 'FormTextField', "variant-".concat(variant)), inputRef: initInputRef ? initInputRef : inputRef, value: value, required: required, fullWidth: !width && fullWidth, error: error, helperText: formColWithHelperText ? undefined : helperText, FormHelperTextProps: { component: 'div' }, disabled: disabled, InputProps: muiInputProps, InputLabelProps: muiInputLabelProps, inputProps: ((_b = initInputProps === null || initInputProps === void 0 ? void 0 : initInputProps.className) === null || _b === void 0 ? void 0 : _b.includes('FormTag-Input')) ? initInputProps : inputProps, style: style, select: select, SelectProps: SelectProps, multiline: multiline, onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown })));
|
|
2507
|
+
return (React__default.createElement(TextField, __assign$7({}, props, { variant: variant, size: size, color: color, focused: focused || undefined, name: name, label: label, placeholder: placeholder, className: classNames$1(className, 'FormValueItem', 'FormTextField', "variant-".concat(variant)), inputRef: initInputRef ? initInputRef : inputRef, value: value, required: required, fullWidth: !width && fullWidth, error: error, helperText: formColWithHelperText ? undefined : error ? errorHelperText : helperText, FormHelperTextProps: { component: 'div' }, disabled: disabled, InputProps: muiInputProps, InputLabelProps: muiInputLabelProps, inputProps: ((_b = initInputProps === null || initInputProps === void 0 ? void 0 : initInputProps.className) === null || _b === void 0 ? void 0 : _b.includes('FormTag-Input')) ? initInputProps : inputProps, style: style, select: select, SelectProps: SelectProps, multiline: multiline, onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown })));
|
|
2509
2508
|
});
|
|
2510
2509
|
FormTextField.displayName = 'FormText';
|
|
2511
2510
|
FormTextField.defaultProps = FormTextFieldDefaultProps;var FormHiddenDefaultProps = __assign$7({}, FormTextFieldDefaultProps);var css_248z$k = ".FormHidden {\n display: none !important;\n}";
|
|
@@ -2522,7 +2521,7 @@ FormText.displayName = 'FormText';
|
|
|
2522
2521
|
FormText.defaultProps = FormTextDefaultProps;var css_248z$j = ".FormTag.FormTextField {\n min-width: 200px;\n}";
|
|
2523
2522
|
styleInject(css_248z$j);var FormTag = React__default.forwardRef(function (_a, ref) {
|
|
2524
2523
|
// FormState -------------------------------------------------------------------------------------------------------
|
|
2525
|
-
var className = _a.className, name = _a.name, initValue = _a.value, exceptValue = _a.exceptValue, required = _a.required, readOnly = _a.readOnly, maxLength = _a.maxLength, disabled = _a.disabled, initFullWidth = _a.fullWidth, initError = _a.error,
|
|
2524
|
+
var className = _a.className, name = _a.name, initValue = _a.value, exceptValue = _a.exceptValue, required = _a.required, readOnly = _a.readOnly, maxLength = _a.maxLength, disabled = _a.disabled, initFullWidth = _a.fullWidth, initError = _a.error, helperText = _a.helperText, formValueSeparator = _a.formValueSeparator, formValueSort = _a.formValueSort, onValidate = _a.onValidate, onKeyDown = _a.onKeyDown, onChange = _a.onChange, onValue = _a.onValue, onBlur = _a.onBlur, props = __rest$4(_a, ["className", "name", "value", "exceptValue", "required", "readOnly", "maxLength", "disabled", "fullWidth", "error", "helperText", "formValueSeparator", "formValueSort", "onValidate", "onKeyDown", "onChange", "onValue", "onBlur"]);
|
|
2526
2525
|
var _b = useFormState(), formFullWidth = _b.fullWidth, onAddValueItem = _b.onAddValueItem, onValueChange = _b.onValueChange, onValueChangeByUser = _b.onValueChangeByUser, onRequestSearchSubmit = _b.onRequestSearchSubmit, otherFormState = __rest$4(_b, ["fullWidth", "onAddValueItem", "onValueChange", "onValueChangeByUser", "onRequestSearchSubmit"]);
|
|
2527
2526
|
// State - FormState -----------------------------------------------------------------------------------------------
|
|
2528
2527
|
var fullWidth = useAutoUpdateState$1(initFullWidth == null ? formFullWidth : initFullWidth)[0];
|
|
@@ -2554,7 +2553,7 @@ styleInject(css_248z$j);var FormTag = React__default.forwardRef(function (_a, re
|
|
|
2554
2553
|
//------------------------------------------------------------------------------------------------------------------
|
|
2555
2554
|
var _e = useState(''), inputValue = _e[0], setInputValue = _e[1];
|
|
2556
2555
|
var _f = useAutoUpdateState$1(initError), error = _f[0], setError = _f[1];
|
|
2557
|
-
var _g =
|
|
2556
|
+
var _g = useState(), errorHelperText = _g[0], setErrorHelperText = _g[1];
|
|
2558
2557
|
// Effect ----------------------------------------------------------------------------------------------------------
|
|
2559
2558
|
useEffect(function () {
|
|
2560
2559
|
if (!isSame$2(value, initValue)) {
|
|
@@ -2564,27 +2563,27 @@ styleInject(css_248z$j);var FormTag = React__default.forwardRef(function (_a, re
|
|
|
2564
2563
|
}
|
|
2565
2564
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2566
2565
|
}, []);
|
|
2567
|
-
// Function -
|
|
2568
|
-
var
|
|
2566
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
2567
|
+
var setErrorErrorHelperText = useCallback(function (error, errorHelperText) {
|
|
2569
2568
|
setError(error);
|
|
2570
|
-
|
|
2571
|
-
}, [setError
|
|
2569
|
+
setErrorHelperText(errorHelperText);
|
|
2570
|
+
}, [setError]);
|
|
2572
2571
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
2573
2572
|
var validate = useCallback(function (value) {
|
|
2574
2573
|
if (required && empty(value)) {
|
|
2575
|
-
|
|
2574
|
+
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
2576
2575
|
return false;
|
|
2577
2576
|
}
|
|
2578
2577
|
if (onValidate) {
|
|
2579
2578
|
var onValidateResult = onValidate(value);
|
|
2580
2579
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
2581
|
-
|
|
2580
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
2582
2581
|
return false;
|
|
2583
2582
|
}
|
|
2584
2583
|
}
|
|
2585
|
-
|
|
2584
|
+
setErrorErrorHelperText(false, undefined);
|
|
2586
2585
|
return true;
|
|
2587
|
-
}, [required, onValidate,
|
|
2586
|
+
}, [required, onValidate, setErrorErrorHelperText]);
|
|
2588
2587
|
// Function - getExtraCommands -------------------------------------------------------------------------------------
|
|
2589
2588
|
var getExtraCommands = useCallback(function () {
|
|
2590
2589
|
return {
|
|
@@ -2704,7 +2703,7 @@ styleInject(css_248z$j);var FormTag = React__default.forwardRef(function (_a, re
|
|
|
2704
2703
|
if (readOnly) {
|
|
2705
2704
|
renderProps.inputProps.className = classNames$1(renderProps.inputProps.className, 'Mui-disabled');
|
|
2706
2705
|
}
|
|
2707
|
-
return (React__default.createElement(FormText, __assign$7({}, renderProps, { ref: handleRef, name: name, className: classNames$1(className, 'FormValueItem', 'FormTag'), error: error, disabled: disabled, fullWidth: fullWidth, required: required, value: inputValue, exceptValue: exceptValue, helperText: helperText, onKeyDown: handleInputKeyDown, onChange: handleInputChange, onBlur: handleBlur })));
|
|
2706
|
+
return (React__default.createElement(FormText, __assign$7({}, renderProps, { ref: handleRef, name: name, className: classNames$1(className, 'FormValueItem', 'FormTag'), error: error, disabled: disabled, fullWidth: fullWidth, required: required, value: inputValue, exceptValue: exceptValue, helperText: error ? errorHelperText : helperText, onKeyDown: handleInputKeyDown, onChange: handleInputChange, onBlur: handleBlur })));
|
|
2708
2707
|
} })));
|
|
2709
2708
|
});
|
|
2710
2709
|
FormTag.displayName = 'FormTag';
|
|
@@ -4012,7 +4011,7 @@ function NumericFormat(props) {
|
|
|
4012
4011
|
});
|
|
4013
4012
|
NumberFormatCustom.displayName = 'NumberFormatCustom';var FormNumberDefaultProps = __assign$7(__assign$7({}, FormTextFieldDefaultProps), { clear: true });var FormNumber = React__default.forwardRef(function (_a, ref) {
|
|
4014
4013
|
// State -------------------------------------------------------------------------------------------------------------
|
|
4015
|
-
var className = _a.className, allowNegative = _a.allowNegative, thousandSeparator = _a.thousandSeparator, allowDecimal = _a.allowDecimal, decimalScale = _a.decimalScale, prefix = _a.prefix, suffix = _a.suffix, readOnly = _a.readOnly, tabIndex = _a.tabIndex, initMuiInputProps = _a.InputProps, initInputProps = _a.inputProps, initValue = _a.value, onChange = _a.onChange, props = __rest$4(_a, ["className", "allowNegative", "thousandSeparator", "allowDecimal", "decimalScale", "prefix", "suffix", "readOnly", "tabIndex", "InputProps", "inputProps", "value", "onChange"]);
|
|
4014
|
+
var className = _a.className, allowNegative = _a.allowNegative, thousandSeparator = _a.thousandSeparator, allowDecimal = _a.allowDecimal, decimalScale = _a.decimalScale, prefix = _a.prefix, suffix = _a.suffix, readOnly = _a.readOnly, tabIndex = _a.tabIndex, initMuiInputProps = _a.InputProps, initInputProps = _a.inputProps, initValue = _a.value, onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate, props = __rest$4(_a, ["className", "allowNegative", "thousandSeparator", "allowDecimal", "decimalScale", "prefix", "suffix", "readOnly", "tabIndex", "InputProps", "inputProps", "value", "onChange", "onValue", "onValidate"]);
|
|
4016
4015
|
var _b = useState(function () { return (empty(initValue) ? '' : "".concat(initValue)); }), strValue = _b[0], setStrValue = _b[1];
|
|
4017
4016
|
// Effect ------------------------------------------------------------------------------------------------------------
|
|
4018
4017
|
useEffect(function () {
|
|
@@ -4056,8 +4055,24 @@ NumberFormatCustom.displayName = 'NumberFormatCustom';var FormNumberDefaultProps
|
|
|
4056
4055
|
onChange && onChange(newValue);
|
|
4057
4056
|
setStrValue(value);
|
|
4058
4057
|
}, [onChange]);
|
|
4058
|
+
var handleValue = useCallback(function (value) {
|
|
4059
|
+
var finalValue = empty(value) || value === '-' || value === '.' ? undefined : Number(value);
|
|
4060
|
+
if (onValue) {
|
|
4061
|
+
finalValue = onValue(finalValue);
|
|
4062
|
+
}
|
|
4063
|
+
return finalValue !== undefined ? finalValue.toString() : undefined;
|
|
4064
|
+
}, [onValue]);
|
|
4065
|
+
var handleValidate = useCallback(function (value) {
|
|
4066
|
+
if (onValidate) {
|
|
4067
|
+
var finalValue = empty(value) || value === '-' || value === '.' ? undefined : Number(value);
|
|
4068
|
+
return onValidate(finalValue);
|
|
4069
|
+
}
|
|
4070
|
+
else {
|
|
4071
|
+
return true;
|
|
4072
|
+
}
|
|
4073
|
+
}, [onValidate]);
|
|
4059
4074
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
4060
|
-
return (React__default.createElement(FormTextField, __assign$7({ ref: ref, className: classNames$1(className, 'FormNumber'), disableReturnKey: true, InputProps: muiInputProps, readOnly: readOnly, value: strValue, onChange: handleChange }, props)));
|
|
4075
|
+
return (React__default.createElement(FormTextField, __assign$7({ ref: ref, className: classNames$1(className, 'FormNumber'), disableReturnKey: true, InputProps: muiInputProps, readOnly: readOnly, value: strValue, onChange: handleChange, onValue: handleValue, onValidate: handleValidate }, props)));
|
|
4061
4076
|
});
|
|
4062
4077
|
FormNumber.displayName = 'FormNumber';
|
|
4063
4078
|
FormNumber.defaultProps = FormNumberDefaultProps;var FormSearchDefaultProps = __assign$7({}, FormTextDefaultProps);var css_248z$h = ".FormSearch input[type=search]::-webkit-search-decoration,\n.FormSearch input[type=search]::-webkit-search-cancel-button,\n.FormSearch input[type=search]::-webkit-search-results-button,\n.FormSearch input[type=search]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n}";
|
|
@@ -4359,32 +4374,37 @@ function autoDash$1(companyNo) {
|
|
|
4359
4374
|
return onValue ? onValue(newValue) : newValue;
|
|
4360
4375
|
}, [onValue]);
|
|
4361
4376
|
var handleValidate = useCallback(function (value) {
|
|
4362
|
-
if (notEmpty(value)
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
sum
|
|
4380
|
-
|
|
4381
|
-
|
|
4377
|
+
if (notEmpty(value)) {
|
|
4378
|
+
if (value.length === 14 && value.includes('-')) {
|
|
4379
|
+
var jumin = value
|
|
4380
|
+
.replace(/-/g, '')
|
|
4381
|
+
.split('')
|
|
4382
|
+
.map(function (v) { return Number(v); });
|
|
4383
|
+
var ckarr = [2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5];
|
|
4384
|
+
for (var i = 0; i < jumin.length - 1; i += 1) {
|
|
4385
|
+
jumin[i] = jumin[i] * ckarr[i];
|
|
4386
|
+
}
|
|
4387
|
+
var juminlast = jumin[jumin.length - 1];
|
|
4388
|
+
var sum = 0;
|
|
4389
|
+
for (var i = 0; i < jumin.length - 1; i += 1) {
|
|
4390
|
+
sum += jumin[i];
|
|
4391
|
+
}
|
|
4392
|
+
sum = sum % 11;
|
|
4393
|
+
sum = 11 - sum;
|
|
4394
|
+
if (sum > 9) {
|
|
4395
|
+
sum = sum % 10;
|
|
4396
|
+
}
|
|
4397
|
+
if (sum != juminlast && juminlast != undefined) {
|
|
4398
|
+
return '유효하지 않은 값입니다.';
|
|
4399
|
+
}
|
|
4400
|
+
return onValidate ? onValidate(value) : true;
|
|
4401
|
+
}
|
|
4402
|
+
else {
|
|
4382
4403
|
return '유효하지 않은 값입니다.';
|
|
4383
4404
|
}
|
|
4384
|
-
return onValidate ? onValidate(value) : true;
|
|
4385
4405
|
}
|
|
4386
4406
|
else {
|
|
4387
|
-
return
|
|
4407
|
+
return onValidate ? onValidate(value) : true;
|
|
4388
4408
|
}
|
|
4389
4409
|
}, [onValidate]);
|
|
4390
4410
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
@@ -4527,7 +4547,7 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4527
4547
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
4528
4548
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth,
|
|
4529
4549
|
//----------------------------------------------------------------------------------------------------------------
|
|
4530
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initChecked = _a.checked, initInputRef = _a.inputRef, initAction = _a.action, readOnly = _a.readOnly, initDisabled = _a.disabled, text = _a.text, initError = _a.error,
|
|
4550
|
+
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initChecked = _a.checked, initInputRef = _a.inputRef, initAction = _a.action, readOnly = _a.readOnly, initDisabled = _a.disabled, text = _a.text, initError = _a.error, helperText = _a.helperText, initValue = _a.value, initData = _a.data, initUncheckedValue = _a.uncheckedValue, exceptValue = _a.exceptValue, hidden = _a.hidden, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
4531
4551
|
//----------------------------------------------------------------------------------------------------------------
|
|
4532
4552
|
className = _a.className, initStyle = _a.style, sx = _a.sx, props = __rest$4(_a, ["variant", "size", "color", "focused", "fullWidth", "name", "labelIcon", "label", "checked", "inputRef", "action", "readOnly", "disabled", "text", "error", "helperText", "value", "data", "uncheckedValue", "exceptValue", "hidden", "onChange", "onValidate", "className", "style", "sx"]);
|
|
4533
4553
|
var id = useId();
|
|
@@ -4555,7 +4575,7 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4555
4575
|
var _d = useAutoUpdateState$1(initValue), value = _d[0], setValue = _d[1];
|
|
4556
4576
|
var _e = useAutoUpdateState$1(initUncheckedValue), uncheckedValue = _e[0], setUncheckedValue = _e[1];
|
|
4557
4577
|
var _f = useAutoUpdateState$1(initError), error = _f[0], setError = _f[1];
|
|
4558
|
-
var _g =
|
|
4578
|
+
var _g = useState(), errorHelperText = _g[0], setErrorHelperText = _g[1];
|
|
4559
4579
|
var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
|
|
4560
4580
|
var _j = useAutoUpdateState$1(initData), data = _j[0], setData = _j[1];
|
|
4561
4581
|
// State - checked -------------------------------------------------------------------------------------------------
|
|
@@ -4585,23 +4605,23 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4585
4605
|
(_d = actionRef.current) === null || _d === void 0 ? void 0 : _d.focusVisible();
|
|
4586
4606
|
}
|
|
4587
4607
|
}, [initInputRef, inputRef, initAction, actionRef]);
|
|
4588
|
-
// Function -
|
|
4589
|
-
var
|
|
4608
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
4609
|
+
var setErrorErrorHelperText = useCallback(function (error, errorHelperText) {
|
|
4590
4610
|
setError(error);
|
|
4591
|
-
|
|
4592
|
-
}, [setError
|
|
4611
|
+
setErrorHelperText(errorHelperText);
|
|
4612
|
+
}, [setError]);
|
|
4593
4613
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
4594
4614
|
var validate = useCallback(function (checked) {
|
|
4595
4615
|
if (onValidate) {
|
|
4596
4616
|
var onValidateResult = onValidate(checked);
|
|
4597
4617
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
4598
|
-
|
|
4618
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
4599
4619
|
return false;
|
|
4600
4620
|
}
|
|
4601
4621
|
}
|
|
4602
|
-
|
|
4622
|
+
setErrorErrorHelperText(false, undefined);
|
|
4603
4623
|
return true;
|
|
4604
|
-
}, [onValidate,
|
|
4624
|
+
}, [onValidate, setErrorErrorHelperText]);
|
|
4605
4625
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
4606
4626
|
useLayoutEffect(function () {
|
|
4607
4627
|
var lastChecked = checked;
|
|
@@ -4646,8 +4666,8 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4646
4666
|
focus: focus,
|
|
4647
4667
|
focusValidate: focus,
|
|
4648
4668
|
validate: function () { return validate(checked); },
|
|
4649
|
-
setError: function (error,
|
|
4650
|
-
return
|
|
4669
|
+
setError: function (error, errorHelperText) {
|
|
4670
|
+
return setErrorErrorHelperText(error, error ? errorHelperText : undefined);
|
|
4651
4671
|
},
|
|
4652
4672
|
};
|
|
4653
4673
|
onAddValueItem(id, commands);
|
|
@@ -4683,13 +4703,12 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4683
4703
|
exceptValue,
|
|
4684
4704
|
disabled,
|
|
4685
4705
|
validate,
|
|
4686
|
-
initHelperText,
|
|
4687
4706
|
id,
|
|
4688
4707
|
setChecked,
|
|
4689
4708
|
setValue,
|
|
4690
4709
|
setUncheckedValue,
|
|
4691
4710
|
setDisabled,
|
|
4692
|
-
|
|
4711
|
+
setErrorErrorHelperText,
|
|
4693
4712
|
data,
|
|
4694
4713
|
setData,
|
|
4695
4714
|
]);
|
|
@@ -4707,7 +4726,7 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React__default.forw
|
|
|
4707
4726
|
}
|
|
4708
4727
|
}, [readOnly, setChecked, onValueChangeByUser, name, onRequestSearchSubmit]);
|
|
4709
4728
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
4710
|
-
return (React__default.createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormCheckbox'), labelIcon: labelIcon, label: label, error: error, fullWidth: fullWidth, helperText: helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, hidden: hidden, autoSize: true, controlHeight: height || (size === 'small' ? 35 : 39), controlVerticalCenter: true, control: React__default.createElement(FormControlLabel, { ref: labelRef, control: React__default.createElement(Checkbox, __assign$7({ name: name, color: color, size: size, inputRef: initInputRef ? initInputRef : inputRef, action: initAction ? initAction : actionRef, checked: checked, checkedIcon: React__default.createElement(CheckBox, { color: error ? 'error' : undefined }), icon: React__default.createElement(CheckBoxOutlineBlank, { color: error ? 'error' : undefined }), onChange: handleChange, disabled: disabled || readOnly }, props)), label: React__default.createElement(Typography, { color: error ? 'error' : readOnly || disabled ? theme.palette.text.disabled : undefined, whiteSpace: 'nowrap' }, text) }) }));
|
|
4729
|
+
return (React__default.createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormCheckbox'), labelIcon: labelIcon, label: label, error: error, fullWidth: fullWidth, helperText: error ? errorHelperText : helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, hidden: hidden, autoSize: true, controlHeight: height || (size === 'small' ? 35 : 39), controlVerticalCenter: true, control: React__default.createElement(FormControlLabel, { ref: labelRef, control: React__default.createElement(Checkbox, __assign$7({ name: name, color: color, size: size, inputRef: initInputRef ? initInputRef : inputRef, action: initAction ? initAction : actionRef, checked: checked, checkedIcon: React__default.createElement(CheckBox, { color: error ? 'error' : undefined }), icon: React__default.createElement(CheckBoxOutlineBlank, { color: error ? 'error' : undefined }), onChange: handleChange, disabled: disabled || readOnly }, props)), label: React__default.createElement(Typography, { color: error ? 'error' : readOnly || disabled ? theme.palette.text.disabled : undefined, whiteSpace: 'nowrap' }, text) }) }));
|
|
4711
4730
|
});
|
|
4712
4731
|
FormCheckbox.displayName = 'FormCheckbox';
|
|
4713
4732
|
FormCheckbox.defaultProps = FormCheckboxDefaultProps;var FormRadioGroupDefaultProps = {
|
|
@@ -4717,7 +4736,7 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
4717
4736
|
// type ------------------------------------------------------------------------------------------------------------
|
|
4718
4737
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth, hidden = _a.hidden,
|
|
4719
4738
|
//----------------------------------------------------------------------------------------------------------------
|
|
4720
|
-
name = _a.name, initWidth = _a.width, labelIcon = _a.labelIcon, label = _a.label, inline = _a.inline, initLoading = _a.loading, nowrap = _a.nowrap, initItems = _a.items, initValue = _a.value, initData = _a.data, initError = _a.error,
|
|
4739
|
+
name = _a.name, initWidth = _a.width, labelIcon = _a.labelIcon, label = _a.label, inline = _a.inline, initLoading = _a.loading, nowrap = _a.nowrap, initItems = _a.items, initValue = _a.value, initData = _a.data, initError = _a.error, helperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, exceptValue = _a.exceptValue, onLoadItems = _a.onLoadItems, onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate,
|
|
4721
4740
|
//----------------------------------------------------------------------------------------------------------------
|
|
4722
4741
|
className = _a.className, initStyle = _a.style, sx = _a.sx,
|
|
4723
4742
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -4741,7 +4760,7 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
4741
4760
|
// State -----------------------------------------------------------------------------------------------------------
|
|
4742
4761
|
var _d = useAutoUpdateState$1(initItems), items = _d[0], setItems = _d[1];
|
|
4743
4762
|
var _e = useAutoUpdateState$1(initError), error = _e[0], setError = _e[1];
|
|
4744
|
-
var _f =
|
|
4763
|
+
var _f = useState(), errorHelperText = _f[0], setErrorHelperText = _f[1];
|
|
4745
4764
|
var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
|
|
4746
4765
|
var _h = useState(false), isOnGetItemLoading = _h[0], setIsOnGetItemLoading = _h[1];
|
|
4747
4766
|
var _j = useAutoUpdateState$1(initLoading), loading = _j[0], setLoading = _j[1];
|
|
@@ -4846,27 +4865,27 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
4846
4865
|
var _a;
|
|
4847
4866
|
(_a = firstInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4848
4867
|
}, []);
|
|
4849
|
-
// Function -
|
|
4850
|
-
var
|
|
4868
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
4869
|
+
var setErrorErrorHelperText = useCallback(function (error, errorHelperText) {
|
|
4851
4870
|
setError(error);
|
|
4852
|
-
|
|
4853
|
-
}, [setError
|
|
4871
|
+
setErrorHelperText(errorHelperText);
|
|
4872
|
+
}, [setError]);
|
|
4854
4873
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
4855
4874
|
var validate = useCallback(function (value) {
|
|
4856
4875
|
if (required && empty(value)) {
|
|
4857
|
-
|
|
4876
|
+
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
4858
4877
|
return false;
|
|
4859
4878
|
}
|
|
4860
4879
|
if (onValidate) {
|
|
4861
4880
|
var onValidateResult = onValidate(value);
|
|
4862
4881
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
4863
|
-
|
|
4882
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
4864
4883
|
return false;
|
|
4865
4884
|
}
|
|
4866
4885
|
}
|
|
4867
|
-
|
|
4886
|
+
setErrorErrorHelperText(false, undefined);
|
|
4868
4887
|
return true;
|
|
4869
|
-
}, [required, onValidate,
|
|
4888
|
+
}, [required, onValidate, setErrorErrorHelperText]);
|
|
4870
4889
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
4871
4890
|
useLayoutEffect(function () {
|
|
4872
4891
|
var lastValue = value;
|
|
@@ -4901,8 +4920,8 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
4901
4920
|
focus: focus,
|
|
4902
4921
|
focusValidate: focus,
|
|
4903
4922
|
validate: function () { return validate(value); },
|
|
4904
|
-
setError: function (error,
|
|
4905
|
-
return
|
|
4923
|
+
setError: function (error, errorHelperText) {
|
|
4924
|
+
return setErrorErrorHelperText(error, error ? errorHelperText : undefined);
|
|
4906
4925
|
},
|
|
4907
4926
|
getItems: function () { return lastItems; },
|
|
4908
4927
|
setItems: function (items) {
|
|
@@ -4952,8 +4971,7 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
4952
4971
|
id,
|
|
4953
4972
|
setValue,
|
|
4954
4973
|
setDisabled,
|
|
4955
|
-
|
|
4956
|
-
initHelperText,
|
|
4974
|
+
setErrorErrorHelperText,
|
|
4957
4975
|
setItems,
|
|
4958
4976
|
setLoading,
|
|
4959
4977
|
data,
|
|
@@ -4996,7 +5014,7 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
4996
5014
|
}
|
|
4997
5015
|
}, [readOnly, items, getFinalValue, value, setValue, onValueChangeByUser, name, onRequestSearchSubmit]);
|
|
4998
5016
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
4999
|
-
return (React__default.createElement(FormItemBase, { focused: focused, ref: baseRef, className: classNames$1(className, 'FormValueItem', 'FormRadioGroup'), variant: variant, size: size, color: color, labelIcon: labelIcon, label: label, fullWidth: fullWidth, required: required, error: error, helperText: helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, hidden: hidden, autoSize: true, controlHeight: height || (size === 'small' ? 35 : 39), controlVerticalCenter: true, control: React__default.createElement(React__default.Fragment, null,
|
|
5017
|
+
return (React__default.createElement(FormItemBase, { focused: focused, ref: baseRef, className: classNames$1(className, 'FormValueItem', 'FormRadioGroup'), variant: variant, size: size, color: color, labelIcon: labelIcon, label: label, fullWidth: fullWidth, required: required, error: error, helperText: error ? errorHelperText : helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, hidden: hidden, autoSize: true, controlHeight: height || (size === 'small' ? 35 : 39), controlVerticalCenter: true, control: React__default.createElement(React__default.Fragment, null,
|
|
5000
5018
|
!fullWidth && !isOnGetItemLoading && !loading && items && (React__default.createElement("div", { ref: resizeWidthDetectorRef, style: {
|
|
5001
5019
|
display: 'grid',
|
|
5002
5020
|
position: 'absolute',
|
|
@@ -5032,7 +5050,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
5032
5050
|
// type ------------------------------------------------------------------------------------------------------------
|
|
5033
5051
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth,
|
|
5034
5052
|
//----------------------------------------------------------------------------------------------------------------
|
|
5035
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, type = _a.type, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initData = _a.data, initError = _a.error,
|
|
5053
|
+
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, type = _a.type, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initData = _a.data, initError = _a.error, helperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, notAllowEmptyValue = _a.notAllowEmptyValue, exceptValue = _a.exceptValue, initWidth = _a.width, multiple = _a.multiple, formValueSeparator = _a.formValueSeparator, formValueSort = _a.formValueSort, hidden = _a.hidden, itemWidth = _a.itemWidth, onLoadItems = _a.onLoadItems,
|
|
5036
5054
|
//----------------------------------------------------------------------------------------------------------------
|
|
5037
5055
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate,
|
|
5038
5056
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -5087,7 +5105,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
5087
5105
|
var _f = useState(false), isOnGetItemLoading = _f[0], setIsOnGetItemLoading = _f[1];
|
|
5088
5106
|
var _g = useAutoUpdateState$1(initItems), items = _g[0], setItems = _g[1];
|
|
5089
5107
|
var _h = useAutoUpdateState$1(initError), error = _h[0], setError = _h[1];
|
|
5090
|
-
var _j =
|
|
5108
|
+
var _j = useState(), errorHelperText = _j[0], setErrorHelperText = _j[1];
|
|
5091
5109
|
var _k = useAutoUpdateState$1(initLoading), loading = _k[0], setLoading = _k[1];
|
|
5092
5110
|
var _l = useAutoUpdateState$1(initDisabled), disabled = _l[0], setDisabled = _l[1];
|
|
5093
5111
|
var _m = useAutoUpdateState$1(initData), data = _m[0], setData = _m[1];
|
|
@@ -5226,27 +5244,27 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
5226
5244
|
var _a;
|
|
5227
5245
|
(_a = refForButtonResizeHeightDetect.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
5228
5246
|
}, [refForButtonResizeHeightDetect]);
|
|
5229
|
-
// Function -
|
|
5230
|
-
var
|
|
5247
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
5248
|
+
var setErrorErrorHelperText = useCallback(function (error, errorHelperText) {
|
|
5231
5249
|
setError(error);
|
|
5232
|
-
|
|
5233
|
-
}, [setError
|
|
5250
|
+
setErrorHelperText(errorHelperText);
|
|
5251
|
+
}, [setError]);
|
|
5234
5252
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
5235
5253
|
var validate = useCallback(function (value) {
|
|
5236
5254
|
if (required && empty(value)) {
|
|
5237
|
-
|
|
5255
|
+
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
5238
5256
|
return false;
|
|
5239
5257
|
}
|
|
5240
5258
|
if (onValidate) {
|
|
5241
5259
|
var onValidateResult = onValidate(value);
|
|
5242
5260
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
5243
|
-
|
|
5261
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
5244
5262
|
return false;
|
|
5245
5263
|
}
|
|
5246
5264
|
}
|
|
5247
|
-
|
|
5265
|
+
setErrorErrorHelperText(false, undefined);
|
|
5248
5266
|
return true;
|
|
5249
|
-
}, [required, onValidate,
|
|
5267
|
+
}, [required, onValidate, setErrorErrorHelperText]);
|
|
5250
5268
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
5251
5269
|
useLayoutEffect(function () {
|
|
5252
5270
|
if (ref || onAddValueItem) {
|
|
@@ -5283,7 +5301,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
5283
5301
|
focusValidate: focus,
|
|
5284
5302
|
validate: function () { return validate(value); },
|
|
5285
5303
|
setError: function (error, errorText) {
|
|
5286
|
-
return
|
|
5304
|
+
return setErrorErrorHelperText(error, error ? errorText : undefined);
|
|
5287
5305
|
},
|
|
5288
5306
|
getFormValueSeparator: function () { return formValueSeparator; },
|
|
5289
5307
|
isFormValueSort: function () { return !!formValueSort; },
|
|
@@ -5342,8 +5360,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
5342
5360
|
id,
|
|
5343
5361
|
setValue,
|
|
5344
5362
|
setDisabled,
|
|
5345
|
-
|
|
5346
|
-
initHelperText,
|
|
5363
|
+
setErrorErrorHelperText,
|
|
5347
5364
|
setItems,
|
|
5348
5365
|
setLoading,
|
|
5349
5366
|
data,
|
|
@@ -5434,7 +5451,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
5434
5451
|
theme.palette.error.main,
|
|
5435
5452
|
type,
|
|
5436
5453
|
]);
|
|
5437
|
-
return (React__default.createElement(FormItemBase, __assign$7({}, formControlBaseProps, { className: classNames$1(className, 'FormValueItem', 'FormToggleButtonGroup', "variant-".concat(variant), "size-".concat(size), !!label && 'with-label', !!fullWidth && 'full-width', "type-".concat(type)), variant: variant, size: size, color: color, labelIcon: labelIcon, label: label, required: required, fullWidth: fullWidth, error: error, helperText: helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, hidden: hidden, autoSize: true, controlHeight: height || 0, controlVerticalCenter: isOnGetItemLoading || loading, control: isOnGetItemLoading || loading ? (React__default.createElement("div", { style: { opacity: 0.54 }, ref: refForLoadingResizeHeightDetect },
|
|
5454
|
+
return (React__default.createElement(FormItemBase, __assign$7({}, formControlBaseProps, { className: classNames$1(className, 'FormValueItem', 'FormToggleButtonGroup', "variant-".concat(variant), "size-".concat(size), !!label && 'with-label', !!fullWidth && 'full-width', "type-".concat(type)), variant: variant, size: size, color: color, labelIcon: labelIcon, label: label, required: required, fullWidth: fullWidth, error: error, helperText: error ? errorHelperText : helperText, helperTextProps: { style: { marginLeft: 2 } }, style: style, sx: sx, hidden: hidden, autoSize: true, controlHeight: height || 0, controlVerticalCenter: isOnGetItemLoading || loading, control: isOnGetItemLoading || loading ? (React__default.createElement("div", { style: { opacity: 0.54 }, ref: refForLoadingResizeHeightDetect },
|
|
5438
5455
|
React__default.createElement(CircularProgress, { size: 16, color: 'inherit' }))) : (React__default.createElement(React__default.Fragment, null,
|
|
5439
5456
|
!fullWidth && !isOnGetItemLoading && !loading && items && (React__default.createElement("div", { ref: refForResizeWidthDetect, style: {
|
|
5440
5457
|
display: 'grid',
|
|
@@ -5460,7 +5477,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5460
5477
|
//----------------------------------------------------------------------------------------------------------------
|
|
5461
5478
|
precision = _a.precision, highlightSelectedOnly = _a.highlightSelectedOnly, icon = _a.icon, emptyIcon = _a.emptyIcon, max = _a.max, hidden = _a.hidden,
|
|
5462
5479
|
//----------------------------------------------------------------------------------------------------------------
|
|
5463
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, readOnly = _a.readOnly, required = _a.required, initDisabled = _a.disabled, initError = _a.error,
|
|
5480
|
+
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, readOnly = _a.readOnly, required = _a.required, initDisabled = _a.disabled, initError = _a.error, helperText = _a.helperText, initValue = _a.value, initData = _a.data, exceptValue = _a.exceptValue, onChange = _a.onChange, onValidate = _a.onValidate, onValue = _a.onValue,
|
|
5464
5481
|
//----------------------------------------------------------------------------------------------------------------
|
|
5465
5482
|
className = _a.className, initStyle = _a.style, sx = _a.sx;
|
|
5466
5483
|
var id = useId();
|
|
@@ -5477,7 +5494,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5477
5494
|
var inputRef = useRef();
|
|
5478
5495
|
// State -----------------------------------------------------------------------------------------------------------
|
|
5479
5496
|
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
5480
|
-
var _e =
|
|
5497
|
+
var _e = useState(), errorHelperText = _e[0], setErrorHelperText = _e[1];
|
|
5481
5498
|
var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
|
|
5482
5499
|
var _g = useAutoUpdateState$1(initData), data = _g[0], setData = _g[1];
|
|
5483
5500
|
// State - width, height -------------------------------------------------------------------------------------------
|
|
@@ -5522,25 +5539,25 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5522
5539
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
5523
5540
|
});
|
|
5524
5541
|
}, []);
|
|
5525
|
-
var
|
|
5542
|
+
var setErrorErrorHelperText = useCallback(function (error, errorHelperText) {
|
|
5526
5543
|
setError(error);
|
|
5527
|
-
|
|
5528
|
-
}, [setError
|
|
5544
|
+
setErrorHelperText(errorHelperText);
|
|
5545
|
+
}, [setError]);
|
|
5529
5546
|
var validate = useCallback(function (value) {
|
|
5530
5547
|
if (required && (empty(value) || value === 0)) {
|
|
5531
|
-
|
|
5548
|
+
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
5532
5549
|
return false;
|
|
5533
5550
|
}
|
|
5534
5551
|
if (onValidate) {
|
|
5535
5552
|
var onValidateResult = onValidate(value);
|
|
5536
5553
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
5537
|
-
|
|
5554
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
5538
5555
|
return false;
|
|
5539
5556
|
}
|
|
5540
5557
|
}
|
|
5541
|
-
|
|
5558
|
+
setErrorErrorHelperText(false, undefined);
|
|
5542
5559
|
return true;
|
|
5543
|
-
}, [required, onValidate,
|
|
5560
|
+
}, [required, onValidate, setErrorErrorHelperText]);
|
|
5544
5561
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
5545
5562
|
useLayoutEffect(function () {
|
|
5546
5563
|
var lastValue = value;
|
|
@@ -5573,8 +5590,8 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5573
5590
|
focus: focus,
|
|
5574
5591
|
focusValidate: focus,
|
|
5575
5592
|
validate: function () { return validate(value); },
|
|
5576
|
-
setError: function (error,
|
|
5577
|
-
return
|
|
5593
|
+
setError: function (error, errorHelperText) {
|
|
5594
|
+
return setErrorErrorHelperText(error, error ? errorHelperText : undefined);
|
|
5578
5595
|
},
|
|
5579
5596
|
};
|
|
5580
5597
|
onAddValueItem(id, commands);
|
|
@@ -5606,14 +5623,13 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5606
5623
|
disabled,
|
|
5607
5624
|
focus,
|
|
5608
5625
|
validate,
|
|
5609
|
-
initHelperText,
|
|
5610
5626
|
ref,
|
|
5611
5627
|
onAddValueItem,
|
|
5612
5628
|
onRemoveValueItem,
|
|
5613
5629
|
id,
|
|
5614
5630
|
setValue,
|
|
5615
5631
|
setDisabled,
|
|
5616
|
-
|
|
5632
|
+
setErrorErrorHelperText,
|
|
5617
5633
|
data,
|
|
5618
5634
|
setData,
|
|
5619
5635
|
]);
|
|
@@ -5632,7 +5648,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5632
5648
|
}
|
|
5633
5649
|
}, [readOnly, getFinalValue, setValue, onValueChangeByUser, name, onRequestSearchSubmit]);
|
|
5634
5650
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
5635
|
-
return (React__default.createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormRating'), labelIcon: labelIcon, label: label, error: error, fullWidth: false, required: required, helperText: helperText, helperTextProps: { style: { marginLeft: 5 } }, style: style, sx: sx, hidden: hidden, autoSize: true, controlHeight: height || (size === 'small' ? 21 : 26), controlVerticalCenter: true, control: React__default.createElement(Rating, { ref: ratingRef, size: size === 'medium' ? 'large' : 'medium', name: name, precision: precision, highlightSelectedOnly: highlightSelectedOnly, value: value, disabled: disabled || readOnly, max: max, icon: React__default.createElement(FormIcon, { color: color, fontSize: 'inherit' }, icon ? icon : 'Star'), emptyIcon: React__default.createElement(FormIcon, { fontSize: 'inherit' }, emptyIcon ? emptyIcon : 'StarBorder'), onChange: handleChange, onFocus: function () { return setFocused(initFocused || true); }, onBlur: function () { return setFocused(initFocused || false); } }) }));
|
|
5651
|
+
return (React__default.createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormRating'), labelIcon: labelIcon, label: label, error: error, fullWidth: false, required: required, helperText: error ? errorHelperText : helperText, helperTextProps: { style: { marginLeft: 5 } }, style: style, sx: sx, hidden: hidden, autoSize: true, controlHeight: height || (size === 'small' ? 21 : 26), controlVerticalCenter: true, control: React__default.createElement(Rating, { ref: ratingRef, size: size === 'medium' ? 'large' : 'medium', name: name, precision: precision, highlightSelectedOnly: highlightSelectedOnly, value: value, disabled: disabled || readOnly, max: max, icon: React__default.createElement(FormIcon, { color: color, fontSize: 'inherit' }, icon ? icon : 'Star'), emptyIcon: React__default.createElement(FormIcon, { fontSize: 'inherit' }, emptyIcon ? emptyIcon : 'StarBorder'), onChange: handleChange, onFocus: function () { return setFocused(initFocused || true); }, onBlur: function () { return setFocused(initFocused || false); } }) }));
|
|
5636
5652
|
});
|
|
5637
5653
|
FormRating.displayName = 'FormRating';
|
|
5638
5654
|
FormRating.defaultProps = FormRatingDefaultProps;var propTypes = {exports: {}};var reactIs = {exports: {}};var reactIs_production_min = {};/** @license React v16.13.1
|
|
@@ -7478,7 +7494,7 @@ styleInject(css_248z$c);var FormTextEditor = React__default.forwardRef(function
|
|
|
7478
7494
|
//----------------------------------------------------------------------------------------------------------------
|
|
7479
7495
|
menubar = _a.menubar, height = _a.height, hidden = _a.hidden, onImageUpload = _a.onImageUpload,
|
|
7480
7496
|
//----------------------------------------------------------------------------------------------------------------
|
|
7481
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, readOnly = _a.readOnly, required = _a.required, initDisabled = _a.disabled, initError = _a.error,
|
|
7497
|
+
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, readOnly = _a.readOnly, required = _a.required, initDisabled = _a.disabled, initError = _a.error, helperText = _a.helperText, initValue = _a.value, initData = _a.data, exceptValue = _a.exceptValue, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
7482
7498
|
//----------------------------------------------------------------------------------------------------------------
|
|
7483
7499
|
className = _a.className;
|
|
7484
7500
|
var id = useId();
|
|
@@ -7504,7 +7520,7 @@ styleInject(css_248z$c);var FormTextEditor = React__default.forwardRef(function
|
|
|
7504
7520
|
}, [value]);
|
|
7505
7521
|
// State -----------------------------------------------------------------------------------------------------------
|
|
7506
7522
|
var _e = useAutoUpdateState$1(initError), error = _e[0], setError = _e[1];
|
|
7507
|
-
var _f =
|
|
7523
|
+
var _f = useState(), errorHelperText = _f[0], setErrorHelperText = _f[1];
|
|
7508
7524
|
var _g = useState(false), initialized = _g[0], setInitialized = _g[1];
|
|
7509
7525
|
var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
|
|
7510
7526
|
var _j = useAutoUpdateState$1(initData), data = _j[0], setData = _j[1];
|
|
@@ -7518,11 +7534,11 @@ styleInject(css_248z$c);var FormTextEditor = React__default.forwardRef(function
|
|
|
7518
7534
|
textarea.style.display = 'none';
|
|
7519
7535
|
}
|
|
7520
7536
|
}, [editorRef]);
|
|
7521
|
-
// Function -
|
|
7522
|
-
var
|
|
7537
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
7538
|
+
var setErrorErrorHelperText = useCallback(function (error, errorHelperText) {
|
|
7523
7539
|
setError(error);
|
|
7524
|
-
|
|
7525
|
-
}, [setError
|
|
7540
|
+
setErrorHelperText(errorHelperText);
|
|
7541
|
+
}, [setError]);
|
|
7526
7542
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
7527
7543
|
var validate = useCallback(function (value) {
|
|
7528
7544
|
var isEmptyValue = false;
|
|
@@ -7533,19 +7549,19 @@ styleInject(css_248z$c);var FormTextEditor = React__default.forwardRef(function
|
|
|
7533
7549
|
isEmptyValue = empty(text.trim());
|
|
7534
7550
|
}
|
|
7535
7551
|
if (required && (isEmptyValue || empty(value))) {
|
|
7536
|
-
|
|
7552
|
+
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
7537
7553
|
return false;
|
|
7538
7554
|
}
|
|
7539
7555
|
if (onValidate) {
|
|
7540
7556
|
var onValidateResult = onValidate(value);
|
|
7541
7557
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
7542
|
-
|
|
7558
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
7543
7559
|
return false;
|
|
7544
7560
|
}
|
|
7545
7561
|
}
|
|
7546
|
-
|
|
7562
|
+
setErrorErrorHelperText(false, undefined);
|
|
7547
7563
|
return true;
|
|
7548
|
-
}, [required, onValidate,
|
|
7564
|
+
}, [required, onValidate, setErrorErrorHelperText]);
|
|
7549
7565
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
7550
7566
|
useLayoutEffect(function () {
|
|
7551
7567
|
var lastValue = value;
|
|
@@ -7578,8 +7594,8 @@ styleInject(css_248z$c);var FormTextEditor = React__default.forwardRef(function
|
|
|
7578
7594
|
focus: focus,
|
|
7579
7595
|
focusValidate: focus,
|
|
7580
7596
|
validate: function () { return validate(value); },
|
|
7581
|
-
setError: function (error,
|
|
7582
|
-
return
|
|
7597
|
+
setError: function (error, errorText) {
|
|
7598
|
+
return setErrorErrorHelperText(error, error ? errorText : undefined);
|
|
7583
7599
|
},
|
|
7584
7600
|
};
|
|
7585
7601
|
onAddValueItem(id, commands);
|
|
@@ -7609,17 +7625,16 @@ styleInject(css_248z$c);var FormTextEditor = React__default.forwardRef(function
|
|
|
7609
7625
|
exceptValue,
|
|
7610
7626
|
disabled,
|
|
7611
7627
|
focus,
|
|
7612
|
-
validate,
|
|
7613
|
-
initHelperText,
|
|
7614
7628
|
ref,
|
|
7615
7629
|
onAddValueItem,
|
|
7616
7630
|
onRemoveValueItem,
|
|
7617
7631
|
id,
|
|
7618
7632
|
setValue,
|
|
7619
7633
|
setDisabled,
|
|
7620
|
-
|
|
7634
|
+
setErrorErrorHelperText,
|
|
7621
7635
|
data,
|
|
7622
7636
|
setData,
|
|
7637
|
+
validate,
|
|
7623
7638
|
]);
|
|
7624
7639
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
7625
7640
|
var handleEditorChange = useCallback(function (value) {
|
|
@@ -7647,7 +7662,7 @@ styleInject(css_248z$c);var FormTextEditor = React__default.forwardRef(function
|
|
|
7647
7662
|
});
|
|
7648
7663
|
}, [onImageUpload]);
|
|
7649
7664
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
7650
|
-
return (React__default.createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormTextEditor', !initialized && 'initializing'), labelIcon: labelIcon, label: label, error: error, required: required, fullWidth: true, helperText: helperText, helperTextProps: { style: { marginLeft: 5 } }, style: { width: '100%' }, hidden: hidden, controlHeight: height, control: React__default.createElement(React__default.Fragment, null,
|
|
7665
|
+
return (React__default.createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormTextEditor', !initialized && 'initializing'), labelIcon: labelIcon, label: label, error: error, required: required, fullWidth: true, helperText: error ? errorHelperText : helperText, helperTextProps: { style: { marginLeft: 5 } }, style: { width: '100%' }, hidden: hidden, controlHeight: height, control: React__default.createElement(React__default.Fragment, null,
|
|
7651
7666
|
!initialized ? React__default.createElement(Skeleton, { variant: 'rectangular', width: '100%', height: height }) : null,
|
|
7652
7667
|
React__default.createElement(Editor, { ref: editorRef, value: value, disabled: readOnly || disabled, init: {
|
|
7653
7668
|
height: height,
|
|
@@ -7680,7 +7695,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7680
7695
|
// type ------------------------------------------------------------------------------------------------------------
|
|
7681
7696
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
7682
7697
|
//----------------------------------------------------------------------------------------------------------------
|
|
7683
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initData = _a.data, initError = _a.error,
|
|
7698
|
+
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initData = _a.data, initError = _a.error, helperText = _a.helperText, initDisabled = _a.disabled, readOnly = _a.readOnly, required = _a.required, exceptValue = _a.exceptValue, width = _a.width, placeholder = _a.placeholder, multiple = _a.multiple, formValueSeparator = _a.formValueSeparator, formValueSort = _a.formValueSort, disablePortal = _a.disablePortal, noOptionsText = _a.noOptionsText, loadingText = _a.loadingText, limitTags = _a.limitTags, openOnFocus = _a.openOnFocus, disableClearable = _a.disableClearable, async = _a.async, hidden = _a.hidden, onLoadItems = _a.onLoadItems, onAsyncLoadValueItem = _a.onAsyncLoadValueItem, onRenderItem = _a.onRenderItem, onRenderTag = _a.onRenderTag, onAddItem = _a.onAddItem, getOptionDisabled = _a.getOptionDisabled,
|
|
7684
7699
|
//----------------------------------------------------------------------------------------------------------------
|
|
7685
7700
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate,
|
|
7686
7701
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -7704,7 +7719,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7704
7719
|
var _c = useState(false), isOnGetItemLoading = _c[0], setIsOnGetItemLoading = _c[1];
|
|
7705
7720
|
var _d = useAutoUpdateState$1(initItems), items = _d[0], setItems = _d[1];
|
|
7706
7721
|
var _e = useAutoUpdateState$1(initError), error = _e[0], setError = _e[1];
|
|
7707
|
-
var _f =
|
|
7722
|
+
var _f = useState(), errorHelperText = _f[0], setErrorHelperText = _f[1];
|
|
7708
7723
|
var _g = useAutoUpdateState$1(initLoading), loading = _g[0], setLoading = _g[1];
|
|
7709
7724
|
var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
|
|
7710
7725
|
var _j = useState(undefined), inputValue = _j[0], setInputValue = _j[1];
|
|
@@ -7946,27 +7961,27 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7946
7961
|
var _a;
|
|
7947
7962
|
(_a = textFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
7948
7963
|
}, [textFieldRef]);
|
|
7949
|
-
// Function -
|
|
7950
|
-
var
|
|
7964
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
7965
|
+
var setErrorErrorHelperText = useCallback(function (error, errorHelperText) {
|
|
7951
7966
|
setError(error);
|
|
7952
|
-
|
|
7953
|
-
}, [setError
|
|
7967
|
+
setErrorHelperText(errorHelperText);
|
|
7968
|
+
}, [setError]);
|
|
7954
7969
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
7955
7970
|
var validate = useCallback(function (value) {
|
|
7956
7971
|
if (required && empty(value)) {
|
|
7957
|
-
|
|
7972
|
+
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
7958
7973
|
return false;
|
|
7959
7974
|
}
|
|
7960
7975
|
if (onValidate) {
|
|
7961
7976
|
var onValidateResult = onValidate(value);
|
|
7962
7977
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
7963
|
-
|
|
7978
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
7964
7979
|
return false;
|
|
7965
7980
|
}
|
|
7966
7981
|
}
|
|
7967
|
-
|
|
7982
|
+
setErrorErrorHelperText(false, undefined);
|
|
7968
7983
|
return true;
|
|
7969
|
-
}, [required, onValidate,
|
|
7984
|
+
}, [required, onValidate, setErrorErrorHelperText]);
|
|
7970
7985
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
7971
7986
|
useLayoutEffect(function () {
|
|
7972
7987
|
if (ref || onAddValueItem) {
|
|
@@ -8003,7 +8018,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
8003
8018
|
focusValidate: focus,
|
|
8004
8019
|
validate: function () { return validate(value); },
|
|
8005
8020
|
setError: function (error, errorText) {
|
|
8006
|
-
return
|
|
8021
|
+
return setErrorErrorHelperText(error, error ? errorText : undefined);
|
|
8007
8022
|
},
|
|
8008
8023
|
getFormValueSeparator: function () { return formValueSeparator; },
|
|
8009
8024
|
isFormValueSort: function () { return !!formValueSort; },
|
|
@@ -8062,8 +8077,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
8062
8077
|
id,
|
|
8063
8078
|
setValue,
|
|
8064
8079
|
setDisabled,
|
|
8065
|
-
|
|
8066
|
-
initHelperText,
|
|
8080
|
+
setErrorErrorHelperText,
|
|
8067
8081
|
setItems,
|
|
8068
8082
|
setLoading,
|
|
8069
8083
|
data,
|
|
@@ -8132,7 +8146,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
8132
8146
|
}
|
|
8133
8147
|
}, renderTags: function (value, getTagProps) {
|
|
8134
8148
|
return value.map(function (option, index) { return (React__default.createElement(Chip, __assign$7({ size: 'small', label: onRenderTag ? onRenderTag(option) : option.label }, getTagProps({ index: index })))); });
|
|
8135
|
-
}, renderInput: function (params) { return (React__default.createElement(FormTextField, __assign$7({}, params, { ref: textFieldRef, name: name, variant: variant, size: size, color: color, labelIcon: labelIcon, label: label, labelShrink: labelShrink, required: required, focused: focused, error: error, readOnly: readOnly, helperText: helperText, placeholder: placeholder, noFormValueItem: true, InputProps: __assign$7(__assign$7({}, params.InputProps), { endAdornment: (React__default.createElement(React__default.Fragment, null,
|
|
8149
|
+
}, renderInput: function (params) { return (React__default.createElement(FormTextField, __assign$7({}, params, { ref: textFieldRef, name: name, variant: variant, size: size, color: color, labelIcon: labelIcon, label: label, labelShrink: labelShrink, required: required, focused: focused, error: error, readOnly: readOnly, helperText: error ? errorHelperText : helperText, placeholder: placeholder, noFormValueItem: true, InputProps: __assign$7(__assign$7({}, params.InputProps), { endAdornment: (React__default.createElement(React__default.Fragment, null,
|
|
8136
8150
|
loading || isOnGetItemLoading ? React__default.createElement(CircularProgress$1, { color: 'inherit', size: 20 }) : null,
|
|
8137
8151
|
params.InputProps.endAdornment)) }), inputProps: readOnly || disabled ? __assign$7(__assign$7({}, params.inputProps), { tabIndex: -1 }) : params.inputProps }))); } }));
|
|
8138
8152
|
}));
|
|
@@ -10370,7 +10384,7 @@ styleInject(css_248z$7);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10370
10384
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
10371
10385
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
10372
10386
|
//--------------------------------------------------------------------------------------------------------------------
|
|
10373
|
-
name = _a.name, type = _a.type, time = _a.time, initValue = _a.value, initData = _a.data, initLabel = _a.label, labelIcon = _a.labelIcon, initFormat = _a.format, initFormValueFormat = _a.formValueFormat, required = _a.required, readOnly = _a.readOnly, initDisabled = _a.disabled, width = _a.width, initError = _a.error,
|
|
10387
|
+
name = _a.name, type = _a.type, time = _a.time, initValue = _a.value, initData = _a.data, initLabel = _a.label, labelIcon = _a.labelIcon, initFormat = _a.format, initFormValueFormat = _a.formValueFormat, required = _a.required, readOnly = _a.readOnly, initDisabled = _a.disabled, width = _a.width, initError = _a.error, helperText = _a.helperText, minDate = _a.minDate, maxDate = _a.maxDate, disableFuture = _a.disableFuture, disablePast = _a.disablePast, exceptValue = _a.exceptValue, icon = _a.icon, startAdornment = _a.startAdornment, endAdornment = _a.endAdornment, align = _a.align, hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds, minuteInterval = _a.minuteInterval, secondInterval = _a.secondInterval, readOnlyInput = _a.readOnlyInput, hidden = _a.hidden, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
10374
10388
|
//--------------------------------------------------------------------------------------------------------------------
|
|
10375
10389
|
className = _a.className, initStyle = _a.style, sx = _a.sx, otherProps = __rest$4(_a, ["variant", "size", "color", "focused", "labelShrink", "fullWidth", "name", "type", "time", "value", "data", "label", "labelIcon", "format", "formValueFormat", "required", "readOnly", "disabled", "width", "error", "helperText", "minDate", "maxDate", "disableFuture", "disablePast", "exceptValue", "icon", "startAdornment", "endAdornment", "align", "hours", "minutes", "seconds", "minuteInterval", "secondInterval", "readOnlyInput", "hidden", "onChange", "onValidate", "className", "style", "sx"]);
|
|
10376
10390
|
var id = useId();
|
|
@@ -10395,7 +10409,7 @@ styleInject(css_248z$7);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10395
10409
|
// State -----------------------------------------------------------------------------------------------------------
|
|
10396
10410
|
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
10397
10411
|
var _e = useState(null), timeError = _e[0], setTimeError = _e[1];
|
|
10398
|
-
var _f =
|
|
10412
|
+
var _f = useState(), errorHelperText = _f[0], setErrorHelperText = _f[1];
|
|
10399
10413
|
var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
|
|
10400
10414
|
var _h = useAutoUpdateState$1(initData), data = _h[0], setData = _h[1];
|
|
10401
10415
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
@@ -10510,39 +10524,39 @@ styleInject(css_248z$7);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10510
10524
|
var _a;
|
|
10511
10525
|
(_a = textFieldInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
10512
10526
|
}, [textFieldInputRef]);
|
|
10513
|
-
// Function -
|
|
10514
|
-
var
|
|
10527
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
10528
|
+
var setErrorErrorHelperText = useCallback(function (error, helperText) {
|
|
10515
10529
|
setError(error);
|
|
10516
|
-
|
|
10517
|
-
}, [setError
|
|
10530
|
+
setErrorHelperText(helperText);
|
|
10531
|
+
}, [setError]);
|
|
10518
10532
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
10519
10533
|
var validate = useCallback(function (value) {
|
|
10520
10534
|
if (required && empty(value)) {
|
|
10521
|
-
|
|
10535
|
+
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
10522
10536
|
return false;
|
|
10523
10537
|
}
|
|
10524
10538
|
if (value && !value.isValid()) {
|
|
10525
|
-
|
|
10539
|
+
setErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
10526
10540
|
return false;
|
|
10527
10541
|
}
|
|
10528
10542
|
if (datePickerErrorRef.current) {
|
|
10529
|
-
|
|
10543
|
+
setErrorErrorHelperText(true, getDateValidationErrorText(datePickerErrorRef.current));
|
|
10530
10544
|
return false;
|
|
10531
10545
|
}
|
|
10532
10546
|
if (timeError) {
|
|
10533
|
-
|
|
10547
|
+
setErrorErrorHelperText(true, getDateValidationErrorText(timeError));
|
|
10534
10548
|
return false;
|
|
10535
10549
|
}
|
|
10536
10550
|
if (onValidate) {
|
|
10537
10551
|
var onValidateResult = onValidate(value);
|
|
10538
10552
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
10539
|
-
|
|
10553
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
10540
10554
|
return false;
|
|
10541
10555
|
}
|
|
10542
10556
|
}
|
|
10543
|
-
|
|
10557
|
+
setErrorErrorHelperText(false, undefined);
|
|
10544
10558
|
return true;
|
|
10545
|
-
}, [required, timeError, onValidate,
|
|
10559
|
+
}, [required, timeError, onValidate, setErrorErrorHelperText]);
|
|
10546
10560
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
10547
10561
|
useLayoutEffect(function () {
|
|
10548
10562
|
if (ref || onAddValueItem) {
|
|
@@ -10577,7 +10591,7 @@ styleInject(css_248z$7);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10577
10591
|
focusValidate: focus,
|
|
10578
10592
|
validate: function () { return validate(value); },
|
|
10579
10593
|
setError: function (error, errorText) {
|
|
10580
|
-
return
|
|
10594
|
+
return setErrorErrorHelperText(error, error ? errorText : undefined);
|
|
10581
10595
|
},
|
|
10582
10596
|
getFormValueFormat: function () { return formValueFormat; },
|
|
10583
10597
|
};
|
|
@@ -10620,8 +10634,7 @@ styleInject(css_248z$7);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10620
10634
|
id,
|
|
10621
10635
|
setValue,
|
|
10622
10636
|
setDisabled,
|
|
10623
|
-
|
|
10624
|
-
initHelperText,
|
|
10637
|
+
setErrorErrorHelperText,
|
|
10625
10638
|
data,
|
|
10626
10639
|
setData,
|
|
10627
10640
|
]);
|
|
@@ -10776,14 +10789,14 @@ styleInject(css_248z$7);var PrivateDatePicker = React__default.forwardRef(functi
|
|
|
10776
10789
|
{
|
|
10777
10790
|
name: 'offset',
|
|
10778
10791
|
options: {
|
|
10779
|
-
offset: [0, error &&
|
|
10792
|
+
offset: [0, error && errorHelperText ? 8 : -14],
|
|
10780
10793
|
},
|
|
10781
10794
|
},
|
|
10782
10795
|
],
|
|
10783
10796
|
}, title: React__default.createElement(PrivateStaticDatePicker, __assign$7({}, otherProps, { ref: privateStaticDatePickerRef, type: type, time: time, value: value, availableDate: availableDate, minDate: minDate, maxDate: maxDate, disablePast: disablePast, disableFuture: disableFuture, hours: hours, minutes: minutes, seconds: seconds, minuteInterval: minuteInterval, secondInterval: secondInterval, onChange: handleChange, onAccept: function () { return !time && setOpen(false); }, onClose: function () { return setOpen(false); } })) },
|
|
10784
10797
|
React__default.createElement("div", { style: { display: fullWidth ? 'block' : 'inline-block' } },
|
|
10785
10798
|
React__default.createElement(DesktopDatePicker, __assign$7({ value: inputValue, label: label, open: false, format: format, disabled: disabled, readOnly: readOnly, minDate: minDate, maxDate: maxDate, disablePast: disablePast, disableFuture: disableFuture, onClose: function () { return setOpen(false); }, onError: function (reason) { return (datePickerErrorRef.current = reason); }, onChange: function (newValue) { return handleChange('date', newValue); }, slotProps: slotProps }, otherProps)))),
|
|
10786
|
-
!formColWithHelperText && helperText && (React__default.createElement(FormHelperText, { error: error, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, helperText))))));
|
|
10799
|
+
!formColWithHelperText && (helperText || (error && errorHelperText)) && (React__default.createElement(FormHelperText, { error: error, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, error ? errorHelperText : helperText))))));
|
|
10787
10800
|
});
|
|
10788
10801
|
PrivateDatePicker.displayName = 'PrivateDatePicker';
|
|
10789
10802
|
PrivateDatePicker.defaultProps = PrivateDatePickerDefaultProps;var PrivateDateTimePickerDefaultProps = {
|
|
@@ -11074,7 +11087,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
11074
11087
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
11075
11088
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
11076
11089
|
//--------------------------------------------------------------------------------------------------------------------
|
|
11077
|
-
name = _a.name, type = _a.type, time = _a.time, initValue = _a.value, initData = _a.data, initLabel = _a.label, labelIcon = _a.labelIcon, initFormat = _a.format, initFormValueFormat = _a.formValueFormat, required = _a.required, readOnly = _a.readOnly, initDisabled = _a.disabled, width = _a.width, initError = _a.error,
|
|
11090
|
+
name = _a.name, type = _a.type, time = _a.time, initValue = _a.value, initData = _a.data, initLabel = _a.label, labelIcon = _a.labelIcon, initFormat = _a.format, initFormValueFormat = _a.formValueFormat, required = _a.required, readOnly = _a.readOnly, initDisabled = _a.disabled, width = _a.width, initError = _a.error, helperText = _a.helperText, minDate = _a.minDate, maxDate = _a.maxDate, disableFuture = _a.disableFuture, disablePast = _a.disablePast, exceptValue = _a.exceptValue, icon = _a.icon, startAdornment = _a.startAdornment, endAdornment = _a.endAdornment, align = _a.align, hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds, minuteInterval = _a.minuteInterval, secondInterval = _a.secondInterval, readOnlyInput = _a.readOnlyInput, hidden = _a.hidden, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
11078
11091
|
//--------------------------------------------------------------------------------------------------------------------
|
|
11079
11092
|
className = _a.className, initStyle = _a.style, sx = _a.sx, otherProps = __rest$4(_a, ["variant", "size", "color", "focused", "labelShrink", "fullWidth", "name", "type", "time", "value", "data", "label", "labelIcon", "format", "formValueFormat", "required", "readOnly", "disabled", "width", "error", "helperText", "minDate", "maxDate", "disableFuture", "disablePast", "exceptValue", "icon", "startAdornment", "endAdornment", "align", "hours", "minutes", "seconds", "minuteInterval", "secondInterval", "readOnlyInput", "hidden", "onChange", "onValidate", "className", "style", "sx"]);
|
|
11080
11093
|
var id = useId();
|
|
@@ -11099,7 +11112,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
11099
11112
|
// State -----------------------------------------------------------------------------------------------------------
|
|
11100
11113
|
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
11101
11114
|
var _e = useState(null), timeError = _e[0], setTimeError = _e[1];
|
|
11102
|
-
var _f =
|
|
11115
|
+
var _f = useState(), errorHelperText = _f[0], setErrorHelperText = _f[1];
|
|
11103
11116
|
var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
|
|
11104
11117
|
var _h = useAutoUpdateState$1(initData), data = _h[0], setData = _h[1];
|
|
11105
11118
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
@@ -11214,39 +11227,39 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
11214
11227
|
var _a;
|
|
11215
11228
|
(_a = textFieldInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
11216
11229
|
}, [textFieldInputRef]);
|
|
11217
|
-
// Function -
|
|
11218
|
-
var
|
|
11230
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
11231
|
+
var setErrorErrorHelperText = useCallback(function (error, errorHelperText) {
|
|
11219
11232
|
setError(error);
|
|
11220
|
-
|
|
11221
|
-
}, [setError
|
|
11233
|
+
setErrorHelperText(errorHelperText);
|
|
11234
|
+
}, [setError]);
|
|
11222
11235
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
11223
11236
|
var validate = useCallback(function (value) {
|
|
11224
11237
|
if (required && empty(value)) {
|
|
11225
|
-
|
|
11238
|
+
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
11226
11239
|
return false;
|
|
11227
11240
|
}
|
|
11228
11241
|
if (value && !value.isValid()) {
|
|
11229
|
-
|
|
11242
|
+
setErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
11230
11243
|
return false;
|
|
11231
11244
|
}
|
|
11232
11245
|
if (datePickerErrorRef.current) {
|
|
11233
|
-
|
|
11246
|
+
setErrorErrorHelperText(true, getDateValidationErrorText(datePickerErrorRef.current));
|
|
11234
11247
|
return false;
|
|
11235
11248
|
}
|
|
11236
11249
|
if (timeError) {
|
|
11237
|
-
|
|
11250
|
+
setErrorErrorHelperText(true, getDateValidationErrorText(timeError));
|
|
11238
11251
|
return false;
|
|
11239
11252
|
}
|
|
11240
11253
|
if (onValidate) {
|
|
11241
11254
|
var onValidateResult = onValidate(value);
|
|
11242
11255
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
11243
|
-
|
|
11256
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
11244
11257
|
return false;
|
|
11245
11258
|
}
|
|
11246
11259
|
}
|
|
11247
|
-
|
|
11260
|
+
setErrorErrorHelperText(false, undefined);
|
|
11248
11261
|
return true;
|
|
11249
|
-
}, [required, timeError, onValidate,
|
|
11262
|
+
}, [required, timeError, onValidate, setErrorErrorHelperText]);
|
|
11250
11263
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
11251
11264
|
useLayoutEffect(function () {
|
|
11252
11265
|
if (ref || onAddValueItem) {
|
|
@@ -11281,7 +11294,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
11281
11294
|
focusValidate: focus,
|
|
11282
11295
|
validate: function () { return validate(value); },
|
|
11283
11296
|
setError: function (error, errorText) {
|
|
11284
|
-
return
|
|
11297
|
+
return setErrorErrorHelperText(error, error ? errorText : undefined);
|
|
11285
11298
|
},
|
|
11286
11299
|
getFormValueFormat: function () { return formValueFormat; },
|
|
11287
11300
|
};
|
|
@@ -11324,8 +11337,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
11324
11337
|
id,
|
|
11325
11338
|
setValue,
|
|
11326
11339
|
setDisabled,
|
|
11327
|
-
|
|
11328
|
-
initHelperText,
|
|
11340
|
+
setErrorErrorHelperText,
|
|
11329
11341
|
data,
|
|
11330
11342
|
setData,
|
|
11331
11343
|
]);
|
|
@@ -11504,7 +11516,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
11504
11516
|
}, title: React__default.createElement(PrivateStaticDateTimePicker, __assign$7({}, otherProps, { ref: privateStaticDateTimePickerRef, type: type, time: time, value: value, availableDate: availableDate, minDate: minDate, maxDate: maxDate, disablePast: disablePast, disableFuture: disableFuture, hours: hours, minutes: minutes, seconds: seconds, minuteInterval: minuteInterval, secondInterval: secondInterval, onChange: handleChange, onAccept: function () { return !time && setOpen(false); }, onClose: function () { return setOpen(false); } })) },
|
|
11505
11517
|
React__default.createElement("div", { style: { display: fullWidth ? 'block' : 'inline-block' } },
|
|
11506
11518
|
React__default.createElement(DesktopDateTimePicker, __assign$7({ value: inputValue, label: label, open: false, format: format, disabled: disabled, readOnly: readOnly, minDate: minDate, maxDate: maxDate, disablePast: disablePast, disableFuture: disableFuture, onClose: function () { return setOpen(false); }, onError: function (reason) { return (datePickerErrorRef.current = reason); }, onChange: function (newValue) { return handleChange('date', newValue); }, slotProps: slotProps }, otherProps)))),
|
|
11507
|
-
!formColWithHelperText && helperText && (React__default.createElement(FormHelperText, { error: error, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, helperText))))));
|
|
11519
|
+
!formColWithHelperText && (helperText || (error && errorHelperText)) && (React__default.createElement(FormHelperText, { error: error, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, error ? errorHelperText : helperText))))));
|
|
11508
11520
|
});
|
|
11509
11521
|
PrivateDateTimePicker.displayName = 'PrivateDateTimePicker';
|
|
11510
11522
|
PrivateDateTimePicker.defaultProps = PrivateDateTimePickerDefaultProps;var PrivateAlertDialogDefaultProps = {
|
|
@@ -12133,7 +12145,7 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12133
12145
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
12134
12146
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
12135
12147
|
//--------------------------------------------------------------------------------------------------------------------
|
|
12136
|
-
name = _a.name, initValue = _a.value, initData = _a.data, startLabel = _a.startLabel, startLabelIcon = _a.startLabelIcon, endLabel = _a.endLabel, endLabelIcon = _a.endLabelIcon, 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,
|
|
12148
|
+
name = _a.name, initValue = _a.value, initData = _a.data, startLabel = _a.startLabel, startLabelIcon = _a.startLabelIcon, endLabel = _a.endLabel, endLabelIcon = _a.endLabelIcon, 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, formValueStartNameSuffix = _a.formValueStartNameSuffix, formValueEndNameSuffix = _a.formValueEndNameSuffix, 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, hidden = _a.hidden, onGetActionButtons = _a.onGetActionButtons, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
12137
12149
|
// -------------------------------------------------------------------------------------------------------------------
|
|
12138
12150
|
className = _a.className;
|
|
12139
12151
|
var id = useId();
|
|
@@ -12160,8 +12172,10 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12160
12172
|
var _d = useState(false), startError = _d[0], setStartError = _d[1];
|
|
12161
12173
|
var _e = useState(false), endError = _e[0], setEndError = _e[1];
|
|
12162
12174
|
var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
|
|
12163
|
-
var _g =
|
|
12164
|
-
var _h =
|
|
12175
|
+
var _g = useState(), errorHelperText = _g[0], setErrorHelperText = _g[1];
|
|
12176
|
+
var _h = useState(), startErrorHelperText = _h[0], setStartErrorHelperText = _h[1];
|
|
12177
|
+
var _j = useState(), endErrorHelperText = _j[0], setEndErrorHelperText = _j[1];
|
|
12178
|
+
var _k = useAutoUpdateState$1(initData), data = _k[0], setData = _k[1];
|
|
12165
12179
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
12166
12180
|
var format = useMemo(function () { return initFormat || DEFAULT_FORMAT; }, [initFormat]);
|
|
12167
12181
|
// Function - getFinalValue ----------------------------------------------------------------------------------------
|
|
@@ -12182,77 +12196,77 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12182
12196
|
(_b = startDateTextFieldRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
12183
12197
|
}
|
|
12184
12198
|
}, [endError, startDateTextFieldRef, endDateTextFieldRef]);
|
|
12185
|
-
// Function -
|
|
12186
|
-
var
|
|
12199
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
12200
|
+
var setErrorErrorHelperText = useCallback(function (error, errorHelperText) {
|
|
12187
12201
|
setError(error);
|
|
12188
|
-
|
|
12189
|
-
}, [setError
|
|
12190
|
-
var
|
|
12202
|
+
setErrorHelperText(errorHelperText);
|
|
12203
|
+
}, [setError]);
|
|
12204
|
+
var setStartErrorErrorHelperText = useCallback(function (error, startErrorHelperText) {
|
|
12191
12205
|
setStartError(error);
|
|
12192
|
-
|
|
12193
|
-
}, [
|
|
12194
|
-
var
|
|
12206
|
+
setStartErrorHelperText(startErrorHelperText);
|
|
12207
|
+
}, []);
|
|
12208
|
+
var setEndErrorErrorHelperText = useCallback(function (error, endErrorHelperText) {
|
|
12195
12209
|
setEndError(error);
|
|
12196
|
-
|
|
12197
|
-
}, [
|
|
12210
|
+
setEndErrorHelperText(endErrorHelperText);
|
|
12211
|
+
}, []);
|
|
12198
12212
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
12199
12213
|
var validate = useCallback(function (value) {
|
|
12200
12214
|
var _a, _b;
|
|
12201
12215
|
if (required && (value[0] == null || value[1] == null)) {
|
|
12202
12216
|
if (value[0] == null && value[1] == null) {
|
|
12203
|
-
|
|
12217
|
+
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12204
12218
|
}
|
|
12205
12219
|
else if (value[0] == null) {
|
|
12206
|
-
|
|
12220
|
+
setStartErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12207
12221
|
}
|
|
12208
12222
|
else {
|
|
12209
|
-
|
|
12223
|
+
setEndErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12210
12224
|
}
|
|
12211
12225
|
return false;
|
|
12212
12226
|
}
|
|
12213
12227
|
if (requiredStart && value[0] == null) {
|
|
12214
|
-
|
|
12228
|
+
setStartErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12215
12229
|
return false;
|
|
12216
12230
|
}
|
|
12217
12231
|
if (requiredEnd && value[1] == null) {
|
|
12218
|
-
|
|
12232
|
+
setEndErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12219
12233
|
return false;
|
|
12220
12234
|
}
|
|
12221
12235
|
if (!allowSingleSelect && (value[0] || value[1]) && (value[0] == null || value[1] == null)) {
|
|
12222
12236
|
if (value[0] == null) {
|
|
12223
|
-
|
|
12237
|
+
setStartErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12224
12238
|
}
|
|
12225
12239
|
else {
|
|
12226
|
-
|
|
12240
|
+
setEndErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12227
12241
|
}
|
|
12228
12242
|
return false;
|
|
12229
12243
|
}
|
|
12230
12244
|
var startInputValue = ((_a = startDateTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
12231
12245
|
var endInputValue = ((_b = endDateTextFieldRef.current) === null || _b === void 0 ? void 0 : _b.value) || '';
|
|
12232
12246
|
if (notEmpty(startInputValue) && !dayjs(startInputValue, format).isValid()) {
|
|
12233
|
-
|
|
12247
|
+
setStartErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
12234
12248
|
return false;
|
|
12235
12249
|
}
|
|
12236
12250
|
if (notEmpty(endInputValue) && !dayjs(endInputValue, format).isValid()) {
|
|
12237
|
-
|
|
12251
|
+
setEndErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
12238
12252
|
return false;
|
|
12239
12253
|
}
|
|
12240
12254
|
if (startInputDatePickerErrorRef.current) {
|
|
12241
|
-
|
|
12255
|
+
setStartErrorErrorHelperText(true, getDateValidationErrorText(startInputDatePickerErrorRef.current));
|
|
12242
12256
|
return false;
|
|
12243
12257
|
}
|
|
12244
12258
|
if (endInputDatePickerErrorRef.current) {
|
|
12245
|
-
|
|
12259
|
+
setEndErrorErrorHelperText(true, getDateValidationErrorText(endInputDatePickerErrorRef.current));
|
|
12246
12260
|
return false;
|
|
12247
12261
|
}
|
|
12248
12262
|
if (onValidate) {
|
|
12249
12263
|
var onValidateResult = onValidate(value);
|
|
12250
12264
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
12251
|
-
|
|
12265
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
12252
12266
|
return false;
|
|
12253
12267
|
}
|
|
12254
12268
|
}
|
|
12255
|
-
|
|
12269
|
+
setErrorErrorHelperText(false, undefined);
|
|
12256
12270
|
setStartError(false);
|
|
12257
12271
|
setEndError(false);
|
|
12258
12272
|
return true;
|
|
@@ -12263,10 +12277,9 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12263
12277
|
allowSingleSelect,
|
|
12264
12278
|
format,
|
|
12265
12279
|
onValidate,
|
|
12266
|
-
|
|
12267
|
-
|
|
12268
|
-
|
|
12269
|
-
setEndErrorHelperText,
|
|
12280
|
+
setErrorErrorHelperText,
|
|
12281
|
+
setStartErrorErrorHelperText,
|
|
12282
|
+
setEndErrorErrorHelperText,
|
|
12270
12283
|
]);
|
|
12271
12284
|
// Function activeMonth --------------------------------------------------------------------------------------------
|
|
12272
12285
|
var activeMonth = useCallback(function (month) {
|
|
@@ -12275,16 +12288,16 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12275
12288
|
(_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.activeMonth(month);
|
|
12276
12289
|
}, [containerRef]);
|
|
12277
12290
|
// State -----------------------------------------------------------------------------------------------------------
|
|
12278
|
-
var
|
|
12279
|
-
var
|
|
12280
|
-
var
|
|
12291
|
+
var _l = useState(false), open = _l[0], setOpen = _l[1];
|
|
12292
|
+
var _m = useState('start'), selectType = _m[0], setSelectType = _m[1];
|
|
12293
|
+
var _o = useAutoUpdateState$1(useCallback(function () {
|
|
12281
12294
|
return initValue || DEFAULT_VALUE;
|
|
12282
|
-
}, [initValue])), value =
|
|
12295
|
+
}, [initValue])), value = _o[0], setValue = _o[1];
|
|
12283
12296
|
var calendarCount = useAutoUpdateState$1(initCalendarCount || 2)[0];
|
|
12284
|
-
var
|
|
12297
|
+
var _p = useState(function () {
|
|
12285
12298
|
var now = dayjs();
|
|
12286
12299
|
return [now, now.add(1, 'month'), now.add(2, 'month')];
|
|
12287
|
-
}), months =
|
|
12300
|
+
}), months = _p[0], setMonths = _p[1];
|
|
12288
12301
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
12289
12302
|
var inputDatePickerProps = useMemo(function () { return ({
|
|
12290
12303
|
variant: variant,
|
|
@@ -12360,9 +12373,9 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12360
12373
|
var handleChange = useCallback(function (newValue) {
|
|
12361
12374
|
setValue(newValue);
|
|
12362
12375
|
setOpen(false);
|
|
12363
|
-
|
|
12364
|
-
|
|
12365
|
-
}, [
|
|
12376
|
+
setStartErrorErrorHelperText(false, undefined);
|
|
12377
|
+
setEndErrorErrorHelperText(false, undefined);
|
|
12378
|
+
}, [setEndErrorErrorHelperText, setStartErrorErrorHelperText, setValue]);
|
|
12366
12379
|
var handleValueChange = useCallback(function (selectType, newValue, fromInput) {
|
|
12367
12380
|
var _a;
|
|
12368
12381
|
var finalValue;
|
|
@@ -12391,7 +12404,7 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12391
12404
|
}
|
|
12392
12405
|
}
|
|
12393
12406
|
}
|
|
12394
|
-
|
|
12407
|
+
setStartErrorErrorHelperText(false, undefined);
|
|
12395
12408
|
if (fromInput && newValue) {
|
|
12396
12409
|
activeMonth(newValue);
|
|
12397
12410
|
}
|
|
@@ -12402,7 +12415,7 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12402
12415
|
if (fromInput && newValue) {
|
|
12403
12416
|
activeMonth(newValue.subtract(calendarCount - 1, 'month'));
|
|
12404
12417
|
}
|
|
12405
|
-
|
|
12418
|
+
setStartErrorErrorHelperText(false, undefined);
|
|
12406
12419
|
}
|
|
12407
12420
|
else {
|
|
12408
12421
|
finalValue = [value[0], newValue];
|
|
@@ -12423,7 +12436,7 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12423
12436
|
(_a = startDateTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
12424
12437
|
});
|
|
12425
12438
|
}
|
|
12426
|
-
|
|
12439
|
+
setEndErrorErrorHelperText(false, undefined);
|
|
12427
12440
|
}
|
|
12428
12441
|
break;
|
|
12429
12442
|
}
|
|
@@ -12434,11 +12447,10 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12434
12447
|
}, [
|
|
12435
12448
|
setValue,
|
|
12436
12449
|
value,
|
|
12437
|
-
|
|
12438
|
-
initHelperText,
|
|
12450
|
+
setStartErrorErrorHelperText,
|
|
12439
12451
|
activeMonth,
|
|
12440
12452
|
calendarCount,
|
|
12441
|
-
|
|
12453
|
+
setEndErrorErrorHelperText,
|
|
12442
12454
|
open,
|
|
12443
12455
|
onRequestSearchSubmit,
|
|
12444
12456
|
name,
|
|
@@ -12570,7 +12582,7 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12570
12582
|
focusValidate: focusValidate,
|
|
12571
12583
|
validate: function () { return validate(value); },
|
|
12572
12584
|
setError: function (error, errorText) {
|
|
12573
|
-
return
|
|
12585
|
+
return setErrorErrorHelperText(error, error ? errorText : undefined);
|
|
12574
12586
|
},
|
|
12575
12587
|
getFormValueFormat: function () { return formValueFormat || FormDateRangePickerDefaultProps.format; },
|
|
12576
12588
|
getFormValueStartNameSuffix: function () {
|
|
@@ -12628,8 +12640,7 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12628
12640
|
id,
|
|
12629
12641
|
setValue,
|
|
12630
12642
|
setDisabled,
|
|
12631
|
-
|
|
12632
|
-
initHelperText,
|
|
12643
|
+
setErrorErrorHelperText,
|
|
12633
12644
|
data,
|
|
12634
12645
|
setData,
|
|
12635
12646
|
]);
|
|
@@ -12642,7 +12653,14 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12642
12653
|
{
|
|
12643
12654
|
name: 'offset',
|
|
12644
12655
|
options: {
|
|
12645
|
-
offset: [
|
|
12656
|
+
offset: [
|
|
12657
|
+
0,
|
|
12658
|
+
(error && errorHelperText) ||
|
|
12659
|
+
(startError && startErrorHelperText) ||
|
|
12660
|
+
(endError && endErrorHelperText)
|
|
12661
|
+
? 8
|
|
12662
|
+
: -14,
|
|
12663
|
+
],
|
|
12646
12664
|
},
|
|
12647
12665
|
},
|
|
12648
12666
|
],
|
|
@@ -12654,7 +12672,17 @@ var FormDateRangePicker = React__default.forwardRef(function (_a, ref) {
|
|
|
12654
12672
|
React__default.createElement(Grid, { item: true, sx: { px: 1 } }, "~"),
|
|
12655
12673
|
React__default.createElement(Grid, { item: true, flex: 1 },
|
|
12656
12674
|
React__default.createElement(InputDatePicker, __assign$7({}, inputDatePickerProps, { style: inputStyle, value: value[1], label: endLabel, labelIcon: endLabelIcon, error: error || endError, 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); } }))))),
|
|
12657
|
-
!formColWithHelperText &&
|
|
12675
|
+
!formColWithHelperText &&
|
|
12676
|
+
(helperText ||
|
|
12677
|
+
(error && errorHelperText) ||
|
|
12678
|
+
(startError && startErrorHelperText) ||
|
|
12679
|
+
(endError && endErrorHelperText)) && (React__default.createElement(FormHelperText, { error: error || startError || endError, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, error
|
|
12680
|
+
? errorHelperText
|
|
12681
|
+
: startError
|
|
12682
|
+
? startErrorHelperText
|
|
12683
|
+
: endError
|
|
12684
|
+
? endErrorHelperText
|
|
12685
|
+
: helperText))))));
|
|
12658
12686
|
});
|
|
12659
12687
|
FormDateRangePicker.displayName = 'FormDateRangePicker';
|
|
12660
12688
|
FormDateRangePicker.defaultProps = FormDateRangePickerDefaultProps;var FormFileDefaultProps = {
|
|
@@ -12716,7 +12744,7 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
12716
12744
|
//----------------------------------------------------------------------------------------------------------------
|
|
12717
12745
|
accept = _a.accept, hideUrl = _a.hideUrl, uploadLabel = _a.uploadLabel, uploadTabIndex = _a.uploadTabIndex, hideUpload = _a.hideUpload, hideUploadLabel = _a.hideUploadLabel, linkLabel = _a.linkLabel, linkTabIndex = _a.linkTabIndex, hideLink = _a.hideLink, hideLinkLabel = _a.hideLinkLabel, removeLabel = _a.removeLabel, removeTabIndex = _a.removeTabIndex, hideRemove = _a.hideRemove, hideRemoveLabel = _a.hideRemoveLabel, maxFileSize = _a.maxFileSize, preview = _a.preview, hidden = _a.hidden, onFile = _a.onFile, onLink = _a.onLink,
|
|
12718
12746
|
//----------------------------------------------------------------------------------------------------------------
|
|
12719
|
-
name = _a.name, labelIcon = _a.labelIcon, initLabel = _a.label, required = _a.required, readOnly = _a.readOnly, initDisabled = _a.disabled, initError = _a.error,
|
|
12747
|
+
name = _a.name, labelIcon = _a.labelIcon, initLabel = _a.label, required = _a.required, readOnly = _a.readOnly, initDisabled = _a.disabled, initError = _a.error, helperText = _a.helperText, initValue = _a.value, initData = _a.data, exceptValue = _a.exceptValue, onChange = _a.onChange, onValidate = _a.onValidate,
|
|
12720
12748
|
//----------------------------------------------------------------------------------------------------------------
|
|
12721
12749
|
className = _a.className;
|
|
12722
12750
|
var id = useId();
|
|
@@ -12745,7 +12773,7 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
12745
12773
|
}, [value]);
|
|
12746
12774
|
// State -----------------------------------------------------------------------------------------------------------
|
|
12747
12775
|
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
12748
|
-
var _e =
|
|
12776
|
+
var _e = useState(), errorHelperText = _e[0], setErrorHelperText = _e[1];
|
|
12749
12777
|
var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
|
|
12750
12778
|
var _g = useState(false), isOpenLinkDialog = _g[0], setIsOpenLinkDialog = _g[1];
|
|
12751
12779
|
var _h = useAutoUpdateState$1(initData), data = _h[0], setData = _h[1];
|
|
@@ -12771,11 +12799,11 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
12771
12799
|
(_c = textFieldRef.current) === null || _c === void 0 ? void 0 : _c.focus();
|
|
12772
12800
|
}
|
|
12773
12801
|
}, [hideUpload, hideUrl]);
|
|
12774
|
-
// Function -
|
|
12775
|
-
var
|
|
12802
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
12803
|
+
var setErrorErrorHelperText = useCallback(function (error, errorHelperText) {
|
|
12776
12804
|
setError(error);
|
|
12777
|
-
|
|
12778
|
-
}, [setError
|
|
12805
|
+
setErrorHelperText(errorHelperText);
|
|
12806
|
+
}, [setError]);
|
|
12779
12807
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
12780
12808
|
var validate = useCallback(function (value) {
|
|
12781
12809
|
var isEmptyValue = false;
|
|
@@ -12786,19 +12814,19 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
12786
12814
|
isEmptyValue = empty(text.trim());
|
|
12787
12815
|
}
|
|
12788
12816
|
if (required && (isEmptyValue || empty(value))) {
|
|
12789
|
-
|
|
12817
|
+
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
12790
12818
|
return false;
|
|
12791
12819
|
}
|
|
12792
12820
|
if (onValidate) {
|
|
12793
12821
|
var onValidateResult = onValidate(value);
|
|
12794
12822
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
12795
|
-
|
|
12823
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
12796
12824
|
return false;
|
|
12797
12825
|
}
|
|
12798
12826
|
}
|
|
12799
|
-
|
|
12827
|
+
setErrorErrorHelperText(false, undefined);
|
|
12800
12828
|
return true;
|
|
12801
|
-
}, [required, onValidate,
|
|
12829
|
+
}, [required, onValidate, setErrorErrorHelperText]);
|
|
12802
12830
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
12803
12831
|
useLayoutEffect(function () {
|
|
12804
12832
|
var lastValue = value;
|
|
@@ -12831,8 +12859,8 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
12831
12859
|
focus: focus,
|
|
12832
12860
|
focusValidate: focus,
|
|
12833
12861
|
validate: function () { return validate(value); },
|
|
12834
|
-
setError: function (error,
|
|
12835
|
-
return
|
|
12862
|
+
setError: function (error, errorHelperText) {
|
|
12863
|
+
return setErrorErrorHelperText(error, error ? errorHelperText : undefined);
|
|
12836
12864
|
},
|
|
12837
12865
|
};
|
|
12838
12866
|
onAddValueItem(id, commands);
|
|
@@ -12863,14 +12891,13 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
12863
12891
|
disabled,
|
|
12864
12892
|
focus,
|
|
12865
12893
|
validate,
|
|
12866
|
-
initHelperText,
|
|
12867
12894
|
ref,
|
|
12868
12895
|
onAddValueItem,
|
|
12869
12896
|
onRemoveValueItem,
|
|
12870
12897
|
id,
|
|
12871
12898
|
setValue,
|
|
12872
12899
|
setDisabled,
|
|
12873
|
-
|
|
12900
|
+
setErrorErrorHelperText,
|
|
12874
12901
|
data,
|
|
12875
12902
|
setData,
|
|
12876
12903
|
]);
|
|
@@ -12956,7 +12983,7 @@ styleInject(css_248z$1);var FormFile = React__default.forwardRef(function (_a, r
|
|
|
12956
12983
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
12957
12984
|
return (React__default.createElement(FormItemBase, { variant: variant, size: size, color: color, focused: focused, className: classNames$1(className, 'FormValueItem', 'FormFile', "variant-".concat(variant), "size-".concat(size), !!initLabel && 'with-label', !!fullWidth && 'full-width', !!hideUrl && 'hide-file-name', !!hideLink && 'hide-link', !!hideUpload && 'hide-upload', !!hideRemove && 'hide-remove', notEmpty(value) && 'with-value'), labelIcon: hideUrl ? labelIcon : undefined, label: hideUrl ? initLabel : undefined, error: error, required: required, fullWidth: fullWidth, hidden: hidden, helperText: React__default.createElement("div", null,
|
|
12958
12985
|
preview,
|
|
12959
|
-
React__default.createElement("div", null, helperText)), hideLabel: !hideUrl, helperTextProps: {
|
|
12986
|
+
React__default.createElement("div", null, error ? errorHelperText : helperText)), hideLabel: !hideUrl, helperTextProps: {
|
|
12960
12987
|
style: {
|
|
12961
12988
|
marginLeft: !hideUrl && variant !== 'standard' ? 14 : undefined,
|
|
12962
12989
|
marginTop: !hideUrl && variant === 'standard' ? 19 : undefined,
|