igniteui-react-core
Version:
Ignite UI React Core.
355 lines (354 loc) • 11.1 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 { Base, markType } from "./type";
import { List$1 } from "./List$1";
import { SectionData } from "./SectionData";
import { SectionDataStartIndexComparer } from "./SectionDataStartIndexComparer";
import { SectionDataUndisplacedStartIndexComparer } from "./SectionDataUndisplacedStartIndexComparer";
import { SectionSearchData } from "./SectionSearchData";
/**
* @hidden
*/
export let SectionMap = /*@__PURE__*/ (() => {
class SectionMap extends Base {
constructor() {
super();
this.a = new SectionData();
this.j = new SectionDataStartIndexComparer();
this.k = new SectionDataUndisplacedStartIndexComparer();
this.s = new List$1(SectionData.$, 0);
this.m = new SectionSearchData();
this.l = new SectionSearchData();
}
get t() {
return this.s;
}
get u() {
return this.s._inner[this.s.count - 1].ad + 1;
}
get q() {
return this.t.count > 0;
}
n(a, b, c) {
if (a >= 0 && a < this.s.count) {
let d = this.s._inner[a];
if (b >= d.af && b <= d.ad) {
c.c = c.c + 1;
if (c.c >= c.a.length) {
c.c = 0;
}
c.b[c.c] = a;
c.a[c.c] = d;
return true;
}
}
return false;
}
o(a, b, c) {
if (a >= 0 && a < this.s.count) {
let d = this.s._inner[a];
if ((b >= d.ac && b <= d.ab) || (!d.p && b >= d.ac)) {
c.c = c.c + 1;
if (c.c >= c.a.length) {
c.c = 0;
}
c.b[c.c] = a;
c.a[c.c] = d;
return true;
}
}
return false;
}
e(a) {
return this.f(a, this.j, this.m);
}
f(a, b, c) {
if (c.a == null) {
c.a = new Array(5);
c.b = new Array(5);
for (let d = 0; d < c.a.length; d++) {
c.a[d] = null;
c.b[d] = -1;
}
}
if (c.a[c.c] != null) {
if (a >= c.a[c.c].af && a <= c.a[c.c].ad) {
return c.a[c.c];
}
for (let e = 0; e < c.a.length; e++) {
if (c.a[e] != null) {
if (a >= c.a[e].af && a <= c.a[e].ad) {
c.c = e;
return c.a[c.c];
}
}
}
let f = c.b[c.c] + 1;
if (this.n(f, a, c)) {
return c.a[c.c];
}
f = c.b[c.c] - 1;
if (this.n(f, a, c)) {
return c.a[c.c];
}
}
this.a.af = a;
let g = this.s.g(this.a, b);
if (g < 0) {
g = ~g;
g--;
}
if (this.n(g, a, c)) {
return c.a[c.c];
}
if (this.n(g + 1, a, c)) {
return c.a[c.c];
}
if (this.n(g - 1, a, c)) {
return c.a[c.c];
}
return null;
}
h(a, b, c) {
if (c.a == null) {
c.a = new Array(5);
c.b = new Array(5);
for (let d = 0; d < c.a.length; d++) {
c.a[d] = null;
c.b[d] = -1;
}
}
if (c.a[c.c] != null) {
let e = c.a[c.c];
if (a >= e.ac && a <= e.ab) {
return e;
}
for (let f = 0; f < c.a.length; f++) {
if (c.a[f] != null) {
if (a >= c.a[f].ac && a <= c.a[f].ab) {
c.c = f;
return c.a[c.c];
}
}
}
let g = c.b[c.c] + 1;
if (this.o(g, a, c)) {
return c.a[c.c];
}
g = c.b[c.c] - 1;
if (this.o(g, a, c)) {
return c.a[c.c];
}
}
this.a.af = a;
let h = this.s.g(this.a, b);
if (h < 0) {
h = ~h;
h--;
}
if (this.o(h, a, c)) {
return c.a[c.c];
}
if (this.o(h + 1, a, c)) {
return c.a[c.c];
}
if (this.o(h - 1, a, c)) {
return c.a[c.c];
}
return null;
}
v() {
this.s.clear();
this.m.a = null;
this.l.a = null;
}
ac(a, b, c) {
for (let d = a.ae + 1; d < this.s.count; d++) {
let e = this.s._inner[d];
e.t += c;
e.af += b;
e.ad += b;
for (let f = 0; f < e.h.length; f++) {
if (e.h[f] != -1) {
e.h[f] += b;
}
}
}
}
ab(a, b, c) {
for (let d = a.ae; d < this.s.count; d++) {
let e = this.s._inner[d];
e.t += c;
e.af += b;
e.ad += b;
e.ae = d;
if (e.z > a.ae) {
e.z -= 1;
}
for (let f = 0; f < e.h.length; f++) {
if (e.h[f] != -1) {
e.h[f] += b;
}
}
}
}
x(a) {
if (this.s.count == 0) {
return;
}
let b = this.s._inner[this.s.count - 1];
b.ad = a;
}
i(a, b, c, d, e, f) {
let g = this.b(b, c, d, e, f);
g.af = a;
g.ae = this.s.count;
if (this.s.count > 0) {
g.t = this.s._inner[this.s.count - 1].t;
}
this.s.add(g);
return g;
}
b(a, b, c, d, e) {
let f = new SectionData();
f.e = c;
f.d = new Array(c.length);
let g = new Array(c.length);
for (let h = 0; h < g.length; h++) {
f.d[h] = 0;
g[h] = a.getItemProperty(b, c[h]);
}
f.f = g;
f.ai(d, e);
let i = d == 1 ? c.length : 1;
f.b = new Array(i);
f.h = new Array(i);
f.i = new Array(i);
for (let j = 0; j < i; j++) {
f.h[j] = -1;
f.i[j] = new Array(a.summaryDescriptions.k.count);
for (let k = 0; k < a.summaryDescriptions.k.count; k++) {
f.i[j][k] = null;
}
}
f.g = new Array(c.length);
return f;
}
ad(a, b, c) {
for (let d = a.ae + 1; d < this.s.count; d++) {
this.s._inner[d].ae = d;
this.s._inner[d].t += c;
this.s._inner[d].af += b;
this.s._inner[d].ad += b;
for (let e = 0; e < this.s._inner[d].h.length; e++) {
if (this.s._inner[d].h[e] != -1) {
this.s._inner[d].h[e] += b;
}
}
}
}
aa(a, b) {
this.s.insert(a, b);
}
ae(a) {
if (this.m != null) {
let b = this.m;
SectionMap.w(a, b);
}
if (this.l != null) {
let c = this.l;
SectionMap.w(a, c);
}
this.s._inner[a].o = true;
this.s.removeAt(a);
}
static w(a, b) {
if (b.a != null) {
for (let c = 0; c < b.a.length; c++) {
if (b.a[c] != null) {
if (b.a[c].ae == a) {
b.a[c] = null;
}
}
}
}
}
d() {
return this.s._inner[this.s.count - 1];
}
c() {
return this.s._inner[0];
}
y() {
this.s._inner[this.s.count - 1].t += 1;
}
g(a) {
return this.h(a, this.k, this.l);
}
p(a) {
for (let b = 0; b < this.t.count; b++) {
if (b == a.ae) {
continue;
}
if (this.t._inner[b].z == a.ae) {
return true;
}
}
return false;
}
z(a, b) {
if (a.e == null) {
a.d[0] += b;
return;
}
if (a.z == -1) {
for (let c = 0; c < a.e.length; c++) {
a.d[c] += b;
}
}
else {
let d = a.w();
for (let e = a.w(); e < a.e.length; e++) {
a.d[e] += b;
}
let f = a.z;
while (f >= 0) {
let g = this.t._inner[f];
let h = g.w();
g.d[h] += b;
f = g.z;
}
}
}
af(a, b) {
for (let c = 0; c < a.ae; c++) {
let d = this.s._inner[c];
for (let e = 0; e < a.e.length; e++) {
if (d.a[e] != null && (d.f[e] == a.f[e] || Base.equalsStatic(d.f[e], a.f[e]))) {
a.z = c;
a.a[e] = null;
}
}
}
}
r(a) {
let b = a.w();
if (b == 0) {
return true;
}
let c = this.s._inner[a.z];
for (let d = b - 1; d >= 0; d--) {
if (!c.c[d]) {
return false;
}
}
return this.r(c);
}
}
SectionMap.$t = /*@__PURE__*/ markType(SectionMap, 'SectionMap');
return SectionMap;
})();