@anglr/grid
Version:
Angular module displaying grid
75 lines • 5.24 kB
JavaScript
import { Component, ChangeDetectionStrategy, Inject, Optional, HostBinding, forwardRef, ElementRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CommonDynamicModule } from '@anglr/common';
import { BodyHeaderContentRendererAbstractComponent } from '../bodyHeaderContentRendererAbstract.component';
import { CONTENT_RENDERER_OPTIONS, GRID_PLUGIN_INSTANCES } from '../../../../misc/tokens';
import { TableBodyContentRendererComponent } from './body/basic/tableBodyContentRenderer.component';
import { TableHeaderContentRendererComponent } from './header/basic/tableHeaderContentRenderer.component';
import { ResolveForwardRefPipe } from '../../../../pipes';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@anglr/common";
/**
* Default options for 'TableContentRendererComponent'
*/
const defaultOptions = {
cssClasses: {
table: 'table table-condensed table-striped table-hover',
containerDiv: 'table-container'
},
plugins: {
bodyRenderer: {
type: forwardRef(() => TableBodyContentRendererComponent),
instance: null,
instanceCallback: null,
options: null,
},
headerRenderer: {
type: forwardRef(() => TableHeaderContentRendererComponent),
instance: null,
instanceCallback: null,
options: null,
}
}
};
/**
* Component used for 'TableContentRendererComponent'
* @deprecated use new MatrixGrid with MatrixContentRenderer instead
*/
export class TableContentRendererComponent extends BodyHeaderContentRendererAbstractComponent {
//######################### public properties - hosts #########################
/**
* Css class applied to grid itself
*/
get cssClass() {
return this.ɵoptions.cssClasses.containerDiv;
}
//######################### constructor #########################
constructor(pluginElement, gridPlugins, options) {
super(pluginElement, gridPlugins, defaultOptions, options);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: TableContentRendererComponent, deps: [{ token: i0.ElementRef }, { token: GRID_PLUGIN_INSTANCES, optional: true }, { token: CONTENT_RENDERER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.0", type: TableContentRendererComponent, isStandalone: true, selector: "div.table-content-renderer", host: { properties: { "class": "this.cssClass" } }, usesInheritance: true, ngImport: i0, template: "<table [ngClass]=\"options.cssClasses.table\">\r\n <ng-template [ngComponentOutletEx]=\"options.plugins.headerRenderer.type | resolveForwardRef\" (ngComponentOutletExCreated)=\"setHeaderRendererComponent($event)\"></ng-template>\r\n <ng-template [ngComponentOutletEx]=\"options.plugins.bodyRenderer.type | resolveForwardRef\" (ngComponentOutletExCreated)=\"setBodyRendererComponent($event)\"></ng-template>\r\n</table>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: CommonDynamicModule }, { kind: "directive", type: i2.NgComponentOutletEx, selector: "[ngComponentOutletEx]", inputs: ["ngComponentOutletEx", "ngComponentOutletExInjector", "ngComponentOutletExContent"], outputs: ["ngComponentOutletExCreated"], exportAs: ["ngComponentOutletEx"] }, { kind: "pipe", type: ResolveForwardRefPipe, name: "resolveForwardRef" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0", ngImport: i0, type: TableContentRendererComponent, decorators: [{
type: Component,
args: [{ selector: 'div.table-content-renderer', imports: [
CommonModule,
CommonDynamicModule,
ResolveForwardRefPipe,
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<table [ngClass]=\"options.cssClasses.table\">\r\n <ng-template [ngComponentOutletEx]=\"options.plugins.headerRenderer.type | resolveForwardRef\" (ngComponentOutletExCreated)=\"setHeaderRendererComponent($event)\"></ng-template>\r\n <ng-template [ngComponentOutletEx]=\"options.plugins.bodyRenderer.type | resolveForwardRef\" (ngComponentOutletExCreated)=\"setBodyRendererComponent($event)\"></ng-template>\r\n</table>" }]
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{
type: Inject,
args: [GRID_PLUGIN_INSTANCES]
}, {
type: Optional
}] }, { type: undefined, decorators: [{
type: Inject,
args: [CONTENT_RENDERER_OPTIONS]
}, {
type: Optional
}] }], propDecorators: { cssClass: [{
type: HostBinding,
args: ['class']
}] } });
//# sourceMappingURL=tableContentRenderer.component.js.map