@progress/kendo-angular-pivotgrid 21.4.1-develop.1 → 22.0.0-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.
Files changed (62) hide show
  1. package/configurator/chip-menu/chip-menu-item-base.d.ts +1 -1
  2. package/data-binding/base-binding-directive.d.ts +1 -1
  3. package/fesm2022/progress-kendo-angular-pivotgrid.mjs +120 -120
  4. package/localization/messages.d.ts +1 -1
  5. package/package.json +18 -26
  6. package/schematics/ngAdd/index.js +2 -2
  7. package/esm2022/configurator/chip-kb-nav.directive.mjs +0 -69
  8. package/esm2022/configurator/chip-menu/chip-menu-container.component.mjs +0 -51
  9. package/esm2022/configurator/chip-menu/chip-menu-filter.component.mjs +0 -135
  10. package/esm2022/configurator/chip-menu/chip-menu-item-base.mjs +0 -40
  11. package/esm2022/configurator/chip-menu/chip-menu-item-content-template.directive.mjs +0 -29
  12. package/esm2022/configurator/chip-menu/chip-menu-item.component.mjs +0 -206
  13. package/esm2022/configurator/chip-menu/chip-menu-item.directive.mjs +0 -98
  14. package/esm2022/configurator/chip-menu/chip-menu-reorder.component.mjs +0 -198
  15. package/esm2022/configurator/chip-menu/chip-menu-sort.component.mjs +0 -104
  16. package/esm2022/configurator/chip-menu/chip-menu.component.mjs +0 -165
  17. package/esm2022/configurator/chip-menu/chip-menu.service.mjs +0 -40
  18. package/esm2022/configurator/chip-menu/filtering/filter-menu-container.component.mjs +0 -186
  19. package/esm2022/configurator/chip-menu/filtering/filter-menu-dropdownlist.directive.mjs +0 -44
  20. package/esm2022/configurator/chip-menu/filtering/menu-tabbing.service.mjs +0 -20
  21. package/esm2022/configurator/chip-menu/filtering/string-filter-menu.component.mjs +0 -148
  22. package/esm2022/configurator/chip-menu/single-popup.service.mjs +0 -136
  23. package/esm2022/configurator/configurator.component.mjs +0 -806
  24. package/esm2022/configurator/configurator.service.mjs +0 -53
  25. package/esm2022/configurator/draggable.directive.mjs +0 -131
  26. package/esm2022/configurator/drop-cue.service.mjs +0 -86
  27. package/esm2022/configurator/drop-target.directive.mjs +0 -190
  28. package/esm2022/data-binding/base-binding-directive.mjs +0 -164
  29. package/esm2022/data-binding/local-binding.directive.mjs +0 -107
  30. package/esm2022/data-binding/olap-binding.directive.mjs +0 -204
  31. package/esm2022/data-binding/pivotgrid-data.service.mjs +0 -76
  32. package/esm2022/directives.mjs +0 -97
  33. package/esm2022/index.mjs +0 -28
  34. package/esm2022/localization/custom-messages.component.mjs +0 -57
  35. package/esm2022/localization/localized-messages.directive.mjs +0 -39
  36. package/esm2022/localization/messages.mjs +0 -254
  37. package/esm2022/localization/pivot-localization.service.mjs +0 -30
  38. package/esm2022/models/configuration-change-event.mjs +0 -37
  39. package/esm2022/models/configurator-chipmenu-reorder-target.mjs +0 -5
  40. package/esm2022/models/configurator-orientation.mjs +0 -5
  41. package/esm2022/models/configurator-position.mjs +0 -5
  42. package/esm2022/models/configurator-settings.mjs +0 -21
  43. package/esm2022/models/data-row-item.mjs +0 -5
  44. package/esm2022/models/drop-section.mjs +0 -5
  45. package/esm2022/models/drop-target.mjs +0 -5
  46. package/esm2022/models/expanded-change-event.mjs +0 -29
  47. package/esm2022/models/expanded-state-action.mjs +0 -5
  48. package/esm2022/models/loader-settings.mjs +0 -5
  49. package/esm2022/models/virtualization-settings.mjs +0 -25
  50. package/esm2022/package-metadata.mjs +0 -16
  51. package/esm2022/pivotgrid.component.mjs +0 -729
  52. package/esm2022/pivotgrid.module.mjs +0 -87
  53. package/esm2022/progress-kendo-angular-pivotgrid.mjs +0 -8
  54. package/esm2022/rendering/pivotgrid-cell.directive.mjs +0 -247
  55. package/esm2022/rendering/pivotgrid-table.component.mjs +0 -386
  56. package/esm2022/rendering/templates/pivotgrid-cell-template.directive.mjs +0 -44
  57. package/esm2022/rendering/templates/pivotgrid-column-header-cell-template.directive.mjs +0 -44
  58. package/esm2022/rendering/templates/pivotgrid-row-header-cell-template.directive.mjs +0 -44
  59. package/esm2022/rendering/templates/pivotgrid-value-cell-template.directive.mjs +0 -43
  60. package/esm2022/util.mjs +0 -223
  61. package/esm2022/virtual/scroll.service.mjs +0 -18
  62. package/esm2022/virtual/scrollable-container.mjs +0 -128
