@progress/kendo-angular-pivotgrid 15.2.0-develop.1 → 15.2.0-develop.3

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.
package/esm2020/index.mjs CHANGED
@@ -18,5 +18,10 @@ export { DropTargetDirective } from './configurator/drop-target.directive';
18
18
  // Events
19
19
  export { ExpandChangeEvent } from './models/expanded-change-event';
20
20
  export { ConfigurationChangeEvent } from './models/configuration-change-event';
21
+ // Template Directives
22
+ export { CellTemplateDirective } from './rendering/templates/pivotgrid-cell-template.directive';
23
+ export { ValueCellTemplateDirective } from './rendering/templates/pivotgrid-value-cell-template.directive';
24
+ export { RowHeaderCellTemplateDirective } from './rendering/templates/pivotgrid-row-header-cell-template.directive';
25
+ export { ColumnHeaderCellTemplateDirective } from './rendering/templates/pivotgrid-column-header-cell-template.directive';
21
26
  // Export types from PivotGrid common package
22
27
  export { sumAggregate, averageAggregate, minAggregate, maxAggregate } from '@progress/kendo-pivotgrid-common';
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-pivotgrid',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1709657996,
13
- version: '15.2.0-develop.1',
12
+ publishDate: 1709730569,
13
+ version: '15.2.0-develop.3',
14
14
  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'
15
15
  };
@@ -2,7 +2,7 @@
2
2
  * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { Component, ElementRef, HostBinding, Input, NgZone, Renderer2, ViewChild } from '@angular/core';
5
+ import { Component, ContentChild, ElementRef, HostBinding, Input, NgZone, Renderer2, ViewChild } from '@angular/core';
6
6
  import { validatePackage } from '@progress/kendo-licensing';
7
7
  import { packageMetadata } from './package-metadata';
8
8
  import { isChanged, isDocumentAvailable, ScrollbarWidthService } from '@progress/kendo-angular-common';
@@ -14,6 +14,10 @@ import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
14
14
  import { ConfiguratorNavigation, PivotGridNavigation } from '@progress/kendo-pivotgrid-common';
15
15
  import { PivotLocalizationService } from './localization/pivot-localization.service';
16
16
  import { gearIcon } from '@progress/kendo-svg-icons';
17
+ import { CellTemplateDirective } from './rendering/templates/pivotgrid-cell-template.directive';
18
+ import { ValueCellTemplateDirective } from './rendering/templates/pivotgrid-value-cell-template.directive';
19
+ import { RowHeaderCellTemplateDirective } from './rendering/templates/pivotgrid-row-header-cell-template.directive';
20
+ import { ColumnHeaderCellTemplateDirective } from './rendering/templates/pivotgrid-column-header-cell-template.directive';
17
21
  import * as i0 from "@angular/core";
18
22
  import * as i1 from "./data-binding/pivotgrid-data.service";
19
23
  import * as i2 from "@progress/kendo-angular-l10n";
@@ -252,7 +256,7 @@ PivotGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
252
256
  provide: L10N_PREFIX,
253
257
  useValue: 'kendo.pivotgrid'
254
258
  }
