@superdispatch/ui
Advanced tools
Comparing version 0.25.0 to 0.25.1
@@ -29,11 +29,15 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2"; | ||
allowedDecimalSeparators: ['.', ','], | ||
onValueChange: values => { | ||
var floatValue = !Number.isNaN(Number(values.floatValue)) ? values.floatValue : null; | ||
var event = { | ||
target: { | ||
onValueChange: (values, sourceInfo) => { | ||
var _values$floatValue; | ||
var floatValue = (_values$floatValue = values.floatValue) !== null && _values$floatValue !== void 0 ? _values$floatValue : null; | ||
var { | ||
event | ||
} = sourceInfo; // eslint-disable-next-line @typescript-eslint/no-unsafe-call | ||
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread(_objectSpread({}, event), {}, { | ||
target: _objectSpread(_objectSpread({}, event === null || event === void 0 ? void 0 : event.target), {}, { | ||
value: disableValueParsing ? values.value : floatValue | ||
} | ||
}; // eslint-disable-next-line @typescript-eslint/no-unsafe-call | ||
onChange === null || onChange === void 0 ? void 0 : onChange(event); | ||
}) | ||
})); | ||
} | ||
@@ -40,0 +44,0 @@ })); |
import _objectSpread from "@babel/runtime/helpers/objectSpread2"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; | ||
var _excluded = ["id", "value", "onChange", "inputMode", "valueIsNumericString"]; | ||
var _excluded = ["id", "value", "onChange", "inputMode", "valueIsNumericString", "onValueChange"]; | ||
import { TextField } from '@material-ui/core'; | ||
@@ -15,3 +15,4 @@ import { forwardRef } from 'react'; | ||
inputMode = 'decimal', | ||
valueIsNumericString = true | ||
valueIsNumericString = true, | ||
onValueChange: _onValueChange | ||
} = _ref, | ||
@@ -29,10 +30,12 @@ props = _objectWithoutProperties(_ref, _excluded); | ||
customInput: TextField, | ||
onValueChange: values => { | ||
var event = { | ||
target: { | ||
name: props.name, | ||
onValueChange: (values, sourceInfo) => { | ||
var { | ||
event | ||
} = sourceInfo; | ||
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread(_objectSpread({}, event), {}, { | ||
target: _objectSpread(_objectSpread({}, event === null || event === void 0 ? void 0 : event.target), {}, { | ||
value: values.value | ||
} | ||
}; | ||
onChange === null || onChange === void 0 ? void 0 : onChange(event); | ||
}) | ||
})); | ||
_onValueChange === null || _onValueChange === void 0 ? void 0 : _onValueChange(values, sourceInfo); | ||
} | ||
@@ -39,0 +42,0 @@ })); |
{ | ||
"name": "@superdispatch/ui", | ||
"version": "0.25.0", | ||
"version": "0.25.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
986010
12624