targetj 1.0.239 → 1.0.241

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/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();
@@ -368,7 +363,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
368
363
  eventOrder = eventItem.order,
369
364
  queue = eventItem.queue,
370
365
  rateLimit = eventItem.rateLimit;
371
- var now = _TUtil.TUtil.now();
366
+ var now = TUtil.now();
372
367
  var tmodel;
373
368
  if (eventType === 'move' && this.touchCount > 0 && this.currentHandlers.start) {
374
369
  tmodel = this.currentHandlers.start;
@@ -483,7 +478,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
483
478
  event.preventDefault();
484
479
  }
485
480
  this.end0 = this.getTouch(event);
486
- var clickHandler = _SearchUtil.SearchUtil.findFirstClickHandler(tmodel);
481
+ var clickHandler = SearchUtil.findFirstClickHandler(tmodel);
487
482
  var canAcceptClick = !this.start0 || clickHandler === this.currentHandlers.click && (clickHandler !== this.currentHandlers.swipe || this.getSwipeDistance() < 5);
488
483
  if (clickHandler && canAcceptClick) {
489
484
  clickHandler.markEventDirty();
@@ -546,7 +541,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
546
541
  case 'resize':
547
542
  this.windowEpoch++;
548
543
  this.resizeRoot();
549
- (0, _App.getManager)().getAvailableDoms().forEach(function (t) {
544
+ getManager().getAvailableDoms().forEach(function (t) {
550
545
  if (t.targets['onResize']) {
551
546
  t.markLayoutDirty('resize-event');
552
547
  }
@@ -563,7 +558,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
563
558
  this.windowEpoch++;
564
559
  this.windowScrollX = window.scrollX | 0;
565
560
  this.windowScrollY = window.scrollY | 0;
566
- (0, _App.getLocationManager)().domIslandSet.forEach(function (t) {
561
+ getLocationManager().domIslandSet.forEach(function (t) {
567
562
  t.markLayoutDirty('window-scroll-event');
568
563
  });
569
564
  } else {
@@ -577,7 +572,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
577
572
  }
578
573
  break;
579
574
  }
580
- (0, _App.getRunScheduler)().schedule(0, "".concat(originalName, "-").concat(eventName, "-").concat((event.target.tagName || '').toUpperCase()));
575
+ getRunScheduler().schedule(0, "".concat(originalName, "-").concat(eventName, "-").concat((event.target.tagName || '').toUpperCase()));
581
576
  }
582
577
  }, {
583
578
  key: "queueScrollEndEvent",
@@ -593,13 +588,13 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
593
588
  originalName: eventType,
594
589
  tmodel: handler,
595
590
  originalEvent: undefined,
596
- timeStamp: _TUtil.TUtil.now(),
591
+ timeStamp: TUtil.now(),
597
592
  synthetic: true
598
593
  });
599
594
  this.eventEpoch++;
600
595
  handler.markEventDirty();
601
596
  handler.markLayoutDirty(eventType);
602
- (0, _App.getRunScheduler)().schedule(0, eventType);
597
+ getRunScheduler().schedule(0, eventType);
603
598
  }
604
599
  }, {
605
600
  key: "queueWindowScrollEndEvent",
@@ -613,16 +608,16 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
613
608
  originalName: eventType,
614
609
  tmodel: tmodel,
615
610
  originalEvent: undefined,
616
- timeStamp: _TUtil.TUtil.now(),
611
+ timeStamp: TUtil.now(),
617
612
  synthetic: true,
618
613
  scrollSource: scrollSource
619
614
  });
620
615
  this.eventEpoch++;
