@progress/kendo-angular-pivotgrid 1.0.3-dev.202210121054 → 1.1.0-dev.202210240946
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/bundles/kendo-angular-pivotgrid.umd.js +1 -1
- package/configurator/chip-kb-nav.directive.d.ts +25 -0
- package/configurator/configurator.component.d.ts +28 -6
- package/esm2015/configurator/chip-kb-nav.directive.js +59 -0
- package/esm2015/configurator/chip-menu/chip-menu.component.js +1 -1
- package/esm2015/configurator/configurator.component.js +169 -29
- package/esm2015/data-binding/base-binding-directive.js +1 -0
- package/esm2015/localization/custom-messages.component.js +1 -1
- package/esm2015/package-metadata.js +1 -1
- package/esm2015/pivotgrid.component.js +59 -13
- package/esm2015/pivotgrid.module.js +5 -2
- package/esm2015/util.js +8 -0
- package/fesm2015/kendo-angular-pivotgrid.js +293 -47
- package/localization/custom-messages.component.d.ts +1 -1
- package/package.json +2 -2
- package/pivotgrid.component.d.ts +9 -0
- package/pivotgrid.module.d.ts +7 -6
- package/util.d.ts +4 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { EventEmitter, NgZone, OnDestroy, OnInit, Renderer2 } from '@angular/core';
|
|
6
|
+
import { ChipComponent } from '@progress/kendo-angular-buttons';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export declare class ChipKeyboardNavigationDirective implements OnInit, OnDestroy {
|
|
12
|
+
private host;
|
|
13
|
+
private renderer;
|
|
14
|
+
private ngZone;
|
|
15
|
+
private keydownSub;
|
|
16
|
+
reorder: EventEmitter<{
|
|
17
|
+
direction: string;
|
|
18
|
+
sender: ChipComponent;
|
|
19
|
+
}>;
|
|
20
|
+
constructor(host: ChipComponent, renderer: Renderer2, ngZone: NgZone);
|
|
21
|
+
ngOnInit(): void;
|
|
22
|
+
ngOnDestroy(): void;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChipKeyboardNavigationDirective, never>;
|
|
24
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ChipKeyboardNavigationDirective, "[kendoChipKeyboardNavigation]", never, {}, { "reorder": "reorder"; }, never>;
|
|
25
|
+
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright © 2021 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 { ChangeDetectorRef, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
6
|
-
import { AxisDescriptor, PivotGridField, PivotGridConfiguratorState } from '@progress/kendo-pivotgrid-common';
|
|
7
|
-
import { TreeItem } from '@progress/kendo-angular-treeview';
|
|
5
|
+
import { ChangeDetectorRef, EventEmitter, NgZone, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
6
|
+
import { AxisDescriptor, PivotGridField, PivotGridConfiguratorState, ConfiguratorNavigation } from '@progress/kendo-pivotgrid-common';
|
|
7
|
+
import { TreeItem, TreeViewComponent } from '@progress/kendo-angular-treeview';
|
|
8
8
|
import { PivotGridDataService } from '../data-binding/pivotgrid-data.service';
|
|
9
9
|
import { ConfiguratorService } from './configurator.service';
|
|
10
10
|
import { Observable } from 'rxjs';
|
|
@@ -12,6 +12,7 @@ import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
|
12
12
|
import { FilterDescriptor, SortDescriptor } from '@progress/kendo-data-query';
|
|
13
13
|
import { PivotGridConfiguratorOrientation } from '../models/configurator-orientation';
|
|
14
14
|
import { DropSectionType } from '../models/drop-section';
|
|
15
|
+
import { ChipListComponent, ChipRemoveEvent } from '@progress/kendo-angular-buttons';
|
|
15
16
|
import * as i0 from "@angular/core";
|
|
16
17
|
/**
|
|
17
18
|
* @hidden
|
|
@@ -22,10 +23,18 @@ export declare class PivotGridConfiguratorComponent implements OnInit, OnChanges
|
|
|
22
23
|
private localization;
|
|
23
24
|
configuratorService: ConfiguratorService;
|
|
24
25
|
private cdr;
|
|
26
|
+
private zone;
|
|
25
27
|
hostClass: boolean;
|
|
28
|
+
hostAriaRole: string;
|
|
29
|
+
get headerTextId(): string;
|
|
26
30
|
orientation: PivotGridConfiguratorOrientation;
|
|
27
31
|
sort: Array<SortDescriptor>;
|
|
28
32
|
filter: FilterDescriptor[];
|
|
33
|
+
navigation: ConfiguratorNavigation;
|
|
34
|
+
close: EventEmitter<any>;
|
|
35
|
+
treeView: TreeViewComponent;
|
|
36
|
+
columnsList: ChipListComponent;
|
|
37
|
+
rowsList: ChipListComponent;
|
|
29
38
|
originalState: PivotGridConfiguratorState;
|
|
30
39
|
state: PivotGridConfiguratorState;
|
|
31
40
|
fields: PivotGridField[];
|
|
@@ -36,12 +45,15 @@ export declare class PivotGridConfiguratorComponent implements OnInit, OnChanges
|
|
|
36
45
|
* A function which determines if a specific node has child nodes.
|
|
37
46
|
*/
|
|
38
47
|
hasChildren: (node: any) => boolean;
|
|
39
|
-
constructor(dataService: PivotGridDataService, localization: LocalizationService, configuratorService: ConfiguratorService, cdr: ChangeDetectorRef);
|
|
48
|
+
constructor(dataService: PivotGridDataService, localization: LocalizationService, configuratorService: ConfiguratorService, cdr: ChangeDetectorRef, zone: NgZone);
|
|
40
49
|
ngOnInit(): void;
|
|
50
|
+
ngAfterViewInit(): void;
|
|
41
51
|
ngOnDestroy(): void;
|
|
42
52
|
ngOnChanges(changes: SimpleChanges): void;
|
|
43
53
|
getName(name: string[]): string;
|
|
54
|
+
contentLabelId(section: string): string;
|
|
44
55
|
setState(state: PivotGridConfiguratorState): void;
|
|
56
|
+
onReorder(ev: any, name: string, item: any): void;
|
|
45
57
|
/**
|
|
46
58
|
* Returns the localized message for a given token
|
|
47
59
|
*/
|
|
@@ -62,7 +74,7 @@ export declare class PivotGridConfiguratorComponent implements OnInit, OnChanges
|
|
|
62
74
|
* Updates the respective axis configuration of the current state
|
|
63
75
|
* when a chip is deleted from the UI
|
|
64
76
|
*/
|
|
65
|
-
onChipRemove(item: AxisDescriptor, section: DropSectionType): void;
|
|
77
|
+
onChipRemove(ev: ChipRemoveEvent, item: AxisDescriptor, section: DropSectionType): void;
|
|
66
78
|
/**
|
|
67
79
|
* Constructs an array with all selected fields.
|
|
68
80
|
* @param fields - used for when child nodes are loaded on demand.
|
|
@@ -90,6 +102,8 @@ export declare class PivotGridConfiguratorComponent implements OnInit, OnChanges
|
|
|
90
102
|
item: TreeItem;
|
|
91
103
|
}): void;
|
|
92
104
|
handleCheckedChange(event: any, item: any): void;
|
|
105
|
+
onTreeViewSelect(ev: Event): void;
|
|
106
|
+
onTreeViewEscape(ev: KeyboardEvent): void;
|
|
93
107
|
handleSubmit(): void;
|
|
94
108
|
/**
|
|
95
109
|
* Reset the configurator to the last saved state
|
|
@@ -103,6 +117,14 @@ export declare class PivotGridConfiguratorComponent implements OnInit, OnChanges
|
|
|
103
117
|
* Creates an array containing only the field names, e.g. '[Date].[Calendar]' or 'Product'
|
|
104
118
|
*/
|
|
105
119
|
private extractDefaultFields;
|
|
120
|
+
/**
|
|
121
|
+
* Swaps chips within the same ChipList
|
|
122
|
+
*/
|
|
123
|
+
private swapChips;
|
|
124
|
+
/**
|
|
125
|
+
* Moves a chip from one ChipList to another
|
|
126
|
+
*/
|
|
127
|
+
private moveChip;
|
|
106
128
|
static ɵfac: i0.ɵɵFactoryDeclaration<PivotGridConfiguratorComponent, never>;
|
|
107
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PivotGridConfiguratorComponent, "kendo-pivotgrid-configurator", never, { "orientation": "orientation"; "sort": "sort"; "filter": "filter"; }, {}, never, never>;
|
|
129
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PivotGridConfiguratorComponent, "kendo-pivotgrid-configurator", never, { "orientation": "orientation"; "sort": "sort"; "filter": "filter"; "navigation": "navigation"; }, { "close": "close"; }, never, never>;
|
|
108
130
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 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, EventEmitter, Output } from '@angular/core';
|
|
6
|
+
import { Keys } from '@progress/kendo-angular-common';
|
|
7
|
+
import { Subscription } from 'rxjs';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
import * as i1 from "@progress/kendo-angular-buttons";
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export class ChipKeyboardNavigationDirective {
|
|
14
|
+
constructor(host, renderer, ngZone) {
|
|
15
|
+
this.host = host;
|
|
16
|
+
this.renderer = renderer;
|
|
17
|
+
this.ngZone = ngZone;
|
|
18
|
+
this.keydownSub = new Subscription();
|
|
19
|
+
this.reorder = new EventEmitter();
|
|
20
|
+
}
|
|
21
|
+
ngOnInit() {
|
|
22
|
+
const chipElement = this.host.element.nativeElement;
|
|
23
|
+
this.ngZone.runOutsideAngular(() => {
|
|
24
|
+
this.keydownSub.add(this.renderer.listen(chipElement, 'keydown', (ev) => {
|
|
25
|
+
const isAltDown = ev.keyCode === Keys.ArrowDown && ev.altKey;
|
|
26
|
+
const menuIcon = this.host.element.nativeElement.querySelector('.k-i-more-vertical');
|
|
27
|
+
const shiftAndMeta = ev.shiftKey && ev.metaKey;
|
|
28
|
+
const isArrow = [Keys.ArrowLeft, Keys.ArrowRight, Keys.ArrowDown, Keys.ArrowUp].includes(ev.keyCode);
|
|
29
|
+
const isReorderAction = shiftAndMeta && isArrow;
|
|
30
|
+
if (isAltDown && menuIcon) {
|
|
31
|
+
menuIcon.click();
|
|
32
|
+
}
|
|
33
|
+
else if (isReorderAction) {
|
|
34
|
+
const direction = {
|
|
35
|
+
[Keys.ArrowDown]: 'down',
|
|
36
|
+
[Keys.ArrowUp]: 'up',
|
|
37
|
+
[Keys.ArrowRight]: 'right',
|
|
38
|
+
[Keys.ArrowLeft]: 'left'
|
|
39
|
+
}[ev.keyCode];
|
|
40
|
+
this.reorder.emit({
|
|
41
|
+
direction,
|
|
42
|
+
sender: this.host
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
ngOnDestroy() {
|
|
49
|
+
this.keydownSub.unsubscribe();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
ChipKeyboardNavigationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipKeyboardNavigationDirective, deps: [{ token: i1.ChipComponent }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
53
|
+
ChipKeyboardNavigationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ChipKeyboardNavigationDirective, selector: "[kendoChipKeyboardNavigation]", outputs: { reorder: "reorder" }, ngImport: i0 });
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipKeyboardNavigationDirective, decorators: [{
|
|
55
|
+
type: Directive,
|
|
56
|
+
args: [{ selector: '[kendoChipKeyboardNavigation]' }]
|
|
57
|
+
}], ctorParameters: function () { return [{ type: i1.ChipComponent }, { type: i0.Renderer2 }, { type: i0.NgZone }]; }, propDecorators: { reorder: [{
|
|
58
|
+
type: Output
|
|
59
|
+
}] } });
|
|
@@ -45,7 +45,7 @@ export class ChipMenuComponent {
|
|
|
45
45
|
close() {
|
|
46
46
|
this.popupService.destroy();
|
|
47
47
|
this.popupRef = null;
|
|
48
|
-
this.anchor.nativeElement.focus();
|
|
48
|
+
this.anchor.nativeElement.closest('.k-chip').focus();
|
|
49
49
|
}
|
|
50
50
|
get chipMenuTitle() {
|
|
51
51
|
const localizationMsg = this.localization.get('chipMenuIconTitle') || '';
|