igniteui-react-grids
Version:
Ignite UI React grid components.
84 lines (83 loc) • 2.22 kB
JavaScript
import { IgrCellType } from "./igr-cell-type";
import { CellTemplateContext as CellTemplateContext_internal } from "./CellTemplateContext";
export class IgrCellTemplateContext {
createImplementation() {
return new CellTemplateContext_internal();
}
get nativeElement() {
return this._implementation.nativeElement;
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
onImplementationCreated() {
}
constructor() {
this.mounted = false;
this._implementation = this.createImplementation();
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
}
_provideImplementation(i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
}
get implicit() {
return this.i.f;
}
set implicit(v) {
this.i.f = v;
}
get additionalTemplateContext() {
return this.i.e;
}
set additionalTemplateContext(v) {
this.i.e = v;
}
get cell() {
const r = this.i.a;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = new IgrCellType();
if (r.$type) {
e._implementation = r;
}
else {
if (e.i.setNativeElement) {
e.i.setNativeElement(r);
}
}
r.externalObject = e;
}
return r.externalObject;
}
set cell(v) {
v == null ? this.i.a = null : this.i.a = v.i;
}
findByName(name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
if (this.cell && this.cell.name && this.cell.name == name) {
return this.cell;
}
return null;
}
setNativeElement(element) {
this.i.setNativeElement(element);
}
}