@progress/kendo-angular-filter 1.0.0 → 2.0.0-dev.202204131933
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/es2015/aria-label.directive.d.ts → aria-label.directive.d.ts} +3 -0
- package/bundles/kendo-angular-filter.umd.js +5 -0
- package/{dist/es2015/editors → editors}/boolean-editor.component.d.ts +3 -0
- package/{dist/es2015/editors → editors}/date-editor.component.d.ts +3 -0
- package/{dist/es2015/editors → editors}/numeric-editor.component.d.ts +3 -0
- package/{dist/es2015/editors → editors}/text-editor.component.d.ts +3 -0
- package/esm2015/aria-label.directive.js +28 -0
- package/esm2015/editors/boolean-editor.component.js +84 -0
- package/esm2015/editors/date-editor.component.js +67 -0
- package/esm2015/editors/numeric-editor.component.js +67 -0
- package/esm2015/editors/text-editor.component.js +59 -0
- package/esm2015/filter-expression-operators.component.js +68 -0
- package/{dist/es2015 → esm2015}/filter-expression.component.js +71 -26
- package/esm2015/filter-group.component.js +206 -0
- package/{dist/es2015 → esm2015}/filter.component.js +151 -34
- package/esm2015/filter.module.js +117 -0
- package/{dist/es2015 → esm2015}/filter.service.js +8 -10
- package/{dist/es2015/shared.module.d.ts → esm2015/kendo-angular-filter.js} +2 -3
- package/esm2015/localization/custom-messages.component.js +41 -0
- package/esm2015/localization/localized-messages.directive.js +36 -0
- package/esm2015/localization/messages.js +95 -0
- package/{dist/es/index.js → esm2015/main.js} +3 -8
- package/{dist/es → esm2015}/model/filter-expression.js +1 -0
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/esm2015/shared.module.js +50 -0
- package/{dist/es2015 → esm2015}/util.js +3 -3
- package/fesm2015/kendo-angular-filter.js +1622 -0
- package/{dist/es2015/filter-expression-operators.component.d.ts → filter-expression-operators.component.d.ts} +3 -0
- package/{dist/es2015/filter-expression.component.d.ts → filter-expression.component.d.ts} +5 -0
- package/{dist/es2015/filter-group.component.d.ts → filter-group.component.d.ts} +7 -2
- package/{dist/es2015/filter.component.d.ts → filter.component.d.ts} +7 -2
- package/filter.module.d.ts +53 -0
- package/{dist/es2015/filter.service.d.ts → filter.service.d.ts} +3 -0
- package/{dist/npm/model/filter-expression.js → kendo-angular-filter.d.ts} +3 -3
- package/{dist/es2015/localization → localization}/custom-messages.component.d.ts +4 -1
- package/{dist/es2015/localization → localization}/localized-messages.directive.d.ts +3 -0
- package/{dist/es2015/localization → localization}/messages.d.ts +3 -0
- package/{dist/es2015/index.d.ts → main.d.ts} +4 -8
- package/{dist/es2015/model → model}/filter-expression.d.ts +0 -0
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +39 -110
- package/schematics/ngAdd/index.js +5 -2
- package/schematics/ngAdd/index.js.map +1 -1
- package/shared.module.d.ts +19 -0
- package/util.d.ts +147 -0
- package/dist/cdn/js/kendo-angular-filter.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/aria-label.directive.js +0 -30
- package/dist/es/editors/boolean-editor.component.js +0 -61
- package/dist/es/editors/date-editor.component.js +0 -45
- package/dist/es/editors/numeric-editor.component.js +0 -45
- package/dist/es/editors/text-editor.component.js +0 -45
- package/dist/es/filter-expression-operators.component.js +0 -48
- package/dist/es/filter-expression.component.js +0 -136
- package/dist/es/filter-group.component.js +0 -84
- package/dist/es/filter.component.js +0 -185
- package/dist/es/filter.module.js +0 -91
- package/dist/es/filter.service.js +0 -45
- package/dist/es/localization/custom-messages.component.js +0 -44
- package/dist/es/localization/localized-messages.directive.js +0 -35
- package/dist/es/localization/messages.js +0 -166
- package/dist/es/main.js +0 -6
- package/dist/es/package-metadata.js +0 -15
- package/dist/es/shared.module.js +0 -35
- package/dist/es/util.js +0 -136
- package/dist/es2015/aria-label.directive.js +0 -29
- package/dist/es2015/editors/boolean-editor.component.js +0 -72
- package/dist/es2015/editors/date-editor.component.js +0 -56
- package/dist/es2015/editors/numeric-editor.component.js +0 -56
- package/dist/es2015/editors/text-editor.component.js +0 -52
- package/dist/es2015/filter-expression-operators.component.js +0 -59
- package/dist/es2015/filter-group.component.js +0 -145
- package/dist/es2015/filter.module.d.ts +0 -37
- package/dist/es2015/filter.module.js +0 -88
- package/dist/es2015/index.js +0 -21
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/localization/custom-messages.component.js +0 -36
- package/dist/es2015/localization/localized-messages.directive.js +0 -31
- package/dist/es2015/localization/messages.js +0 -160
- package/dist/es2015/main.d.ts +0 -7
- package/dist/es2015/main.js +0 -6
- package/dist/es2015/model/filter-expression.js +0 -7
- package/dist/es2015/shared.module.js +0 -32
- package/dist/es2015/util.d.ts +0 -147
- package/dist/fesm2015/index.js +0 -1316
- package/dist/fesm5/index.js +0 -1076
- package/dist/npm/aria-label.directive.js +0 -32
- package/dist/npm/editors/boolean-editor.component.js +0 -63
- package/dist/npm/editors/date-editor.component.js +0 -47
- package/dist/npm/editors/numeric-editor.component.js +0 -47
- package/dist/npm/editors/text-editor.component.js +0 -47
- package/dist/npm/filter-expression-operators.component.js +0 -50
- package/dist/npm/filter-expression.component.js +0 -138
- package/dist/npm/filter-group.component.js +0 -86
- package/dist/npm/filter.component.js +0 -187
- package/dist/npm/filter.module.js +0 -93
- package/dist/npm/filter.service.js +0 -47
- package/dist/npm/index.js +0 -37
- package/dist/npm/localization/custom-messages.component.js +0 -46
- package/dist/npm/localization/localized-messages.directive.js +0 -37
- package/dist/npm/localization/messages.js +0 -168
- package/dist/npm/main.js +0 -10
- package/dist/npm/package-metadata.js +0 -17
- package/dist/npm/shared.module.js +0 -37
- package/dist/npm/util.js +0 -138
- package/dist/systemjs/kendo-angular-filter.js +0 -5
|
@@ -0,0 +1,68 @@
|
|
|
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 { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
6
|
+
import { nullOperators } from './util';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "./filter.service";
|
|
9
|
+
import * as i2 from "@progress/kendo-angular-l10n";
|
|
10
|
+
import * as i3 from "@progress/kendo-angular-dropdowns";
|
|
11
|
+
import * as i4 from "./aria-label.directive";
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
export class FilterExpressionOperatorsComponent {
|
|
16
|
+
constructor(filterService, localization) {
|
|
17
|
+
this.filterService = filterService;
|
|
18
|
+
this.localization = localization;
|
|
19
|
+
this.valueChange = new EventEmitter();
|
|
20
|
+
this.operators = [];
|
|
21
|
+
}
|
|
22
|
+
messageFor(key) {
|
|
23
|
+
return this.localization.get(key);
|
|
24
|
+
}
|
|
25
|
+
operatorValueChange(value) {
|
|
26
|
+
this.valueChange.emit();
|
|
27
|
+
this.filterService.isEditorDisabled = nullOperators.indexOf(value) >= 0;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
FilterExpressionOperatorsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterExpressionOperatorsComponent, deps: [{ token: i1.FilterService }, { token: i2.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
31
|
+
FilterExpressionOperatorsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterExpressionOperatorsComponent, selector: "kendo-filter-expression-operators", inputs: { currentItem: "currentItem", operators: "operators" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
32
|
+
<kendo-dropdownlist
|
|
33
|
+
[kendoAriaLabelValue]="messageFor('filterOperatorAriaLabel')"
|
|
34
|
+
[data]="operators"
|
|
35
|
+
[title]="messageFor('filterExpressionOperators')"
|
|
36
|
+
[(value)]="currentItem.operator"
|
|
37
|
+
(valueChange)="operatorValueChange($event)"
|
|
38
|
+
[valuePrimitive]="true"
|
|
39
|
+
textField="text"
|
|
40
|
+
valueField="value"
|
|
41
|
+
>
|
|
42
|
+
</kendo-dropdownlist>
|
|
43
|
+
`, isInline: true, components: [{ type: i3.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: i4.AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }] });
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterExpressionOperatorsComponent, decorators: [{
|
|
45
|
+
type: Component,
|
|
46
|
+
args: [{
|
|
47
|
+
selector: 'kendo-filter-expression-operators',
|
|
48
|
+
template: `
|
|
49
|
+
<kendo-dropdownlist
|
|
50
|
+
[kendoAriaLabelValue]="messageFor('filterOperatorAriaLabel')"
|
|
51
|
+
[data]="operators"
|
|
52
|
+
[title]="messageFor('filterExpressionOperators')"
|
|
53
|
+
[(value)]="currentItem.operator"
|
|
54
|
+
(valueChange)="operatorValueChange($event)"
|
|
55
|
+
[valuePrimitive]="true"
|
|
56
|
+
textField="text"
|
|
57
|
+
valueField="value"
|
|
58
|
+
>
|
|
59
|
+
</kendo-dropdownlist>
|
|
60
|
+
`
|
|
61
|
+
}]
|
|
62
|
+
}], ctorParameters: function () { return [{ type: i1.FilterService }, { type: i2.LocalizationService }]; }, propDecorators: { currentItem: [{
|
|
63
|
+
type: Input
|
|
64
|
+
}], valueChange: [{
|
|
65
|
+
type: Output
|
|
66
|
+
}], operators: [{
|
|
67
|
+
type: Input
|
|
68
|
+
}] } });
|
|
@@ -2,15 +2,24 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import
|
|
6
|
-
import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
7
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
-
import { FilterService } from './filter.service';
|
|
5
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
9
6
|
import { defaultDateOperators, defaultNumericOperators, defaultOperators, defaultStringOperators, getKeyByValue, isFilterEditor, localizeOperators } from './util';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "./filter.service";
|
|
9
|
+
import * as i2 from "@progress/kendo-angular-l10n";
|
|
10
|
+
import * as i3 from "@progress/kendo-angular-dropdowns";
|
|
11
|
+
import * as i4 from "./filter-expression-operators.component";
|
|
12
|
+
import * as i5 from "./editors/text-editor.component";
|
|
13
|
+
import * as i6 from "./editors/numeric-editor.component";
|
|
14
|
+
import * as i7 from "./editors/boolean-editor.component";
|
|
15
|
+
import * as i8 from "./editors/date-editor.component";
|
|
16
|
+
import * as i9 from "./aria-label.directive";
|
|
17
|
+
import * as i10 from "@angular/common";
|
|
18
|
+
import * as i11 from "@progress/kendo-angular-buttons";
|
|
10
19
|
/**
|
|
11
20
|
* @hidden
|
|
12
21
|
*/
|
|
13
|
-
|
|
22
|
+
export class FilterExpressionComponent {
|
|
14
23
|
constructor(filterService, localization, cdr) {
|
|
15
24
|
this.filterService = filterService;
|
|
16
25
|
this.localization = localization;
|
|
@@ -110,23 +119,55 @@ let FilterExpressionComponent = class FilterExpressionComponent {
|
|
|
110
119
|
}
|
|
111
120
|
}
|
|
112
121
|
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
]
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
]
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
122
|
+
}
|
|
123
|
+
FilterExpressionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterExpressionComponent, deps: [{ token: i1.FilterService }, { token: i2.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
124
|
+
FilterExpressionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterExpressionComponent, selector: "kendo-filter-expression", inputs: { index: "index", currentItem: "currentItem" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
125
|
+
<div class="k-filter-toolbar" role="group" [attr.aria-label]="messageFor('filterAriaLabel')">
|
|
126
|
+
<div class="k-toolbar">
|
|
127
|
+
<div class="k-filter-toolbar-item k-filter-field">
|
|
128
|
+
<kendo-dropdownlist
|
|
129
|
+
[kendoAriaLabelValue]="messageFor('filterFieldAriaLabel')"
|
|
130
|
+
[title]="messageFor('filterExpressionFilters')"
|
|
131
|
+
[data]="filters"
|
|
132
|
+
textField="title"
|
|
133
|
+
valueField="field"
|
|
134
|
+
[value]="currentItem.field"
|
|
135
|
+
[valuePrimitive]="true"
|
|
136
|
+
(valueChange)="filterValueChange($event)">
|
|
137
|
+
</kendo-dropdownlist>
|
|
138
|
+
</div>
|
|
139
|
+
<div *ngIf="!isBoolean" class="k-filter-toolbar-item k-filter-operator">
|
|
140
|
+
<kendo-filter-expression-operators
|
|
141
|
+
[currentItem]="currentItem"
|
|
142
|
+
[operators]="operators"
|
|
143
|
+
(valueChange)="valueChange.emit();">
|
|
144
|
+
</kendo-filter-expression-operators>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<ng-container [ngSwitch]="getEditorType()">
|
|
148
|
+
<kendo-filter-text-editor *ngSwitchCase="'string'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-text-editor>
|
|
149
|
+
<kendo-filter-numeric-editor *ngSwitchCase="'number'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-numeric-editor>
|
|
150
|
+
<kendo-filter-boolean-editor *ngSwitchCase="'boolean'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-boolean-editor>
|
|
151
|
+
<kendo-filter-date-editor *ngSwitchCase="'date'" [currentItem]="currentItem" (valueChange)="valueChange.emit()"></kendo-filter-date-editor>
|
|
152
|
+
</ng-container>
|
|
153
|
+
|
|
154
|
+
<div class="k-filter-toolbar-item">
|
|
155
|
+
<button
|
|
156
|
+
kendoButton
|
|
157
|
+
icon="close"
|
|
158
|
+
fillMode="flat"
|
|
159
|
+
[title]="messageFor('remove')"
|
|
160
|
+
(click)="removeFilterExpression()">
|
|
161
|
+
</button>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
`, isInline: true, components: [{ type: i3.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: i4.FilterExpressionOperatorsComponent, selector: "kendo-filter-expression-operators", inputs: ["currentItem", "operators"], outputs: ["valueChange"] }, { type: i5.FilterTextEditorComponent, selector: "kendo-filter-text-editor", inputs: ["currentItem"], outputs: ["valueChange"] }, { type: i6.FilterNumericEditorComponent, selector: "kendo-filter-numeric-editor", inputs: ["currentItem"], outputs: ["valueChange"] }, { type: i7.FilterBooleanEditorComponent, selector: "kendo-filter-boolean-editor", inputs: ["currentItem"], outputs: ["valueChange"] }, { type: i8.FilterDateEditorComponent, selector: "kendo-filter-date-editor", inputs: ["currentItem"], outputs: ["valueChange"] }], directives: [{ type: i9.AriaLabelValueDirective, selector: "[kendoAriaLabelValue]", inputs: ["kendoAriaLabelValue"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i10.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i11.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterExpressionComponent, decorators: [{
|
|
167
|
+
type: Component,
|
|
168
|
+
args: [{
|
|
169
|
+
selector: 'kendo-filter-expression',
|
|
170
|
+
template: `
|
|
130
171
|
<div class="k-filter-toolbar" role="group" [attr.aria-label]="messageFor('filterAriaLabel')">
|
|
131
172
|
<div class="k-toolbar">
|
|
132
173
|
<div class="k-filter-toolbar-item k-filter-field">
|
|
@@ -168,7 +209,11 @@ FilterExpressionComponent = tslib_1.__decorate([
|
|
|
168
209
|
</div>
|
|
169
210
|
</div>
|
|
170
211
|
`
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
212
|
+
}]
|
|
213
|
+
}], ctorParameters: function () { return [{ type: i1.FilterService }, { type: i2.LocalizationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { index: [{
|
|
214
|
+
type: Input
|
|
215
|
+
}], currentItem: [{
|
|
216
|
+
type: Input
|
|
217
|
+
}], valueChange: [{
|
|
218
|
+
type: Output
|
|
219
|
+
}] } });
|
|
@@ -0,0 +1,206 @@
|
|
|
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 { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
6
|
+
import { localizeOperators, logicOperators } from './util';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "./filter.service";
|
|
9
|
+
import * as i2 from "@progress/kendo-angular-l10n";
|
|
10
|
+
import * as i3 from "./filter-expression.component";
|
|
11
|
+
import * as i4 from "@angular/common";
|
|
12
|
+
import * as i5 from "@progress/kendo-angular-buttons";
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export class FilterGroupComponent {
|
|
17
|
+
constructor(filterService, localization, cdr) {
|
|
18
|
+
this.filterService = filterService;
|
|
19
|
+
this.localization = localization;
|
|
20
|
+
this.cdr = cdr;
|
|
21
|
+
this.index = 0;
|
|
22
|
+
this.currentItem = {
|
|
23
|
+
logic: 'or',
|
|
24
|
+
filters: []
|
|
25
|
+
};
|
|
26
|
+
this.valueChange = new EventEmitter();
|
|
27
|
+
this.operators = [];
|
|
28
|
+
}
|
|
29
|
+
ngOnInit() {
|
|
30
|
+
this.operators = this.getLogicOperators();
|
|
31
|
+
this.localizationSubscription = this.localization.changes.subscribe(() => {
|
|
32
|
+
this.operators = this.getLogicOperators();
|
|
33
|
+
this.cdr.detectChanges();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
ngOnDestroy() {
|
|
37
|
+
if (this.localizationSubscription) {
|
|
38
|
+
this.localizationSubscription.unsubscribe();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
getLogicOperators() {
|
|
42
|
+
return localizeOperators(logicOperators)(this.localization);
|
|
43
|
+
}
|
|
44
|
+
messageFor(key) {
|
|
45
|
+
return this.localization.get(key);
|
|
46
|
+
}
|
|
47
|
+
selectedChange(logicOperator) {
|
|
48
|
+
if (this.currentItem.logic !== logicOperator) {
|
|
49
|
+
this.currentItem.logic = logicOperator;
|
|
50
|
+
this.valueChange.emit();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
addFilterExpression() {
|
|
54
|
+
this.filterService.addFilterExpression(this.currentItem);
|
|
55
|
+
this.valueChange.emit();
|
|
56
|
+
}
|
|
57
|
+
addFilterGroup() {
|
|
58
|
+
this.filterService.addFilterGroup(this.currentItem);
|
|
59
|
+
this.valueChange.emit();
|
|
60
|
+
}
|
|
61
|
+
removeFilterGroup() {
|
|
62
|
+
this.filterService.remove(this.currentItem, this.index);
|
|
63
|
+
this.valueChange.emit();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
FilterGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterGroupComponent, deps: [{ token: i1.FilterService }, { token: i2.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
67
|
+
FilterGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterGroupComponent, selector: "kendo-filter-group", inputs: { index: "index", currentItem: "currentItem" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
68
|
+
<div class="k-filter-toolbar" role="toolbar" [attr.aria-label]="messageFor('filterToolbarAriaLabel')">
|
|
69
|
+
<div class="k-toolbar">
|
|
70
|
+
<div class="k-filter-toolbar-item">
|
|
71
|
+
<div class="k-widget k-button-group" role="group">
|
|
72
|
+
<button
|
|
73
|
+
*ngFor="let operator of operators"
|
|
74
|
+
kendoButton
|
|
75
|
+
[ngClass]="{'k-group-start': operator.value === 'and', 'k-group-end': operator.value === 'or'}"
|
|
76
|
+
[selected]="currentItem.logic === operator.value"
|
|
77
|
+
[title]="operator.text"
|
|
78
|
+
(click)="selectedChange(operator.value)"
|
|
79
|
+
>
|
|
80
|
+
{{operator.text}}
|
|
81
|
+
</button>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="k-filter-toolbar-item">
|
|
85
|
+
<button
|
|
86
|
+
kendoButton
|
|
87
|
+
[title]="messageFor('addFilter')"
|
|
88
|
+
icon="filter-add-expression"
|
|
89
|
+
(click)="addFilterExpression()">
|
|
90
|
+
{{messageFor('addFilter')}}
|
|
91
|
+
</button>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="k-filter-toolbar-item">
|
|
94
|
+
<button
|
|
95
|
+
kendoButton
|
|
96
|
+
[title]="messageFor('addGroup')"
|
|
97
|
+
icon="filter-add-group"
|
|
98
|
+
(click)="addFilterGroup()">
|
|
99
|
+
{{messageFor('addGroup')}}
|
|
100
|
+
</button>
|
|
101
|
+
</div>
|
|
102
|
+
<div class="k-filter-toolbar-item">
|
|
103
|
+
<button
|
|
104
|
+
kendoButton
|
|
105
|
+
icon="close"
|
|
106
|
+
fillMode="flat"
|
|
107
|
+
[title]="messageFor('remove')"
|
|
108
|
+
(click)="removeFilterGroup()">
|
|
109
|
+
</button>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<ul class="k-filter-lines" *ngIf="currentItem.filters">
|
|
115
|
+
<ng-container *ngFor="let item of currentItem.filters; let i = index;">
|
|
116
|
+
<li class="k-filter-item" *ngIf="!item['filters']">
|
|
117
|
+
<kendo-filter-expression (valueChange)="valueChange.emit()" [currentItem]="item" [index]="i">
|
|
118
|
+
</kendo-filter-expression>
|
|
119
|
+
</li>
|
|
120
|
+
<li class="k-filter-item" *ngIf="item['filters']">
|
|
121
|
+
<kendo-filter-group
|
|
122
|
+
(valueChange)="valueChange.emit()"
|
|
123
|
+
[currentItem]="item"
|
|
124
|
+
[index]="i"
|
|
125
|
+
>
|
|
126
|
+
</kendo-filter-group>
|
|
127
|
+
</li>
|
|
128
|
+
</ng-container>
|
|
129
|
+
</ul>
|
|
130
|
+
`, isInline: true, components: [{ type: i3.FilterExpressionComponent, selector: "kendo-filter-expression", inputs: ["index", "currentItem"], outputs: ["valueChange"] }, { type: FilterGroupComponent, selector: "kendo-filter-group", inputs: ["index", "currentItem"], outputs: ["valueChange"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterGroupComponent, decorators: [{
|
|
132
|
+
type: Component,
|
|
133
|
+
args: [{
|
|
134
|
+
selector: 'kendo-filter-group',
|
|
135
|
+
template: `
|
|
136
|
+
<div class="k-filter-toolbar" role="toolbar" [attr.aria-label]="messageFor('filterToolbarAriaLabel')">
|
|
137
|
+
<div class="k-toolbar">
|
|
138
|
+
<div class="k-filter-toolbar-item">
|
|
139
|
+
<div class="k-widget k-button-group" role="group">
|
|
140
|
+
<button
|
|
141
|
+
*ngFor="let operator of operators"
|
|
142
|
+
kendoButton
|
|
143
|
+
[ngClass]="{'k-group-start': operator.value === 'and', 'k-group-end': operator.value === 'or'}"
|
|
144
|
+
[selected]="currentItem.logic === operator.value"
|
|
145
|
+
[title]="operator.text"
|
|
146
|
+
(click)="selectedChange(operator.value)"
|
|
147
|
+
>
|
|
148
|
+
{{operator.text}}
|
|
149
|
+
</button>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
<div class="k-filter-toolbar-item">
|
|
153
|
+
<button
|
|
154
|
+
kendoButton
|
|
155
|
+
[title]="messageFor('addFilter')"
|
|
156
|
+
icon="filter-add-expression"
|
|
157
|
+
(click)="addFilterExpression()">
|
|
158
|
+
{{messageFor('addFilter')}}
|
|
159
|
+
</button>
|
|
160
|
+
</div>
|
|
161
|
+
<div class="k-filter-toolbar-item">
|
|
162
|
+
<button
|
|
163
|
+
kendoButton
|
|
164
|
+
[title]="messageFor('addGroup')"
|
|
165
|
+
icon="filter-add-group"
|
|
166
|
+
(click)="addFilterGroup()">
|
|
167
|
+
{{messageFor('addGroup')}}
|
|
168
|
+
</button>
|
|
169
|
+
</div>
|
|
170
|
+
<div class="k-filter-toolbar-item">
|
|
171
|
+
<button
|
|
172
|
+
kendoButton
|
|
173
|
+
icon="close"
|
|
174
|
+
fillMode="flat"
|
|
175
|
+
[title]="messageFor('remove')"
|
|
176
|
+
(click)="removeFilterGroup()">
|
|
177
|
+
</button>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<ul class="k-filter-lines" *ngIf="currentItem.filters">
|
|
183
|
+
<ng-container *ngFor="let item of currentItem.filters; let i = index;">
|
|
184
|
+
<li class="k-filter-item" *ngIf="!item['filters']">
|
|
185
|
+
<kendo-filter-expression (valueChange)="valueChange.emit()" [currentItem]="item" [index]="i">
|
|
186
|
+
</kendo-filter-expression>
|
|
187
|
+
</li>
|
|
188
|
+
<li class="k-filter-item" *ngIf="item['filters']">
|
|
189
|
+
<kendo-filter-group
|
|
190
|
+
(valueChange)="valueChange.emit()"
|
|
191
|
+
[currentItem]="item"
|
|
192
|
+
[index]="i"
|
|
193
|
+
>
|
|
194
|
+
</kendo-filter-group>
|
|
195
|
+
</li>
|
|
196
|
+
</ng-container>
|
|
197
|
+
</ul>
|
|
198
|
+
`
|
|
199
|
+
}]
|
|
200
|
+
}], ctorParameters: function () { return [{ type: i1.FilterService }, { type: i2.LocalizationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { index: [{
|
|
201
|
+
type: Input
|
|
202
|
+
}], currentItem: [{
|
|
203
|
+
type: Input
|
|
204
|
+
}], valueChange: [{
|
|
205
|
+
type: Output
|
|
206
|
+
}] } });
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
5
|
import { Component, Input, Output, EventEmitter, HostBinding, isDevMode } from '@angular/core';
|
|
7
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
6
|
import { FilterService } from './filter.service';
|
|
9
7
|
import { isArray } from './util';
|
|
10
|
-
import { ChangeDetectorRef } from '@angular/core';
|
|
11
8
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
12
9
|
import { packageMetadata } from './package-metadata';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "./filter.service";
|
|
12
|
+
import * as i2 from "@progress/kendo-angular-l10n";
|
|
13
|
+
import * as i3 from "./filter-group.component";
|
|
14
|
+
import * as i4 from "./localization/localized-messages.directive";
|
|
13
15
|
/**
|
|
14
16
|
* Represents the [Kendo UI Filter component for Angular]({% slug overview_filter %}).
|
|
15
17
|
* The Filter component can be used to apply any user defined filter criteria.
|
|
@@ -42,7 +44,7 @@ import { packageMetadata } from './package-metadata';
|
|
|
42
44
|
* }
|
|
43
45
|
* ```
|
|
44
46
|
*/
|
|
45
|
-
|
|
47
|
+
export class FilterComponent {
|
|
46
48
|
constructor(filterService, localization, cdr) {
|
|
47
49
|
this.filterService = filterService;
|
|
48
50
|
this.localization = localization;
|
|
@@ -141,29 +143,139 @@ let FilterComponent = class FilterComponent {
|
|
|
141
143
|
}
|
|
142
144
|
});
|
|
143
145
|
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
146
|
+
}
|
|
147
|
+
FilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterComponent, deps: [{ token: i1.FilterService }, { token: i2.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
148
|
+
FilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilterComponent, selector: "kendo-filter", inputs: { filters: "filters", value: "value" }, outputs: { valueChange: "valueChange" }, host: { properties: { "attr.dir": "this.direction" } }, providers: [FilterService], ngImport: i0, template: `
|
|
149
|
+
<ng-container kendoFilterLocalizedMessages
|
|
150
|
+
i18n-editorDateTodayText="kendo.filter.editorDateTodayText|The text of the Today button of the Date editor"
|
|
151
|
+
editorDateTodayText="Today"
|
|
152
|
+
|
|
153
|
+
i18n-editorDateToggleText="kendo.filter.editorDateToggleText|The title of the Toggle button of the Date editor."
|
|
154
|
+
editorDateToggleText="Toggle calendar"
|
|
155
|
+
|
|
156
|
+
i18n-editorNumericDecrement="kendo.filter.editorNumericDecrement|The title of the Decrement button of the Numeric editor"
|
|
157
|
+
editorNumericDecrement="Decrement"
|
|
158
|
+
|
|
159
|
+
i18n-editorNumericIncrement="kendo.filter.editorNumericIncrement|The title of the Increment button of the Numeric editor"
|
|
160
|
+
editorNumericIncrement="Increment"
|
|
161
|
+
|
|
162
|
+
i18n-filterExpressionOperators="kendo.filter.filterExpressionOperators|The text of the Filter Expression Operators drop down"
|
|
163
|
+
filterExpressionOperators="Operators"
|
|
164
|
+
|
|
165
|
+
i18n-filterExpressionFilters="kendo.filter.filterExpressionFilters|The text of the Filter Expression filters drop down"
|
|
166
|
+
filterExpressionFilters="Fields"
|
|
167
|
+
|
|
168
|
+
i18n-remove="kendo.filter.remove|The text of the Remove button"
|
|
169
|
+
remove="Remove"
|
|
170
|
+
|
|
171
|
+
i18n-addFilter="kendo.filter.addFilter|The text of the Add Filter button"
|
|
172
|
+
addFilter="Add Filter"
|
|
173
|
+
|
|
174
|
+
i18n-addGroup="kendo.filter.addGroup|The text of the Add Group button"
|
|
175
|
+
addGroup="Add Group"
|
|
176
|
+
|
|
177
|
+
i18n-filterAndLogic="kendo.filter.filterAndLogic|The text of the And filter logic"
|
|
178
|
+
filterAndLogic="And"
|
|
179
|
+
|
|
180
|
+
i18n-filterOrLogic="kendo.filter.filterOrLogic|The text of the Or filter logic"
|
|
181
|
+
filterOrLogic="Or"
|
|
182
|
+
|
|
183
|
+
i18n-filterEqOperator="kendo.filter.filterEqOperator|The text of the equal filter operator"
|
|
184
|
+
filterEqOperator="Is equal to"
|
|
185
|
+
|
|
186
|
+
i18n-filterNotEqOperator="kendo.filter.filterNotEqOperator|The text of the not equal filter operator"
|
|
187
|
+
filterNotEqOperator="Is not equal to"
|
|
188
|
+
|
|
189
|
+
i18n-filterIsNullOperator="kendo.filter.filterIsNullOperator|The text of the is null filter operator"
|
|
190
|
+
filterIsNullOperator="Is null"
|
|
191
|
+
|
|
192
|
+
i18n-filterIsNotNullOperator="kendo.filter.filterIsNotNullOperator|The text of the is not null filter operator"
|
|
193
|
+
filterIsNotNullOperator="Is not null"
|
|
194
|
+
|
|
195
|
+
i18n-filterIsEmptyOperator="kendo.filter.filterIsEmptyOperator|The text of the is empty filter operator"
|
|
196
|
+
filterIsEmptyOperator="Is empty"
|
|
197
|
+
|
|
198
|
+
i18n-filterIsNotEmptyOperator="kendo.filter.filterIsNotEmptyOperator|The text of the is not empty filter operator"
|
|
199
|
+
filterIsNotEmptyOperator="Is not empty"
|
|
200
|
+
|
|
201
|
+
i18n-filterStartsWithOperator="kendo.filter.filterStartsWithOperator|The text of the starts with filter operator"
|
|
202
|
+
filterStartsWithOperator="Starts with"
|
|
203
|
+
|
|
204
|
+
i18n-filterContainsOperator="kendo.filter.filterContainsOperator|The text of the contains filter operator"
|
|
205
|
+
filterContainsOperator="Contains"
|
|
206
|
+
|
|
207
|
+
i18n-filterNotContainsOperator="kendo.filter.filterNotContainsOperator|The text of the does not contain filter operator"
|
|
208
|
+
filterNotContainsOperator="Does not contain"
|
|
209
|
+
|
|
210
|
+
i18n-filterEndsWithOperator="kendo.filter.filterEndsWithOperator|The text of the ends with filter operator"
|
|
211
|
+
filterEndsWithOperator="Ends with"
|
|
212
|
+
|
|
213
|
+
i18n-filterGteOperator="kendo.filter.filterGteOperator|The text of the greater than or equal filter operator"
|
|
214
|
+
filterGteOperator="Is greater than or equal to"
|
|
215
|
+
|
|
216
|
+
i18n-filterGtOperator="kendo.filter.filterGtOperator|The text of the greater than filter operator"
|
|
217
|
+
filterGtOperator="Is greater than"
|
|
218
|
+
|
|
219
|
+
i18n-filterLteOperator="kendo.filter.filterLteOperator|The text of the less than or equal filter operator"
|
|
220
|
+
filterLteOperator="Is less than or equal to"
|
|
221
|
+
|
|
222
|
+
i18n-filterLtOperator="kendo.filter.filterLtOperator|The text of the less than filter operator"
|
|
223
|
+
filterLtOperator="Is less than"
|
|
224
|
+
|
|
225
|
+
i18n-filterIsTrue="kendo.filter.filterIsTrue|The text of the IsTrue boolean filter option"
|
|
226
|
+
filterIsTrue="Is True"
|
|
227
|
+
|
|
228
|
+
i18n-filterIsFalse="kendo.filter.filterIsFalse|The text of the IsFalse boolean filter option"
|
|
229
|
+
filterIsFalse="Is False"
|
|
230
|
+
|
|
231
|
+
i18n-filterBooleanAll="kendo.filter.filterBooleanAll|The text of the (All) boolean filter option"
|
|
232
|
+
filterBooleanAll="(All)"
|
|
233
|
+
|
|
234
|
+
i18n-filterAfterOrEqualOperator="kendo.filter.filterAfterOrEqualOperator|The text of the after or equal date filter operator"
|
|
235
|
+
filterAfterOrEqualOperator="Is after or equal to"
|
|
236
|
+
|
|
237
|
+
i18n-filterAfterOperator="kendo.filter.filterAfterOperator|The text of the after date filter operator"
|
|
238
|
+
filterAfterOperator="Is after"
|
|
239
|
+
|
|
240
|
+
i18n-filterBeforeOperator="kendo.filter.filterBeforeOperator|The text of the before date filter operator"
|
|
241
|
+
filterBeforeOperator="Is before"
|
|
242
|
+
|
|
243
|
+
i18n-filterBeforeOrEqualOperator="kendo.filter.filterBeforeOrEqualOperator|The text of the before or equal date filter operator"
|
|
244
|
+
filterBeforeOrEqualOperator="Is before or equal to"
|
|
245
|
+
|
|
246
|
+
i18n-filterFieldAriaLabel="kendo.filter.filterFieldAriaLabel|The text of the filter field aria label"
|
|
247
|
+
filterFieldAriaLabel="field"
|
|
248
|
+
|
|
249
|
+
i18n-filterOperatorAriaLabel="kendo.filter.filterOperatorAriaLabel|The text of the filter operator aria label"
|
|
250
|
+
filterOperatorAriaLabel="operator"
|
|
251
|
+
|
|
252
|
+
i18n-filterValueAriaLabel="kendo.filter.filterValueAriaLabel|The text of the filter value aria label"
|
|
253
|
+
filterValueAriaLabel="value"
|
|
254
|
+
|
|
255
|
+
i18n-filterAriaLabel="kendo.filter.filterAriaLabel|The text of the filter row aria label"
|
|
256
|
+
filterAriaLabel="filter"
|
|
257
|
+
|
|
258
|
+
i18n-filterToolbarAriaLabel="kendo.filter.filterToolbarAriaLabel|The text of the filter toolbar aria label"
|
|
259
|
+
filterToolbarAriaLabel="filter settings"
|
|
260
|
+
>
|
|
261
|
+
</ng-container>
|
|
262
|
+
<div class="k-widget k-filter" [attr.dir]="direction">
|
|
263
|
+
<ul class='k-filter-container'>
|
|
264
|
+
<li class='k-filter-group-main'>
|
|
265
|
+
<kendo-filter-group
|
|
266
|
+
[currentItem]="getCurrentFilter()"
|
|
267
|
+
(valueChange)="onValueChange()"
|
|
268
|
+
>
|
|
269
|
+
</kendo-filter-group>
|
|
270
|
+
</li>
|
|
271
|
+
</ul>
|
|
272
|
+
</div>
|
|
273
|
+
`, isInline: true, components: [{ type: i3.FilterGroupComponent, selector: "kendo-filter-group", inputs: ["index", "currentItem"], outputs: ["valueChange"] }], directives: [{ type: i4.LocalizedMessagesDirective, selector: "[kendoFilterLocalizedMessages]" }] });
|
|
274
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilterComponent, decorators: [{
|
|
275
|
+
type: Component,
|
|
276
|
+
args: [{
|
|
277
|
+
selector: 'kendo-filter',
|
|
278
|
+
template: `
|
|
167
279
|
<ng-container kendoFilterLocalizedMessages
|
|
168
280
|
i18n-editorDateTodayText="kendo.filter.editorDateTodayText|The text of the Today button of the Date editor"
|
|
169
281
|
editorDateTodayText="Today"
|
|
@@ -289,10 +401,15 @@ FilterComponent = tslib_1.__decorate([
|
|
|
289
401
|
</ul>
|
|
290
402
|
</div>
|
|
291
403
|
`,
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
],
|
|
298
|
-
|
|
404
|
+
providers: [FilterService]
|
|
405
|
+
}]
|
|
406
|
+
}], ctorParameters: function () { return [{ type: i1.FilterService }, { type: i2.LocalizationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { direction: [{
|
|
407
|
+
type: HostBinding,
|
|
408
|
+
args: ['attr.dir']
|
|
409
|
+
}], filters: [{
|
|
410
|
+
type: Input
|
|
411
|
+
}], value: [{
|
|
412
|
+
type: Input
|
|
413
|
+
}], valueChange: [{
|
|
414
|
+
type: Output
|
|
415
|
+
}] } });
|