targetj 1.0.240 → 1.0.242

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.
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ColorUtil = void 0;
7
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
8
2
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
3
  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); } }
@@ -14,7 +8,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
14
8
  /**
15
9
  * It provides utility functions for morphing colors.
16
10
  */
17
- var ColorUtil = exports.ColorUtil = /*#__PURE__*/function () {
11
+ var ColorUtil = /*#__PURE__*/function () {
18
12
  function ColorUtil() {
19
13
  _classCallCheck(this, ColorUtil);
20
14
  }
@@ -182,4 +176,5 @@ _defineProperty(ColorUtil, "colors", {
182
176
  whitesmoke: "#f5f5f5",
183
177
  yellow: "#ffff00",
184
178
  yellowgreen: "#9acd32"
185
- });
179
+ });
180
+ export { ColorUtil };
package/build/DomInit.js CHANGED
@@ -1,13 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DomInit = void 0;
7
- var _$Dom = require("./$Dom.js");
8
- var _TUtil = require("./TUtil.js");
9
- var _App = require("./App.js");
10
- var _TargetData = require("./TargetData.js");
11
1
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
12
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
3
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
@@ -24,22 +14,27 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
24
14
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
25
15
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
26
16
  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); }
17
+ import { $Dom } from "./$Dom.js";
18
+ import { TUtil } from "./TUtil.js";
19
+ import { tRoot, App, getTModelById } from "./App.js";
20
+ import { TargetData } from "./TargetData.js";
21
+
27
22
  /**
28
23
  *
29
24
  * Map and bind dom elements to model structures
30
25
  */
