targetj 1.0.227 → 1.0.228
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/BaseModel.js +13 -4
- package/build/LoadingManager.js +4 -1
- package/build/TUtil.js +4 -0
- package/build/TargetParser.js +1 -1
- package/build/TargetUtil.js +83 -0
- package/dist/targetjs.js +1 -1
- package/dist/targetjs.js.gz +0 -0
- package/package.json +1 -1
package/build/BaseModel.js
CHANGED
|
@@ -1137,11 +1137,20 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
1137
1137
|
}
|
|
1138
1138
|
}, {
|
|
1139
1139
|
key: "activateTarget",
|
|
1140
|
-
value: function activateTarget(key, value) {
|
|
1140
|
+
value: function activateTarget(key, value, options) {
|
|
1141
|
+
var actualValue = value;
|
|
1142
|
+
var actualOptions = options;
|
|
1143
|
+
if (value !== null && value !== void 0 && value.reset && Object.keys(value).length === 1 && !options) {
|
|
1144
|
+
actualValue = undefined;
|
|
1145
|
+
actualOptions = value;
|
|
1146
|
+
}
|
|
1141
1147
|
if (this.canTargetBeActivated(key)) {
|
|
1142
|
-
var _target$childAction, _target$addChildActio;
|
|
1143
|
-
if (
|
|
1144
|
-
|
|
1148
|
+
var _actualOptions, _target$childAction, _target$addChildActio;
|
|
1149
|
+
if ((_actualOptions = actualOptions) !== null && _actualOptions !== void 0 && _actualOptions.reset) {
|
|
1150
|
+
_TargetUtil.TargetUtil.resetTargetPipelineState(this, key);
|
|
1151
|
+
}
|
|
1152
|
+
if (_TUtil.TUtil.isDefined(actualValue)) {
|
|
1153
|
+
this.val("___".concat(key), actualValue);
|
|
1145
1154
|
}
|
|
1146
1155
|
if (this.isVisible()) {
|
|
1147
1156
|
this.markLayoutDirty(key);
|
package/build/LoadingManager.js
CHANGED
|
@@ -36,6 +36,7 @@ var LoadingManager = exports.LoadingManager = /*#__PURE__*/function () {
|
|
|
36
36
|
this.tmodelKeyMap = {};
|
|
37
37
|
this.fetchingAPIMap = {};
|
|
38
38
|
this.fetchingImageMap = {};
|
|
39
|
+
this.fetchSeq = 0;
|
|
39
40
|
}
|
|
40
41
|
return _createClass(LoadingManager, [{
|
|
41
42
|
key: "clear",
|
|
@@ -43,6 +44,7 @@ var LoadingManager = exports.LoadingManager = /*#__PURE__*/function () {
|
|
|
43
44
|
this.tmodelKeyMap = {};
|
|
44
45
|
this.fetchingAPIMap = {};
|
|
45
46
|
this.fetchingImageMap = {};
|
|
47
|
+
this.fetchSeq = 0;
|
|
46
48
|
}
|
|
47
49
|
}, {
|
|
48
50
|
key: "fetchCommon",
|
|
@@ -117,7 +119,8 @@ var LoadingManager = exports.LoadingManager = /*#__PURE__*/function () {
|
|
|
117
119
|
}, {
|
|
118
120
|
key: "getFetchKey",
|
|
119
121
|
value: function getFetchKey(tmodel, url, query) {
|
|
120
|
-
|
|
122
|
+
var base = query ? "".concat(tmodel.oid, "_").concat(url, "_").concat(tmodel.getTargetCycle(tmodel.key), "_").concat(JSON.stringify(query)) : "".concat(tmodel.oid, "_").concat(url, "_").concat(tmodel.getTargetCycle(tmodel.key));
|
|
123
|
+
return "".concat(base, "_").concat(++this.fetchSeq);
|
|
121
124
|
}
|
|
122
125
|
}, {
|
|
123
126
|
key: "getTModelKey",
|
package/build/TUtil.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.TUtil = void 0;
|
|
|
7
7
|
var _App = require("./App.js");
|
|
8
8
|
var _TargetUtil = require("./TargetUtil.js");
|
|
9
9
|
var _TargetData = require("./TargetData.js");
|
|
10
|
+
var _TargetParser = require("./TargetParser");
|
|
10
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; } } }; }
|
|
11
12
|
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); }
|
|
12
13
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
@@ -304,6 +305,9 @@ var TUtil = exports.TUtil = /*#__PURE__*/function () {
|
|
|
304
305
|
}, {
|
|
305
306
|
key: "runTargetValue",
|
|
306
307
|
value: function runTargetValue(tmodel, target, key, cycle, lastValue) {
|
|
308
|
+
if (_TargetParser.TargetParser.isIntervalTarget(target) && cycle === 1) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
307
311
|
var cleanKey = _TargetUtil.TargetUtil.getTargetName(key);
|
|
308
312
|
var isExternalEvent = _TargetData.TargetData.allEventMap[cleanKey];
|
|
309
313
|
if (isExternalEvent) {
|
package/build/TargetParser.js
CHANGED
|
@@ -161,7 +161,7 @@ var TargetParser = exports.TargetParser = /*#__PURE__*/function () {
|
|
|
161
161
|
if (target.isInterval && _TUtil.TUtil.isDefined(target.interval)) {
|
|
162
162
|
return true;
|
|
163
163
|
}
|
|
164
|
-
return _TUtil.TUtil.isDefined(target.interval) && !_TUtil.TUtil.isDefined(target.steps) && !_TUtil.TUtil.isDefined(target.cycles)
|
|
164
|
+
return _TUtil.TUtil.isDefined(target.interval) && !_TUtil.TUtil.isDefined(target.steps) && !_TUtil.TUtil.isDefined(target.cycles);
|
|
165
165
|
}
|
|
166
166
|
}, {
|
|
167
167
|
key: "isPrimitiveArray",
|
package/build/TargetUtil.js
CHANGED
|
@@ -642,5 +642,88 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
|
|
|
642
642
|
originalTargetName: originalTargetName
|
|
643
643
|
};
|
|
644
644
|
}
|
|
645
|
+
}, {
|
|
646
|
+
key: "resetTargetPipelineState",
|
|
647
|
+
value: function resetTargetPipelineState(tmodel, targetName) {
|
|
648
|
+
var _target$childAction4, _target$addChildActio;
|
|
649
|
+
var visited = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();
|
|
650
|
+
if (!tmodel || !targetName) {
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
var target = tmodel.targets[targetName];
|
|
654
|
+
TargetUtil.resetSingleTargetState(tmodel, targetName);
|
|
655
|
+
if ((_target$childAction4 = target.childAction) !== null && _target$childAction4 !== void 0 && _target$childAction4.length) {
|
|
656
|
+
target.childAction.forEach(function (child) {
|
|
657
|
+
if (child) {
|
|
658
|
+
TargetUtil.resetTargetChildState(child, visited);
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
target.childAction = [];
|
|
662
|
+
}
|
|
663
|
+
if ((_target$addChildActio = target.addChildAction) !== null && _target$addChildActio !== void 0 && _target$addChildActio.length) {
|
|
664
|
+
target.addChildAction.forEach(function (child) {
|
|
665
|
+
if (child) {
|
|
666
|
+
TargetUtil.resetTargetChildState(child, visited);
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
target.addChildAction = [];
|
|
670
|
+
}
|
|
671
|
+
var nextTarget = target === null || target === void 0 ? void 0 : target.activateNextTarget;
|
|
672
|
+
if (!nextTarget) {
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
var nextTargetDef = tmodel.targets[nextTarget];
|
|
676
|
+
if (!nextTargetDef || !nextTarget.endsWith('$') && nextTargetDef.active === false) {
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
TargetUtil.resetTargetPipelineState(tmodel, nextTarget, visited);
|
|
680
|
+
}
|
|
681
|
+
}, {
|
|
682
|
+
key: "resetTargetChildState",
|
|
683
|
+
value: function resetTargetChildState(tmodel, visited) {
|
|
684
|
+
var sig = "".concat(tmodel.oid);
|
|
685
|
+
if (visited.has(sig)) {
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
visited.add(sig);
|
|
689
|
+
var names = Object.keys(tmodel.targetValues);
|
|
690
|
+
for (var i = 0; i < names.length; i++) {
|
|
691
|
+
var _target$childAction5, _target$addChildActio2;
|
|
692
|
+
var key = names[i];
|
|
693
|
+
var target = tmodel.targets[key];
|
|
694
|
+
TargetUtil.resetSingleTargetState(tmodel, key);
|
|
695
|
+
if (target !== null && target !== void 0 && (_target$childAction5 = target.childAction) !== null && _target$childAction5 !== void 0 && _target$childAction5.length) {
|
|
696
|
+
target.childAction.forEach(function (child) {
|
|
697
|
+
if (child) {
|
|
698
|
+
TargetUtil.resetTargetChildState(child, visited);
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
target.childAction = [];
|
|
702
|
+
}
|
|
703
|
+
if (target !== null && target !== void 0 && (_target$addChildActio2 = target.addChildAction) !== null && _target$addChildActio2 !== void 0 && _target$addChildActio2.length) {
|
|
704
|
+
target.addChildAction.forEach(function (child) {
|
|
705
|
+
if (child) {
|
|
706
|
+
TargetUtil.resetTargetChildState(child, visited);
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
target.addChildAction = [];
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}, {
|
|
714
|
+
key: "resetSingleTargetState",
|
|
715
|
+
value: function resetSingleTargetState(tmodel, key) {
|
|
716
|
+
var targetValue = tmodel.targetValues[key];
|
|
717
|
+
if (targetValue) {
|
|
718
|
+
targetValue.completeCount = 0;
|
|
719
|
+
targetValue.nextTargetUpdateCount = 0;
|
|
720
|
+
}
|
|
721
|
+
tmodel.cancelAnimation();
|
|
722
|
+
tmodel.activatedTargets.length = 0;
|
|
723
|
+
tmodel.removeFromActiveTargets(key);
|
|
724
|
+
tmodel.removeFromAnimatingMap(key);
|
|
725
|
+
tmodel.removeFromUpdatingTargets(key);
|
|
726
|
+
TargetUtil.clearPendingTargets(tmodel, key);
|
|
727
|
+
}
|
|
645
728
|
}]);
|
|
646
729
|
}();
|