import React from 'react'; import { ButtonProps } from '../Button'; /** * @author Hanz * @date 2021/11/8 下午3:07 * @description */ type GetContainer = string | HTMLElement | (() => HTMLElement) | false; type ILevelMove = number | [number, number]; export type IPlacement = 'left' | 'top' | 'right' | 'bottom'; export interface IOffsetStyle { width?: string | number; height?: string | number; } export interface DrawerProps { /** 类名 */ className?: string; /** 宽度 */ width?: string | number; /** 高度 */ height?: string | number; /** 可拖拽边线调整大小。请注意拖拽只可以增大抽屉尺寸,不可以减小!因为减小尺寸会失去设计时给出尺寸的意义 */ resizable?: boolean; /** 打开 */ open?: boolean; /** 默认打开 */ defaultOpen?: boolean; /** handler elemenet */ handler?: React.ReactElement | null | false; /** 抽屉的方向 */ placement?: IPlacement; /** 预设抽屉宽度(或高度), large 1000px, medium 630px, small 400px */ size?: 'small' | 'medium' | 'large' | 'auto'; /** 层级元素 */ level?: null | string | string[]; /** 层级移动值 */ levelMove?: ILevelMove | ((e: { target: HTMLElement; open: boolean; }) => ILevelMove); /** 层级动画时间 */ duration?: string; /** 层级动画曲线 */ ease?: string; /** 是否显示遮罩 */ showMask?: boolean; /** 点击遮罩是否可关闭 */ maskClosable?: boolean; /** 遮罩样式 */ maskStyle?: React.CSSProperties; style?: React.CSSProperties; /** 变化时回调 */ onChange?: (open: boolean) => void; /** transition end 回调 */ afterVisibleChange?: (open: boolean) => void; /** handle 点击*/ onHandleClick?: (event: React.MouseEvent | React.KeyboardEvent) => void; /** 关闭时回调 */ onClose?: (event: React.MouseEvent | React.KeyboardEvent) => void; /** 是否支持键盘 esc 关闭 */ keyboard?: boolean; /** 内容包裹样式 */ contentWrapperStyle?: React.CSSProperties; /** 是否获得焦点 */ autoFocus?: boolean; /** 包裹类名 */ wrapperClassName?: string; /** 预渲染 Drawer 内元素 */ forceRender?: boolean; /** 获得挂载节点 */ getContainer?: GetContainer; /** 关闭时销毁 */ destroyOnClose?: boolean; /** 标题 */ title?: React.ReactNode; /** 抽屉右上角的操作区域 */ extra?: React.ReactNode; /** 抽屉底部区域 */ footer?: React.ReactNode; /** 是否显示右上角的操作区域 默认true */ showExtra?: boolean; /** 内容节点 */ children?: React.ReactNode; /** 确定回调 */ onOk?: () => void; /** 取消回调 */ onCancel?: () => void; /** 确定按钮属性*/ okButtonProps?: ButtonProps; /** 取消按钮属性*/ cancelButtonProps?: ButtonProps; /** 设置多层抽屉的推动行为 默认值 { distance: 100 }*/ push?: boolean | { distance: string | number; }; [name: string]: any; } export {};