@progress/kendo-angular-filter 25.4.0-develop.10 → 25.4.0-develop.11

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.
@@ -3,7 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as i0 from '@angular/core';
6
- import { signal, Injectable, Directive, ContentChild, Input, Component, EventEmitter, Output, afterNextRender, ChangeDetectionStrategy, isDevMode, forwardRef, ViewChildren, ContentChildren, HostBinding, HostListener, NgModule } from '@angular/core';
6
+ import { signal, Injectable, Directive, ContentChild, Input, Component, EventEmitter, Output, afterNextRender, ChangeDetectionStrategy, computed, isDevMode, forwardRef, ViewChildren, ContentChildren, HostBinding, HostListener, NgModule } from '@angular/core';
7
7
  import * as i1 from '@progress/kendo-angular-l10n';
8
8
  import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
9
9
  import { validatePackage } from '@progress/kendo-licensing';
@@ -54,6 +54,13 @@ class FilterService {
54
54
  }
55
55
  parentItem.filters.forEach((filter) => filter.filters && this.remove(item, positionIndex, filter));
56
56
  }
57
+ replace(item, newItem, positionIndex, parentItem = this.normalizedValue) {
58
+ if (parentItem.filters[positionIndex] === item) {
59
+ parentItem.filters[positionIndex] = newItem;
60
+ return true;
61
+ }
62
+ return parentItem.filters.some((filter) => filter.filters && this.replace(item, newItem, positionIndex, filter));
63
+ }
57
64
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
58
65
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FilterService });
59
66
  }
@@ -238,8 +245,8 @@ const packageMetadata = {
238
245
  productName: 'Kendo UI for Angular',
239
246
  productCode: 'KENDOUIANGULAR',
240
247
  productCodes: ['KENDOUIANGULAR'],
241
- publishDate: 1792514098,
242
- version: '25.4.0-develop.10',
248
+ publishDate: 1792569451,
249
+ version: '25.4.0-develop.11',
243
250
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
244
251
  };
245
252
 
