@xaypay/tui 0.0.121 → 0.0.122
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.es.js +75 -62
- package/dist/index.js +75 -62
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -782,14 +782,14 @@ const File = ({
|
|
|
782
782
|
change({
|
|
783
783
|
file: file[ix],
|
|
784
784
|
uuid: v4(),
|
|
785
|
-
check: formatError
|
|
785
|
+
check: formatError ? formatError : configStyles.FILE.formatError
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
788
|
} else {
|
|
789
789
|
change({
|
|
790
790
|
file: file[ix],
|
|
791
791
|
uuid: v4(),
|
|
792
|
-
check: maxSizeError
|
|
792
|
+
check: maxSizeError ? maxSizeError : configStyles.FILE.maxSizeError
|
|
793
793
|
});
|
|
794
794
|
}
|
|
795
795
|
}
|
|
@@ -811,14 +811,14 @@ const File = ({
|
|
|
811
811
|
change({
|
|
812
812
|
file: file[ix],
|
|
813
813
|
uuid: v4(),
|
|
814
|
-
check: formatError
|
|
814
|
+
check: formatError ? formatError : configStyles.FILE.formatError
|
|
815
815
|
});
|
|
816
816
|
}
|
|
817
817
|
} else {
|
|
818
818
|
change({
|
|
819
819
|
file: file[ix],
|
|
820
820
|
uuid: v4(),
|
|
821
|
-
check: maxSizeError
|
|
821
|
+
check: maxSizeError ? maxSizeError : configStyles.FILE.maxSizeError
|
|
822
822
|
});
|
|
823
823
|
}
|
|
824
824
|
}
|
|
@@ -832,7 +832,7 @@ const File = ({
|
|
|
832
832
|
setImage(null);
|
|
833
833
|
handleUploadFiles(file);
|
|
834
834
|
if (file.length === 0 && memoizedItems.length === 0) {
|
|
835
|
-
setError(noChoosenFile);
|
|
835
|
+
setError(noChoosenFile ? noChoosenFile : configStyles.FILE.noChoosenFile);
|
|
836
836
|
}
|
|
837
837
|
} else {
|
|
838
838
|
if (file[0]) {
|
|
@@ -850,16 +850,16 @@ const File = ({
|
|
|
850
850
|
}
|
|
851
851
|
} else {
|
|
852
852
|
setImage(null);
|
|
853
|
-
setError(formatError);
|
|
853
|
+
setError(formatError ? formatError : configStyles.FILE.formatError);
|
|
854
854
|
}
|
|
855
855
|
} else {
|
|
856
856
|
setImage(null);
|
|
857
|
-
setError(maxSizeError);
|
|
857
|
+
setError(maxSizeError ? maxSizeError : configStyles.FILE.maxSizeError);
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
860
|
if (file.length === 0) {
|
|
861
861
|
setImage(null);
|
|
862
|
-
setError(noChoosenFile);
|
|
862
|
+
setError(noChoosenFile ? noChoosenFile : configStyles.FILE.noChoosenFile);
|
|
863
863
|
}
|
|
864
864
|
}
|
|
865
865
|
};
|
|
@@ -2877,6 +2877,7 @@ const Input = ({
|
|
|
2877
2877
|
const [show, setShow] = useState(false);
|
|
2878
2878
|
const [isHover, setIsHover] = useState(false);
|
|
2879
2879
|
const [innerValue, setInnerValue] = useState('');
|
|
2880
|
+
const [innerMinNumSize, setInnerMinNumSize] = useState(0);
|
|
2880
2881
|
const [innerErrorMessage, setInnerErrorMessage] = useState('');
|
|
2881
2882
|
const random = Math.floor(Math.random() * 1000 + 1);
|
|
2882
2883
|
const configStyles = compereConfigs();
|
|
@@ -2912,60 +2913,60 @@ const Input = ({
|
|
|
2912
2913
|
}
|
|
2913
2914
|
return val;
|
|
2914
2915
|
};
|
|
2915
|
-
const handleCheckTypeNumber = val => {
|
|
2916
|
+
const handleCheckTypeNumber = (val, prevVal) => {
|
|
2916
2917
|
if (type === 'number') {
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
} else if (float[1] !== undefined && float[1] !== '0') {
|
|
2948
|
-
if (float[2] === undefined || float[2] === '0') {
|
|
2949
|
-
val = `${int}.${float[0]}${float[1]}`;
|
|
2950
|
-
} else if (float[2] !== undefined && float[2] !== '0') {
|
|
2951
|
-
val = `${int}.${float[0]}${float[1]}${float[2]}`;
|
|
2918
|
+
if (maxLength && maxLength > 0) {
|
|
2919
|
+
if (val.length > maxLength) {
|
|
2920
|
+
val = val.substr(0, maxLength);
|
|
2921
|
+
}
|
|
2922
|
+
} else {
|
|
2923
|
+
const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.)?(\d+)?$/ : /^\d+$/;
|
|
2924
|
+
if (val.length > 16 && !val.includes('.')) {
|
|
2925
|
+
val = val.substr(0, 16);
|
|
2926
|
+
}
|
|
2927
|
+
if (val > Number.MAX_SAFE_INTEGER) {
|
|
2928
|
+
val = prevVal;
|
|
2929
|
+
}
|
|
2930
|
+
if (val < Number.MIN_SAFE_INTEGER) {
|
|
2931
|
+
val = prevVal;
|
|
2932
|
+
}
|
|
2933
|
+
if (innerMinNumSize && val < innerMinNumSize) {
|
|
2934
|
+
val = prevVal;
|
|
2935
|
+
}
|
|
2936
|
+
if (maxNumSize && val > maxNumSize) {
|
|
2937
|
+
val = prevVal;
|
|
2938
|
+
}
|
|
2939
|
+
if (floatToFix > 0) {
|
|
2940
|
+
const floatNumParts = typeof val === 'string' ? val.split('.') : val;
|
|
2941
|
+
const int = floatNumParts[0];
|
|
2942
|
+
const float = floatNumParts[1];
|
|
2943
|
+
if (float && float.length > 0) {
|
|
2944
|
+
let floatResult = '';
|
|
2945
|
+
[...float].map((item, index) => {
|
|
2946
|
+
if (index + 1 <= floatToFix) {
|
|
2947
|
+
floatResult += item;
|
|
2952
2948
|
}
|
|
2949
|
+
});
|
|
2950
|
+
if (floatResult !== '') {
|
|
2951
|
+
val = `${int}.${floatResult}`;
|
|
2952
|
+
} else {
|
|
2953
|
+
val = `${int}`;
|
|
2953
2954
|
}
|
|
2954
2955
|
}
|
|
2956
|
+
} else {
|
|
2957
|
+
const floatNumParts = typeof val === 'string' ? val.split('.') : val;
|
|
2958
|
+
const int = floatNumParts[0];
|
|
2959
|
+
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
2960
|
+
val = `${int}`;
|
|
2961
|
+
}
|
|
2955
2962
|
}
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
val =
|
|
2963
|
+
if (!regNum.test(val)) {
|
|
2964
|
+
const newStr = val.replace(/[^0-9.]/g, '').replace(/^([^.]*\.)(.*)$/, function (_, b, c) {
|
|
2965
|
+
return b + c.replace(/\./g, '');
|
|
2966
|
+
});
|
|
2967
|
+
val = newStr;
|
|
2961
2968
|
}
|
|
2962
2969
|
}
|
|
2963
|
-
if (!regNum.test(val)) {
|
|
2964
|
-
const newStr = val.replace(/[^0-9.]/g, '').replace(/^([^.]*\.)(.*)$/, function (_, b, c) {
|
|
2965
|
-
return b + c.replace(/\./g, '');
|
|
2966
|
-
});
|
|
2967
|
-
val = newStr;
|
|
2968
|
-
}
|
|
2969
2970
|
if (withoutDot && !/^\d+$/.test(val)) {
|
|
2970
2971
|
const newStr = val.replace(/[^0-9]/g, '').replace(/^([^.]*\.)(.*)$/, function (_, b, c) {
|
|
2971
2972
|
return b + c.replace(/\./g, '');
|
|
@@ -2978,9 +2979,9 @@ const Input = ({
|
|
|
2978
2979
|
const handleChange = event => {
|
|
2979
2980
|
let prevValue = innerValue;
|
|
2980
2981
|
let currentValue = event.target.value;
|
|
2981
|
-
const max = maxLength ? maxLength : configStyles.INPUT.maxLength;
|
|
2982
|
+
const max = type === 'number' ? maxLength ? maxLength : null : maxLength ? maxLength : configStyles.INPUT.maxLength;
|
|
2982
2983
|
currentValue = handleCheckTypeTel(currentValue, prevValue);
|
|
2983
|
-
currentValue = handleCheckTypeNumber(currentValue);
|
|
2984
|
+
currentValue = handleCheckTypeNumber(currentValue, prevValue);
|
|
2984
2985
|
if (max && currentValue.length > max && type !== 'tel' && type !== 'number') {
|
|
2985
2986
|
currentValue = currentValue.substr(0, max);
|
|
2986
2987
|
}
|
|
@@ -3002,19 +3003,31 @@ const Input = ({
|
|
|
3002
3003
|
setShow(!show);
|
|
3003
3004
|
};
|
|
3004
3005
|
useEffect(() => {
|
|
3006
|
+
let newValue = value;
|
|
3005
3007
|
if (errorMessage) {
|
|
3006
3008
|
setInnerErrorMessage(errorMessage);
|
|
3007
3009
|
} else {
|
|
3008
3010
|
setInnerErrorMessage('');
|
|
3009
3011
|
}
|
|
3010
|
-
|
|
3012
|
+
if (minNumSize && minNumSize < 0) {
|
|
3013
|
+
setInnerMinNumSize(0);
|
|
3014
|
+
alert('minNumSize prop can\'t be less then 0');
|
|
3015
|
+
} else if (minNumSize && minNumSize >= 0) {
|
|
3016
|
+
setInnerMinNumSize(minNumSize);
|
|
3017
|
+
}
|
|
3018
|
+
if (type === 'number' && (maxNumSize || maxNumSize === 0 || minNumSize || minNumSize === 0) && (maxLength || maxLength === 0)) {
|
|
3019
|
+
alert("You can't use maxNumSize or minNumSize and maxLength props together when Input type is number");
|
|
3020
|
+
}
|
|
3021
|
+
if (type === 'number' && maxNumSize < minNumSize) {
|
|
3022
|
+
alert("maxNumSize prop can't be less then minNumSize");
|
|
3023
|
+
}
|
|
3011
3024
|
if (value !== undefined) {
|
|
3012
3025
|
if (value === null) {
|
|
3013
3026
|
newValue = '';
|
|
3014
3027
|
} else {
|
|
3015
|
-
const max = maxLength ? maxLength : configStyles.INPUT.maxLength;
|
|
3016
|
-
newValue = handleCheckTypeTel(
|
|
3017
|
-
newValue = handleCheckTypeNumber(value);
|
|
3028
|
+
const max = type === 'number' ? maxLength ? maxLength : null : maxLength ? maxLength : configStyles.INPUT.maxLength;
|
|
3029
|
+
newValue = handleCheckTypeTel(value, newValue);
|
|
3030
|
+
newValue = handleCheckTypeNumber(value, newValue);
|
|
3018
3031
|
if (max && value.length > max && type !== 'tel' && type !== 'number') {
|
|
3019
3032
|
newValue = value.substr(0, max);
|
|
3020
3033
|
}
|
|
@@ -3024,7 +3037,7 @@ const Input = ({
|
|
|
3024
3037
|
setInnerValue(() => newValue);
|
|
3025
3038
|
}
|
|
3026
3039
|
}
|
|
3027
|
-
}, [type, value, regexp, maxLength, errorMessage, regexpErrorMessage, telErrorMessage]);
|
|
3040
|
+
}, [type, value, regexp, maxLength, maxNumSize, minNumSize, errorMessage, regexpErrorMessage, telErrorMessage]);
|
|
3028
3041
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
3029
3042
|
className: classProps
|
|
3030
3043
|
}, label ? /*#__PURE__*/React__default.createElement("label", {
|
package/dist/index.js
CHANGED
|
@@ -812,14 +812,14 @@ const File = ({
|
|
|
812
812
|
change({
|
|
813
813
|
file: file[ix],
|
|
814
814
|
uuid: v4(),
|
|
815
|
-
check: formatError
|
|
815
|
+
check: formatError ? formatError : configStyles.FILE.formatError
|
|
816
816
|
});
|
|
817
817
|
}
|
|
818
818
|
} else {
|
|
819
819
|
change({
|
|
820
820
|
file: file[ix],
|
|
821
821
|
uuid: v4(),
|
|
822
|
-
check: maxSizeError
|
|
822
|
+
check: maxSizeError ? maxSizeError : configStyles.FILE.maxSizeError
|
|
823
823
|
});
|
|
824
824
|
}
|
|
825
825
|
}
|
|
@@ -841,14 +841,14 @@ const File = ({
|
|
|
841
841
|
change({
|
|
842
842
|
file: file[ix],
|
|
843
843
|
uuid: v4(),
|
|
844
|
-
check: formatError
|
|
844
|
+
check: formatError ? formatError : configStyles.FILE.formatError
|
|
845
845
|
});
|
|
846
846
|
}
|
|
847
847
|
} else {
|
|
848
848
|
change({
|
|
849
849
|
file: file[ix],
|
|
850
850
|
uuid: v4(),
|
|
851
|
-
check: maxSizeError
|
|
851
|
+
check: maxSizeError ? maxSizeError : configStyles.FILE.maxSizeError
|
|
852
852
|
});
|
|
853
853
|
}
|
|
854
854
|
}
|
|
@@ -862,7 +862,7 @@ const File = ({
|
|
|
862
862
|
setImage(null);
|
|
863
863
|
handleUploadFiles(file);
|
|
864
864
|
if (file.length === 0 && memoizedItems.length === 0) {
|
|
865
|
-
setError(noChoosenFile);
|
|
865
|
+
setError(noChoosenFile ? noChoosenFile : configStyles.FILE.noChoosenFile);
|
|
866
866
|
}
|
|
867
867
|
} else {
|
|
868
868
|
if (file[0]) {
|
|
@@ -880,16 +880,16 @@ const File = ({
|
|
|
880
880
|
}
|
|
881
881
|
} else {
|
|
882
882
|
setImage(null);
|
|
883
|
-
setError(formatError);
|
|
883
|
+
setError(formatError ? formatError : configStyles.FILE.formatError);
|
|
884
884
|
}
|
|
885
885
|
} else {
|
|
886
886
|
setImage(null);
|
|
887
|
-
setError(maxSizeError);
|
|
887
|
+
setError(maxSizeError ? maxSizeError : configStyles.FILE.maxSizeError);
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
890
|
if (file.length === 0) {
|
|
891
891
|
setImage(null);
|
|
892
|
-
setError(noChoosenFile);
|
|
892
|
+
setError(noChoosenFile ? noChoosenFile : configStyles.FILE.noChoosenFile);
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
895
|
};
|
|
@@ -2907,6 +2907,7 @@ const Input = ({
|
|
|
2907
2907
|
const [show, setShow] = React.useState(false);
|
|
2908
2908
|
const [isHover, setIsHover] = React.useState(false);
|
|
2909
2909
|
const [innerValue, setInnerValue] = React.useState('');
|
|
2910
|
+
const [innerMinNumSize, setInnerMinNumSize] = React.useState(0);
|
|
2910
2911
|
const [innerErrorMessage, setInnerErrorMessage] = React.useState('');
|
|
2911
2912
|
const random = Math.floor(Math.random() * 1000 + 1);
|
|
2912
2913
|
const configStyles = compereConfigs();
|
|
@@ -2942,60 +2943,60 @@ const Input = ({
|
|
|
2942
2943
|
}
|
|
2943
2944
|
return val;
|
|
2944
2945
|
};
|
|
2945
|
-
const handleCheckTypeNumber = val => {
|
|
2946
|
+
const handleCheckTypeNumber = (val, prevVal) => {
|
|
2946
2947
|
if (type === 'number') {
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
} else if (float[1] !== undefined && float[1] !== '0') {
|
|
2978
|
-
if (float[2] === undefined || float[2] === '0') {
|
|
2979
|
-
val = `${int}.${float[0]}${float[1]}`;
|
|
2980
|
-
} else if (float[2] !== undefined && float[2] !== '0') {
|
|
2981
|
-
val = `${int}.${float[0]}${float[1]}${float[2]}`;
|
|
2948
|
+
if (maxLength && maxLength > 0) {
|
|
2949
|
+
if (val.length > maxLength) {
|
|
2950
|
+
val = val.substr(0, maxLength);
|
|
2951
|
+
}
|
|
2952
|
+
} else {
|
|
2953
|
+
const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.)?(\d+)?$/ : /^\d+$/;
|
|
2954
|
+
if (val.length > 16 && !val.includes('.')) {
|
|
2955
|
+
val = val.substr(0, 16);
|
|
2956
|
+
}
|
|
2957
|
+
if (val > Number.MAX_SAFE_INTEGER) {
|
|
2958
|
+
val = prevVal;
|
|
2959
|
+
}
|
|
2960
|
+
if (val < Number.MIN_SAFE_INTEGER) {
|
|
2961
|
+
val = prevVal;
|
|
2962
|
+
}
|
|
2963
|
+
if (innerMinNumSize && val < innerMinNumSize) {
|
|
2964
|
+
val = prevVal;
|
|
2965
|
+
}
|
|
2966
|
+
if (maxNumSize && val > maxNumSize) {
|
|
2967
|
+
val = prevVal;
|
|
2968
|
+
}
|
|
2969
|
+
if (floatToFix > 0) {
|
|
2970
|
+
const floatNumParts = typeof val === 'string' ? val.split('.') : val;
|
|
2971
|
+
const int = floatNumParts[0];
|
|
2972
|
+
const float = floatNumParts[1];
|
|
2973
|
+
if (float && float.length > 0) {
|
|
2974
|
+
let floatResult = '';
|
|
2975
|
+
[...float].map((item, index) => {
|
|
2976
|
+
if (index + 1 <= floatToFix) {
|
|
2977
|
+
floatResult += item;
|
|
2982
2978
|
}
|
|
2979
|
+
});
|
|
2980
|
+
if (floatResult !== '') {
|
|
2981
|
+
val = `${int}.${floatResult}`;
|
|
2982
|
+
} else {
|
|
2983
|
+
val = `${int}`;
|
|
2983
2984
|
}
|
|
2984
2985
|
}
|
|
2986
|
+
} else {
|
|
2987
|
+
const floatNumParts = typeof val === 'string' ? val.split('.') : val;
|
|
2988
|
+
const int = floatNumParts[0];
|
|
2989
|
+
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
2990
|
+
val = `${int}`;
|
|
2991
|
+
}
|
|
2985
2992
|
}
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
val =
|
|
2993
|
+
if (!regNum.test(val)) {
|
|
2994
|
+
const newStr = val.replace(/[^0-9.]/g, '').replace(/^([^.]*\.)(.*)$/, function (_, b, c) {
|
|
2995
|
+
return b + c.replace(/\./g, '');
|
|
2996
|
+
});
|
|
2997
|
+
val = newStr;
|
|
2991
2998
|
}
|
|
2992
2999
|
}
|
|
2993
|
-
if (!regNum.test(val)) {
|
|
2994
|
-
const newStr = val.replace(/[^0-9.]/g, '').replace(/^([^.]*\.)(.*)$/, function (_, b, c) {
|
|
2995
|
-
return b + c.replace(/\./g, '');
|
|
2996
|
-
});
|
|
2997
|
-
val = newStr;
|
|
2998
|
-
}
|
|
2999
3000
|
if (withoutDot && !/^\d+$/.test(val)) {
|
|
3000
3001
|
const newStr = val.replace(/[^0-9]/g, '').replace(/^([^.]*\.)(.*)$/, function (_, b, c) {
|
|
3001
3002
|
return b + c.replace(/\./g, '');
|
|
@@ -3008,9 +3009,9 @@ const Input = ({
|
|
|
3008
3009
|
const handleChange = event => {
|
|
3009
3010
|
let prevValue = innerValue;
|
|
3010
3011
|
let currentValue = event.target.value;
|
|
3011
|
-
const max = maxLength ? maxLength : configStyles.INPUT.maxLength;
|
|
3012
|
+
const max = type === 'number' ? maxLength ? maxLength : null : maxLength ? maxLength : configStyles.INPUT.maxLength;
|
|
3012
3013
|
currentValue = handleCheckTypeTel(currentValue, prevValue);
|
|
3013
|
-
currentValue = handleCheckTypeNumber(currentValue);
|
|
3014
|
+
currentValue = handleCheckTypeNumber(currentValue, prevValue);
|
|
3014
3015
|
if (max && currentValue.length > max && type !== 'tel' && type !== 'number') {
|
|
3015
3016
|
currentValue = currentValue.substr(0, max);
|
|
3016
3017
|
}
|
|
@@ -3032,19 +3033,31 @@ const Input = ({
|
|
|
3032
3033
|
setShow(!show);
|
|
3033
3034
|
};
|
|
3034
3035
|
React.useEffect(() => {
|
|
3036
|
+
let newValue = value;
|
|
3035
3037
|
if (errorMessage) {
|
|
3036
3038
|
setInnerErrorMessage(errorMessage);
|
|
3037
3039
|
} else {
|
|
3038
3040
|
setInnerErrorMessage('');
|
|
3039
3041
|
}
|
|
3040
|
-
|
|
3042
|
+
if (minNumSize && minNumSize < 0) {
|
|
3043
|
+
setInnerMinNumSize(0);
|
|
3044
|
+
alert('minNumSize prop can\'t be less then 0');
|
|
3045
|
+
} else if (minNumSize && minNumSize >= 0) {
|
|
3046
|
+
setInnerMinNumSize(minNumSize);
|
|
3047
|
+
}
|
|
3048
|
+
if (type === 'number' && (maxNumSize || maxNumSize === 0 || minNumSize || minNumSize === 0) && (maxLength || maxLength === 0)) {
|
|
3049
|
+
alert("You can't use maxNumSize or minNumSize and maxLength props together when Input type is number");
|
|
3050
|
+
}
|
|
3051
|
+
if (type === 'number' && maxNumSize < minNumSize) {
|
|
3052
|
+
alert("maxNumSize prop can't be less then minNumSize");
|
|
3053
|
+
}
|
|
3041
3054
|
if (value !== undefined) {
|
|
3042
3055
|
if (value === null) {
|
|
3043
3056
|
newValue = '';
|
|
3044
3057
|
} else {
|
|
3045
|
-
const max = maxLength ? maxLength : configStyles.INPUT.maxLength;
|
|
3046
|
-
newValue = handleCheckTypeTel(
|
|
3047
|
-
newValue = handleCheckTypeNumber(value);
|
|
3058
|
+
const max = type === 'number' ? maxLength ? maxLength : null : maxLength ? maxLength : configStyles.INPUT.maxLength;
|
|
3059
|
+
newValue = handleCheckTypeTel(value, newValue);
|
|
3060
|
+
newValue = handleCheckTypeNumber(value, newValue);
|
|
3048
3061
|
if (max && value.length > max && type !== 'tel' && type !== 'number') {
|
|
3049
3062
|
newValue = value.substr(0, max);
|
|
3050
3063
|
}
|
|
@@ -3054,7 +3067,7 @@ const Input = ({
|
|
|
3054
3067
|
setInnerValue(() => newValue);
|
|
3055
3068
|
}
|
|
3056
3069
|
}
|
|
3057
|
-
}, [type, value, regexp, maxLength, errorMessage, regexpErrorMessage, telErrorMessage]);
|
|
3070
|
+
}, [type, value, regexp, maxLength, maxNumSize, minNumSize, errorMessage, regexpErrorMessage, telErrorMessage]);
|
|
3058
3071
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3059
3072
|
className: classProps
|
|
3060
3073
|
}, label ? /*#__PURE__*/React__default["default"].createElement("label", {
|