X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FPanel.jsx;h=df128ff67d75741216952588899a005c570bb30f;hb=4e020febdf6201ab5f10a0e49be81c6ff32daaeb;hp=f5cf7bc6c1184b20646222a7b0db0a286cf2f9fb;hpb=ec0805acf4f81286d56b43c431fd6a89f5bf743a;p=github%2Ffretlink%2Ftime-picker.git diff --git a/src/Panel.jsx b/src/Panel.jsx index f5cf7bc..df128ff 100644 --- a/src/Panel.jsx +++ b/src/Panel.jsx @@ -34,8 +34,11 @@ const Panel = React.createClass({ onEsc: PropTypes.func, allowEmpty: PropTypes.bool, showHour: PropTypes.bool, + showMinute: PropTypes.bool, showSecond: PropTypes.bool, onClear: PropTypes.func, + use12Hours: PropTypes.bool, + addon: PropTypes.func, }, getDefaultProps() { @@ -47,6 +50,8 @@ const Panel = React.createClass({ disabledMinutes: noop, disabledSeconds: noop, defaultOpenValue: moment(), + use12Hours: false, + addon: noop, }; }, @@ -79,11 +84,15 @@ const Panel = React.createClass({ this.setState({ currentSelectPanel }); }, + close() { + this.props.onEsc(); + }, + render() { const { prefixCls, className, placeholder, disabledHours, disabledMinutes, - disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showSecond, - format, defaultOpenValue, clearText, onEsc, + disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showMinute, showSecond, + format, defaultOpenValue, clearText, onEsc, addon, use12Hours, } = this.props; const { value, currentSelectPanel, @@ -97,7 +106,7 @@ const Panel = React.createClass({ const secondOptions = generateOptions(60, disabledSecondOptions, hideDisabledOptions); return ( -
+
+ {addon(this)}
); },