255
- ], viewQueries: [{ propertyName: "colHeadersTable", first: true, predicate: ["colHeadersTable"], descendants: true, read: ElementRef }, { propertyName: "rowHeadersTable", first: true, predicate: ["rowHeadersTable"], descendants: true, read: ElementRef }, { propertyName: "valuesTable", first: true, predicate: ["valuesTable"], descendants: true, read: ElementRef }, { propertyName: "table", first: true, predicate: ["table"], descendants: true, read: ElementRef }, { propertyName: "configuratorWrapper", first: true, predicate: ["configurator"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: `
259
+ ], queries: [{ propertyName: "customCellTemplate", first: true, predicate: CellTemplateDirective, descendants: true }, { propertyName: "valueCellTemplate", first: true, predicate: ValueCellTemplateDirective, descendants: true }, { propertyName: "rowHeaderCellTemplate", first: true, predicate: RowHeaderCellTemplateDirective, descendants: true }, { propertyName: "columnHeaderCellTemplate", first: true, predicate: ColumnHeaderCellTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "colHeadersTable", first: true, predicate: ["colHeadersTable"], descendants: true, read: ElementRef }, { propertyName: "rowHeadersTable", first: true, predicate: ["rowHeadersTable"], descendants: true, read: ElementRef }, { propertyName: "valuesTable", first: true, predicate: ["valuesTable"], descendants: true, read: ElementRef }, { propertyName: "table", first: true, predicate: ["table"], descendants: true, read: ElementRef }, { propertyName: "configuratorWrapper", first: true, predicate: ["configurator"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: `
256
260
  <ng-container kendoPivotGridLocalizedMessages
257
261
  i18n-loading="kendo.pivotgrid.loading|The loading text"
258
262
  loading="Loading"
@@ -366,14 +370,20 @@ PivotGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
366
370
  <kendo-pivotgrid-table
367
371
  #colHeadersTable
368
372
  [colWidth]="columnHeadersWidth"
373
+ [customCellTemplate]="customCellTemplate"
374
+ [columnHeaderCellTemplate]="columnHeaderCellTemplate"
369
375
  class="k-pivotgrid-column-headers"
370
376
  tableType="columnHeader"></kendo-pivotgrid-table>
371
377
  <kendo-pivotgrid-table
372
378
  #rowHeadersTable
379
+ [customCellTemplate]="customCellTemplate"
380
+ [rowHeaderCellTemplate]="rowHeaderCellTemplate"
373
381
  class="k-pivotgrid-row-headers"
374
382
  tableType="rowHeader"></kendo-pivotgrid-table>
375
383
  <kendo-pivotgrid-table
376
384
  #valuesTable
385
+ [customCellTemplate]="customCellTemplate"
386
+ [valueCellTemplate]="valueCellTemplate"
377
387
  [colWidth]="columnHeadersWidth"
378
388
  class="k-pivotgrid-values"
379
389
  tableType="values"></kendo-pivotgrid-table>
@@ -403,7 +413,7 @@ PivotGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
403
413
  <span>{{messageFor('configuratorButtonText')}}<kendo-icon-wrapper name="gear" innerCssClass="k-color-inherit" [svgIcon]="gearSVGIcon"></kendo-icon-wrapper>
404
414
  </span>
405
415
  </div>
406
- `, isInline: true, components: [{ type: i4.PivotGridTableComponent, selector: "kendo-pivotgrid-table", inputs: ["tableType", "colWidth"] }, { type: i5.LoaderComponent, selector: "kendo-loader", inputs: ["type", "themeColor", "size"] }, { type: i6.PivotGridConfiguratorComponent, selector: "kendo-pivotgrid-configurator", inputs: ["orientation", "sort", "filter", "navigation"], outputs: ["close"] }, { type: i7.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i8.LocalizedMessagesDirective, selector: "[kendoPivotGridLocalizedMessages]" }, { type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
416
+ `, isInline: true, components: [{ type: i4.PivotGridTableComponent, selector: "kendo-pivotgrid-table", inputs: ["tableType", "colWidth", "customCellTemplate", "valueCellTemplate", "rowHeaderCellTemplate", "columnHeaderCellTemplate"] }, { type: i5.LoaderComponent, selector: "kendo-loader", inputs: ["type", "themeColor", "size"] }, { type: i6.PivotGridConfiguratorComponent, selector: "kendo-pivotgrid-configurator", inputs: ["orientation", "sort", "filter", "navigation"], outputs: ["close"] }, { type: i7.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i8.LocalizedMessagesDirective, selector: "[kendoPivotGridLocalizedMessages]" }, { type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
407
417
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PivotGridComponent, decorators: [{
408
418
  type: Component,
409
419
  args: [{
@@ -531,14 +541,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
531
541
  <kendo-pivotgrid-table
532
542
  #colHeadersTable
533
543
  [colWidth]="columnHeadersWidth"
544
+ [customCellTemplate]="customCellTemplate"
545
+ [columnHeaderCellTemplate]="columnHeaderCellTemplate"
534
546
  class="k-pivotgrid-column-headers"
535
547
  tableType="columnHeader"></kendo-pivotgrid-table>
536
548
  <kendo-pivotgrid-table
537
549
  #rowHeadersTable
550
+ [customCellTemplate]="customCellTemplate"
551
+ [rowHeaderCellTemplate]="rowHeaderCellTemplate"
538
552
  class="k-pivotgrid-row-headers"
539
553
  tableType="rowHeader"></kendo-pivotgrid-table>
540
554
  <kendo-pivotgrid-table
541
555
  #valuesTable
556
+ [customCellTemplate]="customCellTemplate"
557
+ [valueCellTemplate]="valueCellTemplate"
542
558
  [colWidth]="columnHeadersWidth"
543
559
  class="k-pivotgrid-values"
544
560
  tableType="values"></kendo-pivotgrid-table>
@@ -606,6 +622,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
606
622
  }], configuratorWrapper: [{
607
623
  type: ViewChild,
608
624
  args: ['configurator', { read: ElementRef }]
625
+ }], customCellTemplate: [{
626
+ type: ContentChild,
627
+ args: [CellTemplateDirective]
628
+ }], valueCellTemplate: [{
629
+ type: ContentChild,
630
+ args: [ValueCellTemplateDirective]
631
+ }], rowHeaderCellTemplate: [{
632
+ type: ContentChild,
633
+ args: [RowHeaderCellTemplateDirective]
634
+ }], columnHeaderCellTemplate: [{
635
+ type: ContentChild,
636
+ args: [ColumnHeaderCellTemplateDirective]
609
637
  }], loaderSettings: [{
610
638
  type: Input
611
639
  }], configurator: [{
@@ -20,6 +20,10 @@ import { ChipMenuModule } from './configurator/chip-menu/chip-menu.module';
20
20
  import { SharedModule } from './shared.module';
21
21
  import { ChipKeyboardNavigationDirective } from './configurator/chip-kb-nav.directive';
22
22
  import { IconsModule } from '@progress/kendo-angular-icons';
23
+ import { CellTemplateDirective } from './rendering/templates/pivotgrid-cell-template.directive';
24
+ import { ValueCellTemplateDirective } from './rendering/templates/pivotgrid-value-cell-template.directive';
25
+ import { RowHeaderCellTemplateDirective } from './rendering/templates/pivotgrid-row-header-cell-template.directive';
26
+ import { ColumnHeaderCellTemplateDirective } from './rendering/templates/pivotgrid-column-header-cell-template.directive';
23
27
  import * as i0 from "@angular/core";
24
28
  const IMPORTED_MODULES = [
25
29
  EventsModule,
@@ -41,7 +45,11 @@ const DECLARATIONS = [
41
45
  DropTargetDirective,
42
46
  LocalizedMessagesDirective,
43
47
  CustomMessagesComponent,
44
- ChipKeyboardNavigationDirective
48
+ ChipKeyboardNavigationDirective,
49
+ CellTemplateDirective,
50
+ ValueCellTemplateDirective,
51
+ RowHeaderCellTemplateDirective,
52
+ ColumnHeaderCellTemplateDirective
45
53
  ];
46
54
  const EXPORTS = [
47
55
  PivotGridComponent,
@@ -49,7 +57,11 @@ const EXPORTS = [
49
57
  PivotGridCellDirective,
50
58
  PivotLocalBindingDirective,
51
59
  PivotOLAPBindingDirective,
52
- CustomMessagesComponent
60
+ CustomMessagesComponent,
61
+ CellTemplateDirective,
62
+ ValueCellTemplateDirective,
63
+ RowHeaderCellTemplateDirective,
64
+ ColumnHeaderCellTemplateDirective
53
65
  ];
54
66
  /**
55
67
  * Sample module
@@ -67,7 +79,11 @@ PivotGridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
67
79
  DropTargetDirective,
68
80
  LocalizedMessagesDirective,
69
81
  CustomMessagesComponent,
70
- ChipKeyboardNavigationDirective], imports: [EventsModule,
82
+ ChipKeyboardNavigationDirective,
83
+ CellTemplateDirective,
84
+ ValueCellTemplateDirective,
85
+ RowHeaderCellTemplateDirective,
86
+ ColumnHeaderCellTemplateDirective], imports: [EventsModule,
71
87
  IndicatorsModule,
72
88
  TreeViewModule,
73
89
  DraggableModule,
@@ -78,7 +94,11 @@ PivotGridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
78
94
  PivotGridCellDirective,
79
95
  PivotLocalBindingDirective,
80
96
  PivotOLAPBindingDirective,
81
- CustomMessagesComponent] });
97
+ CustomMessagesComponent,
98
+ CellTemplateDirective,
99
+ ValueCellTemplateDirective,
100
+ RowHeaderCellTemplateDirective,
101
+ ColumnHeaderCellTemplateDirective] });
82
102
  PivotGridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PivotGridModule, imports: [[...IMPORTED_MODULES]] });
83
103
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PivotGridModule, decorators: [{
84
104
  type: NgModule,
@@ -5,11 +5,16 @@
5
5
  import { Component, ElementRef, HostBinding, Input, Renderer2 } from '@angular/core';
6
6
  import { chevronDownIcon, chevronUpIcon } from '@progress/kendo-svg-icons';
7
7
  import { PivotGridDataService } from '../data-binding/pivotgrid-data.service';
8
+ import { CellTemplateDirective } from './templates/pivotgrid-cell-template.directive';
9
+ import { ValueCellTemplateDirective } from './templates/pivotgrid-value-cell-template.directive';
10
+ import { RowHeaderCellTemplateDirective } from './templates/pivotgrid-row-header-cell-template.directive';
11
+ import { ColumnHeaderCellTemplateDirective } from './templates/pivotgrid-column-header-cell-template.directive';
8
12
  import * as i0 from "@angular/core";
9
13
  import * as i1 from "../data-binding/pivotgrid-data.service";
10
14
  import * as i2 from "@progress/kendo-angular-icons";
11
15
  import * as i3 from "@angular/common";
12
16
  import * as i4 from "@progress/kendo-angular-common";
17
+ import * as i5 from "@progress/kendo-angular-buttons";
13
18
  /**
14
19
  * @hidden
15
20
  */
@@ -29,8 +34,13 @@ export class PivotGridCellDirective {
29
34
  });
30
35
  };
31
36
  }
37
+ get isNotProvidedCellTemplatePerType() {
38
+ return (this.tableType === 'values' && !this.valueCellTemplate)
39
+ || (this.tableType === 'rowHeader' && !this.rowHeaderCellTemplate)
40
+ || (this.tableType === 'columnHeader' && !this.columnHeaderCellTemplate);
41
+ }
32
42
  get expanded() {
33
- return this.kendoPivotGridCell?.hasChildren && this.kendoPivotGridCell.children.length;
43
+ return (this.kendoPivotGridCell?.hasChildren && this.kendoPivotGridCell.children.length > 0) || false;
34
44
  }
35
45
  ngOnInit() {
36
46
  const nativeElement = this.hostEl.nativeElement;
@@ -52,31 +62,133 @@ export class PivotGridCellDirective {
52
62
  }
53
63
  }
54
64
  PivotGridCellDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PivotGridCellDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.PivotGridDataService }], target: i0.ɵɵFactoryTarget.Component });
55
- PivotGridCellDirective.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: PivotGridCellDirective, selector: "[kendoPivotGridCell]", inputs: { kendoPivotGridCell: "kendoPivotGridCell", tableType: "tableType", rowIndex: "rowIndex", colIndex: "colIndex" }, host: { properties: { "class.k-pivotgrid-cell": "this.cellClass" } }, ngImport: i0, template: `
56
- <kendo-icon-wrapper
57
- *ngIf="kendoPivotGridCell.hasChildren && !kendoPivotGridCell.total"
58
- aria-hidden="true"
59
- [kendoEventsOutsideAngular]="{ click: handleClick }"
60
- [name]="expanded ? 'chevron-up' : 'chevron-down'"
61
- [svgIcon]="expanded ? chevronUpSVGIcon : chevronDownSVGIcon"
62
- innerCssClass="k-pivotgrid-toggle">
63
- </kendo-icon-wrapper>
64
- {{ kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption }}`, isInline: true, components: [{ type: i2.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }] });
65
+ PivotGridCellDirective.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: PivotGridCellDirective, selector: "[kendoPivotGridCell]", inputs: { kendoPivotGridCell: "kendoPivotGridCell", tableType: "tableType", rowIndex: "rowIndex", colIndex: "colIndex", customCellTemplate: "customCellTemplate", valueCellTemplate: "valueCellTemplate", rowHeaderCellTemplate: "rowHeaderCellTemplate", columnHeaderCellTemplate: "columnHeaderCellTemplate" }, host: { properties: { "class.k-pivotgrid-cell": "this.cellClass" } }, ngImport: i0, template: `
66
+ <kendo-icon-wrapper
67
+ *ngIf="kendoPivotGridCell.hasChildren && !kendoPivotGridCell.total"
68
+ aria-hidden="true"
69
+ [kendoEventsOutsideAngular]="{ click: handleClick }"
70
+ [name]="expanded ? 'chevron-up' : 'chevron-down'"
71
+ [svgIcon]="expanded ? chevronUpSVGIcon : chevronDownSVGIcon"
72
+ innerCssClass="k-pivotgrid-toggle">
73
+ </kendo-icon-wrapper>
74
+ <!--value cell template-->
75
+ <ng-template *ngIf="tableType === 'values' && valueCellTemplate"
76
+ [templateContext]="{
77
+ templateRef: valueCellTemplate.templateRef,
78
+ $implicit: kendoPivotGridCell,
79
+ value: kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption,
80
+ rowIndex: rowIndex,
81
+ columnIndex: colIndex,
82
+ tableType: tableType
83
+ }">
84
+ </ng-template>
85
+ <!--row header cell template-->
86
+ <ng-template *ngIf="tableType === 'rowHeader' && rowHeaderCellTemplate"
87
+ [templateContext]="{
88
+ templateRef: rowHeaderCellTemplate.templateRef,
89
+ $implicit: kendoPivotGridCell,
90
+ text: kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption,
91
+ rowIndex: rowIndex,
92
+ columnIndex: colIndex,
93
+ tableType: tableType,
94
+ expanded: expanded
95
+ }">
96
+ </ng-template>
97
+ <!--column header cell template-->
98
+ <ng-template *ngIf="tableType === 'columnHeader' && columnHeaderCellTemplate"
99
+ [templateContext]="{
100
+ templateRef: columnHeaderCellTemplate.templateRef,
101
+ $implicit: kendoPivotGridCell,
102
+ text: kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption,
103
+ rowIndex: rowIndex,
104
+ columnIndex: colIndex,
105
+ tableType: tableType,
106
+ expanded: expanded
107
+ }">
108
+ </ng-template>
109
+ <!--cell template-->
110
+ <ng-template *ngIf="customCellTemplate && isNotProvidedCellTemplatePerType"
111
+ [templateContext]="{
112
+ templateRef: customCellTemplate.templateRef,
113
+ $implicit: kendoPivotGridCell,
114
+ text: kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption,
115
+ rowIndex: rowIndex,
116
+ columnIndex: colIndex,
117
+ tableType: tableType,
118
+ expanded: expanded
119
+ }">
120
+ </ng-template>
121
+ <!--default cell content-->
122
+ <span *ngIf="!customCellTemplate && isNotProvidedCellTemplatePerType">
123
+ {{ kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption }}
124
+ </span>
125
+ `, isInline: true, components: [{ type: i2.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: i5.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }] });
65
126
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PivotGridCellDirective, decorators: [{
66
127
  type: Component,
67
128
  args: [{
68
129
  // eslint-disable-next-line @angular-eslint/component-selector
69
130
  selector: '[kendoPivotGridCell]',
70
131
  template: `
71
- <kendo-icon-wrapper
72
- *ngIf="kendoPivotGridCell.hasChildren && !kendoPivotGridCell.total"
73
- aria-hidden="true"
74
- [kendoEventsOutsideAngular]="{ click: handleClick }"
75
- [name]="expanded ? 'chevron-up' : 'chevron-down'"
76
- [svgIcon]="expanded ? chevronUpSVGIcon : chevronDownSVGIcon"
77
- innerCssClass="k-pivotgrid-toggle">
78
- </kendo-icon-wrapper>
79
- {{ kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption }}`
132
+ <kendo-icon-wrapper
133
+ *ngIf="kendoPivotGridCell.hasChildren && !kendoPivotGridCell.total"
134
+ aria-hidden="true"
135
+ [kendoEventsOutsideAngular]="{ click: handleClick }"
136
+ [name]="expanded ? 'chevron-up' : 'chevron-down'"
137
+ [svgIcon]="expanded ? chevronUpSVGIcon : chevronDownSVGIcon"
138
+ innerCssClass="k-pivotgrid-toggle">
139
+ </kendo-icon-wrapper>
140
+ <!--value cell template-->
141
+ <ng-template *ngIf="tableType === 'values' && valueCellTemplate"
142
+ [templateContext]="{
143
+ templateRef: valueCellTemplate.templateRef,
144
+ $implicit: kendoPivotGridCell,
145
+ value: kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption,
146
+ rowIndex: rowIndex,
147
+ columnIndex: colIndex,
148
+ tableType: tableType
149
+ }">
150
+ </ng-template>
151
+ <!--row header cell template-->
152
+ <ng-template *ngIf="tableType === 'rowHeader' && rowHeaderCellTemplate"
153
+ [templateContext]="{
154
+ templateRef: rowHeaderCellTemplate.templateRef,
155
+ $implicit: kendoPivotGridCell,
156
+ text: kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption,
157
+ rowIndex: rowIndex,
158
+ columnIndex: colIndex,
159
+ tableType: tableType,
160
+ expanded: expanded
161
+ }">
162
+ </ng-template>
163
+ <!--column header cell template-->
164
+ <ng-template *ngIf="tableType === 'columnHeader' && columnHeaderCellTemplate"
165
+ [templateContext]="{
166
+ templateRef: columnHeaderCellTemplate.templateRef,
167
+ $implicit: kendoPivotGridCell,
168
+ text: kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption,
169
+ rowIndex: rowIndex,
170
+ columnIndex: colIndex,
171
+ tableType: tableType,
172
+ expanded: expanded
173
+ }">
174
+ </ng-template>
175
+ <!--cell template-->
176
+ <ng-template *ngIf="customCellTemplate && isNotProvidedCellTemplatePerType"
177
+ [templateContext]="{
178
+ templateRef: customCellTemplate.templateRef,
179
+ $implicit: kendoPivotGridCell,
180
+ text: kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption,
181
+ rowIndex: rowIndex,
182
+ columnIndex: colIndex,
183
+ tableType: tableType,
184
+ expanded: expanded
185
+ }">
186
+ </ng-template>
187
+ <!--default cell content-->
188
+ <span *ngIf="!customCellTemplate && isNotProvidedCellTemplatePerType">
189
+ {{ kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption }}
190
+ </span>
191
+ `
80
192
  }]
81
193
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.PivotGridDataService }]; }, propDecorators: { cellClass: [{
82
194
  type: HostBinding,
@@ -89,4 +201,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
89
201
  type: Input
90
202
  }], colIndex: [{
91
203
  type: Input
204
+ }], customCellTemplate: [{
205
+ type: Input
206
+ }], valueCellTemplate: [{
207
+ type: Input
208
+ }], rowHeaderCellTemplate: [{
209
+ type: Input
210
+ }], columnHeaderCellTemplate: [{
211
+ type: Input
92
212
  }] } });
@@ -5,6 +5,10 @@
5
5
  import { Component, Input } from '@angular/core';
6
6
  import { Subscription } from 'rxjs';
7
7
  import { PivotGridDataService } from '../data-binding/pivotgrid-data.service';
8
+ import { CellTemplateDirective } from './templates/pivotgrid-cell-template.directive';
9
+ import { ValueCellTemplateDirective } from './templates/pivotgrid-value-cell-template.directive';
10
+ import { ColumnHeaderCellTemplateDirective } from './templates/pivotgrid-column-header-cell-template.directive';
11
+ import { RowHeaderCellTemplateDirective } from './templates/pivotgrid-row-header-cell-template.directive';
8
12
  import * as i0 from "@angular/core";
9
13
  import * as i1 from "../data-binding/pivotgrid-data.service";
10
14
  import * as i2 from "./pivotgrid-cell.directive";
@@ -31,7 +35,7 @@ export class PivotGridTableComponent {
31
35
  }
32
36
  }
33
37
  PivotGridTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PivotGridTableComponent, deps: [{ token: i1.PivotGridDataService }], target: i0.ɵɵFactoryTarget.Component });
34
- PivotGridTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: PivotGridTableComponent, selector: "kendo-pivotgrid-table", inputs: { tableType: "tableType", colWidth: "colWidth" }, ngImport: i0, template: `
38
+ PivotGridTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: PivotGridTableComponent, selector: "kendo-pivotgrid-table", inputs: { tableType: "tableType", colWidth: "colWidth", customCellTemplate: "customCellTemplate", valueCellTemplate: "valueCellTemplate", rowHeaderCellTemplate: "rowHeaderCellTemplate", columnHeaderCellTemplate: "columnHeaderCellTemplate" }, ngImport: i0, template: `
35
39
  <table
36
40
  class="k-pivotgrid-table"
37
41
  role="presentation">
@@ -48,6 +52,9 @@ PivotGridTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
48
52
  <th
49
53
  *ngIf="cell && tableType !== 'values'"
50
54
  [kendoPivotGridCell]="cell"
55
+ [customCellTemplate]="customCellTemplate"
56
+ [rowHeaderCellTemplate]="rowHeaderCellTemplate"
57
+ [columnHeaderCellTemplate]="columnHeaderCellTemplate"
51
58
  [tableType]="tableType"
52
59
  [colIndex]="colIndex"
53
60
  [rowIndex]="rowIndex"
@@ -56,6 +63,8 @@ PivotGridTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
56
63
  [attr.id]="pivotGridId + (tableType === 'columnHeader' ? 'ch-' : 'rh-') + (rowIndex + 1) + '-' + (colIndex + 1)"></th>
57
64
  <td
58
65
  *ngIf="cell && tableType === 'values'"
66
+ [customCellTemplate]="customCellTemplate"
67
+ [valueCellTemplate]="valueCellTemplate"
59
68
  [kendoPivotGridCell]="cell"
60
69
  tableType="values"
61
70
  [colIndex]="colIndex"
@@ -66,7 +75,7 @@ PivotGridTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
66
75
  </tr>
67
76
  </tbody>
68
77
  </table>
69
- `, isInline: true, components: [{ type: i2.PivotGridCellDirective, selector: "[kendoPivotGridCell]", inputs: ["kendoPivotGridCell", "tableType", "rowIndex", "colIndex"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
78
+ `, isInline: true, components: [{ type: i2.PivotGridCellDirective, selector: "[kendoPivotGridCell]", inputs: ["kendoPivotGridCell", "tableType", "rowIndex", "colIndex", "customCellTemplate", "valueCellTemplate", "rowHeaderCellTemplate", "columnHeaderCellTemplate"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
70
79
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PivotGridTableComponent, decorators: [{
71
80
  type: Component,
72
81
  args: [{
@@ -88,6 +97,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
88
97
  <th
89
98
  *ngIf="cell && tableType !== 'values'"
90
99
  [kendoPivotGridCell]="cell"
100
+ [customCellTemplate]="customCellTemplate"
101
+ [rowHeaderCellTemplate]="rowHeaderCellTemplate"
102
+ [columnHeaderCellTemplate]="columnHeaderCellTemplate"
91
103
  [tableType]="tableType"
92
104
  [colIndex]="colIndex"
93
105
  [rowIndex]="rowIndex"
@@ -96,6 +108,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
96
108
  [attr.id]="pivotGridId + (tableType === 'columnHeader' ? 'ch-' : 'rh-') + (rowIndex + 1) + '-' + (colIndex + 1)"></th>
97
109
  <td
98
110
  *ngIf="cell && tableType === 'values'"
111
+ [customCellTemplate]="customCellTemplate"
112
+ [valueCellTemplate]="valueCellTemplate"
99
113
  [kendoPivotGridCell]="cell"
100
114
  tableType="values"
101
115
  [colIndex]="colIndex"
@@ -112,4 +126,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
112
126
  type: Input
113
127
  }], colWidth: [{
114
128
  type: Input
129
+ }], customCellTemplate: [{
130
+ type: Input
131
+ }], valueCellTemplate: [{
132
+ type: Input
133
+ }], rowHeaderCellTemplate: [{
134
+ type: Input
135
+ }], columnHeaderCellTemplate: [{
136
+ type: Input
115
137
  }] } });
@@ -0,0 +1,41 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2024 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, TemplateRef } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Represents the cell template of the PivotGrid.
9
+ * Helps to customize the content of the cells. To define the cell template, nest an `<ng-template>` tag with the
10
+ * `kendoPivotGridCellTemplate` directive inside a `<kendo-pivot-grid>` tag [see example](slug:templates_pivotgrid#toc-cell-template).
11
+ *
12
+ * The template context is set to the current cell item and the following additional fields are passed:
13
+ * - `cellItem`&mdash;The current cell item. Represents the default context that will be assigned to any template variable which utilizes the `let-x` syntax&mdash;for example, `let-cellItem`.
14
+ * - `columnIndex`&mdash;The current column index. Use it as an alias for a template variable by utilizing the `let-columnIndex="columnIndex"` syntax.
15
+ * - `rowIndex`&mdash;The current data row index. Use it as an alias for a template variable by utilizing the `let-rowIndex="rowIndex"` syntax.
16
+ * - `expanded`&mdash;The expanded state of the cell. Use it as an alias for a template variable by utilizing the `let-expanded="expanded"` syntax.
17
+ * - `tableType`&mdash;The table type. Use it as an alias for a template variable by utilizing the `let-tableType="tableType"` syntax.
18
+ * - `text`&mdash;The default cell text. Use it as an alias for a template variable by utilizing the `let-text="text"` syntax.
19
+ *
20
+ * @example
21
+ * ```html
22
+ * <kendo-pivot-grid [data]="data" ...>
23
+ * <ng-template kendoPivotGridCellTemplate let-cellItem let-rowIndex="rowIndex" let-column="column">
24
+ * Row: {{rowIndex}}
25
+ * </ng-template>
26
+ * </kendo-pivot-grid>
27
+ * ```
28
+ */
29
+ export class CellTemplateDirective {
30
+ constructor(templateRef) {
31
+ this.templateRef = templateRef;
32
+ }
33
+ }
34
+ CellTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CellTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
35
+ CellTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: CellTemplateDirective, selector: "[kendoPivotGridCellTemplate]", ngImport: i0 });
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CellTemplateDirective, decorators: [{
37
+ type: Directive,
38
+ args: [{
39
+ selector: '[kendoPivotGridCellTemplate]'
40
+ }]
41
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
@@ -0,0 +1,41 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2024 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, TemplateRef } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Represents the column header cell template of the PivotGrid.
9
+ * Helps to customize the content of the column header cells. To define the column header cell template, nest an `<ng-template>` tag with the
10
+ * `kendoPivotGridColumnHeaderCellTemplate` directive inside a `<kendo-pivot-grid>` tag [see example](slug:templates_pivotgrid#toc-column-header-cell-template).
11
+ *
12
+ * The template context is set to the current cell item and the following additional fields are passed:
13
+ * - `cellItem`&mdash;The current cell item. Represents the default context that will be assigned to any template variable which utilizes the `let-x` syntax&mdash;for example, `let-cellItem`.
14
+ * - `columnIndex`&mdash;The current column index. Use it as an alias for a template variable by utilizing the `let-columnIndex="columnIndex"` syntax.
15
+ * - `rowIndex`&mdash;The current data row index. Use it as an alias for a template variable by utilizing the `let-rowIndex="rowIndex"` syntax.
16
+ * - `expanded`&mdash;The expanded state of the cell. Use it as an alias for a template variable by utilizing the `let-expanded="expanded"` syntax.
17
+ * - `tableType`&mdash;The table type. Use it as an alias for a template variable by utilizing the `let-tableType="tableType"` syntax.
18
+ * - `text`&mdash;The default cell text. Use it as an alias for a template variable by utilizing the `let-text="text"` syntax.
19
+ *
20
+ * @example
21
+ * ```html
22
+ * <kendo-pivot-grid [data]="data" ...>
23
+ * <ng-template kendoPivotGridColumnHeaderCellTemplate let-cellItem let-rowIndex="rowIndex" let-column="column">
24
+ * Row: {{rowIndex}}
25
+ * </ng-template>
26
+ * </kendo-pivot-grid>
27
+ * ```
28
+ */
29
+ export class ColumnHeaderCellTemplateDirective {
30
+ constructor(templateRef) {
31
+ this.templateRef = templateRef;
32
+ }
33
+ }
34
+ ColumnHeaderCellTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColumnHeaderCellTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
35
+ ColumnHeaderCellTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: ColumnHeaderCellTemplateDirective, selector: "[kendoPivotGridColumnHeaderCellTemplate]", ngImport: i0 });
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColumnHeaderCellTemplateDirective, decorators: [{
37
+ type: Directive,
38
+ args: [{
39
+ selector: '[kendoPivotGridColumnHeaderCellTemplate]'
40
+ }]
41
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
@@ -0,0 +1,41 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2024 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, TemplateRef } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Represents the row header cell template of the PivotGrid.
9
+ * Helps to customize the content of the row header cells. To define the row header cell template, nest an `<ng-template>` tag with the
10
+ * `kendoPivotGridRowHeaderCellTemplate` directive inside a `<kendo-pivot-grid>` tag [see example](slug:templates_pivotgrid#toc-row-header-cell-template).
11
+ *
12
+ * The template context is set to the current cell item and the following additional fields are passed:
13
+ * - `cellItem`&mdash;The current cell item. Represents the default context that will be assigned to any template variable which utilizes the `let-x` syntax&mdash;for example, `let-cellItem`.
14
+ * - `columnIndex`&mdash;The current column index. Use it as an alias for a template variable by utilizing the `let-columnIndex="columnIndex"` syntax.
15
+ * - `rowIndex`&mdash;The current data row index. Use it as an alias for a template variable by utilizing the `let-rowIndex="rowIndex"` syntax.
16
+ * - `expanded`&mdash;The expanded state of the cell. Use it as an alias for a template variable by utilizing the `let-expanded="expanded"` syntax.
17
+ * - `tableType`&mdash;The table type. Use it as an alias for a template variable by utilizing the `let-tableType="tableType"` syntax.
18
+ * - `text`&mdash;The default cell text. Use it as an alias for a template variable by utilizing the `let-text="text"` syntax.
19
+ *
20
+ * @example
21
+ * ```html
22
+ * <kendo-pivot-grid [data]="data" ...>
23
+ * <ng-template kendoPivotGridRowHeaderCellTemplate let-cellItem let-rowIndex="rowIndex" let-column="column">
24
+ * Row: {{rowIndex}}
25
+ * </ng-template>
26
+ * </kendo-pivot-grid>
27
+ * ```
28
+ */
29
+ export class RowHeaderCellTemplateDirective {
30
+ constructor(templateRef) {
31
+ this.templateRef = templateRef;
32
+ }
33
+ }
34
+ RowHeaderCellTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: RowHeaderCellTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
35
+ RowHeaderCellTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: RowHeaderCellTemplateDirective, selector: "[kendoPivotGridRowHeaderCellTemplate]", ngImport: i0 });
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: RowHeaderCellTemplateDirective, decorators: [{
37
+ type: Directive,
38
+ args: [{
39
+ selector: '[kendoPivotGridRowHeaderCellTemplate]'
40
+ }]
41
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });