UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

16 lines (14 loc) 6.34 kB
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("ng-zorro-antd/core/animation"),require("ng-zorro-antd/core/config"),require("ng-zorro-antd/core/util"),require("rxjs"),require("rxjs/operators"),require("@angular/common"),require("ng-zorro-antd/core/outlet"),require("ng-zorro-antd/icon")):"function"==typeof define&&define.amd?define("ng-zorro-antd/alert",["exports","@angular/core","ng-zorro-antd/core/animation","ng-zorro-antd/core/config","ng-zorro-antd/core/util","rxjs","rxjs/operators","@angular/common","ng-zorro-antd/core/outlet","ng-zorro-antd/icon"],e):e(((n=n||self)["ng-zorro-antd"]=n["ng-zorro-antd"]||{},n["ng-zorro-antd"].alert={}),n.ng.core,n["ng-zorro-antd"].core.animation,n["ng-zorro-antd"].core.config,n["ng-zorro-antd"].core.util,n.rxjs,n.rxjs.operators,n.ng.common,n["ng-zorro-antd"].core.outlet,n["ng-zorro-antd"].icon)}(this,(function(n,e,t,o,r,i,a,s,c,l){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */function p(n,e,t,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(n,e,t,o);else for(var s=n.length-1;s>=0;s--)(r=n[s])&&(a=(i<3?r(a):i>3?r(e,t,a):r(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function u(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}var z=function(){function n(n,t){var o=this;this.nzConfigService=n,this.cdr=t,this.nzCloseText=null,this.nzIconType=null,this.nzMessage=null,this.nzDescription=null,this.nzType="info",this.nzBanner=!1,this.nzOnClose=new e.EventEmitter,this.closed=!1,this.iconTheme="fill",this.inferredIconType="info-circle",this.isTypeSet=!1,this.isShowIconSet=!1,this.destroy$=new i.Subject,this.nzConfigService.getConfigChangeEventForComponent("alert").pipe(a.takeUntil(this.destroy$)).subscribe((function(){o.cdr.markForCheck()}))}return n.prototype.closeAlert=function(){this.closed=!0},n.prototype.onFadeAnimationDone=function(){this.closed&&this.nzOnClose.emit(!0)},n.prototype.ngOnChanges=function(n){var e=n.nzShowIcon,t=n.nzDescription,o=n.nzType,r=n.nzBanner;if(e&&(this.isShowIconSet=!0),o)switch(this.isTypeSet=!0,this.nzType){case"error":this.inferredIconType="close-circle";break;case"success":this.inferredIconType="check-circle";break;case"info":this.inferredIconType="info-circle";break;case"warning":this.inferredIconType="exclamation-circle"}t&&(this.iconTheme=this.nzDescription?"outline":"fill"),r&&(this.isTypeSet||(this.nzType="warning"),this.isShowIconSet||(this.nzShowIcon=!0))},n.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},n.decorators=[{type:e.Component,args:[{selector:"nz-alert",exportAs:"nzAlert",animations:[t.slideAlertMotion],template:'\n <div\n *ngIf="!closed"\n class="ant-alert"\n [class.ant-alert-success]="nzType === \'success\'"\n [class.ant-alert-info]="nzType === \'info\'"\n [class.ant-alert-warning]="nzType === \'warning\'"\n [class.ant-alert-error]="nzType === \'error\'"\n [class.ant-alert-no-icon]="!nzShowIcon"\n [class.ant-alert-banner]="nzBanner"\n [class.ant-alert-closable]="nzCloseable"\n [class.ant-alert-with-description]="!!nzDescription"\n [@slideAlertMotion]\n (@slideAlertMotion.done)="onFadeAnimationDone()"\n >\n <ng-container *ngIf="nzShowIcon">\n <i nz-icon class="ant-alert-icon" [nzType]="nzIconType || inferredIconType" [nzTheme]="iconTheme"></i>\n </ng-container>\n <span class="ant-alert-message" *ngIf="nzMessage">\n <ng-container *nzStringTemplateOutlet="nzMessage">{{ nzMessage }}</ng-container>\n </span>\n <span class="ant-alert-description" *ngIf="nzDescription">\n <ng-container *nzStringTemplateOutlet="nzDescription">{{ nzDescription }}</ng-container>\n </span>\n <button type="button" tabindex="0" *ngIf="nzCloseable || nzCloseText" class="ant-alert-close-icon" (click)="closeAlert()">\n <ng-template #closeDefaultTemplate>\n <i nz-icon nzType="close"></i>\n </ng-template>\n <ng-container *ngIf="nzCloseText; else closeDefaultTemplate">\n <ng-container *nzStringTemplateOutlet="nzCloseText">\n <span class="ant-alert-close-text">{{ nzCloseText }}</span>\n </ng-container>\n </ng-container>\n </button>\n </div>\n ',changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,preserveWhitespaces:!1}]}],n.ctorParameters=function(){return[{type:o.NzConfigService},{type:e.ChangeDetectorRef}]},n.propDecorators={nzCloseText:[{type:e.Input}],nzIconType:[{type:e.Input}],nzMessage:[{type:e.Input}],nzDescription:[{type:e.Input}],nzType:[{type:e.Input}],nzCloseable:[{type:e.Input}],nzShowIcon:[{type:e.Input}],nzBanner:[{type:e.Input}],nzOnClose:[{type:e.Output}]},p([o.WithConfig("alert",!1),r.InputBoolean(),u("design:type",Boolean)],n.prototype,"nzCloseable",void 0),p([o.WithConfig("alert",!1),r.InputBoolean(),u("design:type",Boolean)],n.prototype,"nzShowIcon",void 0),p([r.InputBoolean(),u("design:type",Object)],n.prototype,"nzBanner",void 0),n}();var g=function(){function n(){}return n.decorators=[{type:e.NgModule,args:[{declarations:[z],exports:[z],imports:[s.CommonModule,l.NzIconModule,c.NzOutletModule]}]}],n}();n.NzAlertComponent=z,n.NzAlertModule=g,Object.defineProperty(n,"__esModule",{value:!0})})); //# sourceMappingURL=ng-zorro-antd-alert.umd.min.js.map