@progress/kendo-angular-grid 13.4.0-develop.9 → 13.4.1-develop.1
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/column-menu/column-chooser-item-checked.directive.d.ts +20 -0
- package/column-menu/column-chooser.component.d.ts +9 -1
- package/column-menu/column-list-kb-nav.service.d.ts +22 -0
- package/column-menu/column-list.component.d.ts +10 -2
- package/column-menu/column-menu-item.component.d.ts +2 -0
- package/column-menu/column-menu.component.d.ts +10 -4
- package/column-menu/column-menu.module.d.ts +22 -21
- package/common/error-messages.d.ts +1 -1
- package/esm2020/column-menu/column-chooser-item-checked.directive.mjs +36 -0
- package/esm2020/column-menu/column-chooser.component.mjs +63 -12
- package/esm2020/column-menu/column-list-kb-nav.service.mjs +38 -0
- package/esm2020/column-menu/column-list.component.mjs +137 -26
- package/esm2020/column-menu/column-menu-autosize-all.component.mjs +2 -2
- package/esm2020/column-menu/column-menu-autosize.component.mjs +2 -2
- package/esm2020/column-menu/column-menu-chooser.component.mjs +3 -1
- package/esm2020/column-menu/column-menu-item.component.mjs +10 -4
- package/esm2020/column-menu/column-menu.component.mjs +79 -37
- package/esm2020/column-menu/column-menu.module.mjs +6 -2
- package/esm2020/common/error-messages.mjs +1 -1
- package/esm2020/filtering/menu/filter-menu-container.component.mjs +2 -2
- package/esm2020/filtering/menu/filter-menu.component.mjs +52 -10
- package/esm2020/navigation/logical-cell.directive.mjs +1 -1
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/rendering/header/header.component.mjs +30 -20
- package/fesm2015/progress-kendo-angular-grid.mjs +402 -81
- package/fesm2020/progress-kendo-angular-grid.mjs +394 -80
- package/filtering/menu/filter-menu.component.d.ts +13 -4
- package/package.json +16 -16
- package/rendering/header/header.component.d.ts +4 -1
- package/schematics/ngAdd/index.js +3 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ElementRef, Renderer2 } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export declare class ColumnMenuChooserItemCheckedDirective {
|
|
11
|
+
host: ElementRef;
|
|
12
|
+
private renderer;
|
|
13
|
+
kendoColumnMenuChooserItemChecked: boolean;
|
|
14
|
+
private checkedChangeSub;
|
|
15
|
+
constructor(host: ElementRef, renderer: Renderer2);
|
|
16
|
+
ngAfterViewInit(): void;
|
|
17
|
+
ngOnDestroy(): void;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnMenuChooserItemCheckedDirective, never>;
|
|
19
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ColumnMenuChooserItemCheckedDirective, "[kendoColumnMenuChooserItemChecked]", never, { "kendoColumnMenuChooserItemChecked": "kendoColumnMenuChooserItemChecked"; }, {}, never>;
|
|
20
|
+
}
|
|
@@ -47,9 +47,13 @@ export declare class ColumnChooserComponent implements OnDestroy {
|
|
|
47
47
|
* @default true
|
|
48
48
|
*/
|
|
49
49
|
allowHideAll: boolean;
|
|
50
|
+
private anchor;
|
|
51
|
+
private columnList;
|
|
50
52
|
get columns(): any[];
|
|
51
|
-
|
|
53
|
+
popupRef: any;
|
|
54
|
+
popupId: string;
|
|
52
55
|
private closeClick;
|
|
56
|
+
private escapeListener;
|
|
53
57
|
constructor(ctx: ContextService, columnInfoService: ColumnInfoService, popupService: PopupService, ngZone: NgZone, renderer: Renderer2, changeDetector: ChangeDetectorRef);
|
|
54
58
|
ngOnDestroy(): void;
|
|
55
59
|
/**
|
|
@@ -64,6 +68,10 @@ export declare class ColumnChooserComponent implements OnDestroy {
|
|
|
64
68
|
* @hidden
|
|
65
69
|
*/
|
|
66
70
|
onChange(changed: any[]): void;
|
|
71
|
+
/**
|
|
72
|
+
* @hidden
|
|
73
|
+
*/
|
|
74
|
+
onShiftTab(e: Event): void;
|
|
67
75
|
private close;
|
|
68
76
|
private detachClose;
|
|
69
77
|
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnChooserComponent, never>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Renderer2 } from '@angular/core';
|
|
6
|
+
import { ColumnMenuChooserItemCheckedDirective } from './column-chooser-item-checked.directive';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export declare class ColumnListKeyboardNavigation {
|
|
12
|
+
private renderer;
|
|
13
|
+
items: ColumnMenuChooserItemCheckedDirective[];
|
|
14
|
+
activeIndex: number;
|
|
15
|
+
constructor(renderer: Renderer2);
|
|
16
|
+
next(): void;
|
|
17
|
+
prev(): void;
|
|
18
|
+
toggle(index: number, active: boolean): void;
|
|
19
|
+
toggleCheckedState(): void;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnListKeyboardNavigation, never>;
|
|
21
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ColumnListKeyboardNavigation>;
|
|
22
|
+
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { ElementRef, NgZone, Renderer2, EventEmitter, OnInit, OnDestroy, SimpleChanges } from '@angular/core';
|
|
6
6
|
import { ColumnMenuService } from './column-menu.service';
|
|
7
|
+
import { ColumnListKeyboardNavigation } from './column-list-kb-nav.service';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
/**
|
|
9
10
|
* @hidden
|
|
@@ -12,13 +13,16 @@ export declare class ColumnListComponent implements OnInit, OnDestroy {
|
|
|
12
13
|
private element;
|
|
13
14
|
private ngZone;
|
|
14
15
|
private renderer;
|
|
16
|
+
private listNavigationService;
|
|
15
17
|
get className(): boolean;
|
|
18
|
+
isChecked(checkbox: any): any;
|
|
16
19
|
reset: EventEmitter<any>;
|
|
17
20
|
apply: EventEmitter<any>;
|
|
18
21
|
columnChange: EventEmitter<any>;
|
|
19
22
|
set columns(value: any[]);
|
|
20
23
|
get columns(): any[];
|
|
21
24
|
autoSync: boolean;
|
|
25
|
+
ariaLabel: string;
|
|
22
26
|
allowHideAll: boolean;
|
|
23
27
|
applyText: string;
|
|
24
28
|
resetText: string;
|
|
@@ -26,7 +30,9 @@ export declare class ColumnListComponent implements OnInit, OnDestroy {
|
|
|
26
30
|
isLast: boolean;
|
|
27
31
|
isExpanded: boolean;
|
|
28
32
|
service: ColumnMenuService;
|
|
33
|
+
resetButton: ElementRef;
|
|
29
34
|
private applyButton;
|
|
35
|
+
private options;
|
|
30
36
|
private hasLocked;
|
|
31
37
|
private hasVisibleLocked;
|
|
32
38
|
private unlockedCount;
|
|
@@ -35,17 +41,19 @@ export declare class ColumnListComponent implements OnInit, OnDestroy {
|
|
|
35
41
|
private _columns;
|
|
36
42
|
private allColumns;
|
|
37
43
|
private domSubscriptions;
|
|
38
|
-
constructor(element: ElementRef, ngZone: NgZone, renderer: Renderer2);
|
|
44
|
+
constructor(element: ElementRef, ngZone: NgZone, renderer: Renderer2, listNavigationService: ColumnListKeyboardNavigation);
|
|
39
45
|
isDisabled(column: any): boolean;
|
|
40
46
|
ngOnInit(): void;
|
|
47
|
+
ngAfterViewInit(): void;
|
|
41
48
|
ngOnChanges(changes: SimpleChanges): void;
|
|
42
49
|
ngOnDestroy(): void;
|
|
43
50
|
cancelChanges(): void;
|
|
44
51
|
applyChanges(): void;
|
|
45
52
|
onTab(e: Event): void;
|
|
53
|
+
onKeydown: (e: KeyboardEvent) => void;
|
|
46
54
|
private forEachCheckBox;
|
|
47
55
|
private updateDisabled;
|
|
48
56
|
private updateColumnState;
|
|
49
57
|
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnListComponent, never>;
|
|
50
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ColumnListComponent, "kendo-grid-columnlist", never, { "columns": "columns"; "autoSync": "autoSync"; "allowHideAll": "allowHideAll"; "applyText": "applyText"; "resetText": "resetText"; "actionsClass": "actionsClass"; "isLast": "isLast"; "isExpanded": "isExpanded"; "service": "service"; }, { "reset": "reset"; "apply": "apply"; "columnChange": "columnChange"; }, never, never>;
|
|
58
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ColumnListComponent, "kendo-grid-columnlist", never, { "columns": "columns"; "autoSync": "autoSync"; "ariaLabel": "ariaLabel"; "allowHideAll": "allowHideAll"; "applyText": "applyText"; "resetText": "resetText"; "actionsClass": "actionsClass"; "isLast": "isLast"; "isExpanded": "isExpanded"; "service": "service"; }, { "reset": "reset"; "apply": "apply"; "columnChange": "columnChange"; }, never, never>;
|
|
51
59
|
}
|
|
@@ -60,6 +60,8 @@ export declare class ColumnMenuItemComponent implements OnChanges {
|
|
|
60
60
|
expanded: boolean;
|
|
61
61
|
contentTemplate: ColumnMenuItemContentTemplateDirective;
|
|
62
62
|
contentState: string;
|
|
63
|
+
contentId: string;
|
|
64
|
+
ngAfterViewInit(): void;
|
|
63
65
|
ngOnChanges(changes: any): void;
|
|
64
66
|
/**
|
|
65
67
|
* @hidden
|
|
@@ -11,6 +11,7 @@ import { ContextService } from '../common/provider.service';
|
|
|
11
11
|
import { SVGIcon } from '@progress/kendo-svg-icons';
|
|
12
12
|
import { TabStripComponent } from '@progress/kendo-angular-layout';
|
|
13
13
|
import { ColumnInfoService } from '../common/column-info.service';
|
|
14
|
+
import { IdService } from '../common/id.service';
|
|
14
15
|
import * as i0 from "@angular/core";
|
|
15
16
|
/**
|
|
16
17
|
* Represents the [column menu](slug:columnmenu_grid#toc-customizing-the-position) component.
|
|
@@ -31,6 +32,7 @@ export declare class ColumnMenuComponent implements AfterViewInit, OnChanges, On
|
|
|
31
32
|
private renderer;
|
|
32
33
|
private cdr;
|
|
33
34
|
private columnInfoService;
|
|
35
|
+
private idService;
|
|
34
36
|
/**
|
|
35
37
|
* @hidden
|
|
36
38
|
*/
|
|
@@ -103,9 +105,9 @@ export declare class ColumnMenuComponent implements AfterViewInit, OnChanges, On
|
|
|
103
105
|
*/
|
|
104
106
|
get showGeneralTab(): boolean;
|
|
105
107
|
moreVerticalIcon: SVGIcon;
|
|
106
|
-
|
|
108
|
+
popupRef: any;
|
|
107
109
|
private closeSubscription;
|
|
108
|
-
constructor(navigationService: NavigationService, popupService: SinglePopupService, service: ColumnMenuService, ctx: ContextService, renderer: Renderer2, cdr: ChangeDetectorRef, columnInfoService: ColumnInfoService);
|
|
110
|
+
constructor(navigationService: NavigationService, popupService: SinglePopupService, service: ColumnMenuService, ctx: ContextService, renderer: Renderer2, cdr: ChangeDetectorRef, columnInfoService: ColumnInfoService, idService: IdService);
|
|
109
111
|
/**
|
|
110
112
|
* @hidden
|
|
111
113
|
*/
|
|
@@ -114,6 +116,10 @@ export declare class ColumnMenuComponent implements AfterViewInit, OnChanges, On
|
|
|
114
116
|
* @hidden
|
|
115
117
|
*/
|
|
116
118
|
get hasFilter(): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* @hidden
|
|
121
|
+
*/
|
|
122
|
+
get isNavigable(): boolean;
|
|
117
123
|
/**
|
|
118
124
|
* @hidden
|
|
119
125
|
*/
|
|
@@ -160,12 +166,12 @@ export declare class ColumnMenuComponent implements AfterViewInit, OnChanges, On
|
|
|
160
166
|
/**
|
|
161
167
|
* @hidden
|
|
162
168
|
*/
|
|
163
|
-
close(): void;
|
|
169
|
+
close(triggerFocus?: boolean): void;
|
|
164
170
|
/**
|
|
165
171
|
* @hidden
|
|
166
172
|
*/
|
|
167
173
|
get columnMenuTitle(): string;
|
|
168
174
|
private getExpandedState;
|
|
169
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnMenuComponent,
|
|
175
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnMenuComponent, [null, null, null, null, null, null, null, { optional: true; }]>;
|
|
170
176
|
static ɵcmp: i0.ɵɵComponentDeclaration<ColumnMenuComponent, "kendo-grid-column-menu", never, { "standalone": "standalone"; "column": "column"; "settings": "settings"; "sort": "sort"; "filter": "filter"; "sortable": "sortable"; "columnMenuTemplate": "columnMenuTemplate"; "tabIndex": "tabIndex"; }, {}, never, never>;
|
|
171
177
|
}
|
|
@@ -3,32 +3,33 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
import * as i1 from "./column-
|
|
7
|
-
import * as i2 from "./column-
|
|
8
|
-
import * as i3 from "./column-
|
|
9
|
-
import * as i4 from "./column-menu-
|
|
10
|
-
import * as i5 from "./column-menu-
|
|
11
|
-
import * as i6 from "./column-menu-item
|
|
12
|
-
import * as i7 from "./column-menu-
|
|
13
|
-
import * as i8 from "./column-menu.component";
|
|
14
|
-
import * as i9 from "./column-menu
|
|
15
|
-
import * as i10 from "./column-menu-
|
|
16
|
-
import * as i11 from "./column-menu-
|
|
17
|
-
import * as i12 from "./column-menu-
|
|
18
|
-
import * as i13 from "./column-menu-
|
|
19
|
-
import * as i14 from "./column-menu-
|
|
20
|
-
import * as i15 from "./column-menu-
|
|
21
|
-
import * as i16 from "./column-menu-autosize
|
|
22
|
-
import * as i17 from "
|
|
23
|
-
import * as i18 from "
|
|
24
|
-
import * as i19 from "
|
|
25
|
-
import * as i20 from "@progress/kendo-angular-
|
|
6
|
+
import * as i1 from "./column-chooser-item-checked.directive";
|
|
7
|
+
import * as i2 from "./column-list.component";
|
|
8
|
+
import * as i3 from "./column-chooser.component";
|
|
9
|
+
import * as i4 from "./column-menu-chooser.component";
|
|
10
|
+
import * as i5 from "./column-menu-filter.component";
|
|
11
|
+
import * as i6 from "./column-menu-item.component";
|
|
12
|
+
import * as i7 from "./column-menu-item-content-template.directive";
|
|
13
|
+
import * as i8 from "./column-menu-sort.component";
|
|
14
|
+
import * as i9 from "./column-menu.component";
|
|
15
|
+
import * as i10 from "./column-menu-lock.component";
|
|
16
|
+
import * as i11 from "./column-menu-template.directive";
|
|
17
|
+
import * as i12 from "./column-menu-container.component";
|
|
18
|
+
import * as i13 from "./column-menu-item.directive";
|
|
19
|
+
import * as i14 from "./column-menu-stick.component";
|
|
20
|
+
import * as i15 from "./column-menu-position.component";
|
|
21
|
+
import * as i16 from "./column-menu-autosize.component";
|
|
22
|
+
import * as i17 from "./column-menu-autosize-all.component";
|
|
23
|
+
import * as i18 from "@angular/common";
|
|
24
|
+
import * as i19 from "../filtering/menu/filter-menu.module";
|
|
25
|
+
import * as i20 from "@progress/kendo-angular-buttons";
|
|
26
|
+
import * as i21 from "@progress/kendo-angular-layout";
|
|
26
27
|
/**
|
|
27
28
|
* @hidden
|
|
28
29
|
*/
|
|
29
30
|
export declare class ColumnMenuModule {
|
|
30
31
|
static exports(): any[];
|
|
31
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnMenuModule, never>;
|
|
32
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ColumnMenuModule, [typeof i1.
|
|
33
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ColumnMenuModule, [typeof i1.ColumnMenuChooserItemCheckedDirective, typeof i2.ColumnListComponent, typeof i3.ColumnChooserComponent, typeof i4.ColumnMenuChooserComponent, typeof i5.ColumnMenuFilterComponent, typeof i6.ColumnMenuItemComponent, typeof i7.ColumnMenuItemContentTemplateDirective, typeof i8.ColumnMenuSortComponent, typeof i9.ColumnMenuComponent, typeof i10.ColumnMenuLockComponent, typeof i11.ColumnMenuTemplateDirective, typeof i12.ColumnMenuContainerComponent, typeof i13.ColumnMenuItemDirective, typeof i14.ColumnMenuStickComponent, typeof i15.ColumnMenuPositionComponent, typeof i16.ColumnMenuAutoSizeColumnComponent, typeof i17.ColumnMenuAutoSizeAllColumnsComponent], [typeof i18.CommonModule, typeof i19.FilterMenuModule, typeof i20.ButtonModule, typeof i21.TabStripModule], [typeof i1.ColumnMenuChooserItemCheckedDirective, typeof i2.ColumnListComponent, typeof i3.ColumnChooserComponent, typeof i4.ColumnMenuChooserComponent, typeof i5.ColumnMenuFilterComponent, typeof i6.ColumnMenuItemComponent, typeof i7.ColumnMenuItemContentTemplateDirective, typeof i8.ColumnMenuSortComponent, typeof i9.ColumnMenuComponent, typeof i10.ColumnMenuLockComponent, typeof i11.ColumnMenuTemplateDirective, typeof i12.ColumnMenuContainerComponent, typeof i13.ColumnMenuItemDirective, typeof i14.ColumnMenuStickComponent, typeof i15.ColumnMenuPositionComponent, typeof i16.ColumnMenuAutoSizeColumnComponent, typeof i17.ColumnMenuAutoSizeAllColumnsComponent]>;
|
|
33
34
|
static ɵinj: i0.ɵɵInjectorDeclaration<ColumnMenuModule>;
|
|
34
35
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 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, ElementRef, HostBinding, Input, Renderer2 } from '@angular/core';
|
|
6
|
+
import { Subscription } from 'rxjs';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export class ColumnMenuChooserItemCheckedDirective {
|
|
12
|
+
constructor(host, renderer) {
|
|
13
|
+
this.host = host;
|
|
14
|
+
this.renderer = renderer;
|
|
15
|
+
this.checkedChangeSub = new Subscription();
|
|
16
|
+
}
|
|
17
|
+
ngAfterViewInit() {
|
|
18
|
+
this.checkedChangeSub.add(this.renderer.listen(this.host.nativeElement.firstElementChild, 'change', (e) => {
|
|
19
|
+
this.kendoColumnMenuChooserItemChecked = e.target.checked;
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
ngOnDestroy() {
|
|
23
|
+
this.checkedChangeSub.unsubscribe();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
ColumnMenuChooserItemCheckedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColumnMenuChooserItemCheckedDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
27
|
+
ColumnMenuChooserItemCheckedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: ColumnMenuChooserItemCheckedDirective, selector: "[kendoColumnMenuChooserItemChecked]", inputs: { kendoColumnMenuChooserItemChecked: "kendoColumnMenuChooserItemChecked" }, host: { properties: { "attr.aria-checked": "this.kendoColumnMenuChooserItemChecked" } }, ngImport: i0 });
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColumnMenuChooserItemCheckedDirective, decorators: [{
|
|
29
|
+
type: Directive,
|
|
30
|
+
args: [{ selector: '[kendoColumnMenuChooserItemChecked]' }]
|
|
31
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { kendoColumnMenuChooserItemChecked: [{
|
|
32
|
+
type: HostBinding,
|
|
33
|
+
args: ['attr.aria-checked']
|
|
34
|
+
}, {
|
|
35
|
+
type: Input
|
|
36
|
+
}] } });
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
* Copyright © 2023 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, Input, NgZone, Renderer2, ChangeDetectorRef } from '@angular/core';
|
|
5
|
+
import { Component, Input, NgZone, Renderer2, ChangeDetectorRef, ViewChild } from '@angular/core';
|
|
6
6
|
import { PopupService } from '@progress/kendo-angular-popup';
|
|
7
7
|
import { ColumnInfoService } from '../common/column-info.service';
|
|
8
8
|
import { closest } from '../rendering/common/dom-queries';
|
|
9
|
-
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
9
|
+
import { Keys, guid, isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
10
10
|
import { columnsIcon } from '@progress/kendo-svg-icons';
|
|
11
|
+
import { ButtonComponent } from '@progress/kendo-angular-buttons';
|
|
11
12
|
import { ContextService } from '../common/provider.service';
|
|
13
|
+
import { ColumnListComponent } from './column-list.component';
|
|
12
14
|
import * as i0 from "@angular/core";
|
|
13
15
|
import * as i1 from "../common/provider.service";
|
|
14
16
|
import * as i2 from "../common/column-info.service";
|
|
@@ -74,13 +76,30 @@ export class ColumnChooserComponent {
|
|
|
74
76
|
anchorAlign: { vertical: 'bottom', horizontal: direction },
|
|
75
77
|
popupAlign: { vertical: 'top', horizontal: direction }
|
|
76
78
|
});
|
|
77
|
-
|
|
79
|
+
const popupElement = this.popupRef?.popupElement;
|
|
80
|
+
if (popupElement) {
|
|
81
|
+
const popupId = `k-${guid()}`;
|
|
82
|
+
const popupAriaElement = popupElement.querySelector('.k-popup');
|
|
83
|
+
this.ngZone.runOutsideAngular(() => {
|
|
84
|
+
this.escapeListener = this.renderer.listen(popupAriaElement, 'keydown', (e) => {
|
|
85
|
+
if (e.keyCode === Keys.Escape) {
|
|
86
|
+
this.close(true);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
this.renderer.setAttribute(popupElement, 'dir', this.ctx.localization.rtl ? 'rtl' : 'ltr');
|
|
91
|
+
this.renderer.setAttribute(popupAriaElement, 'id', popupId);
|
|
92
|
+
this.renderer.setAttribute(popupAriaElement, 'role', 'dialog');
|
|
93
|
+
this.popupId = popupId;
|
|
94
|
+
}
|
|
78
95
|
if (!isDocumentAvailable()) {
|
|
79
96
|
return;
|
|
80
97
|
}
|
|
81
98
|
this.ngZone.runOutsideAngular(() => this.closeClick = this.renderer.listen('document', 'click', ({ target }) => {
|
|
82
99
|
if (!closest(target, node => node === this.popupRef.popupElement || node === anchor.element)) {
|
|
83
|
-
this.
|
|
100
|
+
this.ngZone.run(() => {
|
|
101
|
+
this.close();
|
|
102
|
+
});
|
|
84
103
|
}
|
|
85
104
|
}));
|
|
86
105
|
}
|
|
@@ -92,7 +111,7 @@ export class ColumnChooserComponent {
|
|
|
92
111
|
* @hidden
|
|
93
112
|
*/
|
|
94
113
|
onApply(changed) {
|
|
95
|
-
this.close();
|
|
114
|
+
this.close(true);
|
|
96
115
|
if (changed.length) {
|
|
97
116
|
this.changeDetector.markForCheck();
|
|
98
117
|
this.columnInfoService.changeVisibility(changed);
|
|
@@ -105,12 +124,24 @@ export class ColumnChooserComponent {
|
|
|
105
124
|
this.changeDetector.markForCheck();
|
|
106
125
|
this.columnInfoService.changeVisibility(changed);
|
|
107
126
|
}
|
|
108
|
-
|
|
127
|
+
/**
|
|
128
|
+
* @hidden
|
|
129
|
+
*/
|
|
130
|
+
onShiftTab(e) {
|
|
131
|
+
if (e.target.matches('.k-column-list-item')) {
|
|
132
|
+
e.preventDefault();
|
|
133
|
+
this.columnList.resetButton.nativeElement.focus();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
close(focusAnchor = false) {
|
|
109
137
|
if (this.popupRef) {
|
|
110
138
|
this.popupRef.close();
|
|
111
139
|
this.popupRef = null;
|
|
140
|
+
this.changeDetector.markForCheck();
|
|
141
|
+
this.escapeListener && this.escapeListener();
|
|
112
142
|
}
|
|
113
143
|
this.detachClose();
|
|
144
|
+
focusAnchor && this.anchor.element.focus();
|
|
114
145
|
}
|
|
115
146
|
detachClose() {
|
|
116
147
|
if (this.closeClick) {
|
|
@@ -120,7 +151,7 @@ export class ColumnChooserComponent {
|
|
|
120
151
|
}
|
|
121
152
|
}
|
|
122
153
|
ColumnChooserComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColumnChooserComponent, deps: [{ token: i1.ContextService }, { token: i2.ColumnInfoService }, { token: i3.PopupService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
123
|
-
ColumnChooserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ColumnChooserComponent, selector: "kendo-grid-column-chooser", inputs: { autoSync: "autoSync", allowHideAll: "allowHideAll" }, ngImport: i0, template: `
|
|
154
|
+
ColumnChooserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ColumnChooserComponent, selector: "kendo-grid-column-chooser", inputs: { autoSync: "autoSync", allowHideAll: "allowHideAll" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true }, { propertyName: "columnList", first: true, predicate: ["columnList"], descendants: true }], ngImport: i0, template: `
|
|
124
155
|
<button #anchor
|
|
125
156
|
kendoButton
|
|
126
157
|
type="button"
|
|
@@ -128,20 +159,27 @@ ColumnChooserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
128
159
|
fillMode="flat"
|
|
129
160
|
[attr.title]="ctx.localization.get('columns')"
|
|
130
161
|
icon="columns"
|
|
131
|
-
[svgIcon]="columnsIcon"
|
|
162
|
+
[svgIcon]="columnsIcon"
|
|
163
|
+
[attr.aria-haspopup]="'dialog'"
|
|
164
|
+
[attr.aria-expanded]="!!(popupRef)"
|
|
165
|
+
[attr.aria-controls]="!!(popupRef) ? popupId : undefined"></button>
|
|
132
166
|
<ng-template #template>
|
|
133
167
|
<span class='k-column-chooser-title'>{{ ctx.localization.get('columns') }}</span>
|
|
134
168
|
<kendo-grid-columnlist
|
|
169
|
+
#columnList
|
|
135
170
|
[columns]="columns"
|
|
171
|
+
[ariaLabel]="ctx.localization.get('columns')"
|
|
172
|
+
[isLast]="true"
|
|
136
173
|
[applyText]="ctx.localization.get('columnsApply')"
|
|
137
174
|
[resetText]="ctx.localization.get('columnsReset')"
|
|
138
175
|
[autoSync]="autoSync"
|
|
139
176
|
[allowHideAll]="allowHideAll"
|
|
140
177
|
(apply)="onApply($event)"
|
|
141
|
-
(columnChange)="onChange($event)"
|
|
178
|
+
(columnChange)="onChange($event)"
|
|
179
|
+
(keydown.shift.tab)="onShiftTab($event)">
|
|
142
180
|
</kendo-grid-columnlist>
|
|
143
181
|
</ng-template>
|
|
144
|
-
`, isInline: true, components: [{ type: i4.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i5.ColumnListComponent, selector: "kendo-grid-columnlist", inputs: ["columns", "autoSync", "allowHideAll", "applyText", "resetText", "actionsClass", "isLast", "isExpanded", "service"], outputs: ["reset", "apply", "columnChange"] }] });
|
|
182
|
+
`, isInline: true, components: [{ type: i4.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i5.ColumnListComponent, selector: "kendo-grid-columnlist", inputs: ["columns", "autoSync", "ariaLabel", "allowHideAll", "applyText", "resetText", "actionsClass", "isLast", "isExpanded", "service"], outputs: ["reset", "apply", "columnChange"] }] });
|
|
145
183
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColumnChooserComponent, decorators: [{
|
|
146
184
|
type: Component,
|
|
147
185
|
args: [{
|
|
@@ -154,17 +192,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
154
192
|
fillMode="flat"
|
|
155
193
|
[attr.title]="ctx.localization.get('columns')"
|
|
156
194
|
icon="columns"
|
|
157
|
-
[svgIcon]="columnsIcon"
|
|
195
|
+
[svgIcon]="columnsIcon"
|
|
196
|
+
[attr.aria-haspopup]="'dialog'"
|
|
197
|
+
[attr.aria-expanded]="!!(popupRef)"
|
|
198
|
+
[attr.aria-controls]="!!(popupRef) ? popupId : undefined"></button>
|
|
158
199
|
<ng-template #template>
|
|
159
200
|
<span class='k-column-chooser-title'>{{ ctx.localization.get('columns') }}</span>
|
|
160
201
|
<kendo-grid-columnlist
|
|
202
|
+
#columnList
|
|
161
203
|
[columns]="columns"
|
|
204
|
+
[ariaLabel]="ctx.localization.get('columns')"
|
|
205
|
+
[isLast]="true"
|
|
162
206
|
[applyText]="ctx.localization.get('columnsApply')"
|
|
163
207
|
[resetText]="ctx.localization.get('columnsReset')"
|
|
164
208
|
[autoSync]="autoSync"
|
|
165
209
|
[allowHideAll]="allowHideAll"
|
|
166
210
|
(apply)="onApply($event)"
|
|
167
|
-
(columnChange)="onChange($event)"
|
|
211
|
+
(columnChange)="onChange($event)"
|
|
212
|
+
(keydown.shift.tab)="onShiftTab($event)">
|
|
168
213
|
</kendo-grid-columnlist>
|
|
169
214
|
</ng-template>
|
|
170
215
|
`
|
|
@@ -173,4 +218,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
173
218
|
type: Input
|
|
174
219
|
}], allowHideAll: [{
|
|
175
220
|
type: Input
|
|
221
|
+
}], anchor: [{
|
|
222
|
+
type: ViewChild,
|
|
223
|
+
args: ['anchor']
|
|
224
|
+
}], columnList: [{
|
|
225
|
+
type: ViewChild,
|
|
226
|
+
args: ['columnList']
|
|
176
227
|
}] } });
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Injectable, Renderer2 } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export class ColumnListKeyboardNavigation {
|
|
11
|
+
constructor(renderer) {
|
|
12
|
+
this.renderer = renderer;
|
|
13
|
+
this.activeIndex = 0;
|
|
14
|
+
}
|
|
15
|
+
next() {
|
|
16
|
+
this.toggle(this.activeIndex, false);
|
|
17
|
+
this.activeIndex = Math.min(this.activeIndex + 1, this.items.length - 1);
|
|
18
|
+
this.toggle(this.activeIndex, true);
|
|
19
|
+
}
|
|
20
|
+
prev() {
|
|
21
|
+
this.toggle(this.activeIndex, false);
|
|
22
|
+
this.activeIndex = Math.max(this.activeIndex - 1, 0);
|
|
23
|
+
this.toggle(this.activeIndex, true);
|
|
24
|
+
}
|
|
25
|
+
toggle(index, active) {
|
|
26
|
+
const element = this.items[index]?.host.nativeElement;
|
|
27
|
+
element && this.renderer.setAttribute(this.items[index].host.nativeElement, 'tabindex', active ? '0' : '-1');
|
|
28
|
+
active && element && element.focus();
|
|
29
|
+
}
|
|
30
|
+
toggleCheckedState() {
|
|
31
|
+
this.items[this.activeIndex].host.nativeElement.firstElementChild.click();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
ColumnListKeyboardNavigation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColumnListKeyboardNavigation, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
35
|
+
ColumnListKeyboardNavigation.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColumnListKeyboardNavigation });
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColumnListKeyboardNavigation, decorators: [{
|
|
37
|
+
type: Injectable
|
|
38
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }]; } });
|