igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
119 lines (118 loc) • 5.18 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 { 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
*/
export let FinancialChartIndicatorMenuView = /*@__PURE__*/ (() => {
class FinancialChartIndicatorMenuView extends FinancialChartDropDownControlView {
f(a, b, c, d) {
super.f(a, b, c, d);
}
k(a) {
super.k(a);
let b = a;
if (b.tagName != "LI") {
return;
}
let c = b.parentNode.parentNode;
let d;
let 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;
}
let f = b.classList.toggle("checked");
let g = b.parentNode;
if (e) {
for (let h = 0; h < g.children.length; h++) {
let i = g.children.item(h);
if (i != b) {
i.classList.remove("checked");
}
}
let j = f ? b.getAttribute("data-value") : "None";
if (stringIsNullOrEmpty(j)) {
return;
}
if (d == FinancialChartVolumeType_$type) {
let k;
if (((() => { let l = EnumUtil.tryParse$1(FinancialChartVolumeType_$type, j, true, k); k = l.p2; return l.ret; })())) {
this.l.i = k;
}
}
else {
let l;
if (((() => { let m = EnumUtil.tryParse$1(TrendLineType_$type, j, true, l); l = m.p2; return m.ret; })())) {
this.l.l = l;
}
}
}
else {
if (d == FinancialIndicatorType_$type) {
this.l.j = new FinancialIndicatorTypeCollection(0);
;
}
else {
this.l.k = new FinancialOverlayTypeCollection(0);
}
for (let m = 0; m < g.children.length; m++) {
let n = g.children.item(m);
if (n.classList.contains("checked")) {
let o = n.getAttribute("data-value");
if (stringIsNullOrEmpty(o)) {
continue;
}
if (d == FinancialIndicatorType_$type) {
let p;
if (((() => { let q = EnumUtil.tryParse$1(FinancialIndicatorType_$type, o, true, p); p = q.p2; return q.ret; })())) {
let q = p;
this.l.j.add(q);
}
}
else {
let r;
if (((() => { let s = EnumUtil.tryParse$1(FinancialOverlayType_$type, o, true, r); r = s.p2; return s.ret; })())) {
let s = r;
this.l.k.add(s);
}
}
}
}
}
this.a.onSelectionChanged();
}
get l() {
return this.a;
}
}
FinancialChartIndicatorMenuView.$t = /*@__PURE__*/ markType(FinancialChartIndicatorMenuView, 'FinancialChartIndicatorMenuView', FinancialChartDropDownControlView.$);
return FinancialChartIndicatorMenuView;
})();