igniteui-react-grids
Version:
Ignite UI React grid components.
117 lines (116 loc) • 3.2 kB
JavaScript
import { IgrCellType } from "./igr-cell-type";
import { IgrRowType } from "./igr-row-type";
import { GridContextMenuEventArgsDetail as GridContextMenuEventArgsDetail_internal } from "./GridContextMenuEventArgsDetail";
/**
* Represents an event argument for the grid contextMenu output
*/
export class IgrGridContextMenuEventArgsDetail {
createImplementation() {
return new GridContextMenuEventArgsDetail_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();
}
}
/**
* Represents the grid cell that triggered the event.
*/
get cell() {
const r = this.i.b;
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.b = null : this.i.b = v.i;
}
/**
* Represents the original event that occurred
* Examples of such events include: selecting, clicking, double clicking, etc.
*/
get event() {
return this.i.g;
}
set event(v) {
this.i.g = v;
}
/**
* Represents the grid row that triggered the event.
*/
get row() {
const r = this.i.c;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = new IgrRowType();
if (r.$type) {
e._implementation = r;
}
else {
if (e.i.setNativeElement) {
e.i.setNativeElement(r);
}
}
r.externalObject = e;
}
return r.externalObject;
}
set row(v) {
v == null ? this.i.c = null : this.i.c = 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;
}
if (this.row && this.row.name && this.row.name == name) {
return this.row;
}
return null;
}
setNativeElement(element) {
this.i.setNativeElement(element);
}
}