venice-ui 2.1.5 → 2.1.7
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.
|
@@ -19,6 +19,7 @@ const Form = ({ formData, size = 'medium', read }) => {
|
|
|
19
19
|
};
|
|
20
20
|
const onIntChangeHandler = (name, value) => {
|
|
21
21
|
let valueString = value;
|
|
22
|
+
console.log('onIntChangeHandler', valueString);
|
|
22
23
|
if (valueString.length > 0) {
|
|
23
24
|
const modify = valueString
|
|
24
25
|
.replaceAll(',', '.')
|
|
@@ -46,19 +46,19 @@ const Input = ({ label, labelPosition = 'top', value, type = 'text', name, disab
|
|
|
46
46
|
? calculateNumberValue(e.target.value)
|
|
47
47
|
: e.target.value.toString();
|
|
48
48
|
setInputValue(returnedValue);
|
|
49
|
-
debouncedHandleChange(name,
|
|
49
|
+
debouncedHandleChange(name, returnedValue);
|
|
50
50
|
};
|
|
51
51
|
const onBlurValidation = () => {
|
|
52
52
|
if (type === 'number' || type === 'increase') {
|
|
53
|
-
let validateValue =
|
|
53
|
+
let validateValue = inputValue;
|
|
54
54
|
if (isNaN(parseFloat(validateValue.toString()))) {
|
|
55
55
|
validateValue = min !== undefined ? min : 0;
|
|
56
56
|
}
|
|
57
|
-
if (typeof
|
|
58
|
-
if (min !== undefined &&
|
|
57
|
+
if (typeof inputValue === 'number') {
|
|
58
|
+
if (min !== undefined && inputValue < min) {
|
|
59
59
|
validateValue = min;
|
|
60
60
|
}
|
|
61
|
-
else if (max !== undefined &&
|
|
61
|
+
else if (max !== undefined && inputValue > max) {
|
|
62
62
|
validateValue = max;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -13,6 +13,7 @@ export const Form = ({ formData, size = 'medium', read }) => {
|
|
|
13
13
|
};
|
|
14
14
|
const onIntChangeHandler = (name, value) => {
|
|
15
15
|
let valueString = value;
|
|
16
|
+
console.log('onIntChangeHandler', valueString);
|
|
16
17
|
if (valueString.length > 0) {
|
|
17
18
|
const modify = valueString
|
|
18
19
|
.replaceAll(',', '.')
|
|
@@ -20,19 +20,19 @@ export const Input = ({ label, labelPosition = 'top', value, type = 'text', name
|
|
|
20
20
|
? calculateNumberValue(e.target.value)
|
|
21
21
|
: e.target.value.toString();
|
|
22
22
|
setInputValue(returnedValue);
|
|
23
|
-
debouncedHandleChange(name,
|
|
23
|
+
debouncedHandleChange(name, returnedValue);
|
|
24
24
|
};
|
|
25
25
|
const onBlurValidation = () => {
|
|
26
26
|
if (type === 'number' || type === 'increase') {
|
|
27
|
-
let validateValue =
|
|
27
|
+
let validateValue = inputValue;
|
|
28
28
|
if (isNaN(parseFloat(validateValue.toString()))) {
|
|
29
29
|
validateValue = min !== undefined ? min : 0;
|
|
30
30
|
}
|
|
31
|
-
if (typeof
|
|
32
|
-
if (min !== undefined &&
|
|
31
|
+
if (typeof inputValue === 'number') {
|
|
32
|
+
if (min !== undefined && inputValue < min) {
|
|
33
33
|
validateValue = min;
|
|
34
34
|
}
|
|
35
|
-
else if (max !== undefined &&
|
|
35
|
+
else if (max !== undefined && inputValue > max) {
|
|
36
36
|
validateValue = max;
|
|
37
37
|
}
|
|
38
38
|
}
|