import { MouseEvent, ReactNode, CSSProperties, PropsWithChildren } from 'react'; import { DialogActionsAlign } from '@befe/brick-core'; import { ModalProps } from '@befe/brick-comp-modal'; export type DialogAction = (e: MouseEvent) => void | Promise; type PropsFromModal = Omit; export declare const DIALOG_SIZES: readonly ["sm", "md"]; export declare const DIALOG_WIDTH_SIZES: readonly ["xs", "sm", "md", "lg", "xl"]; type WidthSize = (typeof DIALOG_WIDTH_SIZES)[number]; export interface BaseDialogProps { /** * 点击确认回调 */ onConfirm?: DialogAction; /** * 点击取消/关闭回调 */ onCancel?: DialogAction; } export interface DialogProps extends PropsFromModal, BaseDialogProps { /** * 自定义 class */ className?: string; /** * 尺寸 * * use config context `baseSize` as default */ size?: 'md' | 'sm'; /** * 宽度 */ width?: WidthSize | number; /** * 标题 */ headline?: ReactNode; /** * 是否使用 head 有分隔线的样式 */ headDivide?: boolean; /** * 自定义确认按钮文本 */ confirmLabel?: string; /** * 禁用确认按钮 */ confirmDisabled?: boolean; /** * 自定义取消按钮文本 */ cancelLabel?: string; /** * 自定义操作区 */ actions?: ReactNode; /** * 点击蒙层是否进行取消/关闭 */ maskCancel?: boolean; /** * 操作按钮的位置 * use config context `dialogActionsAlign` as default */ actionsAlign?: DialogActionsAlign; /** * @private * 最小高度,主要给 dialog-confirm 重载用 */ minHeight?: number; /** * @private */ maxHeight?: number; /** * @private */ topDistance?: number; /** * 是否有关闭小叉 */ withCloseX?: boolean; /** * 是否有取消按钮(以及关闭小叉),无取消关闭即 alert 信息确认 情景 */ withCancel?: boolean; /** * @private 暂不开放 * 是否居中 */ centered?: boolean; } /** * BaseDialog 的内部 override 能力,仅供同族组件(Drawer)定制渲染,不对外开放。 */ export interface BaseDialogOverrides { /** * @private 对基础 className 再加工(Drawer 追加 drawer 类) */ classNameTransform?: (baseClassName: string) => string; /** * @private 对基础 modalProps 再加工(Drawer 改 visible / withMaskEffect / onTransitionEnd) */ modalPropsTransform?: (baseModalProps: ModalProps) => ModalProps; /** * @private 直接指定 wrap 的 style(Drawer 用;指定后不再随窗口自适应、也不装 resize 监听) */ wrapStyleOverride?: CSSProperties; /** * @private 隐藏默认操作区(Drawer 无 actions 且无 onConfirm 时不渲染 foot) */ hideDefaultActions?: boolean; } type BaseDialogComponentProps = PropsWithChildren; /** * @docgen-skip */ export declare function BaseDialog(props: BaseDialogComponentProps): import("react/jsx-runtime").JSX.Element; export declare namespace BaseDialog { var displayName: string; } export declare function Dialog(props: PropsWithChildren): import("react/jsx-runtime").JSX.Element; export declare namespace Dialog { var displayName: string; } export {};