ab-ui-library 1.18.4 → 1.19.0
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.
|
@@ -78,16 +78,19 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, _ref2) {
|
|
|
78
78
|
var isErrorVisible = hasError !== undefined ? hasError : !!error;
|
|
79
79
|
var placeHolder = label === placeholder ? '' : placeholder || datePlaceHolderText;
|
|
80
80
|
var changeHandler = function changeHandler(event) {
|
|
81
|
-
var eventValue = event.target.value;
|
|
81
|
+
var eventValue = event.target.value.trim(); // remove spaces from beginning and end
|
|
82
|
+
|
|
82
83
|
var valueWithoutSeparator = type === 'numeric' ? eventValue.replace(new RegExp(thousandSeparator, 'g'), '') : eventValue;
|
|
83
|
-
|
|
84
|
+
var formatedValue = witUpperCase ? valueWithoutSeparator.toUpperCase() : valueWithoutSeparator;
|
|
85
|
+
if (formatedValue.length - 1 === maxCount) {
|
|
84
86
|
return;
|
|
85
87
|
}
|
|
88
|
+
event.target.value = formatedValue;
|
|
86
89
|
if (setFieldValue && name) {
|
|
87
|
-
setFieldValue(name,
|
|
90
|
+
setFieldValue(name, formatedValue);
|
|
88
91
|
}
|
|
89
92
|
if (handleChange) {
|
|
90
|
-
handleChange(event,
|
|
93
|
+
handleChange(event, formatedValue);
|
|
91
94
|
}
|
|
92
95
|
};
|
|
93
96
|
var currentLength = useMemo(function () {
|