@pdg/react-form 1.0.64 → 1.0.66
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 +256 -244
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +256 -244
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2207,7 +2207,7 @@ styleInject(css_248z$l);var FormTextField = React.forwardRef(function (_a, ref)
|
|
|
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.forwardRef(function (_a, ref)
|
|
|
2228
2228
|
var fullWidth = React.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 = React.useState(), errorHelperText = _e[0], setErrorHelperText = _e[1];
|
|
2232
2232
|
var _f = React.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.forwardRef(function (_a, ref)
|
|
|
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 = React.useCallback(function (error, errorHelperText) {
|
|
2309
2309
|
setError(error);
|
|
2310
|
-
|
|
2311
|
-
}, [setError
|
|
2310
|
+
setErrorHelperText(errorHelperText);
|
|
2311
|
+
}, [setError]);
|
|
2312
2312
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
2313
2313
|
var validate = React.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 = React.useMemo(function () {
|
|
2342
2342
|
var muiInputProps = __assign$7({}, initMuiInputProps);
|
|
@@ -2426,7 +2426,7 @@ styleInject(css_248z$l);var FormTextField = React.forwardRef(function (_a, ref)
|
|
|
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.forwardRef(function (_a, ref)
|
|
|
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.forwardRef(function (_a, ref)
|
|
|
2505
2504
|
onKeyDown(e);
|
|
2506
2505
|
}, [select, multiline, disableReturnKey, noFormValueItem, onKeyDown, onRequestSearchSubmit, name, value]);
|
|
2507
2506
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
2508
|
-
return (React.createElement(material.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.createElement(material.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.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.forwardRef(function (_a, ref) {
|
|
|
2554
2553
|
//------------------------------------------------------------------------------------------------------------------
|
|
2555
2554
|
var _e = React.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 = React.useState(), errorHelperText = _g[0], setErrorHelperText = _g[1];
|
|
2558
2557
|
// Effect ----------------------------------------------------------------------------------------------------------
|
|
2559
2558
|
React.useEffect(function () {
|
|
2560
2559
|
if (!isSame$2(value, initValue)) {
|
|
@@ -2564,27 +2563,27 @@ styleInject(css_248z$j);var FormTag = React.forwardRef(function (_a, ref) {
|
|
|
2564
2563
|
}
|
|
2565
2564
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2566
2565
|
}, []);
|
|
2567
|
-
// Function -
|
|
2568
|
-
var
|
|
2566
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
2567
|
+
var setErrorErrorHelperText = React.useCallback(function (error, errorHelperText) {
|
|
2569
2568
|
setError(error);
|
|
2570
|
-
|
|
2571
|
-
}, [setError
|
|
2569
|
+
setErrorHelperText(errorHelperText);
|
|
2570
|
+
}, [setError]);
|
|
2572
2571
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
2573
2572
|
var validate = React.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 = React.useCallback(function () {
|
|
2590
2589
|
return {
|
|
@@ -2704,7 +2703,7 @@ styleInject(css_248z$j);var FormTag = React.forwardRef(function (_a, ref) {
|
|
|
2704
2703
|
if (readOnly) {
|
|
2705
2704
|
renderProps.inputProps.className = classNames$1(renderProps.inputProps.className, 'Mui-disabled');
|
|
2706
2705
|
}
|
|
2707
|
-
return (React.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.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.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, initValue = _a.value, onChange = _a.onChange, props = __rest$4(_a, ["className", "allowNegative", "thousandSeparator", "allowDecimal", "decimalScale", "prefix", "suffix", "readOnly", "tabIndex", "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, props = __rest$4(_a, ["className", "allowNegative", "thousandSeparator", "allowDecimal", "decimalScale", "prefix", "suffix", "readOnly", "tabIndex", "InputProps", "inputProps", "value", "onChange"]);
|
|
4016
4015
|
var _b = React.useState(function () { return (empty(initValue) ? '' : "".concat(initValue)); }), strValue = _b[0], setStrValue = _b[1];
|
|
4017
4016
|
// Effect ------------------------------------------------------------------------------------------------------------
|
|
4018
4017
|
React.useEffect(function () {
|
|
@@ -4037,17 +4036,18 @@ NumberFormatCustom.displayName = 'NumberFormatCustom';var FormNumberDefaultProps
|
|
|
4037
4036
|
else {
|
|
4038
4037
|
inputProps.decimalScale = 0;
|
|
4039
4038
|
}
|
|
4040
|
-
return __assign$7(__assign$7({}, initMuiInputProps), { inputComponent: NumberFormatCustom, inputProps: inputProps });
|
|
4039
|
+
return __assign$7(__assign$7({}, initMuiInputProps), { inputComponent: NumberFormatCustom, inputProps: __assign$7(__assign$7({}, initInputProps), inputProps) });
|
|
4041
4040
|
}, [
|
|
4042
|
-
|
|
4041
|
+
readOnly,
|
|
4043
4042
|
allowNegative,
|
|
4044
|
-
|
|
4045
|
-
initMuiInputProps,
|
|
4043
|
+
thousandSeparator,
|
|
4046
4044
|
prefix,
|
|
4047
|
-
readOnly,
|
|
4048
|
-
tabIndex,
|
|
4049
4045
|
suffix,
|
|
4050
|
-
|
|
4046
|
+
tabIndex,
|
|
4047
|
+
allowDecimal,
|
|
4048
|
+
initMuiInputProps,
|
|
4049
|
+
initInputProps,
|
|
4050
|
+
decimalScale,
|
|
4051
4051
|
]);
|
|
4052
4052
|
// Event Handler -----------------------------------------------------------------------------------------------------
|
|
4053
4053
|
var handleChange = React.useCallback(function (value) {
|
|
@@ -4358,32 +4358,37 @@ function autoDash$1(companyNo) {
|
|
|
4358
4358
|
return onValue ? onValue(newValue) : newValue;
|
|
4359
4359
|
}, [onValue]);
|
|
4360
4360
|
var handleValidate = React.useCallback(function (value) {
|
|
4361
|
-
if (notEmpty(value)
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
sum
|
|
4379
|
-
|
|
4380
|
-
|
|
4361
|
+
if (notEmpty(value)) {
|
|
4362
|
+
if (value.length === 14 && value.includes('-')) {
|
|
4363
|
+
var jumin = value
|
|
4364
|
+
.replace(/-/g, '')
|
|
4365
|
+
.split('')
|
|
4366
|
+
.map(function (v) { return Number(v); });
|
|
4367
|
+
var ckarr = [2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5];
|
|
4368
|
+
for (var i = 0; i < jumin.length - 1; i += 1) {
|
|
4369
|
+
jumin[i] = jumin[i] * ckarr[i];
|
|
4370
|
+
}
|
|
4371
|
+
var juminlast = jumin[jumin.length - 1];
|
|
4372
|
+
var sum = 0;
|
|
4373
|
+
for (var i = 0; i < jumin.length - 1; i += 1) {
|
|
4374
|
+
sum += jumin[i];
|
|
4375
|
+
}
|
|
4376
|
+
sum = sum % 11;
|
|
4377
|
+
sum = 11 - sum;
|
|
4378
|
+
if (sum > 9) {
|
|
4379
|
+
sum = sum % 10;
|
|
4380
|
+
}
|
|
4381
|
+
if (sum != juminlast && juminlast != undefined) {
|
|
4382
|
+
return '유효하지 않은 값입니다.';
|
|
4383
|
+
}
|
|
4384
|
+
return onValidate ? onValidate(value) : true;
|
|
4385
|
+
}
|
|
4386
|
+
else {
|
|
4381
4387
|
return '유효하지 않은 값입니다.';
|
|
4382
4388
|
}
|
|
4383
|
-
return onValidate ? onValidate(value) : true;
|
|
4384
4389
|
}
|
|
4385
4390
|
else {
|
|
4386
|
-
return
|
|
4391
|
+
return onValidate ? onValidate(value) : true;
|
|
4387
4392
|
}
|
|
4388
4393
|
}, [onValidate]);
|
|
4389
4394
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
@@ -4526,7 +4531,7 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React.forwardRef(fu
|
|
|
4526
4531
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
4527
4532
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth,
|
|
4528
4533
|
//----------------------------------------------------------------------------------------------------------------
|
|
4529
|
-
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,
|
|
4534
|
+
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,
|
|
4530
4535
|
//----------------------------------------------------------------------------------------------------------------
|
|
4531
4536
|
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"]);
|
|
4532
4537
|
var id = React.useId();
|
|
@@ -4554,7 +4559,7 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React.forwardRef(fu
|
|
|
4554
4559
|
var _d = useAutoUpdateState$1(initValue), value = _d[0], setValue = _d[1];
|
|
4555
4560
|
var _e = useAutoUpdateState$1(initUncheckedValue), uncheckedValue = _e[0], setUncheckedValue = _e[1];
|
|
4556
4561
|
var _f = useAutoUpdateState$1(initError), error = _f[0], setError = _f[1];
|
|
4557
|
-
var _g =
|
|
4562
|
+
var _g = React.useState(), errorHelperText = _g[0], setErrorHelperText = _g[1];
|
|
4558
4563
|
var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
|
|
4559
4564
|
var _j = useAutoUpdateState$1(initData), data = _j[0], setData = _j[1];
|
|
4560
4565
|
// State - checked -------------------------------------------------------------------------------------------------
|
|
@@ -4584,23 +4589,23 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React.forwardRef(fu
|
|
|
4584
4589
|
(_d = actionRef.current) === null || _d === void 0 ? void 0 : _d.focusVisible();
|
|
4585
4590
|
}
|
|
4586
4591
|
}, [initInputRef, inputRef, initAction, actionRef]);
|
|
4587
|
-
// Function -
|
|
4588
|
-
var
|
|
4592
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
4593
|
+
var setErrorErrorHelperText = React.useCallback(function (error, errorHelperText) {
|
|
4589
4594
|
setError(error);
|
|
4590
|
-
|
|
4591
|
-
}, [setError
|
|
4595
|
+
setErrorHelperText(errorHelperText);
|
|
4596
|
+
}, [setError]);
|
|
4592
4597
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
4593
4598
|
var validate = React.useCallback(function (checked) {
|
|
4594
4599
|
if (onValidate) {
|
|
4595
4600
|
var onValidateResult = onValidate(checked);
|
|
4596
4601
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
4597
|
-
|
|
4602
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
4598
4603
|
return false;
|
|
4599
4604
|
}
|
|
4600
4605
|
}
|
|
4601
|
-
|
|
4606
|
+
setErrorErrorHelperText(false, undefined);
|
|
4602
4607
|
return true;
|
|
4603
|
-
}, [onValidate,
|
|
4608
|
+
}, [onValidate, setErrorErrorHelperText]);
|
|
4604
4609
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
4605
4610
|
React.useLayoutEffect(function () {
|
|
4606
4611
|
var lastChecked = checked;
|
|
@@ -4645,8 +4650,8 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React.forwardRef(fu
|
|
|
4645
4650
|
focus: focus,
|
|
4646
4651
|
focusValidate: focus,
|
|
4647
4652
|
validate: function () { return validate(checked); },
|
|
4648
|
-
setError: function (error,
|
|
4649
|
-
return
|
|
4653
|
+
setError: function (error, errorHelperText) {
|
|
4654
|
+
return setErrorErrorHelperText(error, error ? errorHelperText : undefined);
|
|
4650
4655
|
},
|
|
4651
4656
|
};
|
|
4652
4657
|
onAddValueItem(id, commands);
|
|
@@ -4682,13 +4687,12 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React.forwardRef(fu
|
|
|
4682
4687
|
exceptValue,
|
|
4683
4688
|
disabled,
|
|
4684
4689
|
validate,
|
|
4685
|
-
initHelperText,
|
|
4686
4690
|
id,
|
|
4687
4691
|
setChecked,
|
|
4688
4692
|
setValue,
|
|
4689
4693
|
setUncheckedValue,
|
|
4690
4694
|
setDisabled,
|
|
4691
|
-
|
|
4695
|
+
setErrorErrorHelperText,
|
|
4692
4696
|
data,
|
|
4693
4697
|
setData,
|
|
4694
4698
|
]);
|
|
@@ -4706,7 +4710,7 @@ FormItemBase.displayName = 'FormItemBase';var FormCheckbox = React.forwardRef(fu
|
|
|
4706
4710
|
}
|
|
4707
4711
|
}, [readOnly, setChecked, onValueChangeByUser, name, onRequestSearchSubmit]);
|
|
4708
4712
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
4709
|
-
return (React.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.createElement(material.FormControlLabel, { ref: labelRef, control: React.createElement(material.Checkbox, __assign$7({ name: name, color: color, size: size, inputRef: initInputRef ? initInputRef : inputRef, action: initAction ? initAction : actionRef, checked: checked, checkedIcon: React.createElement(iconsMaterial.CheckBox, { color: error ? 'error' : undefined }), icon: React.createElement(iconsMaterial.CheckBoxOutlineBlank, { color: error ? 'error' : undefined }), onChange: handleChange, disabled: disabled || readOnly }, props)), label: React.createElement(material.Typography, { color: error ? 'error' : readOnly || disabled ? theme.palette.text.disabled : undefined, whiteSpace: 'nowrap' }, text) }) }));
|
|
4713
|
+
return (React.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.createElement(material.FormControlLabel, { ref: labelRef, control: React.createElement(material.Checkbox, __assign$7({ name: name, color: color, size: size, inputRef: initInputRef ? initInputRef : inputRef, action: initAction ? initAction : actionRef, checked: checked, checkedIcon: React.createElement(iconsMaterial.CheckBox, { color: error ? 'error' : undefined }), icon: React.createElement(iconsMaterial.CheckBoxOutlineBlank, { color: error ? 'error' : undefined }), onChange: handleChange, disabled: disabled || readOnly }, props)), label: React.createElement(material.Typography, { color: error ? 'error' : readOnly || disabled ? theme.palette.text.disabled : undefined, whiteSpace: 'nowrap' }, text) }) }));
|
|
4710
4714
|
});
|
|
4711
4715
|
FormCheckbox.displayName = 'FormCheckbox';
|
|
4712
4716
|
FormCheckbox.defaultProps = FormCheckboxDefaultProps;var FormRadioGroupDefaultProps = {
|
|
@@ -4716,7 +4720,7 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
4716
4720
|
// type ------------------------------------------------------------------------------------------------------------
|
|
4717
4721
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth, hidden = _a.hidden,
|
|
4718
4722
|
//----------------------------------------------------------------------------------------------------------------
|
|
4719
|
-
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,
|
|
4723
|
+
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,
|
|
4720
4724
|
//----------------------------------------------------------------------------------------------------------------
|
|
4721
4725
|
className = _a.className, initStyle = _a.style, sx = _a.sx,
|
|
4722
4726
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -4740,7 +4744,7 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
4740
4744
|
// State -----------------------------------------------------------------------------------------------------------
|
|
4741
4745
|
var _d = useAutoUpdateState$1(initItems), items = _d[0], setItems = _d[1];
|
|
4742
4746
|
var _e = useAutoUpdateState$1(initError), error = _e[0], setError = _e[1];
|
|
4743
|
-
var _f =
|
|
4747
|
+
var _f = React.useState(), errorHelperText = _f[0], setErrorHelperText = _f[1];
|
|
4744
4748
|
var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
|
|
4745
4749
|
var _h = React.useState(false), isOnGetItemLoading = _h[0], setIsOnGetItemLoading = _h[1];
|
|
4746
4750
|
var _j = useAutoUpdateState$1(initLoading), loading = _j[0], setLoading = _j[1];
|
|
@@ -4845,27 +4849,27 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
4845
4849
|
var _a;
|
|
4846
4850
|
(_a = firstInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4847
4851
|
}, []);
|
|
4848
|
-
// Function -
|
|
4849
|
-
var
|
|
4852
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
4853
|
+
var setErrorErrorHelperText = React.useCallback(function (error, errorHelperText) {
|
|
4850
4854
|
setError(error);
|
|
4851
|
-
|
|
4852
|
-
}, [setError
|
|
4855
|
+
setErrorHelperText(errorHelperText);
|
|
4856
|
+
}, [setError]);
|
|
4853
4857
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
4854
4858
|
var validate = React.useCallback(function (value) {
|
|
4855
4859
|
if (required && empty(value)) {
|
|
4856
|
-
|
|
4860
|
+
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
4857
4861
|
return false;
|
|
4858
4862
|
}
|
|
4859
4863
|
if (onValidate) {
|
|
4860
4864
|
var onValidateResult = onValidate(value);
|
|
4861
4865
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
4862
|
-
|
|
4866
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
4863
4867
|
return false;
|
|
4864
4868
|
}
|
|
4865
4869
|
}
|
|
4866
|
-
|
|
4870
|
+
setErrorErrorHelperText(false, undefined);
|
|
4867
4871
|
return true;
|
|
4868
|
-
}, [required, onValidate,
|
|
4872
|
+
}, [required, onValidate, setErrorErrorHelperText]);
|
|
4869
4873
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
4870
4874
|
React.useLayoutEffect(function () {
|
|
4871
4875
|
var lastValue = value;
|
|
@@ -4900,8 +4904,8 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
4900
4904
|
focus: focus,
|
|
4901
4905
|
focusValidate: focus,
|
|
4902
4906
|
validate: function () { return validate(value); },
|
|
4903
|
-
setError: function (error,
|
|
4904
|
-
return
|
|
4907
|
+
setError: function (error, errorHelperText) {
|
|
4908
|
+
return setErrorErrorHelperText(error, error ? errorHelperText : undefined);
|
|
4905
4909
|
},
|
|
4906
4910
|
getItems: function () { return lastItems; },
|
|
4907
4911
|
setItems: function (items) {
|
|
@@ -4951,8 +4955,7 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
4951
4955
|
id,
|
|
4952
4956
|
setValue,
|
|
4953
4957
|
setDisabled,
|
|
4954
|
-
|
|
4955
|
-
initHelperText,
|
|
4958
|
+
setErrorErrorHelperText,
|
|
4956
4959
|
setItems,
|
|
4957
4960
|
setLoading,
|
|
4958
4961
|
data,
|
|
@@ -4995,7 +4998,7 @@ var FormRadioGroup = ToForwardRefExoticComponent(AutoTypeForwardRef(function (_a
|
|
|
4995
4998
|
}
|
|
4996
4999
|
}, [readOnly, items, getFinalValue, value, setValue, onValueChangeByUser, name, onRequestSearchSubmit]);
|
|
4997
5000
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
4998
|
-
return (React.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.createElement(React.Fragment, null,
|
|
5001
|
+
return (React.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.createElement(React.Fragment, null,
|
|
4999
5002
|
!fullWidth && !isOnGetItemLoading && !loading && items && (React.createElement("div", { ref: resizeWidthDetectorRef, style: {
|
|
5000
5003
|
display: 'grid',
|
|
5001
5004
|
position: 'absolute',
|
|
@@ -5031,7 +5034,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
5031
5034
|
// type ------------------------------------------------------------------------------------------------------------
|
|
5032
5035
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initFullWidth = _a.fullWidth,
|
|
5033
5036
|
//----------------------------------------------------------------------------------------------------------------
|
|
5034
|
-
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,
|
|
5037
|
+
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,
|
|
5035
5038
|
//----------------------------------------------------------------------------------------------------------------
|
|
5036
5039
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate,
|
|
5037
5040
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -5086,7 +5089,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
5086
5089
|
var _f = React.useState(false), isOnGetItemLoading = _f[0], setIsOnGetItemLoading = _f[1];
|
|
5087
5090
|
var _g = useAutoUpdateState$1(initItems), items = _g[0], setItems = _g[1];
|
|
5088
5091
|
var _h = useAutoUpdateState$1(initError), error = _h[0], setError = _h[1];
|
|
5089
|
-
var _j =
|
|
5092
|
+
var _j = React.useState(), errorHelperText = _j[0], setErrorHelperText = _j[1];
|
|
5090
5093
|
var _k = useAutoUpdateState$1(initLoading), loading = _k[0], setLoading = _k[1];
|
|
5091
5094
|
var _l = useAutoUpdateState$1(initDisabled), disabled = _l[0], setDisabled = _l[1];
|
|
5092
5095
|
var _m = useAutoUpdateState$1(initData), data = _m[0], setData = _m[1];
|
|
@@ -5225,27 +5228,27 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
5225
5228
|
var _a;
|
|
5226
5229
|
(_a = refForButtonResizeHeightDetect.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
5227
5230
|
}, [refForButtonResizeHeightDetect]);
|
|
5228
|
-
// Function -
|
|
5229
|
-
var
|
|
5231
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
5232
|
+
var setErrorErrorHelperText = React.useCallback(function (error, errorHelperText) {
|
|
5230
5233
|
setError(error);
|
|
5231
|
-
|
|
5232
|
-
}, [setError
|
|
5234
|
+
setErrorHelperText(errorHelperText);
|
|
5235
|
+
}, [setError]);
|
|
5233
5236
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
5234
5237
|
var validate = React.useCallback(function (value) {
|
|
5235
5238
|
if (required && empty(value)) {
|
|
5236
|
-
|
|
5239
|
+
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
5237
5240
|
return false;
|
|
5238
5241
|
}
|
|
5239
5242
|
if (onValidate) {
|
|
5240
5243
|
var onValidateResult = onValidate(value);
|
|
5241
5244
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
5242
|
-
|
|
5245
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
5243
5246
|
return false;
|
|
5244
5247
|
}
|
|
5245
5248
|
}
|
|
5246
|
-
|
|
5249
|
+
setErrorErrorHelperText(false, undefined);
|
|
5247
5250
|
return true;
|
|
5248
|
-
}, [required, onValidate,
|
|
5251
|
+
}, [required, onValidate, setErrorErrorHelperText]);
|
|
5249
5252
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
5250
5253
|
React.useLayoutEffect(function () {
|
|
5251
5254
|
if (ref || onAddValueItem) {
|
|
@@ -5282,7 +5285,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
5282
5285
|
focusValidate: focus,
|
|
5283
5286
|
validate: function () { return validate(value); },
|
|
5284
5287
|
setError: function (error, errorText) {
|
|
5285
|
-
return
|
|
5288
|
+
return setErrorErrorHelperText(error, error ? errorText : undefined);
|
|
5286
5289
|
},
|
|
5287
5290
|
getFormValueSeparator: function () { return formValueSeparator; },
|
|
5288
5291
|
isFormValueSort: function () { return !!formValueSort; },
|
|
@@ -5341,8 +5344,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
5341
5344
|
id,
|
|
5342
5345
|
setValue,
|
|
5343
5346
|
setDisabled,
|
|
5344
|
-
|
|
5345
|
-
initHelperText,
|
|
5347
|
+
setErrorErrorHelperText,
|
|
5346
5348
|
setItems,
|
|
5347
5349
|
setLoading,
|
|
5348
5350
|
data,
|
|
@@ -5433,7 +5435,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
|
|
|
5433
5435
|
theme.palette.error.main,
|
|
5434
5436
|
type,
|
|
5435
5437
|
]);
|
|
5436
|
-
return (React.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.createElement("div", { style: { opacity: 0.54 }, ref: refForLoadingResizeHeightDetect },
|
|
5438
|
+
return (React.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.createElement("div", { style: { opacity: 0.54 }, ref: refForLoadingResizeHeightDetect },
|
|
5437
5439
|
React.createElement(material.CircularProgress, { size: 16, color: 'inherit' }))) : (React.createElement(React.Fragment, null,
|
|
5438
5440
|
!fullWidth && !isOnGetItemLoading && !loading && items && (React.createElement("div", { ref: refForResizeWidthDetect, style: {
|
|
5439
5441
|
display: 'grid',
|
|
@@ -5459,7 +5461,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5459
5461
|
//----------------------------------------------------------------------------------------------------------------
|
|
5460
5462
|
precision = _a.precision, highlightSelectedOnly = _a.highlightSelectedOnly, icon = _a.icon, emptyIcon = _a.emptyIcon, max = _a.max, hidden = _a.hidden,
|
|
5461
5463
|
//----------------------------------------------------------------------------------------------------------------
|
|
5462
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, readOnly = _a.readOnly, required = _a.required, initDisabled = _a.disabled, initError = _a.error,
|
|
5464
|
+
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,
|
|
5463
5465
|
//----------------------------------------------------------------------------------------------------------------
|
|
5464
5466
|
className = _a.className, initStyle = _a.style, sx = _a.sx;
|
|
5465
5467
|
var id = React.useId();
|
|
@@ -5476,7 +5478,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5476
5478
|
var inputRef = React.useRef();
|
|
5477
5479
|
// State -----------------------------------------------------------------------------------------------------------
|
|
5478
5480
|
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
5479
|
-
var _e =
|
|
5481
|
+
var _e = React.useState(), errorHelperText = _e[0], setErrorHelperText = _e[1];
|
|
5480
5482
|
var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
|
|
5481
5483
|
var _g = useAutoUpdateState$1(initData), data = _g[0], setData = _g[1];
|
|
5482
5484
|
// State - width, height -------------------------------------------------------------------------------------------
|
|
@@ -5521,25 +5523,25 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5521
5523
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
5522
5524
|
});
|
|
5523
5525
|
}, []);
|
|
5524
|
-
var
|
|
5526
|
+
var setErrorErrorHelperText = React.useCallback(function (error, errorHelperText) {
|
|
5525
5527
|
setError(error);
|
|
5526
|
-
|
|
5527
|
-
}, [setError
|
|
5528
|
+
setErrorHelperText(errorHelperText);
|
|
5529
|
+
}, [setError]);
|
|
5528
5530
|
var validate = React.useCallback(function (value) {
|
|
5529
5531
|
if (required && (empty(value) || value === 0)) {
|
|
5530
|
-
|
|
5532
|
+
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
5531
5533
|
return false;
|
|
5532
5534
|
}
|
|
5533
5535
|
if (onValidate) {
|
|
5534
5536
|
var onValidateResult = onValidate(value);
|
|
5535
5537
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
5536
|
-
|
|
5538
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
5537
5539
|
return false;
|
|
5538
5540
|
}
|
|
5539
5541
|
}
|
|
5540
|
-
|
|
5542
|
+
setErrorErrorHelperText(false, undefined);
|
|
5541
5543
|
return true;
|
|
5542
|
-
}, [required, onValidate,
|
|
5544
|
+
}, [required, onValidate, setErrorErrorHelperText]);
|
|
5543
5545
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
5544
5546
|
React.useLayoutEffect(function () {
|
|
5545
5547
|
var lastValue = value;
|
|
@@ -5572,8 +5574,8 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5572
5574
|
focus: focus,
|
|
5573
5575
|
focusValidate: focus,
|
|
5574
5576
|
validate: function () { return validate(value); },
|
|
5575
|
-
setError: function (error,
|
|
5576
|
-
return
|
|
5577
|
+
setError: function (error, errorHelperText) {
|
|
5578
|
+
return setErrorErrorHelperText(error, error ? errorHelperText : undefined);
|
|
5577
5579
|
},
|
|
5578
5580
|
};
|
|
5579
5581
|
onAddValueItem(id, commands);
|
|
@@ -5605,14 +5607,13 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5605
5607
|
disabled,
|
|
5606
5608
|
focus,
|
|
5607
5609
|
validate,
|
|
5608
|
-
initHelperText,
|
|
5609
5610
|
ref,
|
|
5610
5611
|
onAddValueItem,
|
|
5611
5612
|
onRemoveValueItem,
|
|
5612
5613
|
id,
|
|
5613
5614
|
setValue,
|
|
5614
5615
|
setDisabled,
|
|
5615
|
-
|
|
5616
|
+
setErrorErrorHelperText,
|
|
5616
5617
|
data,
|
|
5617
5618
|
setData,
|
|
5618
5619
|
]);
|
|
@@ -5631,7 +5632,7 @@ FormToggleButtonGroup.defaultProps = FormToggleButtonGroupDefaultProps;var FormR
|
|
|
5631
5632
|
}
|
|
5632
5633
|
}, [readOnly, getFinalValue, setValue, onValueChangeByUser, name, onRequestSearchSubmit]);
|
|
5633
5634
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
5634
|
-
return (React.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.createElement(material.Rating, { ref: ratingRef, size: size === 'medium' ? 'large' : 'medium', name: name, precision: precision, highlightSelectedOnly: highlightSelectedOnly, value: value, disabled: disabled || readOnly, max: max, icon: React.createElement(FormIcon, { color: color, fontSize: 'inherit' }, icon ? icon : 'Star'), emptyIcon: React.createElement(FormIcon, { fontSize: 'inherit' }, emptyIcon ? emptyIcon : 'StarBorder'), onChange: handleChange, onFocus: function () { return setFocused(initFocused || true); }, onBlur: function () { return setFocused(initFocused || false); } }) }));
|
|
5635
|
+
return (React.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.createElement(material.Rating, { ref: ratingRef, size: size === 'medium' ? 'large' : 'medium', name: name, precision: precision, highlightSelectedOnly: highlightSelectedOnly, value: value, disabled: disabled || readOnly, max: max, icon: React.createElement(FormIcon, { color: color, fontSize: 'inherit' }, icon ? icon : 'Star'), emptyIcon: React.createElement(FormIcon, { fontSize: 'inherit' }, emptyIcon ? emptyIcon : 'StarBorder'), onChange: handleChange, onFocus: function () { return setFocused(initFocused || true); }, onBlur: function () { return setFocused(initFocused || false); } }) }));
|
|
5635
5636
|
});
|
|
5636
5637
|
FormRating.displayName = 'FormRating';
|
|
5637
5638
|
FormRating.defaultProps = FormRatingDefaultProps;var propTypes = {exports: {}};var reactIs = {exports: {}};var reactIs_production_min = {};/** @license React v16.13.1
|
|
@@ -7477,7 +7478,7 @@ styleInject(css_248z$c);var FormTextEditor = React.forwardRef(function (_a, ref)
|
|
|
7477
7478
|
//----------------------------------------------------------------------------------------------------------------
|
|
7478
7479
|
menubar = _a.menubar, height = _a.height, hidden = _a.hidden, onImageUpload = _a.onImageUpload,
|
|
7479
7480
|
//----------------------------------------------------------------------------------------------------------------
|
|
7480
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, readOnly = _a.readOnly, required = _a.required, initDisabled = _a.disabled, initError = _a.error,
|
|
7481
|
+
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,
|
|
7481
7482
|
//----------------------------------------------------------------------------------------------------------------
|
|
7482
7483
|
className = _a.className;
|
|
7483
7484
|
var id = React.useId();
|
|
@@ -7503,7 +7504,7 @@ styleInject(css_248z$c);var FormTextEditor = React.forwardRef(function (_a, ref)
|
|
|
7503
7504
|
}, [value]);
|
|
7504
7505
|
// State -----------------------------------------------------------------------------------------------------------
|
|
7505
7506
|
var _e = useAutoUpdateState$1(initError), error = _e[0], setError = _e[1];
|
|
7506
|
-
var _f =
|
|
7507
|
+
var _f = React.useState(), errorHelperText = _f[0], setErrorHelperText = _f[1];
|
|
7507
7508
|
var _g = React.useState(false), initialized = _g[0], setInitialized = _g[1];
|
|
7508
7509
|
var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
|
|
7509
7510
|
var _j = useAutoUpdateState$1(initData), data = _j[0], setData = _j[1];
|
|
@@ -7517,11 +7518,11 @@ styleInject(css_248z$c);var FormTextEditor = React.forwardRef(function (_a, ref)
|
|
|
7517
7518
|
textarea.style.display = 'none';
|
|
7518
7519
|
}
|
|
7519
7520
|
}, [editorRef]);
|
|
7520
|
-
// Function -
|
|
7521
|
-
var
|
|
7521
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
7522
|
+
var setErrorErrorHelperText = React.useCallback(function (error, errorHelperText) {
|
|
7522
7523
|
setError(error);
|
|
7523
|
-
|
|
7524
|
-
}, [setError
|
|
7524
|
+
setErrorHelperText(errorHelperText);
|
|
7525
|
+
}, [setError]);
|
|
7525
7526
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
7526
7527
|
var validate = React.useCallback(function (value) {
|
|
7527
7528
|
var isEmptyValue = false;
|
|
@@ -7532,19 +7533,19 @@ styleInject(css_248z$c);var FormTextEditor = React.forwardRef(function (_a, ref)
|
|
|
7532
7533
|
isEmptyValue = empty(text.trim());
|
|
7533
7534
|
}
|
|
7534
7535
|
if (required && (isEmptyValue || empty(value))) {
|
|
7535
|
-
|
|
7536
|
+
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
7536
7537
|
return false;
|
|
7537
7538
|
}
|
|
7538
7539
|
if (onValidate) {
|
|
7539
7540
|
var onValidateResult = onValidate(value);
|
|
7540
7541
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
7541
|
-
|
|
7542
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
7542
7543
|
return false;
|
|
7543
7544
|
}
|
|
7544
7545
|
}
|
|
7545
|
-
|
|
7546
|
+
setErrorErrorHelperText(false, undefined);
|
|
7546
7547
|
return true;
|
|
7547
|
-
}, [required, onValidate,
|
|
7548
|
+
}, [required, onValidate, setErrorErrorHelperText]);
|
|
7548
7549
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
7549
7550
|
React.useLayoutEffect(function () {
|
|
7550
7551
|
var lastValue = value;
|
|
@@ -7577,8 +7578,8 @@ styleInject(css_248z$c);var FormTextEditor = React.forwardRef(function (_a, ref)
|
|
|
7577
7578
|
focus: focus,
|
|
7578
7579
|
focusValidate: focus,
|
|
7579
7580
|
validate: function () { return validate(value); },
|
|
7580
|
-
setError: function (error,
|
|
7581
|
-
return
|
|
7581
|
+
setError: function (error, errorText) {
|
|
7582
|
+
return setErrorErrorHelperText(error, error ? errorText : undefined);
|
|
7582
7583
|
},
|
|
7583
7584
|
};
|
|
7584
7585
|
onAddValueItem(id, commands);
|
|
@@ -7608,17 +7609,16 @@ styleInject(css_248z$c);var FormTextEditor = React.forwardRef(function (_a, ref)
|
|
|
7608
7609
|
exceptValue,
|
|
7609
7610
|
disabled,
|
|
7610
7611
|
focus,
|
|
7611
|
-
validate,
|
|
7612
|
-
initHelperText,
|
|
7613
7612
|
ref,
|
|
7614
7613
|
onAddValueItem,
|
|
7615
7614
|
onRemoveValueItem,
|
|
7616
7615
|
id,
|
|
7617
7616
|
setValue,
|
|
7618
7617
|
setDisabled,
|
|
7619
|
-
|
|
7618
|
+
setErrorErrorHelperText,
|
|
7620
7619
|
data,
|
|
7621
7620
|
setData,
|
|
7621
|
+
validate,
|
|
7622
7622
|
]);
|
|
7623
7623
|
// Event Handler ---------------------------------------------------------------------------------------------------
|
|
7624
7624
|
var handleEditorChange = React.useCallback(function (value) {
|
|
@@ -7646,7 +7646,7 @@ styleInject(css_248z$c);var FormTextEditor = React.forwardRef(function (_a, ref)
|
|
|
7646
7646
|
});
|
|
7647
7647
|
}, [onImageUpload]);
|
|
7648
7648
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
7649
|
-
return (React.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.createElement(React.Fragment, null,
|
|
7649
|
+
return (React.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.createElement(React.Fragment, null,
|
|
7650
7650
|
!initialized ? React.createElement(material.Skeleton, { variant: 'rectangular', width: '100%', height: height }) : null,
|
|
7651
7651
|
React.createElement(Editor, { ref: editorRef, value: value, disabled: readOnly || disabled, init: {
|
|
7652
7652
|
height: height,
|
|
@@ -7679,7 +7679,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7679
7679
|
// type ------------------------------------------------------------------------------------------------------------
|
|
7680
7680
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
7681
7681
|
//----------------------------------------------------------------------------------------------------------------
|
|
7682
|
-
name = _a.name, labelIcon = _a.labelIcon, label = _a.label, initLoading = _a.loading, initItems = _a.items, initValue = _a.value, initData = _a.data, initError = _a.error,
|
|
7682
|
+
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,
|
|
7683
7683
|
//----------------------------------------------------------------------------------------------------------------
|
|
7684
7684
|
onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate,
|
|
7685
7685
|
//----------------------------------------------------------------------------------------------------------------
|
|
@@ -7703,7 +7703,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7703
7703
|
var _c = React.useState(false), isOnGetItemLoading = _c[0], setIsOnGetItemLoading = _c[1];
|
|
7704
7704
|
var _d = useAutoUpdateState$1(initItems), items = _d[0], setItems = _d[1];
|
|
7705
7705
|
var _e = useAutoUpdateState$1(initError), error = _e[0], setError = _e[1];
|
|
7706
|
-
var _f =
|
|
7706
|
+
var _f = React.useState(), errorHelperText = _f[0], setErrorHelperText = _f[1];
|
|
7707
7707
|
var _g = useAutoUpdateState$1(initLoading), loading = _g[0], setLoading = _g[1];
|
|
7708
7708
|
var _h = useAutoUpdateState$1(initDisabled), disabled = _h[0], setDisabled = _h[1];
|
|
7709
7709
|
var _j = React.useState(undefined), inputValue = _j[0], setInputValue = _j[1];
|
|
@@ -7945,27 +7945,27 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
7945
7945
|
var _a;
|
|
7946
7946
|
(_a = textFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
7947
7947
|
}, [textFieldRef]);
|
|
7948
|
-
// Function -
|
|
7949
|
-
var
|
|
7948
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
7949
|
+
var setErrorErrorHelperText = React.useCallback(function (error, errorHelperText) {
|
|
7950
7950
|
setError(error);
|
|
7951
|
-
|
|
7952
|
-
}, [setError
|
|
7951
|
+
setErrorHelperText(errorHelperText);
|
|
7952
|
+
}, [setError]);
|
|
7953
7953
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
7954
7954
|
var validate = React.useCallback(function (value) {
|
|
7955
7955
|
if (required && empty(value)) {
|
|
7956
|
-
|
|
7956
|
+
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
7957
7957
|
return false;
|
|
7958
7958
|
}
|
|
7959
7959
|
if (onValidate) {
|
|
7960
7960
|
var onValidateResult = onValidate(value);
|
|
7961
7961
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
7962
|
-
|
|
7962
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
7963
7963
|
return false;
|
|
7964
7964
|
}
|
|
7965
7965
|
}
|
|
7966
|
-
|
|
7966
|
+
setErrorErrorHelperText(false, undefined);
|
|
7967
7967
|
return true;
|
|
7968
|
-
}, [required, onValidate,
|
|
7968
|
+
}, [required, onValidate, setErrorErrorHelperText]);
|
|
7969
7969
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
7970
7970
|
React.useLayoutEffect(function () {
|
|
7971
7971
|
if (ref || onAddValueItem) {
|
|
@@ -8002,7 +8002,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
8002
8002
|
focusValidate: focus,
|
|
8003
8003
|
validate: function () { return validate(value); },
|
|
8004
8004
|
setError: function (error, errorText) {
|
|
8005
|
-
return
|
|
8005
|
+
return setErrorErrorHelperText(error, error ? errorText : undefined);
|
|
8006
8006
|
},
|
|
8007
8007
|
getFormValueSeparator: function () { return formValueSeparator; },
|
|
8008
8008
|
isFormValueSort: function () { return !!formValueSort; },
|
|
@@ -8061,8 +8061,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
8061
8061
|
id,
|
|
8062
8062
|
setValue,
|
|
8063
8063
|
setDisabled,
|
|
8064
|
-
|
|
8065
|
-
initHelperText,
|
|
8064
|
+
setErrorErrorHelperText,
|
|
8066
8065
|
setItems,
|
|
8067
8066
|
setLoading,
|
|
8068
8067
|
data,
|
|
@@ -8131,7 +8130,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
|
|
|
8131
8130
|
}
|
|
8132
8131
|
}, renderTags: function (value, getTagProps) {
|
|
8133
8132
|
return value.map(function (option, index) { return (React.createElement(material.Chip, __assign$7({ size: 'small', label: onRenderTag ? onRenderTag(option) : option.label }, getTagProps({ index: index })))); });
|
|
8134
|
-
}, renderInput: function (params) { return (React.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.createElement(React.Fragment, null,
|
|
8133
|
+
}, renderInput: function (params) { return (React.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.createElement(React.Fragment, null,
|
|
8135
8134
|
loading || isOnGetItemLoading ? React.createElement(CircularProgress, { color: 'inherit', size: 20 }) : null,
|
|
8136
8135
|
params.InputProps.endAdornment)) }), inputProps: readOnly || disabled ? __assign$7(__assign$7({}, params.inputProps), { tabIndex: -1 }) : params.inputProps }))); } }));
|
|
8137
8136
|
}));
|
|
@@ -10369,7 +10368,7 @@ styleInject(css_248z$7);var PrivateDatePicker = React.forwardRef(function (_a, r
|
|
|
10369
10368
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
10370
10369
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
10371
10370
|
//--------------------------------------------------------------------------------------------------------------------
|
|
10372
|
-
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,
|
|
10371
|
+
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,
|
|
10373
10372
|
//--------------------------------------------------------------------------------------------------------------------
|
|
10374
10373
|
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"]);
|
|
10375
10374
|
var id = React.useId();
|
|
@@ -10394,7 +10393,7 @@ styleInject(css_248z$7);var PrivateDatePicker = React.forwardRef(function (_a, r
|
|
|
10394
10393
|
// State -----------------------------------------------------------------------------------------------------------
|
|
10395
10394
|
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
10396
10395
|
var _e = React.useState(null), timeError = _e[0], setTimeError = _e[1];
|
|
10397
|
-
var _f =
|
|
10396
|
+
var _f = React.useState(), errorHelperText = _f[0], setErrorHelperText = _f[1];
|
|
10398
10397
|
var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
|
|
10399
10398
|
var _h = useAutoUpdateState$1(initData), data = _h[0], setData = _h[1];
|
|
10400
10399
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
@@ -10509,39 +10508,39 @@ styleInject(css_248z$7);var PrivateDatePicker = React.forwardRef(function (_a, r
|
|
|
10509
10508
|
var _a;
|
|
10510
10509
|
(_a = textFieldInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
10511
10510
|
}, [textFieldInputRef]);
|
|
10512
|
-
// Function -
|
|
10513
|
-
var
|
|
10511
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
10512
|
+
var setErrorErrorHelperText = React.useCallback(function (error, helperText) {
|
|
10514
10513
|
setError(error);
|
|
10515
|
-
|
|
10516
|
-
}, [setError
|
|
10514
|
+
setErrorHelperText(helperText);
|
|
10515
|
+
}, [setError]);
|
|
10517
10516
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
10518
10517
|
var validate = React.useCallback(function (value) {
|
|
10519
10518
|
if (required && empty(value)) {
|
|
10520
|
-
|
|
10519
|
+
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
10521
10520
|
return false;
|
|
10522
10521
|
}
|
|
10523
10522
|
if (value && !value.isValid()) {
|
|
10524
|
-
|
|
10523
|
+
setErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
10525
10524
|
return false;
|
|
10526
10525
|
}
|
|
10527
10526
|
if (datePickerErrorRef.current) {
|
|
10528
|
-
|
|
10527
|
+
setErrorErrorHelperText(true, getDateValidationErrorText(datePickerErrorRef.current));
|
|
10529
10528
|
return false;
|
|
10530
10529
|
}
|
|
10531
10530
|
if (timeError) {
|
|
10532
|
-
|
|
10531
|
+
setErrorErrorHelperText(true, getDateValidationErrorText(timeError));
|
|
10533
10532
|
return false;
|
|
10534
10533
|
}
|
|
10535
10534
|
if (onValidate) {
|
|
10536
10535
|
var onValidateResult = onValidate(value);
|
|
10537
10536
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
10538
|
-
|
|
10537
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
10539
10538
|
return false;
|
|
10540
10539
|
}
|
|
10541
10540
|
}
|
|
10542
|
-
|
|
10541
|
+
setErrorErrorHelperText(false, undefined);
|
|
10543
10542
|
return true;
|
|
10544
|
-
}, [required, timeError, onValidate,
|
|
10543
|
+
}, [required, timeError, onValidate, setErrorErrorHelperText]);
|
|
10545
10544
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
10546
10545
|
React.useLayoutEffect(function () {
|
|
10547
10546
|
if (ref || onAddValueItem) {
|
|
@@ -10576,7 +10575,7 @@ styleInject(css_248z$7);var PrivateDatePicker = React.forwardRef(function (_a, r
|
|
|
10576
10575
|
focusValidate: focus,
|
|
10577
10576
|
validate: function () { return validate(value); },
|
|
10578
10577
|
setError: function (error, errorText) {
|
|
10579
|
-
return
|
|
10578
|
+
return setErrorErrorHelperText(error, error ? errorText : undefined);
|
|
10580
10579
|
},
|
|
10581
10580
|
getFormValueFormat: function () { return formValueFormat; },
|
|
10582
10581
|
};
|
|
@@ -10619,8 +10618,7 @@ styleInject(css_248z$7);var PrivateDatePicker = React.forwardRef(function (_a, r
|
|
|
10619
10618
|
id,
|
|
10620
10619
|
setValue,
|
|
10621
10620
|
setDisabled,
|
|
10622
|
-
|
|
10623
|
-
initHelperText,
|
|
10621
|
+
setErrorErrorHelperText,
|
|
10624
10622
|
data,
|
|
10625
10623
|
setData,
|
|
10626
10624
|
]);
|
|
@@ -10775,14 +10773,14 @@ styleInject(css_248z$7);var PrivateDatePicker = React.forwardRef(function (_a, r
|
|
|
10775
10773
|
{
|
|
10776
10774
|
name: 'offset',
|
|
10777
10775
|
options: {
|
|
10778
|
-
offset: [0, error &&
|
|
10776
|
+
offset: [0, error && errorHelperText ? 8 : -14],
|
|
10779
10777
|
},
|
|
10780
10778
|
},
|
|
10781
10779
|
],
|
|
10782
10780
|
}, title: React.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); } })) },
|
|
10783
10781
|
React.createElement("div", { style: { display: fullWidth ? 'block' : 'inline-block' } },
|
|
10784
10782
|
React.createElement(xDatePickers.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)))),
|
|
10785
|
-
!formColWithHelperText && helperText && (React.createElement(material.FormHelperText, { error: error, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, helperText))))));
|
|
10783
|
+
!formColWithHelperText && (helperText || (error && errorHelperText)) && (React.createElement(material.FormHelperText, { error: error, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, error ? errorHelperText : helperText))))));
|
|
10786
10784
|
});
|
|
10787
10785
|
PrivateDatePicker.displayName = 'PrivateDatePicker';
|
|
10788
10786
|
PrivateDatePicker.defaultProps = PrivateDatePickerDefaultProps;var PrivateDateTimePickerDefaultProps = {
|
|
@@ -11073,7 +11071,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
11073
11071
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
11074
11072
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
11075
11073
|
//--------------------------------------------------------------------------------------------------------------------
|
|
11076
|
-
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,
|
|
11074
|
+
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,
|
|
11077
11075
|
//--------------------------------------------------------------------------------------------------------------------
|
|
11078
11076
|
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"]);
|
|
11079
11077
|
var id = React.useId();
|
|
@@ -11098,7 +11096,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
11098
11096
|
// State -----------------------------------------------------------------------------------------------------------
|
|
11099
11097
|
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
11100
11098
|
var _e = React.useState(null), timeError = _e[0], setTimeError = _e[1];
|
|
11101
|
-
var _f =
|
|
11099
|
+
var _f = React.useState(), errorHelperText = _f[0], setErrorHelperText = _f[1];
|
|
11102
11100
|
var _g = useAutoUpdateState$1(initDisabled), disabled = _g[0], setDisabled = _g[1];
|
|
11103
11101
|
var _h = useAutoUpdateState$1(initData), data = _h[0], setData = _h[1];
|
|
11104
11102
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
@@ -11213,39 +11211,39 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
11213
11211
|
var _a;
|
|
11214
11212
|
(_a = textFieldInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
11215
11213
|
}, [textFieldInputRef]);
|
|
11216
|
-
// Function -
|
|
11217
|
-
var
|
|
11214
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
11215
|
+
var setErrorErrorHelperText = React.useCallback(function (error, errorHelperText) {
|
|
11218
11216
|
setError(error);
|
|
11219
|
-
|
|
11220
|
-
}, [setError
|
|
11217
|
+
setErrorHelperText(errorHelperText);
|
|
11218
|
+
}, [setError]);
|
|
11221
11219
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
11222
11220
|
var validate = React.useCallback(function (value) {
|
|
11223
11221
|
if (required && empty(value)) {
|
|
11224
|
-
|
|
11222
|
+
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
11225
11223
|
return false;
|
|
11226
11224
|
}
|
|
11227
11225
|
if (value && !value.isValid()) {
|
|
11228
|
-
|
|
11226
|
+
setErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
11229
11227
|
return false;
|
|
11230
11228
|
}
|
|
11231
11229
|
if (datePickerErrorRef.current) {
|
|
11232
|
-
|
|
11230
|
+
setErrorErrorHelperText(true, getDateValidationErrorText(datePickerErrorRef.current));
|
|
11233
11231
|
return false;
|
|
11234
11232
|
}
|
|
11235
11233
|
if (timeError) {
|
|
11236
|
-
|
|
11234
|
+
setErrorErrorHelperText(true, getDateValidationErrorText(timeError));
|
|
11237
11235
|
return false;
|
|
11238
11236
|
}
|
|
11239
11237
|
if (onValidate) {
|
|
11240
11238
|
var onValidateResult = onValidate(value);
|
|
11241
11239
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
11242
|
-
|
|
11240
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
11243
11241
|
return false;
|
|
11244
11242
|
}
|
|
11245
11243
|
}
|
|
11246
|
-
|
|
11244
|
+
setErrorErrorHelperText(false, undefined);
|
|
11247
11245
|
return true;
|
|
11248
|
-
}, [required, timeError, onValidate,
|
|
11246
|
+
}, [required, timeError, onValidate, setErrorErrorHelperText]);
|
|
11249
11247
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
11250
11248
|
React.useLayoutEffect(function () {
|
|
11251
11249
|
if (ref || onAddValueItem) {
|
|
@@ -11280,7 +11278,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
11280
11278
|
focusValidate: focus,
|
|
11281
11279
|
validate: function () { return validate(value); },
|
|
11282
11280
|
setError: function (error, errorText) {
|
|
11283
|
-
return
|
|
11281
|
+
return setErrorErrorHelperText(error, error ? errorText : undefined);
|
|
11284
11282
|
},
|
|
11285
11283
|
getFormValueFormat: function () { return formValueFormat; },
|
|
11286
11284
|
};
|
|
@@ -11323,8 +11321,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
11323
11321
|
id,
|
|
11324
11322
|
setValue,
|
|
11325
11323
|
setDisabled,
|
|
11326
|
-
|
|
11327
|
-
initHelperText,
|
|
11324
|
+
setErrorErrorHelperText,
|
|
11328
11325
|
data,
|
|
11329
11326
|
setData,
|
|
11330
11327
|
]);
|
|
@@ -11503,7 +11500,7 @@ PrivateStaticDateTimePicker.defaultProps = PrivateStaticDateTimePickerDefaultPro
|
|
|
11503
11500
|
}, title: React.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); } })) },
|
|
11504
11501
|
React.createElement("div", { style: { display: fullWidth ? 'block' : 'inline-block' } },
|
|
11505
11502
|
React.createElement(xDatePickers.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)))),
|
|
11506
|
-
!formColWithHelperText && helperText && (React.createElement(material.FormHelperText, { error: error, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, helperText))))));
|
|
11503
|
+
!formColWithHelperText && (helperText || (error && errorHelperText)) && (React.createElement(material.FormHelperText, { error: error, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, error ? errorHelperText : helperText))))));
|
|
11507
11504
|
});
|
|
11508
11505
|
PrivateDateTimePicker.displayName = 'PrivateDateTimePicker';
|
|
11509
11506
|
PrivateDateTimePicker.defaultProps = PrivateDateTimePickerDefaultProps;var PrivateAlertDialogDefaultProps = {
|
|
@@ -12132,7 +12129,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12132
12129
|
// ID --------------------------------------------------------------------------------------------------------------
|
|
12133
12130
|
var initVariant = _a.variant, initSize = _a.size, initColor = _a.color, initFocused = _a.focused, initLabelShrink = _a.labelShrink, initFullWidth = _a.fullWidth,
|
|
12134
12131
|
//--------------------------------------------------------------------------------------------------------------------
|
|
12135
|
-
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,
|
|
12132
|
+
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,
|
|
12136
12133
|
// -------------------------------------------------------------------------------------------------------------------
|
|
12137
12134
|
className = _a.className;
|
|
12138
12135
|
var id = React.useId();
|
|
@@ -12159,8 +12156,10 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12159
12156
|
var _d = React.useState(false), startError = _d[0], setStartError = _d[1];
|
|
12160
12157
|
var _e = React.useState(false), endError = _e[0], setEndError = _e[1];
|
|
12161
12158
|
var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
|
|
12162
|
-
var _g =
|
|
12163
|
-
var _h =
|
|
12159
|
+
var _g = React.useState(), errorHelperText = _g[0], setErrorHelperText = _g[1];
|
|
12160
|
+
var _h = React.useState(), startErrorHelperText = _h[0], setStartErrorHelperText = _h[1];
|
|
12161
|
+
var _j = React.useState(), endErrorHelperText = _j[0], setEndErrorHelperText = _j[1];
|
|
12162
|
+
var _k = useAutoUpdateState$1(initData), data = _k[0], setData = _k[1];
|
|
12164
12163
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
12165
12164
|
var format = React.useMemo(function () { return initFormat || DEFAULT_FORMAT; }, [initFormat]);
|
|
12166
12165
|
// Function - getFinalValue ----------------------------------------------------------------------------------------
|
|
@@ -12181,77 +12180,77 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12181
12180
|
(_b = startDateTextFieldRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
12182
12181
|
}
|
|
12183
12182
|
}, [endError, startDateTextFieldRef, endDateTextFieldRef]);
|
|
12184
|
-
// Function -
|
|
12185
|
-
var
|
|
12183
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
12184
|
+
var setErrorErrorHelperText = React.useCallback(function (error, errorHelperText) {
|
|
12186
12185
|
setError(error);
|
|
12187
|
-
|
|
12188
|
-
}, [setError
|
|
12189
|
-
var
|
|
12186
|
+
setErrorHelperText(errorHelperText);
|
|
12187
|
+
}, [setError]);
|
|
12188
|
+
var setStartErrorErrorHelperText = React.useCallback(function (error, startErrorHelperText) {
|
|
12190
12189
|
setStartError(error);
|
|
12191
|
-
|
|
12192
|
-
}, [
|
|
12193
|
-
var
|
|
12190
|
+
setStartErrorHelperText(startErrorHelperText);
|
|
12191
|
+
}, []);
|
|
12192
|
+
var setEndErrorErrorHelperText = React.useCallback(function (error, endErrorHelperText) {
|
|
12194
12193
|
setEndError(error);
|
|
12195
|
-
|
|
12196
|
-
}, [
|
|
12194
|
+
setEndErrorHelperText(endErrorHelperText);
|
|
12195
|
+
}, []);
|
|
12197
12196
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
12198
12197
|
var validate = React.useCallback(function (value) {
|
|
12199
12198
|
var _a, _b;
|
|
12200
12199
|
if (required && (value[0] == null || value[1] == null)) {
|
|
12201
12200
|
if (value[0] == null && value[1] == null) {
|
|
12202
|
-
|
|
12201
|
+
setErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12203
12202
|
}
|
|
12204
12203
|
else if (value[0] == null) {
|
|
12205
|
-
|
|
12204
|
+
setStartErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12206
12205
|
}
|
|
12207
12206
|
else {
|
|
12208
|
-
|
|
12207
|
+
setEndErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12209
12208
|
}
|
|
12210
12209
|
return false;
|
|
12211
12210
|
}
|
|
12212
12211
|
if (requiredStart && value[0] == null) {
|
|
12213
|
-
|
|
12212
|
+
setStartErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12214
12213
|
return false;
|
|
12215
12214
|
}
|
|
12216
12215
|
if (requiredEnd && value[1] == null) {
|
|
12217
|
-
|
|
12216
|
+
setEndErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12218
12217
|
return false;
|
|
12219
12218
|
}
|
|
12220
12219
|
if (!allowSingleSelect && (value[0] || value[1]) && (value[0] == null || value[1] == null)) {
|
|
12221
12220
|
if (value[0] == null) {
|
|
12222
|
-
|
|
12221
|
+
setStartErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12223
12222
|
}
|
|
12224
12223
|
else {
|
|
12225
|
-
|
|
12224
|
+
setEndErrorErrorHelperText(true, '필수 입력 항목입니다.');
|
|
12226
12225
|
}
|
|
12227
12226
|
return false;
|
|
12228
12227
|
}
|
|
12229
12228
|
var startInputValue = ((_a = startDateTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
12230
12229
|
var endInputValue = ((_b = endDateTextFieldRef.current) === null || _b === void 0 ? void 0 : _b.value) || '';
|
|
12231
12230
|
if (notEmpty(startInputValue) && !dayjs(startInputValue, format).isValid()) {
|
|
12232
|
-
|
|
12231
|
+
setStartErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
12233
12232
|
return false;
|
|
12234
12233
|
}
|
|
12235
12234
|
if (notEmpty(endInputValue) && !dayjs(endInputValue, format).isValid()) {
|
|
12236
|
-
|
|
12235
|
+
setEndErrorErrorHelperText(true, '형식이 일치하지 않습니다.');
|
|
12237
12236
|
return false;
|
|
12238
12237
|
}
|
|
12239
12238
|
if (startInputDatePickerErrorRef.current) {
|
|
12240
|
-
|
|
12239
|
+
setStartErrorErrorHelperText(true, getDateValidationErrorText(startInputDatePickerErrorRef.current));
|
|
12241
12240
|
return false;
|
|
12242
12241
|
}
|
|
12243
12242
|
if (endInputDatePickerErrorRef.current) {
|
|
12244
|
-
|
|
12243
|
+
setEndErrorErrorHelperText(true, getDateValidationErrorText(endInputDatePickerErrorRef.current));
|
|
12245
12244
|
return false;
|
|
12246
12245
|
}
|
|
12247
12246
|
if (onValidate) {
|
|
12248
12247
|
var onValidateResult = onValidate(value);
|
|
12249
12248
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
12250
|
-
|
|
12249
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
12251
12250
|
return false;
|
|
12252
12251
|
}
|
|
12253
12252
|
}
|
|
12254
|
-
|
|
12253
|
+
setErrorErrorHelperText(false, undefined);
|
|
12255
12254
|
setStartError(false);
|
|
12256
12255
|
setEndError(false);
|
|
12257
12256
|
return true;
|
|
@@ -12262,10 +12261,9 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12262
12261
|
allowSingleSelect,
|
|
12263
12262
|
format,
|
|
12264
12263
|
onValidate,
|
|
12265
|
-
|
|
12266
|
-
|
|
12267
|
-
|
|
12268
|
-
setEndErrorHelperText,
|
|
12264
|
+
setErrorErrorHelperText,
|
|
12265
|
+
setStartErrorErrorHelperText,
|
|
12266
|
+
setEndErrorErrorHelperText,
|
|
12269
12267
|
]);
|
|
12270
12268
|
// Function activeMonth --------------------------------------------------------------------------------------------
|
|
12271
12269
|
var activeMonth = React.useCallback(function (month) {
|
|
@@ -12274,16 +12272,16 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12274
12272
|
(_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.activeMonth(month);
|
|
12275
12273
|
}, [containerRef]);
|
|
12276
12274
|
// State -----------------------------------------------------------------------------------------------------------
|
|
12277
|
-
var
|
|
12278
|
-
var
|
|
12279
|
-
var
|
|
12275
|
+
var _l = React.useState(false), open = _l[0], setOpen = _l[1];
|
|
12276
|
+
var _m = React.useState('start'), selectType = _m[0], setSelectType = _m[1];
|
|
12277
|
+
var _o = useAutoUpdateState$1(React.useCallback(function () {
|
|
12280
12278
|
return initValue || DEFAULT_VALUE;
|
|
12281
|
-
}, [initValue])), value =
|
|
12279
|
+
}, [initValue])), value = _o[0], setValue = _o[1];
|
|
12282
12280
|
var calendarCount = useAutoUpdateState$1(initCalendarCount || 2)[0];
|
|
12283
|
-
var
|
|
12281
|
+
var _p = React.useState(function () {
|
|
12284
12282
|
var now = dayjs();
|
|
12285
12283
|
return [now, now.add(1, 'month'), now.add(2, 'month')];
|
|
12286
|
-
}), months =
|
|
12284
|
+
}), months = _p[0], setMonths = _p[1];
|
|
12287
12285
|
// Memo --------------------------------------------------------------------------------------------------------------
|
|
12288
12286
|
var inputDatePickerProps = React.useMemo(function () { return ({
|
|
12289
12287
|
variant: variant,
|
|
@@ -12359,9 +12357,9 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12359
12357
|
var handleChange = React.useCallback(function (newValue) {
|
|
12360
12358
|
setValue(newValue);
|
|
12361
12359
|
setOpen(false);
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
}, [
|
|
12360
|
+
setStartErrorErrorHelperText(false, undefined);
|
|
12361
|
+
setEndErrorErrorHelperText(false, undefined);
|
|
12362
|
+
}, [setEndErrorErrorHelperText, setStartErrorErrorHelperText, setValue]);
|
|
12365
12363
|
var handleValueChange = React.useCallback(function (selectType, newValue, fromInput) {
|
|
12366
12364
|
var _a;
|
|
12367
12365
|
var finalValue;
|
|
@@ -12390,7 +12388,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12390
12388
|
}
|
|
12391
12389
|
}
|
|
12392
12390
|
}
|
|
12393
|
-
|
|
12391
|
+
setStartErrorErrorHelperText(false, undefined);
|
|
12394
12392
|
if (fromInput && newValue) {
|
|
12395
12393
|
activeMonth(newValue);
|
|
12396
12394
|
}
|
|
@@ -12401,7 +12399,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12401
12399
|
if (fromInput && newValue) {
|
|
12402
12400
|
activeMonth(newValue.subtract(calendarCount - 1, 'month'));
|
|
12403
12401
|
}
|
|
12404
|
-
|
|
12402
|
+
setStartErrorErrorHelperText(false, undefined);
|
|
12405
12403
|
}
|
|
12406
12404
|
else {
|
|
12407
12405
|
finalValue = [value[0], newValue];
|
|
@@ -12422,7 +12420,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12422
12420
|
(_a = startDateTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
12423
12421
|
});
|
|
12424
12422
|
}
|
|
12425
|
-
|
|
12423
|
+
setEndErrorErrorHelperText(false, undefined);
|
|
12426
12424
|
}
|
|
12427
12425
|
break;
|
|
12428
12426
|
}
|
|
@@ -12433,11 +12431,10 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12433
12431
|
}, [
|
|
12434
12432
|
setValue,
|
|
12435
12433
|
value,
|
|
12436
|
-
|
|
12437
|
-
initHelperText,
|
|
12434
|
+
setStartErrorErrorHelperText,
|
|
12438
12435
|
activeMonth,
|
|
12439
12436
|
calendarCount,
|
|
12440
|
-
|
|
12437
|
+
setEndErrorErrorHelperText,
|
|
12441
12438
|
open,
|
|
12442
12439
|
onRequestSearchSubmit,
|
|
12443
12440
|
name,
|
|
@@ -12569,7 +12566,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12569
12566
|
focusValidate: focusValidate,
|
|
12570
12567
|
validate: function () { return validate(value); },
|
|
12571
12568
|
setError: function (error, errorText) {
|
|
12572
|
-
return
|
|
12569
|
+
return setErrorErrorHelperText(error, error ? errorText : undefined);
|
|
12573
12570
|
},
|
|
12574
12571
|
getFormValueFormat: function () { return formValueFormat || FormDateRangePickerDefaultProps.format; },
|
|
12575
12572
|
getFormValueStartNameSuffix: function () {
|
|
@@ -12627,8 +12624,7 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12627
12624
|
id,
|
|
12628
12625
|
setValue,
|
|
12629
12626
|
setDisabled,
|
|
12630
|
-
|
|
12631
|
-
initHelperText,
|
|
12627
|
+
setErrorErrorHelperText,
|
|
12632
12628
|
data,
|
|
12633
12629
|
setData,
|
|
12634
12630
|
]);
|
|
@@ -12641,7 +12637,14 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12641
12637
|
{
|
|
12642
12638
|
name: 'offset',
|
|
12643
12639
|
options: {
|
|
12644
|
-
offset: [
|
|
12640
|
+
offset: [
|
|
12641
|
+
0,
|
|
12642
|
+
(error && errorHelperText) ||
|
|
12643
|
+
(startError && startErrorHelperText) ||
|
|
12644
|
+
(endError && endErrorHelperText)
|
|
12645
|
+
? 8
|
|
12646
|
+
: -14,
|
|
12647
|
+
],
|
|
12645
12648
|
},
|
|
12646
12649
|
},
|
|
12647
12650
|
],
|
|
@@ -12653,7 +12656,17 @@ var FormDateRangePicker = React.forwardRef(function (_a, ref) {
|
|
|
12653
12656
|
React.createElement(material.Grid, { item: true, sx: { px: 1 } }, "~"),
|
|
12654
12657
|
React.createElement(material.Grid, { item: true, flex: 1 },
|
|
12655
12658
|
React.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); } }))))),
|
|
12656
|
-
!formColWithHelperText &&
|
|
12659
|
+
!formColWithHelperText &&
|
|
12660
|
+
(helperText ||
|
|
12661
|
+
(error && errorHelperText) ||
|
|
12662
|
+
(startError && startErrorHelperText) ||
|
|
12663
|
+
(endError && endErrorHelperText)) && (React.createElement(material.FormHelperText, { error: error || startError || endError, style: { marginLeft: variant === 'standard' ? 0 : 14 } }, error
|
|
12664
|
+
? errorHelperText
|
|
12665
|
+
: startError
|
|
12666
|
+
? startErrorHelperText
|
|
12667
|
+
: endError
|
|
12668
|
+
? endErrorHelperText
|
|
12669
|
+
: helperText))))));
|
|
12657
12670
|
});
|
|
12658
12671
|
FormDateRangePicker.displayName = 'FormDateRangePicker';
|
|
12659
12672
|
FormDateRangePicker.defaultProps = FormDateRangePickerDefaultProps;var FormFileDefaultProps = {
|
|
@@ -12715,7 +12728,7 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
12715
12728
|
//----------------------------------------------------------------------------------------------------------------
|
|
12716
12729
|
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,
|
|
12717
12730
|
//----------------------------------------------------------------------------------------------------------------
|
|
12718
|
-
name = _a.name, labelIcon = _a.labelIcon, initLabel = _a.label, required = _a.required, readOnly = _a.readOnly, initDisabled = _a.disabled, initError = _a.error,
|
|
12731
|
+
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,
|
|
12719
12732
|
//----------------------------------------------------------------------------------------------------------------
|
|
12720
12733
|
className = _a.className;
|
|
12721
12734
|
var id = React.useId();
|
|
@@ -12744,7 +12757,7 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
12744
12757
|
}, [value]);
|
|
12745
12758
|
// State -----------------------------------------------------------------------------------------------------------
|
|
12746
12759
|
var _d = useAutoUpdateState$1(initError), error = _d[0], setError = _d[1];
|
|
12747
|
-
var _e =
|
|
12760
|
+
var _e = React.useState(), errorHelperText = _e[0], setErrorHelperText = _e[1];
|
|
12748
12761
|
var _f = useAutoUpdateState$1(initDisabled), disabled = _f[0], setDisabled = _f[1];
|
|
12749
12762
|
var _g = React.useState(false), isOpenLinkDialog = _g[0], setIsOpenLinkDialog = _g[1];
|
|
12750
12763
|
var _h = useAutoUpdateState$1(initData), data = _h[0], setData = _h[1];
|
|
@@ -12770,11 +12783,11 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
12770
12783
|
(_c = textFieldRef.current) === null || _c === void 0 ? void 0 : _c.focus();
|
|
12771
12784
|
}
|
|
12772
12785
|
}, [hideUpload, hideUrl]);
|
|
12773
|
-
// Function -
|
|
12774
|
-
var
|
|
12786
|
+
// Function - setErrorErrorHelperText -----------------------------------------------------------------------------------
|
|
12787
|
+
var setErrorErrorHelperText = React.useCallback(function (error, errorHelperText) {
|
|
12775
12788
|
setError(error);
|
|
12776
|
-
|
|
12777
|
-
}, [setError
|
|
12789
|
+
setErrorHelperText(errorHelperText);
|
|
12790
|
+
}, [setError]);
|
|
12778
12791
|
// Function - validate ---------------------------------------------------------------------------------------------
|
|
12779
12792
|
var validate = React.useCallback(function (value) {
|
|
12780
12793
|
var isEmptyValue = false;
|
|
@@ -12785,19 +12798,19 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
12785
12798
|
isEmptyValue = empty(text.trim());
|
|
12786
12799
|
}
|
|
12787
12800
|
if (required && (isEmptyValue || empty(value))) {
|
|
12788
|
-
|
|
12801
|
+
setErrorErrorHelperText(true, '필수 선택 항목입니다.');
|
|
12789
12802
|
return false;
|
|
12790
12803
|
}
|
|
12791
12804
|
if (onValidate) {
|
|
12792
12805
|
var onValidateResult = onValidate(value);
|
|
12793
12806
|
if (onValidateResult != null && onValidateResult !== true) {
|
|
12794
|
-
|
|
12807
|
+
setErrorErrorHelperText(true, onValidateResult);
|
|
12795
12808
|
return false;
|
|
12796
12809
|
}
|
|
12797
12810
|
}
|
|
12798
|
-
|
|
12811
|
+
setErrorErrorHelperText(false, undefined);
|
|
12799
12812
|
return true;
|
|
12800
|
-
}, [required, onValidate,
|
|
12813
|
+
}, [required, onValidate, setErrorErrorHelperText]);
|
|
12801
12814
|
// Commands --------------------------------------------------------------------------------------------------------
|
|
12802
12815
|
React.useLayoutEffect(function () {
|
|
12803
12816
|
var lastValue = value;
|
|
@@ -12830,8 +12843,8 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
12830
12843
|
focus: focus,
|
|
12831
12844
|
focusValidate: focus,
|
|
12832
12845
|
validate: function () { return validate(value); },
|
|
12833
|
-
setError: function (error,
|
|
12834
|
-
return
|
|
12846
|
+
setError: function (error, errorHelperText) {
|
|
12847
|
+
return setErrorErrorHelperText(error, error ? errorHelperText : undefined);
|
|
12835
12848
|
},
|
|
12836
12849
|
};
|
|
12837
12850
|
onAddValueItem(id, commands);
|
|
@@ -12862,14 +12875,13 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
12862
12875
|
disabled,
|
|
12863
12876
|
focus,
|
|
12864
12877
|
validate,
|
|
12865
|
-
initHelperText,
|
|
12866
12878
|
ref,
|
|
12867
12879
|
onAddValueItem,
|
|
12868
12880
|
onRemoveValueItem,
|
|
12869
12881
|
id,
|
|
12870
12882
|
setValue,
|
|
12871
12883
|
setDisabled,
|
|
12872
|
-
|
|
12884
|
+
setErrorErrorHelperText,
|
|
12873
12885
|
data,
|
|
12874
12886
|
setData,
|
|
12875
12887
|
]);
|
|
@@ -12955,7 +12967,7 @@ styleInject(css_248z$1);var FormFile = React.forwardRef(function (_a, ref) {
|
|
|
12955
12967
|
// Render ----------------------------------------------------------------------------------------------------------
|
|
12956
12968
|
return (React.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.createElement("div", null,
|
|
12957
12969
|
preview,
|
|
12958
|
-
React.createElement("div", null, helperText)), hideLabel: !hideUrl, helperTextProps: {
|
|
12970
|
+
React.createElement("div", null, error ? errorHelperText : helperText)), hideLabel: !hideUrl, helperTextProps: {
|
|
12959
12971
|
style: {
|
|
12960
12972
|
marginLeft: !hideUrl && variant !== 'standard' ? 14 : undefined,
|
|
12961
12973
|
marginTop: !hideUrl && variant === 'standard' ? 19 : undefined,
|