igniteui-webcomponents-grids
Version:
Ignite UI Web Components grid components.
107 lines (106 loc) • 3.44 kB
JavaScript
import { CellKey as CellKey_internal } from "./CellKey";
import { IgcPrimaryKeyValue } from './igc-primary-key-value';
import { IgcDataGridColumnComponent } from './igc-data-grid-column-component';
/**
* An indentifier for a specific cell in the grid.
*/
var IgcCellKey = /** @class */ /*@__PURE__*/ (function () {
function IgcCellKey() {
this._implementation = new CellKey_internal();
this._implementation.externalObject = this;
}
Object.defineProperty(IgcCellKey.prototype, "i", {
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcCellKey.prototype.onImplementationCreated = function () {
};
IgcCellKey.prototype._provideImplementation = function (i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
};
Object.defineProperty(IgcCellKey.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 IgcPrimaryKeyValue(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(IgcCellKey.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(IgcCellKey.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(IgcCellKey.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 = IgcDataGridColumnComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
},
enumerable: false,
configurable: true
});
IgcCellKey.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 IgcCellKey;
}());
export { IgcCellKey };