UNPKG

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