@angular/cdk 14.0.0-rc.0 → 14.0.0

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 (192) hide show
  1. package/esm2020/a11y/a11y-module.mjs +5 -5
  2. package/esm2020/a11y/aria-describer/aria-describer.mjs +10 -9
  3. package/esm2020/a11y/focus-monitor/focus-monitor.mjs +7 -7
  4. package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +4 -4
  5. package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +4 -4
  6. package/esm2020/a11y/focus-trap/focus-trap.mjs +7 -7
  7. package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +4 -4
  8. package/esm2020/a11y/input-modality/input-modality-detector.mjs +4 -4
  9. package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +4 -4
  10. package/esm2020/a11y/live-announcer/live-announcer.mjs +7 -7
  11. package/esm2020/accordion/accordion-item.mjs +4 -4
  12. package/esm2020/accordion/accordion-module.mjs +5 -5
  13. package/esm2020/accordion/accordion.mjs +4 -4
  14. package/esm2020/bidi/bidi-module.mjs +5 -5
  15. package/esm2020/bidi/dir.mjs +4 -4
  16. package/esm2020/bidi/directionality.mjs +4 -4
  17. package/esm2020/clipboard/clipboard-module.mjs +5 -5
  18. package/esm2020/clipboard/clipboard.mjs +4 -4
  19. package/esm2020/clipboard/copy-to-clipboard.mjs +4 -4
  20. package/esm2020/collections/unique-selection-dispatcher.mjs +4 -4
  21. package/esm2020/dialog/dialog-container.mjs +4 -4
  22. package/esm2020/dialog/dialog-module.mjs +5 -5
  23. package/esm2020/dialog/dialog.mjs +4 -4
  24. package/esm2020/drag-drop/directives/drag-handle.mjs +4 -4
  25. package/esm2020/drag-drop/directives/drag-placeholder.mjs +4 -4
  26. package/esm2020/drag-drop/directives/drag-preview.mjs +4 -4
  27. package/esm2020/drag-drop/directives/drag.mjs +4 -4
  28. package/esm2020/drag-drop/directives/drop-list-group.mjs +4 -4
  29. package/esm2020/drag-drop/directives/drop-list.mjs +4 -4
  30. package/esm2020/drag-drop/drag-drop-module.mjs +5 -5
  31. package/esm2020/drag-drop/drag-drop-registry.mjs +4 -4
  32. package/esm2020/drag-drop/drag-drop.mjs +4 -4
  33. package/esm2020/layout/breakpoints-observer.mjs +4 -4
  34. package/esm2020/layout/layout-module.mjs +5 -5
  35. package/esm2020/layout/media-matcher.mjs +4 -4
  36. package/esm2020/menu/context-menu-trigger.mjs +18 -35
  37. package/esm2020/menu/menu-aim.mjs +14 -15
  38. package/esm2020/menu/menu-bar.mjs +8 -34
  39. package/esm2020/menu/menu-base.mjs +23 -39
  40. package/esm2020/menu/menu-group.mjs +4 -4
  41. package/esm2020/menu/menu-item-checkbox.mjs +5 -4
  42. package/esm2020/menu/menu-item-radio.mjs +11 -54
  43. package/esm2020/menu/menu-item-selectable.mjs +4 -4
  44. package/esm2020/menu/menu-item.mjs +22 -52
  45. package/esm2020/menu/menu-module.mjs +5 -5
  46. package/esm2020/menu/menu-stack.mjs +4 -4
  47. package/esm2020/menu/menu-trigger-base.mjs +14 -21
  48. package/esm2020/menu/menu-trigger.mjs +31 -52
  49. package/esm2020/menu/menu.mjs +11 -45
  50. package/esm2020/observers/observe-content.mjs +14 -14
  51. package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +4 -4
  52. package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +4 -4
  53. package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +4 -4
  54. package/esm2020/overlay/fullscreen-overlay-container.mjs +4 -4
  55. package/esm2020/overlay/overlay-container.mjs +4 -4
  56. package/esm2020/overlay/overlay-directives.mjs +7 -7
  57. package/esm2020/overlay/overlay-module.mjs +5 -5
  58. package/esm2020/overlay/overlay.mjs +4 -4
  59. package/esm2020/overlay/position/overlay-position-builder.mjs +4 -4
  60. package/esm2020/overlay/scroll/scroll-strategy-options.mjs +4 -4
  61. package/esm2020/platform/platform-module.mjs +5 -5
  62. package/esm2020/platform/platform.mjs +4 -4
  63. package/esm2020/portal/portal-directives.mjs +17 -17
  64. package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +4 -4
  65. package/esm2020/scrolling/scroll-dispatcher.mjs +4 -4
  66. package/esm2020/scrolling/scrollable.mjs +4 -4
  67. package/esm2020/scrolling/scrolling-module.mjs +9 -9
  68. package/esm2020/scrolling/viewport-ruler.mjs +4 -4
  69. package/esm2020/scrolling/virtual-for-of.mjs +4 -4
  70. package/esm2020/scrolling/virtual-scroll-viewport.mjs +4 -4
  71. package/esm2020/stepper/step-header.mjs +4 -4
  72. package/esm2020/stepper/step-label.mjs +4 -4
  73. package/esm2020/stepper/stepper-button.mjs +7 -7
  74. package/esm2020/stepper/stepper-module.mjs +5 -5
  75. package/esm2020/stepper/stepper.mjs +7 -7
  76. package/esm2020/table/cell.mjs +22 -22
  77. package/esm2020/table/coalesced-style-scheduler.mjs +4 -4
  78. package/esm2020/table/row.mjs +28 -28
  79. package/esm2020/table/table-module.mjs +5 -5
  80. package/esm2020/table/table.mjs +19 -19
  81. package/esm2020/table/text-column.mjs +4 -4
  82. package/esm2020/text-field/autofill.mjs +7 -7
  83. package/esm2020/text-field/autosize.mjs +4 -4
  84. package/esm2020/text-field/text-field-module.mjs +5 -5
  85. package/esm2020/tree/nested-node.mjs +4 -4
  86. package/esm2020/tree/node.mjs +4 -4
  87. package/esm2020/tree/outlet.mjs +4 -4
  88. package/esm2020/tree/padding.mjs +4 -4
  89. package/esm2020/tree/toggle.mjs +4 -4
  90. package/esm2020/tree/tree-module.mjs +5 -5
  91. package/esm2020/tree/tree.mjs +7 -7
  92. package/esm2020/version.mjs +1 -1
  93. package/fesm2015/a11y.mjs +46 -45
  94. package/fesm2015/a11y.mjs.map +1 -1
  95. package/fesm2015/accordion.mjs +10 -10
  96. package/fesm2015/accordion.mjs.map +1 -1
  97. package/fesm2015/bidi.mjs +10 -10
  98. package/fesm2015/bidi.mjs.map +1 -1
  99. package/fesm2015/cdk.mjs +1 -1
  100. package/fesm2015/cdk.mjs.map +1 -1
  101. package/fesm2015/clipboard.mjs +10 -10
  102. package/fesm2015/clipboard.mjs.map +1 -1
  103. package/fesm2015/collections.mjs +3 -3
  104. package/fesm2015/collections.mjs.map +1 -1
  105. package/fesm2015/dialog.mjs +10 -10
  106. package/fesm2015/dialog.mjs.map +1 -1
  107. package/fesm2015/drag-drop.mjs +28 -28
  108. package/fesm2015/drag-drop.mjs.map +1 -1
  109. package/fesm2015/layout.mjs +10 -10
  110. package/fesm2015/layout.mjs.map +1 -1
  111. package/fesm2015/menu.mjs +248 -423
  112. package/fesm2015/menu.mjs.map +1 -1
  113. package/fesm2015/observers.mjs +13 -13
  114. package/fesm2015/observers.mjs.map +1 -1
  115. package/fesm2015/overlay.mjs +34 -34
  116. package/fesm2015/overlay.mjs.map +1 -1
  117. package/fesm2015/platform.mjs +7 -7
  118. package/fesm2015/platform.mjs.map +1 -1
  119. package/fesm2015/portal.mjs +16 -16
  120. package/fesm2015/portal.mjs.map +1 -1
  121. package/fesm2015/scrolling.mjs +26 -26
  122. package/fesm2015/scrolling.mjs.map +1 -1
  123. package/fesm2015/stepper.mjs +22 -22
  124. package/fesm2015/stepper.mjs.map +1 -1
  125. package/fesm2015/table.mjs +76 -76
  126. package/fesm2015/table.mjs.map +1 -1
  127. package/fesm2015/text-field.mjs +13 -13
  128. package/fesm2015/text-field.mjs.map +1 -1
  129. package/fesm2015/tree.mjs +25 -25
  130. package/fesm2015/tree.mjs.map +1 -1
  131. package/fesm2020/a11y.mjs +46 -45
  132. package/fesm2020/a11y.mjs.map +1 -1
  133. package/fesm2020/accordion.mjs +10 -10
  134. package/fesm2020/accordion.mjs.map +1 -1
  135. package/fesm2020/bidi.mjs +10 -10
  136. package/fesm2020/bidi.mjs.map +1 -1
  137. package/fesm2020/cdk.mjs +1 -1
  138. package/fesm2020/cdk.mjs.map +1 -1
  139. package/fesm2020/clipboard.mjs +10 -10
  140. package/fesm2020/clipboard.mjs.map +1 -1
  141. package/fesm2020/collections.mjs +3 -3
  142. package/fesm2020/collections.mjs.map +1 -1
  143. package/fesm2020/dialog.mjs +10 -10
  144. package/fesm2020/dialog.mjs.map +1 -1
  145. package/fesm2020/drag-drop.mjs +28 -28
  146. package/fesm2020/drag-drop.mjs.map +1 -1
  147. package/fesm2020/layout.mjs +10 -10
  148. package/fesm2020/layout.mjs.map +1 -1
  149. package/fesm2020/menu.mjs +238 -404
  150. package/fesm2020/menu.mjs.map +1 -1
  151. package/fesm2020/observers.mjs +13 -13
  152. package/fesm2020/observers.mjs.map +1 -1
  153. package/fesm2020/overlay.mjs +34 -34
  154. package/fesm2020/overlay.mjs.map +1 -1
  155. package/fesm2020/platform.mjs +7 -7
  156. package/fesm2020/platform.mjs.map +1 -1
  157. package/fesm2020/portal.mjs +16 -16
  158. package/fesm2020/portal.mjs.map +1 -1
  159. package/fesm2020/scrolling.mjs +26 -26
  160. package/fesm2020/scrolling.mjs.map +1 -1
  161. package/fesm2020/stepper.mjs +22 -22
  162. package/fesm2020/stepper.mjs.map +1 -1
  163. package/fesm2020/table.mjs +76 -76
  164. package/fesm2020/table.mjs.map +1 -1
  165. package/fesm2020/text-field.mjs +13 -13
  166. package/fesm2020/text-field.mjs.map +1 -1
  167. package/fesm2020/tree.mjs +25 -25
  168. package/fesm2020/tree.mjs.map +1 -1
  169. package/menu/index.d.ts +51 -150
  170. package/overlay/index.d.ts +2 -2
  171. package/package.json +3 -3
  172. package/schematics/index.d.ts +2 -1
  173. package/schematics/index.js +4 -4
  174. package/schematics/index.mjs +4 -4
  175. package/schematics/ng-add/index.js +1 -1
  176. package/schematics/ng-add/index.mjs +1 -1
  177. package/schematics/ng-generate/drag-drop/schema.json +3 -0
  178. package/schematics/ng-update/devkit-file-system.js +8 -5
  179. package/schematics/ng-update/devkit-file-system.mjs +8 -5
  180. package/schematics/utils/ast/standalone.d.ts +26 -0
  181. package/schematics/utils/ast/standalone.js +191 -0
  182. package/schematics/utils/ast/standalone.mjs +191 -0
  183. package/schematics/utils/ast.js +5 -4
  184. package/schematics/utils/ast.mjs +5 -4
  185. package/schematics/utils/build-component.js +4 -4
  186. package/schematics/utils/build-component.mjs +4 -4
  187. package/schematics/utils/index.d.ts +1 -0
  188. package/schematics/utils/index.js +5 -1
  189. package/schematics/utils/index.mjs +5 -1
  190. package/schematics/utils/vendored-ast-utils/index.d.ts +0 -70
  191. package/schematics/utils/vendored-ast-utils/index.js +0 -480
  192. package/schematics/utils/vendored-ast-utils/index.mjs +0 -480
