UNPKG

igniteui-react-core

Version:
208 lines (207 loc) 6.91 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, fromEnum, typeCast, markType } from "./type"; import { List$1 } from "./List$1"; import { FastIterationDictionary$2 } from "./FastIterationDictionary$2"; import { ISummaryResult_$type } from "./ISummaryResult"; import { stringIsNullOrWhiteSpace } from "./string"; /** * @hidden */ export let DataSourceSpecialRow = /*@__PURE__*/ (() => { class DataSourceSpecialRow extends Base { constructor() { super(...arguments); this.$$isSpecialRow = true; this.j = new FastIterationDictionary$2(String_$type, Base.$, 0); this.i = new FastIterationDictionary$2(String_$type, Base.$, 0); this._rowType = 0; this._targetRow = null; this._level = 0; this._summaryResults = null; } get rowType() { return this._rowType; } set rowType(a) { this._rowType = a; } get keys() { let a = new List$1(String_$type, 0); for (let b = 0; b < this.j.o.count; b++) { if (this.j.p._inner[b]) { continue; } a.add(this.j.o._inner[b]); } return a.toArray(); } get values() { let a = new List$1(Base.$, 0); for (let b = 0; b < this.j.q.count; b++) { if (this.j.p._inner[b]) { continue; } a.add1(this.j.q._inner[b]); } return a.toArray(); } get sectionKeys() { let a = new List$1(String_$type, 0); for (let b = 0; b < this.i.o.count; b++) { if (this.i.p._inner[b]) { continue; } a.add(this.i.o._inner[b]); } return a.toArray(); } get sectionValues() { let a = new List$1(Base.$, 0); for (let b = 0; b < this.i.q.count; b++) { if (this.i.p._inner[b]) { continue; } a.add1(this.i.q._inner[b]); } return a.toArray(); } get targetRow() { return this._targetRow; } set targetRow(a) { this._targetRow = a; } get level() { return this._level; } set level(a) { this._level = a; } get summaryResults() { return this._summaryResults; } set summaryResults(a) { this._summaryResults = a; } getValue(a) { if (a == "SectionInformation") { return this.i; } let b = null; if (((() => { let c = this.j.h(a, b); b = c.p1; return c.ret; })())) { return b; } b = this.getSummaryValue(a); return b; } getSectionValue(a) { if (a == "SectionInformation") { return this.i; } let b = null; if (((() => { let c = this.i.h(a, b); b = c.p1; return c.ret; })())) { return b; } b = this.getSummaryValue(a); return b; } setValue(a, b) { this.j.item(a, b); } setSectionValue(a, b) { this.i.item(a, b); } getSectionKeys() { let a = new Array(this.i.r); let b = 0; for (let c of fromEnum(this.i.m)) { a[b] = c; b++; } return a; } getSummaryValue(a) { if (this.summaryResults != null) { for (let b = 0; b < this.summaryResults.length; b++) { if (this.summaryResults[b] != null && this.summaryResults[b].propertyName == a) { return this.summaryResults[b].value; } } } return null; } getSummaryResults(a) { if (stringIsNullOrWhiteSpace(a)) { return this.summaryResults; } let b = new List$1(ISummaryResult_$type, 0); for (let c = 0; c < this.summaryResults.length; c++) { if (this.summaryResults[c] != null && this.summaryResults[c].propertyName == a) { b.add(this.summaryResults[c]); } } return b.toArray(); } l(a) { if (a.rowType != 1) { return false; } if (a.i.r != this.i.r) { return false; } for (let b = 0; b < a.i.o.count; b++) { let c = a.i.o._inner[b]; let d = a.i.q._inner[b]; if (!this.i.d(c)) { return false; } if (this.i.item(c) == null) { if (this.i.item(c) != d) { return false; } continue; } if (!Base.equalsStatic(this.i.item(c), d)) { return false; } } return true; } equals(a) { let b = typeCast(DataSourceSpecialRow.$, a); if (b != null) { if (this.rowType == 1 && b.rowType == 1) { return this.l(b); } else if (this.rowType == 3 && b.rowType == 3) { return this.targetRow == b.targetRow; } } return super.equals(a); } getHashCode() { if (this.rowType == 1) { let a = 0; for (let b = 0; b < this.i.q.count; b++) { a = a * 17 + this.o(this.i.o._inner[b]); a = a * 17 + this.o(this.i.q._inner[b]); } return a; } return super.getHashCode(); } o(val_) { if (val_ == null) { return 0; } return Base.getHashCodeStatic(val_); } } DataSourceSpecialRow.$t = /*@__PURE__*/ markType(DataSourceSpecialRow, 'DataSourceSpecialRow'); return DataSourceSpecialRow; })();