igniteui-react-core
Version:
Ignite UI React Core.
124 lines (123 loc) • 4.13 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 { __extends, __values } from "tslib";
import { Base, Number_$type, fromEnum, markType } from "./type";
import { List$1 } from "./List$1";
import { DataLegendSeriesValueInfo } from "./DataLegendSeriesValueInfo";
import { Dictionary$2 } from "./Dictionary$2";
import { DataLegendSeriesValueType_$type } from "./DataLegendSeriesValueType";
/**
* @hidden
*/
var DataLegendSeriesContext = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(DataLegendSeriesContext, _super);
function DataLegendSeriesContext() {
var _this = _super.call(this) || this;
_this.c = new Dictionary$2(DataLegendSeriesValueType_$type, DataLegendSeriesValueInfo.$, 0);
_this.h = null;
_this.d = null;
_this.e = new List$1(DataLegendSeriesValueInfo.$, 0);
return _this;
}
DataLegendSeriesContext.prototype.b = function (a) {
if (this.c.containsKey(a)) {
return this.c.item(a);
}
return null;
};
DataLegendSeriesContext.prototype.f = function (a) {
if (this.c.containsKey(a)) {
return this.c.item(a).l;
}
return NaN;
};
DataLegendSeriesContext.prototype.k = function (a, b) {
var c = null;
if (!this.c.containsKey(a)) {
c = new DataLegendSeriesValueInfo();
c.a = a;
this.i(c);
}
c.l = b;
};
DataLegendSeriesContext.prototype.l = function (a, b) {
var c = b;
if (this.c.containsKey(a)) {
this.j(a);
}
c.a = a;
this.i(c);
};
DataLegendSeriesContext.prototype.j = function (a) {
if (this.c.containsKey(a)) {
var b = this.c.item(a);
this.e.remove(b);
this.c.removeItem(a);
}
};
DataLegendSeriesContext.prototype.i = function (a) {
var b = false;
if (a.o == -1) {
b = true;
a.o = this.g();
}
this.c.item(a.a, a);
this.e.add(a);
if (!b) {
this.e.aa(function (c, d) { return c.o - d.o; });
}
};
DataLegendSeriesContext.prototype.g = function () {
var a = -1;
for (var b = 0; b < this.e.count; b++) {
a = Math.max(a, this.e._inner[b].o);
}
return a + 1;
};
Object.defineProperty(DataLegendSeriesContext.prototype, "e", {
get: function () {
return this.d;
},
set: function (a) {
this.d = a;
this.c.clear();
for (var b = 0; b < this.d.count; b++) {
this.d._inner[b].o = b;
this.c.item(this.d._inner[b].a, this.d._inner[b]);
}
},
enumerable: false,
configurable: true
});
DataLegendSeriesContext.prototype.a = function () {
var e_1, _a;
var a = new List$1(Number_$type, 0);
try {
for (var _b = __values(fromEnum(this.e)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
a.add(b.l);
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_1)
throw e_1.error;
}
}
return a.toArray();
};
DataLegendSeriesContext.$t = markType(DataLegendSeriesContext, 'DataLegendSeriesContext');
return DataLegendSeriesContext;
}(Base));
export { DataLegendSeriesContext };