diff options
Diffstat (limited to 'src/TimePicker.jsx')
-rw-r--r-- | src/TimePicker.jsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index e017527..70327d7 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx | |||
@@ -42,11 +42,14 @@ export default class Picker extends Component { | |||
42 | onChange: PropTypes.func, | 42 | onChange: PropTypes.func, |
43 | onOpen: PropTypes.func, | 43 | onOpen: PropTypes.func, |
44 | onClose: PropTypes.func, | 44 | onClose: PropTypes.func, |
45 | onFocus: PropTypes.func, | ||
46 | onBlur: PropTypes.func, | ||
45 | addon: PropTypes.func, | 47 | addon: PropTypes.func, |
46 | name: PropTypes.string, | 48 | name: PropTypes.string, |
47 | autoComplete: PropTypes.string, | 49 | autoComplete: PropTypes.string, |
48 | use12Hours: PropTypes.bool, | 50 | use12Hours: PropTypes.bool, |
49 | focusOnOpen: PropTypes.bool, | 51 | focusOnOpen: PropTypes.bool, |
52 | onKeyDown: PropTypes.func, | ||
50 | }; | 53 | }; |
51 | 54 | ||
52 | static defaultProps = { | 55 | static defaultProps = { |
@@ -70,9 +73,12 @@ export default class Picker extends Component { | |||
70 | onChange: noop, | 73 | onChange: noop, |
71 | onOpen: noop, | 74 | onOpen: noop, |
72 | onClose: noop, | 75 | onClose: noop, |
76 | onFocus: noop, | ||
77 | onBlur: noop, | ||
73 | addon: noop, | 78 | addon: noop, |
74 | use12Hours: false, | 79 | use12Hours: false, |
75 | focusOnOpen: false, | 80 | focusOnOpen: false, |
81 | onKeyDown: noop, | ||
76 | }; | 82 | }; |
77 | 83 | ||
78 | constructor(props) { | 84 | constructor(props) { |
@@ -159,7 +165,7 @@ export default class Picker extends Component { | |||
159 | prefixCls, placeholder, disabledHours, | 165 | prefixCls, placeholder, disabledHours, |
160 | disabledMinutes, disabledSeconds, hideDisabledOptions, | 166 | disabledMinutes, disabledSeconds, hideDisabledOptions, |
161 | allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText, | 167 | allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText, |
162 | addon, use12Hours, focusOnOpen, | 168 | addon, use12Hours, focusOnOpen, onKeyDown, |
163 | } = this.props; | 169 | } = this.props; |
164 | return ( | 170 | return ( |
165 | <Panel | 171 | <Panel |
@@ -184,6 +190,7 @@ export default class Picker extends Component { | |||
184 | use12Hours={use12Hours} | 190 | use12Hours={use12Hours} |
185 | addon={addon} | 191 | addon={addon} |
186 | focusOnOpen={focusOnOpen} | 192 | focusOnOpen={focusOnOpen} |
193 | onKeyDown={onKeyDown} | ||
187 | /> | 194 | /> |
188 | ); | 195 | ); |
189 | } | 196 | } |
@@ -234,6 +241,7 @@ export default class Picker extends Component { | |||
234 | const { | 241 | const { |
235 | prefixCls, placeholder, placement, align, | 242 | prefixCls, placeholder, placement, align, |
236 | disabled, transitionName, style, className, getPopupContainer, name, autoComplete, | 243 | disabled, transitionName, style, className, getPopupContainer, name, autoComplete, |
244 | onFocus, onBlur, | ||
237 | } = this.props; | 245 | } = this.props; |
238 | const { open, value } = this.state; | 246 | const { open, value } = this.state; |
239 | const popupClassName = this.getPopupClassName(); | 247 | const popupClassName = this.getPopupClassName(); |
@@ -263,6 +271,8 @@ export default class Picker extends Component { | |||
263 | onKeyDown={this.onKeyDown} | 271 | onKeyDown={this.onKeyDown} |
264 | disabled={disabled} value={value && value.format(this.getFormat()) || ''} | 272 | disabled={disabled} value={value && value.format(this.getFormat()) || ''} |
265 | autoComplete={autoComplete} | 273 | autoComplete={autoComplete} |
274 | onFocus={onFocus} | ||
275 | onBlur={onBlur} | ||
266 | /> | 276 | /> |
267 | <span className={`${prefixCls}-icon`}/> | 277 | <span className={`${prefixCls}-icon`}/> |
268 | </span> | 278 | </span> |