UNPKG

@progress/kendo-angular-treelist

Version:

Kendo UI TreeList for Angular - Display hierarchical data in an Angular tree grid view that supports sorting, filtering, paging, and much more.

57 lines (56 loc) 2.26 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { Directive, Input, ViewContainerRef } from '@angular/core'; import { ColumnComponent } from '../columns/column.component'; import { anyChanged } from '../utils'; import * as i0 from "@angular/core"; /** * @hidden */ export class FilterHostDirective { host; column; filter; component; constructor(host) { this.host = host; } ngOnInit() { this.component = this.host.createComponent(this.componentType()); this.initComponent({ column: this.column, filter: this.filter }); } ngOnDestroy() { if (this.component) { this.component.destroy(); this.component = null; } } ngOnChanges(changes) { if (anyChanged(["column", "filter"], changes)) { this.initComponent({ column: this.column, filter: this.filter }); } } initComponent({ column, filter }) { const instance = this.component.instance; instance.column = column; instance.filter = filter; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterHostDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FilterHostDirective, inputs: { column: "column", filter: "filter" }, usesOnChanges: true, ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterHostDirective, decorators: [{ type: Directive, args: [{}] }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { column: [{ type: Input }], filter: [{ type: Input }] } });