1 | import { CreateElement, VNode } from 'vue'
|
2 | import { VXETableComponent } from './component'
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export declare class Modal extends VXETableComponent {
|
8 | |
9 |
|
10 |
|
11 | value?: boolean;
|
12 | |
13 |
|
14 |
|
15 | id?: string;
|
16 | |
17 |
|
18 |
|
19 | type?: 'alert' | 'confirm' | 'message';
|
20 | |
21 |
|
22 |
|
23 | loading?: boolean;
|
24 | |
25 |
|
26 |
|
27 | status?: string;
|
28 | |
29 |
|
30 |
|
31 | iconStatus?: string;
|
32 | |
33 |
|
34 |
|
35 | top?: number | string;
|
36 | |
37 |
|
38 |
|
39 | position?: 'center' | {
|
40 | top?: number;
|
41 | left?: number;
|
42 | };
|
43 | |
44 |
|
45 |
|
46 | title?: string;
|
47 | |
48 |
|
49 |
|
50 | duration?: number | string;
|
51 | message?: string | number;
|
52 | |
53 |
|
54 |
|
55 | content?: string | number;
|
56 | |
57 |
|
58 |
|
59 | lockView?: boolean;
|
60 | |
61 |
|
62 |
|
63 | lockScroll?: boolean;
|
64 | |
65 |
|
66 |
|
67 | mask?: boolean;
|
68 | |
69 |
|
70 |
|
71 | maskClosable?: boolean;
|
72 | |
73 |
|
74 |
|
75 | escClosable?: boolean;
|
76 | |
77 |
|
78 |
|
79 | resize?: boolean;
|
80 | |
81 |
|
82 |
|
83 | showHeader?: boolean;
|
84 | |
85 |
|
86 |
|
87 | showFooter?: boolean;
|
88 | |
89 |
|
90 |
|
91 | dblclickZoom?: boolean;
|
92 | |
93 |
|
94 |
|
95 | width?: number | string;
|
96 | |
97 |
|
98 |
|
99 | height?: number | string;
|
100 | |
101 |
|
102 |
|
103 | minWidth?: number | string;
|
104 | |
105 |
|
106 |
|
107 | minHeight?: number | string;
|
108 | |
109 |
|
110 |
|
111 | zIndex?: number;
|
112 | marginSize?: number | string;
|
113 | |
114 |
|
115 |
|
116 | fullscreen?: boolean;
|
117 | |
118 |
|
119 |
|
120 | remember?: boolean;
|
121 | |
122 |
|
123 |
|
124 | destroyOnClose?: boolean;
|
125 | |
126 |
|
127 |
|
128 | showTitleOverflow?: boolean;
|
129 | |
130 |
|
131 |
|
132 | transfer?: boolean;
|
133 | |
134 |
|
135 |
|
136 | storage?: boolean;
|
137 | storageKey?: string;
|
138 | animat?: boolean;
|
139 | beforeHideMethod?(params: { type: string }): Promise<any>;
|
140 |
|
141 | |
142 |
|
143 |
|
144 | open(): any;
|
145 | |
146 |
|
147 |
|
148 | close(): any;
|
149 | |
150 |
|
151 |
|
152 | getBox(): HTMLElement;
|
153 | |
154 |
|
155 |
|
156 | getPosition(): {
|
157 | top?: number;
|
158 | left?: number;
|
159 | } | null;
|
160 | |
161 |
|
162 |
|
163 | setPosition(top?: number, left?: number): Promise<any>;
|
164 | |
165 |
|
166 |
|
167 | isMaximized(): boolean;
|
168 | |
169 |
|
170 |
|
171 | zoom(): Promise<boolean>;
|
172 | |
173 |
|
174 |
|
175 | maximize(): Promise<any>;
|
176 | |
177 |
|
178 |
|
179 | revert(): Promise<any>;
|
180 | }
|
181 |
|
182 |
|
183 |
|
184 |
|
185 | export declare type ModalOptionTypes = 'alert' | 'confirm' | 'message'
|
186 |
|
187 |
|
188 |
|
189 | export declare type ModalOptionStatus = 'info' | 'success' | 'warning' | 'question' | 'error' | 'loading'
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 | export declare type ModalEventTypes = 'default' | 'mask' | 'close' | 'confirm' | 'cancel' | 'keydown' | 'exist'
|
199 |
|
200 | export interface ModalOptions {
|
201 | id?: string;
|
202 | type?: string;
|
203 | loading?: boolean;
|
204 | status?: ModalOptionStatus;
|
205 | iconStatus?: string;
|
206 | top?: number | string;
|
207 | position?: 'center' | {
|
208 | top?: number;
|
209 | left?: number;
|
210 | };
|
211 | title?: string;
|
212 | duration?: number | string;
|
213 | message?: string | number;
|
214 | content?: string | number;
|
215 | lockView?: boolean;
|
216 | lockScroll?: boolean;
|
217 | mask?: boolean;
|
218 | maskClosable?: boolean;
|
219 | escClosable?: boolean;
|
220 | resize?: boolean;
|
221 | showHeader?: boolean;
|
222 | showFooter?: boolean;
|
223 | dblclickZoom?: boolean;
|
224 | width?: number | string;
|
225 | height?: number | string;
|
226 | minWidth?: number | string;
|
227 | minHeight?: number | string;
|
228 | zIndex?: number;
|
229 | marginSize?: number | string;
|
230 | fullscreen?: boolean;
|
231 | remember?: boolean;
|
232 | destroyOnClose?: boolean;
|
233 | showTitleOverflow?: boolean;
|
234 | transfer?: boolean;
|
235 | storage?: boolean;
|
236 | storageKey?: string;
|
237 | animat?: boolean;
|
238 | size?: 'medium' | 'small' | 'mini';
|
239 | beforeHideMethod?(params: { type: string }): Promise<any>;
|
240 |
|
241 | slots?: {
|
242 | default?(params: ModalDefaultSlotParams, h: CreateElement): VNode[] | string[];
|
243 | header?(params: ModalHeaderSlotParams, h: CreateElement): VNode[] | string[];
|
244 | title?(params: ModalTitleSlotParams, h: CreateElement): VNode[] | string[];
|
245 | footer?(params: ModalFooterSlotParams, h: CreateElement): VNode[] | string[];
|
246 | };
|
247 |
|
248 | events?: {
|
249 | inserted?(params: ModalEventParams): any;
|
250 | show?(params: ModalEventParams): any;
|
251 | hide?(params: ModalEventParams): any;
|
252 | zoom?(params: ModalEventParams): any;
|
253 | };
|
254 | }
|
255 |
|
256 | export interface ModalDefaultSlotParams {
|
257 | $modal: Modal;
|
258 | }
|
259 |
|
260 | export interface ModalHeaderSlotParams extends ModalDefaultSlotParams {}
|
261 | export interface ModalTitleSlotParams extends ModalDefaultSlotParams {}
|
262 | export interface ModalFooterSlotParams extends ModalDefaultSlotParams {}
|
263 |
|
264 | export interface ModalEventParams {
|
265 | $modal: Modal;
|
266 | type: string;
|
267 | }
|
268 |
|
269 |
|
270 |
|
271 |
|
272 | export interface ModalController {
|
273 | |
274 |
|
275 |
|
276 |
|
277 | open (options: ModalOptions): Promise<string>;
|
278 | |
279 |
|
280 |
|
281 |
|
282 |
|
283 |
|
284 | alert (content: string, title?: string, options?: ModalOptions): Promise<string>;
|
285 | |
286 |
|
287 |
|
288 |
|
289 | alert (options: ModalOptions): Promise<string>;
|
290 | |
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 | confirm (content: string, title?: string, options?: ModalOptions): Promise<string>;
|
297 | |
298 |
|
299 |
|
300 |
|
301 | confirm (options: ModalOptions): Promise<string>;
|
302 | |
303 |
|
304 |
|
305 |
|
306 |
|
307 |
|
308 | message (content: string, options?: ModalOptions): Promise<string>;
|
309 | |
310 |
|
311 |
|
312 |
|
313 | message (options: ModalOptions): Promise<string>;
|
314 | |
315 |
|
316 |
|
317 |
|
318 | get (id: string): Modal;
|
319 | |
320 |
|
321 |
|
322 |
|
323 | close (id?: string): Promise<any>;
|
324 | }
|