1 | import * as React from 'react';
|
2 | import { OverridableComponent, OverrideProps } from '../OverridableComponent';
|
3 | import { Omit } from '@material-ui/types';
|
4 | import { TablePaginationActionsProps } from './TablePaginationActions';
|
5 | import { TableCellProps } from '../TableCell';
|
6 | import { IconButtonProps } from '../IconButton';
|
7 | import { SelectProps } from '../Select';
|
8 |
|
9 | export interface LabelDisplayedRowsArgs {
|
10 | from: number;
|
11 | to: number;
|
12 | count: number;
|
13 | page: number;
|
14 | }
|
15 |
|
16 | export interface TablePaginationTypeMap<P, D extends React.ElementType> {
|
17 | props: P &
|
18 | TablePaginationBaseProps & {
|
19 | ActionsComponent?: React.ElementType<TablePaginationActionsProps>;
|
20 | backIconButtonProps?: Partial<IconButtonProps>;
|
21 | count: number;
|
22 | labelDisplayedRows?: (paginationInfo: LabelDisplayedRowsArgs) => React.ReactNode;
|
23 | labelRowsPerPage?: React.ReactNode;
|
24 | nextIconButtonProps?: Partial<IconButtonProps>;
|
25 | onChangePage: (event: React.MouseEvent<HTMLButtonElement> | null, page: number) => void;
|
26 | onChangeRowsPerPage?: React.ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;
|
27 | page: number;
|
28 | rowsPerPage: number;
|
29 | rowsPerPageOptions?: Array<number | { value: number; label: string }>;
|
30 | SelectProps?: Partial<SelectProps>;
|
31 | };
|
32 | defaultComponent: D;
|
33 | classKey: TablePaginationClassKey;
|
34 | }
|
35 |
|
36 | declare const TablePagination: OverridableComponent<
|
37 | TablePaginationTypeMap<{}, React.ComponentType<TablePaginationBaseProps>>
|
38 | >;
|
39 |
|
40 | export type TablePaginationClassKey =
|
41 | | 'root'
|
42 | | 'toolbar'
|
43 | | 'spacer'
|
44 | | 'menuItem'
|
45 | | 'caption'
|
46 | | 'input'
|
47 | | 'selectRoot'
|
48 | | 'select'
|
49 | | 'selectIcon'
|
50 | | 'actions';
|
51 |
|
52 | export type TablePaginationBaseProps = Omit<TableCellProps, 'classes' | 'component'>;
|
53 |
|
54 | export type TablePaginationProps<
|
55 | D extends React.ElementType = React.ComponentType<TablePaginationBaseProps>,
|
56 | P = {}
|
57 | > = OverrideProps<TablePaginationTypeMap<P, D>, D>;
|
58 |
|
59 | export default TablePagination;
|