package/fesm2020/menu.mjs CHANGED
@@ -1,16 +1,14 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, InjectionToken, Optional, SkipSelf, Inject, Injectable, EventEmitter, Injector, Self, Input, Output, ContentChildren, NgModule } from '@angular/core';
3
- import * as i1 from '@angular/cdk/overlay';
4
- import { OverlayConfig, STANDARD_DROPDOWN_BELOW_POSITIONS, STANDARD_DROPDOWN_ADJACENT_POSITIONS, OverlayModule } from '@angular/cdk/overlay';
2
+ import { Directive, InjectionToken, Optional, SkipSelf, Inject, Injectable, inject, Injector, ViewContainerRef, EventEmitter, NgZone, ElementRef, InjectFlags, Input, Output, ContentChildren, NgModule } from '@angular/core';
3
+ import { Overlay, OverlayConfig, STANDARD_DROPDOWN_BELOW_POSITIONS, STANDARD_DROPDOWN_ADJACENT_POSITIONS, OverlayModule } from '@angular/cdk/overlay';
5
4
  import { UP_ARROW, hasModifierKey, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, ENTER, SPACE, TAB, ESCAPE } from '@angular/cdk/keycodes';
6
- import * as i1$1 from '@angular/cdk/bidi';
7
5
  import { startWith, debounceTime, distinctUntilChanged, filter, takeUntil, mergeMap, mapTo, mergeAll, switchMap, skip } from 'rxjs/operators';
8
- import * as i1$2 from '@angular/cdk/collections';
9
6
  import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
10
- import { Subject, fromEvent, merge, defer, partition } from 'rxjs';
7
+ import { Subject, merge, fromEvent, defer, partition } from 'rxjs';
11
8
  import { TemplatePortal } from '@angular/cdk/portal';
12
9
  import { FocusKeyManager } from '@angular/cdk/a11y';
13
10
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
11
+ import { Directionality } from '@angular/cdk/bidi';
14
12
 
15
13
  /**
16
14
  * @license
@@ -24,9 +22,9 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion';
24
22
  */
25
23
  class CdkMenuGroup {
26
24
  }
27
- CdkMenuGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
28
- CdkMenuGroup.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-next.16", type: CdkMenuGroup, selector: "[cdkMenuGroup]", host: { attributes: { "role": "group" }, classAttribute: "cdk-menu-group" }, providers: [{ provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }], exportAs: ["cdkMenuGroup"], ngImport: i0 });
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuGroup, decorators: [{
25
+ CdkMenuGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
26
+ CdkMenuGroup.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuGroup, selector: "[cdkMenuGroup]", host: { attributes: { "role": "group" }, classAttribute: "cdk-menu-group" }, providers: [{ provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }], exportAs: ["cdkMenuGroup"], ngImport: i0 });
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuGroup, decorators: [{
30
28
  type: Directive,
31
29
  args: [{
32
30
  selector: '[cdkMenuGroup]',
@@ -195,12 +193,114 @@ class MenuStack {
195
193
  this._hasFocus.next(hasFocus);
196
194
  }
197
195
  }
198
- MenuStack.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: MenuStack, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
199
- MenuStack.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: MenuStack });
200
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: MenuStack, decorators: [{
196
+ MenuStack.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: MenuStack, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
197
+ MenuStack.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: MenuStack });
198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: MenuStack, decorators: [{
201
199
  type: Injectable
202
200
  }] });
203
201
 
