@progress/kendo-angular-grid 19.0.0-develop.3 → 19.0.0-develop.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adaptiveness/adaptive-mode.d.ts +12 -0
- package/adaptiveness/adaptive-renderer.component.d.ts +84 -0
- package/codemods/template-transformer/index.js +94 -0
- package/codemods/utils.js +553 -0
- package/codemods/v19/grid-kendogridgroupbinding.js +51 -0
- package/column-menu/column-chooser.component.d.ts +4 -0
- package/column-menu/column-list.component.d.ts +10 -3
- package/column-menu/column-menu-item.component.d.ts +48 -3
- package/column-menu/column-menu-item.directive.d.ts +5 -2
- package/column-menu/column-menu.component.d.ts +4 -2
- package/columns/column-base.d.ts +5 -0
- package/columns/span-column.component.d.ts +2 -2
- package/common/adaptiveness.service.d.ts +50 -0
- package/common/single-popup.service.d.ts +3 -1
- package/common/toolbar-tool-base.directive.d.ts +26 -0
- package/directives.d.ts +12 -5
- package/dragdrop/drag-hint.service.d.ts +3 -2
- package/editing/add-command-tool.directive.d.ts +7 -6
- package/editing/cancel-command-tool.directive.d.ts +38 -0
- package/editing/edit-command-tool.directive.d.ts +38 -0
- package/editing/edit.service.d.ts +1 -1
- package/editing/remove-command-tool.directive.d.ts +39 -0
- package/editing/save-command-tool.directive.d.ts +38 -0
- package/editing/toolbar-editing-tool-base.directive.d.ts +29 -0
- package/editing-directives/editing-directive-base.d.ts +4 -1
- package/editing-directives/external-editing.directive.d.ts +3 -1
- package/esm2022/adaptiveness/adaptive-mode.mjs +5 -0
- package/esm2022/adaptiveness/adaptive-renderer.component.mjs +1108 -0
- package/esm2022/column-menu/column-chooser.component.mjs +13 -11
- package/esm2022/column-menu/column-list.component.mjs +51 -8
- package/esm2022/column-menu/column-menu-autosize-all.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-autosize.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-chooser.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-container.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-filter.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-item.component.mjs +123 -12
- package/esm2022/column-menu/column-menu-item.directive.mjs +14 -5
- package/esm2022/column-menu/column-menu-lock.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-position.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-sort.component.mjs +1 -1
- package/esm2022/column-menu/column-menu-stick.component.mjs +1 -1
- package/esm2022/column-menu/column-menu.component.mjs +68 -44
- package/esm2022/column-resizing/column-handle.directive.mjs +2 -2
- package/esm2022/columns/column-base.mjs +9 -0
- package/esm2022/columns/columns-container.mjs +1 -1
- package/esm2022/columns/span-column.component.mjs +9 -9
- package/esm2022/common/adaptiveness.service.mjs +72 -0
- package/esm2022/common/single-popup.service.mjs +9 -3
- package/esm2022/common/toolbar-tool-base.directive.mjs +81 -0
- package/esm2022/directives.mjs +18 -3
- package/esm2022/dragdrop/drag-hint.service.mjs +7 -4
- package/esm2022/editing/add-command-tool.directive.mjs +12 -15
- package/esm2022/editing/cancel-command-tool.directive.mjs +64 -0
- package/esm2022/editing/edit-command-tool.directive.mjs +59 -0
- package/esm2022/editing/form/form-formfield.component.mjs +1 -1
- package/esm2022/editing/remove-command-tool.directive.mjs +60 -0
- package/esm2022/editing/remove-command.directive.mjs +1 -0
- package/esm2022/editing/save-command-tool.directive.mjs +64 -0
- package/esm2022/editing/toolbar-editing-tool-base.directive.mjs +94 -0
- package/esm2022/editing-directives/editing-directive-base.mjs +5 -2
- package/esm2022/editing-directives/external-editing.directive.mjs +28 -14
- package/esm2022/excel/excel-command-tool.directive.mjs +12 -17
- package/esm2022/filtering/cell/autocomplete-filter-cell.component.mjs +1 -1
- package/esm2022/filtering/cell/boolean-filter-cell.component.mjs +1 -1
- package/esm2022/filtering/cell/date-filter-cell.component.mjs +1 -1
- package/esm2022/filtering/cell/filter-cell-operators.component.mjs +1 -1
- package/esm2022/filtering/filter-input.directive.mjs +14 -2
- package/esm2022/filtering/menu/boolean-filter-menu.component.mjs +4 -2
- package/esm2022/filtering/menu/date-filter-menu-input.component.mjs +5 -1
- package/esm2022/filtering/menu/date-filter-menu.component.mjs +7 -1
- package/esm2022/filtering/menu/filter-menu-container.component.mjs +21 -10
- package/esm2022/filtering/menu/filter-menu-input-wrapper.component.mjs +27 -5
- package/esm2022/filtering/menu/filter-menu.component.mjs +44 -29
- package/esm2022/filtering/menu/numeric-filter-menu-input.component.mjs +2 -0
- package/esm2022/filtering/menu/numeric-filter-menu.component.mjs +7 -1
- package/esm2022/filtering/menu/string-filter-menu-input.component.mjs +2 -0
- package/esm2022/filtering/menu/string-filter-menu.component.mjs +11 -2
- package/esm2022/grid.component.mjs +358 -82
- package/esm2022/grid.module.mjs +114 -101
- package/esm2022/index.mjs +10 -1
- package/esm2022/localization/messages.mjs +104 -2
- package/esm2022/navigation/navigation.service.mjs +1 -1
- package/esm2022/navigation/toolbar-tool-name.mjs +17 -0
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/pdf/pdf-command-tool.directive.mjs +12 -15
- package/esm2022/rendering/cell.component.mjs +4 -4
- package/esm2022/rendering/header/header.component.mjs +1 -1
- package/esm2022/rendering/list.component.mjs +1 -1
- package/esm2022/rendering/table-body.component.mjs +11 -3
- package/esm2022/rendering/toolbar/tools/column-chooser-tool.directive.mjs +203 -0
- package/esm2022/rendering/toolbar/tools/filter-command-tool.directive.mjs +61 -34
- package/esm2022/rendering/toolbar/tools/filter-tool-wrapper.component.mjs +29 -8
- package/esm2022/rendering/toolbar/tools/filter-toolbar-tool.component.mjs +73 -8
- package/esm2022/rendering/toolbar/tools/sort-command-tool.directive.mjs +46 -20
- package/esm2022/rendering/toolbar/tools/sort-toolbar-tool.component.mjs +24 -8
- package/esm2022/row-reordering/row-reorder.service.mjs +15 -0
- package/esm2022/selection/selection.service.mjs +11 -0
- package/esm2022/state-management/grid-state.models.mjs +26 -0
- package/esm2022/state-management/redo-command-tool.mjs +66 -0
- package/esm2022/state-management/undo-command-tool.mjs +66 -0
- package/esm2022/state-management/undo-redo.directive.mjs +178 -0
- package/esm2022/state-management/undo-redo.service.mjs +22 -0
- package/esm2022/state-management/undo-redo.stack.mjs +232 -0
- package/esm2022/utils.mjs +13 -13
- package/excel/excel-command-tool.directive.d.ts +5 -5
- package/fesm2022/progress-kendo-angular-grid.mjs +4672 -1798
- package/filtering/filter-input.directive.d.ts +1 -0
- package/filtering/menu/date-filter-menu-input.component.d.ts +1 -1
- package/filtering/menu/filter-menu-container.component.d.ts +14 -4
- package/filtering/menu/filter-menu-input-wrapper.component.d.ts +8 -3
- package/filtering/menu/filter-menu.component.d.ts +6 -3
- package/filtering/menu/numeric-filter-menu-input.component.d.ts +1 -1
- package/filtering/menu/string-filter-menu-input.component.d.ts +1 -1
- package/filtering/menu/string-filter-menu.component.d.ts +1 -0
- package/grid.component.d.ts +86 -33
- package/grid.module.d.ts +107 -100
- package/index.d.ts +9 -1
- package/localization/messages.d.ts +70 -2
- package/navigation/toolbar-tool-name.d.ts +17 -0
- package/package.json +36 -20
- package/pdf/pdf-command-tool.directive.d.ts +6 -5
- package/rendering/cell.component.d.ts +1 -1
- package/{column-menu → rendering/toolbar/tools}/column-chooser-tool.directive.d.ts +17 -6
- package/rendering/toolbar/tools/filter-command-tool.directive.d.ts +9 -1
- package/rendering/toolbar/tools/filter-tool-wrapper.component.d.ts +6 -5
- package/rendering/toolbar/tools/filter-toolbar-tool.component.d.ts +11 -2
- package/rendering/toolbar/tools/sort-command-tool.directive.d.ts +9 -1
- package/rendering/toolbar/tools/sort-toolbar-tool.component.d.ts +5 -1
- package/row-reordering/row-reorder.service.d.ts +2 -0
- package/schematics/ngAdd/index.js +4 -4
- package/selection/selection.service.d.ts +1 -0
- package/state-management/grid-state.models.d.ts +58 -0
- package/state-management/redo-command-tool.d.ts +38 -0
- package/state-management/undo-command-tool.d.ts +38 -0
- package/state-management/undo-redo.directive.d.ts +51 -0
- package/state-management/undo-redo.service.d.ts +19 -0
- package/state-management/undo-redo.stack.d.ts +104 -0
- package/utils.d.ts +11 -5
- package/esm2022/column-menu/column-chooser-tool.directive.mjs +0 -172
|
@@ -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
|
/**
|
|
@@ -26,22 +27,23 @@ export class FilterToolWrapperComponent {
|
|
|
26
27
|
this.close.emit();
|
|
27
28
|
this.hostButton?.focus(event);
|
|
28
29
|
}
|
|
30
|
+
onClick(event) {
|
|
31
|
+
if (this.hostButton.location !== 'toolbar') {
|
|
32
|
+
event.stopImmediatePropagation();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
29
35
|
close = new EventEmitter();
|
|
30
36
|
hostButton;
|
|
31
37
|
clearIcon = filterClearIcon;
|
|
32
38
|
columnInfoService;
|
|
33
|
-
popupRef;
|
|
34
|
-
filter;
|
|
35
|
-
subscriptions;
|
|
36
|
-
_ctx;
|
|
37
39
|
set ctx(ctx) {
|
|
38
40
|
this._ctx = ctx;
|
|
41
|
+
this.filter = ctx.grid.filter;
|
|
39
42
|
this.createPopup();
|
|
40
43
|
}
|
|
41
44
|
get ctx() {
|
|
42
45
|
return this._ctx;
|
|
43
46
|
}
|
|
44
|
-
_filterService;
|
|
45
47
|
set filterService(filterService) {
|
|
46
48
|
this._filterService = filterService;
|
|
47
49
|
this.subscriptions = this._filterService.changes.subscribe(filter => {
|
|
@@ -53,6 +55,11 @@ export class FilterToolWrapperComponent {
|
|
|
53
55
|
return this._filterService;
|
|
54
56
|
}
|
|
55
57
|
columnMenuService;
|
|
58
|
+
popupRef;
|
|
59
|
+
filter;
|
|
60
|
+
subscriptions;
|
|
61
|
+
_ctx;
|
|
62
|
+
_filterService;
|
|
56
63
|
constructor(injector) {
|
|
57
64
|
this.injector = injector;
|
|
58
65
|
}
|
|
@@ -81,6 +88,7 @@ export class FilterToolWrapperComponent {
|
|
|
81
88
|
{ provide: FilterService, useValue: this._filterService },
|
|
82
89
|
{ provide: ContextService, useValue: this._ctx },
|
|
83
90
|
{ provide: ColumnInfoService, useValue: this.columnInfoService },
|
|
91
|
+
AdaptiveGridService,
|
|
84
92
|
SinglePopupService,
|
|
85
93
|
ScrollSyncService
|
|
86
94
|
],
|
|
@@ -93,10 +101,15 @@ export class FilterToolWrapperComponent {
|
|
|
93
101
|
}
|
|
94
102
|
}
|
|
95
103
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterToolWrapperComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
96
|
-
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)" }, 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: `
|
|
104
|
+
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: `
|
|
97
105
|
<ng-container #container></ng-container>
|
|
98
106
|
<div class="k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer">
|
|
99
|
-
<button kendoButton
|
|
107
|
+
<button kendoButton
|
|
108
|
+
[svgIcon]="clearIcon"
|
|
109
|
+
icon="filter-clear"
|
|
110
|
+
(click)="clear()">
|
|
111
|
+
{{ctx?.localization.get('filterClearAllButton')}}
|
|
112
|
+
</button>
|
|
100
113
|
</div>
|
|
101
114
|
`, 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"] }] });
|
|
102
115
|
}
|
|
@@ -107,7 +120,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
107
120
|
template: `
|
|
108
121
|
<ng-container #container></ng-container>
|
|
109
122
|
<div class="k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer">
|
|
110
|
-
<button kendoButton
|
|
123
|
+
<button kendoButton
|
|
124
|
+
[svgIcon]="clearIcon"
|
|
125
|
+
icon="filter-clear"
|
|
126
|
+
(click)="clear()">
|
|
127
|
+
{{ctx?.localization.get('filterClearAllButton')}}
|
|
128
|
+
</button>
|
|
111
129
|
</div>
|
|
112
130
|
`,
|
|
113
131
|
standalone: true,
|
|
@@ -125,6 +143,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
125
143
|
}], onEscKeyDown: [{
|
|
126
144
|
type: HostListener,
|
|
127
145
|
args: ['keydown.escape', ['$event']]
|
|
146
|
+
}], onClick: [{
|
|
147
|
+
type: HostListener,
|
|
148
|
+
args: ['click', ['$event']]
|
|
128
149
|
}], close: [{
|
|
129
150
|
type: Output
|
|
130
151
|
}] } });
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, ElementRef, EventEmitter, Output, QueryList, ViewChildren } from '@angular/core';
|
|
5
|
+
import { Component, ElementRef, EventEmitter, NgZone, Output, QueryList, ViewChildren } from '@angular/core';
|
|
6
6
|
import { ContextService } from '../../../common/provider.service';
|
|
7
7
|
import { NgFor } from '@angular/common';
|
|
8
8
|
import { KENDO_BUTTON } from '@progress/kendo-angular-buttons';
|
|
@@ -12,10 +12,13 @@ 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';
|
|
16
|
+
import { take } from 'rxjs/operators';
|
|
15
17
|
import * as i0 from "@angular/core";
|
|
16
18
|
import * as i1 from "../../../filtering/filter.service";
|
|
17
19
|
import * as i2 from "../../../common/provider.service";
|
|
18
20
|
import * as i3 from "../../../common/column-info.service";
|
|
21
|
+
import * as i4 from "../../../common/adaptiveness.service";
|
|
19
22
|
/**
|
|
20
23
|
* @hidden
|
|
21
24
|
*/
|
|
@@ -24,6 +27,8 @@ export class FilterToolbarToolComponent {
|
|
|
24
27
|
filterService;
|
|
25
28
|
ctx;
|
|
26
29
|
columnInfoService;
|
|
30
|
+
ngZone;
|
|
31
|
+
adaptiveGridService;
|
|
27
32
|
filterItems;
|
|
28
33
|
menuItems;
|
|
29
34
|
filterContainers;
|
|
@@ -38,12 +43,44 @@ export class FilterToolbarToolComponent {
|
|
|
38
43
|
columnMenuService;
|
|
39
44
|
columns;
|
|
40
45
|
filter;
|
|
46
|
+
isFilterApplied(column) {
|
|
47
|
+
if (!this.filter?.filters) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
if (Array.isArray(this.filter.filters)) {
|
|
51
|
+
for (const filterGroup of this.filter.filters) {
|
|
52
|
+
if (filterGroup.filters && Array.isArray(filterGroup.filters)) {
|
|
53
|
+
for (const filter of filterGroup.filters) {
|
|
54
|
+
if (filter.field === column.field) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else if (filterGroup.field === column.field) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
isItemFocused(filterItem) {
|
|
67
|
+
return this.currentFocusedItem === filterItem;
|
|
68
|
+
}
|
|
69
|
+
onItemFocus(item) {
|
|
70
|
+
this.currentFocusedItem = item;
|
|
71
|
+
}
|
|
72
|
+
onItemFocusOut() {
|
|
73
|
+
this.currentFocusedItem = null;
|
|
74
|
+
}
|
|
75
|
+
currentFocusedItem = null;
|
|
41
76
|
subscriptions;
|
|
42
|
-
constructor(element, filterService, ctx, columnInfoService) {
|
|
77
|
+
constructor(element, filterService, ctx, columnInfoService, ngZone, adaptiveGridService) {
|
|
43
78
|
this.element = element;
|
|
44
79
|
this.filterService = filterService;
|
|
45
80
|
this.ctx = ctx;
|
|
46
81
|
this.columnInfoService = columnInfoService;
|
|
82
|
+
this.ngZone = ngZone;
|
|
83
|
+
this.adaptiveGridService = adaptiveGridService;
|
|
47
84
|
}
|
|
48
85
|
ngOnInit() {
|
|
49
86
|
this.columns = this.columnInfoService.leafNamedColumns.filter(column => column?.filterable);
|
|
@@ -53,13 +90,29 @@ export class FilterToolbarToolComponent {
|
|
|
53
90
|
});
|
|
54
91
|
}
|
|
55
92
|
ngAfterViewInit() {
|
|
56
|
-
this.
|
|
93
|
+
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
94
|
+
this.filterItems?.get(0)?.nativeElement.focus();
|
|
95
|
+
});
|
|
57
96
|
}
|
|
58
97
|
ngOnDestroy() {
|
|
59
98
|
if (this.subscriptions) {
|
|
60
99
|
this.subscriptions.unsubscribe();
|
|
61
100
|
}
|
|
62
101
|
}
|
|
102
|
+
navigateView(column) {
|
|
103
|
+
if (this.ctx.grid.isActionSheetExpanded && this.adaptiveGridService.viewType === 'filterToolbarTool') {
|
|
104
|
+
const componentRef = this.ctx.grid.adaptiveRenderer.filterToolbarToolTemplate.createComponent(FilterMenuContainerComponent);
|
|
105
|
+
componentRef.instance.column = this.getColumnComponent(column);
|
|
106
|
+
componentRef.instance.filter = this.filter;
|
|
107
|
+
this.subscriptions.add(componentRef.instance.close.subscribe(() => {
|
|
108
|
+
this.adaptiveGridService.reset();
|
|
109
|
+
}));
|
|
110
|
+
this.adaptiveGridService.filterMenuContainerComponentRef = componentRef;
|
|
111
|
+
this.adaptiveGridService.secondaryView = 'columnFilter';
|
|
112
|
+
this.adaptiveGridService.column = this.getColumnComponent(column);
|
|
113
|
+
this.ctx.grid.adaptiveRenderer.actionSheet.nextView();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
63
116
|
getColumnComponent(column) {
|
|
64
117
|
return column;
|
|
65
118
|
}
|
|
@@ -83,16 +136,22 @@ export class FilterToolbarToolComponent {
|
|
|
83
136
|
menuItem.contentState = 'expanded';
|
|
84
137
|
}
|
|
85
138
|
}
|
|
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 });
|
|
139
|
+
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: i0.NgZone }, { token: i4.AdaptiveGridService }], target: i0.ɵɵFactoryTarget.Component });
|
|
87
140
|
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
141
|
<div [style]="hostStyles">
|
|
89
142
|
<kendo-grid-columnmenu-item *ngFor="let column of columns; let i = index"
|
|
90
143
|
class="k-columnmenu-item-wrapper" #filterItem
|
|
91
144
|
role="button"
|
|
92
145
|
tabindex="0"
|
|
146
|
+
[column]="getColumnComponent(column)"
|
|
93
147
|
[text]="column.title || getColumnComponent(column).field"
|
|
148
|
+
(focus)="onItemFocus(filterItem)"
|
|
149
|
+
(focusout)="onItemFocusOut()"
|
|
94
150
|
(keydown.enter)="toggleItem($event, i)"
|
|
95
|
-
[
|
|
151
|
+
[indicatorIcon]="isFilterApplied(column)"
|
|
152
|
+
(itemClick)="navigateView(getColumnComponent(column))"
|
|
153
|
+
[expanded]="false"
|
|
154
|
+
[focused]="isItemFocused(filterItem)">
|
|
96
155
|
<ng-template kendoGridColumnMenuItemContentTemplate>
|
|
97
156
|
<kendo-grid-filter-menu-container
|
|
98
157
|
#filterContainer
|
|
@@ -105,7 +164,7 @@ export class FilterToolbarToolComponent {
|
|
|
105
164
|
</ng-template>
|
|
106
165
|
</kendo-grid-columnmenu-item>
|
|
107
166
|
</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]" }] });
|
|
167
|
+
`, 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", "indicatorIcon", "text", "selected", "disabled", "expanded", "focused", "service", "column"], outputs: ["itemClick", "expand", "collapse"] }, { kind: "directive", type: ColumnMenuItemContentTemplateDirective, selector: "[kendoGridColumnMenuItemContentTemplate]" }] });
|
|
109
168
|
}
|
|
110
169
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilterToolbarToolComponent, decorators: [{
|
|
111
170
|
type: Component,
|
|
@@ -117,9 +176,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
117
176
|
class="k-columnmenu-item-wrapper" #filterItem
|
|
118
177
|
role="button"
|
|
119
178
|
tabindex="0"
|
|
179
|
+
[column]="getColumnComponent(column)"
|
|
120
180
|
[text]="column.title || getColumnComponent(column).field"
|
|
181
|
+
(focus)="onItemFocus(filterItem)"
|
|
182
|
+
(focusout)="onItemFocusOut()"
|
|
121
183
|
(keydown.enter)="toggleItem($event, i)"
|
|
122
|
-
[
|
|
184
|
+
[indicatorIcon]="isFilterApplied(column)"
|
|
185
|
+
(itemClick)="navigateView(getColumnComponent(column))"
|
|
186
|
+
[expanded]="false"
|
|
187
|
+
[focused]="isItemFocused(filterItem)">
|
|
123
188
|
<ng-template kendoGridColumnMenuItemContentTemplate>
|
|
124
189
|
<kendo-grid-filter-menu-container
|
|
125
190
|
#filterContainer
|
|
@@ -136,7 +201,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
136
201
|
standalone: true,
|
|
137
202
|
imports: [NgFor, KENDO_BUTTON, FilterMenuContainerComponent, ColumnMenuItemComponent, ColumnMenuItemContentTemplateDirective]
|
|
138
203
|
}]
|
|
139
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.FilterService }, { type: i2.ContextService }, { type: i3.ColumnInfoService }]; }, propDecorators: { filterItems: [{
|
|
204
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.FilterService }, { type: i2.ContextService }, { type: i3.ColumnInfoService }, { type: i0.NgZone }, { type: i4.AdaptiveGridService }]; }, propDecorators: { filterItems: [{
|
|
140
205
|
type: ViewChildren,
|
|
141
206
|
args: ['filterItem', { read: ElementRef }]
|
|
142
207
|
}], 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,19 @@ 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
|
-
|
|
56
|
+
/**
|
|
57
|
+
* @hidden
|
|
58
|
+
*/
|
|
59
|
+
isSortingApplied(sort) {
|
|
60
|
+
return isPresent(sort) && sort.length > 0 && sort.filter(item => item.dir !== undefined).length > 0;
|
|
61
|
+
}
|
|
62
|
+
constructor(host, popupService, ctx, sortService, columnInfoService, ngZone, renderer, adaptiveGridService) {
|
|
54
63
|
this.host = host;
|
|
55
64
|
this.popupService = popupService;
|
|
56
65
|
this.ctx = ctx;
|
|
@@ -58,19 +67,20 @@ export class SortCommandToolbarDirective {
|
|
|
58
67
|
this.columnInfoService = columnInfoService;
|
|
59
68
|
this.ngZone = ngZone;
|
|
60
69
|
this.renderer = renderer;
|
|
70
|
+
this.adaptiveGridService = adaptiveGridService;
|
|
61
71
|
}
|
|
62
72
|
ngOnInit() {
|
|
63
73
|
this.toolSubs = this.host.click.subscribe(e => this.onClick(e));
|
|
64
74
|
this.toolSubs.add(this.sortService.changes.subscribe(sort => {
|
|
65
|
-
|
|
66
|
-
this.host.showBadge = isSortingApplied;
|
|
75
|
+
this.host.showBadge = this.isSortingApplied(sort);
|
|
67
76
|
}));
|
|
77
|
+
this.host.showBadge = this.isSortingApplied(this.ctx.grid.sort);
|
|
68
78
|
const hasToolbarIcon = isPresent(this.host.toolbarOptions.icon) && this.host.toolbarOptions.icon !== '';
|
|
69
79
|
const hasOverflowIcon = isPresent(this.host.overflowOptions.icon) && this.host.overflowOptions.icon !== '';
|
|
70
80
|
const hasIcon = hasToolbarIcon && hasOverflowIcon;
|
|
71
81
|
const hasSvgIcon = isPresent(this.host.toolbarOptions.svgIcon) && isPresent(this.host.overflowOptions.svgIcon);
|
|
72
82
|
if (!hasIcon) {
|
|
73
|
-
this.host.icon = '
|
|
83
|
+
this.host.icon = 'arrows-swap';
|
|
74
84
|
}
|
|
75
85
|
if (!hasSvgIcon) {
|
|
76
86
|
this.host.svgIcon = arrowsSwapIcon;
|
|
@@ -82,9 +92,9 @@ export class SortCommandToolbarDirective {
|
|
|
82
92
|
this.host.text = this.ctx.localization.get(`sortToolbarToolText`);
|
|
83
93
|
});
|
|
84
94
|
}
|
|
85
|
-
this.
|
|
86
|
-
this.
|
|
87
|
-
this.
|
|
95
|
+
this.buttonElement?.setAttribute('aria-haspopup', 'dialog');
|
|
96
|
+
this.buttonElement?.setAttribute('aria-expanded', 'false');
|
|
97
|
+
this.buttonElement?.setAttribute('title', this.ctx.localization.get('sortToolbarToolText'));
|
|
88
98
|
}
|
|
89
99
|
ngOnDestroy() {
|
|
90
100
|
if (this.toolSubs) {
|
|
@@ -104,30 +114,42 @@ export class SortCommandToolbarDirective {
|
|
|
104
114
|
}
|
|
105
115
|
onClick(e) {
|
|
106
116
|
e.preventDefault();
|
|
107
|
-
if (this.
|
|
108
|
-
this.
|
|
109
|
-
|
|
117
|
+
if (this.ctx.grid.adaptiveMode === 'auto' && this.adaptiveGridService.windowSize !== 'large') {
|
|
118
|
+
if (!this.ctx.grid.isActionSheetExpanded) {
|
|
119
|
+
this.adaptiveGridService.viewType = 'sortToolbarTool';
|
|
120
|
+
this.ctx.grid.adaptiveRenderer.actionSheet.toggle(true);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
if (this.popupRef) {
|
|
125
|
+
this.closePopup();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
this.openPopup();
|
|
110
129
|
}
|
|
111
|
-
this.openPopup();
|
|
112
130
|
}
|
|
113
131
|
openPopup() {
|
|
114
132
|
const direction = this.ctx.localization.rtl ? 'right' : 'left';
|
|
115
133
|
this.popupRef = this.popupService.open({
|
|
116
|
-
anchor: this.
|
|
134
|
+
anchor: this.buttonElement,
|
|
117
135
|
content: SortToolbarToolComponent,
|
|
118
136
|
popupClass: 'k-grid-columnmenu-popup',
|
|
119
137
|
positionMode: 'absolute',
|
|
120
138
|
anchorAlign: { vertical: 'bottom', horizontal: direction },
|
|
121
139
|
popupAlign: { vertical: 'top', horizontal: direction }
|
|
122
140
|
});
|
|
141
|
+
this.adaptiveGridService.popupRef = this.popupRef;
|
|
123
142
|
this.setPopupAttributes();
|
|
143
|
+
this.host.selected = true;
|
|
124
144
|
this.ngZone.runOutsideAngular(() => {
|
|
125
145
|
if (!isDocumentAvailable()) {
|
|
126
146
|
return;
|
|
127
147
|
}
|
|
128
148
|
this.removeClickListener = this.renderer.listen('document', 'click', (e) => {
|
|
129
|
-
if (this.popupRef && !closest(e.target, node => node === this.popupRef.popupElement || node === this.
|
|
130
|
-
this.
|
|
149
|
+
if (this.popupRef && !closest(e.target, node => node === this.popupRef.popupElement || node === this.buttonElement)) {
|
|
150
|
+
this.ngZone.run(() => {
|
|
151
|
+
this.closePopup();
|
|
152
|
+
});
|
|
131
153
|
}
|
|
132
154
|
});
|
|
133
155
|
});
|
|
@@ -145,8 +167,8 @@ export class SortCommandToolbarDirective {
|
|
|
145
167
|
this.renderer.setAttribute(popupElement, 'dir', this.ctx.localization.rtl ? 'rtl' : 'ltr');
|
|
146
168
|
this.renderer.setAttribute(popupAriaElement, 'id', popupId);
|
|
147
169
|
this.renderer.setAttribute(popupAriaElement, 'role', 'dialog');
|
|
148
|
-
this.
|
|
149
|
-
this.
|
|
170
|
+
this.buttonElement?.setAttribute('aria-expanded', 'true');
|
|
171
|
+
this.buttonElement?.setAttribute('aria-controls', popupId);
|
|
150
172
|
}
|
|
151
173
|
initPopupProperties() {
|
|
152
174
|
this.popupRef.content.instance.columnInfoService = this.columnInfoService;
|
|
@@ -161,8 +183,9 @@ export class SortCommandToolbarDirective {
|
|
|
161
183
|
}));
|
|
162
184
|
}
|
|
163
185
|
closePopup() {
|
|
164
|
-
this.
|
|
165
|
-
this.
|
|
186
|
+
this.buttonElement?.setAttribute('aria-expanded', 'false');
|
|
187
|
+
this.buttonElement?.removeAttribute('aria-controls');
|
|
188
|
+
this.host.selected = false;
|
|
166
189
|
if (this.popupRef) {
|
|
167
190
|
this.popupRef.close();
|
|
168
191
|
this.popupRef = null;
|
|
@@ -176,7 +199,10 @@ export class SortCommandToolbarDirective {
|
|
|
176
199
|
this.removeClickListener = null;
|
|
177
200
|
}
|
|
178
201
|
}
|
|
179
|
-
|
|
202
|
+
get buttonElement() {
|
|
203
|
+
return this.host.getButton();
|
|
204
|
+
}
|
|
205
|
+
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 });
|
|
180
206
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SortCommandToolbarDirective, isStandalone: true, selector: "[kendoGridSortTool]", ngImport: i0 });
|
|
181
207
|
}
|
|
182
208
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SortCommandToolbarDirective, decorators: [{
|
|
@@ -185,4 +211,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
185
211
|
selector: '[kendoGridSortTool]',
|
|
186
212
|
standalone: true
|
|
187
213
|
}]
|
|
188
|
-
}], ctorParameters: function () { return [{ type: i1.ToolBarButtonComponent }, { type: i2.PopupService }, { type: i3.ContextService }, { type: i4.SortService }, { type: i5.ColumnInfoService }, { type: i0.NgZone }, { type: i0.Renderer2 }]; } });
|
|
214
|
+
}], 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
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
export const directions = initialDirection => initialDirection === "asc" ? ["asc", "desc"] : ["desc", "asc"];
|
|
16
19
|
/**
|
|
17
20
|
* @hidden
|
|
18
21
|
*/
|
|
@@ -75,7 +78,10 @@ export class SortToolbarToolComponent {
|
|
|
75
78
|
this.subscription.unsubscribe();
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
|
-
toggleSort(column) {
|
|
81
|
+
toggleSort(column, ev) {
|
|
82
|
+
if (this.hostButton.location !== 'toolbar') {
|
|
83
|
+
ev.stopImmediatePropagation();
|
|
84
|
+
}
|
|
79
85
|
const field = column?.field;
|
|
80
86
|
if (!field) {
|
|
81
87
|
return;
|
|
@@ -142,8 +148,8 @@ export class SortToolbarToolComponent {
|
|
|
142
148
|
#sortItem
|
|
143
149
|
role="button"
|
|
144
150
|
class="k-columnmenu-item"
|
|
145
|
-
(click)="toggleSort(column)"
|
|
146
|
-
(keydown.enter)="toggleSort(column)"
|
|
151
|
+
(click)="toggleSort(column, $event)"
|
|
152
|
+
(keydown.enter)="toggleSort(column, $event)"
|
|
147
153
|
[tabindex]="'0'"
|
|
148
154
|
>
|
|
149
155
|
{{column.title || getColumnComponent(column).field}}
|
|
@@ -160,7 +166,12 @@ export class SortToolbarToolComponent {
|
|
|
160
166
|
</div>
|
|
161
167
|
|
|
162
168
|
<div class="k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer">
|
|
163
|
-
<button kendoButton
|
|
169
|
+
<button kendoButton
|
|
170
|
+
[svgIcon]="clearIcon"
|
|
171
|
+
icon="x"
|
|
172
|
+
(click)="clearSorting()">
|
|
173
|
+
{{ctx?.localization.get('sortClearButton')}}
|
|
174
|
+
</button>
|
|
164
175
|
</div>
|
|
165
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"] }] });
|
|
166
177
|
}
|
|
@@ -179,8 +190,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
179
190
|
#sortItem
|
|
180
191
|
role="button"
|
|
181
192
|
class="k-columnmenu-item"
|
|
182
|
-
(click)="toggleSort(column)"
|
|
183
|
-
(keydown.enter)="toggleSort(column)"
|
|
193
|
+
(click)="toggleSort(column, $event)"
|
|
194
|
+
(keydown.enter)="toggleSort(column, $event)"
|
|
184
195
|
[tabindex]="'0'"
|
|
185
196
|
>
|
|
186
197
|
{{column.title || getColumnComponent(column).field}}
|
|
@@ -197,7 +208,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
197
208
|
</div>
|
|
198
209
|
|
|
199
210
|
<div class="k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer">
|
|
200
|
-
<button kendoButton
|
|
211
|
+
<button kendoButton
|
|
212
|
+
[svgIcon]="clearIcon"
|
|
213
|
+
icon="x"
|
|
214
|
+
(click)="clearSorting()">
|
|
215
|
+
{{ctx?.localization.get('sortClearButton')}}
|
|
216
|
+
</button>
|
|
201
217
|
</div>
|
|
202
218
|
`,
|
|
203
219
|
standalone: true,
|
|
@@ -24,6 +24,10 @@ export class RowReorderService {
|
|
|
24
24
|
constructor(renderer) {
|
|
25
25
|
this.renderer = renderer;
|
|
26
26
|
}
|
|
27
|
+
ngOnDestroy() {
|
|
28
|
+
this.destroyDropIndicator();
|
|
29
|
+
this.destroyHintElement();
|
|
30
|
+
}
|
|
27
31
|
press(ev) {
|
|
28
32
|
this.dragTarget = ev.dragTarget;
|
|
29
33
|
this.offsetY = ev.dragEvent.offsetY;
|
|
@@ -55,12 +59,14 @@ export class RowReorderService {
|
|
|
55
59
|
}
|
|
56
60
|
dragEnd() {
|
|
57
61
|
this.destroyDropIndicator();
|
|
62
|
+
this.destroyHintElement();
|
|
58
63
|
this.dragTarget = null;
|
|
59
64
|
this.dropTarget = null;
|
|
60
65
|
this.hintElement = null;
|
|
61
66
|
}
|
|
62
67
|
drop(ev) {
|
|
63
68
|
this.destroyDropIndicator();
|
|
69
|
+
this.destroyHintElement();
|
|
64
70
|
const rowReorderArgs = this.rowReorderArgs(this.dragTarget, this.dropTarget, ev.dragData);
|
|
65
71
|
this.rowReorder.emit(rowReorderArgs);
|
|
66
72
|
}
|
|
@@ -142,6 +148,15 @@ export class RowReorderService {
|
|
|
142
148
|
this.dropIndicator = null;
|
|
143
149
|
}
|
|
144
150
|
}
|
|
151
|
+
destroyHintElement() {
|
|
152
|
+
if (!isDocumentAvailable()) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (this.hintElement?.parentElement) {
|
|
156
|
+
this.hintElement.parentElement.removeChild(this.hintElement);
|
|
157
|
+
this.hintElement = null;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
145
160
|
decorateHint() {
|
|
146
161
|
hintClasses.forEach(className => this.renderer.addClass(this.hintElement, className));
|
|
147
162
|
Object.keys(hintStyles)
|
|
@@ -144,6 +144,7 @@ export class SelectionService {
|
|
|
144
144
|
ev.rangeStartRow = { dataItem: this.lastSelectionData, index: this.lastSelectionStartIndex };
|
|
145
145
|
ev.rangeEndRow = { dataItem: item.data, index: item.index };
|
|
146
146
|
}
|
|
147
|
+
this.syncCurrentSelection(ev);
|
|
147
148
|
this.changes.emit(ev);
|
|
148
149
|
}
|
|
149
150
|
toggle(item) {
|
|
@@ -223,6 +224,7 @@ export class SelectionService {
|
|
|
223
224
|
deselectedRows: [rowArgs],
|
|
224
225
|
selectedRows: []
|
|
225
226
|
};
|
|
227
|
+
this.syncCurrentSelection(ev);
|
|
226
228
|
this.changes.emit(ev);
|
|
227
229
|
}
|
|
228
230
|
}
|
|
@@ -295,6 +297,7 @@ export class SelectionService {
|
|
|
295
297
|
if (this.options.cellAggregates) {
|
|
296
298
|
ev.cellAggregates = this.aggregateService.onSelectionChange(ev);
|
|
297
299
|
}
|
|
300
|
+
this.syncCurrentSelection(ev);
|
|
298
301
|
this.changes.emit(ev);
|
|
299
302
|
}
|
|
300
303
|
selectRange(startIndex, endIndex, preserveSelection, existingSelections = []) {
|
|
@@ -428,6 +431,14 @@ export class SelectionService {
|
|
|
428
431
|
this.dataChangedSubscription = null;
|
|
429
432
|
}
|
|
430
433
|
}
|
|
434
|
+
syncCurrentSelection(ev) {
|
|
435
|
+
for (const row of ev.deselectedRows) {
|
|
436
|
+
this.currentSelection.splice(row.index, 1);
|
|
437
|
+
}
|
|
438
|
+
for (const row of ev.selectedRows) {
|
|
439
|
+
this.currentSelection[row.index] = row;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
431
442
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectionService, deps: [{ token: i1.DomEventsService }, { token: i2.CellSelectionAggregateService }, { token: i3.LocalDataChangesService }, { token: i4.NavigationService }, { token: i5.ContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
432
443
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectionService });
|
|
433
444
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { PreventableEvent } from "@progress/kendo-angular-common";
|
|
6
|
+
/**
|
|
7
|
+
* Arguments for the `undo` and `redo` events.
|
|
8
|
+
*/
|
|
9
|
+
export class UndoRedoEvent extends PreventableEvent {
|
|
10
|
+
/**
|
|
11
|
+
* The event data of the original action that triggered the state change.
|
|
12
|
+
*/
|
|
13
|
+
originalEvent;
|
|
14
|
+
/**
|
|
15
|
+
* The grid state and rendered data at the time of the action.
|
|
16
|
+
*/
|
|
17
|
+
gridState;
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
constructor({ originalEvent, gridState }) {
|
|
22
|
+
super();
|
|
23
|
+
this.originalEvent = originalEvent;
|
|
24
|
+
this.gridState = gridState;
|
|
25
|
+
}
|
|
26
|
+
}
|