Skip to content

Commit d756173

Browse files
committed
style: format code
1 parent d038b90 commit d756173

Some content is hidden

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

74 files changed

+128
-99
lines changed

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ components/style/color/*.less
2424
.gitattributes
2525
.stylelintrc
2626
.vcmrc
27+
.logo
28+
.npmrc.template
29+
.huskyrc

components/checkbox/__tests__/group.test.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ describe('CheckboxGroup', () => {
4040
it('does not trigger onChange callback of both Checkbox and CheckboxGroup when CheckboxGroup is disabled', () => {
4141
const onChangeGroup = jest.fn();
4242

43-
const options = [{ label: 'Apple', value: 'Apple' }, { label: 'Pear', value: 'Pear' }];
43+
const options = [
44+
{ label: 'Apple', value: 'Apple' },
45+
{ label: 'Pear', value: 'Pear' },
46+
];
4447

4548
const groupWrapper = mount(
4649
{
@@ -95,7 +98,10 @@ describe('CheckboxGroup', () => {
9598
});
9699

97100
it('passes prefixCls down to checkbox', () => {
98-
const options = [{ label: 'Apple', value: 'Apple' }, { label: 'Orange', value: 'Orange' }];
101+
const options = [
102+
{ label: 'Apple', value: 'Apple' },
103+
{ label: 'Orange', value: 'Orange' },
104+
];
99105

100106
const wrapper = mount({
101107
render() {
@@ -106,7 +112,10 @@ describe('CheckboxGroup', () => {
106112
expect(wrapper.html()).toMatchSnapshot();
107113
});
108114
it('should be controlled by value', async () => {
109-
const options = [{ label: 'Apple', value: 'Apple' }, { label: 'Orange', value: 'Orange' }];
115+
const options = [
116+
{ label: 'Apple', value: 'Apple' },
117+
{ label: 'Orange', value: 'Orange' },
118+
];
110119

111120
const wrapper = mount(Checkbox.Group, {
112121
propsData: { options },

components/date-picker/__tests__/utils.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable import/prefer-default-export */
21
export function $$(className) {
32
return document.body.querySelectorAll(className);
43
}

components/date-picker/demo/disabled-date.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Disabled part of dates and time by `disabledDate` and `disabledTime` respectivel
2424
:disabledDate="disabledDate"
2525
:disabledTime="disabledRangeTime"
2626
:showTime="{
27-
hideDisabledOptions: true,
27+
hideDisabledOptions: true,
2828
defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('11:59:59', 'HH:mm:ss')]
2929
}"
3030
format="YYYY-MM-DD HH:mm:ss"

