1 | import * as React from 'react';
|
2 | import type { ButtonProps, LegacyButtonType } from '../button/button';
|
3 | import type { DirectionType } from '../config-provider';
|
4 | type MousePosition = {
|
5 | x: number;
|
6 | y: number;
|
7 | } | null;
|
8 | export interface ModalProps {
|
9 |
|
10 | open?: boolean;
|
11 |
|
12 | confirmLoading?: boolean;
|
13 |
|
14 | title?: React.ReactNode;
|
15 |
|
16 | closable?: boolean;
|
17 |
|
18 | onOk?: (e: React.MouseEvent<HTMLElement>) => void;
|
19 |
|
20 | onCancel?: (e: React.MouseEvent<HTMLElement>) => void;
|
21 | afterClose?: () => void;
|
22 |
|
23 | centered?: boolean;
|
24 |
|
25 | width?: string | number;
|
26 |
|
27 | footer?: React.ReactNode;
|
28 |
|
29 | okText?: React.ReactNode;
|
30 |
|
31 | okType?: LegacyButtonType;
|
32 |
|
33 | cancelText?: React.ReactNode;
|
34 |
|
35 | maskClosable?: boolean;
|
36 |
|
37 | forceRender?: boolean;
|
38 | okButtonProps?: ButtonProps;
|
39 | cancelButtonProps?: ButtonProps;
|
40 | destroyOnClose?: boolean;
|
41 | style?: React.CSSProperties;
|
42 | wrapClassName?: string;
|
43 | maskTransitionName?: string;
|
44 | transitionName?: string;
|
45 | className?: string;
|
46 | getContainer?: string | HTMLElement | getContainerFunc | false;
|
47 | zIndex?: number;
|
48 | bodyStyle?: React.CSSProperties;
|
49 | maskStyle?: React.CSSProperties;
|
50 | mask?: boolean;
|
51 | keyboard?: boolean;
|
52 | wrapProps?: any;
|
53 | prefixCls?: string;
|
54 | closeIcon?: React.ReactNode;
|
55 | modalRender?: (node: React.ReactNode) => React.ReactNode;
|
56 | focusTriggerAfterClose?: boolean;
|
57 | children?: React.ReactNode;
|
58 | mousePosition?: MousePosition;
|
59 |
|
60 | visible?: boolean;
|
61 | }
|
62 | type getContainerFunc = () => HTMLElement;
|
63 | export interface ModalFuncProps {
|
64 | prefixCls?: string;
|
65 | className?: string;
|
66 | open?: boolean;
|
67 |
|
68 | visible?: boolean;
|
69 | title?: React.ReactNode;
|
70 | closable?: boolean;
|
71 | content?: React.ReactNode;
|
72 | onOk?: (...args: any[]) => any;
|
73 | onCancel?: (...args: any[]) => any;
|
74 | afterClose?: () => void;
|
75 | okButtonProps?: ButtonProps;
|
76 | cancelButtonProps?: ButtonProps;
|
77 | centered?: boolean;
|
78 | width?: string | number;
|
79 | okText?: React.ReactNode;
|
80 | okType?: LegacyButtonType;
|
81 | cancelText?: React.ReactNode;
|
82 | icon?: React.ReactNode;
|
83 | mask?: boolean;
|
84 | maskClosable?: boolean;
|
85 | zIndex?: number;
|
86 | okCancel?: boolean;
|
87 | style?: React.CSSProperties;
|
88 | wrapClassName?: string;
|
89 | maskStyle?: React.CSSProperties;
|
90 | type?: 'info' | 'success' | 'error' | 'warn' | 'warning' | 'confirm';
|
91 | keyboard?: boolean;
|
92 | getContainer?: string | HTMLElement | getContainerFunc | false;
|
93 | autoFocusButton?: null | 'ok' | 'cancel';
|
94 | transitionName?: string;
|
95 | maskTransitionName?: string;
|
96 | direction?: DirectionType;
|
97 | bodyStyle?: React.CSSProperties;
|
98 | closeIcon?: React.ReactNode;
|
99 | modalRender?: (node: React.ReactNode) => React.ReactNode;
|
100 | focusTriggerAfterClose?: boolean;
|
101 | }
|
102 | export interface ModalLocale {
|
103 | okText: string;
|
104 | cancelText: string;
|
105 | justOkText: string;
|
106 | }
|
107 | declare const Modal: React.FC<ModalProps>;
|
108 | export default Modal;
|