@progress/kendo-angular-grid 19.0.0-develop.17 → 19.0.0-develop.18

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.
Files changed (70) hide show
  1. package/adaptiveness/adaptive-mode.d.ts +12 -0
  2. package/adaptiveness/adaptive-renderer.component.d.ts +84 -0
  3. package/column-menu/column-chooser.component.d.ts +4 -0
  4. package/column-menu/column-list.component.d.ts +9 -3
  5. package/column-menu/column-menu-item.component.d.ts +38 -2
  6. package/column-menu/column-menu-item.directive.d.ts +5 -2
  7. package/column-menu/column-menu.component.d.ts +4 -2
  8. package/common/adaptiveness.service.d.ts +50 -0
  9. package/common/single-popup.service.d.ts +3 -1
  10. package/directives.d.ts +1 -1
  11. package/editing-directives/external-editing.directive.d.ts +3 -1
  12. package/esm2022/adaptiveness/adaptive-mode.mjs +5 -0
  13. package/esm2022/adaptiveness/adaptive-renderer.component.mjs +1106 -0
  14. package/esm2022/column-menu/column-chooser.component.mjs +13 -11
  15. package/esm2022/column-menu/column-list.component.mjs +42 -8
  16. package/esm2022/column-menu/column-menu-autosize-all.component.mjs +1 -1
  17. package/esm2022/column-menu/column-menu-autosize.component.mjs +1 -1
  18. package/esm2022/column-menu/column-menu-chooser.component.mjs +1 -1
  19. package/esm2022/column-menu/column-menu-container.component.mjs +1 -1
  20. package/esm2022/column-menu/column-menu-filter.component.mjs +1 -1
  21. package/esm2022/column-menu/column-menu-item.component.mjs +106 -11
  22. package/esm2022/column-menu/column-menu-item.directive.mjs +14 -5
  23. package/esm2022/column-menu/column-menu-lock.component.mjs +1 -1
  24. package/esm2022/column-menu/column-menu-position.component.mjs +1 -1
  25. package/esm2022/column-menu/column-menu-sort.component.mjs +1 -1
  26. package/esm2022/column-menu/column-menu-stick.component.mjs +1 -1
  27. package/esm2022/column-menu/column-menu.component.mjs +60 -41
  28. package/esm2022/common/adaptiveness.service.mjs +72 -0
  29. package/esm2022/common/single-popup.service.mjs +9 -3
  30. package/esm2022/directives.mjs +1 -1
  31. package/esm2022/editing-directives/external-editing.directive.mjs +28 -14
  32. package/esm2022/filtering/menu/boolean-filter-menu.component.mjs +2 -2
  33. package/esm2022/filtering/menu/date-filter-menu-input.component.mjs +2 -0
  34. package/esm2022/filtering/menu/date-filter-menu.component.mjs +4 -0
  35. package/esm2022/filtering/menu/filter-menu-container.component.mjs +21 -10
  36. package/esm2022/filtering/menu/filter-menu-input-wrapper.component.mjs +24 -4
  37. package/esm2022/filtering/menu/filter-menu.component.mjs +44 -29
  38. package/esm2022/filtering/menu/numeric-filter-menu.component.mjs +4 -0
  39. package/esm2022/filtering/menu/string-filter-menu.component.mjs +4 -0
  40. package/esm2022/grid.component.mjs +143 -28
  41. package/esm2022/grid.module.mjs +1 -1
  42. package/esm2022/index.mjs +1 -1
  43. package/esm2022/localization/messages.mjs +62 -2
  44. package/esm2022/package-metadata.mjs +2 -2
  45. package/esm2022/rendering/toolbar/tools/column-chooser-tool.directive.mjs +203 -0
  46. package/esm2022/rendering/toolbar/tools/filter-command-tool.directive.mjs +39 -26
  47. package/esm2022/rendering/toolbar/tools/filter-tool-wrapper.component.mjs +19 -7
  48. package/esm2022/rendering/toolbar/tools/filter-toolbar-tool.component.mjs +26 -4
  49. package/esm2022/rendering/toolbar/tools/sort-command-tool.directive.mjs +21 -8
  50. package/esm2022/rendering/toolbar/tools/sort-toolbar-tool.component.mjs +16 -3
  51. package/esm2022/utils.mjs +0 -13
  52. package/fesm2022/progress-kendo-angular-grid.mjs +2960 -1360
  53. package/filtering/menu/date-filter-menu-input.component.d.ts +1 -1
  54. package/filtering/menu/filter-menu-container.component.d.ts +14 -4
  55. package/filtering/menu/filter-menu-input-wrapper.component.d.ts +8 -3
  56. package/filtering/menu/filter-menu.component.d.ts +6 -3
  57. package/grid.component.d.ts +30 -3
  58. package/grid.module.d.ts +1 -1
  59. package/index.d.ts +1 -1
  60. package/localization/messages.d.ts +42 -2
  61. package/package.json +21 -20
  62. package/{column-menu → rendering/toolbar/tools}/column-chooser-tool.directive.d.ts +13 -3
  63. package/rendering/toolbar/tools/filter-command-tool.directive.d.ts +3 -1
  64. package/rendering/toolbar/tools/filter-tool-wrapper.component.d.ts +5 -5
  65. package/rendering/toolbar/tools/filter-toolbar-tool.component.d.ts +4 -1
  66. package/rendering/toolbar/tools/sort-command-tool.directive.d.ts +3 -1
  67. package/rendering/toolbar/tools/sort-toolbar-tool.component.d.ts +4 -0
  68. package/schematics/ngAdd/index.js +4 -4
  69. package/utils.d.ts +0 -4
  70. package/esm2022/column-menu/column-chooser-tool.directive.mjs +0 -160
