targetj 1.0.233 → 1.0.235

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.
@@ -708,7 +708,11 @@ _defineProperty(TargetData, "attributesToTargets", {
708
708
  onscroll: 'onScroll',
709
709
  onscrollleft: 'onScrollLeft',
710
710
  onscrolltop: 'onScrollTop',
711
+ onscrollleftend: 'onScrollLeftEnd',
712
+ onscrolltopend: 'onScrollTopEnd',
711
713
  onwindowscroll: 'onWindowScroll',
714
+ onwindowscrolltopend: 'onWindowScrollTopEnd',
715
+ onwindowscrollleftend: 'onWindowScrollLeftEnd',
712
716
  onpopstate: 'onPopState',
713
717
  onchange: 'onChange',
714
718
  oninput: 'onInput',
@@ -796,7 +800,11 @@ _defineProperty(TargetData, "targetToEventsMapping", {
796
800
  onScroll: ['touchStart', 'mouseStart', 'wheelEvents'],
797
801
  onScrollLeft: ['touchStart', 'mouseStart', 'wheelEvents'],
798
802
  onScrollTop: ['touchStart', 'mouseStart', 'wheelEvents'],
803
+ onScrollLeftEnd: ['touchStart', 'mouseStart', 'wheelEvents'],
804
+ onScrollTopEnd: ['touchStart', 'mouseStart', 'wheelEvents'],
799
805
  onWindowScroll: ['containerScroll'],
806
+ onWindowScrollTopEnd: ['containerScroll'],
807
+ onWindowScrollLeftEnd: ['containerScroll'],
800
808
  onPopState: ['popState'],
801
809
  onChange: ['changeEvents'],
802
810
  onInput: ['inputEvents'],
@@ -879,8 +887,20 @@ _defineProperty(TargetData, "allEventMap", {
879
887
  onScrollLeft: function onScrollLeft(tmodel) {
880
888
  return (0, _App.getEvents)().getOrientation() !== 'vertical' && (0, _App.getEvents)().isScrollLeftHandler(tmodel) && (0, _App.getEvents)().deltaX();
881
889
  },
882
- onWindowScroll: function onWindowScroll() {
883
- return (0, _App.getEvents)().getEventType() === 'scroll';
890
+ onScrollTopEnd: function onScrollTopEnd(tmodel) {
891
+ return (0, _App.getEvents)().getEventType() === 'scrolltopend' && (0, _App.getEvents)().isScrollTopEndHandler(tmodel);
892
+ },
893
+ onScrollLeftEnd: function onScrollLeftEnd(tmodel) {
894
+ return (0, _App.getEvents)().getEventType() === 'scrollleftend' && (0, _App.getEvents)().isScrollLeftEndHandler(tmodel);
895
+ },
896
+ onWindowScroll: function onWindowScroll(tmodel) {
897
+ return (0, _App.getEvents)().getEventType() === 'scroll' && (0, _App.getEvents)().getEventTModel() === tmodel;
898
+ },
899
+ onWindowScrollTopEnd: function onWindowScrollTopEnd(tmodel) {
900
+ return (0, _App.getEvents)().getEventType() === 'windowscrolltopend' && (0, _App.getEvents)().getEventTModel() === tmodel;
901
+ },
902
+ onWindowScrollLeftEnd: function onWindowScrollLeftEnd(tmodel) {
903
+ return (0, _App.getEvents)().getEventType() === 'windowscrollleftend' && (0, _App.getEvents)().getEventTModel() === tmodel;
884
904
  },
885
905
  onPopState: function onPopState() {
886
906
  return (0, _App.getEvents)().getEventType() === 'popstate';
@@ -163,7 +163,7 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
163
163
  var newStatus = TargetExecutor.calculateTargetStatus(tmodel, targetValue, key);
164
164
  tmodel.setTargetStatus(key, newStatus);
165
165
  if (!_TargetData.TargetData.ignoreRerun[key] && tmodel.shouldScheduleRun(key)) {
166
- (0, _App.getRunScheduler)().schedule(1, 'updateTarget2-' + tmodel.oid + "-" + key);
166
+ (0, _App.getRunScheduler)().schedule(1, 'updateTarget2-' + tmodel.oid);
167
167
  }
168
168
  }
169
169
  }, {
@@ -65,7 +65,7 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
65
65
  }
66
66
  var schedulePeriod = _TUtil.TUtil.scheduleExecution(tmodel, key);
67
67
  if (schedulePeriod > 0) {
68
- (0, _App.getRunScheduler)().timeSchedule(schedulePeriod, "targetSchedule__".concat(tmodel.oid, "__").concat(key, "_").concat(schedulePeriod));
68
+ (0, _App.getRunScheduler)().schedule(schedulePeriod, "targetSchedule__".concat(tmodel.oid));
69
69
  return;
70
70
  }
71
71
  }
@@ -97,7 +97,7 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
97
97
  var key = _step2.value;
98
98
  schedulePeriod = _TUtil.TUtil.scheduleExecution(tmodel, key);
99
99
  if (schedulePeriod > 0) {
100
- (0, _App.getRunScheduler)().schedule(schedulePeriod, "setActualValues-".concat(tmodel.oid, "__").concat(key, "_").concat(schedulePeriod));
100
+ (0, _App.getRunScheduler)().schedule(schedulePeriod, "setActualValues-".concat(tmodel.oid));
101
101
  } else {
102
102
  tmodel.resetScheduleTimeStamp(key);
103
103
  this.setActualValue(tmodel, key);
@@ -333,7 +333,7 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
333
333
  return;
334
334
  }
335
335
  if (!tmodel.isTargetImperative(key) && !tmodel.isTargetEnabled(key)) {
336
- (0, _App.getRunScheduler)().schedule(15, "setActualValue-postpone-".concat(tmodel.oid, "__").concat(key));
336
+ (0, _App.getRunScheduler)().schedule(15, "setActualValue-postpone-".concat(tmodel.oid, "}"));
337
337
  return;
338
338
  }
339
339
  var theValue = tmodel.getTargetValue(key);
@@ -7,13 +7,13 @@ exports.TargetUtil = void 0;
7
7
  var _App = require("./App.js");
8
8
  var _TUtil = require("./TUtil.js");
9
9
  var _TargetData = require("./TargetData.js");
10
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
10
12
  function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
11
13
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
15
  function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
13
16
  function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
14
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
15
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
16
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
17
17
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
18
18
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
19
19
  function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
@@ -203,7 +203,7 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
203
203
  if (prevOk === true) {
204
204
  TargetUtil.activateTargetOnce(tmodel, nextTarget);
205
205
  nextTargetActivated = true;
206
- TargetUtil.clearPendingTargets(tmodel, key);
206
+ TargetUtil.clearPendingTargetsForNextTarget(tmodel, nextTarget);
207
207
  tmodel.targetValues[nextTarget].triggeredByCompleteCount = targetValue.completeCount;
208
208
  } else {
209
209
  TargetUtil.markPendingTargets(tmodel, key);
@@ -224,7 +224,7 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
224
224
  tmodel.removeFromActiveTargets(nextTarget);
225
225
  TargetUtil.activateTarget(tmodel, nextTarget);
226
226
  nextTargetActivated = true;
227
- TargetUtil.clearPendingTargets(tmodel, key);
227
+ TargetUtil.clearPendingTargetsForNextTarget(tmodel, nextTarget);
228
228
  tmodel.targetValues[nextTarget].triggeredByCompleteCount = targetValue.completeCount;
229
229
  } else {
230
230
  TargetUtil.markPendingTargets(tmodel, key);
@@ -269,8 +269,8 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
269
269
  (tmodel.pendingTargets || (tmodel.pendingTargets = new Set())).add(key);
270
270
  }
271
271
  }, {
272
- key: "clearPendingTargets",
273
- value: function clearPendingTargets(tmodel, key) {
272
+ key: "clearPendingTarget",
273
+ value: function clearPendingTarget(tmodel, key) {
274
274
  var pending = tmodel.pendingTargets;
275
275
  if (!pending) {
276
276
  return;
@@ -280,11 +280,29 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
280
280
  tmodel.pendingTargets = undefined;
281
281
  }
282
282
  }
283
+ }, {
284
+ key: "clearPendingTargetsForNextTarget",
285
+ value: function clearPendingTargetsForNextTarget(tmodel, nextTarget) {
286
+ var pending = tmodel.pendingTargets;
287
+ if (!pending) {
288
+ return;
289
+ }
290
+ for (var _i = 0, _arr = _toConsumableArray(pending); _i < _arr.length; _i++) {
291
+ var _tmodel$targets$key;
292
+ var key = _arr[_i];
293
+ if (((_tmodel$targets$key = tmodel.targets[key]) === null || _tmodel$targets$key === void 0 ? void 0 : _tmodel$targets$key.activateNextTarget) === nextTarget) {
294
+ pending.delete(key);
295
+ }
296
+ }
297
+ if (pending.size === 0) {
298
+ tmodel.pendingTargets = undefined;
299
+ }
300
+ }
283
301
  }, {
284
302
  key: "cleanupTarget",
285
303
  value: function cleanupTarget(tmodel, key) {
286
304
  if (tmodel.isTargetComplete(key) || !TargetUtil.isTargetFullyCompleted(tmodel, key)) {
287
- return;
305
+ return false;
288
306
  }
289
307
  tmodel.setTargetComplete(key);
290
308
  var target = tmodel.targets[key];
@@ -301,6 +319,7 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
301
319
  target.fetchAction = false;
302
320
  }
303
321
  TargetUtil.bubbleInvokerCompletion(tmodel, key);
322
+ return true;
304
323
  }
305
324
  }, {
306
325
  key: "bubbleInvokerCompletion",
@@ -333,9 +352,9 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
333
352
  };
334
353
  tryCleanupAndBubble(targetValue.originalTModel, targetValue.originalTargetName);
335
354
  if (!tmodel.isTargetImperative(key)) {
336
- var _tmodel$targets$key, _tmodel$targets$key2;
355
+ var _tmodel$targets$key2, _tmodel$targets$key3;
337
356
  tryCleanupAndBubble(targetValue.invokerTModel, targetValue.invokerTargetName);
338
- tryCleanupAndBubble((_tmodel$targets$key = tmodel.targets[key]) === null || _tmodel$targets$key === void 0 ? void 0 : _tmodel$targets$key.originalTModel, (_tmodel$targets$key2 = tmodel.targets[key]) === null || _tmodel$targets$key2 === void 0 ? void 0 : _tmodel$targets$key2.originalTargetName);
357
+ tryCleanupAndBubble((_tmodel$targets$key2 = tmodel.targets[key]) === null || _tmodel$targets$key2 === void 0 ? void 0 : _tmodel$targets$key2.originalTModel, (_tmodel$targets$key3 = tmodel.targets[key]) === null || _tmodel$targets$key3 === void 0 ? void 0 : _tmodel$targets$key3.originalTargetName);
339
358
  }
340
359
  }
341
360
  }, {
@@ -392,7 +411,7 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
392
411
  }, {
393
412
  key: "isTargetFullyCompleted",
394
413
  value: function isTargetFullyCompleted(tmodel, key) {
395
- var result = !tmodel.isTargetUpdating(key) && tmodel.isTargetCompleteDeep(key) === true;
414
+ var result = !tmodel.isTargetUpdating(key) && tmodel.isTargetTreeComplete(key) === true;
396
415
  if (result && !tmodel.isTargetImperative(key)) {
397
416
  result = !tmodel.hasUpdatingImperativeTargets(key);
398
417
  }
@@ -418,17 +437,17 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
418
437
  if (tmodel.hasUpdatingImperativeTargets(targetName)) {
419
438
  return tmodel.oid + "." + targetName + ": " + tmodel.getUpdatingImperativeTargets(targetName);
420
439
  }
421
- if (tmodel.isTargetCompleteDeep(targetName) !== true) {
422
- //const activeChildrenList = [ ...(tmodel.activeChildrenMap?.values() ?? []) ];
423
- //return tmodel.oid + "." + targetName + " ==> " + tmodel.getTargetStatus(targetName) + ", " + tmodel.isTargetCompleteDeep(targetName) + ":: " + activeChildrenList.map(t => t.oid + ':' + t.hasAnyUpdates()) + ", " + [ ...TargetUtil.getUpdatingChildren(tmodel, targetName).keys() ];
440
+ if (tmodel.isTargetTreeComplete(targetName) !== true) {
441
+ //const activeChildrenList = [ ...TargetUtil.getActiveChildren(tmodel, tmodel.targets[targetName].completionScope).values() ];
442
+ //return tmodel.oid + "." + targetName + " ==> " + tmodel.getTargetStatus(targetName) + ", " + tmodel.isTargetTreeComplete(targetName) + ":: " + activeChildrenList.map(t => t.oid + ':' + t.hasAnyUpdates()) + ", " + [ ...TargetUtil.getUpdatingChildren(tmodel, targetName).keys() ];
424
443
  return false;
425
444
  }
426
445
  }
427
446
  return true;
428
447
  }
429
448
  }, {
430
- key: "isTargetCompleteDeep",
431
- value: function isTargetCompleteDeep(tmodel, key) {
449
+ key: "isTargetTreeComplete",
450
+ value: function isTargetTreeComplete(tmodel, key) {
432
451
  var target = tmodel.targets[key];
433
452
  if (target) {
434
453
  var _target$childAction, _target$childAction2, _target$childAction3;
@@ -448,13 +467,13 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
448
467
  if (!tmodel.isTargetComplete(key) && !tmodel.isTargetDone(key)) {
449
468
  return 'not done';
450
469
  }
451
- if (((_target$childAction = target.childAction) === null || _target$childAction === void 0 ? void 0 : _target$childAction.length) > 0 && TargetUtil.getUpdatingChildren(tmodel, key, target.waitForChildren).size > 0) {
470
+ if (((_target$childAction = target.childAction) === null || _target$childAction === void 0 ? void 0 : _target$childAction.length) > 0 && TargetUtil.getUpdatingChildren(tmodel, key, target.completionScope).size > 0) {
452
471
  return 'updating children';
453
472
  }
454
- if (((_target$childAction2 = target.childAction) === null || _target$childAction2 === void 0 ? void 0 : _target$childAction2.length) > 0 && TargetUtil.getActiveChildren(tmodel, target.waitForChildren).size > 0) {
473
+ if (((_target$childAction2 = target.childAction) === null || _target$childAction2 === void 0 ? void 0 : _target$childAction2.length) > 0 && TargetUtil.getActiveChildren(tmodel, target.completionScope).size > 0) {
455
474
  return 'active children';
456
475
  }
457
- if (((_target$childAction3 = target.childAction) === null || _target$childAction3 === void 0 ? void 0 : _target$childAction3.length) > 0 && TargetUtil.areTargetChildrenComplete(target.childAction, target.waitForChildren) !== true) {
476
+ if (((_target$childAction3 = target.childAction) === null || _target$childAction3 === void 0 ? void 0 : _target$childAction3.length) > 0 && TargetUtil.areTargetChildrenComplete(target.childAction, target.completionScope) !== true) {
458
477
  return 'incomplete children';
459
478
  }
460
479
  if (target.fetchAction && !(0, _App.getLoader)().isLoadingSuccessful(tmodel, key)) {
@@ -466,7 +485,7 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
466
485
  }, {
467
486
  key: "areTargetChildrenComplete",
468
487
  value: function areTargetChildrenComplete(children) {
469
- var waitForChildren = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all';
488
+ var completionScope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all';
470
489
  if (!children) {
471
490
  return true;
472
491
  }
@@ -475,15 +494,15 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
475
494
  try {
476
495
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
477
496
  var child = _step2.value;
478
- if (TargetUtil.shouldIgnoreChildForCompletion(child, waitForChildren)) {
497
+ if (TargetUtil.shouldIgnoreChildForCompletion(child, completionScope)) {
479
498
  continue;
480
499
  }
481
- if (_App.App.tmodelIdMap[child.oid] && !TargetUtil.isTModelComplete(child)) {
482
- return false;
500
+ if (child.exists() && !TargetUtil.isTModelComplete(child)) {
501
+ return child.oid;
483
502
  }
484
503
  if (child.hasChildren()) {
485
- if (!TargetUtil.areTargetChildrenComplete(child.getChildren(), waitForChildren)) {
486
- return false;
504
+ if (!TargetUtil.areTargetChildrenComplete(child.getChildren(), completionScope)) {
505
+ return child.oid;
487
506
  }
488
507
  }
489
508
  }
@@ -498,12 +517,12 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
498
517
  key: "getUpdatingChildren",
499
518
  value: function getUpdatingChildren(tmodel, originalTargetName) {
500
519
  var _tmodel$updatingChild, _tmodel$updatingChild2, _tmodel$animatingChil, _tmodel$animatingChil2;
501
- var waitForChildren = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "all";
520
+ var completionScope = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "all";
502
521
  var childrenMap = new Map();
503
522
  var children = [].concat(_toConsumableArray((_tmodel$updatingChild = (_tmodel$updatingChild2 = tmodel.updatingChildrenMap) === null || _tmodel$updatingChild2 === void 0 ? void 0 : _tmodel$updatingChild2.values()) !== null && _tmodel$updatingChild !== void 0 ? _tmodel$updatingChild : []), _toConsumableArray((_tmodel$animatingChil = (_tmodel$animatingChil2 = tmodel.animatingChildrenMap) === null || _tmodel$animatingChil2 === void 0 ? void 0 : _tmodel$animatingChil2.values()) !== null && _tmodel$animatingChil !== void 0 ? _tmodel$animatingChil : []));
504
523
  children.forEach(function (child) {
505
524
  var _child$updatingTarget;
506
- if (TargetUtil.shouldIgnoreChildForCompletion(child, waitForChildren)) {
525
+ if (TargetUtil.shouldIgnoreChildForCompletion(child, completionScope)) {
507
526
  return;
508
527
  }
509
528
  var updatingList = [].concat(_toConsumableArray((_child$updatingTarget = child.updatingTargetList) !== null && _child$updatingTarget !== void 0 ? _child$updatingTarget : []), _toConsumableArray(child.animatingMap ? _toConsumableArray(child.animatingMap.keys()) : []));
@@ -544,11 +563,11 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
544
563
  key: "getActiveChildren",
545
564
  value: function getActiveChildren(tmodel) {
546
565
  var _tmodel$activeChildre, _tmodel$activeChildre2;
547
- var waitForChildren = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all';
566
+ var completionScope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all';
548
567
  var childrenMap = new Map();
549
568
  var children = _toConsumableArray((_tmodel$activeChildre = (_tmodel$activeChildre2 = tmodel.activeChildrenMap) === null || _tmodel$activeChildre2 === void 0 ? void 0 : _tmodel$activeChildre2.values()) !== null && _tmodel$activeChildre !== void 0 ? _tmodel$activeChildre : []);
550
569
  children.forEach(function (child) {
551
- if (TargetUtil.shouldIgnoreChildForCompletion(child, waitForChildren)) {
570
+ if (TargetUtil.shouldIgnoreChildForCompletion(child, completionScope)) {
552
571
  return;
553
572
  }
554
573
  if (child.activeTargetList.length) {
@@ -559,11 +578,11 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
559
578
  }
560
579
  }, {
561
580
  key: "shouldIgnoreChildForCompletion",
562
- value: function shouldIgnoreChildForCompletion(child, waitForChildren) {
563
- if (waitForChildren === "none") {
581
+ value: function shouldIgnoreChildForCompletion(child, completionScope) {
582
+ if (completionScope === "none") {
564
583
  return true;
565
584
  }
566
- if (waitForChildren === "visible") {
585
+ if (completionScope === "visible") {
567
586
  return child.visibilityStatus && !child.isVisible();
568
587
  }
569
588
  return false;
@@ -642,7 +661,9 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
642
661
  tmodel.clearActiveChildren();
643
662
  tmodel.clearAnimatingChildren();
644
663
  (0, _App.getLocationManager)().domIslandSet.delete(tmodel);
645
- delete _App.App.tmodelIdMap[tmodel.oid];
664
+ if (_App.App.tmodelIdMap[tmodel.oid] === tmodel) {
665
+ delete _App.App.tmodelIdMap[tmodel.oid];
666
+ }
646
667
  }
647
668
  }, {
648
669
  key: "getOriginalNames",
@@ -653,15 +674,32 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
653
674
  originalTModel = (_tmodel$targetValues$6 = tmodel.targetValues[key]) === null || _tmodel$targetValues$6 === void 0 ? void 0 : _tmodel$targetValues$6.originalTModel;
654
675
  originalTargetName = (_tmodel$targetValues$7 = tmodel.targetValues[key]) === null || _tmodel$targetValues$7 === void 0 ? void 0 : _tmodel$targetValues$7.originalTargetName;
655
676
  } else {
656
- var _tmodel$targets$key3, _tmodel$targets$key4;
657
- originalTModel = (_tmodel$targets$key3 = tmodel.targets[key]) === null || _tmodel$targets$key3 === void 0 ? void 0 : _tmodel$targets$key3.originalTModel;
658
- originalTargetName = (_tmodel$targets$key4 = tmodel.targets[key]) === null || _tmodel$targets$key4 === void 0 ? void 0 : _tmodel$targets$key4.originalTargetName;
677
+ var _tmodel$targets$key4, _tmodel$targets$key5;
678
+ originalTModel = (_tmodel$targets$key4 = tmodel.targets[key]) === null || _tmodel$targets$key4 === void 0 ? void 0 : _tmodel$targets$key4.originalTModel;
679
+ originalTargetName = (_tmodel$targets$key5 = tmodel.targets[key]) === null || _tmodel$targets$key5 === void 0 ? void 0 : _tmodel$targets$key5.originalTargetName;
659
680
  }
660
681
  return {
661
682
  originalTModel: originalTModel,
662
683
  originalTargetName: originalTargetName
663
684
  };
664
685
  }
686
+ }, {
687
+ key: "resetTargetState",
688
+ value: function resetTargetState(tmodel, targetName) {
689
+ var visited = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();
690
+ if (!tmodel || !targetName) {
691
+ return;
692
+ }
693
+ TargetUtil.resetSingleTargetState(tmodel, targetName);
694
+ var target = tmodel.targets[targetName];
695
+ var nextTarget = target === null || target === void 0 ? void 0 : target.activateNextTarget;
696
+ var nextTargetDef = tmodel.targets[nextTarget];
697
+ if (!nextTargetDef || !nextTarget.endsWith('$') && nextTargetDef.active === false) {
698
+ return;
699
+ }
700
+ TargetUtil.resetTargetsBetween(tmodel, targetName, nextTarget, visited);
701
+ TargetUtil.resetTargetPipelineState(tmodel, nextTarget, visited);
702
+ }
665
703
  }, {
666
704
  key: "resetTargetPipelineState",
667
705
  value: function resetTargetPipelineState(tmodel, targetName) {
@@ -678,7 +716,6 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
678
716
  TargetUtil.resetTargetChildState(child, visited);
679
717
  }
680
718
  });
681
- target.childAction = [];
682
719
  }
683
720
  if ((_target$addChildActio = target.addChildAction) !== null && _target$addChildActio !== void 0 && _target$addChildActio.length) {
684
721
  target.addChildAction.forEach(function (child) {
@@ -686,7 +723,6 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
686
723
  TargetUtil.resetTargetChildState(child, visited);
687
724
  }
688
725
  });
689
- target.addChildAction = [];
690
726
  }
691
727
  var nextTarget = target === null || target === void 0 ? void 0 : target.activateNextTarget;
692
728
  if (!nextTarget) {
@@ -696,8 +732,39 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
696
732
  if (!nextTargetDef || !nextTarget.endsWith('$') && nextTargetDef.active === false) {
697
733
  return;
698
734
  }
735
+ TargetUtil.resetTargetsBetween(tmodel, targetName, nextTarget, visited);
699
736
  TargetUtil.resetTargetPipelineState(tmodel, nextTarget, visited);
700
737
  }
738
+ }, {
739
+ key: "resetTargetsBetween",
740
+ value: function resetTargetsBetween(tmodel, fromTarget, toTarget, visited) {
741
+ var names = tmodel.functionTargetNames;
742
+ var fromIndex = names.indexOf(fromTarget);
743
+ var toIndex = names.indexOf(toTarget);
744
+ if (fromIndex < 0 || toIndex < 0 || toIndex <= fromIndex) {
745
+ return;
746
+ }
747
+ for (var i = fromIndex + 1; i < toIndex; i++) {
748
+ var _target$childAction5, _target$addChildActio2;
749
+ var key = names[i];
750
+ TargetUtil.resetSingleTargetState(tmodel, key);
751
+ var target = tmodel.targets[key];
752
+ if (target !== null && target !== void 0 && (_target$childAction5 = target.childAction) !== null && _target$childAction5 !== void 0 && _target$childAction5.length) {
753
+ target.childAction.forEach(function (child) {
754
+ if (child) {
755
+ TargetUtil.resetTargetChildState(child, visited);
756
+ }
757
+ });
758
+ }
759
+ if (target !== null && target !== void 0 && (_target$addChildActio2 = target.addChildAction) !== null && _target$addChildActio2 !== void 0 && _target$addChildActio2.length) {
760
+ target.addChildAction.forEach(function (child) {
761
+ if (child) {
762
+ TargetUtil.resetTargetChildState(child, visited);
763
+ }
764
+ });
765
+ }
766
+ }
767
+ }
701
768
  }, {
702
769
  key: "resetTargetChildState",
703
770
  value: function resetTargetChildState(tmodel, visited) {
@@ -708,11 +775,11 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
708
775
  visited.add(sig);
709
776
  var names = Object.keys(tmodel.targetValues);
710
777
  for (var i = 0; i < names.length; i++) {
711
- var _target$childAction5, _target$addChildActio2;
778
+ var _target$childAction6, _target$addChildActio3;
712
779
  var key = names[i];
713
780
  var target = tmodel.targets[key];
714
781
  TargetUtil.resetSingleTargetState(tmodel, key);
715
- if (target !== null && target !== void 0 && (_target$childAction5 = target.childAction) !== null && _target$childAction5 !== void 0 && _target$childAction5.length) {
782
+ if (target !== null && target !== void 0 && (_target$childAction6 = target.childAction) !== null && _target$childAction6 !== void 0 && _target$childAction6.length) {
716
783
  target.childAction.forEach(function (child) {
717
784
  if (child) {
718
785
  TargetUtil.resetTargetChildState(child, visited);
@@ -720,7 +787,7 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
720
787
  });
721
788
  target.childAction = [];
722
789
  }
723
- if (target !== null && target !== void 0 && (_target$addChildActio2 = target.addChildAction) !== null && _target$addChildActio2 !== void 0 && _target$addChildActio2.length) {
790
+ if (target !== null && target !== void 0 && (_target$addChildActio3 = target.addChildAction) !== null && _target$addChildActio3 !== void 0 && _target$addChildActio3.length) {
724
791
  target.addChildAction.forEach(function (child) {
725
792
  if (child) {
726
793
  TargetUtil.resetTargetChildState(child, visited);
@@ -739,14 +806,35 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
739
806
  targetValue.triggeredByCompleteCount = 0;
740
807
  targetValue.resetFlag = true;
741
808
  targetValue.nextTargetUpdateCount = 0;
742
- targetValue.status = 'complete';
809
+ targetValue.status = '';
743
810
  }
744
811
  tmodel.cancelAnimation();
745
812
  tmodel.activatedTargets.length = 0;
746
813
  tmodel.removeFromActiveTargets(key);
747
814
  tmodel.removeFromAnimatingMap(key);
748
815
  tmodel.removeFromUpdatingTargets(key);
749
- TargetUtil.clearPendingTargets(tmodel, key);
816
+ TargetUtil.clearPendingTarget(tmodel, key);
817
+ }
818
+ }, {
819
+ key: "removeChildFromTargetActions",
820
+ value: function removeChildFromTargetActions(parent, child) {
821
+ if (!parent || !child) {
822
+ return;
823
+ }
824
+ for (var _i2 = 0, _Object$values = Object.values(parent.targets); _i2 < _Object$values.length; _i2++) {
825
+ var _target$childAction7, _target$addChildActio4;
826
+ var target = _Object$values[_i2];
827
+ if ((_target$childAction7 = target.childAction) !== null && _target$childAction7 !== void 0 && _target$childAction7.length) {
828
+ target.childAction = target.childAction.filter(function (c) {
829
+ return c !== child;
830
+ });
831
+ }
832
+ if ((_target$addChildActio4 = target.addChildAction) !== null && _target$addChildActio4 !== void 0 && _target$addChildActio4.length) {
833
+ target.addChildAction = target.addChildAction.filter(function (c) {
834
+ return c !== child;
835
+ });
836
+ }
837
+ }
750
838
  }
751
839
  }]);
752
840
  }();