targetj 1.0.259 → 1.1.0
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 +16 -1
- package/README.md +18 -25
- package/build/AnimationManager.js +1 -1
- package/build/AnimationUtil.js +1 -8
- package/build/App.js +13 -4
- package/build/BaseModel.js +39 -14
- package/build/Bracket.js +7 -1
- package/build/Child.js +504 -0
- package/build/EventListener.js +10 -1
- package/build/LocationManager.js +161 -40
- package/build/PageManager.js +35 -134
- package/build/ParticleChild.js +575 -0
- package/build/ParticleRenderer.js +818 -0
- package/build/ParticleRuntime.js +1513 -0
- package/build/ParticleTModel.js +1423 -0
- package/build/ParticleUtil.js +265 -0
- package/build/RunScheduler.js +10 -3
- package/build/ScheduleUtil.js +2 -2
- package/build/StateManager.js +235 -31
- package/build/StateUtil.js +14 -15
- package/build/TModel.js +62 -28
- package/build/TModelFactory.js +48 -0
- package/build/TModelManager.js +146 -98
- package/build/TModelUtil.js +11 -8
- package/build/TUtil.js +57 -47
- package/build/TargetData.js +7 -1
- package/build/TargetExecutor.js +63 -9
- package/build/TargetManager.js +39 -23
- package/build/TargetParser.js +38 -2
- package/build/TargetUtil.js +26 -5
- package/build/Viewport.js +2 -2
- package/build/VisibilityUtil.js +4 -2
- package/build/index.js +6 -1
- package/dist/targetjs.js +1 -1
- package/dist/targetjs.js.gz +0 -0
- package/package.json +1 -1
package/build/Child.js
ADDED
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
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
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
6
|
+
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); } }
|
|
7
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
import { TModelUtil } from "./TModelUtil.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* It provides a lightweight logical child that can be rendered by different backends.
|
|
14
|
+
*
|
|
15
|
+
* A Child participates in layout, visibility and the public child API, but does not
|
|
16
|
+
* have its own TargetJS runtime, scheduler, DOM, animations or child hierarchy.
|
|
17
|
+
*/
|
|
18
|
+
var Child = /*#__PURE__*/function () {
|
|
19
|
+
function Child(parent, index) {
|
|
20
|
+
var _parent$particleValue;
|
|
21
|
+
_classCallCheck(this, Child);
|
|
22
|
+
this.parent = parent;
|
|
23
|
+
this.index = index;
|
|
24
|
+
this.isLightweightChild = true;
|
|
25
|
+
this.type = "".concat(parent.type, "_");
|
|
26
|
+
this.oid = "".concat(parent.oid, "_gpu_").concat(index);
|
|
27
|
+
this.x = 0;
|
|
28
|
+
this.y = 0;
|
|
29
|
+
this.absX = 0;
|
|
30
|
+
this.absY = 0;
|
|
31
|
+
var values = (_parent$particleValue = parent.particleValues[index]) !== null && _parent$particleValue !== void 0 ? _parent$particleValue : {};
|
|
32
|
+
this.explicitX = Object.prototype.hasOwnProperty.call(values, "x");
|
|
33
|
+
this.explicitY = Object.prototype.hasOwnProperty.call(values, "y");
|
|
34
|
+
this.targets = {};
|
|
35
|
+
this.targetValues = {};
|
|
36
|
+
this.allTargetMap = {};
|
|
37
|
+
for (var _i = 0, _Object$keys = Object.keys(values); _i < _Object$keys.length; _i++) {
|
|
38
|
+
var key = _Object$keys[_i];
|
|
39
|
+
this.allTargetMap[key] = true;
|
|
40
|
+
}
|
|
41
|
+
this.actualValues = _objectSpread(_objectSpread({}, values), {}, {
|
|
42
|
+
isVisible: true
|
|
43
|
+
});
|
|
44
|
+
this.visibilityStatus = undefined;
|
|
45
|
+
this.updatingTargetList = [];
|
|
46
|
+
this.activeTargetList = [];
|
|
47
|
+
this.activatedTargets = [];
|
|
48
|
+
this.runtimeState = {
|
|
49
|
+
updatingTargetList: this.updatingTargetList,
|
|
50
|
+
activeTargetList: this.activeTargetList,
|
|
51
|
+
activatedTargets: this.activatedTargets,
|
|
52
|
+
fetchActionTargetList: [],
|
|
53
|
+
lastChildrenUpdate: {
|
|
54
|
+
additions: [],
|
|
55
|
+
deletions: []
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
this.noDomUpdatingTargets = false;
|
|
59
|
+
this.pendingTargets = false;
|
|
60
|
+
this.currentStatus = undefined;
|
|
61
|
+
this.dirtyLayout = false;
|
|
62
|
+
}
|
|
63
|
+
return _createClass(Child, [{
|
|
64
|
+
key: "state",
|
|
65
|
+
value: function state() {
|
|
66
|
+
return this.runtimeState;
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "isTargetImperative",
|
|
70
|
+
value: function isTargetImperative() {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
key: "val",
|
|
75
|
+
value: function val(key, value) {
|
|
76
|
+
if (arguments.length === 2) {
|
|
77
|
+
this.allTargetMap[key] = true;
|
|
78
|
+
this.actualValues[key] = value;
|
|
79
|
+
if (key === "x") {
|
|
80
|
+
this.explicitX = true;
|
|
81
|
+
} else if (key === "y") {
|
|
82
|
+
this.explicitY = true;
|
|
83
|
+
}
|
|
84
|
+
this.parent.setChildValue(this.index, key, value);
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
return this.parent.getChildValue(this.index, key);
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
key: "getParent",
|
|
91
|
+
value: function getParent() {
|
|
92
|
+
return this.parent;
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
key: "getRealParent",
|
|
96
|
+
value: function getRealParent() {
|
|
97
|
+
return this.parent;
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
key: "getParentValue",
|
|
101
|
+
value: function getParentValue(key) {
|
|
102
|
+
var _this$parent;
|
|
103
|
+
return (_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.val(key);
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
key: "pval",
|
|
107
|
+
value: function pval(key) {
|
|
108
|
+
return this.getParentValue(key);
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
key: "exists",
|
|
112
|
+
value: function exists() {
|
|
113
|
+
var _this$parent2;
|
|
114
|
+
return ((_this$parent2 = this.parent) === null || _this$parent2 === void 0 ? void 0 : _this$parent2.getChild(this.index)) === this;
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "isComplete",
|
|
118
|
+
value: function isComplete() {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "hasAnimatingTargets",
|
|
123
|
+
value: function hasAnimatingTargets() {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "hasAnimatingChildren",
|
|
128
|
+
value: function hasAnimatingChildren() {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
key: "hasUpdatingChildren",
|
|
133
|
+
value: function hasUpdatingChildren() {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}, {
|
|
137
|
+
key: "hasActiveChildren",
|
|
138
|
+
value: function hasActiveChildren() {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
key: "getChildren",
|
|
143
|
+
value: function getChildren() {
|
|
144
|
+
return [];
|
|
145
|
+
}
|
|
146
|
+
}, {
|
|
147
|
+
key: "hasChildren",
|
|
148
|
+
value: function hasChildren() {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
key: "clearUpdatingChildren",
|
|
153
|
+
value: function clearUpdatingChildren() {
|
|
154
|
+
this.updatingTargetList.length = 0;
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
key: "clearActiveChildren",
|
|
158
|
+
value: function clearActiveChildren() {
|
|
159
|
+
this.activeTargetList.length = 0;
|
|
160
|
+
}
|
|
161
|
+
}, {
|
|
162
|
+
key: "clearAnimatingChildren",
|
|
163
|
+
value: function clearAnimatingChildren() {}
|
|
164
|
+
}, {
|
|
165
|
+
key: "cancelAnimation",
|
|
166
|
+
value: function cancelAnimation() {}
|
|
167
|
+
}, {
|
|
168
|
+
key: "hasEventDirty",
|
|
169
|
+
value: function hasEventDirty() {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
}, {
|
|
173
|
+
key: "markEventDirty",
|
|
174
|
+
value: function markEventDirty() {}
|
|
175
|
+
}, {
|
|
176
|
+
key: "markLayoutDirty",
|
|
177
|
+
value: function markLayoutDirty(key) {
|
|
178
|
+
var _this$parent3, _this$parent3$markLay;
|
|
179
|
+
(_this$parent3 = this.parent) === null || _this$parent3 === void 0 || (_this$parent3$markLay = _this$parent3.markLayoutDirty) === null || _this$parent3$markLay === void 0 || _this$parent3$markLay.call(_this$parent3, "gpuChild-".concat(this.index, "-").concat(key));
|
|
180
|
+
}
|
|
181
|
+
}, {
|
|
182
|
+
key: "removeLayoutDirty",
|
|
183
|
+
value: function removeLayoutDirty() {}
|
|
184
|
+
}, {
|
|
185
|
+
key: "getDirtyLayout",
|
|
186
|
+
value: function getDirtyLayout() {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
}, {
|
|
190
|
+
key: "getX",
|
|
191
|
+
value: function getX() {
|
|
192
|
+
return this.explicitX ? this.val("x") : this.x;
|
|
193
|
+
}
|
|
194
|
+
}, {
|
|
195
|
+
key: "getY",
|
|
196
|
+
value: function getY() {
|
|
197
|
+
return this.explicitY ? this.val("y") : this.y;
|
|
198
|
+
}
|
|
199
|
+
}, {
|
|
200
|
+
key: "getWidth",
|
|
201
|
+
value: function getWidth() {
|
|
202
|
+
var _this$val;
|
|
203
|
+
return (_this$val = this.val("width")) !== null && _this$val !== void 0 ? _this$val : 0;
|
|
204
|
+
}
|
|
205
|
+
}, {
|
|
206
|
+
key: "getHeight",
|
|
207
|
+
value: function getHeight() {
|
|
208
|
+
var _this$val2;
|
|
209
|
+
return (_this$val2 = this.val("height")) !== null && _this$val2 !== void 0 ? _this$val2 : 0;
|
|
210
|
+
}
|
|
211
|
+
}, {
|
|
212
|
+
key: "getBaseWidth",
|
|
213
|
+
value: function getBaseWidth() {
|
|
214
|
+
return this.getWidth();
|
|
215
|
+
}
|
|
216
|
+
}, {
|
|
217
|
+
key: "getBaseHeight",
|
|
218
|
+
value: function getBaseHeight() {
|
|
219
|
+
return this.getHeight();
|
|
220
|
+
}
|
|
221
|
+
}, {
|
|
222
|
+
key: "getMinWidth",
|
|
223
|
+
value: function getMinWidth() {
|
|
224
|
+
return this.getWidth();
|
|
225
|
+
}
|
|
226
|
+
}, {
|
|
227
|
+
key: "getTopBaseHeight",
|
|
228
|
+
value: function getTopBaseHeight() {
|
|
229
|
+
return 0;
|
|
230
|
+
}
|
|
231
|
+
}, {
|
|
232
|
+
key: "getMeasuringScale",
|
|
233
|
+
value: function getMeasuringScale() {
|
|
234
|
+
var _this$val3;
|
|
235
|
+
return (_this$val3 = this.val("measuringScale")) !== null && _this$val3 !== void 0 ? _this$val3 : 1;
|
|
236
|
+
}
|
|
237
|
+
}, {
|
|
238
|
+
key: "getMarginTop",
|
|
239
|
+
value: function getMarginTop() {
|
|
240
|
+
var _ref, _this$val4;
|
|
241
|
+
return (_ref = (_this$val4 = this.val("marginTop")) !== null && _this$val4 !== void 0 ? _this$val4 : this.val("topMargin")) !== null && _ref !== void 0 ? _ref : 0;
|
|
242
|
+
}
|
|
243
|
+
}, {
|
|
244
|
+
key: "getMarginLeft",
|
|
245
|
+
value: function getMarginLeft() {
|
|
246
|
+
var _ref2, _this$val5;
|
|
247
|
+
return (_ref2 = (_this$val5 = this.val("marginLeft")) !== null && _this$val5 !== void 0 ? _this$val5 : this.val("leftMargin")) !== null && _ref2 !== void 0 ? _ref2 : 0;
|
|
248
|
+
}
|
|
249
|
+
}, {
|
|
250
|
+
key: "getMarginRight",
|
|
251
|
+
value: function getMarginRight() {
|
|
252
|
+
var _ref3, _this$val6, _this$getParentValue;
|
|
253
|
+
var margin = (_ref3 = (_this$val6 = this.val("marginRight")) !== null && _this$val6 !== void 0 ? _this$val6 : this.val("rightMargin")) !== null && _ref3 !== void 0 ? _ref3 : 0;
|
|
254
|
+
return margin + ((_this$getParentValue = this.getParentValue("gap")) !== null && _this$getParentValue !== void 0 ? _this$getParentValue : 0);
|
|
255
|
+
}
|
|
256
|
+
}, {
|
|
257
|
+
key: "getMarginBottom",
|
|
258
|
+
value: function getMarginBottom() {
|
|
259
|
+
var _ref4, _this$val7, _this$getParentValue2;
|
|
260
|
+
var margin = (_ref4 = (_this$val7 = this.val("marginBottom")) !== null && _this$val7 !== void 0 ? _this$val7 : this.val("bottomMargin")) !== null && _ref4 !== void 0 ? _ref4 : 0;
|
|
261
|
+
return margin + ((_this$getParentValue2 = this.getParentValue("gap")) !== null && _this$getParentValue2 !== void 0 ? _this$getParentValue2 : 0);
|
|
262
|
+
}
|
|
263
|
+
}, {
|
|
264
|
+
key: "getTopMargin",
|
|
265
|
+
value: function getTopMargin() {
|
|
266
|
+
return this.getMarginTop();
|
|
267
|
+
}
|
|
268
|
+
}, {
|
|
269
|
+
key: "getLeftMargin",
|
|
270
|
+
value: function getLeftMargin() {
|
|
271
|
+
return this.getMarginLeft();
|
|
272
|
+
}
|
|
273
|
+
}, {
|
|
274
|
+
key: "getRightMargin",
|
|
275
|
+
value: function getRightMargin() {
|
|
276
|
+
return this.getMarginRight();
|
|
277
|
+
}
|
|
278
|
+
}, {
|
|
279
|
+
key: "getBottomMargin",
|
|
280
|
+
value: function getBottomMargin() {
|
|
281
|
+
return this.getMarginBottom();
|
|
282
|
+
}
|
|
283
|
+
}, {
|
|
284
|
+
key: "getItemOverflowMode",
|
|
285
|
+
value: function getItemOverflowMode() {
|
|
286
|
+
var _this$val8;
|
|
287
|
+
return (_this$val8 = this.val("itemOverflowMode")) !== null && _this$val8 !== void 0 ? _this$val8 : "auto";
|
|
288
|
+
}
|
|
289
|
+
}, {
|
|
290
|
+
key: "isInFlow",
|
|
291
|
+
value: function isInFlow() {
|
|
292
|
+
var _this$val9;
|
|
293
|
+
return (_this$val9 = this.val("isInFlow")) !== null && _this$val9 !== void 0 ? _this$val9 : true;
|
|
294
|
+
}
|
|
295
|
+
}, {
|
|
296
|
+
key: "isIncluded",
|
|
297
|
+
value: function isIncluded() {
|
|
298
|
+
return true;
|
|
299
|
+
}
|
|
300
|
+
}, {
|
|
301
|
+
key: "useContentWidth",
|
|
302
|
+
value: function useContentWidth() {
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
}, {
|
|
306
|
+
key: "useContentHeight",
|
|
307
|
+
value: function useContentHeight() {
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
310
|
+
}, {
|
|
311
|
+
key: "getContentWidth",
|
|
312
|
+
value: function getContentWidth() {
|
|
313
|
+
return 0;
|
|
314
|
+
}
|
|
315
|
+
}, {
|
|
316
|
+
key: "getContentHeight",
|
|
317
|
+
value: function getContentHeight() {
|
|
318
|
+
return 0;
|
|
319
|
+
}
|
|
320
|
+
}, {
|
|
321
|
+
key: "hasDom",
|
|
322
|
+
value: function hasDom() {
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
}, {
|
|
326
|
+
key: "isDomIsland",
|
|
327
|
+
value: function isDomIsland() {
|
|
328
|
+
return false;
|
|
329
|
+
}
|
|
330
|
+
}, {
|
|
331
|
+
key: "reuseDomDefinition",
|
|
332
|
+
value: function reuseDomDefinition() {
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
}, {
|
|
336
|
+
key: "requiresDom",
|
|
337
|
+
value: function requiresDom() {
|
|
338
|
+
return false;
|
|
339
|
+
}
|
|
340
|
+
}, {
|
|
341
|
+
key: "requiresDomRelocation",
|
|
342
|
+
value: function requiresDomRelocation() {
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
}, {
|
|
346
|
+
key: "hasDomHolderChanged",
|
|
347
|
+
value: function hasDomHolderChanged() {
|
|
348
|
+
return false;
|
|
349
|
+
}
|
|
350
|
+
}, {
|
|
351
|
+
key: "hasBaseElementChanged",
|
|
352
|
+
value: function hasBaseElementChanged() {
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
}, {
|
|
356
|
+
key: "getHtml",
|
|
357
|
+
value: function getHtml() {
|
|
358
|
+
return undefined;
|
|
359
|
+
}
|
|
360
|
+
}, {
|
|
361
|
+
key: "excludeDefaultStyling",
|
|
362
|
+
value: function excludeDefaultStyling() {
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
}, {
|
|
366
|
+
key: "excludeStyling",
|
|
367
|
+
value: function excludeStyling() {
|
|
368
|
+
return true;
|
|
369
|
+
}
|
|
370
|
+
}, {
|
|
371
|
+
key: "addToStyleTargetList",
|
|
372
|
+
value: function addToStyleTargetList() {}
|
|
373
|
+
}, {
|
|
374
|
+
key: "calcAbsolutePosition",
|
|
375
|
+
value: function calcAbsolutePosition(x, y) {
|
|
376
|
+
var _this$parent$absX, _this$parent4, _this$parent$absY, _this$parent5;
|
|
377
|
+
this.absX = ((_this$parent$absX = (_this$parent4 = this.parent) === null || _this$parent4 === void 0 ? void 0 : _this$parent4.absX) !== null && _this$parent$absX !== void 0 ? _this$parent$absX : 0) + x;
|
|
378
|
+
this.absY = ((_this$parent$absY = (_this$parent5 = this.parent) === null || _this$parent5 === void 0 ? void 0 : _this$parent5.absY) !== null && _this$parent$absY !== void 0 ? _this$parent$absY : 0) + y;
|
|
379
|
+
}
|
|
380
|
+
}, {
|
|
381
|
+
key: "isVisible",
|
|
382
|
+
value: function isVisible() {
|
|
383
|
+
return this.actualValues.isVisible !== false;
|
|
384
|
+
}
|
|
385
|
+
}, {
|
|
386
|
+
key: "calcVisibility",
|
|
387
|
+
value: function calcVisibility() {
|
|
388
|
+
var _this$getX, _this$getY;
|
|
389
|
+
var parent = this.parent;
|
|
390
|
+
if (!parent) {
|
|
391
|
+
return false;
|
|
392
|
+
}
|
|
393
|
+
var x = (_this$getX = this.getX()) !== null && _this$getX !== void 0 ? _this$getX : 0;
|
|
394
|
+
var y = (_this$getY = this.getY()) !== null && _this$getY !== void 0 ? _this$getY : 0;
|
|
395
|
+
var width = this.getWidth();
|
|
396
|
+
var height = this.getHeight();
|
|
397
|
+
var parentWidth = parent.getWidth();
|
|
398
|
+
var parentHeight = parent.getHeight();
|
|
399
|
+
return x + width >= 0 && y + height >= 0 && x <= parentWidth && y <= parentHeight;
|
|
400
|
+
}
|
|
401
|
+
}, {
|
|
402
|
+
key: "validateVisibilityInParent",
|
|
403
|
+
value: function validateVisibilityInParent() {
|
|
404
|
+
return true;
|
|
405
|
+
}
|
|
406
|
+
}, {
|
|
407
|
+
key: "addToParentVisibleChildren",
|
|
408
|
+
value: function addToParentVisibleChildren() {
|
|
409
|
+
if (this.isVisible() && this.isInFlow() && this.parent) {
|
|
410
|
+
this.parent.visibleChildren.push(this);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}, {
|
|
414
|
+
key: "setLayoutX",
|
|
415
|
+
value: function setLayoutX(value) {
|
|
416
|
+
this.x = value;
|
|
417
|
+
if (!this.explicitX) {
|
|
418
|
+
this.actualValues.x = value;
|
|
419
|
+
this.parent.setChildLayoutValue(this.index, "x", value);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}, {
|
|
423
|
+
key: "setLayoutY",
|
|
424
|
+
value: function setLayoutY(value) {
|
|
425
|
+
this.y = value;
|
|
426
|
+
if (!this.explicitY) {
|
|
427
|
+
this.actualValues.y = value;
|
|
428
|
+
this.parent.setChildLayoutValue(this.index, "y", value);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}, {
|
|
432
|
+
key: "setTarget",
|
|
433
|
+
value: function setTarget(key, value) {
|
|
434
|
+
this.allTargetMap[key] = true;
|
|
435
|
+
if (key === "x") {
|
|
436
|
+
this.explicitX = true;
|
|
437
|
+
} else if (key === "y") {
|
|
438
|
+
this.explicitY = true;
|
|
439
|
+
}
|
|
440
|
+
this.parent.setChildTarget(this.index, key, value);
|
|
441
|
+
return this;
|
|
442
|
+
}
|
|
443
|
+
}, {
|
|
444
|
+
key: "activateTarget",
|
|
445
|
+
value: function activateTarget(key) {
|
|
446
|
+
this.parent.activateGpuChildTarget(this.index, key);
|
|
447
|
+
return this;
|
|
448
|
+
}
|
|
449
|
+
}, {
|
|
450
|
+
key: "getLayoutHeight",
|
|
451
|
+
value: function getLayoutHeight() {
|
|
452
|
+
var height = this.getHeight();
|
|
453
|
+
if (this.usesContentBoxSizing()) {
|
|
454
|
+
height += this.getPaddingTop() + this.getPaddingBottom();
|
|
455
|
+
}
|
|
456
|
+
return height;
|
|
457
|
+
}
|
|
458
|
+
}, {
|
|
459
|
+
key: "getLayoutWidth",
|
|
460
|
+
value: function getLayoutWidth() {
|
|
461
|
+
var width = this.getWidth();
|
|
462
|
+
if (this.usesContentBoxSizing()) {
|
|
463
|
+
width += this.getPaddingLeft() + this.getPaddingRight();
|
|
464
|
+
}
|
|
465
|
+
return width;
|
|
466
|
+
}
|
|
467
|
+
}, {
|
|
468
|
+
key: "usesContentBoxSizing",
|
|
469
|
+
value: function usesContentBoxSizing() {
|
|
470
|
+
return this.getBoxSizing() !== "border-box";
|
|
471
|
+
}
|
|
472
|
+
}, {
|
|
473
|
+
key: "getBoxSizing",
|
|
474
|
+
value: function getBoxSizing() {
|
|
475
|
+
var _ref5, _ref6, _this$val10;
|
|
476
|
+
return (_ref5 = (_ref6 = (_this$val10 = this.val("boxSizing")) !== null && _this$val10 !== void 0 ? _this$val10 : this.val("box-sizing")) !== null && _ref6 !== void 0 ? _ref6 : this.getParentValue("boxSizing")) !== null && _ref5 !== void 0 ? _ref5 : "content-box";
|
|
477
|
+
}
|
|
478
|
+
}, {
|
|
479
|
+
key: "getPaddingTop",
|
|
480
|
+
value: function getPaddingTop() {
|
|
481
|
+
var _ref7, _this$val11;
|
|
482
|
+
return (_ref7 = (_this$val11 = this.val("paddingTop")) !== null && _this$val11 !== void 0 ? _this$val11 : this.val("topPadding")) !== null && _ref7 !== void 0 ? _ref7 : TModelUtil.getPaddingValue(this, "top");
|
|
483
|
+
}
|
|
484
|
+
}, {
|
|
485
|
+
key: "getPaddingLeft",
|
|
486
|
+
value: function getPaddingLeft() {
|
|
487
|
+
var _ref8, _this$val12;
|
|
488
|
+
return (_ref8 = (_this$val12 = this.val("paddingLeft")) !== null && _this$val12 !== void 0 ? _this$val12 : this.val("leftPadding")) !== null && _ref8 !== void 0 ? _ref8 : TModelUtil.getPaddingValue(this, "left");
|
|
489
|
+
}
|
|
490
|
+
}, {
|
|
491
|
+
key: "getPaddingRight",
|
|
492
|
+
value: function getPaddingRight() {
|
|
493
|
+
var _ref9, _this$val13;
|
|
494
|
+
return (_ref9 = (_this$val13 = this.val("paddingRight")) !== null && _this$val13 !== void 0 ? _this$val13 : this.val("rightPadding")) !== null && _ref9 !== void 0 ? _ref9 : TModelUtil.getPaddingValue(this, "right");
|
|
495
|
+
}
|
|
496
|
+
}, {
|
|
497
|
+
key: "getPaddingBottom",
|
|
498
|
+
value: function getPaddingBottom() {
|
|
499
|
+
var _ref10, _this$val14;
|
|
500
|
+
return (_ref10 = (_this$val14 = this.val("paddingBottom")) !== null && _this$val14 !== void 0 ? _this$val14 : this.val("bottomPadding")) !== null && _ref10 !== void 0 ? _ref10 : TModelUtil.getPaddingValue(this, "bottom");
|
|
501
|
+
}
|
|
502
|
+
}]);
|
|
503
|
+
}();
|
|
504
|
+
export { Child };
|
package/build/EventListener.js
CHANGED
|
@@ -377,6 +377,15 @@ var EventListener = /*#__PURE__*/function () {
|
|
|
377
377
|
mark(this.currentHandlers.scrollTop, "scrolltop-event");
|
|
378
378
|
mark(this.currentHandlers.pinch, "pinch-event");
|
|
379
379
|
break;
|
|
380
|
+
case "popstate":
|
|
381
|
+
for (var _i2 = 0, _Object$values = Object.values(getManager().visibleOidMap); _i2 < _Object$values.length; _i2++) {
|
|
382
|
+
var _tmodel$externalEvent;
|
|
383
|
+
var tmodel = _Object$values[_i2];
|
|
384
|
+
if ((_tmodel$externalEvent = tmodel.externalEventMap) !== null && _tmodel$externalEvent !== void 0 && _tmodel$externalEvent.has("onPopState")) {
|
|
385
|
+
mark(tmodel, "popstate-event");
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
break;
|
|
380
389
|
}
|
|
381
390
|
}
|
|
382
391
|
}, {
|
|
@@ -698,7 +707,7 @@ var EventListener = /*#__PURE__*/function () {
|
|
|
698
707
|
if (el && el.nodeType === 1) {
|
|
699
708
|
oid = el.getAttribute('tgjs-oid') || el.id;
|
|
700
709
|
}
|
|
701
|
-
if (!oid || !
|
|
710
|
+
if (!oid || !getManager().visibleOidMap[oid]) {
|
|
702
711
|
oid = el === null || el === void 0 ? void 0 : el.id;
|
|
703
712
|
if (!oid || !getManager().visibleOidMap[oid]) {
|
|
704
713
|
oid = $Dom.findNearestParentWithId(event.target);
|