import { ReactNode, CSSProperties } from 'react'; import { ButtonProps } from '../button'; import { ConfirmProps } from './confirm'; import { type SizeType } from '../config-provider'; /** * @title Modal */ export interface ModalProps { style?: CSSProperties; className?: string | string[]; size?: SizeType | 'xl' | 'xxl' | 'sm' | 'md' | 'lg' | 'full'; /** * 关闭弹出框的回调 */ onCancel?: () => void; /** * 点击确认按钮的回调 */ onOk?: (e?: Event) => Promise | void; /** * 指定弹出框挂载的父节点 * @defaultValue () => document.body */ getPopupContainer?: () => Element; /** * 对话框里的弹出框 `Select` `Tooltip` 等挂载的容器,默认挂载在对话框内。 */ getChildrenPopupContainer?: (node: HTMLElement) => Element; /** * 弹出框的标题 * @en The title of Modal */ title?: string | ReactNode; /** * 弹出框是否可见 * @en Whether the Modal is visible */ visible?: boolean; /** * 是否显示遮罩 * @defaultValue true */ mask?: boolean; /** * @zh * 简洁模式的样式,没有分割线,底部按钮居中显示。默认通过方法调用的提示类型的弹窗会展示`simple`样式。设置为true时,默认不显示右上角关闭图标 */ simple?: boolean; /** * 确认按钮文案 */ okText?: ReactNode; /** * 取消按钮文案 */ cancelText?: ReactNode; /** * 确认按钮的 props */ okButtonProps?: ButtonProps; /** * 取消按钮的 props */ cancelButtonProps?: ButtonProps; /** * 自定义页脚,传入 null 则不显示 */ footer?: ReactNode | ((cancelButtonNode: ReactNode, okButtonNode: ReactNode) => ReactNode); /** * 是否显示右上角的关闭按钮 */ closable?: boolean; /** * 自定义右上角的关闭按钮节点 */ closeIcon?: ReactNode; /** * 点击蒙层是否可以关闭 * @defaultValue true */ maskClosable?: boolean; /** * 蒙层的样式 */ maskStyle?: CSSProperties; /** * 弹框打开之后的回调 */ afterOpen?: () => void; /** * 弹框关闭之后的回调 */ afterClose?: () => void; /** * 确认按钮加载中 */ confirmLoading?: boolean; /** * 是否在初次打开对话框时才渲染 dom * @defaultValue true */ mountOnEnter?: boolean; /** * 是否在隐藏之后销毁DOM结构 * @defaultValue true */ unmountOnExit?: boolean; /** * 按 `ESC` 键关闭 * @defaultValue true */ escToExit?: boolean; /** * 弹出框垂直水平居中 * @defaultValue true */ alignCenter?: boolean; /** * @en The class of the wrapped dom */ wrapClassName?: string | string[]; /** * 弹出框外层样式 */ wrapStyle?: CSSProperties; hideCancel?: boolean; /** * 是否默认聚焦第一个可聚焦元素,只在 `focusLock` 开启时生效。 * @defaultValue false */ autoFocus?: boolean; /** * 是否将焦点锁定在弹出框内 * @defaultValue false */ focusLock?: boolean; /** * 是否全屏 * @defaultValue false */ fullScreen?: boolean; /** * 高度100% * @defaultValue false */ fullScreenH?: boolean; /** * 自定义渲染对话框 */ modalRender?: (modalNode: ReactNode) => ReactNode; prefixCls?: string; } export declare type ModalReturnProps = { update: Function; close: Function; }; declare type modalHookFunction = (config: ConfirmProps) => { close: () => void; update: (config: ConfirmProps) => void; }; export declare type ModalHookReturnType = { confirm?: modalHookFunction; info?: modalHookFunction; success?: modalHookFunction; warning?: modalHookFunction; error?: modalHookFunction; }; export {};