x25 5.1.22 → 5.1.24
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/Inputs/NumericInput.js +8 -1
- package/Inputs/NumericTemplate.js +9 -2
- package/Inputs/common.js +5 -5
- package/package.json +3 -3
package/Inputs/NumericInput.js
CHANGED
|
@@ -46,7 +46,14 @@ var NumericInput = exports.NumericInput = function NumericInput(props) {
|
|
|
46
46
|
valueToShow = formatValue(value, props.optional),
|
|
47
47
|
updateValue = function updateValue(targetValue) {
|
|
48
48
|
setValue(targetValue);
|
|
49
|
-
|
|
49
|
+
|
|
50
|
+
var valueToStore = targetValue;
|
|
51
|
+
|
|
52
|
+
if ((0, _common.isFloat)((0, _common.floatToEnglishComma)(targetValue))) {
|
|
53
|
+
valueToStore = (0, _common.getFloatValueToStore)(targetValue);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
input.onChange(valueToStore);
|
|
50
57
|
},
|
|
51
58
|
handleBlur = function handleBlur() {
|
|
52
59
|
var newValue = (0, _common.clearFloatOnBlur)(value),
|
|
@@ -50,7 +50,14 @@ var NumericTemplate = exports.NumericTemplate = function NumericTemplate(props)
|
|
|
50
50
|
valueToShow = formatValue(value, props.optional),
|
|
51
51
|
updateValue = function updateValue(targetValue) {
|
|
52
52
|
setValue(targetValue);
|
|
53
|
-
|
|
53
|
+
|
|
54
|
+
var valueToStore = targetValue;
|
|
55
|
+
|
|
56
|
+
if ((0, _common.isFloat)((0, _common.floatToEnglishComma)(targetValue))) {
|
|
57
|
+
valueToStore = (0, _common.getFloatValueToStore)(targetValue);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
input.onChange(valueToStore);
|
|
54
61
|
},
|
|
55
62
|
handleBlur = function handleBlur() {
|
|
56
63
|
var newValue = (0, _common.clearFloatOnBlur)(value),
|
|
@@ -104,7 +111,7 @@ var NumericTemplate = exports.NumericTemplate = function NumericTemplate(props)
|
|
|
104
111
|
ref: onRegisterRef,
|
|
105
112
|
tabIndex: tabIndex,
|
|
106
113
|
type: type,
|
|
107
|
-
value:
|
|
114
|
+
value: valueToShow
|
|
108
115
|
}),
|
|
109
116
|
_react2.default.createElement(
|
|
110
117
|
"div",
|
package/Inputs/common.js
CHANGED
|
@@ -8,14 +8,14 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [
|
|
|
8
8
|
|
|
9
9
|
/* eslint-disable require-unicode-regexp */
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
return String(raw).replace(",", ".");
|
|
13
|
-
},
|
|
14
|
-
floatToLocalComma = function floatToLocalComma(raw) {
|
|
11
|
+
var floatToLocalComma = function floatToLocalComma(raw) {
|
|
15
12
|
return String(raw).replace(".", ",");
|
|
16
13
|
};
|
|
17
14
|
|
|
18
|
-
var
|
|
15
|
+
var floatToEnglishComma = exports.floatToEnglishComma = function floatToEnglishComma(raw) {
|
|
16
|
+
return String(raw).replace(",", ".");
|
|
17
|
+
},
|
|
18
|
+
isFloat = exports.isFloat = function isFloat(raw) {
|
|
19
19
|
var floatRegex = /^-?\d+(?:[.]\d*?)?$/;
|
|
20
20
|
|
|
21
21
|
return floatRegex.test(raw);
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.1.
|
|
2
|
+
"version": "5.1.24",
|
|
3
3
|
"name": "x25",
|
|
4
4
|
"description": "x25",
|
|
5
5
|
"scripts": {
|
|
@@ -135,11 +135,11 @@
|
|
|
135
135
|
"react-router-dom": "^5.1.2",
|
|
136
136
|
"react-select": "^3.0.8",
|
|
137
137
|
"react-sidebar": "^3.0.2",
|
|
138
|
-
"reactstrap": "^9.
|
|
138
|
+
"reactstrap": "^9.1.4",
|
|
139
139
|
"redux": "^4.0.4",
|
|
140
140
|
"redux-form": "^8.2.5",
|
|
141
141
|
"redux-injector": "^0.1.0",
|
|
142
142
|
"reselect": "^4.0.0",
|
|
143
143
|
"superagent": "^5.1.1"
|
|
144
144
|
}
|
|
145
|
-
}
|
|
145
|
+
}
|