mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
type: improve ts type for transfer (#50018)
* type: improve ts type for transfer * revert as any * fix type
This commit is contained in:
parent
902aa2e313
commit
02d331b60d
@ -73,11 +73,11 @@ const TransferListBody: React.ForwardRefRenderFunction<
|
||||
}
|
||||
}, [filteredRenderItems, mergedPagination, pageSize]);
|
||||
|
||||
const onInternalClick = (item: RecordType, e: React.MouseEvent<Element, MouseEvent>) => {
|
||||
const onInternalClick = (item: KeyWiseTransferItem, e: React.MouseEvent<Element, MouseEvent>) => {
|
||||
onItemSelect(item.key, !selectedKeys.includes(item.key), e);
|
||||
};
|
||||
|
||||
const onRemove = (item: RecordType) => {
|
||||
const onRemove = (item: KeyWiseTransferItem) => {
|
||||
onItemRemove?.([item.key]);
|
||||
};
|
||||
|
||||
@ -130,8 +130,8 @@ const TransferListBody: React.ForwardRefRenderFunction<
|
||||
renderedEl={renderedEl}
|
||||
prefixCls={prefixCls}
|
||||
showRemove={showRemove}
|
||||
onClick={onInternalClick as any}
|
||||
onRemove={onRemove as any}
|
||||
onClick={onInternalClick}
|
||||
onRemove={onRemove}
|
||||
checked={selectedKeys.includes(item.key)}
|
||||
disabled={globalDisabled || item.disabled}
|
||||
/>
|
||||
|
@ -203,7 +203,7 @@ const TransferList = <RecordType extends KeyWiseTransferItem>(
|
||||
<div className={`${prefixCls}-body-search-wrapper`}>
|
||||
<Search
|
||||
prefixCls={`${prefixCls}-search`}
|
||||
onChange={internalHandleFilter as any}
|
||||
onChange={internalHandleFilter}
|
||||
handleClear={internalHandleClear}
|
||||
placeholder={searchPlaceholder}
|
||||
value={filterValue}
|
||||
|
@ -6,7 +6,7 @@ import Input from '../input';
|
||||
export interface TransferSearchProps {
|
||||
prefixCls?: string;
|
||||
placeholder?: string;
|
||||
onChange?: (e: React.FormEvent<HTMLElement>) => void;
|
||||
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
||||
handleClear?: () => void;
|
||||
value?: string;
|
||||
disabled?: boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user