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.

92 lines (91 loc) 3.49 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { Input, Directive } from '@angular/core'; import { ColumnComponent } from '../columns/column.component'; import { FilterService } from './filter.service'; import { BaseFilterCellComponent } from './base-filter-cell.component'; import { LocalizationService } from '@progress/kendo-angular-l10n'; import * as i0 from "@angular/core"; import * as i1 from "./filter.service"; import * as i2 from "@progress/kendo-angular-l10n"; /** * @hidden */ export class BooleanFilterComponent extends BaseFilterCellComponent { localization; /** * @hidden */ get hostClasses() { return true; } /** * The column with which the filter is associated. * @type {ColumnComponent} */ column; /** * @hidden */ operator = "eq"; /** * The current filter for the associated column field. * @readonly * @type {FilterDescriptor} */ get currentFilter() { return this.filterByField(this.column.field); } /** * The current filter operator for the associated column field. * @readonly * @type {string} */ get currentOperator() { return this.currentFilter ? this.currentFilter.operator : this.operator; } /** * @hidden */ items; /** * @hidden */ defaultItem; subscription; constructor(filterService, localization) { super(filterService); this.localization = localization; this.items = [ { text: this.localization.get("filterIsTrue"), value: true }, { text: this.localization.get("filterIsFalse"), value: false } ]; this.defaultItem = { text: this.localization.get("filterBooleanAll"), value: null }; } ngOnInit() { this.subscription = this.localization.changes.subscribe(this.localizationChange.bind(this)); } ngOnDestroy() { if (this.subscription) { this.subscription.unsubscribe(); } super.ngOnDestroy(); } localizationChange() { this.items = [ { text: this.localization.get("filterIsTrue"), value: true }, { text: this.localization.get("filterIsFalse"), value: false } ]; this.defaultItem = { text: this.localization.get("filterBooleanAll"), value: null }; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BooleanFilterComponent, deps: [{ token: i1.FilterService }, { token: i2.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: BooleanFilterComponent, inputs: { column: "column" }, usesInheritance: true, ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BooleanFilterComponent, decorators: [{ type: Directive, args: [{}] }], ctorParameters: function () { return [{ type: i1.FilterService }, { type: i2.LocalizationService }]; }, propDecorators: { column: [{ type: Input }] } });