UNPKG

choerodon-ui

Version:

An enterprise-class UI design language and React-based implementation

80 lines (79 loc) 2.55 kB
import React, { Component, ReactNode } from 'react'; import { SpinProps } from '../spin'; import { Size } from '../_util/enum'; import { PaginationProps } from '../pagination'; import Item from './Item'; import ConfigContext, { ConfigContextValue } from '../config-provider/ConfigContext'; export { ListItemProps, ListItemMetaProps } from './Item'; export declare type ColumnCount = 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24; export declare type ColumnType = 'gutter' | 'column' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'; export interface ListGridType { gutter?: number; column?: ColumnCount; xs?: ColumnCount; sm?: ColumnCount; md?: ColumnCount; lg?: ColumnCount; xl?: ColumnCount; xxl?: ColumnCount; } export interface ListProps { bordered?: boolean; className?: string; children?: ReactNode; dataSource: any; extra?: ReactNode; grid?: ListGridType; id?: string; itemLayout?: string; loading?: boolean | SpinProps; loadMore?: ReactNode; paginationProps?: PaginationProps; pagination?: any; prefixCls?: string; rowPrefixCls?: string; spinPrefixCls?: string; rowKey?: any; renderItem: any; size?: Size; split?: boolean; header?: ReactNode; footer?: ReactNode; empty?: ReactNode; locale?: Record<string, any>; } export interface ListLocale { emptyText: string; } export default class List extends Component<ListProps> { static displayName: string; static Item: typeof Item; static get contextType(): typeof ConfigContext; static defaultProps: { dataSource: never[]; bordered: boolean; split: boolean; loading: boolean; pagination: boolean; }; context: ConfigContextValue; state: { paginationCurrent: number; }; defaultPaginationProps: { current: number; pageSize: number; onChange: (page: number, pageSize: number) => void; total: number; }; private keys; getContextValue(): { grid: ListGridType | undefined; getPrefixCls: typeof import("../configure").getPrefixCls; }; renderItem: (item: React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>, index: number) => any; isSomethingAfterLastItem(): boolean; renderEmpty: (contextLocale: ListLocale) => JSX.Element; getPrefixCls(): string; render(): JSX.Element; }