2023-10-26 11:46:22 +08:00
|
|
|
import React, { useMemo, useRef, useState } from 'react';
|
2020-05-26 12:38:08 +08:00
|
|
|
import DownOutlined from '@ant-design/icons/DownOutlined';
|
2022-06-22 14:57:09 +08:00
|
|
|
import classNames from 'classnames';
|
|
|
|
import omit from 'rc-util/lib/omit';
|
2023-10-26 11:46:22 +08:00
|
|
|
|
2023-04-27 11:48:57 +08:00
|
|
|
import { groupKeysMap } from '../_util/transKeys';
|
2017-03-17 15:23:25 +08:00
|
|
|
import Checkbox from '../checkbox';
|
2020-05-13 19:15:40 +08:00
|
|
|
import Dropdown from '../dropdown';
|
2022-10-23 00:33:45 +08:00
|
|
|
import type { MenuProps } from '../menu';
|
2022-05-07 14:31:54 +08:00
|
|
|
import type {
|
2022-06-22 14:57:09 +08:00
|
|
|
KeyWiseTransferItem,
|
2020-02-04 10:16:23 +08:00
|
|
|
RenderResult,
|
|
|
|
RenderResultObject,
|
|
|
|
SelectAllLabel,
|
2022-06-22 14:57:09 +08:00
|
|
|
TransferDirection,
|
2020-05-13 19:15:40 +08:00
|
|
|
TransferLocale,
|
2020-02-04 10:16:23 +08:00
|
|
|
} from './index';
|
2024-03-14 21:14:21 +08:00
|
|
|
import type { PaginationType, TransferKey } from './interface';
|
2023-10-26 11:46:22 +08:00
|
|
|
import type { ListBodyRef, TransferListBodyProps } from './ListBody';
|
|
|
|
import DefaultListBody, { OmitProps } from './ListBody';
|
2022-06-22 14:57:09 +08:00
|
|
|
import Search from './search';
|
2015-12-24 17:44:54 +08:00
|
|
|
|
2019-05-07 17:10:42 +08:00
|
|
|
const defaultRender = () => null;
|
2015-11-25 23:17:06 +08:00
|
|
|
|
2022-04-08 22:55:42 +08:00
|
|
|
function isRenderResultPlainObject(result: RenderResult): result is RenderResultObject {
|
|
|
|
return !!(
|
2018-12-07 16:17:45 +08:00
|
|
|
result &&
|
2024-02-24 14:50:03 +08:00
|
|
|
!React.isValidElement(result) &&
|
2018-12-07 16:17:45 +08:00
|
|
|
Object.prototype.toString.call(result) === '[object Object]'
|
|
|
|
);
|
2017-01-27 17:08:12 +08:00
|
|
|
}
|
|
|
|
|
2020-11-08 15:28:03 +08:00
|
|
|
function getEnabledItemKeys<RecordType extends KeyWiseTransferItem>(items: RecordType[]) {
|
2022-11-19 13:47:33 +08:00
|
|
|
return items.filter((data) => !data.disabled).map((data) => data.key);
|
2020-05-13 19:15:40 +08:00
|
|
|
}
|
|
|
|
|
2023-07-25 14:05:52 +08:00
|
|
|
const isValidIcon = (icon: React.ReactNode) => icon !== undefined;
|
|
|
|
|
2020-11-08 15:28:03 +08:00
|
|
|
export interface RenderedItem<RecordType> {
|
2019-05-07 17:10:42 +08:00
|
|
|
renderedText: string;
|
|
|
|
renderedEl: React.ReactNode;
|
2020-11-08 15:28:03 +08:00
|
|
|
item: RecordType;
|
2019-05-07 17:10:42 +08:00
|
|
|
}
|
|
|
|
|
2020-11-08 15:28:03 +08:00
|
|
|
type RenderListFunction<T> = (props: TransferListBodyProps<T>) => React.ReactNode;
|
2021-02-28 11:00:44 +08:00
|
|
|
|
2020-11-08 15:28:03 +08:00
|
|
|
export interface TransferListProps<RecordType> extends TransferLocale {
|
2016-10-24 16:30:38 +08:00
|
|
|
prefixCls: string;
|
2020-12-11 23:23:49 +08:00
|
|
|
titleText: React.ReactNode;
|
2020-11-08 15:28:03 +08:00
|
|
|
dataSource: RecordType[];
|
2023-08-29 22:53:43 +08:00
|
|
|
filterOption?: (filterText: string, item: RecordType, direction: TransferDirection) => boolean;
|
2016-07-13 11:14:24 +08:00
|
|
|
style?: React.CSSProperties;
|
2024-03-14 21:14:21 +08:00
|
|
|
checkedKeys: TransferKey[];
|
2019-05-07 17:10:42 +08:00
|
|
|
handleFilter: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
2024-03-14 21:14:21 +08:00
|
|
|
onItemSelect: (
|
|
|
|
key: TransferKey,
|
|
|
|
check: boolean,
|
|
|
|
e?: React.MouseEvent<Element, MouseEvent>,
|
|
|
|
) => void;
|
|
|
|
onItemSelectAll: (dataSource: TransferKey[], checkAll: boolean | 'replace') => void;
|
|
|
|
onItemRemove?: (keys: TransferKey[]) => void;
|
2016-10-24 16:30:38 +08:00
|
|
|
handleClear: () => void;
|
2020-12-28 15:30:18 +08:00
|
|
|
/** Render item */
|
2020-11-08 15:28:03 +08:00
|
|
|
render?: (item: RecordType) => RenderResult;
|
2017-03-17 15:23:25 +08:00
|
|
|
showSearch?: boolean;
|
|
|
|
searchPlaceholder: string;
|
|
|
|
itemUnit: string;
|
|
|
|
itemsUnit: string;
|
2020-11-08 15:28:03 +08:00
|
|
|
renderList?: RenderListFunction<RecordType>;
|
2021-06-30 12:10:23 +08:00
|
|
|
footer?: (
|
|
|
|
props: TransferListProps<RecordType>,
|
|
|
|
info?: { direction: TransferDirection },
|
|
|
|
) => React.ReactNode;
|
2023-01-05 10:37:35 +08:00
|
|
|
onScroll: (e: React.UIEvent<HTMLUListElement, UIEvent>) => void;
|
2018-09-15 15:18:59 +08:00
|
|
|
disabled?: boolean;
|
2019-05-07 17:10:42 +08:00
|
|
|
direction: TransferDirection;
|
|
|
|
showSelectAll?: boolean;
|
2020-02-04 10:16:23 +08:00
|
|
|
selectAllLabel?: SelectAllLabel;
|
2020-05-13 19:15:40 +08:00
|
|
|
showRemove?: boolean;
|
|
|
|
pagination?: PaginationType;
|
2023-07-25 14:05:52 +08:00
|
|
|
selectionsIcon?: React.ReactNode;
|
2019-05-07 17:10:42 +08:00
|
|
|
}
|
|
|
|
|
2024-04-01 15:49:45 +08:00
|
|
|
export interface TransferCustomListBodyProps<T> extends TransferListBodyProps<T> {}
|
2023-10-26 11:46:22 +08:00
|
|
|
|
2023-01-02 18:10:37 +08:00
|
|
|
const TransferList = <RecordType extends KeyWiseTransferItem>(
|
|
|
|
props: TransferListProps<RecordType>,
|
|
|
|
) => {
|
|
|
|
const {
|
|
|
|
prefixCls,
|
|
|
|
dataSource = [],
|
|
|
|
titleText = '',
|
|
|
|
checkedKeys,
|
|
|
|
disabled,
|
|
|
|
showSearch = false,
|
|
|
|
style,
|
|
|
|
searchPlaceholder,
|
|
|
|
notFoundContent,
|
|
|
|
selectAll,
|
2024-04-22 12:03:12 +08:00
|
|
|
deselectAll,
|
2023-01-02 18:10:37 +08:00
|
|
|
selectCurrent,
|
|
|
|
selectInvert,
|
|
|
|
removeAll,
|
|
|
|
removeCurrent,
|
|
|
|
showSelectAll = true,
|
|
|
|
showRemove,
|
|
|
|
pagination,
|
|
|
|
direction,
|
|
|
|
itemsUnit,
|
|
|
|
itemUnit,
|
|
|
|
selectAllLabel,
|
2023-07-25 14:05:52 +08:00
|
|
|
selectionsIcon,
|
2023-01-02 18:10:37 +08:00
|
|
|
footer,
|
|
|
|
renderList,
|
|
|
|
onItemSelectAll,
|
|
|
|
onItemRemove,
|
|
|
|
handleFilter,
|
|
|
|
handleClear,
|
|
|
|
filterOption,
|
|
|
|
render = defaultRender,
|
|
|
|
} = props;
|
2019-08-05 18:38:10 +08:00
|
|
|
|
2023-01-05 10:37:35 +08:00
|
|
|
const [filterValue, setFilterValue] = useState<string>('');
|
|
|
|
const listBodyRef = useRef<ListBodyRef<RecordType>>({});
|
2019-05-09 12:27:35 +08:00
|
|
|
|
2023-01-02 18:10:37 +08:00
|
|
|
const internalHandleFilter = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
|
|
setFilterValue(e.target.value);
|
2020-05-13 19:15:40 +08:00
|
|
|
handleFilter(e);
|
|
|
|
};
|
|
|
|
|
2023-01-02 18:10:37 +08:00
|
|
|
const internalHandleClear = () => {
|
|
|
|
setFilterValue('');
|
2020-05-13 19:15:40 +08:00
|
|
|
handleClear();
|
|
|
|
};
|
|
|
|
|
2023-01-02 18:10:37 +08:00
|
|
|
const matchFilter = (text: string, item: RecordType) => {
|
2020-05-13 19:15:40 +08:00
|
|
|
if (filterOption) {
|
2023-08-29 22:53:43 +08:00
|
|
|
return filterOption(filterValue, item, direction);
|
2020-05-13 19:15:40 +08:00
|
|
|
}
|
2022-10-21 11:45:55 +08:00
|
|
|
return text.includes(filterValue);
|
2020-05-13 19:15:40 +08:00
|
|
|
};
|
|
|
|
|
2023-01-05 10:37:35 +08:00
|
|
|
const renderListBody = (listProps: TransferListBodyProps<RecordType>) => {
|
2023-10-26 11:46:22 +08:00
|
|
|
let bodyContent: React.ReactNode = renderList
|
|
|
|
? renderList({
|
|
|
|
...listProps,
|
2024-04-01 15:49:45 +08:00
|
|
|
onItemSelect: (key, check) => listProps.onItemSelect(key, check),
|
2023-10-26 11:46:22 +08:00
|
|
|
})
|
|
|
|
: null;
|
2020-05-13 19:15:40 +08:00
|
|
|
const customize: boolean = !!bodyContent;
|
|
|
|
if (!customize) {
|
2024-04-01 15:49:45 +08:00
|
|
|
// @ts-ignore
|
2023-01-05 10:37:35 +08:00
|
|
|
bodyContent = <DefaultListBody ref={listBodyRef} {...listProps} />;
|
2020-05-13 19:15:40 +08:00
|
|
|
}
|
2023-01-02 18:10:37 +08:00
|
|
|
return { customize, bodyContent };
|
|
|
|
};
|
|
|
|
|
|
|
|
const renderItem = (item: RecordType): RenderedItem<RecordType> => {
|
|
|
|
const renderResult = render(item);
|
|
|
|
const isRenderResultPlain = isRenderResultPlainObject(renderResult);
|
2020-05-13 19:15:40 +08:00
|
|
|
return {
|
2023-01-02 18:10:37 +08:00
|
|
|
item,
|
2023-01-05 10:37:35 +08:00
|
|
|
renderedEl: isRenderResultPlain ? renderResult.label : renderResult,
|
|
|
|
renderedText: isRenderResultPlain ? renderResult.value : (renderResult as string),
|
2020-05-13 19:15:40 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-01-05 10:37:35 +08:00
|
|
|
const notFoundContentEle = useMemo<React.ReactNode>(
|
|
|
|
() =>
|
|
|
|
Array.isArray(notFoundContent)
|
|
|
|
? notFoundContent[direction === 'left' ? 0 : 1]
|
|
|
|
: notFoundContent,
|
|
|
|
[notFoundContent, direction],
|
|
|
|
);
|
2023-01-02 18:10:37 +08:00
|
|
|
|
2023-01-05 10:37:35 +08:00
|
|
|
const [filteredItems, filteredRenderItems] = useMemo(() => {
|
|
|
|
const filterItems: RecordType[] = [];
|
|
|
|
const filterRenderItems: RenderedItem<RecordType>[] = [];
|
2023-01-02 18:10:37 +08:00
|
|
|
dataSource.forEach((item) => {
|
|
|
|
const renderedItem = renderItem(item);
|
2023-01-05 10:37:35 +08:00
|
|
|
if (filterValue && !matchFilter(renderedItem.renderedText, item)) {
|
|
|
|
return;
|
2023-01-02 18:10:37 +08:00
|
|
|
}
|
2023-01-05 10:37:35 +08:00
|
|
|
filterItems.push(item);
|
|
|
|
filterRenderItems.push(renderedItem);
|
2023-01-02 18:10:37 +08:00
|
|
|
});
|
2023-01-05 10:37:35 +08:00
|
|
|
return [filterItems, filterRenderItems] as const;
|
|
|
|
}, [dataSource, filterValue]);
|
|
|
|
|
|
|
|
const checkStatus = useMemo<string>(() => {
|
|
|
|
if (checkedKeys.length === 0) {
|
|
|
|
return 'none';
|
|
|
|
}
|
|
|
|
const checkedKeysMap = groupKeysMap(checkedKeys);
|
|
|
|
if (filteredItems.every((item) => checkedKeysMap.has(item.key) || !!item.disabled)) {
|
|
|
|
return 'all';
|
|
|
|
}
|
|
|
|
return 'part';
|
|
|
|
}, [checkedKeys, filteredItems]);
|
2023-01-02 18:10:37 +08:00
|
|
|
|
2023-01-05 10:37:35 +08:00
|
|
|
const listBody = useMemo<React.ReactNode>(() => {
|
2019-05-09 12:27:35 +08:00
|
|
|
const search = showSearch ? (
|
|
|
|
<div className={`${prefixCls}-body-search-wrapper`}>
|
|
|
|
<Search
|
|
|
|
prefixCls={`${prefixCls}-search`}
|
2024-07-25 18:58:06 +08:00
|
|
|
onChange={internalHandleFilter}
|
2023-01-02 18:10:37 +08:00
|
|
|
handleClear={internalHandleClear}
|
2019-05-09 12:27:35 +08:00
|
|
|
placeholder={searchPlaceholder}
|
|
|
|
value={filterValue}
|
|
|
|
disabled={disabled}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
) : null;
|
|
|
|
|
2023-01-05 10:37:35 +08:00
|
|
|
const { customize, bodyContent } = renderListBody({
|
2023-01-02 18:10:37 +08:00
|
|
|
...omit(props, OmitProps),
|
2019-07-09 11:46:21 +08:00
|
|
|
filteredItems,
|
|
|
|
filteredRenderItems,
|
|
|
|
selectedKeys: checkedKeys,
|
|
|
|
});
|
2019-05-09 12:27:35 +08:00
|
|
|
|
2019-07-09 11:46:21 +08:00
|
|
|
let bodyNode: React.ReactNode;
|
|
|
|
// We should wrap customize list body in a classNamed div to use flex layout.
|
|
|
|
if (customize) {
|
|
|
|
bodyNode = <div className={`${prefixCls}-body-customize-wrapper`}>{bodyContent}</div>;
|
|
|
|
} else {
|
|
|
|
bodyNode = filteredItems.length ? (
|
|
|
|
bodyContent
|
|
|
|
) : (
|
2023-01-05 10:37:35 +08:00
|
|
|
<div className={`${prefixCls}-body-not-found`}>{notFoundContentEle}</div>
|
2019-05-09 12:27:35 +08:00
|
|
|
);
|
|
|
|
}
|
2019-07-09 11:46:21 +08:00
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className={classNames(
|
|
|
|
showSearch ? `${prefixCls}-body ${prefixCls}-body-with-search` : `${prefixCls}-body`,
|
|
|
|
)}
|
|
|
|
>
|
|
|
|
{search}
|
|
|
|
{bodyNode}
|
|
|
|
</div>
|
|
|
|
);
|
2023-01-05 10:37:35 +08:00
|
|
|
}, [
|
|
|
|
showSearch,
|
2021-08-10 19:20:53 +08:00
|
|
|
prefixCls,
|
2023-01-05 10:37:35 +08:00
|
|
|
searchPlaceholder,
|
|
|
|
filterValue,
|
|
|
|
disabled,
|
|
|
|
checkedKeys,
|
|
|
|
filteredItems,
|
|
|
|
filteredRenderItems,
|
|
|
|
notFoundContentEle,
|
|
|
|
]);
|
|
|
|
|
|
|
|
const checkBox = (
|
|
|
|
<Checkbox
|
2023-01-09 10:04:35 +08:00
|
|
|
disabled={dataSource.length === 0 || disabled}
|
2023-01-05 10:37:35 +08:00
|
|
|
checked={checkStatus === 'all'}
|
|
|
|
indeterminate={checkStatus === 'part'}
|
|
|
|
className={`${prefixCls}-checkbox`}
|
|
|
|
onChange={() => {
|
|
|
|
// Only select enabled items
|
|
|
|
onItemSelectAll?.(
|
|
|
|
filteredItems.filter((item) => !item.disabled).map(({ key }) => key),
|
|
|
|
checkStatus !== 'all',
|
|
|
|
);
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
2017-01-27 17:08:12 +08:00
|
|
|
|
2023-01-02 18:10:37 +08:00
|
|
|
const getSelectAllLabel = (selectedCount: number, totalCount: number): React.ReactNode => {
|
2020-02-04 10:16:23 +08:00
|
|
|
if (selectAllLabel) {
|
|
|
|
return typeof selectAllLabel === 'function'
|
|
|
|
? selectAllLabel({ selectedCount, totalCount })
|
|
|
|
: selectAllLabel;
|
|
|
|
}
|
|
|
|
const unit = totalCount > 1 ? itemsUnit : itemUnit;
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{(selectedCount > 0 ? `${selectedCount}/` : '') + totalCount} {unit}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2023-01-02 18:10:37 +08:00
|
|
|
// Custom Layout
|
|
|
|
const footerDom = footer && (footer.length < 2 ? footer(props) : footer(props, { direction }));
|
2015-12-24 17:44:54 +08:00
|
|
|
|
2023-01-02 18:10:37 +08:00
|
|
|
const listCls = classNames(prefixCls, {
|
|
|
|
[`${prefixCls}-with-pagination`]: !!pagination,
|
|
|
|
[`${prefixCls}-with-footer`]: !!footerDom,
|
|
|
|
});
|
2017-01-27 17:08:12 +08:00
|
|
|
|
2023-01-02 18:10:37 +08:00
|
|
|
// ====================== Get filtered, checked item list ======================
|
2016-01-13 16:28:36 +08:00
|
|
|
|
2023-01-02 18:10:37 +08:00
|
|
|
const listFooter = footerDom ? <div className={`${prefixCls}-footer`}>{footerDom}</div> : null;
|
|
|
|
|
2023-01-05 10:37:35 +08:00
|
|
|
const checkAllCheckbox = !showRemove && !pagination && checkBox;
|
2023-01-02 18:10:37 +08:00
|
|
|
|
|
|
|
let items: MenuProps['items'];
|
|
|
|
|
|
|
|
if (showRemove) {
|
|
|
|
items = [
|
|
|
|
/* Remove Current Page */
|
|
|
|
pagination
|
|
|
|
? {
|
|
|
|
key: 'removeCurrent',
|
|
|
|
label: removeCurrent,
|
|
|
|
onClick() {
|
|
|
|
const pageKeys = getEnabledItemKeys(
|
2023-01-05 10:37:35 +08:00
|
|
|
(listBodyRef.current?.items || []).map((entity) => entity.item),
|
2023-01-02 18:10:37 +08:00
|
|
|
);
|
|
|
|
onItemRemove?.(pageKeys);
|
|
|
|
},
|
|
|
|
}
|
|
|
|
: null,
|
|
|
|
/* Remove All */
|
|
|
|
{
|
|
|
|
key: 'removeAll',
|
|
|
|
label: removeAll,
|
|
|
|
onClick() {
|
|
|
|
onItemRemove?.(getEnabledItemKeys(filteredItems));
|
2022-03-18 15:20:35 +08:00
|
|
|
},
|
2023-01-02 18:10:37 +08:00
|
|
|
},
|
|
|
|
].filter(Boolean);
|
|
|
|
} else {
|
|
|
|
items = [
|
|
|
|
{
|
|
|
|
key: 'selectAll',
|
2024-04-22 12:03:12 +08:00
|
|
|
label: checkStatus === 'all' ? deselectAll : selectAll,
|
2023-01-02 18:10:37 +08:00
|
|
|
onClick() {
|
|
|
|
const keys = getEnabledItemKeys(filteredItems);
|
2023-01-05 10:37:35 +08:00
|
|
|
onItemSelectAll?.(keys, keys.length !== checkedKeys.length);
|
2022-03-18 15:20:35 +08:00
|
|
|
},
|
2023-01-02 18:10:37 +08:00
|
|
|
},
|
|
|
|
pagination
|
|
|
|
? {
|
|
|
|
key: 'selectCurrent',
|
|
|
|
label: selectCurrent,
|
|
|
|
onClick() {
|
2023-01-05 10:37:35 +08:00
|
|
|
const pageItems = listBodyRef.current?.items || [];
|
|
|
|
onItemSelectAll?.(getEnabledItemKeys(pageItems.map((entity) => entity.item)), true);
|
2023-01-02 18:10:37 +08:00
|
|
|
},
|
|
|
|
}
|
|
|
|
: null,
|
|
|
|
{
|
|
|
|
key: 'selectInvert',
|
|
|
|
label: selectInvert,
|
|
|
|
onClick() {
|
2024-01-24 10:54:15 +08:00
|
|
|
const availablePageItemKeys = getEnabledItemKeys(
|
|
|
|
(listBodyRef.current?.items || []).map((entity) => entity.item),
|
2023-01-02 18:10:37 +08:00
|
|
|
);
|
2024-01-24 10:54:15 +08:00
|
|
|
const checkedKeySet = new Set(checkedKeys);
|
|
|
|
const newCheckedKeysSet = new Set(checkedKeySet);
|
|
|
|
availablePageItemKeys.forEach((key) => {
|
2023-01-02 18:10:37 +08:00
|
|
|
if (checkedKeySet.has(key)) {
|
2024-01-24 10:54:15 +08:00
|
|
|
newCheckedKeysSet.delete(key);
|
2022-03-18 15:20:35 +08:00
|
|
|
} else {
|
2024-01-24 10:54:15 +08:00
|
|
|
newCheckedKeysSet.add(key);
|
2022-03-18 15:20:35 +08:00
|
|
|
}
|
2023-01-02 18:10:37 +08:00
|
|
|
});
|
2024-01-24 10:54:15 +08:00
|
|
|
onItemSelectAll?.(Array.from(newCheckedKeysSet), 'replace');
|
2022-03-18 15:20:35 +08:00
|
|
|
},
|
2023-01-02 18:10:37 +08:00
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|
2023-01-05 10:37:35 +08:00
|
|
|
const dropdown: React.ReactNode = (
|
2023-01-02 18:10:37 +08:00
|
|
|
<Dropdown className={`${prefixCls}-header-dropdown`} menu={{ items }} disabled={disabled}>
|
2023-07-25 14:05:52 +08:00
|
|
|
{isValidIcon(selectionsIcon) ? selectionsIcon : <DownOutlined />}
|
2023-01-02 18:10:37 +08:00
|
|
|
</Dropdown>
|
|
|
|
);
|
2016-11-28 19:14:43 +08:00
|
|
|
|
2023-01-02 18:10:37 +08:00
|
|
|
return (
|
|
|
|
<div className={listCls} style={style}>
|
|
|
|
{/* Header */}
|
|
|
|
<div className={`${prefixCls}-header`}>
|
|
|
|
{showSelectAll ? (
|
|
|
|
<>
|
|
|
|
{checkAllCheckbox}
|
|
|
|
{dropdown}
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
<span className={`${prefixCls}-header-selected`}>
|
|
|
|
{getSelectAllLabel(checkedKeys.length, filteredItems.length)}
|
|
|
|
</span>
|
|
|
|
<span className={`${prefixCls}-header-title`}>{titleText}</span>
|
2016-01-07 14:21:29 +08:00
|
|
|
</div>
|
2023-01-02 18:10:37 +08:00
|
|
|
{listBody}
|
|
|
|
{listFooter}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2023-01-04 15:09:03 +08:00
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
|
|
TransferList.displayName = 'TransferList';
|
|
|
|
}
|
|
|
|
|
2023-01-02 18:10:37 +08:00
|
|
|
export default TransferList;
|