ant-design/components/transfer/index.tsx

474 lines
15 KiB
TypeScript
Raw Normal View History

import * as React from 'react';
import classNames from 'classnames';
import List, { TransferListProps } from './list';
2015-12-25 17:53:35 +08:00
import Operation from './operation';
import Search from './search';
import LocaleReceiver from '../locale-provider/LocaleReceiver';
import defaultLocale from '../locale/default';
2018-12-26 16:01:00 +08:00
import { ConfigConsumer, ConfigConsumerProps, RenderEmptyHandler } from '../config-provider';
import { TransferListBodyProps } from './ListBody';
import { PaginationType } from './interface';
2020-05-14 16:36:05 +08:00
import devWarning from '../_util/devWarning';
export { TransferListProps } from './list';
export { TransferOperationProps } from './operation';
2017-12-14 10:49:44 +08:00
export { TransferSearchProps } from './search';
2017-11-20 17:41:32 +08:00
export type TransferDirection = 'left' | 'right';
export interface RenderResultObject {
label: React.ReactElement;
value: string;
}
export type RenderResult = React.ReactElement | RenderResultObject | string | null;
export interface TransferItem {
key?: string;
title?: string;
2016-07-13 11:14:24 +08:00
description?: string;
disabled?: boolean;
[name: string]: any;
}
export type KeyWise<T> = T & { key: string };
export type KeyWiseTransferItem = KeyWise<TransferItem>;
type TransferRender<RecordType> = (item: RecordType) => RenderResult;
export interface ListStyle {
direction: TransferDirection;
}
export type SelectAllLabel =
| React.ReactNode
| ((info: { selectedCount: number; totalCount: number }) => React.ReactNode);
export interface TransferLocale {
titles: React.ReactNode[];
notFoundContent?: React.ReactNode;
searchPlaceholder: string;
itemUnit: string;
itemsUnit: string;
remove: string;
selectAll: string;
selectCurrent: string;
selectInvert: string;
removeAll: string;
removeCurrent: string;
}
export interface TransferProps<RecordType> {
2016-12-07 18:08:52 +08:00
prefixCls?: string;
className?: string;
2018-09-15 15:18:59 +08:00
disabled?: boolean;
dataSource: RecordType[];
targetKeys?: string[];
selectedKeys?: string[];
render?: TransferRender<RecordType>;
onChange?: (targetKeys: string[], direction: TransferDirection, moveKeys: string[]) => void;
onSelectChange?: (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => void;
2016-12-07 18:08:52 +08:00
style?: React.CSSProperties;
2019-11-05 13:26:39 +08:00
listStyle: ((style: ListStyle) => React.CSSProperties) | React.CSSProperties;
operationStyle?: React.CSSProperties;
titles?: React.ReactNode[];
operations?: string[];
2016-07-13 11:14:24 +08:00
showSearch?: boolean;
filterOption?: (inputValue: string, item: RecordType) => boolean;
locale?: Partial<TransferLocale>;
footer?: (props: TransferListProps<RecordType>) => React.ReactNode;
rowKey?: (record: RecordType) => string;
onSearch?: (direction: TransferDirection, value: string) => void;
onScroll?: (direction: TransferDirection, e: React.SyntheticEvent<HTMLUListElement>) => void;
children?: (props: TransferListBodyProps<RecordType>) => React.ReactNode;
showSelectAll?: boolean;
selectAllLabels?: SelectAllLabel[];
oneWay?: boolean;
pagination?: PaginationType;
2017-11-20 17:41:32 +08:00
}
interface TransferState {
sourceSelectedKeys: string[];
targetSelectedKeys: string[];
}
class Transfer<RecordType extends TransferItem = TransferItem> extends React.Component<
TransferProps<RecordType>,
TransferState
> {
// For high-level customized Transfer @dqaria
static List = List;
2019-08-05 18:38:10 +08:00
static Operation = Operation;
2019-08-05 18:38:10 +08:00
static Search = Search;
static defaultProps = {
dataSource: [],
locale: {},
showSearch: false,
listStyle: () => {},
};
static getDerivedStateFromProps<T>({
selectedKeys,
targetKeys,
pagination,
children,
}: TransferProps<T>) {
if (selectedKeys) {
const mergedTargetKeys = targetKeys || [];
return {
sourceSelectedKeys: selectedKeys.filter(key => !mergedTargetKeys.includes(key)),
targetSelectedKeys: selectedKeys.filter(key => mergedTargetKeys.includes(key)),
};
}
2020-05-14 16:36:05 +08:00
devWarning(
!pagination || !children,
'Transfer',
'`pagination` not support customize render list.',
);
return null;
}
separatedDataSource: {
leftDataSource: RecordType[];
rightDataSource: RecordType[];
} | null = null;
2016-08-08 14:42:29 +08:00
constructor(props: TransferProps<RecordType>) {
2015-11-25 23:17:06 +08:00
super(props);
const { selectedKeys = [], targetKeys = [] } = props;
2015-11-25 23:17:06 +08:00
this.state = {
sourceSelectedKeys: selectedKeys.filter(key => targetKeys.indexOf(key) === -1),
targetSelectedKeys: selectedKeys.filter(key => targetKeys.indexOf(key) > -1),
2015-11-25 23:17:06 +08:00
};
}
2016-07-15 14:01:51 +08:00
setStateKeys = (
direction: TransferDirection,
keys: string[] | ((prevKeys: string[]) => string[]),
) => {
if (direction === 'left') {
this.setState(({ sourceSelectedKeys }) => ({
sourceSelectedKeys: typeof keys === 'function' ? keys(sourceSelectedKeys || []) : keys,
}));
} else {
this.setState(({ targetSelectedKeys }) => ({
targetSelectedKeys: typeof keys === 'function' ? keys(targetSelectedKeys || []) : keys,
}));
}
};
getTitles(transferLocale: TransferLocale): React.ReactNode[] {
const { titles } = this.props;
if (titles) {
return titles;
2019-08-05 18:38:10 +08:00
}
return transferLocale.titles;
2015-12-16 23:02:49 +08:00
}
getLocale = (transferLocale: TransferLocale, renderEmpty: RenderEmptyHandler) => ({
...transferLocale,
notFoundContent: renderEmpty('Transfer'),
...this.props.locale,
});
2015-12-16 23:02:49 +08:00
2017-11-20 17:41:32 +08:00
moveTo = (direction: TransferDirection) => {
const { targetKeys = [], dataSource = [], onChange } = this.props;
const { sourceSelectedKeys, targetSelectedKeys } = this.state;
const moveKeys = direction === 'right' ? sourceSelectedKeys : targetSelectedKeys;
// filter the disabled options
2018-12-07 20:02:01 +08:00
const newMoveKeys = moveKeys.filter(
(key: string) => !dataSource.some(data => !!(key === data.key && data.disabled)),
2017-11-20 17:41:32 +08:00
);
2015-12-21 15:29:02 +08:00
// move items to target box
2018-12-07 20:02:01 +08:00
const newTargetKeys =
direction === 'right'
? newMoveKeys.concat(targetKeys)
: targetKeys.filter(targetKey => newMoveKeys.indexOf(targetKey) === -1);
2015-12-21 15:29:02 +08:00
// empty checked keys
const oppositeDirection = direction === 'right' ? 'left' : 'right';
this.setStateKeys(oppositeDirection, []);
this.handleSelectChange(oppositeDirection, []);
2015-12-21 15:29:02 +08:00
2016-10-24 16:30:38 +08:00
if (onChange) {
onChange(newTargetKeys, direction, newMoveKeys);
2016-10-24 16:30:38 +08:00
}
2018-12-07 20:02:01 +08:00
};
2015-11-25 23:17:06 +08:00
moveToLeft = () => this.moveTo('left');
2016-10-24 16:30:38 +08:00
2019-08-05 18:38:10 +08:00
moveToRight = () => this.moveTo('right');
onItemSelectAll = (direction: TransferDirection, selectedKeys: string[], checkAll: boolean) => {
this.setStateKeys(direction, prevKeys => {
let mergedCheckedKeys = [];
if (checkAll) {
// Merge current keys with origin key
mergedCheckedKeys = Array.from(new Set([...prevKeys, ...selectedKeys]));
} else {
// Remove current keys from origin keys
mergedCheckedKeys = prevKeys.filter((key: string) => selectedKeys.indexOf(key) === -1);
}
this.handleSelectChange(direction, mergedCheckedKeys);
return mergedCheckedKeys;
});
2018-12-07 20:02:01 +08:00
};
2015-11-25 23:17:06 +08:00
onLeftItemSelectAll = (selectedKeys: string[], checkAll: boolean) =>
this.onItemSelectAll('left', selectedKeys, checkAll);
2019-08-05 18:38:10 +08:00
onRightItemSelectAll = (selectedKeys: string[], checkAll: boolean) =>
this.onItemSelectAll('right', selectedKeys, checkAll);
2016-03-30 17:06:19 +08:00
2017-11-20 17:41:32 +08:00
handleFilter = (direction: TransferDirection, e: React.ChangeEvent<HTMLInputElement>) => {
const { onSearch } = this.props;
const { value } = e.target;
if (onSearch) {
onSearch(direction, value);
}
2018-12-07 20:02:01 +08:00
};
2015-11-26 16:07:11 +08:00
2017-11-20 17:41:32 +08:00
handleLeftFilter = (e: React.ChangeEvent<HTMLInputElement>) => this.handleFilter('left', e);
2019-08-05 18:38:10 +08:00
2017-11-20 17:41:32 +08:00
handleRightFilter = (e: React.ChangeEvent<HTMLInputElement>) => this.handleFilter('right', e);
2016-03-30 17:06:19 +08:00
handleClear = (direction: TransferDirection) => {
const { onSearch } = this.props;
if (onSearch) {
onSearch(direction, '');
}
2018-12-07 20:02:01 +08:00
};
2015-11-25 23:17:06 +08:00
handleLeftClear = () => this.handleClear('left');
2019-08-05 18:38:10 +08:00
handleRightClear = () => this.handleClear('right');
2016-03-30 17:06:19 +08:00
onItemSelect = (direction: TransferDirection, selectedKey: string, checked: boolean) => {
const { sourceSelectedKeys, targetSelectedKeys } = this.state;
const holder = direction === 'left' ? [...sourceSelectedKeys] : [...targetSelectedKeys];
const index = holder.indexOf(selectedKey);
if (index > -1) {
2015-12-21 15:29:02 +08:00
holder.splice(index, 1);
}
if (checked) {
holder.push(selectedKey);
2015-12-21 15:29:02 +08:00
}
this.handleSelectChange(direction, holder);
if (!this.props.selectedKeys) {
this.setStateKeys(direction, holder);
}
2018-12-07 20:02:01 +08:00
};
2015-11-25 23:17:06 +08:00
onLeftItemSelect = (selectedKey: string, checked: boolean) =>
this.onItemSelect('left', selectedKey, checked);
2019-08-05 18:38:10 +08:00
onRightItemSelect = (selectedKey: string, checked: boolean) =>
this.onItemSelect('right', selectedKey, checked);
2016-03-30 17:06:19 +08:00
onRightItemRemove = (selectedKeys: string[]) => {
const { targetKeys = [], onChange } = this.props;
this.setStateKeys('right', []);
if (onChange) {
onChange(
targetKeys.filter(key => !selectedKeys.includes(key)),
'left',
[...selectedKeys],
);
}
};
handleScroll = (direction: TransferDirection, e: React.SyntheticEvent<HTMLUListElement>) => {
const { onScroll } = this.props;
if (onScroll) {
onScroll(direction, e);
}
2018-12-07 20:02:01 +08:00
};
handleLeftScroll = (e: React.SyntheticEvent<HTMLUListElement>) => this.handleScroll('left', e);
2019-08-05 18:38:10 +08:00
handleRightScroll = (e: React.SyntheticEvent<HTMLUListElement>) => this.handleScroll('right', e);
2019-08-05 18:38:10 +08:00
handleSelectChange(direction: TransferDirection, holder: string[]) {
const { sourceSelectedKeys, targetSelectedKeys } = this.state;
const { onSelectChange } = this.props;
if (!onSelectChange) {
return;
}
2019-08-05 18:38:10 +08:00
if (direction === 'left') {
onSelectChange(holder, targetSelectedKeys);
} else {
onSelectChange(sourceSelectedKeys, holder);
}
}
handleListStyle = (
2019-11-05 13:26:39 +08:00
listStyle: ((style: ListStyle) => React.CSSProperties) | React.CSSProperties,
direction: TransferDirection,
) => {
if (typeof listStyle === 'function') {
return listStyle({ direction });
}
return listStyle;
};
2019-08-05 18:38:10 +08:00
separateDataSource() {
const { dataSource, rowKey, targetKeys = [] } = this.props;
const leftDataSource: KeyWise<RecordType>[] = [];
const rightDataSource: KeyWise<RecordType>[] = new Array(targetKeys.length);
dataSource.forEach((record: KeyWise<RecordType>) => {
2019-08-05 18:38:10 +08:00
if (rowKey) {
record.key = rowKey(record);
}
// rightDataSource should be ordered by targetKeys
// leftDataSource should be ordered by dataSource
const indexOfKey = targetKeys.indexOf(record.key);
if (indexOfKey !== -1) {
rightDataSource[indexOfKey] = record;
} else {
leftDataSource.push(record);
}
});
return {
leftDataSource,
rightDataSource,
};
}
renderTransfer = (transferLocale: TransferLocale) => (
<ConfigConsumer>
feat: added rtl direction to all of ant-design components (#19380) * rtl demo change en-us description * change bundlesize css limit * RTL: modal component (exclude confirm) * RTL: table component * RTL: pagination component * cleanup rtl demo * fix pagination.tsx compile error * RTL: button and button-group * RTL: Steps component * fix rtl demo style * fix input suffix icon alignment * fix select component arrow issue * RTL: form component * add pagination rtl test * fix test lint error * RTL: rate component * RTL: radio and radio group components * RTL: tree-select component * some fixes to RTL components * RTL: badge component * fix rtl issue in inline form * fix input component rtl padding issue * fix switch component text rtl issue * fix table grouped header text-align * add rtl support to whole demo with RTL button * Update rtl demo responsive * RTL: page-header component * RTL: typography component * RTL: Dropdown (Partial) * update config-provider doc * RTL: input component * RTL: select component * RTL: switch component * RTL: tree component * fix rtl demo lint * rtl demo change en-us description * RTL: modal component (exclude confirm) * RTL: table component * RTL: pagination component * cleanup rtl demo * RTL: button and button-group * RTL: Steps component * fix rtl demo style * fix input suffix icon alignment * RTL: form component * RTL: rate component * RTL: radio and radio group components * RTL: tree-select component * RTL: badge component * fix rtl issue in inline form * fix input component rtl padding issue * add rtl support to whole demo with RTL button * fix lost changes after rebase * fix lint errors * RTL: Transfer Component * RTL: upload component * RTL: update avatar demo * RTL: comment component * RTL: collapse component * RTL: carousel component * update snapshots * RTL: Card component * RTL: descriptions component * RTL: Empty component * RTL: list component * RTL: slider component * slider component import/order * add shared rtlTest * RTL: Statistic component * RTL: tooltip components * RTL: popover component * RTL: timeline component * RTL: tag component * RTL: alert component * RTL: drawer component * RTL: Tab component * change direction definition * RTL: progress component * input.tsx, remove duplicate after rebase * fix demo.less after rebase * fix ant-row-rtl after rebase * fix upload issues in rtl * badge rtl demo margin fix * fix: tabs with icon margin * fix: radio-wrapper margin * fix: table component after rebase * fix: centered modal text-align * update slider snapshot * RTL: popconfirm component * RTL: back-top component * RTL: spin component * RTL: result component * RTL: skeleton component * RTL: menu component * RTL: time-picker component * RTL: calendar component * RTL: date-picker component * RTL: home page * update snapshots * test: add auto-complete rtl test * test: add avatar component rtl tests * test: add badge component rtl tests * test: add breadcrumb component rtl tests * test: add button components rtl tests * test: add card component rtl tests * test: add carousel component rtl tests * test: add cascader component rtl tests * test: add checkbox component rtl tests * test: add collapse component rtl tests * test: add comment component rtl tests * test: add dropdown component rtl tests * test: add empty component rtl tests * test: add form component rtl tests * test: add grid component rtl tests * test: add input component rtl tests * test: add search component rtl tests * test: add input-number component rtl tests * test: add layout component rtl tests * test: add list component rtl tests * test: add mentions component rtl tests * test: add modal component rtl tests * test: add page-header component rtl tests * test: add pagination component rtl tests * test: add radio component rtl tests * test: add rate component rtl tests * test: add select component rtl tests * test: add slider component rtl tests * test: add steps component rtl tests * test: add switch component rtl tests * test: add table component rtl tests * test: add transfer component rtl tests * test: add tree component rtl tests * test: add tree-select component rtl tests * test: add typography component rtl tests * test: add upload component rtl tests * test: add affix component rtl tests * update calendar tests * increase css file maxSize * update snapshots * remove workflows to allow push * remove duplicate reverse prop from slider * fix: remove table demo from config-provider * fix: remove table demo from config-provider * fix lint error * Added direction property to ConfigProvider * cascader rtl tests added * update config-provider doc * RTL: grid system * RTL: input component * RTL: switch component * fix rtl demo lint * RTL: modal component (exclude confirm) * RTL: table component * RTL: pagination component * cleanup rtl demo * fix pagination.tsx compile error * RTL: button and button-group * RTL: Steps component * fix rtl demo style * RTL: form component * add pagination rtl test * RTL: rate component * RTL: radio and radio group components * RTL: tree-select component * RTL: badge component * fix rtl issue in inline form * fix input component rtl padding issue * add rtl support to whole demo with RTL button * RTL: input component * RTL: select component * RTL: switch component * RTL: tree component * fix rtl demo lint * rtl demo change en-us description * RTL: modal component (exclude confirm) * RTL: table component * RTL: pagination component * cleanup rtl demo * RTL: button and button-group * RTL: Steps component * fix rtl demo style * fix input suffix icon alignment * RTL: form component * RTL: rate component * RTL: radio and radio group components * RTL: tree-select component * RTL: badge component * fix rtl issue in inline form * fix input component rtl padding issue * add rtl support to whole demo with RTL button * input.tsx, remove duplicate after rebase * fix ant-row-rtl after rebase * update snapshots * test: add cascader component rtl tests * test: add pagination component rtl tests * update calendar tests * update snapshots * fix: remove table demo from config-provider * fix: remove table demo from config-provider * fix lint error * update direction.md icons * dropdown and cascader default placement in rtl * update snapshots * fix lint errors * remove duplicate import * update snapshots * update snapshot * update calendar snapshot * update snapshots * integrate with new rc-picker * update snapshots * fix lint errors * update snapshot * update snapshots * update snapshots * update snapshots :| * update snapshots * fix compile error. * fix typo after rebase * update snapshots * remove workflows to allow push * update snapshots * update snapshots * fix dist error * front-page css fix * update snapshots * fix lint and test issues * restore cascader index.less * update snapshots * fix logo in rtl and demo controls * ci errors * resolve steps/index.tsx conflicts * tooltip family demo remove inline style * resolve table/Table.tsx conflicts * resolve modal/Modal.tsx conflicts * resolve cascader/index.tsx conflicts * add workflows from upstream * update snapshots * revert logo to default * fix codebox demo direction of placements * resolve tooltip overlayClassName conflicts * update snapshots * update popover test * fix: cascader miss popupClassName * fix: fix select missing dropdownClassName * chore: Update snapshot * chore: Adjust menu use rtl logic * docs: Update demo line color Co-authored-by: 二货机器人 <smith3816@gmail.com>
2020-01-02 19:10:16 +08:00
{({ getPrefixCls, renderEmpty, direction }: ConfigConsumerProps) => {
const {
prefixCls: customizePrefixCls,
className,
disabled,
operations = [],
showSearch,
footer,
style,
listStyle,
operationStyle,
filterOption,
render,
children,
showSelectAll,
oneWay,
pagination,
} = this.props;
const prefixCls = getPrefixCls('transfer', customizePrefixCls);
const locale = this.getLocale(transferLocale, renderEmpty);
const { sourceSelectedKeys, targetSelectedKeys } = this.state;
const mergedPagination = !children && pagination;
2019-08-05 18:38:10 +08:00
const { leftDataSource, rightDataSource } = this.separateDataSource();
const leftActive = targetSelectedKeys.length > 0;
const rightActive = sourceSelectedKeys.length > 0;
const cls = classNames(
prefixCls,
{
[`${prefixCls}-disabled`]: disabled,
[`${prefixCls}-customize-list`]: !!children,
[`${prefixCls}-rtl`]: direction === 'rtl',
},
className,
);
const titles = this.getTitles(locale);
const selectAllLabels = this.props.selectAllLabels || [];
return (
<div className={cls} style={style}>
<List<KeyWise<RecordType>>
prefixCls={`${prefixCls}-list`}
titleText={titles[0]}
dataSource={leftDataSource}
filterOption={filterOption}
style={this.handleListStyle(listStyle, 'left')}
checkedKeys={sourceSelectedKeys}
handleFilter={this.handleLeftFilter}
handleClear={this.handleLeftClear}
onItemSelect={this.onLeftItemSelect}
onItemSelectAll={this.onLeftItemSelectAll}
render={render}
showSearch={showSearch}
renderList={children}
footer={footer}
onScroll={this.handleLeftScroll}
disabled={disabled}
direction="left"
showSelectAll={showSelectAll}
selectAllLabel={selectAllLabels[0]}
pagination={mergedPagination}
{...locale}
/>
<Operation
className={`${prefixCls}-operation`}
rightActive={rightActive}
rightArrowText={operations[0]}
moveToRight={this.moveToRight}
leftActive={leftActive}
leftArrowText={operations[1]}
moveToLeft={this.moveToLeft}
style={operationStyle}
disabled={disabled}
feat: added rtl direction to all of ant-design components (#19380) * rtl demo change en-us description * change bundlesize css limit * RTL: modal component (exclude confirm) * RTL: table component * RTL: pagination component * cleanup rtl demo * fix pagination.tsx compile error * RTL: button and button-group * RTL: Steps component * fix rtl demo style * fix input suffix icon alignment * fix select component arrow issue * RTL: form component * add pagination rtl test * fix test lint error * RTL: rate component * RTL: radio and radio group components * RTL: tree-select component * some fixes to RTL components * RTL: badge component * fix rtl issue in inline form * fix input component rtl padding issue * fix switch component text rtl issue * fix table grouped header text-align * add rtl support to whole demo with RTL button * Update rtl demo responsive * RTL: page-header component * RTL: typography component * RTL: Dropdown (Partial) * update config-provider doc * RTL: input component * RTL: select component * RTL: switch component * RTL: tree component * fix rtl demo lint * rtl demo change en-us description * RTL: modal component (exclude confirm) * RTL: table component * RTL: pagination component * cleanup rtl demo * RTL: button and button-group * RTL: Steps component * fix rtl demo style * fix input suffix icon alignment * RTL: form component * RTL: rate component * RTL: radio and radio group components * RTL: tree-select component * RTL: badge component * fix rtl issue in inline form * fix input component rtl padding issue * add rtl support to whole demo with RTL button * fix lost changes after rebase * fix lint errors * RTL: Transfer Component * RTL: upload component * RTL: update avatar demo * RTL: comment component * RTL: collapse component * RTL: carousel component * update snapshots * RTL: Card component * RTL: descriptions component * RTL: Empty component * RTL: list component * RTL: slider component * slider component import/order * add shared rtlTest * RTL: Statistic component * RTL: tooltip components * RTL: popover component * RTL: timeline component * RTL: tag component * RTL: alert component * RTL: drawer component * RTL: Tab component * change direction definition * RTL: progress component * input.tsx, remove duplicate after rebase * fix demo.less after rebase * fix ant-row-rtl after rebase * fix upload issues in rtl * badge rtl demo margin fix * fix: tabs with icon margin * fix: radio-wrapper margin * fix: table component after rebase * fix: centered modal text-align * update slider snapshot * RTL: popconfirm component * RTL: back-top component * RTL: spin component * RTL: result component * RTL: skeleton component * RTL: menu component * RTL: time-picker component * RTL: calendar component * RTL: date-picker component * RTL: home page * update snapshots * test: add auto-complete rtl test * test: add avatar component rtl tests * test: add badge component rtl tests * test: add breadcrumb component rtl tests * test: add button components rtl tests * test: add card component rtl tests * test: add carousel component rtl tests * test: add cascader component rtl tests * test: add checkbox component rtl tests * test: add collapse component rtl tests * test: add comment component rtl tests * test: add dropdown component rtl tests * test: add empty component rtl tests * test: add form component rtl tests * test: add grid component rtl tests * test: add input component rtl tests * test: add search component rtl tests * test: add input-number component rtl tests * test: add layout component rtl tests * test: add list component rtl tests * test: add mentions component rtl tests * test: add modal component rtl tests * test: add page-header component rtl tests * test: add pagination component rtl tests * test: add radio component rtl tests * test: add rate component rtl tests * test: add select component rtl tests * test: add slider component rtl tests * test: add steps component rtl tests * test: add switch component rtl tests * test: add table component rtl tests * test: add transfer component rtl tests * test: add tree component rtl tests * test: add tree-select component rtl tests * test: add typography component rtl tests * test: add upload component rtl tests * test: add affix component rtl tests * update calendar tests * increase css file maxSize * update snapshots * remove workflows to allow push * remove duplicate reverse prop from slider * fix: remove table demo from config-provider * fix: remove table demo from config-provider * fix lint error * Added direction property to ConfigProvider * cascader rtl tests added * update config-provider doc * RTL: grid system * RTL: input component * RTL: switch component * fix rtl demo lint * RTL: modal component (exclude confirm) * RTL: table component * RTL: pagination component * cleanup rtl demo * fix pagination.tsx compile error * RTL: button and button-group * RTL: Steps component * fix rtl demo style * RTL: form component * add pagination rtl test * RTL: rate component * RTL: radio and radio group components * RTL: tree-select component * RTL: badge component * fix rtl issue in inline form * fix input component rtl padding issue * add rtl support to whole demo with RTL button * RTL: input component * RTL: select component * RTL: switch component * RTL: tree component * fix rtl demo lint * rtl demo change en-us description * RTL: modal component (exclude confirm) * RTL: table component * RTL: pagination component * cleanup rtl demo * RTL: button and button-group * RTL: Steps component * fix rtl demo style * fix input suffix icon alignment * RTL: form component * RTL: rate component * RTL: radio and radio group components * RTL: tree-select component * RTL: badge component * fix rtl issue in inline form * fix input component rtl padding issue * add rtl support to whole demo with RTL button * input.tsx, remove duplicate after rebase * fix ant-row-rtl after rebase * update snapshots * test: add cascader component rtl tests * test: add pagination component rtl tests * update calendar tests * update snapshots * fix: remove table demo from config-provider * fix: remove table demo from config-provider * fix lint error * update direction.md icons * dropdown and cascader default placement in rtl * update snapshots * fix lint errors * remove duplicate import * update snapshots * update snapshot * update calendar snapshot * update snapshots * integrate with new rc-picker * update snapshots * fix lint errors * update snapshot * update snapshots * update snapshots * update snapshots :| * update snapshots * fix compile error. * fix typo after rebase * update snapshots * remove workflows to allow push * update snapshots * update snapshots * fix dist error * front-page css fix * update snapshots * fix lint and test issues * restore cascader index.less * update snapshots * fix logo in rtl and demo controls * ci errors * resolve steps/index.tsx conflicts * tooltip family demo remove inline style * resolve table/Table.tsx conflicts * resolve modal/Modal.tsx conflicts * resolve cascader/index.tsx conflicts * add workflows from upstream * update snapshots * revert logo to default * fix codebox demo direction of placements * resolve tooltip overlayClassName conflicts * update snapshots * update popover test * fix: cascader miss popupClassName * fix: fix select missing dropdownClassName * chore: Update snapshot * chore: Adjust menu use rtl logic * docs: Update demo line color Co-authored-by: 二货机器人 <smith3816@gmail.com>
2020-01-02 19:10:16 +08:00
direction={direction}
oneWay={oneWay}
/>
<List<KeyWise<RecordType>>
prefixCls={`${prefixCls}-list`}
titleText={titles[1]}
dataSource={rightDataSource}
filterOption={filterOption}
style={this.handleListStyle(listStyle, 'right')}
checkedKeys={targetSelectedKeys}
handleFilter={this.handleRightFilter}
handleClear={this.handleRightClear}
onItemSelect={this.onRightItemSelect}
onItemSelectAll={this.onRightItemSelectAll}
onItemRemove={this.onRightItemRemove}
render={render}
showSearch={showSearch}
renderList={children}
footer={footer}
onScroll={this.handleRightScroll}
disabled={disabled}
direction="right"
showSelectAll={showSelectAll}
selectAllLabel={selectAllLabels[1]}
showRemove={oneWay}
pagination={mergedPagination}
{...locale}
/>
</div>
);
}}
</ConfigConsumer>
);
render() {
return (
2018-12-07 20:02:01 +08:00
<LocaleReceiver componentName="Transfer" defaultLocale={defaultLocale.Transfer}>
{this.renderTransfer}
</LocaleReceiver>
);
}
}
2019-03-07 15:39:34 +08:00
export default Transfer;