UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

485 lines (484 loc) 16 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 } from "tslib"; import { Base, Number_$type, runOn, markType } from "./type"; import { IDataSourceVirtualDataProvider_$type } from "./IDataSourceVirtualDataProvider"; import { SortDescriptionCollection } from "./SortDescriptionCollection"; import { SummaryDescriptionCollection } from "./SummaryDescriptionCollection"; import { FilterExpressionCollection } from "./FilterExpressionCollection"; import { LinkedList$1 } from "./LinkedList$1"; import { AsyncVirtualDataSourceProviderWorker } from "./AsyncVirtualDataSourceProviderWorker"; import { DataSourceDataProviderSchemaChangedEventArgs } from "./DataSourceDataProviderSchemaChangedEventArgs"; import { stringContains } from "./string"; /** * @hidden */ var BaseVirtualDataProvider = /** @class */ /*@__PURE__*/ (function (_super) { __extends(BaseVirtualDataProvider, _super); function BaseVirtualDataProvider() { var _this = _super.call(this) || this; _this.d = null; _this.r = new LinkedList$1(Number_$type); _this.f = null; _this.l = null; _this.k = null; _this.h = null; _this.m = null; _this.s = 0; _this.j = null; _this.g = null; _this.t = 50; _this.schemaChanged = null; _this.i = null; _this._updateNotifier = null; _this.o = false; _this.a = null; _this.b = null; _this._summaryScope = 0; _this.p = false; _this.n = false; _this._batchCompleted = null; _this.l = new SortDescriptionCollection(); _this.l.n(runOn(_this, _this.w)); _this.k = new SortDescriptionCollection(); _this.k.n(runOn(_this, _this.v)); _this.h = new FilterExpressionCollection(); _this.h.n(runOn(_this, _this.u)); _this.m = new SummaryDescriptionCollection(); _this.m.n(runOn(_this, _this.x)); return _this; } BaseVirtualDataProvider.prototype.x = function (a, b) { this.queueAutoRefresh(); }; BaseVirtualDataProvider.prototype.u = function (a, b) { this.queueAutoRefresh(); }; BaseVirtualDataProvider.prototype.v = function (a, b) { this.queueAutoRefresh(); }; BaseVirtualDataProvider.prototype.w = function (a, b) { this.queueAutoRefresh(); }; BaseVirtualDataProvider.prototype.addPageRequest = function (a, b) { if (this.deferAutoRefresh) { return; } if (this.d != null && this.d.isShutdown) { this.d = null; this.f = null; } if (this.d == null) { this.f = runOn(this, this.ad); this.d = this.e(); } if (b == 2) { this.r.e(a); } else { this.r.f(a); } if (!this.d.addPageRequest(a, b)) { this.d = null; this.f = null; this.addPageRequest(a, b); } }; BaseVirtualDataProvider.prototype.c = function (a) { if (a != null) { a.pageSizeRequested = this.t; a.pageLoaded = this.f; a.executionContext = this.i; } return a; }; BaseVirtualDataProvider.prototype.ab = function () { if (!this.q()) { return; } this.f = runOn(this, this.ad); var a = this.c(null); this.d = this.e(); }; BaseVirtualDataProvider.prototype.q = function () { return true; }; BaseVirtualDataProvider.prototype.removePageRequest = function (a) { var b = this.r.c; while (b != null) { if (b.c == a) { this.r.h(b); } b = b.a; } if (this.d == null) { return; } this.d.removePageRequest(a); }; BaseVirtualDataProvider.prototype.removeAllPageRequests = function () { this.r.g(); if (this.d == null) { return; } this.d.removeAllPageRequests(); }; BaseVirtualDataProvider.prototype.close = function () { if (this.d != null) { this.d.shutdown(); this.d = null; this.f = null; } }; Object.defineProperty(BaseVirtualDataProvider.prototype, "pageLoaded", { get: function () { return this.g; }, set: function (a) { this.g = a; this.queueAutoRefresh(); }, enumerable: false, configurable: true }); BaseVirtualDataProvider.prototype.ad = function (a, b, c) { if (this.pageLoaded != null) { this.s = b; if (this.j == null) { var d = null; if (a != null) { d = a.schema(); } this.j = d; if (this.schemaChanged != null) { this.schemaChanged(this, new DataSourceDataProviderSchemaChangedEventArgs(this.j, this.s)); } } if (a.pageIndex() != AsyncVirtualDataSourceProviderWorker.ac) { this.pageLoaded(a, b, c); } } }; Object.defineProperty(BaseVirtualDataProvider.prototype, "pageSizeRequested", { get: function () { return this.t; }, set: function (a) { this.t = a; this.queueAutoRefresh(); }, enumerable: false, configurable: true }); BaseVirtualDataProvider.prototype.getItemValue = function (a, b) { var c = a; if (c.containsKey(b)) { return c.item(b); } return null; }; Object.defineProperty(BaseVirtualDataProvider.prototype, "actualCount", { get: function () { return this.s; }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "actualSchema", { get: function () { return this.j; }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "executionContext", { get: function () { return this.i; }, set: function (a) { this.i = a; this.queueAutoRefresh(); }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "updateNotifier", { get: function () { return this._updateNotifier; }, set: function (a) { this._updateNotifier = a; }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "deferAutoRefresh", { get: function () { return this.o; }, set: function (a) { this.o = a; if (!this.o) { this.queueAutoRefresh(); } if (this.o && this.q() && this.j == null) { this.queueAutoRefresh(); } }, enumerable: false, configurable: true }); BaseVirtualDataProvider.prototype.get_isSortingSupported = function () { return true; }; Object.defineProperty(BaseVirtualDataProvider.prototype, "isSortingSupported", { get: function () { return this.get_isSortingSupported(); }, enumerable: false, configurable: true }); BaseVirtualDataProvider.prototype.get_isGroupingSupported = function () { return true; }; Object.defineProperty(BaseVirtualDataProvider.prototype, "isGroupingSupported", { get: function () { return this.get_isGroupingSupported(); }, enumerable: false, configurable: true }); BaseVirtualDataProvider.prototype.get_isFilteringSupported = function () { return true; }; Object.defineProperty(BaseVirtualDataProvider.prototype, "isFilteringSupported", { get: function () { return this.get_isFilteringSupported(); }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "sortDescriptions", { get: function () { return this.l; }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "groupDescriptions", { get: function () { return this.k; }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "summaryDescriptions", { get: function () { return this.m; }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "filterExpressions", { get: function () { return this.h; }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "propertiesRequested", { get: function () { return this.a; }, set: function (a) { this.a = a; this.queueAutoRefresh(); }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "schemaIncludedProperties", { get: function () { return this.b; }, set: function (a) { this.b = a; this.queueAutoRefresh(); }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "summaryScope", { get: function () { return this._summaryScope; }, set: function (a) { this._summaryScope = a; }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "notifyUsingSourceIndexes", { get: function () { return true; }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "isItemIndexLookupSupported", { get: function () { return false; }, enumerable: false, configurable: true }); Object.defineProperty(BaseVirtualDataProvider.prototype, "isKeyIndexLookupSupported", { get: function () { return false; }, enumerable: false, configurable: true }); BaseVirtualDataProvider.prototype.notifyClearItems = function () { if (this.updateNotifier != null) { this.updateNotifier.notifyClearItems(); } }; BaseVirtualDataProvider.prototype.notifyInsertItem = function (a, b) { if (this.updateNotifier != null) { this.updateNotifier.notifyInsertItem(a, b); } }; BaseVirtualDataProvider.prototype.notifyRemoveItem = function (a, b) { if (this.updateNotifier != null) { this.updateNotifier.notifyRemoveItem(a, b); } }; BaseVirtualDataProvider.prototype.notifySetItem = function (a, b, c) { if (this.updateNotifier != null) { this.updateNotifier.notifySetItem(a, b, c); } }; BaseVirtualDataProvider.prototype.ac = function () { if (this.p) { return; } if (this.executionContext != null) { this.p = true; this.executionContext.enqueueAction(runOn(this, this.aa)); } }; BaseVirtualDataProvider.prototype.aa = function () { if (!this.p) { return; } this.p = false; this.ag(); }; BaseVirtualDataProvider.prototype.ag = function () { this.ah(); }; BaseVirtualDataProvider.prototype.ah = function () { this.removeAllPageRequests(); this.close(); this.ab(); this.y(); }; BaseVirtualDataProvider.prototype.y = function () { if (this.d != null) { this.d.addPageRequest(AsyncVirtualDataSourceProviderWorker.ac, 2); } }; BaseVirtualDataProvider.prototype.queueAutoRefresh = function () { if (this.deferAutoRefresh) { return; } if (this.n) { return; } if (this.executionContext != null) { this.n = true; this.executionContext.enqueueAction(runOn(this, this.z)); } }; BaseVirtualDataProvider.prototype.z = function () { if (this.deferAutoRefresh) { this.n = false; return; } if (!this.n) { return; } this.n = false; this.ae(); }; BaseVirtualDataProvider.prototype.ae = function () { this.af(); }; BaseVirtualDataProvider.prototype.af = function () { this.removeAllPageRequests(); this.close(); this.ab(); if (this.actualSchema == null) { this.d.addPageRequest(AsyncVirtualDataSourceProviderWorker.ac, 2); } else { this.d.addPageRequest(0, 1); } }; BaseVirtualDataProvider.prototype.flushAutoRefresh = function () { this.z(); }; BaseVirtualDataProvider.prototype.refresh = function () { this.ae(); }; BaseVirtualDataProvider.prototype.indexOfItem = function (a) { return -1; }; BaseVirtualDataProvider.prototype.indexOfKey = function (a) { return -1; }; BaseVirtualDataProvider.prototype.resolveSchemaPropertyType = function (a) { if (this.actualSchema == null) { return 11; } if (stringContains(a, ".")) { return 11; } for (var b = 0; b < this.actualSchema.propertyNames.length; b++) { var c = this.actualSchema.propertyNames[b]; if (c == a) { return this.actualSchema.propertyTypes[b]; } } return 11; }; BaseVirtualDataProvider.prototype.setItemValue = function (a, b, c) { }; BaseVirtualDataProvider.prototype.removeItem = function (a) { }; BaseVirtualDataProvider.prototype.addItem = function (a) { }; BaseVirtualDataProvider.prototype.createBatchRequest = function (a) { if (this.d != null) { this.d.createBatchRequest(a); } }; Object.defineProperty(BaseVirtualDataProvider.prototype, "batchCompleted", { get: function () { return this._batchCompleted; }, set: function (a) { this._batchCompleted = a; }, enumerable: false, configurable: true }); BaseVirtualDataProvider.$t = markType(BaseVirtualDataProvider, 'BaseVirtualDataProvider', Base.$, [IDataSourceVirtualDataProvider_$type]); return BaseVirtualDataProvider; }(Base)); export { BaseVirtualDataProvider };