31
- var DomInit = exports.DomInit = /*#__PURE__*/function () {
26
+ var DomInit = /*#__PURE__*/function () {
32
27
  function DomInit() {
33
28
  _classCallCheck(this, DomInit);
34
29
  }
35
30
  return _createClass(DomInit, null, [{
36
31
  key: "initCacheDoms",
37
32
  value: function initCacheDoms(visibleList) {
38
- var elements = (0, _App.tRoot)().$dom.queryAll('[tgjs]');
33
+ var elements = tRoot().$dom.queryAll('[tgjs]');
39
34
  visibleList.forEach(function (tmodel) {
40
35
  tmodel.$dom = null;
41
36
  });
42
- var visibleMap = _TUtil.TUtil.list2map(visibleList.filter(function (item) {
37
+ var visibleMap = TUtil.list2map(visibleList.filter(function (item) {
43
38
  return item.type !== 'BI';
44
39
  }));
45
40
  var newVisibles = [];
@@ -51,14 +46,14 @@ var DomInit = exports.DomInit = /*#__PURE__*/function () {
51
46
  var id = element.getAttribute("id");
52
47
  var tmodel = visibleMap[id];
53
48
  if (tmodel) {
54
- tmodel.$dom = new _$Dom.$Dom("#".concat(id));
49
+ tmodel.$dom = new $Dom("#".concat(id));
55
50
  } else {
56
- tmodel = (0, _App.getTModelById)(id);
51
+ tmodel = getTModelById(id);
57
52
  if (tmodel) {
58
53
  newVisibles.push(tmodel);
59
- tmodel.$dom = new _$Dom.$Dom("#".concat(id));
54
+ tmodel.$dom = new $Dom("#".concat(id));
60
55
  } else {
61
- _$Dom.$Dom.detach(element);
56
+ $Dom.detach(element);
62
57
  }
63
58
  }
64
59
  }
@@ -94,16 +89,16 @@ var DomInit = exports.DomInit = /*#__PURE__*/function () {
94
89
  patch.position = $dom.getStyleValue('position') || 'relative';
95
90
  patch.sourceDom = true;
96
91
  patch.domIsland = true;
97
- if (!_TUtil.TUtil.isDefined(tmodel.targets.reuseDomDefinition)) {
92
+ if (!TUtil.isDefined(tmodel.targets.reuseDomDefinition)) {
98
93
  patch.reuseDomDefinition = true;
99
94
  patch.domHolder = true;
100
- if (!_TUtil.TUtil.isDefined(tmodel.targets.excludeXYCalc)) {
95
+ if (!TUtil.isDefined(tmodel.targets.excludeXYCalc)) {
101
96
  patch.excludeXYCalc = true;
102
97
  }
103
- if (!_TUtil.TUtil.isDefined(tmodel.targets.x) && !_TUtil.TUtil.isDefined(tmodel.targets.excludeX)) {
98
+ if (!TUtil.isDefined(tmodel.targets.x) && !TUtil.isDefined(tmodel.targets.excludeX)) {
104
99
  patch.excludeX = true;
105
100
  }
106
- if (!_TUtil.TUtil.isDefined(tmodel.targets.y) && !_TUtil.TUtil.isDefined(tmodel.targets.excludeY)) {
101
+ if (!TUtil.isDefined(tmodel.targets.y) && !TUtil.isDefined(tmodel.targets.excludeY)) {
107
102
  patch.excludeY = true;
108
103
  }
109
104
  }
@@ -146,7 +141,7 @@ var DomInit = exports.DomInit = /*#__PURE__*/function () {
146
141
  var attr = _step4.value;
147
142
  if (attr.name.startsWith("tg-")) {
148
143
  var rawKey = attr.name.slice(3);
149
- var key = _TargetData.TargetData.toCanonicalKey(rawKey);
144
+ var key = TargetData.toCanonicalKey(rawKey);
150
145
  var rawValue = attr.value.trim();
151
146
  var value = DomInit.parseString(rawValue);
152
147
  attributeSet[key] = value;
@@ -166,7 +161,7 @@ var DomInit = exports.DomInit = /*#__PURE__*/function () {
166
161
  if (Object.keys(attributeSet).length > 0) {
167
162
  id = element.getAttribute('id');
168
163
  if (!id && !parentModel) {
169
- id = _App.App.getOid('blank').oid;
164
+ id = App.getOid('blank').oid;
170
165
  element.setAttribute('id', id);
171
166
  }
172
167
  if (!element.getAttribute('tgjs')) {
@@ -175,7 +170,7 @@ var DomInit = exports.DomInit = /*#__PURE__*/function () {
175
170
  newModel = _objectSpread({
176
171
  id: id,
177
172
  baseElement: element.tagName.toLowerCase(),
178
- $dom: new _$Dom.$Dom(element)
173
+ $dom: new $Dom(element)
179
174
  }, attributeSet);
180
175
  }
181
176
  if (parentModel) {
@@ -183,7 +178,7 @@ var DomInit = exports.DomInit = /*#__PURE__*/function () {
183
178
  newModel = {
184
179
  textOnly: false,
185
180
  html: element.outerHTML,
186
- $dom: new _$Dom.$Dom(element)
181
+ $dom: new $Dom(element)
187
182
  };
188
183
  }
189
184
  var childrenKey = DomInit.getChildrenKey(parentModel);
@@ -192,7 +187,7 @@ var DomInit = exports.DomInit = /*#__PURE__*/function () {
192
187
  parentModel[childrenKey].value.push(newModel);
193
188
  } else if (typeof parentModel[childrenKey] === 'string') {
194
189
  parentModel[childrenKey] = {
195
- cycles: _TUtil.TUtil.isNumber(+parentModel[childrenKey]) ? +parentModel[childrenKey] : 1,
190
+ cycles: TUtil.isNumber(+parentModel[childrenKey]) ? +parentModel[childrenKey] : 1,
196
191
  value: [newModel]
197
192
  };
198
193
  } else if (_typeof(parentModel[childrenKey]) === 'object') {
@@ -227,22 +222,22 @@ var DomInit = exports.DomInit = /*#__PURE__*/function () {
227
222
  delete _value.$dom;
228
223
  delete _value.id;
229
224
  _value.sourceDom = true;
230
- _value.otype = _value.id || (_parentModel.id || _App.App.getOid('blank').oid) + "_";
231
- _value.isVisible = !_TUtil.TUtil.isDefined(_value.isVisible) ? function () {
225
+ _value.otype = _value.id || (_parentModel.id || App.getOid('blank').oid) + "_";
226
+ _value.isVisible = !TUtil.isDefined(_value.isVisible) ? function () {
232
227
  return this.getParent().isVisible();
233
228
  } : _value.isVisible;
234
- _value.domParent = !_TUtil.TUtil.isDefined(_value.domParent) ? function () {
229
+ _value.domParent = !TUtil.isDefined(_value.domParent) ? function () {
235
230
  return this.getParent();
236
231
  } : _value.domParent;
237
232
  } else {
238
- _value.isVisible = !_TUtil.TUtil.isDefined(_value.isVisible) ? true : _value.isVisible;
239
- _value.domHolder = !_TUtil.TUtil.isDefined(_value.domHolder) ? true : _value.domHolder;
233
+ _value.isVisible = !TUtil.isDefined(_value.isVisible) ? true : _value.isVisible;
234
+ _value.domHolder = !TUtil.isDefined(_value.domHolder) ? true : _value.domHolder;
240
235
  _value.sourceDom = true;
241
- (0, _App.tRoot)().addChild(_value);
236
+ tRoot().addChild(_value);
242
237
  if (!_value.isVisible) {
243
238
  invisibleList.push({
244
239
  $dom: _value.$dom,
245
- tmodel: (0, _App.tRoot)().getLastChild()
240
+ tmodel: tRoot().getLastChild()
246
241
  });
247
242
  }
248
243
  }
@@ -352,17 +347,18 @@ var DomInit = exports.DomInit = /*#__PURE__*/function () {
352
347
  }, {
353
348
  key: "normalizeElementTarget",
354
349
  value: function normalizeElementTarget(elemTarget) {
355
- if (elemTarget instanceof _$Dom.$Dom) {
350
+ if (elemTarget instanceof $Dom) {
356
351
  return elemTarget;
357
352
  }
358
353
  if (elemTarget instanceof Element) {
359
- return new _$Dom.$Dom(elemTarget);
354
+ return new $Dom(elemTarget);
360
355
  }
361
356
  if (typeof elemTarget === 'string') {
362
- var el = _$Dom.$Dom.querySelector(elemTarget);
363
- return el ? new _$Dom.$Dom(el) : null;
357
+ var el = $Dom.querySelector(elemTarget);
358
+ return el ? new $Dom(el) : null;
364
359
  }
365
360
  return null;
366
361
  }
367
362
  }]);
368
- }();
363
+ }();
364
+ export { DomInit };
package/build/Easing.js CHANGED
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Easing = void 0;
7
1
  var _Easing;
8
2
  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); }
9
3
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -15,7 +9,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
15
9
  /**
16
10
  * It provides easing functions that can be ued smooth the transition of actual values toward target values.
17
11
  */
18
- var Easing = exports.Easing = /*#__PURE__*/function () {
12
+ var Easing = /*#__PURE__*/function () {
19
13
  function Easing() {
20
14
  _classCallCheck(this, Easing);
21
15
  }
@@ -121,4 +115,5 @@ var _easeOut = {
121
115
  var _easeInOut = {
122
116
  _: _Easing.cubicBezier(0.42, 0.0, 0.58, 1.0)
123
117
  };
124
- _defineProperty(Easing, "easeMap", new Map([[_Easing.LINEAR, _linear], [_Easing.EASE, _ease._], [_Easing.EASE_IN, _easeIn._], [_Easing.EASE_OUT, _easeOut._], [_Easing.EASE_IN_OUT, _easeInOut._], [_Easing.STEP_START, _stepStart], [_Easing.STEP_END, _stepEnd]]));
118
+ _defineProperty(Easing, "easeMap", new Map([[_Easing.LINEAR, _linear], [_Easing.EASE, _ease._], [_Easing.EASE_IN, _easeIn._], [_Easing.EASE_OUT, _easeOut._], [_Easing.EASE_IN_OUT, _easeInOut._], [_Easing.STEP_START, _stepStart], [_Easing.STEP_END, _stepEnd]]));
119
+ export { Easing };
@@ -1,15 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.EventListener = void 0;
7
- var _$Dom = require("./$Dom.js");
8
- var _SearchUtil = require("./SearchUtil.js");
9
- var _TUtil = require("./TUtil.js");
10
- var _TargetData = require("./TargetData.js");
11
- var _TargetExecutor = require("./TargetExecutor.js");
12
- var _App = require("./App.js");
13
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
14
2
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
15
3
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -24,14 +12,21 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
24
12
  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; }
25
13
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
26
14
  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); }
15
+ import { $Dom } from "./$Dom.js";
16
+ import { SearchUtil } from "./SearchUtil.js";
17
+ import { TUtil } from "./TUtil.js";
18
+ import { TargetData } from "./TargetData.js";
19
+ import { TargetExecutor } from "./TargetExecutor.js";
20
+ import { tApp, getRunScheduler, getManager, tRoot, getLocationManager } from "./App.js";
21
+
27
22
  /**
28
23
  * It provides a central place to manage all events.
29
24
  */
30
- var EventListener = exports.EventListener = /*#__PURE__*/function () {
25
+ var EventListener = /*#__PURE__*/function () {
31
26
  function EventListener() {
32
27
  var _this = this;
33
28
  _classCallCheck(this, EventListener);
34
- this.$document = new _$Dom.$Dom(document);
29
+ this.$document = new $Dom(document);
35
30
  this.currentTouch = {
36
31
  deltaY: 0,
37
32
  deltaX: 0,
@@ -91,7 +86,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
91
86
  };
92
87
  this.windowEpoch = 0;
93
88
  this.eventEpoch = 0;
94
- Object.values(_TargetData.TargetData.events).forEach(function (group) {
89
+ Object.values(TargetData.events).forEach(function (group) {
95
90
  Object.assign(_this.allEvents, group);
96
91
  });
97
92
  this.hovered = new Set();
@@ -103,23 +98,23 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
103
98
  key: "detachWindowEvents",
104
99
  value: function detachWindowEvents() {
105
100
  var _this2 = this;
106
- Object.keys(_TargetData.TargetData.events.windowEvents).forEach(function (key) {
107
- _App.tApp.$window.detachEvent(key, _this2.bindedHandleWindowEvent);
101
+ Object.keys(TargetData.events.windowEvents).forEach(function (key) {
102
+ tApp.$window.detachEvent(key, _this2.bindedHandleWindowEvent);
108
103
  });
109
104
  }
110
105
  }, {
111
106
  key: "attachWindowEvents",
112
107
  value: function attachWindowEvents() {
113
108
  var _this3 = this;
114
- Object.keys(_TargetData.TargetData.events.windowEvents).forEach(function (key) {
115
- _App.tApp.$window.addEvent(key, _this3.bindedHandleWindowEvent);
109
+ Object.keys(TargetData.events.windowEvents).forEach(function (key) {
110
+ tApp.$window.addEvent(key, _this3.bindedHandleWindowEvent);
116
111
  });
117
112
  }
118
113
  }, {
119
114
  key: "detachDocumentEvents",
120
115
  value: function detachDocumentEvents(groupName) {
121
116
  var _this4 = this;
122
- var group = _TargetData.TargetData.events[groupName];
117
+ var group = TargetData.events[groupName];
123
118
  Object.keys(group).forEach(function (type) {
124
119
  var spec = group[type];
125
120
  _this4.$document.detachEvent(type, _this4.bindedParentHandleEvent, spec.capture);
@@ -129,7 +124,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
129
124
  key: "attachDocumentEvents",
130
125
  value: function attachDocumentEvents(groupName) {
131
126
  var _this5 = this;
132
- var group = _TargetData.TargetData.events[groupName];
127
+ var group = TargetData.events[groupName];
133
128
  Object.keys(group).forEach(function (type) {
134
129
  var spec = group[type];
135
130
  _this5.$document.addEvent(type, _this5.bindedParentHandleEvent, spec.capture, spec.passive);
@@ -171,12 +166,12 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
171
166
  value: function attachTargetEvents(tmodel, targetName, force) {
172
167
  var _this6 = this;
173
168
  var targetKey = "".concat(tmodel.oid, " ").concat(targetName);
174
- var events = _TargetData.TargetData.targetToEventsMapping[targetName];
169
+ var events = TargetData.targetToEventsMapping[targetName];
175
170
  if (!events || !Array.isArray(events) || events.length === 0) {
176
171
  return undefined;
177
172
  }
178
173
  events.forEach(function (eventName) {
179
- var eventMap = _TargetData.TargetData.events[eventName];
174
+ var eventMap = TargetData.events[eventName];
180
175
  if (!eventMap) {
181
176
  return undefined;
182
177
  }
@@ -187,7 +182,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
187
182
  }
188
183
  var eventSpec = eventMap[key];
189
184
  var isWindow = !!eventSpec.windowEvent;
190
- var $dom = isWindow ? _App.tApp.$window : tmodel.hasDom() ? tmodel.$dom : null;
185
+ var $dom = isWindow ? tApp.$window : tmodel.hasDom() ? tmodel.$dom : null;
191
186
  if (!$dom) {
192
187
  return false;
193
188
  }
@@ -228,7 +223,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
228
223
  key: "resetEventsOnTimeout",
229
224
  value: function resetEventsOnTimeout() {
230
225
  if (this.scrollEndTimeStamp.x > 0 || this.scrollEndTimeStamp.y > 0 || this.currentTouch.pinchDelta) {
231
- var now = _TUtil.TUtil.now();
226
+ var now = TUtil.now();
232
227
  var diff = Math.max(this.scrollEndTimeStamp.x - now, this.scrollEndTimeStamp.y - now);
233
228
  if (diff > 100) {
234
229
  this.currentTouch.deltaY *= 0.95;
@@ -257,7 +252,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
257
252
  this.queueScrollEndEvent('y', this.currentHandlers.scrollTop);
258
253
  this.scrollEndTimeStamp.y = 0;
259
254
  }
260
- (0, _App.getRunScheduler)().schedule(10, 'scroll decay');
255
+ getRunScheduler().schedule(10, 'scroll decay');
261
256
  }
262
257
  }
263
258
  }, {
@@ -267,14 +262,14 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
267
262
  eventType = _ref.eventType;
268
263
  var clickHandler, swipeHandler, scrollLeftHandler, scrollTopHandler, pinchHandler, focusHandler, enterHandler, leaveHandler;
269
264
  if (tmodel) {
270
- clickHandler = _SearchUtil.SearchUtil.findFirstClickHandler(tmodel);
271
- swipeHandler = _SearchUtil.SearchUtil.findFirstSwipeHandler(tmodel);
272
- enterHandler = _SearchUtil.SearchUtil.findFirstEnterHandler(tmodel);
273
- leaveHandler = _SearchUtil.SearchUtil.findFirstLeaveHandler(tmodel);
274
- scrollLeftHandler = _SearchUtil.SearchUtil.findFirstScrollLeftHandler(tmodel, eventType);
275
- scrollTopHandler = _SearchUtil.SearchUtil.findFirstScrollTopHandler(tmodel, eventType);
276
- pinchHandler = _SearchUtil.SearchUtil.findFirstPinchHandler(tmodel);
277
- focusHandler = _$Dom.$Dom.hasFocus(tmodel) ? tmodel : this.currentHandlers.focus;
265
+ clickHandler = SearchUtil.findFirstClickHandler(tmodel);
266
+ swipeHandler = SearchUtil.findFirstSwipeHandler(tmodel);
267
+ enterHandler = SearchUtil.findFirstEnterHandler(tmodel);
268
+ leaveHandler = SearchUtil.findFirstLeaveHandler(tmodel);
269
+ scrollLeftHandler = SearchUtil.findFirstScrollLeftHandler(tmodel, eventType);
270
+ scrollTopHandler = SearchUtil.findFirstScrollTopHandler(tmodel, eventType);
271
+ pinchHandler = SearchUtil.findFirstPinchHandler(tmodel);
272
+ focusHandler = $Dom.hasFocus(tmodel) ? tmodel : this.currentHandlers.focus;
278
273
  }
279
274
  if (this.currentHandlers.scrollLeft !== scrollLeftHandler || this.currentHandlers.scrollTop !== scrollTopHandler) {
280
275
  this.clearTouch();
@@ -353,7 +348,8 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
353
348
  _this$currentHandlers5,
354
349
  _this$currentHandlers7,
355
350
  _this$currentHandlers8,
356
- _this7 = this;
351
+ _this7 = this,
352
+ _tmodel3;
357
353
  if (!event) {
358
354
  return;
359
355
  }
@@ -368,7 +364,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
368
364
  eventOrder = eventItem.order,
369
365
  queue = eventItem.queue,
370
366
  rateLimit = eventItem.rateLimit;
371
- var now = _TUtil.TUtil.now();
367
+ var now = TUtil.now();
372
368
  var tmodel;
373
369
  if (eventType === 'move' && this.touchCount > 0 && this.currentHandlers.start) {
374
370
  tmodel = this.currentHandlers.start;
@@ -483,7 +479,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
483
479
  event.preventDefault();
484
480
  }
485
481
  this.end0 = this.getTouch(event);
486
- var clickHandler = _SearchUtil.SearchUtil.findFirstClickHandler(tmodel);
482
+ var clickHandler = SearchUtil.findFirstClickHandler(tmodel);
487
483
  var canAcceptClick = !this.start0 || clickHandler === this.currentHandlers.click && (clickHandler !== this.currentHandlers.swipe || this.getSwipeDistance() < 5);
488
484
  if (clickHandler && canAcceptClick) {
489
485
  clickHandler.markEventDirty();
@@ -546,7 +542,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
546
542
  case 'resize':
547
543
  this.windowEpoch++;
548
544
  this.resizeRoot();
549
- (0, _App.getManager)().getAvailableDoms().forEach(function (t) {
545
+ getManager().getAvailableDoms().forEach(function (t) {
550
546
  if (t.targets['onResize']) {
551
547
  t.markLayoutDirty('resize-event');
552
548
  }
@@ -558,26 +554,20 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
558
554
  _this7.queueWindowScrollEndEvent('x', tmodel);
559
555
  _this7.queueWindowScrollEndEvent('y', tmodel);
560
556
  _this7.windowScrollEndTimer = 0;
561
- }, 120);
557
+ }, 450);
562
558
  if (isWindowEvent) {
563
559
  this.windowEpoch++;
564
560
  this.windowScrollX = window.scrollX | 0;
565
561
  this.windowScrollY = window.scrollY | 0;
566
- (0, _App.getLocationManager)().domIslandSet.forEach(function (t) {
562
+ getLocationManager().domIslandSet.forEach(function (t) {
567
563
  t.markLayoutDirty('window-scroll-event');
568
564
  });
569
565
  } else {
570
566
  tmodel.markLayoutDirty('container-scroll-event');
571
- clearTimeout(tmodel.scrollEndTimer);
572
- tmodel.scrollEndTimer = setTimeout(function () {
573
- _this7.queueWindowScrollEndEvent('x', tmodel, 'container');
574
- _this7.queueWindowScrollEndEvent('y', tmodel, 'container');
575
- tmodel.scrollEndTimer = 0;
576
- }, 120);
577
567
  }
578
568
  break;
579
569
  }
580
- (0, _App.getRunScheduler)().schedule(0, "".concat(originalName, "-").concat(eventName, "-").concat((event.target.tagName || '').toUpperCase()));
570
+ getRunScheduler().schedule(0, "".concat((_tmodel3 = tmodel) === null || _tmodel3 === void 0 ? void 0 : _tmodel3.oid, "-").concat(originalName, "-").concat(eventName, "-").concat((event.target.tagName || '').toUpperCase()));
581
571
  }
582
572
  }, {
583
573
  key: "queueScrollEndEvent",
@@ -593,13 +583,13 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
593
583
  originalName: eventType,
594
584
  tmodel: handler,
595
585
  originalEvent: undefined,
596
- timeStamp: _TUtil.TUtil.now(),
586
+ timeStamp: TUtil.now(),
597
587
  synthetic: true
598
588
  });
599
589
  this.eventEpoch++;
600
590
  handler.markEventDirty();
601
591
  handler.markLayoutDirty(eventType);
602
- (0, _App.getRunScheduler)().schedule(0, eventType);
592
+ getRunScheduler().schedule(0, eventType);
603
593
  }
604
594
  }, {
605
595
  key: "queueWindowScrollEndEvent",
@@ -613,16 +603,16 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
613
603
  originalName: eventType,
614
604
  tmodel: tmodel,
615
605
  originalEvent: undefined,
616
- timeStamp: _TUtil.TUtil.now(),
606
+ timeStamp: TUtil.now(),
617
607
  synthetic: true,
618
608
  scrollSource: scrollSource
619
609
  });
620
610
  this.eventEpoch++;
621
- (0, _App.getLocationManager)().domIslandSet.forEach(function (t) {
611
+ getLocationManager().domIslandSet.forEach(function (t) {
622
612
  t.markEventDirty();
623
613
  t.markLayoutDirty(eventType);
624
614
  });
625
- (0, _App.getRunScheduler)().schedule(0, eventType);
615
+ getRunScheduler().schedule(0, eventType);
626
616
  }
627
617
  }, {
628
618
  key: "removeScrollEndEvents",
@@ -635,8 +625,8 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
635
625
  }, {
636
626
  key: "resizeRoot",
637
627
  value: function resizeRoot() {
638
- _TargetExecutor.TargetExecutor.executeDeclarativeTarget((0, _App.tRoot)(), 'screenWidth');
639
- _TargetExecutor.TargetExecutor.executeDeclarativeTarget((0, _App.tRoot)(), 'screenHeight');
628
+ TargetExecutor.executeDeclarativeTarget(tRoot(), 'screenWidth');
629
+ TargetExecutor.executeDeclarativeTarget(tRoot(), 'screenHeight');
640
630
  }
641
631
  }, {
642
632
  key: "preventDefault",
@@ -654,13 +644,13 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
654
644
  if (el && el.nodeType === 1) {
655
645
  oid = el.getAttribute('tgjs-oid') || el.id;
656
646
  }
657
- if (!oid || !_App.tApp.manager.visibleOidMap[oid]) {
647
+ if (!oid || !tApp.manager.visibleOidMap[oid]) {
658
648
  oid = el === null || el === void 0 ? void 0 : el.id;
659
- if (!oid || !(0, _App.getManager)().visibleOidMap[oid]) {
660
- oid = _$Dom.$Dom.findNearestParentWithId(event.target);
649
+ if (!oid || !getManager().visibleOidMap[oid]) {
650
+ oid = $Dom.findNearestParentWithId(event.target);
661
651
  }
662
652
  }
663
- return (0, _App.getManager)().visibleOidMap[oid];
653
+ return getManager().visibleOidMap[oid];
664
654
  }
665
655
  }, {
666
656
  key: "clearStart",
@@ -744,7 +734,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
744
734
  key: "getSwipeDistance",
745
735
  value: function getSwipeDistance() {
746
736
  if (this.start0 && this.end0) {
747
- return _TUtil.TUtil.distance(this.start0.originalX, this.start0.originalY, this.end0.x, this.end0.y);
737
+ return TUtil.distance(this.start0.originalX, this.start0.originalY, this.end0.x, this.end0.y);
748
738
  }
749
739
  return 0;
750
740
  }
@@ -988,15 +978,15 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
988
978
  var _event$touches2, _event$originalEvent2;
989
979
  var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
990
980
  var e = ((_event$touches2 = event.touches) === null || _event$touches2 === void 0 ? void 0 : _event$touches2[index]) || ((_event$originalEvent2 = event.originalEvent) === null || _event$originalEvent2 === void 0 || (_event$originalEvent2 = _event$originalEvent2.touches) === null || _event$originalEvent2 === void 0 ? void 0 : _event$originalEvent2[index]) || event;
991
- var x = _TUtil.TUtil.isDefined(e.clientX) ? e.clientX : e.pageX || 0;
992
- var y = _TUtil.TUtil.isDefined(e.clientY) ? e.clientY : e.pageY || 0;
981
+ var x = TUtil.isDefined(e.clientX) ? e.clientX : e.pageX || 0;
982
+ var y = TUtil.isDefined(e.clientY) ? e.clientY : e.pageY || 0;
993
983
  return {
994
984
  x: x,
995
985
  y: y,
996
986
  originalX: x,
997
987
  originalY: y,
998
988
  target: e.target,
999
- timeStamp: _TUtil.TUtil.now()
989
+ timeStamp: TUtil.now()
1000
990
  };
1001
991
  }
1002
992
  }, {
@@ -1006,7 +996,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
1006
996
  this.start0.y = this.end0 ? this.end0.y : this.start0.y;
1007
997
  this.start0.x = this.end0 ? this.end0.x : this.start0.x;
1008
998
  this.end0 = this.getTouch(event);
1009
- if (_TUtil.TUtil.isDefined(this.end0)) {
999
+ if (TUtil.isDefined(this.end0)) {
1010
1000
  var deltaX = this.start0.x - this.end0.x;
1011
1001
  var deltaY = this.start0.y - this.end0.y;
1012
1002
  this.setDeltaXDeltaY(deltaX, deltaY, 'touch');
@@ -1014,8 +1004,8 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
1014
1004
  } else if (this.touchCount >= 2) {
1015
1005
  this.end0 = this.getTouch(event);
1016
1006
  this.end1 = this.getTouch(event, 1);
1017
- var length1 = _TUtil.TUtil.distance(this.start0.x, this.start0.y, this.start1.x, this.start1.y);
1018
- var length2 = _TUtil.TUtil.distance(this.end0.x, this.end0.y, this.end1.x, this.end1.y);
1007
+ var length1 = TUtil.distance(this.start0.x, this.start0.y, this.start1.x, this.start1.y);
1008
+ var length2 = TUtil.distance(this.end0.x, this.end0.y, this.end1.x, this.end1.y);
1019
1009
  var diff = length2 - length1;
1020
1010
  this.currentTouch.pinchDelta = diff > 0 ? 0.3 : diff < 0 ? -0.3 : 0;
1021
1011
  }
@@ -1028,24 +1018,24 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
1028
1018
  deltaY = 0,
1029
1019
  period = 0,
1030
1020
  startPeriod = 0;
1031
- if (_TUtil.TUtil.isDefined(this.end0)) {
1021
+ if (TUtil.isDefined(this.end0)) {
1032
1022
  deltaX = this.start0.originalX - this.end0.x;
1033
1023
  deltaY = this.start0.originalY - this.end0.y;
1034
- startPeriod = _TUtil.TUtil.now() - this.start0.timeStamp;
1035
- period = startPeriod < 250 ? _TUtil.TUtil.now() - this.start0.timeStamp : 0;
1024
+ startPeriod = TUtil.now() - this.start0.timeStamp;
1025
+ period = startPeriod < 250 ? TUtil.now() - this.start0.timeStamp : 0;
1036
1026
  }
1037
1027
  var momentum;
1038
1028
  if (this.currentTouch.orientation === 'horizontal' && Math.abs(deltaX) > 0 && period > 0) {
1039
- momentum = _TUtil.TUtil.momentum(0, deltaX, period);
1029
+ momentum = TUtil.momentum(0, deltaX, period);
1040
1030
  this.scrollEndTimeStamp.x = this.end0.timeStamp + momentum.duration;
1041
- if (this.scrollEndTimeStamp.x - _TUtil.TUtil.now() > 0) {
1031
+ if (this.scrollEndTimeStamp.x - TUtil.now() > 0) {
1042
1032
  this.currentTouch.deltaX = momentum.distance;
1043
1033
  this.currentTouch.manualMomentumFlag = true;
1044
1034
  }
1045
1035
  } else if (this.currentTouch.orientation === 'vertical' && Math.abs(deltaY) > 0 && period > 0) {
1046
- momentum = _TUtil.TUtil.momentum(0, deltaY, period);
1036
+ momentum = TUtil.momentum(0, deltaY, period);
1047
1037
  this.scrollEndTimeStamp.y = this.end0.timeStamp + momentum.duration;
1048
- if (this.scrollEndTimeStamp.y - _TUtil.TUtil.now() > 0) {
1038
+ if (this.scrollEndTimeStamp.y - TUtil.now() > 0) {
1049
1039
  this.currentTouch.deltaY = momentum.distance;
1050
1040
  this.currentTouch.manualMomentumFlag = true;
1051
1041
  }
@@ -1063,7 +1053,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
1063
1053
  } else if (this.currentTouch.orientation === 'none' || this.currentTouch.orientation === 'horizontal' && diff <= -2 || this.currentTouch.orientation === 'vertical') {
1064
1054
  this.currentTouch.orientation = 'vertical';
1065
1055
  }
1066
- var now = _TUtil.TUtil.now();
1056
+ var now = TUtil.now();
1067
1057
  var endDelay = source === 'touch' ? 0 : 500;
1068
1058
  if (this.currentTouch.orientation === 'horizontal') {
1069
1059
  this.currentTouch.dir = deltaX < 0 ? 'left' : deltaX > 0 ? 'right' : this.currentTouch.dir;
@@ -1082,7 +1072,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
1082
1072
  this.currentTouch.deltaX = this.currentTouch.prevDeltaX;
1083
1073
  this.currentTouch.deltaY = this.currentTouch.prevDeltaY;
1084
1074
  if (endDelay && (this.scrollEndTimeStamp.x > 0 || this.scrollEndTimeStamp.y > 0)) {
1085
- (0, _App.getRunScheduler)().schedule(endDelay, 'scroll-end-check');
1075
+ getRunScheduler().schedule(endDelay, 'scroll-end-check');
1086
1076
  }
1087
1077
  }
1088
1078
  }, {
@@ -1110,4 +1100,5 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
1110
1100
  }]);
1111
1101
  }();
1112
1102
  _defineProperty(EventListener, "MAX_EVENT_QUEUE_SIZE", 10);
1113
- _defineProperty(EventListener, "MAX_EVENT_TYPE_CAPACITY", 2);
1103
+ _defineProperty(EventListener, "MAX_EVENT_TYPE_CAPACITY", 2);
1104
+ export { EventListener };