Skip to content

Commit 76d8491

Browse files
committed
style: fix code format
1 parent f547171 commit 76d8491

File tree

68 files changed

+394
-334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+394
-334
lines changed

components/anchor/Anchor.jsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,15 @@ export default {
212212
},
213213

214214
render() {
215-
const { prefixCls: customizePrefixCls, offsetTop, affix, showInkInFixed, activeLink, $slots, getContainer } = this;
215+
const {
216+
prefixCls: customizePrefixCls,
217+
offsetTop,
218+
affix,
219+
showInkInFixed,
220+
activeLink,
221+
$slots,
222+
getContainer,
223+
} = this;
216224

217225
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
218226
const prefixCls = getPrefixCls('anchor', customizePrefixCls);

components/auto-complete/index.jsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,14 @@ const AutoComplete = {
8181
},
8282

8383
render() {
84-
const { size, prefixCls: customizePrefixCls, optionLabelProp, dataSource, $slots, $listeners } = this;
84+
const {
85+
size,
86+
prefixCls: customizePrefixCls,
87+
optionLabelProp,
88+
dataSource,
89+
$slots,
90+
$listeners,
91+
} = this;
8592

8693
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
8794
const prefixCls = getPrefixCls('select', customizePrefixCls);

components/avatar/__tests__/Avatar.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('Avatar Render', () => {
4444
global.document.body.innerHTML = '';
4545
}, 0);
4646
});
47-
it('should handle onError correctly', async() => {
47+
it('should handle onError correctly', async () => {
4848
global.document.body.innerHTML = '';
4949
const LOAD_FAILURE_SRC = 'http://error.url';
5050
const LOAD_SUCCESS_SRC = 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png';
@@ -68,7 +68,7 @@ describe('Avatar Render', () => {
6868
},
6969
};
7070

71-
const wrapper = mount(Foo, { sync: false, attachToDocument: true },);
71+
const wrapper = mount(Foo, { sync: false, attachToDocument: true });
7272
await asyncExpect(() => {
7373
// mock img load Error, since jsdom do not load resource by default
7474
// https://github.com/jsdom/jsdom/issues/1816
@@ -82,7 +82,7 @@ describe('Avatar Render', () => {
8282
}, 0);
8383
});
8484

85-
it('should show image on success after a failure state', async() => {
85+
it('should show image on success after a failure state', async () => {
8686
global.document.body.innerHTML = '';
8787
const LOAD_FAILURE_SRC = 'http://error.url';
8888
const LOAD_SUCCESS_SRC = 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png';

components/badge/ScrollNumber.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ export default {
118118
const { sCount } = this;
119119
if (sCount && Number(sCount) % 1 === 0) {
120120
return getNumberArray(sCount)
121-
.map((num, i) => this.renderCurrentNumber(prefixCls, num, i))
122-
.reverse();
121+
.map((num, i) => this.renderCurrentNumber(prefixCls, num, i))
122+
.reverse();
123123
}
124124
return sCount;
125125
},

components/button/button.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ export default {
151151
const iconNode = iconType ? <Icon type={iconType} /> : null;
152152
const children = filterEmpty($slots.default);
153153
const autoInsertSpace = this.configProvider.autoInsertSpaceInButton !== false;
154-
const kids = children.map(child => this.insertSpace(child, this.isNeedInserted() && autoInsertSpace));
154+
const kids = children.map(child =>
155+
this.insertSpace(child, this.isNeedInserted() && autoInsertSpace),
156+
);
155157

156158
if ($attrs.href !== undefined) {
157159
return (

components/calendar/Header.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default {
135135
},
136136

137137
render() {
138-
const { prefixCls: customizePrefixCls,type, value, locale, fullscreen } = this;
138+
const { prefixCls: customizePrefixCls, type, value, locale, fullscreen } = this;
139139
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
140140
const prefixCls = getPrefixCls('fullcalendar', customizePrefixCls);
141141

components/calendar/index.jsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,12 @@ const Calendar = {
167167
if (value && localeCode) {
168168
value.locale(localeCode);
169169
}
170-
const { prefixCls: customizePrefixCls, fullscreen, dateFullCellRender, monthFullCellRender } = props;
170+
const {
171+
prefixCls: customizePrefixCls,
172+
fullscreen,
173+
dateFullCellRender,
174+
monthFullCellRender,
175+
} = props;
171176
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
172177
const prefixCls = getPrefixCls('fullcalendar', customizePrefixCls);
173178
const type = mode === 'year' ? 'month' : 'date';

components/carousel/index.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ const Carousel = {
136136
props.fade = true;
137137
}
138138

139-
140139
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
141140
let className = getPrefixCls('carousel', props.prefixCls);
142141

components/cascader/index.jsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,9 @@ const Cascader = {
380380
...otherProps
381381
} = props;
382382
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
383-
const renderEmpty = (
384-
this.configProvider.renderEmpty &&
385-
this.configProvider.renderEmpty()
386-
) || ConfigConsumerProps.renderEmpty;
383+
const renderEmpty =
384+
(this.configProvider.renderEmpty && this.configProvider.renderEmpty()) ||
385+
ConfigConsumerProps.renderEmpty;
387386
const prefixCls = getPrefixCls('cascader', customizePrefixCls);
388387
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
389388

components/collapse/Collapse.jsx

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import animation from '../_util/openAnimation';
2-
import { getOptionProps, initDefaultProps, getComponentFromProp, isValidElement } from '../_util/props-util';
2+
import {
3+
getOptionProps,
4+
initDefaultProps,
5+
getComponentFromProp,
6+
isValidElement,
7+
} from '../_util/props-util';
38
import { cloneElement } from '../_util/vnode';
49
import VcCollapse, { collapseProps } from '../vc-collapse';
510
import Icon from '../icon';
@@ -22,12 +27,14 @@ export default {
2227
methods: {
2328
renderExpandIcon(panelProps, prefixCls) {
2429
const expandIcon = getComponentFromProp(this, 'expandIcon', panelProps);
25-
const icon = expandIcon || <Icon type="right" rotate={panelProps.isActive ? 90 : undefined} />;
30+
const icon = expandIcon || (
31+
<Icon type="right" rotate={panelProps.isActive ? 90 : undefined} />
32+
);
2633
return isValidElement(expandIcon ? icon[0] : icon)
27-
? cloneElement(icon, {
28-
class: `${prefixCls}-arrow`,
29-
})
30-
: icon;
34+
? cloneElement(icon, {
35+
class: `${prefixCls}-arrow`,
36+
})
37+
: icon;
3138
},
3239
},
3340
render() {
@@ -42,7 +49,7 @@ export default {
4249
props: {
4350
...getOptionProps(this),
4451
prefixCls,
45-
expandIcon: (panelProps) => this.renderExpandIcon(panelProps, prefixCls),
52+
expandIcon: panelProps => this.renderExpandIcon(panelProps, prefixCls),
4653
},
4754
class: collapseClassName,
4855
on: $listeners,

components/config-provider/index.jsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,11 @@ const ConfigProvider = {
3838
};
3939
},
4040
watch: {
41-
...getWatch([
42-
'prefixCls',
43-
'csp',
44-
'autoInsertSpaceInButton',
45-
]),
41+
...getWatch(['prefixCls', 'csp', 'autoInsertSpaceInButton']),
4642
},
4743
methods: {
4844
renderEmptyComponent() {
49-
const customRender = getComponentFromProp(this,'renderEmpty', {}, false);
45+
const customRender = getComponentFromProp(this, 'renderEmpty', {}, false);
5046
return this.$props.renderEmpty || customRender || defaultRenderEmpty;
5147
},
5248
getPrefixCls(suffixCls, customizePrefixCls) {

components/config-provider/renderEmpty.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const RenderEmpty = {
1414
render(createElement, context) {
1515
const { props, injections } = context;
1616
function renderHtml(componentName) {
17-
const getPrefixCls = injections.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
17+
const getPrefixCls =
18+
injections.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
1819
const prefix = getPrefixCls('empty');
1920
switch (componentName) {
2021
case 'Table':

components/date-picker/RangePicker.jsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,20 @@ export default {
111111
};
112112
}
113113
this.setState(state);
114-
this.prevState = {...this.$data, ...state};
114+
this.prevState = { ...this.$data, ...state };
115115
},
116116
open(val) {
117-
const state = { sOpen: val};
117+
const state = { sOpen: val };
118118
this.setState(state);
119-
this.prevState = {...this.$data, ...state};
119+
this.prevState = { ...this.$data, ...state };
120120
},
121121
},
122122
mounted() {
123-
this.prevState = {...this.$data};
123+
this.prevState = { ...this.$data };
124124
},
125125
updated() {
126126
this.$nextTick(() => {
127-
if(!hasProp(this, 'open') && this.prevState.sOpen && !this.sOpen) {
127+
if (!hasProp(this, 'open') && this.prevState.sOpen && !this.sOpen) {
128128
this.focus();
129129
}
130130
});

components/date-picker/WeekPicker.jsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,28 @@ export default {
5656
value(val) {
5757
const state = { _value: val };
5858
this.setState(state);
59-
this.prevState = {...this.$data, ...state};
59+
this.prevState = { ...this.$data, ...state };
6060
},
6161
open(val) {
6262
const state = { _open: val };
6363
this.setState(state);
64-
this.prevState = {...this.$data, ...state};
64+
this.prevState = { ...this.$data, ...state };
6565
},
6666
},
6767
mounted() {
68-
this.prevState = {...this.$data};
68+
this.prevState = { ...this.$data };
6969
},
7070
updated() {
7171
this.$nextTick(() => {
72-
if(!hasProp(this, 'open') && this.prevState._open && !this._open) {
72+
if (!hasProp(this, 'open') && this.prevState._open && !this._open) {
7373
this.focus();
7474
}
7575
});
7676
},
7777
methods: {
7878
weekDateRender(current) {
7979
const selectedValue = this.$data._value;
80-
const { _prefixCls: prefixCls, $scopedSlots } = this;
80+
const { _prefixCls: prefixCls, $scopedSlots } = this;
8181
const dateRender = this.dateRender || $scopedSlots.dateRender;
8282
const dateNode = dateRender ? dateRender(current) : current.date();
8383
if (
@@ -111,7 +111,7 @@ export default {
111111
this.handleChange(null);
112112
},
113113
renderFooter(...args) {
114-
const {_prefixCls: prefixCls, $scopedSlots} = this;
114+
const { _prefixCls: prefixCls, $scopedSlots } = this;
115115
const renderExtraFooter = this.renderExtraFooter || $scopedSlots.renderExtraFooter;
116116
return renderExtraFooter ? (
117117
<div class={`${prefixCls}-footer-extra`}>{renderExtraFooter(...args)}</div>

components/date-picker/createPicker.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default function createPicker(TheCalendar, props) {
5858
state.showDate = props.value;
5959
}
6060
this.setState(state);
61-
this.prevState = {...this.$data, ...state};
61+
this.prevState = { ...this.$data, ...state };
6262
},
6363
value(val) {
6464
const state = {};
@@ -67,15 +67,15 @@ export default function createPicker(TheCalendar, props) {
6767
state.showDate = val;
6868
}
6969
this.setState(state);
70-
this.prevState = {...this.$data, ...state};
70+
this.prevState = { ...this.$data, ...state };
7171
},
7272
},
7373
mounted() {
74-
this.prevState = {...this.$data};
74+
this.prevState = { ...this.$data };
7575
},
7676
updated() {
7777
this.$nextTick(() => {
78-
if(!hasProp(this, 'open') && this.prevState._open && !this._open) {
78+
if (!hasProp(this, 'open') && this.prevState._open && !this._open) {
7979
this.focus();
8080
}
8181
});

components/date-picker/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { DatePickerProps, MonthPickerProps, WeekPickerProps, RangePickerProps }
99
const DatePicker = wrapPicker(
1010
{ ...createPicker(VcCalendar, DatePickerProps()), name: 'ADatePicker' },
1111
DatePickerProps(),
12-
'date'
12+
'date',
1313
);
1414

1515
const MonthPicker = wrapPicker(

components/date-picker/wrapPicker.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ export default function wrapPicker(Picker, props, pickerType) {
113113
} = props;
114114
const mergedPickerType = showTime ? `${pickerType}Time` : pickerType;
115115
const mergedFormat =
116-
format ||
117-
locale[LOCALE_FORMAT_MAPPING[mergedPickerType]] ||
118-
DEFAULT_FORMAT[mergedPickerType];
116+
format ||
117+
locale[LOCALE_FORMAT_MAPPING[mergedPickerType]] ||
118+
DEFAULT_FORMAT[mergedPickerType];
119119

120120
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
121121
const prefixCls = getPrefixCls('calendar', customizePrefixCls);

components/drawer/index.jsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ const Drawer = {
142142
return null;
143143
}
144144
this.destroyClose = false;
145-
const {
146-
placement,
147-
} = this.$props;
145+
const { placement } = this.$props;
148146

149147
const containerStyle =
150148
placement === 'left' || placement === 'right'
@@ -179,8 +177,12 @@ const Drawer = {
179177
const props = getOptionProps(this);
180178
const {
181179
prefixCls: customizePrefixCls,
182-
width, height, visible,
183-
placement, wrapClassName, ...rest
180+
width,
181+
height,
182+
visible,
183+
placement,
184+
wrapClassName,
185+
...rest
184186
} = props;
185187
const haveMask = rest.mask ? '' : 'no-mask';
186188
const offsetStyle = {};

components/dropdown/dropdown-button.jsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ export default {
7373

7474
return (
7575
<ButtonGroup {...restProps} class={prefixCls}>
76-
<Button type={type} disabled={disabled} onClick={this.onClick} htmlType={htmlType} href={href}>
76+
<Button
77+
type={type}
78+
disabled={disabled}
79+
onClick={this.onClick}
80+
htmlType={htmlType}
81+
href={href}
82+
>
7783
{this.$slots.default}
7884
</Button>
7985
<Dropdown {...dropdownProps}>

components/empty/index.jsx

+2-7
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ const Empty = {
2525
},
2626
methods: {
2727
renderEmpty(contentLocale) {
28-
const {
29-
prefixCls: customizePrefixCls,
30-
...restProps
31-
} = this.$props;
28+
const { prefixCls: customizePrefixCls, ...restProps } = this.$props;
3229
const prefixCls = ConfigConsumerProps.getPrefixCls('empty', customizePrefixCls);
3330
const image = getComponentFromProp(this, 'image');
3431
const description = getComponentFromProp(this, 'description');
@@ -57,9 +54,7 @@ const Empty = {
5754
},
5855
},
5956
render() {
60-
return (
61-
<LocaleReceiver componentName="Empty" scopedSlots={{ default: this.renderEmpty }} />
62-
);
57+
return <LocaleReceiver componentName="Empty" scopedSlots={{ default: this.renderEmpty }} />;
6358
},
6459
};
6560

components/form/FormItem.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ export default {
407407
prefixCls,
408408
this.slotDefault,
409409
this.renderHelp(prefixCls),
410-
this.renderExtra(prefixCls)
410+
this.renderExtra(prefixCls),
411411
),
412412
),
413413
];

0 commit comments

Comments
 (0)