mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 13:09:40 +08:00
a307a7acf7
* remove unnecessary computed props for classNames * rollback autocomplete optimization for possible css style order issue * update snapshots * remove more unnecessary computed props at Input
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
import RcCollapse from 'rc-collapse';
|
|
import classNames from 'classnames';
|
|
|
|
export interface CollapseProps {
|
|
activeKey?: Array<string> | string;
|
|
defaultActiveKey?: Array<string>;
|
|
/** 手风琴效果 */
|
|
accordion?: boolean;
|
|
onChange?: (key: string) => void;
|
|
style?: React.CSSProperties;
|
|
className?: string;
|
|
bordered?: boolean;
|
|
prefixCls?: string;
|
|
}
|
|
|
|
export interface CollapsePanelProps {
|
|
key: string;
|
|
header: React.ReactNode;
|
|
style?: React.CSSProperties;
|
|
className?: string;
|
|
}
|
|
|
|
export class CollapsePanel extends React.Component<CollapsePanelProps, {}> {
|
|
}
|
|
|
|
export default class Collapse extends React.Component<CollapseProps, any> {
|
|
static Panel: typeof CollapsePanel = RcCollapse.Panel;
|
|
|
|
static defaultProps = {
|
|
prefixCls: 'ant-collapse',
|
|
bordered: true,
|
|
};
|
|
|
|
render() {
|
|
const { prefixCls, className = '', bordered } = this.props;
|
|
const collapseClassName = classNames({
|
|
[`${prefixCls}-borderless`]: !bordered,
|
|
}, className);
|
|
return <RcCollapse {...this.props} className={collapseClassName} />;
|
|
}
|
|
}
|