202
+ /**
203
+ * @license
204
+ * Copyright Google LLC All Rights Reserved.
205
+ *
206
+ * Use of this source code is governed by an MIT-style license that can be
207
+ * found in the LICENSE file at https://angular.io/license
208
+ */
209
+ /** Injection token used for an implementation of MenuStack. */
210
+ const MENU_TRIGGER = new InjectionToken('cdk-menu-trigger');
211
+ /**
212
+ * Abstract directive that implements shared logic common to all menu triggers.
213
+ * This class can be extended to create custom menu trigger types.
214
+ */
215
+ class CdkMenuTriggerBase {
216
+ constructor() {
217
+ /** The DI injector for this component. */
218
+ this.injector = inject(Injector);
219
+ /** The view container ref for this component */
220
+ this.viewContainerRef = inject(ViewContainerRef);
221
+ /** The menu stack in which this menu resides. */
222
+ this.menuStack = inject(MENU_STACK);
223
+ /** Emits when the attached menu is requested to open */
224
+ this.opened = new EventEmitter();
225
+ /** Emits when the attached menu is requested to close */
226
+ this.closed = new EventEmitter();
227
+ /** A reference to the overlay which manages the triggered menu */
228
+ this.overlayRef = null;
229
+ /** Emits when this trigger is destroyed. */
230
+ this.destroyed = new Subject();
231
+ /** Emits when the outside pointer events listener on the overlay should be stopped. */
232
+ this.stopOutsideClicksListener = merge(this.closed, this.destroyed);
233
+ }
234
+ ngOnDestroy() {
235
+ this._destroyOverlay();
236
+ this.destroyed.next();
237
+ this.destroyed.complete();
238
+ }
239
+ /** Whether the attached menu is open. */
240
+ isOpen() {
241
+ return !!this.overlayRef?.hasAttached();
242
+ }
243
+ /** Registers a child menu as having been opened by this trigger. */
244
+ registerChildMenu(child) {
245
+ this.childMenu = child;
246
+ }
247
+ /**
248
+ * Get the portal to be attached to the overlay which contains the menu. Allows for the menu
249
+ * content to change dynamically and be reflected in the application.
250
+ */
251
+ getMenuContentPortal() {
252
+ const hasMenuContentChanged = this.menuTemplateRef !== this._menuPortal?.templateRef;
253
+ if (this.menuTemplateRef && (!this._menuPortal || hasMenuContentChanged)) {
254
+ this._menuPortal = new TemplatePortal(this.menuTemplateRef, this.viewContainerRef, undefined, this._getChildMenuInjector());
255
+ }
256
+ return this._menuPortal;
257
+ }
258
+ /**
259
+ * Whether the given element is inside the scope of this trigger's menu stack.
260
+ * @param element The element to check.
261
+ * @return Whether the element is inside the scope of this trigger's menu stack.
262
+ */
263
+ isElementInsideMenuStack(element) {
264
+ for (let el = element; el; el = el?.parentElement ?? null) {
265
+ if (el.getAttribute('data-cdk-menu-stack-id') === this.menuStack.id) {
266
+ return true;
267
+ }
268
+ }
269
+ return false;
270
+ }
271
+ /** Destroy and unset the overlay reference it if exists */
272
+ _destroyOverlay() {
273
+ if (this.overlayRef) {
274
+ this.overlayRef.dispose();
275
+ this.overlayRef = null;
276
+ }
277
+ }
278
+ /** Gets the injector to use when creating a child menu. */
279
+ _getChildMenuInjector() {
280
+ this._childMenuInjector =
281
+ this._childMenuInjector ||
282
+ Injector.create({
283
+ providers: [
284
+ { provide: MENU_TRIGGER, useValue: this },
285
+ { provide: MENU_STACK, useValue: this.menuStack },
286
+ ],
287
+ parent: this.injector,
288
+ });
289
+ return this._childMenuInjector;
290
+ }
291
+ }
292
+ CdkMenuTriggerBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuTriggerBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
293
+ CdkMenuTriggerBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuTriggerBase, host: { properties: { "attr.aria-controls": "childMenu?.id", "attr.data-cdk-menu-stack-id": "menuStack.id" } }, ngImport: i0 });
294
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuTriggerBase, decorators: [{
295
+ type: Directive,
296
+ args: [{
297
+ host: {
298
+ '[attr.aria-controls]': 'childMenu?.id',
299
+ '[attr.data-cdk-menu-stack-id]': 'menuStack.id',
300
+ },
301
+ }]
302
+ }] });
303
+
204
304
  /**
205
305
  * @license
206
306
  * Copyright Google LLC All Rights Reserved.
@@ -278,10 +378,9 @@ function isWithinSubmenu(submenuPoints, m, b) {
278
378
  * to submenu.
279
379
  */
280
380
  class TargetMenuAim {
281
- constructor(
282
- /** The Angular zone. */
283
- _ngZone) {
284
- this._ngZone = _ngZone;
381
+ constructor() {
382
+ /** The Angular zone. */
383
+ this._ngZone = inject(NgZone);
285
384
  /** The last NUM_POINTS mouse move events. */
286
385
  this._points = [];
287
386
  /** Emits when this service is destroyed. */
@@ -400,20 +499,20 @@ class TargetMenuAim {
400
499
  });
401
500
  }
402
501
  }
403
- TargetMenuAim.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: TargetMenuAim, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
404
- TargetMenuAim.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: TargetMenuAim });
405
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: TargetMenuAim, decorators: [{
502
+ TargetMenuAim.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: TargetMenuAim, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
503
+ TargetMenuAim.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: TargetMenuAim });
504
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: TargetMenuAim, decorators: [{
406
505
  type: Injectable
407
- }], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
506
+ }] });
408
507
  /**
409
508
  * CdkTargetMenuAim is a provider for the TargetMenuAim service. It can be added to an
410
509
  * element with either the `cdkMenu` or `cdkMenuBar` directive and child menu items.
411
510
  */
412
511
  class CdkTargetMenuAim {
413
512
  }
414
- CdkTargetMenuAim.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkTargetMenuAim, deps: [], target: i0.ɵɵFactoryTarget.Directive });
415
- CdkTargetMenuAim.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-next.16", type: CdkTargetMenuAim, selector: "[cdkTargetMenuAim]", providers: [{ provide: MENU_AIM, useClass: TargetMenuAim }], exportAs: ["cdkTargetMenuAim"], ngImport: i0 });
416
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkTargetMenuAim, decorators: [{
513
+ CdkTargetMenuAim.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkTargetMenuAim, deps: [], target: i0.ɵɵFactoryTarget.Directive });
514
+ CdkTargetMenuAim.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkTargetMenuAim, selector: "[cdkTargetMenuAim]", providers: [{ provide: MENU_AIM, useClass: TargetMenuAim }], exportAs: ["cdkTargetMenuAim"], ngImport: i0 });
515
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkTargetMenuAim, decorators: [{
417
516
  type: Directive,
418
517
  args: [{
419
518
  selector: '[cdkTargetMenuAim]',
@@ -422,114 +521,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
422
521
  }]
423
522
  }] });
424
523
 
