Merge pull request #1220 from 2betop/master

Panel 支持更多的 className 配置
This commit is contained in:
RickCole 2020-12-21 19:06:15 +08:00 committed by GitHub
commit da4aa7d8ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 2 deletions

View File

@ -1346,6 +1346,7 @@ export default class Form extends React.Component<FormProps, object> {
panelClassName, panelClassName,
headerClassName, headerClassName,
footerClassName, footerClassName,
footerWrapClassName,
actionsClassName, actionsClassName,
bodyClassName, bodyClassName,
classnames: cx, classnames: cx,
@ -1378,6 +1379,7 @@ export default class Form extends React.Component<FormProps, object> {
headerClassName, headerClassName,
footer, footer,
footerClassName, footerClassName,
footerWrapClassName,
actionsClassName, actionsClassName,
bodyClassName, bodyClassName,
affixFooter affixFooter

View File

@ -52,6 +52,11 @@ export interface PanelSchema extends BaseSchema {
*/ */
footerClassName?: SchemaClassName; footerClassName?: SchemaClassName;
/**
* footer actions div
*/
footerWrapClassName?: SchemaClassName;
/** /**
* , title * , title
*/ */
@ -80,6 +85,7 @@ export default class Panel extends React.Component<PanelProps> {
'header', 'header',
'headerClassName', 'headerClassName',
'footerClassName', 'footerClassName',
'footerWrapClassName',
'actionsClassName', 'actionsClassName',
'bodyClassName' 'bodyClassName'
]; ];
@ -210,6 +216,7 @@ export default class Panel extends React.Component<PanelProps> {
headerClassName, headerClassName,
actionsClassName, actionsClassName,
footerClassName, footerClassName,
footerWrapClassName,
children, children,
title, title,
footer, footer,
@ -244,7 +251,12 @@ export default class Panel extends React.Component<PanelProps> {
); );
let footerDom = footerDoms.length ? ( let footerDom = footerDoms.length ? (
<div ref={this.footerDom}>{footerDoms}</div> <div
className={cx('Panel-footerWrap', footerWrapClassName)}
ref={this.footerDom}
>
{footerDoms}
</div>
) : null; ) : null;
return ( return (
@ -268,7 +280,13 @@ export default class Panel extends React.Component<PanelProps> {
{footerDom} {footerDom}
{affixFooter && footerDoms.length ? ( {affixFooter && footerDoms.length ? (
<div ref={this.affixDom} className={cx('Panel-fixedBottom')}> <div
ref={this.affixDom}
className={cx(
'Panel-fixedBottom Panel-footerWrap',
footerWrapClassName
)}
>
{footerDoms} {footerDoms}
</div> </div>
) : null} ) : null}