Skip to content
This repository has been archived by the owner on Sep 20, 2018. It is now read-only.

Latest commit

 

History

History
257 lines (137 loc) · 9.7 KB

CHANGELOG.md

File metadata and controls

257 lines (137 loc) · 9.7 KB

Change Log

Properties

  • value is now of type 'string'
  • onChange changed signature to function (event: React.FormEvent, value: string, complete: boolean) => void
  • error is new prop of type React.PropTypes.oneOf(['none', 'invalidSymbol', 'incompleteNumber', 'singleMinus', 'singleFloatingPoint', 'singleZero', 'min', 'max', 'required']) and it's the controlled error so onError can be called only when error changes. Default value is 'none'

Changes

  • replacing state double with controlled input
  • value is now watched for changes
  • onChange is now called every time when input value must change, third argument provides infomration is value a complete number.

Bug fixes

  • onKeyDown is now called when . and - are pressed and emitted error is 'incompleteNumber'

Implementation

  • shouldComponentUpdate is now not overrided

Properties

Deprecated

  • showDefaultValue
  • error

New

  • defaultValue is of type number and is the same as TextField and input defaultValue prop
  • onValidis function with signature function(value: number) => void called when input's value is a valid number
  • useStrategy is of type React.PropTypes.oneOf(['ignore', 'warn', 'allow']) with defualt value 'allow' and sets used error strategy refer to Strategy and Errors

Changed

  • onError signature changed to function(event: React.FromEvent, value: string) => void
  • onChange signature changed to function(error: 'none' | 'invalidSymbol' | 'incompleteNumber' | 'singleMinus' | 'singleFloatingPoint' | 'singleZero'| 'min' | 'max' | 'required' | 'clean';) => void

Errors

  • 'clean' equivalent of 'required' when required prop is false

Implementation

  • error is moved from props to state
  • re-exposing public method getInputNode of TextField
  • using polyfillied Object.assign ('object-assign')

Properties

Deprecated

  • useStrategy has been renamed to strategy

README changes

Bug fixes

  • fixing when event.preventDefault() is called and when event is delegated

Breaking changes

  • When strategy is 'ignore' and error is min or max instead of clearing input field it's value is overwritten with String(props[error])

Bug fixes

  • Fixing all bugs introduced after v3.0.0 which prevented valid numbers to be entered when strategy is 'ignore' or 'warn'.
  • Fixing a bug after v3.2.0. Now onValid is emitted when input's value is beeing overwritten when ''min'' or 'max' errors are cathced and strategy is not 'allow'.
  • Fixing a bug after v3.2.0 where input value was not overwritten when 'min' or 'max' errors are cathced and strategy is not 'allow' and input is uncontrolled.
  • Fixing a bug where input's value is not beeing validated before and after initial render depending on that is the input controlled or not.

Bug fixes

  • Fixing a bug where valid numbers are prevented from beeing entered. This bug occures when (min * 10) < max (not fixed in v4.0.0)
  • Fixing a bug where valid numbers are prevented from beeing entered. This bug occures when Number(checkedValue) === 0 (not fixed in v4.0.0)

Bug fixes

  • Ensure onBlur is called if a handler is passed via props

New

  • Adding new public method getTextField with signature () => TextField which returns underling TextField ref

Properties

New

  • onRequestValueis function with signature function(value: string) => void called with correct number value when strategy is 'warn' or 'ignore' and value is provided.

Implementation

  • Droping alot of the logic for correcting value when strategy is 'warn' or 'ignore' and simplified it by introducing new prop onRequestValue 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

Bug fixes

  • If strategy is not 'allow' and entered number is less than min but it is decimal number, input value will be overriden if it's not controlled else onRequestValue will be emitted and 'min' error will be emitted if strategy is 'warn'

  • If strategy is not 'allow' and min is greater than 0 and entered number is 0, input value will be overriden if it's not controlled else onRequestValue will be emitted and 'min' error will be emitted if strategy is 'warn'

TypeScript Users Only

  • propTypes is now React.ValidationMap<NumberInputProps> instead of just Object making React.createElement callable

Bug fixes

  • 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

Bug fixes

  • 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.

Bug fixes

  • Fixing 'allow' to properly be masked as 'min' when error is emitted onBlur.
  • If there is error onBlur it will be emitted no matter dose the strategy is 'warn' or 'allow'.

Bug fixes

  • Fixing, in addition of value the following props are checked for changes: min, max,required and strategy before take decision to call onError, onValid and onRequestValue accordingly when componentWillReceiveProps.

Bug fixes

  • Fixing the bug that should have been fixed with v5.0.12 and the one introduced with v5.0.12 which caused events to be one state behind actual input.

Bug fixes

  • Fixing a bug which caused onError to be called based on old props.
  • Fixing the bug that should be fixed with 5.0.12

Bug fixes

  • Fixing Cannot resolve module 'material-ui-number-input' due to $ npm run npm command has not been ran before releasing previos version.

Properties

  • Displayed by the browser keyboard is now configurable (adding support for the input inputMode prop)

Bug fixes

  • Allowing negative min values, closes #7
  • Syncing npm and github versions.

Bug fixes

  • Fixing empty npm package, closes #9
  • Dummy version
  • Shipping #13 (Fixes #12)

Bug fixes

  • 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 to prop-types package

Props

  • Removing the unused prop inputMode