2016-09-12 19:44:28 +02:00
|
|
|
import React from 'react'
|
|
|
|
import { Select, Input } from 'rebass'
|
|
|
|
|
|
|
|
/*** Number fields with support for min, max and units and documentation*/
|
|
|
|
class NumberField extends React.Component {
|
|
|
|
static propTypes = {
|
|
|
|
name: React.PropTypes.string.isRequired,
|
2016-09-12 19:47:28 +02:00
|
|
|
value: React.PropTypes.number,
|
2016-09-12 19:44:28 +02:00
|
|
|
default: React.PropTypes.number,
|
|
|
|
unit: React.PropTypes.string,
|
|
|
|
min: React.PropTypes.number,
|
|
|
|
max: React.PropTypes.number,
|
|
|
|
doc: React.PropTypes.string,
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return <Input type="number"
|
|
|
|
label={this.props.name}
|
|
|
|
name={this.props.name}
|
|
|
|
message={this.props.doc}
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default NumberField
|