igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
248 lines (247 loc) • 8.44 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 { BaseVirtualDataProvider } from "./BaseVirtualDataProvider";
import { Base, Number_$type, runOn, String_$type, markType } from "./type";
import { PageRequestedEventArgs } from "./PageRequestedEventArgs";
import { FastIterationDictionary$2 } from "./FastIterationDictionary$2";
import { GenericPageResponse } from "./GenericPageResponse";
import { AsyncVirtualDataSourceProviderWorker } from "./AsyncVirtualDataSourceProviderWorker";
import { GenericVirtualDataProviderWorkerSettings } from "./GenericVirtualDataProviderWorkerSettings";
import { GenericVirtualDataProviderWorker } from "./GenericVirtualDataProviderWorker";
import { InvalidOperationException } from "./InvalidOperationException";
import { List$1 } from "./List$1";
import { Dictionary$2 } from "./Dictionary$2";
import { GenericSectionInformation } from "./GenericSectionInformation";
import { DefaultSummaryResult } from "./DefaultSummaryResult";
/**
* @hidden
*/
export let GenericInternalVirtualDataProvider = /*@__PURE__*/ (() => {
class GenericInternalVirtualDataProvider extends BaseVirtualDataProvider {
constructor() {
super();
this.am = -1;
this.al = -1;
this.ak = new FastIterationDictionary$2(Number_$type, GenericPageResponse.$, 0);
this.pageRequested = null;
}
e() {
if (!this.q()) {
return null;
}
let a = this.c(null);
return new GenericVirtualDataProviderWorker(a);
}
c(a) {
let b = new GenericVirtualDataProviderWorkerSettings();
b.pageRequested = runOn(this, this.a8);
b.sortDescriptions = this.sortDescriptions;
b.groupDescriptions = this.groupDescriptions;
b.filterExpressions = this.filterExpressions;
b.summaryDescriptions = this.summaryDescriptions;
b.summaryScope = this.summaryScope;
return super.c(b);
}
a8(a, b, c, d) {
this.executionContext.execute(() => {
let e = new GenericPageResponse();
e.h = a;
e.a = d;
e.i = this.actualCount;
this.ak.s(a, e);
if (this.pageRequested != null) {
let f = new PageRequestedEventArgs();
f.a = b == AsyncVirtualDataSourceProviderWorker.ac;
f.e = a;
f.b = -1;
f.c = b;
f.d = c;
this.pageRequested(this, f);
}
});
}
ai() {
if (this.am == -1) {
throw new InvalidOperationException(1, "Must call FillPageStart before trying to fill a page.");
}
let a = this.ak.item(this.am);
if (a.c == null) {
a.c = new List$1(Dictionary$2.$.specialize(String_$type, Base.$), 0);
}
return a;
}
a7(a) {
this.am = a;
if (!this.ak.d(this.am)) {
throw new InvalidOperationException(1, "The provided request ID is not valid.");
}
}
a6() {
let a = this.ai();
if (a == null) {
return;
}
a.a.setResult(a);
this.am = -1;
}
ay(a) {
let b = this.ai();
if (b == null) {
return;
}
b.i = a;
}
at(a, b) {
let c = this.ai();
if (c == null) {
return;
}
for (let d = 0; d < b.length; d++) {
if (d >= c.c.count) {
c.c.add(new Dictionary$2(String_$type, Base.$, 0));
}
c.c._inner[d].item(a, b[d]);
}
}
aw(a, b) {
let c = this.ai();
if (c == null) {
return;
}
for (let d = 0; d < b.length; d++) {
if (d >= c.c.count) {
c.c.add(new Dictionary$2(String_$type, Base.$, 0));
}
c.c._inner[d].item(a, b[d]);
}
}
av(a, b) {
let c = this.ai();
if (c == null) {
return;
}
for (let d = 0; d < b.length; d++) {
if (d >= c.c.count) {
c.c.add(new Dictionary$2(String_$type, Base.$, 0));
}
c.c._inner[d].item(a, b[d]);
}
}
ax(a, b) {
let c = this.ai();
if (c == null) {
return;
}
for (let d = 0; d < b.length; d++) {
if (d >= c.c.count) {
c.c.add(new Dictionary$2(String_$type, Base.$, 0));
}
c.c._inner[d].item(a, b[d]);
}
}
au(a, b) {
let c = this.ai();
if (c == null) {
return;
}
for (let d = 0; d < b.length; d++) {
if (d >= c.c.count) {
c.c.add(new Dictionary$2(String_$type, Base.$, 0));
}
c.c._inner[d].item(a, b[d]);
}
}
an(a, b) {
let c = this.ai();
if (c == null) {
return;
}
c.e.add(a);
switch (b) {
case 0:
c.f.add(2);
break;
case 1:
c.f.add(1);
break;
case 2:
c.f.add(5);
break;
case 3:
c.f.add(8);
break;
case 4:
c.f.add(0);
break;
}
}
a0(a, b) {
let c = this.ai();
if (c == null) {
return;
}
let d = new GenericSectionInformation();
d.startIndex = a;
d.endIndex = b;
c.b.add(d);
this.al = c.b.count - 1;
}
az() {
this.al = -1;
}
a4(a, b) {
this.a1(a, b);
}
a3(a, b) {
this.a1(a, b);
}
a5(a, b) {
this.a1(a, b);
}
a2(a, b) {
this.a1(a, b);
}
a1(a, b) {
let c = this.ai();
if (c == null) {
return;
}
if (this.al == -1) {
throw new InvalidOperationException(1, "Must call FillGroupStart before trying to fill a group.");
}
let d = c.b._inner[this.al];
d.d(a, b);
}
ar(a, b, c) {
this.ao(a, b, c);
}
aq(a, b, c) {
this.ao(a, b, c);
}
as(a, b, c) {
this.ao(a, b, c);
}
ap(a, b, c) {
this.ao(a, b, c);
}
ao(a, b, c) {
let d = this.ai();
if (d == null) {
return;
}
if (this.al != -1) {
let e = d.b._inner[this.al];
e.e(new DefaultSummaryResult(a, b, c));
}
else {
d.g.add(new DefaultSummaryResult(a, b, c));
}
}
}
GenericInternalVirtualDataProvider.$t = markType(GenericInternalVirtualDataProvider, 'GenericInternalVirtualDataProvider', BaseVirtualDataProvider.$);
return GenericInternalVirtualDataProvider;
})();