UNPKG

7.51 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 _ngZone;
73 private _nativeElement;
74 private _destroyCloseHandlers$;
75 private _zoneSubscription;
76 private _bodyContainer;
77 private _positioning;
78 private _menu;
79 private _anchor;
80 /**
81 * Indicates whether the dropdown should be closed when clicking one of dropdown items or pressing ESC.
82 *
83 * * `true` - the dropdown will close on both outside and inside (menu) clicks.
84 * * `false` - the dropdown can only be closed manually via `close()` or `toggle()` methods.
85 * * `"inside"` - the dropdown will close on inside menu clicks, but not outside clicks.
86 * * `"outside"` - the dropdown will close only on the outside clicks and not on menu clicks.
87 */
88 autoClose: boolean | "inside" | "outside";
89 /**
90 * A custom class that is applied only to the `ngbDropdownMenu` parent element.
91 * * In case of the inline dropdown it will be the `<div ngbDropdown>`
92 * * In case of the dropdown with `container="body"` it will be the `<div class="dropdown">` attached to the `<body>`
93 *
94 * Useful mainly when dropdown is attached to the body.
95 * If the dropdown is inline just use `<div ngbDropdown class="custom-class">` instead.
96 *
97 * @since 9.1.0
98 */
99 dropdownClass: string;
100 /**
101 * Defines whether or not the dropdown menu is opened initially.
102 */
103 _open: boolean;
104 /**
105 * The preferred placement of the dropdown, among the [possible values](#/guides/positioning#api).
106 *
107 * The default order of preference is `"bottom-start bottom-end top-start top-end"`
108 *
109 * Please see the [positioning overview](#/positioning) for more details.
110 */
111 placement: PlacementArray;
112 /**
113 * Allows to change default Popper options when positioning the dropdown.
114 * Receives current popper options and returns modified ones.
115 *
116 * @since 13.1.0
117 */
118 popperOptions: (options: Partial<import("@popperjs/core").Options>) => Partial<import("@popperjs/core").Options>;
119 /**
120 * A selector specifying the element the dropdown should be appended to.
121 * Currently only supports "body".
122 *
123 * @since 4.1.0
124 */
125 container: null | 'body';
126 /**
127 * Enable or disable the dynamic positioning. The default value is dynamic unless the dropdown is used
128 * inside a Bootstrap navbar. If you need custom placement for a dropdown in a navbar, set it to
129 * dynamic explicitly. See the [positioning of dropdown](#/positioning#dropdown)
130 * and the [navbar demo](/#/components/dropdown/examples#navbar) for more details.
131 *
132 * @since 4.2.0
133 */
134 display: 'dynamic' | 'static';
135 /**
136 * An event fired when the dropdown is opened or closed.
137 *
138 * The event payload is a `boolean`:
139 * * `true` - the dropdown was opened
140 * * `false` - the dropdown was closed
141 */
142 openChange: EventEmitter<boolean>;
143 ngOnInit(): void;
144 ngAfterContentInit(): void;
145 ngOnChanges(changes: SimpleChanges): void;
146 /**
147 * Checks if the dropdown menu is open.
148 */
149 isOpen(): boolean;
150 /**
151 * Opens the dropdown menu.
152 */
153 open(): void;
154 private _setCloseHandlers;
155 /**
156 * Closes the dropdown menu.
157 */
158 close(): void;
159 /**
160 * Toggles the dropdown menu.
161 */
162 toggle(): void;
163 ngOnDestroy(): void;
164 onKeyDown(event: KeyboardEvent): void;
165 private _isDropup;
166 private _isEventFromToggle;
167 private _getMenuElements;
168 private _positionMenu;
169 private _getFirstPlacement;
170 private _resetContainer;
171 private _applyContainer;
172 private _applyCustomDropdownClass;
173 private _applyPlacementClasses;
174 static ɵfac: i0.ɵɵFactoryDeclaration<NgbDropdown, never>;
175 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>;
176}