ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
2 lines • 4.58 kB
JavaScript
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("ng-zorro-antd/core"),require("@angular/common"),require("ng-zorro-antd/icon")):"function"==typeof define&&define.amd?define("ng-zorro-antd/alert",["exports","@angular/core","ng-zorro-antd/core","@angular/common","ng-zorro-antd/icon"],e):e((n["ng-zorro-antd"]=n["ng-zorro-antd"]||{},n["ng-zorro-antd"].alert={}),n.ng.core,n["ng-zorro-antd"].core,n.ng.common,n["ng-zorro-antd"].icon)}(this,function(n,e,t,o,i){"use strict";function a(n,e,t,o){var i,a=arguments.length,s=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(n,e,t,o);else for(var r=n.length-1;0<=r;r--)(i=n[r])&&(s=(a<3?i(s):3<a?i(e,t,s):i(e,t))||s);return 3<a&&s&&Object.defineProperty(e,t,s),s}function s(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}var r=function(){function n(){this.destroy=!1,this.iconType="info-circle",this.iconTheme="fill",this.isTypeSet=!1,this.isShowIconSet=!1,this.nzType="info",this.nzCloseable=!1,this.nzShowIcon=!1,this.nzBanner=!1,this.nzOnClose=new e.EventEmitter}return n.prototype.closeAlert=function(){this.destroy=!0},n.prototype.onFadeAnimationDone=function(){this.destroy&&this.nzOnClose.emit(!0)},n.prototype.updateIconClassMap=function(){switch(this.nzType){case"error":this.iconType="close-circle";break;case"success":this.iconType="check-circle";break;case"info":this.iconType="info-circle";break;case"warning":this.iconType="exclamation-circle"}this.iconTheme=this.nzDescription?"outline":"fill"},n.prototype.ngOnChanges=function(n){var e=n.nzShowIcon,t=n.nzDescription,o=n.nzType,i=n.nzBanner;e&&(this.isShowIconSet=!0),(t||o)&&this.updateIconClassMap(),o&&(this.isTypeSet=!0),i&&(this.isTypeSet||(this.nzType="warning"),this.isShowIconSet||(this.nzShowIcon=!0))},n.decorators=[{type:e.Component,args:[{selector:"nz-alert",exportAs:"nzAlert",animations:[t.slideAlertMotion],template:'<div *ngIf="!destroy"\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 <ng-container *ngIf="nzShowIcon">\n <i class="ant-alert-icon" [ngClass]="nzIconType" *ngIf="nzIconType; else iconTemplate"></i>\n <ng-template #iconTemplate>\n <i nz-icon class="ant-alert-icon" [type]="iconType" [theme]="iconTheme"></i>\n </ng-template>\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 <a *ngIf="nzCloseable || nzCloseText"\n class="ant-alert-close-icon"\n (click)="closeAlert()">\n <ng-template #closeDefaultTemplate>\n <i nz-icon type="close" class="anticon-close"></i>\n </ng-template>\n <ng-container *ngIf="nzCloseText; else closeDefaultTemplate">\n <ng-container *nzStringTemplateOutlet="nzCloseText">{{ nzCloseText }}</ng-container>\n </ng-container>\n </a>\n</div>',changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,preserveWhitespaces:!1,styles:["\n nz-alert {\n display: block;\n }\n "]}]}],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}]},a([t.InputBoolean(),s("design:type",Object)],n.prototype,"nzCloseable",void 0),a([t.InputBoolean(),s("design:type",Object)],n.prototype,"nzShowIcon",void 0),a([t.InputBoolean(),s("design:type",Object)],n.prototype,"nzBanner",void 0),n}(),c=function(){function n(){}return n.decorators=[{type:e.NgModule,args:[{declarations:[r],exports:[r],imports:[o.CommonModule,i.NzIconModule,t.NzAddOnModule]}]}],n}();n.NzAlertComponent=r,n.NzAlertModule=c,Object.defineProperty(n,"__esModule",{value:!0})});
//# sourceMappingURL=ng-zorro-antd-alert.umd.min.js.map