@progress/kendo-angular-grid 19.0.0-develop.31 → 19.0.0-develop.33

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 (29) hide show
  1. package/adaptiveness/adaptive-renderer.component.d.ts +5 -0
  2. package/common/adaptiveness.service.d.ts +1 -1
  3. package/directives.d.ts +4 -3
  4. package/esm2022/adaptiveness/adaptive-renderer.component.mjs +95 -6
  5. package/esm2022/directives.mjs +3 -1
  6. package/esm2022/filtering/menu/filter-menu-container.component.mjs +3 -0
  7. package/esm2022/grid.component.mjs +32 -8
  8. package/esm2022/grid.module.mjs +100 -99
  9. package/esm2022/index.mjs +1 -0
  10. package/esm2022/localization/messages.mjs +25 -1
  11. package/esm2022/package-metadata.mjs +2 -2
  12. package/esm2022/rendering/toolbar/tools/column-chooser-tool.directive.mjs +7 -0
  13. package/esm2022/rendering/toolbar/tools/filter-command-tool.directive.mjs +8 -0
  14. package/esm2022/rendering/toolbar/tools/filter-toolbar-tool.component.mjs +5 -0
  15. package/esm2022/rendering/toolbar/tools/group-command-tool.directive.mjs +206 -0
  16. package/esm2022/rendering/toolbar/tools/group-toolbar-tool.component.mjs +425 -0
  17. package/esm2022/rendering/toolbar/tools/sort-command-tool.directive.mjs +8 -0
  18. package/fesm2022/progress-kendo-angular-grid.mjs +856 -87
  19. package/filtering/menu/filter-menu-container.component.d.ts +1 -0
  20. package/grid.module.d.ts +99 -98
  21. package/index.d.ts +1 -0
  22. package/localization/messages.d.ts +17 -1
  23. package/package.json +21 -21
  24. package/rendering/toolbar/tools/column-chooser-tool.directive.d.ts +1 -0
  25. package/rendering/toolbar/tools/filter-command-tool.directive.d.ts +1 -0
  26. package/rendering/toolbar/tools/group-command-tool.directive.d.ts +51 -0
  27. package/rendering/toolbar/tools/group-toolbar-tool.component.d.ts +61 -0
  28. package/rendering/toolbar/tools/sort-command-tool.directive.d.ts +1 -0
  29. package/schematics/ngAdd/index.js +4 -4
