igniteui-react-grids
Version:
Ignite UI React grid components.
203 lines (202 loc) • 6.13 kB
JavaScript
import { __extends } from "tslib";
import { IgrCellInfo } from "./igr-cell-info";
import { DataSourceSchemaPropertyType_$type } from "igniteui-react-core";
import { EditorType_$type } from "./EditorType";
import { EditorCellModel as EditorCellModel_internal } from "./EditorCellModel";
import { ensureBool, ensureEnum } from "igniteui-react-core";
/**
* Represents info about the current cell.
*/
var IgrEditorCellInfo = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrEditorCellInfo, _super);
function IgrEditorCellInfo() {
return _super.call(this) || this;
}
IgrEditorCellInfo.prototype.createImplementation = function () {
return new EditorCellModel_internal();
};
Object.defineProperty(IgrEditorCellInfo.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrEditorCellInfo.prototype, "isHidden", {
/**
* Gets whether the editor cell is hidden or not.
*/
get: function () {
return this.i.mr;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrEditorCellInfo.prototype, "editTarget", {
/**
* Gets or sets the edit target for this cell.
*/
get: function () {
var r = this.i.mk;
if (r == null) {
return null;
}
return r.externalObject;
},
set: function (v) {
v == null ? this.i.mk = null : this.i.mk = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrEditorCellInfo.prototype, "dataType", {
/**
* Gets or sets the data type associated with the cell being edited.
*/
get: function () {
return this.i.mi;
},
set: function (v) {
this.i.mi = ensureEnum(DataSourceSchemaPropertyType_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrEditorCellInfo.prototype, "errorMessage", {
/**
* Gets or sets the error message to display in the editor cell.
*/
get: function () {
return this.i.nn;
},
set: function (v) {
this.i.nn = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrEditorCellInfo.prototype, "editValue", {
/**
* Gets or sets the user selected value.
*/
get: function () {
return this.i.na;
},
set: function (v) {
this.i.na = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrEditorCellInfo.prototype, "editorType", {
/**
* Gets or sets the type of editor to use while cell editing.
*/
get: function () {
return this.i.mm;
},
set: function (v) {
this.i.mm = ensureEnum(EditorType_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrEditorCellInfo.prototype, "editorDataSource", {
/**
* Gets or sets the data source to use for the editor where it makes sense.
*/
get: function () {
return this.i.m9;
},
set: function (v) {
this.i.m9 = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrEditorCellInfo.prototype, "editorTextField", {
/**
* Gets or sets the editors display member.
*/
get: function () {
return this.i.ni;
},
set: function (v) {
this.i.ni = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrEditorCellInfo.prototype, "editorValueField", {
/**
* Gets or sets the editors value member.
*/
get: function () {
return this.i.mg;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.mg = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrEditorCellInfo.prototype, "dateFormatString", {
get: function () {
return this.i.nf;
},
set: function (v) {
this.i.nf = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrEditorCellInfo.prototype, "showTodayButton", {
get: function () {
return this.i.ms;
},
set: function (v) {
this.i.ms = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrEditorCellInfo.prototype, "targetRow", {
/**
* Gets the row index that the editor cell is targeting for edit.
*/
get: function () {
return this.i.m7;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrEditorCellInfo.prototype, "targetColumn", {
/**
* Gets the column index that the editor cell is targeting for edit.
*/
get: function () {
return this.i.m6;
},
enumerable: false,
configurable: true
});
IgrEditorCellInfo.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.editTarget && this.editTarget.name && this.editTarget.name == name) {
return this.editTarget;
}
return null;
};
return IgrEditorCellInfo;
}(IgrCellInfo));
export { IgrEditorCellInfo };