@@ -1,53 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 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, Injectable, Output } from '@angular/core';
6
- import { configuratorReducer } from '@progress/kendo-pivotgrid-common';
7
- import { PivotGridDataService } from '../data-binding/pivotgrid-data.service';
8
- import { PivotGridState } from './../models/configurator-settings';
9
- import * as i0 from "@angular/core";
10
- import * as i1 from "../data-binding/pivotgrid-data.service";
11
- /**
12
- * @hidden
13
- */
14
- export class ConfiguratorService {
15
- dataService;
16
- configuratorInstance;
17
- state;
18
- draggedElement;
19
- dropTargetElement;
20
- cueContainer;
21
- orientation;
22
- configuratorStateChange = new EventEmitter();
23
- closeMenu = new EventEmitter();
24
- constructor(dataService) {
25
- this.dataService = dataService;
26
- }
27
- parseConfiguratorState(action) {
28
- const newState = configuratorReducer({
29
- filter: this.dataService.state.filter,
30
- sort: this.dataService.state.sort,
31
- rowAxes: this.dataService.state.rowAxes,
32
- columnAxes: this.dataService.state.columnAxes,
33
- measureAxes: this.dataService.state.measureAxes,
34
- dragItem: this.state.dragItem,
35
- dropDirection: this.state.dropDirection,
36
- dropTarget: this.state.dropTarget,
37
- dropZone: this.state.dropZone
38
- }, action);
39
- Object.keys(newState).forEach(key => newState[key] === undefined && delete newState[key]);
40
- this.state = { ...this.state, ...newState };
41
- this.dataService.state = new PivotGridState(this.state.columnAxes, this.state.rowAxes, this.state.measureAxes, this.state.sort, this.state.filter);
42
- this.configuratorStateChange.emit(this.state);
43
- }
44
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ConfiguratorService, deps: [{ token: i1.PivotGridDataService }], target: i0.ɵɵFactoryTarget.Injectable });
45
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ConfiguratorService });
46
- }
47
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ConfiguratorService, decorators: [{
48
- type: Injectable
49
- }], ctorParameters: () => [{ type: i1.PivotGridDataService }], propDecorators: { configuratorStateChange: [{
50
- type: Output
51
- }], closeMenu: [{
52
- type: Output
53
- }] } });
@@ -1,131 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 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, ElementRef, NgZone, Optional, HostBinding, Renderer2 } from '@angular/core';
6
- import { DraggableDirective, isDocumentAvailable } from '@progress/kendo-angular-common';
7
- import { PIVOT_CONFIGURATOR_ACTION } from '@progress/kendo-pivotgrid-common';
8
- import { ConfiguratorService } from './configurator.service';
9
- import { DropCueService } from './drop-cue.service';
10
- import { Subscription } from 'rxjs';
11
- import { tap } from 'rxjs/operators';
12
- import * as i0 from "@angular/core";
13
- import * as i1 from "@progress/kendo-angular-common";
14
- import * as i2 from "./configurator.service";
15
- import * as i3 from "./drop-cue.service";
16
- /**
17
- * @hidden
18
- */
19
- export class DraggableChipDirective {
20
- draggable;
21
- element;
22
- zone;
23
- service;
24
- cue;
25
- renderer;
26
- get pointerEvents() {
27
- return this.drag ? 'none' : undefined;
28
- }
29
- touchActions = 'none';
30
- item;
31
- initialX = {};
32
- initialY = {};
33
- drag;
34
- invalidTarget = false;
35
- subs = new Subscription();
36
- constructor(draggable, element, zone, service, cue, renderer) {
37
- this.draggable = draggable;
38
- this.element = element;
39
- this.zone = zone;
40
- this.service = service;
41
- this.cue = cue;
42
- this.renderer = renderer;
43
- }
44
- ngOnInit() {
45
- this.subs.add(this.draggable.kendoPress
46
- .pipe(tap((e) => {
47
- this.service.closeMenu.emit();
48
- if (e.originalEvent.target.closest('.k-icon-wrapper-host')) {
49
- this.invalidTarget = true;
50
- }
51
- })).subscribe((event) => {
52
- this.zone.runOutsideAngular(() => {
53
- if (isDocumentAvailable() && !this.invalidTarget) {
54
- this.initialX.current = event.clientX;
55
- this.initialY.current = event.clientY;
56
- const element = this.element.nativeElement;
57
- this.renderer.setStyle(element, 'z-index', 1);
58
- this.service.parseConfiguratorState({ type: PIVOT_CONFIGURATOR_ACTION.setDragItem, payload: this.item });
59
- this.service.draggedElement = {
60
- element,
61
- fromSection: element.closest('.k-chip-list').getAttribute('axes').split('Axes')[0]
62
- };
63
- }
64
- });
65
- }));
66
- this.subs.add(this.draggable.kendoDrag
67
- .subscribe((event) => {
68
- this.zone.runOutsideAngular(() => {
69
- if (isDocumentAvailable() && !this.invalidTarget) {
70
- const isDragging = Math.abs(this.initialX.current - event.clientX) > 5 ||
71
- Math.abs(this.initialY.current - event.clientY) > 5;
72
- if (!isDragging) {
73
- return;
74
- }
75
- this.drag = true;
76
- if (!document.elementFromPoint(event.clientX, event.clientY)?.closest('.k-pivotgrid-configurator')) {
77
- return;
78
- }
79
- this.renderer.setStyle(this.element.nativeElement, 'transform', `translate(${event.clientX - this.initialX.current}px, ${event.clientY - this.initialY.current}px)`);
80
- }
81
- });
82
- }));
83
- this.subs.add(this.draggable.kendoRelease
84
- .subscribe(() => {
85
- this.zone.runOutsideAngular(() => {
86
- this.drag = false;
87
- this.invalidTarget = false;
88
- if (this.service.state.dragItem) {
89
- const element = this.element.nativeElement;
90
- if (isDocumentAvailable()) {
91
- this.renderer.removeStyle(element, 'transform');
92
- this.cue.remove(this.service.cueContainer);
93
- }
94
- this.service.parseConfiguratorState({ type: PIVOT_CONFIGURATOR_ACTION.drop, payload: this.item });
95
- this.service.state.dragItem = null;
96
- this.service.state.dropDirection = null;
97
- this.service.state.dropTarget = null;
98
- this.service.state.dropZone = null;
99
- this.renderer.removeStyle(element, 'z-index');
100
- this.service.draggedElement = null;
101
- if (this.service.dropTargetElement) {
102
- this.renderer.removeStyle(this.service.dropTargetElement, 'cursor');
103
- this.service.dropTargetElement = null;
104
- }
105
- }
106
- });
107
- }));
108
- }
109
- ngOnDestroy() {
110
- this.subs.unsubscribe();
111
- }
112
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DraggableChipDirective, deps: [{ token: i1.DraggableDirective, optional: true }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i2.ConfiguratorService }, { token: i3.DropCueService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
113
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: DraggableChipDirective, isStandalone: true, selector: "[kendoChipDraggable]", inputs: { item: "item" }, host: { properties: { "style.pointerEvents": "this.pointerEvents", "style.touch-action": "this.touchActions" } }, ngImport: i0 });
114
- }
115
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DraggableChipDirective, decorators: [{
116
- type: Directive,
117
- args: [{
118
- selector: '[kendoChipDraggable]',
119
- standalone: true
120
- }]
121
- }], ctorParameters: () => [{ type: i1.DraggableDirective, decorators: [{
122
- type: Optional
123
- }] }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i2.ConfiguratorService }, { type: i3.DropCueService }, { type: i0.Renderer2 }], propDecorators: { pointerEvents: [{
124
- type: HostBinding,
125
- args: ['style.pointerEvents']
126
- }], touchActions: [{
127
- type: HostBinding,
128
- args: ['style.touch-action']
129
- }], item: [{
130
- type: Input
131
- }] } });
@@ -1,86 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 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 } from '@angular/core';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * @hidden
9
- */
10
- export const append = (element, container) => {
11
- let appended = false;
12
- return () => {
13
- if (!appended) {
14
- container.appendChild(element);
15
- appended = true;
16
- }
17
- return element;
18
- };
19
- };
20
- /**
21
- * @hidden
22
- */
23
- export class DropCueService {
24
- dom;
25
- create() {
26
- this.dom = document.createElement('span');
27
- const wrapper = document.createElement('div');
28
- wrapper.classList.add('k-drop-hint', 'k-drop-hint-v');
29
- const hintStart = document.createElement('div');
30
- hintStart.classList.add('k-drop-hint-start');
31
- const hintLine = document.createElement('div');
32
- hintLine.classList.add('k-drop-hint-line');
33
- const hintEnd = document.createElement('div');
34
- hintEnd.classList.add('k-drop-hint-end');
35
- wrapper.append(hintStart, hintLine, hintEnd);
36
- this.dom.append(wrapper);
37
- this.hide();
38
- }
39
- attach(container) {
40
- return append(this.dom, container)();
41
- }
42
- remove(container) {
43
- if (this.dom && this.dom.parentElement && container.contains(this.dom)) {
44
- container.removeChild(this.dom);
45
- this.dom = null;
46
- }
47
- }
48
- hide() {
49
- this.dom.style.display = 'none';
50
- }
51
- show(direction, container, target) {
52
- if (!this.dom) {
53
- this.create();
54
- }
55
- if (!target || !container) {
56
- return;
57
- }
58
- if (direction === 'before') {
59
- if (container.contains(target)) {
60
- container.insertBefore(this.dom, target);
61
- }
62
- else {
63
- container.appendChild(this.dom);
64
- }
65
- }
66
- else {
67
- if (target.classList.contains('k-chip') && target.matches(':last-child')) {
68
- if (container.contains(target)) {
69
- container.insertBefore(this.dom, target);
70
- }
71
- else {
72
- container.appendChild(this.dom);
73
- }
74
- return;
75
- }
76
- // eslint-disable-next-line no-unused-expressions
77
- target.classList.contains('k-chip') ? target.after(this.dom) : container.appendChild(this.dom);
78
- }
79
- this.dom.style.display = '';
80
- }
81
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropCueService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
82
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropCueService });
83
- }
84
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropCueService, decorators: [{
85
- type: Injectable
86
- }] });
@@ -1,190 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 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, Input, NgZone, Renderer2 } from "@angular/core";
6
- import { PIVOT_CONFIGURATOR_ACTION } from "@progress/kendo-pivotgrid-common";
7
- import { Subscription } from "rxjs";
8
- import { ConfiguratorService } from "./configurator.service";
9
- import { DropCueService } from "./drop-cue.service";
10
- import { isPresent } from "../util";
11
- import * as i0 from "@angular/core";
12
- import * as i1 from "./configurator.service";
13
- import * as i2 from "./drop-cue.service";
14
- /**
15
- * @hidden
16
- */
17
- export class DropTargetDirective {
18
- element;
19
- configuratorService;
20
- cue;
21
- renderer;
22
- zone;
23
- item;
24
- axes;
25
- elementType;
26
- elementSectionType;
27
- targetElement;
28
- nextChipOffset;
29
- subs = new Subscription();
30
- constructor(element, configuratorService, cue, renderer, zone) {
31
- this.element = element;
32
- this.configuratorService = configuratorService;
33
- this.cue = cue;
34
- this.renderer = renderer;
35
- this.zone = zone;
36
- }
37
- ngOnInit() {
38
- const element = this.element.nativeElement;
39
- this.elementType = this.getElementType(element);
40
- this.elementSectionType = element.getAttribute('axes')?.split('Axes')[0];
41
- this.subs.add(this.renderer.listen(element, 'mouseenter', this.handleMouseEnter.bind(this)));
42
- this.subs.add(this.renderer.listen(element, 'mousemove', this.handleMouseMove.bind(this)));
43
- this.subs.add(this.renderer.listen(element, 'mouseleave', this.handleMouseLeave.bind(this)));
44
- }
45
- ngOnDestroy() {
46
- this.subs.unsubscribe();
47
- }
48
- handleMouseEnter(event) {
49
- this.zone.runOutsideAngular(() => {
50
- if (this.configuratorService.state.dragItem) {
51
- this.configuratorService.dropTargetElement = this.element.nativeElement;
52
- if (this.configuratorService.draggedElement && !this.isDropAllowed(this.configuratorService.draggedElement.fromSection)) {
53
- return;
54
- }
55
- this.configuratorService.parseConfiguratorState({ type: PIVOT_CONFIGURATOR_ACTION.setDropTarget, payload: this.item });
56
- this.targetElement = this.elementType === 'header' ? event.target.nextElementSibling : event.target;
57
- // eslint-disable-next-line no-unused-expressions
58
- this.cue.dom && this.cue.remove(this.getCueContainer());
59
- this.cue.create();
60
- this.cue.attach(this.getCueContainer());
61
- this.configuratorService.parseConfiguratorState({ type: PIVOT_CONFIGURATOR_ACTION.setDropZone, payload: this.axes });
62
- }
63
- });
64
- }
65
- handleMouseMove(event) {
66
- this.zone.runOutsideAngular(() => {
67
- event.stopImmediatePropagation();
68
- if (this.configuratorService.state.dragItem) {
69
- if (this.configuratorService.draggedElement && !this.isDropAllowed(this.configuratorService.draggedElement.fromSection)) {
70
- this.renderer.setStyle(this.element.nativeElement, 'cursor', 'not-allowed');
71
- return;
72
- }
73
- this.renderer.setStyle(this.element.nativeElement, 'cursor', 'pointer');
74
- const singleOrNoChip = this.targetElement?.querySelectorAll('.k-chip').length < 2;
75
- const isInOwnContainer = this.elementSectionType === this.configuratorService.draggedElement.fromSection;
76
- if (!this.targetElement) {
77
- return;
78
- }
79
- switch (this.elementType) {
80
- case 'chip': {
81
- const rect = this.element.nativeElement.getBoundingClientRect();
82
- const x = event.clientX - rect.left;
83
- const direction = x < rect.width / 2 ? 'before' : 'after';
84
- this.cue.show(direction, this.configuratorService.cueContainer, this.targetElement);
85
- if (direction !== this.configuratorService.state.dropDirection) {
86
- this.configuratorService.parseConfiguratorState({ type: PIVOT_CONFIGURATOR_ACTION.setDropDirection, payload: direction });
87
- }
88
- break;
89
- }
90
- case 'container':
91
- case 'header':
92
- if (singleOrNoChip && isInOwnContainer) {
93
- return;
94
- }
95
- if (isInOwnContainer) {
96
- const draggedElement = this.configuratorService.draggedElement.element;
97
- const nextChip = this.getNextChip(draggedElement);
98
- if (!nextChip) {
99
- this.cue.show('before', this.configuratorService.cueContainer, draggedElement);
100
- if (this.configuratorService.state.dropDirection !== 'before') {
101
- this.configuratorService.parseConfiguratorState({ type: PIVOT_CONFIGURATOR_ACTION.setDropDirection, payload: 'before' });
102
- }
103
- return;
104
- }
105
- const isVertical = this.configuratorService.orientation === 'vertical';
106
- if (!isPresent(this.nextChipOffset)) {
107
- this.nextChipOffset = isVertical ? nextChip.getBoundingClientRect().left : nextChip.getBoundingClientRect().top;
108
- }
109
- const isBefore = isVertical ? event.clientX < this.nextChipOffset : event.clientY < this.nextChipOffset;
110
- if (isBefore) {
111
- this.cue.show('after', this.configuratorService.cueContainer, draggedElement);
112
- return;
113
- }
114
- }
115
- if (this.configuratorService.state.dropDirection !== 'after') {
116
- this.configuratorService.parseConfiguratorState({ type: PIVOT_CONFIGURATOR_ACTION.setDropDirection, payload: 'after' });
117
- }
118
- this.cue.show('after', this.configuratorService.cueContainer, this.targetElement);
119
- break;
120
- default:
121
- }
122
- }
123
- });
124
- }
125
- handleMouseLeave(event) {
126
- this.renderer.removeStyle(this.element.nativeElement, 'cursor');
127
- if (!this.configuratorService.draggedElement) {
128
- return;
129
- }
130
- this.zone.runOutsideAngular(() => {
131
- event.stopImmediatePropagation();
132
- this.configuratorService.dropTargetElement = null;
133
- this.cue.remove(this.getCueContainer());
134
- if (this.elementType === 'chip') {
135
- return;
136
- }
137
- if (this.configuratorService.state.dragItem) {
138
- this.configuratorService.parseConfiguratorState({ type: PIVOT_CONFIGURATOR_ACTION.setDropZone, payload: null });
139
- }
140
- });
141
- }
142
- isDropAllowed(fromSection) {
143
- const element = this.element.nativeElement;
144
- const fromRowsOrColsToMeasures = (fromSection === 'row' || fromSection === 'column') && element.closest('[axes=measureAxes]');
145
- const fromMeasuresToRowsOrCols = fromSection === 'measure' && (element.closest('[axes=rowAxes]') || element.closest('[axes=columnAxes]'));
146
- return !(fromRowsOrColsToMeasures || fromMeasuresToRowsOrCols);
147
- }
148
- getElementType(element) {
149
- return {
150
- 'KENDO-CHIP': 'chip',
151
- 'KENDO-CHIPLIST': 'container',
152
- 'DIV': 'header'
153
- }[element.tagName];
154
- }
155
- getCueContainer() {
156
- const element = this.element.nativeElement;
157
- const cueContainer = {
158
- chip: element.parentElement,
159
- container: element,
160
- header: element.classList.contains('k-settings-description') ? element : element.nextElementSibling
161
- }[this.elementType];
162
- this.configuratorService.cueContainer = cueContainer;
163
- return cueContainer;
164
- }
165
- getNextChip(draggedElement) {
166
- let nextChip = draggedElement.nextElementSibling;
167
- if (nextChip && nextChip.matches('.k-chip')) {
168
- return nextChip;
169
- }
170
- while (nextChip) {
171
- nextChip = nextChip.nextElementSibling;
172
- if (nextChip === null || nextChip.matches('.k-chip')) {
173
- return nextChip;
174
- }
175
- }
176
- }
177
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropTargetDirective, deps: [{ token: i0.ElementRef }, { token: i1.ConfiguratorService }, { token: i2.DropCueService }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
178
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: DropTargetDirective, isStandalone: true, selector: "[kendoDropTarget]", inputs: { item: "item", axes: "axes" }, ngImport: i0 });
179
- }
180
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropTargetDirective, decorators: [{
181
- type: Directive,
182
- args: [{
183
- selector: '[kendoDropTarget]',
184
- standalone: true
185
- }]
186
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.ConfiguratorService }, { type: i2.DropCueService }, { type: i0.Renderer2 }, { type: i0.NgZone }], propDecorators: { item: [{
187
- type: Input
188
- }], axes: [{
189
- type: Input
190
- }] } });
@@ -1,164 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 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, Input, NgZone, Output } from '@angular/core';
6
- import { PivotGridDataService } from './pivotgrid-data.service';
7
- import { headersReducer, HEADERS_ACTION, toTree } from '@progress/kendo-pivotgrid-common';
8
- import { Subscription } from 'rxjs';
9
- import { PivotGridState } from '../models/configurator-settings';
10
- import { ExpandChangeEvent } from '../models/expanded-change-event';
11
- import { hasObservers } from '@progress/kendo-angular-common';
12
- import { ConfigurationChangeEvent } from '../models/configuration-change-event';
13
- import * as i0 from "@angular/core";
14
- import * as i1 from "./pivotgrid-data.service";
15
- /**
16
- * @hidden
17
- * A directive which binds the PivotGrid to an array of objects.
18
- */
19
- export class PivotBaseBindingDirective {
20
- dataService;
21
- zone;
22
- /**
23
- * Defines the column axes configuration of the PivotGrid.
24
- */
25
- columnAxes = [];
26
- /**
27
- * Defines the row axes configuration of the PivotGrid.
28
- */
29
- rowAxes = [];
30
- /**
31
- * Defines the measure axes configuration of the PivotGrid.
32
- */
33
- measureAxes = [];
34
- /**
35
- * Sets the initial sorted state of the PivotGrid.
36
- */
37
- sort = [];
38
- /**
39
- * Sets the initial filtered state of the PivotGrid.
40
- */
41
- filter;
42
- /**
43
- * Fires each time a row or column header gets expanded or collapsed by the user.
44
- *
45
- * The event is preventable. If you prevent the event, the PivotGrid will not rerender with the new state that results from the user interaction.
46
- */
47
- expandChange = new EventEmitter();
48
- /**
49
- * Fires when the Configurator **Apply** button is pressed.
50
- *
51
- * The event is preventable. If you prevent the event, the PivotGrid will not rerender with the new state that results from the configuration changes.
52
- */
53
- configurationChange = new EventEmitter();
54
- /**
55
- * Fires each time new data is loaded and transformed to show aggregated values.
56
- *
57
- * The event fires upon initialization and on user interaction that changes the state of the PivotGrid.
58
- */
59
- dataLoaded = new EventEmitter();
60
- dataState;
61
- configuratorFields;
62
- subs = new Subscription();
63
- constructor(dataService, zone) {
64
- this.dataService = dataService;
65
- this.zone = zone;
66
- }
67
- ngOnInit() {
68
- this.dataService.state = new PivotGridState(this.columnAxes, this.rowAxes, this.measureAxes, this.sort, this.filter);
69
- this.loadData(this.dataService.state);
70
- this.loadFields();
71
- this.subs.add(this.dataService.expandedStateChange.subscribe((state) => {
72
- this.zone.run(() => {
73
- const isCol = state.tableType === 'columnHeader';
74
- const axes = isCol ? 'columnAxes' : 'rowAxes';
75
- // Converts current rows state to a tree-like structure (using the PivotGrid Common pkg)
76
- const tree = toTree((isCol ? this.dataService.columns : this.dataService.rows || []).slice());
77
- this.updateHeaders(axes, tree, state.cell.path);
78
- });
79
- }));
80
- this.subs.add(this.dataService.configuratorFieldChange.subscribe((state) => {
81
- this.zone.run(() => {
82
- if (hasObservers(this.configurationChange)) {
83
- const event = new ConfigurationChangeEvent(state);
84
- this.configurationChange.emit(event);
85
- if (event.isDefaultPrevented()) {
86
- return;
87
- }
88
- }
89
- this.dataService.configuredFields.next(this.dataService.state);
90
- this.loadData(state);
91
- this.dataService.state = state;
92
- this.rowAxes = this.dataService.state.rowAxes;
93
- this.columnAxes = this.dataService.state.columnAxes;
94
- });
95
- }));
96
- this.subs.add(this.dataService.valuesRows.subscribe((data) => {
97
- this.zone.run(() => {
98
- this.dataService.aggregateData = data;
99
- this.dataLoaded.emit(data);
100
- });
101
- }));
102
- this.dataService.directive = this;
103
- }
104
- ngOnDestroy() {
105
- this.subs.unsubscribe();
106
- }
107
- updateDataServiceFields() {
108
- this.dataService.normalizedData = this.dataState.data;
109
- this.dataService.rows = this.dataState.rows;
110
- this.dataService.columns = this.dataState.columns;
111
- this.dataService.updateRowsAndCols();
112
- }
113
- updateConfiguratorFields() {
114
- this.dataService.fields.next(this.configuratorFields);
115
- this.dataService.configuredFields.next(this.dataService.state);
116
- }
117
- updateHeaders(axes, tree, path) {
118
- // Action to determine expand/collapse state
119
- const action = {
120
- type: HEADERS_ACTION.toggle,
121
- payload: path
122
- };
123
- // The `headersReducer` method is responsible for udpating
124
- // the expanded state based on the toggle action (expand/collapse)
125
- // Update axes and reload data
126
- const newHeaders = headersReducer(this[axes].slice(), { ...action, tree });
127
- const newState = { ...this.dataService.state, ...{ [axes]: newHeaders } };
128
- this.dataService.state = newState;
129
- if (hasObservers(this.expandChange)) {
130
- const event = new ExpandChangeEvent(newState);
131
- this.expandChange.emit(event);
132
- if (event.isDefaultPrevented()) {
133
- return;
134
- }
135
- }
136
- this.dataService.configuredFields.next(this.dataService.state);
137
- this[axes] = newHeaders;
138
- this.loadData(this.dataService.state);
139
- }
140
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PivotBaseBindingDirective, deps: [{ token: i1.PivotGridDataService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
141
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: PivotBaseBindingDirective, selector: "kendo-base-binding-directive", inputs: { columnAxes: "columnAxes", rowAxes: "rowAxes", measureAxes: "measureAxes", sort: "sort", filter: "filter" }, outputs: { expandChange: "expandChange", configurationChange: "configurationChange", dataLoaded: "dataLoaded" }, ngImport: i0 });
142
- }
143
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PivotBaseBindingDirective, decorators: [{
144
- type: Directive,
145
- args: [{
146
- selector: 'kendo-base-binding-directive'
147
- }]
148
- }], ctorParameters: () => [{ type: i1.PivotGridDataService }, { type: i0.NgZone }], propDecorators: { columnAxes: [{
149
- type: Input
150
- }], rowAxes: [{
151
- type: Input
152
- }], measureAxes: [{
153
- type: Input
154
- }], sort: [{
155
- type: Input
156
- }], filter: [{
157
- type: Input
158
- }], expandChange: [{
159
- type: Output
160
- }], configurationChange: [{
161
- type: Output
162
- }], dataLoaded: [{
163
- type: Output
164
- }] } });