aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Panel.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Panel.jsx')
-rw-r--r--src/Panel.jsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Panel.jsx b/src/Panel.jsx
index 9066b03..0ed60e9 100644
--- a/src/Panel.jsx
+++ b/src/Panel.jsx
@@ -36,6 +36,7 @@ const Panel = React.createClass({
36 showHour: PropTypes.bool, 36 showHour: PropTypes.bool,
37 showSecond: PropTypes.bool, 37 showSecond: PropTypes.bool,
38 onClear: PropTypes.func, 38 onClear: PropTypes.func,
39 addon: PropTypes.func,
39 }, 40 },
40 41
41 getDefaultProps() { 42 getDefaultProps() {
@@ -47,6 +48,7 @@ const Panel = React.createClass({
47 disabledMinutes: noop, 48 disabledMinutes: noop,
48 disabledSeconds: noop, 49 disabledSeconds: noop,
49 defaultOpenValue: moment(), 50 defaultOpenValue: moment(),
51 addon: noop,
50 }; 52 };
51 }, 53 },
52 54
@@ -79,11 +81,15 @@ const Panel = React.createClass({
79 this.setState({ currentSelectPanel }); 81 this.setState({ currentSelectPanel });
80 }, 82 },
81 83
84 close() {
85 this.props.onEsc();
86 },
87
82 render() { 88 render() {
83 const { 89 const {
84 prefixCls, className, placeholder, disabledHours, disabledMinutes, 90 prefixCls, className, placeholder, disabledHours, disabledMinutes,
85 disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showSecond, 91 disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showSecond,
86 format, defaultOpenValue, clearText, onEsc, 92 format, defaultOpenValue, clearText, onEsc, addon,
87 } = this.props; 93 } = this.props;
88 const { 94 const {
89 value, currentSelectPanel, 95 value, currentSelectPanel,
@@ -133,6 +139,7 @@ const Panel = React.createClass({
133 disabledSeconds={disabledSeconds} 139 disabledSeconds={disabledSeconds}
134 onCurrentSelectPanelChange={this.onCurrentSelectPanelChange} 140 onCurrentSelectPanelChange={this.onCurrentSelectPanelChange}
135 /> 141 />
142 {addon(this)}
136 </div> 143 </div>
137 ); 144 );
138 }, 145 },