UNPKG

@cainiaofe/cn-ui-m

Version:
49 lines (48 loc) 1.21 kB
/// <reference types="react" /> import { NativeProps } from "../../../utils/with-native-props"; import { GetContainer } from './get-container'; import { PropagationEvent } from './propagation-event'; export type MaskProps = { visible?: boolean; /** * 点击蒙层时触发的回调函数 */ onMaskClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void; /** * 不可见时卸载内容 */ destroyOnClose?: boolean; /** * 强制渲染内容 */ forceRender?: boolean; /** * 阻止滚动 */ disableBodyScroll?: boolean; /** * 颜色 */ color?: 'black' | 'white'; /** * 透明度 */ opacity?: 'default' | 'thin' | 'thick' | number; /** * 指定挂载的 HTML 节点,默认为 body,如果为 null 的话,会渲染到当前节点 */ getContainer?: GetContainer; /** * 完全展示后触发 */ afterShow?: () => void; /** * 完全关闭后触发 */ afterClose?: () => void; /** * 阻止某些事件的冒泡 */ stopPropagation?: PropagationEvent[]; children?: React.ReactNode; } & NativeProps<'--z-index'>;