From 4e70ea0da45e572cd660f79ac98b6a25c640cb36 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Thu, 1 Feb 2018 14:20:05 +0800 Subject: Rename readOnlyInput to inputReadOnly --- examples/12hours.js | 1 + src/Header.jsx | 8 ++++---- src/Panel.jsx | 8 ++++---- src/TimePicker.jsx | 8 ++++---- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/examples/12hours.js b/examples/12hours.js index 72d6950..6281210 100644 --- a/examples/12hours.js +++ b/examples/12hours.js @@ -25,6 +25,7 @@ ReactDom.render( onChange={onChange} format={format} use12Hours + inputReadOnly />, document.getElementById('__react-content') ); diff --git a/src/Header.jsx b/src/Header.jsx index 1ba5909..21d557e 100644 --- a/src/Header.jsx +++ b/src/Header.jsx @@ -10,7 +10,7 @@ class Header extends Component { placeholder: PropTypes.string, clearText: PropTypes.string, value: PropTypes.object, - readOnlyInput: PropTypes.bool, + inputReadOnly: PropTypes.bool, hourOptions: PropTypes.array, minuteOptions: PropTypes.array, secondOptions: PropTypes.array, @@ -28,7 +28,7 @@ class Header extends Component { }; static defaultProps = { - readOnlyInput: false, + inputReadOnly: false, } constructor(props) { @@ -171,7 +171,7 @@ class Header extends Component { } getInput() { - const { prefixCls, placeholder, readOnlyInput } = this.props; + const { prefixCls, placeholder, inputReadOnly } = this.props; const { invalid, str } = this.state; const invalidClass = invalid ? `${prefixCls}-input-invalid` : ''; return ( @@ -182,7 +182,7 @@ class Header extends Component { value={str} placeholder={placeholder} onChange={this.onInputChange} - readOnly={!!readOnlyInput} + readOnly={!!inputReadOnly} /> ); } diff --git a/src/Panel.jsx b/src/Panel.jsx index c23241d..1adb19a 100644 --- a/src/Panel.jsx +++ b/src/Panel.jsx @@ -27,7 +27,7 @@ class Panel extends Component { value: PropTypes.object, placeholder: PropTypes.string, format: PropTypes.string, - readOnlyInput: PropTypes.bool, + inputReadOnly: PropTypes.bool, disabledHours: PropTypes.func, disabledMinutes: PropTypes.func, disabledSeconds: PropTypes.func, @@ -59,7 +59,7 @@ class Panel extends Component { use12Hours: false, addon: noop, onKeyDown: noop, - readOnlyInput: false, + inputReadOnly: false, }; constructor(props) { @@ -98,7 +98,7 @@ class Panel extends Component { prefixCls, className, placeholder, disabledHours, disabledMinutes, disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showMinute, showSecond, format, defaultOpenValue, clearText, onEsc, addon, use12Hours, onClear, - focusOnOpen, onKeyDown, hourStep, minuteStep, secondStep, readOnlyInput, + focusOnOpen, onKeyDown, hourStep, minuteStep, secondStep, inputReadOnly, } = this.props; const { value, currentSelectPanel, @@ -139,7 +139,7 @@ class Panel extends Component { allowEmpty={allowEmpty} focusOnOpen={focusOnOpen} onKeyDown={onKeyDown} - readOnlyInput={readOnlyInput} + inputReadOnly={inputReadOnly} />