@progress/kendo-angular-pivotgrid 14.1.0-develop.8 → 14.1.0

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.
Files changed (28) hide show
  1. package/configurator/chip-menu/chip-menu-item.component.d.ts +5 -1
  2. package/configurator/chip-menu/chip-menu-reorder.component.d.ts +44 -0
  3. package/configurator/chip-menu/chip-menu.component.d.ts +5 -3
  4. package/configurator/chip-menu/chip-menu.module.d.ts +4 -3
  5. package/configurator/chip-menu/chip-menu.service.d.ts +5 -1
  6. package/configurator/configurator.service.d.ts +3 -0
  7. package/configurator/draggable.directive.d.ts +5 -3
  8. package/esm2020/configurator/chip-menu/chip-menu-filter.component.mjs +1 -1
  9. package/esm2020/configurator/chip-menu/chip-menu-item.component.mjs +7 -1
  10. package/esm2020/configurator/chip-menu/chip-menu-reorder.component.mjs +185 -0
  11. package/esm2020/configurator/chip-menu/chip-menu-sort.component.mjs +1 -1
  12. package/esm2020/configurator/chip-menu/chip-menu.component.mjs +56 -33
  13. package/esm2020/configurator/chip-menu/chip-menu.module.mjs +8 -3
  14. package/esm2020/configurator/chip-menu/chip-menu.service.mjs +12 -3
  15. package/esm2020/configurator/configurator.component.mjs +20 -2
  16. package/esm2020/configurator/configurator.service.mjs +3 -0
  17. package/esm2020/configurator/draggable.directive.mjs +17 -8
  18. package/esm2020/localization/messages.mjs +9 -1
  19. package/esm2020/models/configurator-chipmenu-reorder-target.mjs +5 -0
  20. package/esm2020/package-metadata.mjs +2 -2
  21. package/esm2020/pivotgrid.component.mjs +26 -2
  22. package/fesm2015/progress-kendo-angular-pivotgrid.mjs +324 -56
  23. package/fesm2020/progress-kendo-angular-pivotgrid.mjs +323 -56
  24. package/localization/messages.d.ts +17 -1
  25. package/localization/pivot-localization.service.d.ts +1 -1
  26. package/models/configurator-chipmenu-reorder-target.d.ts +8 -0
  27. package/package.json +12 -12
  28. package/schematics/ngAdd/index.js +1 -1