425
- /**
426
- * @license
427
- * Copyright Google LLC All Rights Reserved.
428
- *
429
- * Use of this source code is governed by an MIT-style license that can be
430
- * found in the LICENSE file at https://angular.io/license
431
- */
432
- /** Injection token used for an implementation of MenuStack. */
433
- const MENU_TRIGGER = new InjectionToken('cdk-menu-trigger');
434
- /**
435
- * Abstract directive that implements shared logic common to all menu triggers.
436
- * This class can be extended to create custom menu trigger types.
437
- */
438
- class CdkMenuTriggerBase {
439
- constructor(
440
- /** The DI injector for this component */
441
- injector,
442
- /** The view container ref for this component */
443
- viewContainerRef,
444
- /** The menu stack this menu is part of. */
445
- menuStack) {
446
- this.injector = injector;
447
- this.viewContainerRef = viewContainerRef;
448
- this.menuStack = menuStack;
449
- /** Emits when the attached menu is requested to open */
450
- this.opened = new EventEmitter();
451
- /** Emits when the attached menu is requested to close */
452
- this.closed = new EventEmitter();
453
- /** A reference to the overlay which manages the triggered menu */
454
- this.overlayRef = null;
455
- /** Emits when this trigger is destroyed. */
456
- this.destroyed = new Subject();
457
- /** Emits when the outside pointer events listener on the overlay should be stopped. */
458
- this.stopOutsideClicksListener = merge(this.closed, this.destroyed);
459
- }
460
- ngOnDestroy() {
461
- this._destroyOverlay();
462
- this.destroyed.next();
463
- this.destroyed.complete();
464
- }
465
- /** Whether the attached menu is open. */
466
- isOpen() {
467
- return !!this.overlayRef?.hasAttached();
468
- }
469
- /** Registers a child menu as having been opened by this trigger. */
470
- registerChildMenu(child) {
471
- this.childMenu = child;
472
- }
473
- /**
474
- * Get the portal to be attached to the overlay which contains the menu. Allows for the menu
475
- * content to change dynamically and be reflected in the application.
476
- */
477
- getMenuContentPortal() {
478
- const hasMenuContentChanged = this.menuTemplateRef !== this._menuPortal?.templateRef;
479
- if (this.menuTemplateRef && (!this._menuPortal || hasMenuContentChanged)) {
480
- this._menuPortal = new TemplatePortal(this.menuTemplateRef, this.viewContainerRef, undefined, this._getChildMenuInjector());
481
- }
482
- return this._menuPortal;
483
- }
484
- /**
485
- * Whether the given element is inside the scope of this trigger's menu stack.
486
- * @param element The element to check.
487
- * @return Whether the element is inside the scope of this trigger's menu stack.
488
- */
489
- isElementInsideMenuStack(element) {
490
- for (let el = element; el; el = el?.parentElement ?? null) {
491
- if (el.getAttribute('data-cdk-menu-stack-id') === this.menuStack.id) {
492
- return true;
493
- }
494
- }
495
- return false;
496
- }
497
- /** Destroy and unset the overlay reference it if exists */
498
- _destroyOverlay() {
499
- if (this.overlayRef) {
500
- this.overlayRef.dispose();
501
- this.overlayRef = null;
502
- }
503
- }
504
- /** Gets the injector to use when creating a child menu. */
505
- _getChildMenuInjector() {
506
- this._childMenuInjector =
507
- this._childMenuInjector ||
508
- Injector.create({
509
- providers: [
510
- { provide: MENU_TRIGGER, useValue: this },
511
- { provide: MENU_STACK, useValue: this.menuStack },
512
- ],
513
- parent: this.injector,
514
- });
515
- return this._childMenuInjector;
516
- }
517
- }
518
- CdkMenuTriggerBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuTriggerBase, deps: [{ token: i0.Injector }, { token: i0.ViewContainerRef }, { token: MENU_STACK }], target: i0.ɵɵFactoryTarget.Directive });
519
- CdkMenuTriggerBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-next.16", type: CdkMenuTriggerBase, host: { properties: { "attr.aria-controls": "childMenu?.id", "attr.data-cdk-menu-stack-id": "menuStack.id" } }, ngImport: i0 });
520
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuTriggerBase, decorators: [{
521
- type: Directive,
522
- args: [{
523
- host: {
524
- '[attr.aria-controls]': 'childMenu?.id',
525
- '[attr.data-cdk-menu-stack-id]': 'menuStack.id',
526
- },
527
- }]
528
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.ViewContainerRef }, { type: MenuStack, decorators: [{
529
- type: Inject,
530
- args: [MENU_STACK]
531
- }] }]; } });
532
-
533
524
  /**
534
525
  * @license
535
526
  * Copyright Google LLC All Rights Reserved.
@@ -545,32 +536,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
545
536
  * state.
546
537
  */
547
538
  class CdkMenuTrigger extends CdkMenuTriggerBase {
548
- constructor(
549
- /** The DI injector for this component. */
550
- injector,
551
- /** The host element. */
552
- _elementRef,
553
- /** The view container ref for this component. */
554
- viewContainerRef,
555
- /** The CDK overlay service. */
556
- _overlay,
557
- /** The Angular zone. */
558
- _ngZone,
559
- /** The menu stack this trigger belongs to. */
560
- menuStack,
561
- /** The parent menu this trigger belongs to. */
562
- _parentMenu,
563
- /** The menu aim service used by this menu. */
564
- _menuAim,
565
- /** The directionality of the page. */
566
- _directionality) {
567
- super(injector, viewContainerRef, menuStack);
568
- this._elementRef = _elementRef;
569
- this._overlay = _overlay;
570
- this._ngZone = _ngZone;
571
- this._parentMenu = _parentMenu;
572
- this._menuAim = _menuAim;
573
- this._directionality = _directionality;
539
+ constructor() {
540
+ super();
541
+ /** The host element. */
542
+ this._elementRef = inject(ElementRef);
543
+ /** The CDK overlay service. */
544
+ this._overlay = inject(Overlay);
545
+ /** The Angular zone. */
546
+ this._ngZone = inject(NgZone);
547
+ /** The parent menu this trigger belongs to. */
548
+ this._parentMenu = inject(CDK_MENU, InjectFlags.Optional);
549
+ /** The menu aim service used by this menu. */
550
+ this._menuAim = inject(MENU_AIM, InjectFlags.Optional);
551
+ /** The directionality of the page. */
552
+ this._directionality = inject(Directionality, InjectFlags.Optional);
553
+ this._setRole();
574
554
  this._registerCloseHandler();
575
555
  this._subscribeToMenuStackClosed();
576
556
  this._subscribeToMouseEnter();
@@ -704,7 +684,7 @@ class CdkMenuTrigger extends CdkMenuTriggerBase {
704
684
  return new OverlayConfig({
705
685
  positionStrategy: this._getOverlayPositionStrategy(),
706
686
  scrollStrategy: this._overlay.scrollStrategies.reposition(),
707
- direction: this._directionality,
687
+ direction: this._directionality || undefined,
708
688
  });
709
689
  }
710
690
  /** Build the position strategy for the overlay which specifies where to place the menu. */
@@ -776,13 +756,21 @@ class CdkMenuTrigger extends CdkMenuTriggerBase {
776
756
  });
777
757
  }
778
758
  }
759
+ /** Sets the role attribute for this trigger if needed. */
760
+ _setRole() {
761
+ // If this trigger is part of another menu, the cdkMenuItem directive will handle setting the
762
+ // role, otherwise this is a standalone trigger, and we should ensure it has role="button".
763
+ if (!this._parentMenu) {
764
+ this._elementRef.nativeElement.setAttribute('role', 'button');
765
+ }
766
+ }
779
767
  }
780
- CdkMenuTrigger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuTrigger, deps: [{ token: i0.Injector }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i1.Overlay }, { token: i0.NgZone }, { token: MENU_STACK }, { token: CDK_MENU, optional: true }, { token: MENU_AIM, optional: true }, { token: i1$1.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
781
- CdkMenuTrigger.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-next.16", type: CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: { menuTemplateRef: ["cdkMenuTriggerFor", "menuTemplateRef"], menuPosition: ["cdkMenuPosition", "menuPosition"] }, outputs: { opened: "cdkMenuOpened", closed: "cdkMenuClosed" }, host: { attributes: { "aria-haspopup": "menu" }, listeners: { "focusin": "_setHasFocus(true)", "focusout": "_setHasFocus(false)", "keydown": "_toggleOnKeydown($event)", "click": "toggle()" }, properties: { "attr.aria-expanded": "isOpen()" }, classAttribute: "cdk-menu-trigger" }, providers: [
768
+ CdkMenuTrigger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
769
+ CdkMenuTrigger.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: { menuTemplateRef: ["cdkMenuTriggerFor", "menuTemplateRef"], menuPosition: ["cdkMenuPosition", "menuPosition"] }, outputs: { opened: "cdkMenuOpened", closed: "cdkMenuClosed" }, host: { attributes: { "aria-haspopup": "menu" }, listeners: { "focusin": "_setHasFocus(true)", "focusout": "_setHasFocus(false)", "keydown": "_toggleOnKeydown($event)", "click": "toggle()" }, properties: { "attr.aria-expanded": "isOpen()" }, classAttribute: "cdk-menu-trigger" }, providers: [
782
770
  { provide: MENU_TRIGGER, useExisting: CdkMenuTrigger },
783
771
  PARENT_OR_NEW_MENU_STACK_PROVIDER,
784
772
  ], exportAs: ["cdkMenuTriggerFor"], usesInheritance: true, ngImport: i0 });
