ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
16 lines (14 loc) • 4.22 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("ng-zorro-antd/core/config"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("ng-zorro-antd/space",["exports","@angular/common","@angular/core","ng-zorro-antd/core/config","rxjs","rxjs/operators"],t):t(((e=e||self)["ng-zorro-antd"]=e["ng-zorro-antd"]||{},e["ng-zorro-antd"].space={}),e.ng.common,e.ng.core,e["ng-zorro-antd"].core.config,e.rxjs,e.rxjs.operators)}(this,(function(e,t,n,o,r,i){"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 a(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}var c={small:8,middle:16,large:24},s=function(){function e(e,t){this.renderer=e,this.elementRef=t}return e.prototype.setDirectionAndSize=function(e,t){var n="string"==typeof t?c[t]:t;"horizontal"===e?(this.renderer.removeStyle(this.elementRef.nativeElement,"margin-bottom"),this.renderer.setStyle(this.elementRef.nativeElement,"margin-right",n+"px")):(this.renderer.removeStyle(this.elementRef.nativeElement,"margin-right"),this.renderer.setStyle(this.elementRef.nativeElement,"margin-bottom",n+"px"))},e.prototype.ngOnInit=function(){},e.decorators=[{type:n.Component,args:[{selector:"nz-space-item, [nz-space-item]",changeDetection:n.ChangeDetectionStrategy.OnPush,template:"\n <ng-content></ng-content>\n ",host:{class:"ant-space-item"}}]}],e.ctorParameters=function(){return[{type:n.Renderer2},{type:n.ElementRef}]},e}();var p=function(){function e(e){this.nzConfigService=e,this.nzDirection="horizontal",this.destroy$=new r.Subject}return e.prototype.updateSpaceItems=function(){var e=this;this.nzSpaceItemComponents&&this.nzSpaceItemComponents.forEach((function(t){t.setDirectionAndSize(e.nzDirection,e.nzSize)}))},e.prototype.ngOnChanges=function(){this.updateSpaceItems()},e.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},e.prototype.ngAfterViewInit=function(){var e=this;this.nzSpaceItemComponents.changes.pipe(i.startWith(null),i.takeUntil(this.destroy$)).subscribe((function(){e.updateSpaceItems()}))},e.decorators=[{type:n.Component,args:[{selector:"nz-space",exportAs:"NzSpace",changeDetection:n.ChangeDetectionStrategy.OnPush,template:" <ng-content></ng-content> ",host:{class:"ant-space","[class.ant-space-horizontal]":'nzDirection === "horizontal"',"[class.ant-space-vertical]":'nzDirection === "vertical"'}}]}],e.ctorParameters=function(){return[{type:o.NzConfigService}]},e.propDecorators={nzDirection:[{type:n.Input}],nzSize:[{type:n.Input}],nzSpaceItemComponents:[{type:n.ContentChildren,args:[s]}]},function(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);i>3&&a&&Object.defineProperty(t,n,a)}([o.WithConfig("avatar","small"),a("design:type",Object)],e.prototype,"nzSize",void 0),e}();var l=function(){function e(){}return e.decorators=[{type:n.NgModule,args:[{declarations:[p,s],exports:[p,s],imports:[t.CommonModule]}]}],e}();e.NzSpaceComponent=p,e.NzSpaceItemComponent=s,e.NzSpaceModule=l,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ng-zorro-antd-space.umd.min.js.map