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

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 (69) 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 +68 -44
  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/{column-menu → rendering/toolbar/tools}/column-chooser-tool.directive.mjs +50 -9
  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 +2947 -1344
  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
@@ -5,17 +5,22 @@
5
5
  import { Directive, NgZone, Input, Renderer2, ChangeDetectorRef } from '@angular/core';
6
6
  import { PopupService } from '@progress/kendo-angular-popup';
7
7
  import { RefreshService, ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
8
- import { ColumnListComponent } from './column-list.component';
9
- import { closest } from '@progress/kendo-angular-common';
8
+ import { ColumnListComponent } from '../../../column-menu/column-list.component';
9
+ import { closest, isPresent } from '@progress/kendo-angular-common';
10
10
  import { Subscription } from 'rxjs';
11
- import { ContextService } from '../common/provider.service';
11
+ import { columnsIcon } from '@progress/kendo-svg-icons';
12
+ import { ContextService } from '../../../common/provider.service';
12
13
  import { filter, take } from 'rxjs/operators';
13
- import { ToolbarToolBase } from '../common/toolbar-tool-base.directive';
14
- import { ToolbarToolName } from '../navigation/toolbar-tool-name';
14
+ import { AdaptiveGridService } from '../../../common/adaptiveness.service';
15
+ import { ColumnInfoService } from '../../../common/column-info.service';
16
+ import { ToolbarToolBase } from '../../../common/toolbar-tool-base.directive';
17
+ import { ToolbarToolName } from '../../../navigation/toolbar-tool-name';
15
18
  import * as i0 from "@angular/core";
16
19
  import * as i1 from "@progress/kendo-angular-popup";
17
20
  import * as i2 from "@progress/kendo-angular-toolbar";
18
- import * as i3 from "../common/provider.service";
21
+ import * as i3 from "../../../common/provider.service";
22
+ import * as i4 from "../../../common/adaptiveness.service";
23
+ import * as i5 from "../../../common/column-info.service";
19
24
  let incrementingId = 0;
20
25
  /**
21
26
  * Represents the `column-chooser` toolbar tool of the Grid.
@@ -38,6 +43,8 @@ export class ColumnChooserToolbarDirective extends ToolbarToolBase {
38
43
  ctx;
39
44
  zone;
40
45
  refresh;
46
+ adaptiveGridService;
47
+ columnInfoService;
41
48
  /**
42
49
  * Specifies if the changes in the visibility of the column will be immediately applied.
43
50
  *
@@ -50,10 +57,16 @@ export class ColumnChooserToolbarDirective extends ToolbarToolBase {
50
57
  * @default true
51
58
  */
52
59
  allowHideAll = true;
60
+ /**
61
+ * @hidden
62
+ */
63
+ get columns() {
64
+ return this.columnInfoService.leafNamedColumns;
65
+ }
53
66
  popupRef;
54
67
  subs = new Subscription();
55
68
  nextId = incrementingId++;
56
- constructor(renderer, popupSerivce, host, ctx, zone, refresh, cdr) {
69
+ constructor(renderer, popupSerivce, host, ctx, zone, refresh, adaptiveGridService, columnInfoService, cdr) {
57
70
  super(host, ToolbarToolName.columns, ctx, zone, cdr);
58
71
  this.renderer = renderer;
59
72
  this.popupSerivce = popupSerivce;
@@ -61,6 +74,21 @@ export class ColumnChooserToolbarDirective extends ToolbarToolBase {
61
74
  this.ctx = ctx;
62
75
  this.zone = zone;
63
76
  this.refresh = refresh;
77
+ this.adaptiveGridService = adaptiveGridService;
78
+ this.columnInfoService = columnInfoService;
79
+ }
80
+ ngOnInit() {
81
+ this.subs.add(this.host.click.subscribe(e => this.onClick(e)));
82
+ const hasToolbarIcon = isPresent(this.host.toolbarOptions.icon) && this.host.toolbarOptions.icon !== '';
83
+ const hasOverflowIcon = isPresent(this.host.overflowOptions.icon) && this.host.overflowOptions.icon !== '';
84
+ const hasIcon = hasToolbarIcon && hasOverflowIcon;
85
+ const hasSvgIcon = isPresent(this.host.toolbarOptions.svgIcon) && isPresent(this.host.overflowOptions.svgIcon);
86
+ if (!hasIcon) {
87
+ this.host.icon = 'columns';
88
+ }
89
+ if (!hasSvgIcon) {
90
+ this.host.svgIcon = columnsIcon;
91
+ }
64
92
  }
65
93
  ngAfterViewInit() {
66
94
  super.ngAfterViewInit();
@@ -84,6 +112,18 @@ export class ColumnChooserToolbarDirective extends ToolbarToolBase {
84
112
  */
85
113
  onClick(e) {
86
114
  e.preventDefault();
115
+ if (this.ctx.grid.adaptiveMode === 'auto' && this.adaptiveGridService.windowSize !== 'large') {
116
+ if (!this.ctx.grid.isActionSheetExpanded) {
117
+ this.adaptiveGridService.viewType = 'columnChooserToolbarTool';
118
+ this.adaptiveGridService.columns = this.columns;
119
+ this.ctx.grid.adaptiveRenderer.actionSheet.toggle(true);
120
+ }
121
+ }
122
+ else {
123
+ this.togglePopup();
124
+ }
125
+ }
126
+ togglePopup() {
87
127
  if (!this.popupRef) {
88
128
  const direction = this.ctx.localization.rtl ? 'right' : 'left';
89
129
  this.popupRef = this.popupSerivce.open({
@@ -93,6 +133,7 @@ export class ColumnChooserToolbarDirective extends ToolbarToolBase {
93
133
  anchorAlign: { vertical: 'bottom', horizontal: direction },
94
134
  popupAlign: { vertical: 'top', horizontal: direction }
95
135
  });
136
+ this.adaptiveGridService.popupRef = this.popupRef;
96
137
  const popupElement = this.popupRef.popupElement;
97
138
  const popupId = `k-column-chooser-tool-${this.nextId}-popup`;
98
139
  const popupAriaElement = popupElement.querySelector('.k-popup');
@@ -144,7 +185,7 @@ export class ColumnChooserToolbarDirective extends ToolbarToolBase {
144
185
  get buttonElement() {
145
186
  return this.host.getButton();
146
187
  }
147
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColumnChooserToolbarDirective, deps: [{ token: i0.Renderer2 }, { token: i1.PopupService }, { token: i2.ToolBarButtonComponent }, { token: i3.ContextService }, { token: i0.NgZone }, { token: i2.RefreshService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
188
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColumnChooserToolbarDirective, deps: [{ token: i0.Renderer2 }, { token: i1.PopupService }, { token: i2.ToolBarButtonComponent }, { token: i3.ContextService }, { token: i0.NgZone }, { token: i2.RefreshService }, { token: i4.AdaptiveGridService }, { token: i5.ColumnInfoService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
148
189
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ColumnChooserToolbarDirective, isStandalone: true, selector: "[kendoGridColumnChooserTool]", inputs: { autoSync: "autoSync", allowHideAll: "allowHideAll" }, usesInheritance: true, ngImport: i0 });
149
190
  }
150
191
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColumnChooserToolbarDirective, decorators: [{
@@ -153,7 +194,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
153
194
  selector: '[kendoGridColumnChooserTool]',
154
195
  standalone: true
155
196
  }]
156
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i1.PopupService }, { type: i2.ToolBarButtonComponent }, { type: i3.ContextService }, { type: i0.NgZone }, { type: i2.RefreshService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { autoSync: [{
197
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i1.PopupService }, { type: i2.ToolBarButtonComponent }, { type: i3.ContextService }, { type: i0.NgZone }, { type: i2.RefreshService }, { type: i4.AdaptiveGridService }, { type: i5.ColumnInfoService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { autoSync: [{
157
198
  type: Input
158
199
  }], allowHideAll: [{
159
200
  type: Input
@@ -13,12 +13,14 @@ import { ColumnInfoService } from '../../../common/column-info.service';
13
13
  import { take } from 'rxjs/operators';
14
14
  import { FilterService } from '../../../filtering/filter.service';
15
15
  import { FilterToolWrapperComponent } from './filter-tool-wrapper.component';
16
+ import { AdaptiveGridService } from '../../../common/adaptiveness.service';
16
17
  import * as i0 from "@angular/core";
17
18
  import * as i1 from "@progress/kendo-angular-toolbar";
18
19
  import * as i2 from "@progress/kendo-angular-popup";
19
20
  import * as i3 from "../../../common/provider.service";
20
21
  import * as i4 from "../../../filtering/filter.service";
21
22
  import * as i5 from "../../../common/column-info.service";
23
+ import * as i6 from "../../../common/adaptiveness.service";
22
24
  let incrementingId = 0;
23
25
  /**
24
26
  * Represents the toolbar tool for filtering columns of the Grid.
@@ -45,12 +47,13 @@ export class FilterCommandToolbarDirective {
45
47
  columnInfoService;
46
48
  ngZone;
47
49
  renderer;
50
+ adaptiveGridService;
48
51
  popupRef;
49
52
  nextId = incrementingId++;
50
53
  toolSubs = new Subscription();
51
54
  popupSubs;
52
55
  removeClickListener;
53
- constructor(host, popupService, ctx, filterService, columnInfoService, ngZone, renderer) {
56
+ constructor(host, popupService, ctx, filterService, columnInfoService, ngZone, renderer, adaptiveGridService) {
54
57
  this.host = host;
55
58
  this.popupService = popupService;
56
59
  this.ctx = ctx;
@@ -58,6 +61,7 @@ export class FilterCommandToolbarDirective {
58
61
  this.columnInfoService = columnInfoService;
59
62
  this.ngZone = ngZone;
60
63
  this.renderer = renderer;
64
+ this.adaptiveGridService = adaptiveGridService;
61
65
  }
62
66
  ngOnInit() {
63
67
  this.toolSubs = this.host.click.subscribe(e => this.onClick(e));
@@ -69,7 +73,7 @@ export class FilterCommandToolbarDirective {
69
73
  const hasIcon = hasToolbarIcon && hasOverflowIcon;
70
74
  const hasSvgIcon = isPresent(this.host.toolbarOptions.svgIcon) && isPresent(this.host.overflowOptions.svgIcon);
71
75
  if (!hasIcon) {
72
- this.host.icon = 'k-i-filter';
76
+ this.host.icon = 'filter';
73
77
  }
74
78
  if (!hasSvgIcon) {
75
79
  this.host.svgIcon = filterIcon;
@@ -111,31 +115,40 @@ export class FilterCommandToolbarDirective {
111
115
  }
112
116
  openPopup() {
113
117
  const direction = this.ctx.localization.rtl ? 'right' : 'left';
114
- this.popupRef = this.popupService.open({
115
- anchor: this.buttonElement,
116
- content: FilterToolWrapperComponent,
117
- popupClass: 'k-grid-columnmenu-popup',
118
- positionMode: 'absolute',
119
- anchorAlign: { vertical: 'bottom', horizontal: direction },
120
- popupAlign: { vertical: 'top', horizontal: direction }
121
- });
122
- this.setPopupAttributes();
123
- this.ngZone.runOutsideAngular(() => {
124
- if (!isDocumentAvailable()) {
125
- return;
118
+ if (this.ctx.grid.adaptiveMode === 'auto' && this.adaptiveGridService.windowSize !== 'large') {
119
+ if (!this.ctx.grid.isActionSheetExpanded) {
120
+ this.adaptiveGridService.viewType = 'filterToolbarTool';
121
+ this.ctx.grid.adaptiveRenderer.actionSheet.toggle(true);
126
122
  }
127
- this.removeClickListener = this.renderer.listen('document', 'click', (e) => {
128
- if (this.popupRef && !closest(e.target, node => node === this.popupRef.popupElement || node === this.buttonElement)) {
129
- this.closePopup();
123
+ }
124
+ else {
125
+ this.popupRef = this.popupService.open({
126
+ anchor: this.buttonElement,
127
+ content: FilterToolWrapperComponent,
128
+ popupClass: 'k-grid-columnmenu-popup',
129
+ positionMode: 'absolute',
130
+ anchorAlign: { vertical: 'bottom', horizontal: direction },
131
+ popupAlign: { vertical: 'top', horizontal: direction }
132
+ });
133
+ this.adaptiveGridService.popupRef = this.popupRef;
134
+ this.setPopupAttributes();
135
+ this.ngZone.runOutsideAngular(() => {
136
+ if (!isDocumentAvailable()) {
137
+ return;
130
138
  }
139
+ this.removeClickListener = this.renderer.listen('document', 'click', (e) => {
140
+ if (this.popupRef && !closest(e.target, node => node === this.popupRef.popupElement || node === this.buttonElement)) {
141
+ this.closePopup();
142
+ }
143
+ });
131
144
  });
132
- });
133
- this.popupSubs = this.popupRef.popup.instance.anchorViewportLeave.subscribe(() => {
134
- this.popupSubs?.unsubscribe();
135
- this.popupSubs = null;
136
- this.closePopup();
137
- });
138
- this.initPopupProperties();
145
+ this.popupSubs = this.popupRef.popup.instance.anchorViewportLeave.subscribe(() => {
146
+ this.popupSubs?.unsubscribe();
147
+ this.popupSubs = null;
148
+ this.closePopup();
149
+ });
150
+ this.initPopupProperties();
151
+ }
139
152
  }
140
153
  setPopupAttributes() {
141
154
  const popupElement = this.popupRef.popupElement;
@@ -175,7 +188,7 @@ export class FilterCommandToolbarDirective {
175
188
  get buttonElement() {
176
189
  return this.host.getButton();
177
190
  }
178
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterCommandToolbarDirective, deps: [{ token: i1.ToolBarButtonComponent }, { token: i2.PopupService }, { token: i3.ContextService }, { token: i4.FilterService }, { token: i5.ColumnInfoService }, { token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
191
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterCommandToolbarDirective, deps: [{ token: i1.ToolBarButtonComponent }, { token: i2.PopupService }, { token: i3.ContextService }, { token: i4.FilterService }, { token: i5.ColumnInfoService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i6.AdaptiveGridService }], target: i0.ɵɵFactoryTarget.Directive });
179
192
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: FilterCommandToolbarDirective, isStandalone: true, selector: "[kendoGridFilterTool]", ngImport: i0 });
180
193
  }
181
194
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterCommandToolbarDirective, decorators: [{
@@ -184,4 +197,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
184
197
  selector: '[kendoGridFilterTool]',
185
198
  standalone: true
186
199
  }]
187
- }], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: i2.PopupService }, { type: i3.ContextService }, { type: i4.FilterService }, { type: i5.ColumnInfoService }, { type: i0.NgZone }, { type: i0.Renderer2 }]; } });
200
+ }], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: i2.PopupService }, { type: i3.ContextService }, { type: i4.FilterService }, { type: i5.ColumnInfoService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i6.AdaptiveGridService }]; } });
@@ -12,6 +12,7 @@ import { SinglePopupService } from '../../../common/single-popup.service';
12
12
  import { ScrollSyncService } from '../../../scrolling/scroll-sync.service';
13
13
  import { ColumnInfoService } from '../../../common/column-info.service';
14
14
  import { cloneFilters } from '../../../common/filter-descriptor-differ';
15
+ import { AdaptiveGridService } from '../../../common/adaptiveness.service';
15
16
  import * as i0 from "@angular/core";
16
17
  import * as i1 from "@progress/kendo-angular-buttons";
17
18
  /**
@@ -35,10 +36,6 @@ export class FilterToolWrapperComponent {
35
36
  hostButton;
36
37
  clearIcon = filterClearIcon;
37
38
  columnInfoService;
38
- popupRef;
39
- filter;
40
- subscriptions;
41
- _ctx;
42
39
  set ctx(ctx) {
43
40
  this._ctx = ctx;
44
41
  this.createPopup();
@@ -46,7 +43,6 @@ export class FilterToolWrapperComponent {
46
43
  get ctx() {
47
44
  return this._ctx;
48
45
  }
49
- _filterService;
50
46
  set filterService(filterService) {
51
47
  this._filterService = filterService;
52
48
  this.subscriptions = this._filterService.changes.subscribe(filter => {
@@ -58,6 +54,11 @@ export class FilterToolWrapperComponent {
58
54
  return this._filterService;
59
55
  }
60
56
  columnMenuService;
57
+ popupRef;
58
+ filter;
59
+ subscriptions;
60
+ _ctx;
61
+ _filterService;
61
62
  constructor(injector) {
62
63
  this.injector = injector;
63
64
  }
@@ -86,6 +87,7 @@ export class FilterToolWrapperComponent {
86
87
  { provide: FilterService, useValue: this._filterService },
87
88
  { provide: ContextService, useValue: this._ctx },
88
89
  { provide: ColumnInfoService, useValue: this.columnInfoService },
90
+ AdaptiveGridService,
89
91
  SinglePopupService,
90
92
  ScrollSyncService
91
93
  ],
@@ -101,7 +103,12 @@ export class FilterToolWrapperComponent {
101
103
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FilterToolWrapperComponent, isStandalone: true, selector: "kendo-filter-tool-wrapper", outputs: { close: "close" }, host: { listeners: { "keydown.escape": "onEscKeyDown($event)", "click": "onClick($event)" }, properties: { "class.k-column-menu": "this.wrapperClasses", "class.k-column-menu-md": "this.wrapperClasses" } }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: `
102
104
  <ng-container #container></ng-container>
103
105
  <div class="k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer">
104
- <button kendoButton [svgIcon]="clearIcon" (click)="clear()">Clear all filters</button>
106
+ <button kendoButton
107
+ [svgIcon]="clearIcon"
108
+ icon="filter-clear"
109
+ (click)="clear()">
110
+ {{ctx?.localization.get('filterClearAllButton')}}
111
+ </button>
105
112
  </div>
106
113
  `, isInline: true, dependencies: [{ kind: "component", type: i1.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"] }] });
107
114
  }
@@ -112,7 +119,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
112
119
  template: `
113
120
  <ng-container #container></ng-container>
114
121
  <div class="k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer">
115
- <button kendoButton [svgIcon]="clearIcon" (click)="clear()">Clear all filters</button>
122
+ <button kendoButton
123
+ [svgIcon]="clearIcon"
124
+ icon="filter-clear"
125
+ (click)="clear()">
126
+ {{ctx?.localization.get('filterClearAllButton')}}
127
+ </button>
116
128
  </div>
117
129
  `,
118
130
  standalone: true,
@@ -12,10 +12,12 @@ import { ColumnMenuItemComponent } from '../../../column-menu/column-menu-item.c
12
12
  import { ColumnMenuItemContentTemplateDirective } from '../../../column-menu/column-menu-item-content-template.directive';
13
13
  import { ColumnInfoService } from '../../../common/column-info.service';
14
14
  import { cloneFilters } from '../../../common/filter-descriptor-differ';
15
+ import { AdaptiveGridService } from '../../../common/adaptiveness.service';
15
16
  import * as i0 from "@angular/core";
16
17
  import * as i1 from "../../../filtering/filter.service";
17
18
  import * as i2 from "../../../common/provider.service";
18
19
  import * as i3 from "../../../common/column-info.service";
20
+ import * as i4 from "../../../common/adaptiveness.service";
19
21
  /**
20
22
  * @hidden
21
23
  */
@@ -24,6 +26,7 @@ export class FilterToolbarToolComponent {
24
26
  filterService;
25
27
  ctx;
26
28
  columnInfoService;
29
+ adaptiveGridService;
27
30
  filterItems;
28
31
  menuItems;
29
32
  filterContainers;
@@ -39,11 +42,12 @@ export class FilterToolbarToolComponent {
39
42
  columns;
40
43
  filter;
41
44
  subscriptions;
42
- constructor(element, filterService, ctx, columnInfoService) {
45
+ constructor(element, filterService, ctx, columnInfoService, adaptiveGridService) {
43
46
  this.element = element;
44
47
  this.filterService = filterService;
45
48
  this.ctx = ctx;
46
49
  this.columnInfoService = columnInfoService;
50
+ this.adaptiveGridService = adaptiveGridService;
47
51
  }
48
52
  ngOnInit() {
49
53
  this.columns = this.columnInfoService.leafNamedColumns.filter(column => column?.filterable);
@@ -60,6 +64,20 @@ export class FilterToolbarToolComponent {
60
64
  this.subscriptions.unsubscribe();
61
65
  }
62
66
  }
67
+ navigateView(column) {
68
+ if (this.ctx.grid.isActionSheetExpanded && this.adaptiveGridService.viewType === 'filterToolbarTool') {
69
+ const componentRef = this.ctx.grid.adaptiveRenderer.filterToolbarToolTemplate.createComponent(FilterMenuContainerComponent);
70
+ componentRef.instance.column = this.getColumnComponent(column);
71
+ componentRef.instance.filter = this.filter;
72
+ this.subscriptions.add(componentRef.instance.close.subscribe(() => {
73
+ this.adaptiveGridService.reset();
74
+ }));
75
+ this.adaptiveGridService.filterMenuContainerComponentRef = componentRef;
76
+ this.adaptiveGridService.secondaryView = 'columnFilter';
77
+ this.adaptiveGridService.column = this.getColumnComponent(column);
78
+ this.ctx.grid.adaptiveRenderer.actionSheet.nextView();
79
+ }
80
+ }
63
81
  getColumnComponent(column) {
64
82
  return column;
65
83
  }
@@ -83,15 +101,17 @@ export class FilterToolbarToolComponent {
83
101
  menuItem.contentState = 'expanded';
84
102
  }
85
103
  }
86
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterToolbarToolComponent, deps: [{ token: i0.ElementRef }, { token: i1.FilterService }, { token: i2.ContextService }, { token: i3.ColumnInfoService }], target: i0.ɵɵFactoryTarget.Component });
104
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterToolbarToolComponent, deps: [{ token: i0.ElementRef }, { token: i1.FilterService }, { token: i2.ContextService }, { token: i3.ColumnInfoService }, { token: i4.AdaptiveGridService }], target: i0.ɵɵFactoryTarget.Component });
87
105
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FilterToolbarToolComponent, isStandalone: true, selector: "kendo-filter-toolbar-tool", outputs: { close: "close" }, viewQueries: [{ propertyName: "filterItems", predicate: ["filterItem"], descendants: true, read: ElementRef }, { propertyName: "menuItems", predicate: ["filterItem"], descendants: true }, { propertyName: "filterContainers", predicate: ["filterContainer"], descendants: true }], ngImport: i0, template: `
88
106
  <div [style]="hostStyles">
89
107
  <kendo-grid-columnmenu-item *ngFor="let column of columns; let i = index"
90
108
  class="k-columnmenu-item-wrapper" #filterItem
91
109
  role="button"
92
110
  tabindex="0"
111
+ [column]="getColumnComponent(column)"
93
112
  [text]="column.title || getColumnComponent(column).field"
94
113
  (keydown.enter)="toggleItem($event, i)"
114
+ (itemClick)="navigateView(getColumnComponent(column))"
95
115
  [expanded]="false">
96
116
  <ng-template kendoGridColumnMenuItemContentTemplate>
97
117
  <kendo-grid-filter-menu-container
@@ -105,7 +125,7 @@ export class FilterToolbarToolComponent {
105
125
  </ng-template>
106
126
  </kendo-grid-columnmenu-item>
107
127
  </div>
108
- `, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: FilterMenuContainerComponent, selector: "kendo-grid-filter-menu-container", inputs: ["column", "isLast", "isExpanded", "menuTabbingService", "filter", "actionsClass"], outputs: ["close"] }, { kind: "component", type: ColumnMenuItemComponent, selector: "kendo-grid-columnmenu-item", inputs: ["icon", "svgIcon", "text", "selected", "disabled", "expanded", "service"], outputs: ["itemClick", "expand", "collapse"] }, { kind: "directive", type: ColumnMenuItemContentTemplateDirective, selector: "[kendoGridColumnMenuItemContentTemplate]" }] });
128
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: FilterMenuContainerComponent, selector: "kendo-grid-filter-menu-container", inputs: ["column", "isLast", "isExpanded", "menuTabbingService", "filter", "actionsClass"], outputs: ["close"] }, { kind: "component", type: ColumnMenuItemComponent, selector: "kendo-grid-columnmenu-item", inputs: ["icon", "svgIcon", "text", "selected", "disabled", "expanded", "service", "column"], outputs: ["itemClick", "expand", "collapse"] }, { kind: "directive", type: ColumnMenuItemContentTemplateDirective, selector: "[kendoGridColumnMenuItemContentTemplate]" }] });
109
129
  }
110
130
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterToolbarToolComponent, decorators: [{
111
131
  type: Component,
@@ -117,8 +137,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
117
137
  class="k-columnmenu-item-wrapper" #filterItem
118
138
  role="button"
119
139
  tabindex="0"
140
+ [column]="getColumnComponent(column)"
120
141
  [text]="column.title || getColumnComponent(column).field"
121
142
  (keydown.enter)="toggleItem($event, i)"
143
+ (itemClick)="navigateView(getColumnComponent(column))"
122
144
  [expanded]="false">
123
145
  <ng-template kendoGridColumnMenuItemContentTemplate>
124
146
  <kendo-grid-filter-menu-container
@@ -136,7 +158,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
136
158
  standalone: true,
137
159
  imports: [NgFor, KENDO_BUTTON, FilterMenuContainerComponent, ColumnMenuItemComponent, ColumnMenuItemContentTemplateDirective]
138
160
  }]
139
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.FilterService }, { type: i2.ContextService }, { type: i3.ColumnInfoService }]; }, propDecorators: { filterItems: [{
161
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.FilterService }, { type: i2.ContextService }, { type: i3.ColumnInfoService }, { type: i4.AdaptiveGridService }]; }, propDecorators: { filterItems: [{
140
162
  type: ViewChildren,
141
163
  args: ['filterItem', { read: ElementRef }]
142
164
  }], menuItems: [{
@@ -13,12 +13,14 @@ import { SortService } from '../../../common/sort.service';
13
13
  import { closest, isDocumentAvailable, isPresent } from '@progress/kendo-angular-common';
14
14
  import { ColumnInfoService } from '../../../common/column-info.service';
15
15
  import { take } from 'rxjs/operators';
16
+ import { AdaptiveGridService } from '../../../common/adaptiveness.service';
16
17
  import * as i0 from "@angular/core";
17
18
  import * as i1 from "@progress/kendo-angular-toolbar";
18
19
  import * as i2 from "@progress/kendo-angular-popup";
19
20
  import * as i3 from "../../../common/provider.service";
20
21
  import * as i4 from "../../../common/sort.service";
21
22
  import * as i5 from "../../../common/column-info.service";
23
+ import * as i6 from "../../../common/adaptiveness.service";
22
24
  let incrementingId = 0;
23
25
  /**
24
26
  * Represents the toolbar tool for sorting columns of the Grid.
@@ -45,12 +47,13 @@ export class SortCommandToolbarDirective {
45
47
  columnInfoService;
46
48
  ngZone;
47
49
  renderer;
50
+ adaptiveGridService;
48
51
  popupRef;
49
52
  nextId = incrementingId++;
50
53
  toolSubs = new Subscription();
51
54
  popupSubs;
52
55
  removeClickListener;
53
- constructor(host, popupService, ctx, sortService, columnInfoService, ngZone, renderer) {
56
+ constructor(host, popupService, ctx, sortService, columnInfoService, ngZone, renderer, adaptiveGridService) {
54
57
  this.host = host;
55
58
  this.popupService = popupService;
56
59
  this.ctx = ctx;
@@ -58,6 +61,7 @@ export class SortCommandToolbarDirective {
58
61
  this.columnInfoService = columnInfoService;
59
62
  this.ngZone = ngZone;
60
63
  this.renderer = renderer;
64
+ this.adaptiveGridService = adaptiveGridService;
61
65
  }
62
66
  ngOnInit() {
63
67
  this.toolSubs = this.host.click.subscribe(e => this.onClick(e));
@@ -70,7 +74,7 @@ export class SortCommandToolbarDirective {
70
74
  const hasIcon = hasToolbarIcon && hasOverflowIcon;
71
75
  const hasSvgIcon = isPresent(this.host.toolbarOptions.svgIcon) && isPresent(this.host.overflowOptions.svgIcon);
72
76
  if (!hasIcon) {
73
- this.host.icon = 'k-i-arrows-swap';
77
+ this.host.icon = 'arrows-swap';
74
78
  }
75
79
  if (!hasSvgIcon) {
76
80
  this.host.svgIcon = arrowsSwapIcon;
@@ -104,11 +108,19 @@ export class SortCommandToolbarDirective {
104
108
  }
105
109
  onClick(e) {
106
110
  e.preventDefault();
107
- if (this.popupRef) {
108
- this.closePopup();
109
- return;
111
+ if (this.ctx.grid.adaptiveMode === 'auto' && this.adaptiveGridService.windowSize !== 'large') {
112
+ if (!this.ctx.grid.isActionSheetExpanded) {
113
+ this.adaptiveGridService.viewType = 'sortToolbarTool';
114
+ this.ctx.grid.adaptiveRenderer.actionSheet.toggle(true);
115
+ }
116
+ }
117
+ else {
118
+ if (this.popupRef) {
119
+ this.closePopup();
120
+ return;
121
+ }
122
+ this.openPopup();
110
123
  }
111
- this.openPopup();
112
124
  }
113
125
  openPopup() {
114
126
  const direction = this.ctx.localization.rtl ? 'right' : 'left';
@@ -120,6 +132,7 @@ export class SortCommandToolbarDirective {
120
132
  anchorAlign: { vertical: 'bottom', horizontal: direction },
121
133
  popupAlign: { vertical: 'top', horizontal: direction }
122
134
  });
135
+ this.adaptiveGridService.popupRef = this.popupRef;
123
136
  this.setPopupAttributes();
124
137
  this.ngZone.runOutsideAngular(() => {
125
138
  if (!isDocumentAvailable()) {
@@ -179,7 +192,7 @@ export class SortCommandToolbarDirective {
179
192
  get buttonElement() {
180
193
  return this.host.getButton();
181
194
  }
182
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SortCommandToolbarDirective, deps: [{ token: i1.ToolBarButtonComponent }, { token: i2.PopupService }, { token: i3.ContextService }, { token: i4.SortService }, { token: i5.ColumnInfoService }, { token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
195
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SortCommandToolbarDirective, deps: [{ token: i1.ToolBarButtonComponent }, { token: i2.PopupService }, { token: i3.ContextService }, { token: i4.SortService }, { token: i5.ColumnInfoService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i6.AdaptiveGridService }], target: i0.ɵɵFactoryTarget.Directive });
183
196
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SortCommandToolbarDirective, isStandalone: true, selector: "[kendoGridSortTool]", ngImport: i0 });
184
197
  }
185
198
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SortCommandToolbarDirective, decorators: [{
@@ -188,4 +201,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
188
201
  selector: '[kendoGridSortTool]',
189
202
  standalone: true
190
203
  }]
191
- }], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: i2.PopupService }, { type: i3.ContextService }, { type: i4.SortService }, { type: i5.ColumnInfoService }, { type: i0.NgZone }, { type: i0.Renderer2 }]; } });
204
+ }], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: i2.PopupService }, { type: i3.ContextService }, { type: i4.SortService }, { type: i5.ColumnInfoService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i6.AdaptiveGridService }]; } });
@@ -12,7 +12,10 @@ import { normalize } from '../../../columns/sort-settings';
12
12
  import { take } from 'rxjs/operators';
13
13
  import * as i0 from "@angular/core";
14
14
  import * as i1 from "@progress/kendo-angular-buttons";
15
- const directions = initialDirection => initialDirection === "asc" ? ["asc", "desc"] : ["desc", "asc"];
15
+ /**
16
+ * @hidden
17
+ */
18
+ export const directions = initialDirection => initialDirection === "asc" ? ["asc", "desc"] : ["desc", "asc"];
16
19
  /**
17
20
  * @hidden
18
21
  */
@@ -163,7 +166,12 @@ export class SortToolbarToolComponent {
163
166
  </div>
164
167
 
165
168
  <div class="k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer">
166
- <button kendoButton [svgIcon]="clearIcon" (click)="clearSorting()" >Clear sorting</button>
169
+ <button kendoButton
170
+ [svgIcon]="clearIcon"
171
+ icon="x"
172
+ (click)="clearSorting()">
173
+ {{ctx?.localization.get('sortClearButton')}}
174
+ </button>
167
175
  </div>
168
176
  `, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: i1.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"] }] });
169
177
  }
@@ -200,7 +208,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
200
208
  </div>
201
209
 
202
210
  <div class="k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer">
203
- <button kendoButton [svgIcon]="clearIcon" (click)="clearSorting()" >Clear sorting</button>
211
+ <button kendoButton
212
+ [svgIcon]="clearIcon"
213
+ icon="x"
214
+ (click)="clearSorting()">
215
+ {{ctx?.localization.get('sortClearButton')}}
216
+ </button>
204
217
  </div>
205
218
  `,
206
219
  standalone: true,
package/esm2022/utils.mjs CHANGED
@@ -3,7 +3,6 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { InjectionToken } from '@angular/core';
6
- import { isDocumentAvailable } from '@progress/kendo-angular-common';
7
6
  import { merge, of } from 'rxjs';
8
7
  export { isChanged, anyChanged, hasObservers } from '@progress/kendo-angular-common';
9
8
  const EMPTY_REGEX = /^\s*$/;
@@ -109,18 +108,6 @@ const wnd = typeof window !== 'undefined' ? window : {};
109
108
  export const requestAnimationFrame = wnd.requestAnimationFrame || wnd.msRequestAnimationFrame || (callback => setTimeout(callback, FRAME_DURATION));
110
109
  /** @hidden */
111
110
  export const cancelAnimationFrame = wnd.cancelAnimationFrame || wnd.msCancelRequestAnimationFrame || clearTimeout;
112
- /**
113
- * @hidden
114
- */
115
- export const detectIE = () => {
116
- if (!isDocumentAvailable()) {
117
- return;
118
- }
119
- const ua = window.navigator.userAgent;
120
- const msie = ua.indexOf('MSIE ');
121
- const trident = ua.indexOf('Trident/');
122
- return msie > 0 || trident > 0;
123
- };
124
111
  /**
125
112
  * @hidden
126
113
  */