type: improve ts type for transfer (#50018)

* type: improve ts type for transfer

* revert as any

* fix type
This commit is contained in:
thinkasany 2024-07-25 18:58:06 +08:00 committed by GitHub
parent 902aa2e313
commit 02d331b60d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -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}
/>

View File

@ -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}

View File

@ -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;