igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
1,433 lines • 66.5 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 { 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 let IDataSeriesAdapterRule_$type = new Type(null, 'IDataSeriesAdapterRule');
/**
* @hidden
*/
export let DataSeriesAdapterRunContext = /*@__PURE__*/ (() => {
class DataSeriesAdapterRunContext extends Base {
constructor(a) {
super();
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 (let b = 0; b < this.k.supportedSeriesTypes.length; b++) {
this.s.add_1(this.k.supportedSeriesTypes[b]);
}
}
}
get analyzer() {
return this._analyzer;
}
set analyzer(a) {
this._analyzer = a;
}
getSubProvider(a, b) {
let 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;
}
popSubProvider() {
this.popDataSource();
this.popHighlightingDataSource();
this.popPath();
}
aj(a, b) {
return this.k.aq(a, b);
}
recurseRules(a, b, c) {
this.k.be(this, a, b, c);
}
get adjustPrioritiesBasedOnFitness() {
return this.p;
}
get includedProperties() {
return this.b;
}
get excludedProperties() {
return this.a;
}
getCurrentDataSource() {
return this.w.d();
}
getCurrentHighlightingDataSource() {
return this.x.d();
}
pushDataSource(a) {
this.w.h(a);
}
pushHighlightingDataSource(a) {
this.x.h(a);
}
hasValidType(a) {
if (this.s == null) {
return true;
}
if (this.s.contains(a.suggestedSeries)) {
return true;
}
return false;
}
j() {
return this.i;
}
ay(a) {
this.i = a;
}
al(a) {
this.t.add(a);
}
d() {
let a = new Array(this.t.count);
let b = 0;
for (let c of fromEnum(this.t)) {
a[b] = c;
b++;
}
return a;
}
ao() {
this.u.clear();
this.t.clear();
this.v.clear();
}
am(a, b, c) {
this.u.add(a);
this.t.add(b);
this.v.add(c);
}
h(a) {
return this.v._inner[a];
}
ai(a) {
return this.u._inner[a];
}
popDataSource() {
return this.w.e();
}
popHighlightingDataSource() {
return this.x.e();
}
getCurrentPathSegment() {
return this.z.d();
}
getCurrentPath() {
let a = "";
let b = true;
for (let c of fromEnum(this.z)) {
if (b) {
b = false;
}
else {
a += ".";
}
a += c;
}
return a;
}
getParentTitle() {
if (this.y.f == 0) {
return null;
}
return this.y.d();
}
pushPath(a) {
this.z.h(a);
}
popPath() {
return this.z.e();
}
pushParentTitle(a) {
this.y.h(a);
}
popParentTitle() {
return this.y.e();
}
ar(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) {
let c = this.getCurrentHighlightingDataSource();
if (c != null) {
a.highlightedData = c.dataSource;
}
}
}
addDataSeries(a, b) {
this.ar(a, b);
this.l.add(a);
}
removeDataSeries(a) {
this.l.remove(a);
}
insertDataSeries(a, b, c) {
this.ar(b, c);
this.l.insert(a, b);
}
clearDataSeries() {
this.l.clear();
}
getDataSeriesCount() {
return this.l.count;
}
getDataSeriesAt(a) {
return this.l._inner[a];
}
}
DataSeriesAdapterRunContext.$t = markType(DataSeriesAdapterRunContext, 'DataSeriesAdapterRunContext');
return DataSeriesAdapterRunContext;
})();
/**
* @hidden
*/
export let DataSeriesDataProviderAnalyzer = /*@__PURE__*/ (() => {
class DataSeriesDataProviderAnalyzer extends Base {
constructor(a) {
super();
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;
}
get includedProperties() {
return this.b;
}
set includedProperties(a) {
this.b = a;
this.at.clear();
if (this.b == null) {
this.x = false;
}
else {
this.x = true;
let d = this.b;
for (let c = 0; c < d.length; c++) {
let b = d[c];
if (Matcher.a(b)) {
this.av.add(new Matcher(b));
}
else {
this.at.add_1(b);
}
}
}
}
get excludedProperties() {
return this.a;
}
set excludedProperties(a) {
this.a = a;
this.as.clear();
if (this.a == null) {
this.w = false;
}
else {
this.w = true;
let d = this.a;
for (let c = 0; c < d.length; c++) {
let b = d[c];
if (Matcher.a(b)) {
this.au.add(new Matcher(b));
}
else {
this.as.add_1(b);
}
}
}
}
getParentTitle() {
return this.u.getParentTitle();
}
shouldIncludeProperty(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;
}
z(a) {
for (let b = 0; b < this.au.count; b++) {
if (this.au._inner[b].b(a)) {
return true;
}
}
return false;
}
ad(a) {
for (let b = 0; b < this.av.count; b++) {
if (this.av._inner[b].b(a)) {
return true;
}
}
return false;
}
expandCamelCasedWords(a) {
if (a == null) {
return null;
}
a = stringReplace(stringReplace(a, "[", ""), "]", "");
let b = new List$1(String_$type, 0);
let c = 0;
for (let d = 0; d < a.length; d++) {
let e = a.charAt(d);
let f = e.toUpperCase();
let g = e.toLowerCase();
if (d == 0) {
e = f;
}
let h = (c == 0 && b.count > 0);
let 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);
}
let j = stringEmpty();
for (let k = 0; k < b.count; k++) {
j += b._inner[k];
}
return j;
}
hasStringProperties() {
return this.getAllStringProperties().length > 0;
}
getAllStringProperties() {
return this.s((a) => a == 0, null);
}
getAllExcludedStringProperties() {
return this.r((a) => a == 0, null);
}
isCollection(a) {
if (typeCast(IEnumerable_$type, a) !== null || typeCast(Array_$type, a) !== null) {
return true;
}
return false;
}
getAllPropertiesWithName(a) {
return this.s(null, (b) => b == a);
}
getAllNumericProperties() {
return this.s(runOn(this, this.ak), null);
}
getAllObjectProperties() {
return this.s(runOn(this, this.al), null);
}
getAllCollectionProperties() {
let a = this.getAllObjectProperties();
if (a.length == 0) {
return new Array(0);
}
let b = this.u.getCurrentDataSource();
let c = new List$1(String_$type, 0);
for (let d = 0; d < b.actualCount; d++) {
if (this.isCollection(b.getItemAtIndex(d))) {
c.add(b.actualSchema.propertyNames[d]);
}
}
return c.toArray();
}
getFirstNumericProperty() {
let a = this.getAllNumericProperties();
if (a.length == 0) {
return null;
}
return a[0];
}
hasNumericProperties() {
return this.getAllNumericProperties().length > 0;
}
ag(a) {
if (a == 8 || a == 9) {
return true;
}
return false;
}
v(a) {
let b = this.u.getCurrentDataSource();
if (b == null) {
return 11;
}
let c = b.actualSchema;
if (c == null) {
return 11;
}
let d = -1;
for (let 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];
}
s(a, b) {
let c = this.u.getCurrentDataSource();
let d = c.actualSchema;
if (d == null) {
return new Array(0);
}
let e = this.u.getCurrentPath();
let f = 0;
for (let 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++;
}
}
let h = new Array(f);
f = 0;
for (let 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;
}
r(a, b) {
let c = this.u.getCurrentDataSource();
let d = c.actualSchema;
if (d == null) {
return new Array(0);
}
let e = this.u.getCurrentPath();
let f = 0;
for (let 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++;
}
}
let h = new Array(f);
f = 0;
for (let 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;
}
aq(a, b) {
if (a == null) {
return true;
}
return !this.y(a, b, "DontPlot");
}
y(a, b, c) {
if (a == null) {
return false;
}
for (let d = 0; d < a[b].length; d++) {
let e = a[b][d];
if (Base.equalsStatic(e.toLowerCase(), c.toLowerCase())) {
return true;
}
}
return false;
}
getAllPropertiesWithIntent(a) {
return this.m(a, false, false);
}
getAllPropertiesWithValuelessIntent(a) {
return this.m(a, true, false);
}
getPropertyIntentValue(a, b) {
let c = this.u.getCurrentDataSource();
if (c == null) {
return null;
}
let d = c.actualSchema;
if (d == null) {
return null;
}
let e = d.propertyDataIntents;
if (e == null || d.propertyNames == null) {
return null;
}
for (let f = 0; f < d.propertyNames.length; f++) {
if (d.propertyNames[f] != null && Base.equalsStatic(d.propertyNames[f], b)) {
for (let g = 0; g < e[f].length; g++) {
let h = e[f][g];
let i = h.split('/');
if (i.length == 2 && i[0] != null && Base.equalsStatic(i[0], a)) {
return i[1];
}
}
}
}
return null;
}
getAllPropertiesWithValuedIntent(a) {
return this.m(a, false, true);
}
m(a, b, c) {
let d = this.u.getCurrentDataSource();
if (d == null) {
return new Array(0);
}
let e = d.actualSchema;
if (e == null) {
return new Array(0);
}
let f = e.propertyDataIntents;
if (f == null || e.propertyNames == null) {
return new Array(0);
}
let g = 0;
for (let h = 0; h < e.propertyNames.length; h++) {
for (let i = 0; i < f[h].length; i++) {
let j = f[h][i];
let k = j.split('/');
if (b && k.length > 1) {
continue;
}
if (c && k.length < 2) {
continue;
}
if (Base.equalsStatic(a.toLowerCase(), k[0].toLowerCase())) {
g++;
}
}
}
let l = new Array(g);
g = 0;
for (let m = 0; m < e.propertyNames.length; m++) {
for (let n = 0; n < f[m].length; n++) {
let o = f[m][n];
let 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;
}
getAllDateTimeProperties() {
return this.s(runOn(this, this.ag), null);
}
getAllExcludedDateTimeProperties() {
return this.r(runOn(this, this.ag), null);
}
getFirstDateTimeProperty() {
let a = this.getAllDateTimeProperties();
if (a.length == 0) {
return null;
}
return a[0];
}
getFirstStringProperty() {
let a = this.getAllStringProperties();
if (a.length == 0) {
return null;
}
return a[0];
}
hasDateTimeProperties() {
return this.getAllDateTimeProperties().length > 0;
}
ak(a) {
return a == 1 || a == 3 || a == 4 || a == 7 || a == 5 || a == 6 || a == 10;
}
al(a) {
return a == 11;
}
isMonotonic(a, b, c) {
if (a == null) {
return false;
}
let d = false;
let e = false;
let f = a.actualCount;
for (let g = 0; g < Math.min(f, c); g++) {
if (g == 0) {
continue;
}
let h = this.coerceToDouble(a.getItemValue(a.getItemAtIndex(g - 1), b));
let i = this.coerceToDouble(a.getItemValue(a.getItemAtIndex(g), b));
if (!e && h != i) {
d = i > h;
e = true;
}
if (h == i) {
continue;
}
if (e) {
let j = i > h;
if (j != d) {
return false;
}
}
}
return true;
}
isEvenlySpaced(a, b, c) {
if (a == null) {
return false;
}
let d = false;
let e = 0;
let f = a.actualCount;
for (let g = 0; g < Math.min(f, c); g++) {
if (g == 0) {
continue;
}
let h = this.coerceToDouble(a.getItemValue(a.getItemAtIndex(g - 1), b));
let i = this.coerceToDouble(a.getItemValue(a.getItemAtIndex(g), b));
if (!d && h != i) {
let j = Math.abs(i - h);
e = j;
d = true;
continue;
}
if (d) {
let k = Math.abs(i - h);
if (Math.abs(k - e) > 1E-06) {
return false;
}
}
}
return true;
}
a6(a, b, c) {
let d = this.u.getCurrentDataSource();
let e = d.actualSchema;
if (e == null) {
return null;
}
let f = this.s(b, null);
if (f.length == 0) {
return null;
}
if (d.actualCount > a) {
return null;
}
for (let g = 0; g < f.length; g++) {
if (c(f[g], this.v(f[g]))) {
return f[g];
}
}
return null;
}
getFirstDistinctStringProperty(a) {
return this.a6(a, (b) => b == 0, runOn(this, this.am));
}
getFirstDistinctNumericProperty(a) {
return this.a6(a, runOn(this, this.ak), runOn(this, this.aj));
}
getFirstDistinctMonotonicNumericProperty(a) {
let b = this.u.getCurrentDataSource();
return this.a6(a, runOn(this, this.ak), (c, d) => this.aj(c, d) && this.isMonotonic(b, c, a));
}
getFirstDistinctMonotonicNumericPropertyWithEvenSpacing(a) {
let b = this.u.getCurrentDataSource();
return this.a6(a, runOn(this, this.ak), (c, d) => this.aj(c, d) && this.isMonotonic(b, c, a) && this.isEvenlySpaced(b, c, a));
}
getAllDistinctMonotonicNumericProperties(a) {
let b = this.u.getCurrentDataSource();
return this.s(runOn(this, this.ak), (c) => this.aj(c, this.v(c)) && this.isMonotonic(b, c, a));
}
getAllExcludedDistinctMonotonicNumericProperties(a) {
let b = this.u.getCurrentDataSource();
return this.r(runOn(this, this.ak), (c) => this.aj(c, this.v(c)) && this.isMonotonic(b, c, a));
}
getFirstDistinctDateTimeProperty(a) {
return this.a6(a, runOn(this, this.ag), runOn(this, this.af));
}
getFirstStringPropertyPreferringDistinct(a) {
let b = this.getFirstDistinctStringProperty(a);
if (b != null) {
return b;
}
let c = this.getAllStringProperties();
if (c.length == 0) {
return null;
}
return c[0];
}
getTitleString(a, b) {
return this.getTitleStringWithSeparator(a, b, " - ");
}
getTitleStringWithSeparator(a, b, c) {
let d = this.u.getCurrentDataSource();
let e = null;
if (e == null && b != null) {
let f = null;
for (let g = 0; g < b.length; g++) {
let 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) {
let 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) {
let j = this.getAllStringProperties();
for (let l = 0; l < j.length; l++) {
let 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;
}
az(a, b, c) {
if (a != null) {
let d = b.getItemValue(a, c);
if (d != null) {
c = d.toString();
}
}
else {
c = this.getNonNullPropertyValue(c).toString();
}
return c;
}
getNonNullPropertyValue(a) {
let b = this.u.getCurrentDataSource();
for (let c = 0; c < b.actualCount; c++) {
let d = b.getItemValue(b.getItemAtIndex(c), a);
if (d != null) {
return d;
}
}
return null;
}
am(a, b) {
let c = this.u.getCurrentDataSource();
let d = new HashSet$1(String_$type, 0);
for (let e = 0; e < c.actualCount; e++) {
let f = c.getItemValue(c.getItemAtIndex(e), a);
let g = f;
if (d.contains(g)) {
return false;
}
d.add_1(g);
}
return true;
}
af(a, b) {
let c = this.u.getCurrentDataSource();
let d = new HashSet$1(Number_$type, 0);
for (let e = 0; e < c.actualCount; e++) {
let f;
let 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;
}
coerceToDouble(value_) {
return (+value_);
}
aj(a, b) {
let c = this.u.getCurrentDataSource();
if (b == 4 || b == 1 || b == 3) {
let d = new HashSet$1(Number_$type, 0);
for (let e = 0; e < c.actualCount; e++) {
let f;
let 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) {
let h = new HashSet$1(Number_$type, 0);
for (let i = 0; i < c.actualCount; i++) {
let j;
let 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;
}
numericColumnHasDiverseValues(a) {
let b = this.u.getCurrentDataSource();
let c = this.v(a);
let d = a;
let e = new List$1(Number_$type, 0);
if (c == 4 || c == 1 || c == 3) {
for (let f = 0; f < b.actualCount; f++) {
let g;
let 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 (let i = 0; i < b.actualCount; i++) {
let j;
let k = b.getItemValue(b.getItemAtIndex(i), d);
if (k == null) {
j = NaN;
}
else {
j = this.coerceToDouble(k);
}
e.add(j);
}
}
e.y();
for (let l = 1; l < e.count; l++) {
let m = e._inner[l - 1];
let n = e._inner[l];
if (Math.abs(n - m) / n < 0.05) {
return false;
}
}
return true;
}
numericColumnHasNoRange(a, b, c) {
let d = this.v(b);
let e = b;
let f = new List$1(Number_$type, 0);
if (d == 4 || d == 1 || d == 3) {
for (let g = 0; g < a.actualCount; g++) {
let h;
let 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 (let j = 0; j < a.actualCount; j++) {
let k;
let l = a.getItemValue(a.getItemAtIndex(j), e);
if (l == null) {
k = NaN;
}
else {
k = this.coerceToDouble(l);
}
f.add(k);
}
}
let m = 1.7976931348623157E+308;
let n = -1.7976931348623157E+308;
for (let o = 0; o < Math.min(f.count, c); o++) {
let 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;
}
shouldUseLogarithmicScale(a, b) {
return true;
}
}
DataSeriesDataProviderAnalyzer.$t = markType(DataSeriesDataProviderAnalyzer, 'DataSeriesDataProviderAnalyzer');
return DataSeriesDataProviderAnalyzer;
})();
/**
* @hidden
*/
export let DataSeriesAdapterUpdateNotifier = /*@__PURE__*/ (() => {
class DataSeriesAdapterUpdateNotifier extends Base {
constructor(a, b) {
super();
this.a = null;
this.b = null;
this.a = a;
this.b = b;
}
notifyClearItems() {
this.a.a7(this.b);
}
notifyInsertItem(a, b) {
this.a.a8(this.b, a, b);
}
notifyRemoveItem(a, b) {
this.a.a9(this.b, a, b);
}
notifySetItem(a, b, c) {
this.a.ba(this.b, a, b, c);
}
}
DataSeriesAdapterUpdateNotifier.$t = markType(DataSeriesAdapterUpdateNotifier, 'DataSeriesAdapterUpdateNotifier', Base.$, [IDataSourceDataProviderUpdateNotifier_$type]);
return DataSeriesAdapterUpdateNotifier;
})();
/**
* @hidden
*/
export let DataSeriesAdapterRuleCollection = /*@__PURE__*/ (() => {
class DataSeriesAdapterRuleCollection extends ObservableCollection$1 {
constructor() {
super(IDataSeriesAdapterRule_$type, 0);
}
}
DataSeriesAdapterRuleCollection.$t = markType(DataSeriesAdapterRuleCollection, 'DataSeriesAdapterRuleCollection', ObservableCollection$1.$.specialize(IDataSeriesAdapterRule_$type));
return DataSeriesAdapterRuleCollection;
})();
/**
* @hidden
*/
export let DataSeriesAdapterRemovingDuplicatesEventArgs = /*@__PURE__*/ (() => {
class DataSeriesAdapterRemovingDuplicatesEventArgs extends Base {
constructor() {
super(...arguments);
this.b = null;
this.d = null;
this.e = null;
this.a = null;
this.c = false;
}
}
DataSeriesAdapterRemovingDuplicatesEventArgs.$t = markType(DataSeriesAdapterRemovingDuplicatesEventArgs, 'DataSeriesAdapterRemovingDuplicatesEventArgs');
return DataSeriesAdapterRemovingDuplicatesEventArgs;
})();
/**
* @hidden
*/
export let DataSeriesAdapterRunEventArgs = /*@__PURE__*/ (() => {
class DataSeriesAdapterRunEventArgs extends Base {
constructor() {
super(...arguments);
this.a = null;
this.b = false;
}
}
DataSeriesAdapterRunEventArgs.$t = markType(DataSeriesAdapterRunEventArgs, 'DataSeriesAdapterRunEventArgs');
return DataSeriesAdapterRunEventArgs;
})();
/**
* @hidden
*/
export let DataSeriesAdapterImplementation = /*@__PURE__*/ (() => {
class DataSeriesAdapterImplementation extends Base {
constructor() {
super();
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.bb(this.rules);
let a = this.rules;
a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.bj));
}
at(a, b) {
let c = this.ae;
let d = this.ag();
let e = this.af();
if (c != this.z || d != this.ab || e != this.aa) {
this.z = c;
this.ab = d;
this.aa = e;
this.refresh();
}
}
aq(a, b) {
let c = stringEmpty();
if (this.aj != null) {
c = this.aj(a);
}
if (stringIsNullOrEmpty(c)) {
return b;
}
return c;
}
bb(a) {
}
bj(a, b) {
this.refresh();
}
get g() {
return this.al;
}
get itemsSource() {
return this.ak;
}
set itemsSource(a) {
let b = this.ak;
this.ak = a;
if (b != this.ak) {
this.a6("ItemsSource", b, this.ak);
}
}
get supportedSeriesTypes() {
return this.c;
}
set supportedSeriesTypes(a) {
let b = this.c;
this.c = a;
if (b != this.c) {
this.a6("SupportedSeriesTypes", b, this.c);
}
}
get includedProperties() {
return this.b;
}
set includedProperties(a) {
let b = this.b;
this.b = a;
if (b != this.b) {
this.a6("IncludedProperties", b, this.b);
}
}
get excludedProperties() {
return this.a;
}
set excludedProperties(a) {
let b = this.a;
this.a = a;
if (b != this.a) {
this.a6("ExcludedProperties", b, this.a);
}
}
get sortDescriptions() {
return this.t;
}
get postSortDescriptions() {
return this.s;
}
get groupDescriptions() {
return this.r;
}
get filterExpressions() {
return this.m;
}
get highlightFilterExpressions() {
return this.n;
}
get summaryDescriptions() {
return this.x;
}
get rules() {
return this._rules;
}
set rules(a) {
this._rules = a;
}
get dataSeries() {
return this._dataSeries;
}
set dataSeries(a) {
this._dataSeries = a;
}
a6(a, b, c) {
this.bc(a, b, c);
if (this.propertyChanged != null) {
this.propertyChanged(this, new PropertyChangedEventArgs(a));
}
}
bc(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;
}
}
refresh() {
this.ac = true;
this.bi();
let a = new DataSeriesAdapterRunContext(this);
let 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.bl(a);
this.bt(a);
this.av();
this.ac = false;
}
a1(a, b) {
let c = new DataSeriesAdapterRunContext(this);
let d = this.h(this.itemsSource, true);
c.pushDataSource(d.c);
let e = new List$1(String_$type, 0);
let f = new List$1(String_$type, 0);
let g = new List$1(DataSeriesPropertyType_$type, 0);
let h = new HashSet$1(String_$type, 0);
for (let i = 0; i < this.rules.count; i++) {
let j = this.rules._inner[i];
let k = j.getPrimaryAxisLabelsStrings(c);
if (k != null) {
for (let l = 0; l < k.length; l++) {
let m = k[l];
if (m == null) {
continue;
}
h.add_1(m);
let 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 (let o = 0; o < this.rules.count; o++) {
let p = this.rules._inner[o];
let q = p.getAdditionalValuePropertyStrings(c);
if (q != null) {
for (let r = 0; r < q.length; r++) {
let s = q[r];
if (s == null) {
continue;
}
if (h.contains(s)) {
continue;
}
let t = c.ai(r);
if (stringIsNullOrEmpty(t)) {
e.add(s);
f.add(c.analyzer.expandCamelCasedWords(s));
}
else {
e.add(t + "." + s);
f.add(t + "." + c.analyzer.expandCamelCasedWords(s));
}
g.add(c.h(r));
}
}
}
if (d.c.actualSchema != null) {
let u = d.c.actualSchema.propertyNames;
for (let v = 0; v < u.length; v++) {
let w = u[v];
let x = d.c.actualSchema.propertyTypes[v];
let y = x == 0 ? 0 : x == 8 || x == 9 ? 1 : 2;
if (h.contains(w) && u.length > 1) {
if (h.count <= 1) {
continue;
}
else {
if (y == 2) {
h.remove(w);
let z = new List$1(String_$type, 0);
let aa = new List$1(String_$type, 0);
let ab = new List$1(DataSeriesPropertyType_$type, 0);
for (let ac = 0; ac < a.b.length; ac++) {
if (!Base.equalsStatic(a.b[ac], w)) {
z.add(a.b[ac]);
aa.add(a.a[ac]);
ab.add(a.c[ac]);
}
}
a.b = z.toArray();
a.a = aa.toArray();
a.c = ab.toArray();
}
else {
continue;
}
}
}
e.add(w);
f.add(c.analyzer.expandCamelCasedWords(w));
g.add(y);
}
}
b.b = e.toArray();
b.a = f.toArray();
b.c = g.toArray();
}
bi() {
for (let a of fromEnum(this.ai.keys)) {
let b = this.ai.item(a);
b.d = false;
}
}
av() {
let a = new List$1(Base.$, 0);
for (let b of fromEnum(this.ai.keys)) {
let c = this.ai.item(b);
if (!c.d) {
a.add1(b);
this.aw(c);
}
}
for (let d = 0; d < a.count; d++) {
let e = a._inner[d];
this.ai.removeItem(e);
}
}
bt(a) {
this.bh(a);
this.bg(a);
this.bp(a);
}
bh(a) {
let b = true;
if (this.removingUnsupported != null) {
let c = ((() => {
let $ret = new DataSeriesAdapterRunEventArgs();
$ret.a = a;
return $ret;
})());
this.removingUnsupported(this, c);
b = !c.b;
}
if (b) {
if (this.supportedSeriesTypes == null) {
return;
}
let d = new HashSet$1(DataSeriesType_$type, 0);
for (let e = 0; e < this.supportedSeriesTypes.length; e++) {
d.add_1(this.supportedSeriesTypes[e]);
}
for (let f = a.getDataSeriesCount() - 1; f >= 0; f--) {
let g = a.getDataSeriesAt(f);
if (!d.contains(g.suggestedSeries)) {
a.removeDataSeries(g);
}
}
}
}
bp(a) {
let 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--;
}
}
bg(a) {
let b = new Dictionary$2(String_$type, List$1.$.specialize(DataSeries.$), 0);
for (let c = 0; c < a.getDat