| !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/material/icon"),require("@covalent/core/common")):"function"==typeof define&&define.amd?define("@covalent/core/message",["exports","@angular/core","@angular/common","@angular/material/icon","@covalent/core/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).covalent=e.covalent||{},e.covalent.core=e.covalent.core||{},e.covalent.core.message={}),e.ng.core,e.ng.common,e.ng.material.icon,e.covalent.core.common)}(this,(function(e,t,n,i,o){"use strict";var a=function(e){this.viewContainer=e};a.decorators=[{type:t.Directive,args:[{selector:"[tdMessageContainer]"}]}],a.ctorParameters=function(){return[{type:t.ViewContainerRef}]};var r=function(){function e(e,t,n){this._renderer=e,this._changeDetectorRef=t,this._elementRef=n,this._opened=!0,this._hidden=!1,this._animating=!1,this._initialized=!1,this.icon="info_outline",this._renderer.addClass(this._elementRef.nativeElement,"td-message")}return Object.defineProperty(e.prototype,"collapsedAnimation",{get:function(){return{value:!this._opened,duration:100}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return this._hidden?"none":void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(e){this._renderer.removeClass(this._elementRef.nativeElement,"mat-"+this._color),this._renderer.removeClass(this._elementRef.nativeElement,"bgc-"+this._color+"-100"),this._renderer.removeClass(this._elementRef.nativeElement,"tc-"+this._color+"-700"),"primary"===e||"accent"===e||"warn"===e?this._renderer.addClass(this._elementRef.nativeElement,"mat-"+e):(this._renderer.addClass(this._elementRef.nativeElement,"bgc-"+e+"-100"),this._renderer.addClass(this._elementRef.nativeElement,"tc-"+e+"-700")),this._color=e,this._changeDetectorRef.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"opened",{get:function(){return this._opened},set:function(e){this._initialized?e?this.open():this.close():this._opened=e},enumerable:!1,configurable:!0}),e.prototype.animationDoneListener=function(){this._opened||(this._hidden=!0,this._detach()),this._animating=!1,this._changeDetectorRef.markForCheck()},e.prototype.ngAfterViewInit=function(){var e=this;Promise.resolve(void 0).then((function(){e._opened&&e._attach(),e._initialized=!0}))},e.prototype.open=function(){this._opened||this._animating||(this._opened=!0,this._attach(),this._startAnimationState())},e.prototype.close=function(){this._opened&&!this._animating&&(this._opened=!1,this._startAnimationState())},e.prototype.toggle=function(){this._opened?this.close():this.open()},e.prototype._startAnimationState=function(){this._animating=!0,this._hidden=!1,this._changeDetectorRef.markForCheck()},e.prototype._attach=function(){this._childElement.viewContainer.createEmbeddedView(this._template),this._changeDetectorRef.markForCheck()},e.prototype._detach=function(){this._childElement.viewContainer.clear(),this._changeDetectorRef.markForCheck()},e}();r.decorators=[{type:t.Component,args:[{selector:"td-message",template:'<div tdMessageContainer></div>\n<ng-template>\n <div class="td-message-wrapper">\n <mat-icon class="td-message-icon">{{ icon }}</mat-icon>\n <div class="td-message-labels">\n <div *ngIf="label" class="td-message-label">{{ label }}</div>\n <div *ngIf="sublabel" class="td-message-sublabel">{{ sublabel }}</div>\n </div>\n <ng-content select="[td-message-actions]"></ng-content>\n </div>\n</ng-template>\n',animations:[o.tdCollapseAnimation],styles:[":host{display:block}:host .td-message-wrapper{-ms-flex-align:center;-ms-flex-direction:row;-ms-flex-line-pack:center;-ms-flex-pack:start;align-content:center;align-items:center;box-sizing:border-box;display:-ms-flexbox;display:flex;flex-direction:row;justify-content:flex-start;max-width:100%;min-height:52px;padding:8px 16px}:host .td-message-wrapper .td-message-labels{-ms-flex:1;flex:1}.td-message-icon{margin-right:16px}::ng-deep [dir=rtl] .td-message-icon{margin-left:16px;margin-right:0}"]}]}],r.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ChangeDetectorRef},{type:t.ElementRef}]},r.propDecorators={_childElement:[{type:t.ViewChild,args:[a,{static:!0}]}],_template:[{type:t.ViewChild,args:[t.TemplateRef]}],collapsedAnimation:[{type:t.HostBinding,args:["@tdCollapse"]}],hidden:[{type:t.HostBinding,args:["style.display"]}],label:[{type:t.Input}],sublabel:[{type:t.Input}],icon:[{type:t.Input}],color:[{type:t.Input,args:["color"]}],opened:[{type:t.Input,args:["opened"]}],animationDoneListener:[{type:t.HostListener,args:["@tdCollapse.done"]}]};var s=[r,a],l=function(){};l.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.MatIconModule],declarations:[s],exports:[s]}]}],e.CovalentMessageModule=l,e.TdMessageComponent=r,e.TdMessageContainerDirective=a,Object.defineProperty(e,"__esModule",{value:!0})})); |