UNPKG

igniteui-react-core

Version:
1,412 lines (1,411 loc) 93.7 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 { ISupportsDataChangeNotifications_$type } from "./ISupportsDataChangeNotifications"; import { IDataSourceSupportsCount_$type } from "./IDataSourceSupportsCount"; import { IDataSourceDataProviderUpdateNotifier_$type } from "./IDataSourceDataProviderUpdateNotifier"; import { SortDescriptionCollection } from "./SortDescriptionCollection"; import { DataSourceSummaryScope_$type } from "./DataSourceSummaryScope"; import { Base, Type, markType, typeGetValue, PropertyChangedEventArgs, runOn, delegateCombine, typeCast, fromEnum, String_$type, delegateRemove, enumGetBox } from "./type"; import { SyncableObservableCollection$1 } from "./SyncableObservableCollection$1"; import { IDataSourceSupportsIndexedAccess_$type } from "./IDataSourceSupportsIndexedAccess"; import { DataSourceSectionHeaderDisplayMode_$type } from "./DataSourceSectionHeaderDisplayMode"; import { DataSourceSchemaChangedEventArgs } from "./DataSourceSchemaChangedEventArgs"; import { DataSourceRowExpansionChangedEventArgs } from "./DataSourceRowExpansionChangedEventArgs"; import { DataSourceRootSummariesChangedEventArgs } from "./DataSourceRootSummariesChangedEventArgs"; import { DataSourcePropertiesRequestedChangedEventArgs } from "./DataSourcePropertiesRequestedChangedEventArgs"; import { Convert } from "./Convert"; import { truncate, isNaN_ } from "./number"; import { toOADate, fromOADate } from "./dateExtended"; import { DefaultSummaryResult } from "./DefaultSummaryResult"; import { stringCompare } from "./string"; import { ArgumentNullException } from "./ArgumentNullException"; import { IEditableDataSource_$type } from "./IEditableDataSource"; import { TransactionService } from "./TransactionService"; import { TransactionKeyEqualityComparer } from "./TransactionKeyEqualityComparer"; import { Transaction } from "./Transaction"; import { DataSourceSpecialRow } from "./DataSourceSpecialRow"; import { List$1 } from "./List$1"; import { Dictionary$2 } from "./Dictionary$2"; import { DataSourceAggregatedResult } from "./DataSourceAggregatedResult"; import { DataSourceDataCommittedEventArgs } from "./DataSourceDataCommittedEventArgs"; import { Localization } from "./Localization"; import { TransactionType } from "./TransactionType"; import { stringFormat } from "./stringExtended"; /** * @hidden */ export var IDataSourceDataProvider_$type = /*@__PURE__*/ new Type(null, 'IDataSourceDataProvider', null, [ISupportsDataChangeNotifications_$type, IDataSourceSupportsCount_$type]); /** * @hidden */ export var IFilterExpression_$type = /*@__PURE__*/ new Type(null, 'IFilterExpression'); /** * @hidden */ var FilterExpressionCollection = /** @class */ /*@__PURE__*/ (function (_super) { __extends(FilterExpressionCollection, _super); function FilterExpressionCollection() { var _this = _super.call(this) || this; _this.a = null; _this.f = null; _this.f = new SyncableObservableCollection$1(IFilterExpression_$type); return _this; } Object.defineProperty(FilterExpressionCollection.prototype, "syncTarget", { get: function () { return this.a; }, set: function (a) { if (a == null) { this.f.syncTarget = null; this.a = null; return; } this.a = a; this.f.syncTarget = this.a.f; }, enumerable: false, configurable: true }); Object.defineProperty(FilterExpressionCollection.prototype, "shouldDetachOnTargetChange", { get: function () { return this.f.shouldDetachOnTargetChange; }, set: function (a) { this.f.shouldDetachOnTargetChange = a; }, enumerable: false, configurable: true }); FilterExpressionCollection.prototype.add = function (a) { return this.f.add(a); }; FilterExpressionCollection.prototype.insert = function (a, b) { this.f.add1(a, b); }; FilterExpressionCollection.prototype.clear = function () { this.f.clear(); }; FilterExpressionCollection.prototype.get = function (a) { return this.f.get(a); }; FilterExpressionCollection.prototype.indexOf = function (a) { return this.f.indexOf(a); }; FilterExpressionCollection.prototype.remove = function (a) { return this.f.remove1(a); }; FilterExpressionCollection.prototype.removeAt = function (a) { return this.f.remove(a); }; FilterExpressionCollection.prototype.set = function (a, b) { return this.f.set(a, b); }; FilterExpressionCollection.prototype.size = function () { return this.f.size(); }; Object.defineProperty(FilterExpressionCollection.prototype, "onChanged", { get: function () { return this.f.f; }, set: function (a) { this.f.f = a; }, enumerable: false, configurable: true }); FilterExpressionCollection.prototype.n = function (a) { this.f.addListener(a); }; FilterExpressionCollection.prototype.r = function (a) { this.f.removeListener(a); }; FilterExpressionCollection.prototype.o = function (a) { this.f.addOneWayTarget(a.f); }; FilterExpressionCollection.prototype.s = function (a) { this.f.removeOneWayTarget(a.f); }; Object.defineProperty(FilterExpressionCollection.prototype, "k", { get: function () { return this.f.all; }, enumerable: false, configurable: true }); FilterExpressionCollection.$t = markType(FilterExpressionCollection, 'FilterExpressionCollection'); return FilterExpressionCollection; }(Base)); export { FilterExpressionCollection }; /** * @hidden */ export var IDataSource_$type = /*@__PURE__*/ new Type(null, 'IDataSource', null, [ISupportsDataChangeNotifications_$type, IDataSourceSupportsIndexedAccess_$type]); /** * @hidden */ var SummaryCalculator = /** @class */ /*@__PURE__*/ (function (_super) { __extends(SummaryCalculator, _super); function SummaryCalculator() { var _this = _super !== null && _super.apply(this, arguments) || this; _this._propertyName = null; _this._propertyType = 0; _this._dataSource = null; _this._isSummaryDirty = false; _this.b = 5; _this._shouldDisplay = false; return _this; } Object.defineProperty(SummaryCalculator.prototype, "propertyName", { get: function () { return this._propertyName; }, set: function (a) { this._propertyName = a; }, enumerable: false, configurable: true }); Object.defineProperty(SummaryCalculator.prototype, "propertyType", { get: function () { return this._propertyType; }, set: function (a) { this._propertyType = a; }, enumerable: false, configurable: true }); Object.defineProperty(SummaryCalculator.prototype, "dataSource", { get: function () { return this._dataSource; }, set: function (a) { this._dataSource = a; }, enumerable: false, configurable: true }); Object.defineProperty(SummaryCalculator.prototype, "isSummaryDirty", { get: function () { return this._isSummaryDirty; }, set: function (a) { this._isSummaryDirty = a; }, enumerable: false, configurable: true }); SummaryCalculator.prototype.get_operand = function () { return this.b; }; Object.defineProperty(SummaryCalculator.prototype, "operand", { get: function () { return this.get_operand(); }, enumerable: false, configurable: true }); Object.defineProperty(SummaryCalculator.prototype, "shouldDisplay", { get: function () { return this._shouldDisplay; }, set: function (a) { this._shouldDisplay = a; }, enumerable: false, configurable: true }); SummaryCalculator.prototype.beginCalculation = function (a, b) { this.dataSource = a; this.propertyName = b; if (this.propertyName != null) { this.propertyType = a.resolveSchemaPropertyType(this.propertyName); } this.isSummaryDirty = false; }; SummaryCalculator.prototype.getResults = function () { var a = this.endCalculation(); a.shouldDisplay = this.shouldDisplay; return a; }; SummaryCalculator.prototype.endCalculation = function () { return null; }; SummaryCalculator.prototype.aggregate = function (a) { }; SummaryCalculator.prototype.itemAdded = function (a, b, c) { return b; }; SummaryCalculator.prototype.itemRemoved = function (a, b, c) { return b; }; SummaryCalculator.prototype.k = function (a) { if (this.dataSource == null) { return NaN; } var b = this.dataSource.getItemProperty(a, this.propertyName); if (b == null) { return NaN; } return this.l(b); }; SummaryCalculator.prototype.l = function (a) { if (a == null) { return NaN; } switch (this.propertyType) { case 6: return a; case 5: return a; case 1: return typeGetValue(a); case 3: return typeGetValue(a); case 4: return typeGetValue(a); case 7: return a; case 8: return toOADate(a); case 11: try { return Convert.toDouble3(a); } catch (b) { return NaN; } } return 0; }; SummaryCalculator.prototype.m = function (a) { switch (this.propertyType) { case 6: return a; case 5: return a; case 1: return truncate(a); case 3: return truncate(a); case 4: return truncate(a); case 7: return a; case 8: return fromOADate(a); default: return a; } }; SummaryCalculator.$t = markType(SummaryCalculator, 'SummaryCalculator'); return SummaryCalculator; }(Base)); export { SummaryCalculator }; /** * @hidden */ var SumSummaryCalculator = /** @class */ /*@__PURE__*/ (function (_super) { __extends(SumSummaryCalculator, _super); function SumSummaryCalculator() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.r = 0; return _this; } SumSummaryCalculator.prototype.get_displayName = function () { var a = BaseDataSource.bb("DataSource_Summary_Sum"); return a != null ? a : "Sum"; }; Object.defineProperty(SumSummaryCalculator.prototype, "displayName", { get: function () { return this.get_displayName(); }, enumerable: false, configurable: true }); SumSummaryCalculator.prototype.get_operand = function () { return 2; }; SumSummaryCalculator.prototype.beginCalculation = function (a, b) { _super.prototype.beginCalculation.call(this, a, b); this.r = 0; }; SumSummaryCalculator.prototype.endCalculation = function () { return DefaultSummaryResult.createWithDisplay(this.propertyName, 2, this.m(this.r), this.shouldDisplay); }; SumSummaryCalculator.prototype.aggregate = function (a) { var b = this.k(a); if (!isNaN_(b)) { this.r += b; } }; SumSummaryCalculator.prototype.itemAdded = function (a, b, c) { var d = this.k(a); if (isNaN_(d)) { d = 0; } if (b == null) { return DefaultSummaryResult.createWithDisplay(this.propertyName, 2, this.m(d), this.shouldDisplay); } var e = this.l(b.value) + d; return DefaultSummaryResult.createWithDisplay(this.propertyName, 2, this.m(e), this.shouldDisplay); }; SumSummaryCalculator.prototype.itemRemoved = function (a, b, c) { var d = this.k(a); if (isNaN_(d)) { d = 0; } var e = this.l(b.value) - d; return DefaultSummaryResult.createWithDisplay(this.propertyName, 2, this.m(e), this.shouldDisplay); }; SumSummaryCalculator.$t = markType(SumSummaryCalculator, 'SumSummaryCalculator', SummaryCalculator.$); return SumSummaryCalculator; }(SummaryCalculator)); export { SumSummaryCalculator }; /** * @hidden */ var CountSummaryCalculator = /** @class */ /*@__PURE__*/ (function (_super) { __extends(CountSummaryCalculator, _super); function CountSummaryCalculator() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.r = 0; return _this; } CountSummaryCalculator.prototype.get_displayName = function () { var a = BaseDataSource.bb("DataSource_Summary_Count"); return a != null ? a : "Count"; }; Object.defineProperty(CountSummaryCalculator.prototype, "displayName", { get: function () { return this.get_displayName(); }, enumerable: false, configurable: true }); CountSummaryCalculator.prototype.get_operand = function () { return 4; }; CountSummaryCalculator.prototype.beginCalculation = function (a, b) { _super.prototype.beginCalculation.call(this, a, b); this.propertyType = 1; this.r = 0; }; CountSummaryCalculator.prototype.endCalculation = function () { return DefaultSummaryResult.createWithDisplay(this.propertyName, 4, this.r, this.shouldDisplay); }; CountSummaryCalculator.prototype.aggregate = function (a) { this.r++; }; CountSummaryCalculator.prototype.itemAdded = function (a, b, c) { if (b == null) { return DefaultSummaryResult.createWithDisplay(this.propertyName, 4, 1, this.shouldDisplay); } return DefaultSummaryResult.createWithDisplay(this.propertyName, 4, typeGetValue(b.value) + 1, this.shouldDisplay); }; CountSummaryCalculator.prototype.itemRemoved = function (a, b, c) { return DefaultSummaryResult.createWithDisplay(this.propertyName, 4, typeGetValue(b.value) - 1, this.shouldDisplay); }; CountSummaryCalculator.$t = markType(CountSummaryCalculator, 'CountSummaryCalculator', SummaryCalculator.$); return CountSummaryCalculator; }(SummaryCalculator)); export { CountSummaryCalculator }; /** * @hidden */ var AverageSummaryCalculator = /** @class */ /*@__PURE__*/ (function (_super) { __extends(AverageSummaryCalculator, _super); function AverageSummaryCalculator() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.r = 0; _this.s = 0; return _this; } AverageSummaryCalculator.prototype.get_displayName = function () { var a = BaseDataSource.bb("DataSource_Summary_Avg"); return a != null ? a : "Avg"; }; Object.defineProperty(AverageSummaryCalculator.prototype, "displayName", { get: function () { return this.get_displayName(); }, enumerable: false, configurable: true }); AverageSummaryCalculator.prototype.get_operand = function () { return 3; }; AverageSummaryCalculator.prototype.beginCalculation = function (a, b) { _super.prototype.beginCalculation.call(this, a, b); this.r = 0; this.s = 0; }; AverageSummaryCalculator.prototype.endCalculation = function () { var a = this.s > 0 ? this.r / this.s : 0; return DefaultSummaryResult.createWithDisplay(this.propertyName, 3, this.m(a), this.shouldDisplay); }; AverageSummaryCalculator.prototype.aggregate = function (a) { var b = this.k(a); if (!isNaN_(b)) { this.r += b; this.s++; } }; AverageSummaryCalculator.prototype.itemAdded = function (a, b, c) { var d = this.k(a); if (isNaN_(d)) { d = 0; } if (b == null) { return DefaultSummaryResult.createWithDisplay(this.propertyName, 3, this.m(d), this.shouldDisplay); } var e = this.l(b.value) * (c - 1); var f = (e + d) / c; return DefaultSummaryResult.createWithDisplay(this.propertyName, 3, this.m(f), this.shouldDisplay); }; AverageSummaryCalculator.prototype.itemRemoved = function (a, b, c) { var d = this.k(a); if (isNaN_(d)) { d = 0; } var e = this.l(b.value) * (c + 1); var f = (e - d) / c; return DefaultSummaryResult.createWithDisplay(this.propertyName, 3, this.m(f), this.shouldDisplay); }; AverageSummaryCalculator.$t = markType(AverageSummaryCalculator, 'AverageSummaryCalculator', SummaryCalculator.$); return AverageSummaryCalculator; }(SummaryCalculator)); export { AverageSummaryCalculator }; /** * @hidden */ var MaxSummaryCalculator = /** @class */ /*@__PURE__*/ (function (_super) { __extends(MaxSummaryCalculator, _super); function MaxSummaryCalculator() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.r = null; return _this; } MaxSummaryCalculator.prototype.get_displayName = function () { var a = BaseDataSource.bb("DataSource_Summary_Max"); return a != null ? a : "Max"; }; Object.defineProperty(MaxSummaryCalculator.prototype, "displayName", { get: function () { return this.get_displayName(); }, enumerable: false, configurable: true }); MaxSummaryCalculator.prototype.get_operand = function () { return 1; }; MaxSummaryCalculator.prototype.beginCalculation = function (a, b) { _super.prototype.beginCalculation.call(this, a, b); this.r = null; }; MaxSummaryCalculator.prototype.endCalculation = function () { return DefaultSummaryResult.createWithDisplay(this.propertyName, 1, this.r, this.shouldDisplay); }; MaxSummaryCalculator.prototype.aggregate = function (a) { this.r = this.s(a, this.r); }; MaxSummaryCalculator.prototype.itemAdded = function (a, b, c) { if (b == null) { return DefaultSummaryResult.createWithDisplay(this.propertyName, 1, this.s(a, null), this.shouldDisplay); } var d = this.s(a, b.value); return DefaultSummaryResult.createWithDisplay(this.propertyName, 1, d, this.shouldDisplay); }; MaxSummaryCalculator.prototype.itemRemoved = function (a, b, c) { var d = this.dataSource.getItemProperty(a, this.propertyName); if (Base.equalsStatic(d, b.value)) { this.isSummaryDirty = true; } return b; }; MaxSummaryCalculator.prototype.s = function (a, b) { var c = this.dataSource.getItemProperty(a, this.propertyName); if (b == null) { return c; } if (c == null) { return b; } switch (this.propertyType) { case 0: b = stringCompare(c, b) > 0 ? c : b; break; case 6: b = c > b ? c : b; break; case 5: b = c > b ? c : b; break; case 1: b = (typeGetValue(c)) > (typeGetValue(b)) ? c : b; break; case 3: b = (typeGetValue(c)) > (typeGetValue(b)) ? c : b; break; case 4: b = (typeGetValue(c)) > (typeGetValue(b)) ? c : b; break; case 7: b = c > b ? c : b; break; case 2: b = c ? c : b; break; case 10: b = (typeGetValue(c)) > (typeGetValue(b)) ? c : b; break; case 8: var xVal_ = c; var yVal_ = b; xVal_ = +xVal_; yVal_ = +yVal_; var d = typeGetValue(xVal_); var e = typeGetValue(yVal_); b = Base.compareSimple(d, e) > 0 ? c : b; break; } return b; }; MaxSummaryCalculator.$t = markType(MaxSummaryCalculator, 'MaxSummaryCalculator', SummaryCalculator.$); return MaxSummaryCalculator; }(SummaryCalculator)); export { MaxSummaryCalculator }; /** * @hidden */ var MinSummaryCalculator = /** @class */ /*@__PURE__*/ (function (_super) { __extends(MinSummaryCalculator, _super); function MinSummaryCalculator() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.r = null; return _this; } MinSummaryCalculator.prototype.get_displayName = function () { var a = BaseDataSource.bb("DataSource_Summary_Min"); return a != null ? a : "Min"; }; Object.defineProperty(MinSummaryCalculator.prototype, "displayName", { get: function () { return this.get_displayName(); }, enumerable: false, configurable: true }); MinSummaryCalculator.prototype.get_operand = function () { return 0; }; MinSummaryCalculator.prototype.beginCalculation = function (a, b) { _super.prototype.beginCalculation.call(this, a, b); this.r = null; }; MinSummaryCalculator.prototype.endCalculation = function () { return DefaultSummaryResult.createWithDisplay(this.propertyName, 0, this.r, this.shouldDisplay); }; MinSummaryCalculator.prototype.aggregate = function (a) { this.r = this.s(a, this.r); }; MinSummaryCalculator.prototype.itemAdded = function (a, b, c) { if (b == null) { return DefaultSummaryResult.createWithDisplay(this.propertyName, 0, this.s(a, null), this.shouldDisplay); } var d = this.s(a, b.value); return DefaultSummaryResult.createWithDisplay(this.propertyName, 0, d, this.shouldDisplay); }; MinSummaryCalculator.prototype.itemRemoved = function (a, b, c) { var d = this.dataSource.getItemProperty(a, this.propertyName); if (Base.equalsStatic(d, b.value)) { this.isSummaryDirty = true; } return b; }; MinSummaryCalculator.prototype.s = function (a, b) { var c = this.dataSource.getItemProperty(a, this.propertyName); if (b == null) { return c; } if (c == null) { return b; } switch (this.propertyType) { case 0: b = stringCompare(c, b) < 0 ? c : b; break; case 6: b = c < b ? c : b; break; case 5: b = c < b ? c : b; break; case 1: b = (typeGetValue(c)) < (typeGetValue(b)) ? c : b; break; case 3: b = (typeGetValue(c)) < (typeGetValue(b)) ? c : b; break; case 4: b = (typeGetValue(c)) < (typeGetValue(b)) ? c : b; break; case 7: b = c < b ? c : b; break; case 2: b = !c ? c : b; break; case 10: b = (typeGetValue(c)) < (typeGetValue(b)) ? c : b; break; case 8: var xVal_ = c; var yVal_ = b; xVal_ = +xVal_; yVal_ = +yVal_; var d = typeGetValue(xVal_); var e = typeGetValue(yVal_); b = Base.compareSimple(d, e) < 0 ? c : b; break; } return b; }; MinSummaryCalculator.$t = markType(MinSummaryCalculator, 'MinSummaryCalculator', SummaryCalculator.$); return MinSummaryCalculator; }(SummaryCalculator)); export { MinSummaryCalculator }; /** * @hidden */ var SummaryDescription = /** @class */ /*@__PURE__*/ (function (_super) { __extends(SummaryDescription, _super); function SummaryDescription(a) { var _rest = []; for (var _i = 1; _i < arguments.length; _i++) { _rest[_i - 1] = arguments[_i]; } var _this = _super.call(this) || this; _this.h = false; _this.m = null; _this.i = false; _this.a = 0; _this._alias = null; _this.d = null; _this.provideCalculator = null; a = (a == void 0) ? 0 : a; switch (a) { case 0: break; case 1: { var c = _rest[0]; _this.propertyName = c; _this.operand = 4; } break; case 2: { var c = _rest[0]; var d = _rest[1]; _this.propertyName = c; _this.operand = d; } break; } return _this; } Object.defineProperty(SummaryDescription.prototype, "propertyName", { get: function () { return this.m; }, set: function (a) { this.m = a; }, enumerable: false, configurable: true }); Object.defineProperty(SummaryDescription.prototype, "shouldDisplay", { get: function () { return this.i; }, set: function (a) { this.i = a; }, enumerable: false, configurable: true }); Object.defineProperty(SummaryDescription.prototype, "operand", { get: function () { return this.a; }, set: function (a) { this.a = a; switch (this.a) { case 0: this.calculator = new MinSummaryCalculator(); break; case 1: this.calculator = new MaxSummaryCalculator(); break; case 2: this.calculator = new SumSummaryCalculator(); break; case 3: this.calculator = new AverageSummaryCalculator(); break; case 4: this.calculator = new CountSummaryCalculator(); break; } }, enumerable: false, configurable: true }); Object.defineProperty(SummaryDescription.prototype, "alias", { get: function () { return this._alias; }, set: function (a) { this._alias = a; }, enumerable: false, configurable: true }); Object.defineProperty(SummaryDescription.prototype, "calculator", { get: function () { return this.d; }, set: function (a) { this.d = a; }, enumerable: false, configurable: true }); SummaryDescription.prototype.equals = function (a) { var b = a; if (b == null) { return _super.prototype.equals.call(this, a); } return b.propertyName == this.propertyName && b.operand == this.operand; }; SummaryDescription.prototype.getHashCode = function () { return Base.getHashCodeStatic(this.propertyName) * 17 + this.operand; }; SummaryDescription.prototype.p = function () { this.h = true; }; SummaryDescription.prototype.g = function () { if (this.provideCalculator != null) { var a = new ProvideCalculatorEventArgs(); this.provideCalculator(this, a); return a.a; } return null; }; SummaryDescription.prototype.f = function () { var a = null; switch (this.a) { case 0: a = new MinSummaryCalculator(); break; case 1: a = new MaxSummaryCalculator(); break; case 2: a = new SumSummaryCalculator(); break; case 3: a = new AverageSummaryCalculator(); break; case 4: a = new CountSummaryCalculator(); break; case 5: a = this.g(); if (a == null) { throw new ArgumentNullException(2, "Calculator", "No custom calculator was provided."); } break; } if (a != null) { a.shouldDisplay = this.shouldDisplay; } return a; }; SummaryDescription.$t = markType(SummaryDescription, 'SummaryDescription'); return SummaryDescription; }(Base)); export { SummaryDescription }; /** * @hidden */ var SummaryDescriptionCollection = /** @class */ /*@__PURE__*/ (function (_super) { __extends(SummaryDescriptionCollection, _super); function SummaryDescriptionCollection() { var _this = _super.call(this) || this; _this.d = null; _this.f = null; _this.f = new SyncableObservableCollection$1(SummaryDescription.$); return _this; } SummaryDescriptionCollection.prototype.g = function () { return this.f; }; Object.defineProperty(SummaryDescriptionCollection.prototype, "syncTarget", { get: function () { return this.d; }, set: function (a) { if (a == null) { this.f.syncTarget = null; this.d = null; return; } this.d = a; this.f.syncTarget = this.d.f; }, enumerable: false, configurable: true }); SummaryDescriptionCollection.prototype.add = function (a) { return this.f.add(a); }; SummaryDescriptionCollection.prototype.insert = function (a, b) { this.f.add1(a, b); }; SummaryDescriptionCollection.prototype.clear = function () { this.f.clear(); }; SummaryDescriptionCollection.prototype.get = function (a) { return this.f.get(a); }; SummaryDescriptionCollection.prototype.indexOf = function (a) { return this.f.indexOf(a); }; SummaryDescriptionCollection.prototype.remove = function (a) { return this.f.remove1(a); }; SummaryDescriptionCollection.prototype.removeAt = function (a) { return this.f.remove(a); }; SummaryDescriptionCollection.prototype.set = function (a, b) { return this.f.set(a, b); }; SummaryDescriptionCollection.prototype.size = function () { return this.f.size(); }; SummaryDescriptionCollection.prototype.n = function (a) { this.f.addListener(a); }; SummaryDescriptionCollection.prototype.r = function (a) { this.f.removeListener(a); }; SummaryDescriptionCollection.prototype.o = function (a) { this.f.addOneWayTarget(a.f); }; SummaryDescriptionCollection.prototype.s = function (a) { this.f.removeOneWayTarget(a.f); }; Object.defineProperty(SummaryDescriptionCollection.prototype, "onChanged", { get: function () { return this.f.f; }, set: function (a) { this.f.f = a; }, enumerable: false, configurable: true }); Object.defineProperty(SummaryDescriptionCollection.prototype, "k", { get: function () { return this.f.all; }, enumerable: false, configurable: true }); SummaryDescriptionCollection.$t = markType(SummaryDescriptionCollection, 'SummaryDescriptionCollection'); return SummaryDescriptionCollection; }(Base)); export { SummaryDescriptionCollection }; /** * @hidden */ var ProvideCalculatorEventArgs = /** @class */ /*@__PURE__*/ (function (_super) { __extends(ProvideCalculatorEventArgs, _super); function ProvideCalculatorEventArgs() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.a = null; return _this; } ProvideCalculatorEventArgs.$t = markType(ProvideCalculatorEventArgs, 'ProvideCalculatorEventArgs'); return ProvideCalculatorEventArgs; }(Base)); export { ProvideCalculatorEventArgs }; /** * @hidden */ var BaseDataSource = /** @class */ /*@__PURE__*/ (function (_super) { __extends(BaseDataSource, _super); function BaseDataSource() { var _this = _super.call(this) || this; _this.v = null; _this._isReadOnly = false; _this.aa = false; _this.dataCommitted = null; _this.aq = false; _this.a0 = null; _this._externalDataSource = null; _this.t = null; _this.s = null; _this.j = null; _this.u = null; _this.k = null; _this.p = null; _this.au = 0; _this.av = 0; _this.aw = 0; _this.q = null; _this.propertyChanged = null; _this.m = null; _this.o = null; _this.schemaChanged = null; _this.rowExpansionChanged = null; _this.rootSummariesChanged = null; _this.propertiesRequestedChanged = null; _this.ab = false; _this.i = 0; _this.y = false; _this.b = null; _this.a = null; _this.c = null; _this.e = null; _this.ah = false; _this.ai = false; _this.w = false; _this.h = 0; _this.ac = true; _this.ae = true; _this.z = false; _this.ag = false; _this.af = false; _this.ad = true; _this.ak = true; _this.aj = false; _this.al = true; _this.am = true; _this.x = false; _this.d = null; _this.m = new DefaultDataSourceDataProviderUpdateNotifier(_this); _this.t = new SortDescriptionCollection(); _this.s = new SortDescriptionCollection(); _this.u = new SummaryDescriptionCollection(); _this.t.n(runOn(_this, _this.cy)); _this.s.n(runOn(_this, _this.bz)); _this.u.n(runOn(_this, _this.cz)); _this.j = new FilterExpressionCollection(); _this.j.n(runOn(_this, _this.bx)); _this.v = new TransactionService(runOn(_this, _this.b1), runOn(_this, _this.clone1), new TransactionKeyEqualityComparer()); var a = _this.v; a.stateChanged = delegateCombine(a.stateChanged, runOn(_this, _this.cu)); return _this; } BaseDataSource.prototype.cu = function (a, b) { if (a == 0 || a == 1) { if (this.updateNotifier != null) { var c = b; var d = c.transactions._inner[0]; if (d.type == 1 || d.type == TransactionType.Delete) { var e = d.id; var f = this.indexOfKey(e); if (f > -1) { var g = this.getItemAtIndex(f); this.updateNotifier.notifySetItem(f, g, g); var h = this.getStickyRows(); if (h != null) { for (var i = 0; i < h.length; i++) { var j = h[i]; var k = typeCast(DataSourceSpecialRow.$, this.getItemAtIndex(j)); if (k != null && k.rowType == 3 && k.targetRow == g) { this.updateNotifier.notifySetItem(j, k, k); break; } } } } } else if (d.type == 0) { } } } this.ct(a, b); }; BaseDataSource.prototype.ct = function (a, b) { }; BaseDataSource.prototype.ar = function () { return !this.isReadOnly && this.actualPrimaryKey != null && this.actualBaseDataProvider != null && this.v != null; }; BaseDataSource.prototype.b1 = function (a, b) { var e_1, _a; if (a != null && b != null) { var c = a; var d = b; try { for (var _b = __values(fromEnum(d)), _c = _b.next(); !_c.done; _c = _b.next()) { var e = _c.value; if (c.containsKey(e.key)) { c.item(e.key, e.value); } else { c.addItem(e.key, e.value); } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } } }; BaseDataSource.prototype.clone1 = function (a) { var e_2, _a; if (a != null) { var b = a; var c = new Dictionary$2(String_$type, Base.$, 0); try { for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) { var d = _c.value; c.addItem(d.key, d.value); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_2) throw e_2.error; } } return c; } return null; }; Object.defineProperty(BaseDataSource.prototype, "isReadOnly", { get: function () { return this._isReadOnly; }, set: function (a) { this._isReadOnly = a; }, enumerable: false, configurable: true }); BaseDataSource.prototype.get_isBatchingEnabled = function () { return this.aa; }; BaseDataSource.prototype.set_isBatchingEnabled = function (a) { this.aa = a; }; Object.defineProperty(BaseDataSource.prototype, "isBatchingEnabled", { get: function () { return this.get_isBatchingEnabled(); }, set: function (a) { this.set_isBatchingEnabled(a); }, enumerable: false, configurable: true }); Object.defineProperty(BaseDataSource.prototype, "canUndo", { get: function () { return this.v.k; }, enumerable: false, configurable: true }); Object.defineProperty(BaseDataSource.prototype, "canRedo", { get: function () { return this.v.j; }, enumerable: false, configurable: true }); Object.defineProperty(BaseDataSource.prototype, "canCommit", { get: function () { return this.v.a(-1).length > 0; }, enumerable: false, configurable: true }); BaseDataSource.prototype.updatePropertyAtKey = function (a, b, c, d) { if (d === void 0) { d = false; } if (this.ar()) { var e = null; if (a.length == 1 && typeCast(DataSourceSpecialRow.$, a[0]) !== null) { var f = a[0]; if (f.rowType == 3) { e = f; if (this.actualPrimaryKey != null) { a = new Array(this.actualPrimaryKey.length); this.getPrimaryKeyValue(e.targetRow, a); } else { a = [e.targetRow]; } } } var g = new Dictionary$2(String_$type, Base.$, 0); g.addItem(b, c); var h = new Transaction(); h.id = a; h.value = g; h.type = 1; this.v.v(h, d); if (this.isBatchingEnabled || d) { if (this.updateNotifier != null) { var i = this.indexOfKey(a); if (i > -1) { var j = this.getItemAtIndex(i); this.updateNotifier.notifySetItem(i, j, j); } if (this.isRowPinned(i)) { var k = -1; if (e != null) { k = this.indexOfItem(e); } else { var l = this.getStickyRows(); if (l != null) { for (var m = 0; m < l.length; m++) { var n = typeCast(DataSourceSpecialRow.$, this.getItemAtIndex(l[m])); if (n != null && n.rowType == 3) { e = n; k = l[m]; break; } } } } if (k > -1) { this.updateNotifier.notifySetItem(k, e, e); } } } } return h.transactionID; } return -1; }; BaseDataSource.prototype.removeItemByKey = function (a) { if (this.ar()) { var b = null; if (a.length == 1 && typeCast(DataSourceSpecialRow.$, a[0]) !== null) { var c = a[0]; if (c.rowType == 3) { b = c; if (this.actualPrimaryKey != null) { a = new Array(this.actualPrimaryKey.length); this.getPrimaryKeyValue(b.targetRow, a); } else { a = [b.targetRow]; } } } var d = new Transaction(); d.id = a; d.type = TransactionType.Delete; this.v.v(d, false); if (this.isBatchingEnabled) { if (this.updateNotifier != null) { var e = this.indexOfKey(a); if (e > -1) { var f = this.getItemAtIndex(e); this.updateNotifier.notifySetItem(e, f, f); } if (this.isRowPinned(e)) { var g = -1; if (b != null) { g = this.indexOfItem(b); } else { var h = this.getStickyRows(); if (h != null) { for (var i = 0; i < h.length; i++) { var j = typeCast(DataSourceSpecialRow.$, this.getItemAtIndex(h[i])); if (j != null && j.rowType == 3) { b = j; g = h[i]; break; } } } } if (g > -1) { this.updateNotifier.notifySetItem(g, b, b); } } } } } }; BaseDataSource.prototype.removeItem = function (a) { if (this.ar()) { var b = void 0; if (typeCast(DataSourceSpecialRow.$, a) !== null) { b = [a]; } else if (this.actualPrimaryKey == null || this.actualPrimaryKey.length < 1) { b = [a]; } else { b = new Array(this.actualPrimaryKey.length); this.getPrimaryKeyValue(a, b); } this.removeItemByKey(b); } }; BaseDataSource.prototype.addItem = function (a) { if (this.ar()) { if (typeCast(DataSourceSpecialRow.$, a) !== null) { return; } var b = new Transaction(); b.id = [a]; b.type = 0; this.v.v(b, false); } }; BaseDataSource.prototype.acceptPendingTransaction = function (a) { if (this.ar()) { var b = this.v.d(a); if (b != null) { this.v.ap(a); } } }; BaseDataSource.prototype.rejectPendingTransaction = function (a) { if (this.ar()) { var b = this.v.d(a); if (b != null) { this.v.x(a); if (this.updateNotifier != null) { if (b.type != 0) { var c = b.id; var d = this.indexOfKey(c); if (d > -1) { var e = this.getItemAtIndex(d); this.updateNotifier.notifySetItem(d, e, e); var f = this.getStickyRows(); if (f != null) { for (var g = 0; g < f.length; g++) { var h = typeCast(DataSourceSpecialRow.$, this.getItemAtIndex(f[g])); if (h != null && h.rowType == 3) { if (h.targetRow == e) { this.updateNotifier.notifySetItem(f[g], h, h); break; } } } } } } } } } }; BaseDataSource.prototype.commitEdits = function (a) { if (this.ar()) { var b = this.v.c(null).length > 0; var c = this.v.s(a, this.isBatchingEnabled); if (c == -1 && b) { if (this.updateNotifier != null) { this.updateNotifier.notifyClearItems(); } } return c; } return -1; }; BaseDataSource.prototype.cancelEdits = function () { if (this.ar()) { this.v.w(true, null); if (this.updateNotifier != null) { this.updateNotifier.notifyClearItems(); } } }; BaseDataSource.prototype.acceptPendingCommit = function (a) { if (this.ar()) { var b = this.v.e(a); if (b != null) { this.v.u(a); if (this.updateNotifier != null) { for (var c = 0; c < b.a.length; c++) { if (b.a[c].transactionType != 0) { var d = b.a[c].id; var e = this.indexOfKey(d); if (e > -1) { var f = this.getItemAtIndex(e); this.updateNotifier.notifySetItem(e, f, f); } } } } } } }; BaseDataSource.prototype.rejectPendingCommit = function (a) { if (this.ar()) { var b = this.v.e(a); if (b != null) { this.v.ac(a); if (this.updateNotifier != null) { for (var c = 0; c < b.a.length; c++) { if (b.a[c].transactionType != 0) { var d = b.a[c].id; var e = this.indexOfKey(d); if (e > -1) { var f = this.getItemAtIndex(e); this.updateNotifier.notifySetItem(e, f, f); } } } } } } }; BaseDataSource.prototype.undo = function () { if (this.ar()) { this.v.ae(); } }; BaseDataSource.prototype.redo = function () { if (this.ar()) { this.v.ab(); } }; BaseDataSource.prototype.hasEdit = function (a, b) { if (this.ar()) { a = this.g(a); var c = this.v.g(a); if (c != null) { var d = typeCast(Dictionary$2.$.specialize(String_$type, Base.$), c.value); if (d != null && d.containsKey(b)) { return true; } } c = this.v.ah(a); if (c != null) { var e = typeCast(Dictionary$2.$.specialize(String_$type, Base.$), c.value); if (e != null && e.containsKey(b)) { return true; } } c = this.v.ag(a);