test: update spin slider transfer demo and test
parent
7aa46bbdf8
commit
dae7de95db
|
@ -74,7 +74,7 @@ const Slider = {
|
|||
},
|
||||
}))
|
||||
},
|
||||
handleWithTooltip (h, { value, dragging, index, ref, ...restProps }) {
|
||||
handleWithTooltip ({ value, dragging, index, ref, ...restProps }) {
|
||||
const { tooltipPrefixCls, tipFormatter } = this.$props
|
||||
const { visibles } = this
|
||||
const visible = tipFormatter ? (visibles[index] || dragging) : false
|
||||
|
|
|
@ -11,7 +11,9 @@ exports[`renders ./components/spin/demo/custom-indicator.md correctly 1`] = `
|
|||
<div class="ant-spin ant-spin-spinning"><i class="anticon anticon-loading ant-spin-dot"><svg viewBox="0 0 1024 1024" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="anticon-spin">
|
||||
<path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path>
|
||||
</svg></i></div>
|
||||
<div class="ant-spin ant-spin-spinning"><i class="anticon anticon-loading anticon-spin ant-spin-dot" style="font-size: 24px;"></i></div>
|
||||
<div class="ant-spin ant-spin-spinning"><i class="anticon anticon-loading ant-spin-dot"><svg viewBox="0 0 1024 1024" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="anticon-spin">
|
||||
<path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path>
|
||||
</svg></i></div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ describe('Spin', () => {
|
|||
delay: 500,
|
||||
spinning: true,
|
||||
},
|
||||
async: false,
|
||||
sync: false,
|
||||
}
|
||||
const wrapper = mount(Spin, props)
|
||||
await asyncExpect(() => {
|
||||
|
@ -50,13 +50,15 @@ describe('Spin', () => {
|
|||
propsData: {
|
||||
spinning: false,
|
||||
},
|
||||
async: false,
|
||||
sync: false,
|
||||
}
|
||||
const wrapper = mount(Spin, props)
|
||||
await asyncExpect(() => {
|
||||
expect(wrapper.vm.stateSpinning).toBe(false)
|
||||
expect(wrapper.vm.sSpinning).toBe(false)
|
||||
wrapper.setProps({ spinning: true })
|
||||
expect(wrapper.vm.stateSpinning).toBe(true)
|
||||
})
|
||||
await asyncExpect(() => {
|
||||
expect(wrapper.vm.sSpinning).toBe(true)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -58,48 +58,50 @@ exports[`renders ./components/transfer/demo/advanced.md correctly 1`] = `
|
|||
`;
|
||||
|
||||
exports[`renders ./components/transfer/demo/basic.md correctly 1`] = `
|
||||
<div class="ant-transfer">
|
||||
<div class="ant-transfer-list">
|
||||
<div class="ant-transfer-list-header"><label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-indeterminate"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label><span class="ant-transfer-list-header-selected"><span>2/14 items</span><span class="ant-transfer-list-header-title">Source</span></span></div>
|
||||
<div class="ant-transfer-list-body">
|
||||
<ul class="ant-transfer-list-content">
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
</ul>
|
||||
<div class="ant-transfer-list-body-not-found">Not Found</div>
|
||||
<div>
|
||||
<div class="ant-transfer">
|
||||
<div class="ant-transfer-list">
|
||||
<div class="ant-transfer-list-header"><label class="ant-checkbox-wrapper"><span class="ant-checkbox ant-checkbox-indeterminate"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label><span class="ant-transfer-list-header-selected"><span>2/14 items</span><span class="ant-transfer-list-header-title">Source</span></span></div>
|
||||
<div class="ant-transfer-list-body">
|
||||
<ul class="ant-transfer-list-content">
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
</ul>
|
||||
<div class="ant-transfer-list-body-not-found">Not Found</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ant-transfer-operation"><button type="button" class="ant-btn ant-btn-primary ant-btn-sm"><i class="anticon anticon-right"><svg viewBox="64 64 896 896" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
|
||||
<path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"></path>
|
||||
</svg></i></button><button type="button" disabled="disabled" class="ant-btn ant-btn-primary ant-btn-sm"><i class="anticon anticon-left"><svg viewBox="64 64 896 896" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
|
||||
<path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path>
|
||||
</svg></i></button></div>
|
||||
<div class="ant-transfer-list">
|
||||
<div class="ant-transfer-list-header"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label><span class="ant-transfer-list-header-selected"><span>6 items</span><span class="ant-transfer-list-header-title">Target</span></span></div>
|
||||
<div class="ant-transfer-list-body">
|
||||
<ul class="ant-transfer-list-content">
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
</ul>
|
||||
<div class="ant-transfer-list-body-not-found">Not Found</div>
|
||||
<div class="ant-transfer-operation"><button type="button" class="ant-btn ant-btn-primary ant-btn-sm"><i class="anticon anticon-right"><svg viewBox="64 64 896 896" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
|
||||
<path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"></path>
|
||||
</svg></i></button><button type="button" disabled="disabled" class="ant-btn ant-btn-primary ant-btn-sm"><i class="anticon anticon-left"><svg viewBox="64 64 896 896" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
|
||||
<path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path>
|
||||
</svg></i></button></div>
|
||||
<div class="ant-transfer-list">
|
||||
<div class="ant-transfer-list-header"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input" value=""><span class="ant-checkbox-inner"></span></span></label><span class="ant-transfer-list-header-selected"><span>6 items</span><span class="ant-transfer-list-header-title">Target</span></span></div>
|
||||
<div class="ant-transfer-list-body">
|
||||
<ul class="ant-transfer-list-content">
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
<div class="LazyLoad" style="height: 32px;"></div>
|
||||
</ul>
|
||||
<div class="ant-transfer-list-body-not-found">Not Found</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <button type="button" role="switch" class="ant-switch"><span class="ant-switch-inner">disabled</span></button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
exports[`Search should show cross icon when input value exists 1`] = `<div><input value="" placeholder="" type="text" class="ant-input"><span class="undefined-action"><i class="anticon anticon-search"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></i></span></div>`;
|
||||
|
||||
exports[`Search should show cross icon when input value exists 2`] = `
|
||||
<div><input value="a" placeholder="" type="text" class="ant-input"><a href="#" class="undefined-action"><i class="anticon anticon-cross-circle">
|
||||
<!----></i></a></div>
|
||||
<div><input value="a" placeholder="" type="text" class="ant-input"><a href="#" class="undefined-action"><i class="anticon anticon-close-circle"><svg viewBox="64 64 896 896" data-icon="close-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" class="">
|
||||
<path d="M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 0 0-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z"></path>
|
||||
<path d="M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path>
|
||||
</svg></i></a></div>
|
||||
`;
|
||||
|
|
|
@ -10,19 +10,20 @@ The most basic usage of `Transfer` involves providing the source data and target
|
|||
|
||||
```html
|
||||
<template>
|
||||
<a-transfer
|
||||
:dataSource="mockData"
|
||||
:titles="['Source', 'Target']"
|
||||
:targetKeys="targetKeys"
|
||||
:selectedKeys="selectedKeys"
|
||||
@change="handleChange"
|
||||
@selectChange="handleSelectChange"
|
||||
@scroll="handleScroll"
|
||||
:render="item=>item.title"
|
||||
:disabled="disabled"
|
||||
>
|
||||
</a-transfer>
|
||||
<a-switch unCheckedChildren="disabled" checkedChildren="disabled" :checked="disabled" @change="handleDisable" />
|
||||
<div>
|
||||
<a-transfer
|
||||
:dataSource="mockData"
|
||||
:titles="['Source', 'Target']"
|
||||
:targetKeys="targetKeys"
|
||||
:selectedKeys="selectedKeys"
|
||||
@change="handleChange"
|
||||
@selectChange="handleSelectChange"
|
||||
@scroll="handleScroll"
|
||||
:render="item=>item.title"
|
||||
:disabled="disabled"
|
||||
/>
|
||||
<a-switch unCheckedChildren="disabled" checkedChildren="disabled" :checked="disabled" @change="handleDisable" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
|
|
Loading…
Reference in New Issue