@progress/kendo-angular-pivotgrid 0.2.0-dev.202209020712 → 0.2.0-dev.202209020832

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 (54) hide show
  1. package/bundles/kendo-angular-pivotgrid.umd.js +1 -1
  2. package/configurator/chip-menu/chip-menu-container.component.d.ts +21 -0
  3. package/configurator/chip-menu/chip-menu-filter.component.d.ts +44 -0
  4. package/configurator/chip-menu/chip-menu-item-base.d.ts +22 -0
  5. package/configurator/chip-menu/chip-menu-item-content-template.directive.d.ts +18 -0
  6. package/configurator/chip-menu/chip-menu-item.component.d.ts +50 -0
  7. package/configurator/chip-menu/chip-menu-item.directive.d.ts +32 -0
  8. package/configurator/chip-menu/chip-menu-sort.component.d.ts +33 -0
  9. package/configurator/chip-menu/chip-menu.component.d.ts +35 -0
  10. package/configurator/chip-menu/chip-menu.module.d.ts +26 -0
  11. package/configurator/chip-menu/chip-menu.service.d.ts +22 -0
  12. package/configurator/chip-menu/filtering/filter-menu-container.component.d.ts +47 -0
  13. package/configurator/chip-menu/filtering/filter-menu-dropdownlist.directive.d.ts +19 -0
  14. package/configurator/chip-menu/filtering/menu-tabbing.service.d.ts +17 -0
  15. package/configurator/chip-menu/filtering/string-filter-menu.component.d.ts +53 -0
  16. package/configurator/chip-menu/single-popup.service.d.ts +50 -0
  17. package/configurator/configurator.component.d.ts +4 -1
  18. package/data-binding/base-binding-directive.d.ts +10 -1
  19. package/esm2015/configurator/chip-menu/chip-menu-container.component.js +46 -0
  20. package/esm2015/configurator/chip-menu/chip-menu-filter.component.js +112 -0
  21. package/esm2015/configurator/chip-menu/chip-menu-item-base.js +36 -0
  22. package/esm2015/configurator/chip-menu/chip-menu-item-content-template.directive.js +27 -0
  23. package/esm2015/configurator/chip-menu/chip-menu-item.component.js +157 -0
  24. package/esm2015/configurator/chip-menu/chip-menu-item.directive.js +88 -0
  25. package/esm2015/configurator/chip-menu/chip-menu-sort.component.js +89 -0
  26. package/esm2015/configurator/chip-menu/chip-menu.component.js +130 -0
  27. package/esm2015/configurator/chip-menu/chip-menu.module.js +83 -0
  28. package/esm2015/configurator/chip-menu/chip-menu.service.js +28 -0
  29. package/esm2015/configurator/chip-menu/filtering/filter-menu-container.component.js +173 -0
  30. package/esm2015/configurator/chip-menu/filtering/filter-menu-dropdownlist.directive.js +38 -0
  31. package/esm2015/configurator/chip-menu/filtering/menu-tabbing.service.js +20 -0
  32. package/esm2015/configurator/chip-menu/filtering/string-filter-menu.component.js +133 -0
  33. package/esm2015/configurator/chip-menu/single-popup.service.js +121 -0
  34. package/esm2015/configurator/configurator.component.js +56 -33
  35. package/esm2015/configurator/configurator.service.js +2 -2
  36. package/esm2015/data-binding/base-binding-directive.js +16 -4
  37. package/esm2015/data-binding/local-binding.directive.js +3 -3
  38. package/esm2015/data-binding/olap-binding.directive.js +6 -4
  39. package/esm2015/localization/messages.js +3 -1
  40. package/esm2015/localization/pivot-localization.service.js +28 -0
  41. package/esm2015/models/configurator-settings.js +3 -1
  42. package/esm2015/package-metadata.js +1 -1
  43. package/esm2015/pivotgrid.component.js +14 -5
  44. package/esm2015/pivotgrid.module.js +9 -12
  45. package/esm2015/shared.module.js +40 -0
  46. package/esm2015/util.js +13 -0
  47. package/fesm2015/kendo-angular-pivotgrid.js +1331 -75
  48. package/localization/messages.d.ts +23 -1
  49. package/localization/pivot-localization.service.d.ts +19 -0
  50. package/models/configurator-settings.d.ts +4 -1
  51. package/package.json +1 -1
  52. package/pivotgrid.module.d.ts +6 -7
  53. package/shared.module.d.ts +17 -0
  54. package/util.d.ts +12 -0