@@ -0,0 +1,206 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { Directive, NgZone, Renderer2 } from '@angular/core';
6
+ import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
7
+ import { Subscription } from 'rxjs';
8
+ import { groupIcon } from '@progress/kendo-svg-icons';
9
+ import { PopupService } from '@progress/kendo-angular-popup';
10
+ import { ContextService } from '../../../common/provider.service';
11
+ import { closest, isDocumentAvailable, isPresent } from '@progress/kendo-angular-common';
12
+ import { take } from 'rxjs/operators';
13
+ import { AdaptiveGridService } from '../../../common/adaptiveness.service';
14
+ import { GroupToolbarToolComponent } from './group-toolbar-tool.component';
15
+ import * as i0 from "@angular/core";
16
+ import * as i1 from "@progress/kendo-angular-toolbar";
17
+ import * as i2 from "@progress/kendo-angular-popup";
18
+ import * as i3 from "../../../common/provider.service";
19
+ import * as i4 from "../../../common/adaptiveness.service";
20
+ let incrementingId = 0;
21
+ /**
22
+ * Represents the toolbar tool for grouping columns of the Grid.
23
+ * You can apply this directive to any `kendo-toolbar-button` element inside a
24
+ * ToolbarComponent used in the Grid.
25
+ *
26
+ * @example
27
+ * ```html-no-run
28
+ * <kendo-grid>
29
+ * <kendo-toolbar>
30
+ * <kendo-toolbar-button text="Group" kendoGridGroupTool></kendo-toolbar-button>
31
+ * </kendo-toolbar>
32
+ * </kendo-grid>
33
+ * ```
34
+ */
35
+ export class GroupCommandToolbarDirective {
36
+ host;
37
+ popupService;
38
+ ctx;
39
+ ngZone;
40
+ renderer;
41
+ adaptiveGridService;
42
+ popupRef;
43
+ nextId = incrementingId++;
44
+ toolSubs = new Subscription();
45
+ popupSubs;
46
+ actionSheetCloseSub;
47
+ removeClickListener;
48
+ constructor(host, popupService, ctx, ngZone, renderer, adaptiveGridService) {
49
+ this.host = host;
50
+ this.popupService = popupService;
51
+ this.ctx = ctx;
52
+ this.ngZone = ngZone;
53
+ this.renderer = renderer;
54
+ this.adaptiveGridService = adaptiveGridService;
55
+ }
56
+ ngOnInit() {
57
+ this.toolSubs = this.host.click.subscribe(e => this.onClick(e));
58
+ this.toolSubs.add(this.ctx.grid.groupChange.subscribe(group => {
59
+ this.host.showBadge = this.isGroupingApplied(group);
60
+ }));
61
+ this.host.hasBadgeContainer = true;
62
+ this.host.showBadge = this.isGroupingApplied(this.ctx.grid.group);
63
+ const hasToolbarIcon = isPresent(this.host.toolbarOptions.icon) && this.host.toolbarOptions.icon !== '';
64
+ const hasOverflowIcon = isPresent(this.host.overflowOptions.icon) && this.host.overflowOptions.icon !== '';
65
+ const hasIcon = hasToolbarIcon && hasOverflowIcon;
66
+ const hasSvgIcon = isPresent(this.host.toolbarOptions.svgIcon) && isPresent(this.host.overflowOptions.svgIcon);
67
+ if (!hasIcon) {
68
+ this.host.icon = 'group';
69
+ }
70
+ if (!hasSvgIcon) {
71
+ this.host.svgIcon = groupIcon;
72
+ }
73
+ }
74
+ ngAfterViewInit() {
75
+ if (!isPresent(this.host.text)) {
76
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
77
+ this.host.text = this.ctx.localization.get(`groupToolbarToolText`);
78
+ });
79
+ }
80
+ this.buttonElement?.setAttribute('aria-haspopup', 'dialog');
81
+ this.buttonElement?.setAttribute('aria-expanded', 'false');
82
+ this.buttonElement?.setAttribute('title', this.ctx.localization.get('groupToolbarToolText'));
83
+ }
84
+ ngOnDestroy() {
85
+ if (this.toolSubs) {
86
+ this.toolSubs.unsubscribe();
87
+ }
88
+ if (this.popupSubs) {
89
+ this.popupSubs.unsubscribe();
90
+ }
91
+ if (this.popupRef) {
92
+ this.popupRef.close();
93
+ this.popupRef = null;
94
+ }
95
+ if (this.actionSheetCloseSub) {
96
+ this.actionSheetCloseSub.unsubscribe();
97
+ this.actionSheetCloseSub = null;
98
+ }
99
+ if (this.removeClickListener) {
100
+ this.removeClickListener();
101
+ this.removeClickListener = null;
102
+ }
103
+ }
104
+ onClick(e) {
105
+ e.preventDefault();
106
+ if (this.ctx.grid.adaptiveMode === 'auto' && this.adaptiveGridService.windowSize !== 'large') {
107
+ if (!this.ctx.grid.isActionSheetExpanded) {
108
+ this.adaptiveGridService.viewType = 'groupToolbarTool';
109
+ this.ctx.grid.adaptiveRenderer.actionSheet.toggle(true);
110
+ this.host.selected = true;
111
+ this.actionSheetCloseSub = this.ctx.grid.adaptiveRenderer.actionSheet.collapse.subscribe(() => this.host.selected = false);
112
+ }
113
+ }
114
+ else {
115
+ if (this.popupRef) {
116
+ this.closePopup();
117
+ return;
118
+ }
119
+ this.openPopup();
120
+ }
121
+ }
122
+ openPopup() {
123
+ const direction = this.ctx.localization.rtl ? 'right' : 'left';
124
+ this.popupRef = this.popupService.open({
125
+ anchor: this.buttonElement,
126
+ content: GroupToolbarToolComponent,
127
+ popupClass: 'k-grid-columnmenu-popup',
128
+ positionMode: 'absolute',
129
+ anchorAlign: { vertical: 'bottom', horizontal: direction },
130
+ popupAlign: { vertical: 'top', horizontal: direction }
131
+ });
132
+ this.adaptiveGridService.popupRef = this.popupRef;
133
+ this.setPopupAttributes();
134
+ this.host.selected = true;
135
+ this.ngZone.runOutsideAngular(() => {
136
+ if (!isDocumentAvailable()) {
137
+ return;
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.ngZone.run(() => {
142
+ this.closePopup();
143
+ });
144
+ }
145
+ });
146
+ });
147
+ this.popupSubs = this.popupRef.popup.instance.anchorViewportLeave.subscribe(() => {
148
+ this.popupSubs?.unsubscribe();
149
+ this.popupSubs = null;
150
+ this.closePopup();
151
+ });
152
+ this.initPopupProperties();
153
+ }
154
+ setPopupAttributes() {
155
+ const popupElement = this.popupRef.popupElement;
156
+ const popupId = `k-group-tool-${this.nextId}-popup`;
157
+ const popupAriaElement = popupElement.querySelector('.k-popup');
158
+ this.renderer.setAttribute(popupElement, 'dir', this.ctx.localization.rtl ? 'rtl' : 'ltr');
159
+ this.renderer.setAttribute(popupAriaElement, 'id', popupId);
160
+ this.renderer.setAttribute(popupAriaElement, 'role', 'dialog');
161
+ this.buttonElement?.setAttribute('aria-expanded', 'true');
162
+ this.buttonElement?.setAttribute('aria-controls', popupId);
163
+ }
164
+ initPopupProperties() {
165
+ this.popupRef.content.instance.ctx = this.ctx;
166
+ this.popupRef.content.instance.hostButton = this.host;
167
+ this.popupSubs.add(this.popupRef.content.instance.groupClear.subscribe(() => {
168
+ this.closePopup();
169
+ }));
170
+ this.popupSubs.add(this.popupRef.content.instance.close.subscribe(() => {
171
+ this.closePopup();
172
+ }));
173
+ }
174
+ closePopup() {
175
+ this.buttonElement?.setAttribute('aria-expanded', 'false');
176
+ this.buttonElement?.removeAttribute('aria-controls');
177
+ this.host.selected = false;
178
+ if (this.popupRef) {
179
+ this.popupRef.close();
180
+ this.popupRef = null;
181
+ }
182
+ if (this.popupSubs) {
183
+ this.popupSubs.unsubscribe();
184
+ this.popupSubs = null;
185
+ }
186
+ if (this.removeClickListener) {
187
+ this.removeClickListener();
188
+ this.removeClickListener = null;
189
+ }
190
+ }
191
+ get buttonElement() {
192
+ return this.host.getButton();
193
+ }
194
+ isGroupingApplied(group) {
195
+ return isPresent(group) && group.length > 0;
196
+ }
197
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GroupCommandToolbarDirective, deps: [{ token: i1.ToolBarButtonComponent }, { token: i2.PopupService }, { token: i3.ContextService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i4.AdaptiveGridService }], target: i0.ɵɵFactoryTarget.Directive });
198
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: GroupCommandToolbarDirective, isStandalone: true, selector: "[kendoGridGroupTool]", ngImport: i0 });
199
+ }
200
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GroupCommandToolbarDirective, decorators: [{
201
+ type: Directive,
202
+ args: [{
203
+ selector: '[kendoGridGroupTool]',
204
+ standalone: true
205
+ }]
206
+ }], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: i2.PopupService }, { type: i3.ContextService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i4.AdaptiveGridService }]; } });
@@ -0,0 +1,425 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2025 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, ElementRef, EventEmitter, HostBinding, Output, Input, HostListener, ViewChildren, QueryList, NgZone } from '@angular/core';
6
+ import { NgFor, NgIf } from '@angular/common';
7
+ import { IconWrapperComponent } from '@progress/kendo-angular-icons';
8
+ import { chevronUpIcon, chevronDownIcon, xCircleIcon, plusCircleIcon, xIcon } from '@progress/kendo-svg-icons';
9
+ import { KENDO_BUTTON } from '@progress/kendo-angular-buttons';
10
+ import { take } from 'rxjs/operators';
11
+ import { isPresent } from '@progress/kendo-angular-common';
12
+ import * as i0 from "@angular/core";
13
+ import * as i1 from "@progress/kendo-angular-buttons";
14
+ /**
15
+ * @hidden
16
+ */
17
+ export class GroupToolbarToolComponent {
18
+ element;
19
+ ngZone;
20
+ hostClass = true;
21
+ get lgClass() {
22
+ return this.adaptive;
23
+ }
24
+ get mdClass() {
25
+ return !this.adaptive;
26
+ }
27
+ onEscKeyDown(event) {
28
+ event.preventDefault();
29
+ this.hostButton?.focus(event);
30
+ this.close.emit();
31
+ }
32
+ set groupItems(items) {
33
+ this._groupItems = items;
34
+ if (items?.first && (!isPresent(this.currentFocusedItemIndex) || this.currentFocusedItemIndex >= items.length || this.currentFocusedItemIndex < 0)) {
35
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
36
+ this.currentFocusedItemIndex = 0;
37
+ this.groupItems.first.nativeElement.focus();
38
+ });
39
+ return;
40
+ }
41
+ if (items?.first) {
42
+ items.get(this.currentFocusedItemIndex).nativeElement.focus();
43
+ }
44
+ }
45
+ get groupItems() {
46
+ return this._groupItems;
47
+ }
48
+ _groupItems;
49
+ adaptive = false;
50
+ close = new EventEmitter();
51
+ groupClear = new EventEmitter();
52
+ currentFocusedItemIndex;
53
+ group = new Array();
54
+ columns = [];
55
+ iconSize = 'medium';
56
+ upIcon = chevronUpIcon;
57
+ downIcon = chevronDownIcon;
58
+ removeIcon = xCircleIcon;
59
+ addIcon = plusCircleIcon;
60
+ clearIcon = xIcon;
61
+ _ctx;
62
+ set ctx(ctx) {
63
+ if (!ctx || !ctx.grid) {
64
+ return;
65
+ }
66
+ this._ctx = ctx;
67
+ this.group = ctx.grid.group;
68
+ this.subscription = ctx.grid.groupChange.subscribe((group) => {
69
+ this.group = group;
70
+ this.updateGroupedColumns();
71
+ });
72
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
73
+ this.updateGroupedColumns();
74
+ });
75
+ }
76
+ get ctx() {
77
+ return this._ctx;
78
+ }
79
+ groupedColumns = [];
80
+ ungroupedColumns = [];
81
+ subscription;
82
+ hostButton;
83
+ constructor(element, ngZone) {
84
+ this.element = element;
85
+ this.ngZone = ngZone;
86
+ }
87
+ ngOnInit() {
88
+ this.iconSize = this.adaptive ? 'large' : 'medium';
89
+ }
90
+ ngOnDestroy() {
91
+ if (this.subscription) {
92
+ this.subscription.unsubscribe();
93
+ }
94
+ }
95
+ addGroup(column, ev) {
96
+ ev.stopImmediatePropagation();
97
+ const index = this.group.length;
98
+ const groups = this.group.filter(x => x.field !== column?.field);
99
+ if (groups.length || this.group.length === 0) {
100
+ this.group = [...groups.slice(0, index), { field: column?.field }, ...groups.slice(index)];
101
+ this.ctx.grid.groupChange.emit(this.group);
102
+ this.updateGroupedColumns();
103
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
104
+ const newIndex = this.groupedColumns.length - 1;
105
+ const newItem = this.groupItems.get(newIndex);
106
+ if (newItem) {
107
+ this.currentFocusedItemIndex = (this.groupedColumns?.length || 0) + newIndex;
108
+ newItem.nativeElement.focus();
109
+ }
110
+ });
111
+ }
112
+ }
113
+ removeGroup(column, ev) {
114
+ ev.stopImmediatePropagation();
115
+ this.group = this.group.filter(x => x.field !== column?.field);
116
+ this.ctx.grid.groupChange.emit(this.group);
117
+ this.updateGroupedColumns();
118
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
119
+ const newIndex = this.ungroupedColumns.findIndex(ungroupedColumn => ungroupedColumn?.field === column?.field);
120
+ const newItem = this.groupItems.get(newIndex + this.groupedColumns.length);
121
+ if (newItem) {
122
+ newItem.nativeElement.focus();
123
+ }
124
+ });
125
+ }
126
+ moveGroupUp(column, ev) {
127
+ ev.stopImmediatePropagation();
128
+ const index = this.group.findIndex(x => x.field === column?.field);
129
+ if (index > 0) {
130
+ const groupToMove = this.group[index];
131
+ this.group.splice(index, 1);
132
+ this.group.splice(index - 1, 0, groupToMove);
133
+ this.ctx.grid.groupChange.emit(this.group);
134
+ this.updateGroupedColumns();
135
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
136
+ const newItem = this.groupItems.get(index - 1);
137
+ if (newItem) {
138
+ newItem.nativeElement.focus();
139
+ this.currentFocusedItemIndex = index - 1;
140
+ }
141
+ });
142
+ }
143
+ }
144
+ moveGroupDown(column, ev) {
145
+ ev.stopImmediatePropagation();
146
+ const index = this.group.findIndex(x => x.field === column?.field);
147
+ if (index < this.group.length - 1) {
148
+ const groupToMove = this.group[index];
149
+ this.group.splice(index, 1);
150
+ this.group.splice(index + 1, 0, groupToMove);
151
+ this.ctx.grid.groupChange.emit(this.group);
152
+ this.updateGroupedColumns();
153
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
154
+ const newItem = this.groupItems.get(index + 1);
155
+ if (newItem) {
156
+ newItem.nativeElement.focus();
157
+ this.currentFocusedItemIndex = index + 1;
158
+ }
159
+ });
160
+ }
161
+ }
162
+ clear() {
163
+ this.group = [];
164
+ this.ctx.grid.groupChange.emit(this.group);
165
+ this.groupClear.emit(this.group);
166
+ }
167
+ getColumnComponent(column) {
168
+ return column;
169
+ }
170
+ onItemFocus(groupIndex, index) {
171
+ const currentIndex = (typeof groupIndex === 'number' ? groupIndex : this.groupedColumns?.length || 0) + index;
172
+ this.currentFocusedItemIndex = currentIndex;
173
+ }
174
+ handleGroupedKeydown(column, index, ev) {
175
+ if (ev.code === 'Enter' || ev.code === 'Backspace' || ev.code === 'Delete') {
176
+ this.removeGroup(column, ev);
177
+ }
178
+ else if (ev.code === 'ArrowUp' && ev.shiftKey) {
179
+ this.moveGroupUp(column, ev);
180
+ }
181
+ else if (ev.code === 'ArrowDown' && ev.shiftKey) {
182
+ this.moveGroupDown(column, ev);
183
+ }
184
+ else if (ev.code === 'ArrowUp') {
185
+ this.navigateToPreviousItem();
186
+ }
187
+ else if (ev.code === 'ArrowDown') {
188
+ this.navigateToNextItem();
189
+ }
190
+ }
191
+ handleUngroupedKeydown(column, index, ev) {
192
+ if (ev.code === 'Enter') {
193
+ this.addGroup(column, ev);
194
+ }
195
+ else if (ev.code === 'ArrowUp') {
196
+ this.navigateToPreviousItem();
197
+ }
198
+ else if (ev.code === 'ArrowDown') {
199
+ this.navigateToNextItem();
200
+ }
201
+ }
202
+ updateGroupedColumns() {
203
+ this.groupedColumns = this.group
204
+ .map(group => this.ctx.grid.columns.find(column => column?.field === group.field))
205
+ .filter(column => !!column);
206
+ this.ungroupedColumns = this.ctx.grid.columns.filter(column => column?.groupable &&
207
+ !this.groupedColumns.some(gc => gc?.field === column?.field));
208
+ }
209
+ navigateToNextItem() {
210
+ if (this.currentFocusedItemIndex < this.groupItems.length - 1) {
211
+ this.currentFocusedItemIndex++;
212
+ this.groupItems.get(this.currentFocusedItemIndex).nativeElement.focus();
213
+ }
214
+ else if (this.currentFocusedItemIndex === this.groupItems.length - 1) {
215
+ this.currentFocusedItemIndex = 0;
216
+ this.groupItems.get(this.currentFocusedItemIndex).nativeElement.focus();
217
+ }
218
+ }
219
+ navigateToPreviousItem() {
220
+ if (this.currentFocusedItemIndex > 0) {
221
+ this.currentFocusedItemIndex--;
222
+ this.groupItems.get(this.currentFocusedItemIndex).nativeElement.focus();
223
+ }
224
+ else if (this.currentFocusedItemIndex === 0) {
225
+ this.currentFocusedItemIndex = this.groupItems.length - 1;
226
+ this.groupItems.get(this.currentFocusedItemIndex).nativeElement.focus();
227
+ }
228
+ }
229
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GroupToolbarToolComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
230
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GroupToolbarToolComponent, isStandalone: true, selector: "kendo-group-toolbar-tool", inputs: { adaptive: "adaptive" }, outputs: { close: "close", groupClear: "groupClear" }, host: { listeners: { "keydown.escape": "onEscKeyDown($event)" }, properties: { "class.k-group-menu": "this.hostClass", "class.k-group-menu-lg": "this.lgClass", "class.k-group-menu-md": "this.mdClass" } }, viewQueries: [{ propertyName: "groupItems", predicate: ["groupItem"], descendants: true, read: ElementRef }], ngImport: i0, template: `
231
+ <div *ngIf="groupedColumns.length" class="k-group-menu-item-wrap">
232
+ <div *ngFor="let column of groupedColumns; let i = index"
233
+ #groupItem
234
+ role="button"
235
+ class="k-group-menu-item"
236
+ tabindex="0"
237
+ (keydown)="handleGroupedKeydown(column, i, $event)"
238
+ (focus)="onItemFocus(i, 0)"
239
+ >
240
+ <span class="k-group-menu-item-actions" *ngIf="groupedColumns.length > 1">
241
+ <span
242
+ class="k-group-menu-item-action k-group-menu-item-up-action"
243
+ (click)="moveGroupUp(column, $event)"
244
+ [attr.aria-disabled]="i === 0"
245
+ [class.k-disabled]="i === 0"
246
+ >
247
+ <kendo-icon-wrapper
248
+ name="arrow-chevron-up"
249
+ [svgIcon]="upIcon"
250
+ [size]="iconSize"
251
+ ></kendo-icon-wrapper>
252
+ </span>
253
+ <span
254
+ class="k-group-menu-item-action k-group-menu-item-down-action"
255
+ (click)="moveGroupDown(column, $event)"
256
+ [attr.aria-disabled]="i === groupedColumns.length - 1"
257
+ [class.k-disabled]="i === groupedColumns.length - 1"
258
+ >
259
+ <kendo-icon-wrapper
260
+ name="arrow-chevron-down"
261
+ [svgIcon]="downIcon"
262
+ [size]="iconSize"
263
+ ></kendo-icon-wrapper>
264
+ </span>
265
+ </span>
266
+ <span class="k-group-item-text">{{column.title || getColumnComponent(column).field}}</span>
267
+ <span class="k-spacer"></span>
268
+ <span class="k-group-menu-item-actions">
269
+ <span class="k-group-menu-item-action k-group-menu-item-remove-action" (click)="removeGroup(column, $event)">
270
+ <kendo-icon-wrapper
271
+ name="x-circle"
272
+ [svgIcon]="removeIcon"
273
+ [size]="iconSize"
274
+ ></kendo-icon-wrapper>
275
+ </span>
276
+ </span>
277
+ </div>
278
+ </div>
279
+
280
+ <div *ngIf="ungroupedColumns.length" class="k-group-menu-item-wrap">
281
+ <div *ngFor="let column of ungroupedColumns; let i = index"
282
+ #groupItem
283
+ role="button"
284
+ class="k-group-menu-item"
285
+ tabindex="0"
286
+ (keydown)="handleUngroupedKeydown(column, i, $event)"
287
+ (focus)="onItemFocus(null, i)"
288
+ >
289
+ <span class="k-group-item-text">{{column.title || getColumnComponent(column).field}}</span>
290
+ <span class="k-spacer"></span>
291
+ <span class="k-group-menu-item-actions">
292
+ <span class="k-group-menu-item-action k-group-menu-item-add-action" (click)="addGroup(column, $event)">
293
+ <kendo-icon-wrapper
294
+ name="plus-circle"
295
+ [svgIcon]="addIcon"
296
+ [size]="iconSize"
297
+ ></kendo-icon-wrapper>
298
+ </span>
299
+ </span>
300
+ </div>
301
+ </div>
302
+
303
+ <div *ngIf="!adaptive" class="k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer">
304
+ <button kendoButton
305
+ [svgIcon]="clearIcon"
306
+ (click)="clear()"
307
+ icon="x"
308
+ >
309
+ {{ctx?.localization.get('groupClearButton')}}
310
+ </button>
311
+ </div>
312
+ `, 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"] }] });
313
+ }
314
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GroupToolbarToolComponent, decorators: [{
315
+ type: Component,
316
+ args: [{
317
+ selector: 'kendo-group-toolbar-tool',
318
+ template: `
319
+ <div *ngIf="groupedColumns.length" class="k-group-menu-item-wrap">
320
+ <div *ngFor="let column of groupedColumns; let i = index"
321
+ #groupItem
322
+ role="button"
323
+ class="k-group-menu-item"
324
+ tabindex="0"
325
+ (keydown)="handleGroupedKeydown(column, i, $event)"
326
+ (focus)="onItemFocus(i, 0)"
327
+ >
328
+ <span class="k-group-menu-item-actions" *ngIf="groupedColumns.length > 1">
329
+ <span
330
+ class="k-group-menu-item-action k-group-menu-item-up-action"
331
+ (click)="moveGroupUp(column, $event)"
332
+ [attr.aria-disabled]="i === 0"
333
+ [class.k-disabled]="i === 0"
334
+ >
335
+ <kendo-icon-wrapper
336
+ name="arrow-chevron-up"
337
+ [svgIcon]="upIcon"
338
+ [size]="iconSize"
339
+ ></kendo-icon-wrapper>
340
+ </span>
341
+ <span
342
+ class="k-group-menu-item-action k-group-menu-item-down-action"
343
+ (click)="moveGroupDown(column, $event)"
344
+ [attr.aria-disabled]="i === groupedColumns.length - 1"
345
+ [class.k-disabled]="i === groupedColumns.length - 1"
346
+ >
347
+ <kendo-icon-wrapper
348
+ name="arrow-chevron-down"
349
+ [svgIcon]="downIcon"
350
+ [size]="iconSize"
351
+ ></kendo-icon-wrapper>
352
+ </span>
353
+ </span>
354
+ <span class="k-group-item-text">{{column.title || getColumnComponent(column).field}}</span>
355
+ <span class="k-spacer"></span>
356
+ <span class="k-group-menu-item-actions">
357
+ <span class="k-group-menu-item-action k-group-menu-item-remove-action" (click)="removeGroup(column, $event)">
358
+ <kendo-icon-wrapper
359
+ name="x-circle"
360
+ [svgIcon]="removeIcon"
361
+ [size]="iconSize"
362
+ ></kendo-icon-wrapper>
363
+ </span>
364
+ </span>
365
+ </div>
366
+ </div>
367
+
368
+ <div *ngIf="ungroupedColumns.length" class="k-group-menu-item-wrap">
369
+ <div *ngFor="let column of ungroupedColumns; let i = index"
370
+ #groupItem
371
+ role="button"
372
+ class="k-group-menu-item"
373
+ tabindex="0"
374
+ (keydown)="handleUngroupedKeydown(column, i, $event)"
375
+ (focus)="onItemFocus(null, i)"
376
+ >
377
+ <span class="k-group-item-text">{{column.title || getColumnComponent(column).field}}</span>
378
+ <span class="k-spacer"></span>
379
+ <span class="k-group-menu-item-actions">
380
+ <span class="k-group-menu-item-action k-group-menu-item-add-action" (click)="addGroup(column, $event)">
381
+ <kendo-icon-wrapper
382
+ name="plus-circle"
383
+ [svgIcon]="addIcon"
384
+ [size]="iconSize"
385
+ ></kendo-icon-wrapper>
386
+ </span>
387
+ </span>
388
+ </div>
389
+ </div>
390
+
391
+ <div *ngIf="!adaptive" class="k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer">
392
+ <button kendoButton
393
+ [svgIcon]="clearIcon"
394
+ (click)="clear()"
395
+ icon="x"
396
+ >
397
+ {{ctx?.localization.get('groupClearButton')}}
398
+ </button>
399
+ </div>
400
+ `,
401
+ standalone: true,
402
+ imports: [NgFor, NgIf, IconWrapperComponent, KENDO_BUTTON]
403
+ }]
404
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { hostClass: [{
405
+ type: HostBinding,
406
+ args: ['class.k-group-menu']
407
+ }], lgClass: [{
408
+ type: HostBinding,
409
+ args: ['class.k-group-menu-lg']
410
+ }], mdClass: [{
411
+ type: HostBinding,
412
+ args: ['class.k-group-menu-md']
413
+ }], onEscKeyDown: [{
414
+ type: HostListener,
415
+ args: ['keydown.escape', ['$event']]
416
+ }], groupItems: [{
417
+ type: ViewChildren,
418
+ args: ['groupItem', { read: ElementRef }]
419
+ }], adaptive: [{
420
+ type: Input
421
+ }], close: [{
422
+ type: Output
423
+ }], groupClear: [{
424
+ type: Output
425
+ }] } });
@@ -52,6 +52,7 @@ export class SortCommandToolbarDirective {
52
52
  nextId = incrementingId++;
53
53
  toolSubs = new Subscription();
54
54
  popupSubs;
55
+ actionSheetCloseSub;
55
56
  removeClickListener;
56
57
  /**
57
58
  * @hidden
@@ -74,6 +75,7 @@ export class SortCommandToolbarDirective {
74
75
  this.toolSubs.add(this.sortService.changes.subscribe(sort => {
75
76
  this.host.showBadge = this.isSortingApplied(sort);
76
77
  }));
78
+ this.host.hasBadgeContainer = true;
77
79
  this.host.showBadge = this.isSortingApplied(this.ctx.grid.sort);
78
80
  const hasToolbarIcon = isPresent(this.host.toolbarOptions.icon) && this.host.toolbarOptions.icon !== '';
79
81
  const hasOverflowIcon = isPresent(this.host.overflowOptions.icon) && this.host.overflowOptions.icon !== '';
@@ -107,6 +109,10 @@ export class SortCommandToolbarDirective {
107
109
  this.popupRef.close();
108
110
  this.popupRef = null;
109
111
  }
112
+ if (this.actionSheetCloseSub) {
113
+ this.actionSheetCloseSub.unsubscribe();
114
+ this.actionSheetCloseSub = null;
115
+ }
110
116
  if (this.removeClickListener) {
111
117
  this.removeClickListener();
112
118
  this.removeClickListener = null;
@@ -118,6 +124,8 @@ export class SortCommandToolbarDirective {
118
124
  if (!this.ctx.grid.isActionSheetExpanded) {
119
125
  this.adaptiveGridService.viewType = 'sortToolbarTool';
120
126
  this.ctx.grid.adaptiveRenderer.actionSheet.toggle(true);
127
+ this.host.selected = true;
128
+ this.actionSheetCloseSub = this.ctx.grid.adaptiveRenderer.actionSheet.collapse.subscribe(() => this.host.selected = false);
121
129
  }
122
130
  }
123
131
  else {