igniteui-react-grids
Version:
Ignite UI React grid components.
112 lines (111 loc) • 3.98 kB
JavaScript
import { TemplateCellUpdatingEventArgs as TemplateCellUpdatingEventArgs_internal } from "./TemplateCellUpdatingEventArgs";
import { IgrDateTimeCellInfo } from "./igr-date-time-cell-info";
import { IgrImageCellInfo } from "./igr-image-cell-info";
import { IgrNumericCellInfo } from "./igr-numeric-cell-info";
import { IgrRowSeparatorInfo } from "./igr-row-separator-info";
import { IgrSectionHeaderCellInfo } from "./igr-section-header-cell-info";
import { IgrTemplateCellInfo } from "./igr-template-cell-info";
import { IgrTemplateHeaderCellInfo } from "./igr-template-header-cell-info";
import { IgrTemplateSectionHeaderCellInfo } from "./igr-template-section-header-cell-info";
import { IgrTextCellInfo } from "./igr-text-cell-info";
import { IgrTextHeaderCellInfo } from "./igr-text-header-cell-info";
/**
* Information about the cell that has content which is being created or updated.
*/
export class IgrTemplateCellUpdatingEventArgs {
createImplementation() {
return new TemplateCellUpdatingEventArgs_internal();
}
get i() {
return this._implementation;
}
onImplementationCreated() {
}
constructor() {
this._implementation = this.createImplementation();
this._implementation.externalObject = this;
this.onImplementationCreated();
}
_provideImplementation(i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
}
get isCanvasBased() {
return this.i.content.isCanvasBased;
}
/**
* The host in which to add or update content if this is a DOM based cell.
*/
get content() {
if (this.isCanvasBased) {
return null;
}
else {
return this.i.content.element.getNativeElement();
}
}
ensureCorrectSize() {
return this.i.content.ensureCorrectSize();
}
get context() {
if (this.isCanvasBased) {
return this.i.content.templateContext;
}
else {
return null;
}
}
renderStandardBackground() {
this.i.content.renderStandardBackground();
}
renderStandardContent() {
this.i.content.renderStandardContent();
}
/**
* The backing information for the current cell.
*/
get cellInfo() {
if (this.i.cellInfo == null) {
return null;
}
if (!this.i.cellInfo.externalObject) {
let ext = null;
switch (this.i.cellInfo.$type.name) {
case "DateTimeCellModel":
ext = new IgrDateTimeCellInfo();
break;
case "ImageCellModel":
ext = new IgrImageCellInfo();
break;
case "NumericCellModel":
ext = new IgrNumericCellInfo();
break;
case "RowSeparatorModel":
ext = new IgrRowSeparatorInfo();
break;
case "SectionHeaderCellModel":
ext = new IgrSectionHeaderCellInfo();
break;
case "TemplateCellModel":
ext = new IgrTemplateCellInfo();
break;
case "TemplateHeaderCellModel":
ext = new IgrTemplateHeaderCellInfo();
break;
case "TemplateSectionHeaderCellModel":
ext = new IgrTemplateSectionHeaderCellInfo();
break;
case "TextCellModel":
ext = new IgrTextCellInfo();
break;
case "TextHeaderCellModel":
ext = new IgrTextHeaderCellInfo();
break;
}
ext._implementation = this.i.cellInfo;
this.i.cellInfo.externalObject = ext;
}
return this.i.cellInfo.externalObject;
}
}