UNPKG

ng-zorro-antd-yj

Version:

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

65 lines 3.66 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { Directive, ElementRef, Input, Renderer2 } from '@angular/core'; export class NzClassListAddDirective { /** * @param {?} elementRef * @param {?} renderer */ constructor(elementRef, renderer) { this.elementRef = elementRef; this.renderer = renderer; this.classList = []; } /** * @param {?} list * @return {?} */ set nzClassListAdd(list) { this.classList.forEach((/** * @param {?} name * @return {?} */ name => { this.renderer.removeClass(this.elementRef.nativeElement, name); })); list.forEach((/** * @param {?} name * @return {?} */ name => { this.renderer.addClass(this.elementRef.nativeElement, name); })); this.classList = list; } } NzClassListAddDirective.decorators = [ { type: Directive, args: [{ selector: '[nzClassListAdd]' },] } ]; /** @nocollapse */ NzClassListAddDirective.ctorParameters = () => [ { type: ElementRef }, { type: Renderer2 } ]; NzClassListAddDirective.propDecorators = { nzClassListAdd: [{ type: Input }] }; if (false) { /** @type {?} */ NzClassListAddDirective.prototype.classList; /** * @type {?} * @private */ NzClassListAddDirective.prototype.elementRef; /** * @type {?} * @private */ NzClassListAddDirective.prototype.renderer; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3NsaXN0X2FkZC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25nLXpvcnJvLWFudGQteWovIiwic291cmNlcyI6WyJjb3JlL2FkZG9uL2NsYXNzbGlzdF9hZGQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsVUFBVSxFQUFFLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFLeEUsTUFBTSxPQUFPLHVCQUF1Qjs7Ozs7SUFjbEMsWUFBb0IsVUFBc0IsRUFBVSxRQUFtQjtRQUFuRCxlQUFVLEdBQVYsVUF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