UNPKG

@anglr/grid

Version:
40 lines 2.13 kB
import { Inject, Pipe } from '@angular/core'; import { DATA_CELL_CONTEXT_FN, GRID_INSTANCE, GRID_PLUGIN_INSTANCES } from '../../misc/tokens'; import * as i0 from "@angular/core"; /** * Obtains data cell context for template */ export class DataCellContextPipe { //######################### constructor ######################### constructor(factoryFn, grid, plugins) { this.factoryFn = factoryFn; this.grid = grid; this.plugins = plugins; } //######################### public methods - implementation of PipeTransform ######################### /** * Obtains data cell context for cell template * @param data - Data for row that is being rendered * @param index - Index of row for currently rendered cell * @param columnMetadata - Column metadata for rendered cell */ transform(data, index, columnMetadata) { return this.factoryFn(this.grid, this.plugins, data, index, columnMetadata); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: DataCellContextPipe, deps: [{ token: DATA_CELL_CONTEXT_FN }, { token: GRID_INSTANCE }, { token: GRID_PLUGIN_INSTANCES }], target: i0.ɵɵFactoryTarget.Pipe }); } static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.0", ngImport: i0, type: DataCellContextPipe, isStandalone: true, name: "dataCellContext" }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: DataCellContextPipe, decorators: [{ type: Pipe, args: [{ name: 'dataCellContext' }] }], ctorParameters: () => [{ type: undefined, decorators: [{ type: Inject, args: [DATA_CELL_CONTEXT_FN] }] }, { type: undefined, decorators: [{ type: Inject, args: [GRID_INSTANCE] }] }, { type: undefined, decorators: [{ type: Inject, args: [GRID_PLUGIN_INSTANCES] }] }] }); //# sourceMappingURL=dataCellContext.pipe.js.map