@danderson00/react-forms 0.0.24 → 0.0.25
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/input.js +5 -2
- package/package.json +1 -1
- package/src/input.js +2 -1
package/dist/input.js
CHANGED
|
@@ -232,6 +232,9 @@ var _default = function _default(render) {
|
|
|
232
232
|
var valueProps = getValueProps({
|
|
233
233
|
currentValue: getFieldValue(name)
|
|
234
234
|
});
|
|
235
|
+
var numericProps = numeric && {
|
|
236
|
+
type: 'number'
|
|
237
|
+
};
|
|
235
238
|
var typeProps = type && {
|
|
236
239
|
type: type
|
|
237
240
|
};
|
|
@@ -240,11 +243,11 @@ var _default = function _default(render) {
|
|
|
240
243
|
};
|
|
241
244
|
var className = (fieldValidated ? 'validated ' : '') + (props.className || '') || undefined;
|
|
242
245
|
|
|
243
|
-
var finalProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
246
|
+
var finalProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
244
247
|
id: id,
|
|
245
248
|
name: name,
|
|
246
249
|
className: className
|
|
247
|
-
}, passThroughProps), valueProps), typeProps), errorProps), {}, {
|
|
250
|
+
}, passThroughProps), valueProps), numericProps), typeProps), errorProps), {}, {
|
|
248
251
|
onChange: onChange,
|
|
249
252
|
onFocus: onFocus,
|
|
250
253
|
onBlur: onBlur
|
package/package.json
CHANGED
package/src/input.js
CHANGED
|
@@ -128,13 +128,14 @@ export default (render, options = {}) => function Input(props) {
|
|
|
128
128
|
...passThroughProps
|
|
129
129
|
} = props
|
|
130
130
|
const valueProps = getValueProps({ currentValue: getFieldValue(name) })
|
|
131
|
+
const numericProps = (numeric && { type: 'number' })
|
|
131
132
|
const typeProps = (type && { type })
|
|
132
133
|
const errorProps = (passErrorProp && { error })
|
|
133
134
|
const className = ((fieldValidated ? 'validated ' : '') + (props.className || '') || undefined)
|
|
134
135
|
|
|
135
136
|
const finalProps = {
|
|
136
137
|
id, name, className,
|
|
137
|
-
...passThroughProps, ...valueProps, ...typeProps, ...errorProps,
|
|
138
|
+
...passThroughProps, ...valueProps, ...numericProps, ...typeProps, ...errorProps,
|
|
138
139
|
onChange, onFocus, onBlur
|
|
139
140
|
}
|
|
140
141
|
|