blob: 9a284e86a58971059682c23bd14e674d52bc50e7 [file] [log] [blame]
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/material/icon"),require("@angular/core"),require("@covalent/core/common")):"function"==typeof define&&define.amd?define("@covalent/core/message",["exports","@angular/common","@angular/material/icon","@angular/core","@covalent/core/common"],t):t((e.covalent=e.covalent||{},e.covalent.core=e.covalent.core||{},e.covalent.core.message={}),e.ng.common,e.ng.material.icon,e.ng.core,e.covalent.core.common)}(this,function(e,t,n,i,o){"use strict";var a=(r.decorators=[{type:i.Directive,args:[{selector:"[tdMessageContainer]"}]}],r.ctorParameters=function(){return[{type:i.ViewContainerRef}]},r);function r(e){this.viewContainer=e}var s=(Object.defineProperty(l.prototype,"collapsedAnimation",{get:function(){return{value:!this._opened,duration:100}},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"hidden",{get:function(){return this._hidden?"none":undefined},enumerable:!0,configurable:!0}),Object.defineProperty(l.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:!0,configurable:!0}),Object.defineProperty(l.prototype,"opened",{get:function(){return this._opened},set:function(e){this._initialized?e?this.open():this.close():this._opened=e},enumerable:!0,configurable:!0}),l.prototype.animationDoneListener=function(){this._opened||(this._hidden=!0,this._detach()),this._animating=!1,this._changeDetectorRef.markForCheck()},l.prototype.ngAfterViewInit=function(){var e=this;Promise.resolve(undefined).then(function(){e._opened&&e._attach(),e._initialized=!0})},l.prototype.open=function(){this._opened||this._animating||(this._opened=!0,this._attach(),this._startAnimationState())},l.prototype.close=function(){this._opened&&!this._animating&&(this._opened=!1,this._startAnimationState())},l.prototype.toggle=function(){this._opened?this.close():this.open()},l.prototype._startAnimationState=function(){this._animating=!0,this._hidden=!1,this._changeDetectorRef.markForCheck()},l.prototype._attach=function(){this._childElement.viewContainer.createEmbeddedView(this._template),this._changeDetectorRef.markForCheck()},l.prototype._detach=function(){this._childElement.viewContainer.clear(),this._changeDetectorRef.markForCheck()},l.decorators=[{type:i.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>',animations:[o.tdCollapseAnimation],styles:[":host{display:block}:host .td-message-wrapper{padding:8px 16px;min-height:52px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:center;align-content:center;max-width:100%;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}:host .td-message-wrapper .td-message-labels{-webkit-box-flex:1;-ms-flex:1;flex:1}.td-message-icon{margin-right:16px}::ng-deep [dir=rtl] .td-message-icon{margin-left:16px;margin-right:0}"]}]}],l.ctorParameters=function(){return[{type:i.Renderer2},{type:i.ChangeDetectorRef},{type:i.ElementRef}]},l.propDecorators={_childElement:[{type:i.ViewChild,args:[a]}],_template:[{type:i.ViewChild,args:[i.TemplateRef]}],collapsedAnimation:[{type:i.HostBinding,args:["@tdCollapse"]}],hidden:[{type:i.HostBinding,args:["style.display"]}],label:[{type:i.Input,args:["label"]}],sublabel:[{type:i.Input,args:["sublabel"]}],icon:[{type:i.Input,args:["icon"]}],color:[{type:i.Input,args:["color"]}],opened:[{type:i.Input,args:["opened"]}],animationDoneListener:[{type:i.HostListener,args:["@tdCollapse.done"]}]},l);function l(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")}var c=[s,a],d=(p.decorators=[{type:i.NgModule,args:[{imports:[t.CommonModule,n.MatIconModule],declarations:[c],exports:[c]}]}],p);function p(){}e.CovalentMessageModule=d,e.TdMessageContainerDirective=a,e.TdMessageComponent=s,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=covalent-core-message.umd.min.js.map