igniteui-react-core
Version:
Ignite UI React Core.
1,430 lines (1,429 loc) • 72 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 { 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 { List$1 } from "./List$1";
import { DataSeriesPropertyType_$type } from "./DataSeriesPropertyType";
import { DataSeriesAdapterProviderInfo } from "./DataSeriesAdapterProviderInfo";
import { DataSeries } from "./DataSeries";
import { Matcher } from "./Matcher";
import { DataSeriesIntent_$type } from "./DataSeriesIntent";
import { stringIsNullOrEmpty, stringReplace, stringEmpty } from "./string";
import { dateMinValue } from "./date";
import { isNaN_ } from "./number";
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 { IDataSource_$type } from "./IDataSource";
import { AggregatedDataProvider } from "./AggregatedDataProvider";
import { FlatDataProvider } from "./FlatDataProvider";
/**
* @hidden
*/
export var IDataSeriesAdapterRule_$type = /*@__PURE__*/ new Type(null, 'IDataSeriesAdapterRule');
/**
* @hidden
*/
var DataSeriesAdapterRunContext = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(DataSeriesAdapterRunContext, _super);
function DataSeriesAdapterRunContext(a) {
var _this = _super.call(this) || this;
_this.k = null;
_this._analyzer = null;
_this.l = null;
_this.w = null;
_this.x = null;
_this.z = null;
_this.y = null;
_this.b = null;
_this.a = null;
_this.s = null;
_this.p = false;
_this.t = null;
_this.u = null;
_this.v = null;
_this.i = 0;
_this.k = a;
_this.analyzer = new DataSeriesDataProviderAnalyzer(_this);
_this.analyzer.includedProperties = _this.k.includedProperties;
_this.analyzer.excludedProperties = _this.k.excludedProperties;
_this.l = new DataSeriesCollection();
_this.w = new Stack$1(IDataSourceLocalDataProvider_$type);
_this.x = new Stack$1(IDataSourceLocalDataProvider_$type);
_this.z = new Stack$1(String_$type);
_this.y = new Stack$1(String_$type);
_this.b = _this.k.includedProperties;
_this.a = _this.k.excludedProperties;
_this.s = null;
_this.p = _this.k.adjustPrioritiesBasedOnFitness;
_this.t = new List$1(String_$type, 0);
_this.u = new List$1(String_$type, 0);
_this.v = new List$1(DataSeriesPropertyType_$type, 0);
if (_this.k.supportedSeriesTypes != null) {
_this.s = new HashSet$1(DataSeriesType_$type, 0);
for (var b = 0; b < _this.k.supportedSeriesTypes.length; b++) {
_this.s.add_1(_this.k.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.k.h(a, false);
this.pushDataSource(c.c);
if (c.b != null) {
this.pushHighlightingDataSource(c.b);
}
else {
this.pushHighlightingDataSource(null);
}
this.pushPath(b);
return c.c;
};
DataSeriesAdapterRunContext.prototype.popSubProvider = function () {
this.popDataSource();
this.popHighlightingDataSource();
this.popPath();
};
DataSeriesAdapterRunContext.prototype.aj = function (a, b) {
return this.k.aq(a, b);
};
DataSeriesAdapterRunContext.prototype.recurseRules = function (a, b, c) {
this.k.bc(this, a, b, c);
};
Object.defineProperty(DataSeriesAdapterRunContext.prototype, "adjustPrioritiesBasedOnFitness", {
get: function () {
return this.p;
},
enumerable: false,
configurable: true
});
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.w.d();
};
DataSeriesAdapterRunContext.prototype.getCurrentHighlightingDataSource = function () {
return this.x.d();
};
DataSeriesAdapterRunContext.prototype.pushDataSource = function (a) {
this.w.h(a);
};
DataSeriesAdapterRunContext.prototype.pushHighlightingDataSource = function (a) {
this.x.h(a);
};
DataSeriesAdapterRunContext.prototype.hasValidType = function (a) {
if (this.s == null) {
return true;
}
if (this.s.contains(a.suggestedSeries)) {
return true;
}
return false;
};
DataSeriesAdapterRunContext.prototype.j = function () {
return this.i;
};
DataSeriesAdapterRunContext.prototype.ay = function (a) {
this.i = a;
};
DataSeriesAdapterRunContext.prototype.al = function (a) {
this.t.add(a);
};
DataSeriesAdapterRunContext.prototype.d = function () {
var e_1, _a;
var a = new Array(this.t.count);
var b = 0;
try {
for (var _b = __values(fromEnum(this.t)), _c = _b.next(); !_c.done; _c = _b.next()) {
var c = _c.value;
a[b] = c;
b++;
}
}
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.ao = function () {
this.u.clear();
this.t.clear();
this.v.clear();
};
DataSeriesAdapterRunContext.prototype.am = function (a, b, c) {
this.u.add(a);
this.t.add(b);
this.v.add(c);
};
DataSeriesAdapterRunContext.prototype.h = function (a) {
return this.v._inner[a];
};
DataSeriesAdapterRunContext.prototype.ai = function (a) {
return this.u._inner[a];
};
DataSeriesAdapterRunContext.prototype.popDataSource = function () {
return this.w.e();
};
DataSeriesAdapterRunContext.prototype.popHighlightingDataSource = function () {
return this.x.e();
};
DataSeriesAdapterRunContext.prototype.getCurrentPathSegment = function () {
return this.z.d();
};
DataSeriesAdapterRunContext.prototype.getCurrentPath = function () {
var e_2, _a;
var a = "";
var b = true;
try {
for (var _b = __values(fromEnum(this.z)), _c = _b.next(); !_c.done; _c = _b.next()) {
var c = _c.value;
if (b) {
b = false;
}
else {
a += ".";
}
a += c;
}
}
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;
}
}
return a;
};
DataSeriesAdapterRunContext.prototype.getParentTitle = function () {
if (this.y.f == 0) {
return null;
}
return this.y.d();
};
DataSeriesAdapterRunContext.prototype.pushPath = function (a) {
this.z.h(a);
};
DataSeriesAdapterRunContext.prototype.popPath = function () {
return this.z.e();
};
DataSeriesAdapterRunContext.prototype.pushParentTitle = function (a) {
this.y.h(a);
};
DataSeriesAdapterRunContext.prototype.popParentTitle = function () {
return this.y.e();
};
DataSeriesAdapterRunContext.prototype.ar = 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;
}
if (a.highlightedData == null) {
var c = this.getCurrentHighlightingDataSource();
if (c != null) {
a.highlightedData = c.dataSource;
}
}
};
DataSeriesAdapterRunContext.prototype.addDataSeries = function (a, b) {
this.ar(a, b);
this.l.add(a);
};
DataSeriesAdapterRunContext.prototype.removeDataSeries = function (a) {
this.l.remove(a);
};
DataSeriesAdapterRunContext.prototype.insertDataSeries = function (a, b, c) {
this.ar(b, c);
this.l.insert(a, b);
};
DataSeriesAdapterRunContext.prototype.clearDataSeries = function () {
this.l.clear();
};
DataSeriesAdapterRunContext.prototype.getDataSeriesCount = function () {
return this.l.count;
};
DataSeriesAdapterRunContext.prototype.getDataSeriesAt = function (a) {
return this.l._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.u = null;
_this.b = null;
_this.a = null;
_this.x = false;
_this.w = false;
_this.at = new HashSet$1(String_$type, 0);
_this.av = new List$1(Matcher.$, 0);
_this.as = new HashSet$1(String_$type, 0);
_this.au = new List$1(Matcher.$, 0);
_this.u = a;
return _this;
}
Object.defineProperty(DataSeriesDataProviderAnalyzer.prototype, "includedProperties", {
get: function () {
return this.b;
},
set: function (a) {
this.b = a;
this.at.clear();
if (this.b == null) {
this.x = false;
}
else {
this.x = true;
var d = this.b;
for (var c = 0; c < d.length; c++) {
var b = d[c];
if (Matcher.a(b)) {
this.av.add(new Matcher(b));
}
else {
this.at.add_1(b);
}
}
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(DataSeriesDataProviderAnalyzer.prototype, "excludedProperties", {
get: function () {
return this.a;
},
set: function (a) {
this.a = a;
this.as.clear();
if (this.a == null) {
this.w = false;
}
else {
this.w = true;
var d = this.a;
for (var c = 0; c < d.length; c++) {
var b = d[c];
if (Matcher.a(b)) {
this.au.add(new Matcher(b));
}
else {
this.as.add_1(b);
}
}
}
},
enumerable: false,
configurable: true
});
DataSeriesDataProviderAnalyzer.prototype.getParentTitle = function () {
return this.u.getParentTitle();
};
DataSeriesDataProviderAnalyzer.prototype.shouldIncludeProperty = function (a, b) {
if (!stringIsNullOrEmpty(b)) {
a = b + "." + a;
}
if (this.x && !this.at.contains(a) && !this.ad(a)) {
return false;
}
if (this.w && (this.as.contains(a) || this.z(a))) {
return false;
}
return true;
};
DataSeriesDataProviderAnalyzer.prototype.z = function (a) {
for (var b = 0; b < this.au.count; b++) {
if (this.au._inner[b].b(a)) {
return true;
}
}
return false;
};
DataSeriesDataProviderAnalyzer.prototype.ad = function (a) {
for (var b = 0; b < this.av.count; b++) {
if (this.av._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.s(function (a) { return a == 0; }, null);
};
DataSeriesDataProviderAnalyzer.prototype.getAllExcludedStringProperties = function () {
return this.r(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.s(null, function (b) { return b == a; });
};
DataSeriesDataProviderAnalyzer.prototype.getAllNumericProperties = function () {
return this.s(runOn(this, this.ak), null);
};
DataSeriesDataProviderAnalyzer.prototype.getAllObjectProperties = function () {
return this.s(runOn(this, this.al), null);
};
DataSeriesDataProviderAnalyzer.prototype.getAllCollectionProperties = function () {
var a = this.getAllObjectProperties();
if (a.length == 0) {
return new Array(0);
}
var b = this.u.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.ag = function (a) {
if (a == 8 || a == 9) {
return true;
}
return false;
};
DataSeriesDataProviderAnalyzer.prototype.v = function (a) {
var b = this.u.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) {
if (b.actualCount > 0) {
return b.resolveSchemaPropertyType(a);
}
return 11;
}
return c.propertyTypes[d];
};
DataSeriesDataProviderAnalyzer.prototype.s = function (a, b) {
var c = this.u.getCurrentDataSource();
var d = c.actualSchema;
if (d == null) {
return new Array(0);
}
var e = this.u.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.aq(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.aq(d.propertyDataIntents, i) && this.shouldIncludeProperty(d.propertyNames[i], e)) {
h[f] = d.propertyNames[i];
f++;
}
}
return h;
};
DataSeriesDataProviderAnalyzer.prototype.r = function (a, b) {
var c = this.u.getCurrentDataSource();
var d = c.actualSchema;
if (d == null) {
return new Array(0);
}
var e = this.u.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.aq(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.aq(d.propertyDataIntents, i) && !this.shouldIncludeProperty(d.propertyNames[i], e)) {
h[f] = d.propertyNames[i];
f++;
}
}
return h;
};
DataSeriesDataProviderAnalyzer.prototype.aq = function (a, b) {
if (a == null) {
return true;
}
return !this.y(a, b, "DontPlot");
};
DataSeriesDataProviderAnalyzer.prototype.y = 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.m(a, false, false);
};
DataSeriesDataProviderAnalyzer.prototype.getAllPropertiesWithValuelessIntent = function (a) {
return this.m(a, true, false);
};
DataSeriesDataProviderAnalyzer.prototype.getPropertyIntentValue = function (a, b) {
var c = this.u.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.m(a, false, true);
};
DataSeriesDataProviderAnalyzer.prototype.m = function (a, b, c) {
var d = this.u.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.s(runOn(this, this.ag), null);
};
DataSeriesDataProviderAnalyzer.prototype.getAllExcludedDateTimeProperties = function () {
return this.r(runOn(this, this.ag), 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.ak = function (a) {
return a == 1 || a == 3 || a == 4 || a == 7 || a == 5 || a == 6 || a == 10;
};
DataSeriesDataProviderAnalyzer.prototype.al = 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.coerceToDouble(a.getItemValue(a.getItemAtIndex(g - 1), b));
var i = this.coerceToDouble(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.isEvenlySpaced = function (a, b, c) {
if (a == null) {
return false;
}
var d = false;
var e = 0;
var f = a.actualCount;
for (var g = 0; g < Math.min(f, c); g++) {
if (g == 0) {
continue;
}
var h = this.coerceToDouble(a.getItemValue(a.getItemAtIndex(g - 1), b));
var i = this.coerceToDouble(a.getItemValue(a.getItemAtIndex(g), b));
if (!d && h != i) {
var j = Math.abs(i - h);
e = j;
d = true;
continue;
}
if (d) {
var k = Math.abs(i - h);
if (Math.abs(k - e) > 1E-06) {
return false;
}
}
}
return true;
};
DataSeriesDataProviderAnalyzer.prototype.a6 = function (a, b, c) {
var d = this.u.getCurrentDataSource();
var e = d.actualSchema;
if (e == null) {
return null;
}
var f = this.s(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.v(f[g]))) {
return f[g];
}
}
return null;
};
DataSeriesDataProviderAnalyzer.prototype.getFirstDistinctStringProperty = function (a) {
return this.a6(a, function (b) { return b == 0; }, runOn(this, this.am));
};
DataSeriesDataProviderAnalyzer.prototype.getFirstDistinctNumericProperty = function (a) {
return this.a6(a, runOn(this, this.ak), runOn(this, this.aj));
};
DataSeriesDataProviderAnalyzer.prototype.getFirstDistinctMonotonicNumericProperty = function (a) {
var _this = this;
var b = this.u.getCurrentDataSource();
return this.a6(a, runOn(this, this.ak), function (c, d) { return _this.aj(c, d) && _this.isMonotonic(b, c, a); });
};
DataSeriesDataProviderAnalyzer.prototype.getFirstDistinctMonotonicNumericPropertyWithEvenSpacing = function (a) {
var _this = this;
var b = this.u.getCurrentDataSource();
return this.a6(a, runOn(this, this.ak), function (c, d) { return _this.aj(c, d) && _this.isMonotonic(b, c, a) && _this.isEvenlySpaced(b, c, a); });
};
DataSeriesDataProviderAnalyzer.prototype.getAllDistinctMonotonicNumericProperties = function (a) {
var _this = this;
var b = this.u.getCurrentDataSource();
return this.s(runOn(this, this.ak), function (c) { return _this.aj(c, _this.v(c)) && _this.isMonotonic(b, c, a); });
};
DataSeriesDataProviderAnalyzer.prototype.getAllExcludedDistinctMonotonicNumericProperties = function (a) {
var _this = this;
var b = this.u.getCurrentDataSource();
return this.r(runOn(this, this.ak), function (c) { return _this.aj(c, _this.v(c)) && _this.isMonotonic(b, c, a); });
};
DataSeriesDataProviderAnalyzer.prototype.getFirstDistinctDateTimeProperty = function (a) {
return this.a6(a, runOn(this, this.ag), runOn(this, this.af));
};
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.u.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.az(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.az(a, d, e);
}
}
return e;
};
DataSeriesDataProviderAnalyzer.prototype.az = 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.u.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.am = function (a, b) {
var c = this.u.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.af = function (a, b) {
var c = this.u.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.coerceToDouble = function (value_) {
return (+value_);
};
DataSeriesDataProviderAnalyzer.prototype.aj = function (a, b) {
var c = this.u.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.coerceToDouble(k);
}
if (h.contains(j)) {
return false;
}
h.add_1(j);
}
return true;
}
return false;
};
DataSeriesDataProviderAnalyzer.prototype.numericColumnHasDiverseValues = function (a) {
var b = this.u.getCurrentDataSource();
var c = this.v(a);
var d = a;
var e = new List$1(Number_$type, 0);
if (c == 4 || c == 1 || c == 3) {
for (var f = 0; f < b.actualCount; f++) {
var g = void 0;
var h = b.getItemValue(b.getItemAtIndex(f), d);
if (h == null) {
g = -9.2233720368547758E+18;
}
else {
g = typeGetValue(h);
}
e.add(g);
}
}
if (c == 7 || c == 5 || c == 6) {
for (var i = 0; i < b.actualCount; i++) {
var j = void 0;
var k = b.getItemValue(b.getItemAtIndex(i), d);
if (k == null) {
j = NaN;
}
else {
j = this.coerceToDouble(k);
}
e.add(j);
}
}
e.y();
for (var l = 1; l < e.count; l++) {
var m = e._inner[l - 1];
var n = e._inner[l];
if (Math.abs(n - m) / n < 0.05) {
return false;
}
}
return true;
};
DataSeriesDataProviderAnalyzer.prototype.numericColumnHasNoRange = function (a, b, c) {
var d = this.v(b);
var e = b;
var f = new List$1(Number_$type, 0);
if (d == 4 || d == 1 || d == 3) {
for (var g = 0; g < a.actualCount; g++) {
var h = void 0;
var i = a.getItemValue(a.getItemAtIndex(g), e);
if (i == null) {
h = -9.2233720368547758E+18;
}
else {
h = typeGetValue(i);
}
f.add(h);
}
}
if (d == 7 || d == 5 || d == 6) {
for (var j = 0; j < a.actualCount; j++) {
var k = void 0;
var l = a.getItemValue(a.getItemAtIndex(j), e);
if (l == null) {
k = NaN;
}
else {
k = this.coerceToDouble(l);
}
f.add(k);
}
}
var m = 1.7976931348623157E+308;
var n = -1.7976931348623157E+308;
for (var o = 0; o < Math.min(f.count, c); o++) {
var p = f._inner[o];
if (isNaN_(p)) {
continue;
}
m = Math.min(p, m);
n = Math.max(p, n);
if (n - m > 1E-07) {
return false;
}
}
if (n - m < 1E-07) {
return true;
}
return false;
};
DataSeriesDataProviderAnalyzer.prototype.shouldUseLogarithmicScale = function (a, b) {
return true;
};
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.a5(this.b);
};
DataSeriesAdapterUpdateNotifier.prototype.notifyInsertItem = function (a, b) {
this.a.a6(this.b, a, b);
};
DataSeriesAdapterUpdateNotifier.prototype.notifyRemoveItem = function (a, b) {
this.a.a7(this.b, a, b);
};
DataSeriesAdapterUpdateNotifier.prototype.notifySetItem = function (a, b, c) {
this.a.a8(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.ab = false;
_this.z = false;
_this.aa = false;
_this.aj = null;
_this.al = null;
_this.ai = new Dictionary$2(Base.$, DataSeriesAdapterProviderInfo.$, 0);
_this.ah = new Dictionary$2(Base.$, DataSeriesAdapterProviderInfo.$, 0);
_this.ak = null;
_this.propertyChanged = null;
_this.c = null;
_this.b = null;
_this.a = null;
_this.t = null;
_this.s = null;
_this.r = null;
_this.m = null;
_this.n = null;
_this.x = null;
_this._rules = null;
_this._dataSeries = null;
_this.ac = false;
_this.removingUnsupported = null;
_this.removingDuplicates = null;
_this._adjustPrioritiesBasedOnFitness = false;
_this.t = new SortDescriptionCollection();
_this.r = new SortDescriptionCollection();
_this.x = new SummaryDescriptionCollection();
_this.m = new FilterExpressionCollection();
_this.n = new FilterExpressionCollection();
_this.s = new SortDescriptionCollection();
_this.t.n(runOn(_this, _this.at));
_this.r.n(runOn(_this, _this.at));
_this.x.n(runOn(_this, _this.at));
_this.m.n(runOn(_this, _this.at));
_this.n.n(runOn(_this, _this.at));
_this.s.n(runOn(_this, _this.at));
_this.rules = new DataSeriesAdapterRuleCollection();
_this.dataSeries = new DataSeriesCollection();
_this.a9(_this.rules);
var a = _this.rules;
a.collectionChanged = delegateCombine(a.collectionChanged, runOn(_this, _this.bh));
return _this;
}
DataSeriesAdapterImplementation.prototype.at = function (a, b) {
var c = this.ae;
var d = this.ag();
var e = this.af();
if (c != this.z || d != this.ab || e != this.aa) {
this.z = c;
this.ab = d;
this.aa = e;
this.refresh();
}
};
DataSeriesAdapterImplementation.prototype.aq = function (a, b) {
var c = stringEmpty();
if (this.aj != null) {
c = this.aj(a);
}
if (stringIsNullOrEmpty(c)) {
return b;
}
return c;
};
DataSeriesAdapterImplementation.prototype.a9 = function (a) {
};
DataSeriesAdapterImplementation.prototype.bh = function (a, b) {
this.refresh();
};
Object.defineProperty(DataSeriesAdapterImplementation.prototype, "g", {
get: function () {
return this.al;
},
enumerable: false,
configurable: true
});
Object.defineProperty(DataSeriesAdapterImplementation.prototype, "itemsSource", {
get: function () {
return this.ak;
},
set: function (a) {
var b = this.ak;
this.ak = a;
if (b != this.ak) {
this.a4("ItemsSource", b, this.ak);
}
},
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.a4("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.a4("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.a4("ExcludedProperties", b, this.a);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(DataSeriesAdapterImplementation.prototype, "sortDescriptions", {
get: function () {
return this.t;
},
enumerable: false,
configurable: true
});
Object.defineProperty(DataSeriesAdapterImplementation.prototype, "postSortDescriptions", {
get: function () {
return this.s;
},
enumerable: false,
configurable: true
});
Object.defineProperty(DataSeriesAdapterImplementation.prototype, "groupDescriptions", {
get: function () {
return this.r;
},
enumerable: false,
configurable: true
});
Object.defineProperty(DataSeriesAdapterImplementation.prototype, "filterExpressions", {
get: function () {
return this.m;
},
enumerable: false,
configurable: true
});
Object.defineProperty(DataSeriesAdapterImplementation.prototype, "highlightFilterExpressions", {
get: function () {
return this.n;
},
enumerable: false,
configurable: true
});
Object.defineProperty(DataSeriesAdapterImplementation.prototype, "summaryDescriptions", {
get: function () {
return this.x;
},
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.a4 = function (a, b, c) {
this.ba(a, b, c);
if (this.propertyChanged != null) {
this.propertyChanged(this, new PropertyChangedEventArgs(a));
}
};
DataSeriesAdapterImplementation.prototype.ba = 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.ac = true;
this.bg();
var a = new DataSeriesAdapterRunContext(this);
var b = this.h(this.itemsSource, true);
this.au(this.itemsSource, b, null, false);
a.pushDataSource(b.c);
if (b.b != null) {
a.pushHighlightingDataSource(b.b);
}
else {
a.pushHighlightingDataSource(null);
}
this.bj(a);
this.br(a);
this.av();
this.ac = false;
};
DataSeriesAdapterImplementation.prototype.az = function (a, b) {
var c = new DataSeriesAdapterRunContext(this);
var d = this.h(this.itemsSource, true);
c.pushDataSource(d.c);
var e = new List$1(String_$type, 0);
var f = new List$1(String_$type, 0);
var g = new List$1(DataSeriesPropertyType_$type, 0);
var h = new HashSet$1(String_$type, 0);
for (var i = 0; i < this.rules.count; i++) {
var j = this.rules._inner[i];
var k = j.getPrimaryAxisLabelsStrings(c);
if (k != null) {
for (var l = 0; l < k.length; l++) {
var m = k[l];
if (m == null) {
continue;
}
h.add_1(m);
var n = c.ai(l);
if (stringIsNullOrEmpty(n)) {
e.add(m);
f.add(c.analyzer.expandCamelCasedWords(m));
}
else {
e.add(n + "." + m);
f.add(n + "." + c.analyzer.expandCamelCasedWords(m));
}
g.add(c.h(l));
}
}
}
a.b = e.toArray();
a.a = f.toArray();
a.c = g.toArray();
e = new List$1(String_$type, 0);
f = new List$1(String_$type, 0);
g = new List$1(DataSeriesPropertyType_$type, 0);
c.ao();
for (var o = 0; o < this.rules.count; o++) {
var p = this.rules._inner[o];
var q = p.getAdditionalValuePropertyStrings(c);
if (q != null) {
for (var r = 0; r < q.length; r++) {
var s = q[r];
if (s == null) {
continue;
}
if (h.contains(s)) {
continue;
}