igniteui-react-grids
Version:
Ignite UI React grid components.
88 lines (87 loc) • 2.71 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Base, markType } from "igniteui-react-core";
/**
* @hidden
*/
export let PrimaryKeyValue = /*@__PURE__*/ (() => {
class PrimaryKeyValue extends Base {
get key() {
return this.a;
}
set key(a) {
this.a = a;
}
get value() {
return this.b;
}
set value(a) {
this.b = a;
}
constructor(a, b) {
super();
this.a = null;
this.b = null;
this.a = a;
this.b = b;
}
static createIdentityKey(a) {
return new PrimaryKeyValue(null, [a]);
}
equals(a) {
let b = a;
if (b == null) {
return false;
}
if (b.b == null && this.b == null) {
return true;
}
if (b.b.length != this.b.length) {
return false;
}
if (this.a == null && b.a == null && this.b.length == 1 && b.b.length == 1) {
let v1_ = this.b[0];
let v2_ = b.b[0];
return this.f(v1_, v2_);
}
for (let c = 0; c < this.b.length; c++) {
if (!this.f(this.b[c], b.b[c])) {
return false;
}
}
return true;
}
f(a, b) {
if (a == null && b == null) {
return true;
}
if (a == null && b != null) {
return false;
}
return Base.equalsStatic(a, b);
}
getHashCode() {
if (this.b == null || this.b.length == 0) {
return 0;
}
let a = 0;
a = this.i(this.b[0]);
for (let b = 1; b < this.b.length; b++) {
a = a * 17 + this.i(this.b[b]);
}
return a;
}
i(val_) {
if (val_ == null) {
return 0;
}
return Base.getHashCodeStatic(val_);
}
}
PrimaryKeyValue.$t = /*@__PURE__*/ markType(PrimaryKeyValue, 'PrimaryKeyValue');
return PrimaryKeyValue;
})();