targetj 1.1.0 → 1.1.1
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/AnimationManager.js +220 -152
- package/build/AnimationUtil.js +0 -1
- package/build/App.js +79 -39
- package/build/BaseModel.js +43 -11
- package/build/Easing.js +5 -0
- package/build/EventListener.js +29 -9
- package/build/HtmlToCanvas.js +411 -0
- package/build/LocationManager.js +44 -14
- package/build/PageManager.js +84 -33
- package/build/ParticleChild.js +12 -11
- package/build/ParticleExplode.js +360 -0
- package/build/ParticleRenderer.js +669 -188
- package/build/ParticleRuntime.js +844 -311
- package/build/ParticleTModel.js +362 -174
- package/build/ParticleUtil.js +2 -2
- package/build/RunScheduler.js +13 -8
- package/build/StateManager.js +125 -33
- package/build/StateUtil.js +141 -82
- package/build/TModel.js +171 -72
- package/build/TModelManager.js +51 -43
- package/build/TModelUtil.js +230 -143
- package/build/TUtil.js +4 -4
- package/build/TargetData.js +20 -12
- package/build/TargetExecutor.js +37 -14
- package/build/TargetManager.js +13 -18
- package/build/TargetParser.js +36 -2
- package/build/TargetUtil.js +189 -128
- package/dist/targetjs.js +1 -1
- package/dist/targetjs.js.gz +0 -0
- package/package.json +1 -1
package/build/TargetData.js
CHANGED
|
@@ -41,8 +41,7 @@ var TargetData = /*#__PURE__*/function () {
|
|
|
41
41
|
isIncluded: true,
|
|
42
42
|
bracketThreshold: 40,
|
|
43
43
|
bracketSize: 2,
|
|
44
|
-
preventDefault: undefined
|
|
45
|
-
canDeleteDom: undefined
|
|
44
|
+
preventDefault: undefined
|
|
46
45
|
};
|
|
47
46
|
}
|
|
48
47
|
}, {
|
|
@@ -74,9 +73,15 @@ var TargetData = /*#__PURE__*/function () {
|
|
|
74
73
|
key = TargetUtil.getTargetName(key);
|
|
75
74
|
return ["x", "y", "width", "height", "dim"].includes(TargetUtil.getTargetName(key));
|
|
76
75
|
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "requiresDom",
|
|
78
|
+
value: function requiresDom(targetName) {
|
|
79
|
+
return TargetData.onDomTargets.has(targetName);
|
|
80
|
+
}
|
|
77
81
|
}]);
|
|
78
82
|
}();
|
|
79
83
|
_TargetData = TargetData;
|
|
84
|
+
_defineProperty(TargetData, "onDomTargets", new Set(["explodeChildren"]));
|
|
80
85
|
_defineProperty(TargetData, "transformOrder", {
|
|
81
86
|
perspective: 0,
|
|
82
87
|
translateX: 1,
|
|
@@ -195,6 +200,7 @@ _defineProperty(TargetData, "asyncStyleTargetMap", {
|
|
|
195
200
|
alignItems: true,
|
|
196
201
|
display: true,
|
|
197
202
|
cursor: true,
|
|
203
|
+
pointerEvents: true,
|
|
198
204
|
fontFamily: true,
|
|
199
205
|
overflow: true,
|
|
200
206
|
overflowX: true,
|
|
@@ -205,11 +211,14 @@ _defineProperty(TargetData, "asyncStyleTargetMap", {
|
|
|
205
211
|
willChange: true,
|
|
206
212
|
backgroundImage: true,
|
|
207
213
|
backgroundSize: true,
|
|
214
|
+
backgroundPosition: true,
|
|
215
|
+
backgroundRepeat: true,
|
|
208
216
|
flexWrap: true,
|
|
209
217
|
userSelect: true,
|
|
210
218
|
outline: true,
|
|
211
219
|
backfaceVisibility: true,
|
|
212
|
-
filter: true
|
|
220
|
+
filter: true,
|
|
221
|
+
whiteSpace: true
|
|
213
222
|
});
|
|
214
223
|
_defineProperty(TargetData, "scaleMap", {
|
|
215
224
|
scale: true,
|
|
@@ -263,8 +272,7 @@ _defineProperty(TargetData, "mustExecuteTargets", {
|
|
|
263
272
|
widthFromDom: true,
|
|
264
273
|
fetch: true,
|
|
265
274
|
fetchImage: true,
|
|
266
|
-
isVisible: true
|
|
267
|
-
canDeleteDom: true
|
|
275
|
+
isVisible: true
|
|
268
276
|
});
|
|
269
277
|
_defineProperty(TargetData, "ignoreRerun", {
|
|
270
278
|
isVisible: true
|
|
@@ -304,8 +312,7 @@ _defineProperty(TargetData, "controlTargetMap", {
|
|
|
304
312
|
styling: true,
|
|
305
313
|
reuseDomDefinition: true,
|
|
306
314
|
useWindowFrame: true,
|
|
307
|
-
|
|
308
|
-
onDomEvent: true,
|
|
315
|
+
onDomReady: true,
|
|
309
316
|
canHaveDom: true
|
|
310
317
|
});
|
|
311
318
|
_defineProperty(TargetData, "events", {
|
|
@@ -737,6 +744,8 @@ _defineProperty(TargetData, "attributesToTargets", {
|
|
|
737
744
|
backgroundcolor: 'backgroundColor',
|
|
738
745
|
backgroundimage: 'backgroundImage',
|
|
739
746
|
backgroundsize: 'backgroundSize',
|
|
747
|
+
backgroundposition: 'backgroundPosition',
|
|
748
|
+
backgroundrepeat: 'backgroundRepeat',
|
|
740
749
|
bordertop: 'borderTop',
|
|
741
750
|
borderleft: 'borderLeft',
|
|
742
751
|
borderright: 'borderRight',
|
|
@@ -779,7 +788,9 @@ _defineProperty(TargetData, "attributesToTargets", {
|
|
|
779
788
|
ariacurrent: 'ariaCurrent',
|
|
780
789
|
ariapressed: 'ariaPressed',
|
|
781
790
|
tabindex: 'tabIndex',
|
|
782
|
-
backfacevisibility: 'backfaceVisibility'
|
|
791
|
+
backfacevisibility: 'backfaceVisibility',
|
|
792
|
+
whitespace: 'whiteSpace',
|
|
793
|
+
pointerevents: 'pointerEvents'
|
|
783
794
|
});
|
|
784
795
|
_defineProperty(TargetData, "targetToEventsMapping", {
|
|
785
796
|
onStart: ['touchStart', 'mouseStart'],
|
|
@@ -811,9 +822,6 @@ _defineProperty(TargetData, "targetToEventsMapping", {
|
|
|
811
822
|
onSubmit: ['submitEvents']
|
|
812
823
|
});
|
|
813
824
|
_defineProperty(TargetData, "internalEventMap", {
|
|
814
|
-
onDomEvent: function onDomEvent(tmodel) {
|
|
815
|
-
return tmodel.hasDomNow;
|
|
816
|
-
},
|
|
817
825
|
onVisible: function onVisible(tmodel) {
|
|
818
826
|
return tmodel.isNowVisible;
|
|
819
827
|
},
|
|
@@ -929,6 +937,6 @@ _defineProperty(TargetData, "lifecyclePatterns", {
|
|
|
929
937
|
});
|
|
930
938
|
_defineProperty(TargetData, "eventSet", new Set([].concat(_toConsumableArray(Object.keys(_TargetData.allEventMap)), _toConsumableArray(Object.keys(_TargetData.internalEventMap)))));
|
|
931
939
|
_defineProperty(TargetData, "styleSet", new Set([].concat(_toConsumableArray(Object.keys(_TargetData.styleTargetMap)), _toConsumableArray(Object.keys(_TargetData.asyncStyleTargetMap)), _toConsumableArray(Object.keys(_TargetData.attributeTargetMap)))));
|
|
932
|
-
_defineProperty(TargetData, "reservedKeywordSet", new Set([].concat(_toConsumableArray(_TargetData.styleSet), _toConsumableArray(Object.keys(_TargetData.defaultActualValues())), _toConsumableArray(Object.keys(_TargetData.allEventMap)), _toConsumableArray(Object.keys(_TargetData.internalEventMap)), _toConsumableArray(Object.keys(_TargetData.mustExecuteTargets)), ['children', 'addChildren', '
|
|
940
|
+
_defineProperty(TargetData, "reservedKeywordSet", new Set([].concat(_toConsumableArray(_TargetData.styleSet), _toConsumableArray(Object.keys(_TargetData.defaultActualValues())), _toConsumableArray(Object.keys(_TargetData.allEventMap)), _toConsumableArray(Object.keys(_TargetData.internalEventMap)), _toConsumableArray(Object.keys(_TargetData.mustExecuteTargets)), ['children', 'addChildren', 'explodeChildren', 'html', 'isInFlow', 'domHolder', 'domParent', 'gap', 'widthFromDom', 'heightFromDom', 'preventDefault', 'textOnly', 'styling', '$dom', 'defaultStyling', 'reuseDomDefinition', 'canHaveDom', 'excludeXYCalc', 'excludeX', 'excludeY', 'containerOverflowMode', 'itemOverflowMode', 'baseElement', 'element', 'otype', 'calculateChildren', 'domIsland', 'bracketThreshold', 'bracketSize', 'shouldBeBracketed', 'sourceDom'])));
|
|
933
941
|
_defineProperty(TargetData, "activationKeywordSet", new Set(['originalTModel', 'originalTargetName', 'activateNextTarget']));
|
|
934
942
|
export { TargetData };
|
package/build/TargetExecutor.js
CHANGED
|
@@ -195,7 +195,6 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
195
195
|
}, {
|
|
196
196
|
key: "calculateTargetStatus",
|
|
197
197
|
value: function calculateTargetStatus(tmodel, targetValue, key) {
|
|
198
|
-
var _tmodel$targets$key;
|
|
199
198
|
var valuePointer = tmodel.getValueListPointer(key);
|
|
200
199
|
var cycle = tmodel.getTargetCycle(key);
|
|
201
200
|
var cycles = tmodel.getTargetCycles(key);
|
|
@@ -209,7 +208,7 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
209
208
|
return 'updating';
|
|
210
209
|
} else if (tmodel.isTargetInLoop(key) || cycle < cycles - 1) {
|
|
211
210
|
return 'active';
|
|
212
|
-
} else if ((
|
|
211
|
+
} else if (TargetUtil.hasFetchAction(tmodel, key) && !getLoader().isLoadingSuccessful(tmodel, key)) {
|
|
213
212
|
return 'fetching';
|
|
214
213
|
} else {
|
|
215
214
|
return 'done';
|
|
@@ -325,12 +324,16 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
325
324
|
}
|
|
326
325
|
var targetInitial = !tmodel.targetValues[key] && TUtil.isDefined(tmodel.targets[key].initialValue) ? tmodel.targets[key].initialValue : undefined;
|
|
327
326
|
var target = tmodel.targets[key];
|
|
328
|
-
var
|
|
327
|
+
var isExplodeChildren = TargetParser.isExplodeChildrenTarget(key);
|
|
328
|
+
var hasInstances = !isExplodeChildren && target && _typeof(target) === "object" && TUtil.isDefined(target.instances);
|
|
329
329
|
var instances = hasInstances ? TargetParser.getTargetInstances(tmodel, key, target, cycle) : 1;
|
|
330
|
+
var valueTarget = isExplodeChildren && typeof (target === null || target === void 0 ? void 0 : target.value) === "function" ? _objectSpread(_objectSpread({}, target), {}, {
|
|
331
|
+
value: {}
|
|
332
|
+
}) : target;
|
|
330
333
|
var valueArray;
|
|
331
334
|
if (hasInstances) {
|
|
332
335
|
var values = new Array(instances);
|
|
333
|
-
valueArray = TargetParser.getValueStepsCycles(tmodel, key,
|
|
336
|
+
valueArray = TargetParser.getValueStepsCycles(tmodel, key, valueTarget, cycle, 0);
|
|
334
337
|
values[0] = valueArray[0];
|
|
335
338
|
valueArray[0] = values;
|
|
336
339
|
var lastValues = tmodel.val(key);
|
|
@@ -339,7 +342,7 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
339
342
|
values[instance] = TargetParser.getInstanceTargetValue(tmodel, key, target, cycle, lastValue, instance);
|
|
340
343
|
}
|
|
341
344
|
} else {
|
|
342
|
-
valueArray = TargetParser.getValueStepsCycles(tmodel, key,
|
|
345
|
+
valueArray = TargetParser.getValueStepsCycles(tmodel, key, valueTarget, cycle);
|
|
343
346
|
}
|
|
344
347
|
var newValue = valueArray[0];
|
|
345
348
|
var newSteps = valueArray[1] || 0;
|
|
@@ -358,14 +361,32 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
358
361
|
interval: newInterval,
|
|
359
362
|
easing: easing
|
|
360
363
|
})) {
|
|
361
|
-
var _options$
|
|
364
|
+
var _options$cycles, _options$interval, _options$easing;
|
|
362
365
|
var options = specialTarget === true ? {} : specialTarget;
|
|
363
|
-
TargetExecutor.assignSingleTarget(targetValue, newValue, undefined,
|
|
366
|
+
TargetExecutor.assignSingleTarget(targetValue, newValue, undefined, 0, (_options$cycles = options.cycles) !== null && _options$cycles !== void 0 ? _options$cycles : newCycles, (_options$interval = options.interval) !== null && _options$interval !== void 0 ? _options$interval : newInterval, (_options$easing = options.easing) !== null && _options$easing !== void 0 ? _options$easing : easing);
|
|
364
367
|
} else if (TargetParser.isChildTarget(key, newValue)) {
|
|
365
368
|
tmodel.addChild(newValue);
|
|
366
369
|
TargetExecutor.assignSingleTarget(targetValue, newValue, undefined, 0, newCycles, newInterval, easing);
|
|
370
|
+
} else if (TargetParser.isExplodeChildrenTarget(key)) {
|
|
371
|
+
var _target$renderer, _options$steps, _options$cycles2, _options$interval2, _options$easing2;
|
|
372
|
+
var definition = typeof (target === null || target === void 0 ? void 0 : target.value) === "function" ? {} : TargetParser.getExplodeChildrenDefinition(newValue === target ? undefined : newValue);
|
|
373
|
+
if (typeof tmodel.createExplodeChildren !== "function") {
|
|
374
|
+
throw new Error("explodeChildren requires a createExplodeChildren() implementation on the TModel.");
|
|
375
|
+
}
|
|
376
|
+
var result = tmodel.createExplodeChildren(key, definition, {
|
|
377
|
+
renderer: (_target$renderer = target === null || target === void 0 ? void 0 : target.renderer) !== null && _target$renderer !== void 0 ? _target$renderer : "gpu",
|
|
378
|
+
steps: newSteps,
|
|
379
|
+
cycles: newCycles,
|
|
380
|
+
interval: newInterval,
|
|
381
|
+
easing: easing
|
|
382
|
+
});
|
|
383
|
+
if (result === false) {
|
|
384
|
+
throw new Error("explodeChildren could not create its fragment children.");
|
|
385
|
+
}
|
|
386
|
+
var _options = result && _typeof(result) === "object" ? result : {};
|
|
387
|
+
TargetExecutor.assignSingleTarget(targetValue, definition, undefined, (_options$steps = _options.steps) !== null && _options$steps !== void 0 ? _options$steps : 0, (_options$cycles2 = _options.cycles) !== null && _options$cycles2 !== void 0 ? _options$cycles2 : newCycles, (_options$interval2 = _options.interval) !== null && _options$interval2 !== void 0 ? _options$interval2 : newInterval, (_options$easing2 = _options.easing) !== null && _options$easing2 !== void 0 ? _options$easing2 : easing);
|
|
367
388
|
} else if (TargetParser.isChildrenTarget(key, newValue)) {
|
|
368
|
-
var
|
|
389
|
+
var _options2$steps, _options2$cycles, _options2$interval, _options2$easing;
|
|
369
390
|
var _values = Array.isArray(newValue) ? newValue : newValue ? [newValue] : [];
|
|
370
391
|
_values.forEach(function (child) {
|
|
371
392
|
var addedChildrenCount = tmodel.addedChildren.length;
|
|
@@ -375,14 +396,14 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
375
396
|
TargetUtil.markAddChild(tmodel, TargetUtil.currentTargetName, addedChild);
|
|
376
397
|
}
|
|
377
398
|
});
|
|
378
|
-
var
|
|
399
|
+
var _result = tmodel.finalizeChildrenTarget(key, {
|
|
379
400
|
steps: newSteps,
|
|
380
401
|
cycles: newCycles,
|
|
381
402
|
interval: newInterval,
|
|
382
403
|
easing: easing
|
|
383
404
|
});
|
|
384
|
-
var
|
|
385
|
-
TargetExecutor.assignSingleTarget(targetValue, newValue, undefined, (
|
|
405
|
+
var _options2 = _result && _typeof(_result) === "object" ? _result : {};
|
|
406
|
+
TargetExecutor.assignSingleTarget(targetValue, newValue, undefined, (_options2$steps = _options2.steps) !== null && _options2$steps !== void 0 ? _options2$steps : 0, (_options2$cycles = _options2.cycles) !== null && _options2$cycles !== void 0 ? _options2$cycles : newCycles, (_options2$interval = _options2.interval) !== null && _options2$interval !== void 0 ? _options2$interval : newInterval, (_options2$easing = _options2.easing) !== null && _options2$easing !== void 0 ? _options2$easing : easing);
|
|
386
407
|
} else if (TargetParser.isChildObjectTarget(key, tmodel.targets[key])) {
|
|
387
408
|
var child = TargetExecutor.createTModel(key, tmodel.targets[key]);
|
|
388
409
|
tmodel.addChild(child);
|
|
@@ -393,7 +414,7 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
393
414
|
}));
|
|
394
415
|
TargetExecutor.assignSingleTarget(targetValue, filteredValue, undefined, 0, newCycles, newInterval, easing);
|
|
395
416
|
} else if (_typeof(newValue) === 'object' && newValue.asChild === true) {
|
|
396
|
-
var _child =
|
|
417
|
+
var _child = TargetExecutor.createTModel(key, newValue);
|
|
397
418
|
tmodel.addChild(_child);
|
|
398
419
|
TargetExecutor.assignSingleTarget(targetValue, newValue, undefined, 0, newCycles, newInterval, easing);
|
|
399
420
|
} else if (TargetParser.isFetchTarget(key, newValue)) {
|
|
@@ -405,8 +426,8 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
405
426
|
} else if (TargetParser.isListTarget(newValue)) {
|
|
406
427
|
TargetExecutor.assignListTarget(tmodel, key, targetValue, newValue.list, newValue.list[0], newSteps, newInterval, easing, newCycles);
|
|
407
428
|
} else {
|
|
408
|
-
var _tmodel$targets$key$d, _tmodel$targets$
|
|
409
|
-
if (newSteps > 0 && !TUtil.areEqual(tmodel.val(key), newValue, (_tmodel$targets$key$d = (_tmodel$targets$
|
|
429
|
+
var _tmodel$targets$key$d, _tmodel$targets$key;
|
|
430
|
+
if (newSteps > 0 && !TUtil.areEqual(tmodel.val(key), newValue, (_tmodel$targets$key$d = (_tmodel$targets$key = tmodel.targets[key]) === null || _tmodel$targets$key === void 0 ? void 0 : _tmodel$targets$key.deepEquality) !== null && _tmodel$targets$key$d !== void 0 ? _tmodel$targets$key$d : false)) {
|
|
410
431
|
tmodel.resetTargetStep(key);
|
|
411
432
|
}
|
|
412
433
|
TargetExecutor.assignSingleTarget(targetValue, newValue, targetInitial, newSteps, newCycles, newInterval, easing);
|
|
@@ -415,6 +436,8 @@ var TargetExecutor = /*#__PURE__*/function () {
|
|
|
415
436
|
}, {
|
|
416
437
|
key: "createTModel",
|
|
417
438
|
value: function createTModel(key, targets) {
|
|
439
|
+
var _key;
|
|
440
|
+
key = (_key = key) === null || _key === void 0 ? void 0 : _key.replace(/\${1,2}$/, '');
|
|
418
441
|
return TModelFactory.create(key, targets, function (type, targets) {
|
|
419
442
|
return new TModel(type, targets);
|
|
420
443
|
});
|
package/build/TargetManager.js
CHANGED
|
@@ -77,7 +77,7 @@ var TargetManager = /*#__PURE__*/function () {
|
|
|
77
77
|
tmodel.resetScheduleTimeStamp(key);
|
|
78
78
|
TargetExecutor.prepareTarget(tmodel, key);
|
|
79
79
|
TargetExecutor.executeDeclarativeTarget(tmodel, key);
|
|
80
|
-
if (!
|
|
80
|
+
if (!TargetUtil.hasFetchAction(tmodel, key)) {
|
|
81
81
|
TargetUtil.shouldActivateNextTarget(tmodel, key);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -99,7 +99,7 @@ var TargetManager = /*#__PURE__*/function () {
|
|
|
99
99
|
}
|
|
100
100
|
schedulePeriod = ScheduleUtil.scheduleExecution(tmodel, key);
|
|
101
101
|
if (schedulePeriod > 0) {
|
|
102
|
-
getRunScheduler().
|
|
102
|
+
getRunScheduler().scheduleOnlyIfEarlier(schedulePeriod, "setActualValues-".concat(tmodel.oid, "-").concat(key));
|
|
103
103
|
} else {
|
|
104
104
|
tmodel.resetScheduleTimeStamp(key);
|
|
105
105
|
this.setActualValue(tmodel, key);
|
|
@@ -225,26 +225,15 @@ var TargetManager = /*#__PURE__*/function () {
|
|
|
225
225
|
}, {
|
|
226
226
|
key: "calculateTargetStatus",
|
|
227
227
|
value: function calculateTargetStatus(tmodel, key) {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
return;
|
|
228
|
+
if (TargetUtil.isTargetUpdating(tmodel, key)) {
|
|
229
|
+
return 'updating';
|
|
231
230
|
}
|
|
232
|
-
var valuePointer = tmodel.getValueListPointer(key);
|
|
233
231
|
var cycle = tmodel.getTargetCycle(key);
|
|
234
232
|
var cycles = tmodel.getTargetCycles(key);
|
|
235
|
-
|
|
236
|
-
var steps = tmodel.getTargetSteps(key);
|
|
237
|
-
if (Array.isArray(targetValue.valueList) && valuePointer < targetValue.valueList.length) {
|
|
238
|
-
return 'updating';
|
|
239
|
-
} else if (tmodel.isTargetImperative(key) && cycle < cycles - 1) {
|
|
240
|
-
return 'updating';
|
|
241
|
-
} else if (step < steps) {
|
|
242
|
-
return 'updating';
|
|
243
|
-
} else if (tmodel.isTargetInLoop(key) || cycle < cycles - 1) {
|
|
233
|
+
if (tmodel.isTargetInLoop(key) || cycle < cycles - 1) {
|
|
244
234
|
return 'active';
|
|
245
|
-
} else {
|
|
246
|
-
return 'done';
|
|
247
235
|
}
|
|
236
|
+
return 'done';
|
|
248
237
|
}
|
|
249
238
|
}, {
|
|
250
239
|
key: "catchupTargetByElapsed",
|
|
@@ -381,13 +370,19 @@ var TargetManager = /*#__PURE__*/function () {
|
|
|
381
370
|
}, {
|
|
382
371
|
key: "animateActualValue",
|
|
383
372
|
value: function animateActualValue(tmodel, key, targetValue, state, step, valuePointer) {
|
|
373
|
+
var _targetValue$valueLis5;
|
|
384
374
|
if (!tmodel.hasDom()) {
|
|
385
375
|
tmodel.addToNoDomUpdatingTargets(key);
|
|
386
376
|
return;
|
|
387
377
|
}
|
|
388
378
|
var newValue = step > 0 ? TModelUtil.easingMorph(tmodel, key, state.initialValue, state.theValue, step, state.steps) : state.initialValue;
|
|
389
|
-
var cycles = tmodel.isTargetImperative(key) ? tmodel.getTargetCycles(key) : 0;
|
|
390
379
|
var cycleDuration = AnimationUtil.handleWebAnimationAPI(tmodel, state.cleanKey, key, targetValue, newValue, state.theValue, valuePointer, step, state.steps, state.interval, 0, false, true);
|
|
380
|
+
|
|
381
|
+
// AnimationUtil already expands all cycles for value lists.
|
|
382
|
+
if ((_targetValue$valueLis5 = targetValue.valueList) !== null && _targetValue$valueLis5 !== void 0 && _targetValue$valueLis5.length) {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
var cycles = tmodel.isTargetImperative(key) ? tmodel.getTargetCycles(key) : 1;
|
|
391
386
|
for (var c = 1; c < cycles; c++) {
|
|
392
387
|
AnimationUtil.handleWebAnimationAPI(tmodel, state.cleanKey, key, targetValue, newValue, state.theValue, valuePointer, step, state.steps, state.interval, c * cycleDuration, true, false);
|
|
393
388
|
}
|
package/build/TargetParser.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
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
|
+
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
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
1
7
|
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); }
|
|
2
8
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
9
|
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); } }
|
|
@@ -27,8 +33,11 @@ var TargetParser = /*#__PURE__*/function () {
|
|
|
27
33
|
key: "hasLifecycle",
|
|
28
34
|
value: function hasLifecycle(object) {
|
|
29
35
|
for (var key in object) {
|
|
30
|
-
|
|
31
|
-
if (
|
|
36
|
+
// Event handlers are not target lifecycle callbacks.
|
|
37
|
+
if (TargetData.eventSet.has(key)) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (typeof object[key] === 'function' && TargetData.isLifeCycleMethod(key)) {
|
|
32
41
|
return true;
|
|
33
42
|
}
|
|
34
43
|
}
|
|
@@ -324,6 +333,31 @@ var TargetParser = /*#__PURE__*/function () {
|
|
|
324
333
|
}
|
|
325
334
|
return getValue(_target);
|
|
326
335
|
}
|
|
336
|
+
}, {
|
|
337
|
+
key: "getInitialTargetValue",
|
|
338
|
+
value: function getInitialTargetValue(tmodel, key, target) {
|
|
339
|
+
var cycle = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
340
|
+
if (typeof target === "function") {
|
|
341
|
+
return TargetParser.getInitialTargetValue(tmodel, key, target.call(tmodel, cycle, tmodel.val(key)), cycle);
|
|
342
|
+
}
|
|
343
|
+
if (TargetParser.isPlainObject(target)) {
|
|
344
|
+
if (TUtil.isDefined(target.initialValue)) {
|
|
345
|
+
return TargetParser.getInitialTargetValue(tmodel, key, target.initialValue, cycle);
|
|
346
|
+
}
|
|
347
|
+
if (typeof target.value === "function") {
|
|
348
|
+
return TargetParser.getInitialTargetValue(tmodel, key, target.value.call(tmodel, cycle, tmodel.val(key)), cycle);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
var _TargetParser$getValu = TargetParser.getValueStepsCycles(tmodel, key, target, cycle),
|
|
352
|
+
_TargetParser$getValu2 = _slicedToArray(_TargetParser$getValu, 1),
|
|
353
|
+
value = _TargetParser$getValu2[0];
|
|
354
|
+
return TargetParser.isListTarget(value) ? value.list[0] : value;
|
|
355
|
+
}
|
|
356
|
+
}, {
|
|
357
|
+
key: "isExplodeChildrenTarget",
|
|
358
|
+
value: function isExplodeChildrenTarget(key) {
|
|
359
|
+
return TargetUtil.getTargetName(key) === "explodeChildren";
|
|
360
|
+
}
|
|
327
361
|
}]);
|
|
328
362
|
}();
|
|
329
363
|
export { TargetParser };
|