ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
2 lines • 6.84 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("rxjs"),require("rxjs/operators"),require("@angular/common"),require("@angular/core"),require("ng-zorro-antd/core"),require("ng-zorro-antd/icon")):"function"==typeof define&&define.amd?define("ng-zorro-antd/steps",["exports","rxjs","rxjs/operators","@angular/common","@angular/core","ng-zorro-antd/core","ng-zorro-antd/icon"],e):e((t["ng-zorro-antd"]=t["ng-zorro-antd"]||{},t["ng-zorro-antd"].steps={}),t.rxjs,t.rxjs.operators,t.ng.common,t.ng.core,t["ng-zorro-antd"].core,t["ng-zorro-antd"].icon)}(this,function(t,e,n,s,o,i,r){"use strict";var a=(Object.defineProperty(p.prototype,"nzStatus",{get:function(){return this._status},set:function(t){this._status=t,this.isCustomStatus=!0},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"nzIcon",{get:function(){return this._icon},set:function(t){t instanceof o.TemplateRef?this.isIconString=!1:(this.isIconString=!0,this.oldAPIIcon="string"==typeof t&&-1<t.indexOf("anticon")),this._icon=t},enumerable:!0,configurable:!0}),Object.defineProperty(p.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}),p.prototype.markForCheck=function(){this.cdr.markForCheck()},p.decorators=[{type:o.Component,args:[{changeDetection:o.ChangeDetectionStrategy.OnPush,encapsulation:o.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)'}}]}],p.ctorParameters=function(){return[{type:o.ChangeDetectorRef},{type:o.Renderer2},{type:o.ElementRef}]},p.propDecorators={processDotTemplate:[{type:o.ViewChild,args:["processDotTemplate"]}],nzTitle:[{type:o.Input}],nzDescription:[{type:o.Input}],nzStatus:[{type:o.Input}],nzIcon:[{type:o.Input}]},p);function p(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")}var c=(Object.defineProperty(l.prototype,"nzProgressDot",{set:function(t){t instanceof o.TemplateRef?(this.showProcessDot=!0,this.customProcessDotTemplate=t):this.showProcessDot=i.toBoolean(t),this.updateChildrenSteps()},enumerable:!0,configurable:!0}),l.prototype.ngOnChanges=function(t){(t.nzStartIndex||t.nzDirection||t.nzStatus||t.nzCurrent)&&this.updateChildrenSteps(),(t.nzDirection||t.nzProgressDot||t.nzLabelPlacement||t.nzSize)&&this.setClassMap()},l.prototype.ngOnInit=function(){this.setClassMap(),this.updateChildrenSteps()},l.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},l.prototype.ngAfterContentInit=function(){var t=this;this.updateChildrenSteps(),this.steps&&this.steps.changes.pipe(n.takeUntil(this.destroy$)).subscribe(function(){t.updateChildrenSteps()})},l.prototype.updateChildrenSteps=function(){var n=this;if(this.steps){var s=this.steps.length;this.steps.toArray().forEach(function(t,e){Promise.resolve().then(function(){t.outStatus=n.nzStatus,t.showProcessDot=n.showProcessDot,n.customProcessDotTemplate&&(t.customProcessTemplate=n.customProcessDotTemplate),t.direction=n.nzDirection,t.index=e+n.nzStartIndex,t.currentIndex=n.nzCurrent,t.last=s===e+1,t.markForCheck()})})}},l.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)},l.decorators=[{type:o.Component,args:[{changeDetection:o.ChangeDetectionStrategy.OnPush,encapsulation:o.ViewEncapsulation.None,preserveWhitespaces:!1,selector:"nz-steps",exportAs:"nzSteps",template:'<div class="ant-steps" [ngClass]="classMap">\n <ng-content></ng-content>\n</div>'}]}],l.propDecorators={steps:[{type:o.ContentChildren,args:[a]}],nzCurrent:[{type:o.Input}],nzDirection:[{type:o.Input}],nzLabelPlacement:[{type:o.Input}],nzSize:[{type:o.Input}],nzStartIndex:[{type:o.Input}],nzStatus:[{type:o.Input}],nzProgressDot:[{type:o.Input}]},l);function l(){this.nzCurrent=0,this.nzDirection="horizontal",this.nzLabelPlacement="horizontal",this.nzSize="default",this.nzStartIndex=0,this.nzStatus="process",this.showProcessDot=!1,this.destroy$=new e.Subject}var u=(h.decorators=[{type:o.NgModule,args:[{imports:[s.CommonModule,r.NzIconModule,i.NzAddOnModule],exports:[c,a],declarations:[c,a]}]}],h);function h(){}t.NzStepsComponent=c,t.NzStepComponent=a,t.NzStepsModule=u,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=ng-zorro-antd-steps.umd.min.js.map