components/drawer/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const Drawer = {
162162
return (
163163
<div
164164
class={`${prefixCls}-wrapper-body`}
165-
style={{...containerStyle, ...wrapStyle}}
165+
style={{ ...containerStyle, ...wrapStyle }}
166166
onTransitionend={this.onDestroyTransitionEnd}
167167
>
168168
{this.renderHeader(prefixCls)}

components/form/FormItem.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export default {
9696
const { help, validateStatus } = this.$props;
9797
warning(
9898
this.getControls(this.slotDefault, true).length <= 1 ||
99-
(help !== undefined || validateStatus !== undefined),
99+
help !== undefined ||
100+
validateStatus !== undefined,
100101
'`Form.Item` cannot generate `validateStatus` and `help` automatically, ' +
101102
'while there are more than one `getFieldDecorator` in it.',
102103
);

components/form/demo/validate-other.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ Demonstration of validation configuration for form controls which are not shown
99
</us>
1010

1111
<template>
12-
<a-form id="components-form-demo-validate-other" :form="form" v-bind="formItemLayout" @submit="handleSubmit">
12+
<a-form
13+
id="components-form-demo-validate-other"
14+
:form="form"
15+
v-bind="formItemLayout"
16+
@submit="handleSubmit"
17+
>
1318
<a-form-item label="Plain Text">
1419
<span class="ant-form-text">
1520
China

components/locale-provider/__tests__/index.test.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/no-multi-comp */
21
import { mount } from '@vue/test-utils';
32
import Vue from 'vue';
43
import moment from 'moment';

components/radio/__tests__/group.test.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,10 @@ describe('Radio', () => {
218218
});
219219

220220
it('passes prefixCls down to radio', () => {
221-
const options = [{ label: 'Apple', value: 'Apple' }, { label: 'Orange', value: 'Orange' }];
221+
const options = [
222+
{ label: 'Apple', value: 'Apple' },
223+
{ label: 'Orange', value: 'Orange' },
224+
];
222225

223226
const wrapper = mount(RadioGroup, {
224227
propsData: {

components/table/__tests__/Table.filter.test.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ describe('Table.filter', () => {
2121
{
2222
text: 'Title',
2323
value: 'title',
24-
children: [{ text: 'Designer', value: 'designer' }, { text: 'Coder', value: 'coder' }],
24+
children: [
25+
{ text: 'Designer', value: 'designer' },
26+
{ text: 'Coder', value: 'coder' },
27+
],
2528
},
2629
],
2730
onFilter: filterFn,
@@ -358,7 +361,10 @@ describe('Table.filter', () => {
358361
title="name"
359362
dataIndex="name"
360363
key="name"
361-
filters={[{ text: 'Jack', value: 'Jack' }, { text: 'Lucy', value: 'Lucy' }]}
364+
filters={[
365+
{ text: 'Jack', value: 'Jack' },
366+
{ text: 'Lucy', value: 'Lucy' },
367+
]}
362368
filteredValue={this.filters.name}
363369
onFilter={filterFn}
364370
/>
@@ -399,7 +405,10 @@ describe('Table.filter', () => {
399405
title: 'Name',
400406
dataIndex: 'name',
401407
key: 'name',
402-
filters: [{ text: 'Jack', value: 'Jack' }, { text: 'Lucy', value: 'Lucy' }],
408+
filters: [
409+
{ text: 'Jack', value: 'Jack' },
410+
{ text: 'Lucy', value: 'Lucy' },
411+
],
403412
onFilter: filterFn,
404413
filteredValue: ['Jack'],
405414
},

components/table/index.zh-CN.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ const columns = [
6969

7070
### 事件
7171

72-
| 事件名称 | 说明 | 回调参数 |
73-
| ------------------ | -------------------------- | ------------------------------------- |
74-
| expandedRowsChange | 展开的行变化时触发 | Function(expandedRows) |
75-
| change | 分页、排序、筛选变化时触发 | Function(pagination, filters, sorter, { currentDataSource }) |
76-
| expand | 点击展开图标时触发 | Function(expanded, record) |
72+
| 事件名称 | 说明 | 回调参数 |
73+
| --- | --- | --- |
74+
| expandedRowsChange | 展开的行变化时触发 | Function(expandedRows) |
75+
| change | 分页、排序、筛选变化时触发 | Function(pagination, filters, sorter, { currentDataSource }) |
76+
| expand | 点击展开图标时触发 | Function(expanded, record) |
7777

7878
#### customRow 用法
7979

components/tree/DirectoryTree.jsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,10 @@ export default {
171171
},
172172

173173
setUncontrolledState(state) {
174-
const newState = omit(state, Object.keys(getOptionProps(this)).map(p => `_${p}`));
174+
const newState = omit(
175+
state,
176+
Object.keys(getOptionProps(this)).map(p => `_${p}`),
177+
);
175178
if (Object.keys(newState).length) {
176179
this.setState(newState);
177180
}

components/tree/Tree.jsx

+1-8
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,7 @@ export default {
161161
return treeData.map(item => {
162162
const key = item[replaceFields.key];
163163
const children = item[replaceFields.children];
164-
const {
165-
on = {},
166-
slots = {},
167-
scopedSlots = {},
168-
class: cls,
169-
style,
170-
...restProps
171-
} = item;
164+
const { on = {}, slots = {}, scopedSlots = {}, class: cls, style, ...restProps } = item;
172165
const treeNodeProps = {
173166
...restProps,
174167
icon:

components/tree/demo/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
<md cn={md.cn} us={md.us} />
3939
<BasicControlled />
4040
<Basic />
41-
<ReplaceFields/>
41+
<ReplaceFields />
4242
<CustomizedIcon />
4343
<Draggable />
4444
<Dynamic />

components/tree/index.en-US.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ One of the Tree `treeNode` prop for describing the tree's node, TreeNode has the
6464

6565
### DirectoryTree props
6666

67-
| Property | Description | Type | Default |
68-
| ------------ | ------------------------------------------------------------ | ------ | ------- |
67+
| Property | Description | Type | Default |
68+
| ------------ | ------------------------------------------------------------- | ------ | ------- |
6969
| expandAction | Directory open logic, optional `false` `'click'` `'dblclick'` | string | click |
7070

7171
## FAQ

components/tree/index.zh-CN.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
| 参数 | 说明 | 类型 | 默认值 |
66
| --- | --- | --- | --- |
77
| treeData | 节点的配置描述,具体项见下表, 1.1.4 之前的版本使用`treeNodes` | array | -- |
8-
| replaceFields | 替换treeNode中 title,key,children字段为treeData中对应的字段 | object |{children:'children', title:'title', key:'key' } |
8+
| replaceFields | 替换 treeNode 中 title,key,children 字段为 treeData 中对应的字段 | object | {children:'children', title:'title', key:'key' } |
99
| autoExpandParent | 是否自动展开父节点 | boolean | true |
1010
| checkable | 节点前添加 Checkbox 复选框 | boolean | false |
1111
| checkedKeys(v-model) | (受控)选中复选框的树节点(注意:父子节点有关联,如果传入父节点 key,则子节点自动选中;相应当子节点 key 都传入,父节点也自动选中。当设置`checkable``checkStrictly`,它是一个有`checked``halfChecked`属性的对象,并且父子节点的选中与否不再关联 | string\[] \| number\[] \| {checked: string\[] \| number\[], halfChecked: string\[] \| number\[]} | \[] |
@@ -64,8 +64,8 @@
6464

6565
### DirectoryTree props
6666

67-
| 参数 | 说明 | 类型 | 默认值 |
68-
| ------------ | ------------------------------------------------ | ------ | ------ |
67+
| 参数 | 说明 | 类型 | 默认值 |
68+
| ------------ | ------------------------------------------------- | ------ | ------ |
6969
| expandAction | 目录展开逻辑,可选 `false` `'click'` `'dblclick'` | string | click |
7070

7171
## FAQ

components/upload/__tests__/mock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export function setup() {
1111
});
1212
}
1313

14-
export const teardown = mock.teardown.bind(mock);
14+
export const teardown = mock.teardown.bind(mock);

components/vc-calendar/demo/antd-calendar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
/* eslint react/no-multi-comp:0, no-console:0, no-unused-vars:0 */
2+
/* eslint no-console:0, no-unused-vars:0 */
33
44
import '../assets/index.less';
55
import PropTypes from '@/components/_util/vue-types';

components/vc-calendar/demo/antd-month-calendar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
/* eslint react/no-multi-comp:0, no-console:0 */
2+
/* eslint no-console:0 */
33
import '../assets/index.less';
44
import PropTypes from '@/components/_util/vue-types';
55
import DatePicker from '../src/Picker';

components/vc-calendar/demo/antd-range-calendar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
/* eslint react/no-multi-comp:0, no-console:0, no-unused-vars:0 */
2+
/* eslint no-console:0, no-unused-vars:0 */
33
44
import '../assets/index.less';
55
import '@/components/vc-time-picker/assets/index.less';

components/vc-calendar/demo/full-calendar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
/* eslint react/no-multi-comp:0, no-console:0 */
2+
/* eslint no-console:0 */
33
import '../assets/index.less';
44
import zhCN from '../src/locale/zh_CN';
55
import enUS from '../src/locale/en_US';

components/vc-cascader/Cascader.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ export default {
155155
},
156156
handleChange(options, setProps, e) {
157157
if (e.type !== 'keydown' || e.keyCode === KeyCode.ENTER) {
158-
this.__emit('change', options.map(o => o[this.getFieldName('value')]), options);
158+
this.__emit(
159+
'change',
160+
options.map(o => o[this.getFieldName('value')]),
161+
options,
162+
);
159163
this.setPopupVisible(setProps.visible);
160164
}
161165
},

components/vc-dialog/Dialog.jsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const IDialogPropTypes = getDialogPropTypes();
1010

1111
let uuid = 0;
1212

13-
/* eslint react/no-is-mounted:0 */
1413
function noop() {}
1514
function getScroll(w, top) {
1615
let ret = w[`page${top ? 'Y' : 'X'}Offset`];
@@ -111,7 +110,7 @@ export default {
111110
},
112111
updatedCallback(visible) {
113112
const mousePosition = this.mousePosition;
114-
const {mask, focusTriggerAfterClose} = this;
113+
const { mask, focusTriggerAfterClose } = this;
115114
if (this.visible) {
116115
// first show
117116
if (!visible) {
@@ -375,15 +374,15 @@ export default {
375374
cacheOverflow = {
376375
overflowX: document.body.style.overflowX,
377376
overflowY: document.body.style.overflowY,
378-
overflow: document.body.style.overflow,
377+
overflow: document.body.style.overflow,
379378
};
380379
switchScrollingEffect();
381380
// Must be set after switchScrollingEffect
382381
document.body.style.overflow = 'hidden';
383382
} else if (!openCount) {
384383
// IE browser doesn't merge overflow style, need to set it separately
385384
// https://github.com/ant-design/ant-design/issues/19393
386-
if (cacheOverflow.overflow !== undefined) {
385+
if (cacheOverflow.overflow !== undefined) {
387386
document.body.style.overflow = cacheOverflow.overflow;
388387
}
389388
if (cacheOverflow.overflowX !== undefined) {

components/vc-form/demo/async-init.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint react/no-multi-comp:0, no-console:0 */
1+
/* eslint no-console:0 */
22

33
import { createForm } from '../index';
44
import { regionStyle, errorStyle } from './styles';

components/vc-form/demo/dynamic-fields.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint react/no-multi-comp:0, no-console:0 */
1+
/* eslint no-console:0 */
22

33
import { createForm } from '../index';
44
import BaseMixin from '../../_util/BaseMixin';

components/vc-form/demo/dynamic.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint react/no-multi-comp:0, no-console:0 */
1+
/* eslint no-console:0 */
22

33
import { createForm } from '../index';
44
import { regionStyle, errorStyle } from './styles';

components/vc-form/demo/file-input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint react/no-multi-comp:0, no-console:0 */
1+
/* eslint no-console:0 */
22

33
import { createForm } from '../index';
44
import { regionStyle, errorStyle } from './styles';

components/vc-form/demo/getFieldDecorator.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint react/no-multi-comp:0, no-console:0 */
1+
/* eslint no-console:0 */
22

33
import { createForm } from '../index';
44

components/vc-form/demo/modal.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint react/no-multi-comp:0, no-console:0 */
1+
/* eslint no-console:0 */
22

33
import BaseMixin from '../../_util/BaseMixin';
44
import createDOMForm from '../src/createDOMForm';

components/vc-form/demo/nested-field.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint react/no-multi-comp:0, no-console:0 */
1+
/* eslint no-console:0 */
22

33
import createForm from '../src/createDOMForm';
44

components/vc-form/demo/normalize.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint react/no-multi-comp:0, no-console:0 */
1+
/* eslint no-console:0 */
22

33
import { createForm } from '../index';
44
import { regionStyle, errorStyle } from './styles';

components/vc-form/demo/overview.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint react/no-multi-comp:0, no-console:0 */
1+
/* eslint no-console:0 */
22

33
import createDOMForm from '../src/createDOMForm';
44
import { DatePicker, Select } from 'ant-design-vue';

components/vc-form/demo/parallel-form.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint react/no-multi-comp:0, no-console:0 */
1+
/* eslint no-console:0 */
22

33
import { createForm } from '../index';
44
import { regionStyle } from './styles';

components/vc-form/demo/suggest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint react/no-multi-comp:0, no-console:0 */
1+
/* eslint no-console:0 */
22

33
import { createForm } from '../index';
44
import { Select } from 'ant-design-vue';

components/vc-form/demo/validateFirst.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint react/no-multi-comp:0, no-console:0 */
1+
/* eslint no-console:0 */
22

33
import { createForm } from '../index';
44
import { regionStyle, errorStyle } from './styles';

components/vc-form/demo/validateTrigger.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint react/no-multi-comp:0, no-console:0 */
1+
/* eslint no-console:0 */
22

33
import { createForm } from '../index';
44
import { regionStyle, errorStyle } from './styles';

0 commit comments

Comments
 (0)