@progress/kendo-angular-filter
Version:
Kendo UI Angular Filter
87 lines (86 loc) • 3.5 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2026 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
/**
* Represents the FilterOperator type.
*/
import { TemplateRef } from '@angular/core';
import { FormatSettings } from '@progress/kendo-angular-dateinputs';
import { NumberFormatOptions } from '@progress/kendo-angular-intl';
/**
* Specifies the date format used for the DatePicker editor.
* Extends the `FormatSettings` from `@progress/kendo-angular-dateinputs`.
* See the [Filter editor formats documentation]({% slug filter_editor_formats %}).
*/
export interface DateFormat extends FormatSettings {
}
/**
* Specifies the number format used for the NumericTextBox editor when it is not focused.
* Extends the `NumberFormatOptions` from `@progress/kendo-angular-intl`.
* See the [Filter editor formats documentation]({% slug filter_editor_formats %}).
*/
export interface NumberFormat extends NumberFormatOptions {
}
export type FilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'isnull' | 'isnotnull' | 'contains' | 'doesnotcontain' | 'startswith' | 'endswith' | 'isempty' | 'isnotempty';
/**
* Represents the FilterEditor type.
*/
export type FilterEditor = 'string' | 'number' | 'boolean' | 'date';
/**
* Represents the FilterExpression interface.
*/
export interface FilterExpression {
/**
* Specifies the `field` that will be used by the user-defined filter.
*/
field: string;
/**
* 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.
*/
title?: string;
/**
* Specifies the user-defined filter `editor` type that will be used.
* The available options are 'string', 'number', 'boolean', and 'date'.
*/
editor: FilterEditor;
/**
* 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?: FilterOperator[];
/**
* Specifies a template for the expression value editor input.
*/
editorTemplate?: TemplateRef<any>;
/**
* Specifies the user-defined filter `editor` format that will be used.
* See the [Filter editor formats documentation]({% slug filter_editor_formats %}).
*/
editorFormat?: string | NumberFormat | DateFormat;
}