@angular/cdk-experimental 13.0.0 → 13.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/column-resize/resizable.d.ts +1 -0
  2. package/dialog/dialog-container.d.ts +0 -5
  3. package/esm2020/column-resize/column-resize-directives/column-resize-flex.mjs +4 -4
  4. package/esm2020/column-resize/column-resize-directives/column-resize.mjs +4 -4
  5. package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize-flex.mjs +4 -4
  6. package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize.mjs +4 -4
  7. package/esm2020/column-resize/column-resize-module.mjs +9 -9
  8. package/esm2020/column-resize/column-resize-notifier.mjs +7 -7
  9. package/esm2020/column-resize/column-resize.mjs +4 -4
  10. package/esm2020/column-resize/column-size-store.mjs +4 -4
  11. package/esm2020/column-resize/event-dispatcher.mjs +4 -4
  12. package/esm2020/column-resize/overlay-handle.mjs +4 -4
  13. package/esm2020/column-resize/resizable.mjs +8 -4
  14. package/esm2020/column-resize/resize-strategy.mjs +10 -10
  15. package/esm2020/combobox/combobox-module.mjs +5 -5
  16. package/esm2020/combobox/combobox-panel.mjs +4 -4
  17. package/esm2020/combobox/combobox-popup.mjs +4 -4
  18. package/esm2020/combobox/combobox.mjs +4 -4
  19. package/esm2020/dialog/dialog-container.mjs +11 -38
  20. package/esm2020/dialog/dialog-module.mjs +5 -6
  21. package/esm2020/dialog/dialog.mjs +4 -4
  22. package/esm2020/listbox/listbox-module.mjs +5 -5
  23. package/esm2020/listbox/listbox.mjs +7 -7
  24. package/esm2020/menu/context-menu.mjs +7 -7
  25. package/esm2020/menu/menu-aim.mjs +7 -7
  26. package/esm2020/menu/menu-bar.mjs +7 -27
  27. package/esm2020/menu/menu-group.mjs +4 -4
  28. package/esm2020/menu/menu-item-checkbox.mjs +4 -4
  29. package/esm2020/menu/menu-item-radio.mjs +4 -4
  30. package/esm2020/menu/menu-item-selectable.mjs +4 -4
  31. package/esm2020/menu/menu-item-trigger.mjs +4 -4
  32. package/esm2020/menu/menu-item.mjs +11 -58
  33. package/esm2020/menu/menu-module.mjs +5 -5
  34. package/esm2020/menu/menu-panel.mjs +4 -4
  35. package/esm2020/menu/menu.mjs +8 -23
  36. package/esm2020/popover-edit/edit-event-dispatcher.mjs +4 -4
  37. package/esm2020/popover-edit/edit-ref.mjs +4 -4
  38. package/esm2020/popover-edit/edit-services.mjs +4 -4
  39. package/esm2020/popover-edit/focus-dispatcher.mjs +4 -4
  40. package/esm2020/popover-edit/focus-escape-notifier.mjs +4 -4
  41. package/esm2020/popover-edit/lens-directives.mjs +28 -56
  42. package/esm2020/popover-edit/popover-edit-module.mjs +5 -5
  43. package/esm2020/popover-edit/popover-edit-position-strategy-factory.mjs +7 -7
  44. package/esm2020/popover-edit/table-directives.mjs +21 -25
  45. package/esm2020/scrolling/auto-size-virtual-scroll.mjs +4 -4
  46. package/esm2020/scrolling/scrolling-module.mjs +5 -5
  47. package/esm2020/selection/row-selection.mjs +4 -4
  48. package/esm2020/selection/select-all.mjs +4 -4
  49. package/esm2020/selection/selection-column.mjs +4 -4
  50. package/esm2020/selection/selection-module.mjs +5 -5
  51. package/esm2020/selection/selection-toggle.mjs +4 -4
  52. package/esm2020/selection/selection.mjs +4 -4
  53. package/esm2020/table-scroll-container/table-scroll-container-module.mjs +5 -5
  54. package/esm2020/table-scroll-container/table-scroll-container.mjs +4 -4
  55. package/esm2020/version.mjs +1 -1
  56. package/fesm2015/cdk-experimental.mjs +1 -1
  57. package/fesm2015/cdk-experimental.mjs.map +1 -1
  58. package/fesm2015/column-resize.mjs +54 -50
  59. package/fesm2015/column-resize.mjs.map +1 -1
  60. package/fesm2015/combobox.mjs +13 -13
  61. package/fesm2015/combobox.mjs.map +1 -1
  62. package/fesm2015/dialog.mjs +17 -45
  63. package/fesm2015/dialog.mjs.map +1 -1
  64. package/fesm2015/listbox.mjs +10 -10
  65. package/fesm2015/listbox.mjs.map +1 -1
  66. package/fesm2015/menu.mjs +55 -137
  67. package/fesm2015/menu.mjs.map +1 -1
  68. package/fesm2015/popover-edit.mjs +71 -103
  69. package/fesm2015/popover-edit.mjs.map +1 -1
  70. package/fesm2015/scrolling.mjs +7 -7
  71. package/fesm2015/scrolling.mjs.map +1 -1
  72. package/fesm2015/selection.mjs +19 -19
  73. package/fesm2015/selection.mjs.map +1 -1
  74. package/fesm2015/table-scroll-container.mjs +7 -7
  75. package/fesm2015/table-scroll-container.mjs.map +1 -1
  76. package/fesm2020/cdk-experimental.mjs +1 -1
  77. package/fesm2020/cdk-experimental.mjs.map +1 -1
  78. package/fesm2020/column-resize.mjs +54 -50
  79. package/fesm2020/column-resize.mjs.map +1 -1
  80. package/fesm2020/combobox.mjs +13 -13
  81. package/fesm2020/combobox.mjs.map +1 -1
  82. package/fesm2020/dialog.mjs +17 -45
  83. package/fesm2020/dialog.mjs.map +1 -1
  84. package/fesm2020/listbox.mjs +10 -10
  85. package/fesm2020/listbox.mjs.map +1 -1
  86. package/fesm2020/menu.mjs +55 -137
  87. package/fesm2020/menu.mjs.map +1 -1
  88. package/fesm2020/popover-edit.mjs +71 -103
  89. package/fesm2020/popover-edit.mjs.map +1 -1
  90. package/fesm2020/scrolling.mjs +7 -7
  91. package/fesm2020/scrolling.mjs.map +1 -1
  92. package/fesm2020/selection.mjs +19 -19
  93. package/fesm2020/selection.mjs.map +1 -1
  94. package/fesm2020/table-scroll-container.mjs +7 -7
  95. package/fesm2020/table-scroll-container.mjs.map +1 -1
  96. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"menu.mjs","sources":["../../../../../../src/cdk-experimental/menu/menu-interface.ts","../../../../../../src/cdk-experimental/menu/menu-stack.ts","../../../../../../src/cdk-experimental/menu/menu-errors.ts","../../../../../../src/cdk-experimental/menu/menu-aim.ts","../../../../../../src/cdk-experimental/menu/menu-item-trigger.ts","../../../../../../src/cdk-experimental/menu/menu-item.ts","../../../../../../src/cdk-experimental/menu/menu-item-selectable.ts","../../../../../../src/cdk-experimental/menu/menu-group.ts","../../../../../../src/cdk-experimental/menu/menu-panel.ts","../../../../../../src/cdk-experimental/menu/pointer-focus-tracker.ts","../../../../../../src/cdk-experimental/menu/menu.ts","../../../../../../src/cdk-experimental/menu/menu-bar.ts","../../../../../../src/cdk-experimental/menu/menu-item-radio.ts","../../../../../../src/cdk-experimental/menu/menu-item-checkbox.ts","../../../../../../src/cdk-experimental/menu/context-menu.ts","../../../../../../src/cdk-experimental/menu/menu-module.ts","../../../../../../src/cdk-experimental/menu/public-api.ts","../../../../../../src/cdk-experimental/menu/index.ts","../../../../../../src/cdk-experimental/menu/menu_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken, ElementRef} from '@angular/core';\nimport {MenuStackItem} from './menu-stack';\nimport {FocusOrigin} from '@angular/cdk/a11y';\n\n/** Injection token used to return classes implementing the Menu interface */\nexport const CDK_MENU = new InjectionToken<Menu>('cdk-menu');\n\n/** Interface which specifies Menu operations and used to break circular dependency issues */\nexport interface Menu extends MenuStackItem {\n /** The element the Menu directive is placed on. */\n _elementRef: ElementRef<HTMLElement>;\n\n /** The orientation of the menu */\n orientation: 'horizontal' | 'vertical';\n\n /** Place focus on the first MenuItem in the menu. */\n focusFirstItem(focusOrigin: FocusOrigin): void;\n\n /** Place focus on the last MenuItem in the menu. */\n focusLastItem(focusOrigin: FocusOrigin): void;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Subject, Observable} from 'rxjs';\n\n/** Events to emit as specified by the caller once the MenuStack is empty. */\nexport const enum FocusNext {\n nextItem,\n previousItem,\n currentItem,\n}\n\n/**\n * Interface for the elements tracked in the MenuStack.\n */\nexport interface MenuStackItem {\n /** A reference to the previous Menus MenuStack instance. */\n _menuStack: MenuStack | null;\n}\n\n/**\n * MenuStack allows subscribers to listen for close events (when a MenuStackItem is popped off\n * of the stack) in order to perform closing actions. Upon the MenuStack being empty it emits\n * from the `empty` observable specifying the next focus action which the listener should perform\n * as requested by the closer.\n */\nexport class MenuStack {\n /** All MenuStackItems tracked by this MenuStack. */\n private readonly _elements: MenuStackItem[] = [];\n\n /** Emits the element which was popped off of the stack when requested by a closer. */\n private readonly _close: Subject<MenuStackItem | undefined> = new Subject();\n\n /** Emits once the MenuStack has become empty after popping off elements. */\n private readonly _empty: Subject<FocusNext | undefined> = new Subject();\n\n /** Observable which emits the MenuStackItem which has been requested to close. */\n readonly closed: Observable<MenuStackItem | undefined> = this._close;\n\n /**\n * Observable which emits when the MenuStack is empty after popping off the last element. It\n * emits a FocusNext event which specifies the action the closer has requested the listener\n * perform.\n */\n readonly emptied: Observable<FocusNext | undefined> = this._empty;\n\n /** @param menu the MenuStackItem to put on the stack. */\n push(menu: MenuStackItem) {\n this._elements.push(menu);\n }\n\n /**\n * Pop items off of the stack up to and including `lastItem` and emit each on the close\n * observable. If the stack is empty or `lastItem` is not on the stack it does nothing.\n * @param lastItem the last item to pop off the stack.\n * @param focusNext the event to emit on the `empty` observable if the method call resulted in an\n * empty stack. Does not emit if the stack was initially empty or if `lastItem` was not on the\n * stack.\n */\n close(lastItem: MenuStackItem, focusNext?: FocusNext) {\n if (this._elements.indexOf(lastItem) >= 0) {\n let poppedElement: MenuStackItem | undefined;\n do {\n poppedElement = this._elements.pop();\n this._close.next(poppedElement);\n } while (poppedElement !== lastItem);\n\n if (this.isEmpty()) {\n this._empty.next(focusNext);\n }\n }\n }\n\n /**\n * Pop items off of the stack up to but excluding `lastItem` and emit each on the close\n * observable. If the stack is empty or `lastItem` is not on the stack it does nothing.\n * @param lastItem the element which should be left on the stack\n * @return whether or not an item was removed from the stack\n */\n closeSubMenuOf(lastItem: MenuStackItem) {\n let removed = false;\n if (this._elements.indexOf(lastItem) >= 0) {\n removed = this.peek() !== lastItem;\n while (this.peek() !== lastItem) {\n this._close.next(this._elements.pop());\n }\n }\n return removed;\n }\n\n /**\n * Pop off all MenuStackItems and emit each one on the `close` observable one by one.\n * @param focusNext the event to emit on the `empty` observable once the stack is emptied. Does\n * not emit if the stack was initially empty.\n */\n closeAll(focusNext?: FocusNext) {\n if (!this.isEmpty()) {\n while (!this.isEmpty()) {\n const menuStackItem = this._elements.pop();\n if (menuStackItem) {\n this._close.next(menuStackItem);\n }\n }\n\n this._empty.next(focusNext);\n }\n }\n\n /** Return true if this stack is empty. */\n isEmpty() {\n return !this._elements.length;\n }\n\n /** Return the length of the stack. */\n length() {\n return this._elements.length;\n }\n\n /** Get the top most element on the stack. */\n peek(): MenuStackItem | undefined {\n return this._elements[this._elements.length - 1];\n }\n}\n\n/** NoopMenuStack is a placeholder MenuStack used for inline menus. */\nexport class NoopMenuStack extends MenuStack {\n /** Noop push - does not add elements to the MenuStack. */\n override push(_: MenuStackItem) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Throws an exception when a menu panel already has a menu stack.\n * @docs-private\n */\nexport function throwExistingMenuStackError() {\n throw Error(\n 'CdkMenuPanel is already referenced by different CdkMenuTrigger. Ensure that a menu is' +\n ' opened by a single trigger only.',\n );\n}\n\n/**\n * Throws an exception when an instance of the PointerFocusTracker is not provided.\n * @docs-private\n */\nexport function throwMissingPointerFocusTracker() {\n throw Error('expected an instance of PointerFocusTracker to be provided');\n}\n\n/**\n * Throws an exception when a reference to the parent menu is not provided.\n * @docs-private\n */\nexport function throwMissingMenuReference() {\n throw Error('expected a reference to the parent menu');\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable, NgZone, OnDestroy, InjectionToken, Directive} from '@angular/core';\nimport {fromEvent, Subject} from 'rxjs';\nimport {takeUntil, filter} from 'rxjs/operators';\nimport {PointerFocusTracker, FocusableElement} from './pointer-focus-tracker';\nimport {Menu} from './menu-interface';\nimport {throwMissingPointerFocusTracker, throwMissingMenuReference} from './menu-errors';\n\n/**\n * MenuAim is responsible for determining if a sibling menuitem's menu should be closed when a\n * Toggler item is hovered into. It is up to the hovered in item to call the MenuAim service in\n * order to determine if it may perform its close actions.\n */\nexport interface MenuAim {\n /** Set the Menu and its PointerFocusTracker. */\n initialize(menu: Menu, pointerTracker: PointerFocusTracker<FocusableElement & Toggler>): void;\n\n /**\n * Calls the `doToggle` callback when it is deemed that the user is not moving towards\n * the submenu.\n * @param doToggle the function called when the user is not moving towards the submenu.\n */\n toggle(doToggle: () => void): void;\n}\n\n/** Injection token used for an implementation of MenuAim. */\nexport const MENU_AIM = new InjectionToken<MenuAim>('cdk-menu-aim');\n\n/** Capture every nth mouse move event. */\nconst MOUSE_MOVE_SAMPLE_FREQUENCY = 3;\n\n/** The number of mouse move events to track. */\nconst NUM_POINTS = 5;\n\n/**\n * How long to wait before closing a sibling menu if a user stops short of the submenu they were\n * predicted to go into.\n */\nconst CLOSE_DELAY = 300;\n\n/**\n * An element which when hovered over may perform closing actions on the open submenu and\n * potentially open its own menu.\n */\nexport interface Toggler {\n getMenu(): Menu | undefined;\n}\n\n/** Calculate the slope between point a and b. */\nfunction getSlope(a: Point, b: Point) {\n return (b.y - a.y) / (b.x - a.x);\n}\n\n/** Calculate the y intercept for the given point and slope. */\nfunction getYIntercept(point: Point, slope: number) {\n return point.y - slope * point.x;\n}\n\n/** Represents a coordinate of mouse travel. */\ntype Point = {x: number; y: number};\n\n/**\n * Whether the given mouse trajectory line defined by the slope and y intercept falls within the\n * submenu as defined by `submenuPoints`\n * @param submenuPoints the submenu DOMRect points.\n * @param m the slope of the trajectory line.\n * @param b the y intercept of the trajectory line.\n *\n * @return true if any point on the line falls within the submenu.\n */\nfunction isWithinSubmenu(submenuPoints: DOMRect, m: number, b: number) {\n const {left, right, top, bottom} = submenuPoints;\n\n // Check for intersection with each edge of the submenu (left, right, top, bottom)\n // by fixing one coordinate to that edge's coordinate (either x or y) and checking if the\n // other coordinate is within bounds.\n return (\n (m * left + b >= top && m * left + b <= bottom) ||\n (m * right + b >= top && m * right + b <= bottom) ||\n ((top - b) / m >= left && (top - b) / m <= right) ||\n ((bottom - b) / m >= left && (bottom - b) / m <= right)\n );\n}\n/**\n * TargetMenuAim predicts if a user is moving into a submenu. It calculates the\n * trajectory of the user's mouse movement in the current menu to determine if the\n * mouse is moving towards an open submenu.\n *\n * The determination is made by calculating the slope of the users last NUM_POINTS moves where each\n * pair of points determines if the trajectory line points into the submenu. It uses consensus\n * approach by checking if at least NUM_POINTS / 2 pairs determine that the user is moving towards\n * to submenu.\n */\n@Injectable()\nexport class TargetMenuAim implements MenuAim, OnDestroy {\n /** The last NUM_POINTS mouse move events. */\n private readonly _points: Point[] = [];\n\n /** Reference to the root menu in which we are tracking mouse moves. */\n private _menu: Menu;\n\n /** Reference to the root menu's mouse manager. */\n private _pointerTracker: PointerFocusTracker<Toggler & FocusableElement>;\n\n /** The id associated with the current timeout call waiting to resolve. */\n private _timeoutId: number | null;\n\n /** Emits when this service is destroyed. */\n private readonly _destroyed: Subject<void> = new Subject();\n\n constructor(private readonly _ngZone: NgZone) {}\n\n /** Set the Menu and its PointerFocusTracker. */\n initialize(menu: Menu, pointerTracker: PointerFocusTracker<FocusableElement & Toggler>) {\n this._menu = menu;\n this._pointerTracker = pointerTracker;\n this._subscribeToMouseMoves();\n }\n\n /**\n * Calls the `doToggle` callback when it is deemed that the user is not moving towards\n * the submenu.\n * @param doToggle the function called when the user is not moving towards the submenu.\n */\n toggle(doToggle: () => void) {\n // If the menu is horizontal the sub-menus open below and there is no risk of premature\n // closing of any sub-menus therefore we automatically resolve the callback.\n if (this._menu.orientation === 'horizontal') {\n doToggle();\n }\n\n this._checkConfigured();\n\n const siblingItemIsWaiting = !!this._timeoutId;\n const hasPoints = this._points.length > 1;\n\n if (hasPoints && !siblingItemIsWaiting) {\n if (this._isMovingToSubmenu()) {\n this._startTimeout(doToggle);\n } else {\n doToggle();\n }\n } else if (!siblingItemIsWaiting) {\n doToggle();\n }\n }\n\n /**\n * Start the delayed toggle handler if one isn't running already.\n *\n * The delayed toggle handler executes the `doToggle` callback after some period of time iff the\n * users mouse is on an item in the current menu.\n */\n private _startTimeout(doToggle: () => void) {\n // If the users mouse is moving towards a submenu we don't want to immediately resolve.\n // Wait for some period of time before determining if the previous menu should close in\n // cases where the user may have moved towards the submenu but stopped on a sibling menu\n // item intentionally.\n const timeoutId = setTimeout(() => {\n // Resolve if the user is currently moused over some element in the root menu\n if (this._pointerTracker!.activeElement && timeoutId === this._timeoutId) {\n doToggle();\n }\n this._timeoutId = null;\n }, CLOSE_DELAY) as any as number;\n\n this._timeoutId = timeoutId;\n }\n\n /** Whether the user is heading towards the open submenu. */\n private _isMovingToSubmenu() {\n const submenuPoints = this._getSubmenuBounds();\n if (!submenuPoints) {\n return false;\n }\n\n let numMoving = 0;\n const currPoint = this._points[this._points.length - 1];\n // start from the second last point and calculate the slope between each point and the last\n // point.\n for (let i = this._points.length - 2; i >= 0; i--) {\n const previous = this._points[i];\n const slope = getSlope(currPoint, previous);\n if (isWithinSubmenu(submenuPoints, slope, getYIntercept(currPoint, slope))) {\n numMoving++;\n }\n }\n return numMoving >= Math.floor(NUM_POINTS / 2);\n }\n\n /** Get the bounding DOMRect for the open submenu. */\n private _getSubmenuBounds(): DOMRect | undefined {\n return this._pointerTracker?.previousElement\n ?.getMenu()\n ?._elementRef.nativeElement.getBoundingClientRect();\n }\n\n /**\n * Check if a reference to the PointerFocusTracker and menu element is provided.\n * @throws an error if neither reference is provided.\n */\n private _checkConfigured() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._pointerTracker) {\n throwMissingPointerFocusTracker();\n }\n if (!this._menu) {\n throwMissingMenuReference();\n }\n }\n }\n\n /** Subscribe to the root menus mouse move events and update the tracked mouse points. */\n private _subscribeToMouseMoves() {\n this._ngZone.runOutsideAngular(() => {\n fromEvent<MouseEvent>(this._menu._elementRef.nativeElement, 'mousemove')\n .pipe(\n filter((_: MouseEvent, index: number) => index % MOUSE_MOVE_SAMPLE_FREQUENCY === 0),\n takeUntil(this._destroyed),\n )\n .subscribe((event: MouseEvent) => {\n this._points.push({x: event.clientX, y: event.clientY});\n if (this._points.length > NUM_POINTS) {\n this._points.shift();\n }\n });\n });\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n}\n\n/**\n * CdkTargetMenuAim is a provider for the TargetMenuAim service. It should be added to an\n * element with either the `cdkMenu` or `cdkMenuBar` directive and child menu items.\n */\n@Directive({\n selector: '[cdkTargetMenuAim]',\n exportAs: 'cdkTargetMenuAim',\n providers: [{provide: MENU_AIM, useClass: TargetMenuAim}],\n})\nexport class CdkTargetMenuAim {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n Input,\n Output,\n EventEmitter,\n ElementRef,\n ViewContainerRef,\n Inject,\n OnDestroy,\n Optional,\n NgZone,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {TemplatePortal} from '@angular/cdk/portal';\nimport {\n OverlayRef,\n Overlay,\n OverlayConfig,\n ConnectedPosition,\n FlexibleConnectedPositionStrategy,\n} from '@angular/cdk/overlay';\nimport {SPACE, ENTER, RIGHT_ARROW, LEFT_ARROW, DOWN_ARROW, UP_ARROW} from '@angular/cdk/keycodes';\nimport {fromEvent, Subject, merge} from 'rxjs';\nimport {takeUntil, filter} from 'rxjs/operators';\nimport {CdkMenuPanel} from './menu-panel';\nimport {Menu, CDK_MENU} from './menu-interface';\nimport {FocusNext, MenuStack} from './menu-stack';\nimport {throwExistingMenuStackError} from './menu-errors';\nimport {MENU_AIM, MenuAim} from './menu-aim';\n\n/**\n * Whether the target element is a menu item to be ignored by the overlay background click handler.\n */\nexport function isClickInsideMenuOverlay(target: Element): boolean {\n while (target?.parentElement) {\n const isOpenTrigger =\n target.getAttribute('aria-expanded') === 'true' &&\n target.classList.contains('cdk-menu-trigger');\n const isOverlayMenu =\n target.classList.contains('cdk-menu') && !target.classList.contains('cdk-menu-inline');\n\n if (isOpenTrigger || isOverlayMenu) {\n return true;\n }\n target = target.parentElement;\n }\n return false;\n}\n\n/**\n * A directive to be combined with CdkMenuItem which opens the Menu it is bound to. If the\n * element is in a top level MenuBar it will open the menu on click, or if a sibling is already\n * opened it will open on hover. If it is inside of a Menu it will open the attached Submenu on\n * hover regardless of its sibling state.\n *\n * The directive must be placed along with the `cdkMenuItem` directive in order to enable full\n * functionality.\n */\n@Directive({\n selector: '[cdkMenuTriggerFor]',\n exportAs: 'cdkMenuTriggerFor',\n host: {\n '(keydown)': '_toggleOnKeydown($event)',\n '(click)': 'toggle()',\n 'class': 'cdk-menu-trigger',\n 'aria-haspopup': 'menu',\n '[attr.aria-expanded]': 'isMenuOpen()',\n },\n})\nexport class CdkMenuItemTrigger implements OnDestroy {\n /** Template reference variable to the menu this trigger opens */\n @Input('cdkMenuTriggerFor')\n get menuPanel(): CdkMenuPanel | undefined {\n return this._menuPanel;\n }\n set menuPanel(panel: CdkMenuPanel | undefined) {\n // If the provided panel already has a stack, that means it already has a trigger configured.\n // Note however that there are some edge cases where two triggers **may** share the same menu,\n // e.g. two triggers in two separate menus.\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && panel?._menuStack) {\n throwExistingMenuStackError();\n }\n\n this._menuPanel = panel;\n if (this._menuPanel) {\n this._menuPanel._menuStack = this._getMenuStack();\n }\n }\n\n /** Reference to the MenuPanel this trigger toggles. */\n private _menuPanel?: CdkMenuPanel;\n\n /** Emits when the attached menu is requested to open */\n @Output('cdkMenuOpened') readonly opened: EventEmitter<void> = new EventEmitter();\n\n /** Emits when the attached menu is requested to close */\n @Output('cdkMenuClosed') readonly closed: EventEmitter<void> = new EventEmitter();\n\n /** The menu stack for this trigger and its sub-menus. */\n _menuStack: MenuStack = new MenuStack();\n\n /** A reference to the overlay which manages the triggered menu */\n private _overlayRef: OverlayRef | null = null;\n\n /** The content of the menu panel opened by this trigger. */\n private _panelContent: TemplatePortal;\n\n /** Emits when this trigger is destroyed. */\n private readonly _destroyed: Subject<void> = new Subject();\n\n /** Emits when the outside pointer events listener on the overlay should be stopped. */\n private readonly _stopOutsideClicksListener = merge(this.closed, this._destroyed);\n\n constructor(\n private readonly _elementRef: ElementRef<HTMLElement>,\n protected readonly _viewContainerRef: ViewContainerRef,\n private readonly _overlay: Overlay,\n private readonly _ngZone: NgZone,\n @Optional() @Inject(CDK_MENU) private readonly _parentMenu?: Menu,\n @Optional() @Inject(MENU_AIM) private readonly _menuAim?: MenuAim,\n @Optional() private readonly _directionality?: Directionality,\n ) {\n this._registerCloseHandler();\n this._subscribeToMouseEnter();\n }\n\n /** Open/close the attached menu if the trigger has been configured with one */\n toggle() {\n if (this.hasMenu()) {\n this.isMenuOpen() ? this.closeMenu() : this.openMenu();\n }\n }\n\n /** Open the attached menu. */\n openMenu() {\n if (!this.isMenuOpen()) {\n this.opened.next();\n\n this._overlayRef = this._overlayRef || this._overlay.create(this._getOverlayConfig());\n this._overlayRef.attach(this._getPortal());\n this._subscribeToOutsideClicks();\n }\n }\n\n /** Close the opened menu. */\n closeMenu() {\n if (this.isMenuOpen()) {\n this.closed.next();\n\n this._overlayRef!.detach();\n }\n this._closeSiblingTriggers();\n }\n\n /** Return true if the trigger has an attached menu */\n hasMenu() {\n return !!this.menuPanel;\n }\n\n /** Whether the menu this button is a trigger for is open */\n isMenuOpen() {\n return this._overlayRef ? this._overlayRef.hasAttached() : false;\n }\n\n /**\n * Get a reference to the rendered Menu if the Menu is open and it is visible in the DOM.\n * @return the menu if it is open, otherwise undefined.\n */\n getMenu(): Menu | undefined {\n return this.menuPanel?._menu;\n }\n\n /**\n * Subscribe to the mouseenter events and close any sibling menu items if this element is moused\n * into.\n */\n private _subscribeToMouseEnter() {\n // Closes any sibling menu items and opens the menu associated with this trigger.\n const toggleMenus = () =>\n this._ngZone.run(() => {\n this._closeSiblingTriggers();\n this.openMenu();\n });\n\n this._ngZone.runOutsideAngular(() => {\n fromEvent(this._elementRef.nativeElement, 'mouseenter')\n .pipe(\n filter(() => !this._getMenuStack()?.isEmpty() && !this.isMenuOpen()),\n takeUntil(this._destroyed),\n )\n .subscribe(() => {\n if (this._menuAim) {\n this._menuAim.toggle(toggleMenus);\n } else {\n toggleMenus();\n }\n });\n });\n }\n\n /**\n * Handles keyboard events for the menu item, specifically opening/closing the attached menu and\n * focusing the appropriate submenu item.\n * @param event the keyboard event to handle\n */\n _toggleOnKeydown(event: KeyboardEvent) {\n const keyCode = event.keyCode;\n switch (keyCode) {\n case SPACE:\n case ENTER:\n event.preventDefault();\n this.toggle();\n this.menuPanel?._menu?.focusFirstItem('keyboard');\n break;\n\n case RIGHT_ARROW:\n if (this._parentMenu && this._isParentVertical()) {\n event.preventDefault();\n if (this._directionality?.value === 'rtl') {\n this._getMenuStack().close(this._parentMenu, FocusNext.currentItem);\n } else {\n this.openMenu();\n this.menuPanel?._menu?.focusFirstItem('keyboard');\n }\n }\n break;\n\n case LEFT_ARROW:\n if (this._parentMenu && this._isParentVertical()) {\n event.preventDefault();\n if (this._directionality?.value === 'rtl') {\n this.openMenu();\n this.menuPanel?._menu?.focusFirstItem('keyboard');\n } else {\n this._getMenuStack().close(this._parentMenu, FocusNext.currentItem);\n }\n }\n break;\n\n case DOWN_ARROW:\n case UP_ARROW:\n if (!this._isParentVertical()) {\n event.preventDefault();\n this.openMenu();\n keyCode === DOWN_ARROW\n ? this.menuPanel?._menu?.focusFirstItem('keyboard')\n : this.menuPanel?._menu?.focusLastItem('keyboard');\n }\n break;\n }\n }\n\n /** Close out any sibling menu trigger menus. */\n private _closeSiblingTriggers() {\n if (this._parentMenu) {\n const menuStack = this._getMenuStack();\n\n // If nothing was removed from the stack and the last element is not the parent item\n // that means that the parent menu is a menu bar since we don't put the menu bar on the\n // stack\n const isParentMenuBar =\n !menuStack.closeSubMenuOf(this._parentMenu) && menuStack.peek() !== this._parentMenu;\n\n if (isParentMenuBar) {\n menuStack.closeAll();\n }\n } else {\n this._getMenuStack().closeAll();\n }\n }\n\n /** Get the configuration object used to create the overlay */\n private _getOverlayConfig() {\n return new OverlayConfig({\n positionStrategy: this._getOverlayPositionStrategy(),\n scrollStrategy: this._overlay.scrollStrategies.block(),\n direction: this._directionality,\n });\n }\n\n /** Build the position strategy for the overlay which specifies where to place the menu */\n private _getOverlayPositionStrategy(): FlexibleConnectedPositionStrategy {\n return this._overlay\n .position()\n .flexibleConnectedTo(this._elementRef)\n .withPositions(this._getOverlayPositions());\n }\n\n /** Determine and return where to position the opened menu relative to the menu item */\n private _getOverlayPositions(): ConnectedPosition[] {\n // TODO: use a common positioning config from (possibly) cdk/overlay\n return !this._parentMenu || this._parentMenu.orientation === 'horizontal'\n ? [\n {originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top'},\n {originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom'},\n {originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top'},\n {originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom'},\n ]\n : [\n {originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top'},\n {originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom'},\n {originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top'},\n {originX: 'start', originY: 'bottom', overlayX: 'end', overlayY: 'bottom'},\n ];\n }\n\n /**\n * Get the portal to be attached to the overlay which contains the menu. Allows for the menu\n * content to change dynamically and be reflected in the application.\n */\n private _getPortal() {\n const hasMenuContentChanged = this.menuPanel?._templateRef !== this._panelContent?.templateRef;\n if (this.menuPanel && (!this._panelContent || hasMenuContentChanged)) {\n this._panelContent = new TemplatePortal(this.menuPanel._templateRef, this._viewContainerRef);\n }\n\n return this._panelContent;\n }\n\n /**\n * @return true if if the enclosing parent menu is configured in a vertical orientation.\n */\n private _isParentVertical() {\n return this._parentMenu?.orientation === 'vertical';\n }\n\n /**\n * Subscribe to the MenuStack close events if this is a standalone trigger and close out the menu\n * this triggers when requested.\n */\n private _registerCloseHandler() {\n if (!this._parentMenu) {\n this._menuStack.closed.pipe(takeUntil(this._destroyed)).subscribe(item => {\n if (item === this._menuPanel?._menu) {\n this.closeMenu();\n }\n });\n }\n }\n\n /** Get the menu stack for this trigger - either from the parent or this trigger. */\n private _getMenuStack() {\n // We use a function since at the construction of the MenuItemTrigger the parent Menu won't have\n // its menu stack set. Therefore we need to reference the menu stack from the parent each time\n // we want to use it.\n return this._parentMenu?._menuStack || this._menuStack;\n }\n\n ngOnDestroy() {\n this._destroyOverlay();\n this._resetPanelMenuStack();\n\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Set the menu panels menu stack back to null. */\n private _resetPanelMenuStack() {\n // If a CdkMenuTrigger is placed in a submenu, each time the trigger is rendered (its parent\n // menu is opened) the panel setter for CdkMenuPanel is called. From the first render onward,\n // the attached CdkMenuPanel has the MenuStack set. Since we throw an error if a panel already\n // has a stack set, we want to reset the attached stack here to prevent the error from being\n // thrown if the trigger re-configures its attached panel (in the case where there is a 1:1\n // relationship between the panel and trigger).\n if (this._menuPanel) {\n this._menuPanel._menuStack = null;\n }\n }\n\n /**\n * Subscribe to the overlays outside pointer events stream and handle closing out the stack if a\n * click occurs outside the menus.\n */\n private _subscribeToOutsideClicks() {\n if (this._overlayRef) {\n this._overlayRef\n .outsidePointerEvents()\n .pipe(takeUntil(this._stopOutsideClicksListener))\n .subscribe(event => {\n if (!isClickInsideMenuOverlay(event.target as Element)) {\n this._getMenuStack().closeAll();\n }\n });\n }\n }\n\n /** Destroy and unset the overlay reference it if exists */\n private _destroyOverlay() {\n if (this._overlayRef) {\n this._overlayRef.dispose();\n this._overlayRef = null;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n Input,\n Optional,\n Self,\n ElementRef,\n Output,\n EventEmitter,\n Inject,\n HostListener,\n NgZone,\n OnDestroy,\n} from '@angular/core';\nimport {coerceBooleanProperty, BooleanInput} from '@angular/cdk/coercion';\nimport {FocusableOption} from '@angular/cdk/a11y';\nimport {SPACE, ENTER, RIGHT_ARROW, LEFT_ARROW} from '@angular/cdk/keycodes';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {Subject, fromEvent} from 'rxjs';\nimport {takeUntil, filter} from 'rxjs/operators';\nimport {CdkMenuItemTrigger} from './menu-item-trigger';\nimport {Menu, CDK_MENU} from './menu-interface';\nimport {FocusNext} from './menu-stack';\nimport {FocusableElement} from './pointer-focus-tracker';\nimport {Toggler, MENU_AIM, MenuAim} from './menu-aim';\n\n// TODO refactor this to be configurable allowing for custom elements to be removed\n/** Removes all icons from within the given element. */\nfunction removeIcons(element: Element) {\n for (const icon of Array.from(element.querySelectorAll('mat-icon, .material-icons'))) {\n icon.remove();\n }\n}\n\n/**\n * Directive which provides the ability for an element to be focused and navigated to using the\n * keyboard when residing in a CdkMenu, CdkMenuBar, or CdkMenuGroup. It performs user defined\n * behavior when clicked.\n */\n@Directive({\n selector: '[cdkMenuItem]',\n exportAs: 'cdkMenuItem',\n host: {\n '[tabindex]': '_tabindex',\n 'type': 'button',\n 'role': 'menuitem',\n 'class': 'cdk-menu-item',\n '[attr.aria-disabled]': 'disabled || null',\n },\n})\nexport class CdkMenuItem implements FocusableOption, FocusableElement, Toggler, OnDestroy {\n /** Whether the CdkMenuItem is disabled - defaults to false */\n @Input()\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n }\n private _disabled = false;\n\n /**\n * If this MenuItem is a regular MenuItem, outputs when it is triggered by a keyboard or mouse\n * event.\n */\n @Output('cdkMenuItemTriggered') readonly triggered: EventEmitter<void> = new EventEmitter();\n\n /**\n * The tabindex for this menu item managed internally and used for implementing roving a\n * tab index.\n */\n _tabindex: 0 | -1 = -1;\n\n /** Emits when the menu item is destroyed. */\n private readonly _destroyed = new Subject<void>();\n\n constructor(\n readonly _elementRef: ElementRef<HTMLElement>,\n private readonly _ngZone: NgZone,\n @Optional() @Inject(CDK_MENU) private readonly _parentMenu?: Menu,\n @Optional() @Inject(MENU_AIM) private readonly _menuAim?: MenuAim,\n @Optional() private readonly _dir?: Directionality,\n /** Reference to the CdkMenuItemTrigger directive if one is added to the same element */\n // `CdkMenuItem` is commonly used in combination with a `CdkMenuItemTrigger`.\n // tslint:disable-next-line: lightweight-tokens\n @Self() @Optional() private readonly _menuTrigger?: CdkMenuItemTrigger,\n ) {\n this._setupMouseEnter();\n\n if (this._isStandaloneItem()) {\n this._tabindex = 0;\n }\n }\n\n /** Place focus on the element. */\n focus() {\n this._elementRef.nativeElement.focus();\n }\n\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n @HostListener('blur')\n @HostListener('mouseout')\n /** Reset the _tabindex to -1. */\n _resetTabIndex() {\n if (!this._isStandaloneItem()) {\n this._tabindex = -1;\n }\n }\n\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n @HostListener('focus')\n @HostListener('mouseenter', ['$event'])\n /**\n * Set the tab index to 0 if not disabled and it's a focus event, or a mouse enter if this element\n * is not in a menu bar.\n */\n _setTabIndex(event?: MouseEvent) {\n if (this.disabled) {\n return;\n }\n\n // don't set the tabindex if there are no open sibling or parent menus\n if (!event || !this._getMenuStack()?.isEmpty()) {\n this._tabindex = 0;\n }\n }\n\n /** Whether this menu item is standalone or within a menu or menu bar. */\n _isStandaloneItem() {\n return !this._parentMenu;\n }\n\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n @HostListener('click')\n /**\n * If the menu item is not disabled and the element does not have a menu trigger attached, emit\n * on the cdkMenuItemTriggered emitter and close all open menus.\n */\n trigger() {\n if (!this.disabled && !this.hasMenu()) {\n this.triggered.next();\n this._getMenuStack()?.closeAll();\n }\n }\n\n /** Whether the menu item opens a menu. */\n hasMenu() {\n return !!this._menuTrigger?.hasMenu();\n }\n\n /** Return true if this MenuItem has an attached menu and it is open. */\n isMenuOpen() {\n return !!this._menuTrigger?.isMenuOpen();\n }\n\n /**\n * Get a reference to the rendered Menu if the Menu is open and it is visible in the DOM.\n * @return the menu if it is open, otherwise undefined.\n */\n getMenu(): Menu | undefined {\n return this._menuTrigger?.getMenu();\n }\n\n /** Get the MenuItemTrigger associated with this element. */\n getMenuTrigger(): CdkMenuItemTrigger | undefined {\n return this._menuTrigger;\n }\n\n /** Get the label for this element which is required by the FocusableOption interface. */\n getLabel(): string {\n // TODO cloning the tree may be expensive; implement a better method\n // we know that the current node is an element type\n const clone = this._elementRef.nativeElement.cloneNode(true) as Element;\n removeIcons(clone);\n\n return clone.textContent?.trim() || '';\n }\n\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n @HostListener('keydown', ['$event'])\n /**\n * Handles keyboard events for the menu item, specifically either triggering the user defined\n * callback or opening/closing the current menu based on whether the left or right arrow key was\n * pressed.\n * @param event the keyboard event to handle\n */\n _onKeydown(event: KeyboardEvent) {\n switch (event.keyCode) {\n case SPACE:\n case ENTER:\n event.preventDefault();\n this.trigger();\n break;\n\n case RIGHT_ARROW:\n if (this._parentMenu && this._isParentVertical() && !this.hasMenu()) {\n event.preventDefault();\n this._dir?.value === 'rtl'\n ? this._getMenuStack()?.close(this._parentMenu, FocusNext.previousItem)\n : this._getMenuStack()?.closeAll(FocusNext.nextItem);\n }\n break;\n\n case LEFT_ARROW:\n if (this._parentMenu && this._isParentVertical() && !this.hasMenu()) {\n event.preventDefault();\n this._dir?.value === 'rtl'\n ? this._getMenuStack()?.closeAll(FocusNext.nextItem)\n : this._getMenuStack()?.close(this._parentMenu, FocusNext.previousItem);\n }\n break;\n }\n }\n\n /**\n * Subscribe to the mouseenter events and close any sibling menu items if this element is moused\n * into.\n */\n private _setupMouseEnter() {\n if (!this._isStandaloneItem()) {\n const closeOpenSiblings = () =>\n this._ngZone.run(() => this._getMenuStack()?.closeSubMenuOf(this._parentMenu!));\n\n this._ngZone.runOutsideAngular(() =>\n fromEvent(this._elementRef.nativeElement, 'mouseenter')\n .pipe(\n filter(() => !this._getMenuStack()?.isEmpty() && !this.hasMenu()),\n takeUntil(this._destroyed),\n )\n .subscribe(() => {\n if (this._menuAim) {\n this._menuAim.toggle(closeOpenSiblings);\n } else {\n closeOpenSiblings();\n }\n }),\n );\n }\n }\n\n /**\n * Return true if the enclosing parent menu is configured in a horizontal orientation, false\n * otherwise or if no parent.\n */\n private _isParentVertical() {\n return this._parentMenu?.orientation === 'vertical';\n }\n\n /** Get the MenuStack from the parent menu. */\n private _getMenuStack() {\n // We use a function since at the construction of the MenuItemTrigger the parent Menu won't have\n // its menu stack set. Therefore we need to reference the menu stack from the parent each time\n // we want to use it.\n return this._parentMenu?._menuStack;\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceBooleanProperty, BooleanInput} from '@angular/cdk/coercion';\nimport {Input, Directive, Output, EventEmitter} from '@angular/core';\nimport {CdkMenuItem} from './menu-item';\n\n/** Counter used to set a unique id and name for a selectable item */\nlet nextId = 0;\n\n/**\n * Base class providing checked state for MenuItems along with outputting a clicked event when the\n * element is triggered. It provides functionality for selectable elements.\n */\n@Directive()\nexport abstract class CdkMenuItemSelectable extends CdkMenuItem {\n /** Event emitted when the selectable item is clicked */\n @Output('cdkMenuItemToggled') readonly toggled: EventEmitter<CdkMenuItemSelectable> =\n new EventEmitter();\n\n /** Whether the element is checked */\n @Input()\n get checked() {\n return this._checked;\n }\n set checked(value: boolean) {\n this._checked = coerceBooleanProperty(value);\n }\n private _checked = false;\n\n /** The name of the selectable element with a default value */\n @Input() name: string = `cdk-selectable-item-${nextId++}`;\n\n /** The id of the selectable element with a default value */\n @Input() id: string = `cdk-selectable-item-${nextId++}`;\n\n /** If the element is not disabled emit the click event */\n override trigger() {\n if (!this.disabled) {\n this.toggled.next(this);\n }\n }\n\n static ngAcceptInputType_checked: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n Output,\n EventEmitter,\n ContentChildren,\n AfterContentInit,\n QueryList,\n OnDestroy,\n} from '@angular/core';\nimport {UniqueSelectionDispatcher} from '@angular/cdk/collections';\nimport {takeUntil} from 'rxjs/operators';\nimport {CdkMenuItemSelectable} from './menu-item-selectable';\nimport {CdkMenuItem} from './menu-item';\n\n/**\n * Directive which acts as a grouping container for `CdkMenuItem` instances with\n * `role=\"menuitemradio\"`, similar to a `role=\"radiogroup\"` element.\n */\n@Directive({\n selector: '[cdkMenuGroup]',\n exportAs: 'cdkMenuGroup',\n host: {\n 'role': 'group',\n 'class': 'cdk-menu-group',\n },\n providers: [{provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher}],\n})\nexport class CdkMenuGroup implements AfterContentInit, OnDestroy {\n /** Emits the element when checkbox or radiobutton state changed */\n @Output() readonly change: EventEmitter<CdkMenuItem> = new EventEmitter();\n\n /** List of menuitemcheckbox or menuitemradio elements which reside in this group */\n @ContentChildren(CdkMenuItemSelectable, {descendants: true})\n private readonly _selectableItems: QueryList<CdkMenuItemSelectable>;\n\n /** Emits when the _selectableItems QueryList triggers a change */\n private readonly _selectableChanges: EventEmitter<void> = new EventEmitter();\n\n ngAfterContentInit() {\n this._registerMenuSelectionListeners();\n }\n\n /**\n * Register the child selectable elements with the change emitter and ensure any new child\n * elements do so as well.\n */\n private _registerMenuSelectionListeners() {\n this._selectableItems.forEach(selectable => this._registerClickListener(selectable));\n\n this._selectableItems.changes.subscribe((selectableItems: QueryList<CdkMenuItemSelectable>) => {\n this._selectableChanges.next();\n selectableItems.forEach(selectable => this._registerClickListener(selectable));\n });\n }\n\n /** Register each selectable to emit on the change Emitter when clicked */\n private _registerClickListener(selectable: CdkMenuItemSelectable) {\n selectable.toggled\n .pipe(takeUntil(this._selectableChanges))\n .subscribe(() => this.change.next(selectable));\n }\n\n ngOnDestroy() {\n this._selectableChanges.next();\n this._selectableChanges.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef} from '@angular/core';\nimport {Menu} from './menu-interface';\nimport {MenuStack} from './menu-stack';\n\n/**\n * Directive applied to an ng-template which wraps a CdkMenu and provides a reference to the\n * child element it wraps which allows for opening of the CdkMenu in an overlay.\n */\n@Directive({selector: 'ng-template[cdkMenuPanel]', exportAs: 'cdkMenuPanel'})\nexport class CdkMenuPanel {\n /** Reference to the child menu component */\n _menu?: Menu;\n\n /** Keep track of open Menus. */\n _menuStack: MenuStack | null;\n\n constructor(readonly _templateRef: TemplateRef<unknown>) {}\n\n /**\n * Set the Menu component on the menu panel. Since we cannot use ContentChild to fetch the\n * child Menu component, the child Menu must register its self with the parent MenuPanel.\n */\n _registerMenu(child: Menu) {\n this._menu = child;\n\n // The ideal solution would be to affect the CdkMenuPanel injector from the CdkMenuTrigger and\n // inject the menu stack reference into the child menu and menu items, however this isn't\n // possible at this time.\n this._menu._menuStack = this._menuStack;\n this._menuStack?.push(child);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {QueryList, ElementRef} from '@angular/core';\nimport {fromEvent, Observable, defer, Subject} from 'rxjs';\nimport {mapTo, mergeAll, takeUntil, startWith, mergeMap} from 'rxjs/operators';\n\n/** Item to track for mouse focus events. */\nexport interface FocusableElement {\n /** A reference to the element to be tracked. */\n _elementRef: ElementRef<HTMLElement>;\n}\n\n/**\n * PointerFocusTracker keeps track of the currently active item under mouse focus. It also has\n * observables which emit when the users mouse enters and leaves a tracked element.\n */\nexport class PointerFocusTracker<T extends FocusableElement> {\n /** Emits when an element is moused into. */\n readonly entered: Observable<T> = this._getItemPointerEntries();\n\n /** Emits when an element is moused out. */\n readonly exited: Observable<T> = this._getItemPointerExits();\n\n /** The element currently under mouse focus. */\n activeElement?: T;\n\n /** The element previously under mouse focus. */\n previousElement?: T;\n\n /** Emits when this is destroyed. */\n private readonly _destroyed: Subject<void> = new Subject();\n\n constructor(private readonly _items: QueryList<T>) {\n this.entered.subscribe(element => (this.activeElement = element));\n this.exited.subscribe(() => {\n this.previousElement = this.activeElement;\n this.activeElement = undefined;\n });\n }\n\n /**\n * Gets a stream of pointer (mouse) entries into the given items.\n * This should typically run outside the Angular zone.\n */\n private _getItemPointerEntries(): Observable<T> {\n return defer(() =>\n this._items.changes.pipe(\n startWith(this._items),\n mergeMap((list: QueryList<T>) =>\n list.map(element =>\n fromEvent(element._elementRef.nativeElement, 'mouseenter').pipe(\n mapTo(element),\n takeUntil(this._items.changes),\n ),\n ),\n ),\n mergeAll(),\n ),\n );\n }\n\n /**\n * Gets a stream of pointer (mouse) exits out of the given items.\n * This should typically run outside the Angular zone.\n */\n private _getItemPointerExits() {\n return defer(() =>\n this._items.changes.pipe(\n startWith(this._items),\n mergeMap((list: QueryList<T>) =>\n list.map(element =>\n fromEvent(element._elementRef.nativeElement, 'mouseout').pipe(\n mapTo(element),\n takeUntil(this._items.changes),\n ),\n ),\n ),\n mergeAll(),\n ),\n );\n }\n\n /** Stop the managers listeners. */\n destroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n Input,\n Output,\n EventEmitter,\n QueryList,\n ContentChildren,\n AfterContentInit,\n OnDestroy,\n Optional,\n OnInit,\n NgZone,\n HostListener,\n ElementRef,\n Inject,\n Self,\n} from '@angular/core';\nimport {FocusKeyManager, FocusOrigin} from '@angular/cdk/a11y';\nimport {\n LEFT_ARROW,\n RIGHT_ARROW,\n UP_ARROW,\n DOWN_ARROW,\n ESCAPE,\n TAB,\n hasModifierKey,\n} from '@angular/cdk/keycodes';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {merge} from 'rxjs';\nimport {take, takeUntil, startWith, mergeMap, mapTo, mergeAll, switchMap} from 'rxjs/operators';\nimport {CdkMenuGroup} from './menu-group';\nimport {CdkMenuPanel} from './menu-panel';\nimport {Menu, CDK_MENU} from './menu-interface';\nimport {CdkMenuItem} from './menu-item';\nimport {MenuStack, MenuStackItem, FocusNext, NoopMenuStack} from './menu-stack';\nimport {PointerFocusTracker} from './pointer-focus-tracker';\nimport {MENU_AIM, MenuAim} from './menu-aim';\n\n/**\n * Directive which configures the element as a Menu which should contain child elements marked as\n * CdkMenuItem or CdkMenuGroup. Sets the appropriate role and aria-attributes for a menu and\n * contains accessible keyboard and mouse handling logic.\n *\n * It also acts as a RadioGroup for elements marked with role `menuitemradio`.\n */\n@Directive({\n selector: '[cdkMenu]',\n exportAs: 'cdkMenu',\n host: {\n '[tabindex]': '_isInline() ? 0 : null',\n 'role': 'menu',\n 'class': 'cdk-menu',\n '[class.cdk-menu-inline]': '_isInline()',\n '[attr.aria-orientation]': 'orientation',\n },\n providers: [\n {provide: CdkMenuGroup, useExisting: CdkMenu},\n {provide: CDK_MENU, useExisting: CdkMenu},\n ],\n})\nexport class CdkMenu extends CdkMenuGroup implements Menu, AfterContentInit, OnInit, OnDestroy {\n /**\n * Sets the aria-orientation attribute and determines where menus will be opened.\n * Does not affect styling/layout.\n */\n @Input('cdkMenuOrientation') orientation: 'horizontal' | 'vertical' = 'vertical';\n\n /** Event emitted when the menu is closed. */\n @Output() readonly closed: EventEmitter<void | 'click' | 'tab' | 'escape'> = new EventEmitter();\n\n // We provide a default MenuStack implementation in case the menu is an inline menu.\n // For Menus part of a MenuBar nested within a MenuPanel this will be overwritten\n // to the correct parent MenuStack.\n /** Track the Menus making up the open menu stack. */\n _menuStack: MenuStack = new NoopMenuStack();\n\n /** Handles keyboard events for the menu. */\n private _keyManager: FocusKeyManager<CdkMenuItem>;\n\n /** Manages items under mouse focus. */\n private _pointerTracker?: PointerFocusTracker<CdkMenuItem>;\n\n /** List of nested CdkMenuGroup elements */\n @ContentChildren(CdkMenuGroup, {descendants: true})\n private readonly _nestedGroups: QueryList<CdkMenuGroup>;\n\n /** All child MenuItem elements nested in this Menu. */\n @ContentChildren(CdkMenuItem, {descendants: true})\n private readonly _allItems: QueryList<CdkMenuItem>;\n\n /** The Menu Item which triggered the open submenu. */\n private _openItem?: CdkMenuItem;\n\n /**\n * A reference to the enclosing parent menu panel.\n *\n * Required to be set when using ViewEngine since ViewEngine does support injecting a reference to\n * the parent directive if the parent directive is placed on an `ng-template`. If using Ivy, the\n * injected value will be used over this one.\n */\n @Input('cdkMenuPanel') private readonly _explicitPanel?: CdkMenuPanel;\n\n constructor(\n private readonly _ngZone: NgZone,\n readonly _elementRef: ElementRef<HTMLElement>,\n @Self() @Optional() @Inject(MENU_AIM) private readonly _menuAim?: MenuAim,\n @Optional() private readonly _dir?: Directionality,\n // `CdkMenuPanel` is always used in combination with a `CdkMenu`.\n // tslint:disable-next-line: lightweight-tokens\n @Optional() private readonly _menuPanel?: CdkMenuPanel,\n ) {\n super();\n }\n\n ngOnInit() {\n this._registerWithParentPanel();\n }\n\n override ngAfterContentInit() {\n super.ngAfterContentInit();\n\n this._completeChangeEmitter();\n this._setKeyManager();\n this._subscribeToMenuOpen();\n this._subscribeToMenuStack();\n this._subscribeToMouseManager();\n\n this._menuAim?.initialize(this, this._pointerTracker!);\n }\n\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n @HostListener('focus')\n /** Place focus on the first MenuItem in the menu and set the focus origin. */\n focusFirstItem(focusOrigin: FocusOrigin = 'program') {\n this._keyManager.setFocusOrigin(focusOrigin);\n this._keyManager.setFirstItemActive();\n }\n\n /** Place focus on the last MenuItem in the menu and set the focus origin. */\n focusLastItem(focusOrigin: FocusOrigin = 'program') {\n this._keyManager.setFocusOrigin(focusOrigin);\n this._keyManager.setLastItemActive();\n }\n\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n @HostListener('keydown', ['$event'])\n /** Handle keyboard events for the Menu. */\n _handleKeyEvent(event: KeyboardEvent) {\n const keyManager = this._keyManager;\n switch (event.keyCode) {\n case LEFT_ARROW:\n case RIGHT_ARROW:\n if (this._isHorizontal()) {\n event.preventDefault();\n keyManager.setFocusOrigin('keyboard');\n keyManager.onKeydown(event);\n }\n break;\n\n case UP_ARROW:\n case DOWN_ARROW:\n if (!this._isHorizontal()) {\n event.preventDefault();\n keyManager.setFocusOrigin('keyboard');\n keyManager.onKeydown(event);\n }\n break;\n\n case ESCAPE:\n if (!hasModifierKey(event)) {\n event.preventDefault();\n this._menuStack.close(this, FocusNext.currentItem);\n }\n break;\n\n case TAB:\n this._menuStack.closeAll();\n break;\n\n default:\n keyManager.onKeydown(event);\n }\n }\n\n /** Register this menu with its enclosing parent menu panel */\n private _registerWithParentPanel() {\n this._getMenuPanel()?._registerMenu(this);\n }\n\n /**\n * Get the enclosing CdkMenuPanel defaulting to the injected reference over the developer\n * provided reference.\n */\n private _getMenuPanel() {\n return this._menuPanel || this._explicitPanel;\n }\n\n /**\n * Complete the change emitter if there are any nested MenuGroups or register to complete the\n * change emitter if a MenuGroup is rendered at some point\n */\n private _completeChangeEmitter() {\n if (this._hasNestedGroups()) {\n this.change.complete();\n } else {\n this._nestedGroups.changes.pipe(take(1)).subscribe(() => this.change.complete());\n }\n }\n\n /** Return true if there are nested CdkMenuGroup elements within the Menu */\n private _hasNestedGroups() {\n // view engine has a bug where @ContentChildren will return the current element\n // along with children if the selectors match - not just the children.\n // Here, if there is at least one element, we check to see if the first element is a CdkMenu in\n // order to ensure that we return true iff there are child CdkMenuGroup elements.\n return this._nestedGroups.length > 0 && !(this._nestedGroups.first instanceof CdkMenu);\n }\n\n /** Setup the FocusKeyManager with the correct orientation for the menu. */\n private _setKeyManager() {\n this._keyManager = new FocusKeyManager(this._allItems)\n .withWrap()\n .withTypeAhead()\n .withHomeAndEnd();\n\n if (this._isHorizontal()) {\n this._keyManager.withHorizontalOrientation(this._dir?.value || 'ltr');\n } else {\n this._keyManager.withVerticalOrientation();\n }\n }\n\n /**\n * Set the PointerFocusTracker and ensure that when mouse focus changes the key manager is updated\n * with the latest menu item under mouse focus.\n */\n private _subscribeToMouseManager() {\n this._ngZone.runOutsideAngular(() => {\n this._pointerTracker = new PointerFocusTracker(this._allItems);\n this._pointerTracker.entered\n .pipe(takeUntil(this.closed))\n .subscribe(item => this._keyManager.setActiveItem(item));\n });\n }\n\n /** Subscribe to the MenuStack close and empty observables. */\n private _subscribeToMenuStack() {\n this._menuStack.closed\n .pipe(takeUntil(this.closed))\n .subscribe(item => this._closeOpenMenu(item));\n\n this._menuStack.emptied\n .pipe(takeUntil(this.closed))\n .subscribe(event => this._toggleMenuFocus(event));\n }\n\n /**\n * Close the open menu if the current active item opened the requested MenuStackItem.\n * @param item the MenuStackItem requested to be closed.\n */\n private _closeOpenMenu(menu: MenuStackItem | undefined) {\n const keyManager = this._keyManager;\n const trigger = this._openItem;\n if (menu === trigger?.getMenuTrigger()?.getMenu()) {\n trigger?.getMenuTrigger()?.closeMenu();\n // If the user has moused over a sibling item we want to focus the element under mouse focus\n // not the trigger which previously opened the now closed menu.\n if (trigger) {\n keyManager.setActiveItem(this._pointerTracker?.activeElement || trigger);\n }\n }\n }\n\n /** Set focus the either the current, previous or next item based on the FocusNext event. */\n private _toggleMenuFocus(event: FocusNext | undefined) {\n const keyManager = this._keyManager;\n switch (event) {\n case FocusNext.nextItem:\n keyManager.setFocusOrigin('keyboard');\n keyManager.setNextItemActive();\n break;\n\n case FocusNext.previousItem:\n keyManager.setFocusOrigin('keyboard');\n keyManager.setPreviousItemActive();\n break;\n\n case FocusNext.currentItem:\n if (keyManager.activeItem) {\n keyManager.setFocusOrigin('keyboard');\n keyManager.setActiveItem(keyManager.activeItem);\n }\n break;\n }\n }\n\n // TODO(andy9775): remove duplicate logic between menu an menu bar\n /**\n * Subscribe to the menu trigger's open events in order to track the trigger which opened the menu\n * and stop tracking it when the menu is closed.\n */\n private _subscribeToMenuOpen() {\n const exitCondition = merge(this._allItems.changes, this.closed);\n this._allItems.changes\n .pipe(\n startWith(this._allItems),\n mergeMap((list: QueryList<CdkMenuItem>) =>\n list\n .filter(item => item.hasMenu())\n .map(item => item.getMenuTrigger()!.opened.pipe(mapTo(item), takeUntil(exitCondition))),\n ),\n mergeAll(),\n switchMap((item: CdkMenuItem) => {\n this._openItem = item;\n return item.getMenuTrigger()!.closed;\n }),\n takeUntil(this.closed),\n )\n .subscribe(() => (this._openItem = undefined));\n }\n\n /** Return true if this menu has been configured in a horizontal orientation. */\n private _isHorizontal() {\n return this.orientation === 'horizontal';\n }\n\n /**\n * Return true if this menu is an inline menu. That is, it does not exist in a pop-up and is\n * always visible in the dom.\n */\n _isInline() {\n // NoopMenuStack is the default. If this menu is not inline than the NoopMenuStack is replaced\n // automatically.\n return this._menuStack instanceof NoopMenuStack;\n }\n\n override ngOnDestroy() {\n this._emitClosedEvent();\n this._pointerTracker?.destroy();\n }\n\n /** Emit and complete the closed event emitter */\n private _emitClosedEvent() {\n this.closed.next();\n this.closed.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n Input,\n ContentChildren,\n QueryList,\n AfterContentInit,\n OnDestroy,\n Optional,\n NgZone,\n HostListener,\n ElementRef,\n Inject,\n Self,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {FocusKeyManager, FocusOrigin} from '@angular/cdk/a11y';\nimport {LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW, ESCAPE, TAB} from '@angular/cdk/keycodes';\nimport {takeUntil, mergeAll, mapTo, startWith, mergeMap, switchMap} from 'rxjs/operators';\nimport {Subject, merge} from 'rxjs';\nimport {CdkMenuGroup} from './menu-group';\nimport {CDK_MENU, Menu} from './menu-interface';\nimport {CdkMenuItem} from './menu-item';\nimport {MenuStack, MenuStackItem, FocusNext} from './menu-stack';\nimport {PointerFocusTracker} from './pointer-focus-tracker';\nimport {MenuAim, MENU_AIM} from './menu-aim';\n\n/**\n * Directive applied to an element which configures it as a MenuBar by setting the appropriate\n * role, aria attributes, and accessible keyboard and mouse handling logic. The component that\n * this directive is applied to should contain components marked with CdkMenuItem.\n *\n */\n@Directive({\n selector: '[cdkMenuBar]',\n exportAs: 'cdkMenuBar',\n host: {\n 'role': 'menubar',\n 'class': 'cdk-menu-bar',\n 'tabindex': '0',\n '[attr.aria-orientation]': 'orientation',\n },\n providers: [\n {provide: CdkMenuGroup, useExisting: CdkMenuBar},\n {provide: CDK_MENU, useExisting: CdkMenuBar},\n {provide: MenuStack, useClass: MenuStack},\n ],\n})\nexport class CdkMenuBar extends CdkMenuGroup implements Menu, AfterContentInit, OnDestroy {\n /**\n * Sets the aria-orientation attribute and determines where menus will be opened.\n * Does not affect styling/layout.\n */\n @Input('cdkMenuBarOrientation') orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /** Handles keyboard events for the MenuBar. */\n private _keyManager: FocusKeyManager<CdkMenuItem>;\n\n /** Manages items under mouse focus */\n private _pointerTracker?: PointerFocusTracker<CdkMenuItem>;\n\n /** Emits when the MenuBar is destroyed. */\n private readonly _destroyed: Subject<void> = new Subject();\n\n /** All child MenuItem elements nested in this MenuBar. */\n @ContentChildren(CdkMenuItem, {descendants: true})\n private readonly _allItems: QueryList<CdkMenuItem>;\n\n /** The Menu Item which triggered the open submenu. */\n private _openItem?: CdkMenuItem;\n\n constructor(\n readonly _menuStack: MenuStack,\n private readonly _ngZone: NgZone,\n readonly _elementRef: ElementRef<HTMLElement>,\n @Self() @Optional() @Inject(MENU_AIM) private readonly _menuAim?: MenuAim,\n @Optional() private readonly _dir?: Directionality,\n ) {\n super();\n }\n\n override ngAfterContentInit() {\n super.ngAfterContentInit();\n\n this._setKeyManager();\n this._subscribeToMenuOpen();\n this._subscribeToMenuStack();\n this._subscribeToMouseManager();\n\n this._menuAim?.initialize(this, this._pointerTracker!);\n }\n\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n @HostListener('focus')\n /** Place focus on the first MenuItem in the menu and set the focus origin. */\n focusFirstItem(focusOrigin: FocusOrigin = 'program') {\n this._keyManager.setFocusOrigin(focusOrigin);\n this._keyManager.setFirstItemActive();\n }\n\n /** Place focus on the last MenuItem in the menu and set the focus origin. */\n focusLastItem(focusOrigin: FocusOrigin = 'program') {\n this._keyManager.setFocusOrigin(focusOrigin);\n this._keyManager.setLastItemActive();\n }\n\n // In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order\n // to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we\n // can move this back into `host`.\n // tslint:disable:no-host-decorator-in-concrete\n @HostListener('keydown', ['$event'])\n /**\n * Handle keyboard events, specifically changing the focused element and/or toggling the active\n * items menu.\n * @param event the KeyboardEvent to handle.\n */\n _handleKeyEvent(event: KeyboardEvent) {\n const keyManager = this._keyManager;\n switch (event.keyCode) {\n case UP_ARROW:\n case DOWN_ARROW:\n case LEFT_ARROW:\n case RIGHT_ARROW:\n const horizontalArrows = event.keyCode === LEFT_ARROW || event.keyCode === RIGHT_ARROW;\n // For a horizontal menu if the left/right keys were clicked, or a vertical menu if the\n // up/down keys were clicked: if the current menu is open, close it then focus and open the\n // next menu.\n if (\n (this._isHorizontal() && horizontalArrows) ||\n (!this._isHorizontal() && !horizontalArrows)\n ) {\n event.preventDefault();\n\n const prevIsOpen = keyManager.activeItem?.isMenuOpen();\n keyManager.activeItem?.getMenuTrigger()?.closeMenu();\n\n keyManager.setFocusOrigin('keyboard');\n keyManager.onKeydown(event);\n if (prevIsOpen) {\n keyManager.activeItem?.getMenuTrigger()?.openMenu();\n }\n }\n break;\n\n case ESCAPE:\n event.preventDefault();\n keyManager.activeItem?.getMenuTrigger()?.closeMenu();\n break;\n\n case TAB:\n keyManager.activeItem?.getMenuTrigger()?.closeMenu();\n break;\n\n default:\n keyManager.onKeydown(event);\n }\n }\n\n /** Setup the FocusKeyManager with the correct orientation for the menu bar. */\n private _setKeyManager() {\n this._keyManager = new FocusKeyManager(this._allItems)\n .withWrap()\n .withTypeAhead()\n .withHomeAndEnd();\n\n if (this._isHorizontal()) {\n this._keyManager.withHorizontalOrientation(this._dir?.value || 'ltr');\n } else {\n this._keyManager.withVerticalOrientation();\n }\n }\n\n /**\n * Set the PointerFocusTracker and ensure that when mouse focus changes the key manager is updated\n * with the latest menu item under mouse focus.\n */\n private _subscribeToMouseManager() {\n this._ngZone.runOutsideAngular(() => {\n this._pointerTracker = new PointerFocusTracker(this._allItems);\n this._pointerTracker.entered.pipe(takeUntil(this._destroyed)).subscribe(item => {\n if (this._hasOpenSubmenu()) {\n this._keyManager.setActiveItem(item);\n }\n });\n });\n }\n\n /** Subscribe to the MenuStack close and empty observables. */\n private _subscribeToMenuStack() {\n this._menuStack.closed\n .pipe(takeUntil(this._destroyed))\n .subscribe(item => this._closeOpenMenu(item));\n\n this._menuStack.emptied\n .pipe(takeUntil(this._destroyed))\n .subscribe(event => this._toggleOpenMenu(event));\n }\n\n /**\n * Close the open menu if the current active item opened the requested MenuStackItem.\n * @param item the MenuStackItem requested to be closed.\n */\n private _closeOpenMenu(menu: MenuStackItem | undefined) {\n const trigger = this._openItem;\n const keyManager = this._keyManager;\n if (menu === trigger?.getMenuTrigger()?.getMenu()) {\n trigger?.getMenuTrigger()?.closeMenu();\n // If the user has moused over a sibling item we want to focus the element under mouse focus\n // not the trigger which previously opened the now closed menu.\n if (trigger) {\n keyManager.setActiveItem(this._pointerTracker?.activeElement || trigger);\n }\n }\n }\n\n /**\n * Set focus to either the current, previous or next item based on the FocusNext event, then\n * open the previous or next item.\n */\n private _toggleOpenMenu(event: FocusNext | undefined) {\n const keyManager = this._keyManager;\n switch (event) {\n case FocusNext.nextItem:\n keyManager.setFocusOrigin('keyboard');\n keyManager.setNextItemActive();\n keyManager.activeItem?.getMenuTrigger()?.openMenu();\n break;\n\n case FocusNext.previousItem:\n keyManager.setFocusOrigin('keyboard');\n keyManager.setPreviousItemActive();\n keyManager.activeItem?.getMenuTrigger()?.openMenu();\n break;\n\n case FocusNext.currentItem:\n if (keyManager.activeItem) {\n keyManager.setFocusOrigin('keyboard');\n keyManager.setActiveItem(keyManager.activeItem);\n }\n break;\n }\n }\n\n /**\n * @return true if the menu bar is configured to be horizontal.\n */\n private _isHorizontal() {\n return this.orientation === 'horizontal';\n }\n\n /**\n * Subscribe to the menu trigger's open events in order to track the trigger which opened the menu\n * and stop tracking it when the menu is closed.\n */\n private _subscribeToMenuOpen() {\n const exitCondition = merge(this._allItems.changes, this._destroyed);\n this._allItems.changes\n .pipe(\n startWith(this._allItems),\n mergeMap((list: QueryList<CdkMenuItem>) =>\n list\n .filter(item => item.hasMenu())\n .map(item => item.getMenuTrigger()!.opened.pipe(mapTo(item), takeUntil(exitCondition))),\n ),\n mergeAll(),\n switchMap((item: CdkMenuItem) => {\n this._openItem = item;\n return item.getMenuTrigger()!.closed;\n }),\n takeUntil(this._destroyed),\n )\n .subscribe(() => (this._openItem = undefined));\n }\n\n /** Return true if the MenuBar has an open submenu. */\n private _hasOpenSubmenu() {\n return !!this._openItem;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n\n this._destroyed.next();\n this._destroyed.complete();\n\n this._pointerTracker?.destroy();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {UniqueSelectionDispatcher} from '@angular/cdk/collections';\nimport {Directive, OnDestroy, ElementRef, Self, Optional, Inject, NgZone} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {CdkMenuItemSelectable} from './menu-item-selectable';\nimport {CdkMenuItem} from './menu-item';\nimport {CdkMenuItemTrigger} from './menu-item-trigger';\nimport {CDK_MENU, Menu} from './menu-interface';\nimport {MENU_AIM, MenuAim} from './menu-aim';\n\n/**\n * A directive providing behavior for the \"menuitemradio\" ARIA role, which behaves similarly to\n * a conventional radio-button. Any sibling `CdkMenuItemRadio` instances within the same `CdkMenu`\n * or `CdkMenuGroup` comprise a radio group with unique selection enforced.\n */\n@Directive({\n selector: '[cdkMenuItemRadio]',\n exportAs: 'cdkMenuItemRadio',\n host: {\n '[tabindex]': '_tabindex',\n 'type': 'button',\n 'role': 'menuitemradio',\n '[attr.aria-checked]': 'checked || null',\n '[attr.aria-disabled]': 'disabled || null',\n },\n providers: [\n {provide: CdkMenuItemSelectable, useExisting: CdkMenuItemRadio},\n {provide: CdkMenuItem, useExisting: CdkMenuItemSelectable},\n ],\n})\nexport class CdkMenuItemRadio extends CdkMenuItemSelectable implements OnDestroy {\n /** Function to unregister the selection dispatcher */\n private _removeDispatcherListener: () => void;\n\n constructor(\n private readonly _selectionDispatcher: UniqueSelectionDispatcher,\n element: ElementRef<HTMLElement>,\n ngZone: NgZone,\n @Optional() @Inject(CDK_MENU) parentMenu?: Menu,\n @Optional() @Inject(MENU_AIM) menuAim?: MenuAim,\n @Optional() dir?: Directionality,\n /** Reference to the CdkMenuItemTrigger directive if one is added to the same element */\n // `CdkMenuItemRadio` is commonly used in combination with a `CdkMenuItemTrigger`.\n // tslint:disable-next-line: lightweight-tokens\n @Self() @Optional() menuTrigger?: CdkMenuItemTrigger,\n ) {\n super(element, ngZone, parentMenu, menuAim, dir, menuTrigger);\n\n this._registerDispatcherListener();\n }\n\n /** Configure the unique selection dispatcher listener in order to toggle the checked state */\n private _registerDispatcherListener() {\n this._removeDispatcherListener = this._selectionDispatcher.listen(\n (id: string, name: string) => (this.checked = this.id === id && this.name === name),\n );\n }\n\n /** Toggles the checked state of the radio-button. */\n override trigger() {\n super.trigger();\n\n if (!this.disabled) {\n this._selectionDispatcher.notify(this.id, this.name);\n }\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this._removeDispatcherListener();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive} from '@angular/core';\nimport {CdkMenuItemSelectable} from './menu-item-selectable';\nimport {CdkMenuItem} from './menu-item';\n\n/**\n * A directive providing behavior for the \"menuitemcheckbox\" ARIA role, which behaves similarly to a\n * conventional checkbox.\n */\n@Directive({\n selector: '[cdkMenuItemCheckbox]',\n exportAs: 'cdkMenuItemCheckbox',\n host: {\n '[tabindex]': '_tabindex',\n 'type': 'button',\n 'role': 'menuitemcheckbox',\n '[attr.aria-checked]': 'checked || null',\n '[attr.aria-disabled]': 'disabled || null',\n },\n providers: [\n {provide: CdkMenuItemSelectable, useExisting: CdkMenuItemCheckbox},\n {provide: CdkMenuItem, useExisting: CdkMenuItemSelectable},\n ],\n})\nexport class CdkMenuItemCheckbox extends CdkMenuItemSelectable {\n /** Toggle the checked state of the checkbox. */\n override trigger() {\n super.trigger();\n\n if (!this.disabled) {\n this.checked = !this.checked;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n Input,\n ViewContainerRef,\n Output,\n EventEmitter,\n Optional,\n OnDestroy,\n Inject,\n Injectable,\n InjectionToken,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n OverlayRef,\n Overlay,\n OverlayConfig,\n FlexibleConnectedPositionStrategy,\n ConnectedPosition,\n} from '@angular/cdk/overlay';\nimport {TemplatePortal, Portal} from '@angular/cdk/portal';\nimport {coerceBooleanProperty, BooleanInput} from '@angular/cdk/coercion';\nimport {Subject, merge} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {CdkMenuPanel} from './menu-panel';\nimport {MenuStack} from './menu-stack';\nimport {throwExistingMenuStackError} from './menu-errors';\nimport {isClickInsideMenuOverlay} from './menu-item-trigger';\n\n/** Tracks the last open context menu trigger across the entire application. */\n@Injectable({providedIn: 'root'})\nexport class ContextMenuTracker {\n /** The last open context menu trigger. */\n private static _openContextMenuTrigger?: CdkContextMenuTrigger;\n\n /**\n * Close the previous open context menu and set the given one as being open.\n * @param trigger the trigger for the currently open Context Menu.\n */\n update(trigger: CdkContextMenuTrigger) {\n if (ContextMenuTracker._openContextMenuTrigger !== trigger) {\n ContextMenuTracker._openContextMenuTrigger?.close();\n ContextMenuTracker._openContextMenuTrigger = trigger;\n }\n }\n}\n\n/** Configuration options passed to the context menu. */\nexport type ContextMenuOptions = {\n /** The opened menus X coordinate offset from the triggering position. */\n offsetX: number;\n\n /** The opened menus Y coordinate offset from the triggering position. */\n offsetY: number;\n};\n\n/** Injection token for the ContextMenu options object. */\nexport const CDK_CONTEXT_MENU_DEFAULT_OPTIONS = new InjectionToken<ContextMenuOptions>(\n 'cdk-context-menu-default-options',\n);\n\n/** The coordinates of where the context menu should open. */\nexport type ContextMenuCoordinates = {x: number; y: number};\n\n/**\n * A directive which when placed on some element opens a the Menu it is bound to when a user\n * right-clicks within that element. It is aware of nested Context Menus and the lowest level\n * non-disabled context menu will trigger.\n */\n@Directive({\n selector: '[cdkContextMenuTriggerFor]',\n exportAs: 'cdkContextMenuTriggerFor',\n host: {\n '(contextmenu)': '_openOnContextMenu($event)',\n },\n providers: [\n // In cases where the first menu item in the context menu is a trigger the submenu opens on a\n // hover event. Offsetting the opened context menu by 2px prevents this from occurring.\n {provide: CDK_CONTEXT_MENU_DEFAULT_OPTIONS, useValue: {offsetX: 2, offsetY: 2}},\n ],\n})\nexport class CdkContextMenuTrigger implements OnDestroy {\n /** Template reference variable to the menu to open on right click. */\n @Input('cdkContextMenuTriggerFor')\n get menuPanel(): CdkMenuPanel {\n return this._menuPanel;\n }\n set menuPanel(panel: CdkMenuPanel) {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && panel._menuStack) {\n throwExistingMenuStackError();\n }\n this._menuPanel = panel;\n\n if (this._menuPanel) {\n this._menuPanel._menuStack = this._menuStack;\n }\n }\n /** Reference to the MenuPanel this trigger toggles. */\n private _menuPanel: CdkMenuPanel;\n\n /** Emits when the attached menu is requested to open. */\n @Output('cdkContextMenuOpened') readonly opened: EventEmitter<void> = new EventEmitter();\n\n /** Emits when the attached menu is requested to close. */\n @Output('cdkContextMenuClosed') readonly closed: EventEmitter<void> = new EventEmitter();\n\n /** Whether the context menu should be disabled. */\n @Input('cdkContextMenuDisabled')\n get disabled() {\n return this._disabled;\n }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n }\n private _disabled = false;\n\n /** A reference to the overlay which manages the triggered menu. */\n private _overlayRef: OverlayRef | null = null;\n\n /** The content of the menu panel opened by this trigger. */\n private _panelContent: TemplatePortal;\n\n /** Emits when the element is destroyed. */\n private readonly _destroyed = new Subject<void>();\n\n /** The menu stack for this trigger and its associated menus. */\n private readonly _menuStack = new MenuStack();\n\n /** Emits when the outside pointer events listener on the overlay should be stopped. */\n private readonly _stopOutsideClicksListener = merge(this.closed, this._destroyed);\n\n constructor(\n protected readonly _viewContainerRef: ViewContainerRef,\n private readonly _overlay: Overlay,\n private readonly _contextMenuTracker: ContextMenuTracker,\n @Inject(CDK_CONTEXT_MENU_DEFAULT_OPTIONS) private readonly _options: ContextMenuOptions,\n @Optional() private readonly _directionality?: Directionality,\n ) {\n this._setMenuStackListener();\n }\n\n /**\n * Open the attached menu at the specified location.\n * @param coordinates where to open the context menu\n */\n open(coordinates: ContextMenuCoordinates) {\n if (this.disabled) {\n return;\n } else if (this.isOpen()) {\n // since we're moving this menu we need to close any submenus first otherwise they end up\n // disconnected from this one.\n this._menuStack.closeSubMenuOf(this._menuPanel._menu!);\n\n (\n this._overlayRef!.getConfig().positionStrategy as FlexibleConnectedPositionStrategy\n ).setOrigin(coordinates);\n this._overlayRef!.updatePosition();\n } else {\n this.opened.next();\n\n if (this._overlayRef) {\n (\n this._overlayRef.getConfig().positionStrategy as FlexibleConnectedPositionStrategy\n ).setOrigin(coordinates);\n this._overlayRef.updatePosition();\n } else {\n this._overlayRef = this._overlay.create(this._getOverlayConfig(coordinates));\n }\n\n this._overlayRef.attach(this._getMenuContent());\n this._subscribeToOutsideClicks();\n }\n }\n\n /** Close the opened menu. */\n close() {\n this._menuStack.closeAll();\n }\n\n /**\n * Open the context menu and close any previously open menus.\n * @param event the mouse event which opens the context menu.\n */\n _openOnContextMenu(event: MouseEvent) {\n if (!this.disabled) {\n // Prevent the native context menu from opening because we're opening a custom one.\n event.preventDefault();\n\n // Stop event propagation to ensure that only the closest enabled context menu opens.\n // Otherwise, any context menus attached to containing elements would *also* open,\n // resulting in multiple stacked context menus being displayed.\n event.stopPropagation();\n\n this._contextMenuTracker.update(this);\n this.open({x: event.clientX, y: event.clientY});\n\n // A context menu can be triggered via a mouse right click or a keyboard shortcut.\n if (event.button === 2) {\n this._menuPanel._menu?.focusFirstItem('mouse');\n } else if (event.button === 0) {\n this._menuPanel._menu?.focusFirstItem('keyboard');\n } else {\n this._menuPanel._menu?.focusFirstItem('program');\n }\n }\n }\n\n /** Whether the attached menu is open. */\n isOpen() {\n return !!this._overlayRef?.hasAttached();\n }\n\n /**\n * Get the configuration object used to create the overlay.\n * @param coordinates the location to place the opened menu\n */\n private _getOverlayConfig(coordinates: ContextMenuCoordinates) {\n return new OverlayConfig({\n positionStrategy: this._getOverlayPositionStrategy(coordinates),\n scrollStrategy: this._overlay.scrollStrategies.block(),\n direction: this._directionality,\n });\n }\n\n /**\n * Build the position strategy for the overlay which specifies where to place the menu.\n * @param coordinates the location to place the opened menu\n */\n private _getOverlayPositionStrategy(\n coordinates: ContextMenuCoordinates,\n ): FlexibleConnectedPositionStrategy {\n return this._overlay\n .position()\n .flexibleConnectedTo(coordinates)\n .withDefaultOffsetX(this._options.offsetX)\n .withDefaultOffsetY(this._options.offsetY)\n .withPositions(this._getOverlayPositions());\n }\n\n /**\n * Determine and return where to position the opened menu relative to the mouse location.\n */\n private _getOverlayPositions(): ConnectedPosition[] {\n // TODO: this should be configurable through the injected context menu options\n return [\n {originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top'},\n {originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top'},\n {originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom'},\n {originX: 'start', originY: 'bottom', overlayX: 'end', overlayY: 'bottom'},\n ];\n }\n\n /**\n * Get the portal to be attached to the overlay which contains the menu. Allows for the menu\n * content to change dynamically and be reflected in the application.\n */\n private _getMenuContent(): Portal<unknown> {\n const hasMenuContentChanged = this.menuPanel._templateRef !== this._panelContent?.templateRef;\n if (this.menuPanel && (!this._panelContent || hasMenuContentChanged)) {\n this._panelContent = new TemplatePortal(this.menuPanel._templateRef, this._viewContainerRef);\n }\n\n return this._panelContent;\n }\n\n /** Subscribe to the menu stack close events and close this menu when requested. */\n private _setMenuStackListener() {\n this._menuStack.closed.pipe(takeUntil(this._destroyed)).subscribe(item => {\n if (item === this._menuPanel._menu && this.isOpen()) {\n this.closed.next();\n this._overlayRef!.detach();\n }\n });\n }\n\n /**\n * Subscribe to the overlays outside pointer events stream and handle closing out the stack if a\n * click occurs outside the menus.\n */\n private _subscribeToOutsideClicks() {\n if (this._overlayRef) {\n this._overlayRef\n .outsidePointerEvents()\n .pipe(takeUntil(this._stopOutsideClicksListener))\n .subscribe(event => {\n if (!isClickInsideMenuOverlay(event.target as Element)) {\n this._menuStack.closeAll();\n }\n });\n }\n }\n\n ngOnDestroy() {\n this._destroyOverlay();\n this._resetPanelMenuStack();\n\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Destroy and unset the overlay reference it if exists. */\n private _destroyOverlay() {\n if (this._overlayRef) {\n this._overlayRef.dispose();\n this._overlayRef = null;\n }\n }\n\n /** Set the menu panels menu stack back to null. */\n private _resetPanelMenuStack() {\n // If a ContextMenuTrigger is placed in a conditionally rendered view, each time the trigger is\n // rendered the panel setter for ContextMenuTrigger is called. From the first render onward,\n // the attached CdkMenuPanel has the MenuStack set. Since we throw an error if a panel already\n // has a stack set, we want to reset the attached stack here to prevent the error from being\n // thrown if the trigger re-configures its attached panel (in the case where there is a 1:1\n // relationship between the panel and trigger).\n if (this._menuPanel) {\n this._menuPanel._menuStack = null;\n }\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {OverlayModule} from '@angular/cdk/overlay';\nimport {CdkMenu} from './menu';\nimport {CdkMenuBar} from './menu-bar';\nimport {CdkMenuPanel} from './menu-panel';\nimport {CdkMenuItem} from './menu-item';\nimport {CdkMenuGroup} from './menu-group';\nimport {CdkMenuItemRadio} from './menu-item-radio';\nimport {CdkMenuItemCheckbox} from './menu-item-checkbox';\nimport {CdkMenuItemTrigger} from './menu-item-trigger';\nimport {CdkContextMenuTrigger} from './context-menu';\nimport {CdkTargetMenuAim} from './menu-aim';\n\nconst EXPORTED_DECLARATIONS = [\n CdkMenuBar,\n CdkMenu,\n CdkMenuPanel,\n CdkMenuItem,\n CdkMenuItemRadio,\n CdkMenuItemCheckbox,\n CdkMenuItemTrigger,\n CdkMenuGroup,\n CdkContextMenuTrigger,\n CdkTargetMenuAim,\n];\n@NgModule({\n imports: [OverlayModule],\n exports: EXPORTED_DECLARATIONS,\n declarations: EXPORTED_DECLARATIONS,\n})\nexport class CdkMenuModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './menu-module';\nexport * from './menu-bar';\nexport * from './menu';\nexport * from './menu-item';\nexport * from './menu-item-checkbox';\nexport * from './menu-item-radio';\nexport * from './menu-item-trigger';\nexport * from './menu-panel';\nexport * from './menu-group';\nexport * from './context-menu';\n\nexport {MenuStack, MenuStackItem} from './menu-stack';\nexport {CDK_MENU} from './menu-interface';\nexport {TargetMenuAim, MenuAim, MENU_AIM, CdkTargetMenuAim} from './menu-aim';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;AAYA;MACa,QAAQ,GAAG,IAAI,cAAc,CAAO,UAAU;;ACb3D;;;;;;;AAyBA;;;;;;MAMa,SAAS;IAAtB;;QAEmB,cAAS,GAA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AAsB;gBAI1B,QAAQ;sBADX,KAAK;uBAAC,wBAAwB;;;ACnHjC;;;;;;;AAqBA,MAAM,qBAAqB,GAAG;IAC5B,UAAU;IACV,OAAO;IACP,YAAY;IACZ,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,kBAAkB;IAClB,YAAY;IACZ,qBAAqB;IACrB,gBAAgB;CACjB,CAAC;MAMW,aAAa;;+GAAb,aAAa;gHAAb,aAAa,iBAhBxB,UAAU;QACV,OAAO;QACP,YAAY;QACZ,WAAW;QACX,gBAAgB;QAChB,mBAAmB;QACnB,kBAAkB;QAClB,YAAY;QACZ,qBAAqB;QACrB,gBAAgB,aAGN,aAAa,aAZvB,UAAU;QACV,OAAO;QACP,YAAY;QACZ,WAAW;QACX,gBAAgB;QAChB,mBAAmB;QACnB,kBAAkB;QAClB,YAAY;QACZ,qBAAqB;QACrB,gBAAgB;gHAOL,aAAa,YAJf,CAAC,aAAa,CAAC;gGAIb,aAAa;kBALzB,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,OAAO,EAAE,qBAAqB;oBAC9B,YAAY,EAAE,qBAAqB;iBACpC;;;ACrCD;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;"}
