mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +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]);
|
}, [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);
|
onItemSelect(item.key, !selectedKeys.includes(item.key), e);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onRemove = (item: RecordType) => {
|
const onRemove = (item: KeyWiseTransferItem) => {
|
||||||
onItemRemove?.([item.key]);
|
onItemRemove?.([item.key]);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -130,8 +130,8 @@ const TransferListBody: React.ForwardRefRenderFunction<
|
|||||||
renderedEl={renderedEl}
|
renderedEl={renderedEl}
|
||||||
prefixCls={prefixCls}
|
prefixCls={prefixCls}
|
||||||
showRemove={showRemove}
|
showRemove={showRemove}
|
||||||
onClick={onInternalClick as any}
|
onClick={onInternalClick}
|
||||||
onRemove={onRemove as any}
|
onRemove={onRemove}
|
||||||
checked={selectedKeys.includes(item.key)}
|
checked={selectedKeys.includes(item.key)}
|
||||||
disabled={globalDisabled || item.disabled}
|
disabled={globalDisabled || item.disabled}
|
||||||
/>
|
/>
|
||||||
|
@ -203,7 +203,7 @@ const TransferList = <RecordType extends KeyWiseTransferItem>(
|
|||||||
<div className={`${prefixCls}-body-search-wrapper`}>
|
<div className={`${prefixCls}-body-search-wrapper`}>
|
||||||
<Search
|
<Search
|
||||||
prefixCls={`${prefixCls}-search`}
|
prefixCls={`${prefixCls}-search`}
|
||||||
onChange={internalHandleFilter as any}
|
onChange={internalHandleFilter}
|
||||||
handleClear={internalHandleClear}
|
handleClear={internalHandleClear}
|
||||||
placeholder={searchPlaceholder}
|
placeholder={searchPlaceholder}
|
||||||
value={filterValue}
|
value={filterValue}
|
||||||
|
@ -6,7 +6,7 @@ import Input from '../input';
|
|||||||
export interface TransferSearchProps {
|
export interface TransferSearchProps {
|
||||||
prefixCls?: string;
|
prefixCls?: string;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
onChange?: (e: React.FormEvent<HTMLElement>) => void;
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
||||||
handleClear?: () => void;
|
handleClear?: () => void;
|
||||||
value?: string;
|
value?: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user