@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.
- package/esm2020/a11y/a11y-module.mjs +5 -5
- package/esm2020/a11y/aria-describer/aria-describer.mjs +10 -9
- package/esm2020/a11y/focus-monitor/focus-monitor.mjs +7 -7
- package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +4 -4
- package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +4 -4
- package/esm2020/a11y/focus-trap/focus-trap.mjs +7 -7
- package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +4 -4
- package/esm2020/a11y/input-modality/input-modality-detector.mjs +4 -4
- package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +4 -4
- package/esm2020/a11y/live-announcer/live-announcer.mjs +7 -7
- package/esm2020/accordion/accordion-item.mjs +4 -4
- package/esm2020/accordion/accordion-module.mjs +5 -5
- package/esm2020/accordion/accordion.mjs +4 -4
- package/esm2020/bidi/bidi-module.mjs +5 -5
- package/esm2020/bidi/dir.mjs +4 -4
- package/esm2020/bidi/directionality.mjs +4 -4
- package/esm2020/clipboard/clipboard-module.mjs +5 -5
- package/esm2020/clipboard/clipboard.mjs +4 -4
- package/esm2020/clipboard/copy-to-clipboard.mjs +4 -4
- package/esm2020/collections/unique-selection-dispatcher.mjs +4 -4
- package/esm2020/dialog/dialog-container.mjs +4 -4
- package/esm2020/dialog/dialog-module.mjs +5 -5
- package/esm2020/dialog/dialog.mjs +4 -4
- package/esm2020/drag-drop/directives/drag-handle.mjs +4 -4
- package/esm2020/drag-drop/directives/drag-placeholder.mjs +4 -4
- package/esm2020/drag-drop/directives/drag-preview.mjs +4 -4
- package/esm2020/drag-drop/directives/drag.mjs +4 -4
- package/esm2020/drag-drop/directives/drop-list-group.mjs +4 -4
- package/esm2020/drag-drop/directives/drop-list.mjs +4 -4
- package/esm2020/drag-drop/drag-drop-module.mjs +5 -5
- package/esm2020/drag-drop/drag-drop-registry.mjs +4 -4
- package/esm2020/drag-drop/drag-drop.mjs +4 -4
- package/esm2020/layout/breakpoints-observer.mjs +4 -4
- package/esm2020/layout/layout-module.mjs +5 -5
- package/esm2020/layout/media-matcher.mjs +4 -4
- package/esm2020/menu/context-menu-trigger.mjs +18 -35
- package/esm2020/menu/menu-aim.mjs +14 -15
- package/esm2020/menu/menu-bar.mjs +8 -34
- package/esm2020/menu/menu-base.mjs +23 -39
- package/esm2020/menu/menu-group.mjs +4 -4
- package/esm2020/menu/menu-item-checkbox.mjs +5 -4
- package/esm2020/menu/menu-item-radio.mjs +11 -54
- package/esm2020/menu/menu-item-selectable.mjs +4 -4
- package/esm2020/menu/menu-item.mjs +22 -52
- package/esm2020/menu/menu-module.mjs +5 -5
- package/esm2020/menu/menu-stack.mjs +4 -4
- package/esm2020/menu/menu-trigger-base.mjs +14 -21
- package/esm2020/menu/menu-trigger.mjs +31 -52
- package/esm2020/menu/menu.mjs +11 -45
- package/esm2020/observers/observe-content.mjs +14 -14
- package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +4 -4
- package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +4 -4
- package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +4 -4
- package/esm2020/overlay/fullscreen-overlay-container.mjs +4 -4
- package/esm2020/overlay/overlay-container.mjs +4 -4
- package/esm2020/overlay/overlay-directives.mjs +7 -7
- package/esm2020/overlay/overlay-module.mjs +5 -5
- package/esm2020/overlay/overlay.mjs +4 -4
- package/esm2020/overlay/position/overlay-position-builder.mjs +4 -4
- package/esm2020/overlay/scroll/scroll-strategy-options.mjs +4 -4
- package/esm2020/platform/platform-module.mjs +5 -5
- package/esm2020/platform/platform.mjs +4 -4
- package/esm2020/portal/portal-directives.mjs +17 -17
- package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +4 -4
- package/esm2020/scrolling/scroll-dispatcher.mjs +4 -4
- package/esm2020/scrolling/scrollable.mjs +4 -4
- package/esm2020/scrolling/scrolling-module.mjs +9 -9
- package/esm2020/scrolling/viewport-ruler.mjs +4 -4
- package/esm2020/scrolling/virtual-for-of.mjs +4 -4
- package/esm2020/scrolling/virtual-scroll-viewport.mjs +4 -4
- package/esm2020/stepper/step-header.mjs +4 -4
- package/esm2020/stepper/step-label.mjs +4 -4
- package/esm2020/stepper/stepper-button.mjs +7 -7
- package/esm2020/stepper/stepper-module.mjs +5 -5
- package/esm2020/stepper/stepper.mjs +7 -7
- package/esm2020/table/cell.mjs +22 -22
- package/esm2020/table/coalesced-style-scheduler.mjs +4 -4
- package/esm2020/table/row.mjs +28 -28
- package/esm2020/table/table-module.mjs +5 -5
- package/esm2020/table/table.mjs +19 -19
- package/esm2020/table/text-column.mjs +4 -4
- package/esm2020/text-field/autofill.mjs +7 -7
- package/esm2020/text-field/autosize.mjs +4 -4
- package/esm2020/text-field/text-field-module.mjs +5 -5
- package/esm2020/tree/nested-node.mjs +4 -4
- package/esm2020/tree/node.mjs +4 -4
- package/esm2020/tree/outlet.mjs +4 -4
- package/esm2020/tree/padding.mjs +4 -4
- package/esm2020/tree/toggle.mjs +4 -4
- package/esm2020/tree/tree-module.mjs +5 -5
- package/esm2020/tree/tree.mjs +7 -7
- package/esm2020/version.mjs +1 -1
- package/fesm2015/a11y.mjs +46 -45
- package/fesm2015/a11y.mjs.map +1 -1
- package/fesm2015/accordion.mjs +10 -10
- package/fesm2015/accordion.mjs.map +1 -1
- package/fesm2015/bidi.mjs +10 -10
- package/fesm2015/bidi.mjs.map +1 -1
- package/fesm2015/cdk.mjs +1 -1
- package/fesm2015/cdk.mjs.map +1 -1
- package/fesm2015/clipboard.mjs +10 -10
- package/fesm2015/clipboard.mjs.map +1 -1
- package/fesm2015/collections.mjs +3 -3
- package/fesm2015/collections.mjs.map +1 -1
- package/fesm2015/dialog.mjs +10 -10
- package/fesm2015/dialog.mjs.map +1 -1
- package/fesm2015/drag-drop.mjs +28 -28
- package/fesm2015/drag-drop.mjs.map +1 -1
- package/fesm2015/layout.mjs +10 -10
- package/fesm2015/layout.mjs.map +1 -1
- package/fesm2015/menu.mjs +248 -423
- package/fesm2015/menu.mjs.map +1 -1
- package/fesm2015/observers.mjs +13 -13
- package/fesm2015/observers.mjs.map +1 -1
- package/fesm2015/overlay.mjs +34 -34
- package/fesm2015/overlay.mjs.map +1 -1
- package/fesm2015/platform.mjs +7 -7
- package/fesm2015/platform.mjs.map +1 -1
- package/fesm2015/portal.mjs +16 -16
- package/fesm2015/portal.mjs.map +1 -1
- package/fesm2015/scrolling.mjs +26 -26
- package/fesm2015/scrolling.mjs.map +1 -1
- package/fesm2015/stepper.mjs +22 -22
- package/fesm2015/stepper.mjs.map +1 -1
- package/fesm2015/table.mjs +76 -76
- package/fesm2015/table.mjs.map +1 -1
- package/fesm2015/text-field.mjs +13 -13
- package/fesm2015/text-field.mjs.map +1 -1
- package/fesm2015/tree.mjs +25 -25
- package/fesm2015/tree.mjs.map +1 -1
- package/fesm2020/a11y.mjs +46 -45
- package/fesm2020/a11y.mjs.map +1 -1
- package/fesm2020/accordion.mjs +10 -10
- package/fesm2020/accordion.mjs.map +1 -1
- package/fesm2020/bidi.mjs +10 -10
- package/fesm2020/bidi.mjs.map +1 -1
- package/fesm2020/cdk.mjs +1 -1
- package/fesm2020/cdk.mjs.map +1 -1
- package/fesm2020/clipboard.mjs +10 -10
- package/fesm2020/clipboard.mjs.map +1 -1
- package/fesm2020/collections.mjs +3 -3
- package/fesm2020/collections.mjs.map +1 -1
- package/fesm2020/dialog.mjs +10 -10
- package/fesm2020/dialog.mjs.map +1 -1
- package/fesm2020/drag-drop.mjs +28 -28
- package/fesm2020/drag-drop.mjs.map +1 -1
- package/fesm2020/layout.mjs +10 -10
- package/fesm2020/layout.mjs.map +1 -1
- package/fesm2020/menu.mjs +238 -404
- package/fesm2020/menu.mjs.map +1 -1
- package/fesm2020/observers.mjs +13 -13
- package/fesm2020/observers.mjs.map +1 -1
- package/fesm2020/overlay.mjs +34 -34
- package/fesm2020/overlay.mjs.map +1 -1
- package/fesm2020/platform.mjs +7 -7
- package/fesm2020/platform.mjs.map +1 -1
- package/fesm2020/portal.mjs +16 -16
- package/fesm2020/portal.mjs.map +1 -1
- package/fesm2020/scrolling.mjs +26 -26
- package/fesm2020/scrolling.mjs.map +1 -1
- package/fesm2020/stepper.mjs +22 -22
- package/fesm2020/stepper.mjs.map +1 -1
- package/fesm2020/table.mjs +76 -76
- package/fesm2020/table.mjs.map +1 -1
- package/fesm2020/text-field.mjs +13 -13
- package/fesm2020/text-field.mjs.map +1 -1
- package/fesm2020/tree.mjs +25 -25
- package/fesm2020/tree.mjs.map +1 -1
- package/menu/index.d.ts +51 -150
- package/overlay/index.d.ts +2 -2
- package/package.json +3 -3
- package/schematics/index.d.ts +2 -1
- package/schematics/index.js +4 -4
- package/schematics/index.mjs +4 -4
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/drag-drop/schema.json +3 -0
- package/schematics/ng-update/devkit-file-system.js +8 -5
- package/schematics/ng-update/devkit-file-system.mjs +8 -5
- package/schematics/utils/ast/standalone.d.ts +26 -0
- package/schematics/utils/ast/standalone.js +191 -0
- package/schematics/utils/ast/standalone.mjs +191 -0
- package/schematics/utils/ast.js +5 -4
- package/schematics/utils/ast.mjs +5 -4
- package/schematics/utils/build-component.js +4 -4
- package/schematics/utils/build-component.mjs +4 -4
- package/schematics/utils/index.d.ts +1 -0
- package/schematics/utils/index.js +5 -1
- package/schematics/utils/index.mjs +5 -1
- package/schematics/utils/vendored-ast-utils/index.d.ts +0 -70
- package/schematics/utils/vendored-ast-utils/index.js +0 -480
- package/schematics/utils/vendored-ast-utils/index.mjs +0 -480
package/fesm2015/menu.mjs
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, InjectionToken, Optional, SkipSelf, Inject, Injectable,
|
|
3
|
-
import
|
|
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
5
|
import { startWith, debounceTime, distinctUntilChanged, filter, takeUntil, mergeMap, mapTo, mergeAll, switchMap, skip } from 'rxjs/operators';
|
|
7
|
-
import * as i1$2 from '@angular/cdk/collections';
|
|
8
6
|
import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
|
|
9
|
-
import { Subject,
|
|
7
|
+
import { Subject, merge, fromEvent, defer, partition } from 'rxjs';
|
|
10
8
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
11
9
|
import { FocusKeyManager } from '@angular/cdk/a11y';
|
|
12
10
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
13
|
-
import
|
|
11
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
14
12
|
|
|
15
13
|
/**
|
|
16
14
|
* @license
|
|
@@ -24,9 +22,9 @@ import * as i1$1 from '@angular/cdk/bidi';
|
|
|
24
22
|
*/
|
|
25
23
|
class CdkMenuGroup {
|
|
26
24
|
}
|
|
27
|
-
CdkMenuGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
28
|
-
CdkMenuGroup.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
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,117 @@ 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-
|
|
199
|
-
MenuStack.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-
|
|
200
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
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
|
+
var _a;
|
|
242
|
+
return !!((_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.hasAttached());
|
|
243
|
+
}
|
|
244
|
+
/** Registers a child menu as having been opened by this trigger. */
|
|
245
|
+
registerChildMenu(child) {
|
|
246
|
+
this.childMenu = child;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Get the portal to be attached to the overlay which contains the menu. Allows for the menu
|
|
250
|
+
* content to change dynamically and be reflected in the application.
|
|
251
|
+
*/
|
|
252
|
+
getMenuContentPortal() {
|
|
253
|
+
var _a;
|
|
254
|
+
const hasMenuContentChanged = this.menuTemplateRef !== ((_a = this._menuPortal) === null || _a === void 0 ? void 0 : _a.templateRef);
|
|
255
|
+
if (this.menuTemplateRef && (!this._menuPortal || hasMenuContentChanged)) {
|
|
256
|
+
this._menuPortal = new TemplatePortal(this.menuTemplateRef, this.viewContainerRef, undefined, this._getChildMenuInjector());
|
|
257
|
+
}
|
|
258
|
+
return this._menuPortal;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Whether the given element is inside the scope of this trigger's menu stack.
|
|
262
|
+
* @param element The element to check.
|
|
263
|
+
* @return Whether the element is inside the scope of this trigger's menu stack.
|
|
264
|
+
*/
|
|
265
|
+
isElementInsideMenuStack(element) {
|
|
266
|
+
var _a;
|
|
267
|
+
for (let el = element; el; el = (_a = el === null || el === void 0 ? void 0 : el.parentElement) !== null && _a !== void 0 ? _a : null) {
|
|
268
|
+
if (el.getAttribute('data-cdk-menu-stack-id') === this.menuStack.id) {
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
/** Destroy and unset the overlay reference it if exists */
|
|
275
|
+
_destroyOverlay() {
|
|
276
|
+
if (this.overlayRef) {
|
|
277
|
+
this.overlayRef.dispose();
|
|
278
|
+
this.overlayRef = null;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
/** Gets the injector to use when creating a child menu. */
|
|
282
|
+
_getChildMenuInjector() {
|
|
283
|
+
this._childMenuInjector =
|
|
284
|
+
this._childMenuInjector ||
|
|
285
|
+
Injector.create({
|
|
286
|
+
providers: [
|
|
287
|
+
{ provide: MENU_TRIGGER, useValue: this },
|
|
288
|
+
{ provide: MENU_STACK, useValue: this.menuStack },
|
|
289
|
+
],
|
|
290
|
+
parent: this.injector,
|
|
291
|
+
});
|
|
292
|
+
return this._childMenuInjector;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
CdkMenuTriggerBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuTriggerBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
296
|
+
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 });
|
|
297
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuTriggerBase, decorators: [{
|
|
298
|
+
type: Directive,
|
|
299
|
+
args: [{
|
|
300
|
+
host: {
|
|
301
|
+
'[attr.aria-controls]': 'childMenu?.id',
|
|
302
|
+
'[attr.data-cdk-menu-stack-id]': 'menuStack.id',
|
|
303
|
+
},
|
|
304
|
+
}]
|
|
305
|
+
}] });
|
|
306
|
+
|
|
204
307
|
/**
|
|
205
308
|
* @license
|
|
206
309
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -278,10 +381,9 @@ function isWithinSubmenu(submenuPoints, m, b) {
|
|
|
278
381
|
* to submenu.
|
|
279
382
|
*/
|
|
280
383
|
class TargetMenuAim {
|
|
281
|
-
constructor(
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
this._ngZone = _ngZone;
|
|
384
|
+
constructor() {
|
|
385
|
+
/** The Angular zone. */
|
|
386
|
+
this._ngZone = inject(NgZone);
|
|
285
387
|
/** The last NUM_POINTS mouse move events. */
|
|
286
388
|
this._points = [];
|
|
287
389
|
/** Emits when this service is destroyed. */
|
|
@@ -401,20 +503,20 @@ class TargetMenuAim {
|
|
|
401
503
|
});
|
|
402
504
|
}
|
|
403
505
|
}
|
|
404
|
-
TargetMenuAim.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
405
|
-
TargetMenuAim.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-
|
|
406
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
506
|
+
TargetMenuAim.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: TargetMenuAim, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
507
|
+
TargetMenuAim.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: TargetMenuAim });
|
|
508
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: TargetMenuAim, decorators: [{
|
|
407
509
|
type: Injectable
|
|
408
|
-
}]
|
|
510
|
+
}] });
|
|
409
511
|
/**
|
|
410
512
|
* CdkTargetMenuAim is a provider for the TargetMenuAim service. It can be added to an
|
|
411
513
|
* element with either the `cdkMenu` or `cdkMenuBar` directive and child menu items.
|
|
412
514
|
*/
|
|
413
515
|
class CdkTargetMenuAim {
|
|
414
516
|
}
|
|
415
|
-
CdkTargetMenuAim.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
416
|
-
CdkTargetMenuAim.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-
|
|
417
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
517
|
+
CdkTargetMenuAim.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkTargetMenuAim, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
518
|
+
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 });
|
|
519
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkTargetMenuAim, decorators: [{
|
|
418
520
|
type: Directive,
|
|
419
521
|
args: [{
|
|
420
522
|
selector: '[cdkTargetMenuAim]',
|
|
@@ -423,119 +525,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
|
|
|
423
525
|
}]
|
|
424
526
|
}] });
|
|
425
527
|
|
|
426
|
-
/**
|
|
427
|
-
* @license
|
|
428
|
-
* Copyright Google LLC All Rights Reserved.
|
|
429
|
-
*
|
|
430
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
431
|
-
* found in the LICENSE file at https://angular.io/license
|
|
432
|
-
*/
|
|
433
|
-
/** Injection token used for an implementation of MenuStack. */
|
|
434
|
-
const MENU_TRIGGER = new InjectionToken('cdk-menu-trigger');
|
|
435
|
-
/**
|
|
436
|
-
* Abstract directive that implements shared logic common to all menu triggers.
|
|
437
|
-
* This class can be extended to create custom menu trigger types.
|
|
438
|
-
*/
|
|
439
|
-
class CdkMenuTriggerBase {
|
|
440
|
-
constructor(
|
|
441
|
-
/** The DI injector for this component */
|
|
442
|
-
injector,
|
|
443
|
-
/** The view container ref for this component */
|
|
444
|
-
viewContainerRef,
|
|
445
|
-
/** The menu stack this menu is part of. */
|
|
446
|
-
menuStack) {
|
|
447
|
-
this.injector = injector;
|
|
448
|
-
this.viewContainerRef = viewContainerRef;
|
|
449
|
-
this.menuStack = menuStack;
|
|
450
|
-
/** Emits when the attached menu is requested to open */
|
|
451
|
-
this.opened = new EventEmitter();
|
|
452
|
-
/** Emits when the attached menu is requested to close */
|
|
453
|
-
this.closed = new EventEmitter();
|
|
454
|
-
/** A reference to the overlay which manages the triggered menu */
|
|
455
|
-
this.overlayRef = null;
|
|
456
|
-
/** Emits when this trigger is destroyed. */
|
|
457
|
-
this.destroyed = new Subject();
|
|
458
|
-
/** Emits when the outside pointer events listener on the overlay should be stopped. */
|
|
459
|
-
this.stopOutsideClicksListener = merge(this.closed, this.destroyed);
|
|
460
|
-
}
|
|
461
|
-
ngOnDestroy() {
|
|
462
|
-
this._destroyOverlay();
|
|
463
|
-
this.destroyed.next();
|
|
464
|
-
this.destroyed.complete();
|
|
465
|
-
}
|
|
466
|
-
/** Whether the attached menu is open. */
|
|
467
|
-
isOpen() {
|
|
468
|
-
var _a;
|
|
469
|
-
return !!((_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.hasAttached());
|
|
470
|
-
}
|
|
471
|
-
/** Registers a child menu as having been opened by this trigger. */
|
|
472
|
-
registerChildMenu(child) {
|
|
473
|
-
this.childMenu = child;
|
|
474
|
-
}
|
|
475
|
-
/**
|
|
476
|
-
* Get the portal to be attached to the overlay which contains the menu. Allows for the menu
|
|
477
|
-
* content to change dynamically and be reflected in the application.
|
|
478
|
-
*/
|
|
479
|
-
getMenuContentPortal() {
|
|
480
|
-
var _a;
|
|
481
|
-
const hasMenuContentChanged = this.menuTemplateRef !== ((_a = this._menuPortal) === null || _a === void 0 ? void 0 : _a.templateRef);
|
|
482
|
-
if (this.menuTemplateRef && (!this._menuPortal || hasMenuContentChanged)) {
|
|
483
|
-
this._menuPortal = new TemplatePortal(this.menuTemplateRef, this.viewContainerRef, undefined, this._getChildMenuInjector());
|
|
484
|
-
}
|
|
485
|
-
return this._menuPortal;
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* Whether the given element is inside the scope of this trigger's menu stack.
|
|
489
|
-
* @param element The element to check.
|
|
490
|
-
* @return Whether the element is inside the scope of this trigger's menu stack.
|
|
491
|
-
*/
|
|
492
|
-
isElementInsideMenuStack(element) {
|
|
493
|
-
var _a;
|
|
494
|
-
for (let el = element; el; el = (_a = el === null || el === void 0 ? void 0 : el.parentElement) !== null && _a !== void 0 ? _a : null) {
|
|
495
|
-
if (el.getAttribute('data-cdk-menu-stack-id') === this.menuStack.id) {
|
|
496
|
-
return true;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
return false;
|
|
500
|
-
}
|
|
501
|
-
/** Destroy and unset the overlay reference it if exists */
|
|
502
|
-
_destroyOverlay() {
|
|
503
|
-
if (this.overlayRef) {
|
|
504
|
-
this.overlayRef.dispose();
|
|
505
|
-
this.overlayRef = null;
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
/** Gets the injector to use when creating a child menu. */
|
|
509
|
-
_getChildMenuInjector() {
|
|
510
|
-
this._childMenuInjector =
|
|
511
|
-
this._childMenuInjector ||
|
|
512
|
-
Injector.create({
|
|
513
|
-
providers: [
|
|
514
|
-
{ provide: MENU_TRIGGER, useValue: this },
|
|
515
|
-
{ provide: MENU_STACK, useValue: this.menuStack },
|
|
516
|
-
],
|
|
517
|
-
parent: this.injector,
|
|
518
|
-
});
|
|
519
|
-
return this._childMenuInjector;
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
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 });
|
|
523
|
-
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 });
|
|
524
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16", ngImport: i0, type: CdkMenuTriggerBase, decorators: [{
|
|
525
|
-
type: Directive,
|
|
526
|
-
args: [{
|
|
527
|
-
host: {
|
|
528
|
-
'[attr.aria-controls]': 'childMenu?.id',
|
|
529
|
-
'[attr.data-cdk-menu-stack-id]': 'menuStack.id',
|
|
530
|
-
},
|
|
531
|
-
}]
|
|
532
|
-
}], ctorParameters: function () {
|
|
533
|
-
return [{ type: i0.Injector }, { type: i0.ViewContainerRef }, { type: MenuStack, decorators: [{
|
|
534
|
-
type: Inject,
|
|
535
|
-
args: [MENU_STACK]
|
|
536
|
-
}] }];
|
|
537
|
-
} });
|
|
538
|
-
|
|
539
528
|
/**
|
|
540
529
|
* @license
|
|
541
530
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -551,32 +540,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
|
|
|
551
540
|
* state.
|
|
552
541
|
*/
|
|
553
542
|
class CdkMenuTrigger extends CdkMenuTriggerBase {
|
|
554
|
-
constructor(
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
/** The menu aim service used by this menu. */
|
|
570
|
-
_menuAim,
|
|
571
|
-
/** The directionality of the page. */
|
|
572
|
-
_directionality) {
|
|
573
|
-
super(injector, viewContainerRef, menuStack);
|
|
574
|
-
this._elementRef = _elementRef;
|
|
575
|
-
this._overlay = _overlay;
|
|
576
|
-
this._ngZone = _ngZone;
|
|
577
|
-
this._parentMenu = _parentMenu;
|
|
578
|
-
this._menuAim = _menuAim;
|
|
579
|
-
this._directionality = _directionality;
|
|
543
|
+
constructor() {
|
|
544
|
+
super();
|
|
545
|
+
/** The host element. */
|
|
546
|
+
this._elementRef = inject(ElementRef);
|
|
547
|
+
/** The CDK overlay service. */
|
|
548
|
+
this._overlay = inject(Overlay);
|
|
549
|
+
/** The Angular zone. */
|
|
550
|
+
this._ngZone = inject(NgZone);
|
|
551
|
+
/** The parent menu this trigger belongs to. */
|
|
552
|
+
this._parentMenu = inject(CDK_MENU, InjectFlags.Optional);
|
|
553
|
+
/** The menu aim service used by this menu. */
|
|
554
|
+
this._menuAim = inject(MENU_AIM, InjectFlags.Optional);
|
|
555
|
+
/** The directionality of the page. */
|
|
556
|
+
this._directionality = inject(Directionality, InjectFlags.Optional);
|
|
557
|
+
this._setRole();
|
|
580
558
|
this._registerCloseHandler();
|
|
581
559
|
this._subscribeToMenuStackClosed();
|
|
582
560
|
this._subscribeToMouseEnter();
|
|
@@ -711,7 +689,7 @@ class CdkMenuTrigger extends CdkMenuTriggerBase {
|
|
|
711
689
|
return new OverlayConfig({
|
|
712
690
|
positionStrategy: this._getOverlayPositionStrategy(),
|
|
713
691
|
scrollStrategy: this._overlay.scrollStrategies.reposition(),
|
|
714
|
-
direction: this._directionality,
|
|
692
|
+
direction: this._directionality || undefined,
|
|
715
693
|
});
|
|
716
694
|
}
|
|
717
695
|
/** Build the position strategy for the overlay which specifies where to place the menu. */
|
|
@@ -783,13 +761,21 @@ class CdkMenuTrigger extends CdkMenuTriggerBase {
|
|
|
783
761
|
});
|
|
784
762
|
}
|
|
785
763
|
}
|
|
764
|
+
/** Sets the role attribute for this trigger if needed. */
|
|
765
|
+
_setRole() {
|
|
766
|
+
// If this trigger is part of another menu, the cdkMenuItem directive will handle setting the
|
|
767
|
+
// role, otherwise this is a standalone trigger, and we should ensure it has role="button".
|
|
768
|
+
if (!this._parentMenu) {
|
|
769
|
+
this._elementRef.nativeElement.setAttribute('role', 'button');
|
|
770
|
+
}
|
|
771
|
+
}
|
|
786
772
|
}
|
|
787
|
-
CdkMenuTrigger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
788
|
-
CdkMenuTrigger.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-
|
|
773
|
+
CdkMenuTrigger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
774
|
+
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: [
|
|
789
775
|
{ provide: MENU_TRIGGER, useExisting: CdkMenuTrigger },
|
|
790
776
|
PARENT_OR_NEW_MENU_STACK_PROVIDER,
|
|
791
777
|
], exportAs: ["cdkMenuTriggerFor"], usesInheritance: true, ngImport: i0 });
|
|
792
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
778
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuTrigger, decorators: [{
|
|
793
779
|
type: Directive,
|
|
794
780
|
args: [{
|
|
795
781
|
selector: '[cdkMenuTriggerFor]',
|
|
@@ -810,24 +796,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
|
|
|
810
796
|
PARENT_OR_NEW_MENU_STACK_PROVIDER,
|
|
811
797
|
],
|
|
812
798
|
}]
|
|
813
|
-
}], ctorParameters: function () {
|
|
814
|
-
return [{ type: i0.Injector }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i1.Overlay }, { type: i0.NgZone }, { type: MenuStack, decorators: [{
|
|
815
|
-
type: Inject,
|
|
816
|
-
args: [MENU_STACK]
|
|
817
|
-
}] }, { type: undefined, decorators: [{
|
|
818
|
-
type: Optional
|
|
819
|
-
}, {
|
|
820
|
-
type: Inject,
|
|
821
|
-
args: [CDK_MENU]
|
|
822
|
-
}] }, { type: undefined, decorators: [{
|
|
823
|
-
type: Optional
|
|
824
|
-
}, {
|
|
825
|
-
type: Inject,
|
|
826
|
-
args: [MENU_AIM]
|
|
827
|
-
}] }, { type: i1$1.Directionality, decorators: [{
|
|
828
|
-
type: Optional
|
|
829
|
-
}] }];
|
|
830
|
-
} });
|
|
799
|
+
}], ctorParameters: function () { return []; } });
|
|
831
800
|
|
|
832
801
|
/**
|
|
833
802
|
* @license
|
|
@@ -842,29 +811,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
|
|
|
842
811
|
* behavior when clicked.
|
|
843
812
|
*/
|
|
844
813
|
class CdkMenuItem {
|
|
845
|
-
constructor(
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
_menuTrigger) {
|
|
861
|
-
this._elementRef = _elementRef;
|
|
862
|
-
this._ngZone = _ngZone;
|
|
863
|
-
this._menuStack = _menuStack;
|
|
864
|
-
this._parentMenu = _parentMenu;
|
|
865
|
-
this._menuAim = _menuAim;
|
|
866
|
-
this._dir = _dir;
|
|
867
|
-
this._menuTrigger = _menuTrigger;
|
|
814
|
+
constructor() {
|
|
815
|
+
/** The directionality (text direction) of the current page. */
|
|
816
|
+
this._dir = inject(Directionality, InjectFlags.Optional);
|
|
817
|
+
/** The menu's native DOM host element. */
|
|
818
|
+
this._elementRef = inject(ElementRef);
|
|
819
|
+
/** The Angular zone. */
|
|
820
|
+
this._ngZone = inject(NgZone);
|
|
821
|
+
/** The menu aim service used by this menu. */
|
|
822
|
+
this._menuAim = inject(MENU_AIM, InjectFlags.Optional);
|
|
823
|
+
/** The stack of menus this menu belongs to. */
|
|
824
|
+
this._menuStack = inject(MENU_STACK);
|
|
825
|
+
/** The parent menu in which this menuitem resides. */
|
|
826
|
+
this._parentMenu = inject(CDK_MENU, InjectFlags.Optional);
|
|
827
|
+
/** Reference to the CdkMenuItemTrigger directive if one is added to the same element */
|
|
828
|
+
this._menuTrigger = inject(CdkMenuTrigger, InjectFlags.Optional | InjectFlags.Self);
|
|
868
829
|
this._disabled = false;
|
|
869
830
|
/**
|
|
870
831
|
* If this MenuItem is a regular MenuItem, outputs when it is triggered by a keyboard or mouse
|
|
@@ -1061,9 +1022,9 @@ class CdkMenuItem {
|
|
|
1061
1022
|
return ((_a = this._parentMenu) === null || _a === void 0 ? void 0 : _a.orientation) === 'vertical';
|
|
1062
1023
|
}
|
|
1063
1024
|
}
|
|
1064
|
-
CdkMenuItem.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
1065
|
-
CdkMenuItem.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-
|
|
1066
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
1025
|
+
CdkMenuItem.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1026
|
+
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 });
|
|
1027
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItem, decorators: [{
|
|
1067
1028
|
type: Directive,
|
|
1068
1029
|
args: [{
|
|
1069
1030
|
selector: '[cdkMenuItem]',
|
|
@@ -1079,28 +1040,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
|
|
|
1079
1040
|
'(keydown)': '_onKeydown($event)',
|
|
1080
1041
|
},
|
|
1081
1042
|
}]
|
|
1082
|
-
}], ctorParameters: function () {
|
|
1083
|
-
return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: MenuStack, decorators: [{
|
|
1084
|
-
type: Inject,
|
|
1085
|
-
args: [MENU_STACK]
|
|
1086
|
-
}] }, { type: undefined, decorators: [{
|
|
1087
|
-
type: Optional
|
|
1088
|
-
}, {
|
|
1089
|
-
type: Inject,
|
|
1090
|
-
args: [CDK_MENU]
|
|
1091
|
-
}] }, { type: undefined, decorators: [{
|
|
1092
|
-
type: Optional
|
|
1093
|
-
}, {
|
|
1094
|
-
type: Inject,
|
|
1095
|
-
args: [MENU_AIM]
|
|
1096
|
-
}] }, { type: i1$1.Directionality, decorators: [{
|
|
1097
|
-
type: Optional
|
|
1098
|
-
}] }, { type: CdkMenuTrigger, decorators: [{
|
|
1099
|
-
type: Self
|
|
1100
|
-
}, {
|
|
1101
|
-
type: Optional
|
|
1102
|
-
}] }];
|
|
1103
|
-
}, propDecorators: { disabled: [{
|
|
1043
|
+
}], ctorParameters: function () { return []; }, propDecorators: { disabled: [{
|
|
1104
1044
|
type: Input,
|
|
1105
1045
|
args: ['cdkMenuItemDisabled']
|
|
1106
1046
|
}], typeaheadLabel: [{
|
|
@@ -1174,33 +1114,31 @@ let nextId$1 = 0;
|
|
|
1174
1114
|
* This class can be extended to create custom menu types.
|
|
1175
1115
|
*/
|
|
1176
1116
|
class CdkMenuBase extends CdkMenuGroup {
|
|
1177
|
-
constructor(
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
this.ngZone = ngZone;
|
|
1190
|
-
this.menuStack = menuStack;
|
|
1191
|
-
this.menuAim = menuAim;
|
|
1192
|
-
this.dir = dir;
|
|
1117
|
+
constructor() {
|
|
1118
|
+
super(...arguments);
|
|
1119
|
+
/** The menu's native DOM host element. */
|
|
1120
|
+
this.nativeElement = inject(ElementRef).nativeElement;
|
|
1121
|
+
/** The Angular zone. */
|
|
1122
|
+
this.ngZone = inject(NgZone);
|
|
1123
|
+
/** The stack of menus this menu belongs to. */
|
|
1124
|
+
this.menuStack = inject(MENU_STACK);
|
|
1125
|
+
/** The menu aim service used by this menu. */
|
|
1126
|
+
this.menuAim = inject(MENU_AIM, InjectFlags.Optional | InjectFlags.Self);
|
|
1127
|
+
/** The directionality (text direction) of the current page. */
|
|
1128
|
+
this.dir = inject(Directionality, InjectFlags.Optional);
|
|
1193
1129
|
/** The id of the menu's host element. */
|
|
1194
1130
|
this.id = `cdk-menu-${nextId$1++}`;
|
|
1195
1131
|
/** The direction items in the menu flow. */
|
|
1196
1132
|
this.orientation = 'vertical';
|
|
1197
|
-
/**
|
|
1133
|
+
/**
|
|
1134
|
+
* Whether the menu is displayed inline (i.e. always present vs a conditional popup that the
|
|
1135
|
+
* user triggers with a trigger element).
|
|
1136
|
+
*/
|
|
1198
1137
|
this.isInline = false;
|
|
1199
1138
|
/** Emits when the MenuBar is destroyed. */
|
|
1200
1139
|
this.destroyed = new Subject();
|
|
1201
1140
|
/** Whether this menu's menu stack has focus. */
|
|
1202
1141
|
this._menuStackHasFocus = false;
|
|
1203
|
-
this.nativeElement = elementRef.nativeElement;
|
|
1204
1142
|
}
|
|
1205
1143
|
ngAfterContentInit() {
|
|
1206
1144
|
if (!this.isInline) {
|
|
@@ -1317,9 +1255,9 @@ class CdkMenuBase extends CdkMenuGroup {
|
|
|
1317
1255
|
}
|
|
1318
1256
|
}
|
|
1319
1257
|
}
|
|
1320
|
-
CdkMenuBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
1321
|
-
CdkMenuBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-
|
|
1322
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
1258
|
+
CdkMenuBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuBase, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1259
|
+
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 });
|
|
1260
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuBase, decorators: [{
|
|
1323
1261
|
type: Directive,
|
|
1324
1262
|
args: [{
|
|
1325
1263
|
host: {
|
|
@@ -1334,21 +1272,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
|
|
|
1334
1272
|
'(focusout)': 'menuStack.setHasFocus(false)',
|
|
1335
1273
|
},
|
|
1336
1274
|
}]
|
|
1337
|
-
}],
|
|
1338
|
-
return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: MenuStack, decorators: [{
|
|
1339
|
-
type: Inject,
|
|
1340
|
-
args: [MENU_STACK]
|
|
1341
|
-
}] }, { type: undefined, decorators: [{
|
|
1342
|
-
type: Self
|
|
1343
|
-
}, {
|
|
1344
|
-
type: Optional
|
|
1345
|
-
}, {
|
|
1346
|
-
type: Inject,
|
|
1347
|
-
args: [MENU_AIM]
|
|
1348
|
-
}] }, { type: i1$1.Directionality, decorators: [{
|
|
1349
|
-
type: Optional
|
|
1350
|
-
}] }];
|
|
1351
|
-
}, propDecorators: { id: [{
|
|
1275
|
+
}], propDecorators: { id: [{
|
|
1352
1276
|
type: Input
|
|
1353
1277
|
}], items: [{
|
|
1354
1278
|
type: ContentChildren,
|
|
@@ -1370,22 +1294,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
|
|
|
1370
1294
|
* It also acts as a RadioGroup for elements marked with role `menuitemradio`.
|
|
1371
1295
|
*/
|
|
1372
1296
|
class CdkMenu extends CdkMenuBase {
|
|
1373
|
-
constructor(
|
|
1374
|
-
/** The host element. */
|
|
1375
|
-
elementRef,
|
|
1376
|
-
/** The Angular zone. */
|
|
1377
|
-
ngZone,
|
|
1378
|
-
/** The menu stack this menu is part of. */
|
|
1379
|
-
menuStack,
|
|
1380
|
-
/** The trigger that opened this menu. */
|
|
1381
|
-
_parentTrigger,
|
|
1382
|
-
/** The menu aim service used by this menu. */
|
|
1383
|
-
menuAim,
|
|
1384
|
-
/** The directionality of the page. */
|
|
1385
|
-
dir) {
|
|
1297
|
+
constructor() {
|
|
1386
1298
|
var _a;
|
|
1387
|
-
super(
|
|
1388
|
-
this._parentTrigger =
|
|
1299
|
+
super();
|
|
1300
|
+
this._parentTrigger = inject(MENU_TRIGGER, InjectFlags.Optional);
|
|
1389
1301
|
/** Event emitted when the menu is closed. */
|
|
1390
1302
|
this.closed = new EventEmitter();
|
|
1391
1303
|
/** The direction items in the menu flow. */
|
|
@@ -1466,13 +1378,13 @@ class CdkMenu extends CdkMenuBase {
|
|
|
1466
1378
|
.subscribe(event => this._toggleMenuFocus(event));
|
|
1467
1379
|
}
|
|
1468
1380
|
}
|
|
1469
|
-
CdkMenu.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
1470
|
-
CdkMenu.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-
|
|
1381
|
+
CdkMenu.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1382
|
+
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: [
|
|
1471
1383
|
{ provide: CdkMenuGroup, useExisting: CdkMenu },
|
|
1472
1384
|
{ provide: CDK_MENU, useExisting: CdkMenu },
|
|
1473
1385
|
PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER('vertical'),
|
|
1474
1386
|
], exportAs: ["cdkMenu"], usesInheritance: true, ngImport: i0 });
|
|
1475
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
1387
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenu, decorators: [{
|
|
1476
1388
|
type: Directive,
|
|
1477
1389
|
args: [{
|
|
1478
1390
|
selector: '[cdkMenu]',
|
|
@@ -1489,26 +1401,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
|
|
|
1489
1401
|
PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER('vertical'),
|
|
1490
1402
|
],
|
|
1491
1403
|
}]
|
|
1492
|
-
}], ctorParameters: function () {
|
|
1493
|
-
return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: MenuStack, decorators: [{
|
|
1494
|
-
type: Inject,
|
|
1495
|
-
args: [MENU_STACK]
|
|
1496
|
-
}] }, { type: CdkMenuTriggerBase, decorators: [{
|
|
1497
|
-
type: Optional
|
|
1498
|
-
}, {
|
|
1499
|
-
type: Inject,
|
|
1500
|
-
args: [MENU_TRIGGER]
|
|
1501
|
-
}] }, { type: undefined, decorators: [{
|
|
1502
|
-
type: Self
|
|
1503
|
-
}, {
|
|
1504
|
-
type: Optional
|
|
1505
|
-
}, {
|
|
1506
|
-
type: Inject,
|
|
1507
|
-
args: [MENU_AIM]
|
|
1508
|
-
}] }, { type: i1$1.Directionality, decorators: [{
|
|
1509
|
-
type: Optional
|
|
1510
|
-
}] }];
|
|
1511
|
-
}, propDecorators: { closed: [{
|
|
1404
|
+
}], ctorParameters: function () { return []; }, propDecorators: { closed: [{
|
|
1512
1405
|
type: Output
|
|
1513
1406
|
}] } });
|
|
1514
1407
|
|
|
@@ -1526,18 +1419,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
|
|
|
1526
1419
|
*
|
|
1527
1420
|
*/
|
|
1528
1421
|
class CdkMenuBar extends CdkMenuBase {
|
|
1529
|
-
constructor(
|
|
1530
|
-
|
|
1531
|
-
elementRef,
|
|
1532
|
-
/** The Angular zone. */
|
|
1533
|
-
ngZone,
|
|
1534
|
-
/** The menu stack this menu is part of. */
|
|
1535
|
-
menuStack,
|
|
1536
|
-
/** The menu aim service used by this menu. */
|
|
1537
|
-
menuAim,
|
|
1538
|
-
/** The directionality of the page. */
|
|
1539
|
-
dir) {
|
|
1540
|
-
super(elementRef, ngZone, menuStack, menuAim, dir);
|
|
1422
|
+
constructor() {
|
|
1423
|
+
super(...arguments);
|
|
1541
1424
|
/** The direction items in the menu flow. */
|
|
1542
1425
|
this.orientation = 'horizontal';
|
|
1543
1426
|
/** Whether the menu is displayed inline (i.e. always present vs a conditional popup that the user triggers with a trigger element). */
|
|
@@ -1624,13 +1507,13 @@ class CdkMenuBar extends CdkMenuBase {
|
|
|
1624
1507
|
(_a = this.menuStack) === null || _a === void 0 ? void 0 : _a.emptied.pipe(takeUntil(this.destroyed)).subscribe(event => this._toggleOpenMenu(event));
|
|
1625
1508
|
}
|
|
1626
1509
|
}
|
|
1627
|
-
CdkMenuBar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
1628
|
-
CdkMenuBar.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-
|
|
1510
|
+
CdkMenuBar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuBar, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1511
|
+
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: [
|
|
1629
1512
|
{ provide: CdkMenuGroup, useExisting: CdkMenuBar },
|
|
1630
1513
|
{ provide: CDK_MENU, useExisting: CdkMenuBar },
|
|
1631
1514
|
{ provide: MENU_STACK, useFactory: () => MenuStack.inline('horizontal') },
|
|
1632
1515
|
], exportAs: ["cdkMenuBar"], usesInheritance: true, ngImport: i0 });
|
|
1633
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
1516
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuBar, decorators: [{
|
|
1634
1517
|
type: Directive,
|
|
1635
1518
|
args: [{
|
|
1636
1519
|
selector: '[cdkMenuBar]',
|
|
@@ -1646,21 +1529,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
|
|
|
1646
1529
|
{ provide: MENU_STACK, useFactory: () => MenuStack.inline('horizontal') },
|
|
1647
1530
|
],
|
|
1648
1531
|
}]
|
|
1649
|
-
}]
|
|
1650
|
-
return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: MenuStack, decorators: [{
|
|
1651
|
-
type: Inject,
|
|
1652
|
-
args: [MENU_STACK]
|
|
1653
|
-
}] }, { type: undefined, decorators: [{
|
|
1654
|
-
type: Self
|
|
1655
|
-
}, {
|
|
1656
|
-
type: Optional
|
|
1657
|
-
}, {
|
|
1658
|
-
type: Inject,
|
|
1659
|
-
args: [MENU_AIM]
|
|
1660
|
-
}] }, { type: i1$1.Directionality, decorators: [{
|
|
1661
|
-
type: Optional
|
|
1662
|
-
}] }];
|
|
1663
|
-
} });
|
|
1532
|
+
}] });
|
|
1664
1533
|
|
|
1665
1534
|
/**
|
|
1666
1535
|
* @license
|
|
@@ -1685,9 +1554,9 @@ class CdkMenuItemSelectable extends CdkMenuItem {
|
|
|
1685
1554
|
this._checked = coerceBooleanProperty(value);
|
|
1686
1555
|
}
|
|
1687
1556
|
}
|
|
1688
|
-
CdkMenuItemSelectable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
1689
|
-
CdkMenuItemSelectable.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-
|
|
1690
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
1557
|
+
CdkMenuItemSelectable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemSelectable, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1558
|
+
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 });
|
|
1559
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemSelectable, decorators: [{
|
|
1691
1560
|
type: Directive,
|
|
1692
1561
|
args: [{
|
|
1693
1562
|
host: {
|
|
@@ -1700,6 +1569,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
|
|
|
1700
1569
|
args: ['cdkMenuItemChecked']
|
|
1701
1570
|
}] } });
|
|
1702
1571
|
|
|
1572
|
+
/**
|
|
1573
|
+
* @license
|
|
1574
|
+
* Copyright Google LLC All Rights Reserved.
|
|
1575
|
+
*
|
|
1576
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
1577
|
+
* found in the LICENSE file at https://angular.io/license
|
|
1578
|
+
*/
|
|
1703
1579
|
/** Counter used to set a unique id and name for a selectable item */
|
|
1704
1580
|
let nextId = 0;
|
|
1705
1581
|
/**
|
|
@@ -1708,26 +1584,10 @@ let nextId = 0;
|
|
|
1708
1584
|
* or `CdkMenuGroup` comprise a radio group with unique selection enforced.
|
|
1709
1585
|
*/
|
|
1710
1586
|
class CdkMenuItemRadio extends CdkMenuItemSelectable {
|
|
1711
|
-
constructor(
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
ngZone,
|
|
1716
|
-
/** The unique selection dispatcher for this radio's `CdkMenuGroup`. */
|
|
1717
|
-
_selectionDispatcher,
|
|
1718
|
-
/** The menu stack this item belongs to. */
|
|
1719
|
-
menuStack,
|
|
1720
|
-
/** The parent menu for this item. */
|
|
1721
|
-
parentMenu,
|
|
1722
|
-
/** The menu aim used for this item. */
|
|
1723
|
-
menuAim,
|
|
1724
|
-
/** The directionality of the page. */
|
|
1725
|
-
dir,
|
|
1726
|
-
/** Reference to the CdkMenuItemTrigger directive if one is added to the same element */
|
|
1727
|
-
// tslint:disable-next-line: lightweight-tokens
|
|
1728
|
-
menuTrigger) {
|
|
1729
|
-
super(element, ngZone, menuStack, parentMenu, menuAim, dir, menuTrigger);
|
|
1730
|
-
this._selectionDispatcher = _selectionDispatcher;
|
|
1587
|
+
constructor() {
|
|
1588
|
+
super();
|
|
1589
|
+
/** The unique selection dispatcher for this radio's `CdkMenuGroup`. */
|
|
1590
|
+
this._selectionDispatcher = inject(UniqueSelectionDispatcher);
|
|
1731
1591
|
/** An ID to identify this radio item to the `UniqueSelectionDisptcher`. */
|
|
1732
1592
|
this._id = `${nextId++}`;
|
|
1733
1593
|
this._registerDispatcherListener();
|
|
@@ -1754,46 +1614,26 @@ class CdkMenuItemRadio extends CdkMenuItemSelectable {
|
|
|
1754
1614
|
});
|
|
1755
1615
|
}
|
|
1756
1616
|
}
|
|
1757
|
-
CdkMenuItemRadio.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
1758
|
-
CdkMenuItemRadio.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-
|
|
1617
|
+
CdkMenuItemRadio.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemRadio, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1618
|
+
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: [
|
|
1759
1619
|
{ provide: CdkMenuItemSelectable, useExisting: CdkMenuItemRadio },
|
|
1760
1620
|
{ provide: CdkMenuItem, useExisting: CdkMenuItemSelectable },
|
|
1761
1621
|
], exportAs: ["cdkMenuItemRadio"], usesInheritance: true, ngImport: i0 });
|
|
1762
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
1622
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemRadio, decorators: [{
|
|
1763
1623
|
type: Directive,
|
|
1764
1624
|
args: [{
|
|
1765
1625
|
selector: '[cdkMenuItemRadio]',
|
|
1766
1626
|
exportAs: 'cdkMenuItemRadio',
|
|
1767
1627
|
host: {
|
|
1768
1628
|
'role': 'menuitemradio',
|
|
1629
|
+
'[class.cdk-menu-item-radio]': 'true',
|
|
1769
1630
|
},
|
|
1770
1631
|
providers: [
|
|
1771
1632
|
{ provide: CdkMenuItemSelectable, useExisting: CdkMenuItemRadio },
|
|
1772
1633
|
{ provide: CdkMenuItem, useExisting: CdkMenuItemSelectable },
|
|
1773
1634
|
],
|
|
1774
1635
|
}]
|
|
1775
|
-
}], ctorParameters: function () {
|
|
1776
|
-
return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i1$2.UniqueSelectionDispatcher }, { type: MenuStack, decorators: [{
|
|
1777
|
-
type: Inject,
|
|
1778
|
-
args: [MENU_STACK]
|
|
1779
|
-
}] }, { type: undefined, decorators: [{
|
|
1780
|
-
type: Optional
|
|
1781
|
-
}, {
|
|
1782
|
-
type: Inject,
|
|
1783
|
-
args: [CDK_MENU]
|
|
1784
|
-
}] }, { type: undefined, decorators: [{
|
|
1785
|
-
type: Optional
|
|
1786
|
-
}, {
|
|
1787
|
-
type: Inject,
|
|
1788
|
-
args: [MENU_AIM]
|
|
1789
|
-
}] }, { type: i1$1.Directionality, decorators: [{
|
|
1790
|
-
type: Optional
|
|
1791
|
-
}] }, { type: CdkMenuTrigger, decorators: [{
|
|
1792
|
-
type: Self
|
|
1793
|
-
}, {
|
|
1794
|
-
type: Optional
|
|
1795
|
-
}] }];
|
|
1796
|
-
} });
|
|
1636
|
+
}], ctorParameters: function () { return []; } });
|
|
1797
1637
|
|
|
1798
1638
|
/**
|
|
1799
1639
|
* @license
|
|
@@ -1819,18 +1659,19 @@ class CdkMenuItemCheckbox extends CdkMenuItemSelectable {
|
|
|
1819
1659
|
}
|
|
1820
1660
|
}
|
|
1821
1661
|
}
|
|
1822
|
-
CdkMenuItemCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
1823
|
-
CdkMenuItemCheckbox.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-
|
|
1662
|
+
CdkMenuItemCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1663
|
+
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: [
|
|
1824
1664
|
{ provide: CdkMenuItemSelectable, useExisting: CdkMenuItemCheckbox },
|
|
1825
1665
|
{ provide: CdkMenuItem, useExisting: CdkMenuItemSelectable },
|
|
1826
1666
|
], exportAs: ["cdkMenuItemCheckbox"], usesInheritance: true, ngImport: i0 });
|
|
1827
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
1667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuItemCheckbox, decorators: [{
|
|
1828
1668
|
type: Directive,
|
|
1829
1669
|
args: [{
|
|
1830
1670
|
selector: '[cdkMenuItemCheckbox]',
|
|
1831
1671
|
exportAs: 'cdkMenuItemCheckbox',
|
|
1832
1672
|
host: {
|
|
1833
1673
|
'role': 'menuitemcheckbox',
|
|
1674
|
+
'[class.cdk-menu-item-checkbox]': 'true',
|
|
1834
1675
|
},
|
|
1835
1676
|
providers: [
|
|
1836
1677
|
{ provide: CdkMenuItemSelectable, useExisting: CdkMenuItemCheckbox },
|
|
@@ -1868,9 +1709,9 @@ class ContextMenuTracker {
|
|
|
1868
1709
|
}
|
|
1869
1710
|
}
|
|
1870
1711
|
}
|
|
1871
|
-
ContextMenuTracker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
1872
|
-
ContextMenuTracker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-
|
|
1873
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
1712
|
+
ContextMenuTracker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ContextMenuTracker, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1713
|
+
ContextMenuTracker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ContextMenuTracker, providedIn: 'root' });
|
|
1714
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ContextMenuTracker, decorators: [{
|
|
1874
1715
|
type: Injectable,
|
|
1875
1716
|
args: [{ providedIn: 'root' }]
|
|
1876
1717
|
}] });
|
|
@@ -1879,23 +1720,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
|
|
|
1879
1720
|
* It is aware of nested context menus and will trigger only the lowest level non-disabled context menu.
|
|
1880
1721
|
*/
|
|
1881
1722
|
class CdkContextMenuTrigger extends CdkMenuTriggerBase {
|
|
1882
|
-
constructor(
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
_contextMenuTracker,
|
|
1891
|
-
/** The menu stack this menu is part of. */
|
|
1892
|
-
menuStack,
|
|
1893
|
-
/** The directionality of the current page */
|
|
1894
|
-
_directionality) {
|
|
1895
|
-
super(injector, viewContainerRef, menuStack);
|
|
1896
|
-
this._overlay = _overlay;
|
|
1897
|
-
this._contextMenuTracker = _contextMenuTracker;
|
|
1898
|
-
this._directionality = _directionality;
|
|
1723
|
+
constructor() {
|
|
1724
|
+
super();
|
|
1725
|
+
/** The CDK overlay service. */
|
|
1726
|
+
this._overlay = inject(Overlay);
|
|
1727
|
+
/** The directionality of the page. */
|
|
1728
|
+
this._directionality = inject(Directionality, InjectFlags.Optional);
|
|
1729
|
+
/** The app's context menu tracking registry */
|
|
1730
|
+
this._contextMenuTracker = inject(ContextMenuTracker);
|
|
1899
1731
|
this._disabled = false;
|
|
1900
1732
|
this._setMenuStackCloseListener();
|
|
1901
1733
|
}
|
|
@@ -1952,7 +1784,7 @@ class CdkContextMenuTrigger extends CdkMenuTriggerBase {
|
|
|
1952
1784
|
return new OverlayConfig({
|
|
1953
1785
|
positionStrategy: this._getOverlayPositionStrategy(coordinates),
|
|
1954
1786
|
scrollStrategy: this._overlay.scrollStrategies.reposition(),
|
|
1955
|
-
direction: this._directionality,
|
|
1787
|
+
direction: this._directionality || undefined,
|
|
1956
1788
|
});
|
|
1957
1789
|
}
|
|
1958
1790
|
/**
|
|
@@ -2028,12 +1860,12 @@ class CdkContextMenuTrigger extends CdkMenuTriggerBase {
|
|
|
2028
1860
|
}
|
|
2029
1861
|
}
|
|
2030
1862
|
}
|
|
2031
|
-
CdkContextMenuTrigger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
2032
|
-
CdkContextMenuTrigger.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-
|
|
1863
|
+
CdkContextMenuTrigger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkContextMenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1864
|
+
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: [
|
|
2033
1865
|
{ provide: MENU_TRIGGER, useExisting: CdkContextMenuTrigger },
|
|
2034
1866
|
{ provide: MENU_STACK, useClass: MenuStack },
|
|
2035
1867
|
], exportAs: ["cdkContextMenuTriggerFor"], usesInheritance: true, ngImport: i0 });
|
|
2036
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
1868
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkContextMenuTrigger, decorators: [{
|
|
2037
1869
|
type: Directive,
|
|
2038
1870
|
args: [{
|
|
2039
1871
|
selector: '[cdkContextMenuTriggerFor]',
|
|
@@ -2049,14 +1881,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.16",
|
|
|
2049
1881
|
{ provide: MENU_STACK, useClass: MenuStack },
|
|
2050
1882
|
],
|
|
2051
1883
|
}]
|
|
2052
|
-
}], ctorParameters: function () {
|
|
2053
|
-
return [{ type: i0.Injector }, { type: i0.ViewContainerRef }, { type: i1.Overlay }, { type: ContextMenuTracker }, { type: MenuStack, decorators: [{
|
|
2054
|
-
type: Inject,
|
|
2055
|
-
args: [MENU_STACK]
|
|
2056
|
-
}] }, { type: i1$1.Directionality, decorators: [{
|
|
2057
|
-
type: Optional
|
|
2058
|
-
}] }];
|
|
2059
|
-
}, propDecorators: { disabled: [{
|
|
1884
|
+
}], ctorParameters: function () { return []; }, propDecorators: { disabled: [{
|
|
2060
1885
|
type: Input,
|
|
2061
1886
|
args: ['cdkContextMenuDisabled']
|
|
2062
1887
|
}] } });
|
|
@@ -2083,8 +1908,8 @@ const EXPORTED_DECLARATIONS = [
|
|
|
2083
1908
|
/** Module that declares components and directives for the CDK menu. */
|
|
2084
1909
|
class CdkMenuModule {
|
|
2085
1910
|
}
|
|
2086
|
-
CdkMenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-
|
|
2087
|
-
CdkMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.0-
|
|
1911
|
+
CdkMenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1912
|
+
CdkMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuModule, declarations: [CdkMenuBar,
|
|
2088
1913
|
CdkMenu,
|
|
2089
1914
|
CdkMenuItem,
|
|
2090
1915
|
CdkMenuItemRadio,
|
|
@@ -2101,8 +1926,8 @@ CdkMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
2101
1926
|
CdkMenuGroup,
|
|
2102
1927
|
CdkContextMenuTrigger,
|
|
2103
1928
|
CdkTargetMenuAim] });
|
|
2104
|
-
CdkMenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-
|
|
2105
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-
|
|
1929
|
+
CdkMenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuModule, imports: [OverlayModule] });
|
|
1930
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkMenuModule, decorators: [{
|
|
2106
1931
|
type: NgModule,
|
|
2107
1932
|
args: [{
|
|
2108
1933
|
imports: [OverlayModule],
|