acud
Version:
acg react 组件库
59 lines (58 loc) • 2.05 kB
TypeScript
import * as React from 'react';
import { ButtonProps } from '../button';
import { IDialogPropTypes } from 'rc-dialog/lib/IDialogPropTypes';
declare enum SizeType {
'small' = "sm",
'normal' = "md",
'large' = "lg",
'extraLarge' = "xl"
}
export interface ModalProps extends Omit<IDialogPropTypes, 'mousePosition' | 'onClose' | 'transitionName' | 'maskTransitionName' | 'width'> {
prefixCls?: string;
/** 弹框是否可见 */
visible?: boolean;
/** 弹框大小 */
size?: keyof typeof SizeType;
/** 确定按钮 loading */
confirmLoading?: boolean;
/** 弹框标题 */
title?: React.ReactNode;
/** 确认按钮 props */
okButtonProps?: ButtonProps;
/** 点击确定回调 */
onOk?: (e: React.MouseEvent<HTMLElement>) => void;
/** 取消按钮 props */
cancelButtonProps?: ButtonProps;
/** 点击模态框右上角叉、取消按钮、Props.maskClosable 值为 true 时的遮罩层或键盘按下 Esc 时的回调 */
onCancel?: (e: React.MouseEvent<HTMLElement>) => void;
afterClose?: () => void;
/** 弹框宽度 */
width?: string | number;
/** 底部内容 */
footer?: React.ReactNode;
/** 确认按钮文字 */
okText?: string;
/** 取消按钮文字 */
cancelText?: string;
/** 点击蒙层是否允许关闭 */
maskClosable?: boolean;
/** 是否强制渲染 Modal */
forceRender?: boolean;
/** 关闭时是否销毁 Modal 里的子元素 */
destroyOnClose?: boolean;
style?: React.CSSProperties;
className?: string;
/** 指定Modal挂载的html节点 */
getContainer?: string | HTMLElement | (() => HTMLElement) | false | null;
/** 设置 Modal 的 z-index */
zIndex?: number;
/** 是否支持键盘 esc 关闭 */
keyboard?: boolean;
/** 自定义关闭图标 */
closeIcon?: React.ReactNode;
/** 是否显示右上角的关闭按钮 */
closable?: boolean;
children?: React.ReactNode;
}
declare const Modal: React.FC<ModalProps>;
export default Modal;