UNPKG

@progress/kendo-angular-pivotgrid

Version:
43 lines (42 loc) 2.85 kB
/**----------------------------------------------------------------------------------------- * 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 value cell template of the PivotGrid. * Helps to customize the content of the value cells. To define the value cell template, nest an `<ng-template>` tag with the * `kendoPivotGridValueCellTemplate` directive inside a `<kendo-pivot-grid>` tag [see example](slug:templates_pivotgrid#toc-value-cell-template). * * The template context is set to the current cell item and the following additional fields are passed: * - `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`. * - `columnIndex`&mdash;The current column index. Use it as an alias for a template variable by utilizing the `let-columnIndex="columnIndex"` syntax. * - `rowIndex`&mdash;The current data row index. Use it as an alias for a template variable by utilizing the `let-rowIndex="rowIndex"` syntax. * - `tableType`&mdash;The table type. Use it as an alias for a template variable by utilizing the `let-tableType="tableType"` syntax. * - `value`&mdash;The default cell value. Use it as an alias for a template variable by utilizing the `let-value="value"` syntax. * * @example * ```html * <kendo-pivot-grid [data]="data" ...> * <ng-template kendoPivotGridValueCellTemplate let-cellItem let-rowIndex="rowIndex" let-column="column"> * Row: {{rowIndex}} * </ng-template> * </kendo-pivot-grid> * ``` */ export class ValueCellTemplateDirective { templateRef; constructor(templateRef) { this.templateRef = templateRef; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ValueCellTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ValueCellTemplateDirective, isStandalone: true, selector: "[kendoPivotGridValueCellTemplate]", ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ValueCellTemplateDirective, decorators: [{ type: Directive, args: [{ selector: '[kendoPivotGridValueCellTemplate]', standalone: true }] }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });