UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

1,389 lines 52.4 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 { __extends, __values } from "tslib"; import { Type, Base, String_$type, fromEnum, markType, IEnumerable_$type, typeCast, Array_$type, runOn, EnumUtil, Number_$type, typeGetValue, INotifyPropertyChanged_$type, PropertyChangedEventArgs, delegateCombine, delegateRemove } from "./type"; import { DataSeriesCollection } from "./DataSeriesCollection"; import { Stack$1 } from "./Stack$1"; import { IDataSourceLocalDataProvider_$type } from "./IDataSourceLocalDataProvider"; import { HashSet$1 } from "./HashSet$1"; import { DataSeriesType_$type } from "./DataSeriesType"; import { DataSeries } from "./DataSeries"; import { List$1 } from "./List$1"; import { Matcher } from "./Matcher"; import { DataSeriesIntent_$type } from "./DataSeriesIntent"; import { stringIsNullOrEmpty, stringReplace, stringEmpty } from "./string"; import { dateMinValue } from "./date"; import { IDataSourceDataProviderUpdateNotifier_$type } from "./IDataSourceDataProviderUpdateNotifier"; import { ObservableCollection$1 } from "./ObservableCollection$1"; import { SortDescriptionCollection } from "./SortDescriptionCollection"; import { FilterExpressionCollection } from "./FilterExpressionCollection"; import { SummaryDescriptionCollection } from "./SummaryDescriptionCollection"; import { Dictionary$2 } from "./Dictionary$2"; import { DataSeriesAdapterCachedProvider } from "./DataSeriesAdapterCachedProvider"; import { AggregatedDataProvider } from "./AggregatedDataProvider"; import { IDataSource_$type } from "./IDataSource"; import { FlatDataProvider } from "./FlatDataProvider"; /** * @hidden */ export var IDataSeriesAdapterRule_$type = new Type(null, 'IDataSeriesAdapterRule'); /** * @hidden */ var DataSeriesAdapterRunContext = /** @class */ /*@__PURE__*/ (function (_super) { __extends(DataSeriesAdapterRunContext, _super); function DataSeriesAdapterRunContext(a) { var _this = _super.call(this) || this; _this.g = null; _this._analyzer = null; _this.h = null; _this.m = null; _this.o = null; _this.n = null; _this.b = null; _this.a = null; _this.l = null; _this.g = a; _this.analyzer = new DataSeriesDataProviderAnalyzer(_this); _this.analyzer.includedProperties = _this.g.includedProperties; _this.analyzer.excludedProperties = _this.g.excludedProperties; _this.h = new DataSeriesCollection(); _this.m = new Stack$1(IDataSourceLocalDataProvider_$type); _this.o = new Stack$1(String_$type); _this.n = new Stack$1(String_$type); _this.b = _this.g.includedProperties; _this.a = _this.g.excludedProperties; _this.l = null; if (_this.g.supportedSeriesTypes != null) { _this.l = new HashSet$1(DataSeriesType_$type, 0); for (var b = 0; b < _this.g.supportedSeriesTypes.length; b++) { _this.l.add_1(_this.g.supportedSeriesTypes[b]); } } return _this; } Object.defineProperty(DataSeriesAdapterRunContext.prototype, "analyzer", { get: function () { return this._analyzer; }, set: function (a) { this._analyzer = a; }, enumerable: false, configurable: true }); DataSeriesAdapterRunContext.prototype.getSubProvider = function (a, b) { var c = this.g.n(a, false); this.pushDataSource(c); this.pushPath(b); return c; }; DataSeriesAdapterRunContext.prototype.popSubProvider = function () { this.popDataSource(); this.popPath(); }; DataSeriesAdapterRunContext.prototype.w = function (a, b) { return this.g.aj(a, b); }; DataSeriesAdapterRunContext.prototype.recurseRules = function (a, b, c) { this.g.a0(this, a, b, c); }; Object.defineProperty(DataSeriesAdapterRunContext.prototype, "includedProperties", { get: function () { return this.b; }, enumerable: false, configurable: true }); Object.defineProperty(DataSeriesAdapterRunContext.prototype, "excludedProperties", { get: function () { return this.a; }, enumerable: false, configurable: true }); DataSeriesAdapterRunContext.prototype.getCurrentDataSource = function () { return this.m.d(); }; DataSeriesAdapterRunContext.prototype.pushDataSource = function (a) { this.m.h(a); }; DataSeriesAdapterRunContext.prototype.hasValidType = function (a) { if (this.l == null) { return true; } if (this.l.contains(a.suggestedSeries)) { return true; } return false; }; DataSeriesAdapterRunContext.prototype.popDataSource = function () { return this.m.e(); }; DataSeriesAdapterRunContext.prototype.getCurrentPathSegment = function () { return this.o.d(); }; DataSeriesAdapterRunContext.prototype.getCurrentPath = function () { var e_1, _a; var a = ""; var b = true; try { for (var _b = __values(fromEnum(this.o)), _c = _b.next(); !_c.done; _c = _b.next()) { var c = _c.value; if (b) { b = false; } else { a += "."; } a += c; } } 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; }; DataSeriesAdapterRunContext.prototype.getParentTitle = function () { if (this.n.f == 0) { return null; } return this.n.d(); }; DataSeriesAdapterRunContext.prototype.pushPath = function (a) { this.o.h(a); }; DataSeriesAdapterRunContext.prototype.popPath = function () { return this.o.e(); }; DataSeriesAdapterRunContext.prototype.pushParentTitle = function (a) { this.n.h(a); }; DataSeriesAdapterRunContext.prototype.popParentTitle = function () { return this.n.e(); }; DataSeriesAdapterRunContext.prototype.ab = function (a, b) { if (a.priority == -1) { a.priority = b.priority; } if (a.dataPath == null) { a.dataPath = this.getCurrentPath(); } if (a.data == null) { a.data = this.getCurrentDataSource().dataSource; } }; DataSeriesAdapterRunContext.prototype.addDataSeries = function (a, b) { this.ab(a, b); this.h.add(a); }; DataSeriesAdapterRunContext.prototype.removeDataSeries = function (a) { this.h.remove(a); }; DataSeriesAdapterRunContext.prototype.insertDataSeries = function (a, b, c) { this.ab(b, c); this.h.insert(a, b); }; DataSeriesAdapterRunContext.prototype.clearDataSeries = function () { this.h.clear(); }; DataSeriesAdapterRunContext.prototype.getDataSeriesCount = function () { return this.h.count; }; DataSeriesAdapterRunContext.prototype.getDataSeriesAt = function (a) { return this.h._inner[a]; }; DataSeriesAdapterRunContext.$t = markType(DataSeriesAdapterRunContext, 'DataSeriesAdapterRunContext'); return DataSeriesAdapterRunContext; }(Base)); export { DataSeriesAdapterRunContext }; /** * @hidden */ var DataSeriesDataProviderAnalyzer = /** @class */ /*@__PURE__*/ (function (_super) { __extends(DataSeriesDataProviderAnalyzer, _super); function DataSeriesDataProviderAnalyzer(a) { var _this = _super.call(this) || this; _this.p = null; _this.b = null; _this.a = null; _this.s = false; _this.r = false; _this.ak = new HashSet$1(String_$type, 0); _this.am = new List$1(Matcher.$, 0); _this.aj = new HashSet$1(String_$type, 0); _this.al = new List$1(Matcher.$, 0); _this.p = a; return _this; } Object.defineProperty(DataSeriesDataProviderAnalyzer.prototype, "includedProperties", { get: function () { return this.b; }, set: function (a) { this.b = a; this.ak.clear(); if (this.b == null) { this.s = false; } else { this.s = true; var d = this.b; for (var c = 0; c < d.length; c++) { var b = d[c]; if (Matcher.a(b)) { this.am.add(new Matcher(b)); } else { this.ak.add_1(b); } } } }, enumerable: false, configurable: true }); Object.defineProperty(DataSeriesDataProviderAnalyzer.prototype, "excludedProperties", { get: function () { return this.a; }, set: function (a) { this.a = a; this.aj.clear(); if (this.a == null) { this.r = false; } else { this.r = true; var d = this.a; for (var c = 0; c < d.length; c++) { var b = d[c]; if (Matcher.a(b)) { this.al.add(new Matcher(b)); } else { this.aj.add_1(b); } } } }, enumerable: false, configurable: true }); DataSeriesDataProviderAnalyzer.prototype.getParentTitle = function () { return this.p.getParentTitle(); }; DataSeriesDataProviderAnalyzer.prototype.shouldIncludeProperty = function (a, b) { if (!stringIsNullOrEmpty(b)) { a = b + "." + a; } if (this.s && !this.ak.contains(a) && !this.y(a)) { return false; } if (this.r && (this.aj.contains(a) || this.u(a))) { return false; } return true; }; DataSeriesDataProviderAnalyzer.prototype.u = function (a) { for (var b = 0; b < this.al.count; b++) { if (this.al._inner[b].b(a)) { return true; } } return false; }; DataSeriesDataProviderAnalyzer.prototype.y = function (a) { for (var b = 0; b < this.am.count; b++) { if (this.am._inner[b].b(a)) { return true; } } return false; }; DataSeriesDataProviderAnalyzer.prototype.expandCamelCasedWords = function (a) { if (a == null) { return null; } a = stringReplace(stringReplace(a, "[", ""), "]", ""); var b = new List$1(String_$type, 0); var c = 0; for (var d = 0; d < a.length; d++) { var e = a.charAt(d); var f = e.toUpperCase(); var g = e.toLowerCase(); if (d == 0) { e = f; } var h = (c == 0 && b.count > 0); var i = (c > 1); if (f == e) { if (h) { b.add(' '); } c++; } else if (g == e) { if (i) { b.insert(b.count - 1, ' '); } c = 0; } else { c = 0; } b.add(e); } var j = stringEmpty(); for (var k = 0; k < b.count; k++) { j += b._inner[k]; } return j; }; DataSeriesDataProviderAnalyzer.prototype.hasStringProperties = function () { return this.getAllStringProperties().length > 0; }; DataSeriesDataProviderAnalyzer.prototype.getAllStringProperties = function () { return this.n(function (a) { return a == 0; }, null); }; DataSeriesDataProviderAnalyzer.prototype.isCollection = function (a) { if (typeCast(IEnumerable_$type, a) !== null || typeCast(Array_$type, a) !== null) { return true; } return false; }; DataSeriesDataProviderAnalyzer.prototype.getAllPropertiesWithName = function (a) { return this.n(null, function (b) { return b == a; }); }; DataSeriesDataProviderAnalyzer.prototype.getAllNumericProperties = function () { return this.n(runOn(this, this.ae), null); }; DataSeriesDataProviderAnalyzer.prototype.getAllObjectProperties = function () { return this.n(runOn(this, this.af), null); }; DataSeriesDataProviderAnalyzer.prototype.getAllCollectionProperties = function () { var a = this.getAllObjectProperties(); if (a.length == 0) { return new Array(0); } var b = this.p.getCurrentDataSource(); var c = new List$1(String_$type, 0); for (var d = 0; d < b.actualCount; d++) { if (this.isCollection(b.getItemAtIndex(d))) { c.add(b.actualSchema.propertyNames[d]); } } return c.toArray(); }; DataSeriesDataProviderAnalyzer.prototype.getFirstNumericProperty = function () { var a = this.getAllNumericProperties(); if (a.length == 0) { return null; } return a[0]; }; DataSeriesDataProviderAnalyzer.prototype.hasNumericProperties = function () { return this.getAllNumericProperties().length > 0; }; DataSeriesDataProviderAnalyzer.prototype.ab = function (a) { if (a == 8 || a == 9) { return true; } return false; }; DataSeriesDataProviderAnalyzer.prototype.q = function (a) { var b = this.p.getCurrentDataSource(); if (b == null) { return 11; } var c = b.actualSchema; if (c == null) { return 11; } var d = -1; for (var e = 0; e < c.propertyNames.length; e++) { if (Base.equalsStatic(c.propertyNames[e], a)) { d = e; break; } } if (d == -1) { return 11; } return c.propertyTypes[d]; }; DataSeriesDataProviderAnalyzer.prototype.n = function (a, b) { var c = this.p.getCurrentDataSource(); var d = c.actualSchema; if (d == null) { return new Array(0); } var e = this.p.getCurrentPath(); var f = 0; for (var g = 0; g < d.propertyTypes.length; g++) { if ((a == null || a(d.propertyTypes[g])) && (b == null || b(d.propertyNames[g])) && this.ai(d.propertyDataIntents, g) && this.shouldIncludeProperty(d.propertyNames[g], e)) { f++; } } var h = new Array(f); f = 0; for (var i = 0; i < d.propertyTypes.length; i++) { if ((a == null || a(d.propertyTypes[i])) && (b == null || b(d.propertyNames[i])) && this.ai(d.propertyDataIntents, i) && this.shouldIncludeProperty(d.propertyNames[i], e)) { h[f] = d.propertyNames[i]; f++; } } return h; }; DataSeriesDataProviderAnalyzer.prototype.ai = function (a, b) { if (a == null) { return true; } return !this.t(a, b, "DontPlot"); }; DataSeriesDataProviderAnalyzer.prototype.t = function (a, b, c) { if (a == null) { return false; } for (var d = 0; d < a[b].length; d++) { var e = a[b][d]; if (Base.equalsStatic(e.toLowerCase(), c.toLowerCase())) { return true; } } return false; }; DataSeriesDataProviderAnalyzer.prototype.getAllPropertiesWithIntent = function (a) { return this.i(a, false, false); }; DataSeriesDataProviderAnalyzer.prototype.getAllPropertiesWithValuelessIntent = function (a) { return this.i(a, true, false); }; DataSeriesDataProviderAnalyzer.prototype.getPropertyIntentValue = function (a, b) { var c = this.p.getCurrentDataSource(); if (c == null) { return null; } var d = c.actualSchema; if (d == null) { return null; } var e = d.propertyDataIntents; if (e == null || d.propertyNames == null) { return null; } for (var f = 0; f < d.propertyNames.length; f++) { if (d.propertyNames[f] != null && Base.equalsStatic(d.propertyNames[f], b)) { for (var g = 0; g < e[f].length; g++) { var h = e[f][g]; var i = h.split('/'); if (i.length == 2 && i[0] != null && Base.equalsStatic(i[0], a)) { return i[1]; } } } } return null; }; DataSeriesDataProviderAnalyzer.prototype.getAllPropertiesWithValuedIntent = function (a) { return this.i(a, false, true); }; DataSeriesDataProviderAnalyzer.prototype.i = function (a, b, c) { var d = this.p.getCurrentDataSource(); if (d == null) { return new Array(0); } var e = d.actualSchema; if (e == null) { return new Array(0); } var f = e.propertyDataIntents; if (f == null || e.propertyNames == null) { return new Array(0); } var g = 0; for (var h = 0; h < e.propertyNames.length; h++) { for (var i = 0; i < f[h].length; i++) { var j = f[h][i]; var k = j.split('/'); if (b && k.length > 1) { continue; } if (c && k.length < 2) { continue; } if (Base.equalsStatic(a.toLowerCase(), k[0].toLowerCase())) { g++; } } } var l = new Array(g); g = 0; for (var m = 0; m < e.propertyNames.length; m++) { for (var n = 0; n < f[m].length; n++) { var o = f[m][n]; var p = o.split('/'); if (b && p.length > 1) { continue; } if (c && p.length < 2) { continue; } if (Base.equalsStatic(a.toLowerCase(), o.toLowerCase())) { l[g] = e.propertyNames[m]; g++; } } } return l; }; DataSeriesDataProviderAnalyzer.prototype.getAllDateTimeProperties = function () { return this.n(runOn(this, this.ab), null); }; DataSeriesDataProviderAnalyzer.prototype.getFirstDateTimeProperty = function () { var a = this.getAllDateTimeProperties(); if (a.length == 0) { return null; } return a[0]; }; DataSeriesDataProviderAnalyzer.prototype.getFirstStringProperty = function () { var a = this.getAllStringProperties(); if (a.length == 0) { return null; } return a[0]; }; DataSeriesDataProviderAnalyzer.prototype.hasDateTimeProperties = function () { return this.getAllDateTimeProperties().length > 0; }; DataSeriesDataProviderAnalyzer.prototype.ae = function (a) { return a == 1 || a == 3 || a == 4 || a == 7 || a == 5 || a == 6 || a == 10; }; DataSeriesDataProviderAnalyzer.prototype.af = function (a) { return a == 11; }; DataSeriesDataProviderAnalyzer.prototype.isMonotonic = function (a, b, c) { if (a == null) { return false; } var d = false; var e = false; var f = a.actualCount; for (var g = 0; g < Math.min(f, c); g++) { if (g == 0) { continue; } var h = this.an(a.getItemValue(a.getItemAtIndex(g - 1), b)); var i = this.an(a.getItemValue(a.getItemAtIndex(g), b)); if (!e && h != i) { d = i > h; e = true; } if (h == i) { continue; } if (e) { var j = i > h; if (j != d) { return false; } } } return true; }; DataSeriesDataProviderAnalyzer.prototype.aw = function (a, b, c) { var d = this.p.getCurrentDataSource(); var e = d.actualSchema; if (e == null) { return null; } var f = this.n(b, null); if (f.length == 0) { return null; } if (d.actualCount > a) { return null; } for (var g = 0; g < f.length; g++) { if (c(f[g], this.q(f[g]))) { return f[g]; } } return null; }; DataSeriesDataProviderAnalyzer.prototype.getFirstDistinctStringProperty = function (a) { return this.aw(a, function (b) { return b == 0; }, runOn(this, this.ag)); }; DataSeriesDataProviderAnalyzer.prototype.getFirstDistinctNumericProperty = function (a) { return this.aw(a, runOn(this, this.ae), runOn(this, this.ad)); }; DataSeriesDataProviderAnalyzer.prototype.getFirstDistinctMonotonicNumericProperty = function (a) { var _this = this; var b = this.p.getCurrentDataSource(); return this.aw(a, runOn(this, this.ae), function (c, d) { return _this.ad(c, d) && _this.isMonotonic(b, c, a); }); }; DataSeriesDataProviderAnalyzer.prototype.getFirstDistinctDateTimeProperty = function (a) { return this.aw(a, runOn(this, this.ab), runOn(this, this.aa)); }; DataSeriesDataProviderAnalyzer.prototype.getFirstStringPropertyPreferringDistinct = function (a) { var b = this.getFirstDistinctStringProperty(a); if (b != null) { return b; } var c = this.getAllStringProperties(); if (c.length == 0) { return null; } return c[0]; }; DataSeriesDataProviderAnalyzer.prototype.getTitleString = function (a, b) { return this.getTitleStringWithSeparator(a, b, " - "); }; DataSeriesDataProviderAnalyzer.prototype.getTitleStringWithSeparator = function (a, b, c) { var d = this.p.getCurrentDataSource(); var e = null; if (e == null && b != null) { var f = null; for (var g = 0; g < b.length; g++) { var h = this.getPropertyIntentValue(EnumUtil.getName(DataSeriesIntent_$type, (10)), b[g]); if (e == null) { e = h; f = h; } else { if (h != null) { if (h.trim().length > 0 && h != f) { e += c + h; } f = h; } } } } if (e == null) { var i = this.getAllPropertiesWithValuelessIntent(EnumUtil.getName(DataSeriesIntent_$type, (10))); if (i != null && i.length > 0) { e = i[0]; e = this.aq(a, d, e); } } if (e == null) { if (this.getParentTitle() != null) { e = this.getParentTitle(); } } if (e == null && a != null) { var j = this.getAllStringProperties(); for (var l = 0; l < j.length; l++) { var k = j[l]; if (k != null && (Base.equalsStatic(k.toLowerCase(), "label") || Base.equalsStatic(k.toLowerCase(), "title"))) { e = k; } } if (e != null) { e = this.aq(a, d, e); } } return e; }; DataSeriesDataProviderAnalyzer.prototype.aq = function (a, b, c) { if (a != null) { var d = b.getItemValue(a, c); if (d != null) { c = d.toString(); } } else { c = this.getNonNullPropertyValue(c).toString(); } return c; }; DataSeriesDataProviderAnalyzer.prototype.getNonNullPropertyValue = function (a) { var b = this.p.getCurrentDataSource(); for (var c = 0; c < b.actualCount; c++) { var d = b.getItemValue(b.getItemAtIndex(c), a); if (d != null) { return d; } } return null; }; DataSeriesDataProviderAnalyzer.prototype.ag = function (a, b) { var c = this.p.getCurrentDataSource(); var d = new HashSet$1(String_$type, 0); for (var e = 0; e < c.actualCount; e++) { var f = c.getItemValue(c.getItemAtIndex(e), a); var g = f; if (d.contains(g)) { return false; } d.add_1(g); } return true; }; DataSeriesDataProviderAnalyzer.prototype.aa = function (a, b) { var c = this.p.getCurrentDataSource(); var d = new HashSet$1(Number_$type, 0); for (var e = 0; e < c.actualCount; e++) { var f = void 0; var g = c.getItemValue(c.getItemAtIndex(e), a); if (g == null) { f = dateMinValue(); } else { f = g; } if (d.contains(f.getTime())) { return false; } d.add_1(f.getTime()); } return true; }; DataSeriesDataProviderAnalyzer.prototype.an = function (value_) { return (+value_); }; DataSeriesDataProviderAnalyzer.prototype.ad = function (a, b) { var c = this.p.getCurrentDataSource(); if (b == 4 || b == 1 || b == 3) { var d = new HashSet$1(Number_$type, 0); for (var e = 0; e < c.actualCount; e++) { var f = void 0; var g = c.getItemValue(c.getItemAtIndex(e), a); if (g == null) { f = -9.2233720368547758E+18; } else { f = typeGetValue(g); } if (d.contains(f)) { return false; } d.add_1(f); } return true; } if (b == 7 || b == 5 || b == 6) { var h = new HashSet$1(Number_$type, 0); for (var i = 0; i < c.actualCount; i++) { var j = void 0; var k = c.getItemValue(c.getItemAtIndex(i), a); if (k == null) { j = NaN; } else { j = this.an(k); } if (h.contains(j)) { return false; } h.add_1(j); } return true; } return false; }; DataSeriesDataProviderAnalyzer.$t = markType(DataSeriesDataProviderAnalyzer, 'DataSeriesDataProviderAnalyzer'); return DataSeriesDataProviderAnalyzer; }(Base)); export { DataSeriesDataProviderAnalyzer }; /** * @hidden */ var DataSeriesAdapterUpdateNotifier = /** @class */ /*@__PURE__*/ (function (_super) { __extends(DataSeriesAdapterUpdateNotifier, _super); function DataSeriesAdapterUpdateNotifier(a, b) { var _this = _super.call(this) || this; _this.a = null; _this.b = null; _this.a = a; _this.b = b; return _this; } DataSeriesAdapterUpdateNotifier.prototype.notifyClearItems = function () { this.a.at(this.b); }; DataSeriesAdapterUpdateNotifier.prototype.notifyInsertItem = function (a, b) { this.a.au(this.b, a, b); }; DataSeriesAdapterUpdateNotifier.prototype.notifyRemoveItem = function (a, b) { this.a.av(this.b, a, b); }; DataSeriesAdapterUpdateNotifier.prototype.notifySetItem = function (a, b, c) { this.a.aw(this.b, a, b, c); }; DataSeriesAdapterUpdateNotifier.$t = markType(DataSeriesAdapterUpdateNotifier, 'DataSeriesAdapterUpdateNotifier', Base.$, [IDataSourceDataProviderUpdateNotifier_$type]); return DataSeriesAdapterUpdateNotifier; }(Base)); export { DataSeriesAdapterUpdateNotifier }; /** * @hidden */ var DataSeriesAdapterRuleCollection = /** @class */ /*@__PURE__*/ (function (_super) { __extends(DataSeriesAdapterRuleCollection, _super); function DataSeriesAdapterRuleCollection() { return _super.call(this, IDataSeriesAdapterRule_$type, 0) || this; } DataSeriesAdapterRuleCollection.$t = markType(DataSeriesAdapterRuleCollection, 'DataSeriesAdapterRuleCollection', ObservableCollection$1.$.specialize(IDataSeriesAdapterRule_$type)); return DataSeriesAdapterRuleCollection; }(ObservableCollection$1)); export { DataSeriesAdapterRuleCollection }; /** * @hidden */ var DataSeriesAdapterRemovingDuplicatesEventArgs = /** @class */ /*@__PURE__*/ (function (_super) { __extends(DataSeriesAdapterRemovingDuplicatesEventArgs, _super); function DataSeriesAdapterRemovingDuplicatesEventArgs() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.b = null; _this.d = null; _this.e = null; _this.a = null; _this.c = false; return _this; } DataSeriesAdapterRemovingDuplicatesEventArgs.$t = markType(DataSeriesAdapterRemovingDuplicatesEventArgs, 'DataSeriesAdapterRemovingDuplicatesEventArgs'); return DataSeriesAdapterRemovingDuplicatesEventArgs; }(Base)); export { DataSeriesAdapterRemovingDuplicatesEventArgs }; /** * @hidden */ var DataSeriesAdapterRunEventArgs = /** @class */ /*@__PURE__*/ (function (_super) { __extends(DataSeriesAdapterRunEventArgs, _super); function DataSeriesAdapterRunEventArgs() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.a = null; _this.b = false; return _this; } DataSeriesAdapterRunEventArgs.$t = markType(DataSeriesAdapterRunEventArgs, 'DataSeriesAdapterRunEventArgs'); return DataSeriesAdapterRunEventArgs; }(Base)); export { DataSeriesAdapterRunEventArgs }; /** * @hidden */ var DataSeriesAdapterImplementation = /** @class */ /*@__PURE__*/ (function (_super) { __extends(DataSeriesAdapterImplementation, _super); function DataSeriesAdapterImplementation() { var _this = _super.call(this) || this; _this.x = false; _this.w = false; _this.ac = null; _this.ae = null; _this.ab = new Dictionary$2(Base.$, DataSeriesAdapterCachedProvider.$, 0); _this.ad = null; _this.propertyChanged = null; _this.c = null; _this.b = null; _this.a = null; _this.q = null; _this.p = null; _this.o = null; _this.l = null; _this.u = null; _this._rules = null; _this._dataSeries = null; _this.y = false; _this.removingUnsupported = null; _this.removingDuplicates = null; _this.q = new SortDescriptionCollection(); _this.o = new SortDescriptionCollection(); _this.u = new SummaryDescriptionCollection(); _this.l = new FilterExpressionCollection(); _this.p = new SortDescriptionCollection(); _this.q.n(runOn(_this, _this.al)); _this.o.n(runOn(_this, _this.al)); _this.u.n(runOn(_this, _this.al)); _this.l.n(runOn(_this, _this.al)); _this.p.n(runOn(_this, _this.al)); _this.rules = new DataSeriesAdapterRuleCollection(); _this.dataSeries = new DataSeriesCollection(); _this.ax(_this.rules); var a = _this.rules; a.collectionChanged = delegateCombine(a.collectionChanged, runOn(_this, _this.a5)); return _this; } DataSeriesAdapterImplementation.prototype.al = function (a, b) { var c = this.z; var d = this.aa(); if (c != this.w || d != this.x) { this.w = c; this.x = d; this.refresh(); } }; DataSeriesAdapterImplementation.prototype.aj = function (a, b) { var c = stringEmpty(); if (this.ac != null) { c = this.ac(a); } if (stringIsNullOrEmpty(c)) { return b; } return c; }; DataSeriesAdapterImplementation.prototype.ax = function (a) { }; DataSeriesAdapterImplementation.prototype.a5 = function (a, b) { this.refresh(); }; Object.defineProperty(DataSeriesAdapterImplementation.prototype, "g", { get: function () { return this.ae; }, enumerable: false, configurable: true }); Object.defineProperty(DataSeriesAdapterImplementation.prototype, "itemsSource", { get: function () { return this.ad; }, set: function (a) { var b = this.ad; this.ad = a; if (b != this.ad) { this.as("ItemsSource", b, this.ad); } }, enumerable: false, configurable: true }); Object.defineProperty(DataSeriesAdapterImplementation.prototype, "supportedSeriesTypes", { get: function () { return this.c; }, set: function (a) { var b = this.c; this.c = a; if (b != this.c) { this.as("SupportedSeriesTypes", b, this.c); } }, enumerable: false, configurable: true }); Object.defineProperty(DataSeriesAdapterImplementation.prototype, "includedProperties", { get: function () { return this.b; }, set: function (a) { var b = this.b; this.b = a; if (b != this.b) { this.as("IncludedProperties", b, this.b); } }, enumerable: false, configurable: true }); Object.defineProperty(DataSeriesAdapterImplementation.prototype, "excludedProperties", { get: function () { return this.a; }, set: function (a) { var b = this.a; this.a = a; if (b != this.a) { this.as("ExcludedProperties", b, this.a); } }, enumerable: false, configurable: true }); Object.defineProperty(DataSeriesAdapterImplementation.prototype, "sortDescriptions", { get: function () { return this.q; }, enumerable: false, configurable: true }); Object.defineProperty(DataSeriesAdapterImplementation.prototype, "postSortDescriptions", { get: function () { return this.p; }, enumerable: false, configurable: true }); Object.defineProperty(DataSeriesAdapterImplementation.prototype, "groupDescriptions", { get: function () { return this.o; }, enumerable: false, configurable: true }); Object.defineProperty(DataSeriesAdapterImplementation.prototype, "filterExpressions", { get: function () { return this.l; }, enumerable: false, configurable: true }); Object.defineProperty(DataSeriesAdapterImplementation.prototype, "summaryDescriptions", { get: function () { return this.u; }, enumerable: false, configurable: true }); Object.defineProperty(DataSeriesAdapterImplementation.prototype, "rules", { get: function () { return this._rules; }, set: function (a) { this._rules = a; }, enumerable: false, configurable: true }); Object.defineProperty(DataSeriesAdapterImplementation.prototype, "dataSeries", { get: function () { return this._dataSeries; }, set: function (a) { this._dataSeries = a; }, enumerable: false, configurable: true }); DataSeriesAdapterImplementation.prototype.as = function (a, b, c) { this.ay(a, b, c); if (this.propertyChanged != null) { this.propertyChanged(this, new PropertyChangedEventArgs(a)); } }; DataSeriesAdapterImplementation.prototype.ay = function (a, b, c) { switch (a) { case "ItemsSource": this.refresh(); break; case "SupportedSeriesTypes": this.refresh(); break; case "IncludedProperties": this.refresh(); break; case "ExcludedProperties": this.refresh(); break; } }; DataSeriesAdapterImplementation.prototype.refresh = function () { this.y = true; this.a4(); var a = new DataSeriesAdapterRunContext(this); var b = this.n(this.itemsSource, true); this.am(this.itemsSource, b, null, false); a.pushDataSource(b); this.a7(a); this.a9(a); this.an(); this.y = false; }; DataSeriesAdapterImplementation.prototype.a4 = function () { var e_2, _a; try { for (var _b = __values(fromEnum(this.ab.keys)), _c = _b.next(); !_c.done; _c = _b.next()) { var a = _c.value; var b = this.ab.item(a); b.c = false; } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_2) throw e_2.error; } } }; DataSeriesAdapterImplementation.prototype.an = function () { var e_3, _a; var a = new List$1(Base.$, 0); try { for (var _b = __values(fromEnum(this.ab.keys)), _c = _b.next(); !_c.done; _c = _b.next()) { var b = _c.value; var c = this.ab.item(b); if (!c.c) { a.add1(b); var d = c.b; if (typeCast(AggregatedDataProvider.$, d) !== null) { var e = d; if (e.f != null) { this.sortDescriptions.syncTarget = null; this.groupDescriptions.syncTarget = null; this.filterExpressions.syncTarget = null; this.summaryDescriptions.syncTarget = null; } } d.updateNotifier = null; d.schemaChanged = delegateRemove(d.schemaChanged, runOn(this, this.az)); } } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_3) throw e_3.error; } } for (var f = 0; f < a.count; f++) { var g = a._inner[f]; this.ab.removeItem(g); } }; DataSeriesAdapterImplementation.prototype.a9 = function (a) { this.a3(a); this.a2(a); this.a8(a); }; DataSeriesAdapterImplementation.prototype.a3 = function (a) { var b = true; if (this.removingUnsupported != null) { var c = ((function () { var $ret = new DataSeriesAdapterRunEventArgs(); $ret.a = a; return $ret; })()); this.removingUnsupported(this, c); b = !c.b; } if (b) { if (this.supportedSeriesTypes == null) { return; } var d = new HashSet$1(DataSeriesType_$type, 0); for (var e = 0; e < this.supportedSeriesTypes.length; e++) { d.add_1(this.supportedSeriesTypes[e]); } for (var f = a.getDataSeriesCount() - 1; f >= 0; f--) { var g = a.getDataSeriesAt(f); if (!d.contains(g.suggestedSeries)) { a.removeDataSeries(g); } } } }; DataSeriesAdapterImplementation.prototype.a8 = function (a) { var b = 0; for (; b < Math.min(this.dataSeries.count, a.getDataSeriesCount()); b++) { if (!this.dataSeries._inner[b].equals(a.getDataSeriesAt(b))) { this.dataSeries.removeAt(b); b--; } } for (; b < a.getDataSeriesCount(); b++) { this.dataSeries.insert(b, a.getDataSeriesAt(b)); } for (; b < this.dataSeries.count; b++) { this.dataSeries.removeAt(b); b--; } }; DataSeriesAdapterImplementation.prototype.a2 = function (a) { var e_4, _a; var b = new Dictionary$2(String_$type, List$1.$.specialize(DataSeries.$), 0); for (var c = 0; c < a.getDataSeriesCount(); c++) { var d = a.getDataSeriesAt(c); var e = d.i(); for (var f = 0; f < e.count; f++) { if (e.item(f).intent == 16 || e.item(f).intent == 17) { continue; } var g = (d.dataPath != null ? (d.dataPath + ".") : "") + e.item(f).path; if (e.item(f).intent == 25) { g = e.item(f).path; } if (!b.containsKey(g)) { b.item(g, new List$1(DataSeries.$, 0)); } b.item(g).add(d); } } var _loop_1 = function (h) { if (b.item(h).count > 1) { var i_1 = new Array(b.item(h).count); var j = b.item(h); var k = j.count; for (var l = 0; l < k; l++) { i_1[l] = j._inner[l]; } var m = true; if (this_1.removingDuplicates != null) { var n = ((function () { var $ret = new DataSeriesAdapterRemovingDuplicatesEventArgs(); $ret.e = h; $ret.b = a; $ret.a = i_1; return $ret; })()); m = !n.c; } if (m) { var o = -1; var p = null; j = b.item(h); k = j.count; for (var q = 0; q < k; q++) { var r = j._inner[q]; if (r.priority > o) { o = r.priority; p = r; } } for (var s = 0; s < k; s++) { var t = j._inner[s]; if (t != p) { a.removeDataSeries(t); } } } } }; var this_1 = this; try { for (var _b = __values(fromEnum(b.keys)), _c = _b.next(); !_c.done; _c = _b.next()) { var h = _c.value; _loop_1(h); } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_4) throw e_4.error; } } }; DataSeriesAdapterImplementation.prototype.a7 = function (a) { for (var b = 0; b < this.rules.count; b++) { this.a6(a, this.rules._inner[b]); } }; DataSeriesAdapterImplementation.prototype.a6 = function (a, b) { b.evaluate(a); }; Object.defineProperty(DataSeriesAdapterImplementation.prototype, "z", { get: function () { return this.sortDescriptions.k.count > 0 || this.groupDescriptions.k.count > 0 || this.filterExpressions.k.count > 0 || this.summaryDescriptions.k.count > 0; }, enumerable: false, configurable: true }); DataSeriesAdapterImplementation.prototype.aa = function () { return this.groupDescriptions.k.count > 0 && this.postSortDescriptions.k.count > 0; }; DataSeriesAdapterImplementation.prototype.n = function (a, b) { var c = this.aa(); var d = 0; if (typeCast(IDataSource_$type, a) !== null || (b && this.z)) { if (c) { d = 2; } else { d = 1; } } if (a != null && this.ab.containsKey(a)) { var e = this.ab.item(a); e.c = true; if (e.a != d) { var f = e.b; if (typeCast(AggregatedDataProvider.$, f) !== null) { var g = f; if (g.f != null) { this.sortDescriptions.syncTarget = null; this.groupDescriptions.syncTarget = null; this.filterExpressions.syncTarget = null; this.summaryDescriptions.syncTarget = null; } } if (typeCast(FlatDataProvider.$, f) !== null) { } f.updateNotifier = null; f.schemaChanged = delegateRemove(f.schemaChanged, runOn(this, this.az)); this.ab.removeItem(a); } else { return e.b; } } if (typeCast(IDataSourceLocalDataProvider_$type, a) !== null) { return a; } if (typeCast(IDataSource_$type, a) !== null) { var h = new AggregatedDataProvider(); h.f = a; this.sortDescriptions.syncTarget = h.f.sortDescriptions; this.groupDescriptions.syncTarget = h.f.groupDescriptions; this.filterExpressions.syncTarget = h.f.filterExpressions; this.summaryDescriptions.syncTarget = h.f.summaryDescriptions; return h; } if (b && this.z) { var i = this.g.getLocalDataSource(a); var j = new AggregatedDataProvider(); j.f = i; this.sortDescriptions.syncTarget = j.f.sortDescriptions; this.groupDescriptions.syncTarget = j.f.groupDescriptions; this.filterExpressions.syncTarget = j.f.filterExpressions; this.summaryDescriptions.syncTarget = j.f.summaryDescriptions; if (d == 2) { var k = this.g.getLocalDataSource(null); k.dataProvider = j; var l = new FlatDataProvider(); l.e = k; this.postSortDescriptions.syncTarget = l.e.sortDescriptions; return l; } return j; } return this.g.getDataProvider(a); }; DataSeriesAdapterImplementation.prototype.a0 = function (a, b, c, d) { var e = this.n(b, false); this.am(b, e, a.getCurrentDataSource(), d); a.pushDataSource(e); a.pushPath(c); this.a7(a); a.popPath(); a.popDataSource(); }; DataSeriesAdapterImplementation.prototype.am = function (a, b, c, d) { if (a != null && !this.ab.containsKey(a)) { var e = new Dat