@progress/kendo-angular-grid
Version:
Kendo UI Grid for Angular - high performance data grid with paging, filtering, virtualization, CRUD, and more.
59 lines (58 loc) • 2.38 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { Input, ViewContainerRef, Directive } 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, selector: "[kendoGridFilterHostBase]", 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: [{
selector: '[kendoGridFilterHostBase]'
}]
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { column: [{
type: Input
}], filter: [{
type: Input
}] } });