igniteui-react-grids
Version:
Ignite UI React grid components.
107 lines (106 loc) • 3.41 kB
JavaScript
import { CellKey as CellKey_internal } from "./CellKey";
import { IgrPrimaryKeyValue } from './igr-primary-key-value';
import { IgrDataGridColumn } from './igr-data-grid-column';
/**
* An indentifier for a specific cell in the grid.
*/
var IgrCellKey = /** @class */ /*@__PURE__*/ (function () {
function IgrCellKey() {
this._implementation = new CellKey_internal();
this._implementation.externalObject = this;
}
Object.defineProperty(IgrCellKey.prototype, "i", {
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgrCellKey.prototype.onImplementationCreated = function () {
};
IgrCellKey.prototype._provideImplementation = function (i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
};
Object.defineProperty(IgrCellKey.prototype, "primaryKey", {
/**
* Gets or sets the primary key of the row associated with the cell.
*/
get: function () {
if (this.i.primaryKey == null) {
return null;
}
if (!this._primaryKey) {
this._primaryKey = new IgrPrimaryKeyValue(this.i.primaryKey.key, this.i.primaryKey.value);
}
return this._primaryKey;
},
set: function (v) {
this.i.primaryKey = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrCellKey.prototype, "rowItem", {
/**
* Gets or sets the row data object associated with the cell.
*/
get: function () {
return this.i.h;
},
set: function (v) {
this.i.h = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrCellKey.prototype, "columnUniqueKey", {
/**
* Gets or sets the column name associated with the cell.
* All columns in the grid must have a unique name. That unique name is what is used for this property.
*/
get: function () {
return this.i.j;
},
set: function (v) {
this.i.j = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrCellKey.prototype, "resolvedColumn", {
/**
* Gets or sets the resolved column object associated with this cell.
*/
get: function () {
var r = this.i.b;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgrDataGridColumn._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
},
enumerable: false,
configurable: true
});
IgrCellKey.prototype.findByName = function (name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
if (this.primaryKey && this.primaryKey.name && this.primaryKey.name == name) {
return this.primaryKey;
}
return null;
};
return IgrCellKey;
}());
export { IgrCellKey };