import React, { ReactNode } from 'react'; import { ButtonProps } from '../Button'; import { Confirm, ConfirmObject } from './Confirm'; import './index.scss'; type ModalSize = 'sm' | 'md' | 'lg' | 'auto' | 'fullScreen'; export interface ModalProps { /** 对话框是否可见 */ visible?: boolean; /** 打开 */ open?: boolean; /** 确定按钮 loading */ confirmLoading?: boolean; /** 标题 */ title?: ReactNode; /** 内容 */ children?: ReactNode; /** 对话框头部 */ header?: ReactNode; /** 隐藏对话框头部 */ hideHeader?: boolean; /** 底部操作栏 */ actions?: ((buttons: ReactNode[]) => ReactNode[]) | ReactNode; /** 底部内容 */ footer?: ((buttons: ReactNode[]) => ReactNode[]) | ReactNode; /** 是否显示actions */ showActions?: boolean; /** 显示取消按钮 */ showCancel?: boolean; /** 是否显示右上角的关闭按钮 */ closable?: boolean; /** 点击确定回调 */ onOk?: (e?: React.MouseEvent) => void; /** 点击模态框右上角叉、取消按钮,return false 不关闭 */ onCancel?: (e?: React.MouseEvent) => boolean | void; afterClose?: () => void; /** 大小 */ size?: ModalSize; /** 垂直居中 */ centered?: boolean; /** 宽度 */ width?: string | number; /** 确认按钮文字 */ okText?: ReactNode; /** 确认按钮类型 */ okType?: string; /** 取消按钮文字 */ cancelText?: ReactNode; /** 点击蒙层是否允许关闭 */ maskClosable?: boolean; disableBackdropClick?: boolean; /** 强制渲染 Modal */ forceRender?: boolean; /** 确定按钮属性 */ okButtonProps?: ButtonProps; /** 取消按钮属性 */ cancelButtonProps?: ButtonProps; /** 关闭时是否销毁 */ destroyOnClose?: boolean; /** style */ style?: React.CSSProperties; /** 包裹classname */ wrapClassName?: string; /** cls */ className?: string; /** 渲染容器 */ getContainer?: string | HTMLElement | (() => HTMLElement) | false; /** 设置z-index */ zIndex?: number; /** body样式 */ bodyStyle?: React.CSSProperties; /** mask样式 */ maskStyle?: React.CSSProperties; /** 是否显示遮罩 */ mask?: boolean; /** 是否支持键盘esc关闭 */ keyboard?: boolean; disableEscapeKeyDown?: boolean; /** 右上角关闭图标 */ closeIcon?: ReactNode; /** 自定义渲染对话框 */ modalRender?: (node: ReactNode) => ReactNode; /** 对话框关闭后是否需要聚焦触发元素 */ focusTriggerAfterClose?: boolean; /** 是否全屏 */ fullScreen?: boolean; /** 自定义大小 */ customizeSize?: React.CSSProperties; /** 内容宽度 */ contentWidth?: number | string; /** 内容高度 */ contentHeight?: number | string; /** 内容样式 */ contentStyle?: React.CSSProperties; [name: string]: any; } export declare const Modal: React.FC; export { Confirm }; export type { ConfirmObject }; export default Modal;