UNPKG

@lxlib/seed

Version:

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

288 lines (280 loc) 8.74 kB
import { __assign, __decorate, __metadata, __spread } from 'tslib'; import { Injectable, ɵɵdefineInjectable, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ElementRef, Renderer2, Optional, Host, NgModule } from '@angular/core'; import { InputNumber, LxlibUtilModule } from '@lxlib/util'; import { ResponsiveService } from '@lxlib/theme'; import { CommonModule } from '@angular/common'; /** * @fileoverview added by tsickle * Generated from: sg.config.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var SGConfig = /** @class */ (function () { function SGConfig() { /** * 间距,默认:`32` */ this.gutter = 32; /** * 列数,默认:`2` */ this.col = 2; } SGConfig.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ SGConfig.ɵprov = ɵɵdefineInjectable({ factory: function SGConfig_Factory() { return new SGConfig(); }, token: SGConfig, providedIn: "root" }); return SGConfig; }()); if (false) { /** * 间距,默认:`32` * @type {?} */ SGConfig.prototype.gutter; /** * 列数,默认:`2` * @type {?} */ SGConfig.prototype.col; } /** * @fileoverview added by tsickle * Generated from: sg-container.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var SGContainerComponent = /** @class */ (function () { function SGContainerComponent(cog) { Object.assign(this, __assign(__assign({}, new SGConfig()), cog)); } Object.defineProperty(SGContainerComponent.prototype, "marginValue", { // #endregion get: // #endregion /** * @return {?} */ function () { return -(this.gutter / 2); }, enumerable: true, configurable: true }); SGContainerComponent.decorators = [ { type: 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: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None }] } ]; /** @nocollapse */ SGContainerComponent.ctorParameters = function () { return [ { type: SGConfig } ]; }; SGContainerComponent.propDecorators = { gutter: [{ type: Input }], colInCon: [{ type: Input, args: ['sg-container',] }], col: [{ type: Input }] }; __decorate([ InputNumber(), __metadata("design:type", Number) ], SGContainerComponent.prototype, "gutter", void 0); __decorate([ InputNumber(null), __metadata("design:type", Number) ], SGContainerComponent.prototype, "colInCon", void 0); __decorate([ InputNumber(null), __metadata("design:type", Number) ], SGContainerComponent.prototype, "col", void 0); return SGContainerComponent; }()); if (false) { /** @type {?} */ SGContainerComponent.prototype.gutter; /** @type {?} */ SGContainerComponent.prototype.colInCon; /** @type {?} */ SGContainerComponent.prototype.col; } /** * @fileoverview added by tsickle * Generated from: sg.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ var prefixCls = "sg"; var SGComponent = /** @class */ (function () { function SGComponent(el, ren, parent, rep) { this.ren = ren; this.parent = parent; this.rep = rep; this.clsMap = []; this.inited = false; if (parent == null) { throw new Error("[sg] must include 'sg-container' component"); } this.el = el.nativeElement; } Object.defineProperty(SGComponent.prototype, "paddingValue", { get: /** * @return {?} */ function () { return this.parent.gutter / 2; }, enumerable: true, configurable: true }); /** * @private * @template THIS * @this {THIS} * @return {THIS} */ SGComponent.prototype.setClass = /** * @private * @template THIS * @this {THIS} * @return {THIS} */ function () { var _a = (/** @type {?} */ (this)), el = _a.el, ren = _a.ren, clsMap = _a.clsMap, col = _a.col, parent = _a.parent; clsMap.forEach((/** * @param {?} cls * @return {?} */ function (cls) { return ren.removeClass(el, cls); })); clsMap.length = 0; clsMap.push.apply(clsMap, __spread((/** @type {?} */ (this)).rep.genCls(col != null ? col : parent.colInCon || parent.col), [prefixCls + "__item"])); clsMap.forEach((/** * @param {?} cls * @return {?} */ function (cls) { return ren.addClass(el, cls); })); return (/** @type {?} */ (this)); }; /** * @return {?} */ SGComponent.prototype.ngOnChanges = /** * @return {?} */ function () { if (this.inited) this.setClass(); }; /** * @return {?} */ SGComponent.prototype.ngAfterViewInit = /** * @return {?} */ function () { this.setClass(); this.inited = true; }; SGComponent.decorators = [ { type: Component, args: [{ selector: 'sg', exportAs: 'sg', template: " <ng-content></ng-content> ", host: { '[style.padding-left.px]': 'paddingValue', '[style.padding-right.px]': 'paddingValue', }, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None }] } ]; /** @nocollapse */ SGComponent.ctorParameters = function () { return [ { type: ElementRef }, { type: Renderer2 }, { type: SGContainerComponent, decorators: [{ type: Optional }, { type: Host }] }, { type: ResponsiveService } ]; }; SGComponent.propDecorators = { col: [{ type: Input }] }; __decorate([ InputNumber(null), __metadata("design:type", Number) ], SGComponent.prototype, "col", void 0); return SGComponent; }()); if (false) { /** * @type {?} * @private */ SGComponent.prototype.el; /** * @type {?} * @private */ SGComponent.prototype.clsMap; /** * @type {?} * @private */ SGComponent.prototype.inited; /** @type {?} */ SGComponent.prototype.col; /** * @type {?} * @private */ SGComponent.prototype.ren; /** * @type {?} * @private */ SGComponent.prototype.parent; /** * @type {?} * @private */ SGComponent.prototype.rep; } /** * @fileoverview added by tsickle * Generated from: sg.module.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ var COMPONENTS = [SGContainerComponent, SGComponent]; var SGModule = /** @class */ (function () { function SGModule() { } SGModule.decorators = [ { type: NgModule, args: [{ imports: [CommonModule, LxlibUtilModule], declarations: __spread(COMPONENTS), exports: __spread(COMPONENTS), },] } ]; return SGModule; }()); /** * @fileoverview added by tsickle * Generated from: public_api.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * Generated from: grid.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { SGComponent, SGConfig, SGContainerComponent, SGModule }; //# sourceMappingURL=grid.js.map