@progress/kendo-angular-filter 1.0.0-next.202204011458 → 1.0.0
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/dist/cdn/js/kendo-angular-filter.js +20 -0
- package/dist/cdn/main.js +5 -0
- package/dist/es/aria-label.directive.js +30 -0
- package/dist/es/editors/boolean-editor.component.js +61 -0
- package/dist/es/editors/date-editor.component.js +45 -0
- package/dist/es/editors/numeric-editor.component.js +45 -0
- package/dist/es/editors/text-editor.component.js +45 -0
- package/dist/es/filter-expression-operators.component.js +48 -0
- package/dist/es/filter-expression.component.js +136 -0
- package/dist/es/filter-group.component.js +84 -0
- package/dist/es/filter.component.js +185 -0
- package/dist/es/filter.module.js +91 -0
- package/dist/es/filter.service.js +45 -0
- package/{esm2015/main.js → dist/es/index.js} +8 -3
- package/dist/es/localization/custom-messages.component.js +44 -0
- package/dist/es/localization/localized-messages.directive.js +35 -0
- package/dist/es/localization/messages.js +166 -0
- package/dist/es/main.js +6 -0
- package/{esm2015 → dist/es}/model/filter-expression.js +0 -1
- package/dist/es/package-metadata.js +15 -0
- package/dist/es/shared.module.js +35 -0
- package/dist/es/util.js +136 -0
- package/{aria-label.directive.d.ts → dist/es2015/aria-label.directive.d.ts} +0 -3
- package/dist/es2015/aria-label.directive.js +29 -0
- package/{editors → dist/es2015/editors}/boolean-editor.component.d.ts +0 -3
- package/dist/es2015/editors/boolean-editor.component.js +72 -0
- package/{editors → dist/es2015/editors}/date-editor.component.d.ts +0 -3
- package/dist/es2015/editors/date-editor.component.js +56 -0
- package/{editors → dist/es2015/editors}/numeric-editor.component.d.ts +0 -3
- package/dist/es2015/editors/numeric-editor.component.js +56 -0
- package/{editors → dist/es2015/editors}/text-editor.component.d.ts +0 -3
- package/dist/es2015/editors/text-editor.component.js +52 -0
- package/{filter-expression-operators.component.d.ts → dist/es2015/filter-expression-operators.component.d.ts} +0 -3
- package/dist/es2015/filter-expression-operators.component.js +59 -0
- package/{filter-expression.component.d.ts → dist/es2015/filter-expression.component.d.ts} +0 -5
- package/{esm2015 → dist/es2015}/filter-expression.component.js +26 -71
- package/{filter-group.component.d.ts → dist/es2015/filter-group.component.d.ts} +2 -7
- package/dist/es2015/filter-group.component.js +145 -0
- package/{filter.component.d.ts → dist/es2015/filter.component.d.ts} +2 -7
- package/{esm2015 → dist/es2015}/filter.component.js +34 -151
- package/dist/es2015/filter.module.d.ts +37 -0
- package/dist/es2015/filter.module.js +88 -0
- package/{filter.service.d.ts → dist/es2015/filter.service.d.ts} +0 -3
- package/{esm2015 → dist/es2015}/filter.service.js +10 -8
- package/{main.d.ts → dist/es2015/index.d.ts} +8 -4
- package/dist/es2015/index.js +21 -0
- package/dist/es2015/index.metadata.json +1 -0
- package/{localization → dist/es2015/localization}/custom-messages.component.d.ts +1 -4
- package/dist/es2015/localization/custom-messages.component.js +36 -0
- package/{localization → dist/es2015/localization}/localized-messages.directive.d.ts +0 -3
- package/dist/es2015/localization/localized-messages.directive.js +31 -0
- package/{localization → dist/es2015/localization}/messages.d.ts +0 -3
- package/dist/es2015/localization/messages.js +160 -0
- package/dist/es2015/main.d.ts +7 -0
- package/dist/es2015/main.js +6 -0
- package/{model → dist/es2015/model}/filter-expression.d.ts +0 -0
- package/{esm2015/kendo-angular-filter.js → dist/es2015/model/filter-expression.js} +1 -2
- package/{package-metadata.d.ts → dist/es2015/package-metadata.d.ts} +0 -0
- package/{esm2015 → dist/es2015}/package-metadata.js +1 -1
- package/{kendo-angular-filter.d.ts → dist/es2015/shared.module.d.ts} +3 -3
- package/dist/es2015/shared.module.js +32 -0
- package/dist/es2015/util.d.ts +147 -0
- package/{esm2015 → dist/es2015}/util.js +3 -3
- package/dist/fesm2015/index.js +1316 -0
- package/dist/fesm5/index.js +1076 -0
- package/dist/npm/aria-label.directive.js +32 -0
- package/dist/npm/editors/boolean-editor.component.js +63 -0
- package/dist/npm/editors/date-editor.component.js +47 -0
- package/dist/npm/editors/numeric-editor.component.js +47 -0
- package/dist/npm/editors/text-editor.component.js +47 -0
- package/dist/npm/filter-expression-operators.component.js +50 -0
- package/dist/npm/filter-expression.component.js +138 -0
- package/dist/npm/filter-group.component.js +86 -0
- package/dist/npm/filter.component.js +187 -0
- package/dist/npm/filter.module.js +93 -0
- package/dist/npm/filter.service.js +47 -0
- package/dist/npm/index.js +37 -0
- package/dist/npm/localization/custom-messages.component.js +46 -0
- package/dist/npm/localization/localized-messages.directive.js +37 -0
- package/dist/npm/localization/messages.js +168 -0
- package/dist/npm/main.js +10 -0
- package/dist/npm/model/filter-expression.js +9 -0
- package/dist/npm/package-metadata.js +17 -0
- package/dist/npm/shared.module.js +37 -0
- package/dist/npm/util.js +138 -0
- package/dist/systemjs/kendo-angular-filter.js +5 -0
- package/package.json +109 -38
- package/schematics/ngAdd/index.js +2 -5
- package/schematics/ngAdd/index.js.map +1 -1
- package/bundles/kendo-angular-filter.umd.js +0 -5
- package/esm2015/aria-label.directive.js +0 -28
- package/esm2015/editors/boolean-editor.component.js +0 -84
- package/esm2015/editors/date-editor.component.js +0 -67
- package/esm2015/editors/numeric-editor.component.js +0 -67
- package/esm2015/editors/text-editor.component.js +0 -59
- package/esm2015/filter-expression-operators.component.js +0 -68
- package/esm2015/filter-group.component.js +0 -206
- package/esm2015/filter.module.js +0 -117
- package/esm2015/localization/custom-messages.component.js +0 -41
- package/esm2015/localization/localized-messages.directive.js +0 -36
- package/esm2015/localization/messages.js +0 -95
- package/esm2015/shared.module.js +0 -50
- package/fesm2015/kendo-angular-filter.js +0 -1622
- package/filter.module.d.ts +0 -53
- package/shared.module.d.ts +0 -19
- package/util.d.ts +0 -147
|
@@ -0,0 +1,1316 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { __decorate, __metadata } from 'tslib';
|
|
6
|
+
import { Injectable, EventEmitter, isDevMode, HostBinding, Input, Output, Component, ChangeDetectorRef, Directive, ElementRef, Renderer2, forwardRef, NgModule } from '@angular/core';
|
|
7
|
+
import { LocalizationService, ComponentMessages, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
9
|
+
import { CommonModule } from '@angular/common';
|
|
10
|
+
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
|
|
11
|
+
import { InputsModule } from '@progress/kendo-angular-inputs';
|
|
12
|
+
import { LabelModule } from '@progress/kendo-angular-label';
|
|
13
|
+
import { ButtonsModule } from '@progress/kendo-angular-buttons';
|
|
14
|
+
import { DateInputsModule } from '@progress/kendo-angular-dateinputs';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
let FilterService = class FilterService {
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
constructor() {
|
|
24
|
+
this.value = { filters: [], logic: 'or' };
|
|
25
|
+
this.filters = [];
|
|
26
|
+
this.isEditorDisabled = false;
|
|
27
|
+
}
|
|
28
|
+
addFilterGroup(item) {
|
|
29
|
+
let filterGroup = { logic: 'or', filters: [] };
|
|
30
|
+
item.filters.push(filterGroup);
|
|
31
|
+
}
|
|
32
|
+
addFilterExpression(item) {
|
|
33
|
+
let filterExpression = { operator: 'eq', value: null, field: null };
|
|
34
|
+
item.filters.push(filterExpression);
|
|
35
|
+
}
|
|
36
|
+
remove(item, positionIndex, parentItem) {
|
|
37
|
+
if (!parentItem) {
|
|
38
|
+
parentItem = this.value;
|
|
39
|
+
}
|
|
40
|
+
if (item === parentItem) {
|
|
41
|
+
parentItem.filters = [];
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
let index = parentItem.filters.indexOf(item);
|
|
45
|
+
if (index >= 0 && index === positionIndex) {
|
|
46
|
+
parentItem.filters = parentItem.filters.filter((i) => i !== item);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
parentItem.filters.forEach((filter) => filter.filters && this.remove(item, positionIndex, filter));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
FilterService = __decorate([
|
|
53
|
+
Injectable()
|
|
54
|
+
], FilterService);
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @hidden
|
|
58
|
+
*/
|
|
59
|
+
const nullOperators = ["isnull", "isnotnull", "isempty", "isnotempty"];
|
|
60
|
+
/**
|
|
61
|
+
* @hidden
|
|
62
|
+
*/
|
|
63
|
+
const isArray = (value) => Array.isArray(value);
|
|
64
|
+
/**
|
|
65
|
+
* @hidden
|
|
66
|
+
*/
|
|
67
|
+
const getKeyByValue = (object, value) => {
|
|
68
|
+
return Object.keys(object).find(key => object[key] === value);
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* @hidden
|
|
72
|
+
*/
|
|
73
|
+
const defaultStringOperators = {
|
|
74
|
+
"filterEqOperator": "eq",
|
|
75
|
+
"filterNotEqOperator": "neq",
|
|
76
|
+
"filterContainsOperator": "contains",
|
|
77
|
+
"filterNotContainsOperator": "doesnotcontain",
|
|
78
|
+
"filterStartsWithOperator": "startswith",
|
|
79
|
+
"filterEndsWithOperator": "endswith",
|
|
80
|
+
"filterIsNullOperator": "isnull",
|
|
81
|
+
"filterIsNotNullOperator": "isnotnull",
|
|
82
|
+
"filterIsEmptyOperator": "isempty",
|
|
83
|
+
"filterIsNotEmptyOperator": "isnotempty"
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* @hidden
|
|
87
|
+
*/
|
|
88
|
+
const defaultNumericOperators = {
|
|
89
|
+
"filterEqOperator": "eq",
|
|
90
|
+
"filterNotEqOperator": "neq",
|
|
91
|
+
"filterGteOperator": "gte",
|
|
92
|
+
"filterGtOperator": "gt",
|
|
93
|
+
"filterLteOperator": "lte",
|
|
94
|
+
"filterLtOperator": "lt",
|
|
95
|
+
"filterIsNullOperator": "isnull",
|
|
96
|
+
"filterIsNotNullOperator": "isnotnull"
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* @hidden
|
|
100
|
+
*/
|
|
101
|
+
const defaultDateOperators = {
|
|
102
|
+
"filterEqOperator": "eq",
|
|
103
|
+
"filterNotEqOperator": "neq",
|
|
104
|
+
"filterAfterOrEqualOperator": "gte",
|
|
105
|
+
"filterAfterOperator": "gt",
|
|
106
|
+
"filterBeforeOrEqualOperator": "lte",
|
|
107
|
+
"filterBeforeOperator": "lt",
|
|
108
|
+
"filterIsNullOperator": "isnull",
|
|
109
|
+
"filterIsNotNullOperator": "isnotnull"
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* @hidden
|
|
113
|
+
*/
|
|
114
|
+
const defaultOperators = {
|
|
115
|
+
string: defaultStringOperators,
|
|
116
|
+
number: defaultNumericOperators,
|
|
117
|
+
date: defaultDateOperators
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* @hidden
|
|
121
|
+
*/
|
|
122
|
+
const logicOperators = {
|
|
123
|
+
"filterAndLogic": 'and',
|
|
124
|
+
"filterOrLogic": 'or'
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* @hidden
|
|
128
|
+
*/
|
|
129
|
+
const isFilterEditor = (editorType) => {
|
|
130
|
+
const supportedEditorTypes = ['string', 'number', 'boolean', 'date'];
|
|
131
|
+
return supportedEditorTypes.indexOf(editorType) >= 0;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* @hidden
|
|
135
|
+
*/
|
|
136
|
+
const localizeOperators = operators => localization => Object.keys(operators).map(key => ({
|
|
137
|
+
text: localization.get(key),
|
|
138
|
+
value: operators[key]
|
|
139
|
+
}));
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @hidden
|
|
143
|
+
*/
|
|
144
|
+
const packageMetadata = {
|
|
145
|
+
name: '@progress/kendo-angular-filter',
|
|
146
|
+
productName: 'Kendo UI for Angular',
|
|
147
|
+
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
148
|
+
publishDate: 1649147607,
|
|
149
|
+
version: '',
|
|
150
|
+
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Represents the [Kendo UI Filter component for Angular]({% slug overview_filter %}).
|
|
155
|
+
* The Filter component can be used to apply any user defined filter criteria.
|
|
156
|
+
* @example
|
|
157
|
+
* ```
|
|
158
|
+
* @Component({
|
|
159
|
+
* selector: 'my-app',
|
|
160
|
+
* template: `
|
|
161
|
+
* <kendo-filter [filters]="filters" (valueChange)="onValueChange($event)"></kendo-filter>
|
|
162
|
+
* `
|
|
163
|
+
* })
|
|
164
|
+
* export class AppComponent {
|
|
165
|
+
*
|
|
166
|
+
* public filters: FilterExpression[] = [
|
|
167
|
+
* {
|
|
168
|
+
* name: 'country',
|
|
169
|
+
* label: 'Country',
|
|
170
|
+
* filter: 'string',
|
|
171
|
+
* operators: ['eq', 'neq'],
|
|
172
|
+
* },
|
|
173
|
+
* {
|
|
174
|
+
* name: 'budget',
|
|
175
|
+
* filter: 'number'
|
|
176
|
+
* }
|
|
177
|
+
* ];
|
|
178
|
+
*
|
|
179
|
+
* onValueChange(e: CompositeFilterDescriptor){
|
|
180
|
+
* console.log(e)
|
|
181
|
+
* }
|
|
182
|
+
* }
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
let FilterComponent = class FilterComponent {
|
|
186
|
+
constructor(filterService, localization, cdr) {
|
|
187
|
+
this.filterService = filterService;
|
|
188
|
+
this.localization = localization;
|
|
189
|
+
this.cdr = cdr;
|
|
190
|
+
/**
|
|
191
|
+
* Fires every time the Filter component value is updated.
|
|
192
|
+
* That is each time a Filter Group or Filter Expression is added, removed, or updated.
|
|
193
|
+
*/
|
|
194
|
+
this.valueChange = new EventEmitter();
|
|
195
|
+
validatePackage(packageMetadata);
|
|
196
|
+
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Specifies the available user-defined filters. At least one filter should be provided.
|
|
200
|
+
*/
|
|
201
|
+
set filters(_filters) {
|
|
202
|
+
if (isDevMode() && (!isArray(_filters) || _filters.length === 0)) {
|
|
203
|
+
throw new Error(`Pass at least one user-defined filter through the [filters] input property. See http://www.telerik.com/kendo-angular-ui/components/filter/#data-binding`);
|
|
204
|
+
}
|
|
205
|
+
this.filterService.filters = _filters.map(filterExpression => {
|
|
206
|
+
let clonedFilter = Object.assign({}, filterExpression);
|
|
207
|
+
if (!clonedFilter.title) {
|
|
208
|
+
clonedFilter.title = clonedFilter.field;
|
|
209
|
+
}
|
|
210
|
+
return clonedFilter;
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
get filters() {
|
|
214
|
+
return this.filterService.filters;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Sets the initial `value` of the Filter component.
|
|
218
|
+
*/
|
|
219
|
+
set value(value) {
|
|
220
|
+
const clonedValue = JSON.parse(JSON.stringify(value));
|
|
221
|
+
this.normalizeValue(clonedValue);
|
|
222
|
+
this.filterService.value = clonedValue;
|
|
223
|
+
}
|
|
224
|
+
get value() {
|
|
225
|
+
return this.filterService.value;
|
|
226
|
+
}
|
|
227
|
+
ngOnInit() {
|
|
228
|
+
if (this.filters.length === 0) {
|
|
229
|
+
throw new Error(`Pass at least one user-defined filter through the [filters] input property. See http://www.telerik.com/kendo-angular-ui/components/filter/#data-binding`);
|
|
230
|
+
}
|
|
231
|
+
this.localizationSubscription = this.localization.changes.subscribe(({ rtl }) => {
|
|
232
|
+
this.direction = rtl ? 'rtl' : 'ltr';
|
|
233
|
+
this.cdr.detectChanges();
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
ngOnDestroy() {
|
|
237
|
+
if (this.localizationSubscription) {
|
|
238
|
+
this.localizationSubscription.unsubscribe();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* @hidden
|
|
243
|
+
*/
|
|
244
|
+
getCurrentFilter() {
|
|
245
|
+
return this.value;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* @hidden
|
|
249
|
+
*/
|
|
250
|
+
onValueChange() {
|
|
251
|
+
this.valueChange.emit(this.filterService.value);
|
|
252
|
+
}
|
|
253
|
+
normalizeFilter(filterDescriptor) {
|
|
254
|
+
const foundFilter = this.filterService.filters.find((filter) => filter.field === filterDescriptor.field);
|
|
255
|
+
if (isDevMode() && !foundFilter) {
|
|
256
|
+
throw new Error(`There is no user-defined filter with '${filterDescriptor.field}' field provided through the [filters] input property.`);
|
|
257
|
+
}
|
|
258
|
+
if (isDevMode() && foundFilter.editor === 'boolean' && (!filterDescriptor.value && filterDescriptor.value !== false)) {
|
|
259
|
+
console.warn(`Provide a value for the boolean '${filterDescriptor.field}' user-defined filter as the operator is always set to 'eq'.`);
|
|
260
|
+
}
|
|
261
|
+
if (filterDescriptor.operator && foundFilter.operators && !foundFilter.operators.some(operator => operator === filterDescriptor.operator)) {
|
|
262
|
+
throw new Error(`The user-defined filter with field '${filterDescriptor.field}' is missing the '${filterDescriptor.operator}' operator.`);
|
|
263
|
+
}
|
|
264
|
+
if (foundFilter.editor === 'boolean') {
|
|
265
|
+
filterDescriptor.operator = 'eq';
|
|
266
|
+
}
|
|
267
|
+
if (foundFilter.editor === 'date' && filterDescriptor.value) {
|
|
268
|
+
filterDescriptor.value = new Date(filterDescriptor.value);
|
|
269
|
+
}
|
|
270
|
+
if (!filterDescriptor.value && filterDescriptor.value !== false) {
|
|
271
|
+
filterDescriptor.value = null;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
normalizeValue(item) {
|
|
275
|
+
item.filters.forEach((item) => {
|
|
276
|
+
if (item.filters) {
|
|
277
|
+
this.normalizeValue(item);
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
this.normalizeFilter(item);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
__decorate([
|
|
286
|
+
HostBinding('attr.dir'),
|
|
287
|
+
__metadata("design:type", String)
|
|
288
|
+
], FilterComponent.prototype, "direction", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
Input(),
|
|
291
|
+
__metadata("design:type", Array),
|
|
292
|
+
__metadata("design:paramtypes", [Array])
|
|
293
|
+
], FilterComponent.prototype, "filters", null);
|
|
294
|
+
__decorate([
|
|
295
|
+
Input(),
|
|
296
|
+
__metadata("design:type", Object),
|
|
297
|
+
__metadata("design:paramtypes", [Object])
|
|
298
|
+
], FilterComponent.prototype, "value", null);
|
|
299
|
+
__decorate([
|
|
300
|
+
Output(),
|
|
301
|
+
__metadata("design:type", EventEmitter)
|
|
302
|
+
], FilterComponent.prototype, "valueChange", void 0);
|
|
303
|
+
FilterComponent = __decorate([
|
|
304
|
+
Component({
|
|
305
|
+
selector: 'kendo-filter',
|
|
306
|
+
template: `
|
|
307
|
+
<ng-container kendoFilterLocalizedMessages
|
|
308
|
+
i18n-editorDateTodayText="kendo.filter.editorDateTodayText|The text of the Today button of the Date editor"
|
|
309
|
+
editorDateTodayText="Today"
|
|
310
|
+
|
|
311
|
+
i18n-editorDateToggleText="kendo.filter.editorDateToggleText|The title of the Toggle button of the Date editor."
|
|
312
|
+
editorDateToggleText="Toggle calendar"
|
|
313
|
+
|
|
314
|
+
i18n-editorNumericDecrement="kendo.filter.editorNumericDecrement|The title of the Decrement button of the Numeric editor"
|
|
315
|
+
editorNumericDecrement="Decrement"
|
|
316
|
+
|
|
317
|
+
i18n-editorNumericIncrement="kendo.filter.editorNumericIncrement|The title of the Increment button of the Numeric editor"
|
|
318
|
+
editorNumericIncrement="Increment"
|
|
319
|
+
|
|
320
|
+
i18n-filterExpressionOperators="kendo.filter.filterExpressionOperators|The text of the Filter Expression Operators drop down"
|
|
321
|
+
filterExpressionOperators="Operators"
|
|
322
|
+
|
|
323
|
+
i18n-filterExpressionFilters="kendo.filter.filterExpressionFilters|The text of the Filter Expression filters drop down"
|
|
324
|
+
filterExpressionFilters="Fields"
|
|
325
|
+
|
|
326
|
+
i18n-remove="kendo.filter.remove|The text of the Remove button"
|
|
327
|
+
remove="Remove"
|
|
328
|
+
|
|
329
|
+
i18n-addFilter="kendo.filter.addFilter|The text of the Add Filter button"
|
|
330
|
+
addFilter="Add Filter"
|
|
331
|
+
|
|
332
|
+
i18n-addGroup="kendo.filter.addGroup|The text of the Add Group button"
|
|
333
|
+
addGroup="Add Group"
|
|
334
|
+
|
|
335
|
+
i18n-filterAndLogic="kendo.filter.filterAndLogic|The text of the And filter logic"
|
|
336
|
+
filterAndLogic="And"
|
|
337
|
+
|
|
338
|
+
i18n-filterOrLogic="kendo.filter.filterOrLogic|The text of the Or filter logic"
|
|
339
|
+
filterOrLogic="Or"
|
|
340
|
+
|
|
341
|
+
i18n-filterEqOperator="kendo.filter.filterEqOperator|The text of the equal filter operator"
|
|
342
|
+
filterEqOperator="Is equal to"
|
|
343
|
+
|
|
344
|
+
i18n-filterNotEqOperator="kendo.filter.filterNotEqOperator|The text of the not equal filter operator"
|
|
345
|
+
filterNotEqOperator="Is not equal to"
|
|
346
|
+
|
|
347
|
+
i18n-filterIsNullOperator="kendo.filter.filterIsNullOperator|The text of the is null filter operator"
|
|
348
|
+
filterIsNullOperator="Is null"
|
|
349
|
+
|
|
350
|
+
i18n-filterIsNotNullOperator="kendo.filter.filterIsNotNullOperator|The text of the is not null filter operator"
|
|
351
|
+
filterIsNotNullOperator="Is not null"
|
|
352
|
+
|
|
353
|
+
i18n-filterIsEmptyOperator="kendo.filter.filterIsEmptyOperator|The text of the is empty filter operator"
|
|
354
|
+
filterIsEmptyOperator="Is empty"
|
|
355
|
+
|
|
356
|
+
i18n-filterIsNotEmptyOperator="kendo.filter.filterIsNotEmptyOperator|The text of the is not empty filter operator"
|
|
357
|
+
filterIsNotEmptyOperator="Is not empty"
|
|
358
|
+
|
|
359
|
+
i18n-filterStartsWithOperator="kendo.filter.filterStartsWithOperator|The text of the starts with filter operator"
|
|
360
|
+
filterStartsWithOperator="Starts with"
|
|
361
|
+
|
|
362
|
+
i18n-filterContainsOperator="kendo.filter.filterContainsOperator|The text of the contains filter operator"
|
|
363
|
+
filterContainsOperator="Contains"
|
|
364
|
+
|
|
365
|
+
i18n-filterNotContainsOperator="kendo.filter.filterNotContainsOperator|The text of the does not contain filter operator"
|
|
366
|
+
filterNotContainsOperator="Does not contain"
|
|
367
|
+
|
|
368
|
+
i18n-filterEndsWithOperator="kendo.filter.filterEndsWithOperator|The text of the ends with filter operator"
|
|
369
|
+
filterEndsWithOperator="Ends with"
|
|
370
|
+
|
|
371
|
+
i18n-filterGteOperator="kendo.filter.filterGteOperator|The text of the greater than or equal filter operator"
|
|
372
|
+
filterGteOperator="Is greater than or equal to"
|
|
373
|
+
|
|
374
|
+
i18n-filterGtOperator="kendo.filter.filterGtOperator|The text of the greater than filter operator"
|
|
375
|
+
filterGtOperator="Is greater than"
|
|
376
|
+
|
|
377
|
+
i18n-filterLteOperator="kendo.filter.filterLteOperator|The text of the less than or equal filter operator"
|
|
378
|
+
filterLteOperator="Is less than or equal to"
|
|
379
|
+
|
|
380
|
+
i18n-filterLtOperator="kendo.filter.filterLtOperator|The text of the less than filter operator"
|
|
381
|
+
filterLtOperator="Is less than"
|
|
382
|
+
|
|
383
|
+
i18n-filterIsTrue="kendo.filter.filterIsTrue|The text of the IsTrue boolean filter option"
|
|
384
|
+
filterIsTrue="Is True"
|
|
385
|
+
|
|
386
|
+
i18n-filterIsFalse="kendo.filter.filterIsFalse|The text of the IsFalse boolean filter option"
|
|
387
|
+
filterIsFalse="Is False"
|
|
388
|
+
|
|
389
|
+
i18n-filterBooleanAll="kendo.filter.filterBooleanAll|The text of the (All) boolean filter option"
|
|
390
|
+
filterBooleanAll="(All)"
|
|
391
|
+
|
|
392
|
+
i18n-filterAfterOrEqualOperator="kendo.filter.filterAfterOrEqualOperator|The text of the after or equal date filter operator"
|
|
393
|
+
filterAfterOrEqualOperator="Is after or equal to"
|
|
394
|
+
|
|
395
|
+
i18n-filterAfterOperator="kendo.filter.filterAfterOperator|The text of the after date filter operator"
|
|
396
|
+
filterAfterOperator="Is after"
|
|
397
|
+
|
|
398
|
+
i18n-filterBeforeOperator="kendo.filter.filterBeforeOperator|The text of the before date filter operator"
|
|
399
|
+
filterBeforeOperator="Is before"
|
|
400
|
+
|
|
401
|
+
i18n-filterBeforeOrEqualOperator="kendo.filter.filterBeforeOrEqualOperator|The text of the before or equal date filter operator"
|
|
402
|
+
filterBeforeOrEqualOperator="Is before or equal to"
|
|
403
|
+
|
|
404
|
+
i18n-filterFieldAriaLabel="kendo.filter.filterFieldAriaLabel|The text of the filter field aria label"
|
|
405
|
+
filterFieldAriaLabel="field"
|
|
406
|
+
|
|
407
|
+
i18n-filterOperatorAriaLabel="kendo.filter.filterOperatorAriaLabel|The text of the filter operator aria label"
|
|
408
|
+
filterOperatorAriaLabel="operator"
|
|
409
|
+
|
|
410
|
+
i18n-filterValueAriaLabel="kendo.filter.filterValueAriaLabel|The text of the filter value aria label"
|
|
411
|
+
filterValueAriaLabel="value"
|
|
412
|
+
|
|
413
|
+
i18n-filterAriaLabel="kendo.filter.filterAriaLabel|The text of the filter row aria label"
|
|
414
|
+
filterAriaLabel="filter"
|
|
415
|
+
|
|
416
|
+
i18n-filterToolbarAriaLabel="kendo.filter.filterToolbarAriaLabel|The text of the filter toolbar aria label"
|
|
417
|
+
filterToolbarAriaLabel="filter settings"
|
|
418
|
+
>
|
|
419
|
+
</ng-container>
|
|
420
|
+
<div class="k-widget k-filter" [attr.dir]="direction">
|
|
421
|
+
<ul class='k-filter-container'>
|
|
422
|
+
<li class='k-filter-group-main'>
|
|
423
|
+
<kendo-filter-group
|
|
424
|
+
[currentItem]="getCurrentFilter()"
|
|
425
|
+
(valueChange)="onValueChange()"
|
|
426
|
+
>
|
|
427
|
+
</kendo-filter-group>
|
|
428
|
+
</li>
|
|
429
|
+
</ul>
|
|
430
|
+
</div>
|
|
431
|
+
`,
|
|
432
|
+
providers: [FilterService]
|
|
433
|
+
}),
|
|
434
|
+
__metadata("design:paramtypes", [FilterService,
|
|
435
|
+
LocalizationService,
|
|
436
|
+
ChangeDetectorRef])
|
|
437
|
+
], FilterComponent);
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* @hidden
|
|
441
|
+
*/
|
|
442
|
+
let AriaLabelValueDirective = class AriaLabelValueDirective {
|
|
443
|
+
constructor(hostElement, renderer) {
|
|
444
|
+
this.hostElement = hostElement;
|
|
445
|
+
this.renderer = renderer;
|
|
446
|
+
}
|
|
447
|
+
ngOnChanges() {
|
|
448
|
+
const target = this.hostElement.nativeElement.querySelector('input') || this.hostElement.nativeElement;
|
|
449
|
+
this.renderer.setAttribute(target, 'aria-label', this.ariaLabel);
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
__decorate([
|
|
453
|
+
Input('kendoAriaLabelValue'),
|
|
454
|
+
__metadata("design:type", String)
|
|
455
|
+
], AriaLabelValueDirective.prototype, "ariaLabel", void 0);
|
|
456
|
+
AriaLabelValueDirective = __decorate([
|
|
457
|
+
Directive({ selector: '[kendoAriaLabelValue]' }),
|
|
458
|
+
__metadata("design:paramtypes", [ElementRef,
|
|
459
|
+
Renderer2])
|
|
460
|
+
], AriaLabelValueDirective);
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* @hidden
|
|
464
|
+
*/
|
|
465
|
+
let FilterBooleanEditorComponent = class FilterBooleanEditorComponent {
|
|
466
|
+
constructor(localization, cdr) {
|
|
467
|
+
this.localization = localization;
|
|
468
|
+
this.cdr = cdr;
|
|
469
|
+
this.valueChange = new EventEmitter();
|
|
470
|
+
this.items = this.getValueItems();
|
|
471
|
+
this.defaultItem = this.getDefaultItem();
|
|
472
|
+
}
|
|
473
|
+
ngOnInit() {
|
|
474
|
+
this.localizationSubscription = this.localization.changes.subscribe(() => {
|
|
475
|
+
this.defaultItem = this.getDefaultItem();
|
|
476
|
+
this.items = this.getValueItems();
|
|
477
|
+
this.cdr.detectChanges();
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
getDefaultItem() {
|
|
481
|
+
return { text: this.localization.get("filterBooleanAll"), value: null };
|
|
482
|
+
}
|
|
483
|
+
getValueItems() {
|
|
484
|
+
return [
|
|
485
|
+
{ text: this.localization.get("filterIsTrue"), value: true },
|
|
486
|
+
{ text: this.localization.get("filterIsFalse"), value: false }
|
|
487
|
+
];
|
|
488
|
+
}
|
|
489
|
+
ngOnDestroy() {
|
|
490
|
+
if (this.localizationSubscription) {
|
|
491
|
+
this.localizationSubscription.unsubscribe();
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
messageFor(key) {
|
|
495
|
+
return this.localization.get(key);
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
__decorate([
|
|
499
|
+
Input(),
|
|
500
|
+
__metadata("design:type", Object)
|
|
501
|
+
], FilterBooleanEditorComponent.prototype, "currentItem", void 0);
|
|
502
|
+
__decorate([
|
|
503
|
+
Output(),
|
|
504
|
+
__metadata("design:type", EventEmitter)
|
|
505
|
+
], FilterBooleanEditorComponent.prototype, "valueChange", void 0);
|
|
506
|
+
FilterBooleanEditorComponent = __decorate([
|
|
507
|
+
Component({
|
|
508
|
+
selector: 'kendo-filter-boolean-editor',
|
|
509
|
+
template: `
|
|
510
|
+
<kendo-dropdownlist
|
|
511
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
512
|
+
class="k-filter-toolbar-item k-filter-value"
|
|
513
|
+
[(value)]="currentItem.value"
|
|
514
|
+
(valueChange)="valueChange.emit()"
|
|
515
|
+
[data]="items"
|
|
516
|
+
[defaultItem]="defaultItem"
|
|
517
|
+
[valuePrimitive]="true"
|
|
518
|
+
textField="text"
|
|
519
|
+
valueField="value"
|
|
520
|
+
>
|
|
521
|
+
</kendo-dropdownlist>
|
|
522
|
+
`
|
|
523
|
+
}),
|
|
524
|
+
__metadata("design:paramtypes", [LocalizationService, ChangeDetectorRef])
|
|
525
|
+
], FilterBooleanEditorComponent);
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* @hidden
|
|
529
|
+
*/
|
|
530
|
+
let FilterDateEditorComponent = class FilterDateEditorComponent {
|
|
531
|
+
constructor(localization, filterService) {
|
|
532
|
+
this.localization = localization;
|
|
533
|
+
this.filterService = filterService;
|
|
534
|
+
this.valueChange = new EventEmitter();
|
|
535
|
+
}
|
|
536
|
+
messageFor(key) {
|
|
537
|
+
return this.localization.get(key);
|
|
538
|
+
}
|
|
539
|
+
isDisabled() {
|
|
540
|
+
const isDisabled = this.filterService.isEditorDisabled;
|
|
541
|
+
if (isDisabled) {
|
|
542
|
+
this.currentItem.value = null;
|
|
543
|
+
}
|
|
544
|
+
return isDisabled;
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
__decorate([
|
|
548
|
+
Input(),
|
|
549
|
+
__metadata("design:type", Object)
|
|
550
|
+
], FilterDateEditorComponent.prototype, "currentItem", void 0);
|
|
551
|
+
__decorate([
|
|
552
|
+
Output(),
|
|
553
|
+
__metadata("design:type", EventEmitter)
|
|
554
|
+
], FilterDateEditorComponent.prototype, "valueChange", void 0);
|
|
555
|
+
FilterDateEditorComponent = __decorate([
|
|
556
|
+
Component({
|
|
557
|
+
selector: 'kendo-filter-date-editor',
|
|
558
|
+
template: `
|
|
559
|
+
<kendo-datepicker
|
|
560
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
561
|
+
class="k-filter-toolbar-item k-filter-value"
|
|
562
|
+
[(value)]="currentItem.value"
|
|
563
|
+
(valueChange)="valueChange.emit()"
|
|
564
|
+
[disabled]="isDisabled()">
|
|
565
|
+
<kendo-datepicker-messages
|
|
566
|
+
[toggle]="messageFor('editorDateToggleText')"
|
|
567
|
+
[today]="messageFor('editorDateTodayText')">
|
|
568
|
+
</kendo-datepicker-messages>
|
|
569
|
+
</kendo-datepicker>
|
|
570
|
+
`
|
|
571
|
+
}),
|
|
572
|
+
__metadata("design:paramtypes", [LocalizationService, FilterService])
|
|
573
|
+
], FilterDateEditorComponent);
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* @hidden
|
|
577
|
+
*/
|
|
578
|
+
let FilterNumericEditorComponent = class FilterNumericEditorComponent {
|
|
579
|
+
constructor(localization, filterService) {
|
|
580
|
+
this.localization = localization;
|
|
581
|
+
this.filterService = filterService;
|
|
582
|
+
this.valueChange = new EventEmitter();
|
|
583
|
+
}
|
|
584
|
+
messageFor(key) {
|
|
585
|
+
return this.localization.get(key);
|
|
586
|
+
}
|
|
587
|
+
isDisabled() {
|
|
588
|
+
const isDisabled = this.filterService.isEditorDisabled;
|
|
589
|
+
if (isDisabled) {
|
|
590
|
+
this.currentItem.value = null;
|
|
591
|
+
}
|
|
592
|
+
return isDisabled;
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
__decorate([
|
|
596
|
+
Input(),
|
|
597
|
+
__metadata("design:type", Object)
|
|
598
|
+
], FilterNumericEditorComponent.prototype, "currentItem", void 0);
|
|
599
|
+
__decorate([
|
|
600
|
+
Output(),
|
|
601
|
+
__metadata("design:type", EventEmitter)
|
|
602
|
+
], FilterNumericEditorComponent.prototype, "valueChange", void 0);
|
|
603
|
+
FilterNumericEditorComponent = __decorate([
|
|
604
|
+
Component({
|
|
605
|
+
selector: 'kendo-filter-numeric-editor',
|
|
606
|
+
template: `
|
|
607
|
+
<kendo-numerictextbox
|
|
608
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
609
|
+
class="k-filter-toolbar-item k-filter-value"
|
|
610
|
+
[(value)]="currentItem.value"
|
|
611
|
+
(valueChange)="valueChange.emit()"
|
|
612
|
+
[disabled]="isDisabled()">
|
|
613
|
+
<kendo-numerictextbox-messages
|
|
614
|
+
[increment]="messageFor('editorNumericIncrement')"
|
|
615
|
+
[decrement]="messageFor('editorNumericDecrement')">
|
|
616
|
+
</kendo-numerictextbox-messages>
|
|
617
|
+
</kendo-numerictextbox>
|
|
618
|
+
`
|
|
619
|
+
}),
|
|
620
|
+
__metadata("design:paramtypes", [LocalizationService, FilterService])
|
|
621
|
+
], FilterNumericEditorComponent);
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* @hidden
|
|
625
|
+
*/
|
|
626
|
+
let FilterTextEditorComponent = class FilterTextEditorComponent {
|
|
627
|
+
constructor(localization, filterService) {
|
|
628
|
+
this.localization = localization;
|
|
629
|
+
this.filterService = filterService;
|
|
630
|
+
this.valueChange = new EventEmitter();
|
|
631
|
+
}
|
|
632
|
+
isDisabled() {
|
|
633
|
+
const isDisabled = this.filterService.isEditorDisabled;
|
|
634
|
+
if (isDisabled) {
|
|
635
|
+
this.currentItem.value = null;
|
|
636
|
+
}
|
|
637
|
+
return isDisabled;
|
|
638
|
+
}
|
|
639
|
+
messageFor(key) {
|
|
640
|
+
return this.localization.get(key);
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
__decorate([
|
|
644
|
+
Input(),
|
|
645
|
+
__metadata("design:type", Object)
|
|
646
|
+
], FilterTextEditorComponent.prototype, "currentItem", void 0);
|
|
647
|
+
__decorate([
|
|
648
|
+
Output(),
|
|
649
|
+
__metadata("design:type", EventEmitter)
|
|
650
|
+
], FilterTextEditorComponent.prototype, "valueChange", void 0);
|
|
651
|
+
FilterTextEditorComponent = __decorate([
|
|
652
|
+
Component({
|
|
653
|
+
selector: 'kendo-filter-text-editor',
|
|
654
|
+
template: `
|
|
655
|
+
<kendo-textbox
|
|
656
|
+
[kendoAriaLabelValue]="messageFor('filterValueAriaLabel')"
|
|
657
|
+
class="k-filter-toolbar-item k-filter-value"
|
|
658
|
+
[(value)]="currentItem.value"
|
|
659
|
+
(valueChange)="valueChange.emit()"
|
|
660
|
+
[disabled]="isDisabled()">
|
|
661
|
+
</kendo-textbox>
|
|
662
|
+
`
|
|
663
|
+
}),
|
|
664
|
+
__metadata("design:paramtypes", [LocalizationService, FilterService])
|
|
665
|
+
], FilterTextEditorComponent);
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* @hidden
|
|
669
|
+
*/
|
|
670
|
+
let FilterExpressionOperatorsComponent = class FilterExpressionOperatorsComponent {
|
|
671
|
+
constructor(filterService, localization) {
|
|
672
|
+
this.filterService = filterService;
|
|
673
|
+
this.localization = localization;
|
|
674
|
+
this.valueChange = new EventEmitter();
|
|
675
|
+
this.operators = [];
|
|
676
|
+
}
|
|
677
|
+
messageFor(key) {
|
|
678
|
+
return this.localization.get(key);
|
|
679
|
+
}
|
|
680
|
+
operatorValueChange(value) {
|
|
681
|
+
this.valueChange.emit();
|
|
682
|
+
this.filterService.isEditorDisabled = nullOperators.indexOf(value) >= 0;
|
|
683
|
+
}
|
|
684
|
+
};
|
|
685
|
+
__decorate([
|
|
686
|
+
Input(),
|
|
687
|
+
__metadata("design:type", Object)
|
|
688
|
+
], FilterExpressionOperatorsComponent.prototype, "currentItem", void 0);
|
|
689
|
+
__decorate([
|
|
690
|
+
Output(),
|
|
691
|
+
__metadata("design:type", EventEmitter)
|
|
692
|
+
], FilterExpressionOperatorsComponent.prototype, "valueChange", void 0);
|
|
693
|
+
__decorate([
|
|
694
|
+
Input(),
|
|
695
|
+
__metadata("design:type", Array)
|
|
696
|
+
], FilterExpressionOperatorsComponent.prototype, "operators", void 0);
|
|
697
|
+
FilterExpressionOperatorsComponent = __decorate([
|
|
698
|
+
Component({
|
|
699
|
+
selector: 'kendo-filter-expression-operators',
|
|
700
|
+
template: `
|
|
701
|
+
<kendo-dropdownlist
|
|
702
|
+
[kendoAriaLabelValue]="messageFor('filterOperatorAriaLabel')"
|
|
703
|
+
[data]="operators"
|
|
704
|
+
[title]="messageFor('filterExpressionOperators')"
|
|
705
|
+
[(value)]="currentItem.operator"
|
|
706
|
+
(valueChange)="operatorValueChange($event)"
|
|
707
|
+
[valuePrimitive]="true"
|
|
708
|
+
textField="text"
|
|
709
|
+
valueField="value"
|
|
710
|
+
>
|
|
711
|
+
</kendo-dropdownlist>
|
|
712
|
+
`
|
|
713
|
+
}),
|
|
714
|
+
__metadata("design:paramtypes", [FilterService, LocalizationService])
|
|
715
|
+
], FilterExpressionOperatorsComponent);
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* @hidden
|
|
719
|
+
*/
|
|
720
|
+
let FilterExpressionComponent = class FilterExpressionComponent {
|
|
721
|
+
constructor(filterService, localization, cdr) {
|
|
722
|
+
this.filterService = filterService;
|
|
723
|
+
this.localization = localization;
|
|
724
|
+
this.cdr = cdr;
|
|
725
|
+
this.valueChange = new EventEmitter();
|
|
726
|
+
this.operators = [];
|
|
727
|
+
this.filters = [];
|
|
728
|
+
this.isBoolean = false;
|
|
729
|
+
this.isEditorDisabled = false;
|
|
730
|
+
}
|
|
731
|
+
ngOnInit() {
|
|
732
|
+
this.filters = this.filterService.filters;
|
|
733
|
+
const foundFilter = this.getFilterExpressionByField(this.currentItem.field);
|
|
734
|
+
if (this.currentItem.field) {
|
|
735
|
+
this.setOperators(foundFilter);
|
|
736
|
+
}
|
|
737
|
+
const defaultFilter = this.getFilterExpressionByField(this.filterService.filters[0].field);
|
|
738
|
+
if (!this.currentItem.field) {
|
|
739
|
+
this.currentItem.field = this.filterService.filters[0].field;
|
|
740
|
+
this.setOperators(defaultFilter);
|
|
741
|
+
}
|
|
742
|
+
this.localizationSubscription = this.localization.changes.subscribe(() => {
|
|
743
|
+
this.setOperators(foundFilter || defaultFilter);
|
|
744
|
+
this.cdr.detectChanges();
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
ngOnDestroy() {
|
|
748
|
+
if (this.localizationSubscription) {
|
|
749
|
+
this.localizationSubscription.unsubscribe();
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
normalizeOperators(filterEditor, operators) {
|
|
753
|
+
let result = [];
|
|
754
|
+
for (let j = 0; j < operators.length; j++) {
|
|
755
|
+
if (isFilterEditor(filterEditor)) {
|
|
756
|
+
result.push({
|
|
757
|
+
value: operators[j],
|
|
758
|
+
text: this.localization.get(getKeyByValue(defaultOperators[filterEditor], operators[j]))
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
return result;
|
|
763
|
+
}
|
|
764
|
+
messageFor(key) {
|
|
765
|
+
return this.localization.get(key);
|
|
766
|
+
}
|
|
767
|
+
getFilterExpressionByField(name) {
|
|
768
|
+
const foundFilter = this.filterService.filters.find(filter => filter.field === name);
|
|
769
|
+
if (foundFilter) {
|
|
770
|
+
return foundFilter;
|
|
771
|
+
}
|
|
772
|
+
return null;
|
|
773
|
+
}
|
|
774
|
+
filterValueChange(value) {
|
|
775
|
+
this.currentItem.value = null;
|
|
776
|
+
this.currentItem.field = value;
|
|
777
|
+
const foundFilter = this.getFilterExpressionByField(this.currentItem.field);
|
|
778
|
+
this.setOperators(foundFilter);
|
|
779
|
+
this.valueChange.emit();
|
|
780
|
+
}
|
|
781
|
+
getDefaultOperators(operatorsType) {
|
|
782
|
+
switch (operatorsType) {
|
|
783
|
+
case 'string':
|
|
784
|
+
return localizeOperators(defaultStringOperators)(this.localization);
|
|
785
|
+
case 'number':
|
|
786
|
+
return localizeOperators(defaultNumericOperators)(this.localization);
|
|
787
|
+
case 'date':
|
|
788
|
+
return localizeOperators(defaultDateOperators)(this.localization);
|
|
789
|
+
default:
|
|
790
|
+
break;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
getEditorType() {
|
|
794
|
+
let item = this.filterService.filters.find((filterExpression) => filterExpression.field === this.currentItem.field);
|
|
795
|
+
return item.editor;
|
|
796
|
+
}
|
|
797
|
+
removeFilterExpression() {
|
|
798
|
+
this.filterService.remove(this.currentItem, this.index);
|
|
799
|
+
this.valueChange.emit();
|
|
800
|
+
}
|
|
801
|
+
setOperators(filter) {
|
|
802
|
+
this.isBoolean = filter.editor === 'boolean';
|
|
803
|
+
if (this.isBoolean) {
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
if (filter.operators) {
|
|
807
|
+
const localizedOperators = this.normalizeOperators(filter.editor, filter.operators);
|
|
808
|
+
this.operators = localizedOperators;
|
|
809
|
+
if (!this.currentItem.operator) {
|
|
810
|
+
this.currentItem.operator = localizedOperators[0].value;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
else {
|
|
814
|
+
this.operators = this.getDefaultOperators(filter.editor);
|
|
815
|
+
if (!this.currentItem.operator) {
|
|
816
|
+
this.currentItem.operator = this.operators[0].value;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
__decorate([
|
|
822
|
+
Input(),
|
|
823
|
+
__metadata("design:type", Number)
|
|
824
|
+
], FilterExpressionComponent.prototype, "index", void 0);
|
|
825
|
+
__decorate([
|
|
826
|
+
Input(),
|
|
827
|
+
__metadata("design:type", Object)
|
|
828
|
+
], FilterExpressionComponent.prototype, "currentItem", void 0);
|
|
829
|
+
__decorate([
|
|
830
|
+
Output(),
|
|
831
|
+
__metadata("design:type", EventEmitter)
|
|
832
|
+
], FilterExpressionComponent.prototype, "valueChange", void 0);
|
|
833
|
+
FilterExpressionComponent = __decorate([
|
|
834
|
+
Component({
|
|
835
|
+
selector: 'kendo-filter-expression',
|
|
836
|
+
template: `
|
|
837
|
+
<div class="k-filter-toolbar" role="group" [attr.aria-label]="messageFor('filterAriaLabel')">
|
|
838
|
+
<div class="k-toolbar">
|
|
839
|
+
<div class="k-filter-toolbar-item k-filter-field">
|
|
840
|
+
<kendo-dropdownlist
|
|
841
|
+
[kendoAriaLabelValue]="messageFor('filterFieldAriaLabel')"
|
|
842
|
+
[title]="messageFor('filterExpressionFilters')"
|
|
843
|
+
[data]="filters"
|
|
844
|
+
textField="title"
|
|
845
|
+
valueField="field"
|
|
846
|
+
[value]="currentItem.field"
|
|
847
|
+
[valuePrimitive]="true"
|
|
848
|
+
(valueChange)="filterValueChange($event)">
|
|
849
|
+
</kendo-dropdownlist>
|
|
850
|
+
</div>
|
|
851
|
+
<div *ngIf="!isBoolean" class="k-filter-toolbar-item k-filter-operator">
|
|
852
|
+
<kendo-filter-expression-operators
|
|
853
|
+
[currentItem]="currentItem"
|
|
854
|
+
[operators]="operators"
|
|
855
|
+
(valueChange)="valueChange.emit();">
|
|
856
|
+
</kendo-filter-expression-operators>
|
|
857
|
+
</div>
|
|
858
|
+
|
|
859
|
+
<ng-container [ngSwitch]="getEditorType()">
|
|
860
|
+
<kendo-filter-text-editor *ngSwitchCase="'string'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-text-editor>
|
|
861
|
+
<kendo-filter-numeric-editor *ngSwitchCase="'number'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-numeric-editor>
|
|
862
|
+
<kendo-filter-boolean-editor *ngSwitchCase="'boolean'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-boolean-editor>
|
|
863
|
+
<kendo-filter-date-editor *ngSwitchCase="'date'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-date-editor>
|
|
864
|
+
</ng-container>
|
|
865
|
+
|
|
866
|
+
<div class="k-filter-toolbar-item">
|
|
867
|
+
<button
|
|
868
|
+
kendoButton
|
|
869
|
+
icon="close"
|
|
870
|
+
fillMode="flat"
|
|
871
|
+
[title]="messageFor('remove')"
|
|
872
|
+
(click)="removeFilterExpression()">
|
|
873
|
+
</button>
|
|
874
|
+
</div>
|
|
875
|
+
</div>
|
|
876
|
+
</div>
|
|
877
|
+
`
|
|
878
|
+
}),
|
|
879
|
+
__metadata("design:paramtypes", [FilterService, LocalizationService, ChangeDetectorRef])
|
|
880
|
+
], FilterExpressionComponent);
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* @hidden
|
|
884
|
+
*/
|
|
885
|
+
let FilterGroupComponent = class FilterGroupComponent {
|
|
886
|
+
constructor(filterService, localization, cdr) {
|
|
887
|
+
this.filterService = filterService;
|
|
888
|
+
this.localization = localization;
|
|
889
|
+
this.cdr = cdr;
|
|
890
|
+
this.index = 0;
|
|
891
|
+
this.currentItem = {
|
|
892
|
+
logic: 'or',
|
|
893
|
+
filters: []
|
|
894
|
+
};
|
|
895
|
+
this.valueChange = new EventEmitter();
|
|
896
|
+
this.operators = [];
|
|
897
|
+
}
|
|
898
|
+
ngOnInit() {
|
|
899
|
+
this.operators = this.getLogicOperators();
|
|
900
|
+
this.localizationSubscription = this.localization.changes.subscribe(() => {
|
|
901
|
+
this.operators = this.getLogicOperators();
|
|
902
|
+
this.cdr.detectChanges();
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
ngOnDestroy() {
|
|
906
|
+
if (this.localizationSubscription) {
|
|
907
|
+
this.localizationSubscription.unsubscribe();
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
getLogicOperators() {
|
|
911
|
+
return localizeOperators(logicOperators)(this.localization);
|
|
912
|
+
}
|
|
913
|
+
messageFor(key) {
|
|
914
|
+
return this.localization.get(key);
|
|
915
|
+
}
|
|
916
|
+
selectedChange(logicOperator) {
|
|
917
|
+
if (this.currentItem.logic !== logicOperator) {
|
|
918
|
+
this.currentItem.logic = logicOperator;
|
|
919
|
+
this.valueChange.emit();
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
addFilterExpression() {
|
|
923
|
+
this.filterService.addFilterExpression(this.currentItem);
|
|
924
|
+
this.valueChange.emit();
|
|
925
|
+
}
|
|
926
|
+
addFilterGroup() {
|
|
927
|
+
this.filterService.addFilterGroup(this.currentItem);
|
|
928
|
+
this.valueChange.emit();
|
|
929
|
+
}
|
|
930
|
+
removeFilterGroup() {
|
|
931
|
+
this.filterService.remove(this.currentItem, this.index);
|
|
932
|
+
this.valueChange.emit();
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
__decorate([
|
|
936
|
+
Input(),
|
|
937
|
+
__metadata("design:type", Number)
|
|
938
|
+
], FilterGroupComponent.prototype, "index", void 0);
|
|
939
|
+
__decorate([
|
|
940
|
+
Input(),
|
|
941
|
+
__metadata("design:type", Object)
|
|
942
|
+
], FilterGroupComponent.prototype, "currentItem", void 0);
|
|
943
|
+
__decorate([
|
|
944
|
+
Output(),
|
|
945
|
+
__metadata("design:type", EventEmitter)
|
|
946
|
+
], FilterGroupComponent.prototype, "valueChange", void 0);
|
|
947
|
+
FilterGroupComponent = __decorate([
|
|
948
|
+
Component({
|
|
949
|
+
selector: 'kendo-filter-group',
|
|
950
|
+
template: `
|
|
951
|
+
<div class="k-filter-toolbar" role="toolbar" [attr.aria-label]="messageFor('filterToolbarAriaLabel')">
|
|
952
|
+
<div class="k-toolbar">
|
|
953
|
+
<div class="k-filter-toolbar-item">
|
|
954
|
+
<div class="k-widget k-button-group" role="group">
|
|
955
|
+
<button
|
|
956
|
+
*ngFor="let operator of operators"
|
|
957
|
+
kendoButton
|
|
958
|
+
[ngClass]="{'k-group-start': operator.value === 'and', 'k-group-end': operator.value === 'or'}"
|
|
959
|
+
[selected]="currentItem.logic === operator.value"
|
|
960
|
+
[title]="operator.text"
|
|
961
|
+
(click)="selectedChange(operator.value)"
|
|
962
|
+
>
|
|
963
|
+
{{operator.text}}
|
|
964
|
+
</button>
|
|
965
|
+
</div>
|
|
966
|
+
</div>
|
|
967
|
+
<div class="k-filter-toolbar-item">
|
|
968
|
+
<button
|
|
969
|
+
kendoButton
|
|
970
|
+
[title]="messageFor('addFilter')"
|
|
971
|
+
icon="filter-add-expression"
|
|
972
|
+
(click)="addFilterExpression()">
|
|
973
|
+
{{messageFor('addFilter')}}
|
|
974
|
+
</button>
|
|
975
|
+
</div>
|
|
976
|
+
<div class="k-filter-toolbar-item">
|
|
977
|
+
<button
|
|
978
|
+
kendoButton
|
|
979
|
+
[title]="messageFor('addGroup')"
|
|
980
|
+
icon="filter-add-group"
|
|
981
|
+
(click)="addFilterGroup()">
|
|
982
|
+
{{messageFor('addGroup')}}
|
|
983
|
+
</button>
|
|
984
|
+
</div>
|
|
985
|
+
<div class="k-filter-toolbar-item">
|
|
986
|
+
<button
|
|
987
|
+
kendoButton
|
|
988
|
+
icon="close"
|
|
989
|
+
fillMode="flat"
|
|
990
|
+
[title]="messageFor('remove')"
|
|
991
|
+
(click)="removeFilterGroup()">
|
|
992
|
+
</button>
|
|
993
|
+
</div>
|
|
994
|
+
</div>
|
|
995
|
+
</div>
|
|
996
|
+
|
|
997
|
+
<ul class="k-filter-lines" *ngIf="currentItem.filters">
|
|
998
|
+
<ng-container *ngFor="let item of currentItem.filters; let i = index;">
|
|
999
|
+
<li class="k-filter-item" *ngIf="!item.filters">
|
|
1000
|
+
<kendo-filter-expression (valueChange)="valueChange.emit()" [currentItem]="item" [index]="i">
|
|
1001
|
+
</kendo-filter-expression>
|
|
1002
|
+
</li>
|
|
1003
|
+
<li class="k-filter-item" *ngIf="item.filters" >
|
|
1004
|
+
<kendo-filter-group
|
|
1005
|
+
(valueChange)="valueChange.emit()"
|
|
1006
|
+
[currentItem]="item"
|
|
1007
|
+
[index]="i"
|
|
1008
|
+
>
|
|
1009
|
+
</kendo-filter-group>
|
|
1010
|
+
</li>
|
|
1011
|
+
</ng-container>
|
|
1012
|
+
</ul>
|
|
1013
|
+
`
|
|
1014
|
+
}),
|
|
1015
|
+
__metadata("design:paramtypes", [FilterService, LocalizationService, ChangeDetectorRef])
|
|
1016
|
+
], FilterGroupComponent);
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* @hidden
|
|
1020
|
+
*/
|
|
1021
|
+
class Messages extends ComponentMessages {
|
|
1022
|
+
}
|
|
1023
|
+
__decorate([
|
|
1024
|
+
Input(),
|
|
1025
|
+
__metadata("design:type", String)
|
|
1026
|
+
], Messages.prototype, "filterExpressionOperators", void 0);
|
|
1027
|
+
__decorate([
|
|
1028
|
+
Input(),
|
|
1029
|
+
__metadata("design:type", String)
|
|
1030
|
+
], Messages.prototype, "filterExpressionFilters", void 0);
|
|
1031
|
+
__decorate([
|
|
1032
|
+
Input(),
|
|
1033
|
+
__metadata("design:type", String)
|
|
1034
|
+
], Messages.prototype, "remove", void 0);
|
|
1035
|
+
__decorate([
|
|
1036
|
+
Input(),
|
|
1037
|
+
__metadata("design:type", String)
|
|
1038
|
+
], Messages.prototype, "addGroup", void 0);
|
|
1039
|
+
__decorate([
|
|
1040
|
+
Input(),
|
|
1041
|
+
__metadata("design:type", String)
|
|
1042
|
+
], Messages.prototype, "addFilter", void 0);
|
|
1043
|
+
__decorate([
|
|
1044
|
+
Input(),
|
|
1045
|
+
__metadata("design:type", String)
|
|
1046
|
+
], Messages.prototype, "filterAndLogic", void 0);
|
|
1047
|
+
__decorate([
|
|
1048
|
+
Input(),
|
|
1049
|
+
__metadata("design:type", String)
|
|
1050
|
+
], Messages.prototype, "filterOrLogic", void 0);
|
|
1051
|
+
__decorate([
|
|
1052
|
+
Input(),
|
|
1053
|
+
__metadata("design:type", String)
|
|
1054
|
+
], Messages.prototype, "filterEqOperator", void 0);
|
|
1055
|
+
__decorate([
|
|
1056
|
+
Input(),
|
|
1057
|
+
__metadata("design:type", String)
|
|
1058
|
+
], Messages.prototype, "filterNotEqOperator", void 0);
|
|
1059
|
+
__decorate([
|
|
1060
|
+
Input(),
|
|
1061
|
+
__metadata("design:type", String)
|
|
1062
|
+
], Messages.prototype, "filterIsNullOperator", void 0);
|
|
1063
|
+
__decorate([
|
|
1064
|
+
Input(),
|
|
1065
|
+
__metadata("design:type", String)
|
|
1066
|
+
], Messages.prototype, "filterIsNotNullOperator", void 0);
|
|
1067
|
+
__decorate([
|
|
1068
|
+
Input(),
|
|
1069
|
+
__metadata("design:type", String)
|
|
1070
|
+
], Messages.prototype, "filterIsEmptyOperator", void 0);
|
|
1071
|
+
__decorate([
|
|
1072
|
+
Input(),
|
|
1073
|
+
__metadata("design:type", String)
|
|
1074
|
+
], Messages.prototype, "filterIsNotEmptyOperator", void 0);
|
|
1075
|
+
__decorate([
|
|
1076
|
+
Input(),
|
|
1077
|
+
__metadata("design:type", String)
|
|
1078
|
+
], Messages.prototype, "filterStartsWithOperator", void 0);
|
|
1079
|
+
__decorate([
|
|
1080
|
+
Input(),
|
|
1081
|
+
__metadata("design:type", String)
|
|
1082
|
+
], Messages.prototype, "filterContainsOperator", void 0);
|
|
1083
|
+
__decorate([
|
|
1084
|
+
Input(),
|
|
1085
|
+
__metadata("design:type", String)
|
|
1086
|
+
], Messages.prototype, "filterNotContainsOperator", void 0);
|
|
1087
|
+
__decorate([
|
|
1088
|
+
Input(),
|
|
1089
|
+
__metadata("design:type", String)
|
|
1090
|
+
], Messages.prototype, "filterEndsWithOperator", void 0);
|
|
1091
|
+
__decorate([
|
|
1092
|
+
Input(),
|
|
1093
|
+
__metadata("design:type", String)
|
|
1094
|
+
], Messages.prototype, "filterGteOperator", void 0);
|
|
1095
|
+
__decorate([
|
|
1096
|
+
Input(),
|
|
1097
|
+
__metadata("design:type", String)
|
|
1098
|
+
], Messages.prototype, "filterGtOperator", void 0);
|
|
1099
|
+
__decorate([
|
|
1100
|
+
Input(),
|
|
1101
|
+
__metadata("design:type", String)
|
|
1102
|
+
], Messages.prototype, "filterLteOperator", void 0);
|
|
1103
|
+
__decorate([
|
|
1104
|
+
Input(),
|
|
1105
|
+
__metadata("design:type", String)
|
|
1106
|
+
], Messages.prototype, "filterLtOperator", void 0);
|
|
1107
|
+
__decorate([
|
|
1108
|
+
Input(),
|
|
1109
|
+
__metadata("design:type", String)
|
|
1110
|
+
], Messages.prototype, "filterIsTrue", void 0);
|
|
1111
|
+
__decorate([
|
|
1112
|
+
Input(),
|
|
1113
|
+
__metadata("design:type", String)
|
|
1114
|
+
], Messages.prototype, "filterIsFalse", void 0);
|
|
1115
|
+
__decorate([
|
|
1116
|
+
Input(),
|
|
1117
|
+
__metadata("design:type", String)
|
|
1118
|
+
], Messages.prototype, "filterBooleanAll", void 0);
|
|
1119
|
+
__decorate([
|
|
1120
|
+
Input(),
|
|
1121
|
+
__metadata("design:type", String)
|
|
1122
|
+
], Messages.prototype, "filterAfterOrEqualOperator", void 0);
|
|
1123
|
+
__decorate([
|
|
1124
|
+
Input(),
|
|
1125
|
+
__metadata("design:type", String)
|
|
1126
|
+
], Messages.prototype, "filterAfterOperator", void 0);
|
|
1127
|
+
__decorate([
|
|
1128
|
+
Input(),
|
|
1129
|
+
__metadata("design:type", String)
|
|
1130
|
+
], Messages.prototype, "filterBeforeOperator", void 0);
|
|
1131
|
+
__decorate([
|
|
1132
|
+
Input(),
|
|
1133
|
+
__metadata("design:type", String)
|
|
1134
|
+
], Messages.prototype, "filterBeforeOrEqualOperator", void 0);
|
|
1135
|
+
__decorate([
|
|
1136
|
+
Input(),
|
|
1137
|
+
__metadata("design:type", String)
|
|
1138
|
+
], Messages.prototype, "editorNumericDecrement", void 0);
|
|
1139
|
+
__decorate([
|
|
1140
|
+
Input(),
|
|
1141
|
+
__metadata("design:type", String)
|
|
1142
|
+
], Messages.prototype, "editorNumericIncrement", void 0);
|
|
1143
|
+
__decorate([
|
|
1144
|
+
Input(),
|
|
1145
|
+
__metadata("design:type", String)
|
|
1146
|
+
], Messages.prototype, "editorDateTodayText", void 0);
|
|
1147
|
+
__decorate([
|
|
1148
|
+
Input(),
|
|
1149
|
+
__metadata("design:type", String)
|
|
1150
|
+
], Messages.prototype, "editorDateToggleText", void 0);
|
|
1151
|
+
__decorate([
|
|
1152
|
+
Input(),
|
|
1153
|
+
__metadata("design:type", String)
|
|
1154
|
+
], Messages.prototype, "filterFieldAriaLabel", void 0);
|
|
1155
|
+
__decorate([
|
|
1156
|
+
Input(),
|
|
1157
|
+
__metadata("design:type", String)
|
|
1158
|
+
], Messages.prototype, "filterOperatorAriaLabel", void 0);
|
|
1159
|
+
__decorate([
|
|
1160
|
+
Input(),
|
|
1161
|
+
__metadata("design:type", String)
|
|
1162
|
+
], Messages.prototype, "filterValueAriaLabel", void 0);
|
|
1163
|
+
__decorate([
|
|
1164
|
+
Input(),
|
|
1165
|
+
__metadata("design:type", String)
|
|
1166
|
+
], Messages.prototype, "filterAriaLabel", void 0);
|
|
1167
|
+
__decorate([
|
|
1168
|
+
Input(),
|
|
1169
|
+
__metadata("design:type", String)
|
|
1170
|
+
], Messages.prototype, "filterToolbarAriaLabel", void 0);
|
|
1171
|
+
|
|
1172
|
+
var CustomMessagesComponent_1;
|
|
1173
|
+
/**
|
|
1174
|
+
* Custom component messages override default component messages
|
|
1175
|
+
* ([see example]({% slug globalization_filter %}#toc-localization)).
|
|
1176
|
+
*/
|
|
1177
|
+
let CustomMessagesComponent = CustomMessagesComponent_1 = class CustomMessagesComponent extends Messages {
|
|
1178
|
+
constructor(service) {
|
|
1179
|
+
super();
|
|
1180
|
+
this.service = service;
|
|
1181
|
+
}
|
|
1182
|
+
get override() {
|
|
1183
|
+
return true;
|
|
1184
|
+
}
|
|
1185
|
+
};
|
|
1186
|
+
CustomMessagesComponent = CustomMessagesComponent_1 = __decorate([
|
|
1187
|
+
Component({
|
|
1188
|
+
providers: [
|
|
1189
|
+
{
|
|
1190
|
+
provide: Messages,
|
|
1191
|
+
useExisting: forwardRef(() => CustomMessagesComponent_1)
|
|
1192
|
+
}
|
|
1193
|
+
],
|
|
1194
|
+
selector: 'kendo-filter-messages',
|
|
1195
|
+
template: ``
|
|
1196
|
+
}),
|
|
1197
|
+
__metadata("design:paramtypes", [LocalizationService])
|
|
1198
|
+
], CustomMessagesComponent);
|
|
1199
|
+
|
|
1200
|
+
var LocalizedMessagesDirective_1;
|
|
1201
|
+
/**
|
|
1202
|
+
* @hidden
|
|
1203
|
+
*/
|
|
1204
|
+
let LocalizedMessagesDirective = LocalizedMessagesDirective_1 = class LocalizedMessagesDirective extends Messages {
|
|
1205
|
+
constructor(service) {
|
|
1206
|
+
super();
|
|
1207
|
+
this.service = service;
|
|
1208
|
+
}
|
|
1209
|
+
};
|
|
1210
|
+
LocalizedMessagesDirective = LocalizedMessagesDirective_1 = __decorate([
|
|
1211
|
+
Directive({
|
|
1212
|
+
providers: [
|
|
1213
|
+
{
|
|
1214
|
+
provide: Messages,
|
|
1215
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective_1)
|
|
1216
|
+
}
|
|
1217
|
+
],
|
|
1218
|
+
selector: '[kendoFilterLocalizedMessages]'
|
|
1219
|
+
}),
|
|
1220
|
+
__metadata("design:paramtypes", [LocalizationService])
|
|
1221
|
+
], LocalizedMessagesDirective);
|
|
1222
|
+
|
|
1223
|
+
const importedModules = [
|
|
1224
|
+
CommonModule,
|
|
1225
|
+
InputsModule,
|
|
1226
|
+
LabelModule,
|
|
1227
|
+
DropDownsModule,
|
|
1228
|
+
ButtonsModule,
|
|
1229
|
+
DateInputsModule
|
|
1230
|
+
];
|
|
1231
|
+
/**
|
|
1232
|
+
* @hidden
|
|
1233
|
+
*/
|
|
1234
|
+
let SharedModule = class SharedModule {
|
|
1235
|
+
};
|
|
1236
|
+
SharedModule = __decorate([
|
|
1237
|
+
NgModule({
|
|
1238
|
+
imports: [...importedModules],
|
|
1239
|
+
exports: [...importedModules]
|
|
1240
|
+
})
|
|
1241
|
+
], SharedModule);
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
|
|
1245
|
+
* definition for the Filter component.
|
|
1246
|
+
*
|
|
1247
|
+
* @example
|
|
1248
|
+
*
|
|
1249
|
+
* ```
|
|
1250
|
+
* // Import the Filter module
|
|
1251
|
+
* import { FilterModule } from '@progress/kendo-angular-filter';
|
|
1252
|
+
*
|
|
1253
|
+
* // The browser platform with a compiler
|
|
1254
|
+
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
1255
|
+
*
|
|
1256
|
+
* import { NgModule } from '@angular/core';
|
|
1257
|
+
*
|
|
1258
|
+
* // Import the app component
|
|
1259
|
+
* import { AppComponent } from './app.component';
|
|
1260
|
+
*
|
|
1261
|
+
* // Define the app module
|
|
1262
|
+
* _@NgModule({
|
|
1263
|
+
* declarations: [AppComponent], // declare app component
|
|
1264
|
+
* imports: [BrowserModule, FilterModule], // import Filter module
|
|
1265
|
+
* bootstrap: [AppComponent]
|
|
1266
|
+
* })
|
|
1267
|
+
* export class AppModule { }
|
|
1268
|
+
*
|
|
1269
|
+
* // Compile and launch the module
|
|
1270
|
+
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
1271
|
+
*
|
|
1272
|
+
* ```
|
|
1273
|
+
*/
|
|
1274
|
+
let FilterModule = class FilterModule {
|
|
1275
|
+
};
|
|
1276
|
+
FilterModule = __decorate([
|
|
1277
|
+
NgModule({
|
|
1278
|
+
imports: [SharedModule],
|
|
1279
|
+
declarations: [FilterComponent,
|
|
1280
|
+
FilterNumericEditorComponent,
|
|
1281
|
+
FilterTextEditorComponent,
|
|
1282
|
+
FilterExpressionComponent,
|
|
1283
|
+
FilterGroupComponent,
|
|
1284
|
+
FilterExpressionOperatorsComponent,
|
|
1285
|
+
FilterBooleanEditorComponent,
|
|
1286
|
+
FilterDateEditorComponent,
|
|
1287
|
+
LocalizedMessagesDirective,
|
|
1288
|
+
CustomMessagesComponent,
|
|
1289
|
+
AriaLabelValueDirective
|
|
1290
|
+
],
|
|
1291
|
+
exports: [FilterComponent,
|
|
1292
|
+
FilterNumericEditorComponent,
|
|
1293
|
+
FilterTextEditorComponent,
|
|
1294
|
+
FilterExpressionComponent,
|
|
1295
|
+
FilterGroupComponent,
|
|
1296
|
+
FilterExpressionOperatorsComponent,
|
|
1297
|
+
FilterBooleanEditorComponent,
|
|
1298
|
+
FilterDateEditorComponent,
|
|
1299
|
+
LocalizedMessagesDirective,
|
|
1300
|
+
CustomMessagesComponent,
|
|
1301
|
+
AriaLabelValueDirective],
|
|
1302
|
+
providers: [
|
|
1303
|
+
LocalizationService,
|
|
1304
|
+
{
|
|
1305
|
+
provide: L10N_PREFIX,
|
|
1306
|
+
useValue: 'kendo.filter'
|
|
1307
|
+
}
|
|
1308
|
+
]
|
|
1309
|
+
})
|
|
1310
|
+
], FilterModule);
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* Generated bundle index. Do not edit.
|
|
1314
|
+
*/
|
|
1315
|
+
|
|
1316
|
+
export { AriaLabelValueDirective, FilterBooleanEditorComponent, FilterDateEditorComponent, FilterNumericEditorComponent, FilterTextEditorComponent, FilterExpressionOperatorsComponent, FilterExpressionComponent, FilterGroupComponent, FilterService, CustomMessagesComponent, LocalizedMessagesDirective, Messages, SharedModule, FilterComponent, FilterModule };
|