Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

feat(dialog): add property to control whether click mask to close to … (#3020)

VicKun882086247352
diff --git a/packages/design/src/components/dialog/Dialog.tsx b/packages/design/src/components/dialog/Dialog.tsx
index 8dcab84345..5f238f9e84 100644
--- a/packages/design/src/components/dialog/Dialog.tsx
+++ b/packages/design/src/components/dialog/Dialog.tsx
@@ -92,6 +92,10 @@ export interface IDialogProps {
* Whether the dialog should show a mask.
*/
mask?: boolean;
+
+ /**
+ * additional className for dialog
+ */
className?: string;
/**
@@ -100,9 +104,14 @@ export interface IDialogProps {
dialogStyles?: ModalStyles;
/**
- *
+ * whether show close button
*/
closable?: boolean;
+
+ /**
+ * whether click mask to close, default is true
+ */
+ maskClosable?: boolean;
}
export function Dialog(props: IDialogProps) {
@@ -123,6 +132,7 @@ export function Dialog(props: IDialogProps) {
mask,
dialogStyles,
closable,
+ maskClosable,
} = props;
const [dragDisabled, setDragDisabled] = useState(false);
const [positionOffset, setPositionOffset] = useState<{ x: number; y: number } | null>(null);
@@ -223,6 +233,7 @@ export function Dialog(props: IDialogProps) {
onClose={onClose}
styles={dialogStyles}
closable={closable}
+ maskClosable={maskClosable}
>
{children}
</RcDialog>