621
- (0, _App.getLocationManager)().domIslandSet.forEach(function (t) {
616
+ getLocationManager().domIslandSet.forEach(function (t) {
622
617
  t.markEventDirty();
623
618
  t.markLayoutDirty(eventType);
624
619
  });
625
- (0, _App.getRunScheduler)().schedule(0, eventType);
620
+ getRunScheduler().schedule(0, eventType);
626
621
  }
627
622
  }, {
628
623
  key: "removeScrollEndEvents",
@@ -635,8 +630,8 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
635
630
  }, {
636
631
  key: "resizeRoot",
637
632
  value: function resizeRoot() {
638
- _TargetExecutor.TargetExecutor.executeDeclarativeTarget((0, _App.tRoot)(), 'screenWidth');
639
- _TargetExecutor.TargetExecutor.executeDeclarativeTarget((0, _App.tRoot)(), 'screenHeight');
633
+ TargetExecutor.executeDeclarativeTarget(tRoot(), 'screenWidth');
634
+ TargetExecutor.executeDeclarativeTarget(tRoot(), 'screenHeight');
640
635
  }
641
636
  }, {
642
637
  key: "preventDefault",
@@ -654,13 +649,13 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
654
649
  if (el && el.nodeType === 1) {
655
650
  oid = el.getAttribute('tgjs-oid') || el.id;
656
651
  }
657
- if (!oid || !_App.tApp.manager.visibleOidMap[oid]) {
652
+ if (!oid || !tApp.manager.visibleOidMap[oid]) {
658
653
  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);
654
+ if (!oid || !getManager().visibleOidMap[oid]) {
655
+ oid = $Dom.findNearestParentWithId(event.target);
661
656
  }
662
657
  }
663
- return (0, _App.getManager)().visibleOidMap[oid];
658
+ return getManager().visibleOidMap[oid];
664
659
  }
665
660
  }, {
666
661
  key: "clearStart",
@@ -744,7 +739,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
744
739
  key: "getSwipeDistance",
745
740
  value: function getSwipeDistance() {
746
741
  if (this.start0 && this.end0) {
747
- return _TUtil.TUtil.distance(this.start0.originalX, this.start0.originalY, this.end0.x, this.end0.y);
742
+ return TUtil.distance(this.start0.originalX, this.start0.originalY, this.end0.x, this.end0.y);
748
743
  }
749
744
  return 0;
750
745
  }
@@ -988,15 +983,15 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
988
983
  var _event$touches2, _event$originalEvent2;
989
984
  var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
990
985
  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;
986
+ var x = TUtil.isDefined(e.clientX) ? e.clientX : e.pageX || 0;
987
+ var y = TUtil.isDefined(e.clientY) ? e.clientY : e.pageY || 0;
993
988
  return {
994
989
  x: x,
995
990
  y: y,
996
991
  originalX: x,
997
992
  originalY: y,
998
993
  target: e.target,
999
- timeStamp: _TUtil.TUtil.now()
994
+ timeStamp: TUtil.now()
1000
995
  };
1001
996
  }
