targetj 1.0.223 → 1.0.225
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/README.md +9 -19
- package/build/AnimationManager.js +5 -1
- package/build/BaseModel.js +20 -7
- package/build/Bracket.js +22 -3
- package/build/DomInit.js +2 -2
- package/build/LoadingManager.js +3 -3
- package/build/LocationManager.js +0 -3
- package/build/TModelUtil.js +4 -1
- package/build/TargetExecutor.js +33 -21
- package/build/TargetManager.js +51 -27
- package/build/TargetParser.js +3 -3
- package/build/TargetUtil.js +15 -5
- package/dist/targetjs.js +1 -1
- package/dist/targetjs.js.gz +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -112,16 +112,11 @@ App({
|
|
|
112
112
|
this.setTarget('backgroundColor', { value: [ '#ffe8ec', '#f5f5f5' ], steps: 12, interval: 12 });
|
|
113
113
|
},
|
|
114
114
|
heart$$: { // Wait for the button animation to finish, THEN add and animate the heart.
|
|
115
|
-
html: "♥", color: "crimson", fontSize: 20
|
|
115
|
+
html: "♥", color: "crimson", fontSize: 20;
|
|
116
116
|
fly() {
|
|
117
|
-
const cx = this.
|
|
118
|
-
this.setTarget({
|
|
119
|
-
|
|
120
|
-
scale: { value: [0.8, 1.4, 1.1, 0.9, 0.8], steps: 20 },
|
|
121
|
-
rotate: { value: [0, 12, -8, 6, 0], steps: 20 },
|
|
122
|
-
x: { value: [cx, cx + 22, cx - 16, cx + 10, cx], steps: 30 },
|
|
123
|
-
y: { value: [cy - 8, cy - 70, cy - 90, cy - 120, cy - 150], steps: 30 }
|
|
124
|
-
});
|
|
117
|
+
const cx = (this.parent.getWidth() - this.getWidth()) / 2;
|
|
118
|
+
this.setTarget('x', { value: [cx, cx + 22, cx - 16, cx + 10, cx ], steps: 50, cycles: 2 }); // Repeat it twice
|
|
119
|
+
this.setTarget('y', { value: [0, -120], steps: 400 });
|
|
125
120
|
}
|
|
126
121
|
}
|
|
127
122
|
}).mount("#likeButton");
|
|
@@ -152,14 +147,9 @@ App({
|
|
|
152
147
|
heart$$: {
|
|
153
148
|
html: "♥", color: "crimson", fontSize: 20,
|
|
154
149
|
fly() {
|
|
155
|
-
const cx = this.
|
|
156
|
-
this.setTarget({
|
|
157
|
-
|
|
158
|
-
scale: { value: [0.8, 1.4, 1.1, 0.9, 0.8], steps: 20 },
|
|
159
|
-
rotate: { value: [0, 12, -8, 6, 0], steps: 20 },
|
|
160
|
-
x: { value: [cx, cx + 22, cx - 16, cx + 10, cx], steps: 30 },
|
|
161
|
-
y: { value: [cy - 8, cy - 70, cy - 90, cy - 120, cy - 150], steps: 30 }
|
|
162
|
-
});
|
|
150
|
+
const cx = (this.parent.getWidth() - this.getWidth()) / 2;
|
|
151
|
+
this.setTarget('x', { value: [cx, cx + 22, cx - 16, cx + 10, cx ], steps: 50, cycles: 2 }); // Repeat it twice
|
|
152
|
+
this.setTarget('y', { value: [0, -120], steps: 400 });
|
|
163
153
|
}
|
|
164
154
|
},
|
|
165
155
|
fetch$$: { method: "POST", id: 123, url: "/api/like" }, // Wait for the heart to finish, THEN fetch
|
|
@@ -334,7 +324,7 @@ App({
|
|
|
334
324
|
gap: 10,
|
|
335
325
|
fetch: {
|
|
336
326
|
interval: 1000,
|
|
337
|
-
cycles:
|
|
327
|
+
cycles: 5,
|
|
338
328
|
value(i) { return `https://targetjs.io/api/randomUser?id=user${i}`; }
|
|
339
329
|
},
|
|
340
330
|
child$() {
|
|
@@ -411,7 +401,7 @@ App({
|
|
|
411
401
|
},
|
|
412
402
|
wave$$: {
|
|
413
403
|
interval: 30,
|
|
414
|
-
cycles() { return this.visibleChildren.length
|
|
404
|
+
cycles() { return this.visibleChildren.length; },
|
|
415
405
|
value(i) {
|
|
416
406
|
const child = this.visibleChildren[i];
|
|
417
407
|
child.setTarget("scale", { value: [1, 1.06, 1], steps: 18 });
|
|
@@ -180,10 +180,14 @@ var AnimationManager = exports.AnimationManager = /*#__PURE__*/function () {
|
|
|
180
180
|
tmodel.val(originalKey, value);
|
|
181
181
|
var targetValue = tmodel.targetValues[originalKey];
|
|
182
182
|
if (targetValue) {
|
|
183
|
+
var _targetValue$valueLis, _targetValue$valueLis2;
|
|
183
184
|
targetValue.step = tmodel.getTargetSteps(originalKey);
|
|
184
|
-
targetValue.
|
|
185
|
+
targetValue.valuePointer = (_targetValue$valueLis = (_targetValue$valueLis2 = targetValue.valueList) === null || _targetValue$valueLis2 === void 0 ? void 0 : _targetValue$valueLis2.length) !== null && _targetValue$valueLis !== void 0 ? _targetValue$valueLis : 0;
|
|
185
186
|
targetValue.value = value;
|
|
186
187
|
tmodel.setActual(originalKey, value);
|
|
188
|
+
if (tmodel.isTargetImperative(originalKey)) {
|
|
189
|
+
targetValue.cycle = targetValue.cycles;
|
|
190
|
+
}
|
|
187
191
|
}
|
|
188
192
|
}
|
|
189
193
|
if (!tmodel.hasAnimatingTargets()) {
|
package/build/BaseModel.js
CHANGED
|
@@ -314,7 +314,7 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
314
314
|
this.addToStyleTargetList(key);
|
|
315
315
|
}
|
|
316
316
|
if (_TargetParser.TargetParser.isIntervalTarget(target)) {
|
|
317
|
-
target.cycles =
|
|
317
|
+
target.cycles = 2;
|
|
318
318
|
target.isInterval = true;
|
|
319
319
|
} else if (!needsTargetExecution) {
|
|
320
320
|
var _target;
|
|
@@ -759,7 +759,7 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
759
759
|
key: "getTargetCycles",
|
|
760
760
|
value: function getTargetCycles(key) {
|
|
761
761
|
var _this$targetValues$ke17, _this$targetValues$ke18;
|
|
762
|
-
var cycles = (_this$targetValues$ke17 = (_this$targetValues$ke18 = this.targetValues[key]) === null || _this$targetValues$ke18 === void 0 ? void 0 : _this$targetValues$ke18.cycles) !== null && _this$targetValues$ke17 !== void 0 ? _this$targetValues$ke17 :
|
|
762
|
+
var cycles = (_this$targetValues$ke17 = (_this$targetValues$ke18 = this.targetValues[key]) === null || _this$targetValues$ke18 === void 0 ? void 0 : _this$targetValues$ke18.cycles) !== null && _this$targetValues$ke17 !== void 0 ? _this$targetValues$ke17 : 1;
|
|
763
763
|
var target = this.targets[key];
|
|
764
764
|
if (!target) {
|
|
765
765
|
return cycles;
|
|
@@ -772,13 +772,25 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
772
772
|
var _this$targetValues$ke19, _this$targetValues$ke20;
|
|
773
773
|
return (_this$targetValues$ke19 = (_this$targetValues$ke20 = this.targetValues[key]) === null || _this$targetValues$ke20 === void 0 ? void 0 : _this$targetValues$ke20.cycle) !== null && _this$targetValues$ke19 !== void 0 ? _this$targetValues$ke19 : 0;
|
|
774
774
|
}
|
|
775
|
+
}, {
|
|
776
|
+
key: "getValueListPointer",
|
|
777
|
+
value: function getValueListPointer(key) {
|
|
778
|
+
var _this$targetValues$ke21, _this$targetValues$ke22;
|
|
779
|
+
return (_this$targetValues$ke21 = (_this$targetValues$ke22 = this.targetValues[key]) === null || _this$targetValues$ke22 === void 0 ? void 0 : _this$targetValues$ke22.valuePointer) !== null && _this$targetValues$ke21 !== void 0 ? _this$targetValues$ke21 : 0;
|
|
780
|
+
}
|
|
775
781
|
}, {
|
|
776
782
|
key: "incrementTargetCycle",
|
|
777
783
|
value: function incrementTargetCycle(key) {
|
|
778
784
|
if (this.targetValues[key]) {
|
|
779
785
|
this.targetValues[key].cycle++;
|
|
780
786
|
}
|
|
781
|
-
|
|
787
|
+
}
|
|
788
|
+
}, {
|
|
789
|
+
key: "incrementValueListPointer",
|
|
790
|
+
value: function incrementValueListPointer(key) {
|
|
791
|
+
if (this.targetValues[key]) {
|
|
792
|
+
this.targetValues[key].valuePointer++;
|
|
793
|
+
}
|
|
782
794
|
}
|
|
783
795
|
}, {
|
|
784
796
|
key: "setTargetInterval",
|
|
@@ -986,9 +998,9 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
986
998
|
}, {
|
|
987
999
|
key: "addToAnimatingMap",
|
|
988
1000
|
value: function addToAnimatingMap(key) {
|
|
989
|
-
var _this$targetValues$
|
|
1001
|
+
var _this$targetValues$ke23, _this$getParent7;
|
|
990
1002
|
var record = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
991
|
-
if ((_this$targetValues$
|
|
1003
|
+
if ((_this$targetValues$ke23 = this.targetValues[key]) !== null && _this$targetValues$ke23 !== void 0 && _this$targetValues$ke23.snapAnimation) {
|
|
992
1004
|
return;
|
|
993
1005
|
}
|
|
994
1006
|
this.animatingMap || (this.animatingMap = new Map());
|
|
@@ -1107,7 +1119,7 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
1107
1119
|
targetValue.step = 0;
|
|
1108
1120
|
targetValue.cycle = 0;
|
|
1109
1121
|
targetValue.steps = 0;
|
|
1110
|
-
targetValue.cycles =
|
|
1122
|
+
targetValue.cycles = 1;
|
|
1111
1123
|
targetValue.interval = 0;
|
|
1112
1124
|
targetValue.status = '';
|
|
1113
1125
|
}
|
|
@@ -1156,7 +1168,8 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
1156
1168
|
targetValue.executionFlag = false;
|
|
1157
1169
|
targetValue.scheduleTimeStamp = undefined;
|
|
1158
1170
|
targetValue.step = 0;
|
|
1159
|
-
targetValue.cycle =
|
|
1171
|
+
targetValue.cycle = 0;
|
|
1172
|
+
targetValue.valuePointer = Array.isArray(targetValue.valueList) ? 1 : 0;
|
|
1160
1173
|
targetValue.initialValue = undefined;
|
|
1161
1174
|
} else {
|
|
1162
1175
|
var _this$targets$key$cyc, _this$targets$key;
|
package/build/Bracket.js
CHANGED
|
@@ -157,9 +157,28 @@ var Bracket = exports.Bracket = /*#__PURE__*/function (_TModel) {
|
|
|
157
157
|
}, {
|
|
158
158
|
key: "shouldCalculateChildren",
|
|
159
159
|
value: function shouldCalculateChildren() {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
if (this.currentStatus === 'new' || this.isNowVisible) {
|
|
161
|
+
var visibleChild = this.getChildren().find(function (child) {
|
|
162
|
+
return child.calcVisibility();
|
|
163
|
+
});
|
|
164
|
+
this.currentStatus = undefined;
|
|
165
|
+
if (visibleChild) {
|
|
166
|
+
this.currentStatus = 'new';
|
|
167
|
+
var parent = this.parent;
|
|
168
|
+
while (parent && parent.type === 'BI') {
|
|
169
|
+
parent.currentStatus = 'new';
|
|
170
|
+
parent = parent.parent;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
if (this.getDirtyLayout() === false) {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
if (this.isVisible()) {
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
return false;
|
|
163
182
|
}
|
|
164
183
|
}, {
|
|
165
184
|
key: "getDirtyLayout",
|
package/build/DomInit.js
CHANGED
|
@@ -192,7 +192,7 @@ var DomInit = exports.DomInit = /*#__PURE__*/function () {
|
|
|
192
192
|
parentModel[childrenKey].value.push(newModel);
|
|
193
193
|
} else if (typeof parentModel[childrenKey] === 'string') {
|
|
194
194
|
parentModel[childrenKey] = {
|
|
195
|
-
cycles: _TUtil.TUtil.isNumber(+parentModel[childrenKey]) ? +parentModel[childrenKey] :
|
|
195
|
+
cycles: _TUtil.TUtil.isNumber(+parentModel[childrenKey]) ? +parentModel[childrenKey] : 1,
|
|
196
196
|
value: [newModel]
|
|
197
197
|
};
|
|
198
198
|
} else if (_typeof(parentModel[childrenKey]) === 'object') {
|
|
@@ -200,7 +200,7 @@ var DomInit = exports.DomInit = /*#__PURE__*/function () {
|
|
|
200
200
|
}
|
|
201
201
|
} else {
|
|
202
202
|
parentModel.children$ = {
|
|
203
|
-
cycles:
|
|
203
|
+
cycles: 1,
|
|
204
204
|
value: [newModel]
|
|
205
205
|
};
|
|
206
206
|
}
|
package/build/LoadingManager.js
CHANGED
|
@@ -262,7 +262,7 @@ var LoadingManager = exports.LoadingManager = /*#__PURE__*/function () {
|
|
|
262
262
|
value: function calculateTargetStatus(tmodel, key) {
|
|
263
263
|
var cycle = tmodel.getTargetCycle(key);
|
|
264
264
|
var cycles = tmodel.getTargetCycles(key);
|
|
265
|
-
if (tmodel.isTargetInLoop(key) || cycle < cycles) {
|
|
265
|
+
if (tmodel.isTargetInLoop(key) || cycle < cycles - 1) {
|
|
266
266
|
return 'active';
|
|
267
267
|
} else if (!this.isLoadingSuccessful(tmodel, key)) {
|
|
268
268
|
return 'fetching';
|
|
@@ -305,7 +305,7 @@ var LoadingManager = exports.LoadingManager = /*#__PURE__*/function () {
|
|
|
305
305
|
}
|
|
306
306
|
targetResults[fetchEntry.order] = res.result;
|
|
307
307
|
}
|
|
308
|
-
tmodel.val(targetName, (targetResults === null || targetResults === void 0 ? void 0 : targetResults.length) === 1 && tmodel.getTargetCycles(targetName)
|
|
308
|
+
tmodel.val(targetName, (targetResults === null || targetResults === void 0 ? void 0 : targetResults.length) === 1 && tmodel.getTargetCycles(targetName) <= 1 ? targetResults[0] : targetResults);
|
|
309
309
|
var newStatus = _this4.calculateTargetStatus(tmodel, targetName);
|
|
310
310
|
tmodel.setTargetStatus(targetName, newStatus);
|
|
311
311
|
tmodel.setLastUpdate(targetName);
|
|
@@ -350,7 +350,7 @@ var LoadingManager = exports.LoadingManager = /*#__PURE__*/function () {
|
|
|
350
350
|
}
|
|
351
351
|
targetResults[fetchEntry.order] = res;
|
|
352
352
|
}
|
|
353
|
-
tmodel.val(targetName, (targetResults === null || targetResults === void 0 ? void 0 : targetResults.length) === 1 && tmodel.getTargetCycles(targetName)
|
|
353
|
+
tmodel.val(targetName, (targetResults === null || targetResults === void 0 ? void 0 : targetResults.length) === 1 && tmodel.getTargetCycles(targetName) <= 1 ? targetResults[0] : targetResults);
|
|
354
354
|
tmodelEntry.errorCount++;
|
|
355
355
|
_this5.callOnErrorHandler(tmodel, targetName);
|
|
356
356
|
var newStatus = _this5.calculateTargetStatus(tmodel, targetName);
|
package/build/LocationManager.js
CHANGED
|
@@ -236,9 +236,6 @@ var LocationManager = exports.LocationManager = /*#__PURE__*/function () {
|
|
|
236
236
|
if (child.isDomIsland()) {
|
|
237
237
|
_this.domIslandSet.add(child);
|
|
238
238
|
}
|
|
239
|
-
if (child.shouldBeBracketed() && !_TUtil.TUtil.isDefined(child.getDomParent().targets['onWindowScroll'])) {
|
|
240
|
-
child.getDomParent().addTarget('onWindowScroll', '');
|
|
241
|
-
}
|
|
242
239
|
viewport.setLocation();
|
|
243
240
|
if (viewport.isOverflow()) {
|
|
244
241
|
viewport.overflow();
|
package/build/TModelUtil.js
CHANGED
|
@@ -348,6 +348,9 @@ var TModelUtil = exports.TModelUtil = /*#__PURE__*/function () {
|
|
|
348
348
|
}, {
|
|
349
349
|
key: "shouldUseImplicitTransformOrder",
|
|
350
350
|
value: function shouldUseImplicitTransformOrder(tmodel) {
|
|
351
|
+
if (tmodel.val('useTargetTransformOrder')) {
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
351
354
|
var names = tmodel.originalTargetNames || [];
|
|
352
355
|
var hasAny = function hasAny(arr) {
|
|
353
356
|
return arr.some(function (k) {
|
|
@@ -357,7 +360,7 @@ var TModelUtil = exports.TModelUtil = /*#__PURE__*/function () {
|
|
|
357
360
|
var hasPerspective = hasAny(["perspective"]);
|
|
358
361
|
var hasTranslate = hasAny(["translateX", "translateY", "translateZ", "x", "y", "z"]);
|
|
359
362
|
var hasRotate = hasAny(["rotateX", "rotateY", "rotateZ"]) || hasAny(["rotate3DX"]) && hasAny(["rotate3DY"]) && hasAny(["rotate3DZ"]) && hasAny(["rotate3DAngle"]);
|
|
360
|
-
var hasSkew = hasAny(["skewX", "skewY"]);
|
|
363
|
+
var hasSkew = hasAny(["skewX", "skewY", "skew"]);
|
|
361
364
|
var hasScale = hasAny(["scaleX", "scaleY", "scaleZ"]) || hasAny(["scale3DX"]) && hasAny(["scale3DY"]) && hasAny(["scale3DZ"]);
|
|
362
365
|
var groups = 0;
|
|
363
366
|
if (hasPerspective) {
|
package/build/TargetExecutor.js
CHANGED
|
@@ -39,9 +39,9 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
39
39
|
value: function prepareTarget(tmodel, key) {
|
|
40
40
|
_TargetUtil.TargetUtil.currentTargetName = key;
|
|
41
41
|
_TargetUtil.TargetUtil.currentTModel = tmodel;
|
|
42
|
-
if (tmodel.isExecuted(key) && tmodel.getTargetCycles(key) >
|
|
43
|
-
if (tmodel.getTargetCycle(key) < tmodel.getTargetCycles(key)) {
|
|
44
|
-
tmodel.incrementTargetCycle(key
|
|
42
|
+
if (tmodel.isExecuted(key) && tmodel.getTargetCycles(key) > 1) {
|
|
43
|
+
if (tmodel.getTargetCycle(key) < tmodel.getTargetCycles(key) - 1) {
|
|
44
|
+
tmodel.incrementTargetCycle(key);
|
|
45
45
|
} else {
|
|
46
46
|
tmodel.resetTargetCycle(key);
|
|
47
47
|
}
|
|
@@ -56,7 +56,6 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
56
56
|
tmodel.allTargetMap[cleanKey] = key;
|
|
57
57
|
TargetExecutor.resolveTargetValue(tmodel, key);
|
|
58
58
|
TargetExecutor.updateTarget(tmodel, tmodel.targetValues[key], key, false);
|
|
59
|
-
_TargetUtil.TargetUtil.shouldActivateNextTarget(tmodel, key);
|
|
60
59
|
}
|
|
61
60
|
}, {
|
|
62
61
|
key: "assignImperativeTargetValue",
|
|
@@ -76,6 +75,7 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
76
75
|
}, {
|
|
77
76
|
key: "executeImperativeTarget",
|
|
78
77
|
value: function executeImperativeTarget(tmodel, key, value, steps, interval, easing, originalTargetName, originalTModel) {
|
|
78
|
+
var cycles = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
79
79
|
var targetValue;
|
|
80
80
|
if (typeof key === 'string') {
|
|
81
81
|
var cleanKey = _TargetUtil.TargetUtil.getTargetName(key);
|
|
@@ -86,18 +86,21 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
86
86
|
var vSteps = _TUtil.TUtil.isDefined(value.steps) ? value.steps : steps;
|
|
87
87
|
var vInterval = _TUtil.TUtil.isDefined(value.interval) ? value.interval : interval;
|
|
88
88
|
var vEasing = _TUtil.TUtil.isDefined(value.easing) ? value.easing : easing;
|
|
89
|
+
var vCycles = _TUtil.TUtil.isDefined(value.cycles) ? value.cycles : cycles;
|
|
89
90
|
targetValue = TargetExecutor.assignImperativeTargetValue(tmodel, key, originalTargetName, originalTModel);
|
|
90
|
-
TargetExecutor.assignListTarget(tmodel, key, targetValue, value.list, value.list[0], vSteps, vInterval, vEasing);
|
|
91
|
+
TargetExecutor.assignListTarget(tmodel, key, targetValue, value.list, value.list[0], vSteps, vInterval, vEasing, vCycles);
|
|
91
92
|
} else if (_TargetParser.TargetParser.isTargetSpecObject(value)) {
|
|
92
93
|
var valueArray = _TargetParser.TargetParser.getValueStepsCycles(tmodel, value, key);
|
|
93
94
|
var newValue = valueArray[0];
|
|
94
95
|
var newSteps = valueArray[1];
|
|
95
96
|
var newInterval = valueArray[2];
|
|
96
97
|
var newEasing = valueArray[3];
|
|
98
|
+
var newCycles = valueArray[4];
|
|
97
99
|
steps = _TUtil.TUtil.isDefined(newSteps) ? newSteps : steps;
|
|
98
100
|
interval = _TUtil.TUtil.isDefined(newInterval) ? newInterval : interval;
|
|
99
101
|
easing = _TUtil.TUtil.isDefined(newEasing) ? newEasing : easing;
|
|
100
|
-
|
|
102
|
+
cycles = _TUtil.TUtil.isDefined(newCycles) ? newCycles : cycles;
|
|
103
|
+
TargetExecutor.executeImperativeTarget(tmodel, key, newValue, steps, interval, easing, originalTargetName, originalTModel, cycles);
|
|
101
104
|
return;
|
|
102
105
|
} else if (_TargetParser.TargetParser.isObjectTarget(key, value)) {
|
|
103
106
|
var completeValue = _TargetData.TargetData.cssFunctionMap[key] ? _objectSpread(_objectSpread({}, _TargetData.TargetData.cssFunctionMap[key]), value) : value;
|
|
@@ -106,14 +109,16 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
106
109
|
var newSteps = steps;
|
|
107
110
|
var newInterval = interval;
|
|
108
111
|
var newEasing = easing;
|
|
112
|
+
var newCycles = cycles;
|
|
109
113
|
if (_typeof(newValue) === 'object' && !_TargetParser.TargetParser.isListTarget(newValue)) {
|
|
110
114
|
var _valueArray = _TargetParser.TargetParser.getValueStepsCycles(tmodel, completeValue[objectKey], objectKey);
|
|
111
115
|
newValue = _valueArray[0];
|
|
112
116
|
newSteps = _TUtil.TUtil.isDefined(_valueArray[1]) ? _valueArray[1] : steps;
|
|
113
117
|
newInterval = _TUtil.TUtil.isDefined(_valueArray[2]) ? _valueArray[2] : interval;
|
|
114
118
|
newEasing = _TUtil.TUtil.isDefined(_valueArray[3]) ? _valueArray[3] : easing;
|
|
119
|
+
newCycles = _TUtil.TUtil.isDefined(_valueArray[4]) ? _valueArray[4] : cycles;
|
|
115
120
|
}
|
|
116
|
-
TargetExecutor.executeImperativeTarget(tmodel, objectKey, newValue, newSteps, newInterval, newEasing, originalTargetName, originalTModel);
|
|
121
|
+
TargetExecutor.executeImperativeTarget(tmodel, objectKey, newValue, newSteps, newInterval, newEasing, originalTargetName, originalTModel, newCycles);
|
|
117
122
|
});
|
|
118
123
|
} else {
|
|
119
124
|
if (_typeof(value) === 'object' && !_TargetParser.TargetParser.isListTarget(value)) {
|
|
@@ -123,16 +128,19 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
123
128
|
steps = _TUtil.TUtil.isDefined(_valueArray2[1]) ? _valueArray2[1] : steps;
|
|
124
129
|
interval = _TUtil.TUtil.isDefined(_valueArray2[2]) ? _valueArray2[2] : interval;
|
|
125
130
|
easing = _TUtil.TUtil.isDefined(_valueArray2[3]) ? _valueArray2[3] : easing;
|
|
126
|
-
|
|
131
|
+
cycles = _TUtil.TUtil.isDefined(_valueArray2[4]) ? _valueArray2[4] : cycles;
|
|
132
|
+
TargetExecutor.executeImperativeTarget(tmodel, key, value, steps, interval, easing, originalTargetName, originalTModel, cycles);
|
|
127
133
|
} else {
|
|
128
|
-
targetValue = TargetExecutor.assignImperativeTargetValue(tmodel, key, originalTargetName, originalTModel);
|
|
129
|
-
TargetExecutor.assignSingleTarget(targetValue, value, undefined, steps,
|
|
134
|
+
targetValue = TargetExecutor.assignImperativeTargetValue(tmodel, key, originalTargetName, originalTModel, cycles);
|
|
135
|
+
TargetExecutor.assignSingleTarget(targetValue, value, undefined, steps, cycles, interval, easing);
|
|
130
136
|
targetValue.step = 0;
|
|
137
|
+
targetValue.cycle = 0;
|
|
131
138
|
}
|
|
132
139
|
} else {
|
|
133
|
-
targetValue = TargetExecutor.assignImperativeTargetValue(tmodel, key, originalTargetName, originalTModel);
|
|
134
|
-
TargetExecutor.assignSingleTarget(targetValue, value, undefined, steps,
|
|
140
|
+
targetValue = TargetExecutor.assignImperativeTargetValue(tmodel, key, originalTargetName, originalTModel, cycles);
|
|
141
|
+
TargetExecutor.assignSingleTarget(targetValue, value, undefined, steps, cycles, interval, easing);
|
|
135
142
|
targetValue.step = 0;
|
|
143
|
+
targetValue.cycle = 0;
|
|
136
144
|
}
|
|
137
145
|
}
|
|
138
146
|
if (targetValue) {
|
|
@@ -162,6 +170,7 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
162
170
|
key: "calculateTargetStatus",
|
|
163
171
|
value: function calculateTargetStatus(tmodel, targetValue, key) {
|
|
164
172
|
var _tmodel$targets$key;
|
|
173
|
+
var valuePointer = tmodel.getValueListPointer(key);
|
|
165
174
|
var cycle = tmodel.getTargetCycle(key);
|
|
166
175
|
var cycles = tmodel.getTargetCycles(key);
|
|
167
176
|
var step = tmodel.getTargetStep(key);
|
|
@@ -170,9 +179,9 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
170
179
|
return 'done';
|
|
171
180
|
} else if (step < steps) {
|
|
172
181
|
return 'updating';
|
|
173
|
-
} else if (Array.isArray(targetValue.valueList) &&
|
|
182
|
+
} else if (Array.isArray(targetValue.valueList) && valuePointer < targetValue.valueList.length - 1) {
|
|
174
183
|
return 'updating';
|
|
175
|
-
} else if (tmodel.isTargetInLoop(key) || cycle < cycles) {
|
|
184
|
+
} else if (tmodel.isTargetInLoop(key) || cycle < cycles - 1) {
|
|
176
185
|
return 'active';
|
|
177
186
|
} else if ((_tmodel$targets$key = tmodel.targets[key]) !== null && _tmodel$targets$key !== void 0 && _tmodel$targets$key.fetchAction && !(0, _App.getLoader)().isLoadingSuccessful(tmodel, key)) {
|
|
178
187
|
return 'fetching';
|
|
@@ -182,19 +191,19 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
182
191
|
}
|
|
183
192
|
}, {
|
|
184
193
|
key: "assignListTarget",
|
|
185
|
-
value: function assignListTarget(tmodel, key, targetValue, valueList, initialValue, steps, interval, easing) {
|
|
194
|
+
value: function assignListTarget(tmodel, key, targetValue, valueList, initialValue, steps, interval, easing, cycles) {
|
|
186
195
|
targetValue.valueList = valueList;
|
|
187
196
|
targetValue.stepList = Array.isArray(steps) ? steps : _TUtil.TUtil.isDefined(steps) && steps > 0 ? [steps] : [1];
|
|
188
197
|
targetValue.intervalList = Array.isArray(interval) ? interval : _TUtil.TUtil.isDefined(interval) ? [interval || 8] : [8];
|
|
189
198
|
targetValue.easingList = Array.isArray(easing) ? easing : _TUtil.TUtil.isDefined(easing) ? [easing] : [_Easing.Easing.LINEAR];
|
|
190
|
-
targetValue.
|
|
199
|
+
targetValue.cycles = cycles;
|
|
200
|
+
targetValue.valuePointer = 1;
|
|
191
201
|
targetValue.value = valueList[1];
|
|
192
202
|
targetValue.initialValue = initialValue;
|
|
193
203
|
targetValue.steps = targetValue.stepList[0];
|
|
194
204
|
targetValue.interval = targetValue.intervalList[0];
|
|
195
205
|
targetValue.easing = targetValue.easingList[0];
|
|
196
206
|
targetValue.step = 0;
|
|
197
|
-
targetValue.cycles = 0;
|
|
198
207
|
targetValue.snapAnimation = false;
|
|
199
208
|
tmodel.val(key, initialValue);
|
|
200
209
|
tmodel.setActual(key, initialValue);
|
|
@@ -206,11 +215,14 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
206
215
|
delete targetValue.stepList;
|
|
207
216
|
delete targetValue.intervalList;
|
|
208
217
|
delete targetValue.easingList;
|
|
218
|
+
if (_TUtil.TUtil.isDefined(targetValue.valuePointer)) {
|
|
219
|
+
targetValue.valuePointer = 0;
|
|
220
|
+
}
|
|
209
221
|
targetValue.initialValue = initialValue;
|
|
210
222
|
targetValue.lastValue = targetValue.value;
|
|
211
223
|
targetValue.value = value;
|
|
212
224
|
targetValue.steps = steps || 0;
|
|
213
|
-
targetValue.cycles = cycles ||
|
|
225
|
+
targetValue.cycles = cycles || 1;
|
|
214
226
|
targetValue.interval = interval || 0;
|
|
215
227
|
targetValue.easing = easing;
|
|
216
228
|
targetValue.snapAnimation = false;
|
|
@@ -242,12 +254,12 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
242
254
|
var newSteps = valueArray[1] || 0;
|
|
243
255
|
var newInterval = valueArray[2] || 0;
|
|
244
256
|
var newEasing = valueArray[3];
|
|
245
|
-
var newCycles = valueArray[4] ||
|
|
257
|
+
var newCycles = valueArray[4] || 1;
|
|
246
258
|
var targetValue = tmodel.targetValues[key] || _TargetUtil.TargetUtil.emptyValue();
|
|
247
259
|
tmodel.targetValues[key] = targetValue;
|
|
248
260
|
var easing = _TUtil.TUtil.isDefined(newEasing) ? newEasing : _TUtil.TUtil.isDefined(tmodel.targets[key].easing) ? tmodel.targets[key].easing : undefined;
|
|
249
261
|
if (_TargetParser.TargetParser.isIntervalTarget(newValue)) {
|
|
250
|
-
TargetExecutor.assignSingleTarget(targetValue, undefined, undefined, 0,
|
|
262
|
+
TargetExecutor.assignSingleTarget(targetValue, undefined, undefined, 0, 2, newValue.interval, easing);
|
|
251
263
|
} else if (_TargetParser.TargetParser.isChildTarget(key, newValue)) {
|
|
252
264
|
tmodel.addChild(newValue);
|
|
253
265
|
TargetExecutor.assignSingleTarget(targetValue, newValue, undefined, 0, newCycles, newInterval, easing);
|
|
@@ -278,7 +290,7 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
278
290
|
(0, _App.getLoader)().fetchImage(tmodel, newValue);
|
|
279
291
|
TargetExecutor.assignSingleTarget(targetValue, newValue, undefined, 0, newCycles, newInterval, easing);
|
|
280
292
|
} else if (_TargetParser.TargetParser.isListTarget(newValue)) {
|
|
281
|
-
TargetExecutor.assignListTarget(tmodel, key, targetValue, newValue.list, newValue.list[0], newSteps, newInterval, easing);
|
|
293
|
+
TargetExecutor.assignListTarget(tmodel, key, targetValue, newValue.list, newValue.list[0], newSteps, newInterval, easing, newCycles);
|
|
282
294
|
} else {
|
|
283
295
|
var _tmodel$targets$key$d, _tmodel$targets$key2;
|
|
284
296
|
if (newSteps > 0 && !_TUtil.TUtil.areEqual(tmodel.val(key), newValue, (_tmodel$targets$key$d = (_tmodel$targets$key2 = tmodel.targets[key]) === null || _tmodel$targets$key2 === void 0 ? void 0 : _tmodel$targets$key2.deepEquality) !== null && _tmodel$targets$key$d !== void 0 ? _tmodel$targets$key$d : false)) {
|
package/build/TargetManager.js
CHANGED
|
@@ -78,6 +78,7 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
78
78
|
tmodel.resetScheduleTimeStamp(key);
|
|
79
79
|
_TargetExecutor.TargetExecutor.prepareTarget(tmodel, key);
|
|
80
80
|
_TargetExecutor.TargetExecutor.executeDeclarativeTarget(tmodel, key);
|
|
81
|
+
_TargetUtil.TargetUtil.shouldActivateNextTarget(tmodel, key);
|
|
81
82
|
}
|
|
82
83
|
}, {
|
|
83
84
|
key: "setActualValues",
|
|
@@ -192,10 +193,15 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
192
193
|
originalTarget.onImperativeEnd.call(originalTModel, key, originalTModel.val(key));
|
|
193
194
|
originalTModel.setTargetMethodName(originalTargetName, "onImperativeEnd");
|
|
194
195
|
}
|
|
196
|
+
if (tmodel.getTargetCycle(key) < tmodel.getTargetCycles(key) - 1) {
|
|
197
|
+
tmodel.incrementTargetCycle(key);
|
|
198
|
+
tmodel.resetTargetStep(key);
|
|
199
|
+
tmodel.resetTargetInitialValue(key);
|
|
200
|
+
}
|
|
195
201
|
} else {
|
|
196
202
|
var _tmodel$targets$key;
|
|
197
|
-
if (
|
|
198
|
-
tmodel.incrementTargetCycle(key
|
|
203
|
+
if (tmodel.getTargetCycle(key) < tmodel.getTargetCycles(key) - 1) {
|
|
204
|
+
tmodel.incrementTargetCycle(key);
|
|
199
205
|
tmodel.resetTargetStep(key);
|
|
200
206
|
tmodel.resetTargetInitialValue(key);
|
|
201
207
|
tmodel.resetTargetExecutionFlag(key);
|
|
@@ -211,11 +217,14 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
211
217
|
}, {
|
|
212
218
|
key: "calculateTargetStatus",
|
|
213
219
|
value: function calculateTargetStatus(tmodel, targetValue, key) {
|
|
220
|
+
var valuePointer = tmodel.getValueListPointer(key);
|
|
214
221
|
var cycle = tmodel.getTargetCycle(key);
|
|
215
222
|
var cycles = tmodel.getTargetCycles(key);
|
|
216
|
-
if (Array.isArray(targetValue.valueList) &&
|
|
223
|
+
if (Array.isArray(targetValue.valueList) && valuePointer < targetValue.valueList.length) {
|
|
217
224
|
return 'updating';
|
|
218
|
-
} else if (tmodel.
|
|
225
|
+
} else if (tmodel.isTargetImperative(key) && cycle < cycles - 1) {
|
|
226
|
+
return 'updating';
|
|
227
|
+
} else if (tmodel.isTargetInLoop(key) || cycle < cycles - 1) {
|
|
219
228
|
return 'active';
|
|
220
229
|
} else {
|
|
221
230
|
return 'done';
|
|
@@ -223,8 +232,9 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
223
232
|
}
|
|
224
233
|
}, {
|
|
225
234
|
key: "handleWebAnimationAPI",
|
|
226
|
-
value: function handleWebAnimationAPI(tmodel, cleanKey, key, targetValue, from, to, steps, interval) {
|
|
235
|
+
value: function handleWebAnimationAPI(tmodel, cleanKey, key, targetValue, from, to, steps, interval, timeShift) {
|
|
227
236
|
var _batch$keyMap;
|
|
237
|
+
var skipStartFrame = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
228
238
|
var batch = tmodel.waapiBatch || (tmodel.waapiBatch = {
|
|
229
239
|
frames: [],
|
|
230
240
|
easing: undefined,
|
|
@@ -233,14 +243,15 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
233
243
|
});
|
|
234
244
|
var isTransform = _TargetData.TargetData.isTransformKey(cleanKey);
|
|
235
245
|
var getFrameAtTime = function getFrameAtTime(t) {
|
|
246
|
+
var shifted = t + timeShift;
|
|
236
247
|
for (var i = 0; i < batch.frames.length; i++) {
|
|
237
248
|
var _frame = batch.frames[i];
|
|
238
|
-
if (Math.abs(_frame.keyTime -
|
|
249
|
+
if (Math.abs(_frame.keyTime - shifted) < 0.0001) {
|
|
239
250
|
return _frame;
|
|
240
251
|
}
|
|
241
252
|
}
|
|
242
253
|
var frame = {
|
|
243
|
-
keyTime:
|
|
254
|
+
keyTime: shifted,
|
|
244
255
|
tfMap: {},
|
|
245
256
|
styleMap: {},
|
|
246
257
|
keyMeta: new Map()
|
|
@@ -254,13 +265,15 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
254
265
|
var stepList = targetValue.stepList || [1];
|
|
255
266
|
var intervalList = targetValue.intervalList;
|
|
256
267
|
var step = targetValue.step;
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
268
|
+
if (!skipStartFrame) {
|
|
269
|
+
var frame = getFrameAtTime(0);
|
|
270
|
+
if (isTransform) {
|
|
271
|
+
frame.tfMap[cleanKey] = step > 0 && _TUtil.TUtil.isDefined(tmodel.val(key)) ? tmodel.val(key) : valueList[0];
|
|
272
|
+
tmodel.val(key, frame.tfMap[cleanKey]);
|
|
273
|
+
} else {
|
|
274
|
+
frame.styleMap[cleanKey] = valueList[0];
|
|
275
|
+
tmodel.val(key, frame.styleMap[cleanKey]);
|
|
276
|
+
}
|
|
264
277
|
}
|
|
265
278
|
for (var i = 1; i < valueList.length; i++) {
|
|
266
279
|
var stepValue = stepList[(i - 1) % stepList.length];
|
|
@@ -278,17 +291,22 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
278
291
|
interval: intervalValue
|
|
279
292
|
});
|
|
280
293
|
}
|
|
281
|
-
targetValue.
|
|
294
|
+
targetValue.valuePointer = valueList.length;
|
|
282
295
|
} else {
|
|
283
296
|
interval = interval || 8;
|
|
284
297
|
keyDuration = steps * interval;
|
|
285
|
-
|
|
298
|
+
if (!skipStartFrame) {
|
|
299
|
+
var frame0 = getFrameAtTime(0);
|
|
300
|
+
if (isTransform) {
|
|
301
|
+
frame0.tfMap[cleanKey] = from;
|
|
302
|
+
} else {
|
|
303
|
+
frame0.styleMap[cleanKey] = from;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
286
306
|
var frame1 = getFrameAtTime(keyDuration);
|
|
287
307
|
if (isTransform) {
|
|
288
|
-
frame0.tfMap[cleanKey] = from;
|
|
289
308
|
frame1.tfMap[cleanKey] = to;
|
|
290
309
|
} else {
|
|
291
|
-
frame0.styleMap[cleanKey] = from;
|
|
292
310
|
frame1.styleMap[cleanKey] = to;
|
|
293
311
|
}
|
|
294
312
|
tmodel.val(key, from);
|
|
@@ -300,9 +318,10 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
300
318
|
if (tmodel.getTargetEasing(key)) {
|
|
301
319
|
batch.easing = tmodel.getTargetEasing(key);
|
|
302
320
|
}
|
|
303
|
-
batch.totalDuration = Math.max(batch.totalDuration, keyDuration);
|
|
321
|
+
batch.totalDuration = Math.max(batch.totalDuration, timeShift + keyDuration);
|
|
304
322
|
((_batch$keyMap = batch.keyMap)[cleanKey] || (_batch$keyMap[cleanKey] = new Set())).add(key);
|
|
305
323
|
tmodel.removeFromUpdatingTargets(key);
|
|
324
|
+
return keyDuration;
|
|
306
325
|
}
|
|
307
326
|
}, {
|
|
308
327
|
key: "setActualValue",
|
|
@@ -320,6 +339,7 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
320
339
|
var step = tmodel.getTargetStep(key);
|
|
321
340
|
var steps = tmodel.getTargetSteps(key);
|
|
322
341
|
var cycle = tmodel.getTargetCycle(key);
|
|
342
|
+
var valuePointer = tmodel.getValueListPointer(key);
|
|
323
343
|
var interval = tmodel.getTargetInterval(key);
|
|
324
344
|
var initialValue = tmodel.getTargetInitialValue(key);
|
|
325
345
|
var lastUpdateTime = tmodel.getLastUpdate(key);
|
|
@@ -330,7 +350,11 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
330
350
|
}
|
|
331
351
|
if (tmodel.canBeAnimated(cleanKey)) {
|
|
332
352
|
if (tmodel.hasDom()) {
|
|
333
|
-
|
|
353
|
+
var cycles = tmodel.isTargetImperative(key) ? tmodel.getTargetCycles(key) : 0;
|
|
354
|
+
var cycleDuration = this.handleWebAnimationAPI(tmodel, cleanKey, key, targetValue, initialValue, theValue, steps, interval, 0);
|
|
355
|
+
for (var c = 1; c < cycles; c++) {
|
|
356
|
+
this.handleWebAnimationAPI(tmodel, cleanKey, key, targetValue, initialValue, theValue, steps, interval, c * cycleDuration, true);
|
|
357
|
+
}
|
|
334
358
|
}
|
|
335
359
|
return;
|
|
336
360
|
}
|
|
@@ -353,15 +377,15 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
353
377
|
tmodel.setLastUpdate(key);
|
|
354
378
|
step = steps;
|
|
355
379
|
var scheduleTime = 1;
|
|
356
|
-
if (targetValue.valueList &&
|
|
357
|
-
tmodel.
|
|
358
|
-
|
|
380
|
+
if (targetValue.valueList && valuePointer < targetValue.valueList.length) {
|
|
381
|
+
tmodel.incrementValueListPointer(key);
|
|
382
|
+
valuePointer = tmodel.getValueListPointer(key);
|
|
359
383
|
tmodel.resetTargetStep(key);
|
|
360
384
|
targetValue.initialValue = targetValue.value;
|
|
361
|
-
targetValue.value = targetValue.valueList[
|
|
362
|
-
targetValue.steps = targetValue.stepList[(
|
|
363
|
-
targetValue.interval = Array.isArray(targetValue.intervalList) ? targetValue.intervalList[(
|
|
364
|
-
targetValue.easing = targetValue.easingList[(
|
|
385
|
+
targetValue.value = targetValue.valueList[valuePointer];
|
|
386
|
+
targetValue.steps = targetValue.stepList[(valuePointer - 1) % targetValue.stepList.length];
|
|
387
|
+
targetValue.interval = Array.isArray(targetValue.intervalList) ? targetValue.intervalList[(valuePointer - 1) % targetValue.intervalList.length] : 0;
|
|
388
|
+
targetValue.easing = targetValue.easingList[(valuePointer - 1) % targetValue.easingList.length];
|
|
365
389
|
scheduleTime = interval;
|
|
366
390
|
} else {
|
|
367
391
|
this.fireOnEnd(tmodel, key);
|
package/build/TargetParser.js
CHANGED
|
@@ -225,7 +225,7 @@ var TargetParser = exports.TargetParser = /*#__PURE__*/function () {
|
|
|
225
225
|
steps = 0,
|
|
226
226
|
interval = 0,
|
|
227
227
|
easing = undefined,
|
|
228
|
-
cycles =
|
|
228
|
+
cycles = 1;
|
|
229
229
|
var resolveMaybeFn = function resolveMaybeFn(v) {
|
|
230
230
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
231
231
|
args[_key - 1] = arguments[_key];
|
|
@@ -268,7 +268,7 @@ var TargetParser = exports.TargetParser = /*#__PURE__*/function () {
|
|
|
268
268
|
steps = _TUtil.TUtil.isDefined(target.steps) ? resolveMaybeFn(target.steps, cycle) : 0;
|
|
269
269
|
interval = _TUtil.TUtil.isDefined(target.interval) ? resolveMaybeFn(target.interval, cycle) : 8;
|
|
270
270
|
easing = _TUtil.TUtil.isDefined(target.easing) ? resolveMaybeFn(target.easing, cycle) : easing;
|
|
271
|
-
cycles = _TUtil.TUtil.isDefined(target.cycles) ? resolveMaybeFn(target.cycles, cycle, tmodel.getTargetCycles(key)) :
|
|
271
|
+
cycles = _TUtil.TUtil.isDefined(target.cycles) ? resolveMaybeFn(target.cycles, cycle, tmodel.getTargetCycles(key)) : 1;
|
|
272
272
|
return [value, steps, interval, easing, cycles];
|
|
273
273
|
} else if (_typeof(valueResult) === 'object' && _TUtil.TUtil.isDefined(valueResult.value) && _TUtil.TUtil.isDefined(valueResult.steps)) {
|
|
274
274
|
return getValue(valueResult);
|
|
@@ -278,7 +278,7 @@ var TargetParser = exports.TargetParser = /*#__PURE__*/function () {
|
|
|
278
278
|
interval = _TUtil.TUtil.isDefined(target.interval) ? resolveMaybeFn(target.interval, cycle) : 0;
|
|
279
279
|
easing = _TUtil.TUtil.isDefined(target.easing) ? resolveMaybeFn(target.easing, cycle) : easing; // keep prior easing if not supplied
|
|
280
280
|
|
|
281
|
-
cycles = _TUtil.TUtil.isDefined(target.cycles) ? resolveMaybeFn(target.cycles, cycle, tmodel.getTargetCycles(key)) :
|
|
281
|
+
cycles = _TUtil.TUtil.isDefined(target.cycles) ? resolveMaybeFn(target.cycles, cycle, tmodel.getTargetCycles(key)) : 1;
|
|
282
282
|
return Array.isArray(value) ? getValue(value) : [value, steps, interval, easing, cycles];
|
|
283
283
|
}
|
|
284
284
|
|