UNPKG

3.03 kBTypeScriptView Raw
1import { Injector } from '@angular/core';
2import * as i0 from "@angular/core";
3/**
4 * Options available when opening new offcanvas windows with `NgbOffcanvas.open()` method.
5 *
6 * @since 12.1.0
7 */
8export interface NgbOffcanvasOptions {
9 /**
10 * If `true`, opening and closing will be animated.
11 */
12 animation?: boolean;
13 /**
14 * `aria-describedby` attribute value to set on the offcanvas panel.
15 */
16 ariaDescribedBy?: string;
17 /**
18 * `aria-labelledby` attribute value to set on the offcanvas panel.
19 */
20 ariaLabelledBy?: string;
21 /**
22 * If `true`, the backdrop element will be created for a given offcanvas.
23 * If 'static', clicking the backdrop won't close the offcanvas (available since 13.1.0).
24 *
25 * Default value is `true`.
26 */
27 backdrop?: boolean | 'static';
28 /**
29 * A custom class to append to the offcanvas backdrop.
30 */
31 backdropClass?: string;
32 /**
33 * Callback right before the offcanvas will be dismissed.
34 *
35 * If this function returns:
36 * * `false`
37 * * a promise resolved with `false`
38 * * a promise that is rejected
39 *
40 * then the offcanvas won't be dismissed.
41 */
42 beforeDismiss?: () => boolean | Promise<boolean>;
43 /**
44 * A selector specifying the element all new offcanvas panels and backdrops should be appended to.
45 *
46 * If not specified, will be `body`.
47 */
48 container?: string | HTMLElement;
49 /**
50 * The `Injector` to use for offcanvas content.
51 */
52 injector?: Injector;
53 /**
54 * If `true`, the offcanvas will be closed when `Escape` key is pressed
55 *
56 * Default value is `true`.
57 */
58 keyboard?: boolean;
59 /**
60 * A custom class to append to the offcanvas panel.
61 */
62 panelClass?: string;
63 /**
64 * The position of the offcanvas
65 */
66 position?: 'start' | 'end' | 'top' | 'bottom';
67 /**
68 * Scroll content while offcanvas is open (false by default).
69 */
70 scroll?: boolean;
71}
72/**
73 * A configuration service for the [`NgbOffcanvas`](#/components/offcanvas/api#NgbOffcanvas) service.
74 *
75 * You can inject this service, typically in your root component, and customize the values of its properties in
76 * order to provide default values for all offcanvases used in the application.
77 *
78 * @since 12.1.0
79 */
80export declare class NgbOffcanvasConfig implements Required<NgbOffcanvasOptions> {
81 private _ngbConfig;
82 private _animation;
83 ariaDescribedBy: string;
84 ariaLabelledBy: string;
85 backdrop: boolean | 'static';
86 backdropClass: string;
87 beforeDismiss: () => boolean | Promise<boolean>;
88 container: string | HTMLElement;
89 injector: Injector;
90 keyboard: boolean;
91 panelClass: string;
92 position: 'start' | 'end' | 'top' | 'bottom';
93 scroll: boolean;
94 get animation(): boolean;
95 set animation(animation: boolean);
96 static ɵfac: i0.ɵɵFactoryDeclaration<NgbOffcanvasConfig, never>;
97 static ɵprov: i0.ɵɵInjectableDeclaration<NgbOffcanvasConfig>;
98}