@@ -10,36 +10,52 @@ import { FilterInputWrapperComponent } from "../filter-input-wrapper.component";
10
10
  import { replaceMessagePlaceholder } from '../../utils';
11
11
  import { ContextService } from '../../common/provider.service';
12
12
  import { FilterMenuDropDownListDirective } from './filter-menu-dropdownlist.directive';
13
+ import { AdaptiveGridService } from '../../common/adaptiveness.service';
14
+ import { Subscription } from 'rxjs';
13
15
  import * as i0 from "@angular/core";
14
16
  import * as i1 from "../../common/provider.service";
17
+ import * as i2 from "../../common/adaptiveness.service";
15
18
  /**
16
19
  * @hidden
17
20
  */
18
21
  export class FilterMenuInputWrapperComponent extends FilterInputWrapperComponent {
19
22
  ctx;
23
+ adaptiveGridService;
20
24
  filterService;
21
25
  isFirstDropDown;
22
26
  menuTabbingService;
23
27
  firstOperatorDropDown;
24
28
  _currentFilter;
29
+ subs = new Subscription();
25
30
  /**
26
31
  * @hidden
27
32
  */
28
33
  get hostClasses() {
29
34
  return false;
30
35
  }
31
- constructor(ctx) {
36
+ constructor(ctx, adaptiveGridService) {
32
37
  super(null);
33
38
  this.ctx = ctx;
39
+ this.adaptiveGridService = adaptiveGridService;
34
40
  }
35
41
  ngAfterViewInit() {
36
42
  const shouldFocusFirstFocusable = this.isFirstDropDown && this.filterService?.menuTabbingService;
37
43
  const isTabbedInterface = this.menuTabbingService?.isTabbedInterface;
38
44
  if (shouldFocusFirstFocusable && !isTabbedInterface) {
39
45
  this.filterService.menuTabbingService.firstFocusable = this.firstOperatorDropDown;
40
- this.firstOperatorDropDown.focus();
46
+ if (this.ctx.grid?.isActionSheetExpanded) {
47
+ this.subs.add(this.adaptiveGridService.animationEnd.subscribe(() => {
48
+ this.firstOperatorDropDown.focus();
49
+ }));
50
+ }
51
+ else {
52
+ this.firstOperatorDropDown.focus();
53
+ }
41
54
  }
42
55
  }
56
+ ngOnDestroy() {
57
+ this.subs?.unsubscribe();
58
+ }
43
59
  operatorChange(dataItem) {
44
60
  this.currentOperator = dataItem;
45
61
  }
@@ -85,10 +101,12 @@ export class FilterMenuInputWrapperComponent extends FilterInputWrapperComponent
85
101
  const columnName = this.column ? this.column.title || this.column.field : '';
86
102
  return replaceMessagePlaceholder(localizationMsg, 'columnName', columnName);
87
103
  }
88
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterMenuInputWrapperComponent, deps: [{ token: i1.ContextService }], target: i0.ɵɵFactoryTarget.Component });
104
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterMenuInputWrapperComponent, deps: [{ token: i1.ContextService }, { token: i2.AdaptiveGridService }], target: i0.ɵɵFactoryTarget.Component });
89
105
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FilterMenuInputWrapperComponent, isStandalone: true, selector: "kendo-grid-filter-menu-input-wrapper", inputs: { filterService: "filterService", isFirstDropDown: "isFirstDropDown", menuTabbingService: "menuTabbingService", currentFilter: "currentFilter" }, viewQueries: [{ propertyName: "firstOperatorDropDown", first: true, predicate: DropDownListComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: `
90
106
  <kendo-dropdownlist
91
107
  kendoFilterMenuDropDown
108
+ [adaptiveTitle]="ctx.localization.get('adaptiveFilterOperatorsTitle')"
109
+ [adaptiveMode]="ctx.grid?.adaptiveMode"
92
110
  [filterMenuDropDownLabel]="filterMenuDropDownLabel"
93
111
  [data]="operators"
94
112
  (valueChange)="operatorChange($event)"
@@ -108,6 +126,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
108
126
  template: `
109
127
  <kendo-dropdownlist
110
128
  kendoFilterMenuDropDown
129
+ [adaptiveTitle]="ctx.localization.get('adaptiveFilterOperatorsTitle')"
130
+ [adaptiveMode]="ctx.grid?.adaptiveMode"
111
131
  [filterMenuDropDownLabel]="filterMenuDropDownLabel"
112
132
  [data]="operators"
113
133
  (valueChange)="operatorChange($event)"
@@ -122,7 +142,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
122
142
  standalone: true,
123
143
  imports: [DropDownListComponent, FilterMenuDropDownListDirective]
124
144
  }]
