@progress/kendo-angular-pivotgrid 0.2.0 → 0.2.1-dev.202209131551

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.
@@ -38,7 +38,7 @@ const packageMetadata = {
38
38
  name: '@progress/kendo-angular-pivotgrid',
39
39
  productName: 'Kendo UI for Angular',
40
40
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
41
- publishDate: 1662993956,
41
+ publishDate: 1663084250,
42
42
  version: '',
43
43
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
44
44
  };
@@ -443,7 +443,7 @@ PivotGridTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
443
443
  </tr>
444
444
  </tbody>
445
445
  </table>
446
- `, isInline: true, styles: ["\n /** TODO: Remove if added to themes */\n .k-pivotgrid-cell:focus {\n outline: none;\n }\n "], components: [{ type: PivotGridCellDirective, selector: "[kendoPivotGridCell]", inputs: ["kendoPivotGridCell", "tableType", "rowIndex", "colIndex"] }], directives: [{ type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
446
+ `, isInline: true, components: [{ type: PivotGridCellDirective, selector: "[kendoPivotGridCell]", inputs: ["kendoPivotGridCell", "tableType", "rowIndex", "colIndex"] }], directives: [{ type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
447
447
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridTableComponent, decorators: [{
448
448
  type: Component,
449
449
  args: [{
@@ -483,13 +483,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
483
483
  </tr>
484
484
  </tbody>
485
485
  </table>
486
- `,
487
- styles: [`
488
- /** TODO: Remove if added to themes */
489
- .k-pivotgrid-cell:focus {
490
- outline: none;
491
- }
492
- `]
486
+ `
493
487
  }]
494
488
  }], ctorParameters: function () { return [{ type: PivotGridDataService }]; }, propDecorators: { tableType: [{
495
489
  type: Input
@@ -497,20 +491,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
497
491
  type: Input
498
492
  }] } });
499
493
 
494
+ /**
495
+ * @hidden
496
+ */
497
+ class PivotGridState {
498
+ constructor(columnAxes, rowAxes, measureAxes, sort, filter) {
499
+ this.columnAxes = columnAxes;
500
+ this.rowAxes = rowAxes;
501
+ this.measureAxes = measureAxes;
502
+ this.sort = sort;
503
+ this.filter = filter;
504
+ }
505
+ }
506
+
500
507
  /**
501
508
  * @hidden
502
509
  */
503
510
  class ConfiguratorService {
504
- constructor() {
511
+ constructor(dataService) {
512
+ this.dataService = dataService;
505
513
  this.configuratorStateChange = new EventEmitter();
506
514
  }
507
515
  parseConfiguratorState(action) {
508
516
  const newState = configuratorReducer({
509
- filter: this.state.filter,
510
- sort: this.state.sort,
511
- rowAxes: this.state.rowAxes,
512
- columnAxes: this.state.columnAxes,
513
- measureAxes: this.state.measureAxes,
517
+ filter: this.dataService.state.filter,
518
+ sort: this.dataService.state.sort,
519
+ rowAxes: this.dataService.state.rowAxes,
520
+ columnAxes: this.dataService.state.columnAxes,
521
+ measureAxes: this.dataService.state.measureAxes,
514
522
  dragItem: this.state.dragItem,
515
523
  dropDirection: this.state.dropDirection,
516
524
  dropTarget: this.state.dropTarget,
@@ -518,14 +526,15 @@ class ConfiguratorService {
518
526
  }, action);
519
527
  Object.keys(newState).forEach(key => newState[key] === undefined && delete newState[key]);
520
528
  this.state = Object.assign(Object.assign({}, this.state), newState);
529
+ this.dataService.state = new PivotGridState(this.state.columnAxes, this.state.rowAxes, this.state.measureAxes, this.state.sort, this.state.filter);
521
530
  this.configuratorStateChange.emit(this.state);
522
531
  }
523
532
  }
524
- ConfiguratorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfiguratorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
533
+ ConfiguratorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfiguratorService, deps: [{ token: PivotGridDataService }], target: i0.ɵɵFactoryTarget.Injectable });
525
534
  ConfiguratorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfiguratorService });
526
535
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfiguratorService, decorators: [{
527
536
  type: Injectable
528
- }], propDecorators: { configuratorStateChange: [{
537
+ }], ctorParameters: function () { return [{ type: PivotGridDataService }]; }, propDecorators: { configuratorStateChange: [{
529
538
  type: Output
530
539
  }] } });
531
540
 