@@ -0,0 +1,112 @@
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 { Component, Input, Output, EventEmitter } from '@angular/core';
6
+ import { ChipMenuItemBase } from './chip-menu-item-base';
7
+ import * as i0 from "@angular/core";
8
+ import * as i1 from "../../localization/pivot-localization.service";
9
+ import * as i2 from "./chip-menu-item.component";
10
+ import * as i3 from "./filtering/filter-menu-container.component";
11
+ import * as i4 from "./chip-menu-item-content-template.directive";
12
+ /**
13
+ * @hidden
14
+ * Represents the component for setting field filters in the PivotGrid.
15
+ */
16
+ export class ChipMenuFilterComponent extends ChipMenuItemBase {
17
+ constructor(localization, hostElement) {
18
+ super();
19
+ this.localization = localization;
20
+ this.hostElement = hostElement;
21
+ /**
22
+ * Fires when the content is expanded.
23
+ */
24
+ this.expand = new EventEmitter();
25
+ /**
26
+ * Fires when the content is collapsed.
27
+ */
28
+ this.collapse = new EventEmitter();
29
+ /**
30
+ * Specifies if the content is expanded.
31
+ */
32
+ this.expanded = false;
33
+ this.isLast = false;
34
+ this.actionsClass = 'k-columnmenu-actions';
35
+ }
36
+ onCollapse() {
37
+ this.expanded = false;
38
+ if (this.isLast) {
39
+ this.service.menuTabbingService.lastFocusable = this.hostElement.nativeElement.querySelector('.k-columnmenu-item');
40
+ }
41
+ this.collapse.emit();
42
+ }
43
+ onExpand() {
44
+ this.expanded = true;
45
+ this.expand.emit();
46
+ }
47
+ /**
48
+ * Returns the localized message for a given token
49
+ */
50
+ messageFor(localizationToken) {
51
+ return this.localization.get(localizationToken);
52
+ }
53
+ }
54
+ ChipMenuFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuFilterComponent, deps: [{ token: i1.PivotLocalizationService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
55
+ ChipMenuFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ChipMenuFilterComponent, selector: "kendo-pivot-chipmenu-filter", inputs: { chip: "chip", expanded: "expanded", isLast: "isLast" }, outputs: { expand: "expand", collapse: "collapse" }, usesInheritance: true, ngImport: i0, template: `
56
+ <kendo-pivot-chipmenu-item
57
+ classs="k-widget k-expander"
58
+ [text]="messageFor('fieldMenuFilterItemLabel')"
59
+ icon="filter"
60
+ [expanded]="expanded"
61
+ (collapse)="onCollapse()"
62
+ (expand)="onExpand()">
63
+ <ng-template kendoPivotChipMenuItemContentTemplate>
64
+ <kendo-pivot-filter-menu-container
65
+ [chip]="chip"
66
+ [menuTabbingService]="service.menuTabbingService"
67
+ [actionsClass]="actionsClass"
68
+ [isLast]="isLast"
69
+ [isExpanded]="expanded"
70
+ (keydown.shift.tab)="$event.stopImmediatePropagation()"
71
+ (close)="close()">
72
+ </kendo-pivot-filter-menu-container>
73
+ </ng-template>
74
+ </kendo-pivot-chipmenu-item>
75
+ `, isInline: true, components: [{ type: i2.ChipMenuItemComponent, selector: "kendo-pivot-chipmenu-item", inputs: ["icon", "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]" }] });
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuFilterComponent, decorators: [{
77
+ type: Component,
78
+ args: [{
79
+ selector: 'kendo-pivot-chipmenu-filter',
80
+ template: `
81
+ <kendo-pivot-chipmenu-item
82
+ classs="k-widget k-expander"
83
+ [text]="messageFor('fieldMenuFilterItemLabel')"
84
+ icon="filter"
85
+ [expanded]="expanded"
86
+ (collapse)="onCollapse()"
87
+ (expand)="onExpand()">
88
+ <ng-template kendoPivotChipMenuItemContentTemplate>
89
+ <kendo-pivot-filter-menu-container
90
+ [chip]="chip"
91
+ [menuTabbingService]="service.menuTabbingService"
92
+ [actionsClass]="actionsClass"
93
+ [isLast]="isLast"
94
+ [isExpanded]="expanded"
95
+ (keydown.shift.tab)="$event.stopImmediatePropagation()"
96
+ (close)="close()">
97
+ </kendo-pivot-filter-menu-container>
98
+ </ng-template>
99
+ </kendo-pivot-chipmenu-item>
100
+ `
101
+ }]
102
+ }], ctorParameters: function () { return [{ type: i1.PivotLocalizationService }, { type: i0.ElementRef }]; }, propDecorators: { expand: [{
103
+ type: Output
104
+ }], collapse: [{
105
+ type: Output
106
+ }], chip: [{
107
+ type: Input
108
+ }], expanded: [{
109
+ type: Input
110
+ }], isLast: [{
111
+ type: Input
112
+ }] } });
@@ -0,0 +1,36 @@
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 { Input, isDevMode, HostBinding, Component } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * @hidden
9
+ */
10
+ export class ChipMenuItemBase {
11
+ constructor() {
12
+ this.hostClass = true;
13
+ }
14
+ ngOnInit() {
15
+ if (isDevMode() && !this.service) {
16
+ throw new Error('The service input of the host chip menu components (e.g. ChipMenuSortComponent) is mandatory.');
17
+ }
18
+ }
19
+ close() {
20
+ this.service.close();
21
+ }
22
+ }
23
+ ChipMenuItemBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuItemBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
24
+ ChipMenuItemBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ChipMenuItemBase, selector: "kendo-pivot-chip-menu-item-base", inputs: { service: "service" }, host: { properties: { "class.k-columnmenu-item-wrapper": "this.hostClass" } }, ngImport: i0, template: ``, isInline: true });
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuItemBase, decorators: [{
26
+ type: Component,
27
+ args: [{
28
+ selector: 'kendo-pivot-chip-menu-item-base',
29
+ template: ``
30
+ }]
31
+ }], propDecorators: { service: [{
32
+ type: Input
33
+ }], hostClass: [{
34
+ type: HostBinding,
35
+ args: ['class.k-columnmenu-item-wrapper']
36
+ }] } });
@@ -0,0 +1,27 @@
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, Optional } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * @hidden
9
+ *
10
+ * Represents the content template of the ChipMenuItemComponent.
11
+ * Provides an option for specifying the content of a chip menu item..
12
+ */
13
+ export class ChipMenuItemContentTemplateDirective {
14
+ constructor(templateRef) {
15
+ this.templateRef = templateRef;
16
+ }
17
+ }
18
+ ChipMenuItemContentTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuItemContentTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
19
+ ChipMenuItemContentTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ChipMenuItemContentTemplateDirective, selector: "[kendoPivotChipMenuItemContentTemplate]", ngImport: i0 });
20
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuItemContentTemplateDirective, decorators: [{
21
+ type: Directive,
22
+ args: [{
23
+ selector: '[kendoPivotChipMenuItemContentTemplate]'
24
+ }]
25
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
26
+ type: Optional
27
+ }] }]; } });
@@ -0,0 +1,157 @@
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 { Component, Input, Output, EventEmitter, ContentChild } from '@angular/core';
6
+ import { trigger, transition, style, animate, state } from '@angular/animations';
7
+ import { ChipMenuItemContentTemplateDirective } from './chip-menu-item-content-template.directive';
8
+ import * as i0 from "@angular/core";
9
+ import * as i1 from "@angular/common";
10
+ /**
11
+ * @hidden
12
+ *
13
+ */
14
+ export class ChipMenuItemComponent {
15
+ constructor() {
16
+ /**
17
+ * Fires when the item is clicked.
18
+ */
19
+ this.itemClick = new EventEmitter();
20
+ /**
21
+ * Fires when the content is expanded.
22
+ */
23
+ this.expand = new EventEmitter();
24
+ /**
25
+ * Fires when the content is collapsed.
26
+ */
27
+ this.collapse = new EventEmitter();
28
+ this.contentState = 'collapsed';
29
+ }
30
+ get iconClass() {
31
+ return `k-i-${this.icon}`;
32
+ }
33
+ ngOnChanges(changes) {
34
+ if (changes.expanded) {
35
+ this.updateContentState();
36
+ }
37
+ }
38
+ onClick(e) {
39
+ this.itemClick.emit(e);
40
+ if (this.contentTemplate) {
41
+ this.expanded = !this.expanded;
42
+ this.updateContentState();
43
+ if (this.expanded) {
44
+ this.expand.emit();
45
+ }
46
+ else {
47
+ this.collapse.emit();
48
+ }
49
+ }
50
+ }
51
+ updateContentState() {
52
+ this.contentState = this.expanded ? 'expanded' : 'collapsed';
53
+ }
54
+ }
55
+ ChipMenuItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
56
+ ChipMenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ChipMenuItemComponent, selector: "kendo-pivot-chipmenu-item", inputs: { icon: "icon", 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: `
57
+ <div
58
+ class="k-columnmenu-item"
59
+ (click)="onClick($event)"
60
+ (keydown.enter)="onClick($event)"
61
+ [class.k-selected]="selected"
62
+ role="button"
63
+ [attr.aria-expanded]="expanded">
64
+ <span *ngIf="icon" class="k-icon" [ngClass]="iconClass">
65
+ </span>
66
+ {{ text }}
67
+ </div>
68
+ <div *ngIf="contentTemplate" [@state]="contentState" style="overflow:hidden;" class="k-columnmenu-item-content">
69
+ <ng-container [ngTemplateOutlet]="contentTemplate.templateRef">
70
+ </ng-container>
71
+ <div>
72
+ `, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], animations: [
73
+ trigger('state', [
74
+ state('collapsed', style({ display: 'none' })),
75
+ state('expanded', style({ display: 'block' })),
76
+ transition('collapsed => expanded', [
77
+ style({
78
+ height: '0px',
79
+ display: 'block'
80
+ }),
81
+ animate('100ms ease-in', style({
82
+ height: '*'
83
+ }))
84
+ ]),
85
+ transition('expanded => collapsed', [
86
+ style({
87
+ height: '*'
88
+ }),
89
+ animate('100ms ease-in', style({
90
+ height: '0px'
91
+ }))
92
+ ])
93
+ ])
94
+ ] });
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuItemComponent, decorators: [{
96
+ type: Component,
97
+ args: [{
98
+ animations: [
99
+ trigger('state', [
100
+ state('collapsed', style({ display: 'none' })),
101
+ state('expanded', style({ display: 'block' })),
102
+ transition('collapsed => expanded', [
103
+ style({
104
+ height: '0px',
105
+ display: 'block'
106
+ }),
107
+ animate('100ms ease-in', style({
108
+ height: '*'
109
+ }))
110
+ ]),
111
+ transition('expanded => collapsed', [
112
+ style({
113
+ height: '*'
114
+ }),
115
+ animate('100ms ease-in', style({
116
+ height: '0px'
117
+ }))
118
+ ])
119
+ ])
120
+ ],
121
+ selector: 'kendo-pivot-chipmenu-item',
122
+ template: `
123
+ <div
124
+ class="k-columnmenu-item"
125
+ (click)="onClick($event)"
126
+ (keydown.enter)="onClick($event)"
127
+ [class.k-selected]="selected"
128
+ role="button"
129
+ [attr.aria-expanded]="expanded">
130
+ <span *ngIf="icon" class="k-icon" [ngClass]="iconClass">
131
+ </span>
132
+ {{ text }}
133
+ </div>
134
+ <div *ngIf="contentTemplate" [@state]="contentState" style="overflow:hidden;" class="k-columnmenu-item-content">
135
+ <ng-container [ngTemplateOutlet]="contentTemplate.templateRef">
136
+ </ng-container>
137
+ <div>
138
+ `
139
+ }]
140
+ }], propDecorators: { itemClick: [{
141
+ type: Output
142
+ }], expand: [{
143
+ type: Output
144
+ }], collapse: [{
145
+ type: Output
146
+ }], icon: [{
147
+ type: Input
148
+ }], text: [{
149
+ type: Input
150
+ }], selected: [{
151
+ type: Input
152
+ }], expanded: [{
153
+ type: Input
154
+ }], contentTemplate: [{
155
+ type: ContentChild,
156
+ args: [ChipMenuItemContentTemplateDirective, { static: false }]
157
+ }] } });
@@ -0,0 +1,88 @@
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, Input } from '@angular/core';
6
+ import { Subscription } from 'rxjs';
7
+ import { Keys } from '@progress/kendo-angular-common';
8
+ import * as i0 from "@angular/core";
9
+ /**
10
+ * @hidden
11
+ */
12
+ export class ChipMenuItemDirective {
13
+ constructor(hostElement, renderer, ngZone) {
14
+ this.hostElement = hostElement;
15
+ this.renderer = renderer;
16
+ this.ngZone = ngZone;
17
+ this._isFirst = false;
18
+ this._isLast = false;
19
+ this.subs = new Subscription();
20
+ this.onTab = (e) => {
21
+ if (e.keyCode !== Keys.Tab) {
22
+ return;
23
+ }
24
+ if (this.isFirst && e.shiftKey && e.target === this.chipMenuItems[0]) {
25
+ e.preventDefault();
26
+ this.menuItemComponent.service.menuTabbingService.lastFocusable.focus();
27
+ }
28
+ if (this.isLast && !e.shiftKey) {
29
+ const lastColumnMenuItem = this.getLastColumnMenuItem();
30
+ const isExpanded = this.menuItemComponent.expanded;
31
+ if (lastColumnMenuItem === e.target && !isExpanded) {
32
+ e.preventDefault();
33
+ this.menuItemComponent.service.menuTabbingService.firstFocusable.focus();
34
+ }
35
+ }
36
+ };
37
+ }
38
+ set isFirst(value) {
39
+ if (value) {
40
+ const focusableElement = this.chipMenuItems[0];
41
+ this.menuItemComponent.service.menuTabbingService.firstFocusable = focusableElement;
42
+ this.ngZone.runOutsideAngular(() => {
43
+ const firstItemKeydownSub = this.renderer.listen(focusableElement, 'keydown', this.onTab);
44
+ this.subs.add(firstItemKeydownSub);
45
+ });
46
+ }
47
+ this._isFirst = value;
48
+ }
49
+ get isFirst() {
50
+ return this._isFirst;
51
+ }
52
+ set isLast(value) {
53
+ if (!this.chipMenuItems) {
54
+ return;
55
+ }
56
+ if (value) {
57
+ const lastFocusableElement = this.getLastColumnMenuItem();
58
+ this.menuItemComponent.service.menuTabbingService.lastFocusable = lastFocusableElement;
59
+ this.ngZone.runOutsideAngular(() => {
60
+ const lastItemKeydownSub = this.renderer.listen(lastFocusableElement, 'keydown', this.onTab);
61
+ this.subs.add(lastItemKeydownSub);
62
+ });
63
+ }
64
+ this._isLast = value;
65
+ }
66
+ get isLast() {
67
+ return this._isLast;
68
+ }
69
+ ngAfterViewInit() {
70
+ this.chipMenuItems = this.hostElement.nativeElement.querySelectorAll('.k-columnmenu-item');
71
+ this.chipMenuItems.forEach(el => this.renderer.setAttribute(el, 'tabindex', '0'));
72
+ }
73
+ ngOnDestroy() {
74
+ this.subs.unsubscribe();
75
+ }
76
+ getLastColumnMenuItem() {
77
+ return (this.chipMenuItems.length === 1 ? this.chipMenuItems[0] : this.chipMenuItems[1]);
78
+ }
79
+ }
80
+ ChipMenuItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuItemDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
81
+ ChipMenuItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ChipMenuItemDirective, selector: "[kendoPivotChipMenuItem]", inputs: { menuItemComponent: ["kendoPivotChipMenuItem", "menuItemComponent"] }, ngImport: i0 });
82
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuItemDirective, decorators: [{
83
+ type: Directive,
84
+ args: [{ selector: '[kendoPivotChipMenuItem]' }]
85
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }]; }, propDecorators: { menuItemComponent: [{
86
+ type: Input,
87
+ args: ['kendoPivotChipMenuItem']
88
+ }] } });
@@ -0,0 +1,89 @@
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 { Component, Input } from '@angular/core';
6
+ import { ChipMenuItemBase } from './chip-menu-item-base';
7
+ import { PIVOT_CONFIGURATOR_ACTION } from '@progress/kendo-pivotgrid-common';
8
+ import * as i0 from "@angular/core";
9
+ import * as i1 from "../../localization/pivot-localization.service";
10
+ import * as i2 from "../configurator.service";
11
+ import * as i3 from "./chip-menu-item.component";
12
+ /**
13
+ * @hidden
14
+ *
15
+ * Represents a chip-menu item for sorting PivotGrid fields.
16
+ * Allows the user to sort the PivotGrid.
17
+ */
18
+ export class ChipMenuSortComponent extends ChipMenuItemBase {
19
+ constructor(localization, renderer, configuratorService) {
20
+ super();
21
+ this.localization = localization;
22
+ this.renderer = renderer;
23
+ this.configuratorService = configuratorService;
24
+ }
25
+ get sortedAsc() {
26
+ const descriptor = this.descriptor;
27
+ return descriptor && (!descriptor.dir || descriptor.dir === 'asc');
28
+ }
29
+ get sortedDesc() {
30
+ const descriptor = this.descriptor;
31
+ return descriptor && descriptor.dir === 'desc';
32
+ }
33
+ /**
34
+ * Returns the localized message for a given token
35
+ */
36
+ messageFor(localizationToken) {
37
+ return this.localization.get(localizationToken);
38
+ }
39
+ toggleSort(dir) {
40
+ const field = this.chip.name.toString();
41
+ const descriptor = this.descriptor;
42
+ const sort = this.configuratorService.state.sort.filter(s => s.field !== field);
43
+ if (!descriptor || descriptor.dir !== dir) {
44
+ sort.push({ field, dir });
45
+ }
46
+ this.configuratorService.parseConfiguratorState({ type: PIVOT_CONFIGURATOR_ACTION.setSort, payload: sort });
47
+ this.close();
48
+ }
49
+ get descriptor() {
50
+ return [].concat(this.configuratorService.state.sort || []).find(s => s.field === this.chip.name.toString());
51
+ }
52
+ }
53
+ ChipMenuSortComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuSortComponent, deps: [{ token: i1.PivotLocalizationService }, { token: i0.Renderer2 }, { token: i2.ConfiguratorService }], target: i0.ɵɵFactoryTarget.Component });
54
+ ChipMenuSortComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ChipMenuSortComponent, selector: "kendo-pivot-chipmenu-sort", inputs: { chip: "chip" }, usesInheritance: true, ngImport: i0, template: `
55
+ <kendo-pivot-chipmenu-item
56
+ [text]="messageFor('fieldMenuSortAscendingItemLabel')"
57
+ icon="sort-asc-small"
58
+ (itemClick)="toggleSort('asc')"
59
+ [selected]="sortedAsc">
60
+ </kendo-pivot-chipmenu-item>
61
+ <kendo-pivot-chipmenu-item
62
+ [text]="messageFor('fieldMenuSortDescendingItemLabel')"
63
+ icon="sort-desc-small"
64
+ (itemClick)="toggleSort('desc')"
65
+ [selected]="sortedDesc">
66
+ </kendo-pivot-chipmenu-item>
67
+ `, isInline: true, components: [{ type: i3.ChipMenuItemComponent, selector: "kendo-pivot-chipmenu-item", inputs: ["icon", "text", "selected", "expanded"], outputs: ["itemClick", "expand", "collapse"] }] });
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuSortComponent, decorators: [{
69
+ type: Component,
70
+ args: [{
71
+ selector: 'kendo-pivot-chipmenu-sort',
72
+ template: `
73
+ <kendo-pivot-chipmenu-item
74
+ [text]="messageFor('fieldMenuSortAscendingItemLabel')"
75
+ icon="sort-asc-small"
76
+ (itemClick)="toggleSort('asc')"
77
+ [selected]="sortedAsc">
78
+ </kendo-pivot-chipmenu-item>
79
+ <kendo-pivot-chipmenu-item
80
+ [text]="messageFor('fieldMenuSortDescendingItemLabel')"
81
+ icon="sort-desc-small"
82
+ (itemClick)="toggleSort('desc')"
83
+ [selected]="sortedDesc">
84
+ </kendo-pivot-chipmenu-item>
85
+ `
86
+ }]
87
+ }], ctorParameters: function () { return [{ type: i1.PivotLocalizationService }, { type: i0.Renderer2 }, { type: i2.ConfiguratorService }]; }, propDecorators: { chip: [{
88
+ type: Input
89
+ }] } });
@@ -0,0 +1,130 @@
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 { MenuTabbingService } from './filtering/menu-tabbing.service';
6
+ import { Component, Input, ViewChild } from '@angular/core';
7
+ import { ChipMenuService } from './chip-menu.service';
8
+ import { replaceMessagePlaceholder } from '../../util';
9
+ import * as i0 from "@angular/core";
10
+ import * as i1 from "./single-popup.service";
11
+ import * as i2 from "../../localization/pivot-localization.service";
12
+ import * as i3 from "./chip-menu.service";
13
+ import * as i4 from "./chip-menu-container.component";
14
+ import * as i5 from "./chip-menu-sort.component";
15
+ import * as i6 from "./chip-menu-filter.component";
16
+ import * as i7 from "./chip-menu-item.directive";
17
+ const POPUP_CLASS = 'k-column-menu';
18
+ /**
19
+ * @hidden
20
+ *
21
+ * Represents the field chip menu component.
22
+ */
23
+ export class ChipMenuComponent {
24
+ constructor(popupService, localization, service) {
25
+ this.popupService = popupService;
26
+ this.localization = localization;
27
+ this.service = service;
28
+ this.tabIndex = '-1';
29
+ this.closeSubscription = service.closeMenu.subscribe(this.close.bind(this));
30
+ }
31
+ ngOnDestroy() {
32
+ this.close();
33
+ this.closeSubscription.unsubscribe();
34
+ }
35
+ toggle(e, anchor, template) {
36
+ if (e) {
37
+ e.preventDefault();
38
+ e.stopImmediatePropagation();
39
+ }
40
+ this.popupRef = this.popupService.open(anchor, template, this.popupRef, POPUP_CLASS);
41
+ if (!this.popupRef) {
42
+ this.anchor.nativeElement.focus();
43
+ }
44
+ }
45
+ close() {
46
+ this.popupService.destroy();
47
+ this.popupRef = null;
48
+ this.anchor.nativeElement.focus();
49
+ }
50
+ get chipMenuTitle() {
51
+ const localizationMsg = this.localization.get('chipMenuIconTitle') || '';
52
+ const chipName = this.chip.name.toString();
53
+ return replaceMessagePlaceholder(localizationMsg, 'fieldName', chipName);
54
+ }
55
+ }
56
+ ChipMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuComponent, deps: [{ token: i1.SinglePopupService }, { token: i2.PivotLocalizationService }, { token: i3.ChipMenuService }], target: i0.ɵɵFactoryTarget.Component });
57
+ ChipMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ChipMenuComponent, selector: "kendo-pivot-chip-menu", inputs: { chip: "chip", tabIndex: "tabIndex" }, providers: [
58
+ ChipMenuService,
59
+ MenuTabbingService
60
+ ], viewQueries: [{ propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true, static: true }], ngImport: i0, template: `
61
+ <span #anchor
62
+ class="k-icon k-i-more-vertical"
63
+ (click)="toggle($event, anchor, template)"
64
+ [tabindex]="tabIndex"
65
+ [attr.title]="chipMenuTitle">
66
+ </span>
67
+ <ng-template #template>
68
+ <kendo-pivot-chipmenu-container
69
+ (keydown.escape)="close()"
70
+ (keydown.enter)="$event.stopImmediatePropagation()">
71
+ <kendo-pivot-chipmenu-sort
72
+ #sortItem
73
+ [chip]="chip"
74
+ [kendoPivotChipMenuItem]="sortItem"
75
+ [service]="service">
76
+ </kendo-pivot-chipmenu-sort>
77
+
78
+ <kendo-pivot-chipmenu-filter
79
+ #filterItem
80
+ [chip]="chip"
81
+ [kendoPivotChipMenuItem]="filterItem"
82
+ [service]="service">
83
+ </kendo-pivot-chipmenu-filter>
84
+ </kendo-pivot-chipmenu-container>
85
+ </ng-template>
86
+ `, isInline: true, components: [{ type: i4.ChipMenuContainerComponent, selector: "kendo-pivot-chipmenu-container" }, { type: i5.ChipMenuSortComponent, selector: "kendo-pivot-chipmenu-sort", inputs: ["chip"] }, { type: i6.ChipMenuFilterComponent, selector: "kendo-pivot-chipmenu-filter", inputs: ["chip", "expanded", "isLast"], outputs: ["expand", "collapse"] }], directives: [{ type: i7.ChipMenuItemDirective, selector: "[kendoPivotChipMenuItem]", inputs: ["kendoPivotChipMenuItem"] }] });
87
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChipMenuComponent, decorators: [{
88
+ type: Component,
89
+ args: [{
90
+ providers: [
91
+ ChipMenuService,
92
+ MenuTabbingService
93
+ ],
94
+ selector: 'kendo-pivot-chip-menu',
95
+ template: `
96
+ <span #anchor
97
+ class="k-icon k-i-more-vertical"
98
+ (click)="toggle($event, anchor, template)"
99
+ [tabindex]="tabIndex"
100
+ [attr.title]="chipMenuTitle">
101
+ </span>
102
+ <ng-template #template>
103
+ <kendo-pivot-chipmenu-container
104
+ (keydown.escape)="close()"
105
+ (keydown.enter)="$event.stopImmediatePropagation()">
106
+ <kendo-pivot-chipmenu-sort
107
+ #sortItem
108
+ [chip]="chip"
109
+ [kendoPivotChipMenuItem]="sortItem"
110
+ [service]="service">
111
+ </kendo-pivot-chipmenu-sort>
112
+
113
+ <kendo-pivot-chipmenu-filter
114
+ #filterItem
115
+ [chip]="chip"
116
+ [kendoPivotChipMenuItem]="filterItem"
117
+ [service]="service">
118
+ </kendo-pivot-chipmenu-filter>
119
+ </kendo-pivot-chipmenu-container>
120
+ </ng-template>
121
+ `
122
+ }]
123
+ }], ctorParameters: function () { return [{ type: i1.SinglePopupService }, { type: i2.PivotLocalizationService }, { type: i3.ChipMenuService }]; }, propDecorators: { chip: [{
124
+ type: Input
125
+ }], tabIndex: [{
126
+ type: Input
127
+ }], anchor: [{
128
+ type: ViewChild,
129
+ args: ['anchor', { static: true }]
130
+ }] } });