UNPKG

igniteui-react-core

Version:
1,014 lines (1,013 loc) 38.3 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 { __extends, __values } from "tslib"; import { BaseDataSource } from "./BaseDataSource"; import { Base, typeCast, runOn, delegateCombine, delegateRemove, Array_$type, Number_$type, fromEnum, markType } from "./type"; import { RearrangedListView } from "./RearrangedListView"; import { DataSourcePropertiesComparer } from "./DataSourcePropertiesComparer"; import { List$1 } from "./List$1"; import { DataSourceExecutionContext } from "./DataSourceExecutionContext"; import { DataSourceLocalDataProvider } from "./DataSourceLocalDataProvider"; import { DataSourceSpecialRow } from "./DataSourceSpecialRow"; import { ISupportsDataChangeNotifications_$type } from "./ISupportsDataChangeNotifications"; import { IDataSourceClonableDataProvider_$type } from "./IDataSourceClonableDataProvider"; import { TransactionType, TransactionType_$type } from "./TransactionType"; import { ISupportsExpansionChangeNotifications_$type } from "./ISupportsExpansionChangeNotifications"; /** * @hidden */ var LocalDataSource = /** @class */ /*@__PURE__*/ (function (_super) { __extends(LocalDataSource, _super); function LocalDataSource() { var _this = _super.call(this) || this; _this.c2 = null; _this.df = false; _this.c1 = null; _this.d3 = null; _this.c7 = null; _this.db = null; _this.dd = null; _this.d7 = null; _this.c9 = null; _this.dp = new List$1(Array_$type, 0); _this.de = false; _this.c0 = null; _this.dx = -1; _this.dq = -1; _this.dz = -1; _this.ds = -1; _this.d0 = -1; _this.dt = -1; _this.dy = -1; _this.dr = -1; _this.d2 = -1; _this.d1 = -1; _this.dv = -1; _this.du = -1; _this.dw = -1; _this.executionContext = new DataSourceExecutionContext(); _this.v.l = false; return _this; } LocalDataSource.prototype.get_actualBaseDataProvider = function () { return this.actualDataProvider; }; Object.defineProperty(LocalDataSource.prototype, "actualBaseDataProvider", { get: function () { return this.get_actualBaseDataProvider(); }, enumerable: false, configurable: true }); Object.defineProperty(LocalDataSource.prototype, "dataProvider", { get: function () { return this.c2; }, set: function (a) { var b = this.c2; this.c2 = a; if (b != this.c2) { this.onPropertyUpdated("DataProvider", b, this.c2); } }, enumerable: false, configurable: true }); Object.defineProperty(LocalDataSource.prototype, "actualDataProvider", { get: function () { if (this.c1 == null) { this.actualDataProvider = this.resolveDataProvider(); } return this.c1; }, set: function (a) { var b = this.c1; this.c1 = a; if (b != this.c1) { this.onPropertyUpdated("ActualDataProvider", b, this.c1); } }, enumerable: false, configurable: true }); Object.defineProperty(LocalDataSource.prototype, "dataSource", { get: function () { return this.d3; }, set: function (a) { var b = this.d3; this.d3 = a; if (b != this.d3) { this.onPropertyUpdated("ItemsSource", b, this.d3); } }, enumerable: false, configurable: true }); LocalDataSource.prototype.canInitialize = function () { var a = _super.prototype.canInitialize.call(this); if (!a) { return false; } return this.dataSource != null; }; Object.defineProperty(LocalDataSource.prototype, "c8", { get: function () { return this.c7; }, set: function (a) { this.c7 = a; { this.actualDataProvider = this.resolveDataProvider(); } }, enumerable: false, configurable: true }); LocalDataSource.prototype.resolveDataProvider = function () { var provider_ = new DataSourceLocalDataProvider(); provider_.executionContext = new DataSourceExecutionContext(); return provider_; }; LocalDataSource.prototype.propertyUpdatedOverride = function (a, b, c) { _super.prototype.propertyUpdatedOverride.call(this, a, b, c); switch (a) { case "DataProvider": this.df = true; this.actualDataProvider = this.dataProvider; break; case "ActualDataProvider": if (this.actualDataProvider != null) { this.actualDataProvider.dataSource = this.dataSource; this.actualSchema = this.actualDataProvider.actualSchema; this.actualCount = this.resolveFullCount(this.actualDataProvider.actualCount); } this.queueAutoRefresh(); break; case "ItemsSource": if (this.actualDataProvider != null) { this.actualDataProvider.dataSource = this.dataSource; this.actualSchema = this.actualDataProvider.actualSchema; this.actualCount = this.resolveFullCount(this.actualDataProvider.actualCount); } this.queueAutoRefresh(); break; } }; LocalDataSource.prototype.getItemAtIndex = function (a) { if (this.db != null && this.db.a8 != null) { return this.db.a8.item(a); } else { return this.actualDataProvider.getItemAtIndex(a); } }; LocalDataSource.prototype.getItemFromKey = function (a) { var b = this.actualPrimaryKey; if (b == null || b.length < 1 || this.actualBaseDataProvider == null) { return a[0]; } var c = this.da(); var d; if (this.db != null) { var e = this.db.a8.count; for (var f = 0; f < e; f++) { d = this.db.a8.item(f); if (typeCast(DataSourceSpecialRow.$, d) !== null) { var g = d; if (g.rowType == 1 && !this.isSectionContentVisible && this.isSectionHeaderNormalRow) { if (c.i(d, a) == 0) { return d; } } } else if (c.i(d, a) == 0) { return d; } } return null; } if (this.actualDataProvider != null && this.actualDataProvider.isKeyIndexLookupSupported) { var h = this.actualDataProvider.indexOfKey(a); return this.actualDataProvider.getItemAtIndex(h); } if (this.actualDataProvider != null) { var i = this.actualDataProvider.actualCount; for (var j = 0; j < i; j++) { d = this.actualDataProvider.getItemAtIndex(j); if (c.i(d, a) == 0) { return d; } } } return null; }; LocalDataSource.prototype.getItemPropertyAtIndex = function (a, b) { var c; if (this.db != null) { c = this.db.a8.item(a); } else { c = this.actualDataProvider.getItemAtIndex(a); } if (c == null) { return null; } var item_ = c; if ((item_ != null && item_.$$isSpecialRow !== undefined)) { return this.getSpecialRowItemValue(c, b); } if (this.ar()) { var d = this.ao(c, b); if (d) { var e = this.a2(c, b); return e; } } return this.actualDataProvider.getItemValue(c, b); }; LocalDataSource.prototype.c6 = function () { return this.actualDataProvider; }; LocalDataSource.prototype.dh = function () { return this.dp != null && this.dp.count > 0; }; LocalDataSource.prototype.refreshInternalOverride = function () { _super.prototype.refreshInternalOverride.call(this); if (this.actualDataProvider != null) { if (this.di() || this.dj() || this.dk() || this.dl() || this.dh()) { if (this.db == null) { if (this.dd == null) { this.dd = new LocalDataSourceViewUpdateNotifier(this); } this.db = new RearrangedListView(this.actualDataProvider); this.db.ac = this.dd; this.db.ae = new LocalDataSourceViewExpansionNotifier(this); var a = this.db; a.rootSummariesChanged = delegateCombine(a.rootSummariesChanged, runOn(this, this.d9)); } this.ensureComparables(this.actualDataProvider.actualSchema); this.db.aw = this.shouldEmitSectionHeaders && this.aq; this.db.av = this.shouldEmitSectionFooters && this.aq; this.db.ax = this.shouldEmitShiftedRows; this.db.ay = this.shouldEmitSummaryRows; this.db.ce(this.dp); this.db.a4 = this.dn(); this.db.a3 = this.dm(); this.db.q = this.da(); this.db.af = this.groupDescriptions; this.db.ag = this.sortDescriptions; this.db.ah = this.summaryDescriptions; this.db.m = this.summaryScope; this.db.an = this.includeSummaryRowsInSection; this.db.at = this.isSectionSummaryRowsAtBottom; this.db.k = this.sectionHeaderDisplayMode; this.db.n = this; this.db.aq = this.groupDescriptions != null && this.groupDescriptions.k.count > 0; this.db.u = this.dc(); this.db.b9(); this.actualSchema = this.actualDataProvider.actualSchema; this.actualCount = this.db.a8.count; } else { var b = this.c6(); this.actualSchema = this.actualDataProvider.actualSchema; if (b != null) { this.actualCount = b.actualCount; } else { this.actualCount = 0; } if (this.db != null) { this.db.ac = null; var c = this.db; c.rootSummariesChanged = delegateRemove(c.rootSummariesChanged, runOn(this, this.d9)); this.db = null; this.onBroadcastClearItems(); } } } else { this.actualCount = 0; this.actualSchema = null; } }; LocalDataSource.prototype.d9 = function (a, b) { this.cn(); }; LocalDataSource.prototype.get_isItemIndexLookupSupported = function () { return true; }; LocalDataSource.prototype.get_isKeyIndexLookupSupported = function () { return true; }; LocalDataSource.prototype.indexOfItem = function (a) { if (this.db != null) { return this.db.a8.indexOf(a); } if (this.actualDataProvider != null && this.actualDataProvider.isItemIndexLookupSupported) { return this.actualDataProvider.indexOfItem(a); } if (this.actualDataProvider != null) { var b = this.actualDataProvider.actualCount; var c = void 0; for (var d = 0; d < b; d++) { c = this.actualDataProvider.getItemAtIndex(d); if (this.dg(c, a)) { return d; } } } return -1; }; LocalDataSource.prototype.dg = function (a, b) { if (a == null && b == null) { return true; } if (a == null || b == null) { return false; } return Base.equalsStatic(a, b); }; LocalDataSource.prototype.indexOfKey = function (a) { var b = this.actualPrimaryKey; if (b == null || b.length < 1 || this.actualBaseDataProvider == null) { return this.indexOfItem(a[0]); } var c = this.da(); var d; if (this.db != null) { var e = this.db.a8.count; for (var f = 0; f < e; f++) { d = this.db.a8.item(f); if (typeCast(DataSourceSpecialRow.$, d) !== null) { var g = d; if (g.rowType == 1 && !this.isSectionContentVisible && this.isSectionHeaderNormalRow) { if (c.i(d, a) == 0) { return f; } } } else if (c.i(d, a) == 0) { return f; } } return -1; } if (this.actualDataProvider != null && this.actualDataProvider.isKeyIndexLookupSupported) { return this.actualDataProvider.indexOfKey(a); } if (this.actualDataProvider != null) { var h = this.actualDataProvider.actualCount; for (var i = 0; i < h; i++) { d = this.actualDataProvider.getItemAtIndex(i); if (c.i(d, a) == 0) { return i; } } } return -1; }; LocalDataSource.prototype.onActualPrimaryKeyChangedOverrride = function (a, b) { _super.prototype.onActualPrimaryKeyChangedOverrride.call(this, a, b); this.c9 = null; }; LocalDataSource.prototype.da = function () { if (this.c9 != null) { return this.c9; } if (this.actualPrimaryKey == null) { this.c9 = new DataSourcePropertiesComparer(null, null, null, this); return this.c9; } var a = new Array(this.actualPrimaryKey.length); for (var b = 0; b < a.length; b++) { a[b] = 0; } this.c9 = new DataSourcePropertiesComparer(this.actualPrimaryKey, a, this.d, this); return this.c9; }; LocalDataSource.prototype.dc = function () { if (this.filterExpressions.k.count == 0) { return null; } var a = this.actualDataProvider; var b = this.actualDataProvider.actualSchema; var c = this.filterExpressions.k; var d = function (e) { for (var f = 0; f < c.count; f++) { if (!c.item(f).match(e, a, b)) { return false; } } return true; }; return d; }; LocalDataSource.prototype.dn = function () { var a = 0; if (this.sortDescriptions.k.count == 0 && (this.groupDescriptions == null || this.groupDescriptions.k.count == 0)) { return null; } a = this.sortDescriptions.k.count; if (this.groupDescriptions != null) { a += this.groupDescriptions.k.count; } var b = new Array(a); var c = new Array(a); var d = 0; if (this.groupDescriptions != null) { for (var e = 0; e < this.groupDescriptions.k.count; e++) { b[e] = this.groupDescriptions.k.item(e).propertyName; c[e] = this.groupDescriptions.k.item(e).direction; d++; } } for (var f = 0; f < this.sortDescriptions.k.count; f++) { b[f + d] = this.sortDescriptions.k.item(f).propertyName; c[f + d] = this.sortDescriptions.k.item(f).direction; } return new DataSourcePropertiesComparer(b, c, this.d, this); }; LocalDataSource.prototype.dm = function () { if (this.groupDescriptions == null || this.groupDescriptions.k.count < 1) { return null; } var a = 0; a = this.groupDescriptions.k.count; var b = new Array(a); var c = new Array(a); if (this.groupDescriptions != null) { for (var d = 0; d < this.groupDescriptions.k.count; d++) { b[d] = this.groupDescriptions.k.item(d).propertyName; c[d] = this.groupDescriptions.k.item(d).direction; } } return new DataSourcePropertiesComparer(b, c, this.d, this); }; LocalDataSource.prototype.dj = function () { if (this.groupDescriptions == null || this.groupDescriptions.k.count < 1) { return false; } if (this.actualDataProvider == null) { return false; } if (this.actualDataProvider.isGroupingSupported) { return false; } return true; }; LocalDataSource.prototype.dk = function () { if (this.sortDescriptions == null || this.sortDescriptions.k.count < 1) { return false; } if (this.actualDataProvider == null) { return false; } if (this.actualDataProvider.isSortingSupported) { return false; } return true; }; LocalDataSource.prototype.di = function () { return this.filterExpressions != null && this.filterExpressions.k.count > 0; }; LocalDataSource.prototype.dl = function () { if (this.summaryDescriptions == null || this.summaryDescriptions.k.count < 1) { return false; } return true; }; LocalDataSource.prototype.onClearItemsOverride = function () { if (this.db != null) { this.db.notifyClearItems(); this.queueAutoRefresh(); } else { _super.prototype.onClearItemsOverride.call(this); } }; LocalDataSource.prototype.onSetItemOverride = function (a, b, c) { if (this.db != null) { this.db.notifySetItem(a, b, c); } else { _super.prototype.onSetItemOverride.call(this, a, b, c); } }; LocalDataSource.prototype.onInsertItemOverride = function (a, b) { if (this.db != null) { this.db.notifyInsertItem(a, b); } else { _super.prototype.onInsertItemOverride.call(this, a, b); } }; LocalDataSource.prototype.onRemoveItemOverride = function (a, b) { if (this.db != null) { this.db.notifyRemoveItem(a, b); } else { _super.prototype.onRemoveItemOverride.call(this, a, b); } }; LocalDataSource.prototype.ea = function () { this.actualCount = this.db.a8.count; this.onBroadcastClearItems(); }; LocalDataSource.prototype.ed = function (a, b, c) { this.actualCount = this.db.a8.count; this.onBroadcastSetItem(a, b, c); }; LocalDataSource.prototype.eb = function (a, b) { this.actualCount = this.db.a8.count; this.onBroadcastInsertItem(a, b); }; LocalDataSource.prototype.ec = function (a, b) { this.actualCount = this.db.a8.count; this.onBroadcastRemoveItem(a, b); }; LocalDataSource.prototype.pinRow = function (a) { _super.prototype.pinRow.call(this, a); this.dx = -1; this.dq = -1; if (this.db != null) { this.dp.add(a); this.db.b8(a); } else { this.dp.add(a); this.queueAutoRefresh(); } }; LocalDataSource.prototype.unpinRow = function (a) { _super.prototype.unpinRow.call(this, a); var b = this.da(); if (this.db != null) { for (var c = this.dp.count - 1; c >= 0; c--) { var d = this.dp._inner[c]; if (d.length != a.length) { continue; } if (b.h(d, a) == 0) { this.dp.removeAt(c); this.db.cf(d); } } } else { for (var e = this.dp.count - 1; e >= 0; e--) { var f = this.dp._inner[e]; if (f.length != a.length) { continue; } if (b.h(f, a) == 0) { this.dp.removeAt(e); } } this.queueAutoRefresh(); } this.dx = -1; this.dq = -1; }; LocalDataSource.prototype.clearPinnedRows = function () { for (var a = this.dp.count - 1; a >= 0; a--) { this.unpinRow(this.dp._inner[a]); } }; LocalDataSource.prototype.isRowPinned = function (a) { if (this.db == null) { return false; } var b = this.getItemAtIndex(a); if (b == null) { return false; } var item_ = b; if ((item_ != null && item_.$$isSpecialRow !== undefined)) { if (item_.rowType == 3) { return true; } } var c = this.da(); var d; if (this.actualPrimaryKey == null) { d = new Array(1); d[0] = b; } else { var e = this.actualPrimaryKey; var f = e.length; d = new Array(f); for (var g = 0; g < f; g++) { d[g] = this.getItemProperty(b, e[g]); } } for (var h = 0; h < this.dp.count; h++) { if (c.h(this.dp._inner[h], d) == 0) { return true; } } return false; }; LocalDataSource.prototype.get_isSortingSupported = function () { if (this.externalDataSource != null && !this.de) { this.de = true; var a = this.externalDataSource.isSortingSupportedOverride; this.de = false; return a; } return true; }; LocalDataSource.prototype.get_isFilteringSupported = function () { if (this.externalDataSource != null && !this.de) { this.de = true; var a = this.externalDataSource.isFilteringSupportedOverride; this.de = false; return a; } return true; }; LocalDataSource.prototype.get_isGroupingSupported = function () { if (this.externalDataSource != null && !this.de) { this.de = true; var a = this.externalDataSource.isGroupingSupportedOverride; this.de = false; return a; } return true; }; LocalDataSource.prototype.getStickyRowPriority = function (a) { var b = this.getRowType(a); switch (b) { case 1: return 100 - this.getRowLevel(a); case 2: return 99 - this.getRowLevel(a); case 3: case 5: return 2; case 4: return 3; } return 1; }; LocalDataSource.prototype.getStickyRowsInRange = function (a, b) { if (this.db == null || ((this.groupDescriptions == null || this.groupDescriptions.k.count == 0) && (this.summaryDescriptions == null || this.summaryDescriptions.k.count == 0) && !this.dh())) { return null; } var c = null; var d = null; if (this.db.a7.count == 1) { c = this.db.a7._inner[0]; d = this.db.a7._inner[0]; } else { c = this.db.x(a); if (c != null) { while (c.z != -1) { c = this.db.a7._inner[c.z]; } } d = this.db.x(b); if (b >= this.db.a8.count - this.db.bm) { d = this.db.w(); } } if (c == null || d == null) { return null; } if (c.ae == this.dx && c.aa == this.dz && c.af == this.d0 && c.ad == this.dy && c.ah == this.d2 && c.ag == this.d1 && d.ae == this.dq && d.aa == this.ds && d.af == this.dt && d.ad == this.dr && d.ah == this.dv && d.ag == this.du && this.db.bm == this.dw) { return this.c0; } this.dx = c.ae; this.dq = d.ae; this.dz = c.aa; this.ds = d.aa; this.d0 = c.af; this.dt = d.af; this.dy = c.ad; this.dr = d.ad; this.d2 = c.ah; this.d1 = c.ag; this.dv = d.ah; this.du = d.ag; this.dw = this.db.bm; if (this.db.a7.count == 1) { this.dq = d.ad; } var e = 0; if (this.shouldEmitSectionHeaders && this.aq) { e = 1; } var f = this.db.bc(); var g = new List$1(Number_$type, 0); for (var h = c.ae; h <= d.ae; h++) { var i = this.db.a7._inner[h]; var j = this.db.a7._inner[h].c.length; var k = this.db.a7._inner[h].v(); if (this.shouldEmitSectionHeaders && this.aq) { for (var l = 0; l < j; l++) { if (this.db.a7._inner[h].a[l] != null) { var m = i.af + i.b[l]; g.add(m); if (this.summaryScope == 0 || this.summaryScope == 2) { if (i.c[l] && this.includeSummaryRowsInSection && !this.isSectionSummaryRowsAtBottom) { for (var n = 0; n < f; n++) { g.add(m + 1 + n); } } } } if (l < i.c.length && i.a[l] == null && i.z > -1) { var o = this.db.a7._inner[i.z]; if (!o.c[l]) { break; } } else if (!this.db.a7._inner[h].c[l]) { break; } } } if (this.db.a7._inner[h].p) { if (this.shouldEmitShiftedRows) { for (var p = 0; p < this.db.a7._inner[h].aa; p++) { g.add(this.db.a7._inner[h].af + this.db.a7._inner[h].ah + p + k); } } } if (this.summaryScope == 0 || this.summaryScope == 2) { if (this.shouldEmitSummaryRows && this.includeSummaryRowsInSection && this.isSectionSummaryRowsAtBottom) { for (var q = this.db.a7._inner[h].ag - 1; q >= 0; q--) { if (this.shouldEmitSectionFooters) { g.add(this.db.a7._inner[h].ad - k - q); } else { g.add(this.db.a7._inner[h].ad - q); } } } } if (this.shouldEmitSectionFooters && this.aq) { for (var r = j - 1; r >= 0; r--) { if (!this.db.a7._inner[h].c[r]) { break; } g.add(this.db.a7._inner[h].ad - r); } } } for (var s = this.db.a8.count - this.db.bm; s < this.db.a8.count; s++) { g.add(s); } this.c0 = g.toArray(); return this.c0; }; LocalDataSource.prototype.isExclusivelySticky = function (a) { var b = this.getRowType(a); return b == 1 || b == 2 || b == 4 || (this.isSectionSummaryRowsAtBottom && b == 5); }; LocalDataSource.prototype.getRowType = function (a) { if (a < 0) { return 0; } var b = this.getItemAtIndex(a); var item_ = b; if ((item_ != null && item_.$$isSpecialRow !== undefined)) { var c = b.rowType; if (this.isSectionHeaderNormalRow && c == 1) { return 0; } return c; } return 0; }; LocalDataSource.prototype.setIsRowExpandedAtIndex = function (a, b) { if (this.isSectionCollapsable && this.db != null && this.db.a8.count > 0 && this.db.a8.count > a) { this.db.cd(a, b); } }; LocalDataSource.prototype.getIsRowExpandedAtIndex = function (a) { if (this.db != null && this.db.a8.count > 0 && this.db.a8.count > a) { return this.db.al(a); } return true; }; LocalDataSource.prototype.getRowLevel = function (a) { if (a < 0) { return 0; } var b = this.getItemAtIndex(a); var item_ = b; if ((item_ != null && item_.$$isSpecialRow !== undefined)) { return b.level; } if (this.sectionHeaderDisplayMode == 1) { return this.groupDescriptions.k.count; } else if (this.groupDescriptions.k.count > 0) { return 1; } return 0; }; LocalDataSource.prototype.getRootSummaryRowCount = function () { if (this.db != null) { return this.db.bm; } return 0; }; LocalDataSource.prototype.getRootSummaryResults = function () { if (this.db != null) { return this.db.i; } return null; }; LocalDataSource.prototype.getSectionSummaryResults = function (a) { if (this.db != null && this.db.a7.count > 0 && a >= 0 && a < this.db.a7.count) { return this.db.a7._inner[a].i; } return null; }; LocalDataSource.prototype.clone = function () { var a = new LocalDataSource(); a.dataSource = this.dataSource; _super.prototype.cloneProperties.call(this, a); if (this.df && this.dataProvider != null && typeCast(IDataSourceClonableDataProvider_$type, this.dataProvider) !== null) { a.dataProvider = this.dataProvider.clone(); } return a; }; LocalDataSource.prototype.ar = function () { return !this.isReadOnly && this.actualBaseDataProvider != null && this.v != null; }; LocalDataSource.prototype.ct = function (a, b) { var e_1, _a, e_2, _b; if (a == 5) { var c = new List$1(TransactionType_$type, 0); var d = new List$1(Base.$, 0); var e = b; var f = e.a; for (var g = 0; g < f.length; g++) { if (f[g].transactionType == 1) { var h = f[g].id; var i = this.getItemFromKey(h); if (i != null) { var j = f[g].value; var k = this.indexOfItem(i); var l = null; if (this.db != null && k > -1) { l = this.db.x(k); for (var m = 0; m < this.summaryDescriptions.k.count; m++) { var n = this.summaryDescriptions.k.item(m); if (n.operand == 5 || j.containsKey(n.propertyName)) { this.db.co(m, k, i, false, l); } } } try { for (var _c = (e_1 = void 0, __values(fromEnum(j))), _d = _c.next(); !_d.done; _d = _c.next()) { var o = _d.value; this.actualDataProvider.setItemValue(i, o.key, o.value); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_d && !_d.done && (_a = _c.return)) _a.call(_c); } finally { if (e_1) throw e_1.error; } } if (l != null && this.db != null && k > -1) { for (var p = 0; p < this.summaryDescriptions.k.count; p++) { var q = this.summaryDescriptions.k.item(p); if (q.operand == 5 || j.containsKey(q.propertyName)) { this.db.co(p, k, i, true, l); } } } if (k > -1) { this.onBroadcastSetItem(k, i, i); } d.add1(i); c.add(1); if (this.dp.count > 0) { var r = this.da(); for (var s = 0; s < this.dp.count; s++) { if (r.h(this.dp._inner[s], h) == 0) { var t = this.getStickyRows(); for (var u = 0; u < t.length; u++) { var v = t[u]; var w = typeCast(DataSourceSpecialRow.$, this.db.a8.item(v)); if (w != null && w.rowType == 3 && w.targetRow == i) { this.onBroadcastSetItem(v, w, w); break; } } break; } } } } } else if (f[g].transactionType == TransactionType.Delete) { var x = f[g].id; var y = this.indexOfKey(x); if (y > -1) { var z = this.getItemAtIndex(y); this.actualDataProvider.removeItem(z); this.notifyRemoveItem(y, z); d.add1(z); c.add(TransactionType.Delete); } } else if (f[g].transactionType == 0) { var aa = f[g].id; var ab = aa[0]; if (f[g].value != null) { var ac = f[g].value; try { for (var _e = (e_2 = void 0, __values(fromEnum(ac))), _f = _e.next(); !_f.done; _f = _e.next()) { var ad = _f.value; this.actualDataProvider.setItemValue(ab, ad.key, ad.value); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_f && !_f.done && (_b = _e.return)) _b.call(_e); } finally { if (e_2) throw e_2.error; } } } this.actualDataProvider.addItem(ab); d.add1(ab); c.add(0); } } if (f.length > 0) { this.b2(e.id, this.getAggregatedChanges(e.id)); } } }; LocalDataSource.$t = markType(LocalDataSource, 'LocalDataSource', BaseDataSource.$); return LocalDataSource; }(BaseDataSource)); export { LocalDataSource }; /** * @hidden */ var LocalDataSourceViewUpdateNotifier = /** @class */ /*@__PURE__*/ (function (_super) { __extends(LocalDataSourceViewUpdateNotifier, _super); function LocalDataSourceViewUpdateNotifier(a) { var _this = _super.call(this) || this; _this.a = null; _this.a = a; return _this; } LocalDataSourceViewUpdateNotifier.prototype.notifyClearItems = function () { this.a.ea(); }; LocalDataSourceViewUpdateNotifier.prototype.notifyInsertItem = function (a, b) { this.a.eb(a, b); }; LocalDataSourceViewUpdateNotifier.prototype.notifyRemoveItem = function (a, b) { this.a.ec(a, b); }; LocalDataSourceViewUpdateNotifier.prototype.notifySetItem = function (a, b, c) { this.a.ed(a, b, c); }; LocalDataSourceViewUpdateNotifier.$t = markType(LocalDataSourceViewUpdateNotifier, 'LocalDataSourceViewUpdateNotifier', Base.$, [ISupportsDataChangeNotifications_$type]); return LocalDataSourceViewUpdateNotifier; }(Base)); export { LocalDataSourceViewUpdateNotifier }; /** * @hidden */ var LocalDataSourceViewExpansionNotifier = /** @class */ /*@__PURE__*/ (function (_super) { __extends(LocalDataSourceViewExpansionNotifier, _super); function LocalDataSourceViewExpansionNotifier(a) { var _this = _super.call(this) || this; _this.a = null; _this.a = a; return _this; } LocalDataSourceViewExpansionNotifier.prototype.notifyRowExpansionChanged = function (a, b, c) { this.a.onRowExpansionChanged(a, b, c); }; LocalDataSourceViewExpansionNotifier.$t = markType(LocalDataSourceViewExpansionNotifier, 'LocalDataSourceViewExpansionNotifier', Base.$, [ISupportsExpansionChangeNotifications_$type]); return LocalDataSourceViewExpansionNotifier; }(Base)); export { LocalDataSourceViewExpansionNotifier };