Change Transfer moving buttons order for convention

close #11269
This commit is contained in:
afc163 2018-07-20 18:08:42 +08:00
parent 76741d026f
commit cc00ebe5e1
6 changed files with 108 additions and 108 deletions

View File

@ -386,7 +386,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -395,7 +395,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>

View File

@ -5761,7 +5761,7 @@ exports[`Locale Provider should display the text as ar 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -5770,7 +5770,7 @@ exports[`Locale Provider should display the text as ar 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -10358,7 +10358,7 @@ exports[`Locale Provider should display the text as bg 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -10367,7 +10367,7 @@ exports[`Locale Provider should display the text as bg 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -14955,7 +14955,7 @@ exports[`Locale Provider should display the text as ca 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -14964,7 +14964,7 @@ exports[`Locale Provider should display the text as ca 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -19552,7 +19552,7 @@ exports[`Locale Provider should display the text as cs 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -19561,7 +19561,7 @@ exports[`Locale Provider should display the text as cs 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -24149,7 +24149,7 @@ exports[`Locale Provider should display the text as de 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -24158,7 +24158,7 @@ exports[`Locale Provider should display the text as de 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -28746,7 +28746,7 @@ exports[`Locale Provider should display the text as el 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -28755,7 +28755,7 @@ exports[`Locale Provider should display the text as el 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -33343,7 +33343,7 @@ exports[`Locale Provider should display the text as en 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -33352,7 +33352,7 @@ exports[`Locale Provider should display the text as en 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -37940,7 +37940,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -37949,7 +37949,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -42537,7 +42537,7 @@ exports[`Locale Provider should display the text as es 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -42546,7 +42546,7 @@ exports[`Locale Provider should display the text as es 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -47134,7 +47134,7 @@ exports[`Locale Provider should display the text as et 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -47143,7 +47143,7 @@ exports[`Locale Provider should display the text as et 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -51731,7 +51731,7 @@ exports[`Locale Provider should display the text as fa 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -51740,7 +51740,7 @@ exports[`Locale Provider should display the text as fa 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -56328,7 +56328,7 @@ exports[`Locale Provider should display the text as fi 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -56337,7 +56337,7 @@ exports[`Locale Provider should display the text as fi 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -60925,7 +60925,7 @@ exports[`Locale Provider should display the text as fr 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -60934,7 +60934,7 @@ exports[`Locale Provider should display the text as fr 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -65522,7 +65522,7 @@ exports[`Locale Provider should display the text as fr 2`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -65531,7 +65531,7 @@ exports[`Locale Provider should display the text as fr 2`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -70119,7 +70119,7 @@ exports[`Locale Provider should display the text as is 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -70128,7 +70128,7 @@ exports[`Locale Provider should display the text as is 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -74716,7 +74716,7 @@ exports[`Locale Provider should display the text as it 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -74725,7 +74725,7 @@ exports[`Locale Provider should display the text as it 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -79313,7 +79313,7 @@ exports[`Locale Provider should display the text as ja 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -79322,7 +79322,7 @@ exports[`Locale Provider should display the text as ja 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -83910,7 +83910,7 @@ exports[`Locale Provider should display the text as ko 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -83919,7 +83919,7 @@ exports[`Locale Provider should display the text as ko 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -88507,7 +88507,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -88516,7 +88516,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -93104,7 +93104,7 @@ exports[`Locale Provider should display the text as nb 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -93113,7 +93113,7 @@ exports[`Locale Provider should display the text as nb 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -97701,7 +97701,7 @@ exports[`Locale Provider should display the text as nl 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -97710,7 +97710,7 @@ exports[`Locale Provider should display the text as nl 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -102298,7 +102298,7 @@ exports[`Locale Provider should display the text as nl-be 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -102307,7 +102307,7 @@ exports[`Locale Provider should display the text as nl-be 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -106895,7 +106895,7 @@ exports[`Locale Provider should display the text as pl 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -106904,7 +106904,7 @@ exports[`Locale Provider should display the text as pl 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -111492,7 +111492,7 @@ exports[`Locale Provider should display the text as pt 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -111501,7 +111501,7 @@ exports[`Locale Provider should display the text as pt 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -116089,7 +116089,7 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -116098,7 +116098,7 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -120686,7 +120686,7 @@ exports[`Locale Provider should display the text as ru 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -120695,7 +120695,7 @@ exports[`Locale Provider should display the text as ru 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -125283,7 +125283,7 @@ exports[`Locale Provider should display the text as sk 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -125292,7 +125292,7 @@ exports[`Locale Provider should display the text as sk 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -129880,7 +129880,7 @@ exports[`Locale Provider should display the text as sl 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -129889,7 +129889,7 @@ exports[`Locale Provider should display the text as sl 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -134477,7 +134477,7 @@ exports[`Locale Provider should display the text as sr 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -134486,7 +134486,7 @@ exports[`Locale Provider should display the text as sr 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -139074,7 +139074,7 @@ exports[`Locale Provider should display the text as sv 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -139083,7 +139083,7 @@ exports[`Locale Provider should display the text as sv 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -143671,7 +143671,7 @@ exports[`Locale Provider should display the text as th 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -143680,7 +143680,7 @@ exports[`Locale Provider should display the text as th 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -148268,7 +148268,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -148277,7 +148277,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -152865,7 +152865,7 @@ exports[`Locale Provider should display the text as uk 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -152874,7 +152874,7 @@ exports[`Locale Provider should display the text as uk 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -157462,7 +157462,7 @@ exports[`Locale Provider should display the text as vi 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -157471,7 +157471,7 @@ exports[`Locale Provider should display the text as vi 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -162059,7 +162059,7 @@ exports[`Locale Provider should display the text as zh-cn 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -162068,7 +162068,7 @@ exports[`Locale Provider should display the text as zh-cn 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -166656,7 +166656,7 @@ exports[`Locale Provider should display the text as zh-tw 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -166665,7 +166665,7 @@ exports[`Locale Provider should display the text as zh-tw 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>

View File

@ -91,10 +91,10 @@ exports[`renders ./components/transfer/demo/advanced.md correctly 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
<span>
to left
to right
</span>
</button>
<button
@ -103,10 +103,10 @@ exports[`renders ./components/transfer/demo/advanced.md correctly 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
<span>
to right
to left
</span>
</button>
</div>
@ -308,7 +308,7 @@ exports[`renders ./components/transfer/demo/basic.md correctly 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -317,7 +317,7 @@ exports[`renders ./components/transfer/demo/basic.md correctly 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -455,7 +455,7 @@ exports[`renders ./components/transfer/demo/custom-item.md correctly 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -464,7 +464,7 @@ exports[`renders ./components/transfer/demo/custom-item.md correctly 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -575,7 +575,7 @@ exports[`renders ./components/transfer/demo/large-data.md correctly 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -584,7 +584,7 @@ exports[`renders ./components/transfer/demo/large-data.md correctly 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>
@ -713,7 +713,7 @@ exports[`renders ./components/transfer/demo/search.md correctly 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -722,7 +722,7 @@ exports[`renders ./components/transfer/demo/search.md correctly 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>

View File

@ -96,6 +96,14 @@ exports[`Transfer should render correctly 1`] = `
<div
class="ant-transfer-operation"
>
<button
class="ant-btn ant-btn-primary ant-btn-sm ant-btn-icon-only"
type="button"
>
<i
class="anticon anticon-right"
/>
</button>
<button
class="ant-btn ant-btn-primary ant-btn-sm ant-btn-icon-only"
disabled=""
@ -105,14 +113,6 @@ exports[`Transfer should render correctly 1`] = `
class="anticon anticon-left"
/>
</button>
<button
class="ant-btn ant-btn-primary ant-btn-sm ant-btn-icon-only"
type="button"
>
<i
class="anticon anticon-right"
/>
</button>
</div>
<div
class="ant-transfer-list"
@ -265,7 +265,7 @@ exports[`Transfer should show sorted targetkey 1`] = `
type="button"
>
<i
class="anticon anticon-left"
class="anticon anticon-right"
/>
</button>
<button
@ -274,7 +274,7 @@ exports[`Transfer should show sorted targetkey 1`] = `
type="button"
>
<i
class="anticon anticon-right"
class="anticon anticon-left"
/>
</button>
</div>

View File

@ -93,14 +93,14 @@ describe('Transfer', () => {
it('should move selected keys to corresponding list', () => {
const handleChange = jest.fn();
const wrapper = mount(<Transfer {...listCommonProps} onChange={handleChange} />);
wrapper.find(TransferOperation).find(Button).at(1).simulate('click'); // move selected keys to right list
wrapper.find(TransferOperation).find(Button).at(0).simulate('click'); // move selected keys to right list
expect(handleChange).toHaveBeenCalledWith(['a', 'b'], 'right', ['a']);
});
it('should move selected keys expect disabled to corresponding list', () => {
const handleChange = jest.fn();
const wrapper = mount(<Transfer {...listDisabledProps} onChange={handleChange} />);
wrapper.find(TransferOperation).find(Button).at(1).simulate('click'); // move selected keys to right list
wrapper.find(TransferOperation).find(Button).at(0).simulate('click'); // move selected keys to right list
expect(handleChange).toHaveBeenCalledWith(['b'], 'right', ['b']);
});
@ -209,7 +209,7 @@ describe('Transfer', () => {
.simulate('change', { target: { value: 'content2' } });
wrapper.find(TransferList).at(0).find('.ant-transfer-list-header input[type="checkbox"]').filterWhere(n => !n.prop('checked'))
.simulate('change');
wrapper.find(TransferOperation).find(Button).at(1).simulate('click');
wrapper.find(TransferOperation).find(Button).at(0).simulate('click');
expect(handleChange).toHaveBeenCalledWith(['1', '3', '4'], 'right', ['1']);
});

View File

@ -26,15 +26,6 @@ export default class Operation extends React.Component<TransferOperationProps, a
} = this.props;
return (
<div className={className} style={style}>
<Button
type="primary"
size="small"
disabled={!leftActive}
onClick={moveToLeft}
icon="left"
>
{leftArrowText}
</Button>
<Button
type="primary"
size="small"
@ -44,6 +35,15 @@ export default class Operation extends React.Component<TransferOperationProps, a
>
{rightArrowText}
</Button>
<Button
type="primary"
size="small"
disabled={!leftActive}
onClick={moveToLeft}
icon="left"
>
{leftArrowText}
</Button>
</div>
);
}