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