targetj 1.1.8 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -201,10 +201,8 @@ var AnimationManager = /*#__PURE__*/function () {
201
201
  tmodel.removeFromAnimatingMap(originalKey);
202
202
  this.recordMap.delete(recId);
203
203
  this.completeRecord(tmodel, rec, cleanKey, originalKey);
204
+ TModelUtil.commitAnimatedStyles(tmodel, new Set([originalKey]));
204
205
  if (!tmodel.hasAnimatingTargets()) {
205
- if (tmodel.finalKeyframe && tmodel.hasDom()) {
206
- AnimationUtil.fixStyleByAnimation(tmodel, tmodel.finalKeyframe);
207
- }
208
206
  tmodel.lastBatch = undefined;
209
207
  }
210
208
  rec.status = 'complete';
@@ -263,7 +261,7 @@ var AnimationManager = /*#__PURE__*/function () {
263
261
  var ct = (_record$anim$effect = record.anim.effect) === null || _record$anim$effect === void 0 || (_record$anim$effect$g = (_record$anim$effect2 = _record$anim$effect).getComputedTiming) === null || _record$anim$effect$g === void 0 ? void 0 : _record$anim$effect$g.call(_record$anim$effect2);
264
262
  var progress = (_ct$progress = ct === null || ct === void 0 ? void 0 : ct.progress) !== null && _ct$progress !== void 0 ? _ct$progress : 0;
265
263
  var finished = ps === "finished" || ps === "idle" || progress >= 0.999999;
266
- if (finished) {
264
+ if (finished && record.status !== 'done') {
267
265
  record.status = 'done';
268
266
  animsToFinalize.add(record.anim);
269
267
  }
@@ -425,21 +423,13 @@ var AnimationManager = /*#__PURE__*/function () {
425
423
  }, {
426
424
  key: "fixTModelStyleFromFrame",
427
425
  value: function fixTModelStyleFromFrame(tmodel, frame) {
428
- if (!tmodel.hasDom() || !frame) {
426
+ if (!frame) {
429
427
  return;
430
428
  }
431
- var out = _objectSpread({}, frame.styleMap);
432
- var hasTf = Object.keys(frame.tfMap).length > 0;
433
- if (hasTf) {
434
- Object.keys(tmodel.tfMap).forEach(function (key) {
435
- tmodel.tfMap[key] = tmodel.val(key);
436
- });
437
- var tfMap = _objectSpread(_objectSpread({}, tmodel.tfMap), frame.tfMap);
438
- frame.tfMap = tfMap;
439
- out.transform = TModelUtil.getTransformString(tmodel, tfMap);
440
- }
441
- AnimationUtil.addUnitsToFrame(out);
442
- AnimationUtil.fixStyleByAnimation(tmodel, out);
429
+ TModelUtil.fixStyle(tmodel, {
430
+ frame: frame,
431
+ force: true
432
+ });
443
433
  }
444
434
  }, {
445
435
  key: "collectFramesForKey",
@@ -102,48 +102,11 @@ var AnimationUtil = /*#__PURE__*/function () {
102
102
  };
103
103
  getAnimationManager().animate(tmodel, batch, AnimationUtil.getAnimationHooks());
104
104
  }
105
- }, {
106
- key: "fixStyleByAnimation",
107
- value: function fixStyleByAnimation(tmodel, frame) {
108
- if (!tmodel.hasDom()) {
109
- return;
110
- }
111
- var keys = Object.keys(frame);
112
- for (var _i = 0, _keys = keys; _i < _keys.length; _i++) {
113
- var key = _keys[_i];
114
- if (key === 'offset') {
115
- continue;
116
- }
117
- var value = frame[key];
118
- if (value === null) {
119
- continue;
120
- }
121
- var num = value;
122
- if (typeof value === 'string' && value.endsWith('px')) {
123
- var parsed = Number(value.slice(0, -2));
124
- if (!Number.isNaN(parsed)) {
125
- num = parsed;
126
- }
127
- }
128
- if (key === 'width') {
129
- tmodel.styleMap.width = num;
130
- tmodel.$dom.width(value);
131
- } else if (key === 'height') {
132
- tmodel.styleMap.height = num;
133
- tmodel.$dom.height(value);
134
- } else if (key === 'transform') {
135
- tmodel.$dom.transform(value, tmodel.val('transformOrder'));
136
- } else if (!TargetData.transformMap[key]) {
137
- tmodel.$dom.style(key, value);
138
- tmodel.styleMap[key] = num;
139
- }
140
- }
141
- }
142
105
  }, {
143
106
  key: "addUnitsToFrame",
144
107
  value: function addUnitsToFrame(out) {
145
- for (var _i2 = 0, _Object$keys = Object.keys(out); _i2 < _Object$keys.length; _i2++) {
146
- var k = _Object$keys[_i2];
108
+ for (var _i = 0, _Object$keys = Object.keys(out); _i < _Object$keys.length; _i++) {
109
+ var k = _Object$keys[_i];
147
110
  if (k === 'offset' || k === 'transform') {
148
111
  continue;
149
112
  }
@@ -199,9 +162,9 @@ var AnimationUtil = /*#__PURE__*/function () {
199
162
  } finally {
200
163
  _iterator.f();
201
164
  }
202
- for (var _i3 = 0, _records = records; _i3 < _records.length; _i3++) {
165
+ for (var _i2 = 0, _records = records; _i2 < _records.length; _i2++) {
203
166
  var _tmodel$noDomUpdating, _tmodel$noDomUpdating2;
204
- var record = _records[_i3];
167
+ var record = _records[_i2];
205
168
  var originalKey = record.originalKey;
206
169
  var targetValue = tmodel.targetValues[originalKey];
207
170
  if (!targetValue) {
@@ -239,8 +202,8 @@ var AnimationUtil = /*#__PURE__*/function () {
239
202
  } finally {
240
203
  _iterator2.f();
241
204
  }
242
- for (var _i4 = 0, _records2 = records; _i4 < _records2.length; _i4++) {
243
- var record = _records2[_i4];
205
+ for (var _i3 = 0, _records2 = records; _i3 < _records2.length; _i3++) {
206
+ var record = _records2[_i3];
244
207
  var originalKey = record.originalKey;
245
208
  tmodel.addToNoDomUpdatingTargets(originalKey);
246
209
  }
@@ -522,8 +485,8 @@ var AnimationUtil = /*#__PURE__*/function () {
522
485
  if (!batch || !((_batch$frames = batch.frames) !== null && _batch$frames !== void 0 && _batch$frames.length)) {
523
486
  return;
524
487
  }
525
- for (var _i5 = 0, _Object$entries = Object.entries(batch.keyMap); _i5 < _Object$entries.length; _i5++) {
526
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i5], 2),
488
+ for (var _i4 = 0, _Object$entries = Object.entries(batch.keyMap); _i4 < _Object$entries.length; _i4++) {
489
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i4], 2),
527
490
  cleanKey = _Object$entries$_i[0],
528
491
  originalKeys = _Object$entries$_i[1];
529
492
  var _iterator8 = _createForOfIteratorHelper(originalKeys),
@@ -18,11 +18,12 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
18
18
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
19
19
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
20
20
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
21
- import { App, getRunScheduler, getLocationManager, getAnimationManager, getDomTModelById, getEvents } from "./App.js";
21
+ import { App, getRunScheduler, getAnimationManager, getDomTModelById, getEvents } from "./App.js";
22
22
  import { TargetExecutor } from "./TargetExecutor.js";
23
23
  import { TUtil } from "./TUtil.js";
24
24
  import { TargetParser } from "./TargetParser.js";
25
25
  import { TargetUtil } from "./TargetUtil.js";
26
+ import { TModelUtil } from "./TModelUtil.js";
26
27
  import { TargetData } from "./TargetData.js";
27
28
  import { $Dom } from "./$Dom.js";
28
29
  import { Easing } from "./Easing.js";
@@ -131,23 +132,17 @@ var BaseModel = /*#__PURE__*/function () {
131
132
  var _this$state8, _this$state8$fetchAct;
132
133
  return (_this$state8$fetchAct = (_this$state8 = this.state()).fetchActionTargetList) !== null && _this$state8$fetchAct !== void 0 ? _this$state8$fetchAct : _this$state8.fetchActionTargetList = [];
133
134
  }
134
- }, {
135
- key: "activatedTargets",
136
- get: function get() {
137
- var _this$state9, _this$state9$activate;
138
- return (_this$state9$activate = (_this$state9 = this.state()).activatedTargets) !== null && _this$state9$activate !== void 0 ? _this$state9$activate : _this$state9.activatedTargets = [];
139
- }
140
135
  }, {
141
136
  key: "targetMethodMap",
142
137
  get: function get() {
143
- var _this$state10, _this$state10$targetM;
144
- return (_this$state10$targetM = (_this$state10 = this.state()).targetMethodMap) !== null && _this$state10$targetM !== void 0 ? _this$state10$targetM : _this$state10.targetMethodMap = {};
138
+ var _this$state9, _this$state9$targetMe;
139
+ return (_this$state9$targetMe = (_this$state9 = this.state()).targetMethodMap) !== null && _this$state9$targetMe !== void 0 ? _this$state9$targetMe : _this$state9.targetMethodMap = {};
145
140
  }
146
141
  }, {
147
142
  key: "targetExecutionCount",
148
143
  get: function get() {
149
- var _this$state11, _this$state11$targetE;
150
- return (_this$state11$targetE = (_this$state11 = this.state()).targetExecutionCount) !== null && _this$state11$targetE !== void 0 ? _this$state11$targetE : _this$state11.targetExecutionCount = 0;
144
+ var _this$state10, _this$state10$targetE;
145
+ return (_this$state10$targetE = (_this$state10 = this.state()).targetExecutionCount) !== null && _this$state10$targetE !== void 0 ? _this$state10$targetE : _this$state10.targetExecutionCount = 0;
151
146
  },
152
147
  set: function set(val) {
153
148
  this.state().targetExecutionCount = val;
@@ -155,26 +150,26 @@ var BaseModel = /*#__PURE__*/function () {
155
150
  }, {
156
151
  key: "addedChildren",
157
152
  get: function get() {
158
- var _this$state12, _this$state12$addedCh;
159
- return (_this$state12$addedCh = (_this$state12 = this.state()).addedChildren) !== null && _this$state12$addedCh !== void 0 ? _this$state12$addedCh : _this$state12.addedChildren = [];
153
+ var _this$state11, _this$state11$addedCh;
154
+ return (_this$state11$addedCh = (_this$state11 = this.state()).addedChildren) !== null && _this$state11$addedCh !== void 0 ? _this$state11$addedCh : _this$state11.addedChildren = [];
160
155
  }
161
156
  }, {
162
157
  key: "deletedChildren",
163
158
  get: function get() {
164
- var _this$state13, _this$state13$deleted;
165
- return (_this$state13$deleted = (_this$state13 = this.state()).deletedChildren) !== null && _this$state13$deleted !== void 0 ? _this$state13$deleted : _this$state13.deletedChildren = [];
159
+ var _this$state12, _this$state12$deleted;
160
+ return (_this$state12$deleted = (_this$state12 = this.state()).deletedChildren) !== null && _this$state12$deleted !== void 0 ? _this$state12$deleted : _this$state12.deletedChildren = [];
166
161
  }
167
162
  }, {
168
163
  key: "movedChildren",
169
164
  get: function get() {
170
- var _this$state14, _this$state14$movedCh;
171
- return (_this$state14$movedCh = (_this$state14 = this.state()).movedChildren) !== null && _this$state14$movedCh !== void 0 ? _this$state14$movedCh : _this$state14.movedChildren = [];
165
+ var _this$state13, _this$state13$movedCh;
166
+ return (_this$state13$movedCh = (_this$state13 = this.state()).movedChildren) !== null && _this$state13$movedCh !== void 0 ? _this$state13$movedCh : _this$state13.movedChildren = [];
172
167
  }
173
168
  }, {
174
169
  key: "lastChildrenUpdate",
175
170
  get: function get() {
176
- var _this$state15, _this$state15$lastChi;
177
- return (_this$state15$lastChi = (_this$state15 = this.state()).lastChildrenUpdate) !== null && _this$state15$lastChi !== void 0 ? _this$state15$lastChi : _this$state15.lastChildrenUpdate = {
171
+ var _this$state14, _this$state14$lastChi;
172
+ return (_this$state14$lastChi = (_this$state14 = this.state()).lastChildrenUpdate) !== null && _this$state14$lastChi !== void 0 ? _this$state14$lastChi : _this$state14.lastChildrenUpdate = {
178
173
  additions: [],
179
174
  deletions: []
180
175
  };
@@ -182,14 +177,14 @@ var BaseModel = /*#__PURE__*/function () {
182
177
  }, {
183
178
  key: "visibleChildren",
184
179
  get: function get() {
185
- var _this$state16, _this$state16$visible;
186
- return (_this$state16$visible = (_this$state16 = this.state()).visibleChildren) !== null && _this$state16$visible !== void 0 ? _this$state16$visible : _this$state16.visibleChildren = [];
180
+ var _this$state15, _this$state15$visible;
181
+ return (_this$state15$visible = (_this$state15 = this.state()).visibleChildren) !== null && _this$state15$visible !== void 0 ? _this$state15$visible : _this$state15.visibleChildren = [];
187
182
  }
188
183
  }, {
189
184
  key: "passiveTargetList",
190
185
  get: function get() {
191
- var _this$state17, _this$state17$passive;
192
- return (_this$state17$passive = (_this$state17 = this.state()).passiveTargetList) !== null && _this$state17$passive !== void 0 ? _this$state17$passive : _this$state17.passiveTargetList = [];
186
+ var _this$state16, _this$state16$passive;
187
+ return (_this$state16$passive = (_this$state16 = this.state()).passiveTargetList) !== null && _this$state16$passive !== void 0 ? _this$state16$passive : _this$state16.passiveTargetList = [];
193
188
  },
194
189
  set: function set(val) {
195
190
  this.state().passiveTargetList = val;
@@ -197,8 +192,8 @@ var BaseModel = /*#__PURE__*/function () {
197
192
  }, {
198
193
  key: "passiveTargetMap",
199
194
  get: function get() {
200
- var _this$state18, _this$state18$passive;
201
- return (_this$state18$passive = (_this$state18 = this.state()).passiveTargetMap) !== null && _this$state18$passive !== void 0 ? _this$state18$passive : _this$state18.passiveTargetMap = {};
195
+ var _this$state17, _this$state17$passive;
196
+ return (_this$state17$passive = (_this$state17 = this.state()).passiveTargetMap) !== null && _this$state17$passive !== void 0 ? _this$state17$passive : _this$state17.passiveTargetMap = {};
202
197
  },
203
198
  set: function set(val) {
204
199
  this.state().passiveTargetMap = val;
@@ -303,7 +298,7 @@ var BaseModel = /*#__PURE__*/function () {
303
298
  if (doesNextTargetUsePrevValue || isInactiveKey || isExternalEvent || isInternalEvent || targetType === 'object' || targetType === 'function') {
304
299
  if (!TUtil.isDefined(target.value) && !TargetParser.isChildObjectTarget(key, target) && !TargetParser.isIntervalTarget(target)) {
305
300
  needsTargetExecution = true;
306
- var value = _objectSpread({}, target);
301
+ var value = _typeof(target) === 'object' && target !== null && !Array.isArray(target) ? _objectSpread({}, target) : target;
307
302
  target = TargetUtil.wrapTarget(this, value, key);
308
303
  var _iterator = _createForOfIteratorHelper(TargetData.lifecycleCallbackSet),
309
304
  _step;
@@ -373,25 +368,6 @@ var BaseModel = /*#__PURE__*/function () {
373
368
  }
374
369
  this.functionTargetNames.push(key);
375
370
  }
376
- }, {
377
- key: "activate",
378
- value: function activate(targetName) {
379
- getLocationManager().addToActivatedList(this);
380
- this.currentStatus = 'active';
381
- if (targetName && this.isTargetEnabled(targetName) && this.activatedTargets.indexOf(targetName) === -1) {
382
- this.activatedTargets.push(targetName);
383
- }
384
- }
385
- }, {
386
- key: "isActivated",
387
- value: function isActivated() {
388
- return this.currentStatus === 'active';
389
- }
390
- }, {
391
- key: "deactivate",
392
- value: function deactivate() {
393
- this.currentStatus = undefined;
394
- }
395
371
  }, {
396
372
  key: "excludeDefaultStyling",
397
373
  value: function excludeDefaultStyling() {
@@ -448,16 +424,17 @@ var BaseModel = /*#__PURE__*/function () {
448
424
  var _this$styleTargetMap;
449
425
  var styleFlag = true;
450
426
  if (TargetData.transformMap[key]) {
451
- if (this.getParent()) {
427
+ if (this.getParent() && !this.isDomIsland()) {
452
428
  this.calcAbsolutePosition(this.getX(), this.getY());
453
429
  }
430
+ styleFlag = this.tfMap[key] !== TModelUtil.getTransformValue(this, key);
454
431
  } else if (key === 'width' || key === 'height') {
455
- var dimension = Math.floor(key === 'width' ? this.val('width') : this.val('height'));
456
- if (this.styleMap[key] === dimension) {
432
+ if (this.styleMap[key] === this.val(key)) {
457
433
  styleFlag = false;
458
434
  }
459
435
  } else if (key === 'dim') {
460
- if (this.styleMap[key] === Math.floor(this.val('dim'))) {
436
+ var dim = this.val('dim');
437
+ if (this.styleMap.width === dim && this.styleMap.height === dim) {
461
438
  styleFlag = false;
462
439
  }
463
440
  } else if (TUtil.isDefined(this.val(key)) && this.styleMap[key] === this.val(key)) {
@@ -1015,9 +992,6 @@ var BaseModel = /*#__PURE__*/function () {
1015
992
  }
1016
993
  var originalTargetName = TargetUtil.currentTargetName;
1017
994
  var originalTModel = TargetUtil.currentTModel;
1018
- if (originalTargetName === 'swell') {
1019
- console.log("setTarget: " + this.oid + ", " + originalTModel.oid + ", " + originalTargetName);
1020
- }
1021
995
  if (originalTModel && originalTargetName && originalTModel !== this) {
1022
996
  TargetUtil.markChildAction(originalTModel, originalTargetName, this);
1023
997
  }
@@ -1365,6 +1339,7 @@ var BaseModel = /*#__PURE__*/function () {
1365
1339
  }
1366
1340
  targetValue.invokerTModel = invokerTModel;
1367
1341
  targetValue.invokerTarget = invokerTarget;
1342
+ TargetUtil.disableEventBatching(invokerTModel, invokerTarget);
1368
1343
  if (this.targetValues[key]) {
1369
1344
  targetValue.activationTime = TUtil.now();
1370
1345
  targetValue.lastUpdate = TUtil.now();
@@ -1381,7 +1356,6 @@ var BaseModel = /*#__PURE__*/function () {
1381
1356
  targetValue.cycles = (_this$targets$key$cyc = (_this$targets$key = this.targets[key]) === null || _this$targets$key === void 0 ? void 0 : _this$targets$key.cycles) !== null && _this$targets$key$cyc !== void 0 ? _this$targets$key$cyc : targetValue.cycles;
1382
1357
  }
1383
1358
  this.setTargetStatus(key, 'active');
1384
- this.activate(key);
1385
1359
  }
1386
1360
  return this;
1387
1361
  }
@@ -77,6 +77,8 @@ var EventListener = /*#__PURE__*/function () {
77
77
  hover: null
78
78
  };
79
79
  this.eventQueue = [];
80
+ this.priorityEventTModels = new Set();
81
+ this.capturedEventEpoch = 0;
80
82
  this.attachedEventMap = {};
81
83
  this.eventTargetMap = {};
82
84
  this.allEvents = {};
@@ -331,6 +333,7 @@ var EventListener = /*#__PURE__*/function () {
331
333
  this.currentHandlers.end = undefined;
332
334
  this.currentKey = this.currentTouch.key;
333
335
  if (this.eventQueue.length === 0) {
336
+ this.priorityEventTModels.clear();
334
337
  this.currentEventName = '';
335
338
  this.currentEventType = '';
336
339
  this.currentEventTModel = undefined;
@@ -339,6 +342,10 @@ var EventListener = /*#__PURE__*/function () {
339
342
  return;
340
343
  }
341
344
  var lastEvent = this.eventQueue.shift();
345
+ if (lastEvent.eventType === 'key' || lastEvent.eventType === 'keydown') {
346
+ var _lastEvent$originalEv, _lastEvent$originalEv2;
347
+ this.currentKey = ((_lastEvent$originalEv = lastEvent.originalEvent) === null || _lastEvent$originalEv === void 0 ? void 0 : _lastEvent$originalEv.which) || ((_lastEvent$originalEv2 = lastEvent.originalEvent) === null || _lastEvent$originalEv2 === void 0 ? void 0 : _lastEvent$originalEv2.keyCode) || '';
348
+ }
342
349
  if (this.canFindHandlers && !lastEvent.synthetic) {
343
350
  this.findEventHandlers(lastEvent);
344
351
  }
@@ -353,6 +360,8 @@ var EventListener = /*#__PURE__*/function () {
353
360
  this.currentEventTModel = lastEvent.tmodel;
354
361
  this.currentOriginalEvent = lastEvent.originalEvent;
355
362
  this.currentTouch.key = '';
363
+ this.priorityEventTModels.clear();
364
+ this.capturedEventEpoch++;
356
365
  this.markCapturedEventDirty(lastEvent);
357
366
  if (lastEvent.eventType === 'end' || lastEvent.eventType === 'click') {
358
367
  this.canFindHandlers = true;
@@ -362,12 +371,17 @@ var EventListener = /*#__PURE__*/function () {
362
371
  }, {
363
372
  key: "markCapturedEventDirty",
364
373
  value: function markCapturedEventDirty(lastEvent) {
374
+ var _this7 = this;
365
375
  var mark = function mark(tmodel, reason) {
376
+ var _tmodel$externalEvent2;
366
377
  if (!tmodel) {
367
378
  return;
368
379
  }
369
380
  tmodel.markEventDirty();
370
381
  tmodel.markLayoutDirty(reason);
382
+ if (lastEvent.eventType !== 'popstate' && (_tmodel$externalEvent2 = tmodel.externalEventMap) !== null && _tmodel$externalEvent2 !== void 0 && _tmodel$externalEvent2.size) {
383
+ _this7.priorityEventTModels.add(tmodel);
384
+ }
371
385
  };
372
386
  mark(lastEvent.tmodel, "".concat(lastEvent.eventType, "-event"));
373
387
  switch (lastEvent.eventType) {
@@ -385,17 +399,30 @@ var EventListener = /*#__PURE__*/function () {
385
399
  mark(this.currentHandlers.scrollLeft, "scrollleft-event");
386
400
  mark(this.currentHandlers.scrollTop, "scrolltop-event");
387
401
  mark(this.currentHandlers.pinch, "pinch-event");
402
+ mark(this.currentHandlers.hover, "hover-event");
403
+ break;
404
+ case "key":
405
+ case "keydown":
406
+ mark(this.currentHandlers.focus, "key-event");
388
407
  break;
389
408
  case "popstate":
390
409
  for (var _i2 = 0, _Object$values = Object.values(getManager().visibleOidMap); _i2 < _Object$values.length; _i2++) {
391
- var _tmodel$externalEvent2;
410
+ var _tmodel$externalEvent3;
392
411
  var tmodel = _Object$values[_i2];
393
- if ((_tmodel$externalEvent2 = tmodel.externalEventMap) !== null && _tmodel$externalEvent2 !== void 0 && _tmodel$externalEvent2.has("onPopState")) {
412
+ if ((_tmodel$externalEvent3 = tmodel.externalEventMap) !== null && _tmodel$externalEvent3 !== void 0 && _tmodel$externalEvent3.has("onPopState")) {
394
413
  mark(tmodel, "popstate-event");
395
414
  }
396
415
  }
397
416
  break;
398
417
  }
418
+
419
+ // Focus/enter/leave can change as a result of an input event.
420
+ if (lastEvent.eventType !== 'popstate') {
421
+ mark(this.currentHandlers.justFocused, 'focus-event');
422
+ mark(this.currentHandlers.blur, 'blur-event');
423
+ mark(this.currentHandlers.enter, 'enter-event');
424
+ mark(this.currentHandlers.leave, 'leave-event');
425
+ }
399
426
  }
400
427
  }, {
401
428
  key: "handleDocEvent",
@@ -419,7 +446,7 @@ var EventListener = /*#__PURE__*/function () {
419
446
  _this$currentHandlers4,
420
447
  _this$currentHandlers6,
421
448
  _this$currentHandlers7,
422
- _this7 = this,
449
+ _this8 = this,
423
450
  _tmodel3,
424
451
  _tmodel4;
425
452
  if (!event) {
@@ -486,7 +513,12 @@ var EventListener = /*#__PURE__*/function () {
486
513
  (_tmodel2 = tmodel) === null || _tmodel2 === void 0 || _tmodel2.markLayoutDirty('event');
487
514
  this.lastEvent = newEvent;
488
515
  if (queue) {
489
- this.eventQueue.push(this.lastEvent);
516
+ var lastQueued = this.eventQueue.at(-1);
517
+ if (eventType === 'move' && (lastQueued === null || lastQueued === void 0 ? void 0 : lastQueued.eventType) === 'move' && lastQueued.originalName === originalName && lastQueued.tmodel === tmodel) {
518
+ this.eventQueue[this.eventQueue.length - 1] = newEvent;
519
+ } else {
520
+ this.eventQueue.push(newEvent);
521
+ }
490
522
  }
491
523
  var touch;
492
524
  switch (eventName) {
@@ -625,9 +657,9 @@ var EventListener = /*#__PURE__*/function () {
625
657
  case 'scroll':
626
658
  clearTimeout(this.windowScrollEndTimer);
627
659
  this.windowScrollEndTimer = setTimeout(function () {
628
- _this7.queueWindowScrollEndEvent('x', tmodel);
629
- _this7.queueWindowScrollEndEvent('y', tmodel);
630
- _this7.windowScrollEndTimer = 0;
660
+ _this8.queueWindowScrollEndEvent('x', tmodel);
661
+ _this8.queueWindowScrollEndEvent('y', tmodel);
662
+ _this8.windowScrollEndTimer = 0;
631
663
  }, 450);
632
664
  if (isWindowEvent) {
633
665
  this.windowEpoch++;
@@ -770,6 +802,7 @@ var EventListener = /*#__PURE__*/function () {
770
802
  this.clearEnd();
771
803
  this.clearTouch();
772
804
  this.eventQueue.length = 0;
805
+ this.priorityEventTModels.clear();
773
806
  this.touchCount = 0;
774
807
  this.canFindHandlers = true;
775
808
  this.lastEvent = undefined;
@@ -283,14 +283,12 @@ var LoadingManager = /*#__PURE__*/function () {
283
283
  }, {
284
284
  key: "isNextLoadingItemSuccessful",
285
285
  value: function isNextLoadingItemSuccessful(tmodel, targetName) {
286
- var key = this.getTModelKey(tmodel, targetName);
287
- var modelEntry = this.tmodelKeyMap[key];
288
- if (!modelEntry) {
286
+ var entry = this.isLoading(tmodel, targetName);
287
+ if (!entry || entry.activeIndex >= entry.entryCount) {
289
288
  return false;
290
289
  }
291
- var loadTargetName = TUtil.getLoadTargetName(targetName);
292
- var targetValue = tmodel.val(loadTargetName);
293
- return Array.isArray(targetValue) && TUtil.isDefined(targetValue[modelEntry.activeIndex]) && TUtil.isDefined(targetValue[modelEntry.accessIndex]);
290
+ var results = tmodel.val(TUtil.getLoadTargetName(targetName));
291
+ return Array.isArray(results) && TUtil.isDefined(results[entry.activeIndex]);
294
292
  }
295
293
  }, {
296
294
  key: "getLoadingItemValue",