style: prettier code

pull/3067/head
tanjinzhou 4 years ago
parent 789647c604
commit d96a10dce8

@ -33,7 +33,10 @@
"@typescript-eslint/explicit-module-boundary-types": 0, "@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-empty-function": 0, "@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-non-null-assertion": 0, "@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": true }] "@typescript-eslint/no-unused-vars": [
"error",
{ "vars": "all", "args": "after-used", "ignoreRestSiblings": true }
]
} }
} }
], ],

@ -1 +1 @@
Subproject commit 4f6ebd03190812369678c4dd383fdb4e98d6f6c1 Subproject commit 68644e7953c739fe64bfbe458f158fcd1d924872

@ -37,16 +37,12 @@ describe('Select', () => {
attachTo: 'body', attachTo: 'body',
}); });
await asyncExpect(() => { await asyncExpect(() => {
wrapper wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
.findAll('.ant-select-selector')[0]
.element.dispatchEvent(new MouseEvent('mousedown'));
}); });
await asyncExpect(() => { await asyncExpect(() => {
expect($$('.ant-select-item-option').length).toBe(0); expect($$('.ant-select-item-option').length).toBe(0);
expect($$('.ant-empty-description')[0].innerHTML).toBe( expect($$('.ant-empty-description')[0].innerHTML).toBe('No Data');
'No Data',
);
}, 100); }, 100);
}); });
@ -60,9 +56,7 @@ describe('Select', () => {
attachTo: 'body', attachTo: 'body',
}); });
await asyncExpect(() => { await asyncExpect(() => {
wrapper wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
.findAll('.ant-select-selector')[0]
.element.dispatchEvent(new MouseEvent('mousedown'));
}); });
await asyncExpect(() => { await asyncExpect(() => {
@ -79,9 +73,7 @@ describe('Select', () => {
attachTo: 'body', attachTo: 'body',
}); });
await asyncExpect(() => { await asyncExpect(() => {
wrapper wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
.findAll('.ant-select-selector')[0]
.element.dispatchEvent(new MouseEvent('mousedown'));
}); });
await asyncExpect(() => { await asyncExpect(() => {
@ -98,9 +90,7 @@ describe('Select', () => {
sync: false, sync: false,
}); });
await asyncExpect(() => { await asyncExpect(() => {
wrapper wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
.findAll('.ant-select-selector')[0]
.element.dispatchEvent(new MouseEvent('mousedown'));
}); });
await asyncExpect(() => { await asyncExpect(() => {
@ -135,11 +125,9 @@ describe('Select', () => {
expect(getStyle($$('.ant-select-dropdown')[0], 'display')).toBe('block'); expect(getStyle($$('.ant-select-dropdown')[0], 'display')).toBe('block');
}, 100); }, 100);
await asyncExpect(() => { await asyncExpect(() => {
wrapper wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
.findAll('.ant-select-selector')[0]
.element.dispatchEvent(new MouseEvent('mousedown'));
}); });
await asyncExpect(()=>{ await asyncExpect(() => {
expect(onDropdownVisibleChange).toHaveBeenLastCalledWith(false); expect(onDropdownVisibleChange).toHaveBeenLastCalledWith(false);
}); });
await asyncExpect(() => { await asyncExpect(() => {
@ -149,9 +137,7 @@ describe('Select', () => {
await asyncExpect(() => { await asyncExpect(() => {
expect(getStyle($$('.ant-select-dropdown')[0], 'display')).toBe('none'); expect(getStyle($$('.ant-select-dropdown')[0], 'display')).toBe('none');
wrapper wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
.findAll('.ant-select-selector')[0]
.element.dispatchEvent(new MouseEvent('mousedown'));
expect(onDropdownVisibleChange).toHaveBeenLastCalledWith(true); expect(onDropdownVisibleChange).toHaveBeenLastCalledWith(true);
expect(getStyle($$('.ant-select-dropdown')[0], 'display')).toBe('none'); expect(getStyle($$('.ant-select-dropdown')[0], 'display')).toBe('none');
}, 500); }, 500);

@ -104,7 +104,14 @@ export default function() {
} }
const clearIcon = getComponent(this, 'clearIcon'); const clearIcon = getComponent(this, 'clearIcon');
return ( return (
<span key="clear" unselectable="on" aria-hidden="true" style="user-select: none;" class={`${prefixCls}-clear`} onClick={onSelectorClear}> <span
key="clear"
unselectable="on"
aria-hidden="true"
style="user-select: none;"
class={`${prefixCls}-clear`}
onClick={onSelectorClear}
>
{clearIcon} {clearIcon}
</span> </span>
); );
@ -117,7 +124,11 @@ export default function() {
} }
const inputIcon = getComponent(this, 'inputIcon'); const inputIcon = getComponent(this, 'inputIcon');
return ( return (
<span key="arrow" class={`${prefixCls}-arrow`} style={{ outline: 'none', userSelect: 'none' }}> <span
key="arrow"
class={`${prefixCls}-arrow`}
style={{ outline: 'none', userSelect: 'none' }}
>
{inputIcon} {inputIcon}
</span> </span>
); );

@ -81,11 +81,7 @@ const MultipleSelector = {
this.__emit('choiceAnimationLeave', ...args); this.__emit('choiceAnimationLeave', ...args);
}, },
renderSelection() { renderSelection() {
const { const { selectorValueList, labelInValue, maxTagCount } = this.$props;
selectorValueList,
labelInValue,
maxTagCount,
} = this.$props;
const children = getSlot(this); const children = getSlot(this);
const { const {
vcTreeSelect: { onMultipleSelectorRemove }, vcTreeSelect: { onMultipleSelectorRemove },
@ -140,14 +136,9 @@ const MultipleSelector = {
} }
selectedValueNodes.push( selectedValueNodes.push(
<SearchInput <SearchInput key="SearchInput" {...this.$props} {...this.$attrs} ref={this.inputRef}>
key="SearchInput" {children}
{...this.$props} </SearchInput>,
{...this.$attrs}
ref={this.inputRef}
>
{children}
</SearchInput>,
); );
return selectedValueNodes; return selectedValueNodes;

Loading…
Cancel
Save