targetj 1.0.116 → 1.0.118
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/$Dom.js +51 -5
- package/build/App.js +11 -13
- package/build/BaseModel.js +194 -46
- package/build/Bracket.js +30 -7
- package/build/BracketGenerator.js +29 -6
- package/build/EventListener.js +258 -181
- package/build/LocationManager.js +209 -111
- package/build/PageManager.js +4 -3
- package/build/RunScheduler.js +161 -155
- package/build/SearchUtil.js +41 -5
- package/build/TModel.js +210 -129
- package/build/TModelManager.js +79 -142
- package/build/TModelUtil.js +110 -5
- package/build/TUtil.js +32 -24
- package/build/TargetExecutor.js +25 -8
- package/build/TargetManager.js +57 -31
- package/build/TargetUtil.js +100 -50
- package/build/Viewport.js +2 -1
- package/package.json +1 -1
package/build/$Dom.js
CHANGED
|
@@ -60,7 +60,7 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
|
|
|
60
60
|
}, {
|
|
61
61
|
key: "setId",
|
|
62
62
|
value: function setId(id) {
|
|
63
|
-
this.attr(
|
|
63
|
+
this.attr('id', id[0] === '#' ? id.slice(1) : id);
|
|
64
64
|
}
|
|
65
65
|
}, {
|
|
66
66
|
key: "focus",
|
|
@@ -125,9 +125,9 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
|
|
|
125
125
|
key: "css",
|
|
126
126
|
value: function css(_css) {
|
|
127
127
|
if (_TUtil.TUtil.isDefined(_css)) {
|
|
128
|
-
this.
|
|
128
|
+
this.element.className = _css;
|
|
129
129
|
} else {
|
|
130
|
-
return this.
|
|
130
|
+
return this.element.className;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}, {
|
|
@@ -161,6 +161,12 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
|
|
|
161
161
|
value: function getBoundingClientRect() {
|
|
162
162
|
return this.element.getBoundingClientRect();
|
|
163
163
|
}
|
|
164
|
+
}, {
|
|
165
|
+
key: "isXYWithinElement",
|
|
166
|
+
value: function isXYWithinElement(x, y) {
|
|
167
|
+
var rect = this.getBoundingClientRect();
|
|
168
|
+
return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;
|
|
169
|
+
}
|
|
164
170
|
}, {
|
|
165
171
|
key: "parent",
|
|
166
172
|
value: function parent() {
|
|
@@ -174,6 +180,11 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
|
|
|
174
180
|
this.$domParent.childrenCount--;
|
|
175
181
|
}
|
|
176
182
|
}
|
|
183
|
+
}, {
|
|
184
|
+
key: "child",
|
|
185
|
+
value: function child(index) {
|
|
186
|
+
return this.element.children[index];
|
|
187
|
+
}
|
|
177
188
|
}, {
|
|
178
189
|
key: "append$Dom",
|
|
179
190
|
value: function append$Dom($dom) {
|
|
@@ -198,6 +209,12 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
|
|
|
198
209
|
tmodel.$dom.$domParent = this;
|
|
199
210
|
this.childrenCount++;
|
|
200
211
|
}
|
|
212
|
+
}, {
|
|
213
|
+
key: "deleteAllChildren",
|
|
214
|
+
value: function deleteAllChildren() {
|
|
215
|
+
this.element.innerHTML = this.originalContent || '';
|
|
216
|
+
this.childrenCount = 0;
|
|
217
|
+
}
|
|
201
218
|
}, {
|
|
202
219
|
key: "html",
|
|
203
220
|
value: function html(_html) {
|
|
@@ -218,7 +235,7 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
|
|
|
218
235
|
this.textOnly = false;
|
|
219
236
|
}
|
|
220
237
|
} else {
|
|
221
|
-
return this.originalContent;
|
|
238
|
+
return _TUtil.TUtil.isDefined(this.originalContent) ? this.originalContent : this.element.innerHTML;
|
|
222
239
|
}
|
|
223
240
|
}
|
|
224
241
|
}, {
|
|
@@ -240,7 +257,7 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
|
|
|
240
257
|
this.textOnly = true;
|
|
241
258
|
}
|
|
242
259
|
} else {
|
|
243
|
-
return this.originalContent;
|
|
260
|
+
return _TUtil.TUtil.isDefined(this.originalContent) ? this.originalContent : this.element.textContent;
|
|
244
261
|
}
|
|
245
262
|
}
|
|
246
263
|
}, {
|
|
@@ -257,6 +274,15 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
|
|
|
257
274
|
return this.element.innerHTML;
|
|
258
275
|
}
|
|
259
276
|
}
|
|
277
|
+
}, {
|
|
278
|
+
key: "innerText",
|
|
279
|
+
value: function innerText(text) {
|
|
280
|
+
if (_TUtil.TUtil.isDefined(text)) {
|
|
281
|
+
this.element.innerText = text;
|
|
282
|
+
} else {
|
|
283
|
+
return this.element.innerText;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
260
286
|
}, {
|
|
261
287
|
key: "addClass",
|
|
262
288
|
value: function addClass(className) {
|
|
@@ -320,7 +346,17 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
|
|
|
320
346
|
value: function query(selector) {
|
|
321
347
|
return selector[0] === '#' ? $Dom.findById(selector) : selector[0] === '.' ? this.findFirstByClass(selector) : this.findFirstByTag(selector);
|
|
322
348
|
}
|
|
349
|
+
}, {
|
|
350
|
+
key: "stamp",
|
|
351
|
+
value: function stamp() {
|
|
352
|
+
this.attr('data-tgt', 'true');
|
|
353
|
+
}
|
|
323
354
|
}], [{
|
|
355
|
+
key: "getAllStamped",
|
|
356
|
+
value: function getAllStamped() {
|
|
357
|
+
return document.querySelectorAll('[data-tgt="true"]');
|
|
358
|
+
}
|
|
359
|
+
}, {
|
|
324
360
|
key: "query",
|
|
325
361
|
value: function query(selector) {
|
|
326
362
|
return selector[0] === '#' ? $Dom.findById(selector) : selector[0] === '.' ? $Dom.findFirstByClass(selector) : $Dom.findFirstByTag(selector);
|
|
@@ -378,6 +414,16 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
|
|
|
378
414
|
value: function hasFocus(tmodel) {
|
|
379
415
|
return tmodel.hasDom() && document.activeElement === tmodel.$dom.element;
|
|
380
416
|
}
|
|
417
|
+
}, {
|
|
418
|
+
key: "getWindowScrollTop",
|
|
419
|
+
value: function getWindowScrollTop() {
|
|
420
|
+
return window.pageYOffset || document.documentElement.scrollTop || 0;
|
|
421
|
+
}
|
|
422
|
+
}, {
|
|
423
|
+
key: "getWindowScrollLeft",
|
|
424
|
+
value: function getWindowScrollLeft() {
|
|
425
|
+
return window.pageXOffset || document.documentElement.scrollLeft || 0;
|
|
426
|
+
}
|
|
381
427
|
}, {
|
|
382
428
|
key: "ready",
|
|
383
429
|
value: function ready(callback) {
|
package/build/App.js
CHANGED
|
@@ -29,7 +29,6 @@ var AppFn = function AppFn(firstChild) {
|
|
|
29
29
|
my.init = function () {
|
|
30
30
|
my.browser = new _Browser.Browser();
|
|
31
31
|
my.browser.setup();
|
|
32
|
-
my.$document = new _$Dom.$Dom(document);
|
|
33
32
|
my.$window = new _$Dom.$Dom(window);
|
|
34
33
|
my.$window.addEvent("popstate", function (event) {
|
|
35
34
|
if (event.state) {
|
|
@@ -57,9 +56,11 @@ var AppFn = function AppFn(firstChild) {
|
|
|
57
56
|
this.$dom = new _$Dom.$Dom('#tj-root');
|
|
58
57
|
}
|
|
59
58
|
},
|
|
59
|
+
styling: false,
|
|
60
60
|
domHolder: function domHolder() {
|
|
61
61
|
return this.$dom;
|
|
62
62
|
},
|
|
63
|
+
isVisible: true,
|
|
63
64
|
width: function width() {
|
|
64
65
|
return document.documentElement.clientWidth || document.body.clientWidth;
|
|
65
66
|
},
|
|
@@ -91,18 +92,17 @@ var AppFn = function AppFn(firstChild) {
|
|
|
91
92
|
while (1) switch (_context.prev = _context.next) {
|
|
92
93
|
case 0:
|
|
93
94
|
my.runningFlag = false;
|
|
95
|
+
my.events.detachAll();
|
|
96
|
+
my.events.detachWindowEvents();
|
|
97
|
+
my.events.attachWindowEvents();
|
|
94
98
|
my.events.clearAll();
|
|
95
|
-
|
|
96
|
-
my.events.addHandlers(my.$document);
|
|
97
|
-
my.events.removeWindowHandlers();
|
|
98
|
-
my.events.addWindowHandlers();
|
|
99
|
-
_context.next = 8;
|
|
99
|
+
_context.next = 7;
|
|
100
100
|
return my.runScheduler.resetRuns();
|
|
101
|
-
case
|
|
101
|
+
case 7:
|
|
102
102
|
my.runningFlag = true;
|
|
103
103
|
my.runScheduler.schedule(0, "appStart");
|
|
104
104
|
return _context.abrupt("return", my);
|
|
105
|
-
case
|
|
105
|
+
case 10:
|
|
106
106
|
case "end":
|
|
107
107
|
return _context.stop();
|
|
108
108
|
}
|
|
@@ -113,8 +113,8 @@ var AppFn = function AppFn(firstChild) {
|
|
|
113
113
|
while (1) switch (_context2.prev = _context2.next) {
|
|
114
114
|
case 0:
|
|
115
115
|
my.runningFlag = false;
|
|
116
|
-
my.events.
|
|
117
|
-
my.events.
|
|
116
|
+
my.events.detachAll();
|
|
117
|
+
my.events.detachWindowEvents();
|
|
118
118
|
my.events.clearAll();
|
|
119
119
|
_context2.next = 6;
|
|
120
120
|
return my.runScheduler.resetRuns();
|
|
@@ -140,9 +140,7 @@ var AppFn = function AppFn(firstChild) {
|
|
|
140
140
|
my.locationManager.hasLocationList.length = 0;
|
|
141
141
|
my.locationManager.screenWidth = 0;
|
|
142
142
|
my.locationManager.screenHeight = 0;
|
|
143
|
-
_SearchUtil.SearchUtil.
|
|
144
|
-
_SearchUtil.SearchUtil.foundTypeMap = {};
|
|
145
|
-
_SearchUtil.SearchUtil.foundTargetMap = {};
|
|
143
|
+
_SearchUtil.SearchUtil.clear();
|
|
146
144
|
};
|
|
147
145
|
my.isRunning = function () {
|
|
148
146
|
return my.runningFlag;
|
package/build/BaseModel.js
CHANGED
|
@@ -9,6 +9,7 @@ var _TargetExecutor = require("./TargetExecutor.js");
|
|
|
9
9
|
var _TUtil = require("./TUtil.js");
|
|
10
10
|
var _TModelUtil = require("./TModelUtil.js");
|
|
11
11
|
var _TargetUtil = require("./TargetUtil.js");
|
|
12
|
+
var _$Dom = require("./$Dom.js");
|
|
12
13
|
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; } } }; }
|
|
13
14
|
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; }
|
|
14
15
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
@@ -38,19 +39,26 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
38
39
|
var uniqueId = _App.App.getOid(this.type);
|
|
39
40
|
this.oid = uniqueId.oid;
|
|
40
41
|
this.oidNum = uniqueId.num;
|
|
41
|
-
this.targetValues =
|
|
42
|
-
this.actualValues =
|
|
42
|
+
this.targetValues = {};
|
|
43
|
+
this.actualValues = {};
|
|
43
44
|
this.activeTargetList = [];
|
|
44
45
|
this.activeTargetMap = {};
|
|
45
46
|
this.updatingTargetList = [];
|
|
46
47
|
this.updatingTargetMap = {};
|
|
47
48
|
this.updatingChildrenList = [];
|
|
48
49
|
this.updatingChildrenMap = {};
|
|
49
|
-
this.
|
|
50
|
+
this.activeChildrenList = [];
|
|
51
|
+
this.activeChildrenMap = {};
|
|
52
|
+
this.eventTargetList = [];
|
|
53
|
+
this.eventTargetMap = {};
|
|
54
|
+
this.coreTargets = [];
|
|
50
55
|
this.allStyleTargetList = [];
|
|
51
56
|
this.allStyleTargetMap = {};
|
|
52
57
|
this.styleTargetList = [];
|
|
53
58
|
this.styleTargetMap = {};
|
|
59
|
+
this.asyncStyleTargetList = [];
|
|
60
|
+
this.asyncStyleTargetMap = {};
|
|
61
|
+
this.activatedTargets = [];
|
|
54
62
|
this.targetExecutionCount = 0;
|
|
55
63
|
this.parent = null;
|
|
56
64
|
this.targetMethodMap = {};
|
|
@@ -68,14 +76,19 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
68
76
|
this.targetValues = {};
|
|
69
77
|
this.activeTargetMap = {};
|
|
70
78
|
this.activeTargetList = [];
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
var domExists = _$Dom.$Dom.query("#".concat(this.oid));
|
|
80
|
+
if (!domExists && !this.excludeDefaultStyling()) {
|
|
81
|
+
Object.entries(_TModelUtil.TModelUtil.defaultTargets()).forEach(function (_ref) {
|
|
82
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
83
|
+
key = _ref2[0],
|
|
84
|
+
value = _ref2[1];
|
|
85
|
+
if (!(key in _this.targets)) {
|
|
86
|
+
_this.targets[key] = value;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
} else if (domExists && !_TUtil.TUtil.isDefined(this.targets['reuseDomDefinition'])) {
|
|
90
|
+
this.targets['reuseDomDefinition'] = true;
|
|
91
|
+
}
|
|
79
92
|
Object.keys(this.targets).forEach(function (key) {
|
|
80
93
|
_this.processNewTarget(key);
|
|
81
94
|
});
|
|
@@ -83,42 +96,133 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
83
96
|
}, {
|
|
84
97
|
key: "processNewTarget",
|
|
85
98
|
value: function processNewTarget(key) {
|
|
86
|
-
|
|
87
|
-
|
|
99
|
+
var isInactiveKey = key.startsWith('_');
|
|
100
|
+
if (isInactiveKey) {
|
|
101
|
+
var newKey = key.slice(1);
|
|
102
|
+
this.targets[newKey] = _typeof(this.targets[key]) === 'object' && this.targets[key].value ? this.targets[key] : {
|
|
103
|
+
value: this.targets[key]
|
|
104
|
+
};
|
|
105
|
+
this.targets[newKey].active = false;
|
|
106
|
+
delete this.targets[key];
|
|
107
|
+
key = newKey;
|
|
108
|
+
}
|
|
109
|
+
var target = this.targets[key];
|
|
110
|
+
if (!_TUtil.TUtil.isDefined(target)) {
|
|
111
|
+
this.delVal('key');
|
|
88
112
|
return;
|
|
89
113
|
}
|
|
90
114
|
_TargetUtil.TargetUtil.bindTargetName(this.targets, key);
|
|
91
|
-
if (_TargetUtil.TargetUtil.
|
|
92
|
-
if (this.
|
|
93
|
-
this.
|
|
115
|
+
if (_TargetUtil.TargetUtil.allEventMap[key] || _TargetUtil.TargetUtil.internalEventMap[key]) {
|
|
116
|
+
if (!this.eventTargetMap[key]) {
|
|
117
|
+
this.eventTargetList.push(key);
|
|
118
|
+
this.eventTargetMap[key] = true;
|
|
94
119
|
}
|
|
95
120
|
return;
|
|
96
|
-
}
|
|
121
|
+
}
|
|
122
|
+
if (_TargetUtil.TargetUtil.otherTargetEventsMap[key]) {
|
|
97
123
|
return;
|
|
98
124
|
}
|
|
99
|
-
if (_TUtil.TUtil.isDefined(
|
|
100
|
-
this.
|
|
125
|
+
if (_TUtil.TUtil.isDefined(target.initialValue)) {
|
|
126
|
+
this.val(key, target.initialValue);
|
|
127
|
+
}
|
|
128
|
+
if (!isInactiveKey) {
|
|
101
129
|
this.addToStyleTargetList(key);
|
|
102
130
|
}
|
|
103
|
-
if (
|
|
131
|
+
if (_TargetUtil.TargetUtil.coreTargetMap[key] && !this.coreTargets.includes(key)) {
|
|
132
|
+
this.coreTargets.push(key);
|
|
133
|
+
}
|
|
134
|
+
if (!_TargetUtil.TargetUtil.mustExecuteTargets[key] && _TUtil.TUtil.isStringBooleanOrNumber(target)) {
|
|
135
|
+
this.val(key, target);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (target.active !== false && this.canTargetBeActivated(key)) {
|
|
104
139
|
this.addToActiveTargets(key);
|
|
105
140
|
}
|
|
106
141
|
}
|
|
142
|
+
}, {
|
|
143
|
+
key: "activate",
|
|
144
|
+
value: function activate(targetName) {
|
|
145
|
+
(0, _App.getLocationManager)().addToActivatedList(this);
|
|
146
|
+
this.currentStatus = 'active';
|
|
147
|
+
if (targetName && this.isTargetEnabled(targetName) && this.activatedTargets.indexOf(targetName) === -1) {
|
|
148
|
+
this.activatedTargets.push(targetName);
|
|
149
|
+
this.removeFromActiveTargets(targetName);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}, {
|
|
153
|
+
key: "isActivated",
|
|
154
|
+
value: function isActivated() {
|
|
155
|
+
return this.currentStatus === 'active';
|
|
156
|
+
}
|
|
157
|
+
}, {
|
|
158
|
+
key: "deactivate",
|
|
159
|
+
value: function deactivate() {
|
|
160
|
+
this.currentStatus = undefined;
|
|
161
|
+
this.activatedTargets.length = 0;
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
key: "shouldExecuteCyclesInParallel",
|
|
165
|
+
value: function shouldExecuteCyclesInParallel(key) {
|
|
166
|
+
var _this$targets$key;
|
|
167
|
+
return ((_this$targets$key = this.targets[key]) === null || _this$targets$key === void 0 ? void 0 : _this$targets$key.parallel) === true;
|
|
168
|
+
}
|
|
169
|
+
}, {
|
|
170
|
+
key: "canTargetBeActivated",
|
|
171
|
+
value: function canTargetBeActivated(key) {
|
|
172
|
+
return Array.isArray(this.targets['onDomEvent']) && this.targets['onDomEvent'].includes(key) && !this.hasDom() ? false : true;
|
|
173
|
+
}
|
|
107
174
|
}, {
|
|
108
175
|
key: "addToStyleTargetList",
|
|
109
176
|
value: function addToStyleTargetList(key) {
|
|
110
|
-
if (
|
|
177
|
+
if (this.excludeStyling() || this.targets["exclude".concat(_TUtil.TUtil.capitalizeFirstLetter(key))]) {
|
|
111
178
|
return;
|
|
112
179
|
}
|
|
113
|
-
|
|
180
|
+
var isAsyncStyleTarget = _TargetUtil.TargetUtil.asyncStyleTargetMap[key];
|
|
181
|
+
var isAttributeTarget = _TargetUtil.TargetUtil.attributeTargetMap[key];
|
|
182
|
+
if (isAsyncStyleTarget || isAttributeTarget) {
|
|
183
|
+
if (!this.asyncStyleTargetMap[key]) {
|
|
184
|
+
this.asyncStyleTargetList.push(key);
|
|
185
|
+
this.asyncStyleTargetMap[key] = true;
|
|
186
|
+
}
|
|
187
|
+
} else if (this.isStyleTarget(key)) {
|
|
188
|
+
if (_TargetUtil.TargetUtil.transformMap[key]) {
|
|
189
|
+
if (this.getParent()) {
|
|
190
|
+
this.calcAbsolutePosition(this.getX(), this.getY());
|
|
191
|
+
}
|
|
192
|
+
if (_TModelUtil.TModelUtil.getTransformValue(this, key) === this.transformMap[key]) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
} else if (key === 'width' || key === 'height') {
|
|
196
|
+
var dimension = Math.floor(key === 'width' ? this.getWidth() : this.getHeight());
|
|
197
|
+
if (this.styleMap[key] === dimension) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
} else if (_TUtil.TUtil.isDefined(this.val(key)) && this.styleMap[key] === this.val(key)) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
this.styleTargetList.push(key);
|
|
204
|
+
this.styleTargetMap[key] = true;
|
|
205
|
+
} else if (this.useWindowFrame(key)) {
|
|
114
206
|
this.styleTargetList.push(key);
|
|
115
207
|
this.styleTargetMap[key] = true;
|
|
208
|
+
} else {
|
|
209
|
+
return;
|
|
116
210
|
}
|
|
117
211
|
if (!this.allStyleTargetMap[key]) {
|
|
118
212
|
this.allStyleTargetList.push(key);
|
|
119
213
|
this.allStyleTargetMap[key] = true;
|
|
120
214
|
}
|
|
121
215
|
}
|
|
216
|
+
}, {
|
|
217
|
+
key: "isStyleTarget",
|
|
218
|
+
value: function isStyleTarget(key) {
|
|
219
|
+
return _TargetUtil.TargetUtil.styleTargetMap[key];
|
|
220
|
+
}
|
|
221
|
+
}, {
|
|
222
|
+
key: "useWindowFrame",
|
|
223
|
+
value: function useWindowFrame(key) {
|
|
224
|
+
return Array.isArray(this.targets['useWindowFrame']) && this.targets['useWindowFrame'].includes(key);
|
|
225
|
+
}
|
|
122
226
|
}, {
|
|
123
227
|
key: "removeTarget",
|
|
124
228
|
value: function removeTarget(key) {
|
|
@@ -321,11 +425,18 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
321
425
|
value: function getScheduleTimeStamp(key) {
|
|
322
426
|
return this.targetValues[key] ? this.targetValues[key].scheduleTimeStamp : undefined;
|
|
323
427
|
}
|
|
428
|
+
}, {
|
|
429
|
+
key: "isScheduledPending",
|
|
430
|
+
value: function isScheduledPending(key) {
|
|
431
|
+
var lastScheduledTime = this.getScheduleTimeStamp(key);
|
|
432
|
+
var interval = this.getTargetInterval(key);
|
|
433
|
+
return lastScheduledTime && lastScheduledTime + interval > _TUtil.TUtil.now();
|
|
434
|
+
}
|
|
324
435
|
}, {
|
|
325
436
|
key: "shouldScheduleRun",
|
|
326
437
|
value: function shouldScheduleRun(key) {
|
|
327
|
-
var _this$targets$key$tri, _this$targets$
|
|
328
|
-
return (_this$targets$key$tri = (_this$targets$
|
|
438
|
+
var _this$targets$key$tri, _this$targets$key2;
|
|
439
|
+
return (_this$targets$key$tri = (_this$targets$key2 = this.targets[key]) === null || _this$targets$key2 === void 0 ? void 0 : _this$targets$key2.triggerRerun) !== null && _this$targets$key$tri !== void 0 ? _this$targets$key$tri : true;
|
|
329
440
|
}
|
|
330
441
|
}, {
|
|
331
442
|
key: "getTargetInitialValue",
|
|
@@ -405,7 +516,12 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
405
516
|
}, {
|
|
406
517
|
key: "getTargetInterval",
|
|
407
518
|
value: function getTargetInterval(key) {
|
|
408
|
-
|
|
519
|
+
var targetValue = this.targetValues[key];
|
|
520
|
+
var defaultInterval = 0;
|
|
521
|
+
if (this.isStyleTarget(key) || this.useWindowFrame(key)) {
|
|
522
|
+
return targetValue ? targetValue.interval : 0;
|
|
523
|
+
}
|
|
524
|
+
return _TUtil.TUtil.isDefined(this.targets['interval']) ? this.targets['interval'] : (targetValue === null || targetValue === void 0 ? void 0 : targetValue.interval) || defaultInterval;
|
|
409
525
|
}
|
|
410
526
|
}, {
|
|
411
527
|
key: "getTargetEventFunctions",
|
|
@@ -437,7 +553,8 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
437
553
|
key: "addToActiveTargets",
|
|
438
554
|
value: function addToActiveTargets(key) {
|
|
439
555
|
var _this3 = this;
|
|
440
|
-
if (!this.activeTargetMap[key]) {
|
|
556
|
+
if (!this.activeTargetMap[key] && this.canTargetBeActivated(key)) {
|
|
557
|
+
var _this$getParent;
|
|
441
558
|
this.activeTargetMap[key] = true;
|
|
442
559
|
var priorityOrder = ['y', 'x', 'height', 'width', 'start'];
|
|
443
560
|
var priorityIndex = priorityOrder.indexOf(key);
|
|
@@ -453,6 +570,7 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
453
570
|
} else {
|
|
454
571
|
this.activeTargetList.push(key);
|
|
455
572
|
}
|
|
573
|
+
(_this$getParent = this.getParent()) === null || _this$getParent === void 0 || _this$getParent.addToActiveChildren(this);
|
|
456
574
|
}
|
|
457
575
|
}
|
|
458
576
|
}, {
|
|
@@ -464,17 +582,20 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
464
582
|
if (index >= 0) {
|
|
465
583
|
this.activeTargetList.splice(index, 1);
|
|
466
584
|
}
|
|
585
|
+
if (this.activeTargetList.length === 0) {
|
|
586
|
+
var _this$getParent2;
|
|
587
|
+
(_this$getParent2 = this.getParent()) === null || _this$getParent2 === void 0 || _this$getParent2.removeFromActiveChildren(this);
|
|
588
|
+
}
|
|
467
589
|
}
|
|
468
590
|
}
|
|
469
591
|
}, {
|
|
470
592
|
key: "addToUpdatingTargets",
|
|
471
593
|
value: function addToUpdatingTargets(key) {
|
|
472
594
|
if (!this.updatingTargetMap[key]) {
|
|
595
|
+
var _this$getParent3;
|
|
473
596
|
this.updatingTargetMap[key] = true;
|
|
474
597
|
this.updatingTargetList.push(key);
|
|
475
|
-
|
|
476
|
-
this.getParent().addToUpdatingChildren(this);
|
|
477
|
-
}
|
|
598
|
+
(_this$getParent3 = this.getParent()) === null || _this$getParent3 === void 0 || _this$getParent3.addToUpdatingChildren(this);
|
|
478
599
|
}
|
|
479
600
|
}
|
|
480
601
|
}, {
|
|
@@ -486,8 +607,9 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
486
607
|
if (index >= 0) {
|
|
487
608
|
this.updatingTargetList.splice(index, 1);
|
|
488
609
|
}
|
|
489
|
-
if (this.updatingTargetList.length === 0
|
|
490
|
-
|
|
610
|
+
if (this.updatingTargetList.length === 0) {
|
|
611
|
+
var _this$getParent4;
|
|
612
|
+
(_this$getParent4 = this.getParent()) === null || _this$getParent4 === void 0 || _this$getParent4.removeFromUpdatingChildren(this);
|
|
491
613
|
}
|
|
492
614
|
}
|
|
493
615
|
}
|
|
@@ -534,6 +656,30 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
534
656
|
value: function hasUpdatingChildren() {
|
|
535
657
|
return this.updatingChildrenList.length > 0;
|
|
536
658
|
}
|
|
659
|
+
}, {
|
|
660
|
+
key: "addToActiveChildren",
|
|
661
|
+
value: function addToActiveChildren(child) {
|
|
662
|
+
if (!this.activeChildrenMap[child.oid]) {
|
|
663
|
+
this.activeChildrenMap[child.oid] = true;
|
|
664
|
+
this.activeChildrenList.push(child.oid);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}, {
|
|
668
|
+
key: "removeFromActiveChildren",
|
|
669
|
+
value: function removeFromActiveChildren(child) {
|
|
670
|
+
if (this.activeChildrenMap[child.oid]) {
|
|
671
|
+
delete this.activeChildrenMap[child.oid];
|
|
672
|
+
var index = this.activeChildrenList.indexOf(child.oid);
|
|
673
|
+
if (index >= 0) {
|
|
674
|
+
this.activeChildrenList.splice(index, 1);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}, {
|
|
679
|
+
key: "hasActiveChildren",
|
|
680
|
+
value: function hasActiveChildren() {
|
|
681
|
+
return this.activeChildrenList.length > 0;
|
|
682
|
+
}
|
|
537
683
|
}, {
|
|
538
684
|
key: "deleteTargetValue",
|
|
539
685
|
value: function deleteTargetValue(key) {
|
|
@@ -560,37 +706,39 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
560
706
|
}
|
|
561
707
|
}, {
|
|
562
708
|
key: "activateTarget",
|
|
563
|
-
value: function activateTarget(key) {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
var _this4 = this;
|
|
570
|
-
keys.forEach(function (key) {
|
|
571
|
-
var targetValue = _this4.targetValues[key];
|
|
709
|
+
value: function activateTarget(key, value) {
|
|
710
|
+
if (this.canTargetBeActivated(key)) {
|
|
711
|
+
if (_TUtil.TUtil.isDefined('value')) {
|
|
712
|
+
this.val("__".concat(key), value);
|
|
713
|
+
}
|
|
714
|
+
var targetValue = this.targetValues[key];
|
|
572
715
|
if (targetValue) {
|
|
573
716
|
targetValue.executionFlag = false;
|
|
574
717
|
targetValue.scheduleTimeStamp = undefined;
|
|
575
718
|
targetValue.step = 0;
|
|
576
719
|
targetValue.cycle = Array.isArray(targetValue.valueList) ? 1 : 0;
|
|
577
|
-
|
|
720
|
+
this.updateTargetStatus(key);
|
|
578
721
|
} else {
|
|
579
|
-
|
|
722
|
+
this.addToActiveTargets(key);
|
|
580
723
|
}
|
|
581
|
-
|
|
582
|
-
|
|
724
|
+
this.activate(key);
|
|
725
|
+
}
|
|
583
726
|
return this;
|
|
584
727
|
}
|
|
585
728
|
}, {
|
|
586
729
|
key: "manageChildTargetExecution",
|
|
587
730
|
value: function manageChildTargetExecution(child, shouldCalculateChildTargets) {
|
|
588
|
-
return shouldCalculateChildTargets || this.shouldCalculateChildTargets() ||
|
|
731
|
+
return shouldCalculateChildTargets || this.shouldCalculateChildTargets() || child.hasChildren() || child.addedChildren.count > 0 || child.targetExecutionCount === 0;
|
|
589
732
|
}
|
|
590
733
|
}, {
|
|
591
734
|
key: "shouldCalculateChildTargets",
|
|
592
735
|
value: function shouldCalculateChildTargets() {
|
|
593
|
-
return this.
|
|
736
|
+
return this.val('shouldCalculateChildTargets');
|
|
737
|
+
}
|
|
738
|
+
}, {
|
|
739
|
+
key: "getCoreTargets",
|
|
740
|
+
value: function getCoreTargets() {
|
|
741
|
+
return _TUtil.TUtil.isDefined(this.val('coreTargets')) ? this.val('coreTargets') : this.coreTargets;
|
|
594
742
|
}
|
|
595
743
|
}, {
|
|
596
744
|
key: "setTargetMethodName",
|
package/build/Bracket.js
CHANGED
|
@@ -27,20 +27,36 @@ var Bracket = exports.Bracket = /*#__PURE__*/function (_TModel) {
|
|
|
27
27
|
function Bracket(parent) {
|
|
28
28
|
var _this;
|
|
29
29
|
_classCallCheck(this, Bracket);
|
|
30
|
-
_this = _callSuper(this, Bracket, ["BI"
|
|
31
|
-
canHaveDom: false,
|
|
32
|
-
itemOverflowMode: 'never'
|
|
33
|
-
}]);
|
|
30
|
+
_this = _callSuper(this, Bracket, ["BI"]);
|
|
34
31
|
_this.parent = parent;
|
|
35
|
-
_this.newFlag = true;
|
|
36
32
|
return _this;
|
|
37
33
|
}
|
|
38
34
|
_inherits(Bracket, _TModel);
|
|
39
35
|
return _createClass(Bracket, [{
|
|
36
|
+
key: "canHaveDom",
|
|
37
|
+
value: function canHaveDom() {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
key: "getItemOverflowMode",
|
|
42
|
+
value: function getItemOverflowMode() {
|
|
43
|
+
return 'never';
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
40
46
|
key: "shouldBeBracketed",
|
|
41
47
|
value: function shouldBeBracketed() {
|
|
42
48
|
return false;
|
|
43
49
|
}
|
|
50
|
+
}, {
|
|
51
|
+
key: "excludeDefaultStyling",
|
|
52
|
+
value: function excludeDefaultStyling() {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "isIncluded",
|
|
57
|
+
value: function isIncluded() {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
44
60
|
}, {
|
|
45
61
|
key: "getWidth",
|
|
46
62
|
value: function getWidth() {
|
|
@@ -84,6 +100,8 @@ var Bracket = exports.Bracket = /*#__PURE__*/function (_TModel) {
|
|
|
84
100
|
this.viewport.xSouth = this.x;
|
|
85
101
|
this.viewport.xWest = this.x;
|
|
86
102
|
this.viewport.absX = this.getRealParent().viewport.absX;
|
|
103
|
+
this.viewport.absY = this.getRealParent().viewport.absY;
|
|
104
|
+
this.viewport.scrollTop = this.getRealParent().viewport.scrollTop;
|
|
87
105
|
this.viewport.scrollLeft = this.getRealParent().viewport.scrollLeft;
|
|
88
106
|
this.viewport.xOverflowReset = this.getRealParent().viewport.xOverflowReset;
|
|
89
107
|
this.viewport.xOverflowLimit = this.getRealParent().viewport.xOverflowLimit;
|
|
@@ -108,10 +126,15 @@ var Bracket = exports.Bracket = /*#__PURE__*/function (_TModel) {
|
|
|
108
126
|
}, {
|
|
109
127
|
key: "shouldCalculateChildren",
|
|
110
128
|
value: function shouldCalculateChildren() {
|
|
111
|
-
var result = this.isVisible() || this.
|
|
112
|
-
this.
|
|
129
|
+
var result = this.isVisible() || this.currentStatus === 'new';
|
|
130
|
+
this.currentStatus = undefined;
|
|
113
131
|
return result;
|
|
114
132
|
}
|
|
133
|
+
}, {
|
|
134
|
+
key: "validateVisibilityInParent",
|
|
135
|
+
value: function validateVisibilityInParent() {
|
|
136
|
+
return this.getRealParent().validateVisibilityInParent();
|
|
137
|
+
}
|
|
115
138
|
}, {
|
|
116
139
|
key: "getChildren",
|
|
117
140
|
value: function getChildren() {
|