diff options
-rw-r--r-- | examples/12hours.js | 1 | ||||
-rw-r--r-- | src/Header.jsx | 8 | ||||
-rw-r--r-- | src/Panel.jsx | 8 | ||||
-rw-r--r-- | 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( | |||
25 | onChange={onChange} | 25 | onChange={onChange} |
26 | format={format} | 26 | format={format} |
27 | use12Hours | 27 | use12Hours |
28 | inputReadOnly | ||
28 | />, | 29 | />, |
29 | document.getElementById('__react-content') | 30 | document.getElementById('__react-content') |
30 | ); | 31 | ); |
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 { | |||
10 | placeholder: PropTypes.string, | 10 | placeholder: PropTypes.string, |
11 | clearText: PropTypes.string, | 11 | clearText: PropTypes.string, |
12 | value: PropTypes.object, | 12 | value: PropTypes.object, |
13 | readOnlyInput: PropTypes.bool, | 13 | inputReadOnly: PropTypes.bool, |
14 | hourOptions: PropTypes.array, | 14 | hourOptions: PropTypes.array, |
15 | minuteOptions: PropTypes.array, | 15 | minuteOptions: PropTypes.array, |
16 | secondOptions: PropTypes.array, | 16 | secondOptions: PropTypes.array, |
@@ -28,7 +28,7 @@ class Header extends Component { | |||
28 | }; | 28 | }; |
29 | 29 | ||
30 | static defaultProps = { | 30 | static defaultProps = { |
31 | readOnlyInput: false, | 31 | inputReadOnly: false, |
32 | } | 32 | } |
33 | 33 | ||
34 | constructor(props) { | 34 | constructor(props) { |
@@ -171,7 +171,7 @@ class Header extends Component { | |||
171 | } | 171 | } |
172 | 172 | ||
173 | getInput() { | 173 | getInput() { |
174 | const { prefixCls, placeholder, readOnlyInput } = this.props; | 174 | const { prefixCls, placeholder, inputReadOnly } = this.props; |
175 | const { invalid, str } = this.state; | 175 | const { invalid, str } = this.state; |
176 | const invalidClass = invalid ? `${prefixCls}-input-invalid` : ''; | 176 | const invalidClass = invalid ? `${prefixCls}-input-invalid` : ''; |
177 | return ( | 177 | return ( |
@@ -182,7 +182,7 @@ class Header extends Component { | |||
182 | value={str} | 182 | value={str} |
183 | placeholder={placeholder} | 183 | placeholder={placeholder} |
184 | onChange={this.onInputChange} | 184 | onChange={this.onInputChange} |
185 | readOnly={!!readOnlyInput} | 185 | readOnly={!!inputReadOnly} |
186 | /> | 186 | /> |
187 | ); | 187 | ); |
188 | } | 188 | } |
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 { | |||
27 | value: PropTypes.object, | 27 | value: PropTypes.object, |
28 | placeholder: PropTypes.string, | 28 | placeholder: PropTypes.string, |
29 | format: PropTypes.string, | 29 | format: PropTypes.string, |
30 | readOnlyInput: PropTypes.bool, | 30 | inputReadOnly: PropTypes.bool, |
31 | disabledHours: PropTypes.func, | 31 | disabledHours: PropTypes.func, |
32 | disabledMinutes: PropTypes.func, | 32 | disabledMinutes: PropTypes.func, |
33 | disabledSeconds: PropTypes.func, | 33 | disabledSeconds: PropTypes.func, |
@@ -59,7 +59,7 @@ class Panel extends Component { | |||
59 | use12Hours: false, | 59 | use12Hours: false, |
60 | addon: noop, | 60 | addon: noop, |
61 | onKeyDown: noop, | 61 | onKeyDown: noop, |
62 | readOnlyInput: false, | 62 | inputReadOnly: false, |
63 | }; | 63 | }; |
64 | 64 | ||
65 | constructor(props) { | 65 | constructor(props) { |
@@ -98,7 +98,7 @@ class Panel extends Component { | |||
98 | prefixCls, className, placeholder, disabledHours, disabledMinutes, | 98 | prefixCls, className, placeholder, disabledHours, disabledMinutes, |
99 | disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showMinute, showSecond, | 99 | disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showMinute, showSecond, |
100 | format, defaultOpenValue, clearText, onEsc, addon, use12Hours, onClear, | 100 | format, defaultOpenValue, clearText, onEsc, addon, use12Hours, onClear, |
101 | focusOnOpen, onKeyDown, hourStep, minuteStep, secondStep, readOnlyInput, | 101 | focusOnOpen, onKeyDown, hourStep, minuteStep, secondStep, inputReadOnly, |
102 | } = this.props; | 102 | } = this.props; |
103 | const { | 103 | const { |
104 | value, currentSelectPanel, | 104 | value, currentSelectPanel, |
@@ -139,7 +139,7 @@ class Panel extends Component { | |||
139 | allowEmpty={allowEmpty} | 139 | allowEmpty={allowEmpty} |
140 | focusOnOpen={focusOnOpen} | 140 | focusOnOpen={focusOnOpen} |
141 | onKeyDown={onKeyDown} | 141 | onKeyDown={onKeyDown} |
142 | readOnlyInput={readOnlyInput} | 142 | inputReadOnly={inputReadOnly} |
143 | /> | 143 | /> |
144 | <Combobox | 144 | <Combobox |
145 | prefixCls={prefixCls} | 145 | prefixCls={prefixCls} |
diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index 039c2f5..fe07a47 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx | |||
@@ -18,7 +18,7 @@ export default class Picker extends Component { | |||
18 | clearText: PropTypes.string, | 18 | clearText: PropTypes.string, |
19 | value: PropTypes.object, | 19 | value: PropTypes.object, |
20 | defaultOpenValue: PropTypes.object, | 20 | defaultOpenValue: PropTypes.object, |
21 | readOnlyInput: PropTypes.bool, | 21 | inputReadOnly: PropTypes.bool, |
22 | disabled: PropTypes.bool, | 22 | disabled: PropTypes.bool, |
23 | allowEmpty: PropTypes.bool, | 23 | allowEmpty: PropTypes.bool, |
24 | defaultValue: PropTypes.object, | 24 | defaultValue: PropTypes.object, |
@@ -61,7 +61,7 @@ export default class Picker extends Component { | |||
61 | clearText: 'clear', | 61 | clearText: 'clear', |
62 | prefixCls: 'rc-time-picker', | 62 | prefixCls: 'rc-time-picker', |
63 | defaultOpen: false, | 63 | defaultOpen: false, |
64 | readOnlyInput: false, | 64 | inputReadOnly: false, |
65 | style: {}, | 65 | style: {}, |
66 | className: '', | 66 | className: '', |
67 | popupClassName: '', | 67 | popupClassName: '', |
@@ -169,7 +169,7 @@ export default class Picker extends Component { | |||
169 | getPanelElement() { | 169 | getPanelElement() { |
170 | const { | 170 | const { |
171 | prefixCls, placeholder, disabledHours, | 171 | prefixCls, placeholder, disabledHours, |
172 | disabledMinutes, disabledSeconds, hideDisabledOptions, readOnlyInput, | 172 | disabledMinutes, disabledSeconds, hideDisabledOptions, inputReadOnly, |
173 | allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText, | 173 | allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText, |
174 | addon, use12Hours, focusOnOpen, onKeyDown, hourStep, minuteStep, secondStep, | 174 | addon, use12Hours, focusOnOpen, onKeyDown, hourStep, minuteStep, secondStep, |
175 | } = this.props; | 175 | } = this.props; |
@@ -179,7 +179,7 @@ export default class Picker extends Component { | |||
179 | prefixCls={`${prefixCls}-panel`} | 179 | prefixCls={`${prefixCls}-panel`} |
180 | ref={this.savePanelRef} | 180 | ref={this.savePanelRef} |
181 | value={this.state.value} | 181 | value={this.state.value} |
182 | readOnlyInput={readOnlyInput} | 182 | inputReadOnly={inputReadOnly} |
183 | onChange={this.onPanelChange} | 183 | onChange={this.onPanelChange} |
184 | onClear={this.onPanelClear} | 184 | onClear={this.onPanelClear} |
185 | defaultOpenValue={defaultOpenValue} | 185 | defaultOpenValue={defaultOpenValue} |