@progress/kendo-angular-pivotgrid
Version:
PivotGrid package for Angular
44 lines (43 loc) • 2.93 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { Directive, TemplateRef } from '@angular/core';
import * as i0 from "@angular/core";
/**
* Represents the cell template of the PivotGrid.
* Helps to customize the content of the cells. To define the cell template, nest an `<ng-template>` tag with the
* `kendoPivotGridCellTemplate` directive inside a `<kendo-pivot-grid>` tag [see example](slug:templates_pivotgrid#toc-cell-template).
*
* The template context is set to the current cell item and the following additional fields are passed:
* - `cellItem`—The current cell item. Represents the default context that will be assigned to any template variable which utilizes the `let-x` syntax—for example, `let-cellItem`.
* - `columnIndex`—The current column index. Use it as an alias for a template variable by utilizing the `let-columnIndex="columnIndex"` syntax.
* - `rowIndex`—The current data row index. Use it as an alias for a template variable by utilizing the `let-rowIndex="rowIndex"` syntax.
* - `expanded`—The expanded state of the cell. Use it as an alias for a template variable by utilizing the `let-expanded="expanded"` syntax.
* - `tableType`—The table type. Use it as an alias for a template variable by utilizing the `let-tableType="tableType"` syntax.
* - `text`—The default cell text. Use it as an alias for a template variable by utilizing the `let-text="text"` syntax.
*
* @example
* ```html
* <kendo-pivot-grid [data]="data" ...>
* <ng-template kendoPivotGridCellTemplate let-cellItem let-rowIndex="rowIndex" let-column="column">
* Row: {{rowIndex}}
* </ng-template>
* </kendo-pivot-grid>
* ```
*/
export class CellTemplateDirective {
templateRef;
constructor(templateRef) {
this.templateRef = templateRef;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CellTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: CellTemplateDirective, isStandalone: true, selector: "[kendoPivotGridCellTemplate]", ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CellTemplateDirective, decorators: [{
type: Directive,
args: [{
selector: '[kendoPivotGridCellTemplate]',
standalone: true
}]
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });