targetj 1.0.97 → 1.0.98
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/App.js +46 -36
- package/build/BaseModel.js +6 -3
- package/build/Bracket.js +33 -40
- package/build/BracketGenerator.js +3 -1
- package/build/Browser.js +0 -13
- package/build/EventListener.js +63 -39
- package/build/LocationManager.js +34 -52
- package/build/PageManager.js +4 -13
- package/build/TModel.js +40 -13
- package/build/TModelManager.js +13 -1
- package/build/TUtil.js +7 -36
- package/build/TargetManager.js +1 -1
- package/build/TargetUtil.js +7 -3
- package/build/Viewport.js +11 -73
- package/package.json +1 -1
package/build/App.js
CHANGED
|
@@ -26,7 +26,6 @@ var AppFn = function AppFn(firstChild) {
|
|
|
26
26
|
my.init = function () {
|
|
27
27
|
my.browser = new _Browser.Browser();
|
|
28
28
|
my.browser.setup();
|
|
29
|
-
my.browser.measureScreen();
|
|
30
29
|
my.$document = new _$Dom.$Dom(document);
|
|
31
30
|
my.$window = new _$Dom.$Dom(window);
|
|
32
31
|
my.$window.addEvent("popstate", function (event) {
|
|
@@ -42,37 +41,38 @@ var AppFn = function AppFn(firstChild) {
|
|
|
42
41
|
my.manager = new _TModelManager.TModelManager();
|
|
43
42
|
my.runScheduler = new _RunScheduler.RunScheduler();
|
|
44
43
|
my.tRootFactory = function () {
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
44
|
+
var tmodel = new _TModel.TModel('tRoot', {
|
|
45
|
+
start: function start() {
|
|
46
|
+
if (!_$Dom.$Dom.query('#tj-root')) {
|
|
47
|
+
this.$dom = new _$Dom.$Dom();
|
|
48
|
+
this.$dom.create('div');
|
|
49
|
+
this.$dom.setSelector('#tj-root');
|
|
50
|
+
this.$dom.setId('#tj-root');
|
|
51
|
+
this.$dom.attr("tabindex", "0");
|
|
52
|
+
new _$Dom.$Dom('body').insertFirst$Dom(this.$dom);
|
|
53
|
+
} else {
|
|
54
|
+
this.$dom = new _$Dom.$Dom('#tj-root');
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
domHolder: function domHolder() {
|
|
58
|
+
return this.$dom;
|
|
59
|
+
},
|
|
60
|
+
width: function width() {
|
|
61
|
+
return document.documentElement.clientWidth || document.body.clientWidth;
|
|
62
|
+
},
|
|
63
|
+
height: function height() {
|
|
64
|
+
return document.documentElement.clientHeight || document.body.clientHeight;
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
-
};
|
|
66
|
+
});
|
|
67
67
|
if (my.tRoot) {
|
|
68
68
|
my.tRoot.getChildren().forEach(function (t, num) {
|
|
69
69
|
var child = new _TModel.TModel(t.type, t.targets);
|
|
70
70
|
child.oidNum = num;
|
|
71
71
|
child.oid = num > 0 ? "".concat(t.type).concat(num) : t.type;
|
|
72
|
-
|
|
72
|
+
tmodel.addChild(child);
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
return
|
|
75
|
+
return tmodel;
|
|
76
76
|
};
|
|
77
77
|
my.tRoot = my.tRootFactory();
|
|
78
78
|
if (firstChild) {
|
|
@@ -90,7 +90,6 @@ var AppFn = function AppFn(firstChild) {
|
|
|
90
90
|
my.events.addHandlers(my.$document);
|
|
91
91
|
my.events.removeWindowHandlers();
|
|
92
92
|
my.events.addWindowHandlers();
|
|
93
|
-
my.browser.measureScreen();
|
|
94
93
|
my.runScheduler.resetRuns();
|
|
95
94
|
my.runningFlag = true;
|
|
96
95
|
my.runScheduler.schedule(0, "appStart");
|
|
@@ -149,36 +148,47 @@ var isRunning = exports.isRunning = function isRunning() {
|
|
|
149
148
|
return tApp ? tApp.runningFlag : false;
|
|
150
149
|
};
|
|
151
150
|
var tRoot = exports.tRoot = function tRoot() {
|
|
152
|
-
|
|
151
|
+
var _tApp;
|
|
152
|
+
return (_tApp = tApp) === null || _tApp === void 0 ? void 0 : _tApp.tRoot;
|
|
153
153
|
};
|
|
154
154
|
var getEvents = exports.getEvents = function getEvents() {
|
|
155
|
-
|
|
155
|
+
var _tApp2;
|
|
156
|
+
return (_tApp2 = tApp) === null || _tApp2 === void 0 ? void 0 : _tApp2.events;
|
|
156
157
|
};
|
|
157
158
|
var getPager = exports.getPager = function getPager() {
|
|
158
|
-
|
|
159
|
+
var _tApp3;
|
|
160
|
+
return (_tApp3 = tApp) === null || _tApp3 === void 0 ? void 0 : _tApp3.pager;
|
|
159
161
|
};
|
|
160
162
|
var getLoader = exports.getLoader = function getLoader() {
|
|
161
|
-
|
|
163
|
+
var _tApp4;
|
|
164
|
+
return (_tApp4 = tApp) === null || _tApp4 === void 0 ? void 0 : _tApp4.loader;
|
|
162
165
|
};
|
|
163
166
|
var getManager = exports.getManager = function getManager() {
|
|
164
|
-
|
|
167
|
+
var _tApp5;
|
|
168
|
+
return (_tApp5 = tApp) === null || _tApp5 === void 0 ? void 0 : _tApp5.manager;
|
|
165
169
|
};
|
|
166
170
|
var getRunScheduler = exports.getRunScheduler = function getRunScheduler() {
|
|
167
|
-
|
|
171
|
+
var _tApp6;
|
|
172
|
+
return (_tApp6 = tApp) === null || _tApp6 === void 0 ? void 0 : _tApp6.runScheduler;
|
|
168
173
|
};
|
|
169
174
|
var getLocationManager = exports.getLocationManager = function getLocationManager() {
|
|
170
|
-
|
|
175
|
+
var _tApp7;
|
|
176
|
+
return (_tApp7 = tApp) === null || _tApp7 === void 0 ? void 0 : _tApp7.locationManager;
|
|
171
177
|
};
|
|
172
178
|
var getBrowser = exports.getBrowser = function getBrowser() {
|
|
173
|
-
|
|
179
|
+
var _tApp8;
|
|
180
|
+
return (_tApp8 = tApp) === null || _tApp8 === void 0 ? void 0 : _tApp8.browser;
|
|
174
181
|
};
|
|
175
182
|
var getScreenWidth = exports.getScreenWidth = function getScreenWidth() {
|
|
176
|
-
|
|
183
|
+
var _tApp$tRoot$getWidth, _tApp9;
|
|
184
|
+
return (_tApp$tRoot$getWidth = (_tApp9 = tApp) === null || _tApp9 === void 0 || (_tApp9 = _tApp9.tRoot) === null || _tApp9 === void 0 ? void 0 : _tApp9.getWidth()) !== null && _tApp$tRoot$getWidth !== void 0 ? _tApp$tRoot$getWidth : 0;
|
|
177
185
|
};
|
|
178
186
|
var getScreenHeight = exports.getScreenHeight = function getScreenHeight() {
|
|
179
|
-
|
|
187
|
+
var _tApp$tRoot$getHeight, _tApp10;
|
|
188
|
+
return (_tApp$tRoot$getHeight = (_tApp10 = tApp) === null || _tApp10 === void 0 || (_tApp10 = _tApp10.tRoot) === null || _tApp10 === void 0 ? void 0 : _tApp10.getHeight()) !== null && _tApp$tRoot$getHeight !== void 0 ? _tApp$tRoot$getHeight : 0;
|
|
180
189
|
};
|
|
181
190
|
var getVisibles = exports.getVisibles = function getVisibles() {
|
|
182
|
-
|
|
191
|
+
var _tApp11;
|
|
192
|
+
return (_tApp11 = tApp) === null || _tApp11 === void 0 || (_tApp11 = _tApp11.manager) === null || _tApp11 === void 0 ? void 0 : _tApp11.lists.visible;
|
|
183
193
|
};
|
|
184
194
|
window.t = window.t || _SearchUtil.SearchUtil.find;
|
package/build/BaseModel.js
CHANGED
|
@@ -78,13 +78,16 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
|
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
80
|
_TargetUtil.TargetUtil.bindTargetName(this.targets, key);
|
|
81
|
+
if (_TargetUtil.TargetUtil.targetConditionMap[key]) {
|
|
82
|
+
if (this.eventTargets.indexOf(key === -1)) {
|
|
83
|
+
this.eventTargets.push(key);
|
|
84
|
+
}
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
81
87
|
if (_TUtil.TUtil.isDefined(this.targets[key].initialValue)) {
|
|
82
88
|
this.actualValues[key] = this.targets[key].initialValue;
|
|
83
89
|
this.addToStyleTargetList(key);
|
|
84
90
|
}
|
|
85
|
-
if (_TargetUtil.TargetUtil.targetConditionMap[key] && this.eventTargets.indexOf(key === -1)) {
|
|
86
|
-
this.eventTargets.push(key);
|
|
87
|
-
}
|
|
88
91
|
if (this.targets[key].active !== false) {
|
|
89
92
|
this.addToActiveTargets(key);
|
|
90
93
|
}
|
package/build/Bracket.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.Bracket = void 0;
|
|
8
8
|
var _TModel2 = require("./TModel.js");
|
|
9
|
-
var
|
|
9
|
+
var _Viewport = require("./Viewport.js");
|
|
10
10
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
11
|
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); } }
|
|
12
12
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -29,8 +29,10 @@ var Bracket = exports.Bracket = /*#__PURE__*/function (_TModel) {
|
|
|
29
29
|
_classCallCheck(this, Bracket);
|
|
30
30
|
_this = _callSuper(this, Bracket, ["BI", {
|
|
31
31
|
canHaveDom: false,
|
|
32
|
-
|
|
32
|
+
outerOverflowWidth: 0
|
|
33
33
|
}]);
|
|
34
|
+
_this.innerContentWidth = 0;
|
|
35
|
+
_this.innerContentHeight = 0;
|
|
34
36
|
_this.parent = parent;
|
|
35
37
|
_this.newFlag = true;
|
|
36
38
|
return _this;
|
|
@@ -57,60 +59,51 @@ var Bracket = exports.Bracket = /*#__PURE__*/function (_TModel) {
|
|
|
57
59
|
return this.innerContentWidth;
|
|
58
60
|
}
|
|
59
61
|
}, {
|
|
60
|
-
key: "
|
|
61
|
-
value: function
|
|
62
|
-
return
|
|
62
|
+
key: "getInnerOverflowWidth",
|
|
63
|
+
value: function getInnerOverflowWidth() {
|
|
64
|
+
return this.getRealParent().getInnerOverflowWidth();
|
|
63
65
|
}
|
|
64
66
|
}, {
|
|
65
67
|
key: "getInnerContentHeight",
|
|
66
68
|
value: function getInnerContentHeight() {
|
|
67
69
|
return this.innerContentHeight;
|
|
68
70
|
}
|
|
69
|
-
}, {
|
|
70
|
-
key: "getScrollTop",
|
|
71
|
-
value: function getScrollTop() {
|
|
72
|
-
return this.getRealParent().getScrollTop();
|
|
73
|
-
}
|
|
74
|
-
}, {
|
|
75
|
-
key: "getScrollLeft",
|
|
76
|
-
value: function getScrollLeft() {
|
|
77
|
-
return this.getRealParent().getScrollLeft();
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
80
|
-
key: "getBoundingRect",
|
|
81
|
-
value: function getBoundingRect() {
|
|
82
|
-
return _TUtil.TUtil.getBoundingRect(this.getRealParent());
|
|
83
|
-
}
|
|
84
|
-
}, {
|
|
85
|
-
key: "calculateAbsolutePosition",
|
|
86
|
-
value: function calculateAbsolutePosition(x, y) {
|
|
87
|
-
var rect = this.getBoundingRect();
|
|
88
|
-
this.absX = rect.left + x;
|
|
89
|
-
this.absY = rect.top + y;
|
|
90
|
-
}
|
|
91
71
|
}, {
|
|
92
72
|
key: "isVisible",
|
|
93
73
|
value: function isVisible() {
|
|
94
74
|
return this.visibilityStatus.top && this.visibilityStatus.bottom;
|
|
95
75
|
}
|
|
96
|
-
}, {
|
|
97
|
-
key: "addToUpdatingChildren",
|
|
98
|
-
value: function addToUpdatingChildren(child) {
|
|
99
|
-
this.getRealParent().addToUpdatingChildren(child);
|
|
100
|
-
}
|
|
101
76
|
}, {
|
|
102
77
|
key: "addToParentVisibleChildren",
|
|
103
78
|
value: function addToParentVisibleChildren() {}
|
|
104
79
|
}, {
|
|
105
80
|
key: "createViewport",
|
|
106
81
|
value: function createViewport() {
|
|
107
|
-
|
|
82
|
+
this.viewport = this.viewport || new _Viewport.Viewport();
|
|
83
|
+
this.viewport.xNext = this.x;
|
|
84
|
+
this.viewport.xNorth = this.x;
|
|
85
|
+
this.viewport.xEast = this.x;
|
|
86
|
+
this.viewport.xSouth = this.x;
|
|
87
|
+
this.viewport.xWest = this.x;
|
|
88
|
+
this.viewport.xOverflow = this.getRealParent().getXOverflow();
|
|
89
|
+
this.viewport.yNext = this.y;
|
|
90
|
+
this.viewport.yNorth = this.y;
|
|
91
|
+
this.viewport.yWest = this.y;
|
|
92
|
+
this.viewport.yEast = this.y;
|
|
93
|
+
this.viewport.ySouth = this.getRealParent().viewport.ySouth;
|
|
94
|
+
return this.viewport;
|
|
108
95
|
}
|
|
109
96
|
}, {
|
|
110
97
|
key: "getRealParent",
|
|
111
98
|
value: function getRealParent() {
|
|
112
99
|
return this.realParent;
|
|
113
100
|
}
|
|
101
|
+
}, {
|
|
102
|
+
key: "calculateAbsolutePosition",
|
|
103
|
+
value: function calculateAbsolutePosition(x, y) {
|
|
104
|
+
this.absX = x + this.getRealParent().absX;
|
|
105
|
+
this.absY = y + this.getRealParent().absY;
|
|
106
|
+
}
|
|
114
107
|
}, {
|
|
115
108
|
key: "shouldCalculateChildren",
|
|
116
109
|
value: function shouldCalculateChildren() {
|
|
@@ -118,18 +111,18 @@ var Bracket = exports.Bracket = /*#__PURE__*/function (_TModel) {
|
|
|
118
111
|
this.newFlag = false;
|
|
119
112
|
return result;
|
|
120
113
|
}
|
|
121
|
-
}, {
|
|
122
|
-
key: "indexRange",
|
|
123
|
-
value: function indexRange() {
|
|
124
|
-
return [this.startIndex, this.endIndex];
|
|
125
|
-
}
|
|
126
114
|
}, {
|
|
127
115
|
key: "getChildren",
|
|
128
116
|
value: function getChildren() {
|
|
129
117
|
return this.allChildren;
|
|
130
118
|
}
|
|
131
119
|
}, {
|
|
132
|
-
key: "
|
|
133
|
-
value: function
|
|
120
|
+
key: "calcContentWidthHeight",
|
|
121
|
+
value: function calcContentWidthHeight() {
|
|
122
|
+
this.contentHeight = this.viewport.ySouth - this.viewport.yNorth;
|
|
123
|
+
this.innerContentHeight = this.viewport.yEast - this.viewport.yNorth;
|
|
124
|
+
this.innerContentWidth = this.viewport.xSouth - this.viewport.xWest;
|
|
125
|
+
this.contentWidth = this.viewport.xEast - this.viewport.xWest;
|
|
126
|
+
}
|
|
134
127
|
}]);
|
|
135
128
|
}(_TModel2.TModel);
|
|
@@ -180,6 +180,7 @@ var BracketGenerator = exports.BracketGenerator = /*#__PURE__*/function () {
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
bracket.realParent = page;
|
|
183
|
+
BracketGenerator.all[bracket.oid] = bracket;
|
|
183
184
|
return bracket;
|
|
184
185
|
}
|
|
185
186
|
}, {
|
|
@@ -208,4 +209,5 @@ var BracketGenerator = exports.BracketGenerator = /*#__PURE__*/function () {
|
|
|
208
209
|
}
|
|
209
210
|
}]);
|
|
210
211
|
}();
|
|
211
|
-
_defineProperty(BracketGenerator, "bracketMap", {});
|
|
212
|
+
_defineProperty(BracketGenerator, "bracketMap", {});
|
|
213
|
+
_defineProperty(BracketGenerator, "all", {});
|
package/build/Browser.js
CHANGED
|
@@ -18,12 +18,6 @@ var Browser = exports.Browser = /*#__PURE__*/function () {
|
|
|
18
18
|
function Browser() {
|
|
19
19
|
_classCallCheck(this, Browser);
|
|
20
20
|
this.style = undefined;
|
|
21
|
-
this.screen = {
|
|
22
|
-
x: 0,
|
|
23
|
-
y: 0,
|
|
24
|
-
width: 0,
|
|
25
|
-
height: 0
|
|
26
|
-
};
|
|
27
21
|
}
|
|
28
22
|
return _createClass(Browser, [{
|
|
29
23
|
key: "setup",
|
|
@@ -74,12 +68,5 @@ var Browser = exports.Browser = /*#__PURE__*/function () {
|
|
|
74
68
|
style = vendor === '' ? style : vendor + style.charAt(0).toUpperCase() + style.substr(1);
|
|
75
69
|
return style;
|
|
76
70
|
}
|
|
77
|
-
}, {
|
|
78
|
-
key: "measureScreen",
|
|
79
|
-
value: function measureScreen() {
|
|
80
|
-
this.screen.width = document.documentElement.clientWidth || document.body.clientWidth;
|
|
81
|
-
this.screen.height = document.documentElement.clientHeight || document.body.clientHeight;
|
|
82
|
-
return this.screen;
|
|
83
|
-
}
|
|
84
71
|
}]);
|
|
85
72
|
}();
|
package/build/EventListener.js
CHANGED
|
@@ -61,147 +61,168 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
|
|
|
61
61
|
inputType: 'touch',
|
|
62
62
|
eventType: 'start',
|
|
63
63
|
order: 1,
|
|
64
|
-
windowEvent: false
|
|
64
|
+
windowEvent: false,
|
|
65
|
+
queue: true
|
|
65
66
|
},
|
|
66
67
|
touchmove: {
|
|
67
68
|
eventName: 'touchmove',
|
|
68
69
|
inputType: 'touch',
|
|
69
70
|
eventType: 'move',
|
|
70
71
|
order: 1,
|
|
71
|
-
windowEvent: false
|
|
72
|
+
windowEvent: false,
|
|
73
|
+
queue: true
|
|
72
74
|
},
|
|
73
75
|
touchend: {
|
|
74
76
|
eventName: 'touchend',
|
|
75
77
|
inputType: 'touch',
|
|
76
78
|
eventType: 'end',
|
|
77
79
|
order: 1,
|
|
78
|
-
windowEvent: false
|
|
80
|
+
windowEvent: false,
|
|
81
|
+
queue: true
|
|
79
82
|
},
|
|
80
83
|
touchcancel: {
|
|
81
84
|
eventName: 'touchend',
|
|
82
85
|
inputType: 'touch',
|
|
83
86
|
eventType: 'cancel',
|
|
84
87
|
order: 1,
|
|
85
|
-
windowEvent: false
|
|
88
|
+
windowEvent: false,
|
|
89
|
+
queue: true
|
|
86
90
|
},
|
|
87
91
|
mousedown: {
|
|
88
92
|
eventName: 'mousedown',
|
|
89
93
|
inputType: 'mouse',
|
|
90
94
|
eventType: 'start',
|
|
91
95
|
order: 2,
|
|
92
|
-
windowEvent: false
|
|
96
|
+
windowEvent: false,
|
|
97
|
+
queue: true
|
|
93
98
|
},
|
|
94
99
|
mousemove: {
|
|
95
100
|
eventName: 'mousemove',
|
|
96
101
|
inputType: 'mouse',
|
|
97
102
|
eventType: 'move',
|
|
98
103
|
order: 2,
|
|
99
|
-
windowEvent: false
|
|
104
|
+
windowEvent: false,
|
|
105
|
+
queue: true
|
|
100
106
|
},
|
|
101
107
|
mouseup: {
|
|
102
108
|
eventName: 'mouseup',
|
|
103
109
|
inputType: 'mouse',
|
|
104
110
|
eventType: 'end',
|
|
105
111
|
order: 2,
|
|
106
|
-
windowEvent: false
|
|
112
|
+
windowEvent: false,
|
|
113
|
+
queue: true
|
|
107
114
|
},
|
|
108
115
|
mousecancel: {
|
|
109
116
|
eventName: 'mouseup',
|
|
110
117
|
inputType: 'mouse',
|
|
111
118
|
eventType: 'cancel',
|
|
112
119
|
order: 2,
|
|
113
|
-
windowEvent: false
|
|
120
|
+
windowEvent: false,
|
|
121
|
+
queue: true
|
|
114
122
|
},
|
|
115
123
|
mouseleave: {
|
|
116
124
|
eventName: 'mouseleave',
|
|
117
125
|
inputType: 'mouse',
|
|
118
126
|
eventType: 'cancel',
|
|
119
127
|
order: 2,
|
|
120
|
-
windowEvent: false
|
|
128
|
+
windowEvent: false,
|
|
129
|
+
queue: true
|
|
121
130
|
},
|
|
122
131
|
pointerdown: {
|
|
123
132
|
eventName: 'mousedown',
|
|
124
133
|
inputType: 'pointer',
|
|
125
134
|
eventType: 'start',
|
|
126
135
|
order: 3,
|
|
127
|
-
windowEvent: false
|
|
136
|
+
windowEvent: false,
|
|
137
|
+
queue: true
|
|
128
138
|
},
|
|
129
139
|
pointermove: {
|
|
130
140
|
eventName: 'mousemove',
|
|
131
141
|
inputType: 'pointer',
|
|
132
142
|
eventType: 'move',
|
|
133
143
|
order: 3,
|
|
134
|
-
windowEvent: false
|
|
144
|
+
windowEvent: false,
|
|
145
|
+
queue: true
|
|
135
146
|
},
|
|
136
147
|
pointerup: {
|
|
137
148
|
eventName: 'mouseup',
|
|
138
149
|
inputType: 'pointer',
|
|
139
150
|
eventType: 'end',
|
|
140
151
|
order: 3,
|
|
141
|
-
windowEvent: false
|
|
152
|
+
windowEvent: false,
|
|
153
|
+
queue: true
|
|
142
154
|
},
|
|
143
155
|
pointercancel: {
|
|
144
156
|
eventName: 'mousecancel',
|
|
145
157
|
inputType: 'pointer',
|
|
146
158
|
eventType: 'cancel',
|
|
147
159
|
order: 3,
|
|
148
|
-
windowEvent: false
|
|
160
|
+
windowEvent: false,
|
|
161
|
+
queue: true
|
|
149
162
|
},
|
|
150
163
|
wheel: {
|
|
151
164
|
eventName: 'wheel',
|
|
152
165
|
inputType: '',
|
|
153
166
|
eventType: 'wheel',
|
|
154
167
|
order: 1,
|
|
155
|
-
windowEvent: false
|
|
168
|
+
windowEvent: false,
|
|
169
|
+
queue: true
|
|
156
170
|
},
|
|
157
171
|
DOMMouseScroll: {
|
|
158
172
|
eventName: 'wheel',
|
|
159
173
|
inputType: '',
|
|
160
174
|
eventType: 'wheel',
|
|
161
175
|
order: 1,
|
|
162
|
-
windowEvent: false
|
|
176
|
+
windowEvent: false,
|
|
177
|
+
queue: true
|
|
163
178
|
},
|
|
164
179
|
mousewheel: {
|
|
165
180
|
eventName: 'wheel',
|
|
166
181
|
inputType: '',
|
|
167
182
|
eventType: 'wheel',
|
|
168
183
|
order: 1,
|
|
169
|
-
windowEvent: false
|
|
184
|
+
windowEvent: false,
|
|
185
|
+
queue: true
|
|
170
186
|
},
|
|
171
187
|
blur: {
|
|
172
188
|
eventName: 'blur',
|
|
173
189
|
inputType: 'mouse',
|
|
174
190
|
eventType: 'cancel',
|
|
175
191
|
order: 2,
|
|
176
|
-
windowEvent: true
|
|
192
|
+
windowEvent: true,
|
|
193
|
+
queue: true
|
|
177
194
|
},
|
|
178
195
|
keyup: {
|
|
179
196
|
eventName: 'key',
|
|
180
197
|
inputType: '',
|
|
181
198
|
eventType: 'key',
|
|
182
199
|
order: 1,
|
|
183
|
-
windowEvent: true
|
|
200
|
+
windowEvent: true,
|
|
201
|
+
queue: true
|
|
184
202
|
},
|
|
185
203
|
keydown: {
|
|
186
204
|
eventName: 'key',
|
|
187
205
|
inputType: '',
|
|
188
206
|
eventType: 'key',
|
|
189
207
|
order: 1,
|
|
190
|
-
windowEvent: true
|
|
208
|
+
windowEvent: true,
|
|
209
|
+
queue: true
|
|
191
210
|
},
|
|
192
211
|
resize: {
|
|
193
212
|
eventName: 'resize',
|
|
194
213
|
inputType: '',
|
|
195
214
|
eventType: 'resize',
|
|
196
215
|
order: 1,
|
|
197
|
-
windowEvent: true
|
|
216
|
+
windowEvent: true,
|
|
217
|
+
queue: false
|
|
198
218
|
},
|
|
199
219
|
orientationchange: {
|
|
200
220
|
eventName: 'resize',
|
|
201
221
|
inputType: '',
|
|
202
222
|
eventType: 'resize',
|
|
203
223
|
order: 1,
|
|
204
|
-
windowEvent: true
|
|
224
|
+
windowEvent: true,
|
|
225
|
+
queue: false
|
|
205
226
|
}
|
|
206
227
|
};
|
|
207
228
|
this.domEvents = Object.keys(this.eventMap).filter(function (key) {
|
|
@@ -308,15 +329,11 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
|
|
|
308
329
|
return;
|
|
309
330
|
}
|
|
310
331
|
var lastEvent = this.eventQueue.shift();
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
this.currentEventType = lastEvent.eventType;
|
|
317
|
-
this.currentKey = this.currentTouch.key;
|
|
318
|
-
this.currentTouch.key = "";
|
|
319
|
-
}
|
|
332
|
+
this.findEventHandlers(lastEvent);
|
|
333
|
+
this.currentEventName = lastEvent.eventName;
|
|
334
|
+
this.currentEventType = lastEvent.eventType;
|
|
335
|
+
this.currentKey = this.currentTouch.key;
|
|
336
|
+
this.currentTouch.key = "";
|
|
320
337
|
(0, _App.getRunScheduler)().schedule(10, "captureEvents-".concat(lastEvent));
|
|
321
338
|
}
|
|
322
339
|
}, {
|
|
@@ -333,7 +350,8 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
|
|
|
333
350
|
var eventName = eventItem.eventName,
|
|
334
351
|
inputType = eventItem.inputType,
|
|
335
352
|
eventType = eventItem.eventType,
|
|
336
|
-
eventOrder = eventItem.order
|
|
353
|
+
eventOrder = eventItem.order,
|
|
354
|
+
queue = eventItem.queue;
|
|
337
355
|
var now = _TUtil.TUtil.now();
|
|
338
356
|
this.touchTimeStamp = Math.max(now, this.touchTimeStamp);
|
|
339
357
|
var tmodel = this.getTModelFromEvent(event);
|
|
@@ -354,14 +372,16 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
|
|
|
354
372
|
}
|
|
355
373
|
}
|
|
356
374
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
375
|
+
if (queue) {
|
|
376
|
+
this.eventQueue.push({
|
|
377
|
+
eventName: eventName,
|
|
378
|
+
eventItem: eventItem,
|
|
379
|
+
eventType: eventType,
|
|
380
|
+
originalName: originalName,
|
|
381
|
+
tmodel: tmodel,
|
|
382
|
+
timeStamp: now
|
|
383
|
+
});
|
|
384
|
+
}
|
|
365
385
|
switch (eventName) {
|
|
366
386
|
case 'mousedown':
|
|
367
387
|
case 'touchstart':
|
|
@@ -430,6 +450,10 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
|
|
|
430
450
|
case 'key':
|
|
431
451
|
this.currentTouch.key = event.which || event.keyCode;
|
|
432
452
|
break;
|
|
453
|
+
case 'resize':
|
|
454
|
+
(0, _App.tRoot)().val('width', (0, _App.tRoot)().targets.width());
|
|
455
|
+
(0, _App.tRoot)().val('height', (0, _App.tRoot)().targets.height());
|
|
456
|
+
break;
|
|
433
457
|
}
|
|
434
458
|
(0, _App.getRunScheduler)().schedule(0, "".concat(originalName, "-").concat(eventName, "-").concat((event.target.tagName || "").toUpperCase()));
|
|
435
459
|
}
|
package/build/LocationManager.js
CHANGED
|
@@ -64,36 +64,29 @@ var LocationManager = exports.LocationManager = /*#__PURE__*/function () {
|
|
|
64
64
|
}, {
|
|
65
65
|
key: "calculateContainer",
|
|
66
66
|
value: function calculateContainer(container) {
|
|
67
|
-
var _this = this;
|
|
68
67
|
var allChildren = this.getChildren(container);
|
|
69
68
|
var viewport = container.createViewport();
|
|
70
69
|
var visibleChildrenCount = container.visibleChildren.length;
|
|
71
70
|
container.visibleChildren.length = 0;
|
|
72
71
|
var i = 0;
|
|
73
72
|
var childrenLength = allChildren.length;
|
|
74
|
-
|
|
73
|
+
while (i < childrenLength && _App.tApp.isRunning()) {
|
|
75
74
|
var child = allChildren[i++];
|
|
76
75
|
if (!child) {
|
|
77
|
-
|
|
76
|
+
continue;
|
|
78
77
|
}
|
|
79
|
-
|
|
80
|
-
var innerXEast;
|
|
81
|
-
var preX = child.getX();
|
|
82
|
-
var preY = child.getY();
|
|
83
|
-
_this.calculateTargets(child);
|
|
78
|
+
this.calculateTargets(child);
|
|
84
79
|
viewport.setCurrentChild(child);
|
|
85
80
|
child.setLocation(viewport);
|
|
86
81
|
child.calculateAbsolutePosition(child.x, child.y);
|
|
87
|
-
|
|
88
|
-
outerXEast = _TUtil.TUtil.isDefined(child.val('outerXEast')) ? child.val('outerXEast') : child.getOuterXEast();
|
|
89
|
-
if (viewport.isOverflow(outerXEast, innerXEast)) {
|
|
82
|
+
if (viewport.isOverflow(child.getOuterOverflowWidth(), container.getInnerOverflowWidth())) {
|
|
90
83
|
viewport.overflow();
|
|
91
84
|
child.setLocation(viewport);
|
|
92
85
|
} else {
|
|
93
86
|
child.setLocation(viewport);
|
|
94
87
|
}
|
|
95
|
-
if (child.isIncluded() && !
|
|
96
|
-
|
|
88
|
+
if (child.isIncluded() && !this.hasLocationMap[child.oid]) {
|
|
89
|
+
this.addToLocationList(child);
|
|
97
90
|
}
|
|
98
91
|
if (child.isTargetEnabled('x') && !child.isTargetUpdating('x') && !child.isTargetImperative('x') && child.getTargetSteps('x') === 0) {
|
|
99
92
|
_TargetExecutor.TargetExecutor.resolveTargetValue(child, 'x');
|
|
@@ -107,50 +100,39 @@ var LocationManager = exports.LocationManager = /*#__PURE__*/function () {
|
|
|
107
100
|
} else if (!_TUtil.TUtil.isDefined(child.targetValues.y)) {
|
|
108
101
|
child.val('y', child.y);
|
|
109
102
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
if (preY !== child.getY()) {
|
|
114
|
-
child.addToStyleTargetList('y');
|
|
115
|
-
}
|
|
103
|
+
child.addToStyleTargetList('x');
|
|
104
|
+
child.addToStyleTargetList('y');
|
|
116
105
|
child.calculateAbsolutePosition(child.getX(), child.getY());
|
|
117
106
|
viewport.isVisible(child);
|
|
118
107
|
child.addToParentVisibleChildren();
|
|
119
108
|
if (child.shouldCalculateChildren()) {
|
|
120
|
-
|
|
109
|
+
this.calculateContainer(child);
|
|
121
110
|
}
|
|
122
111
|
if (child.isInFlow()) {
|
|
123
112
|
if (_TUtil.TUtil.isNumber(child.val('appendNewLine'))) {
|
|
124
113
|
viewport.appendNewLine();
|
|
125
|
-
|
|
114
|
+
container.calcContentWidthHeight();
|
|
126
115
|
} else {
|
|
127
|
-
|
|
116
|
+
container.calcContentWidthHeight();
|
|
128
117
|
viewport.nextLocation();
|
|
129
118
|
}
|
|
130
119
|
}
|
|
131
|
-
if (
|
|
132
|
-
child.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
child.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
viewport.calcContentWidthHeight();
|
|
150
|
-
_this.locationListStats.push("".concat(child.oid, "-").concat(child.updatingTargetList.length, "-").concat(_TUtil.TUtil.now() - _this.startTime));
|
|
151
|
-
};
|
|
152
|
-
while (i < childrenLength && _App.tApp.isRunning()) {
|
|
153
|
-
if (_loop()) continue;
|
|
120
|
+
if (!_TUtil.TUtil.isDefined(child.targetValues.height) && !_TUtil.TUtil.isDefined(child.targets.heightFromDom) && child.getContentHeight() > 0) {
|
|
121
|
+
var preVal = child.getHeight();
|
|
122
|
+
child.val('height', child.getContentHeight());
|
|
123
|
+
if (preVal !== child.getHeight()) {
|
|
124
|
+
child.addToStyleTargetList('height');
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (!_TUtil.TUtil.isDefined(child.targetValues.width) && !_TUtil.TUtil.isDefined(child.targets.widthFromDom) && child.getContentWidth() > 0) {
|
|
128
|
+
var _preVal = child.getWidth();
|
|
129
|
+
child.val('width', child.getContentWidth());
|
|
130
|
+
if (_preVal !== child.getWidth()) {
|
|
131
|
+
child.addToStyleTargetList('width');
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
container.calcContentWidthHeight();
|
|
135
|
+
this.locationListStats.push("".concat(child.oid, "-").concat(child.updatingTargetList.length, "-").concat(_TUtil.TUtil.now() - this.startTime));
|
|
154
136
|
}
|
|
155
137
|
if (visibleChildrenCount !== container.visibleChildren.length && container.targets['onVisibleChildrenChange']) {
|
|
156
138
|
this.activateTargets(container, container.targets['onVisibleChildrenChange']);
|
|
@@ -169,10 +151,10 @@ var LocationManager = exports.LocationManager = /*#__PURE__*/function () {
|
|
|
169
151
|
if (tmodel.hasDom()) {
|
|
170
152
|
var preWidth = tmodel.getWidth();
|
|
171
153
|
var preHeight = tmodel.getHeight();
|
|
172
|
-
if (!_TUtil.TUtil.isDefined(tmodel.targetValues.width) && !_TUtil.TUtil.isDefined(tmodel.targets.width) && !
|
|
154
|
+
if (!_TUtil.TUtil.isDefined(tmodel.targetValues.width) && !_TUtil.TUtil.isDefined(tmodel.targets.width) && !tmodel.hasChildren() || tmodel.getTargetValue('widthFromDom')) {
|
|
173
155
|
_TargetUtil.TargetUtil.setWidthFromDom(tmodel);
|
|
174
156
|
}
|
|
175
|
-
if (!_TUtil.TUtil.isDefined(tmodel.targetValues.height) && !_TUtil.TUtil.isDefined(tmodel.targets.height) && !
|
|
157
|
+
if (!_TUtil.TUtil.isDefined(tmodel.targetValues.height) && !_TUtil.TUtil.isDefined(tmodel.targets.height) && !tmodel.hasChildren() || tmodel.getTargetValue('heightFromDom')) {
|
|
176
158
|
_TargetUtil.TargetUtil.setHeightFromDom(tmodel);
|
|
177
159
|
}
|
|
178
160
|
if (preWidth !== tmodel.getWidth()) {
|
|
@@ -197,7 +179,7 @@ var LocationManager = exports.LocationManager = /*#__PURE__*/function () {
|
|
|
197
179
|
}, {
|
|
198
180
|
key: "activateTargets",
|
|
199
181
|
value: function activateTargets(tmodel, targetList) {
|
|
200
|
-
var
|
|
182
|
+
var _this = this;
|
|
201
183
|
if (!Array.isArray(targetList)) {
|
|
202
184
|
targetList = [targetList];
|
|
203
185
|
}
|
|
@@ -210,18 +192,18 @@ var LocationManager = exports.LocationManager = /*#__PURE__*/function () {
|
|
|
210
192
|
if (_typeof(target) === 'object') {
|
|
211
193
|
var key = target.key,
|
|
212
194
|
handler = target.handler;
|
|
213
|
-
|
|
195
|
+
_this.activateSingleTarget(handler, key);
|
|
214
196
|
} else {
|
|
215
|
-
|
|
197
|
+
_this.activateSingleTarget(tmodel, target);
|
|
216
198
|
}
|
|
217
199
|
});
|
|
218
200
|
}
|
|
219
201
|
} else if (_typeof(targetName) === 'object') {
|
|
220
202
|
var key = targetName.key,
|
|
221
203
|
handler = targetName.handler;
|
|
222
|
-
|
|
204
|
+
_this.activateSingleTarget(handler, key);
|
|
223
205
|
} else {
|
|
224
|
-
|
|
206
|
+
_this.activateSingleTarget(tmodel, targetName);
|
|
225
207
|
}
|
|
226
208
|
});
|
|
227
209
|
}
|
package/build/PageManager.js
CHANGED
|
@@ -31,21 +31,16 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
|
|
|
31
31
|
return _createClass(PageManager, [{
|
|
32
32
|
key: "openPage",
|
|
33
33
|
value: function openPage(link) {
|
|
34
|
-
var _this = this;
|
|
35
34
|
_App.tApp.stop();
|
|
36
35
|
_App.tApp.reset();
|
|
37
36
|
if (!this.pageCache[link]) {
|
|
38
|
-
_App.tApp.tRoot.
|
|
39
|
-
return child.$dom.innerHTML("");
|
|
40
|
-
});
|
|
37
|
+
_App.tApp.tRoot.$dom.innerHTML("");
|
|
41
38
|
_App.tApp.tRoot = _App.tApp.tRootFactory();
|
|
42
39
|
this.lastLink = link;
|
|
43
40
|
setTimeout(_App.tApp.start);
|
|
44
41
|
} else {
|
|
45
42
|
_App.tApp.tRoot = this.pageCache[link].tRoot;
|
|
46
|
-
_App.tApp.tRoot.
|
|
47
|
-
child.$dom.innerHTML(_this.pageCache[link].htmls[index]);
|
|
48
|
-
});
|
|
43
|
+
_App.tApp.tRoot.$dom.innerHTML(this.pageCache[link].html);
|
|
49
44
|
_TUtil.TUtil.initDoms(this.pageCache[link].visibleList);
|
|
50
45
|
_App.tApp.manager.lists.visible = _toConsumableArray(this.pageCache[link].visibleList);
|
|
51
46
|
this.lastLink = link;
|
|
@@ -72,9 +67,7 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
|
|
|
72
67
|
if (this.lastLink) {
|
|
73
68
|
this.pageCache[this.lastLink] = {
|
|
74
69
|
link: this.lastLink,
|
|
75
|
-
|
|
76
|
-
return child.$dom.innerHTML();
|
|
77
|
-
}),
|
|
70
|
+
html: _App.tApp.tRoot.$dom.innerHTML(),
|
|
78
71
|
visibleList: _toConsumableArray(_App.tApp.manager.lists.visible),
|
|
79
72
|
tRoot: _App.tApp.tRoot
|
|
80
73
|
};
|
|
@@ -92,9 +85,7 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
|
|
|
92
85
|
if (!currentState.browserUrl) {
|
|
93
86
|
this.pageCache[document.URL] = {
|
|
94
87
|
link: document.URL,
|
|
95
|
-
|
|
96
|
-
return child.$dom.innerHTML();
|
|
97
|
-
}),
|
|
88
|
+
htms: _App.tApp.tRoot.$dom.innerHTML(),
|
|
98
89
|
visibleList: _toConsumableArray(_App.tApp.manager.lists.visible),
|
|
99
90
|
tRoot: _App.tApp.tRoot
|
|
100
91
|
};
|
package/build/TModel.js
CHANGED
|
@@ -55,8 +55,6 @@ var TModel = exports.TModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
55
55
|
_this.absY = 0;
|
|
56
56
|
_this.domHeight = undefined;
|
|
57
57
|
_this.domWidth = undefined;
|
|
58
|
-
_this.innerContentWidth = 0;
|
|
59
|
-
_this.innerContentHeight = 0;
|
|
60
58
|
_this.contentWidth = 0;
|
|
61
59
|
_this.contentHeight = 0;
|
|
62
60
|
_this.styleMap = {};
|
|
@@ -76,7 +74,20 @@ var TModel = exports.TModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
76
74
|
return _createClass(TModel, [{
|
|
77
75
|
key: "createViewport",
|
|
78
76
|
value: function createViewport() {
|
|
79
|
-
this.viewport = this.viewport
|
|
77
|
+
this.viewport = this.viewport || new _Viewport.Viewport();
|
|
78
|
+
var scrollLeft = -this.getScrollLeft();
|
|
79
|
+
var scrollTop = -this.getScrollTop();
|
|
80
|
+
this.viewport.xNext = scrollLeft;
|
|
81
|
+
this.viewport.xNorth = scrollLeft;
|
|
82
|
+
this.viewport.xEast = scrollLeft;
|
|
83
|
+
this.viewport.xSouth = scrollLeft;
|
|
84
|
+
this.viewport.xWest = scrollLeft;
|
|
85
|
+
this.viewport.xOverflow = this.getXOverflow();
|
|
86
|
+
this.viewport.yNext = scrollTop;
|
|
87
|
+
this.viewport.yNorth = scrollTop;
|
|
88
|
+
this.viewport.yWest = scrollTop;
|
|
89
|
+
this.viewport.yEast = scrollTop;
|
|
90
|
+
this.viewport.ySouth = scrollTop;
|
|
80
91
|
return this.viewport;
|
|
81
92
|
}
|
|
82
93
|
}, {
|
|
@@ -250,12 +261,12 @@ var TModel = exports.TModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
250
261
|
}, {
|
|
251
262
|
key: "getDomParent",
|
|
252
263
|
value: function getDomParent() {
|
|
253
|
-
return this.actualValues.domParent
|
|
264
|
+
return this.actualValues.domParent || _SearchUtil.SearchUtil.findParentByTarget(this, 'domHolder');
|
|
254
265
|
}
|
|
255
266
|
}, {
|
|
256
267
|
key: "getDomHolder",
|
|
257
268
|
value: function getDomHolder() {
|
|
258
|
-
return this.actualValues.domHolder ? this.actualValues.domHolder : this.getDomParent() ? this.getDomParent().$dom :
|
|
269
|
+
return this.actualValues.domHolder ? this.actualValues.domHolder : this.getDomParent() ? this.getDomParent().$dom : null;
|
|
259
270
|
}
|
|
260
271
|
}, {
|
|
261
272
|
key: "bug",
|
|
@@ -318,31 +329,47 @@ var TModel = exports.TModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
318
329
|
value: function getInnerContentHeight() {
|
|
319
330
|
return 0;
|
|
320
331
|
}
|
|
332
|
+
}, {
|
|
333
|
+
key: "calcContentWidthHeight",
|
|
334
|
+
value: function calcContentWidthHeight() {
|
|
335
|
+
this.contentHeight = this.viewport.ySouth - this.viewport.yNorth;
|
|
336
|
+
this.contentWidth = this.viewport.xEast - this.viewport.xWest;
|
|
337
|
+
}
|
|
321
338
|
}, {
|
|
322
339
|
key: "getInnerHeight",
|
|
323
340
|
value: function getInnerHeight() {
|
|
324
|
-
|
|
341
|
+
var _this$actualValues$in;
|
|
342
|
+
return (_this$actualValues$in = this.actualValues.innerHeight) !== null && _this$actualValues$in !== void 0 ? _this$actualValues$in : this.getHeight();
|
|
325
343
|
}
|
|
326
344
|
}, {
|
|
327
345
|
key: "getInnerWidth",
|
|
328
346
|
value: function getInnerWidth() {
|
|
329
|
-
|
|
347
|
+
var _this$actualValues$in2;
|
|
348
|
+
return (_this$actualValues$in2 = this.actualValues.innerWidth) !== null && _this$actualValues$in2 !== void 0 ? _this$actualValues$in2 : this.getWidth();
|
|
330
349
|
}
|
|
331
350
|
}, {
|
|
332
|
-
key: "
|
|
333
|
-
value: function
|
|
334
|
-
|
|
351
|
+
key: "getInnerOverflowWidth",
|
|
352
|
+
value: function getInnerOverflowWidth() {
|
|
353
|
+
var _this$actualValues$in3;
|
|
354
|
+
return (_this$actualValues$in3 = this.actualValues.innerOverflowWidth) !== null && _this$actualValues$in3 !== void 0 ? _this$actualValues$in3 : this.absX + this.getInnerWidth();
|
|
335
355
|
}
|
|
336
356
|
}, {
|
|
337
|
-
key: "
|
|
338
|
-
value: function
|
|
339
|
-
|
|
357
|
+
key: "getOuterOverflowWidth",
|
|
358
|
+
value: function getOuterOverflowWidth() {
|
|
359
|
+
var _this$actualValues$ou;
|
|
360
|
+
return (_this$actualValues$ou = this.actualValues.outerOverflowWidth) !== null && _this$actualValues$ou !== void 0 ? _this$actualValues$ou : this.absX + this.getInnerWidth();
|
|
340
361
|
}
|
|
341
362
|
}, {
|
|
342
363
|
key: "getContentWidth",
|
|
343
364
|
value: function getContentWidth() {
|
|
344
365
|
return this.contentWidth;
|
|
345
366
|
}
|
|
367
|
+
}, {
|
|
368
|
+
key: "getXOverflow",
|
|
369
|
+
value: function getXOverflow() {
|
|
370
|
+
var _this$actualValues$xO;
|
|
371
|
+
return (_this$actualValues$xO = this.actualValues.xOverflow) !== null && _this$actualValues$xO !== void 0 ? _this$actualValues$xO : 0;
|
|
372
|
+
}
|
|
346
373
|
}, {
|
|
347
374
|
key: "getUIDepth",
|
|
348
375
|
value: function getUIDepth() {
|
package/build/TModelManager.js
CHANGED
|
@@ -236,7 +236,19 @@ var TModelManager = exports.TModelManager = /*#__PURE__*/function () {
|
|
|
236
236
|
value: function fixStyle(tmodel) {
|
|
237
237
|
var transformUpdate = false;
|
|
238
238
|
tmodel.styleTargetList.forEach(function (key) {
|
|
239
|
-
if (
|
|
239
|
+
if (key === 'x') {
|
|
240
|
+
var x = tmodel.absX - tmodel.getDomParent().absX;
|
|
241
|
+
if (tmodel.transformMap['x'] !== x) {
|
|
242
|
+
tmodel.transformMap[key] = x;
|
|
243
|
+
transformUpdate = true;
|
|
244
|
+
}
|
|
245
|
+
} else if (key === 'y') {
|
|
246
|
+
var y = tmodel.absY - tmodel.getDomParent().absY;
|
|
247
|
+
if (tmodel.transformMap['y'] !== y) {
|
|
248
|
+
tmodel.transformMap[key] = y;
|
|
249
|
+
transformUpdate = true;
|
|
250
|
+
}
|
|
251
|
+
} else if (_TargetUtil.TargetUtil.transformMap[key]) {
|
|
240
252
|
var value = _TargetUtil.TargetUtil.rotate3D[key] ? tmodel.val(key) : _TargetUtil.TargetUtil.scaleMap[key] ? _TUtil.TUtil.formatNum(tmodel.val(key), 2) : tmodel.floorVal(key);
|
|
241
253
|
if (tmodel.transformMap[key] !== value) {
|
|
242
254
|
tmodel.transformMap[key] = value;
|
package/build/TUtil.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.TUtil = void 0;
|
|
7
7
|
var _$Dom = require("./$Dom.js");
|
|
8
8
|
var _App = require("./App.js");
|
|
9
|
-
var _SearchUtil = require("./SearchUtil.js");
|
|
10
9
|
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); }
|
|
11
10
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
12
11
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -31,40 +30,12 @@ var TUtil = exports.TUtil = /*#__PURE__*/function () {
|
|
|
31
30
|
return _createClass(TUtil, null, [{
|
|
32
31
|
key: "getBoundingRect",
|
|
33
32
|
value: function getBoundingRect(tmodel) {
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
bottom = top + tmodel.getHeight();
|
|
41
|
-
oid = tmodel.oid;
|
|
42
|
-
} else {
|
|
43
|
-
var rect = tmodel.actualValues.domHolder.getBoundingClientRect();
|
|
44
|
-
left = rect.left;
|
|
45
|
-
top = rect.top;
|
|
46
|
-
right = rect.right;
|
|
47
|
-
bottom = rect.bottom;
|
|
48
|
-
oid = tmodel.actualValues.domHolder.attr('id');
|
|
49
|
-
}
|
|
50
|
-
} else {
|
|
51
|
-
var parent = tmodel.getDomParent() ? tmodel.getDomParent() : _SearchUtil.SearchUtil.findParentByTarget(tmodel, 'domHolder');
|
|
52
|
-
if (parent) {
|
|
53
|
-
left = parent.absX;
|
|
54
|
-
top = parent.absY;
|
|
55
|
-
var width = parent.getWidth();
|
|
56
|
-
var height = parent.getHeight();
|
|
57
|
-
right = left + width;
|
|
58
|
-
bottom = top + height;
|
|
59
|
-
oid = parent.oid;
|
|
60
|
-
} else {
|
|
61
|
-
left = 0;
|
|
62
|
-
top = 0;
|
|
63
|
-
right = (0, _App.getScreenWidth)();
|
|
64
|
-
bottom = (0, _App.getScreenHeight)();
|
|
65
|
-
oid = 'screen';
|
|
66
|
-
}
|
|
67
|
-
}
|
|
33
|
+
var parent = tmodel.getParent();
|
|
34
|
+
var left = parent.absX;
|
|
35
|
+
var top = parent.absY;
|
|
36
|
+
var right = left + parent.getWidth();
|
|
37
|
+
var bottom = top + parent.getHeight();
|
|
38
|
+
var oid = parent.oid;
|
|
68
39
|
return {
|
|
69
40
|
left: left,
|
|
70
41
|
top: top,
|
|
@@ -219,7 +190,7 @@ var TUtil = exports.TUtil = /*#__PURE__*/function () {
|
|
|
219
190
|
var g = _step2.value;
|
|
220
191
|
var gtab = g.isVisible() ? tab + '| ' : tab + 'x ';
|
|
221
192
|
if (g.type === 'BI') {
|
|
222
|
-
console.log("".concat(gtab).concat(g.oid, " v:").concat(g.isVisible(), " x:").concat(Math.floor(g.getX()), " y:").concat(Math.floor(g.getY()), "
|
|
193
|
+
console.log("".concat(gtab).concat(g.oid, " v:").concat(g.isVisible(), " x:").concat(Math.floor(g.getX()), " y:").concat(Math.floor(g.getY()), ", y:").concat(Math.floor(g.absY), " w:").concat(Math.floor(g.getWidth()), " h:").concat(Math.floor(g.getHeight()), " hc:").concat(Math.floor(g.getContentHeight())));
|
|
223
194
|
} else {
|
|
224
195
|
console.log("".concat(gtab).concat(g.oid, " v:").concat(g.isVisible(), " x:").concat(Math.floor(g.getX()), " y:").concat(Math.floor(g.getY()), " w:").concat(Math.floor(g.getWidth()), " h:").concat(Math.floor(g.getHeight()), " hc:").concat(Math.floor(g.getContentHeight())));
|
|
225
196
|
}
|
package/build/TargetManager.js
CHANGED
|
@@ -130,7 +130,7 @@ var TargetManager = exports.TargetManager = /*#__PURE__*/function () {
|
|
|
130
130
|
var originalTargetName, originalTarget, originalTModel;
|
|
131
131
|
if (step <= steps) {
|
|
132
132
|
if (!_TUtil.TUtil.isDefined(initialValue)) {
|
|
133
|
-
initialValue = tmodel.actualValues[key];
|
|
133
|
+
initialValue = _TUtil.TUtil.isDefined(tmodel.actualValues[key]) ? tmodel.actualValues[key] : typeof theValue === 'number' ? 0 : undefined;
|
|
134
134
|
tmodel.setTargetInitialValue(key, initialValue);
|
|
135
135
|
}
|
|
136
136
|
tmodel.actualValues[key] = _TargetUtil.TargetUtil.morph(tmodel, key, initialValue, theValue, step, steps);
|
package/build/TargetUtil.js
CHANGED
|
@@ -86,7 +86,7 @@ var TargetUtil = exports.TargetUtil = /*#__PURE__*/function () {
|
|
|
86
86
|
}, {
|
|
87
87
|
key: "isListTarget",
|
|
88
88
|
value: function isListTarget(value) {
|
|
89
|
-
return _typeof(value) === 'object' && Array.isArray(value.list);
|
|
89
|
+
return _typeof(value) === 'object' && value !== null && Array.isArray(value.list);
|
|
90
90
|
}
|
|
91
91
|
}, {
|
|
92
92
|
key: "isObjectTarget",
|
|
@@ -307,7 +307,8 @@ _defineProperty(TargetUtil, "styleWithUnitMap", {
|
|
|
307
307
|
padding: true,
|
|
308
308
|
left: true,
|
|
309
309
|
top: true,
|
|
310
|
-
fontWeight: true
|
|
310
|
+
fontWeight: true,
|
|
311
|
+
letterSpacing: true
|
|
311
312
|
});
|
|
312
313
|
_defineProperty(TargetUtil, "colorMap", {
|
|
313
314
|
color: true,
|
|
@@ -333,7 +334,10 @@ _defineProperty(TargetUtil, "styleTargetMap", _objectSpread(_objectSpread(_objec
|
|
|
333
334
|
justifyContent: true,
|
|
334
335
|
alignItems: true,
|
|
335
336
|
display: true,
|
|
336
|
-
cursor: true
|
|
337
|
+
cursor: true,
|
|
338
|
+
fontFamily: true,
|
|
339
|
+
overflow: true,
|
|
340
|
+
textDecoration: true
|
|
337
341
|
}));
|
|
338
342
|
_defineProperty(TargetUtil, "scaleMap", {
|
|
339
343
|
scale: true,
|
package/build/Viewport.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Viewport = void 0;
|
|
7
7
|
var _TUtil = require("./TUtil.js");
|
|
8
|
-
var _App = require("./App.js");
|
|
9
8
|
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); }
|
|
10
9
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
10
|
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); } }
|
|
@@ -16,109 +15,56 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
16
15
|
* It calculates the locations and visibility of objects
|
|
17
16
|
*/
|
|
18
17
|
var Viewport = exports.Viewport = /*#__PURE__*/function () {
|
|
19
|
-
function Viewport(
|
|
18
|
+
function Viewport() {
|
|
20
19
|
_classCallCheck(this, Viewport);
|
|
21
|
-
this.tmodel = tmodel;
|
|
22
20
|
this.xNext = 0;
|
|
23
21
|
this.xNorth = 0;
|
|
24
22
|
this.xWest = 0;
|
|
25
23
|
this.xEast = 0;
|
|
26
24
|
this.xSouth = 0;
|
|
27
25
|
this.xOverflow = 0;
|
|
28
|
-
this.xOffset = 0;
|
|
29
26
|
this.yNext = 0;
|
|
30
27
|
this.yNorth = 0;
|
|
31
28
|
this.yWest = 0;
|
|
32
29
|
this.yEast = 0;
|
|
33
30
|
this.ySouth = 0;
|
|
34
|
-
this.yOffset = 0;
|
|
35
|
-
this.reset();
|
|
36
31
|
}
|
|
37
32
|
return _createClass(Viewport, [{
|
|
38
|
-
key: "reset",
|
|
39
|
-
value: function reset() {
|
|
40
|
-
var x, y;
|
|
41
|
-
if (this.tmodel.type === 'BI') {
|
|
42
|
-
x = this.tmodel.getX() + this.tmodel.getScrollLeft();
|
|
43
|
-
y = this.tmodel.getY() + this.tmodel.getScrollTop();
|
|
44
|
-
this.xOffset = 0;
|
|
45
|
-
this.yOffset = 0;
|
|
46
|
-
this.xNext = x;
|
|
47
|
-
this.xNorth = x;
|
|
48
|
-
this.xEast = x;
|
|
49
|
-
this.xSouth = x;
|
|
50
|
-
this.xWest = x;
|
|
51
|
-
this.xOverflow = this.tmodel.getRealParent().getX();
|
|
52
|
-
this.yNext = y;
|
|
53
|
-
this.yNorth = y;
|
|
54
|
-
this.yWest = y;
|
|
55
|
-
this.yEast = y;
|
|
56
|
-
this.ySouth = this.tmodel.getRealParent().viewport ? this.tmodel.getRealParent().viewport.ySouth : y;
|
|
57
|
-
} else {
|
|
58
|
-
this.xOffset = 0;
|
|
59
|
-
this.yOffset = 0;
|
|
60
|
-
x = this.tmodel.getX();
|
|
61
|
-
y = this.tmodel.getY();
|
|
62
|
-
this.xNext = x;
|
|
63
|
-
this.xNorth = x;
|
|
64
|
-
this.xEast = x;
|
|
65
|
-
this.xSouth = x;
|
|
66
|
-
this.xWest = x;
|
|
67
|
-
this.xOverflow = _TUtil.TUtil.isDefined(this.tmodel.val('xOverflow')) ? this.tmodel.val('xOverflow') : x;
|
|
68
|
-
this.yNext = y;
|
|
69
|
-
this.yNorth = y;
|
|
70
|
-
this.yWest = y;
|
|
71
|
-
this.yEast = y;
|
|
72
|
-
this.ySouth = y;
|
|
73
|
-
}
|
|
74
|
-
return this;
|
|
75
|
-
}
|
|
76
|
-
}, {
|
|
77
33
|
key: "setCurrentChild",
|
|
78
34
|
value: function setCurrentChild(child) {
|
|
79
35
|
this.currentChild = child;
|
|
80
|
-
this.xOffset = child.getDomParent() ? -child.getDomParent().getX() : 0;
|
|
81
|
-
this.yOffset = child.getDomParent() ? -child.getDomParent().getY() : 0;
|
|
82
36
|
}
|
|
83
37
|
}, {
|
|
84
38
|
key: "getXNext",
|
|
85
39
|
value: function getXNext() {
|
|
86
|
-
return this.xNext + this.currentChild.getLeftMargin()
|
|
40
|
+
return this.xNext + this.currentChild.getLeftMargin();
|
|
87
41
|
}
|
|
88
42
|
}, {
|
|
89
43
|
key: "getYNext",
|
|
90
44
|
value: function getYNext() {
|
|
91
|
-
return this.yNext + this.currentChild.getTopMargin()
|
|
45
|
+
return this.yNext + this.currentChild.getTopMargin();
|
|
92
46
|
}
|
|
93
47
|
}, {
|
|
94
48
|
key: "isVisible",
|
|
95
49
|
value: function isVisible(child) {
|
|
96
50
|
var x = child.absX;
|
|
97
51
|
var y = child.absY;
|
|
98
|
-
var
|
|
99
|
-
var scale =
|
|
52
|
+
var parent = child.getDomParent();
|
|
53
|
+
var scale = (parent.getMeasuringScale() || 1) * child.getMeasuringScale();
|
|
100
54
|
var maxWidth = _TUtil.TUtil.isDefined(child.getWidth()) ? scale * child.getWidth() : 0;
|
|
101
55
|
var maxHeight = _TUtil.TUtil.isDefined(child.getHeight()) ? scale * child.getHeight() : 0;
|
|
102
56
|
var status = child.visibilityStatus;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
status.bottom = y <= (0, _App.getScreenHeight)() && y <= rect.bottom;
|
|
108
|
-
status.top = y + maxHeight >= 0 && y + maxHeight >= rect.top;
|
|
109
|
-
} else {
|
|
110
|
-
status.right = x <= rect.right;
|
|
111
|
-
status.left = x + maxWidth >= rect.left;
|
|
112
|
-
status.bottom = y <= rect.bottom;
|
|
113
|
-
status.top = y + maxHeight >= rect.top;
|
|
114
|
-
}
|
|
57
|
+
status.right = Math.floor(x) <= parent.absX + parent.getWidth();
|
|
58
|
+
status.left = Math.ceil(x + maxWidth) >= parent.absX;
|
|
59
|
+
status.bottom = Math.floor(y) <= parent.absY + parent.getHeight();
|
|
60
|
+
status.top = Math.ceil(y + maxHeight) >= parent.absY;
|
|
115
61
|
child.visible = status.left && status.right && status.top && status.bottom;
|
|
116
62
|
return child.isVisible();
|
|
117
63
|
}
|
|
118
64
|
}, {
|
|
119
65
|
key: "isOverflow",
|
|
120
|
-
value: function isOverflow(
|
|
121
|
-
return _TUtil.TUtil.isNumber(
|
|
66
|
+
value: function isOverflow(outerOverflowWidth, innerOverflowWidth) {
|
|
67
|
+
return _TUtil.TUtil.isNumber(outerOverflowWidth) && _TUtil.TUtil.isNumber(innerOverflowWidth) && outerOverflowWidth > innerOverflowWidth;
|
|
122
68
|
}
|
|
123
69
|
}, {
|
|
124
70
|
key: "overflow",
|
|
@@ -154,13 +100,5 @@ var Viewport = exports.Viewport = /*#__PURE__*/function () {
|
|
|
154
100
|
this.currentChild.getRealParent().viewport.xEast = Math.max(this.currentChild.getRealParent().viewport.xEast, this.xEast);
|
|
155
101
|
this.currentChild.getRealParent().viewport.ySouth = Math.max(this.currentChild.getRealParent().viewport.ySouth, this.ySouth);
|
|
156
102
|
}
|
|
157
|
-
}, {
|
|
158
|
-
key: "calcContentWidthHeight",
|
|
159
|
-
value: function calcContentWidthHeight() {
|
|
160
|
-
this.tmodel.contentHeight = this.ySouth - this.yNorth;
|
|
161
|
-
this.tmodel.innerContentHeight = this.yEast - this.yNorth;
|
|
162
|
-
this.tmodel.innerContentWidth = this.xSouth - this.xWest;
|
|
163
|
-
this.tmodel.contentWidth = this.xEast - this.xWest;
|
|
164
|
-
}
|
|
165
103
|
}]);
|
|
166
104
|
}();
|