|
|
|
import {
|
|
|
|
GetRowKey,
|
|
|
|
ColumnType as RcColumnType,
|
|
|
|
RenderedCell as RcRenderedCell,
|
|
|
|
ExpandableConfig,
|
|
|
|
} from 'rc-table/lib/interface';
|
|
|
|
import { CheckboxProps } from '../checkbox';
|
|
|
|
import { PaginationConfig } from '../pagination';
|
|
|
|
|
|
|
|
export { GetRowKey, ExpandableConfig };
|
|
|
|
|
|
|
|
export type Key = React.Key;
|
|
|
|
|
|
|
|
export type RowSelectionType = 'checkbox' | 'radio';
|
|
|
|
|
|
|
|
export type SelectionItemSelectFn = (currentRowKeys: Key[]) => void;
|
|
|
|
|
|
|
|
export type ExpandType = null | 'row' | 'nest';
|
|
|
|
|
|
|
|
export interface TableLocale {
|
|
|
|
filterTitle?: string;
|
|
|
|
filterConfirm?: React.ReactNode;
|
|
|
|
filterReset?: React.ReactNode;
|
|
|
|
emptyText?: React.ReactNode | (() => React.ReactNode);
|
|
|
|
selectAll?: React.ReactNode;
|
|
|
|
selectInvert?: React.ReactNode;
|
|
|
|
selectionAll?: React.ReactNode;
|
|
|
|
sortTitle?: string;
|
|
|
|
expand?: string;
|
|
|
|
collapse?: string;
|
|
|
|
triggerDesc?: string;
|
|
|
|
triggerAsc?: string;
|
|
|
|
cancelSort?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type SortOrder = 'descend' | 'ascend' | null;
|
|
|
|
|
|
|
|
export type CompareFn<T> = (a: T, b: T, sortOrder?: SortOrder) => number;
|
|
|
|
|
|
|
|
export interface ColumnFilterItem {
|
|
|
|
text: React.ReactNode;
|
|
|
|
value: string | number | boolean;
|
|
|
|
children?: ColumnFilterItem[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ColumnTitleProps<RecordType> {
|
|
|
|
/** @deprecated Please use `sorterColumns` instead. */
|
|
|
|
sortOrder?: SortOrder;
|
|
|
|
/** @deprecated Please use `sorterColumns` instead. */
|
|
|
|
sortColumn?: ColumnType<RecordType>;
|
|
|
|
sortColumns?: { column: ColumnType<RecordType>; order: SortOrder }[];
|
|
|
|
|
|
|
|
filters?: Record<string, string[]>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ColumnTitle<RecordType> =
|
|
|
|
| React.ReactNode
|
|
|
|
| ((props: ColumnTitleProps<RecordType>) => React.ReactNode);
|
|
|
|
|
|
|
|
export interface FilterDropdownProps {
|
|
|
|
prefixCls: string;
|
|
|
|
setSelectedKeys: (selectedKeys: string[]) => void;
|
|
|
|
selectedKeys: React.Key[];
|
|
|
|
confirm: () => void;
|
|
|
|
clearFilters?: () => void;
|
|
|
|
filters?: ColumnFilterItem[];
|
|
|
|
visible: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
|