igniteui-react-grids
Version:
Ignite UI React grid components.
263 lines (262 loc) • 8.43 kB
JavaScript
import { IgrGridCellIdentifier } from "./igr-grid-cell-identifier";
import { IgrColumn } from "./igr-column";
import { GridEditEventArgsDetail as GridEditEventArgsDetail_internal } from "./GridEditEventArgsDetail";
import { ensureBool } from "igniteui-react-core";
/**
* Represents event arguments related to grid editing.
* The event is cancelable
* It contains information about the row and the column, as well as the old and nwe value of the element/cell
*/
var IgrGridEditEventArgsDetail = /** @class */ /*@__PURE__*/ (function () {
function IgrGridEditEventArgsDetail() {
this.mounted = false;
this._implementation = this.createImplementation();
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
}
IgrGridEditEventArgsDetail.prototype.createImplementation = function () {
return new GridEditEventArgsDetail_internal();
};
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "nativeElement", {
get: function () {
return this._implementation.nativeElement;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgrGridEditEventArgsDetail.prototype.onImplementationCreated = function () {
};
IgrGridEditEventArgsDetail.prototype._provideImplementation = function (i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
};
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "cancel", {
/**
* Provides the ability to cancel the event.
*/
get: function () {
return this.i.f;
},
set: function (v) {
this.i.f = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "rowID", {
/**
* @deprecated Use the `rowKey` property instead.
*/
get: function () {
return this.i.o;
},
set: function (v) {
this.i.o = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "primaryKey", {
/**
* @deprecated Use the `rowKey` property instead.
*/
get: function () {
return this.i.m;
},
set: function (v) {
this.i.m = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "rowKey", {
get: function () {
return this.i.p;
},
set: function (v) {
this.i.p = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "cellID", {
get: function () {
var r = this.i.c;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = new IgrGridCellIdentifier();
if (r.$type) {
e._implementation = r;
}
else {
if (e.i.setNativeElement) {
e.i.setNativeElement(r);
}
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
v == null ? this.i.c = null : this.i.c = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "rowData", {
/**
* `rowData` represents the updated/committed data of the row after the edit (newValue)
* The only case rowData (of the current object) is used directly, is when there is no rowEditing or transactions enabled
*/
get: function () {
return this.i.n;
},
set: function (v) {
this.i.n = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "oldValue", {
/**
* Represents the previous (before editing) value of the edited cell.
* It's used when the event has been stopped/exited.
*/
get: function () {
return this.i.l;
},
set: function (v) {
this.i.l = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "newValue", {
/**
* Optional
* Represents the value, that is being entered in the edited cell
* When there is no `newValue` and the event has ended, the value of the cell returns to the `oldValue`
*/
get: function () {
return this.i.k;
},
set: function (v) {
this.i.k = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "column", {
/**
* Optional
* Represents the column information of the edited cell
*/
get: function () {
var r = this.i.a;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgrColumn._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
v == null ? this.i.a = null : this.i.a = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "owner", {
/**
* Optional
* Represents the grid instance that owns the edit event.
*/
get: function () {
var r = this.i.b;
if (r == null) {
return null;
}
return r.externalObject;
},
set: function (v) {
v == null ? this.i.b = null : this.i.b = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "isAddRow", {
/**
* Optional
* Indicates if the editing consists of adding a new row
*/
get: function () {
return this.i.g;
},
set: function (v) {
this.i.g = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrGridEditEventArgsDetail.prototype, "valid", {
/**
* Optional
* Indicates if the new value would be valid.
* It can be set to return the result of the methods for validation of the grid
*/
get: function () {
return this.i.h;
},
set: function (v) {
this.i.h = ensureBool(v);
},
enumerable: false,
configurable: true
});
IgrGridEditEventArgsDetail.prototype.findByName = function (name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
if (this.cellID && this.cellID.name && this.cellID.name == name) {
return this.cellID;
}
if (this.column && this.column.name && this.column.name == name) {
return this.column;
}
if (this.owner && this.owner.name && this.owner.name == name) {
return this.owner;
}
return null;
};
IgrGridEditEventArgsDetail.prototype.setNativeElement = function (element) {
this.i.setNativeElement(element);
};
return IgrGridEditEventArgsDetail;
}());
export { IgrGridEditEventArgsDetail };