@@ -1184,11 +1191,8 @@ class FilterExpressionComponent extends BaseFilterRowComponent {
1184
1191
  set currentItem(value) {
1185
1192
  const previousField = this._currentItem()?.field;
1186
1193
  this._currentItem.set(value);
1187
- if (value) {
1188
- this._previousField = value.field;
1189
- if (this._initialized && value.field && value.field !== previousField) {
1190
- this.applyFieldChange(value.field);
1191
- }
1194
+ if (value && this._initialized && value.field && value.field !== previousField) {
1195
+ this.applyFieldChange(value.field);
1192
1196
  }
1193
1197
  }
1194
1198
  get currentItem() {
@@ -1254,7 +1258,19 @@ class FilterExpressionComponent extends BaseFilterRowComponent {
1254
1258
  }
1255
1259
  return this.editorFormat;
1256
1260
  }
1257
- _previousField;
1261
+ // Handles field writes from field templates in the user's event handler, not during change detection.
1262
+ fieldTemplateItem = computed(() => new Proxy(this._currentItem(), {
1263
+ get: (_target, property) => this.currentItem[property],
1264
+ set: (_target, property, value) => {
1265
+ if (property === 'field') {
1266
+ this.onTemplateFieldChange(value);
1267
+ }
1268
+ else {
1269
+ this.currentItem[property] = value;
1270
+ }
1271
+ return true;
1272
+ }
1273
+ }), ...(ngDevMode ? [{ debugName: "fieldTemplateItem" }] : []));
1258
1274
  _initialized = false;
1259
1275
  _currentItem = signal(undefined, ...(ngDevMode ? [{ debugName: "_currentItem" }] : []));
1260
1276
  _operators = signal([], ...(ngDevMode ? [{ debugName: "_operators" }] : []));
@@ -1290,17 +1306,7 @@ class FilterExpressionComponent extends BaseFilterRowComponent {
1290
1306
  this.filterService = filterService;
1291
1307
  this.cdr = cdr;
1292
1308
  }
1293
- ngDoCheck() {
1294
- if (this.fieldTemplate && this.currentItem) {
1295
- const currentField = this.currentItem.field;
1296
- if (currentField && currentField !== this._previousField) {
1297
- this._previousField = currentField;
1298
- this.filterValueChange(currentField);
1299
- }
1300
- }
1301
- }
1302
1309
  ngOnInit() {
1303
- this._previousField = this.currentItem.field;
1304
1310
  this.isEditorDisabled = nullOperators.indexOf(this.currentItem.operator) >= 0;
1305
1311
  const foundFilter = this.getFilterExpressionByField(this.currentItem.field);
1306
1312
  if (this.currentItem.field) {
@@ -1346,11 +1352,18 @@ class FilterExpressionComponent extends BaseFilterRowComponent {
1346
1352
  this.applyFieldChange(value);
1347
1353
  this.valueChange.emit();
1348
1354
  }
1355
+ onTemplateFieldChange(field) {
1356
+ if (!field || field === this.currentItem.field) {
1357
+ return;
1358
+ }
1359
+ this.filterValueChange(field);
1360
+ }
1349
1361
  applyFieldChange(field) {
1350
1362
  const current = this._currentItem();
1351
1363
  current.value = null;
1352
- this._currentItem.set({ ...current });
1353
- this._previousField = field;
1364
+ const updated = { ...current };
1365
+ this.filterService.replace(current, updated, this.index);
1366
+ this._currentItem.set(updated);
1354
1367
  this.setTemplates();
1355
1368
  const foundFilter = this.getFilterExpressionByField(field);
1356
1369
  this.setOperators(foundFilter);
@@ -1428,7 +1441,7 @@ class FilterExpressionComponent extends BaseFilterRowComponent {
1428
1441
  @if (fieldTemplate) {
1429
1442
  <ng-container
1430
1443
  [ngTemplateOutlet]="fieldTemplate"
1431
- [ngTemplateOutletContext]="{$implicit: currentItem, filters: availableFilters}">
1444
+ [ngTemplateOutletContext]="{$implicit: fieldTemplateItem(), filters: availableFilters}">
1432
1445
  </ng-container>
1433
1446
  } @else {
1434
1447
  <kendo-dropdownlist
@@ -1512,7 +1525,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImpo
1512
1525
  @if (fieldTemplate) {
1513
1526
  <ng-container
1514
1527
  [ngTemplateOutlet]="fieldTemplate"
1515
- [ngTemplateOutletContext]="{$implicit: currentItem, filters: availableFilters}">
1528
+ [ngTemplateOutletContext]="{$implicit: fieldTemplateItem(), filters: availableFilters}">
1516
1529
  </ng-container>
1517
1530
  } @else {
1518
1531
  <kendo-dropdownlist
package/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as i0 from '@angular/core';
6
- import { TemplateRef, ChangeDetectorRef, Renderer2, OnInit, AfterContentInit, OnDestroy, EventEmitter, ElementRef, Injector, DoCheck } from '@angular/core';
6
+ import { TemplateRef, ChangeDetectorRef, Renderer2, OnInit, AfterContentInit, OnDestroy, EventEmitter, ElementRef, Injector } from '@angular/core';
7
7
  import { LocalizationService, ComponentMessages } from '@progress/kendo-angular-l10n';
8
8
  import { CompositeFilterDescriptor, FilterDescriptor } from '@progress/kendo-data-query';
9
9
  import { FormatSettings } from '@progress/kendo-angular-dateinputs';
@@ -116,6 +116,7 @@ declare class FilterService {
116
116
  addFilterGroup(item: CompositeFilterDescriptor): void;
117
117
  addFilterExpression(item: CompositeFilterDescriptor): void;
118
118
  remove(item: CompositeFilterDescriptor | FilterDescriptor, positionIndex: number, parentItem?: CompositeFilterDescriptor): void;
119
+ replace(item: FilterDescriptor, newItem: FilterDescriptor, positionIndex: number, parentItem?: CompositeFilterDescriptor): boolean;
119
120
  static ɵfac: i0.ɵɵFactoryDeclaration<FilterService, never>;
120
121
  static ɵprov: i0.ɵɵInjectableDeclaration<FilterService>;
121
122
  }
@@ -925,7 +926,7 @@ declare class FilterExpressionOperatorsComponent {
925
926
  /**
926
927
  * @hidden
927
928
  */
928
- declare class FilterExpressionComponent extends BaseFilterRowComponent implements OnInit, DoCheck {
929
+ declare class FilterExpressionComponent extends BaseFilterRowComponent implements OnInit {
929
930
  private filterService;
930
931
  private cdr;
931
932
  /**
@@ -953,7 +954,7 @@ declare class FilterExpressionComponent extends BaseFilterRowComponent implement
953
954
  private get currentFilterExpression();
954
955
  get numericEditorFormat(): string | NumberFormat;
955
956
  get dateEditorFormat(): string | DateFormat;
956
- private _previousField;
957
+ fieldTemplateItem: i0.Signal<FilterDescriptor>;
957
958
  private _initialized;
958
959
  private _currentItem;
959
960
  private _operators;
@@ -965,7 +966,6 @@ declare class FilterExpressionComponent extends BaseFilterRowComponent implement
965
966
  private isNumberFormat;
966
967
  private isDateFormat;
967
968
  constructor(filterService: FilterService, element: ElementRef, navigationService: NavigationService, localization: LocalizationService, renderer: Renderer2, cdr: ChangeDetectorRef);
968
- ngDoCheck(): void;
969
969
  ngOnInit(): void;
970
970
  normalizeOperators(filterEditor: FilterEditor, operators: FilterOperator[]): {
971
971
  text: string;
@@ -973,6 +973,7 @@ declare class FilterExpressionComponent extends BaseFilterRowComponent implement
973
973
  }[];
974
974
  getFilterExpressionByField(name: string): FilterExpression | null;
975
975
  filterValueChange(value: string): void;
976
+ private onTemplateFieldChange;
976
977
  private applyFieldChange;
977
978
  protected getDefaultOperators(operatorsType: FilterEditor): {
978
979
  text: string;
@@ -7,7 +7,7 @@ export const packageMetadata = {
7
7
  "productCodes": [
8
8
  "KENDOUIANGULAR"
9
9
  ],
10
- "publishDate": 1792514098,
11
- "version": "25.4.0-develop.10",
10
+ "publishDate": 1792569451,
11
+ "version": "25.4.0-develop.11",
12
12
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-filter",
3
- "version": "25.4.0-develop.10",
3
+ "version": "25.4.0-develop.11",
4
4
  "description": "Kendo UI Angular Filter",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -32,7 +32,7 @@
32
32
  "package": {
33
33
  "productName": "Kendo UI for Angular",
34
34
  "productCode": "KENDOUIANGULAR",
35
- "publishDate": 1792514098,
35
+ "publishDate": 1792569451,
36
36
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
37
37
  }
38
38
  },
@@ -43,20 +43,20 @@
43
43
  "@angular/platform-browser": "20 - 22",
44
44
  "@progress/kendo-data-query": "^1.7.3",
45
45
  "@progress/kendo-licensing": "^1.11.0",
46
- "@progress/kendo-angular-buttons": "25.4.0-develop.10",
47
- "@progress/kendo-angular-common": "25.4.0-develop.10",
48
- "@progress/kendo-angular-dateinputs": "25.4.0-develop.10",
49
- "@progress/kendo-angular-dropdowns": "25.4.0-develop.10",
50
- "@progress/kendo-angular-inputs": "25.4.0-develop.10",
51
- "@progress/kendo-angular-intl": "25.4.0-develop.10",
52
- "@progress/kendo-angular-l10n": "25.4.0-develop.10",
53
- "@progress/kendo-angular-icons": "25.4.0-develop.10",
54
- "@progress/kendo-angular-label": "25.4.0-develop.10",
46
+ "@progress/kendo-angular-buttons": "25.4.0-develop.11",
47
+ "@progress/kendo-angular-common": "25.4.0-develop.11",
48
+ "@progress/kendo-angular-dateinputs": "25.4.0-develop.11",
49
+ "@progress/kendo-angular-dropdowns": "25.4.0-develop.11",
50
+ "@progress/kendo-angular-inputs": "25.4.0-develop.11",
51
+ "@progress/kendo-angular-intl": "25.4.0-develop.11",
52
+ "@progress/kendo-angular-l10n": "25.4.0-develop.11",
53
+ "@progress/kendo-angular-icons": "25.4.0-develop.11",
54
+ "@progress/kendo-angular-label": "25.4.0-develop.11",
55
55
  "rxjs": "^6.5.3 || ^7.0.0"
56
56
  },
57
57
  "dependencies": {
58
58
  "tslib": "^2.3.1",
59
- "@progress/kendo-angular-schematics": "25.4.0-develop.10"
59
+ "@progress/kendo-angular-schematics": "25.4.0-develop.11"
60
60
  },
61
61
  "schematics": "./schematics/collection.json",
62
62
  "module": "fesm2022/progress-kendo-angular-filter.mjs",
@@ -9,12 +9,12 @@ const schematics_1 = require("@angular-devkit/schematics");
9
9
  function default_1(options) {
10
10
  const finalOptions = Object.assign(Object.assign({}, options), { mainNgModule: 'FilterModule', package: 'filter', peerDependencies: {
11
11
  // peer deps of the dropdowns
12
- '@progress/kendo-angular-treeview': '25.4.0-develop.10',
13
- '@progress/kendo-angular-popup': '25.4.0-develop.10',
14
- '@progress/kendo-angular-navigation': '25.4.0-develop.10',
12
+ '@progress/kendo-angular-treeview': '25.4.0-develop.11',
13
+ '@progress/kendo-angular-popup': '25.4.0-develop.11',
14
+ '@progress/kendo-angular-navigation': '25.4.0-develop.11',
15
15
  // peer dependency of kendo-angular-inputs
16
16
  '@progress/kendo-drawing': '^1.16.0',
17
- '@progress/kendo-angular-dialog': '25.4.0-develop.10',
17
+ '@progress/kendo-angular-dialog': '25.4.0-develop.11',
18
18
  // Peer dependency of icons
19
19
  '@progress/kendo-svg-icons': '^4.0.0'
20
20
  } });