targetj 1.0.228 → 1.0.230
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 +17 -17
- package/build/AnimationManager.js +39 -31
- package/build/BaseModel.js +5 -3
- package/build/Bracket.js +9 -18
- package/build/BracketGenerator.js +22 -1
- package/build/LoadingManager.js +2 -6
- package/build/LocationManager.js +19 -27
- package/build/TModel.js +14 -12
- package/build/TModelManager.js +55 -15
- package/build/TUtil.js +90 -35
- package/build/TargetData.js +8 -2
- package/build/TargetExecutor.js +8 -5
- package/build/TargetManager.js +2 -2
- package/build/TargetParser.js +3 -2
- package/build/TargetUtil.js +7 -2
- package/dist/targetjs.js +1 -1
- package/dist/targetjs.js.gz +0 -0
- package/package.json +1 -1
package/build/TModelManager.js
CHANGED
|
@@ -85,6 +85,7 @@ var TModelManager = exports.TModelManager = /*#__PURE__*/function () {
|
|
|
85
85
|
var _this = this;
|
|
86
86
|
var lastVisibleMap = _objectSpread({}, this.visibleOidMap);
|
|
87
87
|
this.clearFrameLists();
|
|
88
|
+
var activated = [];
|
|
88
89
|
var _iterator = _createForOfIteratorHelper((0, _App.getLocationManager)().hasLocationList),
|
|
89
90
|
_step;
|
|
90
91
|
try {
|
|
@@ -105,16 +106,31 @@ var TModelManager = exports.TModelManager = /*#__PURE__*/function () {
|
|
|
105
106
|
} else {
|
|
106
107
|
delete this.visibleOidMap[tmodel.oid];
|
|
107
108
|
}
|
|
109
|
+
var keepDom = this.shouldPreserveDom(tmodel);
|
|
110
|
+
if (keepDom) {
|
|
111
|
+
this.visibleOidMap[tmodel.oid] = tmodel;
|
|
112
|
+
}
|
|
108
113
|
if (tmodel.hasDom()) {
|
|
109
|
-
if (!tmodel.canHaveDom() || !tmodel.isIncluded() || tmodel.canDeleteDom() && !visible) {
|
|
114
|
+
if (!tmodel.canHaveDom() || !tmodel.isIncluded() || tmodel.canDeleteDom() && !visible && !keepDom) {
|
|
110
115
|
this.addToInvisibleDom(tmodel);
|
|
111
116
|
tmodel.getChildren().forEach(function (tmodel) {
|
|
112
117
|
_this.addToRecursiveInvisibleDom(tmodel);
|
|
113
118
|
});
|
|
114
119
|
}
|
|
115
120
|
}
|
|
116
|
-
if (visible || tmodel.isActivated()) {
|
|
121
|
+
if (visible || tmodel.isActivated() || keepDom) {
|
|
117
122
|
var _state$updatingTarget, _state$activeTargetLi;
|
|
123
|
+
var state = tmodel.state();
|
|
124
|
+
if (((_state$updatingTarget = state.updatingTargetList) === null || _state$updatingTarget === void 0 ? void 0 : _state$updatingTarget.length) > 0 || tmodel.hasAnimatingTargets()) {
|
|
125
|
+
this.lists.updatingTModels.push(tmodel);
|
|
126
|
+
this.lists.updatingTargets = [].concat(_toConsumableArray(this.lists.updatingTargets), _toConsumableArray(state.updatingTargetList));
|
|
127
|
+
}
|
|
128
|
+
if (((_state$activeTargetLi = state.activeTargetList) === null || _state$activeTargetLi === void 0 ? void 0 : _state$activeTargetLi.length) > 0) {
|
|
129
|
+
this.lists.activeTModels.push(tmodel);
|
|
130
|
+
this.lists.activeTargets = [].concat(_toConsumableArray(this.lists.activeTargets), _toConsumableArray(state.activeTargetList));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (visible || tmodel.isActivated() || keepDom) {
|
|
118
134
|
if (this.needsRerender(tmodel)) {
|
|
119
135
|
this.lists.rerender.push(tmodel);
|
|
120
136
|
}
|
|
@@ -130,22 +146,16 @@ var TModelManager = exports.TModelManager = /*#__PURE__*/function () {
|
|
|
130
146
|
if (this.needsRelocation(tmodel)) {
|
|
131
147
|
this.lists.relocation.push(tmodel);
|
|
132
148
|
}
|
|
133
|
-
var
|
|
134
|
-
if (
|
|
135
|
-
this.
|
|
136
|
-
|
|
149
|
+
var _state = tmodel.state();
|
|
150
|
+
if (_state.targetMethodMap && Object.keys(_state.targetMethodMap).length > 0) {
|
|
151
|
+
this.targetMethodMap[tmodel.oid] = _objectSpread({}, _state.targetMethodMap);
|
|
152
|
+
_state.targetMethodMap = {};
|
|
137
153
|
}
|
|
138
|
-
if ((
|
|
139
|
-
|
|
140
|
-
this.lists.activeTargets = [].concat(_toConsumableArray(this.lists.activeTargets), _toConsumableArray(state.activeTargetList));
|
|
154
|
+
if (tmodel.isActivated()) {
|
|
155
|
+
activated.push(tmodel);
|
|
141
156
|
}
|
|
142
|
-
if (state.targetMethodMap && Object.keys(state.targetMethodMap).length > 0) {
|
|
143
|
-
this.targetMethodMap[tmodel.oid] = _objectSpread({}, state.targetMethodMap);
|
|
144
|
-
state.targetMethodMap = {};
|
|
145
|
-
}
|
|
146
|
-
tmodel.deactivate();
|
|
147
157
|
}
|
|
148
|
-
if (visible || tmodel.requiresDom()) {
|
|
158
|
+
if (visible || tmodel.requiresDom() || keepDom) {
|
|
149
159
|
if (tmodel.canHaveDom() && !tmodel.hasDom() && tmodel.isIncluded() && !this.noDomMap[tmodel.oid]) {
|
|
150
160
|
var _tmodel$getDomHolder, _tmodel$getDomParent;
|
|
151
161
|
if ((_tmodel$getDomHolder = tmodel.getDomHolder()) !== null && _tmodel$getDomHolder !== void 0 && _tmodel$getDomHolder.exists() || this.noDomMap[(_tmodel$getDomParent = tmodel.getDomParent()) === null || _tmodel$getDomParent === void 0 ? void 0 : _tmodel$getDomParent.oid]) {
|
|
@@ -162,6 +172,9 @@ var TModelManager = exports.TModelManager = /*#__PURE__*/function () {
|
|
|
162
172
|
} finally {
|
|
163
173
|
_iterator.f();
|
|
164
174
|
}
|
|
175
|
+
activated.forEach(function (t) {
|
|
176
|
+
return t.deactivate();
|
|
177
|
+
});
|
|
165
178
|
Object.values(lastVisibleMap).filter(function (v) {
|
|
166
179
|
return v !== undefined;
|
|
167
180
|
}).forEach(function (tmodel) {
|
|
@@ -173,6 +186,27 @@ var TModelManager = exports.TModelManager = /*#__PURE__*/function () {
|
|
|
173
186
|
});
|
|
174
187
|
return this.lists.noDom.length > 0 ? 0 : this.lists.reattach.length > 0 ? 1 : this.lists.relocation.length > 0 ? 2 : this.lists.rerender.length > 0 ? 3 : this.lists.reasyncStyle.length > 0 ? 4 : this.lists.invisibleDom.length > 0 ? 5 : this.lists.restyle.length > 0 ? 10 : -1;
|
|
175
188
|
}
|
|
189
|
+
}, {
|
|
190
|
+
key: "shouldPreserveDom",
|
|
191
|
+
value: function shouldPreserveDom(tmodel) {
|
|
192
|
+
if (!tmodel.isVisible() && _TUtil.TUtil.isDefined(tmodel.targets.isVisible)) {
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
var parent = tmodel.parent;
|
|
196
|
+
if (!tmodel.isIncluded()) {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
while (parent && parent !== (0, _App.tRoot)()) {
|
|
200
|
+
if (_TUtil.TUtil.isDefined(parent.targets.canDeleteDom)) {
|
|
201
|
+
return parent.val('canDeleteDom') === false;
|
|
202
|
+
}
|
|
203
|
+
if (_TUtil.TUtil.isDefined(parent.targets.isVisible)) {
|
|
204
|
+
return parent.val('isVisible') === true;
|
|
205
|
+
}
|
|
206
|
+
parent = parent.parent;
|
|
207
|
+
}
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
176
210
|
}, {
|
|
177
211
|
key: "isBracketVisible",
|
|
178
212
|
value: function isBracketVisible(tmodel) {
|
|
@@ -368,6 +402,12 @@ var TModelManager = exports.TModelManager = /*#__PURE__*/function () {
|
|
|
368
402
|
if (tmodel.hasAnimatingTargets()) {
|
|
369
403
|
(0, _App.getAnimationManager)().pauseTModel(tmodel);
|
|
370
404
|
}
|
|
405
|
+
Object.keys(tmodel.targetValues).forEach(function (key) {
|
|
406
|
+
var targetValue = tmodel.targetValues[key];
|
|
407
|
+
if (targetValue.status === 'updating' && tmodel.updatingTargetList.indexOf(key) === -1) {
|
|
408
|
+
tmodel.setTargetStatus('active');
|
|
409
|
+
}
|
|
410
|
+
});
|
|
371
411
|
var domParent = tmodel.getDomParent();
|
|
372
412
|
if (domParent && domParent.$dom) {
|
|
373
413
|
domParent.$dom.removeElement(tmodel.$dom.element);
|
package/build/TUtil.js
CHANGED
|
@@ -7,7 +7,6 @@ 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");
|
|
11
10
|
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; } } }; }
|
|
12
11
|
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); }
|
|
13
12
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
@@ -33,53 +32,112 @@ var TUtil = exports.TUtil = /*#__PURE__*/function () {
|
|
|
33
32
|
key: "calcVisibility",
|
|
34
33
|
value: function calcVisibility(child) {
|
|
35
34
|
var _parent$targets$onVis;
|
|
36
|
-
// keep the "x updating" fast-path
|
|
37
|
-
|
|
38
35
|
var parent = child.getRealParent();
|
|
39
36
|
var onVisibleChildrenChange = (_parent$targets$onVis = parent === null || parent === void 0 ? void 0 : parent.targets['onVisibleChildrenChange']) !== null && _parent$targets$onVis !== void 0 ? _parent$targets$onVis : false;
|
|
40
37
|
if (!onVisibleChildrenChange && child.isVisible() && (child.isTargetUpdating(child.allTargetMap['x']) || child.isTargetUpdating(child.allTargetMap['y']))) {
|
|
41
38
|
return true;
|
|
42
39
|
}
|
|
43
|
-
var x = child.absX;
|
|
44
|
-
var y = child.absY;
|
|
45
40
|
var domParent = child.getDomParent();
|
|
46
41
|
var scale = (domParent.getMeasuringScale() || 1) * child.getMeasuringScale();
|
|
47
|
-
var
|
|
48
|
-
var
|
|
42
|
+
var x = child.absX;
|
|
43
|
+
var y = child.absY;
|
|
44
|
+
var width = TUtil.isDefined(child.getWidth()) ? scale * child.getWidth() : 0;
|
|
45
|
+
var height = TUtil.isDefined(child.getHeight()) ? scale * child.getHeight() : 0;
|
|
46
|
+
var visibilityMargin = 20;
|
|
49
47
|
if (!child.visibilityStatus) {
|
|
50
48
|
child.visibilityStatus = {};
|
|
51
49
|
}
|
|
52
50
|
var status = child.visibilityStatus;
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
51
|
+
var clip = this.getVisibilityClipRect(child.getParent());
|
|
52
|
+
if (clip) {
|
|
53
|
+
status.right = x - visibilityMargin <= clip.r;
|
|
54
|
+
status.left = x + width + visibilityMargin >= clip.x;
|
|
55
|
+
status.bottom = y - child.getTopMargin() - visibilityMargin <= clip.b;
|
|
56
|
+
status.top = y + height + visibilityMargin >= clip.y;
|
|
57
|
+
status.clipX = clip.x;
|
|
58
|
+
status.clipY = clip.y;
|
|
59
|
+
status.clipR = clip.r;
|
|
60
|
+
status.clipB = clip.b;
|
|
61
|
+
status.parent = clip.source;
|
|
62
|
+
status.isVisible = status.left && status.right && status.top && status.bottom;
|
|
63
|
+
} else {
|
|
64
|
+
status.right = true;
|
|
65
|
+
status.left = true;
|
|
66
|
+
status.bottom = true;
|
|
67
|
+
status.top = true;
|
|
68
|
+
status.clipX = undefined;
|
|
69
|
+
status.clipY = undefined;
|
|
70
|
+
status.clipR = undefined;
|
|
71
|
+
status.clipB = undefined;
|
|
72
|
+
status.parent = "none";
|
|
73
|
+
status.isVisible = true;
|
|
74
|
+
}
|
|
74
75
|
status.x = x;
|
|
75
76
|
status.y = y;
|
|
76
|
-
status.width =
|
|
77
|
-
status.height =
|
|
78
|
-
status.parent = validateInParent ? parent : "screen";
|
|
79
|
-
status.isVisible = status.left && status.right && status.top && status.bottom;
|
|
77
|
+
status.width = width;
|
|
78
|
+
status.height = height;
|
|
80
79
|
child.actualValues.isVisible = status.isVisible;
|
|
81
80
|
return status.isVisible;
|
|
82
81
|
}
|
|
82
|
+
}, {
|
|
83
|
+
key: "getVisibilityClipRect",
|
|
84
|
+
value: function getVisibilityClipRect(container) {
|
|
85
|
+
var rect = null;
|
|
86
|
+
while (container && container !== (0, _App.tRoot)()) {
|
|
87
|
+
if (this.shouldClipByAncestor(container)) {
|
|
88
|
+
var ancestorRect = this.getAncestorViewportRect(container);
|
|
89
|
+
rect = rect ? this.intersectVisibilityRects(rect, ancestorRect) : ancestorRect;
|
|
90
|
+
if (rect.r <= rect.x || rect.b <= rect.y) {
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
container = container.getParent();
|
|
95
|
+
}
|
|
96
|
+
return rect;
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
key: "shouldClipByAncestor",
|
|
100
|
+
value: function shouldClipByAncestor(ancestor) {
|
|
101
|
+
return ancestor.managesOwnScroll();
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
key: "getAncestorViewportRect",
|
|
105
|
+
value: function getAncestorViewportRect(ancestor) {
|
|
106
|
+
var _ancestor$$dom, _ancestor$$dom2;
|
|
107
|
+
var domScrollLeft = ((_ancestor$$dom = ancestor.$dom) === null || _ancestor$$dom === void 0 ? void 0 : _ancestor$$dom.getScrollLeft()) || 0;
|
|
108
|
+
var domScrollTop = ((_ancestor$$dom2 = ancestor.$dom) === null || _ancestor$$dom2 === void 0 ? void 0 : _ancestor$$dom2.getScrollTop()) || 0;
|
|
109
|
+
return {
|
|
110
|
+
x: ancestor.absX + domScrollLeft,
|
|
111
|
+
y: ancestor.absY + domScrollTop,
|
|
112
|
+
r: ancestor.absX + domScrollLeft + ancestor.getWidth(),
|
|
113
|
+
b: ancestor.absY + domScrollTop + ancestor.getHeight(),
|
|
114
|
+
source: ancestor
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
key: "intersectVisibilityRects",
|
|
119
|
+
value: function intersectVisibilityRects(a, b) {
|
|
120
|
+
return {
|
|
121
|
+
x: Math.max(a.x, b.x),
|
|
122
|
+
y: Math.max(a.y, b.y),
|
|
123
|
+
r: Math.min(a.r, b.r),
|
|
124
|
+
b: Math.min(a.b, b.b),
|
|
125
|
+
source: b.source
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}, {
|
|
129
|
+
key: "updateClipRect",
|
|
130
|
+
value: function updateClipRect(tmodel) {
|
|
131
|
+
var parent = tmodel.getParent();
|
|
132
|
+
var inheritedClip = (parent === null || parent === void 0 ? void 0 : parent.visibilityClipRect) || null;
|
|
133
|
+
if (this.shouldClipByAncestor(tmodel)) {
|
|
134
|
+
var localRect = this.getLocalViewportRect(tmodel);
|
|
135
|
+
tmodel.visibilityClipRect = inheritedClip ? this.intersectVisibilityRects(inheritedClip, localRect) : localRect;
|
|
136
|
+
} else {
|
|
137
|
+
tmodel.visibilityClipRect = inheritedClip;
|
|
138
|
+
}
|
|
139
|
+
return tmodel.visibilityClipRect;
|
|
140
|
+
}
|
|
83
141
|
}, {
|
|
84
142
|
key: "contains",
|
|
85
143
|
value: function contains(container, tmodel) {
|
|
@@ -305,9 +363,6 @@ var TUtil = exports.TUtil = /*#__PURE__*/function () {
|
|
|
305
363
|
}, {
|
|
306
364
|
key: "runTargetValue",
|
|
307
365
|
value: function runTargetValue(tmodel, target, key, cycle, lastValue) {
|
|
308
|
-
if (_TargetParser.TargetParser.isIntervalTarget(target) && cycle === 1) {
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
366
|
var cleanKey = _TargetUtil.TargetUtil.getTargetName(key);
|
|
312
367
|
var isExternalEvent = _TargetData.TargetData.allEventMap[cleanKey];
|
|
313
368
|
if (isExternalEvent) {
|
package/build/TargetData.js
CHANGED
|
@@ -266,7 +266,9 @@ _defineProperty(TargetData, "mustExecuteTargets", {
|
|
|
266
266
|
heightFromDom: true,
|
|
267
267
|
widthFromDom: true,
|
|
268
268
|
fetch: true,
|
|
269
|
-
fetchImage: true
|
|
269
|
+
fetchImage: true,
|
|
270
|
+
isVisible: true,
|
|
271
|
+
canDeleteDom: true
|
|
270
272
|
});
|
|
271
273
|
_defineProperty(TargetData, "ignoreRerun", {
|
|
272
274
|
isVisible: true
|
|
@@ -712,6 +714,7 @@ _defineProperty(TargetData, "attributesToTargets", {
|
|
|
712
714
|
oninput: 'onInput',
|
|
713
715
|
onsubmit: 'onSubmit',
|
|
714
716
|
onvisible: 'onVisible',
|
|
717
|
+
oninvisible: 'oInVisible',
|
|
715
718
|
onresize: 'onResize',
|
|
716
719
|
textalign: 'textAlign',
|
|
717
720
|
preventdefault: 'preventDefault',
|
|
@@ -806,6 +809,9 @@ _defineProperty(TargetData, "internalEventMap", {
|
|
|
806
809
|
onVisible: function onVisible(tmodel) {
|
|
807
810
|
return tmodel.isNowVisible;
|
|
808
811
|
},
|
|
812
|
+
onInVisible: function onInVisible(tmodel) {
|
|
813
|
+
return tmodel.isNowInvisible;
|
|
814
|
+
},
|
|
809
815
|
onResize: function onResize(tmodel) {
|
|
810
816
|
var lastUpdate = tmodel.getDimLastUpdate();
|
|
811
817
|
if (!lastUpdate) {
|
|
@@ -899,5 +905,5 @@ _defineProperty(TargetData, "lifecyclePatterns", {
|
|
|
899
905
|
});
|
|
900
906
|
_defineProperty(TargetData, "eventSet", new Set([].concat(_toConsumableArray(Object.keys(_TargetData.allEventMap)), _toConsumableArray(Object.keys(_TargetData.internalEventMap)))));
|
|
901
907
|
_defineProperty(TargetData, "styleSet", new Set([].concat(_toConsumableArray(Object.keys(_TargetData.styleTargetMap)), _toConsumableArray(Object.keys(_TargetData.asyncStyleTargetMap)), _toConsumableArray(Object.keys(_TargetData.attributeTargetMap)))));
|
|
902
|
-
_defineProperty(TargetData, "reservedKeywordSet", new Set([].concat(_toConsumableArray(_TargetData.styleSet), _toConsumableArray(Object.keys(_TargetData.defaultActualValues())), _toConsumableArray(Object.keys(_TargetData.allEventMap)), _toConsumableArray(Object.keys(_TargetData.internalEventMap)), ['html', 'isInFlow', 'domHolder', 'domParent', 'gap', 'widthFromDom', 'heightFromDom', 'requiresDom', 'preventDefault', 'canDeleteDom', 'textOnly', 'styling', '$dom', 'defaultStyling', 'reuseDomDefinition', 'canHaveDom', 'excludeXYCalc', 'excludeX', 'excludeY', 'containerOverflowMode', 'itemOverflowMode', 'baseElement', 'element', 'otype', 'calculateChildren', 'domIsland', 'bracketThreshold', 'bracketSize', 'sourceDom'])));
|
|
908
|
+
_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)), ['html', 'isInFlow', 'domHolder', 'domParent', 'gap', 'widthFromDom', 'heightFromDom', 'requiresDom', 'preventDefault', 'canDeleteDom', 'textOnly', 'styling', '$dom', 'defaultStyling', 'reuseDomDefinition', 'canHaveDom', 'excludeXYCalc', 'excludeX', 'excludeY', 'containerOverflowMode', 'itemOverflowMode', 'baseElement', 'element', 'otype', 'calculateChildren', 'domIsland', 'bracketThreshold', 'bracketSize', 'shouldBeBracketed', 'sourceDom'])));
|
|
903
909
|
_defineProperty(TargetData, "activationKeywordSet", new Set(['originalTModel', 'originalTargetName', 'activateNextTarget']));
|
package/build/TargetExecutor.js
CHANGED
|
@@ -90,7 +90,7 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
90
90
|
targetValue = TargetExecutor.assignImperativeTargetValue(tmodel, key, originalTargetName, originalTModel);
|
|
91
91
|
TargetExecutor.assignListTarget(tmodel, key, targetValue, value.list, value.list[0], vSteps, vInterval, vEasing, vCycles);
|
|
92
92
|
} else if (_TargetParser.TargetParser.isTargetSpecObject(value)) {
|
|
93
|
-
var valueArray = _TargetParser.TargetParser.getValueStepsCycles(tmodel,
|
|
93
|
+
var valueArray = _TargetParser.TargetParser.getValueStepsCycles(tmodel, key, value);
|
|
94
94
|
var newValue = valueArray[0];
|
|
95
95
|
var newSteps = valueArray[1];
|
|
96
96
|
var newInterval = valueArray[2];
|
|
@@ -111,7 +111,7 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
111
111
|
var newEasing = easing;
|
|
112
112
|
var newCycles = cycles;
|
|
113
113
|
if (_typeof(newValue) === 'object' && !_TargetParser.TargetParser.isListTarget(newValue)) {
|
|
114
|
-
var _valueArray = _TargetParser.TargetParser.getValueStepsCycles(tmodel, completeValue[objectKey]
|
|
114
|
+
var _valueArray = _TargetParser.TargetParser.getValueStepsCycles(tmodel, objectKey, completeValue[objectKey]);
|
|
115
115
|
newValue = _valueArray[0];
|
|
116
116
|
newSteps = _TUtil.TUtil.isDefined(_valueArray[1]) ? _valueArray[1] : steps;
|
|
117
117
|
newInterval = _TUtil.TUtil.isDefined(_valueArray[2]) ? _valueArray[2] : interval;
|
|
@@ -122,7 +122,7 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
122
122
|
});
|
|
123
123
|
} else {
|
|
124
124
|
if (_typeof(value) === 'object' && !_TargetParser.TargetParser.isListTarget(value)) {
|
|
125
|
-
var _valueArray2 = _TargetParser.TargetParser.getValueStepsCycles(tmodel,
|
|
125
|
+
var _valueArray2 = _TargetParser.TargetParser.getValueStepsCycles(tmodel, key, value);
|
|
126
126
|
if (value !== _valueArray2[0]) {
|
|
127
127
|
value = _valueArray2[0];
|
|
128
128
|
steps = _TUtil.TUtil.isDefined(_valueArray2[1]) ? _valueArray2[1] : steps;
|
|
@@ -248,8 +248,11 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
248
248
|
key: "resolveTargetValue",
|
|
249
249
|
value: function resolveTargetValue(tmodel, key) {
|
|
250
250
|
var cycle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : tmodel.getTargetCycle(key);
|
|
251
|
+
if (_TargetParser.TargetParser.isIntervalTarget(tmodel.targets[key]) && cycle === 1) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
251
254
|
var targetInitial = !tmodel.targetValues[key] && _TUtil.TUtil.isDefined(tmodel.targets[key].initialValue) ? tmodel.targets[key].initialValue : undefined;
|
|
252
|
-
var valueArray = _TargetParser.TargetParser.getValueStepsCycles(tmodel, tmodel.targets[key],
|
|
255
|
+
var valueArray = _TargetParser.TargetParser.getValueStepsCycles(tmodel, key, tmodel.targets[key], cycle);
|
|
253
256
|
var newValue = valueArray[0];
|
|
254
257
|
var newSteps = valueArray[1] || 0;
|
|
255
258
|
var newInterval = valueArray[2] || 0;
|
|
@@ -259,7 +262,7 @@ var TargetExecutor = exports.TargetExecutor = /*#__PURE__*/function () {
|
|
|
259
262
|
tmodel.targetValues[key] = targetValue;
|
|
260
263
|
var easing = _TUtil.TUtil.isDefined(newEasing) ? newEasing : _TUtil.TUtil.isDefined(tmodel.targets[key].easing) ? tmodel.targets[key].easing : undefined;
|
|
261
264
|
if (_TargetParser.TargetParser.isIntervalTarget(newValue)) {
|
|
262
|
-
TargetExecutor.assignSingleTarget(targetValue, undefined,
|
|
265
|
+
TargetExecutor.assignSingleTarget(targetValue, undefined, targetInitial, 0, 2, newValue.interval, easing);
|
|
263
266
|
} else if (_TargetParser.TargetParser.isChildTarget(key, newValue)) {
|
|
264
267
|
tmodel.addChild(newValue);
|
|
265
268
|
TargetExecutor.assignSingleTarget(targetValue, newValue, undefined, 0, newCycles, newInterval, easing);
|
package/build/TargetManager.js
CHANGED
|
@@ -243,7 +243,7 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
243
243
|
});
|
|
244
244
|
var isTransform = _TargetData.TargetData.isTransformKey(cleanKey);
|
|
245
245
|
var getFrameAtTime = function getFrameAtTime(t) {
|
|
246
|
-
var shifted = t + timeShift;
|
|
246
|
+
var shifted = Math.max(0, t + timeShift);
|
|
247
247
|
for (var i = 0; i < batch.frames.length; i++) {
|
|
248
248
|
var _frame = batch.frames[i];
|
|
249
249
|
if (Math.abs(_frame.keyTime - shifted) < 0.0001) {
|
|
@@ -318,7 +318,7 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
318
318
|
if (tmodel.getTargetEasing(key)) {
|
|
319
319
|
batch.easing = tmodel.getTargetEasing(key);
|
|
320
320
|
}
|
|
321
|
-
batch.totalDuration = Math.max(batch.totalDuration, timeShift + keyDuration);
|
|
321
|
+
batch.totalDuration = Math.max(0, batch.totalDuration, timeShift + keyDuration);
|
|
322
322
|
((_batch$keyMap = batch.keyMap)[cleanKey] || (_batch$keyMap[cleanKey] = new Set())).add(key);
|
|
323
323
|
tmodel.removeFromUpdatingTargets(key);
|
|
324
324
|
return keyDuration;
|
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.loop) && !_TUtil.TUtil.isDefined(target.steps) && !_TUtil.TUtil.isDefined(target.cycles);
|
|
165
165
|
}
|
|
166
166
|
}, {
|
|
167
167
|
key: "isPrimitiveArray",
|
|
@@ -217,7 +217,8 @@ var TargetParser = exports.TargetParser = /*#__PURE__*/function () {
|
|
|
217
217
|
}
|
|
218
218
|
}, {
|
|
219
219
|
key: "getValueStepsCycles",
|
|
220
|
-
value: function getValueStepsCycles(tmodel,
|
|
220
|
+
value: function getValueStepsCycles(tmodel, key) {
|
|
221
|
+
var _target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : tmodel.targets[key];
|
|
221
222
|
var cycle = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : tmodel.getTargetCycle(key);
|
|
222
223
|
var valueOnly = _target && _target.valueOnly;
|
|
223
224
|
var lastValue = tmodel.val(key);
|
package/build/TargetUtil.js
CHANGED
|
@@ -182,8 +182,8 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
|
|
|
182
182
|
if (nextTarget) {
|
|
183
183
|
if (isEndTrigger) {
|
|
184
184
|
var _tmodel$targetValues$2, _tmodel$targetValues$3;
|
|
185
|
-
var
|
|
186
|
-
if (targetValue.completeCount >
|
|
185
|
+
var triggeredByCompleteCount = (_tmodel$targetValues$2 = (_tmodel$targetValues$3 = tmodel.targetValues[nextTarget]) === null || _tmodel$targetValues$3 === void 0 ? void 0 : _tmodel$targetValues$3.triggeredByCompleteCount) !== null && _tmodel$targetValues$2 !== void 0 ? _tmodel$targetValues$2 : 0;
|
|
186
|
+
if (targetValue.completeCount > triggeredByCompleteCount) {
|
|
187
187
|
canActivate = true;
|
|
188
188
|
}
|
|
189
189
|
} else {
|
|
@@ -199,6 +199,7 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
|
|
|
199
199
|
TargetUtil.activateTargetOnce(tmodel, nextTarget);
|
|
200
200
|
nextTargetActivated = true;
|
|
201
201
|
TargetUtil.clearPendingTargets(tmodel, key);
|
|
202
|
+
tmodel.targetValues[nextTarget].triggeredByCompleteCount = targetValue.completeCount;
|
|
202
203
|
} else {
|
|
203
204
|
TargetUtil.markPendingTargets(tmodel, key);
|
|
204
205
|
}
|
|
@@ -219,6 +220,7 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
|
|
|
219
220
|
TargetUtil.activateTarget(tmodel, nextTarget);
|
|
220
221
|
nextTargetActivated = true;
|
|
221
222
|
TargetUtil.clearPendingTargets(tmodel, key);
|
|
223
|
+
tmodel.targetValues[nextTarget].triggeredByCompleteCount = targetValue.completeCount;
|
|
222
224
|
} else {
|
|
223
225
|
TargetUtil.markPendingTargets(tmodel, key);
|
|
224
226
|
}
|
|
@@ -716,7 +718,10 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
|
|
|
716
718
|
var targetValue = tmodel.targetValues[key];
|
|
717
719
|
if (targetValue) {
|
|
718
720
|
targetValue.completeCount = 0;
|
|
721
|
+
targetValue.triggeredByCompleteCount = 0;
|
|
722
|
+
targetValue.resetFlag = true;
|
|
719
723
|
targetValue.nextTargetUpdateCount = 0;
|
|
724
|
+
targetValue.status = 'complete';
|
|
720
725
|
}
|
|
721
726
|
tmodel.cancelAnimation();
|
|
722
727
|
tmodel.activatedTargets.length = 0;
|