@progress/kendo-angular-pivotgrid 1.0.2 → 1.1.0-dev.202210190858

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.
@@ -0,0 +1,24 @@
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, 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 {
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
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChipKeyboardNavigationDirective, never>;
23
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ChipKeyboardNavigationDirective, "[kendoChipKeyboardNavigation]", never, {}, { "reorder": "reorder"; }, never>;
24
+ }
@@ -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
@@ -104,5 +118,5 @@ export declare class PivotGridConfiguratorComponent implements OnInit, OnChanges
104
118
  */
105
119
  private extractDefaultFields;
106
120
  static ɵfac: i0.ɵɵFactoryDeclaration<PivotGridConfiguratorComponent, never>;
107
- static ɵcmp: i0.ɵɵComponentDeclaration<PivotGridConfiguratorComponent, "kendo-pivotgrid-configurator", never, { "orientation": "orientation"; "sort": "sort"; "filter": "filter"; }, {}, never, never>;
121
+ static ɵcmp: i0.ɵɵComponentDeclaration<PivotGridConfiguratorComponent, "kendo-pivotgrid-configurator", never, { "orientation": "orientation"; "sort": "sort"; "filter": "filter"; "navigation": "navigation"; }, { "close": "close"; }, never, never>;
108
122
  }
@@ -0,0 +1,62 @@
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 isDeleteOrBackspace = ev.keyCode === Keys.Delete || ev.keyCode === Keys.Backspace;
26
+ const isAltDown = ev.keyCode === Keys.ArrowDown && ev.altKey;
27
+ const menuIcon = this.host.element.nativeElement.querySelector('.k-i-more-vertical');
28
+ const shiftAndMeta = ev.shiftKey && ev.metaKey;
29
+ const isArrow = [Keys.ArrowLeft, Keys.ArrowRight, Keys.ArrowDown, Keys.ArrowUp].includes(ev.keyCode);
30
+ const isReorderAction = shiftAndMeta && isArrow;
31
+ if (isDeleteOrBackspace) {
32
+ this.ngZone.run(() => {
33
+ this.host.remove.emit({ sender: this.host, originalEvent: ev });
34
+ });
35
+ }
36
+ else if (isAltDown && menuIcon) {
37
+ menuIcon.click();
38
+ }
39
+ else if (isReorderAction) {
40
+ const direction = {
41
+ [Keys.ArrowDown]: 'down',
42
+ [Keys.ArrowUp]: 'up',
43
+ [Keys.ArrowRight]: 'right',
44
+ [Keys.ArrowLeft]: 'left'
45
+ }[ev.keyCode];
46
+ this.reorder.emit({
47
+ direction,
48
+ sender: this.host
49
+ });
50
+ }
51
+ }));
52
+ });
53
+ }
54
+ }
55
+ 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 });
56
+ ChipKeyboardNavigationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ChipKeyboardNavigationDirective, selector: "[kendoChipKeyboardNavigation]", outputs: { reorder: "reorder" }, ngImport: i0 });
57
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipKeyboardNavigationDirective, decorators: [{
58
+ type: Directive,
59
+ args: [{ selector: '[kendoChipKeyboardNavigation]' }]
60
+ }], ctorParameters: function () { return [{ type: i1.ChipComponent }, { type: i0.Renderer2 }, { type: i0.NgZone }]; }, propDecorators: { reorder: [{
61
+ type: Output
62
+ }] } });
@@ -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') || '';