2019-08-13 15:36:46 -04:00
|
|
|
import React from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
2019-10-25 23:46:32 -03:00
|
|
|
import './TextInput.css';
|
|
|
|
|
|
2019-08-13 15:36:46 -04:00
|
|
|
class TextInput extends React.Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-25 23:46:32 -03:00
|
|
|
static propTypes = {
|
|
|
|
|
value: PropTypes.oneOfType([
|
|
|
|
|
PropTypes.string,
|
|
|
|
|
PropTypes.number
|
|
|
|
|
]),
|
|
|
|
|
id: PropTypes.string,
|
|
|
|
|
label:PropTypes.string,
|
|
|
|
|
type: PropTypes.string,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
|
value: '',
|
|
|
|
|
id: `TextInput-${new Date().toTimeString()}`,
|
|
|
|
|
label: undefined,
|
|
|
|
|
type: 'text',
|
2019-08-13 15:36:46 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
2019-10-25 23:46:32 -03:00
|
|
|
<div className="input-ohif-container">
|
|
|
|
|
<label className="input-ohif-label" htmlFor={this.props.id}>
|
|
|
|
|
{this.props.label}
|
|
|
|
|
<input
|
|
|
|
|
type={this.props.type}
|
|
|
|
|
id={this.props.id}
|
|
|
|
|
className="form-control input-ohif"
|
|
|
|
|
{...this.props}
|
|
|
|
|
/>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
2019-08-13 15:36:46 -04:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export { TextInput };
|