igniteui-webcomponents-grids
Version:
Ignite UI Web Components grid components.
138 lines (137 loc) • 4.38 kB
JavaScript
import { IgcDataGridColumnComponent } from './igc-data-grid-column-component';
import { GridCellValueChangingEventArgs as GridCellValueChangingEventArgs_internal } from "./GridCellValueChangingEventArgs";
import { IgcDateTimeCellInfo } from "./igc-date-time-cell-info";
import { IgcImageCellInfo } from "./igc-image-cell-info";
import { IgcNumericCellInfo } from "./igc-numeric-cell-info";
import { IgcRowSeparatorInfo } from "./igc-row-separator-info";
import { IgcSectionHeaderCellInfo } from "./igc-section-header-cell-info";
import { IgcTemplateCellInfo } from "./igc-template-cell-info";
import { IgcTemplateHeaderCellInfo } from "./igc-template-header-cell-info";
import { IgcTemplateSectionHeaderCellInfo } from "./igc-template-section-header-cell-info";
import { IgcTextCellInfo } from "./igc-text-cell-info";
import { IgcTextHeaderCellInfo } from "./igc-text-header-cell-info";
/**
* Event arguments for the CellValueChanging event
*/
export class IgcGridCellValueChangingEventArgs {
createImplementation() {
return new GridCellValueChangingEventArgs_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();
}
/**
* 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 IgcDateTimeCellInfo();
break;
case "ImageCellModel":
ext = new IgcImageCellInfo();
break;
case "NumericCellModel":
ext = new IgcNumericCellInfo();
break;
case "RowSeparatorModel":
ext = new IgcRowSeparatorInfo();
break;
case "SectionHeaderCellModel":
ext = new IgcSectionHeaderCellInfo();
break;
case "TemplateCellModel":
ext = new IgcTemplateCellInfo();
break;
case "TemplateHeaderCellModel":
ext = new IgcTemplateHeaderCellInfo();
break;
case "TemplateSectionHeaderCellModel":
ext = new IgcTemplateSectionHeaderCellInfo();
break;
case "TextCellModel":
ext = new IgcTextCellInfo();
break;
case "TextHeaderCellModel":
ext = new IgcTextHeaderCellInfo();
break;
}
ext._implementation = this.i.cellInfo;
this.i.cellInfo.externalObject = ext;
}
return this.i.cellInfo.externalObject;
}
/**
* Gets the edit ID for this value change.
*/
get editID() {
return this.i.c;
}
set editID(v) {
this.i.c = +v;
}
/**
* Gets the column the cell belongs to.
*/
get column() {
const r = this.i.b;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgcDataGridColumnComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
set column(v) {
v == null ? this.i.b = null : this.i.b = v.i;
}
/**
* Gets the row item associated with the change.
*/
get item() {
return this.i.item;
}
set item(v) {
this.i.item = v;
}
/**
* Gets the old cell value.
*/
get oldValue() {
return this.i.f;
}
set oldValue(v) {
this.i.f = v;
}
/**
* Gets the new cell value.
*/
get newValue() {
return this.i.e;
}
set newValue(v) {
this.i.e = v;
}
}