@angular/material 19.1.0-next.3 → 19.1.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/LICENSE +1 -1
- package/autocomplete/index.d.ts +1 -1
- package/badge/index.d.ts +2 -2
- package/button/index.d.ts +4 -6
- package/checkbox/index.d.ts +4 -4
- package/chips/index.d.ts +3 -3
- package/core/index.d.ts +0 -1
- package/datepicker/index.d.ts +16 -40
- package/fesm2022/autocomplete.mjs +13 -13
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge.mjs +12 -12
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +10 -10
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +10 -10
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +36 -38
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card.mjs +46 -46
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +18 -18
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips.mjs +42 -42
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core.mjs +75 -73
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +820 -821
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog.mjs +25 -25
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider.mjs +7 -7
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion.mjs +25 -25
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field.mjs +36 -36
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +22 -22
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs +7 -7
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +12 -12
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input.mjs +7 -7
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list.mjs +54 -53
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu.mjs +35 -28
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator.mjs +21 -24
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +9 -9
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +9 -9
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio.mjs +14 -14
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select.mjs +12 -12
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +133 -110
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +16 -16
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider.mjs +23 -25
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +22 -22
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort.mjs +14 -14
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper.mjs +37 -37
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +57 -57
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs.mjs +54 -56
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +16 -14
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +12 -12
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +104 -71
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree.mjs +25 -25
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/index.d.ts +4 -4
- package/icon/index.d.ts +4 -4
- package/list/index.d.ts +6 -5
- package/menu/index.d.ts +5 -1
- package/package.json +7 -7
- package/paginator/index.d.ts +5 -5
- package/progress-bar/index.d.ts +4 -4
- package/progress-spinner/index.d.ts +4 -4
- package/radio/index.d.ts +6 -6
- package/schematics/ng-add/index.js +2 -2
- package/schematics/ng-add/index.mjs +2 -2
- package/select/index.d.ts +1 -1
- package/sidenav/index.d.ts +11 -10
- package/slide-toggle/index.d.ts +4 -4
- package/slider/index.d.ts +2 -2
- package/stepper/index.d.ts +6 -6
- package/tabs/index.d.ts +9 -9
- package/toolbar/index.d.ts +2 -2
- package/tooltip/index.d.ts +10 -4
package/fesm2022/menu.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, ElementRef, ChangeDetectorRef, booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, TemplateRef, ApplicationRef, Injector, ViewContainerRef, Directive, QueryList, EventEmitter, ANIMATION_MODULE_TYPE, afterNextRender, ContentChildren, ViewChild, ContentChild, Output, NgZone,
|
|
2
|
+
import { InjectionToken, inject, ElementRef, ChangeDetectorRef, booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, TemplateRef, ApplicationRef, Injector, ViewContainerRef, Directive, QueryList, EventEmitter, ANIMATION_MODULE_TYPE, afterNextRender, ContentChildren, ViewChild, ContentChild, Output, NgZone, NgModule } from '@angular/core';
|
|
3
3
|
import { FocusMonitor, _IdGenerator, FocusKeyManager, isFakeTouchstartFromScreenReader, isFakeMousedownFromScreenReader } from '@angular/cdk/a11y';
|
|
4
4
|
import { UP_ARROW, DOWN_ARROW, RIGHT_ARROW, LEFT_ARROW, ESCAPE, hasModifierKey, ENTER, SPACE } from '@angular/cdk/keycodes';
|
|
5
5
|
import { Subject, merge, Subscription, of } from 'rxjs';
|
|
@@ -10,7 +10,7 @@ import { _CdkPrivateStyleLoader } from '@angular/cdk/private';
|
|
|
10
10
|
import { TemplatePortal, DomPortalOutlet } from '@angular/cdk/portal';
|
|
11
11
|
import { Directionality } from '@angular/cdk/bidi';
|
|
12
12
|
import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
13
|
-
import {
|
|
13
|
+
import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
|
|
14
14
|
import { CdkScrollableModule } from '@angular/cdk/scrolling';
|
|
15
15
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
16
16
|
|
|
@@ -118,10 +118,10 @@ class MatMenuItem {
|
|
|
118
118
|
_hasFocus() {
|
|
119
119
|
return this._document && this._document.activeElement === this._getHostElement();
|
|
120
120
|
}
|
|
121
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
122
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.0-
|
|
121
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: MatMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
122
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.0-rc.0", type: MatMenuItem, isStandalone: true, selector: "[mat-menu-item]", inputs: { role: "role", disabled: ["disabled", "disabled", booleanAttribute], disableRipple: ["disableRipple", "disableRipple", booleanAttribute] }, host: { listeners: { "click": "_checkDisabled($event)", "mouseenter": "_handleMouseEnter()" }, properties: { "attr.role": "role", "class.mat-mdc-menu-item-highlighted": "_highlighted", "class.mat-mdc-menu-item-submenu-trigger": "_triggersSubmenu", "attr.tabindex": "_getTabIndex()", "attr.aria-disabled": "disabled", "attr.disabled": "disabled || null" }, classAttribute: "mat-mdc-menu-item mat-focus-indicator" }, exportAs: ["matMenuItem"], ngImport: i0, template: "<ng-content select=\"mat-icon, [matMenuItemIcon]\"></ng-content>\n<span class=\"mat-mdc-menu-item-text\"><ng-content></ng-content></span>\n<div class=\"mat-mdc-menu-ripple\" matRipple\n [matRippleDisabled]=\"disableRipple || disabled\"\n [matRippleTrigger]=\"_getHostElement()\">\n</div>\n\n@if (_triggersSubmenu) {\n <svg\n class=\"mat-mdc-menu-submenu-icon\"\n viewBox=\"0 0 5 10\"\n focusable=\"false\"\n aria-hidden=\"true\"><polygon points=\"0,0 5,5 0,10\"/></svg>\n}\n", dependencies: [{ kind: "directive", type: MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
123
123
|
}
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: MatMenuItem, decorators: [{
|
|
125
125
|
type: Component,
|
|
126
126
|
args: [{ selector: '[mat-menu-item]', exportAs: 'matMenuItem', host: {
|
|
127
127
|
'[attr.role]': 'role',
|
|
@@ -230,10 +230,10 @@ class MatMenuContent {
|
|
|
230
230
|
this.detach();
|
|
231
231
|
this._outlet?.dispose();
|
|
232
232
|
}
|
|
233
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
234
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-
|
|
233
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: MatMenuContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
234
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-rc.0", type: MatMenuContent, isStandalone: true, selector: "ng-template[matMenuContent]", providers: [{ provide: MAT_MENU_CONTENT, useExisting: MatMenuContent }], ngImport: i0 });
|
|
235
235
|
}
|
|
236
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
236
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: MatMenuContent, decorators: [{
|
|
237
237
|
type: Directive,
|
|
238
238
|
args: [{
|
|
239
239
|
selector: 'ng-template[matMenuContent]',
|
|
@@ -606,10 +606,10 @@ class MatMenu {
|
|
|
606
606
|
}
|
|
607
607
|
return menuPanel;
|
|
608
608
|
}
|
|
609
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
610
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.1.0-
|
|
609
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: MatMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
610
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.1.0-rc.0", type: MatMenu, isStandalone: true, selector: "mat-menu", inputs: { backdropClass: "backdropClass", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"], ariaDescribedby: ["aria-describedby", "ariaDescribedby"], xPosition: "xPosition", yPosition: "yPosition", overlapTrigger: ["overlapTrigger", "overlapTrigger", booleanAttribute], hasBackdrop: ["hasBackdrop", "hasBackdrop", (value) => (value == null ? null : booleanAttribute(value))], panelClass: ["class", "panelClass"], classList: "classList" }, outputs: { closed: "closed", close: "close" }, host: { properties: { "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null" } }, providers: [{ provide: MAT_MENU_PANEL, useExisting: MatMenu }], queries: [{ propertyName: "lazyContent", first: true, predicate: MAT_MENU_CONTENT, descendants: true }, { propertyName: "_allItems", predicate: MatMenuItem, descendants: true }, { propertyName: "items", predicate: MatMenuItem }], viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], exportAs: ["matMenu"], ngImport: i0, template: "<ng-template>\n <div\n class=\"mat-mdc-menu-panel\"\n [id]=\"panelId\"\n [class]=\"_classList\"\n [class.mat-menu-panel-animations-disabled]=\"_animationsDisabled\"\n [class.mat-menu-panel-exit-animation]=\"_panelAnimationState === 'void'\"\n [class.mat-menu-panel-animating]=\"_isAnimating\"\n (click)=\"closed.emit('click')\"\n tabindex=\"-1\"\n role=\"menu\"\n (animationstart)=\"_onAnimationStart($event.animationName)\"\n (animationend)=\"_onAnimationDone($event.animationName)\"\n (animationcancel)=\"_onAnimationDone($event.animationName)\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n [attr.aria-describedby]=\"ariaDescribedby || null\">\n <div class=\"mat-mdc-menu-content\">\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>\n", styles: ["mat-menu{display:none}.mat-mdc-menu-content{margin:0;padding:8px 0;outline:0}.mat-mdc-menu-content,.mat-mdc-menu-content .mat-mdc-menu-item .mat-mdc-menu-item-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;flex:1;white-space:normal;font-family:var(--mat-menu-item-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-menu-item-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-menu-item-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-menu-item-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-menu-item-label-text-weight, var(--mat-sys-label-large-weight))}@keyframes _mat-menu-enter{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:none}}@keyframes _mat-menu-exit{from{opacity:1}to{opacity:0}}.mat-mdc-menu-panel{min-width:112px;max-width:280px;overflow:auto;box-sizing:border-box;outline:0;animation:_mat-menu-enter 120ms cubic-bezier(0, 0, 0.2, 1);border-radius:var(--mat-menu-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-menu-container-color, var(--mat-sys-surface-container));box-shadow:var(--mat-menu-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));will-change:transform,opacity}.mat-mdc-menu-panel.mat-menu-panel-exit-animation{animation:_mat-menu-exit 100ms 25ms linear forwards}.mat-mdc-menu-panel.mat-menu-panel-animations-disabled{animation:none}.mat-mdc-menu-panel.mat-menu-panel-animating{pointer-events:none}.mat-mdc-menu-panel.mat-menu-panel-animating:has(.mat-mdc-menu-content:empty){display:none}@media(forced-colors: active){.mat-mdc-menu-panel{outline:solid 1px}}.mat-mdc-menu-panel .mat-divider{color:var(--mat-menu-divider-color, var(--mat-sys-surface-variant));margin-bottom:var(--mat-menu-divider-bottom-spacing, 8px);margin-top:var(--mat-menu-divider-top-spacing, 8px)}.mat-mdc-menu-item{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;cursor:pointer;width:100%;text-align:left;box-sizing:border-box;color:inherit;font-size:inherit;background:none;text-decoration:none;margin:0;min-height:48px;padding-left:var(--mat-menu-item-leading-spacing, 12px);padding-right:var(--mat-menu-item-trailing-spacing, 12px);-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-menu-item::-moz-focus-inner{border:0}[dir=rtl] .mat-mdc-menu-item{padding-left:var(--mat-menu-item-trailing-spacing, 12px);padding-right:var(--mat-menu-item-leading-spacing, 12px)}.mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-leading-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-trailing-spacing, 12px)}[dir=rtl] .mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-trailing-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-leading-spacing, 12px)}.mat-mdc-menu-item,.mat-mdc-menu-item:visited,.mat-mdc-menu-item:link{color:var(--mat-menu-item-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-menu-item .mat-icon-no-color,.mat-mdc-menu-item .mat-mdc-menu-submenu-icon{color:var(--mat-menu-item-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-menu-item[disabled]{cursor:default;opacity:.38}.mat-mdc-menu-item[disabled]::after{display:block;position:absolute;content:\"\";top:0;left:0;bottom:0;right:0}.mat-mdc-menu-item:focus{outline:0}.mat-mdc-menu-item .mat-icon{flex-shrink:0;margin-right:var(--mat-menu-item-spacing, 12px);height:var(--mat-menu-item-icon-size, 24px);width:var(--mat-menu-item-icon-size, 24px)}[dir=rtl] .mat-mdc-menu-item{text-align:right}[dir=rtl] .mat-mdc-menu-item .mat-icon{margin-right:0;margin-left:var(--mat-menu-item-spacing, 12px)}.mat-mdc-menu-item:not([disabled]):hover{background-color:var(--mat-menu-item-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-menu-item:not([disabled]).cdk-program-focused,.mat-mdc-menu-item:not([disabled]).cdk-keyboard-focused,.mat-mdc-menu-item:not([disabled]).mat-mdc-menu-item-highlighted{background-color:var(--mat-menu-item-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}@media(forced-colors: active){.mat-mdc-menu-item{margin-top:1px}}.mat-mdc-menu-submenu-icon{width:var(--mat-menu-item-icon-size, 24px);height:10px;fill:currentColor;padding-left:var(--mat-menu-item-spacing, 12px)}[dir=rtl] .mat-mdc-menu-submenu-icon{padding-right:var(--mat-menu-item-spacing, 12px);padding-left:0}[dir=rtl] .mat-mdc-menu-submenu-icon polygon{transform:scaleX(-1);transform-origin:center}@media(forced-colors: active){.mat-mdc-menu-submenu-icon{fill:CanvasText}}.mat-mdc-menu-item .mat-mdc-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
611
611
|
}
|
|
612
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
612
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: MatMenu, decorators: [{
|
|
613
613
|
type: Component,
|
|
614
614
|
args: [{ selector: 'mat-menu', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'matMenu', host: {
|
|
615
615
|
'[attr.aria-label]': 'null',
|
|
@@ -679,7 +679,7 @@ const MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER = {
|
|
|
679
679
|
useFactory: MAT_MENU_SCROLL_STRATEGY_FACTORY,
|
|
680
680
|
};
|
|
681
681
|
/** Options for binding a passive event listener. */
|
|
682
|
-
const passiveEventListenerOptions = { passive: true };
|
|
682
|
+
const passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: true });
|
|
683
683
|
/**
|
|
684
684
|
* Default top padding of the menu panel.
|
|
685
685
|
* @deprecated No longer being used. Will be removed.
|
|
@@ -699,7 +699,6 @@ class MatMenuTrigger {
|
|
|
699
699
|
_ngZone = inject(NgZone);
|
|
700
700
|
_scrollStrategy = inject(MAT_MENU_SCROLL_STRATEGY);
|
|
701
701
|
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
702
|
-
_cleanupTouchstart;
|
|
703
702
|
_portal;
|
|
704
703
|
_overlayRef = null;
|
|
705
704
|
_menuOpen = false;
|
|
@@ -717,6 +716,15 @@ class MatMenuTrigger {
|
|
|
717
716
|
* Used to offset sub-menus to compensate for the padding.
|
|
718
717
|
*/
|
|
719
718
|
_parentInnerPadding;
|
|
719
|
+
/**
|
|
720
|
+
* Handles touch start events on the trigger.
|
|
721
|
+
* Needs to be an arrow function so we can easily use addEventListener and removeEventListener.
|
|
722
|
+
*/
|
|
723
|
+
_handleTouchStart = (event) => {
|
|
724
|
+
if (!isFakeTouchstartFromScreenReader(event)) {
|
|
725
|
+
this._openedBy = 'touch';
|
|
726
|
+
}
|
|
727
|
+
};
|
|
720
728
|
// Tracking input type is necessary so it's possible to only auto-focus
|
|
721
729
|
// the first item of the list when the menu is opened via the keyboard
|
|
722
730
|
_openedBy = undefined;
|
|
@@ -783,13 +791,8 @@ class MatMenuTrigger {
|
|
|
783
791
|
onMenuClose = this.menuClosed;
|
|
784
792
|
constructor() {
|
|
785
793
|
const parentMenu = inject(MAT_MENU_PANEL, { optional: true });
|
|
786
|
-
const renderer = inject(Renderer2);
|
|
787
794
|
this._parentMaterialMenu = parentMenu instanceof MatMenu ? parentMenu : undefined;
|
|
788
|
-
this.
|
|
789
|
-
if (!isFakeTouchstartFromScreenReader(event)) {
|
|
790
|
-
this._openedBy = 'touch';
|
|
791
|
-
}
|
|
792
|
-
}, passiveEventListenerOptions);
|
|
795
|
+
this._element.nativeElement.addEventListener('touchstart', this._handleTouchStart, passiveEventListenerOptions);
|
|
793
796
|
}
|
|
794
797
|
ngAfterContentInit() {
|
|
795
798
|
this._handleHover();
|
|
@@ -798,7 +801,7 @@ class MatMenuTrigger {
|
|
|
798
801
|
if (this.menu && this._ownsMenu(this.menu)) {
|
|
799
802
|
PANELS_TO_TRIGGERS.delete(this.menu);
|
|
800
803
|
}
|
|
801
|
-
this.
|
|
804
|
+
this._element.nativeElement.removeEventListener('touchstart', this._handleTouchStart, passiveEventListenerOptions);
|
|
802
805
|
this._pendingRemoval?.unsubscribe();
|
|
803
806
|
this._menuCloseSubscription.unsubscribe();
|
|
804
807
|
this._closingActionsSubscription.unsubscribe();
|
|
@@ -899,11 +902,15 @@ class MatMenuTrigger {
|
|
|
899
902
|
// Note that we don't wait for the animation to finish if another trigger took
|
|
900
903
|
// over the menu, because the panel will end up empty which looks glitchy.
|
|
901
904
|
if (menu instanceof MatMenu && this._ownsMenu(menu)) {
|
|
902
|
-
this._pendingRemoval = menu._animationDone.pipe(take(1)).subscribe(() =>
|
|
905
|
+
this._pendingRemoval = menu._animationDone.pipe(take(1)).subscribe(() => {
|
|
906
|
+
overlayRef.detach();
|
|
907
|
+
menu.lazyContent?.detach();
|
|
908
|
+
});
|
|
903
909
|
menu._setIsOpen(false);
|
|
904
910
|
}
|
|
905
911
|
else {
|
|
906
912
|
overlayRef.detach();
|
|
913
|
+
menu?.lazyContent?.detach();
|
|
907
914
|
}
|
|
908
915
|
if (menu && this._ownsMenu(menu)) {
|
|
909
916
|
PANELS_TO_TRIGGERS.delete(menu);
|
|
@@ -1108,10 +1115,10 @@ class MatMenuTrigger {
|
|
|
1108
1115
|
_ownsMenu(menu) {
|
|
1109
1116
|
return PANELS_TO_TRIGGERS.get(menu) === this;
|
|
1110
1117
|
}
|
|
1111
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
1112
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-
|
|
1118
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: MatMenuTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1119
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-rc.0", type: MatMenuTrigger, isStandalone: true, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: { _deprecatedMatMenuTriggerFor: ["mat-menu-trigger-for", "_deprecatedMatMenuTriggerFor"], menu: ["matMenuTriggerFor", "menu"], menuData: ["matMenuTriggerData", "menuData"], restoreFocus: ["matMenuTriggerRestoreFocus", "restoreFocus"] }, outputs: { menuOpened: "menuOpened", onMenuOpen: "onMenuOpen", menuClosed: "menuClosed", onMenuClose: "onMenuClose" }, host: { listeners: { "click": "_handleClick($event)", "mousedown": "_handleMousedown($event)", "keydown": "_handleKeydown($event)" }, properties: { "attr.aria-haspopup": "menu ? \"menu\" : null", "attr.aria-expanded": "menuOpen", "attr.aria-controls": "menuOpen ? menu.panelId : null" }, classAttribute: "mat-mdc-menu-trigger" }, exportAs: ["matMenuTrigger"], ngImport: i0 });
|
|
1113
1120
|
}
|
|
1114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
1121
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: MatMenuTrigger, decorators: [{
|
|
1115
1122
|
type: Directive,
|
|
1116
1123
|
args: [{
|
|
1117
1124
|
selector: `[mat-menu-trigger-for], [matMenuTriggerFor]`,
|
|
@@ -1149,8 +1156,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-next.3",
|
|
|
1149
1156
|
}] } });
|
|
1150
1157
|
|
|
1151
1158
|
class MatMenuModule {
|
|
1152
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
1153
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0-
|
|
1159
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: MatMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1160
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0-rc.0", ngImport: i0, type: MatMenuModule, imports: [MatRippleModule,
|
|
1154
1161
|
MatCommonModule,
|
|
1155
1162
|
OverlayModule,
|
|
1156
1163
|
MatMenu,
|
|
@@ -1162,12 +1169,12 @@ class MatMenuModule {
|
|
|
1162
1169
|
MatMenuItem,
|
|
1163
1170
|
MatMenuContent,
|
|
1164
1171
|
MatMenuTrigger] });
|
|
1165
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0-
|
|
1172
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: MatMenuModule, providers: [MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [MatRippleModule,
|
|
1166
1173
|
MatCommonModule,
|
|
1167
1174
|
OverlayModule, CdkScrollableModule,
|
|
1168
1175
|
MatCommonModule] });
|
|
1169
1176
|
}
|
|
1170
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
1177
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: MatMenuModule, decorators: [{
|
|
1171
1178
|
type: NgModule,
|
|
1172
1179
|
args: [{
|
|
1173
1180
|
imports: [
|