@@ -1827,7 +1836,7 @@ class PivotGridConfiguratorComponent {
1827
1836
  this.configuratorService = configuratorService;
1828
1837
  this.cdr = cdr;
1829
1838
  this.hostClass = true;
1830
- this.horizontal = false;
1839
+ this.orientation = 'vertical';
1831
1840
  this.sort = new Array();
1832
1841
  this.checked = [];
1833
1842
  this.subs = new Subscription();
@@ -1846,6 +1855,9 @@ class PivotGridConfiguratorComponent {
1846
1855
  return of(node.children);
1847
1856
  };
1848
1857
  }
1858
+ get isHorizontal() {
1859
+ return this.orientation === 'horizontal';
1860
+ }
1849
1861
  ngOnInit() {
1850
1862
  this.subs.add(this.dataService.fields
1851
1863
  .subscribe(res => {
@@ -1853,13 +1865,21 @@ class PivotGridConfiguratorComponent {
1853
1865
  }));
1854
1866
  this.subs.add(this.dataService.configuredFields
1855
1867
  .subscribe(res => {
1856
- this.originalState = clone(res);
1857
- this.setState(clone(res));
1868
+ const normalizedState = clone(Object.assign(Object.assign({}, this.dataService.state), { dragItem: res.dragItem, dropTarget: res.dropTarget, dropZone: res.dropZone, dropDirection: res.dropDirection }));
1869
+ this.originalState = normalizedState;
1870
+ this.setState(normalizedState);
1858
1871
  this.setChecked();
1859
1872
  }));
1860
1873
  this.subs.add(this.configuratorService.configuratorStateChange
1861
1874
  .subscribe(res => {
1862
1875
  this.state = res;
1876
+ this.dataService.state = this.dataService.state = {
1877
+ columnAxes: res.columnAxes,
1878
+ rowAxes: res.rowAxes,
1879
+ measureAxes: res.measureAxes,
1880
+ sort: res.sort,
1881
+ filter: res.filter
1882
+ };
1863
1883
  this.cdr.detectChanges();
1864
1884
  }));
1865
1885
  }
@@ -1870,8 +1890,14 @@ class PivotGridConfiguratorComponent {
1870
1890
  return name.toString();
1871
1891
  }
1872
1892
  setState(state) {
1873
- this.state = state;
1874
- this.configuratorService.state = state;
1893
+ this.dataService.state = {
1894
+ columnAxes: state.columnAxes,
1895
+ rowAxes: state.rowAxes,
1896
+ measureAxes: state.measureAxes,
1897
+ sort: state.sort,
1898
+ filter: state.filter
1899
+ };
1900
+ this.state = this.configuratorService.state = state;
1875
1901
  }
1876
1902
  /**
1877
1903
  * Returns the localized message for a given token
@@ -1883,23 +1909,34 @@ class PivotGridConfiguratorComponent {
1883
1909
  * Retrieves the 'Columns' section item names
1884
1910
  */
1885
1911
  get columnHierarchies() {
1886
- return this.extractDefaultFields(this.state.columnAxes);
1912
+ return this.extractDefaultFields(this.dataService.state.columnAxes);
1887
1913
  }
1888
1914
  ;
1889
1915
  /**
1890
1916
  * Retrieves the 'Rows' section item names
1891
1917
  */
1892
1918
  get rowHierarchies() {
1893
- return this.extractDefaultFields(this.state.rowAxes);
1919
+ return this.extractDefaultFields(this.dataService.state.rowAxes);
1894
1920
  }
1895
1921
  ;
1896
1922
  /**
1897
1923
  * Retrieves the 'Value' section item names
1898
1924
  */
1899
1925
  get measureHierarchies() {
1900
- return this.extractDefaultFields(this.state.measureAxes);
1926
+ return this.extractDefaultFields(this.dataService.state.measureAxes);
1901
1927
  }
1902
1928
  ;
1929
+ /**
1930
+ * Updates the respective axis configuration of the current state
1931
+ * when a chip is deleted from the UI
1932
+ */
1933
+ onChipRemove(item, section) {
1934
+ const filteredItems = this.dataService.state[`${section}Axes`].filter(descriptor => descriptor !== item);
1935
+ this.dataService.state[`${section}Axes`] = filteredItems;
1936
+ const newState = Object.assign(Object.assign({}, this.state), this.dataService.state);
1937
+ this.checked = this.checked.filter(checkedItem => checkedItem.uniqueName !== item.name[0]);
1938
+ this.setState(newState);
1939
+ }
1903
1940
  /**
1904
1941
  * Constructs an array with all selected fields.
1905
1942
  * @param fields - used for when child nodes are loaded on demand.
@@ -1960,7 +1997,7 @@ class PivotGridConfiguratorComponent {
1960
1997
  this.configuratorService.parseConfiguratorState(action);
1961
1998
  }
1962
1999
  handleSubmit() {
1963
- this.dataService.configuratorFieldChange.emit(this.state);
2000
+ this.dataService.configuratorFieldChange.emit(this.dataService.state);
1964
2001
  }
1965
2002
  /**
1966
2003
  * Reset the configurator to the last saved state
@@ -1992,7 +2029,7 @@ class PivotGridConfiguratorComponent {
1992
2029
  ;
1993
2030
  }
1994
2031
  PivotGridConfiguratorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridConfiguratorComponent, deps: [{ token: PivotGridDataService }, { token: i1.LocalizationService }, { token: ConfiguratorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1995
- PivotGridConfiguratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PivotGridConfiguratorComponent, selector: "kendo-pivotgrid-configurator", inputs: { horizontal: "horizontal", sort: "sort", filter: "filter" }, host: { properties: { "class.k-pivotgrid-configurator": "this.hostClass" } }, providers: [
2032
+ PivotGridConfiguratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PivotGridConfiguratorComponent, selector: "kendo-pivotgrid-configurator", inputs: { orientation: "orientation", sort: "sort", filter: "filter" }, host: { properties: { "class.k-pivotgrid-configurator": "this.hostClass" } }, providers: [
1996
2033
  ConfiguratorService,
1997
2034
  DropCueService,
1998
2035
  SinglePopupService
@@ -2000,8 +2037,8 @@ PivotGridConfiguratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
2000
2037
  <div
2001
2038
  class="k-pivotgrid-configurator-panel k-pivotgrid-configurator-push"
2002
2039
  [ngClass]="{
2003
- 'k-pivotgrid-configurator-horizontal': horizontal,
2004
- 'k-pivotgrid-configurator-vertical': !horizontal
2040
+ 'k-pivotgrid-configurator-horizontal': isHorizontal,
2041
+ 'k-pivotgrid-configurator-vertical': !isHorizontal
2005
2042
  }"
2006
2043
  >
2007
2044
  <div class="k-pivotgrid-configurator-header">
@@ -2009,7 +2046,7 @@ PivotGridConfiguratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
2009
2046
  </div>
2010
2047
 
2011
2048
  <div class="k-pivotgrid-configurator-content">
2012
- <div class="k-form" [class.k-form-horizontal]="horizontal">
2049
+ <div class="k-form" [class.k-form-horizontal]="isHorizontal">
2013
2050
  <div class="k-form-field-wrapper">
2014
2051
  <div class="k-form-field">
2015
2052
  <span class="k-label">{{messageFor('configuratorFieldsText')}}</span>
@@ -2040,7 +2077,7 @@ PivotGridConfiguratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
2040
2077
  </div>
2041
2078
  </div>
2042
2079
 
2043
- <div *ngIf="horizontal; else verticalTemplate" class="k-form-field-wrapper">
2080
+ <div *ngIf="isHorizontal; else verticalTemplate" class="k-form-field-wrapper">
2044
2081
  <ng-container *ngTemplateOutlet="verticalTemplate"></ng-container>
2045
2082
  </div>
2046
2083
 
@@ -2054,21 +2091,22 @@ PivotGridConfiguratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
2054
2091
  kendoDropTarget
2055
2092
  axes="columnAxes"
2056
2093
  >
2057
- <kendo-chip *ngFor="let item of state.columnAxes"
2058
- kendoChipDraggable
2059
- kendoDraggable
2060
- kendoDropTarget
2061
- [item]="item"
2062
- axes="columnAxes"
2063
- rounded="full"
2064
- [removable]="true"
2065
- >
2066
- {{ getName(item.name) }}
2067
-
2068
- <kendo-pivot-chip-menu
2069
- [chip]="item">
2070
- </kendo-pivot-chip-menu>
2071
- </kendo-chip>
2094
+ <ng-container *ngFor="let item of state.columnAxes">
2095
+ <kendo-chip *ngIf="item.name.length === 1"
2096
+ kendoChipDraggable
2097
+ kendoDraggable
2098
+ kendoDropTarget
2099
+ [item]="item"
2100
+ axes="columnAxes"
2101
+ rounded="full"
2102
+ [removable]="true"
2103
+ (remove)="onChipRemove(item, 'column')"
2104
+ >{{ getName(item.name) }}
2105
+ <kendo-pivot-chip-menu
2106
+ [chip]="item">
2107
+ </kendo-pivot-chip-menu>
2108
+ </kendo-chip>
2109
+ </ng-container>
2072
2110
  </kendo-chiplist>
2073
2111
 
2074
2112
  <ng-template #noColumnAxes>
@@ -2084,21 +2122,24 @@ PivotGridConfiguratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
2084
2122
  kendoDropTarget
2085
2123
  axes="rowAxes"
2086
2124
  >
2087
- <kendo-chip *ngFor="let item of state.rowAxes"
2088
- kendoChipDraggable
2089
- kendoDraggable
2090
- kendoDropTarget
2091
- [item]="item"
2092
- axes="rowAxes"
2093
- rounded="full"
2094
- [removable]="true"
2095
- >
2096
- {{ getName(item.name) }}
2097
-
2098
- <kendo-pivot-chip-menu
2099
- [chip]="item">
2100
- </kendo-pivot-chip-menu>
2101
- </kendo-chip>
2125
+ <ng-container *ngFor="let item of state.rowAxes">
2126
+ <kendo-chip *ngIf="item.name.length === 1"
2127
+ kendoChipDraggable
2128
+ kendoDraggable
2129
+ kendoDropTarget
2130
+ [item]="item"
2131
+ axes="rowAxes"
2132
+ rounded="full"
2133
+ [removable]="true"
2134
+ (remove)="onChipRemove(item, 'row')"
2135
+ >
2136
+ {{ getName(item.name) }}
2137
+
2138
+ <kendo-pivot-chip-menu
2139
+ [chip]="item">
2140
+ </kendo-pivot-chip-menu>
2141
+ </kendo-chip>
2142
+ </ng-container>
2102
2143
  </kendo-chiplist>
2103
2144
 
2104
2145
  <ng-template #noRowAxes>
@@ -2106,11 +2147,11 @@ PivotGridConfiguratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
2106
2147
  </ng-template>
2107
2148
  </ng-template>
2108
2149
 
2109
- <div *ngIf="horizontal; else elseTpl2" class="k-form-field-wrapper">
2110
- <ng-container *ngTemplateOutlet="elseTpl2"></ng-container>
2150
+ <div *ngIf="isHorizontal; else verticalMeasuresTemplate" class="k-form-field-wrapper">
2151
+ <ng-container *ngTemplateOutlet="verticalMeasuresTemplate"></ng-container>
2111
2152
  </div>
2112
2153
 
2113
- <ng-template #elseTpl2>
2154
+ <ng-template #verticalMeasuresTemplate>
2114
2155
  <div class="k-form-field" kendoDropTarget axes="measureAxes">
2115
2156
  <span class="k-label">{{messageFor('configuratorValuesText')}}</span>
2116
2157
  </div>
@@ -2128,6 +2169,7 @@ PivotGridConfiguratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
2128
2169
  axes="measureAxes"
2129
2170
  rounded="full"
2130
2171
  [removable]="true"
2172
+ (remove)="onChipRemove(item, 'measure')"
2131
2173
  >
2132
2174
  {{ getName(item.name) }}
2133
2175
  </kendo-chip>
@@ -2145,7 +2187,7 @@ PivotGridConfiguratorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
2145
2187
  <button kendoButton themeColor="primary" type="button" (click)="handleSubmit()">{{messageFor('configuratorApplyButtonText')}}</button>
2146
2188
  </div>
2147
2189
  </div>
2148
- `, isInline: true, components: [{ type: i4.TreeViewComponent, selector: "kendo-treeview", inputs: ["filterInputPlaceholder", "expandDisabledNodes", "animate", "nodeTemplate", "loadMoreButtonTemplate", "trackBy", "nodes", "textField", "hasChildren", "isChecked", "isDisabled", "isExpanded", "isSelected", "isVisible", "navigable", "children", "loadOnDemand", "filterable", "filter", "size", "disableParentNodesOnly"], outputs: ["childrenLoaded", "blur", "focus", "expand", "collapse", "nodeDragStart", "nodeDrag", "filterStateChange", "nodeDrop", "nodeDragEnd", "addItem", "removeItem", "checkedChange", "selectionChange", "filterChange", "nodeClick", "nodeDblClick"], exportAs: ["kendoTreeView"] }, { type: i5.ChipListComponent, selector: "kendo-chiplist, kendo-chip-list", inputs: ["selection", "size"], outputs: ["selectedChange", "remove"] }, { type: i5.ChipComponent, selector: "kendo-chip", inputs: ["label", "icon", "iconClass", "avatarClass", "selected", "removable", "removeIcon", "disabled", "size", "rounded", "fillMode", "themeColor"], outputs: ["remove", "contentClick"] }, { type: ChipMenuComponent, selector: "kendo-pivot-chip-menu", inputs: ["chip", "tabIndex"] }], directives: [{ type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.ExpandDirective, selector: "[kendoTreeViewExpandable]", inputs: ["isExpanded", "expandBy", "expandOnFilter", "expandedKeys"], outputs: ["expandedKeysChange"] }, { type: i4.NodeTemplateDirective, selector: "[kendoTreeViewNodeTemplate]" }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.CheckBoxDirective, selector: "input[kendoCheckBox]", inputs: ["size", "rounded"] }, { type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: DropTargetDirective, selector: "[kendoDropTarget]", inputs: ["item", "axes"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: DraggableChipDirective, selector: "[kendoChipDraggable]", inputs: ["item"] }, { type: i3.DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { type: i5.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
2190
+ `, isInline: true, styles: ["\n .k-form .k-chip-list {\n width: 100%;\n }\n "], components: [{ type: i4.TreeViewComponent, selector: "kendo-treeview", inputs: ["filterInputPlaceholder", "expandDisabledNodes", "animate", "nodeTemplate", "loadMoreButtonTemplate", "trackBy", "nodes", "textField", "hasChildren", "isChecked", "isDisabled", "isExpanded", "isSelected", "isVisible", "navigable", "children", "loadOnDemand", "filterable", "filter", "size", "disableParentNodesOnly"], outputs: ["childrenLoaded", "blur", "focus", "expand", "collapse", "nodeDragStart", "nodeDrag", "filterStateChange", "nodeDrop", "nodeDragEnd", "addItem", "removeItem", "checkedChange", "selectionChange", "filterChange", "nodeClick", "nodeDblClick"], exportAs: ["kendoTreeView"] }, { type: i5.ChipListComponent, selector: "kendo-chiplist, kendo-chip-list", inputs: ["selection", "size"], outputs: ["selectedChange", "remove"] }, { type: i5.ChipComponent, selector: "kendo-chip", inputs: ["label", "icon", "iconClass", "avatarClass", "selected", "removable", "removeIcon", "disabled", "size", "rounded", "fillMode", "themeColor"], outputs: ["remove", "contentClick"] }, { type: ChipMenuComponent, selector: "kendo-pivot-chip-menu", inputs: ["chip", "tabIndex"] }], directives: [{ type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.ExpandDirective, selector: "[kendoTreeViewExpandable]", inputs: ["isExpanded", "expandBy", "expandOnFilter", "expandedKeys"], outputs: ["expandedKeysChange"] }, { type: i4.NodeTemplateDirective, selector: "[kendoTreeViewNodeTemplate]" }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.CheckBoxDirective, selector: "input[kendoCheckBox]", inputs: ["size", "rounded"] }, { type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: DropTargetDirective, selector: "[kendoDropTarget]", inputs: ["item", "axes"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: DraggableChipDirective, selector: "[kendoChipDraggable]", inputs: ["item"] }, { type: i3.DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { type: i5.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
2149
2191
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridConfiguratorComponent, decorators: [{
2150
2192
  type: Component,
2151
2193
  args: [{
@@ -2159,8 +2201,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2159
2201
  <div
2160
2202
  class="k-pivotgrid-configurator-panel k-pivotgrid-configurator-push"
2161
2203
  [ngClass]="{
2162
- 'k-pivotgrid-configurator-horizontal': horizontal,
2163
- 'k-pivotgrid-configurator-vertical': !horizontal
2204
+ 'k-pivotgrid-configurator-horizontal': isHorizontal,
2205
+ 'k-pivotgrid-configurator-vertical': !isHorizontal
2164
2206
  }"
2165
2207
  >
2166
2208
  <div class="k-pivotgrid-configurator-header">
@@ -2168,7 +2210,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2168
2210
  </div>
2169
2211
 
2170
2212
  <div class="k-pivotgrid-configurator-content">
2171
- <div class="k-form" [class.k-form-horizontal]="horizontal">
2213
+ <div class="k-form" [class.k-form-horizontal]="isHorizontal">
2172
2214
  <div class="k-form-field-wrapper">
2173
2215
  <div class="k-form-field">
2174
2216
  <span class="k-label">{{messageFor('configuratorFieldsText')}}</span>
@@ -2199,7 +2241,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2199
2241
  </div>
2200
2242
  </div>
2201
2243
 
2202
- <div *ngIf="horizontal; else verticalTemplate" class="k-form-field-wrapper">
2244
+ <div *ngIf="isHorizontal; else verticalTemplate" class="k-form-field-wrapper">
2203
2245
  <ng-container *ngTemplateOutlet="verticalTemplate"></ng-container>
2204
2246
  </div>
2205
2247
 
@@ -2213,21 +2255,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2213
2255
  kendoDropTarget
2214
2256
  axes="columnAxes"
2215
2257
  >
2216
- <kendo-chip *ngFor="let item of state.columnAxes"
2217
- kendoChipDraggable
2218
- kendoDraggable
2219
- kendoDropTarget
2220
- [item]="item"
2221
- axes="columnAxes"
2222
- rounded="full"
2223
- [removable]="true"
2224
- >
2225
- {{ getName(item.name) }}
2226
-
2227
- <kendo-pivot-chip-menu
2228
- [chip]="item">
2229
- </kendo-pivot-chip-menu>
2230
- </kendo-chip>
2258
+ <ng-container *ngFor="let item of state.columnAxes">
2259
+ <kendo-chip *ngIf="item.name.length === 1"
2260
+ kendoChipDraggable
2261
+ kendoDraggable
2262
+ kendoDropTarget
2263
+ [item]="item"
2264
+ axes="columnAxes"
2265
+ rounded="full"
2266
+ [removable]="true"
2267
+ (remove)="onChipRemove(item, 'column')"
2268
+ >{{ getName(item.name) }}
2269
+ <kendo-pivot-chip-menu
2270
+ [chip]="item">
2271
+ </kendo-pivot-chip-menu>
2272
+ </kendo-chip>
2273
+ </ng-container>
2231
2274
  </kendo-chiplist>
2232
2275
 
2233
2276
  <ng-template #noColumnAxes>
@@ -2243,21 +2286,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2243
2286
  kendoDropTarget
2244
2287
  axes="rowAxes"
2245
2288
  >
2246
- <kendo-chip *ngFor="let item of state.rowAxes"
2247
- kendoChipDraggable
2248
- kendoDraggable
2249
- kendoDropTarget
2250
- [item]="item"
2251
- axes="rowAxes"
2252
- rounded="full"
2253
- [removable]="true"
2254
- >
2255
- {{ getName(item.name) }}
2256
-
2257
- <kendo-pivot-chip-menu
2258
- [chip]="item">
2259
- </kendo-pivot-chip-menu>
2260
- </kendo-chip>
2289
+ <ng-container *ngFor="let item of state.rowAxes">
2290
+ <kendo-chip *ngIf="item.name.length === 1"
2291
+ kendoChipDraggable
2292
+ kendoDraggable
2293
+ kendoDropTarget
2294
+ [item]="item"
2295
+ axes="rowAxes"
2296
+ rounded="full"
2297
+ [removable]="true"
2298
+ (remove)="onChipRemove(item, 'row')"
2299
+ >
2300
+ {{ getName(item.name) }}
2301
+
2302
+ <kendo-pivot-chip-menu
2303
+ [chip]="item">
2304
+ </kendo-pivot-chip-menu>
2305
+ </kendo-chip>
2306
+ </ng-container>
2261
2307
  </kendo-chiplist>
2262
2308
 
2263
2309
  <ng-template #noRowAxes>
@@ -2265,11 +2311,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2265
2311
  </ng-template>
2266
2312
  </ng-template>
2267
2313
 
2268
- <div *ngIf="horizontal; else elseTpl2" class="k-form-field-wrapper">
2269
- <ng-container *ngTemplateOutlet="elseTpl2"></ng-container>
2314
+ <div *ngIf="isHorizontal; else verticalMeasuresTemplate" class="k-form-field-wrapper">
2315
+ <ng-container *ngTemplateOutlet="verticalMeasuresTemplate"></ng-container>
2270
2316
  </div>
2271
2317
 
2272
- <ng-template #elseTpl2>
2318
+ <ng-template #verticalMeasuresTemplate>
2273
2319
  <div class="k-form-field" kendoDropTarget axes="measureAxes">
2274
2320
  <span class="k-label">{{messageFor('configuratorValuesText')}}</span>
2275
2321
  </div>
@@ -2287,6 +2333,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2287
2333
  axes="measureAxes"
2288
2334
  rounded="full"
2289
2335
  [removable]="true"
2336
+ (remove)="onChipRemove(item, 'measure')"
2290
2337
  >
2291
2338
  {{ getName(item.name) }}
2292
2339
  </kendo-chip>
@@ -2304,12 +2351,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2304
2351
  <button kendoButton themeColor="primary" type="button" (click)="handleSubmit()">{{messageFor('configuratorApplyButtonText')}}</button>
2305
2352
  </div>
2306
2353
  </div>
2307
- `
2354
+ `,
2355
+ styles: [`
2356
+ .k-form .k-chip-list {
2357
+ width: 100%;
2358
+ }
2359
+ `]
2308
2360
  }]
2309
2361
  }], ctorParameters: function () { return [{ type: PivotGridDataService }, { type: i1.LocalizationService }, { type: ConfiguratorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { hostClass: [{
2310
2362
  type: HostBinding,
2311
2363
  args: ['class.k-pivotgrid-configurator']
2312
- }], horizontal: [{
2364
+ }], orientation: [{
2313
2365
  type: Input
2314
2366
  }], sort: [{
2315
2367
  type: Input
@@ -2426,7 +2478,7 @@ const DEFAULT_LOADER_SETTINGS = {
2426
2478
  };
2427
2479
  const DEFAULT_CONFIGURATOR_SETTINGS = {
2428
2480
  position: 'right',
2429
- horizontal: false
2481
+ orientation: 'vertical'
2430
2482
  };
2431
2483
  /**
2432
2484
  * Represents the Kendo UI PivotGrid component for Angular.
@@ -2583,9 +2635,12 @@ class PivotGridComponent {
2583
2635
  if (firstCell) {
2584
2636
  firstCell.setAttribute('tabindex', '0');
2585
2637
  }
2586
- this.subs.add(this.dataService.directive.expandChange.pipe(merge(this.dataService.directive.configurationChange)).subscribe(() => this.zone.runOutsideAngular(() => {
2587
- setTimeout(() => this.navigation.update());
2588
- })));
2638
+ if (!this.navigationSubs) {
2639
+ this.navigationSubs = this.dataService.directive.expandChange.pipe(merge(this.dataService.directive.configurationChange)).subscribe(() => this.zone.runOutsideAngular(() => {
2640
+ setTimeout(() => this.navigation.update());
2641
+ }));
2642
+ this.subs.add(this.navigationSubs);
2643
+ }
2589
2644
  }
2590
2645
  stopNavigation() {
2591
2646
  if (this.navigation) {
@@ -2733,7 +2788,7 @@ PivotGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
2733
2788
 
2734
2789
  <kendo-pivotgrid-configurator
2735
2790
  *ngIf="showConfigurator"
2736
- [horizontal]="configuratorSettings.horizontal">
2791
+ [orientation]="configuratorSettings.orientation">
2737
2792
  </kendo-pivotgrid-configurator>
2738
2793
 
2739
2794
  <div *ngIf="configurator"
@@ -2742,7 +2797,7 @@ PivotGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
2742
2797
  <span>{{messageFor('configuratorButtonText')}}<span class="k-icon k-i-gear k-color-inherit"></span>
2743
2798
  </span>
2744
2799
  </div>
2745
- `, isInline: true, styles: ["\n /** TODO: Remove if added to themes */\n div.k-loader {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n .k-pivotgrid-empty-cell:focus {\n outline: none;\n }\n "], components: [{ type: PivotGridTableComponent, selector: "kendo-pivotgrid-table", inputs: ["tableType", "colWidth"] }, { type: i5$1.LoaderComponent, selector: "kendo-loader", inputs: ["type", "themeColor", "size"] }, { type: PivotGridConfiguratorComponent, selector: "kendo-pivotgrid-configurator", inputs: ["horizontal", "sort", "filter"] }], directives: [{ type: LocalizedMessagesDirective, selector: "[kendoPivotGridLocalizedMessages]" }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2800
+ `, isInline: true, styles: ["\n /** TODO: Remove if added to themes */\n div.k-loader {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n "], components: [{ type: PivotGridTableComponent, selector: "kendo-pivotgrid-table", inputs: ["tableType", "colWidth"] }, { type: i5$1.LoaderComponent, selector: "kendo-loader", inputs: ["type", "themeColor", "size"] }, { type: PivotGridConfiguratorComponent, selector: "kendo-pivotgrid-configurator", inputs: ["orientation", "sort", "filter"] }], directives: [{ type: LocalizedMessagesDirective, selector: "[kendoPivotGridLocalizedMessages]" }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2746
2801
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridComponent, decorators: [{
2747
2802
  type: Component,
2748
2803
  args: [{
@@ -2883,7 +2938,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2883
2938
 
2884
2939
  <kendo-pivotgrid-configurator
2885
2940
  *ngIf="showConfigurator"
2886
- [horizontal]="configuratorSettings.horizontal">
2941
+ [orientation]="configuratorSettings.orientation">
2887
2942
  </kendo-pivotgrid-configurator>
2888
2943
 
2889
2944
  <div *ngIf="configurator"
@@ -2901,10 +2956,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2901
2956
  left: 50%;
2902
2957
  transform: translate(-50%, -50%);
2903
2958
  }
2904
-
2905
- .k-pivotgrid-empty-cell:focus {
2906
- outline: none;
2907
- }
2908
2959
  `]
2909
2960
  }]