@@ -45,6 +45,10 @@ export declare class ChipMenuItemComponent implements OnChanges {
45
45
  * Specifies if the item is expanded.
46
46
  */
47
47
  expanded: boolean;
48
+ /**
49
+ * Specified if the item is disabled
50
+ */
51
+ disabled: boolean;
48
52
  contentTemplate: ChipMenuItemContentTemplateDirective;
49
53
  get iconClass(): string;
50
54
  contentState: string;
@@ -52,5 +56,5 @@ export declare class ChipMenuItemComponent implements OnChanges {
52
56
  onClick(e: any): void;
53
57
  private updateContentState;
54
58
  static ɵfac: i0.ɵɵFactoryDeclaration<ChipMenuItemComponent, never>;
55
- static ɵcmp: i0.ɵɵComponentDeclaration<ChipMenuItemComponent, "kendo-pivot-chipmenu-item", never, { "icon": "icon"; "svgIcon": "svgIcon"; "text": "text"; "selected": "selected"; "expanded": "expanded"; }, { "itemClick": "itemClick"; "expand": "expand"; "collapse": "collapse"; }, ["contentTemplate"], never>;
59
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChipMenuItemComponent, "kendo-pivot-chipmenu-item", never, { "icon": "icon"; "svgIcon": "svgIcon"; "text": "text"; "selected": "selected"; "expanded": "expanded"; "disabled": "disabled"; }, { "itemClick": "itemClick"; "expand": "expand"; "collapse": "collapse"; }, ["contentTemplate"], never>;
56
60
  }
@@ -0,0 +1,44 @@
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 { ChangeDetectorRef, NgZone, Renderer2 } from '@angular/core';
6
+ import { ChipMenuItemBase } from './chip-menu-item-base';
7
+ import { ConfiguratorService } from '../configurator.service';
8
+ import { AxisDescriptor } from '@progress/kendo-pivotgrid-common';
9
+ import { PivotLocalizationService } from '../../localization/pivot-localization.service';
10
+ import { SVGIcon } from '@progress/kendo-svg-icons';
11
+ import { ChipMenuReorderTarget } from '../../models/configurator-chipmenu-reorder-target';
12
+ import { PivotGridDataService } from '../../data-binding/pivotgrid-data.service';
13
+ import * as i0 from "@angular/core";
14
+ /**
15
+ * @hidden
16
+ *
17
+ * Represents a chip-menu item for reordering PivotGrid fields.
18
+ */
19
+ export declare class ChipMenuReorderComponent extends ChipMenuItemBase {
20
+ localization: PivotLocalizationService;
21
+ protected renderer: Renderer2;
22
+ protected configuratorService: ConfiguratorService;
23
+ protected dataService: PivotGridDataService;
24
+ protected cdr: ChangeDetectorRef;
25
+ protected ngZone: NgZone;
26
+ chip: AxisDescriptor;
27
+ columnsIcon: SVGIcon;
28
+ rowsIcon: SVGIcon;
29
+ arrowLeftIcon: SVGIcon;
30
+ arrowRightIcon: SVGIcon;
31
+ rtl: boolean;
32
+ get isColumnsField(): boolean;
33
+ get isRowsField(): boolean;
34
+ get isMeasureField(): boolean;
35
+ get isFirst(): boolean;
36
+ get isLast(): boolean;
37
+ private subs;
38
+ constructor(localization: PivotLocalizationService, renderer: Renderer2, configuratorService: ConfiguratorService, dataService: PivotGridDataService, cdr: ChangeDetectorRef, ngZone: NgZone);
39
+ ngOnDestroy(): void;
40
+ messageFor(localizationToken: string): string;
41
+ move(e: any, target: ChipMenuReorderTarget): void;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChipMenuReorderComponent, never>;
43
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChipMenuReorderComponent, "kendo-pivot-chipmenu-reorder", never, { "chip": "chip"; }, {}, never, never>;
44
+ }
@@ -2,7 +2,7 @@
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 { OnDestroy, ElementRef } from '@angular/core';
5
+ import { OnDestroy, ElementRef, Renderer2 } from '@angular/core';
6
6
  import { SinglePopupService } from './single-popup.service';
7
7
  import { ChipMenuService } from './chip-menu.service';
8
8
  import { PivotLocalizationService } from '../../localization/pivot-localization.service';
@@ -18,20 +18,22 @@ export declare class ChipMenuComponent implements OnDestroy {
18
18
  protected popupService: SinglePopupService;
19
19
  localization: PivotLocalizationService;
20
20
  service: ChipMenuService;
21
+ private renderer;
21
22
  /**
22
23
  * The Configurator field instance to control with the menu.
23
24
  */
24
25
  chip: AxisDescriptor;
25
26
  tabIndex: string;
27
+ isMeasureField: boolean;
26
28
  anchor: ElementRef;
27
29
  menuItemSVGIcon: SVGIcon;
28
30
  private popupRef;
29
31
  private closeSubscription;
30
- constructor(popupService: SinglePopupService, localization: PivotLocalizationService, service: ChipMenuService);
32
+ constructor(popupService: SinglePopupService, localization: PivotLocalizationService, service: ChipMenuService, renderer: Renderer2);
31
33
  ngOnDestroy(): void;
32
34
  toggle(e: any, template: any): void;
33
35
  close(): void;
34
36
  get chipMenuTitle(): string;
35
37
  static ɵfac: i0.ɵɵFactoryDeclaration<ChipMenuComponent, never>;
36
- static ɵcmp: i0.ɵɵComponentDeclaration<ChipMenuComponent, "kendo-pivot-chip-menu", never, { "chip": "chip"; "tabIndex": "tabIndex"; }, {}, never, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChipMenuComponent, "kendo-pivot-chip-menu", never, { "chip": "chip"; "tabIndex": "tabIndex"; "isMeasureField": "isMeasureField"; }, {}, never, never>;
37
39
  }
@@ -13,14 +13,15 @@ import * as i7 from "./filtering/string-filter-menu.component";
13
13
  import * as i8 from "./filtering/filter-menu-dropdownlist.directive";
14
14
  import * as i9 from "./chip-menu-container.component";
15
15
  import * as i10 from "./chip-menu-item.directive";
16
- import * as i11 from "../../shared.module";
17
- import * as i12 from "@angular/forms";
16
+ import * as i11 from "./chip-menu-reorder.component";
17
+ import * as i12 from "../../shared.module";
18
+ import * as i13 from "@angular/forms";
18
19
  /**
19
20
  * @hidden
20
21
  */
21
22
  export declare class ChipMenuModule {
22
23
  static exports(): any[];
23
24
  static ɵfac: i0.ɵɵFactoryDeclaration<ChipMenuModule, never>;
24
- static ɵmod: i0.ɵɵNgModuleDeclaration<ChipMenuModule, [typeof i1.ChipMenuItemComponent, typeof i2.ChipMenuSortComponent, typeof i3.ChipMenuComponent, typeof i4.ChipMenuFilterComponent, typeof i5.ChipMenuItemContentTemplateDirective, typeof i6.FilterMenuContainerComponent, typeof i7.StringFilterMenuComponent, typeof i8.FilterMenuDropDownListDirective, typeof i9.ChipMenuContainerComponent, typeof i10.ChipMenuItemDirective], [typeof i11.SharedModule, typeof i12.ReactiveFormsModule, typeof i12.FormsModule], [typeof i1.ChipMenuItemComponent, typeof i2.ChipMenuSortComponent, typeof i3.ChipMenuComponent, typeof i4.ChipMenuFilterComponent, typeof i5.ChipMenuItemContentTemplateDirective, typeof i6.FilterMenuContainerComponent, typeof i7.StringFilterMenuComponent, typeof i8.FilterMenuDropDownListDirective, typeof i9.ChipMenuContainerComponent, typeof i10.ChipMenuItemDirective]>;
25
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ChipMenuModule, [typeof i1.ChipMenuItemComponent, typeof i2.ChipMenuSortComponent, typeof i3.ChipMenuComponent, typeof i4.ChipMenuFilterComponent, typeof i5.ChipMenuItemContentTemplateDirective, typeof i6.FilterMenuContainerComponent, typeof i7.StringFilterMenuComponent, typeof i8.FilterMenuDropDownListDirective, typeof i9.ChipMenuContainerComponent, typeof i10.ChipMenuItemDirective, typeof i11.ChipMenuReorderComponent], [typeof i12.SharedModule, typeof i13.ReactiveFormsModule, typeof i13.FormsModule], [typeof i1.ChipMenuItemComponent, typeof i2.ChipMenuSortComponent, typeof i3.ChipMenuComponent, typeof i4.ChipMenuFilterComponent, typeof i5.ChipMenuItemContentTemplateDirective, typeof i6.FilterMenuContainerComponent, typeof i7.StringFilterMenuComponent, typeof i8.FilterMenuDropDownListDirective, typeof i9.ChipMenuContainerComponent, typeof i10.ChipMenuItemDirective, typeof i11.ChipMenuReorderComponent]>;
25
26
  static ɵinj: i0.ɵɵInjectorDeclaration<ChipMenuModule>;
26
27
  }
@@ -2,6 +2,7 @@
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 { ConfiguratorService } from '../configurator.service';
5
6
  import { MenuTabbingService } from './filtering/menu-tabbing.service';
6
7
  import { EventEmitter } from '@angular/core';
7
8
  import * as i0 from "@angular/core";
@@ -10,13 +11,16 @@ import * as i0 from "@angular/core";
10
11
  * Represents the service that is passed to the ChipMenuFilterComponent and ChipMenuSortComponent.
11
12
  */
12
13
  export declare class ChipMenuService {
14
+ configuratorService?: ConfiguratorService;
13
15
  menuTabbingService: MenuTabbingService;
14
16
  closeMenu: EventEmitter<any>;
17
+ private sub;
15
18
  /**
16
19
  * Closes the chip menu.
17
20
  */
18
21
  close(): void;
19
- constructor(menuTabbingService?: MenuTabbingService);
22
+ constructor(menuTabbingService?: MenuTabbingService, configuratorService?: ConfiguratorService);
23
+ ngOnDestroy(): void;
20
24
  static ɵfac: i0.ɵɵFactoryDeclaration<ChipMenuService, never>;
21
25
  static ɵprov: i0.ɵɵInjectableDeclaration<ChipMenuService>;
22
26
  }
@@ -7,12 +7,14 @@ import { PivotGridConfiguratorState } from '@progress/kendo-pivotgrid-common';
7
7
  import { PivotGridDataService } from '../data-binding/pivotgrid-data.service';
8
8
  import { PivotGridConfiguratorOrientation } from '../models/configurator-orientation';
9
9
  import { DropSectionType } from '../models/drop-section';
10
+ import type { PivotGridConfiguratorComponent } from './configurator.component';
10
11
  import * as i0 from "@angular/core";
11
12
  /**
12
13
  * @hidden
13
14
  */
14
15
  export declare class ConfiguratorService {
15
16
  private dataService;
17
+ configuratorInstance: PivotGridConfiguratorComponent;
16
18
  state: PivotGridConfiguratorState;
17
19
  draggedElement: {
18
20
  element: Element;
@@ -22,6 +24,7 @@ export declare class ConfiguratorService {
22
24
  cueContainer: Element;
23
25
  orientation: PivotGridConfiguratorOrientation;
24
26
  configuratorStateChange: EventEmitter<any>;
27
+ closeMenu: EventEmitter<any>;
25
28
  constructor(dataService: PivotGridDataService);
26
29
  parseConfiguratorState(action: any): void;
27
30
  static ɵfac: i0.ɵɵFactoryDeclaration<ConfiguratorService, never>;
@@ -2,7 +2,7 @@
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 { ElementRef, OnInit, NgZone, OnDestroy, Renderer2 } from '@angular/core';
5
+ import { ElementRef, OnInit, NgZone, OnDestroy, Renderer2, ChangeDetectorRef } from '@angular/core';
6
6
  import { DraggableDirective } from '@progress/kendo-angular-common';
7
7
  import { PivotGridAxis } from '@progress/kendo-pivotgrid-common';
8
8
  import { ConfiguratorService } from './configurator.service';
@@ -18,16 +18,18 @@ export declare class DraggableChipDirective implements OnInit, OnDestroy {
18
18
  private service;
19
19
  private cue;
20
20
  private renderer;
21
+ private cdr;
21
22
  get pointerEvents(): any;
22
23
  touchActions: string;
23
24
  item: PivotGridAxis;
24
25
  initialX: any;
25
26
  initialY: any;
26
27
  private drag;
28
+ private invalidTarget;
27
29
  private subs;
28
- constructor(draggable: DraggableDirective, element: ElementRef, zone: NgZone, service: ConfiguratorService, cue: DropCueService, renderer: Renderer2);
30
+ constructor(draggable: DraggableDirective, element: ElementRef, zone: NgZone, service: ConfiguratorService, cue: DropCueService, renderer: Renderer2, cdr: ChangeDetectorRef);
29
31
  ngOnInit(): void;
30
32
  ngOnDestroy(): void;
31
- static ɵfac: i0.ɵɵFactoryDeclaration<DraggableChipDirective, [{ optional: true; }, null, null, null, null, null]>;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<DraggableChipDirective, [{ optional: true; }, null, null, null, null, null, null]>;
32
34
  static ɵdir: i0.ɵɵDirectiveDeclaration<DraggableChipDirective, "[kendoChipDraggable]", never, { "item": "item"; }, {}, never>;
33
35
  }
@@ -86,7 +86,7 @@ ChipMenuFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
86
86
  </kendo-pivot-filter-menu-container>
87
87
  </ng-template>
88
88
  </kendo-pivot-chipmenu-item>
89
- `, isInline: true, components: [{ type: i2.ChipMenuItemComponent, selector: "kendo-pivot-chipmenu-item", inputs: ["icon", "svgIcon", "text", "selected", "expanded"], outputs: ["itemClick", "expand", "collapse"] }, { type: i3.FilterMenuContainerComponent, selector: "kendo-pivot-filter-menu-container", inputs: ["chip", "isLast", "isExpanded", "menuTabbingService", "actionsClass"], outputs: ["close"] }], directives: [{ type: i4.ChipMenuItemContentTemplateDirective, selector: "[kendoPivotChipMenuItemContentTemplate]" }] });
89
+ `, isInline: true, components: [{ type: i2.ChipMenuItemComponent, selector: "kendo-pivot-chipmenu-item", inputs: ["icon", "svgIcon", "text", "selected", "expanded", "disabled"], outputs: ["itemClick", "expand", "collapse"] }, { type: i3.FilterMenuContainerComponent, selector: "kendo-pivot-filter-menu-container", inputs: ["chip", "isLast", "isExpanded", "menuTabbingService", "actionsClass"], outputs: ["close"] }], directives: [{ type: i4.ChipMenuItemContentTemplateDirective, selector: "[kendoPivotChipMenuItemContentTemplate]" }] });
90
90
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ChipMenuFilterComponent, decorators: [{
91
91
  type: Component,
92
92
  args: [{
@@ -55,14 +55,16 @@ export class ChipMenuItemComponent {
55
55
  }
56
56
  }
57
57
  ChipMenuItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ChipMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
58
- ChipMenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ChipMenuItemComponent, selector: "kendo-pivot-chipmenu-item", inputs: { icon: "icon", svgIcon: "svgIcon", text: "text", selected: "selected", expanded: "expanded" }, outputs: { itemClick: "itemClick", expand: "expand", collapse: "collapse" }, queries: [{ propertyName: "contentTemplate", first: true, predicate: ChipMenuItemContentTemplateDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: `
58
+ ChipMenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ChipMenuItemComponent, selector: "kendo-pivot-chipmenu-item", inputs: { icon: "icon", svgIcon: "svgIcon", text: "text", selected: "selected", expanded: "expanded", disabled: "disabled" }, outputs: { itemClick: "itemClick", expand: "expand", collapse: "collapse" }, queries: [{ propertyName: "contentTemplate", first: true, predicate: ChipMenuItemContentTemplateDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: `
59
59
  <div
60
60
  class="k-columnmenu-item"
61
61
  (click)="onClick($event)"
62
62
  (keydown.enter)="onClick($event)"
63
63
  [class.k-selected]="selected"
64
+ [class.k-disabled]="disabled"
64
65
  role="button"
65
66
  [attr.aria-expanded]="expanded"
67
+ [attr.aria-disabled]="disabled"
66
68
  >
67
69
  <kendo-icon-wrapper
68
70
  *ngIf="icon"
@@ -130,8 +132,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
130
132
  (click)="onClick($event)"
131
133
  (keydown.enter)="onClick($event)"
132
134
  [class.k-selected]="selected"
135
+ [class.k-disabled]="disabled"
133
136
  role="button"
134
137
  [attr.aria-expanded]="expanded"
138
+ [attr.aria-disabled]="disabled"
135
139
  >
136
140
  <kendo-icon-wrapper
137
141
  *ngIf="icon"
@@ -161,6 +165,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
161
165
  type: Input
162
166
  }], expanded: [{
163
167
  type: Input
168
+ }], disabled: [{
169
+ type: Input
164
170
  }], contentTemplate: [{
165
171
  type: ContentChild,
166
172
  args: [ChipMenuItemContentTemplateDirective, { static: false }]
@@ -0,0 +1,185 @@
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 { ChangeDetectorRef, Component, Input, NgZone, Renderer2 } from '@angular/core';
6
+ import { ChipMenuItemBase } from './chip-menu-item-base';
7
+ import { ConfiguratorService } from '../configurator.service';
8
+ import { PivotLocalizationService } from '../../localization/pivot-localization.service';
9
+ import { arrowLeftIcon, arrowRightIcon, columnsIcon, rowsIcon } from '@progress/kendo-svg-icons';
10
+ import { PivotGridDataService } from '../../data-binding/pivotgrid-data.service';
11
+ import { swapItems } from '../../util';
12
+ import * as i0 from "@angular/core";
13
+ import * as i1 from "../../localization/pivot-localization.service";
14
+ import * as i2 from "../configurator.service";
15
+ import * as i3 from "../../data-binding/pivotgrid-data.service";
16
+ import * as i4 from "./chip-menu-item.component";
17
+ import * as i5 from "@angular/common";
18
+ /**
19
+ * @hidden
20
+ *
21
+ * Represents a chip-menu item for reordering PivotGrid fields.
22
+ */
23
+ export class ChipMenuReorderComponent extends ChipMenuItemBase {
24
+ constructor(localization, renderer, configuratorService, dataService, cdr, ngZone) {
25
+ super();
26
+ this.localization = localization;
27
+ this.renderer = renderer;
28
+ this.configuratorService = configuratorService;
29
+ this.dataService = dataService;
30
+ this.cdr = cdr;
31
+ this.ngZone = ngZone;
32
+ this.columnsIcon = columnsIcon;
33
+ this.rowsIcon = rowsIcon;
34
+ this.arrowLeftIcon = arrowLeftIcon;
35
+ this.arrowRightIcon = arrowRightIcon;
36
+ this.rtl = false;
37
+ this.subs = this.localization.localization.changes.subscribe(({ rtl }) => this.rtl = rtl);
38
+ }
39
+ get isColumnsField() {
40
+ return this.configuratorService.state.columnAxes.some(item => item === this.chip);
41
+ }
42
+ get isRowsField() {
43
+ return this.configuratorService.state.rowAxes.some(item => item === this.chip);
44
+ }
45
+ get isMeasureField() {
46
+ return this.configuratorService.state.measureAxes.some(item => item === this.chip);
47
+ }
48
+ get isFirst() {
49
+ const state = this.configuratorService.state;
50
+ return this.isColumnsField && state.columnAxes[0] === this.chip ||
51
+ this.isRowsField && state.rowAxes[0] === this.chip ||
52
+ this.isMeasureField && state.measureAxes[0] === this.chip;
53
+ }
54
+ get isLast() {
55
+ const state = this.configuratorService.state;
56
+ return this.isColumnsField && state.columnAxes[state.columnAxes.length - 1] === this.chip ||
57
+ this.isRowsField && state.rowAxes[state.rowAxes.length - 1] === this.chip ||
58
+ this.isMeasureField && state.measureAxes[state.measureAxes.length - 1] === this.chip;
59
+ }
60
+ ngOnDestroy() {
61
+ this.subs.unsubscribe();
62
+ }
63
+ messageFor(localizationToken) {
64
+ return this.localization.get(localizationToken);
65
+ }
66
+ move(e, target) {
67
+ const isDisabled = e.target.closest('.k-columnmenu-item').getAttribute('aria-disabled') !== 'false';
68
+ if (isDisabled) {
69
+ return;
70
+ }
71
+ const currentState = this.configuratorService.state;
72
+ switch (target) {
73
+ case 'columns':
74
+ {
75
+ const newRows = currentState.rowAxes.filter(item => item !== this.chip);
76
+ const newCols = [...currentState.columnAxes, this.chip];
77
+ const newState = { ...currentState, rowAxes: newRows, columnAxes: newCols };
78
+ this.configuratorService.configuratorInstance.setState(newState);
79
+ this.ngZone.runOutsideAngular(() => setTimeout(() => this.configuratorService.configuratorInstance[`${target}List`]?.chips.last.element.nativeElement.click()));
80
+ }
81
+ break;
82
+ case 'rows':
83
+ {
84
+ const newCols = currentState.columnAxes.filter(item => item !== this.chip);
85
+ const newRows = [...currentState.rowAxes, this.chip];
86
+ const newState = { ...currentState, rowAxes: newRows, columnAxes: newCols };
87
+ this.configuratorService.configuratorInstance.setState(newState);
88
+ this.ngZone.runOutsideAngular(() => setTimeout(() => this.configuratorService.configuratorInstance[`${target}List`]?.chips.last.element.nativeElement.click()));
89
+ }
90
+ break;
91
+ case 'prev':
92
+ {
93
+ const axis = currentState.rowAxes.indexOf(this.chip) > -1 ? 'row' : currentState.columnAxes.indexOf(this.chip) > -1 ? 'column' : 'measure';
94
+ const index = currentState[`${axis}Axes`].indexOf(this.chip);
95
+ swapItems(currentState[`${axis}Axes`], index, index - 1);
96
+ const newState = { ...currentState };
97
+ this.configuratorService.configuratorInstance.setState(newState);
98
+ }
99
+ break;
100
+ case 'next':
101
+ {
102
+ const axis = currentState.rowAxes.indexOf(this.chip) > -1 ? 'row' : currentState.columnAxes.indexOf(this.chip) > -1 ? 'column' : 'measure';
103
+ const index = currentState[`${axis}Axes`].indexOf(this.chip);
104
+ swapItems(currentState[`${axis}Axes`], index, index + 1);
105
+ const newState = { ...currentState };
106
+ this.configuratorService.configuratorInstance.setState(newState);
107
+ }
108
+ break;
109
+ }
110
+ this.close();
111
+ }
112
+ }
113
+ ChipMenuReorderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ChipMenuReorderComponent, deps: [{ token: i1.PivotLocalizationService }, { token: i0.Renderer2 }, { token: i2.ConfiguratorService }, { token: i3.PivotGridDataService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
114
+ ChipMenuReorderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ChipMenuReorderComponent, selector: "kendo-pivot-chipmenu-reorder", inputs: { chip: "chip" }, usesInheritance: true, ngImport: i0, template: `
115
+ <kendo-pivot-chipmenu-item
116
+ *ngIf="!isMeasureField"
117
+ [disabled]="isColumnsField"
118
+ [text]="messageFor('fieldMenuMoveToColumnsItem')"
119
+ icon="columns"
120
+ [svgIcon]="columnsIcon"
121
+ (itemClick)="move($event, 'columns')">
122
+ </kendo-pivot-chipmenu-item>
123
+ <kendo-pivot-chipmenu-item
124
+ *ngIf="!isMeasureField"
125
+ [disabled]="isRowsField"
126
+ [text]="messageFor('fieldMenuMoveToRowsItem')"
127
+ icon="rows"
128
+ [svgIcon]="rowsIcon"
129
+ (itemClick)="move($event, 'rows')">
130
+ </kendo-pivot-chipmenu-item>
131
+ <kendo-pivot-chipmenu-item
132
+ [disabled]="isFirst"
133
+ [text]="messageFor('fieldMenuMovePreviousItem')"
134
+ [icon]="rtl ? 'arrow-right' : 'arrow-left'"
135
+ [svgIcon]="rtl ? arrowRightIcon : arrowLeftIcon"
136
+ (itemClick)="move($event, 'prev')">
137
+ </kendo-pivot-chipmenu-item>
138
+ <kendo-pivot-chipmenu-item
139
+ [disabled]="isLast"
140
+ [text]="messageFor('fieldMenuMoveNextItem')"
141
+ [icon]="rtl ? 'arrow-left' : 'arrow-right'"
142
+ [svgIcon]="rtl ? arrowLeftIcon : arrowRightIcon"
143
+ (itemClick)="move($event, 'next')">
144
+ </kendo-pivot-chipmenu-item>
145
+ `, isInline: true, components: [{ type: i4.ChipMenuItemComponent, selector: "kendo-pivot-chipmenu-item", inputs: ["icon", "svgIcon", "text", "selected", "expanded", "disabled"], outputs: ["itemClick", "expand", "collapse"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ChipMenuReorderComponent, decorators: [{
147
+ type: Component,
148
+ args: [{
149
+ selector: 'kendo-pivot-chipmenu-reorder',
150
+ template: `
151
+ <kendo-pivot-chipmenu-item
152
+ *ngIf="!isMeasureField"
153
+ [disabled]="isColumnsField"
154
+ [text]="messageFor('fieldMenuMoveToColumnsItem')"
155
+ icon="columns"
156
+ [svgIcon]="columnsIcon"
157
+ (itemClick)="move($event, 'columns')">
158
+ </kendo-pivot-chipmenu-item>
159
+ <kendo-pivot-chipmenu-item
160
+ *ngIf="!isMeasureField"
161
+ [disabled]="isRowsField"
162
+ [text]="messageFor('fieldMenuMoveToRowsItem')"
163
+ icon="rows"
164
+ [svgIcon]="rowsIcon"
165
+ (itemClick)="move($event, 'rows')">
166
+ </kendo-pivot-chipmenu-item>
167
+ <kendo-pivot-chipmenu-item
168
+ [disabled]="isFirst"
169
+ [text]="messageFor('fieldMenuMovePreviousItem')"
170
+ [icon]="rtl ? 'arrow-right' : 'arrow-left'"
171
+ [svgIcon]="rtl ? arrowRightIcon : arrowLeftIcon"
172
+ (itemClick)="move($event, 'prev')">
173
+ </kendo-pivot-chipmenu-item>
174
+ <kendo-pivot-chipmenu-item
175
+ [disabled]="isLast"
176
+ [text]="messageFor('fieldMenuMoveNextItem')"
177
+ [icon]="rtl ? 'arrow-left' : 'arrow-right'"
178
+ [svgIcon]="rtl ? arrowLeftIcon : arrowRightIcon"
179
+ (itemClick)="move($event, 'next')">
180
+ </kendo-pivot-chipmenu-item>
181
+ `
182
+ }]
183
+ }], ctorParameters: function () { return [{ type: i1.PivotLocalizationService }, { type: i0.Renderer2 }, { type: i2.ConfiguratorService }, { type: i3.PivotGridDataService }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }]; }, propDecorators: { chip: [{
184
+ type: Input
185
+ }] } });
@@ -71,7 +71,7 @@ ChipMenuSortComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
71
71
  (itemClick)="toggleSort('desc')"
72
72
  [selected]="sortedDesc">
73
73
  </kendo-pivot-chipmenu-item>
74
- `, isInline: true, components: [{ type: i3.ChipMenuItemComponent, selector: "kendo-pivot-chipmenu-item", inputs: ["icon", "svgIcon", "text", "selected", "expanded"], outputs: ["itemClick", "expand", "collapse"] }] });
74
+ `, isInline: true, components: [{ type: i3.ChipMenuItemComponent, selector: "kendo-pivot-chipmenu-item", inputs: ["icon", "svgIcon", "text", "selected", "expanded", "disabled"], outputs: ["itemClick", "expand", "collapse"] }] });
75
75
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ChipMenuSortComponent, decorators: [{
76
76
  type: Component,
77
77
  args: [{
@@ -4,7 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  /* eslint-disable @typescript-eslint/no-explicit-any */
6
6
  import { MenuTabbingService } from './filtering/menu-tabbing.service';
7
- import { Component, Input, ElementRef, ViewChild } from '@angular/core';
7
+ import { Component, Input, ElementRef, ViewChild, Renderer2 } from '@angular/core';
8
8
  import { SinglePopupService } from './single-popup.service';
9
9
  import { ChipMenuService } from './chip-menu.service';
10
10
  import { PivotLocalizationService } from '../../localization/pivot-localization.service';
@@ -18,7 +18,9 @@ import * as i4 from "@progress/kendo-angular-icons";
18
18
  import * as i5 from "./chip-menu-container.component";
19
19
  import * as i6 from "./chip-menu-sort.component";
20
20
  import * as i7 from "./chip-menu-filter.component";
21
- import * as i8 from "./chip-menu-item.directive";
21
+ import * as i8 from "./chip-menu-reorder.component";
22
+ import * as i9 from "@angular/common";
23
+ import * as i10 from "./chip-menu-item.directive";
22
24
  const POPUP_CLASS = 'k-column-menu';
23
25
  /**
24
26
  * @hidden
@@ -26,11 +28,13 @@ const POPUP_CLASS = 'k-column-menu';
26
28
  * Represents the field chip menu component.
27
29
  */
28
30
  export class ChipMenuComponent {
29
- constructor(popupService, localization, service) {
31
+ constructor(popupService, localization, service, renderer) {
30
32
  this.popupService = popupService;
31
33
  this.localization = localization;
32
34
  this.service = service;
35
+ this.renderer = renderer;
33
36
  this.tabIndex = '-1';
37
+ this.isMeasureField = false;
34
38
  this.menuItemSVGIcon = moreVerticalIcon;
35
39
  this.closeSubscription = service.closeMenu.subscribe(this.close.bind(this));
36
40
  }
@@ -45,6 +49,7 @@ export class ChipMenuComponent {
45
49
  }
46
50
  const anchor = this.anchor.nativeElement;
47
51
  this.popupRef = this.popupService.open(anchor, template, this.popupRef, POPUP_CLASS);
52
+ this.popupRef && this.renderer.setAttribute(this.popupRef.popupElement, 'dir', this.localization.rtl ? 'rtl' : 'ltr');
48
53
  if (!this.popupRef) {
49
54
  anchor.focus();
50
55
  }
@@ -60,8 +65,8 @@ export class ChipMenuComponent {
60
65
  return replaceMessagePlaceholder(localizationMsg, 'fieldName', chipName);
61
66
  }
62
67
  }
63
- ChipMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ChipMenuComponent, deps: [{ token: i1.SinglePopupService }, { token: i2.PivotLocalizationService }, { token: i3.ChipMenuService }], target: i0.ɵɵFactoryTarget.Component });
64
- ChipMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ChipMenuComponent, selector: "kendo-pivot-chip-menu", inputs: { chip: "chip", tabIndex: "tabIndex" }, providers: [
68
+ ChipMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ChipMenuComponent, deps: [{ token: i1.SinglePopupService }, { token: i2.PivotLocalizationService }, { token: i3.ChipMenuService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
69
+ ChipMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ChipMenuComponent, selector: "kendo-pivot-chip-menu", inputs: { chip: "chip", tabIndex: "tabIndex", isMeasureField: "isMeasureField" }, providers: [
65
70
  ChipMenuService,
66
71
  MenuTabbingService
67
72
  ], viewQueries: [{ propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: `
@@ -78,23 +83,31 @@ ChipMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
78
83
  <kendo-pivot-chipmenu-container
79
84
  (keydown.escape)="close()"
80
85
  (keydown.enter)="$event.stopImmediatePropagation()">
81
- <kendo-pivot-chipmenu-sort
82
- #sortItem
86
+ <ng-container *ngIf="!isMeasureField">
87
+ <kendo-pivot-chipmenu-sort
88
+ #sortItem
89
+ [chip]="chip"
90
+ [kendoPivotChipMenuItem]="sortItem"
91
+ [service]="service">
92
+ </kendo-pivot-chipmenu-sort>
93
+ <span class="k-separator" [style.borderColor]="'rgba(0, 0, 0, 0.08)'"></span>
94
+ <kendo-pivot-chipmenu-filter
95
+ #filterItem
96
+ [chip]="chip"
97
+ [isLast]="true"
98
+ [kendoPivotChipMenuItem]="filterItem"
99
+ [service]="service">
100
+ </kendo-pivot-chipmenu-filter>
101
+ <span class="k-separator" [style.borderColor]="'rgba(0, 0, 0, 0.08)'"></span>
102
+ </ng-container>
103
+ <kendo-pivot-chipmenu-reorder
104
+ #reorderItem
83
105
  [chip]="chip"
84
- [kendoPivotChipMenuItem]="sortItem"
85
- [service]="service">
86
- </kendo-pivot-chipmenu-sort>
87
-
88
- <kendo-pivot-chipmenu-filter
89
- #filterItem
90
- [chip]="chip"
91
- [isLast]="true"
92
- [kendoPivotChipMenuItem]="filterItem"
93
- [service]="service">
94
- </kendo-pivot-chipmenu-filter>
106
+ [kendoPivotChipMenuItem]="reorderItem"
107
+ [service]="service"></kendo-pivot-chipmenu-reorder>
95
108
  </kendo-pivot-chipmenu-container>
96
109
  </ng-template>
97
- `, isInline: true, components: [{ type: i4.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { type: i5.ChipMenuContainerComponent, selector: "kendo-pivot-chipmenu-container" }, { type: i6.ChipMenuSortComponent, selector: "kendo-pivot-chipmenu-sort", inputs: ["chip"] }, { type: i7.ChipMenuFilterComponent, selector: "kendo-pivot-chipmenu-filter", inputs: ["chip", "expanded", "isLast"], outputs: ["expand", "collapse"] }], directives: [{ type: i8.ChipMenuItemDirective, selector: "[kendoPivotChipMenuItem]", inputs: ["kendoPivotChipMenuItem"] }] });
110
+ `, isInline: true, components: [{ type: i4.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { type: i5.ChipMenuContainerComponent, selector: "kendo-pivot-chipmenu-container" }, { type: i6.ChipMenuSortComponent, selector: "kendo-pivot-chipmenu-sort", inputs: ["chip"] }, { type: i7.ChipMenuFilterComponent, selector: "kendo-pivot-chipmenu-filter", inputs: ["chip", "expanded", "isLast"], outputs: ["expand", "collapse"] }, { type: i8.ChipMenuReorderComponent, selector: "kendo-pivot-chipmenu-reorder", inputs: ["chip"] }], directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.ChipMenuItemDirective, selector: "[kendoPivotChipMenuItem]", inputs: ["kendoPivotChipMenuItem"] }] });
98
111
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ChipMenuComponent, decorators: [{
99
112
  type: Component,
100
113
  args: [{
@@ -117,28 +130,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
117
130
  <kendo-pivot-chipmenu-container
118
131
  (keydown.escape)="close()"
119
132
  (keydown.enter)="$event.stopImmediatePropagation()">
120
- <kendo-pivot-chipmenu-sort
121
- #sortItem
122
- [chip]="chip"
123
- [kendoPivotChipMenuItem]="sortItem"
124
- [service]="service">
125
- </kendo-pivot-chipmenu-sort>
126
-
127
- <kendo-pivot-chipmenu-filter
128
- #filterItem
133
+ <ng-container *ngIf="!isMeasureField">
134
+ <kendo-pivot-chipmenu-sort
135
+ #sortItem
136
+ [chip]="chip"
137
+ [kendoPivotChipMenuItem]="sortItem"
138
+ [service]="service">
139
+ </kendo-pivot-chipmenu-sort>
140
+ <span class="k-separator" [style.borderColor]="'rgba(0, 0, 0, 0.08)'"></span>
141
+ <kendo-pivot-chipmenu-filter
142
+ #filterItem
143
+ [chip]="chip"
144
+ [isLast]="true"
145
+ [kendoPivotChipMenuItem]="filterItem"
146
+ [service]="service">
147
+ </kendo-pivot-chipmenu-filter>
148
+ <span class="k-separator" [style.borderColor]="'rgba(0, 0, 0, 0.08)'"></span>
149
+ </ng-container>
150
+ <kendo-pivot-chipmenu-reorder
151
+ #reorderItem
129
152
  [chip]="chip"
130
- [isLast]="true"
131
- [kendoPivotChipMenuItem]="filterItem"
132
- [service]="service">
133
- </kendo-pivot-chipmenu-filter>
153
+ [kendoPivotChipMenuItem]="reorderItem"
154
+ [service]="service"></kendo-pivot-chipmenu-reorder>
134
155
  </kendo-pivot-chipmenu-container>
135
156
  </ng-template>
136
157
  `
137
158
  }]
138
- }], ctorParameters: function () { return [{ type: i1.SinglePopupService }, { type: i2.PivotLocalizationService }, { type: i3.ChipMenuService }]; }, propDecorators: { chip: [{
159
+ }], ctorParameters: function () { return [{ type: i1.SinglePopupService }, { type: i2.PivotLocalizationService }, { type: i3.ChipMenuService }, { type: i0.Renderer2 }]; }, propDecorators: { chip: [{
139
160
  type: Input
140
161
  }], tabIndex: [{
141
162
  type: Input
163
+ }], isMeasureField: [{
164
+ type: Input
142
165
  }], anchor: [{
143
166
  type: ViewChild,
144
167
  args: ['anchor', { static: true, read: ElementRef }]