UNPKG

ng-zorro-antd

Version:

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

2 lines 6.92 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("ng-zorro-antd/core"),require("@angular/common"),require("ng-zorro-antd/icon")):"function"==typeof define&&define.amd?define("ng-zorro-antd/steps",["exports","@angular/core","rxjs","rxjs/operators","ng-zorro-antd/core","@angular/common","ng-zorro-antd/icon"],e):e(((t=t||self)["ng-zorro-antd"]=t["ng-zorro-antd"]||{},t["ng-zorro-antd"].steps={}),t.ng.core,t.rxjs,t.rxjs.operators,t["ng-zorro-antd"].core,t.ng.common,t["ng-zorro-antd"].icon)}(this,function(t,e,n,s,o,i,r){"use strict";var a=function(){function t(t,e,n){this.cdr=t,this.isCustomStatus=!1,this._status="wait",this.oldAPIIcon=!0,this.isIconString=!0,this.direction="horizontal",this.index=0,this.last=!1,this.outStatus="process",this.showProcessDot=!1,this._currentIndex=0,e.addClass(n.nativeElement,"ant-steps-item")}return Object.defineProperty(t.prototype,"nzStatus",{get:function(){return this._status},set:function(t){this._status=t,this.isCustomStatus=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nzIcon",{get:function(){return this._icon},set:function(t){t instanceof e.TemplateRef?this.isIconString=!1:(this.isIconString=!0,this.oldAPIIcon="string"==typeof t&&t.indexOf("anticon")>-1),this._icon=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(t){this._currentIndex=t,this.isCustomStatus||(this._status=t>this.index?"finish":t===this.index?this.outStatus||"":"wait")},enumerable:!0,configurable:!0}),t.prototype.markForCheck=function(){this.cdr.markForCheck()},t.decorators=[{type:e.Component,args:[{changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,selector:"nz-step",exportAs:"nzStep",preserveWhitespaces:!1,template:'<div class="ant-steps-item-tail" *ngIf="last !== true"></div>\n<div class="ant-steps-item-icon">\n <ng-template [ngIf]="!showProcessDot">\n <span class="ant-steps-icon" *ngIf="nzStatus === \'finish\' && !nzIcon"><i nz-icon type="check"></i></span>\n <span class="ant-steps-icon" *ngIf="nzStatus === \'error\'"><i nz-icon type="close"></i></span>\n <span class="ant-steps-icon" *ngIf="(nzStatus === \'process\' || nzStatus === \'wait\') && !nzIcon">{{ index + 1 }}</span>\n <span class="ant-steps-icon" *ngIf="nzIcon">\n <ng-container *ngIf="isIconString; else iconTemplate">\n <i nz-icon [type]="!oldAPIIcon && nzIcon" [ngClass]="oldAPIIcon && nzIcon"></i>\n </ng-container>\n <ng-template #iconTemplate>\n <ng-template [ngTemplateOutlet]="nzIcon"></ng-template>\n </ng-template>\n </span>\n </ng-template>\n <ng-template [ngIf]="showProcessDot">\n <span class="ant-steps-icon">\n <ng-template #processDotTemplate>\n <span class="ant-steps-icon-dot"></span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]="customProcessTemplate||processDotTemplate"\n [ngTemplateOutletContext]="{ $implicit: processDotTemplate, status:nzStatus, index:index }">\n </ng-template>\n </span>\n </ng-template>\n</div>\n<div class="ant-steps-item-content">\n <div class="ant-steps-item-title">\n <ng-container *nzStringTemplateOutlet="nzTitle">{{ nzTitle }}</ng-container>\n </div>\n <div class="ant-steps-item-description">\n <ng-container *nzStringTemplateOutlet="nzDescription">{{ nzDescription }}</ng-container>\n </div>\n</div>\n',host:{"[class.ant-steps-item-wait]":'nzStatus === "wait"',"[class.ant-steps-item-process]":'nzStatus === "process"',"[class.ant-steps-item-finish]":'nzStatus === "finish"',"[class.ant-steps-item-error]":'nzStatus === "error"',"[class.ant-steps-custom]":"!!nzIcon","[class.ant-steps-next-error]":'(outStatus === "error") && (currentIndex === index + 1)'}}]}],t.ctorParameters=function(){return[{type:e.ChangeDetectorRef},{type:e.Renderer2},{type:e.ElementRef}]},t.propDecorators={processDotTemplate:[{type:e.ViewChild,args:["processDotTemplate",{"static":!1}]}],nzTitle:[{type:e.Input}],nzDescription:[{type:e.Input}],nzStatus:[{type:e.Input}],nzIcon:[{type:e.Input}]},t}(),p=function(){function t(){this.nzCurrent=0,this.nzDirection="horizontal",this.nzLabelPlacement="horizontal",this.nzSize="default",this.nzStartIndex=0,this.nzStatus="process",this.showProcessDot=!1,this.destroy$=new n.Subject}return Object.defineProperty(t.prototype,"nzProgressDot",{set:function(t){t instanceof e.TemplateRef?(this.showProcessDot=!0,this.customProcessDotTemplate=t):this.showProcessDot=o.toBoolean(t),this.updateChildrenSteps()},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){(t.nzStartIndex||t.nzDirection||t.nzStatus||t.nzCurrent)&&this.updateChildrenSteps(),(t.nzDirection||t.nzProgressDot||t.nzLabelPlacement||t.nzSize)&&this.setClassMap()},t.prototype.ngOnInit=function(){this.setClassMap(),this.updateChildrenSteps()},t.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},t.prototype.ngAfterContentInit=function(){var t=this;this.updateChildrenSteps(),this.steps&&this.steps.changes.pipe(s.takeUntil(this.destroy$)).subscribe(function(){t.updateChildrenSteps()})},t.prototype.updateChildrenSteps=function(){var t=this;if(this.steps){var e=this.steps.length;this.steps.toArray().forEach(function(n,s){Promise.resolve().then(function(){n.outStatus=t.nzStatus,n.showProcessDot=t.showProcessDot,t.customProcessDotTemplate&&(n.customProcessTemplate=t.customProcessDotTemplate),n.direction=t.nzDirection,n.index=s+t.nzStartIndex,n.currentIndex=t.nzCurrent,n.last=e===s+1,n.markForCheck()})})}},t.prototype.setClassMap=function(){var t;this.classMap=((t={})["ant-steps-"+this.nzDirection]=!0,t["ant-steps-label-horizontal"]="horizontal"===this.nzDirection,t["ant-steps-label-vertical"]=(this.showProcessDot||"vertical"===this.nzLabelPlacement)&&"horizontal"===this.nzDirection,t["ant-steps-dot"]=this.showProcessDot,t["ant-steps-small"]="small"===this.nzSize,t)},t.decorators=[{type:e.Component,args:[{changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,preserveWhitespaces:!1,selector:"nz-steps",exportAs:"nzSteps",template:'<div class="ant-steps" [ngClass]="classMap">\n <ng-content></ng-content>\n</div>'}]}],t.propDecorators={steps:[{type:e.ContentChildren,args:[a]}],nzCurrent:[{type:e.Input}],nzDirection:[{type:e.Input}],nzLabelPlacement:[{type:e.Input}],nzSize:[{type:e.Input}],nzStartIndex:[{type:e.Input}],nzStatus:[{type:e.Input}],nzProgressDot:[{type:e.Input}]},t}(),c=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule,r.NzIconModule,o.NzAddOnModule],exports:[p,a],declarations:[p,a]}]}],t}();t.NzStepComponent=a,t.NzStepsComponent=p,t.NzStepsModule=c,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=ng-zorro-antd-steps.umd.min.js.map