UNPKG

yoyo-ng-modulewindy

Version:

服务于52ABP模板的前端开源的相关组件内容。整合了ng-alain和你NG ZORRO的内容

60 lines 2.04 kB
import { Directive, ElementRef, Renderer2, Input, } from '@angular/core'; import { toNumber } from 'yoyo-ng-module/util'; import { AdSHFConfig } from './config'; var SHFWrapDirective = /** @class */ (function () { function SHFWrapDirective(cog, el, ren) { this.el = el; this.ren = ren; this._col = 2; this._labelWidth = 100; this.nzLayout = 'horizontal'; Object.assign(this, cog); } Object.defineProperty(SHFWrapDirective.prototype, "col", { get: function () { return this._col; }, set: function (value) { var a = toNumber(value, 0); if (a <= 0) return; this._col = toNumber(value, 0); }, enumerable: true, configurable: true }); Object.defineProperty(SHFWrapDirective.prototype, "labelWidth", { get: function () { return this._labelWidth; }, set: function (value) { this._labelWidth = toNumber(value, 0); }, enumerable: true, configurable: true }); SHFWrapDirective.prototype.ngAfterViewInit = function () { var el = this.el.nativeElement; this.ren.addClass(el.querySelector('.ant-card-body') || el, 'ad-shf__wrap'); this.ren.addClass(el, "ad-shf__" + this.nzLayout); }; SHFWrapDirective.decorators = [ { type: Directive, args: [{ selector: 'shf-wrap, [shf-wrap]', },] }, ]; /** @nocollapse */ SHFWrapDirective.ctorParameters = function () { return [ { type: AdSHFConfig }, { type: ElementRef }, { type: Renderer2 } ]; }; SHFWrapDirective.propDecorators = { col: [{ type: Input, args: ['shf-wrap',] }], labelWidth: [{ type: Input }], nzLayout: [{ type: Input }] }; return SHFWrapDirective; }()); export { SHFWrapDirective }; //# sourceMappingURL=wrap.directive.js.map