785
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuTrigger, decorators: [{
773
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuTrigger, decorators: [{
786
774
  type: Directive,
787
775
  args: [{
788
776
  selector: '[cdkMenuTriggerFor]',
@@ -803,22 +791,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
803
791
  PARENT_OR_NEW_MENU_STACK_PROVIDER,
804
792
  ],
805
793
  }]
806
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i1.Overlay }, { type: i0.NgZone }, { type: MenuStack, decorators: [{
807
- type: Inject,
808
- args: [MENU_STACK]
809
- }] }, { type: undefined, decorators: [{
810
- type: Optional
811
- }, {
812
- type: Inject,
813
- args: [CDK_MENU]
814
- }] }, { type: undefined, decorators: [{
815
- type: Optional
816
- }, {
817
- type: Inject,
818
- args: [MENU_AIM]
819
- }] }, { type: i1$1.Directionality, decorators: [{
820
- type: Optional
821
- }] }]; } });
794
+ }], ctorParameters: function () { return []; } });
822
795
 
823
796
  /**
824
797
  * @license
@@ -833,29 +806,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
833
806
  * behavior when clicked.
834
807
  */
835
808
  class CdkMenuItem {
836
- constructor(
837
- /** The host element for this item. */
838
- _elementRef,
839
- /** The Angular zone. */
840
- _ngZone,
841
- /** The menu stack this item belongs to. */
842
- _menuStack,
843
- /** The parent menu this item belongs to. */
844
- _parentMenu,
845
- /** The menu aim service used for this item. */
846
- _menuAim,
847
- /** The directionality of the page. */
848
- _dir,
849
- /** Reference to the CdkMenuItemTrigger directive if one is added to the same element */
850
- // tslint:disable-next-line: lightweight-tokens
851
- _menuTrigger) {
852
- this._elementRef = _elementRef;
853
- this._ngZone = _ngZone;
854
- this._menuStack = _menuStack;
855
- this._parentMenu = _parentMenu;
856
- this._menuAim = _menuAim;
857
- this._dir = _dir;
858
- this._menuTrigger = _menuTrigger;
809
+ constructor() {
810
+ /** The directionality (text direction) of the current page. */
811
+ this._dir = inject(Directionality, InjectFlags.Optional);
812
+ /** The menu's native DOM host element. */
813
+ this._elementRef = inject(ElementRef);
814
+ /** The Angular zone. */
815
+ this._ngZone = inject(NgZone);
816
+ /** The menu aim service used by this menu. */
817
+ this._menuAim = inject(MENU_AIM, InjectFlags.Optional);
818
+ /** The stack of menus this menu belongs to. */
819
+ this._menuStack = inject(MENU_STACK);
820
+ /** The parent menu in which this menuitem resides. */
821
+ this._parentMenu = inject(CDK_MENU, InjectFlags.Optional);
822
+ /** Reference to the CdkMenuItemTrigger directive if one is added to the same element */
823
+ this._menuTrigger = inject(CdkMenuTrigger, InjectFlags.Optional | InjectFlags.Self);
859
824
  this._disabled = false;
860
825
  /**
861
826
  * If this MenuItem is a regular MenuItem, outputs when it is triggered by a keyboard or mouse
@@ -1047,9 +1012,9 @@ class CdkMenuItem {
1047
1012
  return this._parentMenu?.orientation === 'vertical';
1048
1013
  }
1049
1014
  }
1050
- CdkMenuItem.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuItem, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: MENU_STACK }, { token: CDK_MENU, optional: true }, { token: MENU_AIM, optional: true }, { token: i1$1.Directionality, optional: true }, { token: CdkMenuTrigger, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
1051
- CdkMenuItem.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-next.16", type: CdkMenuItem, selector: "[cdkMenuItem]", inputs: { disabled: ["cdkMenuItemDisabled", "disabled"], typeaheadLabel: ["cdkMenuitemTypeaheadLabel", "typeaheadLabel"] }, outputs: { triggered: "cdkMenuItemTriggered" }, host: { attributes: { "role": "menuitem" }, listeners: { "blur": "_resetTabIndex()", "focus": "_setTabIndex()", "click": "trigger()", "keydown": "_onKeydown($event)" }, properties: { "tabindex": "_tabindex", "attr.aria-disabled": "disabled || null" }, classAttribute: "cdk-menu-item" }, exportAs: ["cdkMenuItem"], ngImport: i0 });
1052
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuItem, decorators: [{
1015
+ CdkMenuItem.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1016
+ CdkMenuItem.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuItem, selector: "[cdkMenuItem]", inputs: { disabled: ["cdkMenuItemDisabled", "disabled"], typeaheadLabel: ["cdkMenuitemTypeaheadLabel", "typeaheadLabel"] }, outputs: { triggered: "cdkMenuItemTriggered" }, host: { attributes: { "role": "menuitem" }, listeners: { "blur": "_resetTabIndex()", "focus": "_setTabIndex()", "click": "trigger()", "keydown": "_onKeydown($event)" }, properties: { "tabindex": "_tabindex", "attr.aria-disabled": "disabled || null" }, classAttribute: "cdk-menu-item" }, exportAs: ["cdkMenuItem"], ngImport: i0 });
1017
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItem, decorators: [{
1053
1018
  type: Directive,
1054
1019
  args: [{
1055
1020
  selector: '[cdkMenuItem]',
@@ -1065,26 +1030,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
1065
1030
  '(keydown)': '_onKeydown($event)',
1066
1031
  },
1067
1032
  }]
1068
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: MenuStack, decorators: [{
1069
- type: Inject,
1070
- args: [MENU_STACK]
1071
- }] }, { type: undefined, decorators: [{
1072
- type: Optional
1073
- }, {
1074
- type: Inject,
1075
- args: [CDK_MENU]
1076
- }] }, { type: undefined, decorators: [{
1077
- type: Optional
1078
- }, {
1079
- type: Inject,
1080
- args: [MENU_AIM]
1081
- }] }, { type: i1$1.Directionality, decorators: [{
1082
- type: Optional
1083
- }] }, { type: CdkMenuTrigger, decorators: [{
1084
- type: Self
1085
- }, {
1086
- type: Optional
1087
- }] }]; }, propDecorators: { disabled: [{
1033
+ }], ctorParameters: function () { return []; }, propDecorators: { disabled: [{
1088
1034
  type: Input,
1089
1035
  args: ['cdkMenuItemDisabled']
1090
1036
  }], typeaheadLabel: [{
@@ -1158,33 +1104,31 @@ let nextId$1 = 0;
1158
1104
  * This class can be extended to create custom menu types.
1159
1105
  */
1160
1106
  class CdkMenuBase extends CdkMenuGroup {
1161
- constructor(
1162
- /** The host element. */
1163
- elementRef,
1164
- /** The Angular zone. */
1165
- ngZone,
1166
- /** The stack of menus this menu belongs to. */
1167
- menuStack,
1168
- /** The menu aim service used by this menu. */
1169
- menuAim,
1170
- /** The directionality of the current page. */
1171
- dir) {
1172
- super();
1173
- this.ngZone = ngZone;
1174
- this.menuStack = menuStack;
1175
- this.menuAim = menuAim;
1176
- this.dir = dir;
1107
+ constructor() {
1108
+ super(...arguments);
1109
+ /** The menu's native DOM host element. */
1110
+ this.nativeElement = inject(ElementRef).nativeElement;
1111
+ /** The Angular zone. */
1112
+ this.ngZone = inject(NgZone);
1113
+ /** The stack of menus this menu belongs to. */
1114
+ this.menuStack = inject(MENU_STACK);
1115
+ /** The menu aim service used by this menu. */
1116
+ this.menuAim = inject(MENU_AIM, InjectFlags.Optional | InjectFlags.Self);
1117
+ /** The directionality (text direction) of the current page. */
1118
+ this.dir = inject(Directionality, InjectFlags.Optional);
1177
1119
  /** The id of the menu's host element. */
1178
1120
  this.id = `cdk-menu-${nextId$1++}`;
1179
1121
  /** The direction items in the menu flow. */
1180
1122
  this.orientation = 'vertical';
1181
- /** Whether the menu is displayed inline (i.e. always present vs a conditional popup that the user triggers with a trigger element). */
1123
+ /**
1124
+ * Whether the menu is displayed inline (i.e. always present vs a conditional popup that the
1125
+ * user triggers with a trigger element).
1126
+ */
1182
1127
  this.isInline = false;
1183
1128
  /** Emits when the MenuBar is destroyed. */
1184
1129
  this.destroyed = new Subject();
1185
1130
  /** Whether this menu's menu stack has focus. */
1186
1131
  this._menuStackHasFocus = false;
1187
- this.nativeElement = elementRef.nativeElement;
1188
1132
  }
1189
1133
  ngAfterContentInit() {
1190
1134
  if (!this.isInline) {
@@ -1298,9 +1242,9 @@ class CdkMenuBase extends CdkMenuGroup {
1298
1242
  }
1299
1243
  }
1300
1244
  }
1301
- CdkMenuBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuBase, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: MENU_STACK }, { token: MENU_AIM, optional: true, self: true }, { token: i1$1.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
1302
- CdkMenuBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-next.16", type: CdkMenuBase, inputs: { id: "id" }, host: { attributes: { "role": "menu" }, listeners: { "focus": "focusFirstItem()", "focusin": "menuStack.setHasFocus(true)", "focusout": "menuStack.setHasFocus(false)" }, properties: { "tabindex": "_getTabIndex()", "id": "id", "attr.aria-orientation": "orientation", "attr.data-cdk-menu-stack-id": "menuStack.id" } }, queries: [{ propertyName: "items", predicate: CdkMenuItem, descendants: true }], usesInheritance: true, ngImport: i0 });
1303
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuBase, decorators: [{
1245
+ CdkMenuBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuBase, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1246
+ CdkMenuBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuBase, inputs: { id: "id" }, host: { attributes: { "role": "menu" }, listeners: { "focus": "focusFirstItem()", "focusin": "menuStack.setHasFocus(true)", "focusout": "menuStack.setHasFocus(false)" }, properties: { "tabindex": "_getTabIndex()", "id": "id", "attr.aria-orientation": "orientation", "attr.data-cdk-menu-stack-id": "menuStack.id" } }, queries: [{ propertyName: "items", predicate: CdkMenuItem, descendants: true }], usesInheritance: true, ngImport: i0 });
1247
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuBase, decorators: [{
1304
1248
  type: Directive,
1305
1249
  args: [{
1306
1250
  host: {
@@ -1315,19 +1259,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
1315
1259
  '(focusout)': 'menuStack.setHasFocus(false)',
1316
1260
  },
1317
1261
  }]
1318
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: MenuStack, decorators: [{
1319
- type: Inject,
1320
- args: [MENU_STACK]
1321
- }] }, { type: undefined, decorators: [{
1322
- type: Self
1323
- }, {
1324
- type: Optional
1325
- }, {
1326
- type: Inject,
1327
- args: [MENU_AIM]
1328
- }] }, { type: i1$1.Directionality, decorators: [{
1329
- type: Optional
1330
- }] }]; }, propDecorators: { id: [{
1262
+ }], propDecorators: { id: [{
1331
1263
  type: Input
1332
1264
  }], items: [{
1333
1265
  type: ContentChildren,
@@ -1349,21 +1281,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
1349
1281
  * It also acts as a RadioGroup for elements marked with role `menuitemradio`.
1350
1282
  */
1351
1283
  class CdkMenu extends CdkMenuBase {
1352
- constructor(
1353
- /** The host element. */
1354
- elementRef,
1355
- /** The Angular zone. */
1356
- ngZone,
1357
- /** The menu stack this menu is part of. */
1358
- menuStack,
1359
- /** The trigger that opened this menu. */
1360
- _parentTrigger,
1361
- /** The menu aim service used by this menu. */
1362
- menuAim,
1363
- /** The directionality of the page. */
1364
- dir) {
1365
- super(elementRef, ngZone, menuStack, menuAim, dir);
1366
- this._parentTrigger = _parentTrigger;
1284
+ constructor() {
1285
+ super();
1286
+ this._parentTrigger = inject(MENU_TRIGGER, InjectFlags.Optional);
1367
1287
  /** Event emitted when the menu is closed. */
1368
1288
  this.closed = new EventEmitter();
1369
1289
  /** The direction items in the menu flow. */
@@ -1444,13 +1364,13 @@ class CdkMenu extends CdkMenuBase {
1444
1364
  .subscribe(event => this._toggleMenuFocus(event));
1445
1365
  }
1446
1366
  }
1447
- CdkMenu.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenu, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: MENU_STACK }, { token: MENU_TRIGGER, optional: true }, { token: MENU_AIM, optional: true, self: true }, { token: i1$1.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
1448
- CdkMenu.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-next.16", type: CdkMenu, selector: "[cdkMenu]", outputs: { closed: "closed" }, host: { attributes: { "role": "menu" }, listeners: { "keydown": "_handleKeyEvent($event)" }, properties: { "class.cdk-menu-inline": "isInline" }, classAttribute: "cdk-menu" }, providers: [
1367
+ CdkMenu.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1368
+ CdkMenu.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenu, selector: "[cdkMenu]", outputs: { closed: "closed" }, host: { attributes: { "role": "menu" }, listeners: { "keydown": "_handleKeyEvent($event)" }, properties: { "class.cdk-menu-inline": "isInline" }, classAttribute: "cdk-menu" }, providers: [
1449
1369
  { provide: CdkMenuGroup, useExisting: CdkMenu },
1450
1370
  { provide: CDK_MENU, useExisting: CdkMenu },
1451
1371
  PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER('vertical'),
1452
1372
  ], exportAs: ["cdkMenu"], usesInheritance: true, ngImport: i0 });
1453
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenu, decorators: [{
1373
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenu, decorators: [{
1454
1374
  type: Directive,
1455
1375
  args: [{
1456
1376
  selector: '[cdkMenu]',
@@ -1467,24 +1387,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
1467
1387
  PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER('vertical'),
1468
1388
  ],
1469
1389
  }]
1470
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: MenuStack, decorators: [{
1471
- type: Inject,
1472
- args: [MENU_STACK]
1473
- }] }, { type: CdkMenuTriggerBase, decorators: [{
1474
- type: Optional
1475
- }, {
1476
- type: Inject,
1477
- args: [MENU_TRIGGER]
1478
- }] }, { type: undefined, decorators: [{
1479
- type: Self
1480
- }, {
1481
- type: Optional
1482
- }, {
1483
- type: Inject,
1484
- args: [MENU_AIM]
1485
- }] }, { type: i1$1.Directionality, decorators: [{
1486
- type: Optional
1487
- }] }]; }, propDecorators: { closed: [{
1390
+ }], ctorParameters: function () { return []; }, propDecorators: { closed: [{
1488
1391
  type: Output
1489
1392
  }] } });
1490
1393
 
@@ -1502,18 +1405,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
1502
1405
  *
1503
1406
  */
1504
1407
  class CdkMenuBar extends CdkMenuBase {
1505
- constructor(
1506
- /** The host element. */
1507
- elementRef,
1508
- /** The Angular zone. */
1509
- ngZone,
1510
- /** The menu stack this menu is part of. */
1511
- menuStack,
1512
- /** The menu aim service used by this menu. */
1513
- menuAim,
1514
- /** The directionality of the page. */
1515
- dir) {
1516
- super(elementRef, ngZone, menuStack, menuAim, dir);
1408
+ constructor() {
1409
+ super(...arguments);
1517
1410
  /** The direction items in the menu flow. */
1518
1411
  this.orientation = 'horizontal';
1519
1412
  /** Whether the menu is displayed inline (i.e. always present vs a conditional popup that the user triggers with a trigger element). */
@@ -1599,13 +1492,13 @@ class CdkMenuBar extends CdkMenuBase {
1599
1492
  .subscribe(event => this._toggleOpenMenu(event));
1600
1493
  }
1601
1494
  }
1602
- CdkMenuBar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuBar, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: MENU_STACK }, { token: MENU_AIM, optional: true, self: true }, { token: i1$1.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
1603
- CdkMenuBar.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-next.16", type: CdkMenuBar, selector: "[cdkMenuBar]", host: { attributes: { "role": "menubar" }, listeners: { "keydown": "_handleKeyEvent($event)" }, classAttribute: "cdk-menu-bar" }, providers: [
1495
+ CdkMenuBar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuBar, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1496
+ CdkMenuBar.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuBar, selector: "[cdkMenuBar]", host: { attributes: { "role": "menubar" }, listeners: { "keydown": "_handleKeyEvent($event)" }, classAttribute: "cdk-menu-bar" }, providers: [
1604
1497
  { provide: CdkMenuGroup, useExisting: CdkMenuBar },
1605
1498
  { provide: CDK_MENU, useExisting: CdkMenuBar },
1606
1499
  { provide: MENU_STACK, useFactory: () => MenuStack.inline('horizontal') },
1607
1500
  ], exportAs: ["cdkMenuBar"], usesInheritance: true, ngImport: i0 });
1608
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuBar, decorators: [{
1501
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuBar, decorators: [{
1609
1502
  type: Directive,
1610
1503
  args: [{
1611
1504
  selector: '[cdkMenuBar]',
@@ -1621,19 +1514,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
1621
1514
  { provide: MENU_STACK, useFactory: () => MenuStack.inline('horizontal') },
1622
1515
  ],
1623
1516
  }]
1624
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: MenuStack, decorators: [{
1625
- type: Inject,
1626
- args: [MENU_STACK]
1627
- }] }, { type: undefined, decorators: [{
1628
- type: Self
1629
- }, {
1630
- type: Optional
1631
- }, {
1632
- type: Inject,
1633
- args: [MENU_AIM]
1634
- }] }, { type: i1$1.Directionality, decorators: [{
1635
- type: Optional
1636
- }] }]; } });
1517
+ }] });
1637
1518
 
1638
1519
  /**
1639
1520
  * @license
@@ -1658,9 +1539,9 @@ class CdkMenuItemSelectable extends CdkMenuItem {
1658
1539
  this._checked = coerceBooleanProperty(value);
1659
1540
  }
1660
1541
  }
1661
- CdkMenuItemSelectable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuItemSelectable, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1662
- CdkMenuItemSelectable.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-next.16", type: CdkMenuItemSelectable, inputs: { checked: ["cdkMenuItemChecked", "checked"] }, host: { properties: { "attr.aria-checked": "!!checked", "attr.aria-disabled": "disabled || null" } }, usesInheritance: true, ngImport: i0 });
1663
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuItemSelectable, decorators: [{
1542
+ CdkMenuItemSelectable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemSelectable, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1543
+ CdkMenuItemSelectable.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuItemSelectable, inputs: { checked: ["cdkMenuItemChecked", "checked"] }, host: { properties: { "attr.aria-checked": "!!checked", "attr.aria-disabled": "disabled || null" } }, usesInheritance: true, ngImport: i0 });
1544
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemSelectable, decorators: [{
1664
1545
  type: Directive,
1665
1546
  args: [{
1666
1547
  host: {
@@ -1688,26 +1569,10 @@ let nextId = 0;
1688
1569
  * or `CdkMenuGroup` comprise a radio group with unique selection enforced.
1689
1570
  */
1690
1571
  class CdkMenuItemRadio extends CdkMenuItemSelectable {
1691
- constructor(
1692
- /** The host element for this radio item. */
1693
- element,
1694
- /** The Angular zone. */
1695
- ngZone,
1696
- /** The unique selection dispatcher for this radio's `CdkMenuGroup`. */
1697
- _selectionDispatcher,
1698
- /** The menu stack this item belongs to. */
1699
- menuStack,
1700
- /** The parent menu for this item. */
1701
- parentMenu,
1702
- /** The menu aim used for this item. */
1703
- menuAim,
1704
- /** The directionality of the page. */
1705
- dir,
1706
- /** Reference to the CdkMenuItemTrigger directive if one is added to the same element */
1707
- // tslint:disable-next-line: lightweight-tokens
1708
- menuTrigger) {
1709
- super(element, ngZone, menuStack, parentMenu, menuAim, dir, menuTrigger);
1710
- this._selectionDispatcher = _selectionDispatcher;
1572
+ constructor() {
1573
+ super();
1574
+ /** The unique selection dispatcher for this radio's `CdkMenuGroup`. */
1575
+ this._selectionDispatcher = inject(UniqueSelectionDispatcher);
1711
1576
  /** An ID to identify this radio item to the `UniqueSelectionDisptcher`. */
1712
1577
  this._id = `${nextId++}`;
1713
1578
  this._registerDispatcherListener();
@@ -1734,44 +1599,26 @@ class CdkMenuItemRadio extends CdkMenuItemSelectable {
1734
1599
  });
1735
1600
  }
1736
1601
  }
1737
- CdkMenuItemRadio.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuItemRadio, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i1$2.UniqueSelectionDispatcher }, { token: MENU_STACK }, { token: CDK_MENU, optional: true }, { token: MENU_AIM, optional: true }, { token: i1$1.Directionality, optional: true }, { token: CdkMenuTrigger, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
1738
- CdkMenuItemRadio.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-next.16", type: CdkMenuItemRadio, selector: "[cdkMenuItemRadio]", host: { attributes: { "role": "menuitemradio" } }, providers: [
1602
+ CdkMenuItemRadio.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemRadio, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1603
+ CdkMenuItemRadio.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuItemRadio, selector: "[cdkMenuItemRadio]", host: { attributes: { "role": "menuitemradio" }, properties: { "class.cdk-menu-item-radio": "true" } }, providers: [
1739
1604
  { provide: CdkMenuItemSelectable, useExisting: CdkMenuItemRadio },
1740
1605
  { provide: CdkMenuItem, useExisting: CdkMenuItemSelectable },
1741
1606
  ], exportAs: ["cdkMenuItemRadio"], usesInheritance: true, ngImport: i0 });
