@progress/kendo-angular-filter 21.4.1-develop.1 → 22.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base-filter-row.component.d.ts +1 -1
- package/fesm2022/progress-kendo-angular-filter.mjs +61 -61
- package/localization/messages.d.ts +1 -1
- package/package.json +16 -24
- package/schematics/ngAdd/index.js +4 -4
- package/esm2022/aria-label.directive.mjs +0 -34
- package/esm2022/base-filter-row.component.mjs +0 -75
- package/esm2022/directives.mjs +0 -17
- package/esm2022/editors/boolean-editor.component.mjs +0 -97
- package/esm2022/editors/date-editor.component.mjs +0 -75
- package/esm2022/editors/numeric-editor.component.mjs +0 -75
- package/esm2022/editors/text-editor.component.mjs +0 -62
- package/esm2022/error-messages.mjs +0 -16
- package/esm2022/filter-expression-operators.component.mjs +0 -90
- package/esm2022/filter-expression.component.mjs +0 -352
- package/esm2022/filter-field.component.mjs +0 -109
- package/esm2022/filter-group.component.mjs +0 -303
- package/esm2022/filter.component.mjs +0 -611
- package/esm2022/filter.module.mjs +0 -105
- package/esm2022/filter.service.mjs +0 -41
- package/esm2022/index.mjs +0 -19
- package/esm2022/localization/custom-messages.component.mjs +0 -44
- package/esm2022/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/localization/messages.mjs +0 -243
- package/esm2022/model/filter-expression.mjs +0 -8
- package/esm2022/navigation.service.mjs +0 -162
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/progress-kendo-angular-filter.mjs +0 -8
- package/esm2022/templates/value-editor.template.mjs +0 -32
- package/esm2022/util.mjs +0 -174
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { ChangeDetectorRef, Component, ElementRef, forwardRef, Input, QueryList, Renderer2, ViewChildren } from '@angular/core';
|
|
6
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
-
import { filterAddExpressionIcon, filterAddGroupIcon, xIcon } from '@progress/kendo-svg-icons';
|
|
8
|
-
import { BaseFilterRowComponent } from './base-filter-row.component';
|
|
9
|
-
import { FilterService } from './filter.service';
|
|
10
|
-
import { NavigationService } from './navigation.service';
|
|
11
|
-
import { FilterItem, getKeyByValue, localizeOperators, logicOperators, selectors } from './util';
|
|
12
|
-
import { FilterExpressionComponent } from './filter-expression.component';
|
|
13
|
-
import { ButtonComponent } from '@progress/kendo-angular-buttons';
|
|
14
|
-
import { NgClass } from '@angular/common';
|
|
15
|
-
import * as i0 from "@angular/core";
|
|
16
|
-
import * as i1 from "./filter.service";
|
|
17
|
-
import * as i2 from "./navigation.service";
|
|
18
|
-
import * as i3 from "@progress/kendo-angular-l10n";
|
|
19
|
-
/**
|
|
20
|
-
* @hidden
|
|
21
|
-
*/
|
|
22
|
-
export class FilterGroupComponent extends BaseFilterRowComponent {
|
|
23
|
-
filterService;
|
|
24
|
-
cdr;
|
|
25
|
-
static ngAcceptInputType_currentItem;
|
|
26
|
-
/**
|
|
27
|
-
* @hidden
|
|
28
|
-
*/
|
|
29
|
-
xIcon = xIcon;
|
|
30
|
-
/**
|
|
31
|
-
* @hidden
|
|
32
|
-
*/
|
|
33
|
-
filterAddGroupIcon = filterAddGroupIcon;
|
|
34
|
-
/**
|
|
35
|
-
* @hidden
|
|
36
|
-
*/
|
|
37
|
-
filterAddExpressionIcon = filterAddExpressionIcon;
|
|
38
|
-
_filterItems;
|
|
39
|
-
get filterItems() {
|
|
40
|
-
return this._filterItems.toArray();
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* @hidden
|
|
44
|
-
*/
|
|
45
|
-
handleExpressionValueChange(isRemoveOperation) {
|
|
46
|
-
if (isRemoveOperation) {
|
|
47
|
-
// due to tracking by index, the filters should first be set to [] so that all rerender afterwards
|
|
48
|
-
const filtersCopy = this.currentItem.filters;
|
|
49
|
-
this.currentItem.filters = [];
|
|
50
|
-
this.cdr.detectChanges();
|
|
51
|
-
this.currentItem.filters = filtersCopy;
|
|
52
|
-
}
|
|
53
|
-
this.valueChange.emit(isRemoveOperation);
|
|
54
|
-
}
|
|
55
|
-
currentItem = {
|
|
56
|
-
logic: 'or',
|
|
57
|
-
filters: []
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* @hidden
|
|
61
|
-
*/
|
|
62
|
-
trackByFunction = (index) => {
|
|
63
|
-
return index;
|
|
64
|
-
};
|
|
65
|
-
operators = [];
|
|
66
|
-
localizationSubscription;
|
|
67
|
-
constructor(filterService, cdr, element, navigationService, localization, renderer) {
|
|
68
|
-
super(element, navigationService, localization, renderer);
|
|
69
|
-
this.filterService = filterService;
|
|
70
|
-
this.cdr = cdr;
|
|
71
|
-
}
|
|
72
|
-
ngOnInit() {
|
|
73
|
-
this.operators = this.getLogicOperators();
|
|
74
|
-
this.localizationSubscription = this.localization.changes.subscribe(() => {
|
|
75
|
-
this.operators = this.getLogicOperators();
|
|
76
|
-
this.cdr.detectChanges();
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
ngOnDestroy() {
|
|
80
|
-
if (this.localizationSubscription) {
|
|
81
|
-
this.localizationSubscription.unsubscribe();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
getLogicOperators() {
|
|
85
|
-
return localizeOperators(logicOperators)(this.localization);
|
|
86
|
-
}
|
|
87
|
-
getOperator(operatorValue) {
|
|
88
|
-
return this.messageFor(getKeyByValue(logicOperators, operatorValue));
|
|
89
|
-
}
|
|
90
|
-
selectedChange(logicOperator) {
|
|
91
|
-
if (this.currentItem.logic !== logicOperator) {
|
|
92
|
-
this.currentItem.logic = logicOperator;
|
|
93
|
-
this.valueChange.emit();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
addFilterExpression() {
|
|
97
|
-
this.filterService.addFilterExpression(this.currentItem);
|
|
98
|
-
this.valueChange.emit();
|
|
99
|
-
}
|
|
100
|
-
addFilterGroup() {
|
|
101
|
-
this.filterService.addFilterGroup(this.currentItem);
|
|
102
|
-
this.valueChange.emit();
|
|
103
|
-
}
|
|
104
|
-
removeFilterGroup() {
|
|
105
|
-
this.filterService.remove(this.currentItem, this.index);
|
|
106
|
-
this.cdr.detectChanges();
|
|
107
|
-
this.valueChange.emit(true);
|
|
108
|
-
}
|
|
109
|
-
onMouseDown(event) {
|
|
110
|
-
const toolbarItemElement = Array.from(event.target.closest(selectors.kendoToolbar).children).indexOf(event.target.closest(selectors.kendoFilterToolbarItem));
|
|
111
|
-
const buttonElement = Array.from(event.target.closest(selectors.kendoToolbar).children).indexOf(event.target.closest(selectors.kendoFilterToolbarButton));
|
|
112
|
-
let index = (toolbarItemElement > -1 ? toolbarItemElement : buttonElement) + 1;
|
|
113
|
-
if (event.target.closest(selectors.andButton)) {
|
|
114
|
-
index = 0;
|
|
115
|
-
}
|
|
116
|
-
if (event.target.closest(selectors.orButton)) {
|
|
117
|
-
index = 1;
|
|
118
|
-
}
|
|
119
|
-
this.navigationService.currentToolbarItemChildrenIndex = index;
|
|
120
|
-
this.navigationService.isFilterNavigationActivated = true;
|
|
121
|
-
const elementToFocus = this.navigationService.flattenFilterItems[this.itemNumber].focusableChildren[index];
|
|
122
|
-
this.navigationService.isFilterExpressionComponentFocused = false;
|
|
123
|
-
this.navigationService.currentToolbarItemIndex = this.itemNumber;
|
|
124
|
-
this.navigationService.focusCurrentElement(elementToFocus, true);
|
|
125
|
-
}
|
|
126
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FilterGroupComponent, deps: [{ token: i1.FilterService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i2.NavigationService }, { token: i3.LocalizationService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
127
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: FilterGroupComponent, isStandalone: true, selector: "kendo-filter-group", inputs: { currentItem: "currentItem" }, providers: [{
|
|
128
|
-
provide: FilterItem,
|
|
129
|
-
useExisting: forwardRef(() => FilterGroupComponent)
|
|
130
|
-
}], viewQueries: [{ propertyName: "_filterItems", predicate: FilterItem, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
131
|
-
<div class="k-filter-toolbar">
|
|
132
|
-
<div class="k-toolbar k-toolbar-md k-toolbar-solid" role="toolbar" [attr.aria-label]="messageFor('filterToolbarAriaLabel')" (mousedown)="onMouseDown($event)">
|
|
133
|
-
<div class="k-toolbar-button-group k-button-group k-button-group-solid" role="group">
|
|
134
|
-
@for (operator of operators; track operator) {
|
|
135
|
-
<button
|
|
136
|
-
tabindex="-1"
|
|
137
|
-
kendoButton
|
|
138
|
-
class="k-toolbar-button"
|
|
139
|
-
[ngClass]="{'k-group-start': operator.value === 'and', 'k-group-end': operator.value === 'or'}"
|
|
140
|
-
[selected]="currentItem.logic === operator.value"
|
|
141
|
-
[attr.aria-pressed]="currentItem.logic === operator.value"
|
|
142
|
-
[title]="operator.text"
|
|
143
|
-
(click)="selectedChange(operator.value)"
|
|
144
|
-
>
|
|
145
|
-
{{getOperator(operator.value)}}
|
|
146
|
-
</button>
|
|
147
|
-
}
|
|
148
|
-
</div>
|
|
149
|
-
|
|
150
|
-
<button
|
|
151
|
-
kendoButton
|
|
152
|
-
class="k-toolbar-button"
|
|
153
|
-
tabindex="-1"
|
|
154
|
-
[title]="messageFor('addFilter')"
|
|
155
|
-
icon="filter-add-expression"
|
|
156
|
-
[svgIcon]="filterAddExpressionIcon"
|
|
157
|
-
(click)="addFilterExpression()">
|
|
158
|
-
{{messageFor('addFilter')}}
|
|
159
|
-
</button>
|
|
160
|
-
|
|
161
|
-
<button
|
|
162
|
-
kendoButton
|
|
163
|
-
class="k-toolbar-button"
|
|
164
|
-
tabindex="-1"
|
|
165
|
-
[title]="messageFor('addGroup')"
|
|
166
|
-
icon="filter-add-group"
|
|
167
|
-
[svgIcon]="filterAddGroupIcon"
|
|
168
|
-
(click)="addFilterGroup()">
|
|
169
|
-
{{messageFor('addGroup')}}
|
|
170
|
-
</button>
|
|
171
|
-
|
|
172
|
-
<button
|
|
173
|
-
kendoButton
|
|
174
|
-
class="k-toolbar-button"
|
|
175
|
-
tabindex="-1"
|
|
176
|
-
icon="x"
|
|
177
|
-
[svgIcon]="xIcon"
|
|
178
|
-
fillMode="flat"
|
|
179
|
-
[title]="messageFor('remove')"
|
|
180
|
-
(click)="removeFilterGroup()">
|
|
181
|
-
</button>
|
|
182
|
-
</div>
|
|
183
|
-
</div>
|
|
184
|
-
|
|
185
|
-
@if (currentItem.filters) {
|
|
186
|
-
<ul class="k-filter-lines" role="group">
|
|
187
|
-
@for (item of currentItem.filters; track $index; let i = $index) {
|
|
188
|
-
@if (!item['filters']) {
|
|
189
|
-
<li class="k-filter-item" role="treeitem">
|
|
190
|
-
<kendo-filter-expression (valueChange)="handleExpressionValueChange($event)" [currentItem]="item" [index]="i">
|
|
191
|
-
</kendo-filter-expression>
|
|
192
|
-
</li>
|
|
193
|
-
}
|
|
194
|
-
@if (item['filters']) {
|
|
195
|
-
<li class="k-filter-item" role="treeitem">
|
|
196
|
-
<kendo-filter-group
|
|
197
|
-
(valueChange)="valueChange.emit($event)"
|
|
198
|
-
[currentItem]="item"
|
|
199
|
-
[index]="i"
|
|
200
|
-
>
|
|
201
|
-
</kendo-filter-group>
|
|
202
|
-
</li>
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
</ul>
|
|
206
|
-
}
|
|
207
|
-
`, isInline: true, dependencies: [{ kind: "component", type: FilterGroupComponent, selector: "kendo-filter-group", inputs: ["currentItem"] }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: FilterExpressionComponent, selector: "kendo-filter-expression", inputs: ["currentItem"] }] });
|
|
208
|
-
}
|
|
209
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FilterGroupComponent, decorators: [{
|
|
210
|
-
type: Component,
|
|
211
|
-
args: [{
|
|
212
|
-
providers: [{
|
|
213
|
-
provide: FilterItem,
|
|
214
|
-
useExisting: forwardRef(() => FilterGroupComponent)
|
|
215
|
-
}],
|
|
216
|
-
selector: 'kendo-filter-group',
|
|
217
|
-
template: `
|
|
218
|
-
<div class="k-filter-toolbar">
|
|
219
|
-
<div class="k-toolbar k-toolbar-md k-toolbar-solid" role="toolbar" [attr.aria-label]="messageFor('filterToolbarAriaLabel')" (mousedown)="onMouseDown($event)">
|
|
220
|
-
<div class="k-toolbar-button-group k-button-group k-button-group-solid" role="group">
|
|
221
|
-
@for (operator of operators; track operator) {
|
|
222
|
-
<button
|
|
223
|
-
tabindex="-1"
|
|
224
|
-
kendoButton
|
|
225
|
-
class="k-toolbar-button"
|
|
226
|
-
[ngClass]="{'k-group-start': operator.value === 'and', 'k-group-end': operator.value === 'or'}"
|
|
227
|
-
[selected]="currentItem.logic === operator.value"
|
|
228
|
-
[attr.aria-pressed]="currentItem.logic === operator.value"
|
|
229
|
-
[title]="operator.text"
|
|
230
|
-
(click)="selectedChange(operator.value)"
|
|
231
|
-
>
|
|
232
|
-
{{getOperator(operator.value)}}
|
|
233
|
-
</button>
|
|
234
|
-
}
|
|
235
|
-
</div>
|
|
236
|
-
|
|
237
|
-
<button
|
|
238
|
-
kendoButton
|
|
239
|
-
class="k-toolbar-button"
|
|
240
|
-
tabindex="-1"
|
|
241
|
-
[title]="messageFor('addFilter')"
|
|
242
|
-
icon="filter-add-expression"
|
|
243
|
-
[svgIcon]="filterAddExpressionIcon"
|
|
244
|
-
(click)="addFilterExpression()">
|
|
245
|
-
{{messageFor('addFilter')}}
|
|
246
|
-
</button>
|
|
247
|
-
|
|
248
|
-
<button
|
|
249
|
-
kendoButton
|
|
250
|
-
class="k-toolbar-button"
|
|
251
|
-
tabindex="-1"
|
|
252
|
-
[title]="messageFor('addGroup')"
|
|
253
|
-
icon="filter-add-group"
|
|
254
|
-
[svgIcon]="filterAddGroupIcon"
|
|
255
|
-
(click)="addFilterGroup()">
|
|
256
|
-
{{messageFor('addGroup')}}
|
|
257
|
-
</button>
|
|
258
|
-
|
|
259
|
-
<button
|
|
260
|
-
kendoButton
|
|
261
|
-
class="k-toolbar-button"
|
|
262
|
-
tabindex="-1"
|
|
263
|
-
icon="x"
|
|
264
|
-
[svgIcon]="xIcon"
|
|
265
|
-
fillMode="flat"
|
|
266
|
-
[title]="messageFor('remove')"
|
|
267
|
-
(click)="removeFilterGroup()">
|
|
268
|
-
</button>
|
|
269
|
-
</div>
|
|
270
|
-
</div>
|
|
271
|
-
|
|
272
|
-
@if (currentItem.filters) {
|
|
273
|
-
<ul class="k-filter-lines" role="group">
|
|
274
|
-
@for (item of currentItem.filters; track $index; let i = $index) {
|
|
275
|
-
@if (!item['filters']) {
|
|
276
|
-
<li class="k-filter-item" role="treeitem">
|
|
277
|
-
<kendo-filter-expression (valueChange)="handleExpressionValueChange($event)" [currentItem]="item" [index]="i">
|
|
278
|
-
</kendo-filter-expression>
|
|
279
|
-
</li>
|
|
280
|
-
}
|
|
281
|
-
@if (item['filters']) {
|
|
282
|
-
<li class="k-filter-item" role="treeitem">
|
|
283
|
-
<kendo-filter-group
|
|
284
|
-
(valueChange)="valueChange.emit($event)"
|
|
285
|
-
[currentItem]="item"
|
|
286
|
-
[index]="i"
|
|
287
|
-
>
|
|
288
|
-
</kendo-filter-group>
|
|
289
|
-
</li>
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
</ul>
|
|
293
|
-
}
|
|
294
|
-
`,
|
|
295
|
-
standalone: true,
|
|
296
|
-
imports: [ButtonComponent, NgClass, FilterExpressionComponent]
|
|
297
|
-
}]
|
|
298
|
-
}], ctorParameters: () => [{ type: i1.FilterService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i2.NavigationService }, { type: i3.LocalizationService }, { type: i0.Renderer2 }], propDecorators: { _filterItems: [{
|
|
299
|
-
type: ViewChildren,
|
|
300
|
-
args: [FilterItem]
|
|
301
|
-
}], currentItem: [{
|
|
302
|
-
type: Input
|
|
303
|
-
}] } });
|