@pdg/react-form 1.0.82 → 1.0.84
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/FormItemTextFieldBase/FormPersonalNo/FormPersonalNo.d.ts +1 -0
- package/dist/FormItemTextFieldBase/FormPersonalNo/FormPersonalNo.types.d.ts +1 -0
- package/dist/index.esm.js +5 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4305,7 +4305,7 @@ NumberFormatCustom.displayName = 'NumberFormatCustom';var FormNumberDefaultProps
|
|
|
4305
4305
|
/********************************************************************************************************************
|
|
4306
4306
|
* State
|
|
4307
4307
|
* ******************************************************************************************************************/
|
|
4308
|
-
var className = _a.className, allowNegative = _a.allowNegative, thousandSeparator = _a.thousandSeparator, allowDecimal = _a.allowDecimal, decimalScale = _a.decimalScale, prefix = _a.prefix, suffix = _a.suffix, readOnly = _a.readOnly, tabIndex = _a.tabIndex, initMuiInputProps = _a.InputProps, initInputProps = _a.inputProps, initValue = _a.value, onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate, props = __rest$4(_a, ["className", "allowNegative", "thousandSeparator", "allowDecimal", "decimalScale", "prefix", "suffix", "readOnly", "tabIndex", "InputProps", "inputProps", "value", "onChange", "onValue", "onValidate"]);
|
|
4308
|
+
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, labelShrink = _a.labelShrink, initMuiInputProps = _a.InputProps, initInputProps = _a.inputProps, initValue = _a.value, onChange = _a.onChange, onValue = _a.onValue, onValidate = _a.onValidate, props = __rest$4(_a, ["className", "allowNegative", "thousandSeparator", "allowDecimal", "decimalScale", "prefix", "suffix", "readOnly", "tabIndex", "labelShrink", "InputProps", "inputProps", "value", "onChange", "onValue", "onValidate"]);
|
|
4309
4309
|
var _b = React.useState(function () { return (empty(initValue) ? '' : "".concat(initValue)); }), strValue = _b[0], setStrValue = _b[1];
|
|
4310
4310
|
/********************************************************************************************************************
|
|
4311
4311
|
* Effect
|
|
@@ -4374,7 +4374,7 @@ NumberFormatCustom.displayName = 'NumberFormatCustom';var FormNumberDefaultProps
|
|
|
4374
4374
|
/********************************************************************************************************************
|
|
4375
4375
|
* Render
|
|
4376
4376
|
* ******************************************************************************************************************/
|
|
4377
|
-
return (React.createElement(FormTextField, __assign$7({ ref: ref, className: classNames$1(className, 'FormNumber'), disableReturnKey: true, InputProps: muiInputProps, readOnly: readOnly, value: strValue, onChange: handleChange, onValue: handleValue, onValidate: handleValidate }, props)));
|
|
4377
|
+
return (React.createElement(FormTextField, __assign$7({ ref: ref, className: classNames$1(className, 'FormNumber'), disableReturnKey: true, labelShrink: strValue === '' || strValue === undefined ? labelShrink : true, InputProps: muiInputProps, readOnly: readOnly, value: strValue, onChange: handleChange, onValue: handleValue, onValidate: handleValidate }, props)));
|
|
4378
4378
|
});
|
|
4379
4379
|
FormNumber.displayName = 'FormNumber';
|
|
4380
4380
|
FormNumber.defaultProps = FormNumberDefaultProps;var FormSearchDefaultProps = __assign$7({}, FormTextDefaultProps);var css_248z$h = ".FormSearch input[type=search]::-webkit-search-decoration,\n.FormSearch input[type=search]::-webkit-search-cancel-button,\n.FormSearch input[type=search]::-webkit-search-results-button,\n.FormSearch input[type=search]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n}";
|
|
@@ -4712,13 +4712,13 @@ function autoDash$1(companyNo) {
|
|
|
4712
4712
|
/********************************************************************************************************************
|
|
4713
4713
|
* Event Handler
|
|
4714
4714
|
* ******************************************************************************************************************/
|
|
4715
|
-
var className = _a.className, onValue = _a.onValue, onValidate = _a.onValidate, props = __rest$4(_a, ["className", "onValue", "onValidate"]);
|
|
4715
|
+
var className = _a.className, skipPersonalNumberValidateCheck = _a.skipPersonalNumberValidateCheck, onValue = _a.onValue, onValidate = _a.onValidate, props = __rest$4(_a, ["className", "skipPersonalNumberValidateCheck", "onValue", "onValidate"]);
|
|
4716
4716
|
var handleValue = React.useCallback(function (value) {
|
|
4717
4717
|
var newValue = autoDash(value.replace(/[^0-9]/gi, ''));
|
|
4718
4718
|
return onValue ? onValue(newValue) : newValue;
|
|
4719
4719
|
}, [onValue]);
|
|
4720
4720
|
var handleValidate = React.useCallback(function (value) {
|
|
4721
|
-
if (notEmpty(value)) {
|
|
4721
|
+
if (notEmpty(value) && !skipPersonalNumberValidateCheck) {
|
|
4722
4722
|
if (value.length === 14 && value.includes('-')) {
|
|
4723
4723
|
var jumin = value
|
|
4724
4724
|
.replace(/-/g, '')
|
|
@@ -4750,7 +4750,7 @@ function autoDash$1(companyNo) {
|
|
|
4750
4750
|
else {
|
|
4751
4751
|
return onValidate ? onValidate(value) : true;
|
|
4752
4752
|
}
|
|
4753
|
-
}, [onValidate]);
|
|
4753
|
+
}, [onValidate, skipPersonalNumberValidateCheck]);
|
|
4754
4754
|
/********************************************************************************************************************
|
|
4755
4755
|
* Render
|
|
4756
4756
|
* ******************************************************************************************************************/
|