125
- }], ctorParameters: function () { return [{ type: i1.ContextService }]; }, propDecorators: { filterService: [{
145
+ }], ctorParameters: function () { return [{ type: i1.ContextService }, { type: i2.AdaptiveGridService }]; }, propDecorators: { filterService: [{
126
146
  type: Input
127
147
  }], isFirstDropDown: [{
128
148
  type: Input
@@ -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 { NavigationService } from './../../navigation/navigation.service';
6
- import { ChangeDetectorRef, Component, ElementRef, Input, Optional, Renderer2, TemplateRef, ViewChild } from '@angular/core';
6
+ import { ChangeDetectorRef, Component, ElementRef, Input, NgZone, Optional, Renderer2, TemplateRef, ViewChild } from '@angular/core';
7
7
  import { FilterService } from "../filter.service";
8
8
  import { ColumnComponent } from '../../columns/column.component';
9
9
  import { SinglePopupService } from '../../common/single-popup.service';
@@ -14,12 +14,14 @@ import { ContextService } from '../../common/provider.service';
14
14
  import { IdService } from '../../common/id.service';
15
15
  import { FilterMenuContainerComponent } from './filter-menu-container.component';
16
16
  import { IconWrapperComponent } from '@progress/kendo-angular-icons';
17
+ import { AdaptiveGridService } from '../../common/adaptiveness.service';
17
18
  import * as i0 from "@angular/core";
18
19
  import * as i1 from "../filter.service";
19
20
  import * as i2 from "../../common/single-popup.service";
20
21
  import * as i3 from "../../common/provider.service";
21
22
  import * as i4 from "./../../navigation/navigation.service";
22
- import * as i5 from "../../common/id.service";
23
+ import * as i5 from "../../common/adaptiveness.service";
24
+ import * as i6 from "../../common/id.service";
23
25
  let id = 0;
24
26
  const getId = (gridId) => `${gridId}-filter-menu-${id++}`;
25
27
  /**
@@ -32,6 +34,8 @@ export class FilterMenuComponent {
32
34
  navigationService;
33
35
  renderer;
34
36
  cdr;
37
+ adaptiveGridService;
38
+ zone;
35
39
  idService;
36
40
  filterIcon = filterIcon;
37
41
  /**
@@ -49,13 +53,15 @@ export class FilterMenuComponent {
49
53
  tabIndex = '-1';
50
54
  popupRef;
51
55
  popupSubs;
52
- constructor(filterService, popupService, ctx, navigationService, renderer, cdr, idService) {
56
+ constructor(filterService, popupService, ctx, navigationService, renderer, cdr, adaptiveGridService, zone, idService) {
53
57
  this.filterService = filterService;
54
58
  this.popupService = popupService;
55
59
  this.ctx = ctx;
56
60
  this.navigationService = navigationService;
57
61
  this.renderer = renderer;
58
62
  this.cdr = cdr;
63
+ this.adaptiveGridService = adaptiveGridService;
64
+ this.zone = zone;
59
65
  this.idService = idService;
60
66
  }
61
67
  ngOnDestroy() {
@@ -79,32 +85,41 @@ export class FilterMenuComponent {
79
85
  return this.navigationService.tableEnabled;
80
86
  }
81
87
  toggle(anchor, template) {
82
- this.popupRef = this.popupService.open(anchor, template, this.popupRef);
83
- // Needed as changes to 'popupRef' are not reflected
84
- // automatically when the Popup is closed by clicking outside the anchor
85
- const ariaRoot = this.isNavigable ? anchor.closest('.k-table-th') : anchor;
86
- if (this.popupRef) {
87
- this.popupSubs?.unsubscribe();
88
- this.popupSubs = this.popupRef.popup.instance.anchorViewportLeave.subscribe(() => {
89
- this.close();
90
- this.updateAria(ariaRoot);
91
- });
92
- this.popupSubs.add(() => this.popupRef.popup.instance.close.subscribe(() => {
93
- this.popupRef = null;
94
- this.updateAria(ariaRoot);
95
- }));
96
- const popupAriaElement = this.popupRef.popupElement.querySelector('.k-grid-filter-popup');
97
- if (popupAriaElement) {
98
- const popupId = getId(this.idService?.gridId());
99
- this.renderer.setAttribute(popupAriaElement, 'id', popupId);
100
- this.renderer.setAttribute(popupAriaElement, 'role', 'dialog');
101
- this.renderer.setAttribute(popupAriaElement, 'aria-label', this.filterLabel);
102
- ariaRoot && this.renderer.setAttribute(ariaRoot, 'aria-controls', popupId);
103
- ariaRoot && this.renderer.setAttribute(ariaRoot, 'aria-expanded', 'true');
88
+ if (this.ctx.grid?.adaptiveMode === 'auto' && this.adaptiveGridService.windowSize !== 'large') {
89
+ if (!this.ctx.grid.isActionSheetExpanded) {
90
+ this.adaptiveGridService.viewType = 'filterMenu';
91
+ this.adaptiveGridService.column = this.column;
92
+ this.ctx.grid.adaptiveRenderer.actionSheet.toggle(true);
104
93
  }
105
94
  }
106
95
  else {
107
- this.focusRoot();
96
+ this.popupRef = this.popupService.open(anchor, template, this.popupRef);
97
+ // Needed as changes to 'popupRef' are not reflected
98
+ // automatically when the Popup is closed by clicking outside the anchor
99
+ const ariaRoot = this.isNavigable ? anchor.closest('.k-table-th') : anchor;
100
+ if (this.popupRef) {
101
+ this.popupSubs?.unsubscribe();
102
+ this.popupSubs = this.popupRef.popup.instance.anchorViewportLeave.subscribe(() => {
103
+ this.close();
104
+ this.updateAria(ariaRoot);
105
+ });
106
+ this.popupSubs.add(() => this.popupRef.popup.instance.close.subscribe(() => {
107
+ this.popupRef = null;
108
+ this.updateAria(ariaRoot);
109
+ }));
110
+ const popupAriaElement = this.popupRef.popupElement.querySelector('.k-grid-filter-popup');
111
+ if (popupAriaElement) {
112
+ const popupId = getId(this.idService?.gridId());
113
+ this.renderer.setAttribute(popupAriaElement, 'id', popupId);
114
+ this.renderer.setAttribute(popupAriaElement, 'role', 'dialog');
115
+ this.renderer.setAttribute(popupAriaElement, 'aria-label', this.filterLabel);
116
+ ariaRoot && this.renderer.setAttribute(ariaRoot, 'aria-controls', popupId);
117
+ ariaRoot && this.renderer.setAttribute(ariaRoot, 'aria-expanded', 'true');
118
+ }
119
+ }
120
+ else {
121
+ this.focusRoot();
122
+ }
108
123
  }
109
124
  return false;
110
125
  }
@@ -126,7 +141,7 @@ export class FilterMenuComponent {
126
141
  focusRoot() {
127
142
  this.isNavigable ? this.navigationService.focusCell(0, this.column.leafIndex) : this.anchor.nativeElement.focus();
128
143
  }
129
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterMenuComponent, deps: [{ token: i1.FilterService }, { token: i2.SinglePopupService }, { token: i3.ContextService }, { token: i4.NavigationService }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i5.IdService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
144
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterMenuComponent, deps: [{ token: i1.FilterService }, { token: i2.SinglePopupService }, { token: i3.ContextService }, { token: i4.NavigationService }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i5.AdaptiveGridService }, { token: i0.NgZone }, { token: i6.IdService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
130
145
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FilterMenuComponent, isStandalone: true, selector: "kendo-grid-filter-menu", inputs: { column: "column", filter: "filter", tabIndex: "tabIndex" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true, static: true }, { propertyName: "template", first: true, predicate: ["template"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: `
131
146
  <a #anchor
132
147
  class="k-grid-filter-menu k-grid-header-menu"
@@ -183,9 +198,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
183
198
  </ng-template>
184
199
  `,
185
200
  standalone: true,
186
- imports: [IconWrapperComponent, FilterMenuContainerComponent]
201
+ imports: [IconWrapperComponent, FilterMenuContainerComponent],
187
202
  }]
188
- }], ctorParameters: function () { return [{ type: i1.FilterService }, { type: i2.SinglePopupService }, { type: i3.ContextService }, { type: i4.NavigationService }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i5.IdService, decorators: [{
203
+ }], ctorParameters: function () { return [{ type: i1.FilterService }, { type: i2.SinglePopupService }, { type: i3.ContextService }, { type: i4.NavigationService }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i5.AdaptiveGridService }, { type: i0.NgZone }, { type: i6.IdService, decorators: [{
189
204
  type: Optional
190
205
  }] }]; }, propDecorators: { column: [{
191
206
  type: Input
@@ -116,6 +116,8 @@ export class NumericFilterMenuComponent extends NumericFilterComponent {
116
116
  <kendo-dropdownlist
117
117
  *ngIf="extra"
118
118
  kendoFilterMenuDropDown
119
+ [adaptiveTitle]="ctx.localization.get('adaptiveFilterOperatorsTitle')"
120
+ [adaptiveMode]="ctx.grid?.adaptiveMode"
119
121
  [filterMenuDropDownLabel]="filterMenuDropDownLabel"
120
122
  class="k-filter-and"
121
123
  [data]="logicOperators"
@@ -168,6 +170,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
168
170
  <kendo-dropdownlist
169
171
  *ngIf="extra"
170
172
  kendoFilterMenuDropDown
173
+ [adaptiveTitle]="ctx.localization.get('adaptiveFilterOperatorsTitle')"
174
+ [adaptiveMode]="ctx.grid?.adaptiveMode"
171
175
  [filterMenuDropDownLabel]="filterMenuDropDownLabel"
172
176
  class="k-filter-and"
173
177
  [data]="logicOperators"
@@ -103,6 +103,8 @@ export class StringFilterMenuComponent extends StringFilterComponent {
103
103
  <kendo-dropdownlist
104
104
  *ngIf="extra"
105
105
  kendoFilterMenuDropDown
106
+ [adaptiveTitle]="ctx.localization.get('adaptiveFilterOperatorsTitle')"
107
+ [adaptiveMode]="ctx.grid?.adaptiveMode"
106
108
  [filterMenuDropDownLabel]="filterMenuDropDownLabel"
107
109
  class="k-filter-and"
108
110
  [data]="logicOperators"
@@ -141,6 +143,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
141
143
  <kendo-dropdownlist
142
144
  *ngIf="extra"
143
145
  kendoFilterMenuDropDown
146
+ [adaptiveTitle]="ctx.localization.get('adaptiveFilterOperatorsTitle')"
147
+ [adaptiveMode]="ctx.grid?.adaptiveMode"
144
148
  [filterMenuDropDownLabel]="filterMenuDropDownLabel"
145
149
  class="k-filter-and"
146
150
  [data]="logicOperators"