UNPKG

igniteui-react-core

Version:
103 lines (102 loc) 3.61 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, Delegate_$type, Number_$type, markType } from "./type"; import { FastIterationDictionary$2 } from "./FastIterationDictionary$2"; import { DelayManagerCallbackSettings } from "./DelayManagerCallbackSettings"; /** * @hidden */ var DelayManager = /** @class */ /*@__PURE__*/ (function (_super) { __extends(DelayManager, _super); function DelayManager(a) { var _rest = []; for (var _i = 1; _i < arguments.length; _i++) { _rest[_i - 1] = arguments[_i]; } var _this = _super.call(this) || this; _this.a = null; _this.c = null; _this.d = null; _this.e = 0; a = (a == void 0) ? 0 : a; switch (a) { case 0: { _this.c = new FastIterationDictionary$2(Delegate_$type, DelayManagerCallbackSettings.$, 0); _this.d = new FastIterationDictionary$2(Number_$type, Delegate_$type, 0); } break; case 1: { var c = _rest[0]; { _this.c = new FastIterationDictionary$2(Delegate_$type, DelayManagerCallbackSettings.$, 0); _this.d = new FastIterationDictionary$2(Number_$type, Delegate_$type, 0); } _this.a = c; } break; } return _this; } Object.defineProperty(DelayManager.prototype, "b", { get: function () { return this.a; }, set: function (a) { this.a = a; }, enumerable: false, configurable: true }); DelayManager.prototype.f = function (a, b) { var _this = this; if (this.a == null) { return -1; } if (this.c.d(a)) { this.c.item(a).c = this.a.getCurrentRelativeTime(); } else { var c = new DelayManagerCallbackSettings(); c.a = this.e++; c.c = this.a.getCurrentRelativeTime(); c.b = b; this.c.s(a, c); this.d.s(c.a, a); } this.a.executeDelayed(function () { return _this.h(a); }, b); return this.c.item(a).a; }; DelayManager.prototype.g = function (a) { if (this.d.d(a)) { var b = this.d.item(a); this.d.f(a); this.c.f(b); } }; DelayManager.prototype.h = function (a) { var _this = this; if (this.c.d(a)) { var b = this.c.item(a); var c = this.a == null ? 0 : this.a.getCurrentRelativeTime(); var d = c - b.c; if (this.a == null || d >= b.b) { a(); this.c.f(a); this.d.f(b.a); } else { this.a.executeDelayed(function () { return _this.h(a); }, (b.b - d)); } } }; DelayManager.$t = markType(DelayManager, 'DelayManager'); return DelayManager; }(Base)); export { DelayManager };