1
+ {"version":3,"file":"menu.mjs","sources":["../../../../../../src/cdk-experimental/menu/menu-interface.ts","../../../../../../src/cdk-experimental/menu/menu-stack.ts","../../../../../../src/cdk-experimental/menu/menu-errors.ts","../../../../../../src/cdk-experimental/menu/menu-aim.ts","../../../../../../src/cdk-experimental/menu/menu-item-trigger.ts","../../../../../../src/cdk-experimental/menu/menu-item.ts","../../../../../../src/cdk-experimental/menu/menu-item-selectable.ts","../../../../../../src/cdk-experimental/menu/menu-group.ts","../../../../../../src/cdk-experimental/menu/menu-panel.ts","../../../../../../src/cdk-experimental/menu/pointer-focus-tracker.ts","../../../../../../src/cdk-experimental/menu/menu.ts","../../../../../../src/cdk-experimental/menu/menu-bar.ts","../../../../../../src/cdk-experimental/menu/menu-item-radio.ts","../../../../../../src/cdk-experimental/menu/menu-item-checkbox.ts","../../../../../../src/cdk-experimental/menu/context-menu.ts","../../../../../../src/cdk-experimental/menu/menu-module.ts","../../../../../../src/cdk-experimental/menu/public-api.ts","../../../../../../src/cdk-experimental/menu/index.ts","../../../../../../src/cdk-experimental/menu/menu_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken, ElementRef} from '@angular/core';\nimport {MenuStackItem} from './menu-stack';\nimport {FocusOrigin} from '@angular/cdk/a11y';\n\n/** Injection token used to return classes implementing the Menu interface */\nexport const CDK_MENU = new InjectionToken<Menu>('cdk-menu');\n\n/** Interface which specifies Menu operations and used to break circular dependency issues */\nexport interface Menu extends MenuStackItem {\n /** The element the Menu directive is placed on. */\n _elementRef: ElementRef<HTMLElement>;\n\n /** The orientation of the menu */\n orientation: 'horizontal' | 'vertical';\n\n /** Place focus on the first MenuItem in the menu. */\n focusFirstItem(focusOrigin: FocusOrigin): void;\n\n /** Place focus on the last MenuItem in the menu. */\n focusLastItem(focusOrigin: FocusOrigin): void;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Subject, Observable} from 'rxjs';\n\n/** Events to emit as specified by the caller once the MenuStack is empty. */\nexport const enum FocusNext {\n nextItem,\n previousItem,\n currentItem,\n}\n\n/**\n * Interface for the elements tracked in the MenuStack.\n */\nexport interface MenuStackItem {\n /** A reference to the previous Menus MenuStack instance. */\n _menuStack: MenuStack | null;\n}\n\n/**\n * MenuStack allows subscribers to listen for close events (when a MenuStackItem is popped off\n * of the stack) in order to perform closing actions. Upon the MenuStack being empty it emits\n * from the `empty` observable specifying the next focus action which the listener should perform\n * as requested by the closer.\n */\nexport class MenuStack {\n /** All MenuStackItems tracked by this MenuStack. */\n private readonly _elements: MenuStackItem[] = [];\n\n /** Emits the element which was popped off of the stack when requested by a closer. */\n private readonly _close: Subject<MenuStackItem | undefined> = new Subject();\n\n /** Emits once the MenuStack has become empty after popping off elements. */\n private readonly _empty: Subject<FocusNext | undefined> = new Subject();\n\n /** Observable which emits the MenuStackItem which has been requested to close. */\n readonly closed: Observable<MenuStackItem | undefined> = this._close;\n\n /**\n * Observable which emits when the MenuStack is empty after popping off the last element. It\n * emits a FocusNext event which specifies the action the closer has requested the listener\n * perform.\n */\n readonly emptied: Observable<FocusNext | undefined> = this._empty;\n\n /** @param menu the MenuStackItem to put on the stack. */\n push(menu: MenuStackItem) {\n this._elements.push(menu);\n }\n\n /**\n * Pop items off of the stack up to and including `lastItem` and emit each on the close\n * observable. If the stack is empty or `lastItem` is not on the stack it does nothing.\n * @param lastItem the last item to pop off the stack.\n * @param focusNext the event to emit on the `empty` observable if the method call resulted in an\n * empty stack. Does not emit if the stack was initially empty or if `lastItem` was not on the\n * stack.\n */\n close(lastItem: MenuStackItem, focusNext?: FocusNext) {\n if (this._elements.indexOf(lastItem) >= 0) {\n let poppedElement: MenuStackItem | undefined;\n do {\n poppedElement = this._elements.pop();\n this._close.next(poppedElement);\n } while (poppedElement !== lastItem);\n\n if (this.isEmpty()) {\n this._empty.next(focusNext);\n }\n }\n }\n\n /**\n * Pop items off of the stack up to but excluding `lastItem` and emit each on the close\n * observable. If the stack is empty or `lastItem` is not on the stack it does nothing.\n * @param lastItem the element which should be left on the stack\n * @return whether or not an item was removed from the stack\n */\n closeSubMenuOf(lastItem: MenuStackItem) {\n let removed = false;\n if (this._elements.indexOf(lastItem) >= 0) {\n removed = this.peek() !== lastItem;\n while (this.peek() !== lastItem) {\n this._close.next(this._elements.pop());\n }\n }\n return removed;\n }\n\n /**\n * Pop off all MenuStackItems and emit each one on the `close` observable one by one.\n * @param focusNext the event to emit on the `empty` observable once the stack is emptied. Does\n * not emit if the stack was initially empty.\n */\n closeAll(focusNext?: FocusNext) {\n if (!this.isEmpty()) {\n while (!this.isEmpty()) {\n const menuStackItem = this._elements.pop();\n if (menuStackItem) {\n this._close.next(menuStackItem);\n }\n }\n\n this._empty.next(focusNext);\n }\n }\n\n /** Return true if this stack is empty. */\n isEmpty() {\n return !this._elements.length;\n }\n\n /** Return the length of the stack. */\n length() {\n return this._elements.length;\n }\n\n /** Get the top most element on the stack. */\n peek(): MenuStackItem | undefined {\n return this._elements[this._elements.length - 1];\n }\n}\n\n/** NoopMenuStack is a placeholder MenuStack used for inline menus. */\nexport class NoopMenuStack extends MenuStack {\n /** Noop push - does not add elements to the MenuStack. */\n override push(_: MenuStackItem) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Throws an exception when a menu panel already has a menu stack.\n * @docs-private\n */\nexport function throwExistingMenuStackError() {\n throw Error(\n 'CdkMenuPanel is already referenced by different CdkMenuTrigger. Ensure that a menu is' +\n ' opened by a single trigger only.',\n );\n}\n\n/**\n * Throws an exception when an instance of the PointerFocusTracker is not provided.\n * @docs-private\n */\nexport function throwMissingPointerFocusTracker() {\n throw Error('expected an instance of PointerFocusTracker to be provided');\n}\n\n/**\n * Throws an exception when a reference to the parent menu is not provided.\n * @docs-private\n */\nexport function throwMissingMenuReference() {\n throw Error('expected a reference to the parent menu');\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable, NgZone, OnDestroy, InjectionToken, Directive} from '@angular/core';\nimport {fromEvent, Subject} from 'rxjs';\nimport {takeUntil, filter} from 'rxjs/operators';\nimport {PointerFocusTracker, FocusableElement} from './pointer-focus-tracker';\nimport {Menu} from './menu-interface';\nimport {throwMissingPointerFocusTracker, throwMissingMenuReference} from './menu-errors';\n\n/**\n * MenuAim is responsible for determining if a sibling menuitem's menu should be closed when a\n * Toggler item is hovered into. It is up to the hovered in item to call the MenuAim service in\n * order to determine if it may perform its close actions.\n */\nexport interface MenuAim {\n /** Set the Menu and its PointerFocusTracker. */\n initialize(menu: Menu, pointerTracker: PointerFocusTracker<FocusableElement & Toggler>): void;\n\n /**\n * Calls the `doToggle` callback when it is deemed that the user is not moving towards\n * the submenu.\n * @param doToggle the function called when the user is not moving towards the submenu.\n */\n toggle(doToggle: () => void): void;\n}\n\n/** Injection token used for an implementation of MenuAim. */\nexport const MENU_AIM = new InjectionToken<MenuAim>('cdk-menu-aim');\n\n/** Capture every nth mouse move event. */\nconst MOUSE_MOVE_SAMPLE_FREQUENCY = 3;\n\n/** The number of mouse move events to track. */\nconst NUM_POINTS = 5;\n\n/**\n * How long to wait before closing a sibling menu if a user stops short of the submenu they were\n * predicted to go into.\n */\nconst CLOSE_DELAY = 300;\n\n/**\n * An element which when hovered over may perform closing actions on the open submenu and\n * potentially open its own menu.\n */\nexport interface Toggler {\n getMenu(): Menu | undefined;\n}\n\n/** Calculate the slope between point a and b. */\nfunction getSlope(a: Point, b: Point) {\n return (b.y - a.y) / (b.x - a.x);\n}\n\n/** Calculate the y intercept for the given point and slope. */\nfunction getYIntercept(point: Point, slope: number) {\n return point.y - slope * point.x;\n}\n\n/** Represents a coordinate of mouse travel. */\ntype Point = {x: number; y: number};\n\n/**\n * Whether the given mouse trajectory line defined by the slope and y intercept falls within the\n * submenu as defined by `submenuPoints`\n * @param submenuPoints the submenu DOMRect points.\n * @param m the slope of the trajectory line.\n * @param b the y intercept of the trajectory line.\n *\n * @return true if any point on the line falls within the submenu.\n */\nfunction isWithinSubmenu(submenuPoints: DOMRect, m: number, b: number) {\n const {left, right, top, bottom} = submenuPoints;\n\n // Check for intersection with each edge of the submenu (left, right, top, bottom)\n // by fixing one coordinate to that edge's coordinate (either x or y) and checking if the\n // other coordinate is within bounds.\n return (\n (m * left + b >= top && m * left + b <= bottom) ||\n (m * right + b >= top && m * right + b <= bottom) ||\n ((top - b) / m >= left && (top - b) / m <= right) ||\n ((bottom - b) / m >= left && (bottom - b) / m <= right)\n );\n}\n/**\n * TargetMenuAim predicts if a user is moving into a submenu. It calculates the\n * trajectory of the user's mouse movement in the current menu to determine if the\n * mouse is moving towards an open submenu.\n *\n * The determination is made by calculating the slope of the users last NUM_POINTS moves where each\n * pair of points determines if the trajectory line points into the submenu. It uses consensus\n * approach by checking if at least NUM_POINTS / 2 pairs determine that the user is moving towards\n * to submenu.\n */\n@Injectable()\nexport class TargetMenuAim implements MenuAim, OnDestroy {\n /** The last NUM_POINTS mouse move events. */\n private readonly _points: Point[] = [];\n\n /** Reference to the root menu in which we are tracking mouse moves. */\n private _menu: Menu;\n\n /** Reference to the root menu's mouse manager. */\n private _pointerTracker: PointerFocusTracker<Toggler & FocusableElement>;\n\n /** The id associated with the current timeout call waiting to resolve. */\n private _timeoutId: number | null;\n\n /** Emits when this service is destroyed. */\n private readonly _destroyed: Subject<void> = new Subject();\n\n constructor(private readonly _ngZone: NgZone) {}\n\n /** Set the Menu and its PointerFocusTracker. */\n initialize(menu: Menu, pointerTracker: PointerFocusTracker<FocusableElement & Toggler>) {\n this._menu = menu;\n this._pointerTracker = pointerTracker;\n this._subscribeToMouseMoves();\n }\n\n /**\n * Calls the `doToggle` callback when it is deemed that the user is not moving towards\n * the submenu.\n * @param doToggle the function called when the user is not moving towards the submenu.\n */\n toggle(doToggle: () => void) {\n // If the menu is horizontal the sub-menus open below and there is no risk of premature\n // closing of any sub-menus therefore we automatically resolve the callback.\n if (this._menu.orientation === 'horizontal') {\n doToggle();\n }\n\n this._checkConfigured();\n\n const siblingItemIsWaiting = !!this._timeoutId;\n const hasPoints = this._points.length > 1;\n\n if (hasPoints && !siblingItemIsWaiting) {\n if (this._isMovingToSubmenu()) {\n this._startTimeout(doToggle);\n } else {\n doToggle();\n }\n } else if (!siblingItemIsWaiting) {\n doToggle();\n }\n }\n\n /**\n * Start the delayed toggle handler if one isn't running already.\n *\n * The delayed toggle handler executes the `doToggle` callback after some period of time iff the\n * users mouse is on an item in the current menu.\n */\n private _startTimeout(doToggle: () => void) {\n // If the users mouse is moving towards a submenu we don't want to immediately resolve.\n // Wait for some period of time before determining if the previous menu should close in\n // cases where the user may have moved towards the submenu but stopped on a sibling menu\n // item intentionally.\n const timeoutId = setTimeout(() => {\n // Resolve if the user is currently moused over some element in the root menu\n if (this._pointerTracker!.activeElement && timeoutId === this._timeoutId) {\n doToggle();\n }\n this._timeoutId = null;\n }, CLOSE_DELAY) as any as number;\n\n this._timeoutId = timeoutId;\n }\n\n /** Whether the user is heading towards the open submenu. */\n private _isMovingToSubmenu() {\n const submenuPoints = this._getSubmenuBounds();\n if (!submenuPoints) {\n return false;\n }\n\n let numMoving = 0;\n const currPoint = this._points[this._points.length - 1];\n // start from the second last point and calculate the slope between each point and the last\n // point.\n for (let i = this._points.length - 2; i >= 0; i--) {\n const previous = this._points[i];\n const slope = getSlope(currPoint, previous);\n if (isWithinSubmenu(submenuPoints, slope, getYIntercept(currPoint, slope))) {\n numMoving++;\n }\n }\n return numMoving >= Math.floor(NUM_POINTS / 2);\n }\n\n /** Get the bounding DOMRect for the open submenu. */\n private _getSubmenuBounds(): DOMRect | undefined {\n return this._pointerTracker?.previousElement\n ?.getMenu()\n ?._elementRef.nativeElement.getBoundingClientRect();\n }\n\n /**\n * Check if a reference to the PointerFocusTracker and menu element is provided.\n * @throws an error if neither reference is provided.\n */\n private _checkConfigured() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._pointerTracker) {\n throwMissingPointerFocusTracker();\n }\n if (!this._menu) {\n throwMissingMenuReference();\n }\n }\n }\n\n /** Subscribe to the root menus mouse move events and update the tracked mouse points. */\n private _subscribeToMouseMoves() {\n this._ngZone.runOutsideAngular(() => {\n fromEvent<MouseEvent>(this._menu._elementRef.nativeElement, 'mousemove')\n .pipe(\n filter((_: MouseEvent, index: number) => index % MOUSE_MOVE_SAMPLE_FREQUENCY === 0),\n takeUntil(this._destroyed),\n )\n .subscribe((event: MouseEvent) => {\n this._points.push({x: event.clientX, y: event.clientY});\n if (this._points.length > NUM_POINTS) {\n this._points.shift();\n }\n });\n });\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n}\n\n/**\n * CdkTargetMenuAim is a provider for the TargetMenuAim service. It should be added to an\n * element with either the `cdkMenu` or `cdkMenuBar` directive and child menu items.\n */\n@Directive({\n selector: '[cdkTargetMenuAim]',\n exportAs: 'cdkTargetMenuAim',\n providers: [{provide: MENU_AIM, useClass: TargetMenuAim}],\n})\nexport class CdkTargetMenuAim {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n Input,\n Output,\n EventEmitter,\n ElementRef,\n ViewContainerRef,\n Inject,\n OnDestroy,\n Optional,\n NgZone,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {TemplatePortal} from '@angular/cdk/portal';\nimport {\n OverlayRef,\n Overlay,\n OverlayConfig,\n ConnectedPosition,\n FlexibleConnectedPositionStrategy,\n} from '@angular/cdk/overlay';\nimport {SPACE, ENTER, RIGHT_ARROW, LEFT_ARROW, DOWN_ARROW, UP_ARROW} from '@angular/cdk/keycodes';\nimport {fromEvent, Subject, merge} from 'rxjs';\nimport {takeUntil, filter} from 'rxjs/operators';\nimport {CdkMenuPanel} from './menu-panel';\nimport {Menu, CDK_MENU} from './menu-interface';\nimport {FocusNext, MenuStack} from './menu-stack';\nimport {throwExistingMenuStackError} from './menu-errors';\nimport {MENU_AIM, MenuAim} from './menu-aim';\n\n/**\n * Whether the target element is a menu item to be ignored by the overlay background click handler.\n */\nexport function isClickInsideMenuOverlay(target: Element): boolean {\n while (target?.parentElement) {\n const isOpenTrigger =\n target.getAttribute('aria-expanded') === 'true' &&\n target.classList.contains('cdk-menu-trigger');\n const isOverlayMenu =\n target.classList.contains('cdk-menu') && !target.classList.contains('cdk-menu-inline');\n\n if (isOpenTrigger || isOverlayMenu) {\n return true;\n }\n target = target.parentElement;\n }\n return false;\n}\n\n/**\n * A directive to be combined with CdkMenuItem which opens the Menu it is bound to. If the\n * element is in a top level MenuBar it will open the menu on click, or if a sibling is already\n * opened it will open on hover. If it is inside of a Menu it will open the attached Submenu on\n * hover regardless of its sibling state.\n *\n * The directive must be placed along with the `cdkMenuItem` directive in order to enable full\n * functionality.\n */\n@Directive({\n selector: '[cdkMenuTriggerFor]',\n exportAs: 'cdkMenuTriggerFor',\n host: {\n '(keydown)': '_toggleOnKeydown($event)',\n '(click)': 'toggle()',\n 'class': 'cdk-menu-trigger',\n 'aria-haspopup': 'menu',\n '[attr.aria-expanded]': 'isMenuOpen()',\n },\n})\nexport class CdkMenuItemTrigger implements OnDestroy {\n /** Template reference variable to the menu this trigger opens */\n @Input('cdkMenuTriggerFor')\n get menuPanel(): CdkMenuPanel | undefined {\n return this._menuPanel;\n }\n set menuPanel(panel: CdkMenuPanel | undefined) {\n // If the provided panel already has a stack, that means it already has a trigger configured.\n // Note however that there are some edge cases where two triggers **may** share the same menu,\n // e.g. two triggers in two separate menus.\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && panel?._menuStack) {\n throwExistingMenuStackError();\n }\n\n this._menuPanel = panel;\n if (this._menuPanel) {\n this._menuPanel._menuStack = this._getMenuStack();\n }\n }\n\n /** Reference to the MenuPanel this trigger toggles. */\n private _menuPanel?: CdkMenuPanel;\n\n /** Emits when the attached menu is requested to open */\n @Output('cdkMenuOpened') readonly opened: EventEmitter<void> = new EventEmitter();\n\n /** Emits when the attached menu is requested to close */\n @Output('cdkMenuClosed') readonly closed: EventEmitter<void> = new EventEmitter();\n\n /** The menu stack for this trigger and its sub-menus. */\n _menuStack: MenuStack = new MenuStack();\n\n /** A reference to the overlay which manages the triggered menu */\n private _overlayRef: OverlayRef | null = null;\n\n /** The content of the menu panel opened by this trigger. */\n private _panelContent: TemplatePortal;\n\n /** Emits when this trigger is destroyed. */\n private readonly _destroyed: Subject<void> = new Subject();\n\n /** Emits when the outside pointer events listener on the overlay should be stopped. */\n private readonly _stopOutsideClicksListener = merge(this.closed, this._destroyed);\n\n constructor(\n private readonly _elementRef: ElementRef<HTMLElement>,\n protected readonly _viewContainerRef: ViewContainerRef,\n private readonly _overlay: Overlay,\n private readonly _ngZone: NgZone,\n @Optional() @Inject(CDK_MENU) private readonly _parentMenu?: Menu,\n @Optional() @Inject(MENU_AIM) private readonly _menuAim?: MenuAim,\n @Optional() private readonly _directionality?: Directionality,\n ) {\n this._registerCloseHandler();\n this._subscribeToMouseEnter();\n }\n\n /** Open/close the attached menu if the trigger has been configured with one */\n toggle() {\n if (this.hasMenu()) {\n this.isMenuOpen() ? this.closeMenu() : this.openMenu();\n }\n }\n\n /** Open the attached menu. */\n openMenu() {\n if (!this.isMenuOpen()) {\n this.opened.next();\n\n this._overlayRef = this._overlayRef || this._overlay.create(this._getOverlayConfig());\n this._overlayRef.attach(this._getPortal());\n this._subscribeToOutsideClicks();\n }\n }\n\n /** Close the opened menu. */\n closeMenu() {\n if (this.isMenuOpen()) {\n this.closed.next();\n\n this._overlayRef!.detach();\n }\n this._closeSiblingTriggers();\n }\n\n /** Return true if the trigger has an attached menu */\n hasMenu() {\n return !!this.menuPanel;\n }\n\n /** Whether the menu this button is a trigger for is open */\n isMenuOpen() {\n return this._overlayRef ? this._overlayRef.hasAttached() : false;\n }\n\n /**\n * Get a reference to the rendered Menu if the Menu is open and it is visible in the DOM.\n * @return the menu if it is open, otherwise undefined.\n */\n getMenu(): Menu | undefined {\n return this.menuPanel?._menu;\n }\n\n /**\n * Subscribe to the mouseenter events and close any sibling menu items if this element is moused\n * into.\n */\n private _subscribeToMouseEnter() {\n // Closes any sibling menu items and opens the menu associated with this trigger.\n const toggleMenus = () =>\n this._ngZone.run(() => {\n this._closeSiblingTriggers();\n this.openMenu();\n });\n\n this._ngZone.runOutsideAngular(() => {\n fromEvent(this._elementRef.nativeElement, 'mouseenter')\n .pipe(\n filter(() => !this._getMenuStack()?.isEmpty() && !this.isMenuOpen()),\n takeUntil(this._destroyed),\n )\n .subscribe(() => {\n if (this._menuAim) {\n this._menuAim.toggle(toggleMenus);\n } else {\n toggleMenus();\n }\n });\n });\n }\n\n /**\n * Handles keyboard events for the menu item, specifically opening/closing the attached menu and\n * focusing the appropriate submenu item.\n * @param event the keyboard event to handle\n */\n _toggleOnKeydown(event: KeyboardEvent) {\n const keyCode = event.keyCode;\n switch (keyCode) {\n case SPACE:\n case ENTER:\n event.preventDefault();\n this.toggle();\n this.menuPanel?._menu?.focusFirstItem('keyboard');\n break;\n\n case RIGHT_ARROW:\n if (this._parentMenu && this._isParentVertical()) {\n event.preventDefault();\n if (this._directionality?.value === 'rtl') {\n this._getMenuStack().close(this._parentMenu, FocusNext.currentItem);\n } else {\n this.openMenu();\n this.menuPanel?._menu?.focusFirstItem('keyboard');\n }\n }\n break;\n\n case LEFT_ARROW:\n if (this._parentMenu && this._isParentVertical()) {\n event.preventDefault();\n if (this._directionality?.value === 'rtl') {\n this.openMenu();\n this.menuPanel?._menu?.focusFirstItem('keyboard');\n } else {\n this._getMenuStack().close(this._parentMenu, FocusNext.currentItem);\n }\n }\n break;\n\n case DOWN_ARROW:\n case UP_ARROW:\n if (!this._isParentVertical()) {\n event.preventDefault();\n this.openMenu();\n keyCode === DOWN_ARROW\n ? this.menuPanel?._menu?.focusFirstItem('keyboard')\n : this.menuPanel?._menu?.focusLastItem('keyboard');\n }\n break;\n }\n }\n\n /** Close out any sibling menu trigger menus. */\n private _closeSiblingTriggers() {\n if (this._parentMenu) {\n const menuStack = this._getMenuStack();\n\n // If nothing was removed from the stack and the last element is not the parent item\n // that means that the parent menu is a menu bar since we don't put the menu bar on the\n // stack\n const isParentMenuBar =\n !menuStack.closeSubMenuOf(this._parentMenu) && menuStack.peek() !== this._parentMenu;\n\n if (isParentMenuBar) {\n menuStack.closeAll();\n }\n } else {\n this._getMenuStack().closeAll();\n }\n }\n\n /** Get the configuration object used to create the overlay */\n private _getOverlayConfig() {\n return new OverlayConfig({\n positionStrategy: this._getOverlayPositionStrategy(),\n scrollStrategy: this._overlay.scrollStrategies.block(),\n direction: this._directionality,\n });\n }\n\n /** Build the position strategy for the overlay which specifies where to place the menu */\n private _getOverlayPositionStrategy(): FlexibleConnectedPositionStrategy {\n return this._overlay\n .position()\n .flexibleConnectedTo(this._elementRef)\n .withPositions(this._getOverlayPositions());\n }\n\n /** Determine and return where to position the opened menu relative to the menu item */\n private _getOverlayPositions(): ConnectedPosition[] {\n // TODO: use a common positioning config from (possibly) cdk/overlay\n return !this._parentMenu || this._parentMenu.orientation === 'horizontal'\n ? [\n {originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top'},\n {originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom'},\n {originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top'},\n {originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom'},\n ]\n : [\n {originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top'},\n {originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom'},\n {originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top'},\n {originX: 'start', originY: 'bottom', overlayX: 'end', overlayY: 'bottom'},\n ];\n }\n\n /**\n * Get the portal to be attached to the overlay which contains the menu. Allows for the menu\n * content to change dynamically and be reflected in the application.\n */\n private _getPortal() {\n const hasMenuContentChanged = this.menuPanel?._templateRef !== this._panelContent?.templateRef;\n if (this.menuPanel && (!this._panelContent || hasMenuContentChanged)) {\n this._panelContent = new TemplatePortal(this.menuPanel._templateRef, this._viewContainerRef);\n }\n\n return this._panelContent;\n }\n\n /**\n * @return true if if the enclosing parent menu is configured in a vertical orientation.\n */\n private _isParentVertical() {\n return this._parentMenu?.orientation === 'vertical';\n }\n\n /**\n * Subscribe to the MenuStack close events if this is a standalone trigger and close out the menu\n * this triggers when requested.\n */\n private _registerCloseHandler() {\n if (!this._parentMenu) {\n this._menuStack.closed.pipe(takeUntil(this._destroyed)).subscribe(item => {\n if (item === this._menuPanel?._menu) {\n this.closeMenu();\n }\n });\n }\n }\n\n /** Get the menu stack for this trigger - either from the parent or this trigger. */\n private _getMenuStack() {\n // We use a function since at the construction of the MenuItemTrigger the parent Menu won't have\n // its menu stack set. Therefore we need to reference the menu stack from the parent each time\n // we want to use it.\n return this._parentMenu?._menuStack || this._menuStack;\n }\n\n ngOnDestroy() {\n this._destroyOverlay();\n this._resetPanelMenuStack();\n\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Set the menu panels menu stack back to null. */\n private _resetPanelMenuStack() {\n // If a CdkMenuTrigger is placed in a submenu, each time the trigger is rendered (its parent\n // menu is opened) the panel setter for CdkMenuPanel is called. From the first render onward,\n // the attached CdkMenuPanel has the MenuStack set. Since we throw an error if a panel already\n // has a stack set, we want to reset the attached stack here to prevent the error from being\n // thrown if the trigger re-configures its attached panel (in the case where there is a 1:1\n // relationship between the panel and trigger).\n if (this._menuPanel) {\n this._menuPanel._menuStack = null;\n }\n }\n\n /**\n * Subscribe to the overlays outside pointer events stream and handle closing out the stack if a\n * click occurs outside the menus.\n */\n private _subscribeToOutsideClicks() {\n if (this._overlayRef) {\n this._overlayRef\n .outsidePointerEvents()\n .pipe(takeUntil(this._stopOutsideClicksListener))\n .subscribe(event => {\n if (!isClickInsideMenuOverlay(event.target as Element)) {\n this._getMenuStack().closeAll();\n }\n });\n }\n }\n\n /** Destroy and unset the overlay reference it if exists */\n private _destroyOverlay() {\n if (this._overlayRef) {\n this._overlayRef.dispose();\n this._overlayRef = null;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n Input,\n Optional,\n Self,\n ElementRef,\n Output,\n EventEmitter,\n Inject,\n NgZone,\n OnDestroy,\n} from '@angular/core';\nimport {coerceBooleanProperty, BooleanInput} from '@angular/cdk/coercion';\nimport {FocusableOption} from '@angular/cdk/a11y';\nimport {SPACE, ENTER, RIGHT_ARROW, LEFT_ARROW} from '@angular/cdk/keycodes';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {Subject, fromEvent} from 'rxjs';\nimport {takeUntil, filter} from 'rxjs/operators';\nimport {CdkMenuItemTrigger} from './menu-item-trigger';\nimport {Menu, CDK_MENU} from './menu-interface';\nimport {FocusNext} from './menu-stack';\nimport {FocusableElement} from './pointer-focus-tracker';\nimport {Toggler, MENU_AIM, MenuAim} from './menu-aim';\n\n// TODO refactor this to be configurable allowing for custom elements to be removed\n/** Removes all icons from within the given element. */\nfunction removeIcons(element: Element) {\n for (const icon of Array.from(element.querySelectorAll('mat-icon, .material-icons'))) {\n icon.remove();\n }\n}\n\n/**\n * Directive which provides the ability for an element to be focused and navigated to using the\n * keyboard when residing in a CdkMenu, CdkMenuBar, or CdkMenuGroup. It performs user defined\n * behavior when clicked.\n */\n@Directive({\n selector: '[cdkMenuItem]',\n exportAs: 'cdkMenuItem',\n host: {\n '[tabindex]': '_tabindex',\n 'type': 'button',\n 'role': 'menuitem',\n 'class': 'cdk-menu-item',\n '[attr.aria-disabled]': 'disabled || null',\n '(blur)': '_resetTabIndex()',\n '(mouseout)': '_resetTabIndex()',\n '(focus)': '_setTabIndex()',\n '(mouseenter)': '_setTabIndex($event)',\n '(click)': 'trigger()',\n '(keydown)': '_onKeydown($event)',\n },\n})\nexport class CdkMenuItem implements FocusableOption, FocusableElement, Toggler, OnDestroy {\n /** Whether the CdkMenuItem is disabled - defaults to false */\n @Input()\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n }\n private _disabled = false;\n\n /**\n * If this MenuItem is a regular MenuItem, outputs when it is triggered by a keyboard or mouse\n * event.\n */\n @Output('cdkMenuItemTriggered') readonly triggered: EventEmitter<void> = new EventEmitter();\n\n /**\n * The tabindex for this menu item managed internally and used for implementing roving a\n * tab index.\n */\n _tabindex: 0 | -1 = -1;\n\n /** Emits when the menu item is destroyed. */\n private readonly _destroyed = new Subject<void>();\n\n constructor(\n readonly _elementRef: ElementRef<HTMLElement>,\n private readonly _ngZone: NgZone,\n @Optional() @Inject(CDK_MENU) private readonly _parentMenu?: Menu,\n @Optional() @Inject(MENU_AIM) private readonly _menuAim?: MenuAim,\n @Optional() private readonly _dir?: Directionality,\n /** Reference to the CdkMenuItemTrigger directive if one is added to the same element */\n // `CdkMenuItem` is commonly used in combination with a `CdkMenuItemTrigger`.\n // tslint:disable-next-line: lightweight-tokens\n @Self() @Optional() private readonly _menuTrigger?: CdkMenuItemTrigger,\n ) {\n this._setupMouseEnter();\n\n if (this._isStandaloneItem()) {\n this._tabindex = 0;\n }\n }\n\n /** Place focus on the element. */\n focus() {\n this._elementRef.nativeElement.focus();\n }\n\n /** Reset the _tabindex to -1. */\n _resetTabIndex() {\n if (!this._isStandaloneItem()) {\n this._tabindex = -1;\n }\n }\n\n /**\n * Set the tab index to 0 if not disabled and it's a focus event, or a mouse enter if this element\n * is not in a menu bar.\n */\n _setTabIndex(event?: MouseEvent) {\n if (this.disabled) {\n return;\n }\n\n // don't set the tabindex if there are no open sibling or parent menus\n if (!event || !this._getMenuStack()?.isEmpty()) {\n this._tabindex = 0;\n }\n }\n\n /** Whether this menu item is standalone or within a menu or menu bar. */\n _isStandaloneItem() {\n return !this._parentMenu;\n }\n\n /**\n * If the menu item is not disabled and the element does not have a menu trigger attached, emit\n * on the cdkMenuItemTriggered emitter and close all open menus.\n */\n trigger() {\n if (!this.disabled && !this.hasMenu()) {\n this.triggered.next();\n this._getMenuStack()?.closeAll();\n }\n }\n\n /** Whether the menu item opens a menu. */\n hasMenu() {\n return !!this._menuTrigger?.hasMenu();\n }\n\n /** Return true if this MenuItem has an attached menu and it is open. */\n isMenuOpen() {\n return !!this._menuTrigger?.isMenuOpen();\n }\n\n /**\n * Get a reference to the rendered Menu if the Menu is open and it is visible in the DOM.\n * @return the menu if it is open, otherwise undefined.\n */\n getMenu(): Menu | undefined {\n return this._menuTrigger?.getMenu();\n }\n\n /** Get the MenuItemTrigger associated with this element. */\n getMenuTrigger(): CdkMenuItemTrigger | undefined {\n return this._menuTrigger;\n }\n\n /** Get the label for this element which is required by the FocusableOption interface. */\n getLabel(): string {\n // TODO cloning the tree may be expensive; implement a better method\n // we know that the current node is an element type\n const clone = this._elementRef.nativeElement.cloneNode(true) as Element;\n removeIcons(clone);\n\n return clone.textContent?.trim() || '';\n }\n\n /**\n * Handles keyboard events for the menu item, specifically either triggering the user defined\n * callback or opening/closing the current menu based on whether the left or right arrow key was\n * pressed.\n * @param event the keyboard event to handle\n */\n _onKeydown(event: KeyboardEvent) {\n switch (event.keyCode) {\n case SPACE:\n case ENTER:\n event.preventDefault();\n this.trigger();\n break;\n\n case RIGHT_ARROW:\n if (this._parentMenu && this._isParentVertical() && !this.hasMenu()) {\n event.preventDefault();\n this._dir?.value === 'rtl'\n ? this._getMenuStack()?.close(this._parentMenu, FocusNext.previousItem)\n : this._getMenuStack()?.closeAll(FocusNext.nextItem);\n }\n break;\n\n case LEFT_ARROW:\n if (this._parentMenu && this._isParentVertical() && !this.hasMenu()) {\n event.preventDefault();\n this._dir?.value === 'rtl'\n ? this._getMenuStack()?.closeAll(FocusNext.nextItem)\n : this._getMenuStack()?.close(this._parentMenu, FocusNext.previousItem);\n }\n break;\n }\n }\n\n /**\n * Subscribe to the mouseenter events and close any sibling menu items if this element is moused\n * into.\n */\n private _setupMouseEnter() {\n if (!this._isStandaloneItem()) {\n const closeOpenSiblings = () =>\n this._ngZone.run(() => this._getMenuStack()?.closeSubMenuOf(this._parentMenu!));\n\n this._ngZone.runOutsideAngular(() =>\n fromEvent(this._elementRef.nativeElement, 'mouseenter')\n .pipe(\n filter(() => !this._getMenuStack()?.isEmpty() && !this.hasMenu()),\n takeUntil(this._destroyed),\n )\n .subscribe(() => {\n if (this._menuAim) {\n this._menuAim.toggle(closeOpenSiblings);\n } else {\n closeOpenSiblings();\n }\n }),\n );\n }\n }\n\n /**\n * Return true if the enclosing parent menu is configured in a horizontal orientation, false\n * otherwise or if no parent.\n */\n private _isParentVertical() {\n return this._parentMenu?.orientation === 'vertical';\n }\n\n /** Get the MenuStack from the parent menu. */\n private _getMenuStack() {\n // We use a function since at the construction of the MenuItemTrigger the parent Menu won't have\n // its menu stack set. Therefore we need to reference the menu stack from the parent each time\n // we want to use it.\n return this._parentMenu?._menuStack;\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceBooleanProperty, BooleanInput} from '@angular/cdk/coercion';\nimport {Input, Directive, Output, EventEmitter} from '@angular/core';\nimport {CdkMenuItem} from './menu-item';\n\n/** Counter used to set a unique id and name for a selectable item */\nlet nextId = 0;\n\n/**\n * Base class providing checked state for MenuItems along with outputting a clicked event when the\n * element is triggered. It provides functionality for selectable elements.\n */\n@Directive()\nexport abstract class CdkMenuItemSelectable extends CdkMenuItem {\n /** Event emitted when the selectable item is clicked */\n @Output('cdkMenuItemToggled') readonly toggled: EventEmitter<CdkMenuItemSelectable> =\n new EventEmitter();\n\n /** Whether the element is checked */\n @Input()\n get checked() {\n return this._checked;\n }\n set checked(value: boolean) {\n this._checked = coerceBooleanProperty(value);\n }\n private _checked = false;\n\n /** The name of the selectable element with a default value */\n @Input() name: string = `cdk-selectable-item-${nextId++}`;\n\n /** The id of the selectable element with a default value */\n @Input() id: string = `cdk-selectable-item-${nextId++}`;\n\n /** If the element is not disabled emit the click event */\n override trigger() {\n if (!this.disabled) {\n this.toggled.next(this);\n }\n }\n\n static ngAcceptInputType_checked: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n Output,\n EventEmitter,\n ContentChildren,\n AfterContentInit,\n QueryList,\n OnDestroy,\n} from '@angular/core';\nimport {UniqueSelectionDispatcher} from '@angular/cdk/collections';\nimport {takeUntil} from 'rxjs/operators';\nimport {CdkMenuItemSelectable} from './menu-item-selectable';\nimport {CdkMenuItem} from './menu-item';\n\n/**\n * Directive which acts as a grouping container for `CdkMenuItem` instances with\n * `role=\"menuitemradio\"`, similar to a `role=\"radiogroup\"` element.\n */\n@Directive({\n selector: '[cdkMenuGroup]',\n exportAs: 'cdkMenuGroup',\n host: {\n 'role': 'group',\n 'class': 'cdk-menu-group',\n },\n providers: [{provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher}],\n})\nexport class CdkMenuGroup implements AfterContentInit, OnDestroy {\n /** Emits the element when checkbox or radiobutton state changed */\n @Output() readonly change: EventEmitter<CdkMenuItem> = new EventEmitter();\n\n /** List of menuitemcheckbox or menuitemradio elements which reside in this group */\n @ContentChildren(CdkMenuItemSelectable, {descendants: true})\n private readonly _selectableItems: QueryList<CdkMenuItemSelectable>;\n\n /** Emits when the _selectableItems QueryList triggers a change */\n private readonly _selectableChanges: EventEmitter<void> = new EventEmitter();\n\n ngAfterContentInit() {\n this._registerMenuSelectionListeners();\n }\n\n /**\n * Register the child selectable elements with the change emitter and ensure any new child\n * elements do so as well.\n */\n private _registerMenuSelectionListeners() {\n this._selectableItems.forEach(selectable => this._registerClickListener(selectable));\n\n this._selectableItems.changes.subscribe((selectableItems: QueryList<CdkMenuItemSelectable>) => {\n this._selectableChanges.next();\n selectableItems.forEach(selectable => this._registerClickListener(selectable));\n });\n }\n\n /** Register each selectable to emit on the change Emitter when clicked */\n private _registerClickListener(selectable: CdkMenuItemSelectable) {\n selectable.toggled\n .pipe(takeUntil(this._selectableChanges))\n .subscribe(() => this.change.next(selectable));\n }\n\n ngOnDestroy() {\n this._selectableChanges.next();\n this._selectableChanges.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef} from '@angular/core';\nimport {Menu} from './menu-interface';\nimport {MenuStack} from './menu-stack';\n\n/**\n * Directive applied to an ng-template which wraps a CdkMenu and provides a reference to the\n * child element it wraps which allows for opening of the CdkMenu in an overlay.\n */\n@Directive({selector: 'ng-template[cdkMenuPanel]', exportAs: 'cdkMenuPanel'})\nexport class CdkMenuPanel {\n /** Reference to the child menu component */\n _menu?: Menu;\n\n /** Keep track of open Menus. */\n _menuStack: MenuStack | null;\n\n constructor(readonly _templateRef: TemplateRef<unknown>) {}\n\n /**\n * Set the Menu component on the menu panel. Since we cannot use ContentChild to fetch the\n * child Menu component, the child Menu must register its self with the parent MenuPanel.\n */\n _registerMenu(child: Menu) {\n this._menu = child;\n\n // The ideal solution would be to affect the CdkMenuPanel injector from the CdkMenuTrigger and\n // inject the menu stack reference into the child menu and menu items, however this isn't\n // possible at this time.\n this._menu._menuStack = this._menuStack;\n this._menuStack?.push(child);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {QueryList, ElementRef} from '@angular/core';\nimport {fromEvent, Observable, defer, Subject} from 'rxjs';\nimport {mapTo, mergeAll, takeUntil, startWith, mergeMap} from 'rxjs/operators';\n\n/** Item to track for mouse focus events. */\nexport interface FocusableElement {\n /** A reference to the element to be tracked. */\n _elementRef: ElementRef<HTMLElement>;\n}\n\n/**\n * PointerFocusTracker keeps track of the currently active item under mouse focus. It also has\n * observables which emit when the users mouse enters and leaves a tracked element.\n */\nexport class PointerFocusTracker<T extends FocusableElement> {\n /** Emits when an element is moused into. */\n readonly entered: Observable<T> = this._getItemPointerEntries();\n\n /** Emits when an element is moused out. */\n readonly exited: Observable<T> = this._getItemPointerExits();\n\n /** The element currently under mouse focus. */\n activeElement?: T;\n\n /** The element previously under mouse focus. */\n previousElement?: T;\n\n /** Emits when this is destroyed. */\n private readonly _destroyed: Subject<void> = new Subject();\n\n constructor(private readonly _items: QueryList<T>) {\n this.entered.subscribe(element => (this.activeElement = element));\n this.exited.subscribe(() => {\n this.previousElement = this.activeElement;\n this.activeElement = undefined;\n });\n }\n\n /**\n * Gets a stream of pointer (mouse) entries into the given items.\n * This should typically run outside the Angular zone.\n */\n private _getItemPointerEntries(): Observable<T> {\n return defer(() =>\n this._items.changes.pipe(\n startWith(this._items),\n mergeMap((list: QueryList<T>) =>\n list.map(element =>\n fromEvent(element._elementRef.nativeElement, 'mouseenter').pipe(\n mapTo(element),\n takeUntil(this._items.changes),\n ),\n ),\n ),\n mergeAll(),\n ),\n );\n }\n\n /**\n * Gets a stream of pointer (mouse) exits out of the given items.\n * This should typically run outside the Angular zone.\n */\n private _getItemPointerExits() {\n return defer(() =>\n this._items.changes.pipe(\n startWith(this._items),\n mergeMap((list: QueryList<T>) =>\n list.map(element =>\n fromEvent(element._elementRef.nativeElement, 'mouseout').pipe(\n mapTo(element),\n takeUntil(this._items.changes),\n ),\n ),\n ),\n mergeAll(),\n ),\n );\n }\n\n /** Stop the managers listeners. */\n destroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n Input,\n Output,\n EventEmitter,\n QueryList,\n ContentChildren,\n AfterContentInit,\n OnDestroy,\n Optional,\n OnInit,\n NgZone,\n ElementRef,\n Inject,\n Self,\n} from '@angular/core';\nimport {FocusKeyManager, FocusOrigin} from '@angular/cdk/a11y';\nimport {\n LEFT_ARROW,\n RIGHT_ARROW,\n UP_ARROW,\n DOWN_ARROW,\n ESCAPE,\n TAB,\n hasModifierKey,\n} from '@angular/cdk/keycodes';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {merge} from 'rxjs';\nimport {take, takeUntil, startWith, mergeMap, mapTo, mergeAll, switchMap} from 'rxjs/operators';\nimport {CdkMenuGroup} from './menu-group';\nimport {CdkMenuPanel} from './menu-panel';\nimport {Menu, CDK_MENU} from './menu-interface';\nimport {CdkMenuItem} from './menu-item';\nimport {MenuStack, MenuStackItem, FocusNext, NoopMenuStack} from './menu-stack';\nimport {PointerFocusTracker} from './pointer-focus-tracker';\nimport {MENU_AIM, MenuAim} from './menu-aim';\n\n/**\n * Directive which configures the element as a Menu which should contain child elements marked as\n * CdkMenuItem or CdkMenuGroup. Sets the appropriate role and aria-attributes for a menu and\n * contains accessible keyboard and mouse handling logic.\n *\n * It also acts as a RadioGroup for elements marked with role `menuitemradio`.\n */\n@Directive({\n selector: '[cdkMenu]',\n exportAs: 'cdkMenu',\n host: {\n '[tabindex]': '_isInline() ? 0 : null',\n 'role': 'menu',\n 'class': 'cdk-menu',\n '[class.cdk-menu-inline]': '_isInline()',\n '[attr.aria-orientation]': 'orientation',\n '(focus)': 'focusFirstItem()',\n '(keydown)': '_handleKeyEvent($event)',\n },\n providers: [\n {provide: CdkMenuGroup, useExisting: CdkMenu},\n {provide: CDK_MENU, useExisting: CdkMenu},\n ],\n})\nexport class CdkMenu extends CdkMenuGroup implements Menu, AfterContentInit, OnInit, OnDestroy {\n /**\n * Sets the aria-orientation attribute and determines where menus will be opened.\n * Does not affect styling/layout.\n */\n @Input('cdkMenuOrientation') orientation: 'horizontal' | 'vertical' = 'vertical';\n\n /** Event emitted when the menu is closed. */\n @Output() readonly closed: EventEmitter<void | 'click' | 'tab' | 'escape'> = new EventEmitter();\n\n // We provide a default MenuStack implementation in case the menu is an inline menu.\n // For Menus part of a MenuBar nested within a MenuPanel this will be overwritten\n // to the correct parent MenuStack.\n /** Track the Menus making up the open menu stack. */\n _menuStack: MenuStack = new NoopMenuStack();\n\n /** Handles keyboard events for the menu. */\n private _keyManager: FocusKeyManager<CdkMenuItem>;\n\n /** Manages items under mouse focus. */\n private _pointerTracker?: PointerFocusTracker<CdkMenuItem>;\n\n /** List of nested CdkMenuGroup elements */\n @ContentChildren(CdkMenuGroup, {descendants: true})\n private readonly _nestedGroups: QueryList<CdkMenuGroup>;\n\n /** All child MenuItem elements nested in this Menu. */\n @ContentChildren(CdkMenuItem, {descendants: true})\n private readonly _allItems: QueryList<CdkMenuItem>;\n\n /** The Menu Item which triggered the open submenu. */\n private _openItem?: CdkMenuItem;\n\n /**\n * A reference to the enclosing parent menu panel.\n *\n * Required to be set when using ViewEngine since ViewEngine does support injecting a reference to\n * the parent directive if the parent directive is placed on an `ng-template`. If using Ivy, the\n * injected value will be used over this one.\n */\n @Input('cdkMenuPanel') private readonly _explicitPanel?: CdkMenuPanel;\n\n constructor(\n private readonly _ngZone: NgZone,\n readonly _elementRef: ElementRef<HTMLElement>,\n @Self() @Optional() @Inject(MENU_AIM) private readonly _menuAim?: MenuAim,\n @Optional() private readonly _dir?: Directionality,\n // `CdkMenuPanel` is always used in combination with a `CdkMenu`.\n // tslint:disable-next-line: lightweight-tokens\n @Optional() private readonly _menuPanel?: CdkMenuPanel,\n ) {\n super();\n }\n\n ngOnInit() {\n this._registerWithParentPanel();\n }\n\n override ngAfterContentInit() {\n super.ngAfterContentInit();\n\n this._completeChangeEmitter();\n this._setKeyManager();\n this._subscribeToMenuOpen();\n this._subscribeToMenuStack();\n this._subscribeToMouseManager();\n\n this._menuAim?.initialize(this, this._pointerTracker!);\n }\n\n /** Place focus on the first MenuItem in the menu and set the focus origin. */\n focusFirstItem(focusOrigin: FocusOrigin = 'program') {\n this._keyManager.setFocusOrigin(focusOrigin);\n this._keyManager.setFirstItemActive();\n }\n\n /** Place focus on the last MenuItem in the menu and set the focus origin. */\n focusLastItem(focusOrigin: FocusOrigin = 'program') {\n this._keyManager.setFocusOrigin(focusOrigin);\n this._keyManager.setLastItemActive();\n }\n\n /** Handle keyboard events for the Menu. */\n _handleKeyEvent(event: KeyboardEvent) {\n const keyManager = this._keyManager;\n switch (event.keyCode) {\n case LEFT_ARROW:\n case RIGHT_ARROW:\n if (this._isHorizontal()) {\n event.preventDefault();\n keyManager.setFocusOrigin('keyboard');\n keyManager.onKeydown(event);\n }\n break;\n\n case UP_ARROW:\n case DOWN_ARROW:\n if (!this._isHorizontal()) {\n event.preventDefault();\n keyManager.setFocusOrigin('keyboard');\n keyManager.onKeydown(event);\n }\n break;\n\n case ESCAPE:\n if (!hasModifierKey(event)) {\n event.preventDefault();\n this._menuStack.close(this, FocusNext.currentItem);\n }\n break;\n\n case TAB:\n this._menuStack.closeAll();\n break;\n\n default:\n keyManager.onKeydown(event);\n }\n }\n\n /** Register this menu with its enclosing parent menu panel */\n private _registerWithParentPanel() {\n this._getMenuPanel()?._registerMenu(this);\n }\n\n /**\n * Get the enclosing CdkMenuPanel defaulting to the injected reference over the developer\n * provided reference.\n */\n private _getMenuPanel() {\n return this._menuPanel || this._explicitPanel;\n }\n\n /**\n * Complete the change emitter if there are any nested MenuGroups or register to complete the\n * change emitter if a MenuGroup is rendered at some point\n */\n private _completeChangeEmitter() {\n if (this._hasNestedGroups()) {\n this.change.complete();\n } else {\n this._nestedGroups.changes.pipe(take(1)).subscribe(() => this.change.complete());\n }\n }\n\n /** Return true if there are nested CdkMenuGroup elements within the Menu */\n private _hasNestedGroups() {\n // view engine has a bug where @ContentChildren will return the current element\n // along with children if the selectors match - not just the children.\n // Here, if there is at least one element, we check to see if the first element is a CdkMenu in\n // order to ensure that we return true iff there are child CdkMenuGroup elements.\n return this._nestedGroups.length > 0 && !(this._nestedGroups.first instanceof CdkMenu);\n }\n\n /** Setup the FocusKeyManager with the correct orientation for the menu. */\n private _setKeyManager() {\n this._keyManager = new FocusKeyManager(this._allItems)\n .withWrap()\n .withTypeAhead()\n .withHomeAndEnd();\n\n if (this._isHorizontal()) {\n this._keyManager.withHorizontalOrientation(this._dir?.value || 'ltr');\n } else {\n this._keyManager.withVerticalOrientation();\n }\n }\n\n /**\n * Set the PointerFocusTracker and ensure that when mouse focus changes the key manager is updated\n * with the latest menu item under mouse focus.\n */\n private _subscribeToMouseManager() {\n this._ngZone.runOutsideAngular(() => {\n this._pointerTracker = new PointerFocusTracker(this._allItems);\n this._pointerTracker.entered\n .pipe(takeUntil(this.closed))\n .subscribe(item => this._keyManager.setActiveItem(item));\n });\n }\n\n /** Subscribe to the MenuStack close and empty observables. */\n private _subscribeToMenuStack() {\n this._menuStack.closed\n .pipe(takeUntil(this.closed))\n .subscribe(item => this._closeOpenMenu(item));\n\n this._menuStack.emptied\n .pipe(takeUntil(this.closed))\n .subscribe(event => this._toggleMenuFocus(event));\n }\n\n /**\n * Close the open menu if the current active item opened the requested MenuStackItem.\n * @param item the MenuStackItem requested to be closed.\n */\n private _closeOpenMenu(menu: MenuStackItem | undefined) {\n const keyManager = this._keyManager;\n const trigger = this._openItem;\n if (menu === trigger?.getMenuTrigger()?.getMenu()) {\n trigger?.getMenuTrigger()?.closeMenu();\n // If the user has moused over a sibling item we want to focus the element under mouse focus\n // not the trigger which previously opened the now closed menu.\n if (trigger) {\n keyManager.setActiveItem(this._pointerTracker?.activeElement || trigger);\n }\n }\n }\n\n /** Set focus the either the current, previous or next item based on the FocusNext event. */\n private _toggleMenuFocus(event: FocusNext | undefined) {\n const keyManager = this._keyManager;\n switch (event) {\n case FocusNext.nextItem:\n keyManager.setFocusOrigin('keyboard');\n keyManager.setNextItemActive();\n break;\n\n case FocusNext.previousItem:\n keyManager.setFocusOrigin('keyboard');\n keyManager.setPreviousItemActive();\n break;\n\n case FocusNext.currentItem:\n if (keyManager.activeItem) {\n keyManager.setFocusOrigin('keyboard');\n keyManager.setActiveItem(keyManager.activeItem);\n }\n break;\n }\n }\n\n // TODO(andy9775): remove duplicate logic between menu an menu bar\n /**\n * Subscribe to the menu trigger's open events in order to track the trigger which opened the menu\n * and stop tracking it when the menu is closed.\n */\n private _subscribeToMenuOpen() {\n const exitCondition = merge(this._allItems.changes, this.closed);\n this._allItems.changes\n .pipe(\n startWith(this._allItems),\n mergeMap((list: QueryList<CdkMenuItem>) =>\n list\n .filter(item => item.hasMenu())\n .map(item => item.getMenuTrigger()!.opened.pipe(mapTo(item), takeUntil(exitCondition))),\n ),\n mergeAll(),\n switchMap((item: CdkMenuItem) => {\n this._openItem = item;\n return item.getMenuTrigger()!.closed;\n }),\n takeUntil(this.closed),\n )\n .subscribe(() => (this._openItem = undefined));\n }\n\n /** Return true if this menu has been configured in a horizontal orientation. */\n private _isHorizontal() {\n return this.orientation === 'horizontal';\n }\n\n /**\n * Return true if this menu is an inline menu. That is, it does not exist in a pop-up and is\n * always visible in the dom.\n */\n _isInline() {\n // NoopMenuStack is the default. If this menu is not inline than the NoopMenuStack is replaced\n // automatically.\n return this._menuStack instanceof NoopMenuStack;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this._emitClosedEvent();\n this._pointerTracker?.destroy();\n }\n\n /** Emit and complete the closed event emitter */\n private _emitClosedEvent() {\n this.closed.next();\n this.closed.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n Input,\n ContentChildren,\n QueryList,\n AfterContentInit,\n OnDestroy,\n Optional,\n NgZone,\n ElementRef,\n Inject,\n Self,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {FocusKeyManager, FocusOrigin} from '@angular/cdk/a11y';\nimport {LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW, ESCAPE, TAB} from '@angular/cdk/keycodes';\nimport {takeUntil, mergeAll, mapTo, startWith, mergeMap, switchMap} from 'rxjs/operators';\nimport {Subject, merge} from 'rxjs';\nimport {CdkMenuGroup} from './menu-group';\nimport {CDK_MENU, Menu} from './menu-interface';\nimport {CdkMenuItem} from './menu-item';\nimport {MenuStack, MenuStackItem, FocusNext} from './menu-stack';\nimport {PointerFocusTracker} from './pointer-focus-tracker';\nimport {MenuAim, MENU_AIM} from './menu-aim';\n\n/**\n * Directive applied to an element which configures it as a MenuBar by setting the appropriate\n * role, aria attributes, and accessible keyboard and mouse handling logic. The component that\n * this directive is applied to should contain components marked with CdkMenuItem.\n *\n */\n@Directive({\n selector: '[cdkMenuBar]',\n exportAs: 'cdkMenuBar',\n host: {\n 'role': 'menubar',\n 'class': 'cdk-menu-bar',\n 'tabindex': '0',\n '[attr.aria-orientation]': 'orientation',\n '(focus)': 'focusFirstItem()',\n '(keydown)': '_handleKeyEvent($event)',\n },\n providers: [\n {provide: CdkMenuGroup, useExisting: CdkMenuBar},\n {provide: CDK_MENU, useExisting: CdkMenuBar},\n {provide: MenuStack, useClass: MenuStack},\n ],\n})\nexport class CdkMenuBar extends CdkMenuGroup implements Menu, AfterContentInit, OnDestroy {\n /**\n * Sets the aria-orientation attribute and determines where menus will be opened.\n * Does not affect styling/layout.\n */\n @Input('cdkMenuBarOrientation') orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /** Handles keyboard events for the MenuBar. */\n private _keyManager: FocusKeyManager<CdkMenuItem>;\n\n /** Manages items under mouse focus */\n private _pointerTracker?: PointerFocusTracker<CdkMenuItem>;\n\n /** Emits when the MenuBar is destroyed. */\n private readonly _destroyed: Subject<void> = new Subject();\n\n /** All child MenuItem elements nested in this MenuBar. */\n @ContentChildren(CdkMenuItem, {descendants: true})\n private readonly _allItems: QueryList<CdkMenuItem>;\n\n /** The Menu Item which triggered the open submenu. */\n private _openItem?: CdkMenuItem;\n\n constructor(\n readonly _menuStack: MenuStack,\n private readonly _ngZone: NgZone,\n readonly _elementRef: ElementRef<HTMLElement>,\n @Self() @Optional() @Inject(MENU_AIM) private readonly _menuAim?: MenuAim,\n @Optional() private readonly _dir?: Directionality,\n ) {\n super();\n }\n\n override ngAfterContentInit() {\n super.ngAfterContentInit();\n\n this._setKeyManager();\n this._subscribeToMenuOpen();\n this._subscribeToMenuStack();\n this._subscribeToMouseManager();\n\n this._menuAim?.initialize(this, this._pointerTracker!);\n }\n\n /** Place focus on the first MenuItem in the menu and set the focus origin. */\n focusFirstItem(focusOrigin: FocusOrigin = 'program') {\n this._keyManager.setFocusOrigin(focusOrigin);\n this._keyManager.setFirstItemActive();\n }\n\n /** Place focus on the last MenuItem in the menu and set the focus origin. */\n focusLastItem(focusOrigin: FocusOrigin = 'program') {\n this._keyManager.setFocusOrigin(focusOrigin);\n this._keyManager.setLastItemActive();\n }\n\n /**\n * Handle keyboard events, specifically changing the focused element and/or toggling the active\n * items menu.\n * @param event the KeyboardEvent to handle.\n */\n _handleKeyEvent(event: KeyboardEvent) {\n const keyManager = this._keyManager;\n switch (event.keyCode) {\n case UP_ARROW:\n case DOWN_ARROW:\n case LEFT_ARROW:\n case RIGHT_ARROW:\n const horizontalArrows = event.keyCode === LEFT_ARROW || event.keyCode === RIGHT_ARROW;\n // For a horizontal menu if the left/right keys were clicked, or a vertical menu if the\n // up/down keys were clicked: if the current menu is open, close it then focus and open the\n // next menu.\n if (\n (this._isHorizontal() && horizontalArrows) ||\n (!this._isHorizontal() && !horizontalArrows)\n ) {\n event.preventDefault();\n\n const prevIsOpen = keyManager.activeItem?.isMenuOpen();\n keyManager.activeItem?.getMenuTrigger()?.closeMenu();\n\n keyManager.setFocusOrigin('keyboard');\n keyManager.onKeydown(event);\n if (prevIsOpen) {\n keyManager.activeItem?.getMenuTrigger()?.openMenu();\n }\n }\n break;\n\n case ESCAPE:\n event.preventDefault();\n keyManager.activeItem?.getMenuTrigger()?.closeMenu();\n break;\n\n case TAB:\n keyManager.activeItem?.getMenuTrigger()?.closeMenu();\n break;\n\n default:\n keyManager.onKeydown(event);\n }\n }\n\n /** Setup the FocusKeyManager with the correct orientation for the menu bar. */\n private _setKeyManager() {\n this._keyManager = new FocusKeyManager(this._allItems)\n .withWrap()\n .withTypeAhead()\n .withHomeAndEnd();\n\n if (this._isHorizontal()) {\n this._keyManager.withHorizontalOrientation(this._dir?.value || 'ltr');\n } else {\n this._keyManager.withVerticalOrientation();\n }\n }\n\n /**\n * Set the PointerFocusTracker and ensure that when mouse focus changes the key manager is updated\n * with the latest menu item under mouse focus.\n */\n private _subscribeToMouseManager() {\n this._ngZone.runOutsideAngular(() => {\n this._pointerTracker = new PointerFocusTracker(this._allItems);\n this._pointerTracker.entered.pipe(takeUntil(this._destroyed)).subscribe(item => {\n if (this._hasOpenSubmenu()) {\n this._keyManager.setActiveItem(item);\n }\n });\n });\n }\n\n /** Subscribe to the MenuStack close and empty observables. */\n private _subscribeToMenuStack() {\n this._menuStack.closed\n .pipe(takeUntil(this._destroyed))\n .subscribe(item => this._closeOpenMenu(item));\n\n this._menuStack.emptied\n .pipe(takeUntil(this._destroyed))\n .subscribe(event => this._toggleOpenMenu(event));\n }\n\n /**\n * Close the open menu if the current active item opened the requested MenuStackItem.\n * @param item the MenuStackItem requested to be closed.\n */\n private _closeOpenMenu(menu: MenuStackItem | undefined) {\n const trigger = this._openItem;\n const keyManager = this._keyManager;\n if (menu === trigger?.getMenuTrigger()?.getMenu()) {\n trigger?.getMenuTrigger()?.closeMenu();\n // If the user has moused over a sibling item we want to focus the element under mouse focus\n // not the trigger which previously opened the now closed menu.\n if (trigger) {\n keyManager.setActiveItem(this._pointerTracker?.activeElement || trigger);\n }\n }\n }\n\n /**\n * Set focus to either the current, previous or next item based on the FocusNext event, then\n * open the previous or next item.\n */\n private _toggleOpenMenu(event: FocusNext | undefined) {\n const keyManager = this._keyManager;\n switch (event) {\n case FocusNext.nextItem:\n keyManager.setFocusOrigin('keyboard');\n keyManager.setNextItemActive();\n keyManager.activeItem?.getMenuTrigger()?.openMenu();\n break;\n\n case FocusNext.previousItem:\n keyManager.setFocusOrigin('keyboard');\n keyManager.setPreviousItemActive();\n keyManager.activeItem?.getMenuTrigger()?.openMenu();\n break;\n\n case FocusNext.currentItem:\n if (keyManager.activeItem) {\n keyManager.setFocusOrigin('keyboard');\n keyManager.setActiveItem(keyManager.activeItem);\n }\n break;\n }\n }\n\n /**\n * @return true if the menu bar is configured to be horizontal.\n */\n private _isHorizontal() {\n return this.orientation === 'horizontal';\n }\n\n /**\n * Subscribe to the menu trigger's open events in order to track the trigger which opened the menu\n * and stop tracking it when the menu is closed.\n */\n private _subscribeToMenuOpen() {\n const exitCondition = merge(this._allItems.changes, this._destroyed);\n this._allItems.changes\n .pipe(\n startWith(this._allItems),\n mergeMap((list: QueryList<CdkMenuItem>) =>\n list\n .filter(item => item.hasMenu())\n .map(item => item.getMenuTrigger()!.opened.pipe(mapTo(item), takeUntil(exitCondition))),\n ),\n mergeAll(),\n switchMap((item: CdkMenuItem) => {\n this._openItem = item;\n return item.getMenuTrigger()!.closed;\n }),\n takeUntil(this._destroyed),\n )\n .subscribe(() => (this._openItem = undefined));\n }\n\n /** Return true if the MenuBar has an open submenu. */\n private _hasOpenSubmenu() {\n return !!this._openItem;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n\n this._destroyed.next();\n this._destroyed.complete();\n\n this._pointerTracker?.destroy();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {UniqueSelectionDispatcher} from '@angular/cdk/collections';\nimport {Directive, OnDestroy, ElementRef, Self, Optional, Inject, NgZone} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {CdkMenuItemSelectable} from './menu-item-selectable';\nimport {CdkMenuItem} from './menu-item';\nimport {CdkMenuItemTrigger} from './menu-item-trigger';\nimport {CDK_MENU, Menu} from './menu-interface';\nimport {MENU_AIM, MenuAim} from './menu-aim';\n\n/**\n * A directive providing behavior for the \"menuitemradio\" ARIA role, which behaves similarly to\n * a conventional radio-button. Any sibling `CdkMenuItemRadio` instances within the same `CdkMenu`\n * or `CdkMenuGroup` comprise a radio group with unique selection enforced.\n */\n@Directive({\n selector: '[cdkMenuItemRadio]',\n exportAs: 'cdkMenuItemRadio',\n host: {\n '[tabindex]': '_tabindex',\n 'type': 'button',\n 'role': 'menuitemradio',\n '[attr.aria-checked]': 'checked || null',\n '[attr.aria-disabled]': 'disabled || null',\n },\n providers: [\n {provide: CdkMenuItemSelectable, useExisting: CdkMenuItemRadio},\n {provide: CdkMenuItem, useExisting: CdkMenuItemSelectable},\n ],\n})\nexport class CdkMenuItemRadio extends CdkMenuItemSelectable implements OnDestroy {\n /** Function to unregister the selection dispatcher */\n private _removeDispatcherListener: () => void;\n\n constructor(\n private readonly _selectionDispatcher: UniqueSelectionDispatcher,\n element: ElementRef<HTMLElement>,\n ngZone: NgZone,\n @Optional() @Inject(CDK_MENU) parentMenu?: Menu,\n @Optional() @Inject(MENU_AIM) menuAim?: MenuAim,\n @Optional() dir?: Directionality,\n /** Reference to the CdkMenuItemTrigger directive if one is added to the same element */\n // `CdkMenuItemRadio` is commonly used in combination with a `CdkMenuItemTrigger`.\n // tslint:disable-next-line: lightweight-tokens\n @Self() @Optional() menuTrigger?: CdkMenuItemTrigger,\n ) {\n super(element, ngZone, parentMenu, menuAim, dir, menuTrigger);\n\n this._registerDispatcherListener();\n }\n\n /** Configure the unique selection dispatcher listener in order to toggle the checked state */\n private _registerDispatcherListener() {\n this._removeDispatcherListener = this._selectionDispatcher.listen(\n (id: string, name: string) => (this.checked = this.id === id && this.name === name),\n );\n }\n\n /** Toggles the checked state of the radio-button. */\n override trigger() {\n super.trigger();\n\n if (!this.disabled) {\n this._selectionDispatcher.notify(this.id, this.name);\n }\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this._removeDispatcherListener();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive} from '@angular/core';\nimport {CdkMenuItemSelectable} from './menu-item-selectable';\nimport {CdkMenuItem} from './menu-item';\n\n/**\n * A directive providing behavior for the \"menuitemcheckbox\" ARIA role, which behaves similarly to a\n * conventional checkbox.\n */\n@Directive({\n selector: '[cdkMenuItemCheckbox]',\n exportAs: 'cdkMenuItemCheckbox',\n host: {\n '[tabindex]': '_tabindex',\n 'type': 'button',\n 'role': 'menuitemcheckbox',\n '[attr.aria-checked]': 'checked || null',\n '[attr.aria-disabled]': 'disabled || null',\n },\n providers: [\n {provide: CdkMenuItemSelectable, useExisting: CdkMenuItemCheckbox},\n {provide: CdkMenuItem, useExisting: CdkMenuItemSelectable},\n ],\n})\nexport class CdkMenuItemCheckbox extends CdkMenuItemSelectable {\n /** Toggle the checked state of the checkbox. */\n override trigger() {\n super.trigger();\n\n if (!this.disabled) {\n this.checked = !this.checked;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Directive,\n Input,\n ViewContainerRef,\n Output,\n EventEmitter,\n Optional,\n OnDestroy,\n Inject,\n Injectable,\n InjectionToken,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n OverlayRef,\n Overlay,\n OverlayConfig,\n FlexibleConnectedPositionStrategy,\n ConnectedPosition,\n} from '@angular/cdk/overlay';\nimport {TemplatePortal, Portal} from '@angular/cdk/portal';\nimport {coerceBooleanProperty, BooleanInput} from '@angular/cdk/coercion';\nimport {Subject, merge} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {CdkMenuPanel} from './menu-panel';\nimport {MenuStack} from './menu-stack';\nimport {throwExistingMenuStackError} from './menu-errors';\nimport {isClickInsideMenuOverlay} from './menu-item-trigger';\n\n/** Tracks the last open context menu trigger across the entire application. */\n@Injectable({providedIn: 'root'})\nexport class ContextMenuTracker {\n /** The last open context menu trigger. */\n private static _openContextMenuTrigger?: CdkContextMenuTrigger;\n\n /**\n * Close the previous open context menu and set the given one as being open.\n * @param trigger the trigger for the currently open Context Menu.\n */\n update(trigger: CdkContextMenuTrigger) {\n if (ContextMenuTracker._openContextMenuTrigger !== trigger) {\n ContextMenuTracker._openContextMenuTrigger?.close();\n ContextMenuTracker._openContextMenuTrigger = trigger;\n }\n }\n}\n\n/** Configuration options passed to the context menu. */\nexport type ContextMenuOptions = {\n /** The opened menus X coordinate offset from the triggering position. */\n offsetX: number;\n\n /** The opened menus Y coordinate offset from the triggering position. */\n offsetY: number;\n};\n\n/** Injection token for the ContextMenu options object. */\nexport const CDK_CONTEXT_MENU_DEFAULT_OPTIONS = new InjectionToken<ContextMenuOptions>(\n 'cdk-context-menu-default-options',\n);\n\n/** The coordinates of where the context menu should open. */\nexport type ContextMenuCoordinates = {x: number; y: number};\n\n/**\n * A directive which when placed on some element opens a the Menu it is bound to when a user\n * right-clicks within that element. It is aware of nested Context Menus and the lowest level\n * non-disabled context menu will trigger.\n */\n@Directive({\n selector: '[cdkContextMenuTriggerFor]',\n exportAs: 'cdkContextMenuTriggerFor',\n host: {\n '(contextmenu)': '_openOnContextMenu($event)',\n },\n providers: [\n // In cases where the first menu item in the context menu is a trigger the submenu opens on a\n // hover event. Offsetting the opened context menu by 2px prevents this from occurring.\n {provide: CDK_CONTEXT_MENU_DEFAULT_OPTIONS, useValue: {offsetX: 2, offsetY: 2}},\n ],\n})\nexport class CdkContextMenuTrigger implements OnDestroy {\n /** Template reference variable to the menu to open on right click. */\n @Input('cdkContextMenuTriggerFor')\n get menuPanel(): CdkMenuPanel {\n return this._menuPanel;\n }\n set menuPanel(panel: CdkMenuPanel) {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && panel._menuStack) {\n throwExistingMenuStackError();\n }\n this._menuPanel = panel;\n\n if (this._menuPanel) {\n this._menuPanel._menuStack = this._menuStack;\n }\n }\n /** Reference to the MenuPanel this trigger toggles. */\n private _menuPanel: CdkMenuPanel;\n\n /** Emits when the attached menu is requested to open. */\n @Output('cdkContextMenuOpened') readonly opened: EventEmitter<void> = new EventEmitter();\n\n /** Emits when the attached menu is requested to close. */\n @Output('cdkContextMenuClosed') readonly closed: EventEmitter<void> = new EventEmitter();\n\n /** Whether the context menu should be disabled. */\n @Input('cdkContextMenuDisabled')\n get disabled() {\n return this._disabled;\n }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n }\n private _disabled = false;\n\n /** A reference to the overlay which manages the triggered menu. */\n private _overlayRef: OverlayRef | null = null;\n\n /** The content of the menu panel opened by this trigger. */\n private _panelContent: TemplatePortal;\n\n /** Emits when the element is destroyed. */\n private readonly _destroyed = new Subject<void>();\n\n /** The menu stack for this trigger and its associated menus. */\n private readonly _menuStack = new MenuStack();\n\n /** Emits when the outside pointer events listener on the overlay should be stopped. */\n private readonly _stopOutsideClicksListener = merge(this.closed, this._destroyed);\n\n constructor(\n protected readonly _viewContainerRef: ViewContainerRef,\n private readonly _overlay: Overlay,\n private readonly _contextMenuTracker: ContextMenuTracker,\n @Inject(CDK_CONTEXT_MENU_DEFAULT_OPTIONS) private readonly _options: ContextMenuOptions,\n @Optional() private readonly _directionality?: Directionality,\n ) {\n this._setMenuStackListener();\n }\n\n /**\n * Open the attached menu at the specified location.\n * @param coordinates where to open the context menu\n */\n open(coordinates: ContextMenuCoordinates) {\n if (this.disabled) {\n return;\n } else if (this.isOpen()) {\n // since we're moving this menu we need to close any submenus first otherwise they end up\n // disconnected from this one.\n this._menuStack.closeSubMenuOf(this._menuPanel._menu!);\n\n (\n this._overlayRef!.getConfig().positionStrategy as FlexibleConnectedPositionStrategy\n ).setOrigin(coordinates);\n this._overlayRef!.updatePosition();\n } else {\n this.opened.next();\n\n if (this._overlayRef) {\n (\n this._overlayRef.getConfig().positionStrategy as FlexibleConnectedPositionStrategy\n ).setOrigin(coordinates);\n this._overlayRef.updatePosition();\n } else {\n this._overlayRef = this._overlay.create(this._getOverlayConfig(coordinates));\n }\n\n this._overlayRef.attach(this._getMenuContent());\n this._subscribeToOutsideClicks();\n }\n }\n\n /** Close the opened menu. */\n close() {\n this._menuStack.closeAll();\n }\n\n /**\n * Open the context menu and close any previously open menus.\n * @param event the mouse event which opens the context menu.\n */\n _openOnContextMenu(event: MouseEvent) {\n if (!this.disabled) {\n // Prevent the native context menu from opening because we're opening a custom one.\n event.preventDefault();\n\n // Stop event propagation to ensure that only the closest enabled context menu opens.\n // Otherwise, any context menus attached to containing elements would *also* open,\n // resulting in multiple stacked context menus being displayed.\n event.stopPropagation();\n\n this._contextMenuTracker.update(this);\n this.open({x: event.clientX, y: event.clientY});\n\n // A context menu can be triggered via a mouse right click or a keyboard shortcut.\n if (event.button === 2) {\n this._menuPanel._menu?.focusFirstItem('mouse');\n } else if (event.button === 0) {\n this._menuPanel._menu?.focusFirstItem('keyboard');\n } else {\n this._menuPanel._menu?.focusFirstItem('program');\n }\n }\n }\n\n /** Whether the attached menu is open. */\n isOpen() {\n return !!this._overlayRef?.hasAttached();\n }\n\n /**\n * Get the configuration object used to create the overlay.\n * @param coordinates the location to place the opened menu\n */\n private _getOverlayConfig(coordinates: ContextMenuCoordinates) {\n return new OverlayConfig({\n positionStrategy: this._getOverlayPositionStrategy(coordinates),\n scrollStrategy: this._overlay.scrollStrategies.block(),\n direction: this._directionality,\n });\n }\n\n /**\n * Build the position strategy for the overlay which specifies where to place the menu.\n * @param coordinates the location to place the opened menu\n */\n private _getOverlayPositionStrategy(\n coordinates: ContextMenuCoordinates,\n ): FlexibleConnectedPositionStrategy {\n return this._overlay\n .position()\n .flexibleConnectedTo(coordinates)\n .withDefaultOffsetX(this._options.offsetX)\n .withDefaultOffsetY(this._options.offsetY)\n .withPositions(this._getOverlayPositions());\n }\n\n /**\n * Determine and return where to position the opened menu relative to the mouse location.\n */\n private _getOverlayPositions(): ConnectedPosition[] {\n // TODO: this should be configurable through the injected context menu options\n return [\n {originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top'},\n {originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top'},\n {originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom'},\n {originX: 'start', originY: 'bottom', overlayX: 'end', overlayY: 'bottom'},\n ];\n }\n\n /**\n * Get the portal to be attached to the overlay which contains the menu. Allows for the menu\n * content to change dynamically and be reflected in the application.\n */\n private _getMenuContent(): Portal<unknown> {\n const hasMenuContentChanged = this.menuPanel._templateRef !== this._panelContent?.templateRef;\n if (this.menuPanel && (!this._panelContent || hasMenuContentChanged)) {\n this._panelContent = new TemplatePortal(this.menuPanel._templateRef, this._viewContainerRef);\n }\n\n return this._panelContent;\n }\n\n /** Subscribe to the menu stack close events and close this menu when requested. */\n private _setMenuStackListener() {\n this._menuStack.closed.pipe(takeUntil(this._destroyed)).subscribe(item => {\n if (item === this._menuPanel._menu && this.isOpen()) {\n this.closed.next();\n this._overlayRef!.detach();\n }\n });\n }\n\n /**\n * Subscribe to the overlays outside pointer events stream and handle closing out the stack if a\n * click occurs outside the menus.\n */\n private _subscribeToOutsideClicks() {\n if (this._overlayRef) {\n this._overlayRef\n .outsidePointerEvents()\n .pipe(takeUntil(this._stopOutsideClicksListener))\n .subscribe(event => {\n if (!isClickInsideMenuOverlay(event.target as Element)) {\n this._menuStack.closeAll();\n }\n });\n }\n }\n\n ngOnDestroy() {\n this._destroyOverlay();\n this._resetPanelMenuStack();\n\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Destroy and unset the overlay reference it if exists. */\n private _destroyOverlay() {\n if (this._overlayRef) {\n this._overlayRef.dispose();\n this._overlayRef = null;\n }\n }\n\n /** Set the menu panels menu stack back to null. */\n private _resetPanelMenuStack() {\n // If a ContextMenuTrigger is placed in a conditionally rendered view, each time the trigger is\n // rendered the panel setter for ContextMenuTrigger is called. From the first render onward,\n // the attached CdkMenuPanel has the MenuStack set. Since we throw an error if a panel already\n // has a stack set, we want to reset the attached stack here to prevent the error from being\n // thrown if the trigger re-configures its attached panel (in the case where there is a 1:1\n // relationship between the panel and trigger).\n if (this._menuPanel) {\n this._menuPanel._menuStack = null;\n }\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {OverlayModule} from '@angular/cdk/overlay';\nimport {CdkMenu} from './menu';\nimport {CdkMenuBar} from './menu-bar';\nimport {CdkMenuPanel} from './menu-panel';\nimport {CdkMenuItem} from './menu-item';\nimport {CdkMenuGroup} from './menu-group';\nimport {CdkMenuItemRadio} from './menu-item-radio';\nimport {CdkMenuItemCheckbox} from './menu-item-checkbox';\nimport {CdkMenuItemTrigger} from './menu-item-trigger';\nimport {CdkContextMenuTrigger} from './context-menu';\nimport {CdkTargetMenuAim} from './menu-aim';\n\nconst EXPORTED_DECLARATIONS = [\n CdkMenuBar,\n CdkMenu,\n CdkMenuPanel,\n CdkMenuItem,\n CdkMenuItemRadio,\n CdkMenuItemCheckbox,\n CdkMenuItemTrigger,\n CdkMenuGroup,\n CdkContextMenuTrigger,\n CdkTargetMenuAim,\n];\n@NgModule({\n imports: [OverlayModule],\n exports: EXPORTED_DECLARATIONS,\n declarations: EXPORTED_DECLARATIONS,\n})\nexport class CdkMenuModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './menu-module';\nexport * from './menu-bar';\nexport * from './menu';\nexport * from './menu-item';\nexport * from './menu-item-checkbox';\nexport * from './menu-item-radio';\nexport * from './menu-item-trigger';\nexport * from './menu-panel';\nexport * from './menu-group';\nexport * from './context-menu';\n\nexport {MenuStack, MenuStackItem} from './menu-stack';\nexport {CDK_MENU} from './menu-interface';\nexport {TargetMenuAim, MenuAim, MENU_AIM, CdkTargetMenuAim} from './menu-aim';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;AAYA;MACa,QAAQ,GAAG,IAAI,cAAc,CAAO,UAAU;;ACb3D;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