UNPKG

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