UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

1,374 lines 86.8 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 { Base, String_$type, Number_$type, typeCast, Array_$type, Boolean_$type, markType } from "./type"; import { ISupportsDataChangeNotifications_$type } from "./ISupportsDataChangeNotifications"; import { List$1 } from "./List$1"; import { SectionData } from "./SectionData"; import { SectionMap } from "./SectionMap"; import { Dictionary$2 } from "./Dictionary$2"; import { DataSourceSpecialRow } from "./DataSourceSpecialRow"; import { SummaryGroup } from "./SummaryGroup"; import { RemovedShiftedRowInfo } from "./RemovedShiftedRowInfo"; import { dateNow } from "./date"; /** * @hidden */ export let RearrangedListView = /*@__PURE__*/ (() => { class RearrangedListView extends Base { constructor(a) { super(); this.n = null; this.a4 = null; this.z = new SectionMap(); this.e = null; this.a = null; this.b = null; this.c = null; this.d = null; this.a8 = 0; this.a7 = 0; this.am = false; this.as = false; this.o = null; this.a0 = null; this.az = null; this.s = null; this.aa = null; this.ac = null; this.m = null; this.ae = null; this.af = null; this.ag = null; this.ap = false; this.k = 0; this.j = 0; this.av = false; this.au = false; this.aw = false; this.ah = false; this.a3 = new List$1(Array_$type, 0); this.ay = new Dictionary$2(String_$type, Boolean_$type, 0); this.n = a; } get bk() { return this.a7; } get i() { return this.e; } get a6() { return this.a4; } get aq() { if (!this.m.isSectionContentVisible) { return true; } return this.m.isSectionCollapsable; } w(a) { return this.z.e(a); } v() { return this.z.d(); } get p() { return this.o; } set p(a) { this.o = a; } get a2() { return this.a0; } set a2(a) { this.a0 = a; } get a1() { return this.az; } set a1(a) { this.az = a; } get t() { return this.s; } set t(a) { this.s = a; } get ab() { return this.aa; } set ab(a) { this.aa = a; } get ad() { return this.ac; } set ad(a) { this.ac = a; } get l() { return this.k; } set l(a) { this.k = a; } get ar() { if (!this.m.isSectionContentVisible) { return false; } if (this.aq) { return this.m.isSectionExpandedDefault; } return true; } b6() { if (this.a4 == this.n || this.a4 == null) { this.a4 = new List$1(Base.$, 0); } this.a4.clear(); if (!this.aq) { this.ay.clear(); } if (this.n == null) { return; } let a = this.n.actualCount; this.a7 = 0; this.a8 = this.ba(); this.br(null); let b = this.ag.k.count > 0 && this.l != 2 && this.l != 3; if (this.s == null) { for (let c = 0; c < a; c++) { let d = this.n.getItemAtIndex(c); this.a4.add1(d); if (b) { this.bq(null, d); } } } else { for (let e = 0; e < a; e++) { let f = this.n.getItemAtIndex(e); if (this.s(f)) { this.a4.add1(f); if (b) { this.bq(null, f); } } } } this.bu(null); if (this.a0 != null) { this.a4.z(this.a0); } this.ah = false; this.z.v(); if (this.ae != null && this.ae.k.count > 0) { this.ah = true; this.b1(); } else { this.z.t.add(((() => { let $ret = new SectionData(); $ret.ae = 0; $ret.e = null; $ret.f = null; $ret.af = 0; $ret.ad = this.a4.count; $ret.c = new Array(0); $ret.d = new Array(1); return $ret; })())); } if (b) { this.bw(this.e); } let g = this.p; let h = new List$1(Base.$, 0); if (this.a3.count > 0 && this.aw) { if (!this.ah) { let i = this.z.t._inner[0]; for (let j = 0; j < this.a3.count; j++) { let k = this.m.indexOfKey(this.a3._inner[j]); if (k != -1) { this.bj(i, this.a4._inner[k], j); } } } else { for (let l = 0; l < this.a3.count; l++) { let m = this.m.indexOfKey(this.a3._inner[l]); if (m != -1) { let n = this.z.e(m); this.bj(n, this.a4._inner[m], l); } } } } if (this.ab != null) { this.ab.notifyClearItems(); } } bl(a, b) { let c = null; if (a.p) { if (b) { let d = a.af + a.v() + a.ah + a.aa; c = this.a4._inner[d]; } else { let e = a.ad - a.u - a.ag; c = this.a4._inner[e]; } } return c; } get a5() { return this.z.t; } b1() { if (this.a4.count == 0) { return; } let a = dateNow(); let b = this.f(); let c = this.g(); let d = this.j == 1 ? c.length : 1; if (this.b == null || this.b.length != c.length) { this.a = new Array(d); this.b = new Array(d); for (let e = 0; e < d; e++) { this.a[e] = null; this.b[e] = null; } } this.c = new Array(d); for (let f = 0; f < d; f++) { this.c[f] = new Array(this.ag.k.count); } let g = this.l == 3 || this.l == 1; let h = new List$1(Base.$, 0); let i = null; let j = null; if (this.m.isSectionContentVisible || !this.av) { for (let k = 0; k < this.a4.count; k++) { let l = this.a4._inner[k]; if (l == null) { continue; } if (i == null) { let m = this.x(k, l, c); k += this.bc(m, k, b, c, true); this.bs(m, true, g); this.z.z(m, 1); this.bq(m, l); j = l; } else { if (this.a1.compare(i, l) != 0) { let n = this.z.t._inner[this.z.t.count - 1]; if (n.q) { k += this.bb(k, j, b, c); } this.bt(k - 1, j, b); let o = this.x(k, l, c); this.bs(o, false, g); let p = this.bc(o, k, b, c, true); k += p; o.q = this.z.r(o); this.z.z(o, 1); this.bq(o, l); j = l; } else { let q = this.z.t._inner[this.z.t.count - 1]; this.z.z(q, 1); this.bq(q, l); } } if (k == this.a4.count - 1) { let r = this.z.t._inner[this.z.t.count - 1]; if (r.q) { k += this.bb(k + 1, j, b, c); } this.bt(k, j, b); } i = l; } if (!g) { if (this.j == 1) { for (let s = 0; s < c.length; s++) { if (this.b[s] == null) { continue; } for (let t = 0; t < this.ag.k.count; t++) { this.b[s].i[s][t] = this.c[s][t].endCalculation(); this.b[s].i[s][t].summaryIndex = t; this.b[s].i[s][t].groupKey = this.b[s].f; } for (let u = 0; u < this.b[s].h.length; u++) { if (this.b[s].h[u] == -1) { this.b[s].h[u] = this.z.t._inner[this.z.t.count - 1].ad + 1; } } } } else { if (this.b[0] != null) { for (let v = 0; v < this.ag.k.count; v++) { this.b[0].i[0][v] = this.c[0][v].endCalculation(); this.b[0].i[0][v].summaryIndex = v; this.b[0].i[0][v].groupKey = this.b[0].f; } this.b[0].h[0] = this.z.t._inner[this.z.t.count - 1].ad + 1; } } } this.bx(); for (let w = 0; w < this.z.t.count; w++) { let x = this.z.t._inner[w]; if (this.av) { if (!x.q) { let y = x.ad - x.af + 1; if (this.j == 1 && this.ae.k.count > 1 && this.am && this.as) { let z = x.w(); let aa = false; if (w + 1 < this.z.t.count && this.z.t._inner[w + 1].w() == 0) { aa = true; } if (aa) { let ab = x.v(); y = ab + x.d[x.d.length - 1]; } } this.a4.v(x.af, y); this.z.ae(x.ae); this.z.ab(x, -y, -y); w--; } else if (!x.p) { let ac = 0; let ad = x.w(); for (let ae = ad; ae < x.c.length; ae++) { ac = x.b[ae]; if (!x.c[ae]) { break; } } let af = x.af + ac + 1; let ag = x.d[x.d.length - 1]; this.a4.v(af, ag); x.ad -= ag; this.z.ac(x, -ag, -ag); } } } } else { for (let ah = 0; ah < this.a4.count; ah++) { let ai = this.a4._inner[ah]; if (ai == null) { continue; } if (i == null) { let aj = this.x(ah, ai, c); this.bd(h, aj, ai, b, c, true); this.bs(aj, true, g); this.z.z(aj, 1); this.bq(aj, ai); j = ai; } else { if (this.a1.compare(i, ai) != 0) { let ak = this.z.t._inner[this.z.t.count - 1]; this.bt(h.count - 1, j, b); let al = this.x(ah, ai, c); this.bs(al, false, g); this.bd(h, al, ai, b, c, true); al.q = this.z.r(al); this.z.z(al, 1); this.bq(al, ai); j = ai; } else { let am = this.z.t._inner[this.z.t.count - 1]; this.z.z(am, 1); this.bq(am, ai); } } if (ah == this.a4.count - 1) { let an = this.z.t._inner[this.z.t.count - 1]; this.bt(ah, j, b); } i = ai; } this.a4 = h; } for (let ao = 0; ao < this.b.length; ao++) { this.a[ao] = null; this.b[ao] = null; } this.c = null; let ap = dateNow(); } bs(a, b, c) { if (b) { for (let d = 0; d < this.b.length; d++) { this.b[d] = a; if (!c) { for (let e = 0; e < this.ag.k.count; e++) { let f = this.ag.k.item(e); this.c[d][e] = f.f(); this.c[d][e].beginCalculation(this.m, f.propertyName); } } } } if (this.j == 1) { let g = false; let h = a.e.length; for (let i = 0; i < h; i++) { if (g) { if (!c) { for (let j = 0; j < this.ag.k.count; j++) { this.b[i].i[i][j] = this.c[i][j].endCalculation(); this.b[i].i[i][j].summaryIndex = j; this.b[i].i[i][j].groupKey = this.b[i].f; this.c[i][j].beginCalculation(this.m, this.ag.k.item(j).propertyName); } this.b[i].h[i] = a.af; } this.b[i] = a; continue; } let k = false; if (this.b[i].f[i] == null) { k = a.f[i] != null; } else { k = !Base.equalsStatic(this.b[i].f[i], a.f[i]); } if (k) { if (!c) { for (let l = 0; l < this.ag.k.count; l++) { this.b[i].i[i][l] = this.c[i][l].endCalculation(); this.b[i].i[i][l].summaryIndex = l; this.b[i].i[i][l].groupKey = this.b[i].f; this.c[i][l].beginCalculation(this.m, this.ag.k.item(l).propertyName); } this.b[i].h[i] = a.af; } this.b[i] = a; if (i - 1 > -1) { let m = i - 1; while (m >= 0 && this.b[m].o) { m = m - 1; } a.z = this.b[m].ae; } g = true; } } } else { let n = false; for (let o = 0; o < a.e.length; o++) { if (this.b[0].f[o] == null) { if (this.b[0].f[o] != a.f[o]) { n = true; break; } continue; } if (!Base.equalsStatic(this.b[0].f[o], a.f[o])) { n = true; break; } } if (n) { if (!c) { for (let p = 0; p < this.ag.k.count; p++) { this.b[0].i[0][p] = this.c[0][p].endCalculation(); this.b[0].i[0][p].summaryIndex = p; this.b[0].i[0][p].groupKey = this.b[0].f; this.c[0][p].beginCalculation(this.m, this.ag.k.item(p).propertyName); } this.b[0].h[0] = a.af; } this.b[0] = a; } } } ba() { let a = 0; let b = new Dictionary$2(String_$type, Number_$type, 0); for (let c = 0; c < this.ag.k.count; c++) { let d = this.ag.k.item(c).propertyName; if (!b.containsKey(d)) { b.addItem(d, 1); } else { b.item(d, b.item(d) + 1); } if (b.item(d) > a) { a = b.item(d); } } return a; } bd(a, b, c, d, e, f) { let g = 0; if (this.av) { if (this.m.sectionHeaderDisplayMode == 0) { if (this.an(a, 0, c, d, e, f)) { this.z.y(); g++; if (b != null) { let h = this.bm(b); b.a[0] = h; b.c[0] = this.al(h); b.b[0] = (a.count - 1) - b.af; } } } else if (this.m.sectionHeaderDisplayMode == 1) { for (let i = 0, j = 0; i < e.length; i++) { let k = a.count + j; if (this.an(a, i, c, d, [e[i]], f)) { g++; this.z.y(); if (b != null) { let l = this.bn(b, i); b.a[i] = l; b.c[i] = this.al(l); b.b[i] = k - b.af; if (!b.c[i]) { break; } } else if (!this.ar) { break; } j++; } } } } return g; } bc(a, b, c, d, e) { let f = 0; if (this.av) { let g = this.a4._inner[b]; if (this.m.sectionHeaderDisplayMode == 0) { if (this.ao(b, 0, g, c, d, e)) { this.z.y(); f++; if (a != null) { let h = this.bm(a); a.a[0] = h; a.c[0] = this.al(h); a.b[0] = b - a.af; } } } else if (this.m.sectionHeaderDisplayMode == 1) { for (let i = 0, j = 0; i < d.length; i++) { let k = b + j; if (this.ao(k, i, g, c, [d[i]], e)) { f++; this.z.y(); if (a != null) { let l = this.bn(a, i); a.a[i] = l; a.c[i] = this.al(l); a.b[i] = k - a.af; if (!a.c[i]) { break; } } else if (!this.ar) { break; } j++; } } } } return f; } ao(a, b, c, d, e, f) { let g = new DataSourceSpecialRow(); g.level = b; for (let h = 0; h < d.length; h++) { g.setValue(d[h], this.m.getItemProperty(c, d[h])); if (h < e.length) { g.setSectionValue(e[h], this.m.getItemProperty(c, e[h])); } } g.rowType = 1; g.summaryResults = new Array(this.ag.k.count); if (f && this.a != null) { if (this.a[b] != null) { if (this.a[b].l(g)) { return false; } else { this.a[b] = g; for (let i = b + 1; i < this.a.length; i++) { this.a[i] = null; } } } else { this.a[b] = g; } } this.a4.insert1(a, g); return true; } an(a, b, c, d, e, f) { let g = new DataSourceSpecialRow(); g.level = b; for (let h = 0; h < d.length; h++) { g.setValue(d[h], this.m.getItemProperty(c, d[h])); if (h < e.length) { g.setSectionValue(e[h], this.m.getItemProperty(c, e[h])); } } g.rowType = 1; g.summaryResults = new Array(this.ag.k.count); if (f && this.a != null) { if (this.a[b] != null) { if (this.a[b].l(g)) { return false; } else { this.a[b] = g; for (let i = b + 1; i < this.a.length; i++) { this.a[i] = null; } } } else { this.a[b] = g; } } a.add1(g); return true; } bb(a, b, c, d) { let e = 0; if (this.au) { if (this.m.sectionHeaderDisplayMode == 0) { this.bv(a, 0, b, c, d); e++; } else if (this.m.sectionHeaderDisplayMode == 1) { for (let f = d.length - 1; f >= 0; f--) { if (this.z.t._inner[this.z.t.count - 1].c[f]) { this.bv(a, f, b, c, [d[f]]); a++; e++; } } } } return e; } bv(a, b, c, d, e) { let f = new DataSourceSpecialRow(); f.level = b; for (let g = 0; g < d.length; g++) { f.setValue(d[g], this.m.getItemProperty(c, d[g])); if (g < e.length) { f.setSectionValue(e[g], this.m.getItemProperty(c, e[g])); } } f.rowType = 2; this.a4.insert1(a, f); } q(a, b, c) { let d = this.r(b, 0, c, 5); if (this.as) { a.ag++; } else { a.ah++; } a.ad++; this.z.ac(a, 1, 1); return d; } r(a, b, c, d) { let e = ((() => { let $ret = new DataSourceSpecialRow(); $ret.level = b; $ret.rowType = d; $ret.summaryResults = c; return $ret; })()); this.a4.insert1(a, e); return e; } bf(a, b, c) { let d = a.v(); let e = a.af + a.ah + a.aa; if (this.av) { e += d; } this.bh(e, a.c.length, b); a.aa++; a.ad++; a.t++; if (c) { this.z.ac(a, 1, 1); } return e; } bg(a, b, c) { let d = a.v(); if (this.av) { b += d; } this.bh(b, a.c.length, c); a.aa++; a.ad++; a.t++; this.z.ac(a, 1, 1); return b; } bh(a, b, c) { let d = new DataSourceSpecialRow(); d.rowType = 3; d.targetRow = c; d.level = b; this.a4.insert1(a, d); return a + 1; } bi(a, b) { let c = -1; for (let d = 0; d < this.a3.count; d++) { if (this.p.i(b, this.a3._inner[d]) == 0) { c = d; break; } } return this.bj(a, b, c); } bj(a, b, c) { let d = -1; if (c != -1) { let e = a.af; let f = e + a.aa; let g = false; for (let h = e; h < f; h++) { let i = this.av ? h + 1 : h; let j = typeCast(DataSourceSpecialRow.$, this.a4._inner[i]); if (j.targetRow != null) { if (this.a0 != null) { let k = this.a0.compare(b, j.targetRow); if (k == 0 || k < 0) { d = this.bg(a, h, b); g = true; break; } } else { let l = -1; for (let m = 0; m < this.a3.count; m++) { if (this.p.i(j.targetRow, this.a3._inner[m]) == 0) { l = m; break; } } if (l > c) { d = this.bg(a, h, b); g = true; break; } } } } if (!g) { d = this.bf(a, b, true); g = true; } } return d; } bw(a) { let b = SectionData.r(a); this.a7 = b.count; for (let c = 0; c < b.count; c++) { let d = new Array(b._inner[c].count); b._inner[c].values.copyTo(d, 0); this.r(this.a4.count, 0, d, 4); } } bx() { if (this.l == 0 || this.l == 2) { for (let a = 0; a < this.z.t.count; a++) { let b = this.z.t._inner[a]; if (!b.q) { continue; } if (this.am) { if (this.as) { this.by(b, false); } else { this.bz(b, false); } } else { for (let c = 0; c < b.i.length; c++) { let d = this.a4._inner[b.af + b.b[c]]; if (d != null) { d.summaryResults = b.i[c]; } if (!b.c[c]) { break; } } } } } } bz(a, b) { let c = 0; let d = this.bl(a, !this.as); for (let e = 0; e < a.i.length; e++) { if (a.a[e] == null || !a.c[e]) { continue; } let f = SectionData.r(a.i[e]); if (this.av) { c += 1; } a.g[e] = new SummaryGroup(); a.g[e].a = new Array(this.a8); for (let g = 0; g < f.count; g++) { let h = new Array(f._inner[g].count); f._inner[g].values.copyTo(h, 0); let i = a.af + c + g; let j = this.r(i, e + 1, h, 5); a.ak(j, g); for (let k = e + 1; k < a.b.length; k++) { a.b[k]++; } a.ad++; a.ah++; this.z.ad(a, 1, 1); if (d != null) { let l = this.f(); for (let m = 0; m < l.length; m++) { j.setValue(l[m], this.m.getItemProperty(d, l[m])); } } if (b && this.ab != null) { this.ab.notifyInsertItem(i, j); } } c += f.count; } } be(a, b, c) { let d = a.h[b]; let e = SectionData.r(a.i[b]); for (let f = 0; f < e.count; f++) { let g = new Array(e._inner[f].count); e._inner[f].values.copyTo(g, 0); let h = this.z.e(d - 1); let i = this.r(d + f, b + 1, g, 5); a.ak(i, f); h.ad++; h.ag++; this.z.ac(h, 1, 1); let j = null; let k = 0; for (let l = d + f - 1; l >= 0; l--) { let m = this.m.getRowType(l); if (m == 0 || m == 1) { j = this.a4._inner[l]; k = m; break; } } if (j != null) { let n = this.f(); if (k == 1) { let o = typeCast(DataSourceSpecialRow.$, j); for (let p = 0; p < n.length; p++) { i.setValue(n[p], o.getValue(n[p])); } } else { for (let q = 0; q < n.length; q++) { i.setValue(n[q], this.m.getItemProperty(j, n[q])); } } } if (c && this.ab != null) { this.ab.notifyInsertItem(d + f, i); } } return e.count; } by(a, b) { for (let c = 0; c < a.i.length; c++) { if (!a.c[c]) { break; } if (a.h[c] == -1) { continue; } a.g[c] = new SummaryGroup(); a.g[c].a = new Array(this.a8); let d = this.be(a, c, b); } } f() { let a = new Array(this.ae.k.count + this.af.k.count); let b = 0; for (let c = 0; c < this.ae.k.count; c++) { a[b] = this.ae.k.item(c).propertyName; b++; } for (let d = 0; d < this.af.k.count; d++) { a[b] = this.af.k.item(d).propertyName; b++; } return a; } g() { let a = new Array(this.ae.k.count); let b = 0; for (let c = 0; c < this.ae.k.count; c++) { a[b] = this.ae.k.item(c).propertyName; b++; } return a; } bt(a, b, c) { this.z.x(a); } x(a, b, c) { return this.z.i(a, this.m, b, c, this.m.sectionHeaderDisplayMode, this.ar); } cb(a) { this.a3 = new List$1(Array_$type, 0); for (let b = 0; b < a.count; b++) { this.a3.add(a._inner[b]); } } b2() { this.a4.clear(); if (this.ab != null) { this.ab.notifyClearItems(); } } notifySetItem(a, b, c) { if (this.a0 != null) { this.b8(b); this.bo(c); } else { this.b9(a, b); this.bp(a, c); } } bp(a, b) { if (!this.ax(b)) { return; } let c = this.a9(a); this.b3(c, b); } b3(a, b) { this.b0(a, b); this.ce(a, b); this.cj(a, b); } b0(a, b) { if (this.ah) { let c = this.z.e(a); if (c == null) { c = this.z.d(); } let d = c.v(); let e = true; if (a >= c.af && a <= c.af + (d - 1) + c.ah + c.aa) { if (!this.ai(c, b, this.a4._inner[c.af])) { c = this.z.e(c.af - 1); if (c == null) { c = this.z.c(); c.af++; } e = false; } else { a = c.af + d + c.ah + c.aa; } } if (e && !c.p) { return; } c.ad++; this.z.ac(c, 1, 0); if (this.ai(c, b, this.a4._inner[c.af])) { if (!c.p) { c.ad--; this.z.ac(c, -1, 0); return; } if (a >= c.ad - c.u - c.ag && a <= c.ad) { a = c.ad - c.u - c.ag; } } } this.a4.insert1(a, b); if (this.ab != null) { this.ab.notifyInsertItem(a, b); } } ce(a, b) { let c = null; if (this.ah) { c = this.z.e(a); } else { c = this.z.t._inner[0]; } if (c == null) { if (this.ah && a == 0) { c = this.z.c(); } else { c = this.z.d(); } } if (this.ai(c, b, this.a4._inner[c.af])) { this.z.z(c, 1); if (this.aw && c.p) { let d = this.bi(c, b); if (d != -1 && this.ab != null) { this.ab.notifyInsertItem(d, this.a4._inner[d]); } } } else { let e = this.z.e(a - 1); if (e != null && this.ai(e, b, this.a4._inner[e.af])) { this.z.z(e, 1); if (this.aw && e.p) { let f = this.bi(e, b); if (f != -1 && this.ab != null) { this.ab.notifyInsertItem(f, this.a4._inner[f]); } } } else { let g = false; if (a <= c.af) { g = true; } let h = 0; let i = null; let j = null; let k = this.f(); let l = this.g(); let m = this.z.b(this.m, b, l, this.j, this.ar); m.af = a; m.ad = a; m.ae = g ? c.ae : c.ae + 1; if (this.j == 1) { this.z.af(m, g); for (let n = 0; n < c.f.length; n++) { if (Base.equalsStatic(c.f[n], m.f[n]) && !c.c[n]) { this.z.z(c, 1); return; } } } this.z.aa(m.ae, m); if (this.av) { let o = this.bc(m, a, k, l, false); m.ad += o; h += o; i = this.a4._inner[a]; if (!g) { c.ad--; } } if (m.p) { if (this.aw) { for (let p = 0; p < this.a3.count; p++) { if (this.p.i(b, this.a3._inner[p]) == 0) { this.bf(m, b, false); h++; break; } } } } else { this.a4.removeAt(a + h); m.ad--; h--; } if (this.au) { let q = this.bb(a + (h - 1), b, k, l); if (q > 1) { m.ad += q; } h += q; j = this.a4._inner[a + (h - 1)]; } this.z.ad(m, h, h); if (this.j == 1) { this.b7(m); } else { if (m.a[0] != null && m.h[0] == -1) { m.h[0] = m.ad + 1; } } if (m.p) { this.z.z(m, 1); } if (this.ab != null) { if (i != null) { this.ab.notifyInsertItem(a, i); } if (j != null) { this.ab.notifyInsertItem(a + (h - 1), j); } } } } } cm(a) { let b = this.a4.indexOf1(a); if (b >= 0) { let c = this.a4._inner[b - 1]; let d = typeCast(DataSourceSpecialRow.$, c); let e = this.f(); for (let f = 0; f < e.length; f++) { if (d == null) { a.setValue(e[f], this.m.getItemProperty(c, e[f])); } else { a.setValue(e[f], d.getValue(e[f])); } } } } b7(a) { let b = false; let c = false; if (a.ae > 0) { let d = this.z.t._inner[a.ae - 1]; let e = 0; for (let f = 0, g = 0; f < a.e.length; f++, g++) { if (!b && Base.equalsStatic(d.f[f], a.f[f])) { this.a4.removeAt(a.af + g); a.ad--; this.z.ac(a, -1, -1); if (this.am && (this.l == 2 || this.l == 0)) { for (let h = 0; h < this.a8; h++) { let i = typeCast(DataSourceSpecialRow.$, this.a4._inner[a.af - 1]); if (i != null && i.rowType == 5 && i.level == f + 1) { this.a4.removeAt(a.af - 1); d.ad--; this.z.ac(d, -1, -1); this.a4.insert1(a.ad + 1, i); e++; this.cm(i); } } } a.a[f] = null; a.b[f] = 0; a.c[f] = true; if (d.a[f] != null) { a.z = d.ae; } g--; c = true; } else { b = true; a.b[f] = g; if (e > 0) { a.ad += e; this.z.ac(a, e, e); a.h[f] = a.ad - (e - 1); } else { a.h[f] = a.ad + 1; } } } if (a.z == -1 && c) { a.z = d.z; } } if (a.ae < this.z.t.count - 1) { b = false; c = false; let j = this.z.t._inner[a.ae + 1]; for (let k = 0, l = 0; k < a.e.length; k++, l++) { if (!b && Base.equalsStatic(j.f[k], a.f[k])) { if (j.a[k] != null) { this.a4.removeAt(j.af + l); j.ad--; this.z.ac(j, -1, -1); a.al(k, -1); a.i[k] = j.i[k]; a.d[k] = j.d[k]; if (this.am && (this.l == 2 || this.l == 0)) { let m = j.g[k].a[0]; let n = this.a4.indexOf1(m); a.h[k] = n; let o = this.z.e(n); let p = j.g[k].a.length; for (let q = 0; q < p; q++) { j.g[k].a[q] = null; this.a4.removeAt(n); o.ad--; if (this.as) { o.ag--; } else { o.ah--; } } this.z.ac(o, -p, -p); a.al(k, -p); } j.h[k] = -1; j.d[k] = 0; j.i[k] = null; j.g[k] = null; j.a[k] = null; j.b[k] = 0; j.c[k] = true; c = true; } l--; } else { b = true; j.b[k] = l; if (a.a[k] != null && a.h[k] == -1) { a.h[k] = a.ad + 1; } } } } } ai(a, b, c) { if (this.ae.k.count == 0) { return true; } if (this.a1.compare(b, c) == 0) { return true; } return false; } h(a, b) { let c = new Array(a.length); for (let d = 0; d < c.length; d++) { c[d] = this.m.getItemProperty(b, a[d]); } return c; } at(a, b) { if (a == null && b == null) { return true; } if (a == null && b != null) { return false; } if (a != null && b == null) { return false; } return Base.equalsStatic(a, b); } a9(a) { if (this.ae.k.count == 0 && this.a3.count == 0 && this.s == null && this.n.actualCount == this.a4.count) { return a; } let b = 0; let c = 0; let d = this.a4.count; while (b < a && c < d) { while (c < d) { let e = this.a4._inner[c]; let f = false; let viewItem_ = e; if ((viewItem_.$$isSpecialRow !== undefined)) { f = true; } if (!f) { break; } c++; } let g = this.n.getItemAtIndex(b); if (this.at(g, this.a4._inner[c])) { c++; b++; } else { b++; } } return c; } b9(a, b) { let c = this.a9(a); if (c < this.a4.count) { if (this.at(b, this.a4._inner[c])) { this.b4(c, b); } } } b4(a, b) { this.a4.removeAt(a); if (this.ab != null) { this.ab.notifyRemoveItem(a, b); } let c = this.y(a, b); this.ck(a, b, c); } y(a, b) { let c = null; if (this.ah) { c = this.z.e(a); } else { c = this.z.t._inner[0]; } if (c != null) { this.z.z(c, -1); if (c.p) { c.ad--; this.z.ac(c, -1, 0); if (this.aw) { for (let d = 0; d < c.aa; d++) { let e = 0; if (this.av) { e = 1; } e += c.ah; let f = this.a4._inner[c.af + d + e]; let g = null; let item_ = f; if ((item_ != null && item_.$$isSpe