Skip to content

Commit cae25c7

Browse files
committed
v1.1.0 Release (Features and bug fixes)
1 parent b9f1011 commit cae25c7

File tree

5 files changed

+157
-201
lines changed

5 files changed

+157
-201
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Or get compiled development and production version from ./dist
2626
| displayType | String: text / input | input | If input it renders a input element where formatting happens as you input characters. If text it renders it as a normal text in a span formatting the given value |
2727
| format | String : Hash based ex (#### #### #### ####) <br/> Or Function| none | If format given as hash string allow number input inplace of hash. If format given as function, component calls the function with unformatted number and expects formatted number.
2828
| mask | String (ex : _) | none | If mask defined, component will show non entered placed with masked value.
29-
| customInput | Component Reference | input | This allow supporting custom inputs with number format. See details
29+
| customInput | Component Reference | input | This allow supporting custom inputs with number format.
3030
| onChange | (e, value) => {} | none | onChange handler accepts event object through which you can get formattedValue (e.targe.value # $2,223) and second parameter non formatted value (ie: 2223)
3131

3232
**Other than this it accepts all the props which can be given to a input or span based on displayType you selected.**
@@ -111,6 +111,12 @@ All custom input props and number input props are passed together.
111111
[http://codepen.io/s-yadav/pen/bpKNMa](http://codepen.io/s-yadav/pen/bpKNMa)
112112

113113
### Major Updates
114+
### v1.1.0
115+
- Support custom input
116+
- Support custom decimal / thousandSeparator
117+
- Support providing decimal precision
118+
- Bug fixes ([See release notes](https://github.com/s-yadav/react-number-format/releases))
119+
114120
### v1.0.0
115121
- Support decimals
116122
- Support changing thousandSeparator to ','

karma.conf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ module.exports = function (config) {
1515
webpack: {
1616
module: {
1717
loaders: [
18-
{test: /\.js$/, exclude: /node_modules/, loaders: ['babel']}
18+
{test: /\.js$/, exclude: /node_modules/, loaders: ['babel']},
19+
{test: /\.json$/, loaders: ['json-loader']}
1920
]
2021
},
2122
watch: true

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-number-format",
33
"description": "React component to format number in an input or as a text.",
4-
"version": "1.1.0-alpha2",
4+
"version": "1.1.0",
55
"main": "lib/number_format.js",
66
"author": "Sudhanshu Yadav",
77
"license": "MIT",
@@ -40,6 +40,7 @@
4040
"babel-register": "^6.7.2",
4141
"classnames": "^2.2.3",
4242
"cross-env": "^3.1.4",
43+
"enzyme": "^2.7.1",
4344
"eslint": "^2.5.3",
4445
"eslint-config-standard": "^5.1.0",
4546
"eslint-loader": "^1.3.0",
@@ -60,7 +61,6 @@
6061
"karma-webpack": "^1.7.0",
6162
"material-ui": "^0.16.7",
6263
"react": "^15.0.1",
63-
"react-addons-test-utils": "^15.0.1",
6464
"react-dom": "^15.0.1",
6565
"react-transform-hmr": "^1.0.4",
6666
"webpack": "^1.12.14",

src/number_format.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class NumberFormat extends React.Component {
3737
value: this.formatInput(props.value).formattedValue
3838
}
3939
this.onChange = this.onChange.bind(this);
40-
this.onInput = this.onInput.bind(this);
4140
this.onKeyDown = this.onKeyDown.bind(this);
4241
}
4342

@@ -212,9 +211,6 @@ class NumberFormat extends React.Component {
212211
onChange(e) {
213212
this.onChangeHandler(e,this.props.onChange);
214213
}
215-
onInput(e) {
216-
this.onChangeHandler(e,this.props.onInput);
217-
}
218214
onKeyDown(e) {
219215
const el = e.target;
220216
const {selectionStart, selectionEnd, value} = el;
@@ -246,9 +242,8 @@ class NumberFormat extends React.Component {
246242
});
247243

248244
const inputProps = Object.assign({}, props, {
249-
type:'tel',
245+
type:'text',
250246
value:this.state.value,
251-
onInput:this.onChange,
252247
onChange:this.onChange,
253248
onKeyDown:this.onKeyDown,
254249
})

0 commit comments

Comments
 (0)