fix filterDropdown type

This commit is contained in:
afc163 2019-05-07 11:53:08 +08:00
parent b41f9d6b00
commit 969c171da1
No known key found for this signature in database
GPG Key ID: 738F973FCE5C6B48
2 changed files with 12 additions and 2 deletions

View File

@ -261,7 +261,7 @@ class FilterMenu<T> extends React.Component<FilterMenuProps<T>, FilterMenuState<
confirm: this.handleConfirm,
clearFilters: this.handleClearFilters,
filters: column.filters,
getPopupContainer: (triggerNode: HTMLElement) => triggerNode.parentNode,
getPopupContainer: (triggerNode: HTMLElement) => triggerNode.parentNode as HTMLElement,
});
}

View File

@ -13,6 +13,16 @@ export type ColumnFilterItem = {
children?: ColumnFilterItem[];
};
export interface FilterDropdownProps {
prefixCls?: string;
setSelectedKeys?: (selectedKeys: string[]) => void;
selectedKeys?: string[];
confirm?: () => void;
clearFilters?: (selectedKeys: string[]) => void;
filters?: ColumnFilterItem[];
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
}
export interface ColumnProps<T> {
title?:
| React.ReactNode
@ -24,7 +34,7 @@ export interface ColumnProps<T> {
filters?: ColumnFilterItem[];
onFilter?: (value: any, record: T) => boolean;
filterMultiple?: boolean;
filterDropdown?: React.ReactNode | ((props: Object) => React.ReactNode);
filterDropdown?: React.ReactNode | ((props: FilterDropdownProps) => React.ReactNode);
filterDropdownVisible?: boolean;
onFilterDropdownVisibleChange?: (visible: boolean) => void;
sorter?: boolean | CompareFn<T>;