UNPKG

4.1 kBTypeScriptView Raw
1import { Injector } from '@angular/core';
2import { NgbConfig } from '../ngb-config';
3import * as i0 from "@angular/core";
4/**
5 * Options available when opening new modal windows with `NgbModal.open()` method.
6 */
7export interface NgbModalOptions {
8 /**
9 * If `true`, modal opening and closing will be animated.
10 *
11 * @since 8.0.0
12 */
13 animation?: boolean;
14 /**
15 * `aria-labelledby` attribute value to set on the modal window.
16 *
17 * @since 2.2.0
18 */
19 ariaLabelledBy?: string;
20 /**
21 * `aria-describedby` attribute value to set on the modal window.
22 *
23 * @since 6.1.0
24 */
25 ariaDescribedBy?: string;
26 /**
27 * If `true`, the backdrop element will be created for a given modal.
28 *
29 * Alternatively, specify `'static'` for a backdrop which doesn't close the modal on click.
30 *
31 * Default value is `true`.
32 */
33 backdrop?: boolean | 'static';
34 /**
35 * Callback right before the modal will be dismissed.
36 *
37 * If this function returns:
38 * * `false`
39 * * a promise resolved with `false`
40 * * a promise that is rejected
41 *
42 * then the modal won't be dismissed.
43 */
44 beforeDismiss?: () => boolean | Promise<boolean>;
45 /**
46 * If `true`, the modal will be centered vertically.
47 *
48 * Default value is `false`.
49 *
50 * @since 1.1.0
51 */
52 centered?: boolean;
53 /**
54 * A selector specifying the element all new modal windows should be appended to.
55 * Since v5.3.0 it is also possible to pass the reference to an `HTMLElement`.
56 *
57 * If not specified, will be `body`.
58 */
59 container?: string | HTMLElement;
60 /**
61 * If `true` modal will always be displayed in fullscreen mode.
62 *
63 * For values like `'md'` it means that modal will be displayed in fullscreen mode
64 * only if the viewport width is below `'md'`. For custom strings (ex. when passing `'mysize'`)
65 * it will add a `'modal-fullscreen-mysize-down'` class.
66 *
67 * If not specified will be `false`.
68 *
69 * @since 12.1.0
70 */
71 fullscreen?: 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | boolean | string;
72 /**
73 * The `Injector` to use for modal content.
74 */
75 injector?: Injector;
76 /**
77 * If `true`, the modal will be closed when `Escape` key is pressed
78 *
79 * Default value is `true`.
80 */
81 keyboard?: boolean;
82 /**
83 * Scrollable modal content (false by default).
84 *
85 * @since 5.0.0
86 */
87 scrollable?: boolean;
88 /**
89 * Size of a new modal window.
90 */
91 size?: 'sm' | 'lg' | 'xl' | string;
92 /**
93 * A custom class to append to the modal window.
94 */
95 windowClass?: string;
96 /**
97 * A custom class to append to the modal dialog.
98 *
99 * @since 9.1.0
100 */
101 modalDialogClass?: string;
102 /**
103 * A custom class to append to the modal backdrop.
104 *
105 * @since 1.1.0
106 */
107 backdropClass?: string;
108}
109/**
110 * A configuration service for the [`NgbModal`](#/components/modal/api#NgbModal) service.
111 *
112 * You can inject this service, typically in your root component, and customize the values of its properties in
113 * order to provide default values for all modals used in the application.
114 *
115 * @since 3.1.0
116 */
117export declare class NgbModalConfig implements Required<NgbModalOptions> {
118 private _ngbConfig;
119 ariaLabelledBy: string;
120 ariaDescribedBy: string;
121 backdrop: boolean | 'static';
122 beforeDismiss: () => boolean | Promise<boolean>;
123 centered: boolean;
124 container: string | HTMLElement;
125 fullscreen: 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | boolean | string;
126 injector: Injector;
127 keyboard: boolean;
128 scrollable: boolean;
129 size: 'sm' | 'lg' | 'xl' | string;
130 windowClass: string;
131 modalDialogClass: string;
132 backdropClass: string;
133 private _animation;
134 constructor(_ngbConfig: NgbConfig);
135 get animation(): boolean;
136 set animation(animation: boolean);
137 static ɵfac: i0.ɵɵFactoryDeclaration<NgbModalConfig, never>;
138 static ɵprov: i0.ɵɵInjectableDeclaration<NgbModalConfig>;
139}