2910
2961
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: PivotGridDataService }, { type: i1.LocalizationService }, { type: i0.Renderer2 }, { type: i3.ScrollbarWidthService }]; }, propDecorators: { hostClass: [{
@@ -2953,19 +3004,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2953
3004
  type: Input
2954
3005
  }] } });
2955
3006
 
2956
- /**
2957
- * @hidden
2958
- */
2959
- class PivotGridState {
2960
- constructor(columnAxes, rowAxes, measureAxes, sort, filter) {
2961
- this.columnAxes = columnAxes;
2962
- this.rowAxes = rowAxes;
2963
- this.measureAxes = measureAxes;
2964
- this.sort = sort;
2965
- this.filter = filter;
2966
- }
2967
- }
2968
-
2969
3007
  /**
2970
3008
  * The event data for the ExpandChangeEvent
2971
3009
  */
@@ -3035,14 +3073,9 @@ class PivotBaseBindingDirective {
3035
3073
  this.dataLoaded = new EventEmitter();
3036
3074
  this.subs = new Subscription();
3037
3075
  }
3038
- /**
3039
- * @hidden
3040
- */
3041
- get state() {
3042
- return new PivotGridState(this.columnAxes, this.rowAxes, this.measureAxes, this.sort, this.filter);
3043
- }
3044
3076
  ngOnInit() {
3045
- this.loadData(this.state);
3077
+ this.dataService.state = new PivotGridState(this.columnAxes, this.rowAxes, this.measureAxes, this.sort, this.filter);
3078
+ this.loadData(this.dataService.state);
3046
3079
  this.loadFields();
3047
3080
  this.subs.add(this.dataService.expandedStateChange.subscribe((state) => {
3048
3081
  this.zone.run(() => {
@@ -3062,14 +3095,9 @@ class PivotBaseBindingDirective {
3062
3095
  return;
3063
3096
  }
3064
3097
  }
3065
- this.dataService.configuredFields.next({
3066
- columnAxes: state.columnAxes,
3067
- rowAxes: state.rowAxes,
3068
- measureAxes: state.measureAxes,
3069
- sort: state.sort,
3070
- filter: state.filter
3071
- });
3098
+ this.dataService.configuredFields.next(this.dataService.state);
3072
3099
  this.loadData(state);
3100
+ this.dataService.state = state;
3073
3101
  });
3074
3102
  }));
