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

diff --cc README.md
index 26e05fc4a992d145a3a25a8e380d4dfd0ef80e8c,0698d7d407dc50b4620d5604a73e446d4fba2c52..27a1aae44b73b2e4e0ec886d0b309c7012a8d61c
+++ b/README.md
@@@ -77,9 -77,7 +77,10 @@@ AP
  | name                    | String                            | - | sets the name of the generated input |
  | onOpen                  | Function({ open })                |   | when TimePicker panel is opened      |
  | onClose                 | Function({ open })                |   | when TimePicker panel is opened      |
 +| hourStep                | Number                            | 1 | interval between hours in picker  |
 +| minuteStep              | Number                            | 1 | interval between minutes in picker  |
 +| secondStep              | Number                            | 1 | interval between seconds in picker  |
+ | focusOnOpen             | Boolean                           | false | automatically focus the input when the picker opens |
  
  ## Test Case
  
diff --cc src/Panel.jsx
index 4e09b57431cd96d712cbdfd00b6a86556eb30e7e,957c021853900ba8f416ae682d721fdef74b2e1f..a1b7c77a9cdd1ae19f28b892e2bc979141dc23f1
@@@ -39,10 -39,8 +39,11 @@@ class Panel extends Component 
      showSecond: PropTypes.bool,
      onClear: PropTypes.func,
      use12Hours: PropTypes.bool,
 +    hourStep: PropTypes.number,
 +    minuteStep: PropTypes.number,
 +    secondStep: PropTypes.number,
      addon: PropTypes.func,
+     focusOnOpen: PropTypes.bool,
      onKeyDown: PropTypes.func,
    };
  
@@@ -94,8 -92,7 +95,8 @@@
      const {
        prefixCls, className, placeholder, disabledHours, disabledMinutes,
        disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showMinute, showSecond,
-       format, defaultOpenValue, clearText, onEsc, addon, use12Hours, onClear, onKeyDown,
-       hourStep, minuteStep, secondStep,
 -      format, defaultOpenValue, clearText, onEsc, addon, use12Hours, onClear, focusOnOpen, onKeyDown,
++      format, defaultOpenValue, clearText, onEsc, addon, use12Hours, onClear,
++      focusOnOpen, onKeyDown, hourStep, minuteStep, secondStep,
      } = this.props;
      const {
        value, currentSelectPanel,
index 5f2239abc48088b93f66caca90e5aa74dc3f9183,70327d723981bf92212702153d58bd26d60d090e..c7ff80a932386bcd421cea50a6d5ef6119afd457
@@@ -48,9 -48,7 +48,10 @@@ export default class Picker extends Com
      name: PropTypes.string,
      autoComplete: PropTypes.string,
      use12Hours: PropTypes.bool,
 +    hourStep: PropTypes.number,
 +    minuteStep: PropTypes.number,
 +    secondStep: PropTypes.number,
+     focusOnOpen: PropTypes.bool,
      onKeyDown: PropTypes.func,
    };
  
        prefixCls, placeholder, disabledHours,
        disabledMinutes, disabledSeconds, hideDisabledOptions,
        allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText,
-       addon, use12Hours, onKeyDown, hourStep, minuteStep, secondStep,
 -      addon, use12Hours, focusOnOpen, onKeyDown,
++      addon, use12Hours, focusOnOpen, onKeyDown, hourStep, minuteStep, secondStep,
      } = this.props;
      return (
        <Panel
          disabledSeconds={disabledSeconds}
          hideDisabledOptions={hideDisabledOptions}
          use12Hours={use12Hours}
 +        hourStep={hourStep}
 +        minuteStep={minuteStep}
 +        secondStep={secondStep}
          addon={addon}
+         focusOnOpen={focusOnOpen}
          onKeyDown={onKeyDown}
        />
      );