1002
997
  }, {
@@ -1006,7 +1001,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
1006
1001
  this.start0.y = this.end0 ? this.end0.y : this.start0.y;
1007
1002
  this.start0.x = this.end0 ? this.end0.x : this.start0.x;
1008
1003
  this.end0 = this.getTouch(event);
1009
- if (_TUtil.TUtil.isDefined(this.end0)) {
1004
+ if (TUtil.isDefined(this.end0)) {
1010
1005
  var deltaX = this.start0.x - this.end0.x;
1011
1006
  var deltaY = this.start0.y - this.end0.y;
1012
1007
  this.setDeltaXDeltaY(deltaX, deltaY, 'touch');
@@ -1014,8 +1009,8 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
1014
1009
  } else if (this.touchCount >= 2) {
1015
1010
  this.end0 = this.getTouch(event);
1016
1011
  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);
1012
+ var length1 = TUtil.distance(this.start0.x, this.start0.y, this.start1.x, this.start1.y);
1013
+ var length2 = TUtil.distance(this.end0.x, this.end0.y, this.end1.x, this.end1.y);
1019
1014
  var diff = length2 - length1;
1020
1015
  this.currentTouch.pinchDelta = diff > 0 ? 0.3 : diff < 0 ? -0.3 : 0;
1021
1016
  }
@@ -1028,24 +1023,24 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
1028
1023
  deltaY = 0,
1029
1024
  period = 0,
1030
1025
  startPeriod = 0;
1031
- if (_TUtil.TUtil.isDefined(this.end0)) {
1026
+ if (TUtil.isDefined(this.end0)) {
1032
1027
  deltaX = this.start0.originalX - this.end0.x;
1033
1028
  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;
1029
+ startPeriod = TUtil.now() - this.start0.timeStamp;
1030
+ period = startPeriod < 250 ? TUtil.now() - this.start0.timeStamp : 0;
1036
1031
  }
1037
1032
  var momentum;
1038
1033
  if (this.currentTouch.orientation === 'horizontal' && Math.abs(deltaX) > 0 && period > 0) {
1039
- momentum = _TUtil.TUtil.momentum(0, deltaX, period);
1034
+ momentum = TUtil.momentum(0, deltaX, period);
1040
1035
  this.scrollEndTimeStamp.x = this.end0.timeStamp + momentum.duration;
1041
- if (this.scrollEndTimeStamp.x - _TUtil.TUtil.now() > 0) {
1036
+ if (this.scrollEndTimeStamp.x - TUtil.now() > 0) {
1042
1037
  this.currentTouch.deltaX = momentum.distance;
1043
1038
  this.currentTouch.manualMomentumFlag = true;
1044
1039
  }
1045
1040
  } else if (this.currentTouch.orientation === 'vertical' && Math.abs(deltaY) > 0 && period > 0) {
1046
- momentum = _TUtil.TUtil.momentum(0, deltaY, period);
1041
+ momentum = TUtil.momentum(0, deltaY, period);
1047
1042
  this.scrollEndTimeStamp.y = this.end0.timeStamp + momentum.duration;
1048
- if (this.scrollEndTimeStamp.y - _TUtil.TUtil.now() > 0) {
1043
+ if (this.scrollEndTimeStamp.y - TUtil.now() > 0) {
1049
1044
  this.currentTouch.deltaY = momentum.distance;
1050
1045
  this.currentTouch.manualMomentumFlag = true;
1051
1046
  }
@@ -1063,7 +1058,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
1063
1058
  } else if (this.currentTouch.orientation === 'none' || this.currentTouch.orientation === 'horizontal' && diff <= -2 || this.currentTouch.orientation === 'vertical') {
1064
1059
  this.currentTouch.orientation = 'vertical';
1065
1060
  }
1066
- var now = _TUtil.TUtil.now();
1061
+ var now = TUtil.now();
1067
1062
  var endDelay = source === 'touch' ? 0 : 500;
1068
1063
  if (this.currentTouch.orientation === 'horizontal') {
1069
1064
  this.currentTouch.dir = deltaX < 0 ? 'left' : deltaX > 0 ? 'right' : this.currentTouch.dir;
@@ -1082,7 +1077,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
1082
1077
  this.currentTouch.deltaX = this.currentTouch.prevDeltaX;
1083
1078
  this.currentTouch.deltaY = this.currentTouch.prevDeltaY;
1084
1079
  if (endDelay && (this.scrollEndTimeStamp.x > 0 || this.scrollEndTimeStamp.y > 0)) {
1085
- (0, _App.getRunScheduler)().schedule(endDelay, 'scroll-end-check');
1080
+ getRunScheduler().schedule(endDelay, 'scroll-end-check');
1086
1081
  }
1087
1082
  }
1088
1083
  }, {
@@ -1110,4 +1105,5 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
1110
1105
  }]);
1111
1106
  }();
1112
1107
  _defineProperty(EventListener, "MAX_EVENT_QUEUE_SIZE", 10);
1113
- _defineProperty(EventListener, "MAX_EVENT_TYPE_CAPACITY", 2);
1108
+ _defineProperty(EventListener, "MAX_EVENT_TYPE_CAPACITY", 2);
1109
+ export { EventListener };