3075
3103
  this.subs.add(this.dataService.valuesRows.subscribe((data) => {
@@ -3090,13 +3118,7 @@ class PivotBaseBindingDirective {
3090
3118
  }
3091
3119
  updateConfiguratorFields() {
3092
3120
  this.dataService.fields.next(this.configuratorFields);
3093
- this.dataService.configuredFields.next({
3094
- columnAxes: this.columnAxes,
3095
- rowAxes: this.rowAxes,
3096
- measureAxes: this.measureAxes,
3097
- sort: this.sort,
3098
- filter: this.filter
3099
- });
3121
+ this.dataService.configuredFields.next(this.dataService.state);
3100
3122
  }
3101
3123
  updateHeaders(axes, tree, path) {
3102
3124
  // Action to determine expand/collapse state
@@ -3108,16 +3130,18 @@ class PivotBaseBindingDirective {
3108
3130
  // the expanded state based on the toggle action (expand/collapse)
3109
3131
  // Update axes and reload data
3110
3132
  const newHeaders = headersReducer(this[axes].slice(), Object.assign(Object.assign({}, action), { tree }));
3133
+ const newState = Object.assign(Object.assign({}, this.dataService.state), { [axes]: newHeaders });
3134
+ this.dataService.state = newState;
3111
3135
  if (hasObservers(this.expandChange)) {
3112
- const newState = Object.assign(Object.assign({}, this.state), { [axes]: newHeaders });
3113
3136
  const event = new ExpandChangeEvent(newState);
3114
3137
  this.expandChange.emit(event);
3115
3138
  if (event.isDefaultPrevented()) {
3116
3139
  return;
3117
3140
  }
3118
3141
  }
3142
+ this.dataService.configuredFields.next(this.dataService.state);
3119
3143
  this[axes] = newHeaders;
3120
- this.loadData(this.state);
3144
+ this.loadData(this.dataService.state);
3121
3145
  }
3122
3146
  ;
3123
3147
  }
@@ -3161,7 +3185,7 @@ class PivotLocalBindingDirective extends PivotBaseBindingDirective {
3161
3185
  }
3162
3186
  ngOnChanges(changes) {
3163
3187
  if (anyChanged(['data', 'dimensions', 'columnAxes', 'rowAxes', 'measureAxes', 'measures'], changes)) {
3164
- this.loadData(this.state);
3188
+ this.loadData(this.dataService.state);
3165
3189
  }
3166
3190
  }
3167
3191
  /**
@@ -3225,7 +3249,7 @@ class PivotOLAPBindingDirective extends PivotBaseBindingDirective {
3225
3249
  }
3226
3250
  ngOnChanges(changes) {
3227
3251
  if (anyChanged(['url', 'cube', 'catalog', 'columnAxes', 'rowAxes', 'measureAxes'], changes)) {
3228
- this.loadData(this.state);
3252
+ this.loadData(this.dataService.state);
3229
3253
  this.loadFields();
3230
3254
  }
3231
3255
  }