UNPKG

zent

Version:

一套前端设计语言和基于React的实现

36 lines (35 loc) 1.34 kB
import { Component } from 'react'; import { PaginationLayout } from '../layout/type'; import { IPopProps } from '../../pop'; export declare type PaginationChangeHandler = (detail: { current: number; pageSize: number; }) => any; export interface IBasePaginationProps { current: number; pageSize: number; total?: number; formatTotal?: (total: number) => React.ReactNode; onChange: PaginationChangeHandler; lastPageHelp?: IPopProps; totalItem?: number; className?: string; } export interface IPaginationLayoutOptions { current: number; total: number; pageSize: number; } export declare type PaginationLayoutFunction = (options: IPaginationLayoutOptions) => PaginationLayout[]; export declare abstract class BasePagination<IProps extends IBasePaginationProps> extends Component<IProps> { abstract readonly name: string; abstract readonly layoutFn: PaginationLayoutFunction; getLayout: (props: IProps) => PaginationLayout[]; shouldUpdateLayout(props: IProps, nextProps: IProps): boolean; getLayoutOptions(props: IProps): IPaginationLayoutOptions; onPageChange: (page: number) => void; onPageSizeChange: (pageSize: number) => void; getTotalPages(total: number, pageSize: number): number; getTotal(props?: IProps): number; } export default BasePagination;