ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
2 lines • 5.71 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/bidi"),require("@angular/common"),require("@angular/core"),require("ng-zorro-antd/core/config"),require("ng-zorro-antd/core/logger"),require("ng-zorro-antd/core/util"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("ng-zorro-antd/space",["exports","@angular/cdk/bidi","@angular/common","@angular/core","ng-zorro-antd/core/config","ng-zorro-antd/core/logger","ng-zorro-antd/core/util","rxjs","rxjs/operators"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["ng-zorro-antd"]=e["ng-zorro-antd"]||{},e["ng-zorro-antd"].space={}),e.ng.cdk.bidi,e.ng.common,e.ng.core,e["ng-zorro-antd"].core.config,e["ng-zorro-antd"].core.logger,e["ng-zorro-antd"].core.util,e.rxjs,e.rxjs.operators)}(this,(function(e,t,n,r,o,i,a,s,c){"use strict";var l=function(){function e(e,t){this.renderer=e,this.elementRef=t}return e.prototype.setDirectionAndSize=function(e,t){"horizontal"===e?(this.renderer.removeStyle(this.elementRef.nativeElement,"margin-bottom"),this.renderer.setStyle(this.elementRef.nativeElement,"margin-right",t+"px")):(this.renderer.removeStyle(this.elementRef.nativeElement,"margin-right"),this.renderer.setStyle(this.elementRef.nativeElement,"margin-bottom",t+"px"))},e.prototype.ngOnInit=function(){},e}();l.decorators=[{type:r.Component,args:[{selector:"nz-space-item, [nz-space-item]",changeDetection:r.ChangeDetectionStrategy.OnPush,template:"\n <ng-content></ng-content>\n ",host:{class:"ant-space-item"}}]}],l.ctorParameters=function(){return[{type:r.Renderer2},{type:r.ElementRef}]};var p=function(){};p.decorators=[{type:r.Directive,args:[{selector:"[nzSpaceItem]"}]}],p.ctorParameters=function(){return[]};function g(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function m(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}Object.create;Object.create;var d={small:8,middle:16,large:24},u=function(){function e(e,t){this.nzConfigService=e,this.cdr=t,this._nzModuleName="space",this.nzDirection="horizontal",this.nzSplit=null,this.nzWrap=!1,this.nzSize="small",this.spaceSize=d.small,this.destroy$=new s.Subject}return e.prototype.updateSpaceItems=function(){var e,t=this,n="string"==typeof this.nzSize?d[this.nzSize]:this.nzSize;this.spaceSize=n/(this.nzSplit?2:1),(null===(e=this.nzSpaceItemComponents)||void 0===e?void 0:e.length)&&(i.warnDeprecation("`nz-space-item` in `nz-space` will be removed in 12.0.0, please use `*nzSpaceItem` instead."),this.nzSpaceItemComponents.forEach((function(e){e.setDirectionAndSize(t.nzDirection,t.spaceSize)}))),this.cdr.markForCheck()},e.prototype.ngOnChanges=function(){this.updateSpaceItems(),this.mergedAlign=void 0===this.nzAlign&&"horizontal"===this.nzDirection?"center":this.nzAlign},e.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},e.prototype.ngAfterContentInit=function(){var e=this;this.updateSpaceItems(),this.nzSpaceItemComponents.changes.pipe(c.takeUntil(this.destroy$)).subscribe((function(){e.updateSpaceItems()}))},e}();u.decorators=[{type:r.Component,args:[{selector:"nz-space, [nz-space]",exportAs:"NzSpace",changeDetection:r.ChangeDetectionStrategy.OnPush,template:'\n <ng-content></ng-content>\n <ng-template ngFor let-item let-last="last" let-index="index" [ngForOf]="items">\n <div\n class="ant-space-item"\n [style.margin-bottom.px]="nzDirection === \'vertical\' ? (last ? null : spaceSize) : null"\n [style.margin-right.px]="nzDirection === \'horizontal\' ? (last ? null : spaceSize) : null"\n >\n <ng-container [ngTemplateOutlet]="item"></ng-container>\n </div>\n <span\n *ngIf="nzSplit && !last"\n class="ant-space-split"\n [style.margin-bottom.px]="nzDirection === \'vertical\' ? (last ? null : spaceSize) : null"\n [style.margin-right.px]="nzDirection === \'horizontal\' ? (last ? null : spaceSize) : null"\n >\n <ng-template [ngTemplateOutlet]="nzSplit" [ngTemplateOutletContext]="{ $implicit: index }"></ng-template>\n </span>\n </ng-template>\n ',host:{class:"ant-space","[class.ant-space-horizontal]":'nzDirection === "horizontal"',"[class.ant-space-vertical]":'nzDirection === "vertical"',"[class.ant-space-align-start]":'mergedAlign === "start"',"[class.ant-space-align-end]":'mergedAlign === "end"',"[class.ant-space-align-center]":'mergedAlign === "center"',"[class.ant-space-align-baseline]":'mergedAlign === "baseline"',"[style.flex-wrap]":'nzWrap ? "wrap" : null'}}]}],u.ctorParameters=function(){return[{type:o.NzConfigService},{type:r.ChangeDetectorRef}]},u.propDecorators={nzDirection:[{type:r.Input}],nzAlign:[{type:r.Input}],nzSplit:[{type:r.Input}],nzWrap:[{type:r.Input}],nzSize:[{type:r.Input}],nzSpaceItemComponents:[{type:r.ContentChildren,args:[l]}],items:[{type:r.ContentChildren,args:[p,{read:r.TemplateRef}]}]},g([a.InputBoolean(),m("design:type",Boolean)],u.prototype,"nzWrap",void 0),g([o.WithConfig(),m("design:type",Object)],u.prototype,"nzSize",void 0);var z=function(){};z.decorators=[{type:r.NgModule,args:[{declarations:[u,l,p],exports:[u,l,p],imports:[t.BidiModule,n.CommonModule]}]}],e.NzSpaceComponent=u,e.NzSpaceItemDirective=p,e.NzSpaceItemLegacyComponent=l,e.NzSpaceModule=z,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ng-zorro-antd-space.umd.min.js.map