Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(material-experimental/mdc-menu): ensure mat-mdc- prefix on all cl…
…asses (#23559) * fix(material-experimental/mdc-menu): ensure mat-mdc- prefix on all classes The MDC menu trigger had `.mat-menu-trigger` class because it was using the same directive as the non-MDC menu. This PR refactors the trigger and content directives to extend a common base class. * fixup! fix(material-experimental/mdc-menu): ensure mat-mdc- prefix on all classes * fixup! fix(material-experimental/mdc-menu): ensure mat-mdc- prefix on all classes * fixup! fix(material-experimental/mdc-menu): ensure mat-mdc- prefix on all classes (cherry picked from commit 771afd9)
- Loading branch information
1 parent
13b24ab
commit e54229f
Showing
9 changed files
with
128 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import {Directive} from '@angular/core'; | ||
import {_MatMenuContentBase, _MatMenuTriggerBase, MAT_MENU_CONTENT} from '@angular/material/menu'; | ||
|
||
/** Directive applied to an element that should trigger a `mat-menu`. */ | ||
@Directive({ | ||
selector: `[mat-menu-trigger-for], [matMenuTriggerFor]`, | ||
host: { | ||
'class': 'mat-mdc-menu-trigger', | ||
}, | ||
exportAs: 'matMenuTrigger' | ||
}) | ||
export class MatMenuTrigger extends _MatMenuTriggerBase {} | ||
|
||
/** Menu content that will be rendered lazily once the menu is opened. */ | ||
@Directive({ | ||
selector: 'ng-template[matMenuContent]', | ||
providers: [{provide: MAT_MENU_CONTENT, useExisting: MatMenuContent}], | ||
}) | ||
export class MatMenuContent extends _MatMenuContentBase {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters