value
is now of type 'string'onChange
changed signature tofunction (event: React.FormEvent, value: string, complete: boolean) => void
error
is new prop of typeReact.PropTypes.oneOf(['none', 'invalidSymbol', 'incompleteNumber', 'singleMinus', 'singleFloatingPoint', 'singleZero', 'min', 'max', 'required'])
and it's the controlled error soonError
can be called only when error changes. Default value is'none'
- replacing state double with controlled input
value
is now watched for changesonChange
is now called every time when input value must change, third argument provides infomration is value a complete number.
onKeyDown
is now called when.
and-
are pressed and emitted error is'incompleteNumber'
shouldComponentUpdate
is now not overrided
showDefaultValue
error
defaultValue
is of typenumber
and is the same asTextField
andinput
defaultValue
proponValid
is function with signaturefunction(value: number) => void
called when input's value is a valid numberuseStrategy
is of typeReact.PropTypes.oneOf(['ignore', 'warn', 'allow'])
with defualt value'allow'
and sets used error strategy refer to Strategy and Errors
onError
signature changed tofunction(event: React.FromEvent, value: string) => void
onChange
signature changed tofunction(error: 'none' | 'invalidSymbol' | 'incompleteNumber' | 'singleMinus' | 'singleFloatingPoint' | 'singleZero'| 'min' | 'max' | 'required' | 'clean';) => void
'clean'
equivalent of'required'
whenrequired
prop isfalse
error
is moved fromprops
tostate
- re-exposing public method
getInputNode
ofTextField
- using polyfillied Object.assign ('object-assign')
useStrategy
has been renamed tostrategy
- fixing when
event.preventDefault()
is called and whenevent
is delegated
- When
strategy
is'ignore'
anderror
ismin
ormax
instead of clearing input field it's value is overwritten withString(props[error])
- Fixing all bugs introduced after
v3.0.0
which prevented valid numbers to be entered whenstrategy
is'ignore'
or'warn'
. - Fixing a bug after
v3.2.0
. NowonValid
is emitted when input's value is beeing overwritten when ''min'' or'max'
errors are cathced andstrategy
is not'allow'
. - Fixing a bug after
v3.2.0
where input value was not overwritten when'min'
or'max'
errors are cathced andstrategy
is not'allow'
and input isuncontrolled
. - Fixing a bug where input's value is not beeing validated before and after initial
render
depending on that is the inputcontrolled
or not.
- Fixing a bug where valid numbers are prevented from beeing entered. This bug occures when
(min * 10) < max
(not fixed inv4.0.0
) - Fixing a bug where valid numbers are prevented from beeing entered. This bug occures when
Number(checkedValue) === 0
(not fixed inv4.0.0
)
- Ensure
onBlur
is called if a handler is passed viaprops
- Adding new
public
methodgetTextField
with signature() => TextField
which returns underlingTextField
ref
onRequestValue
is function with signaturefunction(value: string) => void
called with correct number value whenstrategy
is'warn'
or'ignore'
andvalue
is provided.
- Droping alot of the logic for correcting value when
strategy
is'warn'
or'ignore'
and simplified it by introducing new proponRequestValue
which should ensure correct behavior when consumed by third party libraries such as'react-material-ui-keyboard'
- Re-exporting
default
from'./NumberInput'
- Using npm badge for README.md#Install
- Fixing spelling bug onReqestValue -> onRequestValue, Opps sry ...
- Performance improvment
- Performance improvments and memory optimizations
-
If
strategy
is not'allow'
and entered number is less thanmin
but it is decimal number, input value will be overriden if it's not controlled elseonRequestValue
will be emitted and'min'
error will be emitted ifstrategy
is'warn'
-
If
strategy
is not'allow'
andmin
is greater than0
and entered number is0
, input value will be overriden if it's not controlled elseonRequestValue
will be emitted and'min'
error will be emitted ifstrategy
is'warn'
propTypes
is nowReact.ValidationMap<NumberInputProps>
instead of justObject
makingReact.createElement
callable
- Fixing a bug which caused input value overriding to be skipped when
strategy
is'ignore'
instead of when it's'allow'
- NPM dependencies update
- NPM dependencies update
- Moving to TypeScript v2 and replacing typings with @types
- Fixing when
'singleZero'
is emitted.'singleZero'
is emited accordingly to Errors now. In all other cases when'singleZero'
was emitted now'invalidSymbol'
is emitted instead.
- Fixing
'allow'
to properly be masked as'min'
when error is emittedonBlur
. - If there is error
onBlur
it will be emitted no matter dose the strategy is'warn'
or'allow'
.
- Fixing, in addition of
value
the followingprops
are checked for changes:min
,max
,required
andstrategy
before take decision to callonError
,onValid
andonRequestValue
accordingly whencomponentWillReceiveProps
.
- Fixing the bug that should have been fixed with
v5.0.12
and the one introduced withv5.0.12
which caused events to be one state behind actual input.
- Fixing a bug which caused
onError
to be called based on oldprops
. - Fixing the bug that should be fixed with
5.0.12
- Fixing
Cannot resolve module 'material-ui-number-input'
due to$ npm run npm
command has not been ran before releasing previos version.
- Displayed by the browser keyboard is now configurable (adding support for the
input
inputMode
prop)
- Allowing negative min values, closes #7
- Syncing npm and github versions.
- Fixing empty npm package, closes #9
- Dummy version
- Shipping #13 (Fixes #12)
- Fixed:
Uncaught TypeError: value.match is not a function
at Function.NumberInput.validateValue (NumberInput.js:103)
(closed #14)
-
Updating package dependencies
-
Switching from
React.PropTypes
toprop-types
package
- Removing the unused prop
inputMode