1742
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuItemRadio, decorators: [{
1607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemRadio, decorators: [{
1743
1608
  type: Directive,
1744
1609
  args: [{
1745
1610
  selector: '[cdkMenuItemRadio]',
1746
1611
  exportAs: 'cdkMenuItemRadio',
1747
1612
  host: {
1748
1613
  'role': 'menuitemradio',
1614
+ '[class.cdk-menu-item-radio]': 'true',
1749
1615
  },
1750
1616
  providers: [
1751
1617
  { provide: CdkMenuItemSelectable, useExisting: CdkMenuItemRadio },
1752
1618
  { provide: CdkMenuItem, useExisting: CdkMenuItemSelectable },
1753
1619
  ],
1754
1620
  }]
1755
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i1$2.UniqueSelectionDispatcher }, { type: MenuStack, decorators: [{
1756
- type: Inject,
1757
- args: [MENU_STACK]
1758
- }] }, { type: undefined, decorators: [{
1759
- type: Optional
1760
- }, {
1761
- type: Inject,
1762
- args: [CDK_MENU]
1763
- }] }, { type: undefined, decorators: [{
1764
- type: Optional
1765
- }, {
1766
- type: Inject,
1767
- args: [MENU_AIM]
1768
- }] }, { type: i1$1.Directionality, decorators: [{
1769
- type: Optional
1770
- }] }, { type: CdkMenuTrigger, decorators: [{
1771
- type: Self
1772
- }, {
1773
- type: Optional
1774
- }] }]; } });
1621
+ }], ctorParameters: function () { return []; } });
1775
1622
 
