oolib 2.10.1 → 2.10.2
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.
|
@@ -220,6 +220,9 @@ exports.URLInput = URLInput;
|
|
|
220
220
|
var NumberInput = function (props) {
|
|
221
221
|
var min = props.min, max = props.max;
|
|
222
222
|
var handleValidation = function (value) {
|
|
223
|
+
if (isNaN(value)) {
|
|
224
|
+
return { type: 'error', msg: 'Enter a number' };
|
|
225
|
+
}
|
|
223
226
|
if (min && value < min) {
|
|
224
227
|
return { type: 'error', msg: "Enter value greater than ".concat(min) };
|
|
225
228
|
}
|
|
@@ -227,6 +230,8 @@ var NumberInput = function (props) {
|
|
|
227
230
|
return { type: 'error', msg: "Enter value less than ".concat(max) };
|
|
228
231
|
}
|
|
229
232
|
};
|
|
230
|
-
return (react_1.default.createElement(exports.TextInput, __assign({}, props, {
|
|
233
|
+
return (react_1.default.createElement(exports.TextInput, __assign({}, props, {
|
|
234
|
+
// type="number"
|
|
235
|
+
validateOnBlur: handleValidation, placeholder: "Enter Number..." })));
|
|
231
236
|
};
|
|
232
237
|
exports.NumberInput = NumberInput;
|