UNPKG

@lxlib/seed

Version:

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.

16 lines (14 loc) 5.24 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@lxlib/util"),require("@lxlib/theme"),require("@angular/common")):"function"==typeof define&&define.amd?define("@lxlib/seed/sg",["exports","@angular/core","@lxlib/util","@lxlib/theme","@angular/common"],t):t(((e=e||self).lxlib=e.lxlib||{},e.lxlib.seed=e.lxlib.seed||{},e.lxlib.seed.sg={}),e.ng.core,e.lxlib.util,e.lxlib.theme,e.ng.common)}(this,(function(e,t,n,r,o){"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. ***************************************************************************** */var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function l(e,t,n,r){var o,i=arguments.length,l=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i<3?o(l):i>3?o(t,n,l):o(t,n))||l);return i>3&&l&&Object.defineProperty(t,n,l),l}function a(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)l.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return l}function s(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(c(arguments[t]));return e}var u=function(){function e(){this.gutter=32,this.col=2}return e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}();var p=function(){function e(e){Object.assign(this,i(i({},new u),e))}return Object.defineProperty(e.prototype,"marginValue",{get:function(){return-this.gutter/2},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"sg-container, [sg-container]",exportAs:"sgContainer",template:" <ng-content></ng-content> ",host:{"[style.margin-left.px]":"marginValue","[style.margin-right.px]":"marginValue","[class.ant-row]":"true","[class.sg__wrap]":"true"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None}]}],e.ctorParameters=function(){return[{type:u}]},e.propDecorators={gutter:[{type:t.Input}],colInCon:[{type:t.Input,args:["sg-container"]}],col:[{type:t.Input}]},l([n.InputNumber(),a("design:type",Number)],e.prototype,"gutter",void 0),l([n.InputNumber(null),a("design:type",Number)],e.prototype,"colInCon",void 0),l([n.InputNumber(null),a("design:type",Number)],e.prototype,"col",void 0),e}();var f=function(){function e(e,t,n,r){if(this.ren=t,this.parent=n,this.rep=r,this.clsMap=[],this.inited=!1,null==n)throw new Error("[sg] must include 'sg-container' component");this.el=e.nativeElement}return Object.defineProperty(e.prototype,"paddingValue",{get:function(){return this.parent.gutter/2},enumerable:!0,configurable:!0}),e.prototype.setClass=function(){var e=this,t=e.el,n=e.ren,r=e.clsMap,o=e.col,i=e.parent;return r.forEach((function(e){return n.removeClass(t,e)})),r.length=0,r.push.apply(r,s(this.rep.genCls(null!=o?o:i.colInCon||i.col),["sg__item"])),r.forEach((function(e){return n.addClass(t,e)})),this},e.prototype.ngOnChanges=function(){this.inited&&this.setClass()},e.prototype.ngAfterViewInit=function(){this.setClass(),this.inited=!0},e.decorators=[{type:t.Component,args:[{selector:"sg",exportAs:"sg",template:" <ng-content></ng-content> ",host:{"[style.padding-left.px]":"paddingValue","[style.padding-right.px]":"paddingValue"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:p,decorators:[{type:t.Optional},{type:t.Host}]},{type:r.ResponsiveService}]},e.propDecorators={col:[{type:t.Input}]},l([n.InputNumber(null),a("design:type",Number)],e.prototype,"col",void 0),e}();var g=[p,f],d=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[o.CommonModule,n.LxlibUtilModule],declarations:s(g),exports:s(g)}]}],e}();e.SGComponent=f,e.SGConfig=u,e.SGContainerComponent=p,e.SGModule=d,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=grid.umd.min.js.map