igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
131 lines (130 loc) • 5.53 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 } from "tslib";
import { FinancialChartDropDownControlView } from "./FinancialChartDropDownControlView";
import { markType, EnumUtil } from "igniteui-react-core";
import { FinancialChartVolumeType_$type } from "./FinancialChartVolumeType";
import { TrendLineType_$type } from "igniteui-react-core";
import { FinancialIndicatorType_$type } from "./FinancialIndicatorType";
import { FinancialOverlayType_$type } from "./FinancialOverlayType";
import { FinancialIndicatorTypeCollection } from "./FinancialIndicatorTypeCollection";
import { FinancialOverlayTypeCollection } from "./FinancialOverlayTypeCollection";
import { stringIsNullOrEmpty } from "igniteui-react-core";
/**
* @hidden
*/
var FinancialChartIndicatorMenuView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(FinancialChartIndicatorMenuView, _super);
function FinancialChartIndicatorMenuView() {
return _super !== null && _super.apply(this, arguments) || this;
}
FinancialChartIndicatorMenuView.prototype.f = function (a, b, c, d) {
_super.prototype.f.call(this, a, b, c, d);
};
FinancialChartIndicatorMenuView.prototype.k = function (a) {
_super.prototype.k.call(this, a);
var b = a;
if (b.tagName != "LI") {
return;
}
var c = b.parentNode.parentNode;
var d;
var e = false;
switch (c.getAttribute("data-value")) {
case "FinancialOverlayType":
d = FinancialOverlayType_$type;
e = false;
break;
case "TrendLineType":
d = TrendLineType_$type;
e = true;
break;
case "FinancialChartVolumeType":
d = FinancialChartVolumeType_$type;
e = true;
break;
default:
case "FinancialIndicatorType":
d = FinancialIndicatorType_$type;
e = false;
break;
}
var f = b.classList.toggle("checked");
var g = b.parentNode;
if (e) {
for (var h = 0; h < g.children.length; h++) {
var i = g.children.item(h);
if (i != b) {
i.classList.remove("checked");
}
}
var j_1 = f ? b.getAttribute("data-value") : "None";
if (stringIsNullOrEmpty(j_1)) {
return;
}
if (d == FinancialChartVolumeType_$type) {
var k_1;
if (((function () { var l = EnumUtil.tryParse$1(FinancialChartVolumeType_$type, j_1, true, k_1); k_1 = l.p2; return l.ret; })())) {
this.l.i = k_1;
}
}
else {
var l_1;
if (((function () { var m = EnumUtil.tryParse$1(TrendLineType_$type, j_1, true, l_1); l_1 = m.p2; return m.ret; })())) {
this.l.l = l_1;
}
}
}
else {
if (d == FinancialIndicatorType_$type) {
this.l.j = new FinancialIndicatorTypeCollection(0);
;
}
else {
this.l.k = new FinancialOverlayTypeCollection(0);
}
var _loop_1 = function (m) {
var n = g.children.item(m);
if (n.classList.contains("checked")) {
var o_1 = n.getAttribute("data-value");
if (stringIsNullOrEmpty(o_1)) {
return "continue";
}
if (d == FinancialIndicatorType_$type) {
var p_1;
if (((function () { var q = EnumUtil.tryParse$1(FinancialIndicatorType_$type, o_1, true, p_1); p_1 = q.p2; return q.ret; })())) {
var q = p_1;
this_1.l.j.add(q);
}
}
else {
var r_1;
if (((function () { var s = EnumUtil.tryParse$1(FinancialOverlayType_$type, o_1, true, r_1); r_1 = s.p2; return s.ret; })())) {
var s = r_1;
this_1.l.k.add(s);
}
}
}
};
var this_1 = this;
for (var m = 0; m < g.children.length; m++) {
_loop_1(m);
}
}
this.a.onSelectionChanged();
};
Object.defineProperty(FinancialChartIndicatorMenuView.prototype, "l", {
get: function () {
return this.a;
},
enumerable: false,
configurable: true
});
FinancialChartIndicatorMenuView.$t = markType(FinancialChartIndicatorMenuView, 'FinancialChartIndicatorMenuView', FinancialChartDropDownControlView.$);
return FinancialChartIndicatorMenuView;
}(FinancialChartDropDownControlView));
export { FinancialChartIndicatorMenuView };