| 55 | } |
| 56 | |
| 57 | render () { |
| 58 | const { className, grid, type, trigger, ...other } = this.props; |
| 59 | const props = { |
| 60 | className: classnames( |
| 61 | className, |
| 62 | 'rct-form-control', |
| 63 | getGrid(grid) |
| 64 | ), |
| 65 | onChange: this.handleChange, |
| 66 | type: type === 'password' ? 'password' : 'text', |
| 67 | value: this.state.value |
| 68 | }; |
| 69 | |
| 70 | if (trigger !== 'change') { |
| 71 | let handle = 'on' + trigger.charAt(0).toUpperCase() + trigger.slice(1); |
| 72 | props[handle] = this.handleTrigger; |
| 73 | } |
| 74 | |
| 75 | return (<input {...other} {...props} />); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | Input.propTypes = { |