targetj 1.0.244 → 1.0.246
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.
- package/build/LocationManager.js +1 -2
- package/build/TargetData.js +10 -6
- package/build/TargetUtil.js +78 -5
- package/dist/targetjs.js +1 -1
- package/dist/targetjs.js.gz +0 -0
- package/package.json +1 -1
package/build/LocationManager.js
CHANGED
|
@@ -587,8 +587,7 @@ var LocationManager = /*#__PURE__*/function () {
|
|
|
587
587
|
key: "runEventTargets",
|
|
588
588
|
value: function runEventTargets(tmodel, eventTargets) {
|
|
589
589
|
eventTargets.forEach(function (targetName) {
|
|
590
|
-
|
|
591
|
-
if (tmodel.isTargetEnabled(targetName) && !tmodel.isTargetUpdating(target)) {
|
|
590
|
+
if (tmodel.isTargetEnabled(targetName) && !tmodel.isTargetUpdating(targetName)) {
|
|
592
591
|
if (tmodel.targetValues[targetName]) {
|
|
593
592
|
tmodel.targetValues[targetName].status = '';
|
|
594
593
|
}
|
package/build/TargetData.js
CHANGED
|
@@ -815,15 +815,19 @@ _defineProperty(TargetData, "internalEventMap", {
|
|
|
815
815
|
return tmodel.isNowInvisible;
|
|
816
816
|
},
|
|
817
817
|
onResize: function onResize(tmodel) {
|
|
818
|
-
var
|
|
819
|
-
if (!lastUpdate) {
|
|
820
|
-
return false;
|
|
821
|
-
}
|
|
818
|
+
var _tmodel$lastResizeHan;
|
|
822
819
|
var parent = tmodel.getParent();
|
|
823
820
|
var resizeLast = getResizeLastUpdate();
|
|
824
821
|
var parentLast = parent ? parent.getDimLastUpdate() : 0;
|
|
825
|
-
var resizeLastUpdate =
|
|
826
|
-
|
|
822
|
+
var resizeLastUpdate = Math.max(resizeLast, parentLast);
|
|
823
|
+
if (!resizeLastUpdate) {
|
|
824
|
+
return false;
|
|
825
|
+
}
|
|
826
|
+
if (((_tmodel$lastResizeHan = tmodel.lastResizeHandledTime) !== null && _tmodel$lastResizeHan !== void 0 ? _tmodel$lastResizeHan : 0) >= resizeLastUpdate) {
|
|
827
|
+
return false;
|
|
828
|
+
}
|
|
829
|
+
tmodel.lastResizeHandledTime = resizeLastUpdate;
|
|
830
|
+
return true;
|
|
827
831
|
}
|
|
828
832
|
});
|
|
829
833
|
_defineProperty(TargetData, "allEventMap", {
|
package/build/TargetUtil.js
CHANGED
|
@@ -266,9 +266,7 @@ var TargetUtil = /*#__PURE__*/function () {
|
|
|
266
266
|
}, {
|
|
267
267
|
key: "markPendingTargets",
|
|
268
268
|
value: function markPendingTargets(tmodel, key) {
|
|
269
|
-
|
|
270
|
-
(tmodel.pendingTargets || (tmodel.pendingTargets = new Set())).add(key);
|
|
271
|
-
}
|
|
269
|
+
(tmodel.pendingTargets || (tmodel.pendingTargets = new Set())).add(key);
|
|
272
270
|
}
|
|
273
271
|
}, {
|
|
274
272
|
key: "clearPendingTarget",
|
|
@@ -306,11 +304,9 @@ var TargetUtil = /*#__PURE__*/function () {
|
|
|
306
304
|
TargetUtil.cleanupVisibleComplete(tmodel, key);
|
|
307
305
|
var cannotBeCleaned = tmodel.isTargetComplete(key) || !TargetUtil.isTargetFullyCompleted(tmodel, key);
|
|
308
306
|
if (cannotBeCleaned) {
|
|
309
|
-
TargetUtil.markPendingTargets(tmodel, key);
|
|
310
307
|
return false;
|
|
311
308
|
}
|
|
312
309
|
tmodel.setTargetComplete(key);
|
|
313
|
-
TargetUtil.clearPendingTarget(tmodel, key);
|
|
314
310
|
var target = tmodel.targets[key];
|
|
315
311
|
if (typeof (target === null || target === void 0 ? void 0 : target.onComplete) === "function") {
|
|
316
312
|
target.onComplete.call(tmodel);
|
|
@@ -440,6 +436,83 @@ var TargetUtil = /*#__PURE__*/function () {
|
|
|
440
436
|
}
|
|
441
437
|
return !((_state$updatingTarget2 = state.updatingTargetList) !== null && _state$updatingTarget2 !== void 0 && _state$updatingTarget2.length) && !((_state$activeTargetLi2 = state.activeTargetList) !== null && _state$activeTargetLi2 !== void 0 && _state$activeTargetLi2.length) && !((_state$activatedTarge2 = state.activatedTargets) !== null && _state$activatedTarge2 !== void 0 && _state$activatedTarge2.length) && !tmodel.hasAnimatingTargets() && TargetUtil.isFetchingComplete(tmodel) && !tmodel.hasAnimatingChildren() && !tmodel.hasUpdatingChildren() && !tmodel.hasActiveChildren() && !((_state$lastChildrenUp3 = state.lastChildrenUpdate) !== null && _state$lastChildrenUp3 !== void 0 && (_state$lastChildrenUp3 = _state$lastChildrenUp3.deletions) !== null && _state$lastChildrenUp3 !== void 0 && _state$lastChildrenUp3.length) && !((_state$lastChildrenUp4 = state.lastChildrenUpdate) !== null && _state$lastChildrenUp4 !== void 0 && (_state$lastChildrenUp4 = _state$lastChildrenUp4.additions) !== null && _state$lastChildrenUp4 !== void 0 && _state$lastChildrenUp4.length) && !tmodel.noDomUpdatingTargets && !tmodel.pendingTargets && !getManager().needsReattach(tmodel);
|
|
442
438
|
}
|
|
439
|
+
}, {
|
|
440
|
+
key: "getCompletionBlockers",
|
|
441
|
+
value: function getCompletionBlockers(tmodel) {
|
|
442
|
+
var _state$lastChildrenUp7, _state$lastChildrenUp8;
|
|
443
|
+
var completionScope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "all";
|
|
444
|
+
var state = tmodel.state();
|
|
445
|
+
var blockers = [];
|
|
446
|
+
var add = function add(name, value) {
|
|
447
|
+
if (!value) {
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
blockers.push({
|
|
451
|
+
name: name,
|
|
452
|
+
value: value
|
|
453
|
+
});
|
|
454
|
+
};
|
|
455
|
+
var list = function list(value) {
|
|
456
|
+
if (!value) {
|
|
457
|
+
return [];
|
|
458
|
+
}
|
|
459
|
+
if (value instanceof Set) {
|
|
460
|
+
return _toConsumableArray(value);
|
|
461
|
+
}
|
|
462
|
+
if (value instanceof Map) {
|
|
463
|
+
return _toConsumableArray(value.keys());
|
|
464
|
+
}
|
|
465
|
+
if (Array.isArray(value)) {
|
|
466
|
+
return value;
|
|
467
|
+
}
|
|
468
|
+
return [value];
|
|
469
|
+
};
|
|
470
|
+
if (completionScope === "visible") {
|
|
471
|
+
var _state$lastChildrenUp5, _state$lastChildrenUp6;
|
|
472
|
+
if (TargetUtil.shouldIgnoreChildForCompletion(tmodel, "visible")) {
|
|
473
|
+
return [];
|
|
474
|
+
}
|
|
475
|
+
var updatingChildren = TargetUtil.getUpdatingChildren(tmodel, undefined, "visible");
|
|
476
|
+
var activeChildren = TargetUtil.getActiveChildren(tmodel, "visible");
|
|
477
|
+
add("updatingTargetList", list(state.updatingTargetList));
|
|
478
|
+
add("activeTargetList", list(state.activeTargetList));
|
|
479
|
+
add("activatedTargets", list(state.activatedTargets));
|
|
480
|
+
add("animatingTargets", tmodel.hasAnimatingTargets() ? list(tmodel.animatingMap) : []);
|
|
481
|
+
add("fetching", !TargetUtil.isFetchingComplete(tmodel) ? true : false);
|
|
482
|
+
add("updatingChildren", _toConsumableArray(updatingChildren.keys()));
|
|
483
|
+
add("activeChildren", _toConsumableArray(activeChildren.keys()));
|
|
484
|
+
add("deletedChildren", list((_state$lastChildrenUp5 = state.lastChildrenUpdate) === null || _state$lastChildrenUp5 === void 0 ? void 0 : _state$lastChildrenUp5.deletions));
|
|
485
|
+
add("addedChildren", list((_state$lastChildrenUp6 = state.lastChildrenUpdate) === null || _state$lastChildrenUp6 === void 0 ? void 0 : _state$lastChildrenUp6.additions));
|
|
486
|
+
add("noDomUpdatingTargets", list(tmodel.noDomUpdatingTargets));
|
|
487
|
+
add("pendingTargets", list(tmodel.pendingTargets));
|
|
488
|
+
add("needsReattach", getManager().needsReattach(tmodel) ? true : false);
|
|
489
|
+
return blockers.filter(function (blocker) {
|
|
490
|
+
if (Array.isArray(blocker.value)) {
|
|
491
|
+
return blocker.value.length > 0;
|
|
492
|
+
}
|
|
493
|
+
return !!blocker.value;
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
add("updatingTargetList", list(state.updatingTargetList));
|
|
497
|
+
add("activeTargetList", list(state.activeTargetList));
|
|
498
|
+
add("activatedTargets", list(state.activatedTargets));
|
|
499
|
+
add("animatingTargets", tmodel.hasAnimatingTargets() ? list(tmodel.animatingMap) : []);
|
|
500
|
+
add("fetching", !TargetUtil.isFetchingComplete(tmodel) ? true : false);
|
|
501
|
+
add("animatingChildren", tmodel.hasAnimatingChildren() ? true : false);
|
|
502
|
+
add("updatingChildren", tmodel.hasUpdatingChildren() ? list(tmodel.updatingChildrenMap) : []);
|
|
503
|
+
add("activeChildren", tmodel.hasActiveChildren() ? list(tmodel.activeChildrenMap) : []);
|
|
504
|
+
add("deletedChildren", list((_state$lastChildrenUp7 = state.lastChildrenUpdate) === null || _state$lastChildrenUp7 === void 0 ? void 0 : _state$lastChildrenUp7.deletions));
|
|
505
|
+
add("addedChildren", list((_state$lastChildrenUp8 = state.lastChildrenUpdate) === null || _state$lastChildrenUp8 === void 0 ? void 0 : _state$lastChildrenUp8.additions));
|
|
506
|
+
add("noDomUpdatingTargets", list(tmodel.noDomUpdatingTargets));
|
|
507
|
+
add("pendingTargets", list(tmodel.pendingTargets));
|
|
508
|
+
add("needsReattach", getManager().needsReattach(tmodel) ? true : false);
|
|
509
|
+
return blockers.filter(function (blocker) {
|
|
510
|
+
if (Array.isArray(blocker.value)) {
|
|
511
|
+
return blocker.value.length > 0;
|
|
512
|
+
}
|
|
513
|
+
return !!blocker.value;
|
|
514
|
+
});
|
|
515
|
+
}
|
|
443
516
|
}, {
|
|
444
517
|
key: "isFetchingComplete",
|
|
445
518
|
value: function isFetchingComplete(tmodel) {
|