import { MouseEvent, ReactNode, CSSProperties } from 'react'; import { EventListenerHandler } from '@befe/brick-utils'; import { ConfiguredComponent, BaseSize, 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; } /** * @docgen-skip */ export declare class BaseDialog extends ConfiguredComponent { static displayName: string; static defaultProps: DialogProps; componentLocale: import("@befe/brick-core").ComponentLocale<{ en_us: { confirm: string; cancel: string; }; zh_cn: { confirm: string; cancel: string; }; }>; resizeListener: EventListenerHandler | null; get className(): string; get size(): BaseSize; get closeXSize(): "md" | "lg"; get withCloseX(): boolean; get actionsAlign(): "right" | "center" | "left"; get modalProps(): { className: string; onClickMask: ((e: MouseEvent) => void | Promise | undefined) | undefined; } & Omit & Readonly<{ children?: ReactNode; }>, "className" | "size" | "width" | "headline" | "headDivide" | "confirmLabel" | "confirmDisabled" | "cancelLabel" | "actions" | "maskCancel" | "actionsAlign" | "minHeight" | "topDistance" | "withCloseX" | "withCancel" | "centered" | "onConfirm" | "onCancel">; get childrenArray(): (import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal)[]; get confirmLabel(): string | Props["confirmLabel"]; get cancelLabel(): string | Props["cancelLabel"]; get minHeight(): number; get maxHeight(): number; get topDistance(): number; get wrapStyle(): CSSProperties | undefined; handleClickConfirm: (e: MouseEvent) => void | Promise | undefined; handleClickCancel: (e: MouseEvent) => void | Promise | undefined; getClassName(): string; getModalProps(): { className: string; onClickMask: ((e: MouseEvent) => void | Promise | undefined) | undefined; } & Omit & Readonly<{ children?: ReactNode; }>, "className" | "size" | "width" | "headline" | "headDivide" | "confirmLabel" | "confirmDisabled" | "cancelLabel" | "actions" | "maskCancel" | "actionsAlign" | "minHeight" | "topDistance" | "withCloseX" | "withCancel" | "centered" | "onConfirm" | "onCancel">; renderCloseX(): import("react/jsx-runtime").JSX.Element | null; renderHead(): import("react/jsx-runtime").JSX.Element; renderBody(): import("react/jsx-runtime").JSX.Element | null; renderActions(): import("react/jsx-runtime").JSX.Element | Props["actions"]; renderFoot(): import("react/jsx-runtime").JSX.Element; componentDidMount(): void; componentWillUnmount(): void; render(): import("react/jsx-runtime").JSX.Element; } export declare class Dialog extends BaseDialog { static defaultProps: DialogProps; } export {};