UNPKG

@progress/kendo-angular-filter

Version:
87 lines (86 loc) 3.5 kB
/**----------------------------------------------------------------------------------------- * 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`&mdash; Is equal to * * `neq`&mdash; Is not equal to * * `isnull`&mdash; Is null * * `isnotnull`&mdash; Is not null * * `contains`&mdash; Contains * * `doesnotcontain`&mdash; Does not contain * * `startswith`&mdash; Starts with * * `endswith`&mdash; Ends with * * `isempty`&mdash; Is empty * * `isnotempty`&mdash; Is not empty * * The default number and date operators are: * * `eq`&mdash; Is equals to * * `neq`&mdash; Is not equal to * * `isnull`&mdash; Is null * * `isnotnull`&mdash; Is not null * * `gt`&mdash; Greater than * * `gte`&mdash; Greater than or equal to * * `lt`&mdash; Less than * * `lte`&mdash; 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; }