1776
1623
  /**
1777
1624
  * @license
@@ -1797,18 +1644,19 @@ class CdkMenuItemCheckbox extends CdkMenuItemSelectable {
1797
1644
  }
1798
1645
  }
1799
1646
  }
1800
- CdkMenuItemCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuItemCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1801
- CdkMenuItemCheckbox.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-next.16", type: CdkMenuItemCheckbox, selector: "[cdkMenuItemCheckbox]", host: { attributes: { "role": "menuitemcheckbox" } }, providers: [
1647
+ CdkMenuItemCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1648
+ CdkMenuItemCheckbox.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkMenuItemCheckbox, selector: "[cdkMenuItemCheckbox]", host: { attributes: { "role": "menuitemcheckbox" }, properties: { "class.cdk-menu-item-checkbox": "true" } }, providers: [
1802
1649
  { provide: CdkMenuItemSelectable, useExisting: CdkMenuItemCheckbox },
1803
1650
  { provide: CdkMenuItem, useExisting: CdkMenuItemSelectable },
1804
1651
  ], exportAs: ["cdkMenuItemCheckbox"], usesInheritance: true, ngImport: i0 });
1805
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuItemCheckbox, decorators: [{
1652
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemCheckbox, decorators: [{
1806
1653
  type: Directive,
1807
1654
  args: [{
1808
1655
  selector: '[cdkMenuItemCheckbox]',
1809
1656
  exportAs: 'cdkMenuItemCheckbox',
1810
1657
  host: {
1811
1658
  'role': 'menuitemcheckbox',
1659
+ '[class.cdk-menu-item-checkbox]': 'true',
1812
1660
  },
1813
1661
  providers: [
1814
1662
  { provide: CdkMenuItemSelectable, useExisting: CdkMenuItemCheckbox },
@@ -1845,9 +1693,9 @@ class ContextMenuTracker {
1845
1693
  }
1846
1694
  }
1847
1695
  }
1848
- ContextMenuTracker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: ContextMenuTracker, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1849
- ContextMenuTracker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: ContextMenuTracker, providedIn: 'root' });
1850
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: ContextMenuTracker, decorators: [{
1696
+ ContextMenuTracker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ContextMenuTracker, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1697
+ ContextMenuTracker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ContextMenuTracker, providedIn: 'root' });
1698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ContextMenuTracker, decorators: [{
1851
1699
  type: Injectable,
1852
1700
  args: [{ providedIn: 'root' }]
1853
1701
  }] });
@@ -1856,23 +1704,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
1856
1704
  * It is aware of nested context menus and will trigger only the lowest level non-disabled context menu.
1857
1705
  */
