aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/TimePicker.jsx
diff options
context:
space:
mode:
authorArtem Vasiliev <artem.job@gmail.com>2016-10-20 00:00:17 +0300
committerArtem Vasiliev <artem.job@gmail.com>2016-10-20 00:00:17 +0300
commitb86fe1d16a4ad06951bba9ac2990ec3e4563637a (patch)
tree16cdd2ca2bb19b0a898b2b90b313f96a86f8fe79 /src/TimePicker.jsx
parent9c01af6e34f7d63843bacfcffb8c7ad45d6866cf (diff)
downloadtime-picker-b86fe1d16a4ad06951bba9ac2990ec3e4563637a.tar.gz
time-picker-b86fe1d16a4ad06951bba9ac2990ec3e4563637a.tar.zst
time-picker-b86fe1d16a4ad06951bba9ac2990ec3e4563637a.zip
feat: 'addon' property support
..to be able to render something like OK button to timepicker: ``` <TimePicker allowEmpty={false} addon={panel => { return ( <div className="row"> <a role="button" className="btn btn-sm btn-default" onClick={() => panel.close()}> {__('OK')} </a> </div> ) }} /> ```
Diffstat (limited to 'src/TimePicker.jsx')
-rw-r--r--src/TimePicker.jsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx
index 58f6ea1..358b596 100644
--- a/src/TimePicker.jsx
+++ b/src/TimePicker.jsx
@@ -39,6 +39,7 @@ const Picker = React.createClass({
39 onChange: PropTypes.func, 39 onChange: PropTypes.func,
40 onOpen: PropTypes.func, 40 onOpen: PropTypes.func,
41 onClose: PropTypes.func, 41 onClose: PropTypes.func,
42 addon: PropTypes.func,
42 }, 43 },
43 44
44 getDefaultProps() { 45 getDefaultProps() {
@@ -61,6 +62,7 @@ const Picker = React.createClass({
61 onChange: noop, 62 onChange: noop,
62 onOpen: noop, 63 onOpen: noop,
63 onClose: noop, 64 onClose: noop,
65 addon: noop,
64 }; 66 };
65 }, 67 },
66 68
@@ -137,6 +139,7 @@ const Picker = React.createClass({
137 prefixCls, placeholder, disabledHours, 139 prefixCls, placeholder, disabledHours,
138 disabledMinutes, disabledSeconds, hideDisabledOptions, 140 disabledMinutes, disabledSeconds, hideDisabledOptions,
139 allowEmpty, showHour, showSecond, defaultOpenValue, clearText, 141 allowEmpty, showHour, showSecond, defaultOpenValue, clearText,
142 addon,
140 } = this.props; 143 } = this.props;
141 return ( 144 return (
142 <Panel 145 <Panel
@@ -157,6 +160,7 @@ const Picker = React.createClass({
157 disabledMinutes={disabledMinutes} 160 disabledMinutes={disabledMinutes}
158 disabledSeconds={disabledSeconds} 161 disabledSeconds={disabledSeconds}
159 hideDisabledOptions={hideDisabledOptions} 162 hideDisabledOptions={hideDisabledOptions}
163 addon={addon}
160 /> 164 />
161 ); 165 );
162 }, 166 },