Files
KnowStreaming/kafka-manager-console/src/constants/table.ts
2020-09-28 15:46:34 +08:00

36 lines
1001 B
TypeScript

import { PaginationConfig } from 'component/antd';
export const pagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: ['10', '20', '50', '100', '200', '500'],
showTotal: (total) => `${total}`,
};
export const customPagination: PaginationConfig = {
position: 'bottom',
showQuickJumper: true,
showSizeChanger: true,
showTotal: (total) => `${total}`,
};
export const cellStyle = {
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
};
export const searchProps = {
optionFilterProp: 'children',
showSearch: true,
filterOption: (input: any, option: any) => {
if ( typeof option.props.children === 'object' ) {
const { props } = option.props.children as any;
return (props.children + '').toLowerCase().indexOf(input.toLowerCase()) >= 0;
}
return (option.props.children + '').toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
};