blob: 4c511789bd5e3f34124e1fca83f8096aa4a81ffe [file] [log] [blame]
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@angular/common"),require("@angular/core")):"function"==typeof define&&define.amd?define("@covalent/core/notifications",["exports","@angular/common","@angular/core"],o):o((t.covalent=t.covalent||{},t.covalent.core=t.covalent.core||{},t.covalent.core.notifications={}),t.ng.common,t.ng.core)}(this,function(t,o,i){"use strict";var n={Top:"top",Bottom:"bottom",Center:"center"},e={Before:"before",After:"after",Center:"center"},c=(Object.defineProperty(a.prototype,"positionX",{get:function(){return this._positionX},set:function(t){this._positionX=t},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"positionY",{get:function(){return this._positionY},set:function(t){this._positionY=t},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"notifications",{set:function(t){this._notifications=t},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"limit",{set:function(t){this._limit=t},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"hideHost",{get:function(){return!this.show&&!this._hasContent()},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"noCount",{get:function(){return!0===this._notifications},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"notificationsDisplay",{get:function(){return this._notifications>this._limit?this._limit+"+":this._notifications.toString()},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"show",{get:function(){return!0===this._notifications||!isNaN(this._notifications)&&0<this._notifications},enumerable:!0,configurable:!0}),a.prototype.ngAfterContentInit=function(){this._positionX||(this.positionX=this._hasContent()?e.After:e.Center),this._positionY||(this.positionY=this._hasContent()?n.Top:n.Center)},a.prototype._hasContent=function(){if(this.content){var t=this.content.nativeElement;return t&&(0<t.children.length||!!t.textContent.trim())}return!1},a.decorators=[{type:i.Component,args:[{selector:"td-notification-count",template:'<div #content class="td-notification-content">\n <ng-content></ng-content>\n</div>\n<div *ngIf="show"\n class="td-notification-count mat-{{color}}"\n [class.td-notification-top]="positionY === \'top\'"\n [class.td-notification-bottom]="positionY === \'bottom\'"\n [class.td-notification-before]="positionX === \'before\'"\n [class.td-notification-after]="positionX === \'after\'"\n [class.td-notification-center-y]="positionY === \'center\'"\n [class.td-notification-center-x]="positionX === \'center\'"\n [class.td-notification-no-count]="noCount">\n {{noCount ? \'\' : notificationsDisplay}}\n</div>',changeDetection:i.ChangeDetectionStrategy.OnPush,styles:[":host{position:relative;display:block;text-align:center;min-width:40px;height:40px}:host.td-notification-hidden{min-width:0}.td-notification-count{line-height:21px;width:20px;height:20px;position:absolute;font-size:10px;font-weight:600;border-radius:50%;z-index:1}.td-notification-count.td-notification-center-x{margin-left:auto;margin-right:auto;left:0;right:0}.td-notification-count.td-notification-center-y{margin-top:auto;margin-bottom:auto;top:0;bottom:0}.td-notification-count.td-notification-top{top:0}.td-notification-count.td-notification-bottom{bottom:0}.td-notification-count.td-notification-before{left:0}.td-notification-count.td-notification-after{right:0}.td-notification-count.td-notification-no-count{width:8px;height:8px}.td-notification-count.td-notification-no-count.td-notification-top{top:8px}.td-notification-count.td-notification-no-count.td-notification-bottom{bottom:8px}.td-notification-count.td-notification-no-count.td-notification-before{left:8px}.td-notification-count.td-notification-no-count.td-notification-after{right:8px}::ng-deep [dir=rtl] .td-notification-count.td-notification-before{right:0;left:auto}::ng-deep [dir=rtl] .td-notification-count.td-notification-after{left:0;right:auto}::ng-deep [dir=rtl] .td-notification-count.td-notification-no-count.td-notification-before{right:8px;left:auto}::ng-deep [dir=rtl] .td-notification-count.td-notification-no-count.td-notification-after{left:8px;right:auto}.td-notification-content,.td-notification-content ::ng-deep>*{line-height:40px}"]}]}],a.propDecorators={content:[{type:i.ViewChild,args:["content"]}],color:[{type:i.Input}],positionX:[{type:i.Input}],positionY:[{type:i.Input}],notifications:[{type:i.Input}],limit:[{type:i.Input}],hideHost:[{type:i.HostBinding,args:["class.td-notification-hidden"]}]},a);function a(){this._notifications=0,this._limit=99,this.color="warn"}var r=[c],f=(s.decorators=[{type:i.NgModule,args:[{imports:[o.CommonModule],declarations:[r],exports:[r]}]}],s);function s(){}t.CovalentNotificationsModule=f,t.TdNotificationCountPositionY=n,t.TdNotificationCountPositionX=e,t.DEFAULT_NOTIFICATION_LIMIT=99,t.TdNotificationCountComponent=c,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=covalent-core-notifications.umd.min.js.map