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]); }, [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}
/> />

View File

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

View File

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