diff options
author | 偏右 <afc163@gmail.com> | 2017-10-22 16:25:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-22 16:25:33 +0800 |
commit | cc2dca8a2bb0bf3b820903043be2586fb413c458 (patch) | |
tree | 4e0621e9b18f7938ffc31b87263182c79793d581 /src/TimePicker.jsx | |
parent | 5827568ef882ae5a474f37ff5c843e931528ebe8 (diff) | |
parent | b6767d8a08ccfc52836e09e3a0886a5cf225b93f (diff) | |
download | time-picker-cc2dca8a2bb0bf3b820903043be2586fb413c458.tar.gz time-picker-cc2dca8a2bb0bf3b820903043be2586fb413c458.tar.zst time-picker-cc2dca8a2bb0bf3b820903043be2586fb413c458.zip |
Merge branch 'master' into picker-step
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 85dc3e2..5f2239a 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx | |||
@@ -42,6 +42,8 @@ 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, |
@@ -49,6 +51,7 @@ export default class Picker extends Component { | |||
49 | hourStep: PropTypes.number, | 51 | hourStep: PropTypes.number, |
50 | minuteStep: PropTypes.number, | 52 | minuteStep: PropTypes.number, |
51 | secondStep: PropTypes.number, | 53 | secondStep: PropTypes.number, |
54 | onKeyDown: PropTypes.func, | ||
52 | }; | 55 | }; |
53 | 56 | ||
54 | static defaultProps = { | 57 | static defaultProps = { |
@@ -72,8 +75,11 @@ export default class Picker extends Component { | |||
72 | onChange: noop, | 75 | onChange: noop, |
73 | onOpen: noop, | 76 | onOpen: noop, |
74 | onClose: noop, | 77 | onClose: noop, |
78 | onFocus: noop, | ||
79 | onBlur: noop, | ||
75 | addon: noop, | 80 | addon: noop, |
76 | use12Hours: false, | 81 | use12Hours: false, |
82 | onKeyDown: noop, | ||
77 | }; | 83 | }; |
78 | 84 | ||
79 | constructor(props) { | 85 | constructor(props) { |
@@ -160,7 +166,7 @@ export default class Picker extends Component { | |||
160 | prefixCls, placeholder, disabledHours, | 166 | prefixCls, placeholder, disabledHours, |
161 | disabledMinutes, disabledSeconds, hideDisabledOptions, | 167 | disabledMinutes, disabledSeconds, hideDisabledOptions, |
162 | allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText, | 168 | allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText, |
163 | addon, use12Hours, hourStep, minuteStep, secondStep, | 169 | addon, use12Hours, onKeyDown, hourStep, minuteStep, secondStep, |
164 | } = this.props; | 170 | } = this.props; |
165 | return ( | 171 | return ( |
166 | <Panel | 172 | <Panel |
@@ -187,6 +193,7 @@ export default class Picker extends Component { | |||
187 | minuteStep={minuteStep} | 193 | minuteStep={minuteStep} |
188 | secondStep={secondStep} | 194 | secondStep={secondStep} |
189 | addon={addon} | 195 | addon={addon} |
196 | onKeyDown={onKeyDown} | ||
190 | /> | 197 | /> |
191 | ); | 198 | ); |
192 | } | 199 | } |
@@ -237,6 +244,7 @@ export default class Picker extends Component { | |||
237 | const { | 244 | const { |
238 | prefixCls, placeholder, placement, align, | 245 | prefixCls, placeholder, placement, align, |
239 | disabled, transitionName, style, className, getPopupContainer, name, autoComplete, | 246 | disabled, transitionName, style, className, getPopupContainer, name, autoComplete, |
247 | onFocus, onBlur, | ||
240 | } = this.props; | 248 | } = this.props; |
241 | const { open, value } = this.state; | 249 | const { open, value } = this.state; |
242 | const popupClassName = this.getPopupClassName(); | 250 | const popupClassName = this.getPopupClassName(); |
@@ -266,6 +274,8 @@ export default class Picker extends Component { | |||
266 | onKeyDown={this.onKeyDown} | 274 | onKeyDown={this.onKeyDown} |
267 | disabled={disabled} value={value && value.format(this.getFormat()) || ''} | 275 | disabled={disabled} value={value && value.format(this.getFormat()) || ''} |
268 | autoComplete={autoComplete} | 276 | autoComplete={autoComplete} |
277 | onFocus={onFocus} | ||
278 | onBlur={onBlur} | ||
269 | /> | 279 | /> |
270 | <span className={`${prefixCls}-icon`}/> | 280 | <span className={`${prefixCls}-icon`}/> |
271 | </span> | 281 | </span> |