UNPKG

choerodon-ui

Version:

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

62 lines (61 loc) 1.93 kB
import React, { Component, CSSProperties, MouseEventHandler, ReactNode } from 'react'; import Grid from './Grid'; import Meta from './Meta'; import { TabsProps } from '../tabs'; import ConfigContext, { ConfigContextValue } from '../config-provider/ConfigContext'; export { CardGridProps } from './Grid'; export { CardMetaProps } from './Meta'; export declare type CardType = 'inner'; export interface CardTabListType { key: string; tab: ReactNode; disabled?: boolean; } export interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> { prefixCls?: string; title?: ReactNode; extra?: ReactNode; bordered?: boolean; bodyStyle?: CSSProperties; style?: CSSProperties; loading?: boolean; noHovering?: boolean; hoverable?: boolean; children?: ReactNode; id?: string; className?: string; type?: CardType; cover?: ReactNode; actions?: ReactNode[]; tabList?: CardTabListType[]; onTabChange?: (key: string) => void; onHeadClick?: MouseEventHandler<any>; activeTabKey?: string; defaultActiveTabKey?: string; tabsProps?: TabsProps; } export interface CardState { widerPadding: boolean; } export default class Card extends Component<CardProps, CardState> { static displayName: string; static get contextType(): typeof ConfigContext; static Grid: typeof Grid; static Meta: typeof Meta; context: ConfigContextValue; private resizeEvent; private updateWiderPaddingCalled; state: { widerPadding: boolean; }; private container; componentDidMount(): void; componentWillUnmount(): void; updateWiderPadding(): void; onTabChange: (key: string) => void; saveRef: (node: HTMLDivElement) => void; isContainGrid(): boolean; getAction(actions: ReactNode[]): JSX.Element[] | null; getCompatibleHoverable(): boolean | undefined; render(): JSX.Element; }