2017-12-13 23:23:38 +08:00
|
|
|
import * as React from 'react';
|
|
|
|
import RcCollapse from 'rc-collapse';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
|
|
|
export interface CollapsePanelProps {
|
|
|
|
key: string;
|
|
|
|
header: React.ReactNode;
|
|
|
|
disabled?: boolean;
|
|
|
|
className?: string;
|
|
|
|
style?: React.CSSProperties;
|
|
|
|
showArrow?: boolean;
|
|
|
|
prefixCls?: string;
|
2018-01-31 10:44:33 +08:00
|
|
|
forceRender?: boolean;
|
2018-11-04 16:09:51 +08:00
|
|
|
id?: string;
|
2017-12-13 23:23:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export default class CollapsePanel extends React.Component<CollapsePanelProps, {}> {
|
|
|
|
render() {
|
|
|
|
const { prefixCls, className = '', showArrow = true } = this.props;
|
|
|
|
const collapsePanelClassName = classNames({
|
|
|
|
[`${prefixCls}-no-arrow`]: !showArrow,
|
|
|
|
}, className);
|
|
|
|
return <RcCollapse.Panel {...this.props} className={collapsePanelClassName} />;
|
|
|
|
}
|
|
|
|
}
|