import { Attribute , ChangeDetectionStrategy , Component , Directive , ElementRef , ViewEncapsulation } from '@angular/core' ; import { mixinColor , CanColor , CanColorCtor , ThemePalette } from '@ptsecurity/mosaic/core' ; @ Directive ( { selector : '[mc-icon]' , host : { class : 'mc mc-icon' } } ) export class McIconCSSStyler { } export class McIconBase { constructor ( public _elementRef ) { } } export const McIconMixinBase = mixinColor ( McIconBase , ThemePalette . Empty ) ; @ Component ( { selector : `[mc-icon]` , template : '<ng-content></ng-content>' , styleUrls : [ 'icon.scss' ] , changeDetection : ChangeDetectionStrategy . OnPush , encapsulation : ViewEncapsulation . None , inputs : [ 'color' ] } ) export class McIcon extends McIconMixinBase implements CanColor { constructor ( elementRef , @ Attribute ( 'mc-icon' ) iconName ) { super ( elementRef ) ; if ( iconName ) { elementRef . nativeElement . classList . add ( iconName ) ; } } getHostElement ( ) { return this . _elementRef . nativeElement ; } }