@progress/kendo-angular-filter 21.4.1-develop.1 → 22.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base-filter-row.component.d.ts +1 -1
- package/fesm2022/progress-kendo-angular-filter.mjs +61 -61
- package/localization/messages.d.ts +1 -1
- package/package.json +16 -24
- package/schematics/ngAdd/index.js +4 -4
- package/esm2022/aria-label.directive.mjs +0 -34
- package/esm2022/base-filter-row.component.mjs +0 -75
- package/esm2022/directives.mjs +0 -17
- package/esm2022/editors/boolean-editor.component.mjs +0 -97
- package/esm2022/editors/date-editor.component.mjs +0 -75
- package/esm2022/editors/numeric-editor.component.mjs +0 -75
- package/esm2022/editors/text-editor.component.mjs +0 -62
- package/esm2022/error-messages.mjs +0 -16
- package/esm2022/filter-expression-operators.component.mjs +0 -90
- package/esm2022/filter-expression.component.mjs +0 -352
- package/esm2022/filter-field.component.mjs +0 -109
- package/esm2022/filter-group.component.mjs +0 -303
- package/esm2022/filter.component.mjs +0 -611
- package/esm2022/filter.module.mjs +0 -105
- package/esm2022/filter.service.mjs +0 -41
- package/esm2022/index.mjs +0 -19
- package/esm2022/localization/custom-messages.component.mjs +0 -44
- package/esm2022/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/localization/messages.mjs +0 -243
- package/esm2022/model/filter-expression.mjs +0 -8
- package/esm2022/navigation.service.mjs +0 -162
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/progress-kendo-angular-filter.mjs +0 -8
- package/esm2022/templates/value-editor.template.mjs +0 -32
- package/esm2022/util.mjs +0 -174
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { ChangeDetectorRef, Component, ElementRef, forwardRef, Input, isDevMode, Renderer2 } from '@angular/core';
|
|
6
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
-
import { xIcon } from '@progress/kendo-svg-icons';
|
|
8
|
-
import { BaseFilterRowComponent } from './base-filter-row.component';
|
|
9
|
-
import { FilterErrorMessages } from './error-messages';
|
|
10
|
-
import { FilterService } from './filter.service';
|
|
11
|
-
import { NavigationService } from './navigation.service';
|
|
12
|
-
import { defaultDateOperators, defaultNumericOperators, defaultOperators, defaultStringOperators, FilterItem, getKeyByValue, isFilterEditor, localizeOperators, nullOperators } from './util';
|
|
13
|
-
import { ButtonComponent } from '@progress/kendo-angular-buttons';
|
|
14
|
-
import { FilterDateEditorComponent } from './editors/date-editor.component';
|
|
15
|
-
import { FilterBooleanEditorComponent } from './editors/boolean-editor.component';
|
|
16
|
-
import { FilterNumericEditorComponent } from './editors/numeric-editor.component';
|
|
17
|
-
import { FilterTextEditorComponent } from './editors/text-editor.component';
|
|
18
|
-
import { FilterExpressionOperatorsComponent } from './filter-expression-operators.component';
|
|
19
|
-
import { AriaLabelValueDirective } from './aria-label.directive';
|
|
20
|
-
import { DropDownListComponent } from '@progress/kendo-angular-dropdowns';
|
|
21
|
-
import { TemplateContextDirective } from '@progress/kendo-angular-common';
|
|
22
|
-
import * as i0 from "@angular/core";
|
|
23
|
-
import * as i1 from "./filter.service";
|
|
24
|
-
import * as i2 from "./navigation.service";
|
|
25
|
-
import * as i3 from "@progress/kendo-angular-l10n";
|
|
26
|
-
/**
|
|
27
|
-
* @hidden
|
|
28
|
-
*/
|
|
29
|
-
export class FilterExpressionComponent extends BaseFilterRowComponent {
|
|
30
|
-
filterService;
|
|
31
|
-
cdr;
|
|
32
|
-
/**
|
|
33
|
-
* @hidden
|
|
34
|
-
*/
|
|
35
|
-
xIcon = xIcon;
|
|
36
|
-
static ngAcceptInputType_currentItem;
|
|
37
|
-
currentItem;
|
|
38
|
-
operators = [];
|
|
39
|
-
isBoolean = false;
|
|
40
|
-
editorType;
|
|
41
|
-
isEditorDisabled = false;
|
|
42
|
-
editorTemplate;
|
|
43
|
-
editorFormat;
|
|
44
|
-
get currentFilterExpression() {
|
|
45
|
-
return this.getFilterExpressionByField(this.currentItem.field);
|
|
46
|
-
}
|
|
47
|
-
get numericEditorFormat() {
|
|
48
|
-
const isSupportedFormat = typeof this.editorFormat !== 'string' && !this.isNumberFormat(this.editorFormat);
|
|
49
|
-
if (this.editorFormat && isSupportedFormat) {
|
|
50
|
-
console.warn(FilterErrorMessages.improperNumericEditorValue(this.currentFilterExpression.title));
|
|
51
|
-
}
|
|
52
|
-
return this.editorFormat;
|
|
53
|
-
}
|
|
54
|
-
get dateEditorFormat() {
|
|
55
|
-
const isSupportedFormat = typeof this.editorFormat !== 'string' && !this.isDateFormat(this.editorFormat);
|
|
56
|
-
if (this.editorFormat && isSupportedFormat) {
|
|
57
|
-
console.warn(FilterErrorMessages.improperDateEditorValue(this.currentFilterExpression.title));
|
|
58
|
-
}
|
|
59
|
-
return this.editorFormat;
|
|
60
|
-
}
|
|
61
|
-
isNumberFormat(obj) {
|
|
62
|
-
if (isDevMode() && obj &&
|
|
63
|
-
(obj['currency'] ||
|
|
64
|
-
obj['currencyDisplay'] ||
|
|
65
|
-
obj['maximumFractionDigits'] ||
|
|
66
|
-
obj['minimumIntegerDigits'] ||
|
|
67
|
-
obj['style'] ||
|
|
68
|
-
obj['useGrouping'])) {
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
isDateFormat(obj) {
|
|
76
|
-
if (isDevMode() && obj && obj['displayFormat'] && obj['inputFormat']) {
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
localizationSubscription;
|
|
84
|
-
constructor(filterService, cdr, element, navigationService, localization, renderer) {
|
|
85
|
-
super(element, navigationService, localization, renderer);
|
|
86
|
-
this.filterService = filterService;
|
|
87
|
-
this.cdr = cdr;
|
|
88
|
-
}
|
|
89
|
-
ngOnInit() {
|
|
90
|
-
this.isEditorDisabled = nullOperators.indexOf(this.currentItem.operator) >= 0;
|
|
91
|
-
const foundFilter = this.getFilterExpressionByField(this.currentItem.field);
|
|
92
|
-
if (this.currentItem.field) {
|
|
93
|
-
this.setOperators(foundFilter);
|
|
94
|
-
}
|
|
95
|
-
if (foundFilter?.editorFormat) {
|
|
96
|
-
this.editorFormat = foundFilter.editorFormat;
|
|
97
|
-
}
|
|
98
|
-
const defaultFilter = this.getFilterExpressionByField(this.filterService.filters[0].field);
|
|
99
|
-
if (!this.currentItem.field) {
|
|
100
|
-
this.currentItem.field = this.filterService.filters[0].field;
|
|
101
|
-
if (defaultFilter.editorFormat) {
|
|
102
|
-
this.editorFormat = defaultFilter.editorFormat;
|
|
103
|
-
}
|
|
104
|
-
this.setOperators(defaultFilter);
|
|
105
|
-
}
|
|
106
|
-
this.setEditorTemplate();
|
|
107
|
-
this.localizationSubscription = this.localization.changes.subscribe(() => {
|
|
108
|
-
this.setOperators(foundFilter || defaultFilter);
|
|
109
|
-
this.cdr.detectChanges();
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
ngOnDestroy() {
|
|
113
|
-
if (this.localizationSubscription) {
|
|
114
|
-
this.localizationSubscription.unsubscribe();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
normalizeOperators(filterEditor, operators) {
|
|
118
|
-
const result = [];
|
|
119
|
-
for (let j = 0; j < operators.length; j++) {
|
|
120
|
-
if (isFilterEditor(filterEditor)) {
|
|
121
|
-
result.push({
|
|
122
|
-
value: operators[j],
|
|
123
|
-
text: this.localization.get(getKeyByValue(defaultOperators[filterEditor], operators[j]))
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return result;
|
|
128
|
-
}
|
|
129
|
-
getFilterExpressionByField(name) {
|
|
130
|
-
const foundFilter = this.filterService.filters.find(filter => filter.field === name);
|
|
131
|
-
if (foundFilter) {
|
|
132
|
-
return foundFilter;
|
|
133
|
-
}
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
filterValueChange(value) {
|
|
137
|
-
this.navigationService.currentToolbarItemIndex = this.itemNumber;
|
|
138
|
-
this.navigationService.currentToolbarItemChildrenIndex = 0;
|
|
139
|
-
this.currentItem.value = null;
|
|
140
|
-
this.currentItem.field = value;
|
|
141
|
-
this.setEditorTemplate();
|
|
142
|
-
const foundFilter = this.getFilterExpressionByField(this.currentItem.field);
|
|
143
|
-
this.setOperators(foundFilter);
|
|
144
|
-
this.editorFormat = foundFilter.editorFormat;
|
|
145
|
-
this.valueChange.emit();
|
|
146
|
-
}
|
|
147
|
-
getDefaultOperators(operatorsType) {
|
|
148
|
-
switch (operatorsType) {
|
|
149
|
-
case 'string':
|
|
150
|
-
return localizeOperators(defaultStringOperators)(this.localization);
|
|
151
|
-
case 'number':
|
|
152
|
-
return localizeOperators(defaultNumericOperators)(this.localization);
|
|
153
|
-
case 'date':
|
|
154
|
-
return localizeOperators(defaultDateOperators)(this.localization);
|
|
155
|
-
default:
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
getEditorType() {
|
|
160
|
-
const filterExpression = this.filterService.filters.find((filterExpression) => filterExpression.field === this.currentItem.field);
|
|
161
|
-
return filterExpression?.editor;
|
|
162
|
-
}
|
|
163
|
-
getFilters() {
|
|
164
|
-
return this.filterService.filters || [];
|
|
165
|
-
}
|
|
166
|
-
removeFilterExpression() {
|
|
167
|
-
this.filterService.remove(this.currentItem, this.index);
|
|
168
|
-
this.valueChange.emit(true);
|
|
169
|
-
}
|
|
170
|
-
setOperators(filter) {
|
|
171
|
-
this.isBoolean = filter.editor === 'boolean';
|
|
172
|
-
if (this.isBoolean) {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
if (filter.operators) {
|
|
176
|
-
const localizedOperators = this.normalizeOperators(filter.editor, filter.operators);
|
|
177
|
-
this.operators = localizedOperators;
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
this.operators = this.getDefaultOperators(filter.editor);
|
|
181
|
-
}
|
|
182
|
-
if (!this.currentItem.operator) {
|
|
183
|
-
this.currentItem.operator = this.operators[0].value;
|
|
184
|
-
}
|
|
185
|
-
const operatorDoesNotExist = !this.operators.find(operator => operator.value === this.currentItem.operator);
|
|
186
|
-
if (this.currentItem.operator && operatorDoesNotExist) {
|
|
187
|
-
this.currentItem.operator = this.operators[0].value;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
onOperatorChange(value) {
|
|
191
|
-
this.navigationService.currentToolbarItemIndex = this.itemNumber;
|
|
192
|
-
this.navigationService.currentToolbarItemChildrenIndex = 1;
|
|
193
|
-
this.valueChange.emit();
|
|
194
|
-
if (nullOperators.includes(value)) {
|
|
195
|
-
this.currentItem.value = null;
|
|
196
|
-
this.isEditorDisabled = true;
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
this.isEditorDisabled = false;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
setEditorTemplate() {
|
|
203
|
-
const filterExpression = this.filterService.filters.find((filter) => filter.field === this.currentItem.field);
|
|
204
|
-
this.editorTemplate = filterExpression?.editorTemplate;
|
|
205
|
-
}
|
|
206
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FilterExpressionComponent, deps: [{ token: i1.FilterService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i2.NavigationService }, { token: i3.LocalizationService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
207
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: FilterExpressionComponent, isStandalone: true, selector: "kendo-filter-expression", inputs: { currentItem: "currentItem" }, providers: [{
|
|
208
|
-
provide: FilterItem,
|
|
209
|
-
useExisting: forwardRef(() => FilterExpressionComponent)
|
|
210
|
-
}], usesInheritance: true, ngImport: i0, template: `
|
|
211
|
-
<div class="k-filter-toolbar">
|
|
212
|
-
<div class="k-toolbar k-toolbar-md k-toolbar-solid" role="toolbar" [attr.aria-label]="messageFor('filterToolbarAriaLabel')" (mousedown)="onMouseDown($event)">
|
|
213
|
-
<div class="k-filter-field k-toolbar-item" >
|
|
214
|
-
<kendo-dropdownlist
|
|
215
|
-
[tabindex]="-1"
|
|
216
|
-
[kendoAriaLabelValue]="messageFor('filterFieldAriaLabel')"
|
|
217
|
-
[title]="messageFor('filterExpressionFilters')"
|
|
218
|
-
[data]="getFilters()"
|
|
219
|
-
textField="title"
|
|
220
|
-
valueField="field"
|
|
221
|
-
[value]="currentItem.field"
|
|
222
|
-
[valuePrimitive]="true"
|
|
223
|
-
(valueChange)="filterValueChange($event)">
|
|
224
|
-
</kendo-dropdownlist>
|
|
225
|
-
</div>
|
|
226
|
-
@if (!isBoolean) {
|
|
227
|
-
<div class="k-filter-operator k-toolbar-item" >
|
|
228
|
-
<kendo-filter-expression-operators
|
|
229
|
-
[currentItem]="currentItem"
|
|
230
|
-
[operators]="operators"
|
|
231
|
-
[editorType]="getEditorType()"
|
|
232
|
-
(valueChange)="onOperatorChange($event);">
|
|
233
|
-
</kendo-filter-expression-operators>
|
|
234
|
-
</div>
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
<div class="k-filter-value k-toolbar-item">
|
|
238
|
-
@if (!editorTemplate) {
|
|
239
|
-
@switch (getEditorType()) {
|
|
240
|
-
@case ('string') {
|
|
241
|
-
<kendo-filter-text-editor [currentItem]="currentItem" [isDisabled]="isEditorDisabled" (valueChange)="valueChange.emit()"></kendo-filter-text-editor>
|
|
242
|
-
}
|
|
243
|
-
@case ('number') {
|
|
244
|
-
<kendo-filter-numeric-editor [currentItem]="currentItem" [isDisabled]="isEditorDisabled" [format]="numericEditorFormat" (valueChange)="valueChange.emit()"></kendo-filter-numeric-editor>
|
|
245
|
-
}
|
|
246
|
-
@case ('boolean') {
|
|
247
|
-
<kendo-filter-boolean-editor [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-boolean-editor>
|
|
248
|
-
}
|
|
249
|
-
@case ('date') {
|
|
250
|
-
<kendo-filter-date-editor [currentItem]="currentItem" [isDisabled]="isEditorDisabled" [format]="dateEditorFormat" (valueChange)="valueChange.emit()"></kendo-filter-date-editor>
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
@if (editorTemplate) {
|
|
255
|
-
<ng-template
|
|
256
|
-
[templateContext]="{templateRef: editorTemplate, $implicit: currentItem}">
|
|
257
|
-
</ng-template>
|
|
258
|
-
}
|
|
259
|
-
</div>
|
|
260
|
-
|
|
261
|
-
<button
|
|
262
|
-
kendoButton
|
|
263
|
-
class="k-toolbar-button"
|
|
264
|
-
tabindex="-1"
|
|
265
|
-
icon="x"
|
|
266
|
-
[svgIcon]="xIcon"
|
|
267
|
-
fillMode="flat"
|
|
268
|
-
[title]="messageFor('remove')"
|
|
269
|
-
(click)="removeFilterExpression()">
|
|
270
|
-
</button>
|
|
271
|
-
</div>
|
|
272
|
-
</div>
|
|
273
|
-
`, isInline: true, dependencies: [{ kind: "component", type: DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["customIconClass", "showStickyHeader", "icon", "svgIcon", "loading", "data", "value", "textField", "valueField", "adaptiveMode", "adaptiveTitle", "adaptiveSubtitle", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "leftRightArrowsNavigation", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }, { kind: "directive", type: AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }, { kind: "component", type: FilterExpressionOperatorsComponent, selector: "kendo-filter-expression-operators", inputs: ["currentItem", "editorType", "operators"], outputs: ["valueChange"] }, { kind: "component", type: FilterTextEditorComponent, selector: "kendo-filter-text-editor", inputs: ["currentItem", "isDisabled"], outputs: ["valueChange"] }, { kind: "component", type: FilterNumericEditorComponent, selector: "kendo-filter-numeric-editor", inputs: ["currentItem", "isDisabled", "format"], outputs: ["valueChange"] }, { kind: "component", type: FilterBooleanEditorComponent, selector: "kendo-filter-boolean-editor", inputs: ["currentItem"], outputs: ["valueChange"] }, { kind: "component", type: FilterDateEditorComponent, selector: "kendo-filter-date-editor", inputs: ["currentItem", "isDisabled", "format"], outputs: ["valueChange"] }, { kind: "directive", type: TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
274
|
-
}
|
|
275
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FilterExpressionComponent, decorators: [{
|
|
276
|
-
type: Component,
|
|
277
|
-
args: [{
|
|
278
|
-
providers: [{
|
|
279
|
-
provide: FilterItem,
|
|
280
|
-
useExisting: forwardRef(() => FilterExpressionComponent)
|
|
281
|
-
}],
|
|
282
|
-
selector: 'kendo-filter-expression',
|
|
283
|
-
template: `
|
|
284
|
-
<div class="k-filter-toolbar">
|
|
285
|
-
<div class="k-toolbar k-toolbar-md k-toolbar-solid" role="toolbar" [attr.aria-label]="messageFor('filterToolbarAriaLabel')" (mousedown)="onMouseDown($event)">
|
|
286
|
-
<div class="k-filter-field k-toolbar-item" >
|
|
287
|
-
<kendo-dropdownlist
|
|
288
|
-
[tabindex]="-1"
|
|
289
|
-
[kendoAriaLabelValue]="messageFor('filterFieldAriaLabel')"
|
|
290
|
-
[title]="messageFor('filterExpressionFilters')"
|
|
291
|
-
[data]="getFilters()"
|
|
292
|
-
textField="title"
|
|
293
|
-
valueField="field"
|
|
294
|
-
[value]="currentItem.field"
|
|
295
|
-
[valuePrimitive]="true"
|
|
296
|
-
(valueChange)="filterValueChange($event)">
|
|
297
|
-
</kendo-dropdownlist>
|
|
298
|
-
</div>
|
|
299
|
-
@if (!isBoolean) {
|
|
300
|
-
<div class="k-filter-operator k-toolbar-item" >
|
|
301
|
-
<kendo-filter-expression-operators
|
|
302
|
-
[currentItem]="currentItem"
|
|
303
|
-
[operators]="operators"
|
|
304
|
-
[editorType]="getEditorType()"
|
|
305
|
-
(valueChange)="onOperatorChange($event);">
|
|
306
|
-
</kendo-filter-expression-operators>
|
|
307
|
-
</div>
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
<div class="k-filter-value k-toolbar-item">
|
|
311
|
-
@if (!editorTemplate) {
|
|
312
|
-
@switch (getEditorType()) {
|
|
313
|
-
@case ('string') {
|
|
314
|
-
<kendo-filter-text-editor [currentItem]="currentItem" [isDisabled]="isEditorDisabled" (valueChange)="valueChange.emit()"></kendo-filter-text-editor>
|
|
315
|
-
}
|
|
316
|
-
@case ('number') {
|
|
317
|
-
<kendo-filter-numeric-editor [currentItem]="currentItem" [isDisabled]="isEditorDisabled" [format]="numericEditorFormat" (valueChange)="valueChange.emit()"></kendo-filter-numeric-editor>
|
|
318
|
-
}
|
|
319
|
-
@case ('boolean') {
|
|
320
|
-
<kendo-filter-boolean-editor [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-boolean-editor>
|
|
321
|
-
}
|
|
322
|
-
@case ('date') {
|
|
323
|
-
<kendo-filter-date-editor [currentItem]="currentItem" [isDisabled]="isEditorDisabled" [format]="dateEditorFormat" (valueChange)="valueChange.emit()"></kendo-filter-date-editor>
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
@if (editorTemplate) {
|
|
328
|
-
<ng-template
|
|
329
|
-
[templateContext]="{templateRef: editorTemplate, $implicit: currentItem}">
|
|
330
|
-
</ng-template>
|
|
331
|
-
}
|
|
332
|
-
</div>
|
|
333
|
-
|
|
334
|
-
<button
|
|
335
|
-
kendoButton
|
|
336
|
-
class="k-toolbar-button"
|
|
337
|
-
tabindex="-1"
|
|
338
|
-
icon="x"
|
|
339
|
-
[svgIcon]="xIcon"
|
|
340
|
-
fillMode="flat"
|
|
341
|
-
[title]="messageFor('remove')"
|
|
342
|
-
(click)="removeFilterExpression()">
|
|
343
|
-
</button>
|
|
344
|
-
</div>
|
|
345
|
-
</div>
|
|
346
|
-
`,
|
|
347
|
-
standalone: true,
|
|
348
|
-
imports: [DropDownListComponent, AriaLabelValueDirective, FilterExpressionOperatorsComponent, FilterTextEditorComponent, FilterNumericEditorComponent, FilterBooleanEditorComponent, FilterDateEditorComponent, TemplateContextDirective, ButtonComponent]
|
|
349
|
-
}]
|
|
350
|
-
}], ctorParameters: () => [{ type: i1.FilterService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i2.NavigationService }, { type: i3.LocalizationService }, { type: i0.Renderer2 }], propDecorators: { currentItem: [{
|
|
351
|
-
type: Input
|
|
352
|
-
}] } });
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { ContentChild } from '@angular/core';
|
|
6
|
-
import { Component, Input } from '@angular/core';
|
|
7
|
-
import { FilterValueEditorTemplateDirective } from './templates/value-editor.template';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
/**
|
|
10
|
-
* Represents the [Kendo UI Filter Field component for Angular]({% slug api_filter_filterfieldcomponent %}).
|
|
11
|
-
* Used to declare filter expressions for the Filter component.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```html
|
|
15
|
-
* <kendo-filter>
|
|
16
|
-
* <kendo-filter-field field="country" editor="string" [operators]="['neq', 'eq', 'contains']"></kendo-filter-field>
|
|
17
|
-
* <kendo-filter-field field="budget" editor="number"></kendo-filter-field>
|
|
18
|
-
* <kendo-filter-field field="discontinued" title="Discontinued" editor="boolean"></kendo-filter-field>
|
|
19
|
-
* <kendo-filter-field field="ordered on" title="Ordered on" editor="date"></kendo-filter-field>
|
|
20
|
-
* <kendo-filter>
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export class FilterFieldComponent {
|
|
24
|
-
/**
|
|
25
|
-
* Specifies the `field` that will be used by the user-defined filter.
|
|
26
|
-
*/
|
|
27
|
-
field;
|
|
28
|
-
/**
|
|
29
|
-
* Specifies the `title` text that will be displayed by the user-defined filter.
|
|
30
|
-
* If the `title` isn't set, the value passed to `field` is used.
|
|
31
|
-
*/
|
|
32
|
-
set title(_title) {
|
|
33
|
-
if (_title) {
|
|
34
|
-
this._title = _title;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
this._title = this.field;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
get title() {
|
|
41
|
-
return this._title;
|
|
42
|
-
}
|
|
43
|
-
_title;
|
|
44
|
-
/**
|
|
45
|
-
* Specifies the user-defined filter `editor` type that will be used.
|
|
46
|
-
* The available options are 'string', 'number', 'boolean', and 'date'.
|
|
47
|
-
*/
|
|
48
|
-
editor;
|
|
49
|
-
/**
|
|
50
|
-
* Specifies the operators that will be available in the order of providing them.
|
|
51
|
-
* If no operators are provided, default operators are used for each filter type.
|
|
52
|
-
*
|
|
53
|
-
* The default string operators are:
|
|
54
|
-
* * `eq`— Is equal to
|
|
55
|
-
* * `neq`— Is not equal to
|
|
56
|
-
* * `isnull`— Is null
|
|
57
|
-
* * `isnotnull`— Is not null
|
|
58
|
-
* * `contains`— Contains
|
|
59
|
-
* * `doesnotcontain`— Does not contain
|
|
60
|
-
* * `startswith`— Starts with
|
|
61
|
-
* * `endswith`— Ends with
|
|
62
|
-
* * `isempty`— Is empty
|
|
63
|
-
* * `isnotempty`— Is not empty
|
|
64
|
-
*
|
|
65
|
-
* The default number and date operators are:
|
|
66
|
-
* * `eq`— Is equals to
|
|
67
|
-
* * `neq`— Is not equal to
|
|
68
|
-
* * `isnull`— Is null
|
|
69
|
-
* * `isnotnull`— Is not null
|
|
70
|
-
* * `gt`— Greater than
|
|
71
|
-
* * `gte`— Greater than or equal to
|
|
72
|
-
* * `lt`— Less than
|
|
73
|
-
* * `lte`— Less than or equal to
|
|
74
|
-
*
|
|
75
|
-
* The boolean operator is always set to `eq`
|
|
76
|
-
*/
|
|
77
|
-
operators;
|
|
78
|
-
/**
|
|
79
|
-
* Specifies the user-defined filter `editor` format that will be used. ([see example]({% slug filter_editor_formats %}))
|
|
80
|
-
*/
|
|
81
|
-
editorFormat;
|
|
82
|
-
/**
|
|
83
|
-
* @hidden
|
|
84
|
-
*/
|
|
85
|
-
editorTemplate;
|
|
86
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FilterFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
87
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", 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 });
|
|
88
|
-
}
|
|
89
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FilterFieldComponent, decorators: [{
|
|
90
|
-
type: Component,
|
|
91
|
-
args: [{
|
|
92
|
-
selector: 'kendo-filter-field',
|
|
93
|
-
template: ``,
|
|
94
|
-
standalone: true
|
|
95
|
-
}]
|
|
96
|
-
}], propDecorators: { field: [{
|
|
97
|
-
type: Input
|
|
98
|
-
}], title: [{
|
|
99
|
-
type: Input
|
|
100
|
-
}], editor: [{
|
|
101
|
-
type: Input
|
|
102
|
-
}], operators: [{
|
|
103
|
-
type: Input
|
|
104
|
-
}], editorFormat: [{
|
|
105
|
-
type: Input
|
|
106
|
-
}], editorTemplate: [{
|
|
107
|
-
type: ContentChild,
|
|
108
|
-
args: [FilterValueEditorTemplateDirective]
|
|
109
|
-
}] } });
|