From d67afec16a739a6cc3a28056c8dd124911372be9 Mon Sep 17 00:00:00 2001 From: tanjinzhou <415800467@qq.com> Date: Fri, 17 Jul 2020 17:13:30 +0800 Subject: [PATCH] refactor: tabIndex to tabindex, readOnly to readonly --- components/_util/transButton.jsx | 2 +- components/alert/index.jsx | 2 +- components/cascader/index.jsx | 2 +- components/color-picker/ColorPicker.jsx | 2 +- components/date-picker/RangePicker.jsx | 10 +++++----- components/date-picker/WeekPicker.jsx | 2 +- components/date-picker/createPicker.js | 6 +++--- components/date-picker/interface.js | 2 +- components/input-number/index.jsx | 2 +- components/input/ClearableLabeledInput.jsx | 6 +++--- components/input/__tests__/index.test.js | 2 +- components/input/inputProps.js | 2 +- .../__tests__/__snapshots__/demo.test.js.snap | 2 +- components/select/index.jsx | 2 +- components/switch/index.jsx | 2 +- components/vc-calendar/src/Calendar.jsx | 2 +- components/vc-calendar/src/RangeCalendar.jsx | 2 +- components/vc-calendar/src/date/DateInput.jsx | 2 +- .../vc-calendar/src/mixin/CalendarMixin.js | 2 +- components/vc-cascader/Cascader.jsx | 2 +- components/vc-checkbox/src/Checkbox.jsx | 12 ++++++------ components/vc-collapse/src/Panel.jsx | 2 +- components/vc-dialog/Dialog.jsx | 6 +++--- components/vc-drawer/src/Drawer.js | 2 +- components/vc-input-number/src/index.js | 16 ++++++++-------- components/vc-menu/SubPopupMenu.jsx | 2 +- components/vc-notification/Notice.jsx | 2 +- components/vc-pagination/Pager.jsx | 2 +- components/vc-pagination/Pagination.jsx | 12 ++++++------ components/vc-rate/src/Rate.jsx | 8 ++++---- components/vc-rate/src/Star.jsx | 2 +- components/vc-select/DropdownMenu.jsx | 2 +- components/vc-select/PropTypes.js | 2 +- components/vc-select/Select.jsx | 6 +++--- components/vc-slick/src/slider.js | 2 +- components/vc-slick/src/track.js | 6 +++--- components/vc-slider/src/Handle.jsx | 10 +++++----- components/vc-slider/src/Range.jsx | 12 ++++++------ components/vc-slider/src/Slider.jsx | 6 +++--- components/vc-slider/src/common/createSlider.jsx | 2 +- components/vc-steps/Step.jsx | 2 +- components/vc-switch/PropTypes.js | 2 +- components/vc-table/src/BodyTable.jsx | 4 ++-- components/vc-tabs/src/Sentinel.jsx | 2 +- components/vc-tabs/src/TabBarRootNode.jsx | 2 +- components/vc-time-picker/Header.jsx | 2 +- components/vc-time-picker/Select.jsx | 2 +- components/vc-time-picker/TimePicker.jsx | 4 ++-- components/vc-tree-select/src/Base/BasePopup.jsx | 2 +- .../vc-tree-select/src/Base/BaseSelector.jsx | 10 +++++----- .../src/Selector/MultipleSelector/index.jsx | 2 +- components/vc-tree/src/Tree.jsx | 6 +++--- components/vc-upload/src/AjaxUploader.jsx | 2 +- 53 files changed, 106 insertions(+), 106 deletions(-) diff --git a/components/_util/transButton.jsx b/components/_util/transButton.jsx index 9d02e7c15..80039a0ce 100644 --- a/components/_util/transButton.jsx +++ b/components/_util/transButton.jsx @@ -58,7 +58,7 @@ const TransButton = { return (
+ {closeText ? {closeText} : } ) : null; diff --git a/components/cascader/index.jsx b/components/cascader/index.jsx index bf354c4be..30e906635 100644 --- a/components/cascader/index.jsx +++ b/components/cascader/index.jsx @@ -484,7 +484,7 @@ const Cascader = { placeholder: value && value.length > 0 ? undefined : placeholder, value: inputValue, disabled, - readOnly: !showSearch, + readonly: !showSearch, autoComplete: 'off', class: `${prefixCls}-input ${sizeCls}`, onFocus: showSearch ? this.handleInputFocus : noop, diff --git a/components/color-picker/ColorPicker.jsx b/components/color-picker/ColorPicker.jsx index 77bc630c4..591d55297 100644 --- a/components/color-picker/ColorPicker.jsx +++ b/components/color-picker/ColorPicker.jsx @@ -185,7 +185,7 @@ export default { [`${prefixCls}-disabled`]: this.disabled, }; return ( -
+
diff --git a/components/date-picker/RangePicker.jsx b/components/date-picker/RangePicker.jsx index a7fb35e1e..193f9fdc5 100644 --- a/components/date-picker/RangePicker.jsx +++ b/components/date-picker/RangePicker.jsx @@ -386,20 +386,20 @@ export default { {separator} {clearIcon} {inputIcon} @@ -431,7 +431,7 @@ export default { ref="picker" class={props.pickerClass} style={pickerStyle} - tabIndex={props.disabled ? -1 : 0} + tabindex={props.disabled ? -1 : 0} onFocus={focus} onBlur={blur} onMouseenter={this.onMouseEnter} diff --git a/components/date-picker/WeekPicker.jsx b/components/date-picker/WeekPicker.jsx index 630ba5403..402fa46c3 100644 --- a/components/date-picker/WeekPicker.jsx +++ b/components/date-picker/WeekPicker.jsx @@ -193,7 +193,7 @@ export default { {clearIcon} @@ -255,7 +255,7 @@ export default function createPicker(TheCalendar, props) { ({ timePicker: PropTypes.any, autoFocus: PropTypes.bool, tagPrefixCls: PropTypes.string, - tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + tabindex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), align: PropTypes.object.def(() => ({})), inputReadOnly: PropTypes.bool, valueFormat: PropTypes.string, diff --git a/components/input-number/index.jsx b/components/input-number/index.jsx index e530697c7..69d838859 100644 --- a/components/input-number/index.jsx +++ b/components/input-number/index.jsx @@ -14,7 +14,7 @@ export const InputNumberProps = { value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), step: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - tabIndex: PropTypes.number, + tabindex: PropTypes.number, disabled: PropTypes.bool, size: PropTypes.oneOf(['large', 'small', 'default']), formatter: PropTypes.func, diff --git a/components/input/ClearableLabeledInput.jsx b/components/input/ClearableLabeledInput.jsx index be07ede55..fc3b32c7e 100644 --- a/components/input/ClearableLabeledInput.jsx +++ b/components/input/ClearableLabeledInput.jsx @@ -32,15 +32,15 @@ const ClearableLabeledInput = { prefix: PropTypes.any, addonBefore: PropTypes.any, addonAfter: PropTypes.any, - readOnly: PropTypes.bool, + readonly: PropTypes.bool, }, methods: { renderClearIcon(prefixCls) { - const { allowClear, value, disabled, readOnly, inputType, handleReset } = this.$props; + const { allowClear, value, disabled, readonly, inputType, handleReset } = this.$props; if ( !allowClear || disabled || - readOnly || + readonly || value === undefined || value === null || value === '' diff --git a/components/input/__tests__/index.test.js b/components/input/__tests__/index.test.js index 04d8a191f..07c165a13 100644 --- a/components/input/__tests__/index.test.js +++ b/components/input/__tests__/index.test.js @@ -36,7 +36,7 @@ focusTest(TextArea); describe('TextArea', () => { it('should auto calculate height according to content length', async () => { const wrapper = mount(TextArea, { - propsData: { value: '', readOnly: true, autoSize: true }, + propsData: { value: '', readonly: true, autoSize: true }, sync: false, }); diff --git a/components/input/inputProps.js b/components/input/inputProps.js index e0cefee3e..c43e1c380 100644 --- a/components/input/inputProps.js +++ b/components/input/inputProps.js @@ -12,7 +12,7 @@ export default { name: String, size: PropTypes.oneOf(['small', 'large', 'default']), disabled: PropTypes.bool, - readOnly: PropTypes.bool, + readonly: PropTypes.bool, addonBefore: PropTypes.any, addonAfter: PropTypes.any, // onPressEnter?: React.FormEventHandler; diff --git a/components/mentions/__tests__/__snapshots__/demo.test.js.snap b/components/mentions/__tests__/__snapshots__/demo.test.js.snap index 86c980962..df621fc7b 100644 --- a/components/mentions/__tests__/__snapshots__/demo.test.js.snap +++ b/components/mentions/__tests__/__snapshots__/demo.test.js.snap @@ -41,6 +41,6 @@ exports[`renders ./antdv-demo/docs/mentions/demo/readonly.md correctly 1`] = `
-
+
`; diff --git a/components/select/index.jsx b/components/select/index.jsx index 6087b43f9..33c0c4955 100644 --- a/components/select/index.jsx +++ b/components/select/index.jsx @@ -28,7 +28,7 @@ const AbstractSelectProps = () => ({ showSearch: PropTypes.bool, allowClear: PropTypes.bool, disabled: PropTypes.bool, - tabIndex: PropTypes.number, + tabindex: PropTypes.number, placeholder: PropTypes.any, defaultActiveFirstOption: PropTypes.bool, dropdownClassName: PropTypes.string, diff --git a/components/switch/index.jsx b/components/switch/index.jsx index f7ffa5a88..19d093477 100644 --- a/components/switch/index.jsx +++ b/components/switch/index.jsx @@ -18,7 +18,7 @@ const Switch = { disabled: PropTypes.bool, checkedChildren: PropTypes.any, unCheckedChildren: PropTypes.any, - tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + tabindex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), checked: PropTypes.bool, defaultChecked: PropTypes.bool, autoFocus: PropTypes.bool, diff --git a/components/vc-calendar/src/Calendar.jsx b/components/vc-calendar/src/Calendar.jsx index a35888ed2..e27eaeb71 100644 --- a/components/vc-calendar/src/Calendar.jsx +++ b/components/vc-calendar/src/Calendar.jsx @@ -320,7 +320,7 @@ const Calendar = { children.push(
{dateInputElement} -
+
+
{props.renderSidebar()}
{showClear && sSelectedValue[0] && sSelectedValue[1] ? ( diff --git a/components/vc-calendar/src/date/DateInput.jsx b/components/vc-calendar/src/date/DateInput.jsx index b16074681..bcc059c52 100644 --- a/components/vc-calendar/src/date/DateInput.jsx +++ b/components/vc-calendar/src/date/DateInput.jsx @@ -210,7 +210,7 @@ const DateInput = { onFocus={this.onFocus} onBlur={this.onBlur} inputMode={inputMode} - readOnly={inputReadOnly} + readonly={inputReadOnly} />
{showClear ? ( diff --git a/components/vc-calendar/src/mixin/CalendarMixin.js b/components/vc-calendar/src/mixin/CalendarMixin.js index d1f53640f..1fe026aae 100644 --- a/components/vc-calendar/src/mixin/CalendarMixin.js +++ b/components/vc-calendar/src/mixin/CalendarMixin.js @@ -75,7 +75,7 @@ const CalendarMixin = {
diff --git a/components/vc-cascader/Cascader.jsx b/components/vc-cascader/Cascader.jsx index ae8d73ae4..757547cab 100644 --- a/components/vc-cascader/Cascader.jsx +++ b/components/vc-cascader/Cascader.jsx @@ -381,7 +381,7 @@ export default { {children && cloneElement(children[0], { onKeydown: handleKeyDown, - tabIndex: disabled ? undefined : 0, + tabindex: disabled ? undefined : 0, })} ); diff --git a/components/vc-checkbox/src/Checkbox.jsx b/components/vc-checkbox/src/Checkbox.jsx index 5d0079f4f..11e82c4dd 100644 --- a/components/vc-checkbox/src/Checkbox.jsx +++ b/components/vc-checkbox/src/Checkbox.jsx @@ -21,8 +21,8 @@ export default { // onBlur: PropTypes.func, // onChange: PropTypes.func, // onClick: PropTypes.func, - tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - readOnly: PropTypes.bool, + tabindex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + readonly: PropTypes.bool, autoFocus: PropTypes.bool, value: PropTypes.any, }, @@ -100,8 +100,8 @@ export default { id, type, disabled, - readOnly, - tabIndex, + readonly, + tabindex, autoFocus, onFocus, onBlur, @@ -125,9 +125,9 @@ export default { name, id, type, - readOnly, + readonly, disabled, - tabIndex, + tabindex, class: `${prefixCls}-input`, checked: !!sChecked, autoFocus, diff --git a/components/vc-collapse/src/Panel.jsx b/components/vc-collapse/src/Panel.jsx index f1e1cfdac..e6b190038 100644 --- a/components/vc-collapse/src/Panel.jsx +++ b/components/vc-collapse/src/Panel.jsx @@ -77,7 +77,7 @@ export default { onClick={this.handleItemClick} onKeypress={this.handleKeyPress} role={accordion ? 'tab' : 'button'} - tabIndex={disabled ? -1 : 0} + tabindex={disabled ? -1 : 0} aria-expanded={isActive} > {showArrow && icon} diff --git a/components/vc-dialog/Dialog.jsx b/components/vc-dialog/Dialog.jsx index a7f057eca..a3a055820 100644 --- a/components/vc-dialog/Dialog.jsx +++ b/components/vc-dialog/Dialog.jsx @@ -279,7 +279,7 @@ export default { forceRender={forceRender} onMousedown={this.onDialogMouseDown} > -