1858
1706
  class CdkContextMenuTrigger extends CdkMenuTriggerBase {
1859
- constructor(
1860
- /** The DI injector for this component */
1861
- injector,
1862
- /** The view container ref for this component */
1863
- viewContainerRef,
1864
- /** The CDK overlay service */
1865
- _overlay,
1866
- /** The app's context menu tracking registry */
1867
- _contextMenuTracker,
1868
- /** The menu stack this menu is part of. */
1869
- menuStack,
1870
- /** The directionality of the current page */
1871
- _directionality) {
1872
- super(injector, viewContainerRef, menuStack);
1873
- this._overlay = _overlay;
1874
- this._contextMenuTracker = _contextMenuTracker;
1875
- this._directionality = _directionality;
1707
+ constructor() {
1708
+ super();
1709
+ /** The CDK overlay service. */
1710
+ this._overlay = inject(Overlay);
1711
+ /** The directionality of the page. */
1712
+ this._directionality = inject(Directionality, InjectFlags.Optional);
1713
+ /** The app's context menu tracking registry */
1714
+ this._contextMenuTracker = inject(ContextMenuTracker);
1876
1715
  this._disabled = false;
1877
1716
  this._setMenuStackCloseListener();
1878
1717
  }
@@ -1928,7 +1767,7 @@ class CdkContextMenuTrigger extends CdkMenuTriggerBase {
1928
1767
  return new OverlayConfig({
1929
1768
  positionStrategy: this._getOverlayPositionStrategy(coordinates),
1930
1769
  scrollStrategy: this._overlay.scrollStrategies.reposition(),
1931
- direction: this._directionality,
1770
+ direction: this._directionality || undefined,
1932
1771
  });
1933
1772
  }
1934
1773
  /**
@@ -2003,12 +1842,12 @@ class CdkContextMenuTrigger extends CdkMenuTriggerBase {
2003
1842
  }
2004
1843
  }
2005
1844
  }
2006
- CdkContextMenuTrigger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkContextMenuTrigger, deps: [{ token: i0.Injector }, { token: i0.ViewContainerRef }, { token: i1.Overlay }, { token: ContextMenuTracker }, { token: MENU_STACK }, { token: i1$1.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
2007
- CdkContextMenuTrigger.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-next.16", type: CdkContextMenuTrigger, selector: "[cdkContextMenuTriggerFor]", inputs: { menuTemplateRef: ["cdkContextMenuTriggerFor", "menuTemplateRef"], menuPosition: ["cdkContextMenuPosition", "menuPosition"], disabled: ["cdkContextMenuDisabled", "disabled"] }, outputs: { opened: "cdkContextMenuOpened", closed: "cdkContextMenuClosed" }, host: { listeners: { "contextmenu": "_openOnContextMenu($event)" }, properties: { "attr.data-cdk-menu-stack-id": "null" } }, providers: [
1845
+ CdkContextMenuTrigger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkContextMenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1846
+ CdkContextMenuTrigger.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkContextMenuTrigger, selector: "[cdkContextMenuTriggerFor]", inputs: { menuTemplateRef: ["cdkContextMenuTriggerFor", "menuTemplateRef"], menuPosition: ["cdkContextMenuPosition", "menuPosition"], disabled: ["cdkContextMenuDisabled", "disabled"] }, outputs: { opened: "cdkContextMenuOpened", closed: "cdkContextMenuClosed" }, host: { listeners: { "contextmenu": "_openOnContextMenu($event)" }, properties: { "attr.data-cdk-menu-stack-id": "null" } }, providers: [
2008
1847
  { provide: MENU_TRIGGER, useExisting: CdkContextMenuTrigger },
2009
1848
  { provide: MENU_STACK, useClass: MenuStack },
2010
1849
  ], exportAs: ["cdkContextMenuTriggerFor"], usesInheritance: true, ngImport: i0 });
2011
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkContextMenuTrigger, decorators: [{
1850
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkContextMenuTrigger, decorators: [{
2012
1851
  type: Directive,
2013
1852
  args: [{
2014
1853
  selector: '[cdkContextMenuTriggerFor]',
@@ -2024,12 +1863,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
2024
1863
  { provide: MENU_STACK, useClass: MenuStack },
2025
1864
  ],
2026
1865
  }]
2027
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.ViewContainerRef }, { type: i1.Overlay }, { type: ContextMenuTracker }, { type: MenuStack, decorators: [{
2028
- type: Inject,
2029
- args: [MENU_STACK]
2030
- }] }, { type: i1$1.Directionality, decorators: [{
2031
- type: Optional
2032
- }] }]; }, propDecorators: { disabled: [{
1866
+ }], ctorParameters: function () { return []; }, propDecorators: { disabled: [{
2033
1867
  type: Input,
2034
1868
  args: ['cdkContextMenuDisabled']
2035
1869
  }] } });
@@ -2056,8 +1890,8 @@ const EXPORTED_DECLARATIONS = [
2056
1890
  /** Module that declares components and directives for the CDK menu. */
2057
1891
  class CdkMenuModule {
2058
1892
  }
2059
- CdkMenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2060
- CdkMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuModule, declarations: [CdkMenuBar,
1893
+ CdkMenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1894
+ CdkMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuModule, declarations: [CdkMenuBar,
2061
1895
  CdkMenu,
2062
1896
  CdkMenuItem,
2063
1897
  CdkMenuItemRadio,
@@ -2074,8 +1908,8 @@ CdkMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
2074
1908
  CdkMenuGroup,
2075
1909
  CdkContextMenuTrigger,
2076
1910
  CdkTargetMenuAim] });
2077
- CdkMenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuModule, imports: [OverlayModule] });
2078
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuModule, decorators: [{
1911
+ CdkMenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuModule, imports: [OverlayModule] });
1912
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuModule, decorators: [{
2079
1913
  type: NgModule,
2080
1914
  args: [{
2081
1915
  imports: [OverlayModule],