-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support of keyboard navigation combinations & simple formatter
modify README(short keys) [bug fix] counting remain fix test on useTouch
- Loading branch information
Showing
6 changed files
with
283 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
placeholder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* eslint no-console:0 */ | ||
require('rc-input-number/assets/index.less'); | ||
const InputNumber = require('rc-input-number'); | ||
const React = require('react'); | ||
const ReactDOM = require('react-dom'); | ||
|
||
const Component = React.createClass({ | ||
getInitialState() { | ||
return { | ||
disabled: false, | ||
readOnly: false, | ||
value: 5, | ||
}; | ||
}, | ||
onChange(value) { | ||
console.log('onChange:', value); | ||
this.setState({ value }); | ||
}, | ||
toggleDisabled() { | ||
this.setState({ | ||
disabled: !this.state.disabled, | ||
}); | ||
}, | ||
toggleReadOnly() { | ||
this.setState({ | ||
readOnly: !this.state.readOnly, | ||
}); | ||
}, | ||
format(num) { | ||
return `$ ${num}`; | ||
}, | ||
render() { | ||
return ( | ||
<div style={{ margin: 10 }}> | ||
<InputNumber | ||
min={-8000} | ||
max={10000} | ||
value={this.state.value} | ||
style={{ width: 100 }} | ||
readOnly={this.state.readOnly} | ||
onChange={this.onChange} | ||
disabled={this.state.disabled} | ||
autoFocus={false} | ||
step={0.5} | ||
formatter={this.format} | ||
/> | ||
<p> | ||
<button onClick={this.toggleDisabled}>toggle Disabled</button> | ||
<button onClick={this.toggleReadOnly}>toggle readOnly</button> | ||
</p> | ||
</div> | ||
); | ||
}, | ||
}); | ||
|
||
ReactDOM.render(<Component/>, document.getElementById('__react-content')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.