targetj 1.0.255 → 1.0.257
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/Export.js +46 -65
- package/README.md +17 -2
- package/build/AnimationManager.js +349 -155
- package/build/AnimationUtil.js +59 -6
- package/build/App.js +34 -27
- package/build/BaseModel.js +61 -50
- package/build/EventListener.js +24 -6
- package/build/LoadingManager.js +255 -52
- package/build/PageManager.js +170 -242
- package/build/RunScheduler.js +42 -26
- package/build/SearchUtil.js +10 -0
- package/build/StateManager.js +293 -0
- package/build/StateUtil.js +600 -0
- package/build/TModel.js +10 -2
- package/build/TModelUtil.js +366 -75
- package/build/TUtil.js +7 -0
- package/build/TargetExecutor.js +52 -31
- package/build/TargetUtil.js +75 -30
- package/build/index.js +2 -1
- package/dist/targetjs.js +1 -1
- package/dist/targetjs.js.gz +0 -0
- package/package.json +1 -1
package/build/TargetExecutor.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
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; } }
|
|
4
|
-
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; }
|
|
5
3
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
4
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
5
|
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); }
|
|
8
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
8
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
10
|
+
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."); }
|
|
11
|
+
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
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
13
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
14
|
+
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; }
|
|
11
15
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
12
16
|
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); } }
|
|
13
17
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -83,10 +87,22 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
83
87
|
value: function executeImperativeTarget(tmodel, key, value, steps, interval, easing, originalTargetName, originalTModel) {
|
|
84
88
|
var cycles = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
85
89
|
var options = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : {};
|
|
90
|
+
var snapUpdates = new Map();
|
|
91
|
+
TargetExecutor._executeImperativeTarget(tmodel, key, value, steps, interval, easing, originalTargetName, originalTModel, cycles, options, snapUpdates);
|
|
92
|
+
if (snapUpdates.size) {
|
|
93
|
+
AnimationUtil.overrideAnimatedKeyWithSnap(tmodel, _toConsumableArray(snapUpdates.keys()), _toConsumableArray(snapUpdates.values()));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "_executeImperativeTarget",
|
|
98
|
+
value: function _executeImperativeTarget(tmodel, key, value, steps, interval, easing, originalTargetName, originalTModel) {
|
|
99
|
+
var cycles = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
100
|
+
var options = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : {};
|
|
101
|
+
var snapUpdates = arguments.length > 10 ? arguments[10] : undefined;
|
|
86
102
|
var targetValue;
|
|
87
103
|
if (typeof key === 'string') {
|
|
88
104
|
var cleanKey = TargetUtil.getTargetName(key);
|
|
89
|
-
key = !key.endsWith('+') ? key +
|
|
105
|
+
key = !key.endsWith('+') ? key + '+' : key;
|
|
90
106
|
tmodel.allTargetMap[cleanKey] = key;
|
|
91
107
|
}
|
|
92
108
|
if (TargetParser.isListTarget(value)) {
|
|
@@ -97,18 +113,14 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
97
113
|
targetValue = TargetExecutor.assignImperativeTargetValue(tmodel, key, originalTargetName, originalTModel);
|
|
98
114
|
TargetExecutor.assignListTarget(tmodel, key, targetValue, value.list, value.list[0], vSteps, vInterval, vEasing, vCycles);
|
|
99
115
|
} else if (TargetParser.isTargetSpecObject(value)) {
|
|
100
|
-
var
|
|
116
|
+
var targetOptions = TargetExecutor.getTargetOptions(value);
|
|
101
117
|
var valueArray = TargetParser.getValueStepsCycles(tmodel, key, value);
|
|
102
118
|
var newValue = valueArray[0];
|
|
103
|
-
var newSteps = valueArray[1];
|
|
104
|
-
var newInterval = valueArray[2];
|
|
105
|
-
var newEasing = valueArray[3];
|
|
106
|
-
var newCycles = valueArray[4];
|
|
107
|
-
|
|
108
|
-
interval = TUtil.isDefined(newInterval) ? newInterval : interval;
|
|
109
|
-
easing = TUtil.isDefined(newEasing) ? newEasing : easing;
|
|
110
|
-
cycles = TUtil.isDefined(newCycles) ? newCycles : cycles;
|
|
111
|
-
TargetExecutor.executeImperativeTarget(tmodel, key, newValue, steps, interval, easing, originalTargetName, originalTModel, cycles, _options);
|
|
119
|
+
var newSteps = TUtil.isDefined(valueArray[1]) ? valueArray[1] : steps;
|
|
120
|
+
var newInterval = TUtil.isDefined(valueArray[2]) ? valueArray[2] : interval;
|
|
121
|
+
var newEasing = TUtil.isDefined(valueArray[3]) ? valueArray[3] : easing;
|
|
122
|
+
var newCycles = TUtil.isDefined(valueArray[4]) ? valueArray[4] : cycles;
|
|
123
|
+
TargetExecutor._executeImperativeTarget(tmodel, key, newValue, newSteps, newInterval, newEasing, originalTargetName, originalTModel, newCycles, targetOptions, snapUpdates);
|
|
112
124
|
return;
|
|
113
125
|
} else if (TargetParser.isObjectTarget(key, value)) {
|
|
114
126
|
var completeValue = TargetData.cssFunctionMap[key] ? _objectSpread(_objectSpread({}, TargetData.cssFunctionMap[key]), value) : value;
|
|
@@ -121,14 +133,14 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
121
133
|
var newOptions = options;
|
|
122
134
|
if (_typeof(newValue) === 'object' && !TargetParser.isListTarget(newValue)) {
|
|
123
135
|
newOptions = TargetExecutor.getTargetOptions(newValue);
|
|
124
|
-
var _valueArray = TargetParser.getValueStepsCycles(tmodel, objectKey,
|
|
136
|
+
var _valueArray = TargetParser.getValueStepsCycles(tmodel, objectKey, newValue);
|
|
125
137
|
newValue = _valueArray[0];
|
|
126
138
|
newSteps = TUtil.isDefined(_valueArray[1]) ? _valueArray[1] : steps;
|
|
127
139
|
newInterval = TUtil.isDefined(_valueArray[2]) ? _valueArray[2] : interval;
|
|
128
140
|
newEasing = TUtil.isDefined(_valueArray[3]) ? _valueArray[3] : easing;
|
|
129
141
|
newCycles = TUtil.isDefined(_valueArray[4]) ? _valueArray[4] : cycles;
|
|
130
142
|
}
|
|
131
|
-
TargetExecutor.
|
|
143
|
+
TargetExecutor._executeImperativeTarget(tmodel, objectKey, newValue, newSteps, newInterval, newEasing, originalTargetName, originalTModel, newCycles, newOptions, snapUpdates);
|
|
132
144
|
});
|
|
133
145
|
} else {
|
|
134
146
|
if (_typeof(value) === 'object' && !TargetParser.isListTarget(value)) {
|
|
@@ -139,20 +151,17 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
139
151
|
interval = TUtil.isDefined(_valueArray2[2]) ? _valueArray2[2] : interval;
|
|
140
152
|
easing = TUtil.isDefined(_valueArray2[3]) ? _valueArray2[3] : easing;
|
|
141
153
|
cycles = TUtil.isDefined(_valueArray2[4]) ? _valueArray2[4] : cycles;
|
|
142
|
-
TargetExecutor.
|
|
143
|
-
|
|
144
|
-
targetValue = TargetExecutor.assignImperativeTargetValue(tmodel, key, originalTargetName, originalTModel, cycles);
|
|
145
|
-
TargetExecutor.assignSingleTarget(targetValue, value, undefined, steps, cycles, interval, easing);
|
|
154
|
+
TargetExecutor._executeImperativeTarget(tmodel, key, value, steps, interval, easing, originalTargetName, originalTModel, cycles, options, snapUpdates);
|
|
155
|
+
return;
|
|
146
156
|
}
|
|
147
|
-
} else {
|
|
148
|
-
targetValue = TargetExecutor.assignImperativeTargetValue(tmodel, key, originalTargetName, originalTModel, cycles);
|
|
149
|
-
TargetExecutor.assignSingleTarget(targetValue, value, undefined, steps, cycles, interval, easing);
|
|
150
157
|
}
|
|
158
|
+
targetValue = TargetExecutor.assignImperativeTargetValue(tmodel, key, originalTargetName, originalTModel);
|
|
159
|
+
TargetExecutor.assignSingleTarget(targetValue, value, undefined, steps, cycles, interval, easing);
|
|
151
160
|
}
|
|
152
161
|
if (targetValue) {
|
|
153
162
|
TargetExecutor.resetImperativeProgress(targetValue);
|
|
154
163
|
TargetExecutor.assignTargetOptions(targetValue, options);
|
|
155
|
-
TargetExecutor.updateTarget(tmodel, targetValue, key, true);
|
|
164
|
+
TargetExecutor.updateTarget(tmodel, targetValue, key, true, snapUpdates);
|
|
156
165
|
if (tmodel.isTargetDone(key)) {
|
|
157
166
|
TargetUtil.shouldActivateNextTarget(tmodel, key);
|
|
158
167
|
}
|
|
@@ -160,10 +169,10 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
160
169
|
}
|
|
161
170
|
}, {
|
|
162
171
|
key: "updateTarget",
|
|
163
|
-
value: function updateTarget(tmodel, targetValue, key, enforce) {
|
|
172
|
+
value: function updateTarget(tmodel, targetValue, key, enforce, snapUpdates) {
|
|
164
173
|
tmodel.setLastUpdate(key);
|
|
165
174
|
if (tmodel.getTargetSteps(key) === 0) {
|
|
166
|
-
TargetExecutor.snapActualToTarget(tmodel, key);
|
|
175
|
+
TargetExecutor.snapActualToTarget(tmodel, key, snapUpdates);
|
|
167
176
|
}
|
|
168
177
|
targetValue.executionFlag = true;
|
|
169
178
|
targetValue.executionCount++;
|
|
@@ -173,8 +182,9 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
173
182
|
tmodel.setTargetMethodName(key, 'value');
|
|
174
183
|
var newStatus = TargetExecutor.calculateTargetStatus(tmodel, targetValue, key);
|
|
175
184
|
tmodel.setTargetStatus(key, newStatus);
|
|
176
|
-
|
|
177
|
-
|
|
185
|
+
var shouldSchedule = tmodel.isTargetImperative(key) || tmodel.shouldScheduleRun(key);
|
|
186
|
+
if (!TargetData.ignoreRerun[key] && shouldSchedule) {
|
|
187
|
+
getRunScheduler().schedule(1, "updateTarget-".concat(tmodel.oid, "-").concat(key));
|
|
178
188
|
}
|
|
179
189
|
}
|
|
180
190
|
}, {
|
|
@@ -240,7 +250,8 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
240
250
|
}
|
|
241
251
|
}, {
|
|
242
252
|
key: "snapActualToTarget",
|
|
243
|
-
value: function snapActualToTarget(tmodel, key) {
|
|
253
|
+
value: function snapActualToTarget(tmodel, key, snapUpdates) {
|
|
254
|
+
var _tmodel$animatingMap2;
|
|
244
255
|
var targetValue = tmodel.targetValues[key];
|
|
245
256
|
var newValue;
|
|
246
257
|
if (Array.isArray(targetValue.valueList)) {
|
|
@@ -249,15 +260,25 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
249
260
|
targetValue.value = newValue;
|
|
250
261
|
} else {
|
|
251
262
|
var value = targetValue.value;
|
|
252
|
-
newValue = typeof value ===
|
|
263
|
+
newValue = typeof value === 'function' ? value.call(tmodel) : value;
|
|
253
264
|
}
|
|
254
|
-
|
|
265
|
+
var valueChanged = tmodel.val(key) !== newValue;
|
|
266
|
+
var isAnimating = (_tmodel$animatingMap2 = tmodel.animatingMap) === null || _tmodel$animatingMap2 === void 0 ? void 0 : _tmodel$animatingMap2.has(key);
|
|
267
|
+
if (!valueChanged && !isAnimating) {
|
|
255
268
|
return;
|
|
256
269
|
}
|
|
257
|
-
if (
|
|
270
|
+
if (valueChanged) {
|
|
258
271
|
tmodel.val(key, newValue);
|
|
259
272
|
tmodel.setActual(key, newValue);
|
|
260
273
|
TUtil.handleValueChange(tmodel, key);
|
|
274
|
+
}
|
|
275
|
+
if (!tmodel.hasValidAnimation() || !tmodel.canBeAnimated(key)) {
|
|
276
|
+
targetValue.snapAnimation = false;
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
targetValue.snapAnimation = true;
|
|
280
|
+
if (snapUpdates) {
|
|
281
|
+
snapUpdates.set(key, newValue);
|
|
261
282
|
return;
|
|
262
283
|
}
|
|
263
284
|
AnimationUtil.overrideAnimatedKeyWithSnap(tmodel, key, newValue);
|
package/build/TargetUtil.js
CHANGED
|
@@ -116,29 +116,29 @@ var TargetUtil = /*#__PURE__*/function () {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
Object.keys(target).forEach(function (method) {
|
|
119
|
+
var _originalMethod$__tar;
|
|
119
120
|
var originalMethod = target[method];
|
|
120
|
-
var
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
var wrappedMethod = function wrappedMethod() {
|
|
126
|
-
var _getPrevUpdateTime;
|
|
127
|
-
if (!TargetData.lifecycleCoreSet.has(method)) {
|
|
128
|
-
TargetUtil.currentTargetName = key;
|
|
129
|
-
TargetUtil.currentTModel = tmodel;
|
|
130
|
-
}
|
|
131
|
-
this.key = cleanKey;
|
|
132
|
-
this.value = this.val(cleanKey);
|
|
133
|
-
this.prevTargetValue = getPrevValue();
|
|
134
|
-
this.isPrevTargetUpdated = isPrevTargetUpdated;
|
|
135
|
-
var result = typeof originalMethod === 'function' ? originalMethod.apply(this, arguments) : originalMethod;
|
|
136
|
-
lastPrevUpdateTime = (_getPrevUpdateTime = getPrevUpdateTime()) !== null && _getPrevUpdateTime !== void 0 ? _getPrevUpdateTime : lastPrevUpdateTime;
|
|
137
|
-
return result;
|
|
138
|
-
};
|
|
139
|
-
wrappedMethod.__isBoundTargetMethod = true;
|
|
140
|
-
target[method] = wrappedMethod;
|
|
121
|
+
var sourceMethod = (_originalMethod$__tar = originalMethod === null || originalMethod === void 0 ? void 0 : originalMethod.__targetjsSource) !== null && _originalMethod$__tar !== void 0 ? _originalMethod$__tar : originalMethod;
|
|
122
|
+
var shouldWrap = method === 'value' || typeof sourceMethod === 'function' && TargetData.isLifeCycleMethod(method);
|
|
123
|
+
if (!shouldWrap) {
|
|
124
|
+
return;
|
|
141
125
|
}
|
|
126
|
+
var wrappedMethod = function wrappedMethod() {
|
|
127
|
+
var _getPrevUpdateTime;
|
|
128
|
+
if (!TargetData.lifecycleCoreSet.has(method)) {
|
|
129
|
+
TargetUtil.currentTargetName = key;
|
|
130
|
+
TargetUtil.currentTModel = tmodel;
|
|
131
|
+
}
|
|
132
|
+
this.key = cleanKey;
|
|
133
|
+
this.value = this.val(cleanKey);
|
|
134
|
+
this.prevTargetValue = getPrevValue();
|
|
135
|
+
this.isPrevTargetUpdated = isPrevTargetUpdated;
|
|
136
|
+
var result = typeof sourceMethod === 'function' ? sourceMethod.apply(this, arguments) : sourceMethod;
|
|
137
|
+
lastPrevUpdateTime = (_getPrevUpdateTime = getPrevUpdateTime()) !== null && _getPrevUpdateTime !== void 0 ? _getPrevUpdateTime : lastPrevUpdateTime;
|
|
138
|
+
return result;
|
|
139
|
+
};
|
|
140
|
+
wrappedMethod.__targetjsSource = sourceMethod;
|
|
141
|
+
target[method] = wrappedMethod;
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
}, {
|
|
@@ -239,7 +239,7 @@ var TargetUtil = /*#__PURE__*/function () {
|
|
|
239
239
|
if (!isEndTrigger) {
|
|
240
240
|
targetValue.nextTargetUpdateCount = targetValue.updateCount;
|
|
241
241
|
} else {
|
|
242
|
-
TargetUtil.
|
|
242
|
+
TargetUtil.snapshotTriggeredByCompleteCounts(tmodel, nextTarget);
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
var caughtUp = false;
|
|
@@ -395,12 +395,25 @@ var TargetUtil = /*#__PURE__*/function () {
|
|
|
395
395
|
return (_tmodel$targetValues$2 = (_tmodel$targetValues$3 = tmodel.targetValues[nextTarget]) === null || _tmodel$targetValues$3 === void 0 || (_tmodel$targetValues$3 = _tmodel$targetValues$3.triggeredByCompleteCountMap) === null || _tmodel$targetValues$3 === void 0 ? void 0 : _tmodel$targetValues$3.get(key)) !== null && _tmodel$targetValues$2 !== void 0 ? _tmodel$targetValues$2 : 0;
|
|
396
396
|
}
|
|
397
397
|
}, {
|
|
398
|
-
key: "
|
|
399
|
-
value: function
|
|
398
|
+
key: "snapshotTriggeredByCompleteCounts",
|
|
399
|
+
value: function snapshotTriggeredByCompleteCounts(tmodel, nextTarget) {
|
|
400
400
|
var _tmodel$targetValues;
|
|
401
401
|
var nextTargetValue = (_tmodel$targetValues = tmodel.targetValues)[nextTarget] || (_tmodel$targetValues[nextTarget] = TargetUtil.emptyValue());
|
|
402
|
-
var
|
|
403
|
-
|
|
402
|
+
var map = nextTargetValue.triggeredByCompleteCountMap || (nextTargetValue.triggeredByCompleteCountMap = new Map());
|
|
403
|
+
var nextIndex = tmodel.functionTargetNames.indexOf(nextTarget);
|
|
404
|
+
if (nextIndex < 0) {
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
for (var i = 0; i < nextIndex; i++) {
|
|
408
|
+
var _tmodel$targetValues$4, _tmodel$targetValues$5;
|
|
409
|
+
var previousKey = tmodel.functionTargetNames[i];
|
|
410
|
+
var previousTarget = tmodel.targets[previousKey];
|
|
411
|
+
if ((previousTarget === null || previousTarget === void 0 ? void 0 : previousTarget.activateNextTarget) !== nextTarget) {
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
414
|
+
var completeCount = (_tmodel$targetValues$4 = (_tmodel$targetValues$5 = tmodel.targetValues[previousKey]) === null || _tmodel$targetValues$5 === void 0 ? void 0 : _tmodel$targetValues$5.completeCount) !== null && _tmodel$targetValues$4 !== void 0 ? _tmodel$targetValues$4 : 0;
|
|
415
|
+
map.set(previousKey, completeCount);
|
|
416
|
+
}
|
|
404
417
|
}
|
|
405
418
|
}, {
|
|
406
419
|
key: "activateTargetOnce",
|
|
@@ -741,7 +754,7 @@ var TargetUtil = /*#__PURE__*/function () {
|
|
|
741
754
|
}, {
|
|
742
755
|
key: "shouldIgnoreChildForCompletion",
|
|
743
756
|
value: function shouldIgnoreChildForCompletion(child, completionScope) {
|
|
744
|
-
if (!child.exists()) {
|
|
757
|
+
if (!child || !child.exists()) {
|
|
745
758
|
return true;
|
|
746
759
|
}
|
|
747
760
|
if (completionScope === "none") {
|
|
@@ -836,9 +849,9 @@ var TargetUtil = /*#__PURE__*/function () {
|
|
|
836
849
|
value: function getOriginalNames(tmodel, key) {
|
|
837
850
|
var originalTModel, originalTargetName;
|
|
838
851
|
if (tmodel.isTargetImperative(key)) {
|
|
839
|
-
var _tmodel$targetValues$
|
|
840
|
-
originalTModel = (_tmodel$targetValues$
|
|
841
|
-
originalTargetName = (_tmodel$targetValues$
|
|
852
|
+
var _tmodel$targetValues$6, _tmodel$targetValues$7;
|
|
853
|
+
originalTModel = (_tmodel$targetValues$6 = tmodel.targetValues[key]) === null || _tmodel$targetValues$6 === void 0 ? void 0 : _tmodel$targetValues$6.originalTModel;
|
|
854
|
+
originalTargetName = (_tmodel$targetValues$7 = tmodel.targetValues[key]) === null || _tmodel$targetValues$7 === void 0 ? void 0 : _tmodel$targetValues$7.originalTargetName;
|
|
842
855
|
} else {
|
|
843
856
|
var _tmodel$targets$key4, _tmodel$targets$key5;
|
|
844
857
|
originalTModel = (_tmodel$targets$key4 = tmodel.targets[key]) === null || _tmodel$targets$key4 === void 0 ? void 0 : _tmodel$targets$key4.originalTModel;
|
|
@@ -991,6 +1004,38 @@ var TargetUtil = /*#__PURE__*/function () {
|
|
|
991
1004
|
tmodel.removeFromUpdatingTargets(key);
|
|
992
1005
|
TargetUtil.clearPendingTarget(tmodel, key);
|
|
993
1006
|
}
|
|
1007
|
+
}, {
|
|
1008
|
+
key: "convertAnimatingTargetsToUpdating",
|
|
1009
|
+
value: function convertAnimatingTargetsToUpdating(tmodels) {
|
|
1010
|
+
var _iterator5 = _createForOfIteratorHelper(tmodels),
|
|
1011
|
+
_step5;
|
|
1012
|
+
try {
|
|
1013
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
1014
|
+
var tmodel = _step5.value;
|
|
1015
|
+
if (!(tmodel !== null && tmodel !== void 0 && tmodel.hasAnimatingTargets())) {
|
|
1016
|
+
continue;
|
|
1017
|
+
}
|
|
1018
|
+
var animatingTargets = _toConsumableArray(tmodel.getAnimatingTargets());
|
|
1019
|
+
var _iterator6 = _createForOfIteratorHelper(animatingTargets),
|
|
1020
|
+
_step6;
|
|
1021
|
+
try {
|
|
1022
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
1023
|
+
var targetName = _step6.value;
|
|
1024
|
+
tmodel.setTargetStatus(targetName, "updating");
|
|
1025
|
+
tmodel.removeFromAnimatingMap(targetName);
|
|
1026
|
+
}
|
|
1027
|
+
} catch (err) {
|
|
1028
|
+
_iterator6.e(err);
|
|
1029
|
+
} finally {
|
|
1030
|
+
_iterator6.f();
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
} catch (err) {
|
|
1034
|
+
_iterator5.e(err);
|
|
1035
|
+
} finally {
|
|
1036
|
+
_iterator5.f();
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
994
1039
|
}, {
|
|
995
1040
|
key: "getResetOptions",
|
|
996
1041
|
value: function getResetOptions(options) {
|
package/build/index.js
CHANGED
|
@@ -17,4 +17,5 @@ export * from "./TargetExecutor.js";
|
|
|
17
17
|
export * from "./AnimationManager.js";
|
|
18
18
|
export * from "./AnimationUtil.js";
|
|
19
19
|
export * from "./VisibilityUtil.js";
|
|
20
|
-
export * from "./ScheduleUtil.js";
|
|
20
|
+
export * from "./ScheduleUtil.js";
|
|
21
|
+
export * from "./StateUtil.js";
|