UNPKG

8 kBTypeScriptView Raw
1import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, OnInit, QueryList, Renderer2, SimpleChanges } from '@angular/core';
2import { Placement, PlacementArray } from '../util/positioning';
3import { Options } from '@popperjs/core';
4import { NgbDropdownConfig } from './dropdown-config';
5import * as i0 from "@angular/core";
6/**
7 * @deprecated 14.2.0 this directive isn't useful anymore. You can remove it from your imports
8 */
9export declare class NgbNavbar {
10 static ɵfac: i0.ɵɵFactoryDeclaration<NgbNavbar, never>;
11 static ɵdir: i0.ɵɵDirectiveDeclaration<NgbNavbar, ".navbar", never, {}, {}, never, never, true, never>;
12}
13/**
14 * A directive you should put on a dropdown item to enable keyboard navigation.
15 * Arrow keys will move focus between items marked with this directive.
16 *
17 * @since 4.1.0
18 */
19export declare class NgbDropdownItem {
20 elementRef: ElementRef<HTMLElement>;
21 private _renderer;
22 static ngAcceptInputType_disabled: boolean | '';
23 private _disabled;
24 set disabled(value: boolean);
25 get disabled(): boolean;
26 constructor(elementRef: ElementRef<HTMLElement>, _renderer: Renderer2);
27 static ɵfac: i0.ɵɵFactoryDeclaration<NgbDropdownItem, never>;
28 static ɵdir: i0.ɵɵDirectiveDeclaration<NgbDropdownItem, "[ngbDropdownItem]", never, { "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
29}
30/**
31 * A directive that wraps dropdown menu content and dropdown items.
32 */
33export declare class NgbDropdownMenu {
34 dropdown: NgbDropdown;
35 nativeElement: HTMLElement;
36 placement: Placement | null;
37 isOpen: boolean;
38 menuItems: QueryList<NgbDropdownItem>;
39 constructor(dropdown: NgbDropdown, _elementRef: ElementRef<HTMLElement>);
40 static ɵfac: i0.ɵɵFactoryDeclaration<NgbDropdownMenu, never>;
41 static ɵdir: i0.ɵɵDirectiveDeclaration<NgbDropdownMenu, "[ngbDropdownMenu]", never, {}, {}, ["menuItems"], never, true, never>;
42}
43/**
44 * A directive to mark an element to which dropdown menu will be anchored.
45 *
46 * This is a simple version of the `NgbDropdownToggle` directive.
47 * It plays the same role, but doesn't listen to click events to toggle dropdown menu thus enabling support
48 * for events other than click.
49 *
50 * @since 1.1.0
51 */
52export declare class NgbDropdownAnchor {
53 dropdown: NgbDropdown;
54 nativeElement: HTMLElement;
55 constructor(dropdown: NgbDropdown, _elementRef: ElementRef<HTMLElement>);
56 static ɵfac: i0.ɵɵFactoryDeclaration<NgbDropdownAnchor, never>;
57 static ɵdir: i0.ɵɵDirectiveDeclaration<NgbDropdownAnchor, "[ngbDropdownAnchor]", never, {}, {}, never, never, true, never>;
58}
59/**
60 * A directive to mark an element that will toggle dropdown via the `click` event.
61 *
62 * You can also use `NgbDropdownAnchor` as an alternative.
63 */
64export declare class NgbDropdownToggle extends NgbDropdownAnchor {
65 constructor(dropdown: NgbDropdown, elementRef: ElementRef<HTMLElement>);
66 static ɵfac: i0.ɵɵFactoryDeclaration<NgbDropdownToggle, never>;
67 static ɵdir: i0.ɵɵDirectiveDeclaration<NgbDropdownToggle, "[ngbDropdownToggle]", never, {}, {}, never, never, true, never>;
68}
69/**
70 * A directive that provides contextual overlays for displaying lists of links and more.
71 */
72export declare class NgbDropdown implements OnInit, AfterContentInit, OnChanges, OnDestroy {
73 private _changeDetector;
74 private _document;
75 private _ngZone;
76 private _elementRef;
77 private _renderer;
78 static ngAcceptInputType_autoClose: boolean | string;
79 static ngAcceptInputType_display: string;
80 private _destroyCloseHandlers$;
81 private _zoneSubscription;
82 private _bodyContainer;
83 private _positioning;
84 private _menu;
85 private _anchor;
86 /**
87 * Indicates whether the dropdown should be closed when clicking one of dropdown items or pressing ESC.
88 *
89 * * `true` - the dropdown will close on both outside and inside (menu) clicks.
90 * * `false` - the dropdown can only be closed manually via `close()` or `toggle()` methods.
91 * * `"inside"` - the dropdown will close on inside menu clicks, but not outside clicks.
92 * * `"outside"` - the dropdown will close only on the outside clicks and not on menu clicks.
93 */
94 autoClose: boolean | 'outside' | 'inside';
95 /**
96 * A custom class that is applied only to the `ngbDropdownMenu` parent element.
97 * * In case of the inline dropdown it will be the `<div ngbDropdown>`
98 * * In case of the dropdown with `container="body"` it will be the `<div class="dropdown">` attached to the `<body>`
99 *
100 * Useful mainly when dropdown is attached to the body.
101 * If the dropdown is inline just use `<div ngbDropdown class="custom-class">` instead.
102 *
103 * @since 9.1.0
104 */
105 dropdownClass: string;
106 /**
107 * Defines whether or not the dropdown menu is opened initially.
108 */
109 _open: boolean;
110 /**
111 * The preferred placement of the dropdown, among the [possible values](#/guides/positioning#api).
112 *
113 * The default order of preference is `"bottom-start bottom-end top-start top-end"`
114 *
115 * Please see the [positioning overview](#/positioning) for more details.
116 */
117 placement: PlacementArray;
118 /**
119 * Allows to change default Popper options when positioning the dropdown.
120 * Receives current popper options and returns modified ones.
121 *
122 * @since 13.1.0
123 */
124 popperOptions: (options: Partial<Options>) => Partial<Options>;
125 /**
126 * A selector specifying the element the dropdown should be appended to.
127 * Currently only supports "body".
128 *
129 * @since 4.1.0
130 */
131 container: null | 'body';
132 /**
133 * Enable or disable the dynamic positioning. The default value is dynamic unless the dropdown is used
134 * inside a Bootstrap navbar. If you need custom placement for a dropdown in a navbar, set it to
135 * dynamic explicitly. See the [positioning of dropdown](#/positioning#dropdown)
136 * and the [navbar demo](/#/components/dropdown/examples#navbar) for more details.
137 *
138 * @since 4.2.0
139 */
140 display: 'dynamic' | 'static';
141 /**
142 * An event fired when the dropdown is opened or closed.
143 *
144 * The event payload is a `boolean`:
145 * * `true` - the dropdown was opened
146 * * `false` - the dropdown was closed
147 */
148 openChange: EventEmitter<boolean>;
149 constructor(_changeDetector: ChangeDetectorRef, config: NgbDropdownConfig, _document: any, _ngZone: NgZone, _elementRef: ElementRef<HTMLElement>, _renderer: Renderer2);
150 ngOnInit(): void;
151 ngAfterContentInit(): void;
152 ngOnChanges(changes: SimpleChanges): void;
153 /**
154 * Checks if the dropdown menu is open.
155 */
156 isOpen(): boolean;
157 /**
158 * Opens the dropdown menu.
159 */
160 open(): void;
161 private _setCloseHandlers;
162 /**
163 * Closes the dropdown menu.
164 */
165 close(): void;
166 /**
167 * Toggles the dropdown menu.
168 */
169 toggle(): void;
170 ngOnDestroy(): void;
171 onKeyDown(event: KeyboardEvent): void;
172 private _isDropup;
173 private _isEventFromToggle;
174 private _getMenuElements;
175 private _positionMenu;
176 private _getFirstPlacement;
177 private _resetContainer;
178 private _applyContainer;
179 private _applyCustomDropdownClass;
180 private _applyPlacementClasses;
181 static ɵfac: i0.ɵɵFactoryDeclaration<NgbDropdown, never>;
182 static ɵdir: i0.ɵɵDirectiveDeclaration<NgbDropdown, "[ngbDropdown]", ["ngbDropdown"], { "autoClose": { "alias": "autoClose"; "required": false; }; "dropdownClass": { "alias": "dropdownClass"; "required": false; }; "_open": { "alias": "open"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "popperOptions": { "alias": "popperOptions"; "required": false; }; "container": { "alias": "container"; "required": false; }; "display": { "alias": "display"; "required": false; }; }, { "openChange": "openChange"; }, ["_menu", "_anchor"], never, true, never>;
183}