UNPKG

4.03 kBJavaScriptView Raw
1!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("ngx-bootstrap/utils"),require("@angular/common")):"function"==typeof define&&define.amd?define("ngx-bootstrap/alert",["exports","@angular/core","ngx-bootstrap/utils","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["ngx-bootstrap"]=e["ngx-bootstrap"]||{},e["ngx-bootstrap"].alert={}),e.ng.core,e.utils,e.ng.common)}(this,(function(e,t,n,o){"use strict";
2/*! *****************************************************************************
3 Copyright (c) Microsoft Corporation.
4
5 Permission to use, copy, modify, and/or distribute this software for any
6 purpose with or without fee is hereby granted.
7
8 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 PERFORMANCE OF THIS SOFTWARE.
15 ***************************************************************************** */Object.create;Object.create;var s=function(){this.type="warning",this.dismissible=!1,this.dismissOnTimeout=void 0};s.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new s},token:s,providedIn:"root"}),s.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];var i=function(){function e(e,n){var o=this;this.changeDetection=n,this.type="warning",this.dismissible=!1,this.isOpen=!0,this.onClose=new t.EventEmitter,this.onClosed=new t.EventEmitter,this.classes="",this.dismissibleChange=new t.EventEmitter,Object.assign(this,e),this.dismissibleChange.subscribe((function(){o.classes=o.dismissible?"alert-dismissible":"",o.changeDetection.markForCheck()}))}return e.prototype.ngOnInit=function(){var e=this;this.dismissOnTimeout&&setTimeout((function(){return e.close()}),parseInt(this.dismissOnTimeout,10))},e.prototype.close=function(){this.isOpen&&(this.onClose.emit(this),this.isOpen=!1,this.changeDetection.markForCheck(),this.onClosed.emit(this))},e}();i.decorators=[{type:t.Component,args:[{selector:"alert,bs-alert",template:'<ng-template [ngIf]="isOpen">\n <div [class]="\'alert alert-\' + type" role="alert" [ngClass]="classes">\n <ng-template [ngIf]="dismissible">\n <button type="button" class="close btn-close" aria-label="Close" (click)="close()">\n <span aria-hidden="true" class="visually-hidden">&times;</span>\n <span class="sr-only visually-hidden">Close</span>\n </button>\n </ng-template>\n <ng-content></ng-content>\n </div>\n</ng-template>\n',changeDetection:t.ChangeDetectionStrategy.OnPush}]}],i.ctorParameters=function(){return[{type:s},{type:t.ChangeDetectorRef}]},i.propDecorators={type:[{type:t.Input}],dismissible:[{type:t.Input}],dismissOnTimeout:[{type:t.Input}],isOpen:[{type:t.Input}],onClose:[{type:t.Output}],onClosed:[{type:t.Output}]},function(e,t,n,o){var s,i=arguments.length,r=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(i<3?s(r):i>3?s(t,n,r):s(t,n))||r);i>3&&r&&Object.defineProperty(t,n,r)}([n.OnChange(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:type",Object)],i.prototype,"dismissible",void 0);var r=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e}();r.decorators=[{type:t.NgModule,args:[{imports:[o.CommonModule],declarations:[i],exports:[i],entryComponents:[i]}]}],e.AlertComponent=i,e.AlertConfig=s,e.AlertModule=r,Object.defineProperty(e,"__esModule",{value:!0})}));
16//# sourceMappingURL=ngx-bootstrap-alert.umd.min.js.map
\No newline at end of file