source: trip-planner-front/node_modules/@angular/material/esm2015/menu/menu.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 54.7 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { FocusKeyManager } from '@angular/cdk/a11y';
9import { coerceBooleanProperty } from '@angular/cdk/coercion';
10import { ESCAPE, LEFT_ARROW, RIGHT_ARROW, DOWN_ARROW, UP_ARROW, hasModifierKey, } from '@angular/cdk/keycodes';
11import { ChangeDetectionStrategy, Component, ContentChild, ContentChildren, Directive, ElementRef, EventEmitter, Inject, InjectionToken, Input, NgZone, Output, TemplateRef, QueryList, ViewChild, ViewEncapsulation, } from '@angular/core';
12import { merge, Subject, Subscription } from 'rxjs';
13import { startWith, switchMap, take } from 'rxjs/operators';
14import { matMenuAnimations } from './menu-animations';
15import { MAT_MENU_CONTENT, MatMenuContent } from './menu-content';
16import { throwMatMenuInvalidPositionX, throwMatMenuInvalidPositionY } from './menu-errors';
17import { MatMenuItem } from './menu-item';
18import { MAT_MENU_PANEL } from './menu-panel';
19/** Injection token to be used to override the default options for `mat-menu`. */
20export const MAT_MENU_DEFAULT_OPTIONS = new InjectionToken('mat-menu-default-options', {
21 providedIn: 'root',
22 factory: MAT_MENU_DEFAULT_OPTIONS_FACTORY
23});
24/** @docs-private */
25export function MAT_MENU_DEFAULT_OPTIONS_FACTORY() {
26 return {
27 overlapTrigger: false,
28 xPosition: 'after',
29 yPosition: 'below',
30 backdropClass: 'cdk-overlay-transparent-backdrop',
31 };
32}
33let menuPanelUid = 0;
34/** Base class with all of the `MatMenu` functionality. */
35export class _MatMenuBase {
36 constructor(_elementRef, _ngZone, _defaultOptions) {
37 this._elementRef = _elementRef;
38 this._ngZone = _ngZone;
39 this._defaultOptions = _defaultOptions;
40 this._xPosition = this._defaultOptions.xPosition;
41 this._yPosition = this._defaultOptions.yPosition;
42 /** Only the direct descendant menu items. */
43 this._directDescendantItems = new QueryList();
44 /** Subscription to tab events on the menu panel */
45 this._tabSubscription = Subscription.EMPTY;
46 /** Config object to be passed into the menu's ngClass */
47 this._classList = {};
48 /** Current state of the panel animation. */
49 this._panelAnimationState = 'void';
50 /** Emits whenever an animation on the menu completes. */
51 this._animationDone = new Subject();
52 /** Class or list of classes to be added to the overlay panel. */
53 this.overlayPanelClass = this._defaultOptions.overlayPanelClass || '';
54 /** Class to be added to the backdrop element. */
55 this.backdropClass = this._defaultOptions.backdropClass;
56 this._overlapTrigger = this._defaultOptions.overlapTrigger;
57 this._hasBackdrop = this._defaultOptions.hasBackdrop;
58 /** Event emitted when the menu is closed. */
59 this.closed = new EventEmitter();
60 /**
61 * Event emitted when the menu is closed.
62 * @deprecated Switch to `closed` instead
63 * @breaking-change 8.0.0
64 */
65 this.close = this.closed;
66 this.panelId = `mat-menu-panel-${menuPanelUid++}`;
67 }
68 /** Position of the menu in the X axis. */
69 get xPosition() { return this._xPosition; }
70 set xPosition(value) {
71 if (value !== 'before' && value !== 'after' &&
72 (typeof ngDevMode === 'undefined' || ngDevMode)) {
73 throwMatMenuInvalidPositionX();
74 }
75 this._xPosition = value;
76 this.setPositionClasses();
77 }
78 /** Position of the menu in the Y axis. */
79 get yPosition() { return this._yPosition; }
80 set yPosition(value) {
81 if (value !== 'above' && value !== 'below' && (typeof ngDevMode === 'undefined' || ngDevMode)) {
82 throwMatMenuInvalidPositionY();
83 }
84 this._yPosition = value;
85 this.setPositionClasses();
86 }
87 /** Whether the menu should overlap its trigger. */
88 get overlapTrigger() { return this._overlapTrigger; }
89 set overlapTrigger(value) {
90 this._overlapTrigger = coerceBooleanProperty(value);
91 }
92 /** Whether the menu has a backdrop. */
93 get hasBackdrop() { return this._hasBackdrop; }
94 set hasBackdrop(value) {
95 this._hasBackdrop = coerceBooleanProperty(value);
96 }
97 /**
98 * This method takes classes set on the host mat-menu element and applies them on the
99 * menu template that displays in the overlay container. Otherwise, it's difficult
100 * to style the containing menu from outside the component.
101 * @param classes list of class names
102 */
103 set panelClass(classes) {
104 const previousPanelClass = this._previousPanelClass;
105 if (previousPanelClass && previousPanelClass.length) {
106 previousPanelClass.split(' ').forEach((className) => {
107 this._classList[className] = false;
108 });
109 }
110 this._previousPanelClass = classes;
111 if (classes && classes.length) {
112 classes.split(' ').forEach((className) => {
113 this._classList[className] = true;
114 });
115 this._elementRef.nativeElement.className = '';
116 }
117 }
118 /**
119 * This method takes classes set on the host mat-menu element and applies them on the
120 * menu template that displays in the overlay container. Otherwise, it's difficult
121 * to style the containing menu from outside the component.
122 * @deprecated Use `panelClass` instead.
123 * @breaking-change 8.0.0
124 */
125 get classList() { return this.panelClass; }
126 set classList(classes) { this.panelClass = classes; }
127 ngOnInit() {
128 this.setPositionClasses();
129 }
130 ngAfterContentInit() {
131 this._updateDirectDescendants();
132 this._keyManager = new FocusKeyManager(this._directDescendantItems)
133 .withWrap()
134 .withTypeAhead()
135 .withHomeAndEnd();
136 this._tabSubscription = this._keyManager.tabOut.subscribe(() => this.closed.emit('tab'));
137 // If a user manually (programmatically) focuses a menu item, we need to reflect that focus
138 // change back to the key manager. Note that we don't need to unsubscribe here because _focused
139 // is internal and we know that it gets completed on destroy.
140 this._directDescendantItems.changes.pipe(startWith(this._directDescendantItems), switchMap(items => merge(...items.map((item) => item._focused)))).subscribe(focusedItem => this._keyManager.updateActiveItem(focusedItem));
141 }
142 ngOnDestroy() {
143 this._directDescendantItems.destroy();
144 this._tabSubscription.unsubscribe();
145 this.closed.complete();
146 }
147 /** Stream that emits whenever the hovered menu item changes. */
148 _hovered() {
149 // Coerce the `changes` property because Angular types it as `Observable<any>`
150 const itemChanges = this._directDescendantItems.changes;
151 return itemChanges.pipe(startWith(this._directDescendantItems), switchMap(items => merge(...items.map((item) => item._hovered))));
152 }
153 /*
154 * Registers a menu item with the menu.
155 * @docs-private
156 * @deprecated No longer being used. To be removed.
157 * @breaking-change 9.0.0
158 */
159 addItem(_item) { }
160 /**
161 * Removes an item from the menu.
162 * @docs-private
163 * @deprecated No longer being used. To be removed.
164 * @breaking-change 9.0.0
165 */
166 removeItem(_item) { }
167 /** Handle a keyboard event from the menu, delegating to the appropriate action. */
168 _handleKeydown(event) {
169 const keyCode = event.keyCode;
170 const manager = this._keyManager;
171 switch (keyCode) {
172 case ESCAPE:
173 if (!hasModifierKey(event)) {
174 event.preventDefault();
175 this.closed.emit('keydown');
176 }
177 break;
178 case LEFT_ARROW:
179 if (this.parentMenu && this.direction === 'ltr') {
180 this.closed.emit('keydown');
181 }
182 break;
183 case RIGHT_ARROW:
184 if (this.parentMenu && this.direction === 'rtl') {
185 this.closed.emit('keydown');
186 }
187 break;
188 default:
189 if (keyCode === UP_ARROW || keyCode === DOWN_ARROW) {
190 manager.setFocusOrigin('keyboard');
191 }
192 manager.onKeydown(event);
193 }
194 }
195 /**
196 * Focus the first item in the menu.
197 * @param origin Action from which the focus originated. Used to set the correct styling.
198 */
199 focusFirstItem(origin = 'program') {
200 // When the content is rendered lazily, it takes a bit before the items are inside the DOM.
201 if (this.lazyContent) {
202 this._ngZone.onStable
203 .pipe(take(1))
204 .subscribe(() => this._focusFirstItem(origin));
205 }
206 else {
207 this._focusFirstItem(origin);
208 }
209 }
210 /**
211 * Actual implementation that focuses the first item. Needs to be separated
212 * out so we don't repeat the same logic in the public `focusFirstItem` method.
213 */
214 _focusFirstItem(origin) {
215 const manager = this._keyManager;
216 manager.setFocusOrigin(origin).setFirstItemActive();
217 // If there's no active item at this point, it means that all the items are disabled.
218 // Move focus to the menu panel so keyboard events like Escape still work. Also this will
219 // give _some_ feedback to screen readers.
220 if (!manager.activeItem && this._directDescendantItems.length) {
221 let element = this._directDescendantItems.first._getHostElement().parentElement;
222 // Because the `mat-menu` is at the DOM insertion point, not inside the overlay, we don't
223 // have a nice way of getting a hold of the menu panel. We can't use a `ViewChild` either
224 // because the panel is inside an `ng-template`. We work around it by starting from one of
225 // the items and walking up the DOM.
226 while (element) {
227 if (element.getAttribute('role') === 'menu') {
228 element.focus();
229 break;
230 }
231 else {
232 element = element.parentElement;
233 }
234 }
235 }
236 }
237 /**
238 * Resets the active item in the menu. This is used when the menu is opened, allowing
239 * the user to start from the first option when pressing the down arrow.
240 */
241 resetActiveItem() {
242 this._keyManager.setActiveItem(-1);
243 }
244 /**
245 * Sets the menu panel elevation.
246 * @param depth Number of parent menus that come before the menu.
247 */
248 setElevation(depth) {
249 // The elevation starts at the base and increases by one for each level.
250 // Capped at 24 because that's the maximum elevation defined in the Material design spec.
251 const elevation = Math.min(this._baseElevation + depth, 24);
252 const newElevation = `${this._elevationPrefix}${elevation}`;
253 const customElevation = Object.keys(this._classList).find(className => {
254 return className.startsWith(this._elevationPrefix);
255 });
256 if (!customElevation || customElevation === this._previousElevation) {
257 if (this._previousElevation) {
258 this._classList[this._previousElevation] = false;
259 }
260 this._classList[newElevation] = true;
261 this._previousElevation = newElevation;
262 }
263 }
264 /**
265 * Adds classes to the menu panel based on its position. Can be used by
266 * consumers to add specific styling based on the position.
267 * @param posX Position of the menu along the x axis.
268 * @param posY Position of the menu along the y axis.
269 * @docs-private
270 */
271 setPositionClasses(posX = this.xPosition, posY = this.yPosition) {
272 const classes = this._classList;
273 classes['mat-menu-before'] = posX === 'before';
274 classes['mat-menu-after'] = posX === 'after';
275 classes['mat-menu-above'] = posY === 'above';
276 classes['mat-menu-below'] = posY === 'below';
277 }
278 /** Starts the enter animation. */
279 _startAnimation() {
280 // @breaking-change 8.0.0 Combine with _resetAnimation.
281 this._panelAnimationState = 'enter';
282 }
283 /** Resets the panel animation to its initial state. */
284 _resetAnimation() {
285 // @breaking-change 8.0.0 Combine with _startAnimation.
286 this._panelAnimationState = 'void';
287 }
288 /** Callback that is invoked when the panel animation completes. */
289 _onAnimationDone(event) {
290 this._animationDone.next(event);
291 this._isAnimating = false;
292 }
293 _onAnimationStart(event) {
294 this._isAnimating = true;
295 // Scroll the content element to the top as soon as the animation starts. This is necessary,
296 // because we move focus to the first item while it's still being animated, which can throw
297 // the browser off when it determines the scroll position. Alternatively we can move focus
298 // when the animation is done, however moving focus asynchronously will interrupt screen
299 // readers which are in the process of reading out the menu already. We take the `element`
300 // from the `event` since we can't use a `ViewChild` to access the pane.
301 if (event.toState === 'enter' && this._keyManager.activeItemIndex === 0) {
302 event.element.scrollTop = 0;
303 }
304 }
305 /**
306 * Sets up a stream that will keep track of any newly-added menu items and will update the list
307 * of direct descendants. We collect the descendants this way, because `_allItems` can include
308 * items that are part of child menus, and using a custom way of registering items is unreliable
309 * when it comes to maintaining the item order.
310 */
311 _updateDirectDescendants() {
312 this._allItems.changes
313 .pipe(startWith(this._allItems))
314 .subscribe((items) => {
315 this._directDescendantItems.reset(items.filter(item => item._parentMenu === this));
316 this._directDescendantItems.notifyOnChanges();
317 });
318 }
319}
320_MatMenuBase.decorators = [
321 { type: Directive }
322];
323_MatMenuBase.ctorParameters = () => [
324 { type: ElementRef },
325 { type: NgZone },
326 { type: undefined, decorators: [{ type: Inject, args: [MAT_MENU_DEFAULT_OPTIONS,] }] }
327];
328_MatMenuBase.propDecorators = {
329 _allItems: [{ type: ContentChildren, args: [MatMenuItem, { descendants: true },] }],
330 backdropClass: [{ type: Input }],
331 ariaLabel: [{ type: Input, args: ['aria-label',] }],
332 ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
333 ariaDescribedby: [{ type: Input, args: ['aria-describedby',] }],
334 xPosition: [{ type: Input }],
335 yPosition: [{ type: Input }],
336 templateRef: [{ type: ViewChild, args: [TemplateRef,] }],
337 items: [{ type: ContentChildren, args: [MatMenuItem, { descendants: false },] }],
338 lazyContent: [{ type: ContentChild, args: [MAT_MENU_CONTENT,] }],
339 overlapTrigger: [{ type: Input }],
340 hasBackdrop: [{ type: Input }],
341 panelClass: [{ type: Input, args: ['class',] }],
342 classList: [{ type: Input }],
343 closed: [{ type: Output }],
344 close: [{ type: Output }]
345};
346/** @docs-public MatMenu */
347export class MatMenu extends _MatMenuBase {
348 constructor(elementRef, ngZone, defaultOptions) {
349 super(elementRef, ngZone, defaultOptions);
350 this._elevationPrefix = 'mat-elevation-z';
351 this._baseElevation = 4;
352 }
353}
354MatMenu.decorators = [
355 { type: Component, args: [{
356 selector: 'mat-menu',
357 template: "<ng-template>\n <div\n class=\"mat-menu-panel\"\n [id]=\"panelId\"\n [ngClass]=\"_classList\"\n (keydown)=\"_handleKeydown($event)\"\n (click)=\"closed.emit('click')\"\n [@transformMenu]=\"_panelAnimationState\"\n (@transformMenu.start)=\"_onAnimationStart($event)\"\n (@transformMenu.done)=\"_onAnimationDone($event)\"\n tabindex=\"-1\"\n role=\"menu\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n [attr.aria-describedby]=\"ariaDescribedby || null\">\n <div class=\"mat-menu-content\">\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>\n",
358 changeDetection: ChangeDetectionStrategy.OnPush,
359 encapsulation: ViewEncapsulation.None,
360 exportAs: 'matMenu',
361 host: {
362 '[attr.aria-label]': 'null',
363 '[attr.aria-labelledby]': 'null',
364 '[attr.aria-describedby]': 'null',
365 },
366 animations: [
367 matMenuAnimations.transformMenu,
368 matMenuAnimations.fadeInItems
369 ],
370 providers: [
371 { provide: MAT_MENU_PANEL, useExisting: MatMenu },
372 ],
373 styles: ["mat-menu{display:none}.mat-menu-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;max-height:calc(100vh - 48px);border-radius:4px;outline:0;min-height:64px}.mat-menu-panel.ng-animating{pointer-events:none}.cdk-high-contrast-active .mat-menu-panel{outline:solid 1px}.mat-menu-content:not(:empty){padding-top:8px;padding-bottom:8px}.mat-menu-item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative}.mat-menu-item::-moz-focus-inner{border:0}.mat-menu-item[disabled]{cursor:default}[dir=rtl] .mat-menu-item{text-align:right}.mat-menu-item .mat-icon{margin-right:16px;vertical-align:middle}.mat-menu-item .mat-icon svg{vertical-align:top}[dir=rtl] .mat-menu-item .mat-icon{margin-left:16px;margin-right:0}.mat-menu-item[disabled]{pointer-events:none}.cdk-high-contrast-active .mat-menu-item{margin-top:1px}.cdk-high-contrast-active .mat-menu-item.cdk-program-focused,.cdk-high-contrast-active .mat-menu-item.cdk-keyboard-focused,.cdk-high-contrast-active .mat-menu-item-highlighted{outline:dotted 1px}.mat-menu-item-submenu-trigger{padding-right:32px}[dir=rtl] .mat-menu-item-submenu-trigger{padding-right:16px;padding-left:32px}.mat-menu-submenu-icon{position:absolute;top:50%;right:16px;transform:translateY(-50%);width:5px;height:10px;fill:currentColor}[dir=rtl] .mat-menu-submenu-icon{right:auto;left:16px;transform:translateY(-50%) scaleX(-1)}.cdk-high-contrast-active .mat-menu-submenu-icon{fill:CanvasText}button.mat-menu-item{width:100%}.mat-menu-item .mat-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}\n"]
374 },] }
375];
376MatMenu.ctorParameters = () => [
377 { type: ElementRef },
378 { type: NgZone },
379 { type: undefined, decorators: [{ type: Inject, args: [MAT_MENU_DEFAULT_OPTIONS,] }] }
380];
381//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVudS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tYXRlcmlhbC9tZW51L21lbnUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLGVBQWUsRUFBYyxNQUFNLG1CQUFtQixDQUFDO0FBRS9ELE9BQU8sRUFBZSxxQkFBcUIsRUFBQyxNQUFNLHVCQUF1Qix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