UNPKG

@anglr/grid

Version:
39 lines 2.01 kB
import { Inject, Pipe } from '@angular/core'; import { CELL_CONTEXT_FN, GRID_INSTANCE, GRID_PLUGIN_INSTANCES } from '../../misc/tokens'; import * as i0 from "@angular/core"; /** * Obtains cell context for template */ export class CellContextPipe { //######################### constructor ######################### constructor(factoryFn, grid, plugins) { this.factoryFn = factoryFn; this.grid = grid; this.plugins = plugins; } //######################### public methods - implementation of PipeTransform ######################### /** * Obtains cell context for cell template * @param columnMetadata - Column metadata for rendered cell * @param index - Index of row for currently rendered cell */ transform(columnMetadata, index) { return this.factoryFn(this.grid, this.plugins, index, columnMetadata); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: CellContextPipe, deps: [{ token: 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: CellContextPipe, isStandalone: true, name: "cellContext" }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: CellContextPipe, decorators: [{ type: Pipe, args: [{ name: 'cellContext' }] }], ctorParameters: () => [{ type: undefined, decorators: [{ type: Inject, args: [CELL_CONTEXT_FN] }] }, { type: undefined, decorators: [{ type: Inject, args: [GRID_INSTANCE] }] }, { type: undefined, decorators: [{ type: Inject, args: [GRID_PLUGIN_INSTANCES] }] }] }); //# sourceMappingURL=cellContext.pipe.js.map