react-currency-input
Advanced tools
+1
-1
| { | ||
| "name": "react-currency-input", | ||
| "version": "1.0.3", | ||
| "version": "1.0.4", | ||
| "description": "React component for inputing currency amounts", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
+29
-25
@@ -21,12 +21,16 @@ # react-currency-input | ||
| const MyApp = React.createClass({ | ||
| handleChange(newValue){ | ||
| console.log(newValue) | ||
| } | ||
| render() { | ||
| return ( | ||
| <div> | ||
| <CurrencyInput value="0" onChange={this.handleChange}/> | ||
| </div> | ||
| ); | ||
| } | ||
| getInitialState(){ | ||
| return ({amount: "0.00"}); | ||
| }, | ||
| handleChange(newValue){ | ||
| this.setState({amount: newValue}); | ||
| } | ||
| render() { | ||
| return ( | ||
| <div> | ||
| <CurrencyInput value={this.state.amount} onChange={this.handleChange}/> | ||
| </div> | ||
| ); | ||
| } | ||
| } | ||
@@ -44,13 +48,13 @@ export default MyApp | ||
| const MyApp = React.createClass({ | ||
| handleSubmit(event){ | ||
| event.preventDefault(); | ||
| console.log(this.refs.myinput.getMaskedValue()) | ||
| } | ||
| render() { | ||
| return ( | ||
| <form onSubmit={this.handleSubmit}> | ||
| <CurrencyInput value="0" ref="myinput" /> | ||
| </form> | ||
| ); | ||
| } | ||
| handleSubmit(event){ | ||
| event.preventDefault(); | ||
| console.log(this.refs.myinput.getMaskedValue()) | ||
| } | ||
| render() { | ||
| return ( | ||
| <form onSubmit={this.handleSubmit}> | ||
| <CurrencyInput ref="myinput" /> | ||
| </form> | ||
| ); | ||
| } | ||
| } | ||
@@ -68,3 +72,3 @@ export default MyApp | ||
| // 1.234.567,89 | ||
| <CurrencyInput decimalSeparator="," thousandSeparator="." value="0" onChange={this.handleChange} /> | ||
| <CurrencyInput decimalSeparator="," thousandSeparator="." /> | ||
| ``` | ||
@@ -75,3 +79,3 @@ | ||
| // 123,456.789 | ||
| <CurrencyInput precision="3" value="0" onChange={this.handleChange} /> | ||
| <CurrencyInput precision="3" /> | ||
| ``` | ||
@@ -81,3 +85,3 @@ | ||
| // 123,456,789 | ||
| <CurrencyInput precision="0" value="0" onChange={this.handleChange} /> | ||
| <CurrencyInput precision="0" /> | ||
| ``` | ||
@@ -89,3 +93,3 @@ | ||
| ```javascript | ||
| <CurrencyInput className="form-control" value="0" onChange={this.handleChange} /> | ||
| <CurrencyInput className="form-control" /> | ||
| ``` | ||
@@ -92,0 +96,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
12106
0.12%105
3.96%0
-100%