@progress/kendo-angular-filter 0.1.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/LICENSE.md +11 -0
- package/NOTICE.txt +654 -0
- package/README.md +31 -0
- package/dist/cdn/js/kendo-angular-filter.js +150 -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 +41 -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 +121 -0
- package/dist/es/filter-group.component.js +69 -0
- package/dist/es/filter.component.js +185 -0
- package/dist/es/filter.module.js +91 -0
- package/dist/es/filter.service.js +84 -0
- package/dist/es/index.js +21 -0
- 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/dist/es/model/filter-expression.js +7 -0
- package/dist/es/package-metadata.js +15 -0
- package/dist/es/shared.module.js +37 -0
- package/dist/es/util.js +129 -0
- package/dist/es2015/aria-label.directive.d.ts +15 -0
- package/dist/es2015/aria-label.directive.js +29 -0
- package/dist/es2015/editors/boolean-editor.component.d.ts +25 -0
- package/dist/es2015/editors/boolean-editor.component.js +53 -0
- package/dist/es2015/editors/date-editor.component.d.ts +20 -0
- package/dist/es2015/editors/date-editor.component.js +56 -0
- package/dist/es2015/editors/numeric-editor.component.d.ts +20 -0
- package/dist/es2015/editors/numeric-editor.component.js +56 -0
- package/dist/es2015/editors/text-editor.component.d.ts +20 -0
- package/dist/es2015/editors/text-editor.component.js +52 -0
- package/dist/es2015/filter-expression-operators.component.d.ts +24 -0
- package/dist/es2015/filter-expression-operators.component.js +59 -0
- package/dist/es2015/filter-expression.component.d.ts +40 -0
- package/dist/es2015/filter-expression.component.js +160 -0
- package/dist/es2015/filter-group.component.d.ts +29 -0
- package/dist/es2015/filter-group.component.js +131 -0
- package/dist/es2015/filter.component.d.ts +80 -0
- package/dist/es2015/filter.component.js +298 -0
- package/dist/es2015/filter.module.d.ts +37 -0
- package/dist/es2015/filter.module.js +88 -0
- package/dist/es2015/filter.service.d.ts +43 -0
- package/dist/es2015/filter.service.js +66 -0
- package/dist/es2015/index.d.ts +21 -0
- package/dist/es2015/index.js +21 -0
- package/dist/es2015/index.metadata.json +1 -0
- package/dist/es2015/localization/custom-messages.component.d.ts +15 -0
- package/dist/es2015/localization/custom-messages.component.js +36 -0
- package/dist/es2015/localization/localized-messages.directive.d.ts +13 -0
- package/dist/es2015/localization/localized-messages.directive.js +31 -0
- package/dist/es2015/localization/messages.d.ts +158 -0
- package/dist/es2015/localization/messages.js +160 -0
- package/dist/es2015/main.d.ts +7 -0
- package/dist/es2015/main.js +6 -0
- package/dist/es2015/model/filter-expression.d.ts +60 -0
- package/dist/es2015/model/filter-expression.js +7 -0
- package/dist/es2015/package-metadata.d.ts +9 -0
- package/dist/es2015/package-metadata.js +15 -0
- package/dist/es2015/shared.module.d.ts +9 -0
- package/dist/es2015/shared.module.js +34 -0
- package/dist/es2015/util.d.ts +140 -0
- package/dist/es2015/util.js +129 -0
- package/dist/fesm2015/index.js +1282 -0
- package/dist/fesm5/index.js +1058 -0
- package/dist/npm/aria-label.directive.js +32 -0
- package/dist/npm/editors/boolean-editor.component.js +43 -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 +123 -0
- package/dist/npm/filter-group.component.js +71 -0
- package/dist/npm/filter.component.js +187 -0
- package/dist/npm/filter.module.js +93 -0
- package/dist/npm/filter.service.js +86 -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 +39 -0
- package/dist/npm/util.js +131 -0
- package/dist/systemjs/kendo-angular-filter.js +5 -0
- package/package.json +158 -0
- package/schematics/collection.json +12 -0
- package/schematics/ngAdd/index.js +12 -0
- package/schematics/ngAdd/index.js.map +1 -0
- package/schematics/ngAdd/schema.json +28 -0
|
@@ -0,0 +1,160 @@
|
|
|
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 * as tslib_1 from "tslib";
|
|
6
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
7
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { FilterService } from './filter.service';
|
|
9
|
+
import { defaultOperators, getKeyByValue, isFilterEditor } from './util';
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
let FilterExpressionComponent = class FilterExpressionComponent {
|
|
14
|
+
constructor(filterService, localization) {
|
|
15
|
+
this.filterService = filterService;
|
|
16
|
+
this.localization = localization;
|
|
17
|
+
this.valueChange = new EventEmitter();
|
|
18
|
+
this.operators = [];
|
|
19
|
+
this.filters = [];
|
|
20
|
+
this.isBoolean = false;
|
|
21
|
+
this.isEditorDisabled = false;
|
|
22
|
+
}
|
|
23
|
+
ngOnInit() {
|
|
24
|
+
this.filters = this.filterService.filters;
|
|
25
|
+
if (this.currentItem.field) {
|
|
26
|
+
const foundFilter = this.getFilterExpressionByField(this.currentItem.field);
|
|
27
|
+
this.setOperators(foundFilter);
|
|
28
|
+
}
|
|
29
|
+
if (!this.currentItem.field) {
|
|
30
|
+
this.currentItem.field = this.filterService.filters[0].field;
|
|
31
|
+
const defaultFilter = this.getFilterExpressionByField(this.filterService.filters[0].field);
|
|
32
|
+
this.setOperators(defaultFilter);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
normalizeOperators(filterEditor, operators) {
|
|
36
|
+
let result = [];
|
|
37
|
+
for (let j = 0; j < operators.length; j++) {
|
|
38
|
+
if (isFilterEditor(filterEditor)) {
|
|
39
|
+
result.push({
|
|
40
|
+
value: operators[j],
|
|
41
|
+
text: this.localization.get(getKeyByValue(defaultOperators[filterEditor], operators[j]))
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
messageFor(key) {
|
|
48
|
+
return this.localization.get(key);
|
|
49
|
+
}
|
|
50
|
+
getFilterExpressionByField(name) {
|
|
51
|
+
const foundFilter = this.filterService.filters.find(filter => filter.field === name);
|
|
52
|
+
if (foundFilter) {
|
|
53
|
+
return foundFilter;
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
filterValueChange(value) {
|
|
58
|
+
this.currentItem.value = null;
|
|
59
|
+
this.currentItem.field = value;
|
|
60
|
+
const foundFilter = this.getFilterExpressionByField(this.currentItem.field);
|
|
61
|
+
this.setOperators(foundFilter);
|
|
62
|
+
this.valueChange.emit();
|
|
63
|
+
}
|
|
64
|
+
getDefaultOperators(operatorsType) {
|
|
65
|
+
switch (operatorsType) {
|
|
66
|
+
case 'string':
|
|
67
|
+
return this.filterService.defaultStringOperators;
|
|
68
|
+
case 'number':
|
|
69
|
+
return this.filterService.defaultNumericOperators;
|
|
70
|
+
case 'date':
|
|
71
|
+
return this.filterService.defaultDateOperators;
|
|
72
|
+
default:
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
getEditorType() {
|
|
77
|
+
let item = this.filterService.filters.find((filterExpression) => filterExpression.field === this.currentItem.field);
|
|
78
|
+
return item.editor;
|
|
79
|
+
}
|
|
80
|
+
removeFilterExpression() {
|
|
81
|
+
this.filterService.remove(this.currentItem, this.index);
|
|
82
|
+
this.valueChange.emit();
|
|
83
|
+
}
|
|
84
|
+
setOperators(filter) {
|
|
85
|
+
this.isBoolean = filter.editor === 'boolean';
|
|
86
|
+
if (this.isBoolean) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (filter.operators) {
|
|
90
|
+
const localizedOperators = this.normalizeOperators(filter.editor, filter.operators);
|
|
91
|
+
this.operators = localizedOperators;
|
|
92
|
+
this.currentItem.operator = localizedOperators[0].value;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this.operators = this.getDefaultOperators(filter.editor);
|
|
96
|
+
this.currentItem.operator = this.operators[0].value;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
tslib_1.__decorate([
|
|
101
|
+
Input(),
|
|
102
|
+
tslib_1.__metadata("design:type", Number)
|
|
103
|
+
], FilterExpressionComponent.prototype, "index", void 0);
|
|
104
|
+
tslib_1.__decorate([
|
|
105
|
+
Input(),
|
|
106
|
+
tslib_1.__metadata("design:type", Object)
|
|
107
|
+
], FilterExpressionComponent.prototype, "currentItem", void 0);
|
|
108
|
+
tslib_1.__decorate([
|
|
109
|
+
Output(),
|
|
110
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
111
|
+
], FilterExpressionComponent.prototype, "valueChange", void 0);
|
|
112
|
+
FilterExpressionComponent = tslib_1.__decorate([
|
|
113
|
+
Component({
|
|
114
|
+
selector: 'kendo-filter-expression',
|
|
115
|
+
template: `
|
|
116
|
+
<div class="k-filter-toolbar" role="group" [attr.aria-label]="messageFor('filterAriaLabel')">
|
|
117
|
+
<div class="k-toolbar">
|
|
118
|
+
<div class="k-filter-toolbar-item k-filter-field">
|
|
119
|
+
<kendo-dropdownlist
|
|
120
|
+
[kendoAriaLabelValue]="messageFor('filterFieldAriaLabel')"
|
|
121
|
+
[title]="messageFor('filterExpressionFilters')"
|
|
122
|
+
[data]="filters"
|
|
123
|
+
textField="title"
|
|
124
|
+
valueField="field"
|
|
125
|
+
[value]="currentItem.field"
|
|
126
|
+
[valuePrimitive]="true"
|
|
127
|
+
(valueChange)="filterValueChange($event)">
|
|
128
|
+
</kendo-dropdownlist>
|
|
129
|
+
</div>
|
|
130
|
+
<div *ngIf="!isBoolean" class="k-filter-toolbar-item k-filter-operator">
|
|
131
|
+
<kendo-filter-expression-operators
|
|
132
|
+
[currentItem]="currentItem"
|
|
133
|
+
[operators]="operators"
|
|
134
|
+
(valueChange)="valueChange.emit();">
|
|
135
|
+
</kendo-filter-expression-operators>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<ng-container [ngSwitch]="getEditorType()">
|
|
139
|
+
<kendo-filter-text-editor *ngSwitchCase="'string'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-text-editor>
|
|
140
|
+
<kendo-filter-numeric-editor *ngSwitchCase="'number'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-numeric-editor>
|
|
141
|
+
<kendo-filter-boolean-editor *ngSwitchCase="'boolean'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-boolean-editor>
|
|
142
|
+
<kendo-filter-date-editor *ngSwitchCase="'date'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-date-editor>
|
|
143
|
+
</ng-container>
|
|
144
|
+
|
|
145
|
+
<div class="k-filter-toolbar-item">
|
|
146
|
+
<button
|
|
147
|
+
kendoButton
|
|
148
|
+
icon="close"
|
|
149
|
+
look="flat"
|
|
150
|
+
[title]="messageFor('remove')"
|
|
151
|
+
(click)="removeFilterExpression()">
|
|
152
|
+
</button>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
`
|
|
157
|
+
}),
|
|
158
|
+
tslib_1.__metadata("design:paramtypes", [FilterService, LocalizationService])
|
|
159
|
+
], FilterExpressionComponent);
|
|
160
|
+
export { FilterExpressionComponent };
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { EventEmitter, OnInit } from '@angular/core';
|
|
6
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
+
import { CompositeFilterDescriptor } from '@progress/kendo-data-query';
|
|
8
|
+
import { FilterService } from './filter.service';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare class FilterGroupComponent implements OnInit {
|
|
13
|
+
private filterService;
|
|
14
|
+
localization: LocalizationService;
|
|
15
|
+
index: number;
|
|
16
|
+
currentItem: CompositeFilterDescriptor;
|
|
17
|
+
valueChange: EventEmitter<void>;
|
|
18
|
+
logicOperators: {
|
|
19
|
+
text: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}[];
|
|
22
|
+
constructor(filterService: FilterService, localization: LocalizationService);
|
|
23
|
+
ngOnInit(): void;
|
|
24
|
+
messageFor(key: string): string;
|
|
25
|
+
selectedChange(logicOperator: 'or' | 'and'): void;
|
|
26
|
+
addFilterExpression(): void;
|
|
27
|
+
addFilterGroup(): void;
|
|
28
|
+
removeFilterGroup(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
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 * as tslib_1 from "tslib";
|
|
6
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
7
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { FilterService } from './filter.service';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
let FilterGroupComponent = class FilterGroupComponent {
|
|
13
|
+
constructor(filterService, localization) {
|
|
14
|
+
this.filterService = filterService;
|
|
15
|
+
this.localization = localization;
|
|
16
|
+
this.index = 0;
|
|
17
|
+
this.currentItem = {
|
|
18
|
+
logic: 'or',
|
|
19
|
+
filters: []
|
|
20
|
+
};
|
|
21
|
+
this.valueChange = new EventEmitter();
|
|
22
|
+
this.logicOperators = [];
|
|
23
|
+
}
|
|
24
|
+
ngOnInit() {
|
|
25
|
+
this.logicOperators = this.filterService.logicOperators;
|
|
26
|
+
}
|
|
27
|
+
messageFor(key) {
|
|
28
|
+
return this.localization.get(key);
|
|
29
|
+
}
|
|
30
|
+
selectedChange(logicOperator) {
|
|
31
|
+
if (this.currentItem.logic !== logicOperator) {
|
|
32
|
+
this.currentItem.logic = logicOperator;
|
|
33
|
+
this.valueChange.emit();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
addFilterExpression() {
|
|
37
|
+
this.filterService.addFilterExpression(this.currentItem);
|
|
38
|
+
this.valueChange.emit();
|
|
39
|
+
}
|
|
40
|
+
addFilterGroup() {
|
|
41
|
+
this.filterService.addFilterGroup(this.currentItem);
|
|
42
|
+
this.valueChange.emit();
|
|
43
|
+
}
|
|
44
|
+
removeFilterGroup() {
|
|
45
|
+
this.filterService.remove(this.currentItem, this.index);
|
|
46
|
+
this.valueChange.emit();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
Input(),
|
|
51
|
+
tslib_1.__metadata("design:type", Number)
|
|
52
|
+
], FilterGroupComponent.prototype, "index", void 0);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
Input(),
|
|
55
|
+
tslib_1.__metadata("design:type", Object)
|
|
56
|
+
], FilterGroupComponent.prototype, "currentItem", void 0);
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
Output(),
|
|
59
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
60
|
+
], FilterGroupComponent.prototype, "valueChange", void 0);
|
|
61
|
+
FilterGroupComponent = tslib_1.__decorate([
|
|
62
|
+
Component({
|
|
63
|
+
selector: 'kendo-filter-group',
|
|
64
|
+
template: `
|
|
65
|
+
<div class="k-filter-toolbar" role="toolbar" [attr.aria-label]="messageFor('filterToolbarAriaLabel')">
|
|
66
|
+
<div class="k-toolbar">
|
|
67
|
+
<div class="k-filter-toolbar-item">
|
|
68
|
+
<div class="k-widget k-button-group" role="group">
|
|
69
|
+
<button
|
|
70
|
+
*ngFor="let operator of logicOperators"
|
|
71
|
+
kendoButton
|
|
72
|
+
[ngClass]="{'k-group-start': operator.value === 'and', 'k-group-end': operator.value === 'or'}"
|
|
73
|
+
[selected]="currentItem.logic === operator.value"
|
|
74
|
+
[title]="operator.text"
|
|
75
|
+
(click)="selectedChange(operator.value)"
|
|
76
|
+
>
|
|
77
|
+
{{operator.text}}
|
|
78
|
+
</button>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="k-filter-toolbar-item">
|
|
82
|
+
<button
|
|
83
|
+
kendoButton
|
|
84
|
+
[title]="messageFor('addExpression')"
|
|
85
|
+
icon="filter-add-expression"
|
|
86
|
+
(click)="addFilterExpression()">
|
|
87
|
+
{{messageFor('addExpression')}}
|
|
88
|
+
</button>
|
|
89
|
+
</div>
|
|
90
|
+
<div class="k-filter-toolbar-item">
|
|
91
|
+
<button
|
|
92
|
+
kendoButton
|
|
93
|
+
[title]="messageFor('addGroup')"
|
|
94
|
+
icon="filter-add-group"
|
|
95
|
+
(click)="addFilterGroup()">
|
|
96
|
+
{{messageFor('addGroup')}}
|
|
97
|
+
</button>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="k-filter-toolbar-item">
|
|
100
|
+
<button
|
|
101
|
+
kendoButton
|
|
102
|
+
icon="close"
|
|
103
|
+
look="flat"
|
|
104
|
+
[title]="messageFor('remove')"
|
|
105
|
+
(click)="removeFilterGroup()">
|
|
106
|
+
</button>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<ul class="k-filter-lines" *ngIf="currentItem.filters">
|
|
112
|
+
<ng-container *ngFor="let item of currentItem.filters; let i = index;">
|
|
113
|
+
<li class="k-filter-item" *ngIf="!item.filters">
|
|
114
|
+
<kendo-filter-expression (valueChange)="valueChange.emit()" [currentItem]="item" [index]="i">
|
|
115
|
+
</kendo-filter-expression>
|
|
116
|
+
</li>
|
|
117
|
+
<li class="k-filter-item" *ngIf="item.filters" >
|
|
118
|
+
<kendo-filter-group
|
|
119
|
+
(valueChange)="valueChange.emit()"
|
|
120
|
+
[currentItem]="item"
|
|
121
|
+
[index]="i"
|
|
122
|
+
>
|
|
123
|
+
</kendo-filter-group>
|
|
124
|
+
</li>
|
|
125
|
+
</ng-container>
|
|
126
|
+
</ul>
|
|
127
|
+
`
|
|
128
|
+
}),
|
|
129
|
+
tslib_1.__metadata("design:paramtypes", [FilterService, LocalizationService])
|
|
130
|
+
], FilterGroupComponent);
|
|
131
|
+
export { FilterGroupComponent };
|
|
@@ -0,0 +1,80 @@
|
|
|
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 { OnInit, EventEmitter } from '@angular/core';
|
|
6
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
+
import { FilterService } from './filter.service';
|
|
8
|
+
import { CompositeFilterDescriptor, FilterDescriptor } from '@progress/kendo-data-query';
|
|
9
|
+
import { FilterExpression } from './model/filter-expression';
|
|
10
|
+
import { Direction } from './util';
|
|
11
|
+
import { ChangeDetectorRef } from '@angular/core';
|
|
12
|
+
import { OnDestroy } from '@angular/core';
|
|
13
|
+
/**
|
|
14
|
+
* Represents the [Kendo UI Filter component for Angular]({% slug overview_filter %}).
|
|
15
|
+
* The Filter component can be used to apply any user defined filter criteria.
|
|
16
|
+
* @example
|
|
17
|
+
* ```
|
|
18
|
+
* @Component({
|
|
19
|
+
* selector: 'my-app',
|
|
20
|
+
* template: `
|
|
21
|
+
* <kendo-filter [filters]="filters" (valueChange)="onValueChange($event)"></kendo-filter>
|
|
22
|
+
* `
|
|
23
|
+
* })
|
|
24
|
+
* export class AppComponent {
|
|
25
|
+
*
|
|
26
|
+
* public filters: FilterExpression[] = [
|
|
27
|
+
* {
|
|
28
|
+
* name: 'country',
|
|
29
|
+
* label: 'Country',
|
|
30
|
+
* filter: 'string',
|
|
31
|
+
* operators: ['eq', 'neq'],
|
|
32
|
+
* },
|
|
33
|
+
* {
|
|
34
|
+
* name: 'budget',
|
|
35
|
+
* filter: 'number'
|
|
36
|
+
* }
|
|
37
|
+
* ];
|
|
38
|
+
*
|
|
39
|
+
* onValueChange(e: CompositeFilterDescriptor){
|
|
40
|
+
* console.log(e)
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare class FilterComponent implements OnInit, OnDestroy {
|
|
46
|
+
private filterService;
|
|
47
|
+
private localization;
|
|
48
|
+
private cdr;
|
|
49
|
+
direction: Direction;
|
|
50
|
+
/**
|
|
51
|
+
* Specifies the available user-defined filters. At least one filter should be provided.
|
|
52
|
+
*/
|
|
53
|
+
filters: FilterExpression[];
|
|
54
|
+
/**
|
|
55
|
+
* Sets the initial `value` of the Filter component.
|
|
56
|
+
*/
|
|
57
|
+
value: CompositeFilterDescriptor;
|
|
58
|
+
/**
|
|
59
|
+
* Fires every time the Filter component value is updated.
|
|
60
|
+
* That is each time a Filter Group or Filter Expression is added, removed, or updated.
|
|
61
|
+
*/
|
|
62
|
+
valueChange: EventEmitter<CompositeFilterDescriptor>;
|
|
63
|
+
constructor(filterService: FilterService, localization: LocalizationService, cdr: ChangeDetectorRef);
|
|
64
|
+
ngOnInit(): void;
|
|
65
|
+
ngOnDestroy(): void;
|
|
66
|
+
/**
|
|
67
|
+
* @hidden
|
|
68
|
+
*/
|
|
69
|
+
getCurrentFilter(): CompositeFilterDescriptor;
|
|
70
|
+
/**
|
|
71
|
+
* @hidden
|
|
72
|
+
*/
|
|
73
|
+
getCurrentFilterChildren(): (CompositeFilterDescriptor | FilterDescriptor)[];
|
|
74
|
+
/**
|
|
75
|
+
* @hidden
|
|
76
|
+
*/
|
|
77
|
+
onValueChange(): void;
|
|
78
|
+
private normalizeFilter;
|
|
79
|
+
private normalizeValue;
|
|
80
|
+
}
|