style: format code

pull/1638/head
tangjinzhou 2019-12-21 18:37:33 +08:00
parent d038b90f4d
commit d7561734ea
74 changed files with 128 additions and 99 deletions

View File

@ -24,3 +24,6 @@ components/style/color/*.less
.gitattributes .gitattributes
.stylelintrc .stylelintrc
.vcmrc .vcmrc
.logo
.npmrc.template
.huskyrc

View File

@ -40,7 +40,10 @@ describe('CheckboxGroup', () => {
it('does not trigger onChange callback of both Checkbox and CheckboxGroup when CheckboxGroup is disabled', () => { it('does not trigger onChange callback of both Checkbox and CheckboxGroup when CheckboxGroup is disabled', () => {
const onChangeGroup = jest.fn(); const onChangeGroup = jest.fn();
const options = [{ label: 'Apple', value: 'Apple' }, { label: 'Pear', value: 'Pear' }]; const options = [
{ label: 'Apple', value: 'Apple' },
{ label: 'Pear', value: 'Pear' },
];
const groupWrapper = mount( const groupWrapper = mount(
{ {
@ -95,7 +98,10 @@ describe('CheckboxGroup', () => {
}); });
it('passes prefixCls down to checkbox', () => { it('passes prefixCls down to checkbox', () => {
const options = [{ label: 'Apple', value: 'Apple' }, { label: 'Orange', value: 'Orange' }]; const options = [
{ label: 'Apple', value: 'Apple' },
{ label: 'Orange', value: 'Orange' },
];
const wrapper = mount({ const wrapper = mount({
render() { render() {
@ -106,7 +112,10 @@ describe('CheckboxGroup', () => {
expect(wrapper.html()).toMatchSnapshot(); expect(wrapper.html()).toMatchSnapshot();
}); });
it('should be controlled by value', async () => { it('should be controlled by value', async () => {
const options = [{ label: 'Apple', value: 'Apple' }, { label: 'Orange', value: 'Orange' }]; const options = [
{ label: 'Apple', value: 'Apple' },
{ label: 'Orange', value: 'Orange' },
];
const wrapper = mount(Checkbox.Group, { const wrapper = mount(Checkbox.Group, {
propsData: { options }, propsData: { options },

View File

@ -1,4 +1,3 @@
/* eslint-disable import/prefer-default-export */
export function $$(className) { export function $$(className) {
return document.body.querySelectorAll(className); return document.body.querySelectorAll(className);
} }

View File

@ -24,7 +24,7 @@ Disabled part of dates and time by `disabledDate` and `disabledTime` respectivel
:disabledDate="disabledDate" :disabledDate="disabledDate"
:disabledTime="disabledRangeTime" :disabledTime="disabledRangeTime"
:showTime="{ :showTime="{
hideDisabledOptions: true, hideDisabledOptions: true,
defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('11:59:59', 'HH:mm:ss')] defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('11:59:59', 'HH:mm:ss')]
}" }"
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"

View File

