@anglr/grid
Version:
Angular module displaying grid
52 lines • 5.11 kB
JavaScript
import { Component, ChangeDetectionStrategy, ChangeDetectorRef, Optional, Inject, ElementRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { BodyContentRendererAbstractComponent } from '../../../bodyContentRendererAbstract.component';
import { BODY_CONTENT_RENDERER_OPTIONS, GRID_PLUGIN_INSTANCES } from '../../../../../../misc/tokens';
import { DataCellContextPipe, ReadValuePipe } from '../../../../../../pipes';
import { provideDataCellContextFactoryFn } from '../../../../../../misc/providers';
import { dataCellContextFactory } from '../../../../../../misc/utils';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
/**
* Default options for 'TableBodyContentRendererComponent'
*/
const defaultOptions = {
rowClick: null,
rowCssClass: null,
cssClasses: {},
};
/**
* Component used for rendering tbody for 'TableContentRenderer'
* @deprecated use new MatrixGrid with MatrixContentRenderer instead
*/
export class TableBodyContentRendererComponent extends BodyContentRendererAbstractComponent {
//######################### constructor #########################
constructor(pluginElement, changeDetector, gridPlugins, options) {
super(pluginElement, changeDetector, gridPlugins, defaultOptions, options);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: TableBodyContentRendererComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: GRID_PLUGIN_INSTANCES, optional: true }, { token: BODY_CONTENT_RENDERER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.0", type: TableBodyContentRendererComponent, isStandalone: true, selector: "tbody.content-renderer", providers: [
provideDataCellContextFactoryFn(dataCellContextFactory),
], usesInheritance: true, ngImport: i0, template: "@for(datum of data; track datum; let index=$index)\r\n{\r\n <tr [ngClass]=\"options.rowCssClass?.(datum)\" (click)=\"options.rowClick?.(datum, index)\">\r\n @for(meta of metadata?.columns; track meta)\r\n {\r\n <td [ngClass]=\"meta?.cellClass\"\r\n [attr.data-header-title]=\"meta?.title\">\r\n\r\n @if(meta?.bodyTemplate)\r\n {\r\n <ng-container *ngTemplateOutlet=\"meta?.bodyTemplate ?? null; context: datum | dataCellContext: index : meta\"/>\r\n }\r\n @else\r\n {\r\n {{datum | readValue: meta?.name}}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n}", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: ReadValuePipe, name: "readValue" }, { kind: "pipe", type: DataCellContextPipe, name: "dataCellContext" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: TableBodyContentRendererComponent, decorators: [{
type: Component,
args: [{ selector: 'tbody.content-renderer', imports: [
CommonModule,
ReadValuePipe,
DataCellContextPipe,
], providers: [
provideDataCellContextFactoryFn(dataCellContextFactory),
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@for(datum of data; track datum; let index=$index)\r\n{\r\n <tr [ngClass]=\"options.rowCssClass?.(datum)\" (click)=\"options.rowClick?.(datum, index)\">\r\n @for(meta of metadata?.columns; track meta)\r\n {\r\n <td [ngClass]=\"meta?.cellClass\"\r\n [attr.data-header-title]=\"meta?.title\">\r\n\r\n @if(meta?.bodyTemplate)\r\n {\r\n <ng-container *ngTemplateOutlet=\"meta?.bodyTemplate ?? null; context: datum | dataCellContext: index : meta\"/>\r\n }\r\n @else\r\n {\r\n {{datum | readValue: meta?.name}}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n}" }]
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
type: Inject,
args: [GRID_PLUGIN_INSTANCES]
}, {
type: Optional
}] }, { type: undefined, decorators: [{
type: Inject,
args: [BODY_CONTENT_RENDERER_OPTIONS]
}, {
type: Optional
}] }] });
//# sourceMappingURL=tableBodyContentRenderer.component.js.map