igniteui-react-grids
Version:
Ignite UI React grid components.
90 lines (88 loc) • 2.87 kB
JavaScript
import { PrimaryKeyValue as PrimaryKeyValue_internal } from "./PrimaryKeyValue";
/**
* A primary key value.
*/
var IgrPrimaryKeyValue = /** @class */ /*@__PURE__*/ (function () {
function IgrPrimaryKeyValue(primaryKey, primaryKeyValue) {
if (primaryKey === void 0) {
primaryKey = null;
}
if (primaryKeyValue === void 0) {
primaryKeyValue = null;
}
this._implementation = new PrimaryKeyValue_internal(primaryKey, primaryKeyValue);
this._implementation.externalObject = this;
}
Object.defineProperty(IgrPrimaryKeyValue.prototype, "i", {
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgrPrimaryKeyValue.prototype.onImplementationCreated = function () {
};
IgrPrimaryKeyValue.prototype._provideImplementation = function (i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
};
IgrPrimaryKeyValue.createIdentityKey = function (item) {
var int = PrimaryKeyValue_internal.createIdentityKey(item);
var ext = new IgrPrimaryKeyValue(null, null);
ext._provideImplementation(int);
return ext;
};
Object.defineProperty(IgrPrimaryKeyValue.prototype, "key", {
/**
* The primary key associated with this value.
*/
get: function () {
return this.i.key;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.key = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrPrimaryKeyValue.prototype, "value", {
/**
* The value of the keys for this primary key value.
*/
get: function () {
return this.i.value;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.value = v;
},
enumerable: false,
configurable: true
});
IgrPrimaryKeyValue.prototype.findByName = function (name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
return null;
};
/**
* Determines if two primary key values are equal.
* @param other * The other key value to check against.
*/
IgrPrimaryKeyValue.prototype.equals = function (other) {
var iv = this.i.equals(other);
return (iv);
};
return IgrPrimaryKeyValue;
}());
export { IgrPrimaryKeyValue };