@ -162,7 +162,7 @@ const Drawer = {
return ( return (
<div <div
class={`${prefixCls}-wrapper-body`} class={`${prefixCls}-wrapper-body`}
style={{...containerStyle, ...wrapStyle}} style={{ ...containerStyle, ...wrapStyle }}
onTransitionend={this.onDestroyTransitionEnd} onTransitionend={this.onDestroyTransitionEnd}
> >
{this.renderHeader(prefixCls)} {this.renderHeader(prefixCls)}

View File

@ -96,7 +96,8 @@ export default {
const { help, validateStatus } = this.$props; const { help, validateStatus } = this.$props;
warning( warning(
this.getControls(this.slotDefault, true).length <= 1 || this.getControls(this.slotDefault, true).length <= 1 ||
(help !== undefined || validateStatus !== undefined), help !== undefined ||
validateStatus !== undefined,
'`Form.Item` cannot generate `validateStatus` and `help` automatically, ' + '`Form.Item` cannot generate `validateStatus` and `help` automatically, ' +
'while there are more than one `getFieldDecorator` in it.', 'while there are more than one `getFieldDecorator` in it.',
); );

View File

@ -9,7 +9,12 @@ Demonstration of validation configuration for form controls which are not shown
</us> </us>
<template> <template>
<a-form id="components-form-demo-validate-other" :form="form" v-bind="formItemLayout" @submit="handleSubmit"> <a-form
id="components-form-demo-validate-other"
:form="form"
v-bind="formItemLayout"
@submit="handleSubmit"
>
<a-form-item label="Plain Text"> <a-form-item label="Plain Text">
<span class="ant-form-text"> <span class="ant-form-text">
China China

View File

@ -1,4 +1,3 @@
/* eslint-disable react/no-multi-comp */
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue from 'vue'; import Vue from 'vue';
import moment from 'moment'; import moment from 'moment';

View File

@ -218,7 +218,10 @@ describe('Radio', () => {
}); });
it('passes prefixCls down to radio', () => { it('passes prefixCls down to radio', () => {
const options = [{ label: 'Apple', value: 'Apple' }, { label: 'Orange', value: 'Orange' }]; const options = [
{ label: 'Apple', value: 'Apple' },
{ label: 'Orange', value: 'Orange' },
];
const wrapper = mount(RadioGroup, { const wrapper = mount(RadioGroup, {
propsData: { propsData: {

View File

@ -21,7 +21,10 @@ describe('Table.filter', () => {
{ {
text: 'Title', text: 'Title',
value: 'title', value: 'title',
children: [{ text: 'Designer', value: 'designer' }, { text: 'Coder', value: 'coder' }], children: [
{ text: 'Designer', value: 'designer' },
{ text: 'Coder', value: 'coder' },
],
}, },
], ],
onFilter: filterFn, onFilter: filterFn,
@ -358,7 +361,10 @@ describe('Table.filter', () => {
title="name" title="name"
dataIndex="name" dataIndex="name"
key="name" key="name"
filters={[{ text: 'Jack', value: 'Jack' }, { text: 'Lucy', value: 'Lucy' }]} filters={[
{ text: 'Jack', value: 'Jack' },
{ text: 'Lucy', value: 'Lucy' },
]}
filteredValue={this.filters.name} filteredValue={this.filters.name}
onFilter={filterFn} onFilter={filterFn}
/> />
@ -399,7 +405,10 @@ describe('Table.filter', () => {
title: 'Name', title: 'Name',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
filters: [{ text: 'Jack', value: 'Jack' }, { text: 'Lucy', value: 'Lucy' }], filters: [
{ text: 'Jack', value: 'Jack' },
{ text: 'Lucy', value: 'Lucy' },
],
onFilter: filterFn, onFilter: filterFn,
filteredValue: ['Jack'], filteredValue: ['Jack'],
}, },

View File

@ -69,11 +69,11 @@ const columns = [
### 事件 ### 事件
| 事件名称 | 说明 | 回调参数 | | 事件名称 | 说明 | 回调参数 |
| ------------------ | -------------------------- | ------------------------------------- | | --- | --- | --- |
| expandedRowsChange | 展开的行变化时触发 | Function(expandedRows) | | expandedRowsChange | 展开的行变化时触发 | Function(expandedRows) |
| change | 分页、排序、筛选变化时触发 | Function(pagination, filters, sorter, { currentDataSource }) | | change | 分页、排序、筛选变化时触发 | Function(pagination, filters, sorter, { currentDataSource }) |
| expand | 点击展开图标时触发 | Function(expanded, record) | | expand | 点击展开图标时触发 | Function(expanded, record) |
#### customRow 用法 #### customRow 用法

View File

@ -171,7 +171,10 @@ export default {
}, },
setUncontrolledState(state) { setUncontrolledState(state) {
const newState = omit(state, Object.keys(getOptionProps(this)).map(p => `_${p}`)); const newState = omit(
state,
Object.keys(getOptionProps(this)).map(p => `_${p}`),
);
if (Object.keys(newState).length) { if (Object.keys(newState).length) {
this.setState(newState); this.setState(newState);
} }

View File

@ -161,14 +161,7 @@ export default {
return treeData.map(item => { return treeData.map(item => {
const key = item[replaceFields.key]; const key = item[replaceFields.key];
const children = item[replaceFields.children]; const children = item[replaceFields.children];
const { const { on = {}, slots = {}, scopedSlots = {}, class: cls, style, ...restProps } = item;
on = {},
slots = {},
scopedSlots = {},
class: cls,
style,
...restProps
} = item;
const treeNodeProps = { const treeNodeProps = {
...restProps, ...restProps,
icon: icon:

View File

@ -38,7 +38,7 @@ export default {
<md cn={md.cn} us={md.us} /> <md cn={md.cn} us={md.us} />
<BasicControlled /> <BasicControlled />
<Basic /> <Basic />
<ReplaceFields/> <ReplaceFields />
<CustomizedIcon /> <CustomizedIcon />
<Draggable /> <Draggable />
<Dynamic /> <Dynamic />

View File

@ -64,8 +64,8 @@ One of the Tree `treeNode` prop for describing the tree's node, TreeNode has the
### DirectoryTree props ### DirectoryTree props
| Property | Description | Type | Default | | Property | Description | Type | Default |
| ------------ | ------------------------------------------------------------ | ------ | ------- | | ------------ | ------------------------------------------------------------- | ------ | ------- |
| expandAction | Directory open logic, optional `false` `'click'` `'dblclick'` | string | click | | expandAction | Directory open logic, optional `false` `'click'` `'dblclick'` | string | click |
## FAQ ## FAQ

View File

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

View File

@ -11,4 +11,4 @@ export function setup() {
}); });
} }
export const teardown = mock.teardown.bind(mock); export const teardown = mock.teardown.bind(mock);

View File

@ -1,5 +1,5 @@
<script> <script>
/* eslint react/no-multi-comp:0, no-console:0, no-unused-vars:0 */ /* eslint no-console:0, no-unused-vars:0 */
import '../assets/index.less'; import '../assets/index.less';
import PropTypes from '@/components/_util/vue-types'; import PropTypes from '@/components/_util/vue-types';

View File

@ -1,5 +1,5 @@
<script> <script>
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import '../assets/index.less'; import '../assets/index.less';
import PropTypes from '@/components/_util/vue-types'; import PropTypes from '@/components/_util/vue-types';
import DatePicker from '../src/Picker'; import DatePicker from '../src/Picker';

View File

@ -1,5 +1,5 @@
<script> <script>
/* eslint react/no-multi-comp:0, no-console:0, no-unused-vars:0 */ /* eslint no-console:0, no-unused-vars:0 */
import '../assets/index.less'; import '../assets/index.less';
import '@/components/vc-time-picker/assets/index.less'; import '@/components/vc-time-picker/assets/index.less';

View File

@ -1,5 +1,5 @@
<script> <script>
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import '../assets/index.less'; import '../assets/index.less';
import zhCN from '../src/locale/zh_CN'; import zhCN from '../src/locale/zh_CN';
import enUS from '../src/locale/en_US'; import enUS from '../src/locale/en_US';

View File

@ -155,7 +155,11 @@ export default {
}, },
handleChange(options, setProps, e) { handleChange(options, setProps, e) {
if (e.type !== 'keydown' || e.keyCode === KeyCode.ENTER) { if (e.type !== 'keydown' || e.keyCode === KeyCode.ENTER) {
this.__emit('change', options.map(o => o[this.getFieldName('value')]), options); this.__emit(
'change',
options.map(o => o[this.getFieldName('value')]),
options,
);
this.setPopupVisible(setProps.visible); this.setPopupVisible(setProps.visible);
} }
}, },

View File

@ -10,7 +10,6 @@ const IDialogPropTypes = getDialogPropTypes();
let uuid = 0; let uuid = 0;
/* eslint react/no-is-mounted:0 */
function noop() {} function noop() {}
function getScroll(w, top) { function getScroll(w, top) {
let ret = w[`page${top ? 'Y' : 'X'}Offset`]; let ret = w[`page${top ? 'Y' : 'X'}Offset`];
@ -111,7 +110,7 @@ export default {
}, },
updatedCallback(visible) { updatedCallback(visible) {
const mousePosition = this.mousePosition; const mousePosition = this.mousePosition;
const {mask, focusTriggerAfterClose} = this; const { mask, focusTriggerAfterClose } = this;
if (this.visible) { if (this.visible) {
// first show // first show
if (!visible) { if (!visible) {
@ -375,7 +374,7 @@ export default {
cacheOverflow = { cacheOverflow = {
overflowX: document.body.style.overflowX, overflowX: document.body.style.overflowX,
overflowY: document.body.style.overflowY, overflowY: document.body.style.overflowY,
overflow: document.body.style.overflow, overflow: document.body.style.overflow,
}; };
switchScrollingEffect(); switchScrollingEffect();
// Must be set after switchScrollingEffect // Must be set after switchScrollingEffect
@ -383,7 +382,7 @@ export default {
} else if (!openCount) { } else if (!openCount) {
// IE browser doesn't merge overflow style, need to set it separately // IE browser doesn't merge overflow style, need to set it separately
// https://github.com/ant-design/ant-design/issues/19393 // https://github.com/ant-design/ant-design/issues/19393
if (cacheOverflow.overflow !== undefined) { if (cacheOverflow.overflow !== undefined) {
document.body.style.overflow = cacheOverflow.overflow; document.body.style.overflow = cacheOverflow.overflow;
} }
if (cacheOverflow.overflowX !== undefined) { if (cacheOverflow.overflowX !== undefined) {

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import { createForm } from '../index'; import { createForm } from '../index';
import { regionStyle, errorStyle } from './styles'; import { regionStyle, errorStyle } from './styles';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import { createForm } from '../index'; import { createForm } from '../index';
import BaseMixin from '../../_util/BaseMixin'; import BaseMixin from '../../_util/BaseMixin';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import { createForm } from '../index'; import { createForm } from '../index';
import { regionStyle, errorStyle } from './styles'; import { regionStyle, errorStyle } from './styles';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import { createForm } from '../index'; import { createForm } from '../index';
import { regionStyle, errorStyle } from './styles'; import { regionStyle, errorStyle } from './styles';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import { createForm } from '../index'; import { createForm } from '../index';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import BaseMixin from '../../_util/BaseMixin'; import BaseMixin from '../../_util/BaseMixin';
import createDOMForm from '../src/createDOMForm'; import createDOMForm from '../src/createDOMForm';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import createForm from '../src/createDOMForm'; import createForm from '../src/createDOMForm';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import { createForm } from '../index'; import { createForm } from '../index';
import { regionStyle, errorStyle } from './styles'; import { regionStyle, errorStyle } from './styles';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import createDOMForm from '../src/createDOMForm'; import createDOMForm from '../src/createDOMForm';
import { DatePicker, Select } from 'ant-design-vue'; import { DatePicker, Select } from 'ant-design-vue';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import { createForm } from '../index'; import { createForm } from '../index';
import { regionStyle } from './styles'; import { regionStyle } from './styles';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import { createForm } from '../index'; import { createForm } from '../index';
import { Select } from 'ant-design-vue'; import { Select } from 'ant-design-vue';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import { createForm } from '../index'; import { createForm } from '../index';
import { regionStyle, errorStyle } from './styles'; import { regionStyle, errorStyle } from './styles';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import { createForm } from '../index'; import { createForm } from '../index';
import { regionStyle, errorStyle } from './styles'; import { regionStyle, errorStyle } from './styles';

View File

@ -622,7 +622,13 @@ const Select = {
if (value.length) { if (value.length) {
hidden = true; hidden = true;
} }
if (!state._mirrorInputValue && isCombobox(props) && value.length === 1 && (state._value && !state._value[0])) { if (
!state._mirrorInputValue &&
isCombobox(props) &&
value.length === 1 &&
state._value &&
!state._value[0]
) {
hidden = false; hidden = false;
} }
const placeholder = props.placeholder; const placeholder = props.placeholder;

View File

@ -40,8 +40,8 @@ export default {
[`${prefixCls}-icon`]: true, [`${prefixCls}-icon`]: true,
[`${iconPrefix}icon`]: true, [`${iconPrefix}icon`]: true,
[`${iconPrefix}icon-${icon}`]: icon && isString(icon), [`${iconPrefix}icon-${icon}`]: icon && isString(icon),
[`${iconPrefix}icon-check`]: !icon && status === 'finish' && (icons && !icons.finish), [`${iconPrefix}icon-check`]: !icon && status === 'finish' && icons && !icons.finish,
[`${iconPrefix}icon-close`]: !icon && status === 'error' && (icons && !icons.error), [`${iconPrefix}icon-close`]: !icon && status === 'error' && icons && !icons.error,
}; };
const iconDot = <span class={`${prefixCls}-icon-dot`} />; const iconDot = <span class={`${prefixCls}-icon-dot`} />;
// `progressDot` enjoy the highest priority // `progressDot` enjoy the highest priority

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';
import BaseMixin from '../../_util/BaseMixin'; import BaseMixin from '../../_util/BaseMixin';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';
import Menu from '../../menu'; import Menu from '../../menu';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';
import '../assets/bordered.less'; import '../assets/bordered.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint-disable no-console,func-names,react/no-multi-comp */ /* eslint-disable no-console,func-names */
import Table from '../index'; import Table from '../index';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -20,7 +20,10 @@ const TableHeaderRow = {
const { row, index, height, components, customHeaderRow, prefixCls } = this; const { row, index, height, components, customHeaderRow, prefixCls } = this;
const HeaderRow = components.header.row; const HeaderRow = components.header.row;
const HeaderCell = components.header.cell; const HeaderCell = components.header.cell;
const rowProps = customHeaderRow(row.map(cell => cell.column), index); const rowProps = customHeaderRow(
row.map(cell => cell.column),
index,
);
const customStyle = rowProps ? rowProps.style : {}; const customStyle = rowProps ? rowProps.style : {};
const style = { height, ...customStyle }; const style = { height, ...customStyle };
if (style.height === null) { if (style.height === null) {

View File

@ -72,7 +72,6 @@ export default {
return; return;
} }
// wait next, prev show hide // wait next, prev show hide
/* eslint react/no-did-update-set-state:0 */
if (this.isNextPrevShown(this.$data) !== this.isNextPrevShown(this.setNextPrev())) { if (this.isNextPrevShown(this.$data) !== this.isNextPrevShown(this.setNextPrev())) {
this.$forceUpdate(); this.$forceUpdate();
this.$nextTick(() => { this.$nextTick(() => {

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0, no-alert: 0 */ /* eslint no-console:0, no-alert: 0 */
import BaseMixin from '../../_util/BaseMixin'; import BaseMixin from '../../_util/BaseMixin';
import '../assets/index.less'; import '../assets/index.less';
import '../../vc-dialog/assets/index.less'; import '../../vc-dialog/assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import '../assets/index.less'; import '../assets/index.less';
import './demo.less'; import './demo.less';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0, no-alert: 0 */ /* eslint no-console:0, no-alert: 0 */
import BaseMixin from '../../_util/BaseMixin'; import BaseMixin from '../../_util/BaseMixin';
import '../assets/index.less'; import '../assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0, no-alert: 0 */ /* eslint no-console:0, no-alert: 0 */
import '../assets/index.less'; import '../assets/index.less';
import '../../vc-dialog/assets/index.less'; import '../../vc-dialog/assets/index.less';

View File

@ -1,4 +1,4 @@
/* eslint react/no-multi-comp:0, no-console:0 */ /* eslint no-console:0 */
import BaseMixin from '../../_util/BaseMixin'; import BaseMixin from '../../_util/BaseMixin';
import '../assets/index.less'; import '../assets/index.less';
import TreeSelect from '../src/index'; import TreeSelect from '../src/index';

View File

@ -1,5 +1,3 @@
/* eslint react/no-multi-comp:0, no-console:0 */
import BaseMixin from '../../_util/BaseMixin'; import BaseMixin from '../../_util/BaseMixin';
import '../assets/index.less'; import '../assets/index.less';
import TreeSelect from '../src/index'; import TreeSelect from '../src/index';

View File

@ -1,5 +1,3 @@
/* eslint react/no-multi-comp:0, no-console:0 */
import '../assets/index.less'; import '../assets/index.less';
import TreeSelect, { SHOW_PARENT } from '../index'; import TreeSelect, { SHOW_PARENT } from '../index';
import { gData } from './util'; import { gData } from './util';

View File

@ -123,7 +123,7 @@ const BasePopup = {
_keyList: [], _keyList: [],
_expandedKeyList: expandedKeyList, _expandedKeyList: expandedKeyList,
// Cache `expandedKeyList` when tree is in filter. This is used in `getDerivedStateFromProps` // Cache `expandedKeyList` when tree is in filter. This is used in `getDerivedStateFromProps`
_cachedExpandedKeyList: [], // eslint-disable-line react/no-unused-state _cachedExpandedKeyList: [],
_loadedKeys: [], _loadedKeys: [],
_prevProps: {}, _prevProps: {},
}; };

View File

@ -58,7 +58,6 @@ export default {
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
if (this.supportServerRender) { if (this.supportServerRender) {
/* eslint react/no-did-mount-set-state:0 */
this.setState( this.setState(
{ {
Component: this.getComponent(), Component: this.getComponent(),

View File

@ -21,8 +21,8 @@ There are some major variables below, all less variables could be found in [Defa
@font-size-base: 14px; // major text font size @font-size-base: 14px; // major text font size
@heading-color: rgba(0, 0, 0, 0.85); // heading text color @heading-color: rgba(0, 0, 0, 0.85); // heading text color
@text-color: rgba(0, 0, 0, 0.65); // major text color @text-color: rgba(0, 0, 0, 0.65); // major text color
@text-color-secondary : rgba(0, 0, 0, .45); // secondary text color @text-color-secondary: rgba(0, 0, 0, 0.45); // secondary text color
@disabled-color : rgba(0, 0, 0, .25); // disable state color @disabled-color: rgba(0, 0, 0, 0.25); // disable state color
@border-radius-base: 4px; // major border radius @border-radius-base: 4px; // major border radius
@border-color-base: #d9d9d9; // major border color @border-color-base: #d9d9d9; // major border color
@box-shadow-base: 0 2px 8px rgba(0, 0, 0, 0.15); // major shadow for layers @box-shadow-base: 0 2px 8px rgba(0, 0, 0, 0.15); // major shadow for layers

View File

@ -21,8 +21,8 @@ antd 的样式使用了 [Less](http://lesscss.org/) 作为开发语言,并定
@font-size-base: 14px; // 主字号 @font-size-base: 14px; // 主字号
@heading-color: rgba(0, 0, 0, 0.85); // 标题色 @heading-color: rgba(0, 0, 0, 0.85); // 标题色
@text-color: rgba(0, 0, 0, 0.65); // 主文本色 @text-color: rgba(0, 0, 0, 0.65); // 主文本色
@text-color-secondary : rgba(0, 0, 0, .45); // 次文本色 @text-color-secondary: rgba(0, 0, 0, 0.45); // 次文本色
@disabled-color : rgba(0, 0, 0, .25); // 失效色 @disabled-color: rgba(0, 0, 0, 0.25); // 失效色
@border-radius-base: 4px; // 组件/浮层圆角 @border-radius-base: 4px; // 组件/浮层圆角
@border-color-base: #d9d9d9; // 边框色 @border-color-base: #d9d9d9; // 边框色
@box-shadow-base: 0 2px 8px rgba(0, 0, 0, 0.15); // 浮层阴影 @box-shadow-base: 0 2px 8px rgba(0, 0, 0, 0.15); // 浮层阴影

1
types/empty.d.ts vendored
View File

@ -18,5 +18,4 @@ export declare class Empty extends AntdComponent {
* @type string | VNode * @type string | VNode
*/ */
image: string | VNode; image: string | VNode;
} }

View File

@ -16,7 +16,7 @@ export declare class Tree extends AntdComponent {
*/ */
treeData: TreeNode[]; treeData: TreeNode[];
/** /**
* *
*@description Replace the title,key and children fields in treeNode with the corresponding fields in treeData *@description Replace the title,key and children fields in treeNode with the corresponding fields in treeData
*/ */