Browse Source

fix: titles of TransferProps type to ReactNode (#28326)

pull/28326/merge
Jack 4 years ago
committed by GitHub
parent
commit
e6254885bd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      components/transfer/index.tsx
  2. 2
      components/transfer/list.tsx

6
components/transfer/index.tsx

@ -46,7 +46,7 @@ export type SelectAllLabel =
| ((info: { selectedCount: number; totalCount: number }) => React.ReactNode); | ((info: { selectedCount: number; totalCount: number }) => React.ReactNode);
export interface TransferLocale { export interface TransferLocale {
titles: string[]; titles: React.ReactNode[];
notFoundContent?: React.ReactNode; notFoundContent?: React.ReactNode;
searchPlaceholder: string; searchPlaceholder: string;
itemUnit: string; itemUnit: string;
@ -72,7 +72,7 @@ export interface TransferProps<RecordType> {
style?: React.CSSProperties; style?: React.CSSProperties;
listStyle: ((style: ListStyle) => React.CSSProperties) | React.CSSProperties; listStyle: ((style: ListStyle) => React.CSSProperties) | React.CSSProperties;
operationStyle?: React.CSSProperties; operationStyle?: React.CSSProperties;
titles?: string[]; titles?: React.ReactNode[];
operations?: string[]; operations?: string[];
showSearch?: boolean; showSearch?: boolean;
filterOption?: (inputValue: string, item: RecordType) => boolean; filterOption?: (inputValue: string, item: RecordType) => boolean;
@ -164,7 +164,7 @@ class Transfer<RecordType extends TransferItem = TransferItem> extends React.Com
} }
}; };
getTitles(transferLocale: TransferLocale): string[] { getTitles(transferLocale: TransferLocale): React.ReactNode[] {
const { titles } = this.props; const { titles } = this.props;
if (titles) { if (titles) {
return titles; return titles;

2
components/transfer/list.tsx

@ -42,7 +42,7 @@ type RenderListFunction<T> = (props: TransferListBodyProps<T>) => React.ReactNod
export interface TransferListProps<RecordType> extends TransferLocale { export interface TransferListProps<RecordType> extends TransferLocale {
prefixCls: string; prefixCls: string;
titleText: string; titleText: React.ReactNode;
dataSource: RecordType[]; dataSource: RecordType[];
filterOption?: (filterText: string, item: RecordType) => boolean; filterOption?: (filterText: string, item: RecordType) => boolean;
style?: React.CSSProperties; style?: React.CSSProperties;

Loading…
Cancel
Save