UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

67 lines (66 loc) 2.6 kB
/* 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, Number_$type, String_$type, markType } from "igniteui-react-core"; import { Dictionary$2 } from "igniteui-react-core"; /** * @hidden */ export let DataSourceManager = /*@__PURE__*/ (() => { class DataSourceManager extends Base { constructor() { super(); this.d = null; this.c = null; this.b = null; this.a = null; this.d = new Dictionary$2(Base.$, Base.$, 0); this.c = new Dictionary$2(Base.$, Base.$, 0); this.b = new Dictionary$2(Base.$, Number_$type, 0); this.a = new Dictionary$2(String_$type, Base.$, 0); } e(target_, dataSource_) { if (this.d.containsKey(target_)) { this.f(target_); } this.d.addItem(target_, dataSource_); let arr_ = dataSource_.dataView(); if (this.c.containsKey(arr_)) { this.c.removeItem(arr_); } this.c.addItem(arr_, dataSource_); let a = (dataSource_.id); if (this.a.containsKey(a)) { this.a.removeItem(a); } this.a.addItem(a, dataSource_); if (!this.b.containsKey(dataSource_)) { this.b.addItem(dataSource_, 1); } else { this.b.item(dataSource_, this.b.item(dataSource_) + 1); } target_.itemsSource(arr_); } f(target_) { let curr_ = target_.itemsSource(); this.d.removeItem(target_); if (!this.c.containsKey(curr_)) { return; } let ds_ = this.c.item(curr_); this.b.item(ds_, this.b.item(ds_) - 1); if (this.b.item(ds_) == 0) { this.b.removeItem(ds_); this.c.removeItem(curr_); let a = (ds_.id); this.a.removeItem(a); } } } DataSourceManager.$t = /*@__PURE__*/ markType(DataSourceManager, 'DataSourceManager'); return DataSourceManager; })();