40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
import * as React from 'react';
|
|
import CollapsePanel from './CollapsePanel';
|
|
import { ConfigConsumerProps } from '../config-provider';
|
|
export declare type ExpandIconPosition = 'left' | 'right';
|
|
export interface CollapseProps {
|
|
activeKey?: Array<string | number> | string | number;
|
|
defaultActiveKey?: Array<string | number> | string | number;
|
|
/** 手风琴效果 */
|
|
accordion?: boolean;
|
|
destroyInactivePanel?: boolean;
|
|
onChange?: (key: string | string[]) => void;
|
|
style?: React.CSSProperties;
|
|
className?: string;
|
|
bordered?: boolean;
|
|
prefixCls?: string;
|
|
expandIcon?: (panelProps: PanelProps) => React.ReactNode;
|
|
expandIconPosition?: ExpandIconPosition;
|
|
}
|
|
interface PanelProps {
|
|
isActive?: boolean;
|
|
header?: React.ReactNode;
|
|
className?: string;
|
|
style?: React.CSSProperties;
|
|
showArrow?: boolean;
|
|
forceRender?: boolean;
|
|
disabled?: boolean;
|
|
extra?: React.ReactNode;
|
|
}
|
|
export default class Collapse extends React.Component<CollapseProps, any> {
|
|
static Panel: typeof CollapsePanel;
|
|
static defaultProps: {
|
|
bordered: boolean;
|
|
expandIconPosition: "left" | "right" | undefined;
|
|
};
|
|
renderExpandIcon: (panelProps: PanelProps | undefined, prefixCls: string) => {} | null | undefined;
|
|
renderCollapse: ({ getPrefixCls, direction }: ConfigConsumerProps) => JSX.Element;
|
|
render(): JSX.Element;
|
|
}
|
|
export {};
|