import { Component , Input , ViewEncapsulation , HostListener , ViewChild } from '@angular/core' ; import { ContentActionRef } from '@alfresco/adf-extensions' ; import { MatMenuTrigger } from '@angular/material/menu' ; import { ThemePalette } from '@angular/material/core' ; @ Component ( { selector : 'app-toolbar-menu' , templateUrl : './toolbar-menu.component.html' , encapsulation : ViewEncapsulation . None , host : { class : 'app-toolbar-menu' } } ) export class ToolbarMenuComponent { @ Input ( ) actionRef : ContentActionRef ; @ Input ( ) color : ThemePalette ; @ ViewChild ( 'matTrigger' ) matTrigger : MatMenuTrigger ; @ HostListener ( 'document:keydown.Escape' ) handleKeydownEscape ( ) { this . matTrigger . closeMenu ( ) ; } trackByActionId ( _ , obj ) { return obj . id ; } }