@progress/kendo-angular-filter 2.3.1 → 11.0.0-develop.80
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/NOTICE.txt +3 -3
- package/aria-label.directive.d.ts +1 -1
- package/base-filter-row.component.d.ts +1 -1
- package/editors/boolean-editor.component.d.ts +1 -1
- package/editors/date-editor.component.d.ts +1 -1
- package/editors/numeric-editor.component.d.ts +1 -1
- package/editors/text-editor.component.d.ts +1 -1
- package/error-messages.d.ts +1 -1
- package/{esm2015/aria-label.directive.js → esm2020/aria-label.directive.mjs} +5 -5
- package/{esm2015/base-filter-row.component.js → esm2020/base-filter-row.component.mjs} +8 -6
- package/{esm2015/editors/boolean-editor.component.js → esm2020/editors/boolean-editor.component.mjs} +6 -5
- package/{esm2015/editors/date-editor.component.js → esm2020/editors/date-editor.component.mjs} +5 -4
- package/{esm2015/editors/numeric-editor.component.js → esm2020/editors/numeric-editor.component.mjs} +5 -4
- package/{esm2015/editors/text-editor.component.js → esm2020/editors/text-editor.component.mjs} +5 -4
- package/{esm2015/error-messages.js → esm2020/error-messages.mjs} +1 -1
- package/{esm2015/filter-expression-operators.component.js → esm2020/filter-expression-operators.component.mjs} +5 -4
- package/{esm2015/filter-expression.component.js → esm2020/filter-expression.component.mjs} +16 -13
- package/{esm2015/filter-field.component.js → esm2020/filter-field.component.mjs} +4 -4
- package/{esm2015/filter-group.component.js → esm2020/filter-group.component.mjs} +12 -9
- package/{esm2015/filter.component.js → esm2020/filter.component.mjs} +12 -10
- package/{esm2015/filter.module.js → esm2020/filter.module.mjs} +5 -5
- package/{esm2015/filter.service.js → esm2020/filter.service.mjs} +7 -7
- package/{esm2015/main.js → esm2020/index.mjs} +1 -1
- package/{esm2015/localization/custom-messages.component.js → esm2020/localization/custom-messages.component.mjs} +5 -4
- package/{esm2015/localization/localized-messages.directive.js → esm2020/localization/localized-messages.directive.mjs} +5 -4
- package/{esm2015/localization/messages.js → esm2020/localization/messages.mjs} +4 -4
- package/{esm2015/model/filter-expression.js → esm2020/model/filter-expression.mjs} +1 -1
- package/{esm2015/navigation.service.js → esm2020/navigation.service.mjs} +20 -15
- package/{esm2015/package-metadata.js → esm2020/package-metadata.mjs} +3 -3
- package/{esm2015/kendo-angular-filter.js → esm2020/progress-kendo-angular-filter.mjs} +2 -2
- package/{esm2015/shared.module.js → esm2020/shared.module.mjs} +5 -5
- package/{esm2015/templates/value-editor.template.js → esm2020/templates/value-editor.template.mjs} +5 -5
- package/{esm2015/util.js → esm2020/util.mjs} +4 -4
- package/fesm2015/{kendo-angular-filter.js → progress-kendo-angular-filter.mjs} +91 -85
- package/fesm2020/progress-kendo-angular-filter.mjs +2222 -0
- package/filter-expression-operators.component.d.ts +1 -1
- package/filter-expression.component.d.ts +1 -1
- package/filter-field.component.d.ts +1 -1
- package/filter-group.component.d.ts +1 -1
- package/filter.component.d.ts +1 -1
- package/filter.module.d.ts +1 -1
- package/filter.service.d.ts +1 -1
- package/{main.d.ts → index.d.ts} +1 -1
- package/localization/custom-messages.component.d.ts +1 -1
- package/localization/localized-messages.directive.d.ts +1 -1
- package/localization/messages.d.ts +1 -1
- package/model/filter-expression.d.ts +1 -1
- package/navigation.service.d.ts +1 -1
- package/package-metadata.d.ts +1 -1
- package/package.json +34 -60
- package/{kendo-angular-filter.d.ts → progress-kendo-angular-filter.d.ts} +2 -2
- package/schematics/ngAdd/index.js +1 -5
- package/shared.module.d.ts +1 -1
- package/templates/value-editor.template.d.ts +1 -1
- package/util.d.ts +1 -1
- package/bundles/kendo-angular-filter.umd.js +0 -5
- package/schematics/ngAdd/index.js.map +0 -1
|
@@ -0,0 +1,2222 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2022 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { Injectable, Directive, Component, Input, ContentChild, EventEmitter, Output, isDevMode, forwardRef, ViewChildren, HostListener, HostBinding, ContentChildren, NgModule } from '@angular/core';
|
|
7
|
+
import * as i1 from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
9
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
|
+
import { Keys } from '@progress/kendo-angular-common';
|
|
11
|
+
import * as i10 from '@progress/kendo-angular-buttons';
|
|
12
|
+
import { ButtonsModule } from '@progress/kendo-angular-buttons';
|
|
13
|
+
import * as i2 from '@progress/kendo-angular-dropdowns';
|
|
14
|
+
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
|
|
15
|
+
import * as i2$1 from '@progress/kendo-angular-inputs';
|
|
16
|
+
import { InputsModule } from '@progress/kendo-angular-inputs';
|
|
17
|
+
import * as i2$2 from '@progress/kendo-angular-dateinputs';
|
|
18
|
+
import { DateInputsModule } from '@progress/kendo-angular-dateinputs';
|
|
19
|
+
import * as i12 from '@angular/common';
|
|
20
|
+
import { CommonModule } from '@angular/common';
|
|
21
|
+
import { LabelModule } from '@progress/kendo-angular-label';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
class FilterService {
|
|
27
|
+
constructor() {
|
|
28
|
+
this.normalizedValue = { logic: 'and', filters: [] };
|
|
29
|
+
this.filters = [];
|
|
30
|
+
}
|
|
31
|
+
addFilterGroup(item) {
|
|
32
|
+
const filterGroup = { logic: 'and', filters: [] };
|
|
33
|
+
item.filters.push(filterGroup);
|
|
34
|
+
}
|
|
35
|
+
addFilterExpression(item) {
|
|
36
|
+
const filterExpression = { operator: 'eq', value: null, field: null };
|
|
37
|
+
item.filters.push(filterExpression);
|
|
38
|
+
}
|
|
39
|
+
remove(item, positionIndex, parentItem) {
|
|
40
|
+
if (!parentItem) {
|
|
41
|
+
parentItem = this.normalizedValue;
|
|
42
|
+
}
|
|
43
|
+
if (item === parentItem) {
|
|
44
|
+
parentItem.filters = [];
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const index = parentItem.filters.indexOf(item);
|
|
48
|
+
if (index >= 0 && index === positionIndex) {
|
|
49
|
+
parentItem.filters = parentItem.filters.filter((i) => i !== item);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
parentItem.filters.forEach((filter) => filter.filters && this.remove(item, positionIndex, filter));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
FilterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
56
|
+
FilterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterService });
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterService, decorators: [{
|
|
58
|
+
type: Injectable
|
|
59
|
+
}] });
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @hidden
|
|
63
|
+
*/
|
|
64
|
+
const nullOperators = ["isnull", "isnotnull", "isempty", "isnotempty"];
|
|
65
|
+
/**
|
|
66
|
+
* @hidden
|
|
67
|
+
*/
|
|
68
|
+
const numericOperators = [
|
|
69
|
+
{ text: "Is equal to", value: "eq" },
|
|
70
|
+
{ text: "Not equal to", value: "neq" },
|
|
71
|
+
{ text: "Greater than or equal to", value: "gte" },
|
|
72
|
+
{ text: "Greater than", value: "gt" },
|
|
73
|
+
{ text: "Less than or equal to", value: "lte" },
|
|
74
|
+
{ text: "Less than", value: "lt" },
|
|
75
|
+
{ text: "Is null", value: "isnull" },
|
|
76
|
+
{ text: "Is not null", value: "isnotnull" }
|
|
77
|
+
];
|
|
78
|
+
/**
|
|
79
|
+
* @hidden
|
|
80
|
+
*/
|
|
81
|
+
const stringOperators = [
|
|
82
|
+
{ text: "Is equal to", value: "eq" },
|
|
83
|
+
{ text: "Not equal to", value: "neq" },
|
|
84
|
+
{ text: "Contains", value: "contains" },
|
|
85
|
+
{ text: "Does not contain", value: "doesnotcontain" },
|
|
86
|
+
{ text: "Starts with", value: "startswith" },
|
|
87
|
+
{ text: "Ends with", value: "endswith" },
|
|
88
|
+
{ text: "Is null", value: "isnull" },
|
|
89
|
+
{ text: "Is not null", value: "isnotnull" },
|
|
90
|
+
{ text: "Is empty", value: "isempty" },
|
|
91
|
+
{ text: "Is not empty", value: "isnotempty" }
|
|
92
|
+
];
|
|
93
|
+
/**
|
|
94
|
+
* @hidden
|
|
95
|
+
*/
|
|
96
|
+
const booleanOperators = [
|
|
97
|
+
{ text: "Is equal to", value: "eq" },
|
|
98
|
+
{ text: "Is not equal to", value: "neq" }
|
|
99
|
+
];
|
|
100
|
+
/**
|
|
101
|
+
* @hidden
|
|
102
|
+
*/
|
|
103
|
+
const dateOperators = [
|
|
104
|
+
{ text: "Is equal to", value: "eq" },
|
|
105
|
+
{ text: "Not equal to", value: "neq" },
|
|
106
|
+
{ text: "Greater than or equal to", value: "gte" },
|
|
107
|
+
{ text: "Greater than", value: "gt" },
|
|
108
|
+
{ text: "Less than or equal to", value: "lte" },
|
|
109
|
+
{ text: "Less than", value: "lt" },
|
|
110
|
+
{ text: "Is null", value: "isnull" },
|
|
111
|
+
{ text: "Is not null", value: "isnotnull" }
|
|
112
|
+
];
|
|
113
|
+
/**
|
|
114
|
+
* @hidden
|
|
115
|
+
*/
|
|
116
|
+
const isArray = (value) => Array.isArray(value);
|
|
117
|
+
/**
|
|
118
|
+
* @hidden
|
|
119
|
+
*/
|
|
120
|
+
const getKeyByValue = (object, value) => {
|
|
121
|
+
return Object.keys(object).find(key => object[key] === value);
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* @hidden
|
|
125
|
+
*/
|
|
126
|
+
const defaultStringOperators = {
|
|
127
|
+
"filterEqOperator": "eq",
|
|
128
|
+
"filterNotEqOperator": "neq",
|
|
129
|
+
"filterContainsOperator": "contains",
|
|
130
|
+
"filterNotContainsOperator": "doesnotcontain",
|
|
131
|
+
"filterStartsWithOperator": "startswith",
|
|
132
|
+
"filterEndsWithOperator": "endswith",
|
|
133
|
+
"filterIsNullOperator": "isnull",
|
|
134
|
+
"filterIsNotNullOperator": "isnotnull",
|
|
135
|
+
"filterIsEmptyOperator": "isempty",
|
|
136
|
+
"filterIsNotEmptyOperator": "isnotempty"
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* @hidden
|
|
140
|
+
*/
|
|
141
|
+
const defaultNumericOperators = {
|
|
142
|
+
"filterEqOperator": "eq",
|
|
143
|
+
"filterNotEqOperator": "neq",
|
|
144
|
+
"filterGteOperator": "gte",
|
|
145
|
+
"filterGtOperator": "gt",
|
|
146
|
+
"filterLteOperator": "lte",
|
|
147
|
+
"filterLtOperator": "lt",
|
|
148
|
+
"filterIsNullOperator": "isnull",
|
|
149
|
+
"filterIsNotNullOperator": "isnotnull"
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* @hidden
|
|
153
|
+
*/
|
|
154
|
+
const defaultDateOperators = {
|
|
155
|
+
"filterEqOperator": "eq",
|
|
156
|
+
"filterNotEqOperator": "neq",
|
|
157
|
+
"filterAfterOrEqualOperator": "gte",
|
|
158
|
+
"filterAfterOperator": "gt",
|
|
159
|
+
"filterBeforeOrEqualOperator": "lte",
|
|
160
|
+
"filterBeforeOperator": "lt",
|
|
161
|
+
"filterIsNullOperator": "isnull",
|
|
162
|
+
"filterIsNotNullOperator": "isnotnull"
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* @hidden
|
|
166
|
+
*/
|
|
167
|
+
const defaultOperators = {
|
|
168
|
+
"string": defaultStringOperators,
|
|
169
|
+
"number": defaultNumericOperators,
|
|
170
|
+
"date": defaultDateOperators
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* @hidden
|
|
174
|
+
*/
|
|
175
|
+
const logicOperators = {
|
|
176
|
+
"filterAndLogic": 'and',
|
|
177
|
+
"filterOrLogic": 'or'
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* @hidden
|
|
181
|
+
*/
|
|
182
|
+
const isFilterEditor = (editorType) => {
|
|
183
|
+
const supportedEditorTypes = ['string', 'number', 'boolean', 'date'];
|
|
184
|
+
return supportedEditorTypes.indexOf(editorType) >= 0;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* @hidden
|
|
188
|
+
*/
|
|
189
|
+
const localizeOperators = operators => localization => Object.keys(operators).map(key => ({
|
|
190
|
+
text: localization.get(key),
|
|
191
|
+
value: operators[key]
|
|
192
|
+
}));
|
|
193
|
+
/**
|
|
194
|
+
* @hidden
|
|
195
|
+
*/
|
|
196
|
+
const isPresent = (value) => value !== null && value !== undefined;
|
|
197
|
+
/**
|
|
198
|
+
* @hidden
|
|
199
|
+
*/
|
|
200
|
+
class FilterItem {
|
|
201
|
+
}
|
|
202
|
+
FilterItem.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterItem, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
203
|
+
FilterItem.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterItem });
|
|
204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterItem, decorators: [{
|
|
205
|
+
type: Injectable
|
|
206
|
+
}] });
|
|
207
|
+
/**
|
|
208
|
+
* @hidden
|
|
209
|
+
*/
|
|
210
|
+
const selectors = {
|
|
211
|
+
andButton: `button.k-group-start`,
|
|
212
|
+
orButton: `button.k-group-end`,
|
|
213
|
+
addFilterButton: `button[icon="filter-add-expression"]`,
|
|
214
|
+
addGroupButton: `button[icon="filter-add-group"]`,
|
|
215
|
+
removeButton: `button[icon="x"]`,
|
|
216
|
+
filterFieldWrapper: `.k-filter-field`,
|
|
217
|
+
filterOperatorWrapper: `.k-filter-operator`,
|
|
218
|
+
filterValueEditorWrapper: `.k-filter-value`,
|
|
219
|
+
kendoDropDownListComponent: `kendo-dropdownlist`,
|
|
220
|
+
kendoInput: `.k-input`,
|
|
221
|
+
kendoInputInner: `.k-input-inner`,
|
|
222
|
+
inputElement: `input`,
|
|
223
|
+
textAreaElement: `textarea`,
|
|
224
|
+
kendoToolbar: `.k-toolbar`,
|
|
225
|
+
kendoButton: `.k-button`,
|
|
226
|
+
kendoFilterToolbarItem: `.k-filter-toolbar-item`
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @hidden
|
|
231
|
+
*/
|
|
232
|
+
const packageMetadata = {
|
|
233
|
+
name: '@progress/kendo-angular-filter',
|
|
234
|
+
productName: 'Kendo UI for Angular',
|
|
235
|
+
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
236
|
+
publishDate: 1672394769,
|
|
237
|
+
version: '',
|
|
238
|
+
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
class FilterValueEditorTemplateDirective {
|
|
242
|
+
constructor(templateRef) {
|
|
243
|
+
this.templateRef = templateRef;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
FilterValueEditorTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterValueEditorTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
247
|
+
FilterValueEditorTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: FilterValueEditorTemplateDirective, selector: "[kendoFilterValueEditorTemplate]", ngImport: i0 });
|
|
248
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterValueEditorTemplateDirective, decorators: [{
|
|
249
|
+
type: Directive,
|
|
250
|
+
args: [{
|
|
251
|
+
selector: '[kendoFilterValueEditorTemplate]'
|
|
252
|
+
}]
|
|
253
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Represents the [Kendo UI Filter Field component for Angular]({% slug api_filter_filterfieldcomponent %}).
|
|
257
|
+
* The Filter Field component can be used to add Filter Expressions declaratively.
|
|
258
|
+
* @example
|
|
259
|
+
* ```ts
|
|
260
|
+
* @Component({
|
|
261
|
+
* selector: 'my-app',
|
|
262
|
+
* template: `
|
|
263
|
+
* <kendo-filter (valueChange)="onValueChange($event)">
|
|
264
|
+
* <kendo-filter-field field="country" editor="string" [operators]="['neq', 'eq', 'contains']"></kendo-filter-field>
|
|
265
|
+
* <kendo-filter-field field="budget" editor="number"></kendo-filter-field>
|
|
266
|
+
* <kendo-filter-field field="discontinued" title="Discontinued" editor="boolean"></kendo-filter-field>
|
|
267
|
+
* <kendo-filter-field field="ordered on" title="Ordered on" editor="date"></kendo-filter-field>
|
|
268
|
+
* <kendo-filter>
|
|
269
|
+
* `
|
|
270
|
+
* })
|
|
271
|
+
* export class AppComponent {
|
|
272
|
+
* onValueChange(e: CompositeFilterDescriptor){
|
|
273
|
+
* console.log(e)
|
|
274
|
+
* }
|
|
275
|
+
* }
|
|
276
|
+
* ```
|
|
277
|
+
*/
|
|
278
|
+
class FilterFieldComponent {
|
|
279
|
+
/**
|
|
280
|
+
* Specifies the `title` text that will be displayed by the user-defined filter.
|
|
281
|
+
* If the `title` isn't set, the value passed to `field` is used.
|
|
282
|
+
*/
|
|
283
|
+
set title(_title) {
|
|
284
|
+
if (_title) {
|
|
285
|
+
this._title = _title;
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
this._title = this.field;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
get title() {
|
|
292
|
+
return this._title;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
FilterFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
296
|
+
FilterFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FilterFieldComponent, 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 });
|
|
297
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterFieldComponent, decorators: [{
|
|
298
|
+
type: Component,
|
|
299
|
+
args: [{
|
|
300
|
+
selector: 'kendo-filter-field',
|
|
301
|
+
template: ``
|
|
302
|
+
}]
|
|
303
|
+
}], propDecorators: { field: [{
|
|
304
|
+
type: Input
|
|
305
|
+
}], title: [{
|
|
306
|
+
type: Input
|
|
307
|
+
}], editor: [{
|
|
308
|
+
type: Input
|
|
309
|
+
}], operators: [{
|
|
310
|
+
type: Input
|
|
311
|
+
}], editorFormat: [{
|
|
312
|
+
type: Input
|
|
313
|
+
}], editorTemplate: [{
|
|
314
|
+
type: ContentChild,
|
|
315
|
+
args: [FilterValueEditorTemplateDirective]
|
|
316
|
+
}] } });
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* @hidden
|
|
320
|
+
*/
|
|
321
|
+
class NavigationService {
|
|
322
|
+
constructor(cdr, renderer) {
|
|
323
|
+
this.cdr = cdr;
|
|
324
|
+
this.renderer = renderer;
|
|
325
|
+
this.hierarchicalFilterItems = [];
|
|
326
|
+
this.flattenFilterItems = [];
|
|
327
|
+
this.currentToolbarItemIndex = 0;
|
|
328
|
+
this.currentToolbarItemChildrenIndex = 0;
|
|
329
|
+
this.isInnerNavigationActivated = false;
|
|
330
|
+
this.isFilterExpressionComponentFocused = false;
|
|
331
|
+
}
|
|
332
|
+
processKeyDown(key, event) {
|
|
333
|
+
switch (key) {
|
|
334
|
+
case Keys.ArrowUp: {
|
|
335
|
+
event.preventDefault();
|
|
336
|
+
if (!this.isInnerNavigationActivated) {
|
|
337
|
+
this.currentToolbarItemIndex > 0 ? this.currentToolbarItemIndex-- : this.currentToolbarItemIndex;
|
|
338
|
+
const elementToFocus = this.flattenFilterItems[this.currentToolbarItemIndex].toolbarElement;
|
|
339
|
+
this.focusCurrentElement(elementToFocus);
|
|
340
|
+
}
|
|
341
|
+
break;
|
|
342
|
+
}
|
|
343
|
+
case Keys.ArrowDown: {
|
|
344
|
+
event.preventDefault();
|
|
345
|
+
if (!this.isInnerNavigationActivated) {
|
|
346
|
+
this.currentToolbarItemIndex < this.flattenFilterItems.length - 1 ? this.currentToolbarItemIndex++ : this.currentToolbarItemIndex;
|
|
347
|
+
const elementToFocus = this.flattenFilterItems[this.currentToolbarItemIndex].toolbarElement;
|
|
348
|
+
this.focusCurrentElement(elementToFocus);
|
|
349
|
+
}
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
case Keys.Enter: {
|
|
353
|
+
const isEventTargetFilterToolbar = event.target.closest(selectors.kendoToolbar);
|
|
354
|
+
if (!this.isInnerNavigationActivated && isEventTargetFilterToolbar) {
|
|
355
|
+
event.preventDefault();
|
|
356
|
+
this.isInnerNavigationActivated = true;
|
|
357
|
+
this.currentToolbarItemChildrenIndex = 0;
|
|
358
|
+
const elementToFocus = this.flattenFilterItems[this.currentToolbarItemIndex].focusableChildren[this.currentToolbarItemChildrenIndex];
|
|
359
|
+
this.focusCurrentElement(elementToFocus);
|
|
360
|
+
}
|
|
361
|
+
const isEventTargetKendoFilterToolbarItem = event.target.closest(selectors.kendoFilterToolbarItem);
|
|
362
|
+
const isEventTargetButton = event.target.closest(selectors.kendoButton);
|
|
363
|
+
if (this.isInnerNavigationActivated &&
|
|
364
|
+
!this.isFilterExpressionComponentFocused &&
|
|
365
|
+
isEventTargetKendoFilterToolbarItem &&
|
|
366
|
+
!isEventTargetButton) {
|
|
367
|
+
event.preventDefault();
|
|
368
|
+
this.isFilterExpressionComponentFocused = true;
|
|
369
|
+
const focusableElement = this.flattenFilterItems[this.currentToolbarItemIndex].focusableChildren[this.currentToolbarItemChildrenIndex];
|
|
370
|
+
const elementToFocus = focusableElement.querySelector(selectors.KendoDropDownListComponent) ||
|
|
371
|
+
focusableElement.querySelector(selectors.kendoInputInner) ||
|
|
372
|
+
focusableElement.querySelector(selectors.inputElement) ||
|
|
373
|
+
focusableElement.querySelector(selectors.textAreaElement);
|
|
374
|
+
this.focusCurrentElement(elementToFocus);
|
|
375
|
+
}
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
case Keys.Escape: {
|
|
379
|
+
if (this.isInnerNavigationActivated && !this.isFilterExpressionComponentFocused) {
|
|
380
|
+
event.preventDefault();
|
|
381
|
+
this.isInnerNavigationActivated = false;
|
|
382
|
+
this.currentToolbarItemChildrenIndex = 0;
|
|
383
|
+
const elementToFocus = this.flattenFilterItems[this.currentToolbarItemIndex].toolbarElement;
|
|
384
|
+
this.focusCurrentElement(elementToFocus);
|
|
385
|
+
}
|
|
386
|
+
if (this.isFilterExpressionComponentFocused) {
|
|
387
|
+
event.preventDefault();
|
|
388
|
+
this.isFilterExpressionComponentFocused = false;
|
|
389
|
+
this.isInnerNavigationActivated = true;
|
|
390
|
+
const elementToFocus = this.flattenFilterItems[this.currentToolbarItemIndex].focusableChildren[this.currentToolbarItemChildrenIndex];
|
|
391
|
+
this.focusCurrentElement(elementToFocus);
|
|
392
|
+
}
|
|
393
|
+
break;
|
|
394
|
+
}
|
|
395
|
+
case Keys.ArrowRight: {
|
|
396
|
+
if (this.isInnerNavigationActivated && !this.isFilterExpressionComponentFocused) {
|
|
397
|
+
event.preventDefault();
|
|
398
|
+
this.currentToolbarItemChildrenIndex < this.flattenFilterItems[this.currentToolbarItemIndex].focusableChildren.length - 1 ? this.currentToolbarItemChildrenIndex++ : this.currentToolbarItemChildrenIndex;
|
|
399
|
+
const elementToFocus = this.flattenFilterItems[this.currentToolbarItemIndex].focusableChildren[this.currentToolbarItemChildrenIndex];
|
|
400
|
+
this.focusCurrentElement(elementToFocus);
|
|
401
|
+
}
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
case Keys.ArrowLeft: {
|
|
405
|
+
if (this.isInnerNavigationActivated && !this.isFilterExpressionComponentFocused) {
|
|
406
|
+
event.preventDefault();
|
|
407
|
+
this.currentToolbarItemChildrenIndex > 0 ? this.currentToolbarItemChildrenIndex-- : this.currentToolbarItemChildrenIndex;
|
|
408
|
+
const elementToFocus = this.flattenFilterItems[this.currentToolbarItemIndex].focusableChildren[this.currentToolbarItemChildrenIndex];
|
|
409
|
+
this.focusCurrentElement(elementToFocus);
|
|
410
|
+
}
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
default:
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
focusCurrentElement(element, isOnMouseDown) {
|
|
418
|
+
this.renderer.setAttribute(this.currentlyFocusedElement, 'tabindex', '-1');
|
|
419
|
+
this.currentlyFocusedElement = element;
|
|
420
|
+
if (element) {
|
|
421
|
+
this.renderer.setAttribute(this.currentlyFocusedElement, 'tabindex', '0');
|
|
422
|
+
if (!isOnMouseDown) {
|
|
423
|
+
this.currentlyFocusedElement.focus();
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
flattenHierarchicalFilterItems(filterItems) {
|
|
428
|
+
filterItems.forEach((filterRow) => {
|
|
429
|
+
const flattenItem = { component: filterRow, isGroup: false, toolbarElement: filterRow.toolbarElement, focusableChildren: [] };
|
|
430
|
+
this.flattenFilterItems.push(flattenItem);
|
|
431
|
+
if ((filterRow['operators'] && filterRow['filterItems']?.length > 0)) {
|
|
432
|
+
this.setGroupItemChildren(flattenItem, filterRow);
|
|
433
|
+
this.flattenHierarchicalFilterItems(filterRow['filterItems']);
|
|
434
|
+
}
|
|
435
|
+
else if (filterRow['operators'] && filterRow['filterItems']?.length === 0) {
|
|
436
|
+
this.setGroupItemChildren(flattenItem, filterRow);
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
flattenItem.focusableChildren.push(filterRow.toolbarElement.querySelector(selectors.filterFieldWrapper));
|
|
440
|
+
if (filterRow.toolbarElement.querySelector('.k-filter-operator')) {
|
|
441
|
+
flattenItem.focusableChildren.push(filterRow.toolbarElement.querySelector(selectors.filterOperatorWrapper));
|
|
442
|
+
}
|
|
443
|
+
flattenItem.focusableChildren.push(filterRow.toolbarElement.querySelector(selectors.filterValueEditorWrapper));
|
|
444
|
+
flattenItem.focusableChildren.push(filterRow.toolbarElement.querySelector(selectors.removeButton));
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
setGroupItemChildren(flattenItem, filterRow) {
|
|
449
|
+
flattenItem.isGroup = true;
|
|
450
|
+
flattenItem.focusableChildren.push(filterRow.toolbarElement.querySelector(selectors.andButton));
|
|
451
|
+
flattenItem.focusableChildren.push(filterRow.toolbarElement.querySelector(selectors.orButton));
|
|
452
|
+
flattenItem.focusableChildren.push(filterRow.toolbarElement.querySelector(selectors.addFilterButton));
|
|
453
|
+
flattenItem.focusableChildren.push(filterRow.toolbarElement.querySelector(selectors.addGroupButton));
|
|
454
|
+
flattenItem.focusableChildren.push(filterRow.toolbarElement.querySelector(selectors.removeButton));
|
|
455
|
+
}
|
|
456
|
+
setItemIndexes() {
|
|
457
|
+
this.flattenFilterItems.forEach((item, index) => {
|
|
458
|
+
item.component['itemNumber'] = index;
|
|
459
|
+
});
|
|
460
|
+
this.cdr.detectChanges();
|
|
461
|
+
}
|
|
462
|
+
reset(items) {
|
|
463
|
+
this.flattenFilterItems = [];
|
|
464
|
+
this.hierarchicalFilterItems = items;
|
|
465
|
+
this.flattenHierarchicalFilterItems(items);
|
|
466
|
+
this.setItemIndexes();
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
NavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NavigationService, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
470
|
+
NavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NavigationService });
|
|
471
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NavigationService, decorators: [{
|
|
472
|
+
type: Injectable
|
|
473
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }]; } });
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* @hidden
|
|
477
|
+
*/
|
|
478
|
+
const FilterErrorMessages = {
|
|
479
|
+
missingFilters: `Pass at least one user-defined filter through the [filters] input property or nest kendo-filter-field components. See http://www.telerik.com/kendo-angular-ui/components/filter/#data-binding`,
|
|
480
|
+
missingFilterForUsedField: (field) => `There is no user-defined filter with '${field}' field provided through the [filters] input property.`,
|
|
481
|
+
missingValueForBooleanField: (field) => `Provide a value for the boolean '${field}' user-defined filter as the operator is always set to 'eq'.`,
|
|
482
|
+
operatorBooleanField: (field) => `The operator of the boolean '${field}' user-defined filter is always set to 'eq'.`,
|
|
483
|
+
filterMissingUsedOperator: (field, operator) => `The user-defined filter with field '${field}' is missing the '${operator}' operator.`,
|
|
484
|
+
improperNumericEditorValue: (title) => `The provided value for the numeric editor of the '${title}' filter expression isn't one of a supported type string or NumberFormat. See http://www.telerik.com/kendo-angular-ui/components/filter/#editor-formats/`,
|
|
485
|
+
improperDateEditorValue: (title) => `The provided value for the date editor of the '${title}' filter expression isn't one of a supported type string or DateFormat. See http://www.telerik.com/kendo-angular-ui/components/filter/#editor-formats/`
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* @hidden
|
|
490
|
+
*/
|
|
491
|
+
class BaseFilterRowComponent {
|
|
492
|
+
constructor(element, navigationService, localization, renderer) {
|
|
493
|
+
this.element = element;
|
|
494
|
+
this.navigationService = navigationService;
|
|
495
|
+
this.localization = localization;
|
|
496
|
+
this.renderer = renderer;
|
|
497
|
+
this.valueChange = new EventEmitter();
|
|
498
|
+
}
|
|
499
|
+
get toolbarElement() {
|
|
500
|
+
return this.element.nativeElement.querySelector('.k-toolbar');
|
|
501
|
+
}
|
|
502
|
+
onFocus() {
|
|
503
|
+
this.renderer.addClass(this.navigationService.flattenFilterItems[this.itemNumber].toolbarElement, 'k-focus');
|
|
504
|
+
this.navigationService.isInnerNavigationActivated = false;
|
|
505
|
+
}
|
|
506
|
+
onBlur() {
|
|
507
|
+
this.renderer.removeClass(this.navigationService.flattenFilterItems[this.itemNumber].toolbarElement, 'k-focus');
|
|
508
|
+
}
|
|
509
|
+
messageFor(key) {
|
|
510
|
+
return this.localization.get(key);
|
|
511
|
+
}
|
|
512
|
+
onMouseDown(event) {
|
|
513
|
+
let elementToFocus;
|
|
514
|
+
const closestFilterToolbarItem = event.target.closest(selectors.kendoFilterToolbarItem);
|
|
515
|
+
const closestToolbarItem = event.target.closest(selectors.kendoToolbar);
|
|
516
|
+
if (closestFilterToolbarItem) {
|
|
517
|
+
const index = Array.from(closestToolbarItem.children).indexOf(closestFilterToolbarItem);
|
|
518
|
+
this.navigationService.currentToolbarItemChildrenIndex = index;
|
|
519
|
+
this.navigationService.isInnerNavigationActivated = true;
|
|
520
|
+
this.navigationService.isFilterExpressionComponentFocused = true;
|
|
521
|
+
const wrapperElement = this.navigationService.flattenFilterItems[this.itemNumber].focusableChildren[index];
|
|
522
|
+
elementToFocus = wrapperElement.querySelector(selectors.kendoDropDownListComponent) ||
|
|
523
|
+
wrapperElement.querySelector(selectors.kendoInput) ||
|
|
524
|
+
wrapperElement.querySelector(selectors.kendoInputInner) ||
|
|
525
|
+
wrapperElement.querySelector(selectors.inputElement) ||
|
|
526
|
+
wrapperElement.querySelector(selectors.textAreaElement);
|
|
527
|
+
}
|
|
528
|
+
else {
|
|
529
|
+
this.navigationService.currentToolbarItemChildrenIndex = 0;
|
|
530
|
+
this.navigationService.isInnerNavigationActivated = false;
|
|
531
|
+
this.navigationService.isFilterExpressionComponentFocused = false;
|
|
532
|
+
elementToFocus = this.navigationService.flattenFilterItems[this.itemNumber].toolbarElement;
|
|
533
|
+
}
|
|
534
|
+
this.navigationService.currentToolbarItemIndex = this.itemNumber;
|
|
535
|
+
this.navigationService.focusCurrentElement(elementToFocus, true);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
BaseFilterRowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BaseFilterRowComponent, deps: [{ token: i0.ElementRef }, { token: NavigationService }, { token: i1.LocalizationService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
539
|
+
BaseFilterRowComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: BaseFilterRowComponent, inputs: { index: "index" }, outputs: { valueChange: "valueChange" }, ngImport: i0 });
|
|
540
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BaseFilterRowComponent, decorators: [{
|
|
541
|
+
type: Directive,
|
|
542
|
+
args: [{}]
|
|
543
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: NavigationService }, { type: i1.LocalizationService }, { type: i0.Renderer2 }]; }, propDecorators: { index: [{
|
|
544
|
+
type: Input
|
|
545
|
+
}], valueChange: [{
|
|
546
|
+
type: Output
|
|
547
|
+
}] } });
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* @hidden
|
|
551
|
+
*/
|
|
552
|
+
class AriaLabelValueDirective {
|
|
553
|
+
constructor(hostElement, renderer) {
|
|
554
|
+
this.hostElement = hostElement;
|
|
555
|
+
this.renderer = renderer;
|
|
556
|
+
}
|
|
557
|
+
ngOnInit() {
|
|
558
|
+
const target = this.hostElement.nativeElement.querySelector('input') || this.hostElement.nativeElement;
|
|
559
|
+
this.renderer.setAttribute(target, 'aria-label', this.ariaLabel);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
AriaLabelValueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AriaLabelValueDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
563
|
+
AriaLabelValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: { ariaLabel: ["kendoAriaLabelValue", "ariaLabel"] }, ngImport: i0 });
|
|
564
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AriaLabelValueDirective, decorators: [{
|
|
565
|
+
type: Directive,
|
|
566
|
+
args: [{ selector: '[kendoAriaLabelValue]' }]
|
|
567
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { ariaLabel: [{
|
|
568
|
+
type: Input,
|
|
569
|
+
args: ['kendoAriaLabelValue']
|
|
570
|
+
}] } });
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* @hidden
|
|
574
|
+
*/
|
|
575
|
+
class FilterExpressionOperatorsComponent {
|
|
576
|
+
constructor(localization) {
|
|
577
|
+
this.localization = localization;
|
|
578
|
+
this.valueChange = new EventEmitter();
|
|
579
|
+
this.operators = [];
|
|
580
|
+
}
|
|
581
|
+
messageFor(key) {
|
|
582
|
+
return this.localization.get(key);
|
|
583
|
+
}
|
|
584
|
+
getOperator(operatorValue) {
|
|
585
|
+
return this.messageFor(getKeyByValue(defaultOperators[this.editorType], operatorValue));
|
|
586
|
+
}
|
|
587
|
+
operatorValueChange(value) {
|
|
588
|
+
this.valueChange.emit(value);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
FilterExpressionOperatorsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterExpressionOperatorsComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
592
|
+
FilterExpressionOperatorsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FilterExpressionOperatorsComponent, selector: "kendo-filter-expression-operators", inputs: { currentItem: "currentItem", editorType: "editorType", operators: "operators" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
593
|
+
<kendo-dropdownlist
|
|
594
|
+
[tabindex]="-1"
|
|
595
|
+
[kendoAriaLabelValue]="messageFor('filterOperatorAriaLabel')"
|
|
596
|
+
[data]="operators"
|
|
597
|
+
[title]="messageFor('filterExpressionOperators')"
|
|
598
|
+
[(value)]="currentItem.operator"
|
|
599
|
+
(valueChange)="operatorValueChange($event)"
|
|
600
|
+
[valuePrimitive]="true"
|
|
601
|
+
textField="text"
|
|
602
|
+
valueField="value"
|
|
603
|
+
>
|
|
604
|
+
<ng-template kendoDropDownListValueTemplate let-dataItem>
|
|
605
|
+
{{ getOperator(dataItem.value) }}
|
|
606
|
+
</ng-template>
|
|
607
|
+
<ng-template kendoDropDownListItemTemplate let-dataItem>
|
|
608
|
+
{{ getOperator(dataItem.value) }}
|
|
609
|
+
</ng-template>
|
|
610
|
+
</kendo-dropdownlist>
|
|
611
|
+
`, isInline: true, components: [{ type: i2.DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["iconClass", "loading", "data", "value", "textField", "valueField", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }], directives: [{ type: AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }, { type: i2.ValueTemplateDirective, selector: "[kendoDropDownListValueTemplate],[kendoDropDownTreeValueTemplate]" }, { type: i2.ItemTemplateDirective, selector: "[kendoDropDownListItemTemplate],[kendoComboBoxItemTemplate],[kendoAutoCompleteItemTemplate],[kendoMultiSelectItemTemplate]" }] });
|
|
612
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterExpressionOperatorsComponent, decorators: [{
|
|
613
|
+
type: Component,
|
|
614
|
+
args: [{
|
|
615
|
+
selector: "kendo-filter-expression-operators",
|
|
616
|
+
template: `
|
|
617
|
+
<kendo-dropdownlist
|
|
618
|
+
[tabindex]="-1"
|
|
619
|
+
[kendoAriaLabelValue]="messageFor('filterOperatorAriaLabel')"
|
|
620
|
+
[data]="operators"
|
|
621
|
+
[title]="messageFor('filterExpressionOperators')"
|
|
622
|
+
[(value)]="currentItem.operator"
|
|
623
|
+
(valueChange)="operatorValueChange($event)"
|
|
624
|
+
[valuePrimitive]="true"
|
|
625
|
+
textField="text"
|
|
626
|
+
valueField="value"
|
|
627
|
+
>
|
|
628
|
+
<ng-template kendoDropDownListValueTemplate let-dataItem>
|
|
629
|
+
{{ getOperator(dataItem.value) }}
|
|
630
|
+
</ng-template>
|
|
631
|
+
<ng-template kendoDropDownListItemTemplate let-dataItem>
|
|
632
|
+
{{ getOperator(dataItem.value) }}
|
|
633
|
+
</ng-template>
|
|
634
|
+
</kendo-dropdownlist>
|
|
635
|
+
`
|
|
636
|
+
}]
|
|
637
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { currentItem: [{
|
|
638
|
+
type: Input
|
|
639
|
+
}], editorType: [{
|
|
640
|
+
type: Input
|
|
641
|
+
}], valueChange: [{
|
|
642
|
+
type: Output
|
|
643
|
+
}], operators: [{
|
|
644
|
+
type: Input
|
|
645
|
+
}] } });
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* @hidden
|
|
649
|
+
*/
|
|
650
|
+
class FilterTextEditorComponent {
|
|
651
|
+
constructor(localization) {
|
|
652
|
+
this.localization = localization;
|
|
653
|
+
this.valueChange = new EventEmitter();
|
|
654
|
+
}
|
|
655
|
+
messageFor(key) {
|
|
656
|
+
return this.localization.get(key);
|
|
657
|
+
}
|
|
658
|
+
onValueChange(value) {
|
|
659
|
+
this.currentItem.value = value;
|
|
660
|
+
this.valueChange.emit();
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
FilterTextEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterTextEditorComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
664
|
+
FilterTextEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FilterTextEditorComponent, selector: "kendo-filter-text-editor", inputs: { currentItem: "currentItem", isDisabled: "isDisabled" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
665
|
+
<kendo-textbox
|
|
666
|
+
[tabindex]="-1"
|
|
667
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
668
|
+
[value]="currentItem.value"
|
|
669
|
+
(valueChange)="onValueChange($event)"
|
|
670
|
+
[disabled]="isDisabled">
|
|
671
|
+
</kendo-textbox>
|
|
672
|
+
`, isInline: true, components: [{ type: i2$1.TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "errorIcon", "clearButtonIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }], directives: [{ type: AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }] });
|
|
673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterTextEditorComponent, decorators: [{
|
|
674
|
+
type: Component,
|
|
675
|
+
args: [{
|
|
676
|
+
selector: 'kendo-filter-text-editor',
|
|
677
|
+
template: `
|
|
678
|
+
<kendo-textbox
|
|
679
|
+
[tabindex]="-1"
|
|
680
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
681
|
+
[value]="currentItem.value"
|
|
682
|
+
(valueChange)="onValueChange($event)"
|
|
683
|
+
[disabled]="isDisabled">
|
|
684
|
+
</kendo-textbox>
|
|
685
|
+
`
|
|
686
|
+
}]
|
|
687
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { currentItem: [{
|
|
688
|
+
type: Input
|
|
689
|
+
}], isDisabled: [{
|
|
690
|
+
type: Input
|
|
691
|
+
}], valueChange: [{
|
|
692
|
+
type: Output
|
|
693
|
+
}] } });
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* @hidden
|
|
697
|
+
*/
|
|
698
|
+
class FilterNumericEditorComponent {
|
|
699
|
+
constructor(localization) {
|
|
700
|
+
this.localization = localization;
|
|
701
|
+
this.valueChange = new EventEmitter();
|
|
702
|
+
}
|
|
703
|
+
messageFor(key) {
|
|
704
|
+
return this.localization.get(key);
|
|
705
|
+
}
|
|
706
|
+
onValueChange(value) {
|
|
707
|
+
this.currentItem.value = value;
|
|
708
|
+
this.valueChange.emit();
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
FilterNumericEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterNumericEditorComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
712
|
+
FilterNumericEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FilterNumericEditorComponent, selector: "kendo-filter-numeric-editor", inputs: { currentItem: "currentItem", isDisabled: "isDisabled", format: "format" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
713
|
+
<kendo-numerictextbox
|
|
714
|
+
[tabindex]="-1"
|
|
715
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
716
|
+
[value]="currentItem.value"
|
|
717
|
+
(valueChange)="onValueChange($event)"
|
|
718
|
+
[disabled]="isDisabled"
|
|
719
|
+
[format]="format">
|
|
720
|
+
<kendo-numerictextbox-messages
|
|
721
|
+
[increment]="messageFor('editorNumericIncrement')"
|
|
722
|
+
[decrement]="messageFor('editorNumericDecrement')">
|
|
723
|
+
</kendo-numerictextbox-messages>
|
|
724
|
+
</kendo-numerictextbox>
|
|
725
|
+
`, isInline: true, components: [{ type: i2$1.NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode"], outputs: ["valueChange", "focus", "blur"], exportAs: ["kendoNumericTextBox"] }, { type: i2$1.NumericTextBoxCustomMessagesComponent, selector: "kendo-numerictextbox-messages" }], directives: [{ type: AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }] });
|
|
726
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterNumericEditorComponent, decorators: [{
|
|
727
|
+
type: Component,
|
|
728
|
+
args: [{
|
|
729
|
+
selector: 'kendo-filter-numeric-editor',
|
|
730
|
+
template: `
|
|
731
|
+
<kendo-numerictextbox
|
|
732
|
+
[tabindex]="-1"
|
|
733
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
734
|
+
[value]="currentItem.value"
|
|
735
|
+
(valueChange)="onValueChange($event)"
|
|
736
|
+
[disabled]="isDisabled"
|
|
737
|
+
[format]="format">
|
|
738
|
+
<kendo-numerictextbox-messages
|
|
739
|
+
[increment]="messageFor('editorNumericIncrement')"
|
|
740
|
+
[decrement]="messageFor('editorNumericDecrement')">
|
|
741
|
+
</kendo-numerictextbox-messages>
|
|
742
|
+
</kendo-numerictextbox>
|
|
743
|
+
`
|
|
744
|
+
}]
|
|
745
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { currentItem: [{
|
|
746
|
+
type: Input
|
|
747
|
+
}], isDisabled: [{
|
|
748
|
+
type: Input
|
|
749
|
+
}], format: [{
|
|
750
|
+
type: Input
|
|
751
|
+
}], valueChange: [{
|
|
752
|
+
type: Output
|
|
753
|
+
}] } });
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* @hidden
|
|
757
|
+
*/
|
|
758
|
+
class FilterBooleanEditorComponent {
|
|
759
|
+
constructor(localization, cdr) {
|
|
760
|
+
this.localization = localization;
|
|
761
|
+
this.cdr = cdr;
|
|
762
|
+
this.valueChange = new EventEmitter();
|
|
763
|
+
this.items = this.getValueItems();
|
|
764
|
+
this.defaultItem = this.getDefaultItem();
|
|
765
|
+
}
|
|
766
|
+
ngOnInit() {
|
|
767
|
+
this.localizationSubscription = this.localization.changes.subscribe(() => {
|
|
768
|
+
this.defaultItem = this.getDefaultItem();
|
|
769
|
+
this.items = this.getValueItems();
|
|
770
|
+
this.cdr.detectChanges();
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
getDefaultItem() {
|
|
774
|
+
return { text: this.localization.get("filterBooleanAll"), value: null };
|
|
775
|
+
}
|
|
776
|
+
getValueItems() {
|
|
777
|
+
return [
|
|
778
|
+
{ text: this.localization.get("filterIsTrue"), value: true },
|
|
779
|
+
{ text: this.localization.get("filterIsFalse"), value: false }
|
|
780
|
+
];
|
|
781
|
+
}
|
|
782
|
+
ngOnDestroy() {
|
|
783
|
+
if (this.localizationSubscription) {
|
|
784
|
+
this.localizationSubscription.unsubscribe();
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
messageFor(key) {
|
|
788
|
+
return this.localization.get(key);
|
|
789
|
+
}
|
|
790
|
+
onValueChange(value) {
|
|
791
|
+
this.currentItem.value = value;
|
|
792
|
+
this.valueChange.emit();
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
FilterBooleanEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterBooleanEditorComponent, deps: [{ token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
796
|
+
FilterBooleanEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FilterBooleanEditorComponent, selector: "kendo-filter-boolean-editor", inputs: { currentItem: "currentItem" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
797
|
+
<kendo-dropdownlist
|
|
798
|
+
[tabindex]="-1"
|
|
799
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
800
|
+
[value]="currentItem.value"
|
|
801
|
+
(valueChange)="onValueChange($event)"
|
|
802
|
+
[data]="items"
|
|
803
|
+
[defaultItem]="defaultItem"
|
|
804
|
+
[valuePrimitive]="true"
|
|
805
|
+
textField="text"
|
|
806
|
+
valueField="value"
|
|
807
|
+
>
|
|
808
|
+
</kendo-dropdownlist>
|
|
809
|
+
`, isInline: true, components: [{ type: i2.DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["iconClass", "loading", "data", "value", "textField", "valueField", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }], directives: [{ type: AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }] });
|
|
810
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterBooleanEditorComponent, decorators: [{
|
|
811
|
+
type: Component,
|
|
812
|
+
args: [{
|
|
813
|
+
selector: 'kendo-filter-boolean-editor',
|
|
814
|
+
template: `
|
|
815
|
+
<kendo-dropdownlist
|
|
816
|
+
[tabindex]="-1"
|
|
817
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
818
|
+
[value]="currentItem.value"
|
|
819
|
+
(valueChange)="onValueChange($event)"
|
|
820
|
+
[data]="items"
|
|
821
|
+
[defaultItem]="defaultItem"
|
|
822
|
+
[valuePrimitive]="true"
|
|
823
|
+
textField="text"
|
|
824
|
+
valueField="value"
|
|
825
|
+
>
|
|
826
|
+
</kendo-dropdownlist>
|
|
827
|
+
`
|
|
828
|
+
}]
|
|
829
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { currentItem: [{
|
|
830
|
+
type: Input
|
|
831
|
+
}], valueChange: [{
|
|
832
|
+
type: Output
|
|
833
|
+
}] } });
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* @hidden
|
|
837
|
+
*/
|
|
838
|
+
class FilterDateEditorComponent {
|
|
839
|
+
constructor(localization) {
|
|
840
|
+
this.localization = localization;
|
|
841
|
+
this.valueChange = new EventEmitter();
|
|
842
|
+
}
|
|
843
|
+
messageFor(key) {
|
|
844
|
+
return this.localization.get(key);
|
|
845
|
+
}
|
|
846
|
+
onValueChange(value) {
|
|
847
|
+
this.currentItem.value = value;
|
|
848
|
+
this.valueChange.emit();
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
FilterDateEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterDateEditorComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
852
|
+
FilterDateEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FilterDateEditorComponent, selector: "kendo-filter-date-editor", inputs: { currentItem: "currentItem", isDisabled: "isDisabled", format: "format" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
853
|
+
<kendo-datepicker
|
|
854
|
+
[tabindex]="-1"
|
|
855
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
856
|
+
[value]="currentItem.value"
|
|
857
|
+
(valueChange)="onValueChange($event)"
|
|
858
|
+
[disabled]="isDisabled"
|
|
859
|
+
[format]="format">
|
|
860
|
+
<kendo-datepicker-messages
|
|
861
|
+
[toggle]="messageFor('editorDateToggleText')"
|
|
862
|
+
[today]="messageFor('editorDateTodayText')">
|
|
863
|
+
</kendo-datepicker-messages>
|
|
864
|
+
</kendo-datepicker>
|
|
865
|
+
`, isInline: true, components: [{ type: i2$2.DatePickerComponent, selector: "kendo-datepicker", inputs: ["cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "navigationItemTemplate", "activeView", "bottomView", "topView", "calendarType", "animateCalendarNavigation", "disabled", "readonly", "readOnlyInput", "popupSettings", "navigation", "min", "max", "incompleteDateValidation", "focusedDate", "value", "format", "twoDigitYearMax", "formatPlaceholder", "placeholder", "tabindex", "tabIndex", "disabledDates", "title", "rangeValidation", "disabledDatesValidation", "weekNumber", "size", "rounded", "fillMode"], outputs: ["valueChange", "focus", "blur", "open", "close"], exportAs: ["kendo-datepicker"] }, { type: i2$2.DatePickerCustomMessagesComponent, selector: "kendo-datepicker-messages" }], directives: [{ type: AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }] });
|
|
866
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterDateEditorComponent, decorators: [{
|
|
867
|
+
type: Component,
|
|
868
|
+
args: [{
|
|
869
|
+
selector: 'kendo-filter-date-editor',
|
|
870
|
+
template: `
|
|
871
|
+
<kendo-datepicker
|
|
872
|
+
[tabindex]="-1"
|
|
873
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
874
|
+
[value]="currentItem.value"
|
|
875
|
+
(valueChange)="onValueChange($event)"
|
|
876
|
+
[disabled]="isDisabled"
|
|
877
|
+
[format]="format">
|
|
878
|
+
<kendo-datepicker-messages
|
|
879
|
+
[toggle]="messageFor('editorDateToggleText')"
|
|
880
|
+
[today]="messageFor('editorDateTodayText')">
|
|
881
|
+
</kendo-datepicker-messages>
|
|
882
|
+
</kendo-datepicker>
|
|
883
|
+
`
|
|
884
|
+
}]
|
|
885
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { currentItem: [{
|
|
886
|
+
type: Input
|
|
887
|
+
}], isDisabled: [{
|
|
888
|
+
type: Input
|
|
889
|
+
}], format: [{
|
|
890
|
+
type: Input
|
|
891
|
+
}], valueChange: [{
|
|
892
|
+
type: Output
|
|
893
|
+
}] } });
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* @hidden
|
|
897
|
+
*/
|
|
898
|
+
class FilterExpressionComponent extends BaseFilterRowComponent {
|
|
899
|
+
constructor(filterService, cdr, element, navigationService, localization, renderer) {
|
|
900
|
+
super(element, navigationService, localization, renderer);
|
|
901
|
+
this.filterService = filterService;
|
|
902
|
+
this.cdr = cdr;
|
|
903
|
+
this.operators = [];
|
|
904
|
+
this.filters = [];
|
|
905
|
+
this.isBoolean = false;
|
|
906
|
+
this.isEditorDisabled = false;
|
|
907
|
+
}
|
|
908
|
+
get currentFilterExpression() {
|
|
909
|
+
return this.getFilterExpressionByField(this.currentItem.field);
|
|
910
|
+
}
|
|
911
|
+
get numericEditorFormat() {
|
|
912
|
+
const isSupportedFormat = typeof this.editorFormat !== 'string' && !this.isNumberFormat(this.editorFormat);
|
|
913
|
+
if (this.editorFormat && isSupportedFormat) {
|
|
914
|
+
console.warn(FilterErrorMessages.improperNumericEditorValue(this.currentFilterExpression.title));
|
|
915
|
+
}
|
|
916
|
+
return this.editorFormat;
|
|
917
|
+
}
|
|
918
|
+
get dateEditorFormat() {
|
|
919
|
+
const isSupportedFormat = typeof this.editorFormat !== 'string' && !this.isDateFormat(this.editorFormat);
|
|
920
|
+
if (this.editorFormat && isSupportedFormat) {
|
|
921
|
+
console.warn(FilterErrorMessages.improperDateEditorValue(this.currentFilterExpression.title));
|
|
922
|
+
}
|
|
923
|
+
return this.editorFormat;
|
|
924
|
+
}
|
|
925
|
+
isNumberFormat(obj) {
|
|
926
|
+
if (isDevMode() && obj &&
|
|
927
|
+
(obj['currency'] ||
|
|
928
|
+
obj['currencyDisplay'] ||
|
|
929
|
+
obj['maximumFractionDigits'] ||
|
|
930
|
+
obj['minimumIntegerDigits'] ||
|
|
931
|
+
obj['style'] ||
|
|
932
|
+
obj['useGrouping'])) {
|
|
933
|
+
return true;
|
|
934
|
+
}
|
|
935
|
+
else {
|
|
936
|
+
return false;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
isDateFormat(obj) {
|
|
940
|
+
if (isDevMode() && obj && obj['displayFormat'] && obj['inputFormat']) {
|
|
941
|
+
return true;
|
|
942
|
+
}
|
|
943
|
+
else {
|
|
944
|
+
return false;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
ngOnInit() {
|
|
948
|
+
this.isEditorDisabled = nullOperators.indexOf(this.currentItem.operator) >= 0;
|
|
949
|
+
this.filters = this.filterService.filters;
|
|
950
|
+
const foundFilter = this.getFilterExpressionByField(this.currentItem.field);
|
|
951
|
+
if (this.currentItem.field) {
|
|
952
|
+
this.setOperators(foundFilter);
|
|
953
|
+
}
|
|
954
|
+
if (foundFilter?.editorFormat) {
|
|
955
|
+
this.editorFormat = foundFilter.editorFormat;
|
|
956
|
+
}
|
|
957
|
+
const defaultFilter = this.getFilterExpressionByField(this.filterService.filters[0].field);
|
|
958
|
+
if (!this.currentItem.field) {
|
|
959
|
+
this.currentItem.field = this.filterService.filters[0].field;
|
|
960
|
+
this.setOperators(defaultFilter);
|
|
961
|
+
}
|
|
962
|
+
this.setEditorTemplate();
|
|
963
|
+
this.localizationSubscription = this.localization.changes.subscribe(() => {
|
|
964
|
+
this.setOperators(foundFilter || defaultFilter);
|
|
965
|
+
this.cdr.detectChanges();
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
ngOnDestroy() {
|
|
969
|
+
if (this.localizationSubscription) {
|
|
970
|
+
this.localizationSubscription.unsubscribe();
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
normalizeOperators(filterEditor, operators) {
|
|
974
|
+
const result = [];
|
|
975
|
+
for (let j = 0; j < operators.length; j++) {
|
|
976
|
+
if (isFilterEditor(filterEditor)) {
|
|
977
|
+
result.push({
|
|
978
|
+
value: operators[j],
|
|
979
|
+
text: this.localization.get(getKeyByValue(defaultOperators[filterEditor], operators[j]))
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
return result;
|
|
984
|
+
}
|
|
985
|
+
getFilterExpressionByField(name) {
|
|
986
|
+
const foundFilter = this.filterService.filters.find(filter => filter.field === name);
|
|
987
|
+
if (foundFilter) {
|
|
988
|
+
return foundFilter;
|
|
989
|
+
}
|
|
990
|
+
return null;
|
|
991
|
+
}
|
|
992
|
+
filterValueChange(value) {
|
|
993
|
+
this.navigationService.currentToolbarItemIndex = this.itemNumber;
|
|
994
|
+
this.navigationService.currentToolbarItemChildrenIndex = 0;
|
|
995
|
+
this.currentItem.value = null;
|
|
996
|
+
this.currentItem.field = value;
|
|
997
|
+
this.setEditorTemplate();
|
|
998
|
+
const foundFilter = this.getFilterExpressionByField(this.currentItem.field);
|
|
999
|
+
this.setOperators(foundFilter);
|
|
1000
|
+
this.editorFormat = foundFilter.editorFormat;
|
|
1001
|
+
this.valueChange.emit();
|
|
1002
|
+
}
|
|
1003
|
+
getDefaultOperators(operatorsType) {
|
|
1004
|
+
switch (operatorsType) {
|
|
1005
|
+
case 'string':
|
|
1006
|
+
return localizeOperators(defaultStringOperators)(this.localization);
|
|
1007
|
+
case 'number':
|
|
1008
|
+
return localizeOperators(defaultNumericOperators)(this.localization);
|
|
1009
|
+
case 'date':
|
|
1010
|
+
return localizeOperators(defaultDateOperators)(this.localization);
|
|
1011
|
+
default:
|
|
1012
|
+
break;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
getEditorType() {
|
|
1016
|
+
const item = this.filterService.filters.find((filterExpression) => filterExpression.field === this.currentItem.field);
|
|
1017
|
+
return item.editor;
|
|
1018
|
+
}
|
|
1019
|
+
removeFilterExpression() {
|
|
1020
|
+
this.filterService.remove(this.currentItem, this.index);
|
|
1021
|
+
this.valueChange.emit(true);
|
|
1022
|
+
}
|
|
1023
|
+
setOperators(filter) {
|
|
1024
|
+
this.isBoolean = filter.editor === 'boolean';
|
|
1025
|
+
if (this.isBoolean) {
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
if (filter.operators) {
|
|
1029
|
+
const localizedOperators = this.normalizeOperators(filter.editor, filter.operators);
|
|
1030
|
+
this.operators = localizedOperators;
|
|
1031
|
+
}
|
|
1032
|
+
else {
|
|
1033
|
+
this.operators = this.getDefaultOperators(filter.editor);
|
|
1034
|
+
}
|
|
1035
|
+
if (!this.currentItem.operator) {
|
|
1036
|
+
this.currentItem.operator = this.operators[0].value;
|
|
1037
|
+
}
|
|
1038
|
+
const operatorDoesNotExist = !this.operators.find(operator => operator.value === this.currentItem.operator);
|
|
1039
|
+
if (this.currentItem.operator && operatorDoesNotExist) {
|
|
1040
|
+
this.currentItem.operator = this.operators[0].value;
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
onOperatorChange(value) {
|
|
1044
|
+
this.navigationService.currentToolbarItemIndex = this.itemNumber;
|
|
1045
|
+
this.navigationService.currentToolbarItemChildrenIndex = 1;
|
|
1046
|
+
this.valueChange.emit();
|
|
1047
|
+
if (nullOperators.includes(value)) {
|
|
1048
|
+
this.currentItem.value = null;
|
|
1049
|
+
this.isEditorDisabled = true;
|
|
1050
|
+
}
|
|
1051
|
+
else {
|
|
1052
|
+
this.isEditorDisabled = false;
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
setEditorTemplate() {
|
|
1056
|
+
const filterExpression = this.filterService.filters.find((filter) => filter.field === this.currentItem.field);
|
|
1057
|
+
this.editorTemplate = filterExpression.editorTemplate ? filterExpression.editorTemplate : null;
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
FilterExpressionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterExpressionComponent, deps: [{ token: FilterService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: NavigationService }, { token: i1.LocalizationService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
1061
|
+
FilterExpressionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FilterExpressionComponent, selector: "kendo-filter-expression", inputs: { currentItem: "currentItem" }, providers: [{
|
|
1062
|
+
provide: FilterItem,
|
|
1063
|
+
useExisting: forwardRef(() => FilterExpressionComponent)
|
|
1064
|
+
}], usesInheritance: true, ngImport: i0, template: `
|
|
1065
|
+
<div class="k-filter-toolbar">
|
|
1066
|
+
<div class="k-toolbar" role="toolbar" [attr.aria-label]="messageFor('filterToolbarAriaLabel')" (focus)="onFocus()" (focusout)="onBlur()" (mousedown)="onMouseDown($event)">
|
|
1067
|
+
<div class="k-filter-toolbar-item k-filter-field k-toolbar-item" >
|
|
1068
|
+
<kendo-dropdownlist
|
|
1069
|
+
[tabindex]="-1"
|
|
1070
|
+
[kendoAriaLabelValue]="messageFor('filterFieldAriaLabel')"
|
|
1071
|
+
[title]="messageFor('filterExpressionFilters')"
|
|
1072
|
+
[data]="filters"
|
|
1073
|
+
textField="title"
|
|
1074
|
+
valueField="field"
|
|
1075
|
+
[value]="currentItem.field"
|
|
1076
|
+
[valuePrimitive]="true"
|
|
1077
|
+
(valueChange)="filterValueChange($event)">
|
|
1078
|
+
</kendo-dropdownlist>
|
|
1079
|
+
</div>
|
|
1080
|
+
<div *ngIf="!isBoolean" class="k-filter-toolbar-item k-filter-operator k-toolbar-item" >
|
|
1081
|
+
<kendo-filter-expression-operators
|
|
1082
|
+
[currentItem]="currentItem"
|
|
1083
|
+
[operators]="operators"
|
|
1084
|
+
[editorType]="getEditorType()"
|
|
1085
|
+
(valueChange)="onOperatorChange($event);">
|
|
1086
|
+
</kendo-filter-expression-operators>
|
|
1087
|
+
</div>
|
|
1088
|
+
|
|
1089
|
+
<div class="k-filter-toolbar-item k-filter-value k-toolbar-item">
|
|
1090
|
+
<ng-container *ngIf="!editorTemplate" [ngSwitch]="getEditorType()">
|
|
1091
|
+
<kendo-filter-text-editor *ngSwitchCase="'string'" [currentItem]="currentItem" [isDisabled]="isEditorDisabled" (valueChange)="valueChange.emit()"></kendo-filter-text-editor>
|
|
1092
|
+
<kendo-filter-numeric-editor *ngSwitchCase="'number'" [currentItem]="currentItem" [isDisabled]="isEditorDisabled" [format]="numericEditorFormat" (valueChange)="valueChange.emit()"></kendo-filter-numeric-editor>
|
|
1093
|
+
<kendo-filter-boolean-editor *ngSwitchCase="'boolean'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-boolean-editor>
|
|
1094
|
+
<kendo-filter-date-editor *ngSwitchCase="'date'" [currentItem]="currentItem" [isDisabled]="isEditorDisabled" [format]="dateEditorFormat" (valueChange)="valueChange.emit()"></kendo-filter-date-editor>
|
|
1095
|
+
</ng-container>
|
|
1096
|
+
<ng-container *ngIf="editorTemplate">
|
|
1097
|
+
<ng-template
|
|
1098
|
+
[templateContext]="{templateRef: editorTemplate, $implicit: currentItem}">
|
|
1099
|
+
</ng-template>
|
|
1100
|
+
</ng-container>
|
|
1101
|
+
</div>
|
|
1102
|
+
|
|
1103
|
+
<div class="k-filter-toolbar-item k-toolbar-item" >
|
|
1104
|
+
<button
|
|
1105
|
+
kendoButton
|
|
1106
|
+
tabindex="-1"
|
|
1107
|
+
icon="x"
|
|
1108
|
+
fillMode="flat"
|
|
1109
|
+
[title]="messageFor('remove')"
|
|
1110
|
+
(click)="removeFilterExpression()">
|
|
1111
|
+
</button>
|
|
1112
|
+
</div>
|
|
1113
|
+
</div>
|
|
1114
|
+
</div>
|
|
1115
|
+
`, isInline: true, components: [{ type: i2.DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["iconClass", "loading", "data", "value", "textField", "valueField", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }, { type: FilterExpressionOperatorsComponent, selector: "kendo-filter-expression-operators", inputs: ["currentItem", "editorType", "operators"], outputs: ["valueChange"] }, { type: FilterTextEditorComponent, selector: "kendo-filter-text-editor", inputs: ["currentItem", "isDisabled"], outputs: ["valueChange"] }, { type: FilterNumericEditorComponent, selector: "kendo-filter-numeric-editor", inputs: ["currentItem", "isDisabled", "format"], outputs: ["valueChange"] }, { type: FilterBooleanEditorComponent, selector: "kendo-filter-boolean-editor", inputs: ["currentItem"], outputs: ["valueChange"] }, { type: FilterDateEditorComponent, selector: "kendo-filter-date-editor", inputs: ["currentItem", "isDisabled", "format"], outputs: ["valueChange"] }, { type: i10.Button, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }], directives: [{ type: AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }, { type: i12.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i12.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i12.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i10.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }] });
|
|
1116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterExpressionComponent, decorators: [{
|
|
1117
|
+
type: Component,
|
|
1118
|
+
args: [{
|
|
1119
|
+
providers: [{
|
|
1120
|
+
provide: FilterItem,
|
|
1121
|
+
useExisting: forwardRef(() => FilterExpressionComponent)
|
|
1122
|
+
}],
|
|
1123
|
+
selector: 'kendo-filter-expression',
|
|
1124
|
+
template: `
|
|
1125
|
+
<div class="k-filter-toolbar">
|
|
1126
|
+
<div class="k-toolbar" role="toolbar" [attr.aria-label]="messageFor('filterToolbarAriaLabel')" (focus)="onFocus()" (focusout)="onBlur()" (mousedown)="onMouseDown($event)">
|
|
1127
|
+
<div class="k-filter-toolbar-item k-filter-field k-toolbar-item" >
|
|
1128
|
+
<kendo-dropdownlist
|
|
1129
|
+
[tabindex]="-1"
|
|
1130
|
+
[kendoAriaLabelValue]="messageFor('filterFieldAriaLabel')"
|
|
1131
|
+
[title]="messageFor('filterExpressionFilters')"
|
|
1132
|
+
[data]="filters"
|
|
1133
|
+
textField="title"
|
|
1134
|
+
valueField="field"
|
|
1135
|
+
[value]="currentItem.field"
|
|
1136
|
+
[valuePrimitive]="true"
|
|
1137
|
+
(valueChange)="filterValueChange($event)">
|
|
1138
|
+
</kendo-dropdownlist>
|
|
1139
|
+
</div>
|
|
1140
|
+
<div *ngIf="!isBoolean" class="k-filter-toolbar-item k-filter-operator k-toolbar-item" >
|
|
1141
|
+
<kendo-filter-expression-operators
|
|
1142
|
+
[currentItem]="currentItem"
|
|
1143
|
+
[operators]="operators"
|
|
1144
|
+
[editorType]="getEditorType()"
|
|
1145
|
+
(valueChange)="onOperatorChange($event);">
|
|
1146
|
+
</kendo-filter-expression-operators>
|
|
1147
|
+
</div>
|
|
1148
|
+
|
|
1149
|
+
<div class="k-filter-toolbar-item k-filter-value k-toolbar-item">
|
|
1150
|
+
<ng-container *ngIf="!editorTemplate" [ngSwitch]="getEditorType()">
|
|
1151
|
+
<kendo-filter-text-editor *ngSwitchCase="'string'" [currentItem]="currentItem" [isDisabled]="isEditorDisabled" (valueChange)="valueChange.emit()"></kendo-filter-text-editor>
|
|
1152
|
+
<kendo-filter-numeric-editor *ngSwitchCase="'number'" [currentItem]="currentItem" [isDisabled]="isEditorDisabled" [format]="numericEditorFormat" (valueChange)="valueChange.emit()"></kendo-filter-numeric-editor>
|
|
1153
|
+
<kendo-filter-boolean-editor *ngSwitchCase="'boolean'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-boolean-editor>
|
|
1154
|
+
<kendo-filter-date-editor *ngSwitchCase="'date'" [currentItem]="currentItem" [isDisabled]="isEditorDisabled" [format]="dateEditorFormat" (valueChange)="valueChange.emit()"></kendo-filter-date-editor>
|
|
1155
|
+
</ng-container>
|
|
1156
|
+
<ng-container *ngIf="editorTemplate">
|
|
1157
|
+
<ng-template
|
|
1158
|
+
[templateContext]="{templateRef: editorTemplate, $implicit: currentItem}">
|
|
1159
|
+
</ng-template>
|
|
1160
|
+
</ng-container>
|
|
1161
|
+
</div>
|
|
1162
|
+
|
|
1163
|
+
<div class="k-filter-toolbar-item k-toolbar-item" >
|
|
1164
|
+
<button
|
|
1165
|
+
kendoButton
|
|
1166
|
+
tabindex="-1"
|
|
1167
|
+
icon="x"
|
|
1168
|
+
fillMode="flat"
|
|
1169
|
+
[title]="messageFor('remove')"
|
|
1170
|
+
(click)="removeFilterExpression()">
|
|
1171
|
+
</button>
|
|
1172
|
+
</div>
|
|
1173
|
+
</div>
|
|
1174
|
+
</div>
|
|
1175
|
+
`
|
|
1176
|
+
}]
|
|
1177
|
+
}], ctorParameters: function () { return [{ type: FilterService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: NavigationService }, { type: i1.LocalizationService }, { type: i0.Renderer2 }]; }, propDecorators: { currentItem: [{
|
|
1178
|
+
type: Input
|
|
1179
|
+
}] } });
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* @hidden
|
|
1183
|
+
*/
|
|
1184
|
+
class FilterGroupComponent extends BaseFilterRowComponent {
|
|
1185
|
+
constructor(filterService, cdr, element, navigationService, localization, renderer) {
|
|
1186
|
+
super(element, navigationService, localization, renderer);
|
|
1187
|
+
this.filterService = filterService;
|
|
1188
|
+
this.cdr = cdr;
|
|
1189
|
+
this.currentItem = {
|
|
1190
|
+
logic: 'or',
|
|
1191
|
+
filters: []
|
|
1192
|
+
};
|
|
1193
|
+
this.operators = [];
|
|
1194
|
+
}
|
|
1195
|
+
get filterItems() {
|
|
1196
|
+
return this._filterItems.toArray();
|
|
1197
|
+
}
|
|
1198
|
+
ngOnInit() {
|
|
1199
|
+
this.operators = this.getLogicOperators();
|
|
1200
|
+
this.localizationSubscription = this.localization.changes.subscribe(() => {
|
|
1201
|
+
this.operators = this.getLogicOperators();
|
|
1202
|
+
this.cdr.detectChanges();
|
|
1203
|
+
});
|
|
1204
|
+
}
|
|
1205
|
+
ngOnDestroy() {
|
|
1206
|
+
if (this.localizationSubscription) {
|
|
1207
|
+
this.localizationSubscription.unsubscribe();
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
getLogicOperators() {
|
|
1211
|
+
return localizeOperators(logicOperators)(this.localization);
|
|
1212
|
+
}
|
|
1213
|
+
getOperator(operatorValue) {
|
|
1214
|
+
return this.messageFor(getKeyByValue(logicOperators, operatorValue));
|
|
1215
|
+
}
|
|
1216
|
+
selectedChange(logicOperator) {
|
|
1217
|
+
if (this.currentItem.logic !== logicOperator) {
|
|
1218
|
+
this.currentItem.logic = logicOperator;
|
|
1219
|
+
this.valueChange.emit();
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
addFilterExpression() {
|
|
1223
|
+
this.filterService.addFilterExpression(this.currentItem);
|
|
1224
|
+
this.valueChange.emit();
|
|
1225
|
+
}
|
|
1226
|
+
addFilterGroup() {
|
|
1227
|
+
this.filterService.addFilterGroup(this.currentItem);
|
|
1228
|
+
this.valueChange.emit();
|
|
1229
|
+
}
|
|
1230
|
+
removeFilterGroup() {
|
|
1231
|
+
this.filterService.remove(this.currentItem, this.index);
|
|
1232
|
+
this.cdr.detectChanges();
|
|
1233
|
+
this.valueChange.emit(true);
|
|
1234
|
+
}
|
|
1235
|
+
onMouseDown(event) {
|
|
1236
|
+
let elementToFocus;
|
|
1237
|
+
if (event.target.closest(selectors.kendoFilterToolbarItem)) {
|
|
1238
|
+
let index = Array.from(event.target.closest(selectors.kendoToolbar).children).indexOf(event.target.closest(selectors.kendoFilterToolbarItem)) + 1;
|
|
1239
|
+
if (event.target.closest(selectors.andButton)) {
|
|
1240
|
+
index = 0;
|
|
1241
|
+
}
|
|
1242
|
+
if (event.target.closest(selectors.orButton)) {
|
|
1243
|
+
index = 1;
|
|
1244
|
+
}
|
|
1245
|
+
this.navigationService.currentToolbarItemChildrenIndex = index;
|
|
1246
|
+
this.navigationService.isInnerNavigationActivated = true;
|
|
1247
|
+
elementToFocus = this.navigationService.flattenFilterItems[this.itemNumber].focusableChildren[index];
|
|
1248
|
+
}
|
|
1249
|
+
else {
|
|
1250
|
+
this.navigationService.currentToolbarItemChildrenIndex = 0;
|
|
1251
|
+
this.navigationService.isInnerNavigationActivated = false;
|
|
1252
|
+
elementToFocus = this.navigationService.flattenFilterItems[this.itemNumber].toolbarElement;
|
|
1253
|
+
}
|
|
1254
|
+
this.navigationService.isFilterExpressionComponentFocused = false;
|
|
1255
|
+
this.navigationService.currentToolbarItemIndex = this.itemNumber;
|
|
1256
|
+
this.navigationService.focusCurrentElement(elementToFocus, true);
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
FilterGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterGroupComponent, deps: [{ token: FilterService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: NavigationService }, { token: i1.LocalizationService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
1260
|
+
FilterGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FilterGroupComponent, selector: "kendo-filter-group", inputs: { currentItem: "currentItem" }, providers: [{
|
|
1261
|
+
provide: FilterItem,
|
|
1262
|
+
useExisting: forwardRef(() => FilterGroupComponent)
|
|
1263
|
+
}], viewQueries: [{ propertyName: "_filterItems", predicate: FilterItem, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
1264
|
+
<div class="k-filter-toolbar">
|
|
1265
|
+
<div class="k-toolbar" role="toolbar" [attr.aria-label]="messageFor('filterToolbarAriaLabel')" (focus)="onFocus()" (focusout)="onBlur()" (mousedown)="onMouseDown($event)">
|
|
1266
|
+
<div class="k-filter-toolbar-item">
|
|
1267
|
+
<div class="k-widget k-button-group" role="group">
|
|
1268
|
+
<button
|
|
1269
|
+
tabindex="-1"
|
|
1270
|
+
*ngFor="let operator of operators"
|
|
1271
|
+
kendoButton
|
|
1272
|
+
[ngClass]="{'k-group-start': operator.value === 'and', 'k-group-end': operator.value === 'or'}"
|
|
1273
|
+
[selected]="currentItem.logic === operator.value"
|
|
1274
|
+
[attr.aria-pressed]="currentItem.logic === operator.value"
|
|
1275
|
+
[title]="operator.text"
|
|
1276
|
+
(click)="selectedChange(operator.value)"
|
|
1277
|
+
>
|
|
1278
|
+
{{getOperator(operator.value)}}
|
|
1279
|
+
</button>
|
|
1280
|
+
</div>
|
|
1281
|
+
</div>
|
|
1282
|
+
<div class="k-filter-toolbar-item">
|
|
1283
|
+
<button
|
|
1284
|
+
kendoButton
|
|
1285
|
+
tabindex="-1"
|
|
1286
|
+
[title]="messageFor('addFilter')"
|
|
1287
|
+
icon="filter-add-expression"
|
|
1288
|
+
(click)="addFilterExpression()">
|
|
1289
|
+
{{messageFor('addFilter')}}
|
|
1290
|
+
</button>
|
|
1291
|
+
</div>
|
|
1292
|
+
<div class="k-filter-toolbar-item">
|
|
1293
|
+
<button
|
|
1294
|
+
kendoButton
|
|
1295
|
+
tabindex="-1"
|
|
1296
|
+
[title]="messageFor('addGroup')"
|
|
1297
|
+
icon="filter-add-group"
|
|
1298
|
+
(click)="addFilterGroup()">
|
|
1299
|
+
{{messageFor('addGroup')}}
|
|
1300
|
+
</button>
|
|
1301
|
+
</div>
|
|
1302
|
+
<div class="k-filter-toolbar-item">
|
|
1303
|
+
<button
|
|
1304
|
+
kendoButton
|
|
1305
|
+
tabindex="-1"
|
|
1306
|
+
icon="x"
|
|
1307
|
+
fillMode="flat"
|
|
1308
|
+
[title]="messageFor('remove')"
|
|
1309
|
+
(click)="removeFilterGroup()">
|
|
1310
|
+
</button>
|
|
1311
|
+
</div>
|
|
1312
|
+
</div>
|
|
1313
|
+
</div>
|
|
1314
|
+
|
|
1315
|
+
<ul class="k-filter-lines" role="group" *ngIf="currentItem.filters">
|
|
1316
|
+
<ng-container *ngFor="let item of currentItem.filters; let i = index;">
|
|
1317
|
+
<li class="k-filter-item" role="treeitem" *ngIf="!item['filters']">
|
|
1318
|
+
<kendo-filter-expression (valueChange)="valueChange.emit($event)" [currentItem]="item" [index]="i">
|
|
1319
|
+
</kendo-filter-expression>
|
|
1320
|
+
</li>
|
|
1321
|
+
<li class="k-filter-item" role="treeitem" *ngIf="item['filters']">
|
|
1322
|
+
<kendo-filter-group
|
|
1323
|
+
(valueChange)="valueChange.emit($event)"
|
|
1324
|
+
[currentItem]="item"
|
|
1325
|
+
[index]="i"
|
|
1326
|
+
>
|
|
1327
|
+
</kendo-filter-group>
|
|
1328
|
+
</li>
|
|
1329
|
+
</ng-container>
|
|
1330
|
+
</ul>
|
|
1331
|
+
`, isInline: true, components: [{ type: i10.Button, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: FilterExpressionComponent, selector: "kendo-filter-expression", inputs: ["currentItem"] }, { type: FilterGroupComponent, selector: "kendo-filter-group", inputs: ["currentItem"] }], directives: [{ type: i12.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i12.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i12.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1332
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterGroupComponent, decorators: [{
|
|
1333
|
+
type: Component,
|
|
1334
|
+
args: [{
|
|
1335
|
+
providers: [{
|
|
1336
|
+
provide: FilterItem,
|
|
1337
|
+
useExisting: forwardRef(() => FilterGroupComponent)
|
|
1338
|
+
}],
|
|
1339
|
+
selector: 'kendo-filter-group',
|
|
1340
|
+
template: `
|
|
1341
|
+
<div class="k-filter-toolbar">
|
|
1342
|
+
<div class="k-toolbar" role="toolbar" [attr.aria-label]="messageFor('filterToolbarAriaLabel')" (focus)="onFocus()" (focusout)="onBlur()" (mousedown)="onMouseDown($event)">
|
|
1343
|
+
<div class="k-filter-toolbar-item">
|
|
1344
|
+
<div class="k-widget k-button-group" role="group">
|
|
1345
|
+
<button
|
|
1346
|
+
tabindex="-1"
|
|
1347
|
+
*ngFor="let operator of operators"
|
|
1348
|
+
kendoButton
|
|
1349
|
+
[ngClass]="{'k-group-start': operator.value === 'and', 'k-group-end': operator.value === 'or'}"
|
|
1350
|
+
[selected]="currentItem.logic === operator.value"
|
|
1351
|
+
[attr.aria-pressed]="currentItem.logic === operator.value"
|
|
1352
|
+
[title]="operator.text"
|
|
1353
|
+
(click)="selectedChange(operator.value)"
|
|
1354
|
+
>
|
|
1355
|
+
{{getOperator(operator.value)}}
|
|
1356
|
+
</button>
|
|
1357
|
+
</div>
|
|
1358
|
+
</div>
|
|
1359
|
+
<div class="k-filter-toolbar-item">
|
|
1360
|
+
<button
|
|
1361
|
+
kendoButton
|
|
1362
|
+
tabindex="-1"
|
|
1363
|
+
[title]="messageFor('addFilter')"
|
|
1364
|
+
icon="filter-add-expression"
|
|
1365
|
+
(click)="addFilterExpression()">
|
|
1366
|
+
{{messageFor('addFilter')}}
|
|
1367
|
+
</button>
|
|
1368
|
+
</div>
|
|
1369
|
+
<div class="k-filter-toolbar-item">
|
|
1370
|
+
<button
|
|
1371
|
+
kendoButton
|
|
1372
|
+
tabindex="-1"
|
|
1373
|
+
[title]="messageFor('addGroup')"
|
|
1374
|
+
icon="filter-add-group"
|
|
1375
|
+
(click)="addFilterGroup()">
|
|
1376
|
+
{{messageFor('addGroup')}}
|
|
1377
|
+
</button>
|
|
1378
|
+
</div>
|
|
1379
|
+
<div class="k-filter-toolbar-item">
|
|
1380
|
+
<button
|
|
1381
|
+
kendoButton
|
|
1382
|
+
tabindex="-1"
|
|
1383
|
+
icon="x"
|
|
1384
|
+
fillMode="flat"
|
|
1385
|
+
[title]="messageFor('remove')"
|
|
1386
|
+
(click)="removeFilterGroup()">
|
|
1387
|
+
</button>
|
|
1388
|
+
</div>
|
|
1389
|
+
</div>
|
|
1390
|
+
</div>
|
|
1391
|
+
|
|
1392
|
+
<ul class="k-filter-lines" role="group" *ngIf="currentItem.filters">
|
|
1393
|
+
<ng-container *ngFor="let item of currentItem.filters; let i = index;">
|
|
1394
|
+
<li class="k-filter-item" role="treeitem" *ngIf="!item['filters']">
|
|
1395
|
+
<kendo-filter-expression (valueChange)="valueChange.emit($event)" [currentItem]="item" [index]="i">
|
|
1396
|
+
</kendo-filter-expression>
|
|
1397
|
+
</li>
|
|
1398
|
+
<li class="k-filter-item" role="treeitem" *ngIf="item['filters']">
|
|
1399
|
+
<kendo-filter-group
|
|
1400
|
+
(valueChange)="valueChange.emit($event)"
|
|
1401
|
+
[currentItem]="item"
|
|
1402
|
+
[index]="i"
|
|
1403
|
+
>
|
|
1404
|
+
</kendo-filter-group>
|
|
1405
|
+
</li>
|
|
1406
|
+
</ng-container>
|
|
1407
|
+
</ul>
|
|
1408
|
+
`
|
|
1409
|
+
}]
|
|
1410
|
+
}], ctorParameters: function () { return [{ type: FilterService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: NavigationService }, { type: i1.LocalizationService }, { type: i0.Renderer2 }]; }, propDecorators: { _filterItems: [{
|
|
1411
|
+
type: ViewChildren,
|
|
1412
|
+
args: [FilterItem]
|
|
1413
|
+
}], currentItem: [{
|
|
1414
|
+
type: Input
|
|
1415
|
+
}] } });
|
|
1416
|
+
|
|
1417
|
+
/**
|
|
1418
|
+
* @hidden
|
|
1419
|
+
*/
|
|
1420
|
+
class Messages extends ComponentMessages {
|
|
1421
|
+
}
|
|
1422
|
+
Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1423
|
+
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: Messages, selector: "[kendoFilterMessages]", inputs: { filterExpressionOperators: "filterExpressionOperators", filterExpressionFilters: "filterExpressionFilters", remove: "remove", addGroup: "addGroup", addFilter: "addFilter", filterAndLogic: "filterAndLogic", filterOrLogic: "filterOrLogic", filterEqOperator: "filterEqOperator", filterNotEqOperator: "filterNotEqOperator", filterIsNullOperator: "filterIsNullOperator", filterIsNotNullOperator: "filterIsNotNullOperator", filterIsEmptyOperator: "filterIsEmptyOperator", filterIsNotEmptyOperator: "filterIsNotEmptyOperator", filterStartsWithOperator: "filterStartsWithOperator", filterContainsOperator: "filterContainsOperator", filterNotContainsOperator: "filterNotContainsOperator", filterEndsWithOperator: "filterEndsWithOperator", filterGteOperator: "filterGteOperator", filterGtOperator: "filterGtOperator", filterLteOperator: "filterLteOperator", filterLtOperator: "filterLtOperator", filterIsTrue: "filterIsTrue", filterIsFalse: "filterIsFalse", filterBooleanAll: "filterBooleanAll", filterAfterOrEqualOperator: "filterAfterOrEqualOperator", filterAfterOperator: "filterAfterOperator", filterBeforeOperator: "filterBeforeOperator", filterBeforeOrEqualOperator: "filterBeforeOrEqualOperator", editorNumericDecrement: "editorNumericDecrement", editorNumericIncrement: "editorNumericIncrement", editorDateTodayText: "editorDateTodayText", editorDateToggleText: "editorDateToggleText", filterFieldAriaLabel: "filterFieldAriaLabel", filterOperatorAriaLabel: "filterOperatorAriaLabel", filterValueAriaLabel: "filterValueAriaLabel", filterToolbarAriaLabel: "filterToolbarAriaLabel", filterComponentAriaLabel: "filterComponentAriaLabel" }, usesInheritance: true, ngImport: i0 });
|
|
1424
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: Messages, decorators: [{
|
|
1425
|
+
type: Directive,
|
|
1426
|
+
args: [{
|
|
1427
|
+
selector: '[kendoFilterMessages]'
|
|
1428
|
+
}]
|
|
1429
|
+
}], propDecorators: { filterExpressionOperators: [{
|
|
1430
|
+
type: Input
|
|
1431
|
+
}], filterExpressionFilters: [{
|
|
1432
|
+
type: Input
|
|
1433
|
+
}], remove: [{
|
|
1434
|
+
type: Input
|
|
1435
|
+
}], addGroup: [{
|
|
1436
|
+
type: Input
|
|
1437
|
+
}], addFilter: [{
|
|
1438
|
+
type: Input
|
|
1439
|
+
}], filterAndLogic: [{
|
|
1440
|
+
type: Input
|
|
1441
|
+
}], filterOrLogic: [{
|
|
1442
|
+
type: Input
|
|
1443
|
+
}], filterEqOperator: [{
|
|
1444
|
+
type: Input
|
|
1445
|
+
}], filterNotEqOperator: [{
|
|
1446
|
+
type: Input
|
|
1447
|
+
}], filterIsNullOperator: [{
|
|
1448
|
+
type: Input
|
|
1449
|
+
}], filterIsNotNullOperator: [{
|
|
1450
|
+
type: Input
|
|
1451
|
+
}], filterIsEmptyOperator: [{
|
|
1452
|
+
type: Input
|
|
1453
|
+
}], filterIsNotEmptyOperator: [{
|
|
1454
|
+
type: Input
|
|
1455
|
+
}], filterStartsWithOperator: [{
|
|
1456
|
+
type: Input
|
|
1457
|
+
}], filterContainsOperator: [{
|
|
1458
|
+
type: Input
|
|
1459
|
+
}], filterNotContainsOperator: [{
|
|
1460
|
+
type: Input
|
|
1461
|
+
}], filterEndsWithOperator: [{
|
|
1462
|
+
type: Input
|
|
1463
|
+
}], filterGteOperator: [{
|
|
1464
|
+
type: Input
|
|
1465
|
+
}], filterGtOperator: [{
|
|
1466
|
+
type: Input
|
|
1467
|
+
}], filterLteOperator: [{
|
|
1468
|
+
type: Input
|
|
1469
|
+
}], filterLtOperator: [{
|
|
1470
|
+
type: Input
|
|
1471
|
+
}], filterIsTrue: [{
|
|
1472
|
+
type: Input
|
|
1473
|
+
}], filterIsFalse: [{
|
|
1474
|
+
type: Input
|
|
1475
|
+
}], filterBooleanAll: [{
|
|
1476
|
+
type: Input
|
|
1477
|
+
}], filterAfterOrEqualOperator: [{
|
|
1478
|
+
type: Input
|
|
1479
|
+
}], filterAfterOperator: [{
|
|
1480
|
+
type: Input
|
|
1481
|
+
}], filterBeforeOperator: [{
|
|
1482
|
+
type: Input
|
|
1483
|
+
}], filterBeforeOrEqualOperator: [{
|
|
1484
|
+
type: Input
|
|
1485
|
+
}], editorNumericDecrement: [{
|
|
1486
|
+
type: Input
|
|
1487
|
+
}], editorNumericIncrement: [{
|
|
1488
|
+
type: Input
|
|
1489
|
+
}], editorDateTodayText: [{
|
|
1490
|
+
type: Input
|
|
1491
|
+
}], editorDateToggleText: [{
|
|
1492
|
+
type: Input
|
|
1493
|
+
}], filterFieldAriaLabel: [{
|
|
1494
|
+
type: Input
|
|
1495
|
+
}], filterOperatorAriaLabel: [{
|
|
1496
|
+
type: Input
|
|
1497
|
+
}], filterValueAriaLabel: [{
|
|
1498
|
+
type: Input
|
|
1499
|
+
}], filterToolbarAriaLabel: [{
|
|
1500
|
+
type: Input
|
|
1501
|
+
}], filterComponentAriaLabel: [{
|
|
1502
|
+
type: Input
|
|
1503
|
+
}] } });
|
|
1504
|
+
|
|
1505
|
+
/**
|
|
1506
|
+
* @hidden
|
|
1507
|
+
*/
|
|
1508
|
+
class LocalizedMessagesDirective extends Messages {
|
|
1509
|
+
constructor(service) {
|
|
1510
|
+
super();
|
|
1511
|
+
this.service = service;
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
LocalizedMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1515
|
+
LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: LocalizedMessagesDirective, selector: "[kendoFilterLocalizedMessages]", providers: [
|
|
1516
|
+
{
|
|
1517
|
+
provide: Messages,
|
|
1518
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
1519
|
+
}
|
|
1520
|
+
], usesInheritance: true, ngImport: i0 });
|
|
1521
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
|
1522
|
+
type: Directive,
|
|
1523
|
+
args: [{
|
|
1524
|
+
providers: [
|
|
1525
|
+
{
|
|
1526
|
+
provide: Messages,
|
|
1527
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
1528
|
+
}
|
|
1529
|
+
],
|
|
1530
|
+
selector: '[kendoFilterLocalizedMessages]'
|
|
1531
|
+
}]
|
|
1532
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
|
|
1533
|
+
|
|
1534
|
+
/**
|
|
1535
|
+
* Represents the [Kendo UI Filter component for Angular]({% slug overview_filter %}).
|
|
1536
|
+
* The Filter component can be used to apply any user defined filter criteria.
|
|
1537
|
+
* @example
|
|
1538
|
+
* ```ts
|
|
1539
|
+
* @Component({
|
|
1540
|
+
* selector: 'my-app',
|
|
1541
|
+
* template: `
|
|
1542
|
+
* <kendo-filter [filters]="filters" (valueChange)="onValueChange($event)"></kendo-filter>
|
|
1543
|
+
* `
|
|
1544
|
+
* })
|
|
1545
|
+
* export class AppComponent {
|
|
1546
|
+
*
|
|
1547
|
+
* public filters: FilterExpression[] = [
|
|
1548
|
+
* {
|
|
1549
|
+
* name: 'country',
|
|
1550
|
+
* label: 'Country',
|
|
1551
|
+
* filter: 'string',
|
|
1552
|
+
* operators: ['eq', 'neq'],
|
|
1553
|
+
* },
|
|
1554
|
+
* {
|
|
1555
|
+
* name: 'budget',
|
|
1556
|
+
* filter: 'number'
|
|
1557
|
+
* }
|
|
1558
|
+
* ];
|
|
1559
|
+
*
|
|
1560
|
+
* onValueChange(e: CompositeFilterDescriptor){
|
|
1561
|
+
* console.log(e)
|
|
1562
|
+
* }
|
|
1563
|
+
* }
|
|
1564
|
+
* ```
|
|
1565
|
+
*/
|
|
1566
|
+
class FilterComponent {
|
|
1567
|
+
constructor(filterService, localization, cdr, element, navigationService, renderer) {
|
|
1568
|
+
this.filterService = filterService;
|
|
1569
|
+
this.localization = localization;
|
|
1570
|
+
this.cdr = cdr;
|
|
1571
|
+
this.element = element;
|
|
1572
|
+
this.navigationService = navigationService;
|
|
1573
|
+
this.renderer = renderer;
|
|
1574
|
+
/**
|
|
1575
|
+
* Fires every time the Filter component value is updated.
|
|
1576
|
+
* That is each time a Filter Group or Filter Expression is added, removed, or updated.
|
|
1577
|
+
*/
|
|
1578
|
+
this.valueChange = new EventEmitter();
|
|
1579
|
+
this._value = { filters: [], logic: 'and' };
|
|
1580
|
+
validatePackage(packageMetadata);
|
|
1581
|
+
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
1582
|
+
}
|
|
1583
|
+
/**
|
|
1584
|
+
* @hidden
|
|
1585
|
+
*/
|
|
1586
|
+
focusout() {
|
|
1587
|
+
setTimeout(() => {
|
|
1588
|
+
if (!(document.activeElement.closest('.k-filter'))) {
|
|
1589
|
+
this.renderer.setAttribute(this.navigationService.currentlyFocusedElement, 'tabindex', '-1');
|
|
1590
|
+
this.navigationService.currentlyFocusedElement = this.navigationService.flattenFilterItems[this.navigationService.currentToolbarItemIndex].toolbarElement;
|
|
1591
|
+
this.renderer.setAttribute(this.navigationService.currentlyFocusedElement, 'tabindex', '0');
|
|
1592
|
+
this.navigationService.isInnerNavigationActivated = false;
|
|
1593
|
+
this.navigationService.isFilterExpressionComponentFocused = false;
|
|
1594
|
+
}
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
/**
|
|
1598
|
+
* @hidden
|
|
1599
|
+
*/
|
|
1600
|
+
onKeydown(event) {
|
|
1601
|
+
const keyCode = event.keyCode;
|
|
1602
|
+
const keys = [Keys.ArrowUp, Keys.ArrowDown, Keys.ArrowLeft, Keys.ArrowRight, Keys.Enter,
|
|
1603
|
+
Keys.Escape, Keys.Tab];
|
|
1604
|
+
if (keys.indexOf(keyCode) > -1) {
|
|
1605
|
+
this.navigationService.processKeyDown(keyCode, event);
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
/**
|
|
1609
|
+
* Specifies the available user-defined filters. At least one filter should be provided.
|
|
1610
|
+
*/
|
|
1611
|
+
set filters(_filters) {
|
|
1612
|
+
if (_filters.length > 0) {
|
|
1613
|
+
this.filterService.filters = _filters.map(filterExpression => {
|
|
1614
|
+
const clonedFilter = Object.assign({}, filterExpression);
|
|
1615
|
+
if (!clonedFilter.title) {
|
|
1616
|
+
clonedFilter.title = clonedFilter.field;
|
|
1617
|
+
}
|
|
1618
|
+
return clonedFilter;
|
|
1619
|
+
});
|
|
1620
|
+
this.setValue(this.value);
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
get filters() {
|
|
1624
|
+
return this.filterService.filters;
|
|
1625
|
+
}
|
|
1626
|
+
/**
|
|
1627
|
+
* Sets the initial `value` of the Filter component.
|
|
1628
|
+
*/
|
|
1629
|
+
set value(value) {
|
|
1630
|
+
const clonedValue = JSON.parse(JSON.stringify(value));
|
|
1631
|
+
this._value = clonedValue;
|
|
1632
|
+
if (this.filters.length > 0) {
|
|
1633
|
+
this.setValue(this.value);
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
get value() {
|
|
1637
|
+
return this._value;
|
|
1638
|
+
}
|
|
1639
|
+
get filterItems() {
|
|
1640
|
+
return this._filterItems.toArray();
|
|
1641
|
+
}
|
|
1642
|
+
get toolbarElement() {
|
|
1643
|
+
return this.element.nativeElement.querySelector('.k-toolbar');
|
|
1644
|
+
}
|
|
1645
|
+
ngOnInit() {
|
|
1646
|
+
this.localizationSubscription = this.localization.changes.subscribe(({ rtl }) => {
|
|
1647
|
+
this.direction = rtl ? 'rtl' : 'ltr';
|
|
1648
|
+
this.cdr.detectChanges();
|
|
1649
|
+
});
|
|
1650
|
+
}
|
|
1651
|
+
ngAfterViewInit() {
|
|
1652
|
+
if (this.filterFields && this.filterFields.length > 0) {
|
|
1653
|
+
this.filters = this.filterFields.map((filterField) => ({
|
|
1654
|
+
...filterField,
|
|
1655
|
+
title: filterField.title,
|
|
1656
|
+
editorTemplate: filterField.editorTemplate?.templateRef
|
|
1657
|
+
}));
|
|
1658
|
+
}
|
|
1659
|
+
if (this.filters.length === 0) {
|
|
1660
|
+
throw new Error(FilterErrorMessages.missingFilters);
|
|
1661
|
+
}
|
|
1662
|
+
this.navigationService.reset(this.filterItems);
|
|
1663
|
+
if (!this.navigationService.currentlyFocusedElement) {
|
|
1664
|
+
const firstElement = this.navigationService.flattenFilterItems[0].toolbarElement;
|
|
1665
|
+
this.navigationService.currentlyFocusedElement = firstElement;
|
|
1666
|
+
this.renderer.setAttribute(firstElement, 'tabindex', '0');
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
ngOnDestroy() {
|
|
1670
|
+
if (this.localizationSubscription) {
|
|
1671
|
+
this.localizationSubscription.unsubscribe();
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
/**
|
|
1675
|
+
* @hidden
|
|
1676
|
+
*/
|
|
1677
|
+
getCurrentFilter() {
|
|
1678
|
+
return this.filterService.normalizedValue;
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* @hidden
|
|
1682
|
+
*/
|
|
1683
|
+
onValueChange(isRemoveOperation) {
|
|
1684
|
+
this.valueChange.emit(this.filterService.normalizedValue);
|
|
1685
|
+
this.cdr.detectChanges();
|
|
1686
|
+
this.navigationService.reset(this.filterItems);
|
|
1687
|
+
if (isRemoveOperation) {
|
|
1688
|
+
if (this.navigationService.currentToolbarItemIndex === this.navigationService.flattenFilterItems.length) {
|
|
1689
|
+
this.navigationService.currentToolbarItemIndex -= 1;
|
|
1690
|
+
}
|
|
1691
|
+
this.navigationService.isInnerNavigationActivated = false;
|
|
1692
|
+
this.navigationService.isFilterExpressionComponentFocused = false;
|
|
1693
|
+
this.navigationService.currentlyFocusedElement = this.navigationService.flattenFilterItems[this.navigationService.currentToolbarItemIndex].toolbarElement;
|
|
1694
|
+
this.renderer.setAttribute(this.navigationService.currentlyFocusedElement, 'tabindex', '0');
|
|
1695
|
+
this.renderer.addClass(this.navigationService.currentlyFocusedElement, 'k-focus');
|
|
1696
|
+
this.navigationService.currentlyFocusedElement.focus();
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
normalizeFilter(filterDescriptor) {
|
|
1700
|
+
const foundFilter = this.filterService.filters.find((filter) => filter.field === filterDescriptor.field);
|
|
1701
|
+
if (isDevMode() && !foundFilter) {
|
|
1702
|
+
throw new Error(FilterErrorMessages.missingFilterForUsedField(filterDescriptor.field));
|
|
1703
|
+
}
|
|
1704
|
+
if (isDevMode() && foundFilter.editor === 'boolean' && (!filterDescriptor.value && filterDescriptor.value !== false)) {
|
|
1705
|
+
console.warn(FilterErrorMessages.missingValueForBooleanField(filterDescriptor.field));
|
|
1706
|
+
}
|
|
1707
|
+
if (isDevMode() && foundFilter.editor === 'boolean' && filterDescriptor.operator !== 'eq') {
|
|
1708
|
+
console.warn(FilterErrorMessages.operatorBooleanField(filterDescriptor.field));
|
|
1709
|
+
}
|
|
1710
|
+
if (filterDescriptor.operator && foundFilter.operators && !foundFilter.operators.some(operator => operator === filterDescriptor.operator)) {
|
|
1711
|
+
throw new Error(FilterErrorMessages.filterMissingUsedOperator(filterDescriptor.field, filterDescriptor.operator));
|
|
1712
|
+
}
|
|
1713
|
+
if (foundFilter.editor === 'boolean') {
|
|
1714
|
+
filterDescriptor.operator = 'eq';
|
|
1715
|
+
}
|
|
1716
|
+
if (foundFilter.editor === 'date' && filterDescriptor.value) {
|
|
1717
|
+
filterDescriptor.value = new Date(filterDescriptor.value);
|
|
1718
|
+
}
|
|
1719
|
+
if (!isPresent(filterDescriptor.value)) {
|
|
1720
|
+
filterDescriptor.value = null;
|
|
1721
|
+
}
|
|
1722
|
+
if (nullOperators.indexOf(filterDescriptor.operator) >= 0) {
|
|
1723
|
+
filterDescriptor.value = null;
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
setValue(items) {
|
|
1727
|
+
this.normalizeValue(items);
|
|
1728
|
+
this.filterService.normalizedValue = items;
|
|
1729
|
+
this.cdr.detectChanges();
|
|
1730
|
+
}
|
|
1731
|
+
normalizeValue(items) {
|
|
1732
|
+
if (!this.filterService.filters.length) {
|
|
1733
|
+
return;
|
|
1734
|
+
}
|
|
1735
|
+
items.filters.forEach((item) => {
|
|
1736
|
+
if (item.filters) {
|
|
1737
|
+
this.normalizeValue(item);
|
|
1738
|
+
}
|
|
1739
|
+
else {
|
|
1740
|
+
this.normalizeFilter(item);
|
|
1741
|
+
}
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
/**
|
|
1745
|
+
* @hidden
|
|
1746
|
+
*/
|
|
1747
|
+
messageFor(key) {
|
|
1748
|
+
return this.localization.get(key);
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
FilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterComponent, deps: [{ token: FilterService }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: NavigationService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
1752
|
+
FilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FilterComponent, selector: "kendo-filter", inputs: { filters: "filters", value: "value" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "focusout": "focusout($event)", "keydown": "onKeydown($event)" }, properties: { "attr.dir": "this.direction" } }, providers: [
|
|
1753
|
+
LocalizationService,
|
|
1754
|
+
{
|
|
1755
|
+
provide: L10N_PREFIX,
|
|
1756
|
+
useValue: 'kendo.filter'
|
|
1757
|
+
},
|
|
1758
|
+
FilterService,
|
|
1759
|
+
NavigationService
|
|
1760
|
+
], queries: [{ propertyName: "filterFields", predicate: FilterFieldComponent }], viewQueries: [{ propertyName: "_filterItems", predicate: FilterItem, descendants: true }], ngImport: i0, template: `
|
|
1761
|
+
<ng-container kendoFilterLocalizedMessages
|
|
1762
|
+
i18n-editorDateTodayText="kendo.filter.editorDateTodayText|The text of the Today button of the Date editor"
|
|
1763
|
+
editorDateTodayText="Today"
|
|
1764
|
+
|
|
1765
|
+
i18n-editorDateToggleText="kendo.filter.editorDateToggleText|The title of the Toggle button of the Date editor."
|
|
1766
|
+
editorDateToggleText="Toggle calendar"
|
|
1767
|
+
|
|
1768
|
+
i18n-editorNumericDecrement="kendo.filter.editorNumericDecrement|The title of the Decrement button of the Numeric editor"
|
|
1769
|
+
editorNumericDecrement="Decrement"
|
|
1770
|
+
|
|
1771
|
+
i18n-editorNumericIncrement="kendo.filter.editorNumericIncrement|The title of the Increment button of the Numeric editor"
|
|
1772
|
+
editorNumericIncrement="Increment"
|
|
1773
|
+
|
|
1774
|
+
i18n-filterExpressionOperators="kendo.filter.filterExpressionOperators|The text of the Filter Expression Operators drop down"
|
|
1775
|
+
filterExpressionOperators="Operators"
|
|
1776
|
+
|
|
1777
|
+
i18n-filterExpressionFilters="kendo.filter.filterExpressionFilters|The text of the Filter Expression filters drop down"
|
|
1778
|
+
filterExpressionFilters="Fields"
|
|
1779
|
+
|
|
1780
|
+
i18n-remove="kendo.filter.remove|The text of the Remove button"
|
|
1781
|
+
remove="Remove"
|
|
1782
|
+
|
|
1783
|
+
i18n-addFilter="kendo.filter.addFilter|The text of the Add Filter button"
|
|
1784
|
+
addFilter="Add Filter"
|
|
1785
|
+
|
|
1786
|
+
i18n-addGroup="kendo.filter.addGroup|The text of the Add Group button"
|
|
1787
|
+
addGroup="Add Group"
|
|
1788
|
+
|
|
1789
|
+
i18n-filterAndLogic="kendo.filter.filterAndLogic|The text of the And filter logic"
|
|
1790
|
+
filterAndLogic="And"
|
|
1791
|
+
|
|
1792
|
+
i18n-filterOrLogic="kendo.filter.filterOrLogic|The text of the Or filter logic"
|
|
1793
|
+
filterOrLogic="Or"
|
|
1794
|
+
|
|
1795
|
+
i18n-filterEqOperator="kendo.filter.filterEqOperator|The text of the equal filter operator"
|
|
1796
|
+
filterEqOperator="Is equal to"
|
|
1797
|
+
|
|
1798
|
+
i18n-filterNotEqOperator="kendo.filter.filterNotEqOperator|The text of the not equal filter operator"
|
|
1799
|
+
filterNotEqOperator="Is not equal to"
|
|
1800
|
+
|
|
1801
|
+
i18n-filterIsNullOperator="kendo.filter.filterIsNullOperator|The text of the is null filter operator"
|
|
1802
|
+
filterIsNullOperator="Is null"
|
|
1803
|
+
|
|
1804
|
+
i18n-filterIsNotNullOperator="kendo.filter.filterIsNotNullOperator|The text of the is not null filter operator"
|
|
1805
|
+
filterIsNotNullOperator="Is not null"
|
|
1806
|
+
|
|
1807
|
+
i18n-filterIsEmptyOperator="kendo.filter.filterIsEmptyOperator|The text of the is empty filter operator"
|
|
1808
|
+
filterIsEmptyOperator="Is empty"
|
|
1809
|
+
|
|
1810
|
+
i18n-filterIsNotEmptyOperator="kendo.filter.filterIsNotEmptyOperator|The text of the is not empty filter operator"
|
|
1811
|
+
filterIsNotEmptyOperator="Is not empty"
|
|
1812
|
+
|
|
1813
|
+
i18n-filterStartsWithOperator="kendo.filter.filterStartsWithOperator|The text of the starts with filter operator"
|
|
1814
|
+
filterStartsWithOperator="Starts with"
|
|
1815
|
+
|
|
1816
|
+
i18n-filterContainsOperator="kendo.filter.filterContainsOperator|The text of the contains filter operator"
|
|
1817
|
+
filterContainsOperator="Contains"
|
|
1818
|
+
|
|
1819
|
+
i18n-filterNotContainsOperator="kendo.filter.filterNotContainsOperator|The text of the does not contain filter operator"
|
|
1820
|
+
filterNotContainsOperator="Does not contain"
|
|
1821
|
+
|
|
1822
|
+
i18n-filterEndsWithOperator="kendo.filter.filterEndsWithOperator|The text of the ends with filter operator"
|
|
1823
|
+
filterEndsWithOperator="Ends with"
|
|
1824
|
+
|
|
1825
|
+
i18n-filterGteOperator="kendo.filter.filterGteOperator|The text of the greater than or equal filter operator"
|
|
1826
|
+
filterGteOperator="Is greater than or equal to"
|
|
1827
|
+
|
|
1828
|
+
i18n-filterGtOperator="kendo.filter.filterGtOperator|The text of the greater than filter operator"
|
|
1829
|
+
filterGtOperator="Is greater than"
|
|
1830
|
+
|
|
1831
|
+
i18n-filterLteOperator="kendo.filter.filterLteOperator|The text of the less than or equal filter operator"
|
|
1832
|
+
filterLteOperator="Is less than or equal to"
|
|
1833
|
+
|
|
1834
|
+
i18n-filterLtOperator="kendo.filter.filterLtOperator|The text of the less than filter operator"
|
|
1835
|
+
filterLtOperator="Is less than"
|
|
1836
|
+
|
|
1837
|
+
i18n-filterIsTrue="kendo.filter.filterIsTrue|The text of the IsTrue boolean filter option"
|
|
1838
|
+
filterIsTrue="Is True"
|
|
1839
|
+
|
|
1840
|
+
i18n-filterIsFalse="kendo.filter.filterIsFalse|The text of the IsFalse boolean filter option"
|
|
1841
|
+
filterIsFalse="Is False"
|
|
1842
|
+
|
|
1843
|
+
i18n-filterBooleanAll="kendo.filter.filterBooleanAll|The text of the (All) boolean filter option"
|
|
1844
|
+
filterBooleanAll="(All)"
|
|
1845
|
+
|
|
1846
|
+
i18n-filterAfterOrEqualOperator="kendo.filter.filterAfterOrEqualOperator|The text of the after or equal date filter operator"
|
|
1847
|
+
filterAfterOrEqualOperator="Is after or equal to"
|
|
1848
|
+
|
|
1849
|
+
i18n-filterAfterOperator="kendo.filter.filterAfterOperator|The text of the after date filter operator"
|
|
1850
|
+
filterAfterOperator="Is after"
|
|
1851
|
+
|
|
1852
|
+
i18n-filterBeforeOperator="kendo.filter.filterBeforeOperator|The text of the before date filter operator"
|
|
1853
|
+
filterBeforeOperator="Is before"
|
|
1854
|
+
|
|
1855
|
+
i18n-filterBeforeOrEqualOperator="kendo.filter.filterBeforeOrEqualOperator|The text of the before or equal date filter operator"
|
|
1856
|
+
filterBeforeOrEqualOperator="Is before or equal to"
|
|
1857
|
+
|
|
1858
|
+
i18n-filterFieldAriaLabel="kendo.filter.filterFieldAriaLabel|The text of the filter field aria label"
|
|
1859
|
+
filterFieldAriaLabel="field"
|
|
1860
|
+
|
|
1861
|
+
i18n-filterOperatorAriaLabel="kendo.filter.filterOperatorAriaLabel|The text of the filter operator aria label"
|
|
1862
|
+
filterOperatorAriaLabel="operator"
|
|
1863
|
+
|
|
1864
|
+
i18n-filterValueAriaLabel="kendo.filter.filterValueAriaLabel|The text of the filter value aria label"
|
|
1865
|
+
filterValueAriaLabel="value"
|
|
1866
|
+
|
|
1867
|
+
i18n-filterToolbarAriaLabel="kendo.filter.filterToolbarAriaLabel|The text of the filter row aria label"
|
|
1868
|
+
filterToolbarAriaLabel="filter row settings"
|
|
1869
|
+
|
|
1870
|
+
i18n-filterComponentAriaLabel="kendo.filter.filterComponentAriaLabel|The text of the filter component aria label"
|
|
1871
|
+
filterComponentAriaLabel="filter component"
|
|
1872
|
+
>
|
|
1873
|
+
</ng-container>
|
|
1874
|
+
<div class="k-widget k-filter" [attr.dir]="direction">
|
|
1875
|
+
<ul class='k-filter-container' role="tree" [attr.aria-label]="messageFor('filterComponentAriaLabel')">
|
|
1876
|
+
<li class='k-filter-group-main' role="treeitem">
|
|
1877
|
+
<kendo-filter-group
|
|
1878
|
+
[currentItem]="getCurrentFilter()"
|
|
1879
|
+
(valueChange)="onValueChange($event)"
|
|
1880
|
+
>
|
|
1881
|
+
</kendo-filter-group>
|
|
1882
|
+
</li>
|
|
1883
|
+
</ul>
|
|
1884
|
+
</div>
|
|
1885
|
+
`, isInline: true, components: [{ type: FilterGroupComponent, selector: "kendo-filter-group", inputs: ["currentItem"] }], directives: [{ type: LocalizedMessagesDirective, selector: "[kendoFilterLocalizedMessages]" }] });
|
|
1886
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterComponent, decorators: [{
|
|
1887
|
+
type: Component,
|
|
1888
|
+
args: [{
|
|
1889
|
+
providers: [
|
|
1890
|
+
LocalizationService,
|
|
1891
|
+
{
|
|
1892
|
+
provide: L10N_PREFIX,
|
|
1893
|
+
useValue: 'kendo.filter'
|
|
1894
|
+
},
|
|
1895
|
+
FilterService,
|
|
1896
|
+
NavigationService
|
|
1897
|
+
],
|
|
1898
|
+
selector: 'kendo-filter',
|
|
1899
|
+
template: `
|
|
1900
|
+
<ng-container kendoFilterLocalizedMessages
|
|
1901
|
+
i18n-editorDateTodayText="kendo.filter.editorDateTodayText|The text of the Today button of the Date editor"
|
|
1902
|
+
editorDateTodayText="Today"
|
|
1903
|
+
|
|
1904
|
+
i18n-editorDateToggleText="kendo.filter.editorDateToggleText|The title of the Toggle button of the Date editor."
|
|
1905
|
+
editorDateToggleText="Toggle calendar"
|
|
1906
|
+
|
|
1907
|
+
i18n-editorNumericDecrement="kendo.filter.editorNumericDecrement|The title of the Decrement button of the Numeric editor"
|
|
1908
|
+
editorNumericDecrement="Decrement"
|
|
1909
|
+
|
|
1910
|
+
i18n-editorNumericIncrement="kendo.filter.editorNumericIncrement|The title of the Increment button of the Numeric editor"
|
|
1911
|
+
editorNumericIncrement="Increment"
|
|
1912
|
+
|
|
1913
|
+
i18n-filterExpressionOperators="kendo.filter.filterExpressionOperators|The text of the Filter Expression Operators drop down"
|
|
1914
|
+
filterExpressionOperators="Operators"
|
|
1915
|
+
|
|
1916
|
+
i18n-filterExpressionFilters="kendo.filter.filterExpressionFilters|The text of the Filter Expression filters drop down"
|
|
1917
|
+
filterExpressionFilters="Fields"
|
|
1918
|
+
|
|
1919
|
+
i18n-remove="kendo.filter.remove|The text of the Remove button"
|
|
1920
|
+
remove="Remove"
|
|
1921
|
+
|
|
1922
|
+
i18n-addFilter="kendo.filter.addFilter|The text of the Add Filter button"
|
|
1923
|
+
addFilter="Add Filter"
|
|
1924
|
+
|
|
1925
|
+
i18n-addGroup="kendo.filter.addGroup|The text of the Add Group button"
|
|
1926
|
+
addGroup="Add Group"
|
|
1927
|
+
|
|
1928
|
+
i18n-filterAndLogic="kendo.filter.filterAndLogic|The text of the And filter logic"
|
|
1929
|
+
filterAndLogic="And"
|
|
1930
|
+
|
|
1931
|
+
i18n-filterOrLogic="kendo.filter.filterOrLogic|The text of the Or filter logic"
|
|
1932
|
+
filterOrLogic="Or"
|
|
1933
|
+
|
|
1934
|
+
i18n-filterEqOperator="kendo.filter.filterEqOperator|The text of the equal filter operator"
|
|
1935
|
+
filterEqOperator="Is equal to"
|
|
1936
|
+
|
|
1937
|
+
i18n-filterNotEqOperator="kendo.filter.filterNotEqOperator|The text of the not equal filter operator"
|
|
1938
|
+
filterNotEqOperator="Is not equal to"
|
|
1939
|
+
|
|
1940
|
+
i18n-filterIsNullOperator="kendo.filter.filterIsNullOperator|The text of the is null filter operator"
|
|
1941
|
+
filterIsNullOperator="Is null"
|
|
1942
|
+
|
|
1943
|
+
i18n-filterIsNotNullOperator="kendo.filter.filterIsNotNullOperator|The text of the is not null filter operator"
|
|
1944
|
+
filterIsNotNullOperator="Is not null"
|
|
1945
|
+
|
|
1946
|
+
i18n-filterIsEmptyOperator="kendo.filter.filterIsEmptyOperator|The text of the is empty filter operator"
|
|
1947
|
+
filterIsEmptyOperator="Is empty"
|
|
1948
|
+
|
|
1949
|
+
i18n-filterIsNotEmptyOperator="kendo.filter.filterIsNotEmptyOperator|The text of the is not empty filter operator"
|
|
1950
|
+
filterIsNotEmptyOperator="Is not empty"
|
|
1951
|
+
|
|
1952
|
+
i18n-filterStartsWithOperator="kendo.filter.filterStartsWithOperator|The text of the starts with filter operator"
|
|
1953
|
+
filterStartsWithOperator="Starts with"
|
|
1954
|
+
|
|
1955
|
+
i18n-filterContainsOperator="kendo.filter.filterContainsOperator|The text of the contains filter operator"
|
|
1956
|
+
filterContainsOperator="Contains"
|
|
1957
|
+
|
|
1958
|
+
i18n-filterNotContainsOperator="kendo.filter.filterNotContainsOperator|The text of the does not contain filter operator"
|
|
1959
|
+
filterNotContainsOperator="Does not contain"
|
|
1960
|
+
|
|
1961
|
+
i18n-filterEndsWithOperator="kendo.filter.filterEndsWithOperator|The text of the ends with filter operator"
|
|
1962
|
+
filterEndsWithOperator="Ends with"
|
|
1963
|
+
|
|
1964
|
+
i18n-filterGteOperator="kendo.filter.filterGteOperator|The text of the greater than or equal filter operator"
|
|
1965
|
+
filterGteOperator="Is greater than or equal to"
|
|
1966
|
+
|
|
1967
|
+
i18n-filterGtOperator="kendo.filter.filterGtOperator|The text of the greater than filter operator"
|
|
1968
|
+
filterGtOperator="Is greater than"
|
|
1969
|
+
|
|
1970
|
+
i18n-filterLteOperator="kendo.filter.filterLteOperator|The text of the less than or equal filter operator"
|
|
1971
|
+
filterLteOperator="Is less than or equal to"
|
|
1972
|
+
|
|
1973
|
+
i18n-filterLtOperator="kendo.filter.filterLtOperator|The text of the less than filter operator"
|
|
1974
|
+
filterLtOperator="Is less than"
|
|
1975
|
+
|
|
1976
|
+
i18n-filterIsTrue="kendo.filter.filterIsTrue|The text of the IsTrue boolean filter option"
|
|
1977
|
+
filterIsTrue="Is True"
|
|
1978
|
+
|
|
1979
|
+
i18n-filterIsFalse="kendo.filter.filterIsFalse|The text of the IsFalse boolean filter option"
|
|
1980
|
+
filterIsFalse="Is False"
|
|
1981
|
+
|
|
1982
|
+
i18n-filterBooleanAll="kendo.filter.filterBooleanAll|The text of the (All) boolean filter option"
|
|
1983
|
+
filterBooleanAll="(All)"
|
|
1984
|
+
|
|
1985
|
+
i18n-filterAfterOrEqualOperator="kendo.filter.filterAfterOrEqualOperator|The text of the after or equal date filter operator"
|
|
1986
|
+
filterAfterOrEqualOperator="Is after or equal to"
|
|
1987
|
+
|
|
1988
|
+
i18n-filterAfterOperator="kendo.filter.filterAfterOperator|The text of the after date filter operator"
|
|
1989
|
+
filterAfterOperator="Is after"
|
|
1990
|
+
|
|
1991
|
+
i18n-filterBeforeOperator="kendo.filter.filterBeforeOperator|The text of the before date filter operator"
|
|
1992
|
+
filterBeforeOperator="Is before"
|
|
1993
|
+
|
|
1994
|
+
i18n-filterBeforeOrEqualOperator="kendo.filter.filterBeforeOrEqualOperator|The text of the before or equal date filter operator"
|
|
1995
|
+
filterBeforeOrEqualOperator="Is before or equal to"
|
|
1996
|
+
|
|
1997
|
+
i18n-filterFieldAriaLabel="kendo.filter.filterFieldAriaLabel|The text of the filter field aria label"
|
|
1998
|
+
filterFieldAriaLabel="field"
|
|
1999
|
+
|
|
2000
|
+
i18n-filterOperatorAriaLabel="kendo.filter.filterOperatorAriaLabel|The text of the filter operator aria label"
|
|
2001
|
+
filterOperatorAriaLabel="operator"
|
|
2002
|
+
|
|
2003
|
+
i18n-filterValueAriaLabel="kendo.filter.filterValueAriaLabel|The text of the filter value aria label"
|
|
2004
|
+
filterValueAriaLabel="value"
|
|
2005
|
+
|
|
2006
|
+
i18n-filterToolbarAriaLabel="kendo.filter.filterToolbarAriaLabel|The text of the filter row aria label"
|
|
2007
|
+
filterToolbarAriaLabel="filter row settings"
|
|
2008
|
+
|
|
2009
|
+
i18n-filterComponentAriaLabel="kendo.filter.filterComponentAriaLabel|The text of the filter component aria label"
|
|
2010
|
+
filterComponentAriaLabel="filter component"
|
|
2011
|
+
>
|
|
2012
|
+
</ng-container>
|
|
2013
|
+
<div class="k-widget k-filter" [attr.dir]="direction">
|
|
2014
|
+
<ul class='k-filter-container' role="tree" [attr.aria-label]="messageFor('filterComponentAriaLabel')">
|
|
2015
|
+
<li class='k-filter-group-main' role="treeitem">
|
|
2016
|
+
<kendo-filter-group
|
|
2017
|
+
[currentItem]="getCurrentFilter()"
|
|
2018
|
+
(valueChange)="onValueChange($event)"
|
|
2019
|
+
>
|
|
2020
|
+
</kendo-filter-group>
|
|
2021
|
+
</li>
|
|
2022
|
+
</ul>
|
|
2023
|
+
</div>
|
|
2024
|
+
`
|
|
2025
|
+
}]
|
|
2026
|
+
}], ctorParameters: function () { return [{ type: FilterService }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: NavigationService }, { type: i0.Renderer2 }]; }, propDecorators: { focusout: [{
|
|
2027
|
+
type: HostListener,
|
|
2028
|
+
args: ['focusout', ['$event']]
|
|
2029
|
+
}], onKeydown: [{
|
|
2030
|
+
type: HostListener,
|
|
2031
|
+
args: ['keydown', ['$event']]
|
|
2032
|
+
}], direction: [{
|
|
2033
|
+
type: HostBinding,
|
|
2034
|
+
args: ['attr.dir']
|
|
2035
|
+
}], filters: [{
|
|
2036
|
+
type: Input
|
|
2037
|
+
}], value: [{
|
|
2038
|
+
type: Input
|
|
2039
|
+
}], valueChange: [{
|
|
2040
|
+
type: Output
|
|
2041
|
+
}], filterFields: [{
|
|
2042
|
+
type: ContentChildren,
|
|
2043
|
+
args: [FilterFieldComponent]
|
|
2044
|
+
}], _filterItems: [{
|
|
2045
|
+
type: ViewChildren,
|
|
2046
|
+
args: [FilterItem]
|
|
2047
|
+
}] } });
|
|
2048
|
+
|
|
2049
|
+
/**
|
|
2050
|
+
* Custom component messages override default component messages
|
|
2051
|
+
* ([see example]({% slug globalization_filter %}#toc-localization)).
|
|
2052
|
+
*/
|
|
2053
|
+
class CustomMessagesComponent extends Messages {
|
|
2054
|
+
constructor(service) {
|
|
2055
|
+
super();
|
|
2056
|
+
this.service = service;
|
|
2057
|
+
}
|
|
2058
|
+
get override() {
|
|
2059
|
+
return true;
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
CustomMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CustomMessagesComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2063
|
+
CustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: CustomMessagesComponent, selector: "kendo-filter-messages", providers: [
|
|
2064
|
+
{
|
|
2065
|
+
provide: Messages,
|
|
2066
|
+
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
2067
|
+
}
|
|
2068
|
+
], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
2069
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CustomMessagesComponent, decorators: [{
|
|
2070
|
+
type: Component,
|
|
2071
|
+
args: [{
|
|
2072
|
+
providers: [
|
|
2073
|
+
{
|
|
2074
|
+
provide: Messages,
|
|
2075
|
+
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
2076
|
+
}
|
|
2077
|
+
],
|
|
2078
|
+
selector: 'kendo-filter-messages',
|
|
2079
|
+
template: ``
|
|
2080
|
+
}]
|
|
2081
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
|
|
2082
|
+
|
|
2083
|
+
const importedModules = [
|
|
2084
|
+
CommonModule,
|
|
2085
|
+
InputsModule,
|
|
2086
|
+
LabelModule,
|
|
2087
|
+
DropDownsModule,
|
|
2088
|
+
ButtonsModule,
|
|
2089
|
+
DateInputsModule
|
|
2090
|
+
];
|
|
2091
|
+
/**
|
|
2092
|
+
* @hidden
|
|
2093
|
+
*/
|
|
2094
|
+
class SharedModule {
|
|
2095
|
+
}
|
|
2096
|
+
SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2097
|
+
SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, imports: [CommonModule,
|
|
2098
|
+
InputsModule,
|
|
2099
|
+
LabelModule,
|
|
2100
|
+
DropDownsModule,
|
|
2101
|
+
ButtonsModule,
|
|
2102
|
+
DateInputsModule], exports: [CommonModule,
|
|
2103
|
+
InputsModule,
|
|
2104
|
+
LabelModule,
|
|
2105
|
+
DropDownsModule,
|
|
2106
|
+
ButtonsModule,
|
|
2107
|
+
DateInputsModule] });
|
|
2108
|
+
SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, imports: [[...importedModules], CommonModule,
|
|
2109
|
+
InputsModule,
|
|
2110
|
+
LabelModule,
|
|
2111
|
+
DropDownsModule,
|
|
2112
|
+
ButtonsModule,
|
|
2113
|
+
DateInputsModule] });
|
|
2114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, decorators: [{
|
|
2115
|
+
type: NgModule,
|
|
2116
|
+
args: [{
|
|
2117
|
+
imports: [...importedModules],
|
|
2118
|
+
exports: [...importedModules]
|
|
2119
|
+
}]
|
|
2120
|
+
}] });
|
|
2121
|
+
|
|
2122
|
+
/**
|
|
2123
|
+
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
|
|
2124
|
+
* definition for the Filter component.
|
|
2125
|
+
*
|
|
2126
|
+
* @example
|
|
2127
|
+
*
|
|
2128
|
+
* ```
|
|
2129
|
+
* // Import the Filter module
|
|
2130
|
+
* import { FilterModule } from '@progress/kendo-angular-filter';
|
|
2131
|
+
*
|
|
2132
|
+
* // The browser platform with a compiler
|
|
2133
|
+
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
2134
|
+
*
|
|
2135
|
+
* import { NgModule } from '@angular/core';
|
|
2136
|
+
*
|
|
2137
|
+
* // Import the app component
|
|
2138
|
+
* import { AppComponent } from './app.component';
|
|
2139
|
+
*
|
|
2140
|
+
* // Define the app module
|
|
2141
|
+
* _@NgModule({
|
|
2142
|
+
* declarations: [AppComponent], // declare app component
|
|
2143
|
+
* imports: [BrowserModule, FilterModule], // import Filter module
|
|
2144
|
+
* bootstrap: [AppComponent]
|
|
2145
|
+
* })
|
|
2146
|
+
* export class AppModule { }
|
|
2147
|
+
*
|
|
2148
|
+
* // Compile and launch the module
|
|
2149
|
+
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
2150
|
+
*
|
|
2151
|
+
* ```
|
|
2152
|
+
*/
|
|
2153
|
+
class FilterModule {
|
|
2154
|
+
}
|
|
2155
|
+
FilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2156
|
+
FilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterModule, declarations: [FilterComponent,
|
|
2157
|
+
FilterNumericEditorComponent,
|
|
2158
|
+
FilterTextEditorComponent,
|
|
2159
|
+
FilterExpressionComponent,
|
|
2160
|
+
FilterGroupComponent,
|
|
2161
|
+
FilterExpressionOperatorsComponent,
|
|
2162
|
+
FilterBooleanEditorComponent,
|
|
2163
|
+
FilterDateEditorComponent,
|
|
2164
|
+
LocalizedMessagesDirective,
|
|
2165
|
+
CustomMessagesComponent,
|
|
2166
|
+
AriaLabelValueDirective,
|
|
2167
|
+
FilterFieldComponent,
|
|
2168
|
+
FilterValueEditorTemplateDirective], imports: [SharedModule], exports: [FilterComponent,
|
|
2169
|
+
FilterNumericEditorComponent,
|
|
2170
|
+
FilterTextEditorComponent,
|
|
2171
|
+
FilterExpressionComponent,
|
|
2172
|
+
FilterGroupComponent,
|
|
2173
|
+
FilterExpressionOperatorsComponent,
|
|
2174
|
+
FilterBooleanEditorComponent,
|
|
2175
|
+
FilterDateEditorComponent,
|
|
2176
|
+
LocalizedMessagesDirective,
|
|
2177
|
+
CustomMessagesComponent,
|
|
2178
|
+
AriaLabelValueDirective,
|
|
2179
|
+
FilterFieldComponent,
|
|
2180
|
+
FilterValueEditorTemplateDirective] });
|
|
2181
|
+
FilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterModule, imports: [[SharedModule]] });
|
|
2182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilterModule, decorators: [{
|
|
2183
|
+
type: NgModule,
|
|
2184
|
+
args: [{
|
|
2185
|
+
imports: [SharedModule],
|
|
2186
|
+
declarations: [FilterComponent,
|
|
2187
|
+
FilterNumericEditorComponent,
|
|
2188
|
+
FilterTextEditorComponent,
|
|
2189
|
+
FilterExpressionComponent,
|
|
2190
|
+
FilterGroupComponent,
|
|
2191
|
+
FilterExpressionOperatorsComponent,
|
|
2192
|
+
FilterBooleanEditorComponent,
|
|
2193
|
+
FilterDateEditorComponent,
|
|
2194
|
+
LocalizedMessagesDirective,
|
|
2195
|
+
CustomMessagesComponent,
|
|
2196
|
+
AriaLabelValueDirective,
|
|
2197
|
+
FilterFieldComponent,
|
|
2198
|
+
FilterValueEditorTemplateDirective
|
|
2199
|
+
],
|
|
2200
|
+
exports: [FilterComponent,
|
|
2201
|
+
FilterNumericEditorComponent,
|
|
2202
|
+
FilterTextEditorComponent,
|
|
2203
|
+
FilterExpressionComponent,
|
|
2204
|
+
FilterGroupComponent,
|
|
2205
|
+
FilterExpressionOperatorsComponent,
|
|
2206
|
+
FilterBooleanEditorComponent,
|
|
2207
|
+
FilterDateEditorComponent,
|
|
2208
|
+
LocalizedMessagesDirective,
|
|
2209
|
+
CustomMessagesComponent,
|
|
2210
|
+
AriaLabelValueDirective,
|
|
2211
|
+
FilterFieldComponent,
|
|
2212
|
+
FilterValueEditorTemplateDirective
|
|
2213
|
+
]
|
|
2214
|
+
}]
|
|
2215
|
+
}] });
|
|
2216
|
+
|
|
2217
|
+
/**
|
|
2218
|
+
* Generated bundle index. Do not edit.
|
|
2219
|
+
*/
|
|
2220
|
+
|
|
2221
|
+
export { AriaLabelValueDirective, CustomMessagesComponent, FilterBooleanEditorComponent, FilterComponent, FilterDateEditorComponent, FilterExpressionComponent, FilterExpressionOperatorsComponent, FilterFieldComponent, FilterGroupComponent, FilterModule, FilterNumericEditorComponent, FilterTextEditorComponent, FilterValueEditorTemplateDirective, LocalizedMessagesDirective };
|
|
2222
|
+
|