|
@@ -5,6 +5,7 @@ import { cssClasses } from '@douyinfe/semi-foundation/sideSheet/constants';
|
|
import Button from '../iconButton';
|
|
import Button from '../iconButton';
|
|
import { noop } from 'lodash';
|
|
import { noop } from 'lodash';
|
|
import { IconClose } from '@douyinfe/semi-icons';
|
|
import { IconClose } from '@douyinfe/semi-icons';
|
|
|
|
+import { SideSheetProps } from "@douyinfe/semi-foundation/sideSheet/sideSheetFoundation";
|
|
|
|
|
|
let uuid = 0;
|
|
let uuid = 0;
|
|
const prefixCls = cssClasses.PREFIX;
|
|
const prefixCls = cssClasses.PREFIX;
|
|
@@ -19,17 +20,18 @@ export interface SideSheetContentProps {
|
|
title?: React.ReactNode;
|
|
title?: React.ReactNode;
|
|
closable?: boolean;
|
|
closable?: boolean;
|
|
headerStyle?: CSSProperties;
|
|
headerStyle?: CSSProperties;
|
|
- width: CSSProperties['width'];
|
|
|
|
|
|
+ width?: CSSProperties['width'];
|
|
height: CSSProperties['height'];
|
|
height: CSSProperties['height'];
|
|
style: CSSProperties;
|
|
style: CSSProperties;
|
|
|
|
+ size: SideSheetProps['size'];
|
|
bodyStyle?: CSSProperties;
|
|
bodyStyle?: CSSProperties;
|
|
className: string;
|
|
className: string;
|
|
- dialogClassName?:string;
|
|
|
|
|
|
+ dialogClassName?: string;
|
|
children?: React.ReactNode;
|
|
children?: React.ReactNode;
|
|
footer?: React.ReactNode;
|
|
footer?: React.ReactNode;
|
|
'aria-label'?: string;
|
|
'aria-label'?: string;
|
|
- maskExtraProps?: {[key:string]: any};
|
|
|
|
- wrapperExtraProps?: {[key:string]: any}
|
|
|
|
|
|
+ maskExtraProps?: {[key: string]: any};
|
|
|
|
+ wrapperExtraProps?: {[key: string]: any}
|
|
}
|
|
}
|
|
|
|
|
|
export default class SideSheetContent extends React.PureComponent<SideSheetContentProps> {
|
|
export default class SideSheetContent extends React.PureComponent<SideSheetContentProps> {
|
|
@@ -138,7 +140,7 @@ export default class SideSheetContent extends React.PureComponent<SideSheetConte
|
|
key="dialog-element"
|
|
key="dialog-element"
|
|
role="dialog"
|
|
role="dialog"
|
|
tabIndex={-1}
|
|
tabIndex={-1}
|
|
- className={cls(`${prefixCls}-inner`, `${prefixCls}-inner-wrap`, this.props.dialogClassName??"")}
|
|
|
|
|
|
+ className={cls(`${prefixCls}-inner`, `${prefixCls}-inner-wrap`, this.props.dialogClassName??"", `${prefixCls}-size-${props.size}`)}
|
|
// onMouseDown={this.onDialogMouseDown}
|
|
// onMouseDown={this.onDialogMouseDown}
|
|
style={{ ...props.style, ...style }}
|
|
style={{ ...props.style, ...style }}
|
|
{...this.props.wrapperExtraProps}
|
|
{...this.props.wrapperExtraProps}
|
|
@@ -168,6 +170,7 @@ export default class SideSheetContent extends React.PureComponent<SideSheetConte
|
|
} = this.props;
|
|
} = this.props;
|
|
const wrapperCls = cls(className, {
|
|
const wrapperCls = cls(className, {
|
|
[`${prefixCls}-fixed`]: !mask,
|
|
[`${prefixCls}-fixed`]: !mask,
|
|
|
|
+ [`${prefixCls}-size-${this.props.size}`]: !mask
|
|
});
|
|
});
|
|
const wrapperStyle: CSSProperties = {};
|
|
const wrapperStyle: CSSProperties = {};
|
|
if (!mask && width) {
|
|
if (!mask && width) {
|