@progress/kendo-angular-filter
Version:
Kendo UI Angular Filter
110 lines (109 loc) • 4.61 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 { ContentChild } from '@angular/core';
import { Component, Input } from '@angular/core';
import { FilterValueEditorTemplateDirective } from './templates/value-editor.template';
import * as i0 from "@angular/core";
/**
* Represents the [Kendo UI Filter Field component for Angular]({% slug api_filter_filterfieldcomponent %}).
* Used to declare filter expressions for the Filter component.
*
* @example
* ```html
* <kendo-filter>
* <kendo-filter-field field="country" editor="string" [operators]="['neq', 'eq', 'contains']"></kendo-filter-field>
* <kendo-filter-field field="budget" editor="number"></kendo-filter-field>
* <kendo-filter-field field="discontinued" title="Discontinued" editor="boolean"></kendo-filter-field>
* <kendo-filter-field field="ordered on" title="Ordered on" editor="date"></kendo-filter-field>
* <kendo-filter>
* ```
*/
export class FilterFieldComponent {
/**
* Specifies the `field` that will be used by the user-defined filter.
*/
field;
/**
* Specifies the `title` text that will be displayed by the user-defined filter.
* If the `title` isn't set, the value passed to `field` is used.
*/
set title(_title) {
if (_title) {
this._title = _title;
}
else {
this._title = this.field;
}
}
get title() {
return this._title;
}
_title;
/**
* Specifies the user-defined filter `editor` type that will be used.
* The available options are 'string', 'number', 'boolean', and 'date'.
*/
editor;
/**
* Specifies the operators that will be available in the order of providing them.
* If no operators are provided, default operators are used for each filter type.
*
* The default string operators are:
* * `eq`— Is equal to
* * `neq`— Is not equal to
* * `isnull`— Is null
* * `isnotnull`— Is not null
* * `contains`— Contains
* * `doesnotcontain`— Does not contain
* * `startswith`— Starts with
* * `endswith`— Ends with
* * `isempty`— Is empty
* * `isnotempty`— Is not empty
*
* The default number and date operators are:
* * `eq`— Is equals to
* * `neq`— Is not equal to
* * `isnull`— Is null
* * `isnotnull`— Is not null
* * `gt`— Greater than
* * `gte`— Greater than or equal to
* * `lt`— Less than
* * `lte`— Less than or equal to
*
* The boolean operator is always set to `eq`
*/
operators;
/**
* Specifies the user-defined filter `editor` format that will be used. ([see example]({% slug filter_editor_formats %}))
*/
editorFormat;
/**
* @hidden
*/
editorTemplate;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FilterFieldComponent, isStandalone: true, selector: "kendo-filter-field", inputs: { field: "field", title: "title", editor: "editor", operators: "operators", editorFormat: "editorFormat" }, queries: [{ propertyName: "editorTemplate", first: true, predicate: FilterValueEditorTemplateDirective, descendants: true }], ngImport: i0, template: ``, isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterFieldComponent, decorators: [{
type: Component,
args: [{
selector: 'kendo-filter-field',
template: ``,
standalone: true
}]
}], propDecorators: { field: [{
type: Input
}], title: [{
type: Input
}], editor: [{
type: Input
}], operators: [{
type: Input
}], editorFormat: [{
type: Input
}], editorTemplate: [{
type: ContentChild,
args: [FilterValueEditorTemplateDirective]
}] } });