targetj 1.0.92 → 1.0.94
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 +1 -1
- package/build/$Dom.js +10 -0
- package/build/App.js +12 -9
- package/build/BaseModel.js +131 -214
- package/build/Bracket.js +3 -0
- package/build/EventListener.js +66 -16
- package/build/LocationManager.js +47 -61
- package/build/Moves.js +149 -28
- package/build/TModel.js +188 -48
- package/build/TModelManager.js +8 -5
- package/build/TModelUtil.js +64 -12
- package/build/TargetManager.js +14 -7
- package/build/TargetUtil.js +59 -2
- package/package.json +1 -1
package/Export.js
CHANGED
|
@@ -3,8 +3,8 @@ export * from "./build/TModel.js"
|
|
|
3
3
|
export * from "./build/Moves.js"
|
|
4
4
|
export * from "./build/SearchUtil.js"
|
|
5
5
|
export * from "./build/TargetUtil.js"
|
|
6
|
+
export * from "./build/TModelUtil.js"
|
|
6
7
|
export * from "./build/TUtil.js"
|
|
7
|
-
export * from "./build/ColorUtil.js"
|
|
8
8
|
export * from "./build/$Dom.js"
|
|
9
9
|
export * from "./build/Bracket.js"
|
|
10
10
|
export * from "./build/BracketGenerator.js"
|
package/build/$Dom.js
CHANGED
|
@@ -57,6 +57,11 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
|
|
|
57
57
|
value: function focus() {
|
|
58
58
|
this.element.focus();
|
|
59
59
|
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "blur",
|
|
62
|
+
value: function blur() {
|
|
63
|
+
this.element.blur();
|
|
64
|
+
}
|
|
60
65
|
}, {
|
|
61
66
|
key: "attr",
|
|
62
67
|
value: function attr(name, value) {
|
|
@@ -358,6 +363,11 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
|
|
|
358
363
|
parent.removeChild(element);
|
|
359
364
|
}
|
|
360
365
|
}
|
|
366
|
+
}, {
|
|
367
|
+
key: "hasFocus",
|
|
368
|
+
value: function hasFocus(tmodel) {
|
|
369
|
+
return tmodel.hasDom() && document.activeElement === tmodel.$dom.element;
|
|
370
|
+
}
|
|
361
371
|
}, {
|
|
362
372
|
key: "ready",
|
|
363
373
|
value: function ready(callback) {
|
package/build/App.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.tRoot = exports.tApp = exports.isRunning = exports.getScreenWidth = exports.getScreenHeight = exports.getRunScheduler = exports.getPager = exports.getManager = exports.getLocationManager = exports.getLoader = exports.getEvents = exports.getBrowser = exports.App = void 0;
|
|
6
|
+
exports.tRoot = exports.tApp = exports.isRunning = exports.getVisibles = exports.getScreenWidth = exports.getScreenHeight = exports.getRunScheduler = exports.getPager = exports.getManager = exports.getLocationManager = exports.getLoader = exports.getEvents = exports.getBrowser = exports.App = void 0;
|
|
7
7
|
var _$Dom = require("./$Dom.js");
|
|
8
8
|
var _TModel = require("./TModel.js");
|
|
9
9
|
var _Browser = require("./Browser.js");
|
|
@@ -149,28 +149,28 @@ var isRunning = exports.isRunning = function isRunning() {
|
|
|
149
149
|
return tApp ? tApp.runningFlag : false;
|
|
150
150
|
};
|
|
151
151
|
var tRoot = exports.tRoot = function tRoot() {
|
|
152
|
-
return tApp ? tApp.tRoot :
|
|
152
|
+
return tApp ? tApp.tRoot : undefined;
|
|
153
153
|
};
|
|
154
154
|
var getEvents = exports.getEvents = function getEvents() {
|
|
155
|
-
return tApp ? tApp.events :
|
|
155
|
+
return tApp ? tApp.events : undefined;
|
|
156
156
|
};
|
|
157
157
|
var getPager = exports.getPager = function getPager() {
|
|
158
|
-
return tApp ? tApp.pager :
|
|
158
|
+
return tApp ? tApp.pager : undefined;
|
|
159
159
|
};
|
|
160
160
|
var getLoader = exports.getLoader = function getLoader() {
|
|
161
|
-
return tApp ? tApp.loader :
|
|
161
|
+
return tApp ? tApp.loader : undefined;
|
|
162
162
|
};
|
|
163
163
|
var getManager = exports.getManager = function getManager() {
|
|
164
|
-
return tApp ? tApp.manager :
|
|
164
|
+
return tApp ? tApp.manager : undefined;
|
|
165
165
|
};
|
|
166
166
|
var getRunScheduler = exports.getRunScheduler = function getRunScheduler() {
|
|
167
|
-
return tApp ? tApp.runScheduler :
|
|
167
|
+
return tApp ? tApp.runScheduler : undefined;
|
|
168
168
|
};
|
|
169
169
|
var getLocationManager = exports.getLocationManager = function getLocationManager() {
|
|
170
|
-
return tApp ? tApp.locationManager :
|
|
170
|
+
return tApp ? tApp.locationManager : undefined;
|
|
171
171
|
};
|
|
172
172
|
var getBrowser = exports.getBrowser = function getBrowser() {
|
|
173
|
-
return tApp ? tApp.browser :
|
|
173
|
+
return tApp ? tApp.browser : undefined;
|
|
174
174
|
};
|
|
175
175
|
var getScreenWidth = exports.getScreenWidth = function getScreenWidth() {
|
|
176
176
|
return tApp ? tApp.browser.screen.width : 0;
|
|
@@ -178,4 +178,7 @@ var getScreenWidth = exports.getScreenWidth = function getScreenWidth() {
|
|
|
178
178
|
var getScreenHeight = exports.getScreenHeight = function getScreenHeight() {
|
|
179
179
|
return tApp ? tApp.browser.screen.height : 0;
|
|
180
180
|
};
|
|
181
|
+
var getVisibles = exports.getVisibles = function getVisibles() {
|
|
182
|
+
return tApp ? tApp.manager.lists.visible : undefined;
|
|
183
|
+
};
|
|
181
184
|
window.t = window.t || _SearchUtil.SearchUtil.find;
|
package/build/BaseModel.js
CHANGED
|
@@ -6,22 +6,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.BaseModel = void 0;
|
|
7
7
|
var _App = require("./App.js");
|
|
8
8
|
var _TargetExecutor = require("./TargetExecutor.js");
|
|
9
|
-
var _Viewport = require("./Viewport.js");
|
|
10
9
|
var _TUtil = require("./TUtil.js");
|
|
11
|
-
var _SearchUtil = require("./SearchUtil.js");
|
|
12
10
|
var _TModelUtil = require("./TModelUtil.js");
|
|
13
|
-
|
|
14
|
-
function
|
|
11
|
+
var _TargetUtil = require("./TargetUtil.js");
|
|
12
|
+
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; } } }; }
|
|
15
13
|
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; } }
|
|
16
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
17
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
18
14
|
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; }
|
|
15
|
+
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; }
|
|
19
16
|
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); }
|
|
20
17
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
21
18
|
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); } }
|
|
22
19
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
23
20
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
24
21
|
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); }
|
|
22
|
+
/**
|
|
23
|
+
* It provides the target state and associated logic to the TModel.
|
|
24
|
+
*/
|
|
25
25
|
var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
26
26
|
function BaseModel(type, targets) {
|
|
27
27
|
_classCallCheck(this, BaseModel);
|
|
@@ -35,6 +35,7 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
35
35
|
this.oid = uniqueId.oid;
|
|
36
36
|
this.oidNum = uniqueId.num;
|
|
37
37
|
this.targetValues = {};
|
|
38
|
+
this.actualValues = {};
|
|
38
39
|
this.activeTargetList = [];
|
|
39
40
|
this.activeTargetMap = {};
|
|
40
41
|
this.updatingTargetList = [];
|
|
@@ -43,29 +44,10 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
43
44
|
this.updatingTargetMap = {};
|
|
44
45
|
this.updatingChildrenList = [];
|
|
45
46
|
this.updatingChildrenMap = {};
|
|
46
|
-
this.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
this.deletedChildren = [];
|
|
51
|
-
this.lastChildrenUpdate = {
|
|
52
|
-
additions: [],
|
|
53
|
-
deletions: []
|
|
54
|
-
};
|
|
55
|
-
this.allChildren = [];
|
|
56
|
-
this.x = 0;
|
|
57
|
-
this.y = 0;
|
|
58
|
-
this.absX = 0;
|
|
59
|
-
this.absY = 0;
|
|
47
|
+
this.eventTargets = [];
|
|
48
|
+
this.styleTargetList = [];
|
|
49
|
+
this.styleTargetMap = {};
|
|
60
50
|
this.parent = null;
|
|
61
|
-
this.visibilityStatus = {
|
|
62
|
-
top: false,
|
|
63
|
-
right: false,
|
|
64
|
-
bottom: false,
|
|
65
|
-
left: false
|
|
66
|
-
};
|
|
67
|
-
this.visible = false;
|
|
68
|
-
this.inFlowVisibles = [];
|
|
69
51
|
this.targetMethodMap = {};
|
|
70
52
|
}
|
|
71
53
|
return _createClass(BaseModel, [{
|
|
@@ -78,6 +60,72 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
78
60
|
value: function getRealParent() {
|
|
79
61
|
return this.parent;
|
|
80
62
|
}
|
|
63
|
+
}, {
|
|
64
|
+
key: "initTargets",
|
|
65
|
+
value: function initTargets() {
|
|
66
|
+
var _this = this;
|
|
67
|
+
this.actualValues = _TModelUtil.TModelUtil.initializeActualValues();
|
|
68
|
+
this.targetValues = {};
|
|
69
|
+
this.activeTargetMap = {};
|
|
70
|
+
this.activeTargetList = [];
|
|
71
|
+
Object.keys(this.targets).forEach(function (key) {
|
|
72
|
+
_this.processNewTarget(key);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "processNewTarget",
|
|
77
|
+
value: function processNewTarget(key) {
|
|
78
|
+
if (!_TUtil.TUtil.isDefined(this.targets[key])) {
|
|
79
|
+
delete this.actualValues[key];
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
_TargetUtil.TargetUtil.bindTargetName(this.targets, key);
|
|
83
|
+
if (_TUtil.TUtil.isDefined(this.targets[key].initialValue)) {
|
|
84
|
+
this.actualValues[key] = this.targets[key].initialValue;
|
|
85
|
+
this.addToStyleTargetList(key);
|
|
86
|
+
}
|
|
87
|
+
if (_TargetUtil.TargetUtil.targetConditionMap[key] && this.eventTargets.indexOf(key === -1)) {
|
|
88
|
+
this.eventTargets.push(key);
|
|
89
|
+
}
|
|
90
|
+
if (this.targets[key].active !== false) {
|
|
91
|
+
this.addToActiveTargets(key);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
key: "addToStyleTargetList",
|
|
96
|
+
value: function addToStyleTargetList(key) {
|
|
97
|
+
if (!_TargetUtil.TargetUtil.styleTargetMap[key]) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (!this.styleTargetMap[key]) {
|
|
101
|
+
this.styleTargetList.push(key);
|
|
102
|
+
this.styleTargetMap[key] = true;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
key: "removeTarget",
|
|
107
|
+
value: function removeTarget(key) {
|
|
108
|
+
delete this.targets[key];
|
|
109
|
+
this.removeFromActiveTargets(key);
|
|
110
|
+
this.removeFromUpdatingTargets(key);
|
|
111
|
+
delete this.targetValues[key];
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
key: "addTarget",
|
|
115
|
+
value: function addTarget(key, target) {
|
|
116
|
+
this.addTargets(_defineProperty({}, key, target));
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
key: "addTargets",
|
|
120
|
+
value: function addTargets(targets) {
|
|
121
|
+
var _this2 = this;
|
|
122
|
+
Object.keys(targets).forEach(function (key) {
|
|
123
|
+
_this2.targets[key] = targets[key];
|
|
124
|
+
_this2.removeFromUpdatingTargets(key);
|
|
125
|
+
_this2.processNewTarget(key);
|
|
126
|
+
});
|
|
127
|
+
(0, _App.getRunScheduler)().schedule(10, 'addTargets-' + this.oid);
|
|
128
|
+
}
|
|
81
129
|
}, {
|
|
82
130
|
key: "getTargetStepPercent",
|
|
83
131
|
value: function getTargetStepPercent(key, step) {
|
|
@@ -191,6 +239,11 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
191
239
|
value: function isExecuted(key) {
|
|
192
240
|
return this.targetValues[key] && this.targetValues[key].executionFlag;
|
|
193
241
|
}
|
|
242
|
+
}, {
|
|
243
|
+
key: "neverExecuted",
|
|
244
|
+
value: function neverExecuted(key) {
|
|
245
|
+
return !this.targetValues[key];
|
|
246
|
+
}
|
|
194
247
|
}, {
|
|
195
248
|
key: "isTargetImperative",
|
|
196
249
|
value: function isTargetImperative(key) {
|
|
@@ -211,9 +264,6 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
211
264
|
}, {
|
|
212
265
|
key: "isTargetEnabled",
|
|
213
266
|
value: function isTargetEnabled(key) {
|
|
214
|
-
if (this.isTargetImperative(key)) {
|
|
215
|
-
return true;
|
|
216
|
-
}
|
|
217
267
|
var target = this.targets[key];
|
|
218
268
|
if (!_TUtil.TUtil.isDefined(target)) {
|
|
219
269
|
return false;
|
|
@@ -354,7 +404,7 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
354
404
|
}, {
|
|
355
405
|
key: "addToActiveTargets",
|
|
356
406
|
value: function addToActiveTargets(key) {
|
|
357
|
-
var
|
|
407
|
+
var _this3 = this;
|
|
358
408
|
if (!this.activeTargetMap[key]) {
|
|
359
409
|
this.activeTargetMap[key] = true;
|
|
360
410
|
var priorityOrder = ['y', 'x', 'height', 'width', 'start'];
|
|
@@ -364,8 +414,8 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
364
414
|
return !priorityOrder.includes(item);
|
|
365
415
|
});
|
|
366
416
|
priorityOrder.forEach(function (priorityKey) {
|
|
367
|
-
if (
|
|
368
|
-
|
|
417
|
+
if (_this3.activeTargetMap[priorityKey]) {
|
|
418
|
+
_this3.activeTargetList.unshift(priorityKey);
|
|
369
419
|
}
|
|
370
420
|
});
|
|
371
421
|
} else {
|
|
@@ -409,6 +459,49 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
409
459
|
}
|
|
410
460
|
}
|
|
411
461
|
}
|
|
462
|
+
}, {
|
|
463
|
+
key: "hasUpdatingTargets",
|
|
464
|
+
value: function hasUpdatingTargets(originalTargetName) {
|
|
465
|
+
var _iterator = _createForOfIteratorHelper(this.updatingTargetList),
|
|
466
|
+
_step;
|
|
467
|
+
try {
|
|
468
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
469
|
+
var target = _step.value;
|
|
470
|
+
if (this.isTargetImperative(target) && this.targetValues[target].originalTargetName === originalTargetName) {
|
|
471
|
+
return true;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
} catch (err) {
|
|
475
|
+
_iterator.e(err);
|
|
476
|
+
} finally {
|
|
477
|
+
_iterator.f();
|
|
478
|
+
}
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
481
|
+
}, {
|
|
482
|
+
key: "addToUpdatingChildren",
|
|
483
|
+
value: function addToUpdatingChildren(child) {
|
|
484
|
+
if (!this.updatingChildrenMap[child.oid]) {
|
|
485
|
+
this.updatingChildrenMap[child.oid] = true;
|
|
486
|
+
this.updatingChildrenList.push(child.oid);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}, {
|
|
490
|
+
key: "removeFromUpdatingChildren",
|
|
491
|
+
value: function removeFromUpdatingChildren(child) {
|
|
492
|
+
if (this.updatingChildrenMap[child.oid]) {
|
|
493
|
+
delete this.updatingChildrenMap[child.oid];
|
|
494
|
+
var index = this.updatingChildrenList.indexOf(child.oid);
|
|
495
|
+
if (index >= 0) {
|
|
496
|
+
this.updatingChildrenList.splice(index, 1);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}, {
|
|
501
|
+
key: "hasUpdatingChildren",
|
|
502
|
+
value: function hasUpdatingChildren() {
|
|
503
|
+
return this.updatingChildrenList.length > 0;
|
|
504
|
+
}
|
|
412
505
|
}, {
|
|
413
506
|
key: "deleteTargetValue",
|
|
414
507
|
value: function deleteTargetValue(key) {
|
|
@@ -441,17 +534,17 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
441
534
|
}, {
|
|
442
535
|
key: "activateTargets",
|
|
443
536
|
value: function activateTargets(keys) {
|
|
444
|
-
var
|
|
537
|
+
var _this4 = this;
|
|
445
538
|
keys.forEach(function (key) {
|
|
446
|
-
var targetValue =
|
|
539
|
+
var targetValue = _this4.targetValues[key];
|
|
447
540
|
if (targetValue) {
|
|
448
541
|
targetValue.executionFlag = false;
|
|
449
542
|
targetValue.scheduleTimeStamp = undefined;
|
|
450
543
|
targetValue.step = 0;
|
|
451
544
|
targetValue.cycle = 0;
|
|
452
|
-
|
|
545
|
+
_this4.updateTargetStatus(key);
|
|
453
546
|
} else {
|
|
454
|
-
|
|
547
|
+
_this4.addToActiveTargets(key);
|
|
455
548
|
}
|
|
456
549
|
});
|
|
457
550
|
(0, _App.getRunScheduler)().schedule(10, 'activateTargets-' + this.oid);
|
|
@@ -467,181 +560,5 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
467
560
|
this.targetMethodMap[targetName].push(methodName);
|
|
468
561
|
}
|
|
469
562
|
}
|
|
470
|
-
}, {
|
|
471
|
-
key: "addToUpdatingChildren",
|
|
472
|
-
value: function addToUpdatingChildren(child) {
|
|
473
|
-
if (!this.updatingChildrenMap[child.oid]) {
|
|
474
|
-
this.updatingChildrenMap[child.oid] = true;
|
|
475
|
-
this.updatingChildrenList.push(child.oid);
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}, {
|
|
479
|
-
key: "removeFromUpdatingChildren",
|
|
480
|
-
value: function removeFromUpdatingChildren(child) {
|
|
481
|
-
if (this.updatingChildrenMap[child.oid]) {
|
|
482
|
-
delete this.updatingChildrenMap[child.oid];
|
|
483
|
-
var index = this.updatingChildrenList.indexOf(child.oid);
|
|
484
|
-
if (index >= 0) {
|
|
485
|
-
this.updatingChildrenList.splice(index, 1);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
}, {
|
|
490
|
-
key: "hasUpdatingChildren",
|
|
491
|
-
value: function hasUpdatingChildren() {
|
|
492
|
-
return this.updatingChildrenList.length > 0;
|
|
493
|
-
}
|
|
494
|
-
}, {
|
|
495
|
-
key: "addChild",
|
|
496
|
-
value: function addChild(child) {
|
|
497
|
-
var index = this.addedChildren.count + this.allChildren.length;
|
|
498
|
-
this.addedChildren.count++;
|
|
499
|
-
_TModelUtil.TModelUtil.addItem(this.addedChildren.list, child, index);
|
|
500
|
-
(0, _App.getRunScheduler)().schedule(10, 'addChild-' + this.oid + "-" + child.oid);
|
|
501
|
-
return this;
|
|
502
|
-
}
|
|
503
|
-
}, {
|
|
504
|
-
key: "removeChild",
|
|
505
|
-
value: function removeChild(child) {
|
|
506
|
-
this.deletedChildren.push(child);
|
|
507
|
-
this.removeFromUpdatingChildren(child);
|
|
508
|
-
(0, _App.getRunScheduler)().schedule(10, 'removeChild-' + this.oid + "-" + child.oid);
|
|
509
|
-
return this;
|
|
510
|
-
}
|
|
511
|
-
}, {
|
|
512
|
-
key: "removeAllChildren",
|
|
513
|
-
value: function removeAllChildren() {
|
|
514
|
-
this.allChildren.length = 0;
|
|
515
|
-
this.updatingChildrenList.length = 0;
|
|
516
|
-
this.updatingChildrenMap = {};
|
|
517
|
-
(0, _App.getRunScheduler)().schedule(10, 'removeAllChildren-' + this.oid);
|
|
518
|
-
return this;
|
|
519
|
-
}
|
|
520
|
-
}, {
|
|
521
|
-
key: "addToParentVisibleList",
|
|
522
|
-
value: function addToParentVisibleList() {
|
|
523
|
-
if (this.isVisible() && this.isInFlow() && this.getParent()) {
|
|
524
|
-
this.getParent().inFlowVisibles.push(this);
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
}, {
|
|
528
|
-
key: "shouldCalculateChildren",
|
|
529
|
-
value: function shouldCalculateChildren() {
|
|
530
|
-
if (_TUtil.TUtil.isDefined(this.actualValues.calculateChildren)) {
|
|
531
|
-
return this.actualValues.calculateChildren;
|
|
532
|
-
}
|
|
533
|
-
return this.isVisible() && this.isIncluded() && (this.hasChildren() || this.addedChildren.count > 0 || this.getContentHeight() > 0);
|
|
534
|
-
}
|
|
535
|
-
}, {
|
|
536
|
-
key: "createViewport",
|
|
537
|
-
value: function createViewport() {
|
|
538
|
-
this.viewport = this.viewport ? this.viewport.reset() : new _Viewport.Viewport(this);
|
|
539
|
-
return this.viewport;
|
|
540
|
-
}
|
|
541
|
-
}, {
|
|
542
|
-
key: "setLocation",
|
|
543
|
-
value: function setLocation(viewport) {
|
|
544
|
-
this.x = viewport.getXNext();
|
|
545
|
-
this.y = viewport.getYNext();
|
|
546
|
-
}
|
|
547
|
-
}, {
|
|
548
|
-
key: "calculateAbsolutePosition",
|
|
549
|
-
value: function calculateAbsolutePosition(x, y) {
|
|
550
|
-
var rect = this.getBoundingRect();
|
|
551
|
-
this.absX = rect.left + x;
|
|
552
|
-
this.absY = rect.top + y;
|
|
553
|
-
}
|
|
554
|
-
}, {
|
|
555
|
-
key: "getBoundingRect",
|
|
556
|
-
value: function getBoundingRect() {
|
|
557
|
-
return _TUtil.TUtil.getBoundingRect(this);
|
|
558
|
-
}
|
|
559
|
-
}, {
|
|
560
|
-
key: "getFirstChild",
|
|
561
|
-
value: function getFirstChild() {
|
|
562
|
-
return this.hasChildren() ? this.getChildren()[0] : undefined;
|
|
563
|
-
}
|
|
564
|
-
}, {
|
|
565
|
-
key: "hasChildren",
|
|
566
|
-
value: function hasChildren() {
|
|
567
|
-
return this.getChildren().length > 0;
|
|
568
|
-
}
|
|
569
|
-
}, {
|
|
570
|
-
key: "getChildren",
|
|
571
|
-
value: function getChildren() {
|
|
572
|
-
var _this3 = this;
|
|
573
|
-
if (this.addedChildren.count > 0) {
|
|
574
|
-
this.addedChildren.list.forEach(function (_ref) {
|
|
575
|
-
var index = _ref.index,
|
|
576
|
-
segment = _ref.segment;
|
|
577
|
-
segment.forEach(function (t) {
|
|
578
|
-
return t.parent = _this3;
|
|
579
|
-
});
|
|
580
|
-
if (index >= _this3.allChildren.length) {
|
|
581
|
-
var _this3$allChildren;
|
|
582
|
-
(_this3$allChildren = _this3.allChildren).push.apply(_this3$allChildren, _toConsumableArray(segment));
|
|
583
|
-
} else {
|
|
584
|
-
var _this3$allChildren2;
|
|
585
|
-
(_this3$allChildren2 = _this3.allChildren).splice.apply(_this3$allChildren2, [index, 0].concat(_toConsumableArray(segment)));
|
|
586
|
-
}
|
|
587
|
-
});
|
|
588
|
-
this.lastChildrenUpdate.additions = this.lastChildrenUpdate.additions.concat(this.addedChildren.list);
|
|
589
|
-
this.addedChildren.list.length = 0;
|
|
590
|
-
this.addedChildren.count = 0;
|
|
591
|
-
}
|
|
592
|
-
if (this.deletedChildren.length > 0) {
|
|
593
|
-
this.deletedChildren.forEach(function (child) {
|
|
594
|
-
var index = _this3.allChildren.indexOf(child);
|
|
595
|
-
_this3.lastChildrenUpdate.deletions.push(index);
|
|
596
|
-
if (index >= 0) {
|
|
597
|
-
_this3.allChildren.splice(index, 1);
|
|
598
|
-
}
|
|
599
|
-
});
|
|
600
|
-
this.deletedChildren.length = 0;
|
|
601
|
-
}
|
|
602
|
-
return this.allChildren;
|
|
603
|
-
}
|
|
604
|
-
}, {
|
|
605
|
-
key: "getLastChild",
|
|
606
|
-
value: function getLastChild() {
|
|
607
|
-
return this.hasChildren() ? this.getChildren()[this.getChildren().length - 1] : undefined;
|
|
608
|
-
}
|
|
609
|
-
}, {
|
|
610
|
-
key: "getChild",
|
|
611
|
-
value: function getChild(index) {
|
|
612
|
-
return this.hasChildren() ? this.getChildren()[index] : undefined;
|
|
613
|
-
}
|
|
614
|
-
}, {
|
|
615
|
-
key: "getChildIndex",
|
|
616
|
-
value: function getChildIndex(child) {
|
|
617
|
-
return this.getChildren().indexOf(child);
|
|
618
|
-
}
|
|
619
|
-
}, {
|
|
620
|
-
key: "getChildrenOids",
|
|
621
|
-
value: function getChildrenOids() {
|
|
622
|
-
return this.getChildren().map(function (o) {
|
|
623
|
-
return o.oid;
|
|
624
|
-
}).join(" ");
|
|
625
|
-
}
|
|
626
|
-
}, {
|
|
627
|
-
key: "findChild",
|
|
628
|
-
value: function findChild(type) {
|
|
629
|
-
return this.getChildren().find(function (child) {
|
|
630
|
-
return typeof type === 'function' ? type.call(child) : child.type === type;
|
|
631
|
-
});
|
|
632
|
-
}
|
|
633
|
-
}, {
|
|
634
|
-
key: "findLastChild",
|
|
635
|
-
value: function findLastChild(type) {
|
|
636
|
-
return this.getChildren().findLast(function (child) {
|
|
637
|
-
return typeof type === 'function' ? type.call(child) : child.type === type;
|
|
638
|
-
});
|
|
639
|
-
}
|
|
640
|
-
}, {
|
|
641
|
-
key: "getParentValue",
|
|
642
|
-
value: function getParentValue(targetName) {
|
|
643
|
-
var parent = _SearchUtil.SearchUtil.findParentByTarget(this, targetName);
|
|
644
|
-
return parent ? parent.val(targetName) : undefined;
|
|
645
|
-
}
|
|
646
563
|
}]);
|
|
647
564
|
}();
|
package/build/Bracket.js
CHANGED
|
@@ -98,6 +98,9 @@ var Bracket = exports.Bracket = /*#__PURE__*/function (_TModel) {
|
|
|
98
98
|
value: function addToUpdatingChildren(child) {
|
|
99
99
|
this.getRealParent().addToUpdatingChildren(child);
|
|
100
100
|
}
|
|
101
|
+
}, {
|
|
102
|
+
key: "addToParentVisibleChildren",
|
|
103
|
+
value: function addToParentVisibleChildren() {}
|
|
101
104
|
}, {
|
|
102
105
|
key: "createViewport",
|
|
103
106
|
value: function createViewport() {
|
package/build/EventListener.js
CHANGED
|
@@ -47,7 +47,12 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
|
|
|
47
47
|
touch: null,
|
|
48
48
|
scrollLeft: null,
|
|
49
49
|
scrollTop: null,
|
|
50
|
-
pinch: null
|
|
50
|
+
pinch: null,
|
|
51
|
+
enterEvent: null,
|
|
52
|
+
leaveEvent: null,
|
|
53
|
+
focus: null,
|
|
54
|
+
justFocused: null,
|
|
55
|
+
blur: null
|
|
51
56
|
};
|
|
52
57
|
this.eventQueue = [];
|
|
53
58
|
this.eventMap = {
|
|
@@ -246,6 +251,41 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
|
|
|
246
251
|
(0, _App.getRunScheduler)().schedule(runDelay, "scroll decay");
|
|
247
252
|
}
|
|
248
253
|
}
|
|
254
|
+
}, {
|
|
255
|
+
key: "findEventHandlers",
|
|
256
|
+
value: function findEventHandlers(tmodel) {
|
|
257
|
+
var touchHandler = _SearchUtil.SearchUtil.findFirstTouchHandler(tmodel);
|
|
258
|
+
var scrollLeftHandler = _SearchUtil.SearchUtil.findFirstScrollLeftHandler(tmodel);
|
|
259
|
+
var scrollTopHandler = _SearchUtil.SearchUtil.findFirstScrollTopHandler(tmodel);
|
|
260
|
+
var pinchHandler = _SearchUtil.SearchUtil.findFirstPinchHandler(tmodel);
|
|
261
|
+
var focusHandler = _$Dom.$Dom.hasFocus(tmodel) ? tmodel : this.currentHandlers.focus;
|
|
262
|
+
if (this.currentHandlers.scrollLeft !== scrollLeftHandler || this.currentHandlers.scrollTop !== scrollTopHandler) {
|
|
263
|
+
this.clearTouch();
|
|
264
|
+
}
|
|
265
|
+
this.currentHandlers.enterEvent = null;
|
|
266
|
+
this.currentHandlers.leaveEvent = null;
|
|
267
|
+
this.currentHandlers.justFocused = null;
|
|
268
|
+
this.currentHandlers.blur = null;
|
|
269
|
+
if (this.currentHandlers.touch !== touchHandler) {
|
|
270
|
+
this.currentHandlers.enterEvent = touchHandler;
|
|
271
|
+
this.currentHandlers.leaveEvent = this.currentHandlers.touch;
|
|
272
|
+
}
|
|
273
|
+
if (this.currentHandlers.focus !== focusHandler) {
|
|
274
|
+
this.currentHandlers.justFocused = focusHandler;
|
|
275
|
+
this.currentHandlers.blur = this.currentHandlers.focus;
|
|
276
|
+
this.eventQueue.push({
|
|
277
|
+
eventName: 'focus',
|
|
278
|
+
eventType: 'focus',
|
|
279
|
+
tmodel: tmodel,
|
|
280
|
+
timeStamp: _TUtil.TUtil.now()
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
this.currentHandlers.touch = touchHandler;
|
|
284
|
+
this.currentHandlers.scrollLeft = scrollLeftHandler;
|
|
285
|
+
this.currentHandlers.scrollTop = scrollTopHandler;
|
|
286
|
+
this.currentHandlers.pinch = pinchHandler;
|
|
287
|
+
this.currentHandlers.focus = focusHandler;
|
|
288
|
+
}
|
|
249
289
|
}, {
|
|
250
290
|
key: "captureEvents",
|
|
251
291
|
value: function captureEvents() {
|
|
@@ -381,21 +421,6 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
|
|
|
381
421
|
}
|
|
382
422
|
(0, _App.getRunScheduler)().schedule(0, "".concat(originalName, "-").concat(eventName, "-").concat((event.target.tagName || "").toUpperCase()));
|
|
383
423
|
}
|
|
384
|
-
}, {
|
|
385
|
-
key: "findEventHandlers",
|
|
386
|
-
value: function findEventHandlers(tmodel) {
|
|
387
|
-
var touchHandler = _SearchUtil.SearchUtil.findFirstTouchHandler(tmodel);
|
|
388
|
-
var scrollLeftHandler = this.end0 ? this.currentHandlers.scrollLeft : _SearchUtil.SearchUtil.findFirstScrollLeftHandler(tmodel);
|
|
389
|
-
var scrollTopHandler = this.end0 ? this.currentHandlers.scrollTop : _SearchUtil.SearchUtil.findFirstScrollTopHandler(tmodel);
|
|
390
|
-
var pinchHandler = _SearchUtil.SearchUtil.findFirstPinchHandler(tmodel);
|
|
391
|
-
if (this.currentHandlers.scrollLeft !== scrollLeftHandler || this.currentHandlers.scrollTop !== scrollTopHandler) {
|
|
392
|
-
this.clearTouch();
|
|
393
|
-
}
|
|
394
|
-
this.currentHandlers.touch = touchHandler;
|
|
395
|
-
this.currentHandlers.scrollLeft = scrollLeftHandler;
|
|
396
|
-
this.currentHandlers.scrollTop = scrollTopHandler;
|
|
397
|
-
this.currentHandlers.pinch = pinchHandler;
|
|
398
|
-
}
|
|
399
424
|
}, {
|
|
400
425
|
key: "preventDefault",
|
|
401
426
|
value: function preventDefault(tmodel, eventName) {
|
|
@@ -554,6 +579,31 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
|
|
|
554
579
|
value: function isTouchHandler(handler) {
|
|
555
580
|
return this.getTouchHandler() === handler && handler.canHandleEvents('touch');
|
|
556
581
|
}
|
|
582
|
+
}, {
|
|
583
|
+
key: "isEnterEventHandler",
|
|
584
|
+
value: function isEnterEventHandler(handler) {
|
|
585
|
+
return this.currentHandlers.enterEvent === handler;
|
|
586
|
+
}
|
|
587
|
+
}, {
|
|
588
|
+
key: "isLeaveEventHandler",
|
|
589
|
+
value: function isLeaveEventHandler(handler) {
|
|
590
|
+
return this.currentHandlers.leaveEvent === handler;
|
|
591
|
+
}
|
|
592
|
+
}, {
|
|
593
|
+
key: "onFocus",
|
|
594
|
+
value: function onFocus(handler) {
|
|
595
|
+
return this.currentHandlers.justFocused === handler;
|
|
596
|
+
}
|
|
597
|
+
}, {
|
|
598
|
+
key: "onBlur",
|
|
599
|
+
value: function onBlur(handler) {
|
|
600
|
+
return this.currentHandlers.blur === handler;
|
|
601
|
+
}
|
|
602
|
+
}, {
|
|
603
|
+
key: "hasFocus",
|
|
604
|
+
value: function hasFocus(handler) {
|
|
605
|
+
return this.currentHandlers.focus === handler;
|
|
606
|
+
}
|
|
557
607
|
}, {
|
|
558
608
|
key: "isTouchHandlerType",
|
|
559
609
|
value: function isTouchHandlerType(type) {
|