@progress/kendo-angular-grid 19.0.0-develop.17 → 19.0.0-develop.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adaptiveness/adaptive-mode.d.ts +12 -0
- package/adaptiveness/adaptive-renderer.component.d.ts +84 -0
- package/column-menu/column-chooser.component.d.ts +4 -0
- package/column-menu/column-list.component.d.ts +9 -3
- package/column-menu/column-menu-item.component.d.ts +38 -2
- package/column-menu/column-menu-item.directive.d.ts +5 -2
- package/column-menu/column-menu.component.d.ts +4 -2
- package/common/adaptiveness.service.d.ts +50 -0
- package/common/single-popup.service.d.ts +3 -1
- package/directives.d.ts +1 -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 +1106 -0
- package/esm2022/column-menu/column-chooser.component.mjs +13 -11
- package/esm2022/column-menu/column-list.component.mjs +42 -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 +106 -11
- 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 +60 -41
- package/esm2022/common/adaptiveness.service.mjs +72 -0
- package/esm2022/common/single-popup.service.mjs +9 -3
- package/esm2022/directives.mjs +1 -1
- package/esm2022/editing-directives/external-editing.directive.mjs +28 -14
- package/esm2022/filtering/menu/boolean-filter-menu.component.mjs +2 -2
- package/esm2022/filtering/menu/date-filter-menu-input.component.mjs +2 -0
- package/esm2022/filtering/menu/date-filter-menu.component.mjs +4 -0
- package/esm2022/filtering/menu/filter-menu-container.component.mjs +21 -10
- package/esm2022/filtering/menu/filter-menu-input-wrapper.component.mjs +24 -4
- package/esm2022/filtering/menu/filter-menu.component.mjs +44 -29
- package/esm2022/filtering/menu/numeric-filter-menu.component.mjs +4 -0
- package/esm2022/filtering/menu/string-filter-menu.component.mjs +4 -0
- package/esm2022/grid.component.mjs +143 -28
- package/esm2022/grid.module.mjs +1 -1
- package/esm2022/index.mjs +1 -1
- package/esm2022/localization/messages.mjs +62 -2
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/rendering/toolbar/tools/column-chooser-tool.directive.mjs +203 -0
- package/esm2022/rendering/toolbar/tools/filter-command-tool.directive.mjs +39 -26
- package/esm2022/rendering/toolbar/tools/filter-tool-wrapper.component.mjs +19 -7
- package/esm2022/rendering/toolbar/tools/filter-toolbar-tool.component.mjs +26 -4
- package/esm2022/rendering/toolbar/tools/sort-command-tool.directive.mjs +21 -8
- package/esm2022/rendering/toolbar/tools/sort-toolbar-tool.component.mjs +16 -3
- package/esm2022/utils.mjs +0 -13
- package/fesm2022/progress-kendo-angular-grid.mjs +2960 -1360
- 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/grid.component.d.ts +30 -3
- package/grid.module.d.ts +1 -1
- package/index.d.ts +1 -1
- package/localization/messages.d.ts +42 -2
- package/package.json +21 -20
- package/{column-menu → rendering/toolbar/tools}/column-chooser-tool.directive.d.ts +13 -3
- package/rendering/toolbar/tools/filter-command-tool.directive.d.ts +3 -1
- package/rendering/toolbar/tools/filter-tool-wrapper.component.d.ts +5 -5
- package/rendering/toolbar/tools/filter-toolbar-tool.component.d.ts +4 -1
- package/rendering/toolbar/tools/sort-command-tool.directive.d.ts +3 -1
- package/rendering/toolbar/tools/sort-toolbar-tool.component.d.ts +4 -0
- package/schematics/ngAdd/index.js +4 -4
- package/utils.d.ts +0 -4
- package/esm2022/column-menu/column-chooser-tool.directive.mjs +0 -160
|
@@ -0,0 +1,203 @@
|
|
|
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, Input, Renderer2, ChangeDetectorRef } from '@angular/core';
|
|
6
|
+
import { PopupService } from '@progress/kendo-angular-popup';
|
|
7
|
+
import { RefreshService, ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
8
|
+
import { ColumnListComponent } from '../../../column-menu/column-list.component';
|
|
9
|
+
import { closest, isPresent } from '@progress/kendo-angular-common';
|
|
10
|
+
import { Subscription } from 'rxjs';
|
|
11
|
+
import { columnsIcon } from '@progress/kendo-svg-icons';
|
|
12
|
+
import { ContextService } from '../../../common/provider.service';
|
|
13
|
+
import { filter, take } from 'rxjs/operators';
|
|
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';
|
|
18
|
+
import * as i0 from "@angular/core";
|
|
19
|
+
import * as i1 from "@progress/kendo-angular-popup";
|
|
20
|
+
import * as i2 from "@progress/kendo-angular-toolbar";
|
|
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";
|
|
24
|
+
let incrementingId = 0;
|
|
25
|
+
/**
|
|
26
|
+
* Represents the `column-chooser` toolbar tool of the Grid.
|
|
27
|
+
* You can apply this directive to any `kendo-toolbar-button` element inside a
|
|
28
|
+
* ToolbarComponent used in the Grid.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```html-no-run
|
|
32
|
+
* <kendo-grid>
|
|
33
|
+
* <kendo-toolbar>
|
|
34
|
+
* <kendo-toolbar-button kendoGridColumnChooserTool></kendo-toolbar-button>
|
|
35
|
+
* </kendo-toolbar>
|
|
36
|
+
* </kendo-grid>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export class ColumnChooserToolbarDirective extends ToolbarToolBase {
|
|
40
|
+
renderer;
|
|
41
|
+
popupSerivce;
|
|
42
|
+
host;
|
|
43
|
+
ctx;
|
|
44
|
+
zone;
|
|
45
|
+
refresh;
|
|
46
|
+
adaptiveGridService;
|
|
47
|
+
columnInfoService;
|
|
48
|
+
/**
|
|
49
|
+
* Specifies if the changes in the visibility of the column will be immediately applied.
|
|
50
|
+
*
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
autoSync = false;
|
|
54
|
+
/**
|
|
55
|
+
* Specifies if all columns can be hidden.
|
|
56
|
+
*
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
59
|
+
allowHideAll = true;
|
|
60
|
+
/**
|
|
61
|
+
* @hidden
|
|
62
|
+
*/
|
|
63
|
+
get columns() {
|
|
64
|
+
return this.columnInfoService.leafNamedColumns;
|
|
65
|
+
}
|
|
66
|
+
popupRef;
|
|
67
|
+
subs = new Subscription();
|
|
68
|
+
nextId = incrementingId++;
|
|
69
|
+
constructor(renderer, popupSerivce, host, ctx, zone, refresh, adaptiveGridService, columnInfoService, cdr) {
|
|
70
|
+
super(host, ToolbarToolName.columns, ctx, zone, cdr);
|
|
71
|
+
this.renderer = renderer;
|
|
72
|
+
this.popupSerivce = popupSerivce;
|
|
73
|
+
this.host = host;
|
|
74
|
+
this.ctx = ctx;
|
|
75
|
+
this.zone = zone;
|
|
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
|
+
}
|
|
92
|
+
}
|
|
93
|
+
ngAfterViewInit() {
|
|
94
|
+
super.ngAfterViewInit();
|
|
95
|
+
this.zone.onStable.pipe(take(1)).subscribe(() => {
|
|
96
|
+
this.buttonElement?.setAttribute('aria-haspopup', 'dialog');
|
|
97
|
+
this.buttonElement?.setAttribute('aria-expanded', 'false');
|
|
98
|
+
this.buttonElement?.setAttribute('title', this.ctx.localization.get('columns'));
|
|
99
|
+
});
|
|
100
|
+
this.subs.add(this.refresh.onRefresh.pipe(filter((tool) => tool === this.host)).subscribe((tool) => {
|
|
101
|
+
if (tool.overflows && this.popupRef) {
|
|
102
|
+
this.popupRef.close();
|
|
103
|
+
}
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
ngOnDestroy() {
|
|
107
|
+
super.ngOnDestroy();
|
|
108
|
+
this.subs.unsubscribe();
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* @hidden
|
|
112
|
+
*/
|
|
113
|
+
onClick(e) {
|
|
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() {
|
|
127
|
+
if (!this.popupRef) {
|
|
128
|
+
if (!this.host.overflows) {
|
|
129
|
+
const direction = this.ctx.localization.rtl ? 'right' : 'left';
|
|
130
|
+
this.popupRef = this.popupSerivce.open({
|
|
131
|
+
anchor: this.buttonElement,
|
|
132
|
+
content: ColumnListComponent,
|
|
133
|
+
positionMode: 'absolute',
|
|
134
|
+
anchorAlign: { vertical: 'bottom', horizontal: direction },
|
|
135
|
+
popupAlign: { vertical: 'top', horizontal: direction }
|
|
136
|
+
});
|
|
137
|
+
this.adaptiveGridService.popupRef = this.popupRef;
|
|
138
|
+
const popupElement = this.popupRef.popupElement;
|
|
139
|
+
const popupId = `k-column-chooser-tool-${this.nextId}-popup`;
|
|
140
|
+
const popupAriaElement = popupElement.querySelector('.k-popup');
|
|
141
|
+
this.zone.runOutsideAngular(() => {
|
|
142
|
+
this.renderer.listen(popupAriaElement, 'keydown', (e) => {
|
|
143
|
+
if (e.key === 'Escape') {
|
|
144
|
+
this.closePopup(true);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
this.renderer.setAttribute(popupElement, 'dir', this.ctx.localization.rtl ? 'rtl' : 'ltr');
|
|
149
|
+
this.renderer.setAttribute(popupAriaElement, 'id', popupId);
|
|
150
|
+
this.renderer.setAttribute(popupAriaElement, 'role', 'dialog');
|
|
151
|
+
this.buttonElement?.setAttribute('aria-expanded', 'true');
|
|
152
|
+
this.buttonElement?.setAttribute('aria-controls', popupId);
|
|
153
|
+
const columnList = this.popupRef.content.instance;
|
|
154
|
+
columnList.isLast = true;
|
|
155
|
+
columnList.autoSync = this.autoSync;
|
|
156
|
+
columnList.allowHideAll = this.allowHideAll;
|
|
157
|
+
columnList.applyText = this.ctx.localization.get('columnsApply');
|
|
158
|
+
columnList.resetText = this.ctx.localization.get('columnsReset');
|
|
159
|
+
columnList.columns = this.ctx.grid.columns;
|
|
160
|
+
columnList.ariaLabel = this.ctx.localization.get('columns');
|
|
161
|
+
this.subs.add(this.popupRef.popup.instance.anchorViewportLeave.subscribe(() => {
|
|
162
|
+
this.closePopup(true);
|
|
163
|
+
}));
|
|
164
|
+
this.subs.add(columnList.apply.subscribe(() => {
|
|
165
|
+
this.closePopup();
|
|
166
|
+
}));
|
|
167
|
+
this.zone.runOutsideAngular(() => this.renderer.listen('document', 'click', ({ target }) => {
|
|
168
|
+
if (this.popupRef && !closest(target, node => node === this.popupRef.popupElement || node === this.buttonElement)) {
|
|
169
|
+
this.zone.run(() => {
|
|
170
|
+
this.closePopup();
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
this.closePopup();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
closePopup(focusAnchor = false) {
|
|
181
|
+
this.popupRef.close();
|
|
182
|
+
this.popupRef = null;
|
|
183
|
+
this.buttonElement?.setAttribute('aria-expanded', 'false');
|
|
184
|
+
this.buttonElement?.removeAttribute('aria-controls');
|
|
185
|
+
focusAnchor && this.buttonElement?.focus();
|
|
186
|
+
}
|
|
187
|
+
get buttonElement() {
|
|
188
|
+
return this.host.getButton();
|
|
189
|
+
}
|
|
190
|
+
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 });
|
|
191
|
+
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 });
|
|
192
|
+
}
|
|
193
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColumnChooserToolbarDirective, decorators: [{
|
|
194
|
+
type: Directive,
|
|
195
|
+
args: [{
|
|
196
|
+
selector: '[kendoGridColumnChooserTool]',
|
|
197
|
+
standalone: true
|
|
198
|
+
}]
|
|
199
|
+
}], 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: [{
|
|
200
|
+
type: Input
|
|
201
|
+
}], allowHideAll: [{
|
|
202
|
+
type: Input
|
|
203
|
+
}] } });
|
|
@@ -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 = '
|
|
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.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
|
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
|
|
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 = '
|
|
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.
|
|
108
|
-
this.
|
|
109
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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,
|