]> git.immae.eu Git - github/fretlink/time-picker.git/commitdiff
Merge branch 'master' into focus-on-open
author偏右 <afc163@gmail.com>
Sun, 22 Oct 2017 08:24:17 +0000 (16:24 +0800)
committerGitHub <noreply@github.com>
Sun, 22 Oct 2017 08:24:17 +0000 (16:24 +0800)
1  2 
src/Header.jsx
src/Panel.jsx
src/TimePicker.jsx

diff --cc src/Header.jsx
index 6bed557af2b54b1115ed920313b90e1c18a7a359,f6dd24157ae34e04fb43d66ff8e34475d4ae48c0..1520d25e3008b371efc66bebfe620d2cf5df4034
@@@ -22,7 -22,7 +22,8 @@@ class Header extends Component 
      allowEmpty: PropTypes.bool,
      defaultOpenValue: PropTypes.object,
      currentSelectPanel: PropTypes.string,
 +    focusOnOpen: PropTypes.bool,
+     onKeyDown: PropTypes.func,
    };
  
    constructor(props) {
diff --cc src/Panel.jsx
index deeba5207f6a023337a4c2e8d6827b0e3ef2fc0b,8a6c872e7e73784aeeace67fe3d4bca09384b57b..957c021853900ba8f416ae682d721fdef74b2e1f
@@@ -40,7 -40,7 +40,8 @@@ class Panel extends Component 
      onClear: PropTypes.func,
      use12Hours: PropTypes.bool,
      addon: PropTypes.func,
 +    focusOnOpen: PropTypes.bool,
+     onKeyDown: PropTypes.func,
    };
  
    static defaultProps = {
@@@ -90,7 -91,7 +92,7 @@@
      const {
        prefixCls, className, placeholder, disabledHours, disabledMinutes,
        disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showMinute, showSecond,
-       format, defaultOpenValue, clearText, onEsc, addon, use12Hours, onClear, focusOnOpen,
 -      format, defaultOpenValue, clearText, onEsc, addon, use12Hours, onClear, onKeyDown,
++      format, defaultOpenValue, clearText, onEsc, addon, use12Hours, onClear, focusOnOpen, onKeyDown,
      } = this.props;
      const {
        value, currentSelectPanel,
            onChange={this.onChange}
            onClear={onClear}
            allowEmpty={allowEmpty}
 +          focusOnOpen={focusOnOpen}
+           onKeyDown={onKeyDown}
          />
          <Combobox
            prefixCls={prefixCls}
index e01752732dbb7e9c8b0710f0f58dc5599f1aced5,271515da4af3973ac5ed0486c3bbc1f1e8948a6d..70327d723981bf92212702153d58bd26d60d090e
@@@ -46,7 -48,7 +48,8 @@@ export default class Picker extends Com
      name: PropTypes.string,
      autoComplete: PropTypes.string,
      use12Hours: PropTypes.bool,
 +    focusOnOpen: PropTypes.bool,
+     onKeyDown: PropTypes.func,
    };
  
    static defaultProps = {
      onChange: noop,
      onOpen: noop,
      onClose: noop,
+     onFocus: noop,
+     onBlur: noop,
      addon: noop,
      use12Hours: false,
 +    focusOnOpen: false,
+     onKeyDown: noop,
    };
  
    constructor(props) {
        prefixCls, placeholder, disabledHours,
        disabledMinutes, disabledSeconds, hideDisabledOptions,
        allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText,
-       addon, use12Hours, focusOnOpen,
 -      addon, use12Hours, onKeyDown,
++      addon, use12Hours, focusOnOpen, onKeyDown,
      } = this.props;
      return (
        <Panel
          hideDisabledOptions={hideDisabledOptions}
          use12Hours={use12Hours}
          addon={addon}
 +        focusOnOpen={focusOnOpen}
+         onKeyDown={onKeyDown}
        />
      );
    }