UNPKG

ng-zorro-antd-yj

Version:

An enterprise-class UI components based on Ant Design and Angular

66 lines 4.9 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { Directive, ElementRef, Host, Input, Optional, Renderer2 } from '@angular/core'; import { toBoolean } from '../core/util/convert'; import { NzTableComponent } from './nz-table.component'; export class NzTrDirective { /** * @param {?} elementRef * @param {?} renderer * @param {?} nzTableComponent */ constructor(elementRef, renderer, nzTableComponent) { this.elementRef = elementRef; this.renderer = renderer; this.nzTableComponent = nzTableComponent; } /** * @param {?} value * @return {?} */ set nzExpand(value) { if (toBoolean(value)) { this.renderer.removeStyle(this.elementRef.nativeElement, 'display'); this.renderer.addClass(this.elementRef.nativeElement, 'ant-table-expanded-row'); } else { this.renderer.setStyle(this.elementRef.nativeElement, 'display', 'none'); this.renderer.removeClass(this.elementRef.nativeElement, 'ant-table-expanded-row'); } } } NzTrDirective.decorators = [ { type: Directive, args: [{ // tslint:disable-next-line:directive-selector selector: 'tr', host: { '[class.ant-table-row]': 'nzTableComponent' } },] } ]; /** @nocollapse */ NzTrDirective.ctorParameters = () => [ { type: ElementRef }, { type: Renderer2 }, { type: NzTableComponent, decorators: [{ type: Host }, { type: Optional }] } ]; NzTrDirective.propDecorators = { nzExpand: [{ type: Input }] }; if (false) { /** * @type {?} * @private */ NzTrDirective.prototype.elementRef; /** * @type {?} * @private */ NzTrDirective.prototype.renderer; /** @type {?} */ NzTrDirective.prototype.nzTableComponent; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotdHIuZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmctem9ycm8tYW50ZC15ai8iLCJzb3VyY2VzIjpbInRhYmxlL256LXRyLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFB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