import { Component , ViewEncapsulation , ChangeDetectionStrategy , Input , DoCheck , ChangeDetectorRef } from '@angular/core' ; import { ContentActionRef } from '@alfresco/adf-extensions' ; import { ToolbarButtonType } from '../toolbar-button/toolbar-button.component' ; import { ThemePalette } from '@angular/material/core' ; @ Component ( { selector : 'aca-toolbar-action' , templateUrl : './toolbar-action.component.html' , styleUrls : [ './toolbar-action.component.scss' ] , encapsulation : ViewEncapsulation . None , changeDetection : ChangeDetectionStrategy . OnPush , host : { class : 'aca-toolbar-action' } } ) export class ToolbarActionComponent implements DoCheck { @ Input ( ) type : ToolbarButtonType = ToolbarButtonType . ICON_BUTTON ; @ Input ( ) color : ThemePalette ; @ Input ( ) actionRef : ContentActionRef ; constructor ( private cd ) { } ngDoCheck ( ) { if ( this . actionRef . id . includes ( 'app.viewer' ) ) { this . cd . markForCheck ( ) ; } } }